@snabcentr/vue-ui-lib 2.28.2 → 2.29.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 +3 -3
- package/dist/sc-vue-ui-lib.css +1 -1
- package/dist/sc-vue-ui-lib.js +5984 -5833
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +131 -131
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/dist/src/catalog/interfaces/events/i-category-emits.d.ts +20 -7
- package/dist/src/catalog/interfaces/events/i-product-emits.d.ts +10 -1
- package/dist/src/catalog/interfaces/properties/i-catalog-properties.d.ts +12 -13
- package/dist/src/catalog/interfaces/properties/i-catalogable-item-properties.d.ts +12 -3
- package/dist/src/catalog/interfaces/properties/i-product-actions-properties.d.ts +7 -2
- package/dist/src/components/catalog/category-collapse-item.vue.d.ts +9 -10
- package/dist/src/components/catalog/category-collapse.vue.d.ts +3 -7
- package/dist/src/components/catalog/product-details/product-actions.vue.d.ts +7 -40
- package/dist/src/components/catalog/product-details/product-name.vue.d.ts +3 -2
- package/dist/src/types/button-state.d.ts +8 -0
- package/dist/src/types/index.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(L,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","vue-tel-input"],D):(L=typeof globalThis<"u"?globalThis:L||self,D(L.SC_VueUiLib={},L["lodash-es"],L.Vue,L["naive-ui"],L["@snabcentr/common-lib"],L["date-fns"],L["libphonenumber-js"],L["vue-tel-input"]))})(this,function(L,D,i,A,U,Rn,Xi,Wh){"use strict";var Dk=Object.defineProperty;var Lh=L=>{throw TypeError(L)};var Hk=(L,D,i)=>D in L?Dk(L,D,{enumerable:!0,configurable:!0,writable:!0,value:i}):L[D]=i;var C=(L,D,i)=>Hk(L,typeof D!="symbol"?D+"":D,i),Dh=(L,D,i)=>D.has(L)||Lh("Cannot "+i);var Et=(L,D,i)=>(Dh(L,D,"read from private field"),i?i.call(L):D.get(L)),pa=(L,D,i)=>D.has(L)?Lh("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(L):D.set(L,i),Hh=(L,D,i,A)=>(Dh(L,D,"write to private field"),A?A.call(L,i):D.set(L,i),i);var yi,ct,Ss;var Ge=(e=>(e.AttachedUser="attached_user",e.ClientInfo="client_info",e.CreatedAt="created_at",e.DeliveryInfo="delivery_info",e.Id="id",e.SalesDirections="sales_directions",e.Status="status",e))(Ge||{}),Xe=(e=>(e.phone="phone",e.tablet="tablet",e.laptop="laptop",e))(Xe||{});class Wn{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&D.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Wn.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!Wn.isVnodeEmpty(t()):!1}}class Lt{static convertReferencesToOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){const a=r?[{label:"",value:-1,disabled:!0}]:[];let l=t.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:o?o(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),[...a,...l]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Lt.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Lt.convertReferencesToOptionsList(t,n,r,s,o)}}const jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xh(e,t){return i.openBlock(),i.createElementBlock("svg",jh,[...t[0]||(t[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const ga=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Xh}),qh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Yh(e,t){return i.openBlock(),i.createElementBlock("svg",qh,[...t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const ma=i.markRaw({name:"tabler-edit",render:Yh}),Uh={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Gh(e,t){return i.openBlock(),i.createElementBlock("svg",Uh,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const Kh=i.markRaw({name:"fluent-pin32-regular",render:Gh}),Zh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jh(e,t){return i.openBlock(),i.createElementBlock("svg",Zh,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const Qh=i.markRaw({name:"ion-eye-outline",render:Jh}),eu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function tu(e,t){return i.openBlock(),i.createElementBlock("svg",eu,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M15.744 4.276c1.221-2.442 4.476-2.97 6.406-1.04l6.614 6.614c1.93 1.93 1.402 5.186-1.04 6.406l-6.35 3.176a1.5 1.5 0 0 0-.753.867l-1.66 4.983a2 2 0 0 1-3.312.782l-4.149-4.15l-6.086 6.087H4v-1.415l6.086-6.085l-4.149-4.15a2 2 0 0 1 .782-3.31l4.982-1.662a1.5 1.5 0 0 0 .868-.752z"},null,-1)])])}const nu=i.markRaw({name:"fluent-pin32-filled",render:tu}),iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ru(e,t){return i.openBlock(),i.createElementBlock("svg",iu,[...t[0]||(t[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const _a=i.markRaw({name:"ion-cart-outline",render:ru}),su={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ou(e,t){return i.openBlock(),i.createElementBlock("svg",su,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const au=i.markRaw({name:"ion-bookmark-outline",render:ou}),lu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cu(e,t){return i.openBlock(),i.createElementBlock("svg",lu,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const du=i.markRaw({name:"ion-eye-off-sharp",render:cu}),hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function uu(e,t){return i.openBlock(),i.createElementBlock("svg",hu,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const fu=i.markRaw({name:"ion-chevron-forward-outline",render:uu}),pu=["data-name"],gu={class:"sc-collapse-item-header flex flex-row gap-2.5"},mu={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},_u={key:0},yu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},bu={class:"flex flex-1 flex-col"},wu={key:0,class:"sc-collapse-item-sub-title flex-1"},vu={key:1,class:"sc-collapse-item-title-extra flex-none"},ku={key:0,class:"sc-collapse-item-content"},xu={},Cu=i.defineComponent({...xu,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.inject("itemHeaderClickHandler",D.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=D.some(a,m=>m===r.name),d=i.computed(()=>D.some(l,m=>m===r.name)),h=i.ref(c),f=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return t({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||f()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(m,_)=>{const y=fu;return i.openBlock(),i.createElementBlock("div",{"data-name":m.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":m.disabled})},[i.createElementVNode("div",gu,[i.createElementVNode("div",mu,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:f},[i.renderSlot(m.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(Wn).hasSlotContent(m.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",_u,[i.createElementVNode("div",yu,[i.renderSlot(m.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",bu,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[i.renderSlot(m.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(m.title),1)],!0)]),i.unref(Wn).hasSlotContent(m.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",wu,[i.renderSlot(m.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Wn).hasSlotContent(m.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",vu,[i.renderSlot(m.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",ku,[i.renderSlot(m.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,pu)}}}),jn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},ya=jn(Cu,[["__scopeId","data-v-415a3dda"]]),xr=Symbol(),Su={Button:{border:"1px solid grey"},Card:{paddingMedium:"1rem"},Checkbox:{border:"1px solid rgb(12, 88, 32)"},Common:{borderRadius:"0.5rem",borderRadiusSmall:"0.25rem",fontWeight:"500",fontWeightStrong:"600",fontSize:"0.75rem",fontSizeMedium:"0.75rem",fontSizeLarge:"0.8125rem",lineHeight:"1.25rem",heightSmall:"24px",heightMedium:"30px",heightTiny:"20px",heightLarge:"36px",heightHuge:"42px",primaryColor:"#FFCC40FF",primaryColorHover:"#FFE49BFF",primaryColorPressed:"#FFBB00FF",primaryColorSuppl:"#FCC42AFF",successColor:"#4AC99BFF",successColorHover:"#4AC99BBF",successColorPressed:"#21AA78FF",errorColor:"#F45725FF",errorColorHover:"#F4572599",textColorBase:"#191C30E5",textColorDisabled:"#191C30E5"},DataTable:{borderColor:"rgb(207, 207, 207)",lineHeight:1.4,tdColorHover:"rgb(250,250,250)",thColor:"rgb(231, 231, 231)",thFontWeight:400,thPaddingMedium:"8px",tdPaddingMedium:"8px",thTextColor:"rgb(22, 0, 108)"},Drawer:{closeIconColor:"rgba(31, 34, 37, 1)",closeIconColorHover:"rgba(10, 157, 5, 1)"},Form:{marginBottom:0,lineHeight:1,labelFontSizeTopMedium:"0.75rem",labelHeightMedium:"20px",labelFontWeight:500,labelTextColor:"rgba(27, 31, 59, 0.65)",labelPaddingVertical:"0",labelPaddingHorizontal:"0"},Input:{paddingMedium:"0.5rem",fontSizeMedium:"0.9125rem",lineHeight:"1.25rem",lineHeightTextarea:"1.25rem",border:"1px solid #E0E0E0",borderRadius:"0.5rem",iconSize:"1,125rem"},Tabs:{tabFontSizeMedium:"0.9375rem",tabColorSegment:"#FFCC40FF",tabBorderColor:"#CCCCCCFF"}},Bu={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Tu={},ba=i.defineComponent({...Tu,__name:"product-actions",props:{product:{},eventEmitter:{},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>D.isNil(t.productContextButtonsConfig)?[]:D.isFunction(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),s=()=>{t.eventEmitter.emit("product:add-to-cart",{product:t.product})},o=()=>{t.eventEmitter.emit("product:edit",{product:t.product})},a=l=>{t.eventEmitter.emit("product:context-select",{product:t.product,key:l})};return(l,c)=>{var m;const d=_a,h=A.NButton,f=A.NTooltip,p=ma,u=ga,g=A.NDropdown;return i.openBlock(),i.createElementBlock("div",Bu,[(i.unref(D.isFunction)(l.showProductAddToCartButton)?l.showProductAddToCartButton(l.product):l.showProductAddToCartButton)?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:s},{default:i.withCtx(()=>[i.createVNode(d)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[0]||(c[0]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),(i.unref(D.isFunction)(l.showProductEditButton)?l.showProductEditButton(l.product):l.showProductEditButton)?(i.openBlock(),i.createBlock(f,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary",onClick:o},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["size"])]),default:i.withCtx(()=>[c[1]||(c[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),((m=r.value)==null?void 0:m.length)>0?(i.openBlock(),i.createBlock(g,{key:2,options:r.value,size:i.unref(n),trigger:"click",onSelect:a},{default:i.withCtx(()=>[i.createVNode(h,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Eu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $u(e,t){return i.openBlock(),i.createElementBlock("svg",Eu,[...t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Ru=i.markRaw({name:"tabler-history",render:$u}),Nu={class:"flex flex-row gap-1"},Pu={key:0,class:"flex flex-row text-nowrap text-sm line-through"},Fu={key:1,class:"flex flex-row text-nowrap text-sm"},Mu={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Au={},Cr=i.defineComponent({...Au,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(e){const t=e,n=i.computed(()=>D.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:D.get(t.product,t.costFieldName)),s=i.computed(()=>t.additionalThroughFieldName?D.get(t.product,t.additionalThroughFieldName):void 0),o=i.computed(()=>t.product.costDate?Rn.format(t.product.costDate,U.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(D.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!D.isNil(r.value)),l=i.computed(()=>D.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(t.product.currencySignature==="RUB"||!t.currencyRates||!t.currencyRates[t.product.currencySignature])return null;const h=t.currencyRates[t.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>D.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,f)=>{var m;const p=A.NTag,u=A.NTooltip,g=Ru;return i.openBlock(),i.createElementBlock("div",Nu,[h.showTag?(i.openBlock(),i.createBlock(u,{key:0},{trigger:i.withCtx(()=>[i.createVNode(p,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var _;return[i.createTextVNode(i.toDisplayString(((_=n.value)==null?void 0:_.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var _;return[i.createTextVNode(" "+i.toDisplayString(((_=n.value)==null?void 0:_.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Pu,i.toDisplayString(d.value)+" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(m=n.value)==null?void 0:m.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&h.eventEmitter}),onClick:f[0]||(f[0]=()=>{var _;a.value&&((_=h.eventEmitter)==null||_.emit("cost:click",{product:h.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",Fu," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(h.showQuantityUnit?`₽/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),h.showCostDate&&!i.unref(D.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Mu,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),h.showPriceHistory&&h.eventEmitter?(i.openBlock(),i.createBlock(u,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:f[1]||(f[1]=_=>{var y;return(y=h.eventEmitter)==null?void 0:y.emit("cost:show-price-history",{product:h.product})})})]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Vu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Iu(e,t){return i.openBlock(),i.createElementBlock("svg",Vu,[...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 Es=i.markRaw({name:"ion-information-circle-outline",render:Iu}),Ou={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function zu(e,t){return i.openBlock(),i.createElementBlock("svg",Ou,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const wa=i.markRaw({name:"ion-images",render:zu});/*!
|
|
1
|
+
(function(H,D){typeof exports=="object"&&typeof module<"u"?D(exports,require("lodash-es"),require("vue"),require("naive-ui"),require("@snabcentr/common-lib"),require("date-fns"),require("libphonenumber-js"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","lodash-es","vue","naive-ui","@snabcentr/common-lib","date-fns","libphonenumber-js","vue-tel-input"],D):(H=typeof globalThis<"u"?globalThis:H||self,D(H.SC_VueUiLib={},H["lodash-es"],H.Vue,H["naive-ui"],H["@snabcentr/common-lib"],H["date-fns"],H["libphonenumber-js"],H["vue-tel-input"]))})(this,function(H,D,i,I,Y,$n,qi,qh){"use strict";var Yk=Object.defineProperty;var Hh=H=>{throw TypeError(H)};var Uk=(H,D,i)=>D in H?Yk(H,D,{enumerable:!0,configurable:!0,writable:!0,value:i}):H[D]=i;var C=(H,D,i)=>Uk(H,typeof D!="symbol"?D+"":D,i),Wh=(H,D,i)=>D.has(H)||Hh("Cannot "+i);var Rt=(H,D,i)=>(Wh(H,D,"read from private field"),i?i.call(H):D.get(H)),pa=(H,D,i)=>D.has(H)?Hh("Cannot add the same private member more than once"):D instanceof WeakSet?D.add(H):D.set(H,i),jh=(H,D,i,I)=>(Wh(H,D,"write to private field"),I?I.call(H,i):D.set(H,i),i);var _i,at,Ss;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||{}),qe=(e=>(e.phone="phone",e.tablet="tablet",e.laptop="laptop",e))(qe||{});class Wn{static isVnodeEmpty(t){return t.every(n=>n.type===i.Comment||n.type===i.Text&&D.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&Wn.isVnodeEmpty(n.children))}static hasSlotContent(t){return t?!Wn.isVnodeEmpty(t()):!1}}class Dt{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 Dt.convertReferencesToOptionsList(t,n,r,s,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,s=void 0,o=void 0){return Dt.convertReferencesToOptionsList(t,n,r,s,o)}}const Xh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Yh(e,t){return i.openBlock(),i.createElementBlock("svg",Xh,[...t[0]||(t[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const ga=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Yh}),Uh={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Gh(e,t){return i.openBlock(),i.createElementBlock("svg",Uh,[...t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const ma=i.markRaw({name:"tabler-edit",render:Gh}),Kh={viewBox:"0 0 512 512",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:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const ya=i.markRaw({name:"ion-checkmark-done-circle",render:Zh}),Jh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Qh(e,t){return i.openBlock(),i.createElementBlock("svg",Jh,[...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:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const _a=i.markRaw({name:"ion-checkmark-done-circle-outline",render:Qh}),eu={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function tu(e,t){return i.openBlock(),i.createElementBlock("svg",eu,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"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 nu=i.markRaw({name:"fluent-pin32-regular",render:tu}),iu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ru(e,t){return i.openBlock(),i.createElementBlock("svg",iu,[...t[0]||(t[0]=[i.createElementVNode("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 su=i.markRaw({name:"ion-eye-outline",render:ru}),ou={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function au(e,t){return i.openBlock(),i.createElementBlock("svg",ou,[...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 lu=i.markRaw({name:"fluent-pin32-filled",render:au}),cu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function du(e,t){return i.openBlock(),i.createElementBlock("svg",cu,[...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 ba=i.markRaw({name:"ion-cart-outline",render:du}),hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function uu(e,t){return i.openBlock(),i.createElementBlock("svg",hu,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const fu=i.markRaw({name:"ion-bookmark-outline",render:uu}),pu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gu(e,t){return i.openBlock(),i.createElementBlock("svg",pu,[...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 mu=i.markRaw({name:"ion-eye-off-sharp",render:gu}),yu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _u(e,t){return i.openBlock(),i.createElementBlock("svg",yu,[...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 bu=i.markRaw({name:"ion-chevron-forward-outline",render:_u}),wu=["data-name"],vu={class:"sc-collapse-item-header flex flex-row gap-2.5"},ku={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},xu={key:0},Cu={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Su={class:"flex flex-1 flex-col"},Bu={key:0,class:"sc-collapse-item-sub-title flex-1"},Tu={key:1,class:"sc-collapse-item-title-extra flex-none"},Eu={key:0,class:"sc-collapse-item-content"},Ru={},$u=i.defineComponent({...Ru,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.inject("itemHeaderClickHandler",D.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=D.some(a,m=>m===r.name),d=i.computed(()=>D.some(l,m=>m===r.name)),h=i.ref(c),u=()=>{r.disabled||(h.value=d.value||!h.value,s("header:click",r.name,h.value),o(r.name,h.value))};return t({expand:()=>{!r.disabled&&!h.value&&(h.value=!0,s("header:click",r.name,h.value),o(r.name,h.value))},toggle:()=>{r.disabled||u()},collapse:()=>{!r.disabled&&h.value&&!d.value&&(h.value=!1,s("header:click",r.name,h.value),o(r.name,h.value))},expanded:i.readonly(h)}),(m,y)=>{const _=bu;return i.openBlock(),i.createElementBlock("div",{"data-name":m.name,class:i.normalizeClass({"sc-collapse-item flex flex-col p-2":!0,"cursor-not-allowed text-gray-400":m.disabled})},[i.createElementVNode("div",vu,[i.createElementVNode("div",ku,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":h.value}),onClick:u},[i.renderSlot(m.$slots,"arrow",{},()=>[i.createVNode(_)],!0)],2)]),i.unref(Wn).hasSlotContent(m.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",xu,[i.createElementVNode("div",Cu,[i.renderSlot(m.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Su,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:u},[i.renderSlot(m.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(m.title),1)],!0)]),i.unref(Wn).hasSlotContent(m.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Bu,[i.renderSlot(m.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(Wn).hasSlotContent(m.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Tu,[i.renderSlot(m.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||h.value?(i.openBlock(),i.createElementBlock("div",Eu,[i.renderSlot(m.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,wu)}}}),jn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,s]of t)n[r]=s;return n},wa=jn($u,[["__scopeId","data-v-415a3dda"]]),xr=Symbol(),Nu={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"}},Pu={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Fu={},va=i.defineComponent({...Fu,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>D.isFunction(t.showProductAddToCartButton)?t.showProductAddToCartButton(t.product):t.showProductAddToCartButton),s=i.computed(()=>D.isFunction(t.showProductEditButton)?t.showProductEditButton(t.product):t.showProductEditButton),o=i.computed(()=>D.isFunction(t.showProductRequiredButton)?t.showProductRequiredButton(t.product):t.showProductRequiredButton),a=i.computed(()=>D.isNil(t.productContextButtonsConfig)?[]:D.isFunction(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),l=()=>{t.eventEmitter.emit("product:add-to-cart",{product:t.product})},c=()=>{t.eventEmitter.emit("product:edit",{product:t.product})},d=()=>{t.eventEmitter.emit("product:required",{product:t.product})},h=u=>{t.eventEmitter.emit("product:context-select",{product:t.product,key:u})};return(u,p)=>{var v;const f=_a,g=ya,m=I.NButton,y=I.NTooltip,_=ma,b=ba,S=ga,x=I.NDropdown;return i.openBlock(),i.createElementBlock("div",Pu,[o.value?(i.openBlock(),i.createBlock(y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(m,{ghost:!0,size:i.unref(n),disabled:o.value==="disabled",type:u.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[u.product.isRequired?(i.openBlock(),i.createBlock(g,{key:1})):(i.openBlock(),i.createBlock(f,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[u.product.isRequired?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Убрать из списка дополнительных продаж")],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Добавить в список дополнительных продаж")],64))]),_:1})):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createBlock(y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(m,{ghost:!0,size:i.unref(n),type:"primary",disabled:s.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[p[0]||(p[0]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(m,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[p[1]||(p[1]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((v=a.value)==null?void 0:v.length)>0?(i.openBlock(),i.createBlock(x,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:h},{default:i.withCtx(()=>[i.createVNode(m,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(S)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Mu={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Au(e,t){return i.openBlock(),i.createElementBlock("svg",Mu,[...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 Vu=i.markRaw({name:"tabler-history",render:Au}),Iu={class:"flex flex-row gap-1"},Ou={key:0,class:"flex flex-row text-nowrap text-sm line-through"},zu={key:1,class:"flex flex-row text-nowrap text-sm"},Lu={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Du={},Cr=i.defineComponent({...Du,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(e){const t=e,n=i.computed(()=>D.find(t.product.priceCoefficients,["coefficient.slug",t.costFieldName])),r=i.computed(()=>n.value?n.value.cost:D.get(t.product,t.costFieldName)),s=i.computed(()=>t.additionalThroughFieldName?D.get(t.product,t.additionalThroughFieldName):void 0),o=i.computed(()=>t.product.costDate?$n.format(t.product.costDate,Y.AppConfigProvider.getConfig().dateFormats.uiDate):void 0),a=i.computed(()=>(D.isFunction(t.allowPriceClick)?t.allowPriceClick(t.product):t.allowPriceClick)&&!D.isNil(r.value)),l=i.computed(()=>D.isNil(r.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value))),c=i.computed(()=>{if(t.product.currencySignature==="RUB"||!t.currencyRates||!t.currencyRates[t.product.currencySignature])return null;const h=t.currencyRates[t.product.currencySignature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(r.value)*h)}),d=i.computed(()=>D.isNil(s.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(s.value));return(h,u)=>{var m;const p=I.NTag,f=I.NTooltip,g=Vu;return i.openBlock(),i.createElementBlock("div",Iu,[h.showTag?(i.openBlock(),i.createBlock(f,{key:0},{trigger:i.withCtx(()=>[i.createVNode(p,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!n.value}])},{default:i.withCtx(()=>{var y;return[i.createTextVNode(i.toDisplayString(((y=n.value)==null?void 0:y.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var y;return[i.createTextVNode(" "+i.toDisplayString(((y=n.value)==null?void 0:y.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[s.value&&s.value!==r.value?(i.openBlock(),i.createElementBlock("span",Ou,i.toDisplayString(d.value)+" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base",{"text-gray-600":(m=n.value)==null?void 0:m.readOnly,"font-bold":!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":a.value&&h.eventEmitter}),onClick:u[0]||(u[0]=()=>{var y;a.value&&((y=h.eventEmitter)==null||y.emit("cost:click",{product:h.product,cost:r.value}))})},i.toDisplayString(l.value),3),i.createTextVNode(" "+i.toDisplayString(h.showQuantityUnit?` ${h.product.currency}/${h.product.quantityUnit}`:""),1)],2),c.value?(i.openBlock(),i.createElementBlock("span",zu," ~ "+i.toDisplayString(c.value)+" "+i.toDisplayString(h.showQuantityUnit?`₽/${h.product.quantityUnit}`:""),1)):i.createCommentVNode("",!0),h.showCostDate&&!i.unref(D.isNil)(o.value)?(i.openBlock(),i.createElementBlock("span",Lu,[i.createTextVNode(i.toDisplayString(o.value)+" ",1),h.showPriceHistory&&h.eventEmitter?(i.openBlock(),i.createBlock(f,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"cursor-pointer",onClick:u[1]||(u[1]=y=>{var _;return(_=h.eventEmitter)==null?void 0:_.emit("cost:show-price-history",{product:h.product})})})]),default:i.withCtx(()=>[u[2]||(u[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])])}}}),Hu={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Wu(e,t){return i.openBlock(),i.createElementBlock("svg",Hu,[...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 Es=i.markRaw({name:"ion-information-circle-outline",render:Wu}),ju={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qu(e,t){return i.openBlock(),i.createElementBlock("svg",ju,[...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 ka=i.markRaw({name:"ion-images",render:qu});/*!
|
|
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 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)},
|
|
19
|
+
***************************************************************************** */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)},Xu={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"}},Xi={containerResize:"lgContainerResize",updateSlides:"lgUpdateSlides",beforeOpen:"lgBeforeOpen",beforeSlide:"lgBeforeSlide"},Yu=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=Sr(Sr({},Xu),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(Xi.beforeSlide+".thumb",function(n){var r=n.detail.index;t.animateThumb(r)}),this.core.LGel.on(Xi.beforeOpen+".thumb",function(){t.thumbOuterWidth=t.core.outer.get().offsetWidth}),this.core.LGel.on(Xi.updateSlides+".thumb",function(){t.rebuildThumbnails()}),this.core.LGel.on(Xi.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(Xi.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 Br=function(){return Br=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Br.apply(this,arguments)},Hu={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},gn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},$s=500,Wu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Br(Br({},Hu),this.core.settings),this}return e.prototype.buildTemplates=function(){var t=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(t+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},e.prototype.enableZoom=function(t){var n=this,r=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(gn.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(t){return{x:t.pageX,y:t.pageY}},e.prototype.getSwipeCords=function(t){var n=t.touches[0].pageX,r=t.touches[0].pageY;return{x:n,y:r}},e.prototype.getDragAllowedAxises=function(t,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();t?(s=r.offsetHeight*t,o=r.offsetWidth*t):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(t,n,r,s){if(!(Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;t===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,f=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=o-l,this.pageY=a-c,this.positionChanged=!1);var p=this.getPossibleSwipeDragCords(n),u,g,m=o-this.pageX,_=a-this.pageY;if(t-n>1){var y=(t-n)/Math.abs(n);m=(n<0?-m:m)+this.left*(y+(n<0?-1:1)),_=(n<0?-_:_)+this.top*(y+(n<0?-1:1)),u=m/y,g=_/y}else{var y=(t-n)*n;u=m*y,g=_*y}r&&(f?this.isBeyondPossibleLeft(u,p.minX)?u=p.minX:this.isBeyondPossibleRight(u,p.maxX)&&(u=p.maxX):t>1&&(u<p.minX?u=p.minX:u>p.maxX&&(u=p.maxX)),h?this.isBeyondPossibleTop(g,p.minY)?g=p.minY:this.isBeyondPossibleBottom(g,p.maxY)&&(g=p.maxY):t>1&&(g<p.minY?g=p.minY:g>p.maxY&&(g=p.maxY))),this.setZoomStyles({x:u,y:g,scale:t}),this.left=u,this.top=g,s&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(t){if(this.isImageSlide(t)){var n=this.core.getSlideItem(t).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},e.prototype.setZoomImageSize=function(){var t=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=t.getCurrentImageActualSizeScale();t.scale>=r&&(n.addClass("no-transition"),t.imageReset=!0)},$s),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")}},$s+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},$s+110)}},e.prototype.getNaturalWidth=function(t){var n=this.core.getSlideItem(t).find(".lg-image").first(),r=this.core.galleryItems[t].width;return r?parseFloat(r):n.get().naturalWidth},e.prototype.getActualSizeScale=function(t,n){var r,s;return t>=n?(r=t/n,s=r||2):s=1,s},e.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=t.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},e.prototype.getPageCords=function(t){var n={};if(t)n.x=t.pageX||t.touches[0].pageX,n.y=t.pageY||t.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},e.prototype.setPageCords=function(t){var n=this.getPageCords(t);this.pageX=n.x,this.pageY=n.y},e.prototype.manageActualPixelClassNames=function(){var t=this.core.getElementById("lg-actual-size");t.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),t>1},e.prototype.getScale=function(t){var n=this.getCurrentImageActualSizeScale();return t<1?t=1:t>n&&(t=n),t},e.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){t.$LG(r.target).hasClass("lg-image")&&t.setActualSize(t.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=t.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),t.setActualSize(t.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(gn.containerResize+".zoom "+gn.rotateRight+".zoom "+gn.rotateLeft+".zoom "+gn.flipHorizontal+".zoom "+gn.flipVertical+".zoom",function(){if(!(!t.core.lgOpened||!t.isImageSlide(t.core.index)||t.core.touchAction)){var r=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();t.top=0,t.left=0,t.setZoomEssentials(),t.setZoomSwipeStyles(r,{x:0,y:0}),t.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(t.isImageSlide(t.core.index)){var r=0;t.imageReset&&(t.resetImageTranslate(t.core.index),r=50),setTimeout(function(){var s=t.scale-t.settings.scale;s<1&&(s=1),t.beginZoom(s),t.zoomImage(s,-t.settings.scale,!0,!t.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){t.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){t.setActualSize(t.core.index)}),this.core.LGel.on(gn.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(gn.afterOpen+".zoom",function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1}),this.core.LGel.on(gn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.zoomInProgress=!1,t.resetZoom(s),t.resetImageTranslate(s),t.isImageSlide(t.core.index)&&t.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var t=this.scale+this.settings.scale;this.settings.infiniteZoom||(t=this.getScale(t)),this.beginZoom(t),this.zoomImage(t,Math.min(this.settings.scale,t-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(t!==void 0?t:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(t){return Math.sqrt((t.touches[0].pageX-t.touches[1].pageX)*(t.touches[0].pageX-t.touches[1].pageX)+(t.touches[0].pageY-t.touches[1].pageY)*(t.touches[0].pageY-t.touches[1].pageY))},e.prototype.pinchZoom=function(){var t=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=t.core.getSlideItem(t.core.index),!!t.isImageSlide(t.core.index)&&l.touches.length===2){if(l.preventDefault(),t.core.outer.hasClass("lg-first-slide-loading"))return;s=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.setPageCords(l),t.resetImageTranslate(t.core.index),t.core.touchAction="pinch",n=t.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=t.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=t.scale;var h=Math.max(1,s+-d*.02);t.scale=Math.round((h+Number.EPSILON)*100)/100;var f=t.scale-o;t.zoomImage(t.scale,Math.round((f+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,t.scale<=1)t.resetZoom();else{var c=t.getCurrentImageActualSizeScale();if(t.scale>=c){var d=c-t.scale;d===0&&(d=.01),t.zoomImage(c,d,!1,!0)}t.manageActualPixelClassNames(),t.core.outer.addClass("lg-zoomed")}t.core.touchAction=void 0}})},e.prototype.touchendZoom=function(t,n,r,s,o){var a=n.x-t.x,l=n.y-t.y,c=Math.abs(a)/o+1,d=Math.abs(l)/o+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var h=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),f={};f.x=this.left+a,f.y=this.top+l;var p=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(f.y,p.minY)?f.y=p.minY:this.isBeyondPossibleBottom(f.y,p.maxY)&&(f.y=p.maxY)),r&&(this.isBeyondPossibleLeft(f.x,p.minX)?f.x=p.minX:this.isBeyondPossibleRight(f.x,p.maxX)&&(f.x=p.maxX)),s?this.top=f.y:f.y=this.top,r?this.left=f.x:f.x=this.left,this.setZoomSwipeStyles(h,f),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(t,n,r,s,o){var a={};if(s){if(a.y=this.top+(n.y-t.y),this.isBeyondPossibleTop(a.y,o.minY)){var l=o.minY-a.y;a.y=o.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,o.maxY)){var c=a.y-o.maxY;a.y=o.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-t.x),this.isBeyondPossibleLeft(a.x,o.minX)){var d=o.minX-a.x;a.x=o.minX-d/6}else if(this.isBeyondPossibleRight(a.x,o.maxX)){var h=a.x-o.maxX;a.x=o.maxX+h/6}}else a.x=this.left;return a},e.prototype.isBeyondPossibleLeft=function(t,n){return t>=n},e.prototype.isBeyondPossibleRight=function(t,n){return t<=n},e.prototype.isBeyondPossibleTop=function(t,n){return t>=n},e.prototype.isBeyondPossibleBottom=function(t,n){return t<=n},e.prototype.isImageSlide=function(t){var n=this.core.galleryItems[t];return this.core.getSlideType(n)==="image"},e.prototype.getPossibleSwipeDragCords=function(t){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,s=n.get().getBoundingClientRect(),o=s.height,a=s.width;t&&(o=o+t*o,a=a+t*a);var l=(o-this.containerRect.height)/2,c=(this.containerRect.height-o)/2+r,d=(a-this.containerRect.width)/2,h=(this.containerRect.width-a)/2,f={minY:l,maxY:c,minX:d,maxX:h};return f},e.prototype.setZoomSwipeStyles=function(t,n){t.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},e.prototype.zoomSwipe=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=new Date,c=new Date,d,h,f=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(p){if(t.isImageSlide(t.core.index)&&(f=t.core.getSlideItem(t.core.index),(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))&&p.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){p.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var u=t.getDragAllowedAxises(0);a=u.allowY,o=u.allowX,(o||a)&&(n=t.getSwipeCords(p)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(p){if(p.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))){p.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(p);var u=t.getZoomSwipeCords(n,r,o,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(s=!0,t.setZoomSwipeStyles(h,u))}}),this.core.$inner.on("touchend.lg",function(p){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.target))){if(p.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var u=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,u)}})},e.prototype.zoomDrag=function(){var t=this,n={},r={},s=!1,o=!1,a=!1,l=!1,c,d,h,f;this.core.outer.on("mousedown.lg.zoom",function(p){if(t.isImageSlide(t.core.index)){var u=t.core.getSlideItem(t.core.index);if(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target)){c=new Date,f=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var g=t.getDragAllowedAxises(0);l=g.allowY,a=g.allowX,t.core.outer.hasClass("lg-zoomed")&&t.$LG(p.target).hasClass("lg-object")&&(a||l)&&(p.preventDefault(),n=t.getDragCords(p),h=t.getPossibleSwipeDragCords(),s=!0,t.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(p){if(s){o=!0,r=t.getDragCords(p);var u=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(f,u)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(p){if(s){if(d=new Date,s=!1,t.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=t.getDragCords(p);var u=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,u)}o=!1}t.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},e}();const ju={ref:"gallery-container",class:"lightgallery-wrapper"},Xu={},va=i.defineComponent({...Xu,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(e){const t=e,n={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...t.settings}),D.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",ju,[i.renderSlot(o.$slots,"default")],512))}}),at=class at{static init(){at.isInitialized||(at.isInitialized=!0,at.windowResizeHandler(),window.addEventListener("resize",at.windowResizeHandler))}static destroy(){window.removeEventListener("resize",at.windowResizeHandler),at.isInitialized=!1}static getDeviceTypeByResolution(){const t=U.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<t.tablet?Xe.phone:window.innerWidth<t.laptop?Xe.tablet:Xe.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return at.setRefValueDependingOnDeviceResolution(s,t,n,r),at.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return at.getDeviceTypeByResolution()===Xe.phone}static isTabletDevice(){return at.getDeviceTypeByResolution()===Xe.tablet}static isLaptopDevice(){return at.getDeviceTypeByResolution()===Xe.laptop}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(at.getDeviceTypeByResolution()){case Xe.phone:t.value=n;break;case Xe.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){D.forEach(at.refsDependingOnDeviceResolution,t=>{at.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};C(at,"isInitialized",!1),C(at,"refsDependingOnDeviceResolution",[]);let vt=at;const qu=["href"],Yu=["src","alt"],Uu={},ka=i.defineComponent({...Uu,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Du,Wu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(vt.getDeviceTypeByResolution()===Xe.phone?.7:.8),a=i.ref(o()),l=()=>{a.value=o()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),t({show:c}),window.addEventListener("resize",l),(d,h)=>{const f=wa,p=A.NPopover;return i.openBlock(),i.createBlock(p,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=u=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(f)])])]),default:i.withCtx(()=>[i.createVNode(va,{settings:s.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:h[1]||(h[1]=()=>{r.value=!0}),onAfterClose:h[2]||(h[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.images,(u,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:u.image},[i.createElementVNode("img",{src:u.preview,alt:`Изображение #${g+1}`},null,8,Yu)],8,qu))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),Gu={class:"flex flex-col text-sm"},Ku={},Zu=i.defineComponent({...Ku,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Es,s=A.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",Gu,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(o,a)=>(i.openBlock(),i.createElementBlock("span",{key:a},i.toDisplayString(o.warehouse.name)+": "+i.toDisplayString(o.count)+" "+i.toDisplayString(t.product.quantityUnit),1))),128))])]),_:3})}}}),Ju={class:"flex flex-row justify-between"},Qu={key:0},ef={class:"ml-2 align-sub"},tf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},nf={class:"@container"},rf={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},sf={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},of={class:"text-sc-dark-grey"},af={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},lf={class:"text-gray-600"},cf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},df={key:3,class:"underline decoration-dashed"},hf={key:4,class:"sc-product-pack whitespace-nowrap"},uf={class:"text-gray-600"},ff={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},pf={class:"text-gray-600"},gf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},mf={key:0},_f={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},yf={},Yi=i.defineComponent({...yf,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=i.computed(()=>D.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>D.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,f;return(f=(h=n.product)==null?void 0:h.properties)==null?void 0:f.planingIncomingDate}),a=i.useTemplateRef("image-gallery"),l=()=>{var h;(h=a.value)==null||h.show()},c=i.computed(()=>D.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return t({showProductImagesPreview:l}),(h,f)=>{var y,b,S,x,v;const p=wa,u=A.NText,g=ba,m=Es,_=A.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Ju,[i.createVNode(u,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&h.eventEmitter}),onClick:d},i.toDisplayString(h.product.name),3),h.product.onOrder?(i.openBlock(),i.createElementBlock("span",Qu," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",ef,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(ka,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",tf,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),h.showProductAddToCartButton||h.showProductEditButton||((y=h.productContextButtonsConfig)==null?void 0:y.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:h.product,"event-emitter":h.eventEmitter,"show-product-add-to-cart-button":h.showProductAddToCartButton,"show-product-edit-button":h.showProductEditButton,"product-context-buttons-config":h.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",nf,[i.createElementVNode("div",rf,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",sf,[f[0]||(f[0]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",of,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",af,[f[1]||(f[1]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",lf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(Zu,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",cf,[f[2]||(f[2]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(m,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",df," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",hf,[f[3]||(f[3]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",uf,i.toDisplayString((v=(x=h.product)==null?void 0:x.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",ff,[f[4]||(f[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",pf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(_,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",gf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Cr,{key:B.coefficient.slug,product:h.product,"cost-field-name":B.coefficient.slug??"","event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-price-history":h.showPriceHistory,"show-cost-date":h.showCostDate,"currency-rates":h.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","show-cost-date","currency-rates"]))),128)),i.createVNode(Cr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":h.showCostDate,"show-price-history":h.showPriceHistory,"currency-rates":h.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",mf,[i.createElementVNode("ul",_f,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),h.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(h.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),bf=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(Cr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),wf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(vt.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})}),t.showProductCosts&&(D.forEach(e,s=>{D.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),D.forEach(D.sortBy(r,["slug"]),s=>{n.push(bf(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Cr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})})),(t.showProductEditButton||!D.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(ba,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},vf={key:0,class:"pt-0.5"},kf={key:0},xf={class:"line-through"},Cf={key:0},Sf={key:1},Bf={class:"flex flex-row gap-1"},Tf={key:0},Ef={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},$f={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Rf={},Nf=i.defineComponent({...Rf,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>{var T;return(T=t==null?void 0:t.filteredItems)==null?void 0:T[t.categoryItem.id]}),s=i.computed(()=>{var T,$;return D.isArray((T=t.categoryItem)==null?void 0:T.categories)&&(($=t.categoryItem.categories)==null?void 0:$.length)>0}),o=i.computed(()=>{var T;return D.isArray((T=t.categoryItem)==null?void 0:T.products)?t.categoryItem.products:[]}),a=i.computed(()=>Object.entries(t.categoryItem.currencyRates??{}).map(([T,$])=>`${$} руб./${B(T)}`).join(", ")),l=i.computed(()=>D.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter(T=>{var j;const $=(j=r.value)==null?void 0:j.products;return D.isArray($)&&$.includes(T.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>D.isFunction(t.showHideForClientButton)?t.showHideForClientButton(t.categoryItem):t.showHideForClientButton),h=i.computed(()=>D.isFunction(t.showPinButton)?t.showPinButton(t.categoryItem):t.showPinButton),f=i.computed(()=>D.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),p=i.computed(()=>D.isNil(t.categoryContextButtonsConfig)?[]:D.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),u=i.computed(()=>new U.ClientCategory(t.categoryItem)),g=i.ref(!1),m=i.ref(!1),_=i.computed(()=>!D.isUndefined(t.selectedCategoriesItems)),y=i.computed(()=>(t.selectedCategoriesItems??[]).some(T=>T.id===t.categoryItem.id)),b=i.computed(()=>M.value&&vt.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),S=i.useTemplateRef("collapse-item-reference"),x=i.computed(()=>{var T,$;return($=(T=t.categoryItem.properties)==null?void 0:T.templateCost)==null?void 0:$.priceCoefficient}),v=i.computed(()=>{var T,$;return($=(T=t.categoryItem.properties)==null?void 0:T.templateCost)==null?void 0:$.increasePercent}),B=(T,$="ru-RU")=>0 .toLocaleString($,{style:"currency",currency:T,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),k=T=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:T,target:S.value})},R=(T,$)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:$,isLoadingState:g,target:S.value})},P=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem,target:S.value})},N=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem,target:S.value})},W=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem,target:S.value})},q=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem,target:S.value})},F=T=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:T,target:S.value})},M=i.ref(0),I=i.computed(()=>M.value&&o.value.length>0?wf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,currencyRates:t.categoryItem.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig}):[]),Z=D.debounce(()=>{M.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",Z)}),window.addEventListener("resize",Z),Z(),(T,$)=>{const j=A.NCheckbox,z=du,Y=A.NTooltip,V=au,O=_a,J=A.NTag,ge=nu,re=Qh,he=A.NButton,se=Kh,Pe=ma,Fe=ga,Ze=A.NDropdown,Le=A.NDataTable,dt=A.NAlert,Zt=A.NSpin;return i.openBlock(),i.createBlock(ya,{ref:"collapse-item-reference",name:T.categoryItem.id,"data-id":T.categoryItem.id,"onHeader:click":R},{"pre-arrow":i.withCtx(()=>{var Oe,Ce,Je;return[_.value?(i.openBlock(),i.createElementBlock("div",vf,[i.createVNode(j,{checked:y.value,"onUpdate:checked":k},null,8,["checked"])])):i.createCommentVNode("",!0),!d.value&&((Oe=u.value)!=null&&Oe.isDisabled)?(i.openBlock(),i.createBlock(Y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(z,{class:"pt-1.5"})]),default:i.withCtx(()=>[$[1]||($[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((Ce=u.value)==null?void 0:Ce.isFavorite)??!1?(i.openBlock(),i.createBlock(Y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(V,{class:"pt-1.5"})]),default:i.withCtx(()=>[$[2]||($[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0),((Je=u.value)==null?void 0:Je.isRequired)??!1?(i.openBlock(),i.createBlock(Y,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(O,{class:"pt-1.5"})]),default:i.withCtx(()=>[$[3]||($[3]=i.createTextVNode(" Доп. продажа ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Oe,Ce,Je,Qe,un;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":T.categoryItem.isHidden,"text-gray-400":(Oe=u.value)==null?void 0:Oe.isDisabled})},[i.createVNode(Y,{disabled:!T.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(T.categoryItem.name),1)]),default:i.withCtx(()=>[$[4]||($[4]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:$[0]||($[0]=i.withModifiers((...Ue)=>i.unref(D.noop)&&i.unref(D.noop)(...Ue),["prevent","stop"]))},[(Ce=T.categoryItem.properties)!=null&&Ce.m2Price?(i.openBlock(),i.createBlock(J,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((Je=T.categoryItem.properties)==null?void 0:Je.templateCost)&&T.categoryItem.properties.m2PriceRetail&&v.value}),round:""},{default:i.withCtx(()=>{var Ue;return[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString(T.categoryItem.properties.m2Price)+" руб./м2 ",1),(Ue=T.categoryItem.properties)!=null&&Ue.templateCost&&T.categoryItem.properties.m2PriceRetail&&v.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[v.value?(i.openBlock(),i.createBlock(J,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[v.value?(i.openBlock(),i.createElementBlock("span",kf,i.toDisplayString(v.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(J,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",xf,i.toDisplayString(T.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(Qe=T.categoryItem.properties)!=null&&Qe.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[x.value||v.value?(i.openBlock(),i.createBlock(J,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Ue;return[x.value?(i.openBlock(),i.createElementBlock("span",Cf,i.toDisplayString((Ue=x.value)==null?void 0:Ue.name),1)):i.createCommentVNode("",!0),v.value?(i.openBlock(),i.createElementBlock("span",Sf,i.toDisplayString(v.value>0?"+":"")+i.toDisplayString(v.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(J,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((un=u.value)!=null&&un.manager)?(i.openBlock(),i.createBlock(J,{key:3,size:i.unref(n),closable:!0,round:"",onClose:W},{default:i.withCtx(()=>[i.createVNode(Y,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Ue,Ft;return[i.createElementVNode("span",Bf,[i.createVNode(ge),i.createTextVNode(" "+i.toDisplayString((Ft=(Ue=u.value)==null?void 0:Ue.manager)==null?void 0:Ft.name),1)])]}),default:i.withCtx(()=>{var Ue,Ft;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Ft=(Ue=u.value)==null?void 0:Ue.manager)==null?void 0:Ft.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[T.showSlugs||T.showProperties?(i.openBlock(),i.createElementBlock("div",Tf,[i.createElementVNode("ul",Ef,[T.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:T.categoryItem.id,slug:T.categoryItem.slug},(Oe,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(Oe),1))),128)):i.createCommentVNode("",!0),T.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(T.categoryItem.properties,(Oe,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(Oe),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Oe;return[i.createElementVNode("div",$f,[d.value?(i.openBlock(),i.createBlock(Y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:P},{default:i.withCtx(()=>{var Ce;return[(Ce=u.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createBlock(z,{key:1})):(i.openBlock(),i.createBlock(re,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce;return[(Ce=u.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(u.value.hidingComment?`. Причина: '${u.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((Oe=u.value)!=null&&Oe.manager)?(i.openBlock(),i.createBlock(Y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{size:i.unref(n),onClick:N},{default:i.withCtx(()=>[i.createVNode(se)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce,Je,Qe;return[(Ce=u.value)!=null&&Ce.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((Qe=(Je=u.value)==null?void 0:Je.manager)==null?void 0:Qe.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(Y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary",onClick:q},{default:i.withCtx(()=>[i.createVNode(Pe)]),_:1},8,["size"])]),default:i.withCtx(()=>[$[5]||($[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Ze,{key:3,options:p.value,size:i.unref(n),trigger:"click",onSelect:F},{default:i.withCtx(()=>[i.createVNode(he,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(Fe)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(T.$slots,"default",{},()=>{var Oe;return[s.value?(i.openBlock(),i.createBlock(Ca,{key:0,"categories-items":T.categoryItem.categories??[],"has-products":c.value||g.value,"event-emitter":T.eventEmitter,"filtered-items":r.value?((Oe=r.value)==null?void 0:Oe.categories)??{}:void 0,"selected-categories-items":T.selectedCategoriesItems,"selected-products-items":T.selectedProductsItems,"show-slugs":T.showSlugs,"show-properties":T.showProperties,"show-product-costs":T.showProductCosts,"allow-name-click":T.allowNameClick,"allow-price-click":T.allowPriceClick,"show-price-history":T.showPriceHistory,"show-cost-date":T.showCostDate,"show-product-add-to-cart-button":T.showProductAddToCartButton,"show-product-edit-button":T.showProductEditButton,"product-context-buttons-config":T.productContextButtonsConfig,"show-hide-for-client-button":T.showHideForClientButton,"show-pin-button":T.showPinButton,"show-category-edit-button":T.showCategoryEditButton,"category-context-buttons-config":T.categoryContextButtonsConfig},null,8,["categories-items","has-products","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"])):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createBlock(Le,{key:1,columns:I.value,data:l.value,bordered:!0,loading:g.value,remote:!0,"row-key":Ce=>Ce.id,"table-layout":b.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!g.value&&!m.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(dt,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(dt,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createBlock(Zt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...$[6]||($[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Pf=jn(Nf,[["__scopeId","data-v-c02ae9c0"]]),Ff={class:"sc-collapse flex w-full flex-col"},Mf={},xa=i.defineComponent({...Mf,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(e,{emit:t}){const n=e,r=t,s=(o,a)=>{r("on-item-header-click",o,a)};return i.provide("itemHeaderClickHandler",s),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(o,a)=>(i.openBlock(),i.createElementBlock("div",Ff,[i.renderSlot(o.$slots,"default")]))}}),Af={},Ca=i.defineComponent({...Af,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},filteredItems:{default:void 0},selectedCategoriesItems:{default:void 0},selectedProductsItems:{default:void 0},showHideForClientButton:{type:[Boolean,Function],default:!1},showPinButton:{type:[Boolean,Function],default:!1},showCategoryEditButton:{type:[Boolean,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},showProductAddToCartButton:{type:[Boolean,Function],default:!1},showProductEditButton:{type:[Boolean,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>D.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(D.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=A.NSpin,c=A.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(xa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Pf,{key:d.id,"category-item":d,"event-emitter":o.eventEmitter,"filtered-items":s(d,o.filteredItems),"selected-categories-items":o.selectedCategoriesItems,"selected-products-items":o.selectedProductsItems,"show-slugs":o.showSlugs,"show-properties":o.showProperties,"show-product-costs":o.showProductCosts,"allow-name-click":o.allowNameClick,"allow-price-click":o.allowPriceClick,"show-price-history":o.showPriceHistory,"show-cost-date":o.showCostDate,"show-product-add-to-cart-button":o.showProductAddToCartButton,"show-product-edit-button":o.showProductEditButton,"product-context-buttons-config":o.productContextButtonsConfig,"show-hide-for-client-button":o.showHideForClientButton,"show-pin-button":o.showPinButton,"show-category-edit-button":o.showCategoryEditButton,"category-context-buttons-config":o.categoryContextButtonsConfig},null,8,["category-item","event-emitter","filtered-items","selected-categories-items","selected-products-items","show-slugs","show-properties","show-product-costs","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-product-add-to-cart-button","show-product-edit-button","product-context-buttons-config","show-hide-for-client-button","show-pin-button","show-category-edit-button","category-context-buttons-config"]))),128))]),_:1})):o.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!o.hasProducts&&!o.loading&&o.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Vf={class:"text-sm"},If={class:"text-sm"},Of={},zf=i.defineComponent({...Of,__name:"add-product-to-cart-form",props:{product:{},cartItem:{default:void 0},validation:{default:()=>({length:{},quantity:{},marker:{}})},isSubmitProcessing:{type:Boolean}},emits:["submit"],setup(e,{emit:t}){var l,c,d,h,f,p,u,g;const n=e,r=i.ref(new U.CartItemBase(n.cartItem??new U.CartItemBase({product:n.product,quantity:((c=(l=n.product)==null?void 0:l.properties)==null?void 0:c.minCount)??1,length:((h=(d=n.product)==null?void 0:d.properties)==null?void 0:h.minLength)||((p=(f=n.product)==null?void 0:f.properties)!=null&&p.ignoreMinCountCheck?0:(g=(u=n.product)==null?void 0:u.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var y,b,S,x,v,B,k,R,P;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=(v=n.product)==null?void 0:v.properties)==null?void 0:B.minCount),_=(R=(k=n.product)==null?void 0:k.properties)==null?void 0:R.maxLength;return m||_?`(${m?`от ${m}`:""}${m&&_?" ":""}${_?`до ${_}`:""} ${(P=n.product)==null?void 0:P.unit})`:""}),a=()=>{U.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,_)=>(i.openBlock(),i.createBlock(i.unref(A.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(U.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(A.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01||!1,"validation-status":m.validation.length.validationStatus||void 0,label:"Метраж, "+m.product.unit+o.value+"м."},i.createSlots({default:i.withCtx(()=>{var y,b;return[i.createVNode(i.unref(A.NInputNumber),{value:r.value.length,"onUpdate:value":_[0]||(_[0]=S=>r.value.length=S),max:((y=m.product.properties)==null?void 0:y.maxLength)||void 0,min:((b=m.product.properties)==null?void 0:b.minLength)||i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Vf,"Метраж должен быть кратен "+i.toDisplayString(i.unref(U.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(U.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:r.value.quantity,"onUpdate:value":_[1]||(_[1]=y=>r.value.quantity=y),min:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(U.UnitsHelper).getProductMultiplicity(m.product),validator:y=>y%i.unref(U.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(U.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",If,"Количество должно быть кратно "+i.toDisplayString(i.unref(U.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{feedback:m.validation.marker.feedback||"","show-feedback":m.validation.marker.showFeedback||!1,"validation-status":m.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:r.value.marker,"onUpdate:value":_[2]||(_[2]=y=>r.value.marker=y),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NButton),{loading:m.isSubmitProcessing,disabled:r.value.length===0||r.value.quantity===0,type:"primary",class:"self-start",onClick:_[3]||(_[3]=y=>a())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.cartItem?"Изменить":"В корзину"),1)]),_:1},8,["loading","disabled"])]),_:1}))}}),Lf={},Sa=i.defineComponent({...Lf,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=new U.Reference,l=i.computed(()=>{const u=o.value?[]:a,g=D.isUndefined(r.value)?u:r.value;return D.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>Lt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=u=>{var g;if(D.isArray(u)){const m=u.length>0?u.map(_=>{var y;return(y=c.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=u===a.id||(g=c.value.find(_=>_.value===u))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var u;return(u=h.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=h.value)==null?void 0:u.blur()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":u.consistentMenuWidth,disabled:u.disabled||c.value.length===0,filterable:u.filterable,"max-tag-count":u.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Df={},Hf=i.defineComponent({...Df,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(e,{emit:t}){var S,x;const n=e,r=t,s=()=>{const v=U.PriceCoefficient.getRetailPriceCoefficient();return D.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,R,P;return v.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():(P=(R=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:R.find(N=>N.coefficient.id===v.id))==null?void 0:P.cost},d=i.computed(()=>{var B;const v=[...((B=U.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var P;const R=c(k);R?k.name+=` (${R} ${(P=l.value)==null?void 0:P.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),f=i.ref(((x=(S=n.value)==null?void 0:S.value)==null?void 0:x.toString())??null),p=i.ref(null),u=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===U.PriceCoefficientEnum.K0)}),g=i.ref(void 0),m=()=>{var B,k,R;g.value=void 0;let v=Number.parseFloat(((B=f.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||f.value){const P=s(),N=c(h.value??P)??0,W=N+N*((v??0)/100);p.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(W),W>(((k=l.value)==null?void 0:k.getRetailCost())??W)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),u.value&&W<(((R=u.value)==null?void 0:R.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else p.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},_=v=>{D.isArray(v)||(h.value=v,!h.value&&f.value&&(h.value=s()),m())},y=()=>{h.value||(h.value=s()),m()},b=v=>{var k,R,P,N,W,q;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let F=0;if(B<=0)h.value=void 0,f.value=null;else if(u.value&&B<(((k=u.value)==null?void 0:k.cost)??0))h.value=(R=u.value)==null?void 0:R.coefficient,F=(B-u.value.cost)*100/u.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>(((P=l.value)==null?void 0:P.getRetailCost())??B)){h.value=s();const M=((N=l.value)==null?void 0:N.getRetailCost())??0;F=(B-M)*100/M,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const M=(q=(W=l.value)==null?void 0:W.priceCoefficients)==null?void 0:q.filter(I=>I.cost<B);if(M&&M.length>0){const I=M.at(-1);h.value=I==null?void 0:I.coefficient,F=(B-((I==null?void 0:I.cost)??0))*100/((I==null?void 0:I.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(F),r("update:value",{value:Number.isNaN(F)?void 0:F,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return i.onMounted(()=>{var v,B,k,R;n.calculationType===U.CalculationTypeEnum.m2Cost?p.value=((B=(v=n.value)==null?void 0:v.value)==null?void 0:B.toString())??null:!((k=n.value)!=null&&k.coefficient)&&((R=n.value)!=null&&R.value)&&(h.value=s()),m()}),(v,B)=>{var P,N,W;const k=A.NInput,R=A.NInputGroup;return i.openBlock(),i.createBlock(i.unref(A.NFormItem),{"show-label":!i.unref(D.isNil)(v.label),label:v.label,"show-feedback":!i.unref(D.isNil)(((P=g.value)==null?void 0:P.feedback)??v.feedback),feedback:((N=g.value)==null?void 0:N.feedback)??v.feedback,"validation-status":((W=g.value)==null?void 0:W.validationStatus)??v.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&v.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[v.calculationType!==i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(R,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Sa,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:v.clearable,disabled:v.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":_},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:f.value,"onUpdate:value":[B[0]||(B[0]=q=>f.value=q),y],clearable:v.clearable,disabled:v.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%",-1))]),_:2},[f.value&&!f.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||v.calculationType===i.unref(U.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:p.value,"onUpdate:value":[B[1]||(B[1]=q=>p.value=q),b],clearable:v.clearable,disabled:v.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var q;return[i.createTextVNode(i.toDisplayString((q=l.value)==null?void 0:q.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Wf={class:"flex flex-row gap-1"},jf={class:"sc-client-name flex flex-col gap-1 text-base"},Xf=["href"],qf={key:1,class:"text-sc-grey"},Yf={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Uf={key:0},Gf={key:1,class:"text-sm"},Kf={},Tr=i.defineComponent({...Kf,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.client.lastLoginAt?Rn.format(n.client.lastLoginAt,U.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{D.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Es,d=A.NButton,h=A.NPopover;return i.openBlock(),i.createElementBlock("div",Wf,[a.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",a.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(h,{disabled:i.unref(D.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",jf,[i.createElementVNode("a",{href:a.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>o(f))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!a.client.isActive})},i.toDisplayString(a.client.name),3),a.showSalesDirection&&a.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!a.client.isActive})}," ("+i.toDisplayString(a.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),a.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",qf," [ Деактивирован ] "))],8,Xf),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",Yf," г. "+i.toDisplayString(a.client.city.name)+", "+i.toDisplayString(a.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[a.client.alternativeName?(i.openBlock(),i.createElementBlock("div",Uf,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",Gf," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Zf={class:"text-base"},Jf={},Ba=i.defineComponent({...Jf,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",Zf,i.toDisplayString(t.contragent.name),1))}}),Qf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ep(e,t){return i.openBlock(),i.createElementBlock("svg",Qf,[...t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const tp=i.markRaw({name:"tabler-mail",render:ep}),np=["href"],ip={},rp=i.defineComponent({...ip,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=tp;return i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showEmailIcon})},[t.showEmailIcon?(i.openBlock(),i.createBlock(r,{key:0})):i.createCommentVNode("",!0),i.createElementVNode("a",{href:`mailto:${t.email}`,class:"no-underline"},i.toDisplayString(t.email),9,np)],2)}}}),sp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function op(e,t){return i.openBlock(),i.createElementBlock("svg",sp,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const Ta=i.markRaw({name:"fa6-brands-viber",render:op}),ap={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},lp=["id"],cp=["id"],dp=["fill"],hp=["fill"];function up(e,t){return i.openBlock(),i.createElementBlock("svg",ap,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,lp),i.createElementVNode("linearGradient",{id:e.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...t[1]||(t[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,cp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,dp),i.createElementVNode("path",{fill:"url(#"+e.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,hp),t[2]||(t[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Ea=i.markRaw({name:"logos-whatsapp-icon",render:up,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+e(),SVGHW6lecxh:"uicons-"+e()}}}}),fp={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},pp=["id"],gp=["fill"];function mp(e,t){return i.openBlock(),i.createElementBlock("svg",fp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...t[0]||(t[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,pp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,gp),t[1]||(t[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const $a=i.markRaw({name:"logos-telegram",render:mp,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),_p={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yp(e,t){return i.openBlock(),i.createElementBlock("svg",_p,[...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 Ra=i.markRaw({name:"ion-call",render:yp}),bp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wp(e,t){return i.openBlock(),i.createElementBlock("svg",bp,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6"},null,-1)])])}const vp=i.markRaw({name:"tabler-phone-call",render:wp}),kp={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},xp=["href"],Cp=["href"],Sp=["href"],Bp=["href"],Tp={},Ep=i.defineComponent({...Tp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?Xi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return D.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=vp,h=Ra,f=$a,p=Ea,u=Ta;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",{class:i.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=g=>a.value=!a.value),onFocusout:c[1]||(c[1]=g=>a.value=!1),onMouseleave:c[2]||(c[2]=g=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":l.showPhoneIcon})},[l.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(s.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",kp,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(h)],8,xp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(f)],8,Cp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(p)],8,Sp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(u)],8,Bp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),$p={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Rp(e,t){return i.openBlock(),i.createElementBlock("svg",$p,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const Np=i.markRaw({name:"mdi-envelope",render:Rp}),Pp={class:"flex flex-col gap-1"},Fp={key:0,class:"mb-2 flex flex-col text-base"},Mp={key:0,class:"text-sc-dark-grey text-sm"},Ap={key:1,class:"whitespace-nowrap text-sm"},Vp={key:2,class:"whitespace-nowrap text-sm"},Ip={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},Op=["href"],zp=["href"],Lp=["href"],Dp=["href"],Hp=["href"],Wp={key:0,class:"flex flex-col text-base"},jp={key:0,class:"text-sc-dark-grey text-sm"},Xp={key:1,class:"mt-2 text-sm"},qp={key:0,class:"-mt-1"},Yp={},Up=i.defineComponent({...Yp,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{try{return t.contact.phone?Xi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return D.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return D.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return D.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||t.contact.email),l=i.ref(!1);return(c,d)=>{var _,y;const h=Ra,f=$a,p=Ea,u=Ta,g=Np,m=A.NPopover;return i.openBlock(),i.createElementBlock("div",Pp,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,x,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(b=c.contact)!=null&&b.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${c.classes}`),style:i.normalizeStyle(c.styles),onMouseenter:d[0]||(d[0]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[c.fullView&&(c.contact.name||(S=c.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",Fp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(x=c.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",Mp,i.toDisplayString((v=c.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",Ap,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",Vp,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Ip,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${o.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(h)],8,Op)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${o.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(f)],8,zp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(p)],8,Lp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(u)],8,Dp)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${c.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,Hp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,x,v;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",Wp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",jp,i.toDisplayString((S=c.contact)==null?void 0:S.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(x=c.contact)!=null&&x.comment?(i.openBlock(),i.createElementBlock("div",Xp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=c.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((_=c.contact)!=null&&_.comment)?(i.openBlock(),i.createElementBlock("div",qp,[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)])}}}),Gp={key:0,class:"flex w-fit items-center gap-2"},Kp={key:1,class:"flex flex-wrap gap-1"},Zp={key:0},Jp={},Ui=i.defineComponent({...Jp,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{var r,s;return(s=(r=t.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=A.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",Gp,[i.createVNode(o,{size:17,class:"w-fit"}),s[0]||(s[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):r.product.isNewRec()?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Kp,[i.createElementVNode("div",null,i.toDisplayString(r.product.code)+" - "+i.toDisplayString(r.product.name)+" - "+i.toDisplayString(r.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(r.product.unit),1),n.value?(i.openBlock(),i.createElementBlock("div",Zp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),Qp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function eg(e,t){return i.openBlock(),i.createElementBlock("svg",Qp,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const Er=i.markRaw({name:"ion-close",render:eg}),tg={class:"mr-3 flex flex-col gap-2"},ng=["onClick"],ig={class:"h-full p-2"},rg={},sg=i.defineComponent({...rg,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(e,{emit:t}){const n=e,r=i.useTemplateRef("drawing-template-containers"),s=t;return i.onMounted(()=>{n.settings.allTemplates.forEach((o,a)=>{var c;const l=(c=r.value)==null?void 0:c.at(a);l&&s("init-draw-template",l,o)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=Er;return i.openBlock(),i.createBlock(i.unref(A.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",tg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(A.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":d===o.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",ig,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,ng)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Na=jn(sg,[["__scopeId","data-v-828c3059"]]),og={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ag(e,t){return i.openBlock(),i.createElementBlock("svg",og,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Pa=i.markRaw({name:"ion-trash",render:ag}),lg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cg(e,t){return i.openBlock(),i.createElementBlock("svg",lg,[...t[0]||(t[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Fa=i.markRaw({name:"ion-plus",render:cg}),dg={class:"flex flex-col gap-4"},hg={class:"flex flex-col gap-2"},ug={class:"mt-8 font-bold"},fg={class:"grid grow grid-cols-2 items-start gap-2"},pg={class:"flex flex-col gap-4"},gg={class:"flex gap-3"},mg={},Ma=i.defineComponent({...mg,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new U.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=D.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=Fa,f=Pa,p=A.NInput;return i.openBlock(),i.createBlock(i.unref(A.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var u,g,m,_,y,b,S,x,v;return[i.createElementVNode("div",dg,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(A.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",hg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,k)=>{var R,P,N,W,q,F;return i.openBlock(),i.createElementBlock("div",{key:k,class:"flex items-start gap-2"},[i.createElementVNode("div",ug,i.toDisplayString(k+1),1),i.createElementVNode("div",fg,[i.createVNode(i.unref(A.NFormItem),{label:"Ширина, мм",required:!0,feedback:((R=c.validation[`lines_widths[${k+1}]`])==null?void 0:R.feedback)||"","show-feedback":((P=c.validation[`lines_widths[${k+1}]`])==null?void 0:P.showFeedback)||!1,"validation-status":(N=c.validation[`lines_widths[${k+1}]`])==null?void 0:N.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:s.value.linesWidths[k],"onUpdate:value":[M=>s.value.linesWidths[k]=M,a],min:s.value.linesWidths.length>1?c.settings.minLineWidth:c.settings.stripMinWidth,max:c.settings.maxLineWidth,step:c.settings.lineWidthStep,validator:M=>M%c.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((W=c.validation[`lines_angles[${k+1}]`])==null?void 0:W.feedback)||"","show-feedback":((q=c.validation[`lines_angles[${k+1}]`])==null?void 0:q.showFeedback)||!1,"validation-status":(F=c.validation[`lines_angles[${k+1}]`])==null?void 0:F.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:s.value.linesAngles[k],"onUpdate:value":[M=>s.value.linesAngles[k]=M,a],min:c.settings.minLineAngle,max:c.settings.maxLineAngle,step:c.settings.lineAngleStep,validator:M=>M%c.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(A.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,size:"medium",onClick:M=>r("click:add-line",k)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:M=>r("click:remove-line",k)},{default:i.withCtx(()=>[i.createVNode(f)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(A.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),c.settings.allowSaveTemplates&&c.selectTemplateIndex===c.settings.allTemplates.length-1?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=B=>r("click:save-template"))},{default:i.withCtx(()=>[...d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",pg,[i.createVNode(i.unref(A.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=B=>s.value.colorSide=B),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":((u=c.validation.length)==null?void 0:u.showFeedback)||!1,feedback:((g=c.validation.length)==null?void 0:g.feedback)||"","validation-status":(m=c.validation.length)==null?void 0:m.validationStatus,label:`Метраж${c.settings.stripMinLength?" от "+c.settings.stripMinLength:""}${c.settings.stripMaxLength?" до "+c.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=B=>s.value.length=B),a],required:!0,max:c.settings.stripMaxLength||void 0,min:c.settings.stripMinLength,step:c.settings.lengthStep,validator:B=>B%c.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":((_=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(A.NInputNumber),{value:c.value.quantity,"onUpdate:value":d[5]||(d[5]=B=>c.value.quantity=B),min:1,validator:B=>Number.isInteger(B),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":((S=c.validation.marker)==null?void 0:S.showFeedback)||!1,feedback:((x=c.validation.marker)==null?void 0:x.feedback)||"","validation-status":(v=c.validation.marker)==null?void 0:v.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:c.value.marker,"onUpdate:value":d[6]||(d[6]=B=>c.value.marker=B),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",gg,[i.createVNode(i.unref(A.NButton),{loading:c.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=B=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=B=>r("click:view-switch"))},{default:i.withCtx(()=>[...d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Aa=Object.defineProperty,_g=Object.defineProperties,yg=Object.getOwnPropertyDescriptors,Va=Object.getOwnPropertySymbols,bg=Object.prototype.hasOwnProperty,wg=Object.prototype.propertyIsEnumerable,Rs=(e,t,n)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ns=(e,t)=>{for(var n in t||(t={}))bg.call(t,n)&&Rs(e,n,t[n]);if(Va)for(var n of Va(t))wg.call(t,n)&&Rs(e,n,t[n]);return e},Ps=(e,t)=>_g(e,yg(t)),Ia=(e,t)=>{for(var n in t)Aa(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>(Rs(e,typeof t!="symbol"?t+"":t,n),n),Oa=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},$t=(e,t,n)=>(Oa(e,t,"read from private field"),n?n.call(e):t.get(e)),za=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},vg=(e,t,n,r)=>(Oa(e,t,"write to private field"),t.set(e,n),n),kt={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||"canvas",e.nodeType=1,e.getAttribute=function(n){return this[n]},e.setAttribute=function(n,r){return this[n]=r,this},e},polyfill:function(e,t){return kt.shim(e),typeof t<"u"&&(kt.Image=t),kt.isHeadless=!0,e}},La={};Ia(La,{Curve:()=>xi,getAnchorsFromArcData:()=>Cg,getComponentOnCubicBezier:()=>Gi,getControlPoints:()=>Ja,getCurveBoundingBox:()=>Ga,getCurveFromPoints:()=>Za,getCurveLength:()=>Ua,getReflection:()=>As,integrate:()=>Ka,subdivide:()=>Ms});var Da={};Ia(Da,{HALF_PI:()=>et,NumArray:()=>Qt,TWO_PI:()=>ut,decomposeMatrix:()=>ki,getComputedMatrix:()=>ja,getPoT:()=>Xa,lerp:()=>Mt,mod:()=>At,setMatrix:()=>Wa,toFixed:()=>Re});var De;typeof window<"u"?De=window:typeof global<"u"?De=global:typeof self<"u"&&(De=self);var Ha,ut=Math.PI*2,et=Math.PI*.5;function ki(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function Wa(e){Ha=e}function ja(e,t){t=t&&t.identity()||new Ha;let n=e;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function Mt(e,t,n){return n*(t-e)+e}var Fs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Xa(e){let t=0;for(;Fs[t]&&Fs[t]<e;)t++;return Fs[t]}function At(e,t){for(;e<0;)e+=t;return e%t}var Qt=De.Float32Array||Array,kg=Math.floor;function Re(e){return kg(e*1e6)/1e6}var te={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},X=class{constructor(){w(this,"_events",{}),w(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}};w(X,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(X,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var qa={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(X.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(X.Types.change))}}},qt=class extends X{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in qa)Object.defineProperty(this,n,qa[n]);this.x=e,this.y=t}static add(e,t){return new qt(e.x+t.x,e.y+t.y)}static sub(e,t){return new qt(e.x-t.x,e.y-t.y)}static subtract(e,t){return qt.sub(e,t)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){const s=arguments[0]-arguments[2],o=arguments[1]-arguments[3];return Math.atan2(o,s)}const n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(e,t){return Math.sqrt(qt.distanceBetweenSquared(e,t))}static distanceBetweenSquared(e,t){const n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new qt(this.x,this.y)}add(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=t),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=t),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=t),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=t),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=typeof t>"u"?1e-4:t,this.distanceTo(e)<t}lerp(e,t){const n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Re(this.x),y:Re(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}},Q=qt;w(Q,"zero",new qt),w(Q,"left",new qt(-1,0)),w(Q,"right",new qt(1,0)),w(Q,"up",new qt(0,-1)),w(Q,"down",new qt(0,1));var ve=class extends Q{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=te.move){super(t,n),w(this,"controls",{left:new Q,right:new Q}),w(this,"_command",te.move),w(this,"_relative",!0),w(this,"_rx",0),w(this,"_ry",0),w(this,"_xAxisRotation",0),w(this,"_largeArcFlag",0),w(this,"_sweepFlag",1);for(let d in Ya)Object.defineProperty(this,d,Ya[d]);this.command=l,this.relative=!0;const c=ve.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(X.Types.change,c),this.controls.right.set(o,a).addEventListener(X.Types.change,c)}static makeBroadcast(t){return n;function n(){t._bound&&t.dispatchEvent(X.Types.change)}}static fromObject(t){return new ve().copy(t)}copy(t){return this.x=t.x,this.y=t.y,typeof t.command=="string"&&(this.command=t.command),t.controls&&(t.controls.left&&this.controls.left.copy(t.controls.left),t.controls.right&&this.controls.right.copy(t.controls.right)),typeof t.relative=="boolean"&&(this.relative=t.relative),typeof t.rx=="number"&&(this.rx=t.rx),typeof t.ry=="number"&&(this.ry=t.ry),typeof t.xAxisRotation=="number"&&(this.xAxisRotation=t.xAxisRotation),typeof t.largeArcFlag=="number"&&(this.largeArcFlag=t.largeArcFlag),typeof t.sweepFlag=="number"&&(this.sweepFlag=t.sweepFlag),this}clone(){return new ve().copy(this)}toObject(){return{x:Re(this.x),y:Re(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Re(this.rx),ry:Re(this.ry),xAxisRotation:Re(this.xAxisRotation),largeArcFlag:Re(this.largeArcFlag),sweepFlag:Re(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},Ya={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(X.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(X.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(X.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(X.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(X.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(X.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(X.Types.change))}}},xg=0,xt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.19",PublishDate:"2025-06-27T18:00:39.187Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return xg++}},xi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Gi(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Ms(e,t,n,r,s,o,a,l,c){c=c||xi.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new ve(a,l)];const h=[];for(let f=0;f<d;f++){const p=f/d,u=Gi(p,e,n,s,a),g=Gi(p,t,r,o,l);h.push(new ve(u,g))}return h}function Ua(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,f=3*(n-e),p=9*(r-o)+3*(l-t),u=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+f,b=(p*_+u)*_+g;return Math.sqrt(y*y+b*b)}return Ka(m,0,1,c||xi.RecursionLimit)}function Ga(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,p,u,g,m,_,y;for(let v=0;v<2;++v){if(v==0?(f=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(f=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(f)<1e-12)continue;u=-p/f,0<u&&u<1&&c.push(u);continue}_=f*f-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-f+y)/(2*h),0<g&&g<1&&c.push(g),m=(-f-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)u=c[b],x=1-u,d[0][b]=x*x*x*e+3*x*x*u*n+3*x*u*u*s+u*u*u*a,d[1][b]=x*x*x*t+3*x*x*u*r+3*x*u*u*o+u*u*u*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Ka(e,t,n,r){let s=xi.abscissas[r-2],o=xi.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(e(l+f)+e(l-f))}return a*h}function Za(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?At(s-1,n):Math.max(s-1,0),l=t?At(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Ja(c,d,h),d.command=s===0?te.move:te.curve}}function Ja(e,t,n){const r=Q.angleBetween(e,t),s=Q.angleBetween(n,t);let o=Q.distanceBetween(e,t),a=Q.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=et:l-=et,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function As(e,t,n){return new Q(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function Cg(e,t,n,r,s,o,a){const l=xt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,f=n*Math.cos(h),p=r*Math.sin(h),u=new ve(f,p);u.command=te.line}}var Qa=Array.prototype.slice;function Sg(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}var G={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},isFunction:function(e){return typeof e=="function"},extend:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=Qa.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!Sg(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:De.performance&&De.performance.now?De.performance:Date},Vt={hasEventListeners:typeof De.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),Vt},unbind:function(e,t,n,r){return Vt.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),Vt},getRequestAnimationFrame:function(){const e=["ms","moz","webkit","o"];let t=0,n=De.requestAnimationFrame;if(!n){for(let s=0;s<e.length;s++)n=De[e[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-t)),c=De.setTimeout(d,l);t=a+l;function d(){s(a+l)}return c}return n}},Ci=De.document?De.document.createElement("div"):{};Ci.id="help-two-load",Object.defineProperty(Vt,"temp",{enumerable:!0,get:function(){return G.isElement(Ci)&&!De.document.head.contains(Ci)&&(Ci.style.display="none",De.document.head.appendChild(Ci)),Ci}});var Rt=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},Bg=De.devicePixelRatio||1;function Tg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Vs(e){return Bg/Tg(e)}var $r=class{constructor(){w(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}},ft,Nn=class extends Array{constructor(){super(),za(this,ft,new X),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return $t(this,ft)}set _events(t){vg(this,ft,t)}get _bound(){return $t(this,ft)._bound}set _bound(t){$t(this,ft)._bound=t}addEventListener(){return $t(this,ft).addEventListener.apply(this,arguments)}on(){return $t(this,ft).on.apply(this,arguments)}bind(){return $t(this,ft).bind.apply(this,arguments)}removeEventListener(){return $t(this,ft).removeEventListener.apply(this,arguments)}off(){return $t(this,ft).off.apply(this,arguments)}unbind(){return $t(this,ft).unbind.apply(this,arguments)}dispatchEvent(){return $t(this,ft).dispatchEvent.apply(this,arguments)}trigger(){return $t(this,ft).trigger.apply(this,arguments)}listen(){return $t(this,ft).listen.apply(this,arguments)}ignore(){return $t(this,ft).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(X.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(X.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(X.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(X.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(X.Types.remove,t),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(X.Types.insert,n),this.trigger(X.Types.order)}return t}sort(){return super.sort.apply(this,arguments),this.trigger(X.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(X.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(t,n){const r=[];for(let s=0;s<this.length;s++){const o=this[s];let a;n?a=t.call(n,o,s):a=t(o,s),r.push(a)}return r}};ft=new WeakMap;var el=class extends X{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",xt.Identifier+xt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in tl)Object.defineProperty(this,e,tl[e])}static fromObject(e){const t=new el().copy(e);return"id"in e&&(t.id=e.id),t}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return this.renderer.type=e.renderer.type,this.className=e.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},Xn=el;w(Xn,"Properties",["renderer","id","className"]);var tl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Rr,nl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};De.document&&(Rr=document.createElement("a"));var tt=class extends Xn{constructor(e,t){super(),w(this,"_flagSrc",!1),w(this,"_flagImage",!1),w(this,"_flagVideo",!1),w(this,"_flagLoaded",!1),w(this,"_flagRepeat",!1),w(this,"_flagOffset",!1),w(this,"_flagScale",!1),w(this,"_src",""),w(this,"_image",null),w(this,"_loaded",!1),w(this,"_repeat","no-repeat"),w(this,"_scale",1),w(this,"_offset",null);for(let n in il)Object.defineProperty(this,n,il[n]);if(this._renderer.type="texture",this._renderer.flagOffset=Eg.bind(this),this._renderer.flagScale=$g.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Q,typeof t=="function"){const n=(function(){this.unbind(X.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(X.Types.load,n)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const n=Object.prototype.toString.call(e);(n==="[object HTMLImageElement]"||n==="[object HTMLCanvasElement]"||n==="[object HTMLVideoElement]"||n==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const t=new tt().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return Rr?(Rr.href=e,Rr.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const t=tt.getAbsoluteURL(e);if(tt.ImageRegistry.contains(t))return tt.ImageRegistry.get(t);let n;return kt.Image?(n=new kt.Image,kt.shim(n,"img")):De.document?nl.video.test(t)?n=document.createElement("video"):n=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),n.crossOrigin="anonymous",n.referrerPolicy="no-referrer",n}static load(e,t){let n=e.image,r=tt.getTag(n);e._flagImage&&(/canvas/i.test(r)?tt.Register.canvas(e,t):(e._src=!kt.isHeadless&&n.getAttribute("two-src")||n.src,tt.Register[r](e,t))),e._flagSrc&&(n||(n=tt.getImage(e.src),e.image=n),r=tt.getTag(n),tt.Register[r](e,t))}clone(){const e=new tt(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Q?e.offset:new Q().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Q?e.scale:new Q().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(X.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,tt.load(this,(function(){this.loaded=!0,this.trigger(X.Types.change).trigger(X.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Te=tt;w(Te,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Te,"RegularExpressions",nl),w(Te,"ImageRegistry",new $r),w(Te,"Register",{canvas:function(e,t){e._src="#"+e.id,tt.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!kt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof t=="function"&&t()},s=function(o){throw!kt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Rt("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!kt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=tt.getAbsoluteURL(e._src),!(!kt.isHeadless&&n&&n.getAttribute("two-src"))&&(kt.isHeadless||n.setAttribute("two-src",e.src),tt.ImageRegistry.add(e.src,n),kt.isHeadless?tt.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(kt.isHeadless)throw new Rt("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 Rt("unable to load "+e.src)};e._src=tt.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),tt.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",r,!1),e.image.src=e.src,e.image.load())}});var il={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=Te.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Te.ImageRegistry.contains(n)?this._image=Te.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(X.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(X.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Q&&this._scale.unbind(X.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof Q&&this._scale.bind(X.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Eg(){this._flagOffset=!0}function $g(){this._flagScale=!0}var Yt=class extends Xn{constructor(e,t,n){super(),w(this,"_flagOffset",!0),w(this,"_flagOpacity",!0),w(this,"_flagColor",!0),w(this,"_offset",0),w(this,"_opacity",1),w(this,"_color","#fff");for(let r in rl)Object.defineProperty(this,r,rl[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:Yt.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:Yt.Index<=0?"#fff":"#000",Yt.Index=(Yt.Index+1)%2}static fromObject(e){const t=new Yt().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Yt.Properties.length;t++){const n=Yt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Yt;return G.each(Yt.Properties,function(n){t[n]=this[n]},this),e&&e.stops&&e.stops.push(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",G.each(Yt.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},en=Yt;w(en,"Index",0),w(en,"Properties",["offset","opacity","color"]);var rl={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},qn=class extends Xn{constructor(e){super(),w(this,"_flagStops",!1),w(this,"_flagSpread",!1),w(this,"_flagUnits",!1),w(this,"_spread",""),w(this,"_units","");for(let t in sl)Object.defineProperty(this,t,sl[t]);this._renderer.type="gradient",this._renderer.flagStops=Rg.bind(this),this._renderer.bindStops=Ng.bind(this),this._renderer.unbindStops=Pg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let t=e.stops;t&&t.length>0&&(t=t.map(r=>r instanceof en?r:new en().copy(r)));const n=new qn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new qn(t);return G.each(qn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<qn.Properties.length;t++){const n=qn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return G.each(qn.Properties,t=>{e[t]=this[t]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Ye=qn;w(Ye,"Stop",en),w(Ye,"Properties",["spread","stops","units"]);var sl={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(X.Types.insert,t).unbind(X.Types.remove,n),this._stops=new Nn((e||[]).slice(0)),this._stops.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._stops)}}};function Rg(){this._flagStops=!0}function Ng(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Pg(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ki=class extends Ye{constructor(e,t,n,r,s){super(s),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let o in ol)Object.defineProperty(this,o,ol[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Fg.bind(this),this.left=new Q,this.right=new Q,typeof e=="number"&&(this.left.x=e),typeof t=="number"&&(this.left.y=t),typeof n=="number"&&(this.right.x=n),typeof r=="number"&&(this.right.y=r)}static fromObject(e){const t=new Ki().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ki.Properties.length;t++){const n=Ki.Properties[t];n in e&&(this[n]=e[n]instanceof Q?e[n]:new Q().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Ki(this.left._x,this.left._y,this.right._x,this.right._y,t);return G.each(Ye.Properties,function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Ae=Ki;w(Ae,"Stop",en),w(Ae,"Properties",["left","right"]);var ol={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof Q&&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 Q&&this._right.unbind(X.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(X.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Fg(){this._flagEndPoints=!0}var Yn=class extends Ye{constructor(e,t,n,r,s,o){super(r),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let a in al)Object.defineProperty(this,a,al[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Mg.bind(this),this._renderer.flagFocal=Ag.bind(this),this.center=new Q,this.radius=typeof n=="number"?n:1,this.focal=new Q,typeof e=="number"&&(this.center.x=e),typeof t=="number"&&(this.center.y=t),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof o=="number"&&(this.focal.y=o)}static fromObject(e){const t=new Yn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Yn.Properties.length;t++){const n=Yn.Properties[t];n in e&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof Q?e[n]:new Q().copy(e[n]):typeof e[n]=="number"&&(this[n]=e[MediaKeySystemAccess]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Yn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return G.each(Ye.Properties.concat(Yn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return G.each(Yn.Properties,function(t){e[t]=this[t]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(X.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}},Ve=Yn;w(Ve,"Stop",en),w(Ve,"Properties",["center","radius","focal"]);var al={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(X.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(X.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(X.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(X.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Mg(){this._flagCenter=!0}function Ag(){this._flagFocal=!0}function ll(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function 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 cl(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ua(r,l,s,c,o,d,a,h,n)}function dl(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ms(r,l,s,c,o,d,a,h,n)}function Un(e){switch(e.renderer.type){case"texture":return Te.fromObject(e);case"gradient":return Ye.fromObject(e);case"linear-gradient":return Ae.fromObject(e);case"radial-gradient":return Ve.fromObject(e)}return e}var Vg=Math.cos,Ig=Math.sin,hl=Math.tan,Is=[],It=class extends X{constructor(e,t,n,r,s,o){super(),w(this,"elements",new Qt(9)),w(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,t,n){if(t.length<=3){const v=e;let B,k,R;const P=t[0]||0,N=t[1]||0,W=t[2]||0;return B=v[0]*P+v[1]*N+v[2]*W,k=v[3]*P+v[4]*N+v[5]*W,R=v[6]*P+v[7]*N+v[8]*W,[B,k,R]}const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5],d=e[6],h=e[7],f=e[8],p=t[0],u=t[1],g=t[2],m=t[3],_=t[4],y=t[5],b=t[6],S=t[7],x=t[8];return n=n||new Qt(9),n[0]=r*p+s*m+o*b,n[1]=r*u+s*_+o*S,n[2]=r*g+s*y+o*x,n[3]=a*p+l*m+c*b,n[4]=a*u+l*_+c*S,n[5]=a*g+l*y+c*x,n[6]=d*p+h*m+f*b,n[7]=d*u+h*_+f*S,n[8]=d*g+h*y+f*x,n}static fromObject(e){return new It().copy(e)}set(e,t,n,r,s,o,a,l,c){if(typeof t>"u"){const d=e;e=d[0],t=d[1],n=d[2],r=d[3],s=d[4],o=d[5],a=d[6],l=d[7],c=d[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=s,this.elements[5]=o,this.elements[6]=a,this.elements[7]=l,this.elements[8]=c,this.trigger(X.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(X.Types.change)}identity(){return this.elements[0]=It.Identity[0],this.elements[1]=It.Identity[1],this.elements[2]=It.Identity[2],this.elements[3]=It.Identity[3],this.elements[4]=It.Identity[4],this.elements[5]=It.Identity[5],this.elements[6]=It.Identity[6],this.elements[7]=It.Identity[7],this.elements[8]=It.Identity[8],this.trigger(X.Types.change)}multiply(e,t,n,r,s,o,a,l,c){if(typeof t>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(X.Types.change);if(typeof n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const F=s[0]*e+s[1]*t+s[2]*n,M=s[3]*e+s[4]*t+s[5]*n,I=s[6]*e+s[7]*t+s[8]*n;return[F,M,I]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],f=d[0],p=d[1],u=d[2],g=d[3],m=d[4],_=d[5],y=d[6],b=d[7],S=d[8],x=h[0],v=h[1],B=h[2],k=h[3],R=h[4],P=h[5],N=h[6],W=h[7],q=h[8];return this.elements[0]=f*x+p*k+u*N,this.elements[1]=f*v+p*R+u*W,this.elements[2]=f*B+p*P+u*q,this.elements[3]=g*x+m*k+_*N,this.elements[4]=g*v+m*R+_*W,this.elements[5]=g*B+m*P+_*q,this.elements[6]=y*x+b*k+S*N,this.elements[7]=y*v+b*R+S*W,this.elements[8]=y*B+b*P+S*q,this.trigger(X.Types.change)}inverse(e){const t=this.elements;e=e||new It;const n=t[0],r=t[1],s=t[2],o=t[3],a=t[4],l=t[5],c=t[6],d=t[7],h=t[8],f=h*a-l*d,p=-h*o+l*c,u=d*o-a*c;let g=n*f+r*p+s*u;return g?(g=1/g,e.elements[0]=f*g,e.elements[1]=(-h*r+s*d)*g,e.elements[2]=(l*r-s*a)*g,e.elements[3]=p*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=u*g,e.elements[7]=(-d*n+r*c)*g,e.elements[8]=(a*n-r*o)*g,e):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){const t=Vg(e),n=Ig(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){const t=hl(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=hl(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return Is.length=0,this.toTransformArray(e,Is),Is.map(Re).join(" ")}toTransformArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],f=n[7],p=n[8];if(r){t[0]=s,t[1]=l,t[2]=h,t[3]=o,t[4]=c,t[5]=f,t[6]=a,t[7]=d,t[8]=p;return}return[s,l,h,o,c,f,a,d,p]}if(r){t[0]=s,t[1]=l,t[2]=o,t[3]=c,t[4]=a,t[5]=d;return}return[s,l,o,c,a,d]}toArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],f=n[7],p=n[8];if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d,t[6]=h,t[7]=f,t[8]=p;return}return[s,o,a,l,c,d,h,f,p]}if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d;return}return[s,o,a,l,c,d]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new It().copy(this)}},Gn=It;w(Gn,"Identity",[1,0,0,0,1,0,0,0,1]),Wa(Gn);var Os=class extends Xn{constructor(){super(),w(this,"_flagMatrix",!0),w(this,"_flagScale",!1),w(this,"_matrix",null),w(this,"_worldMatrix",null),w(this,"_position",null),w(this,"_rotation",0),w(this,"_scale",1),w(this,"_skewX",0),w(this,"_skewY",0);for(let e in Pr)Object.defineProperty(this,e,Pr[e]);this._renderer.flagMatrix=ul.bind(this),this.isShape=!0,this.matrix=new Gn,this.worldMatrix=new Gn,this.position=new Q,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Os().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 Q?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof Q?e.scale:new Q(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const t=new Os;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 Q?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof Q?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}},mn=Os;w(mn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Pr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(X.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(X.Types.change,this._renderer.flagMatrix),ul.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Q&&this._scale.unbind(X.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof Q&&this._scale.bind(X.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return ja(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function ul(){this._flagMatrix=!0}var Si=Math.min,Bi=Math.max,Og=Math.ceil,zg=Math.floor,Lg=new Q,Pn=class extends mn{constructor(e,t,n,r){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in fl)Object.defineProperty(this,s,fl[s]);this._renderer.type="path",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=_l.bind(this),this._renderer.flagStroke=yl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!r,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new Pn().copy(Ps(Ns({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e),this.vertices=[];for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Pn.Properties.length;t++){const n=Pn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Pn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Pn.Properties.length;n++){const r=Pn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(t=>t.toObject()),G.each(Pn.Properties,t=>{typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,s=e.top+e.height/2;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=s,this.mask.translation.y+=n),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r];s.x-=t,s.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,s,o,a,l=1/0,c=-1/0,d=1/0,h=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:f,scaleY:p}=ki(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof f=="number"&&typeof p=="number"&&(n=Math.max(f,p)*(this.linewidth||0)/2)}else n*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(r<=0)return{width:0,height:0};for(s=0;s<r;s++){a=this._renderer.vertices[s],o=this._renderer.vertices[(s+r-1)%r];const[f,p]=t.multiply(o.x,o.y),[u,g]=t.multiply(a.x,a.y);if(o.controls&&a.controls){let m=o.controls.right.x,_=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[v,B]=t.multiply(S,x);const k=Ga(f,p,y,b,v,B,u,g);d=Si(k.min.y-n,d),l=Si(k.min.x-n,l),c=Bi(k.max.x+n,c),h=Bi(k.max.y+n,h)}else s<=1&&(d=Si(p-n,d),l=Si(f-n,l),c=Bi(f+n,c),h=Bi(p+n,h)),d=Si(g-n,d),l=Si(u-n,l),c=Bi(u+n,c),h=Bi(g+n,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}getPointAt(e,t){let n,r,s,o,a,l,c,d,h,f,p,u,g,m,_,y=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let x=null,v=null;for(let Z=0,T=this._lengths.length,$=0;Z<T;Z++){if($+this._lengths[Z]>=y){this._closed?(n=At(Z,b),r=At(Z-1,b),Z===0&&(n=r,r=Z)):(n=Z,r=Math.min(Math.max(Z-1,0),S)),x=this.vertices[n],v=this.vertices[r],y-=$,this._lengths[Z]!==0?e=y/this._lengths[Z]:e=0;break}$+=this._lengths[Z]}if(x===null||v===null)return null;if(x){if(!v)return x}else return v;_=v.controls&&v.controls.right,m=x.controls&&x.controls.left,a=v.x,f=v.y,l=(_||v).x,p=(_||v).y,c=(m||x).x,u=(m||x).y,d=x.x,g=x.y,_&&v.relative&&(l+=v.x,p+=v.y),m&&x.relative&&(c+=x.x,u+=x.y),o=Gi(e,a,l,c,d),h=Gi(e,f,p,u,g);const B=Mt(a,l,e),k=Mt(f,p,e),R=Mt(l,c,e),P=Mt(p,u,e),N=Mt(c,d,e),W=Mt(u,g,e),q=Mt(B,R,e),F=Mt(k,P,e),M=Mt(R,N,e),I=Mt(P,W,e);return G.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=q,t.controls.left.y=F,t.controls.right.x=M,t.controls.right.y=I,(typeof t.relative!="boolean"||t.relative)&&(t.controls.left.x-=o,t.controls.left.y-=h,t.controls.right.x-=o,t.controls.right.y-=h)),t.t=e,t):(s=new ve(o,h,q-o,F-h,M-o,I-h,this._curved?te.curve:te.line),s.t=e,s)}plot(){if(this.curved)return Za(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?te.move:te.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===te.close;let r=this.vertices[t],s=[],o;return G.each(this.vertices,function(a,l){if(l<=0&&!n){r=a;return}if(a.command===te.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=te.line),r=a;return}o=dl(a,r,e),s=s.concat(o),G.each(o,function(c,d){d<=0&&r.command===te.move?c.command=te.move:c.command=te.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=dl(a,r,e),s=s.concat(o),G.each(o,function(c,d){d<=0&&r.command===te.move?c.command=te.move:c.command=te.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?te.close:te.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=[]),G.each(this.vertices,function(a,l){if(l<=0||a.command===te.move){s=a,this._lengths[l]=0;return}this._lengths[l]=cl(a,s,e),o+=this._lengths[l],s=a},this),this._length=o,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,t=this._closed,n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Nr(this,n*this._length),o=Nr(this,r*this._length),a=Og(s),l=zg(o);let c,d,h,f,p,u;for(this._renderer.vertices.length=0,u=0;u<e;u++)this._renderer.collection.length<=u&&this._renderer.collection.push(new ve),u>l&&!d?(p=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(r,p),p.command=this._renderer.collection[u].command,this._renderer.vertices.push(p),d=p,h=this._collection[u-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[u-1].controls.right.copy(h.controls.right).lerp(Q.zero,1-p.t):this._renderer.collection[u-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):u>=a&&u<=l&&(p=this._renderer.collection[u].copy(this._collection[u]),this._renderer.vertices.push(p),u===l&&ll(this,r)?(d=p,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):u===a&&ll(this,n)&&(c=p,c.command=te.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(u=a-1,p=this._renderer.collection[u].copy(this._collection[u]),this.getPointAt(n,p),p.command=te.move,this._renderer.vertices.unshift(p),f=this._collection[u+1],f&&f.controls&&(p.controls.left.clear(),f.relative?this._renderer.collection[u+1].controls.left.copy(f.controls.left).lerp(Q.zero,p.t):(Lg.copy(f),this._renderer.collection[u+1].controls.left.copy(f.controls.left).lerp(f,p.t))))}return mn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,mn.prototype.flagReset.call(this),this}},xe=Pn;w(xe,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(xe,"Utils",{getCurveLength:cl});var fl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";G.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 Nn?this._collection=e:this._collection=new Nn(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,G.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function pl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function gl(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ml(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function _l(){this._flagFill=!0}function yl(){this._flagStroke=!0}var Zi=class extends xe{constructor(e,t,n,r){const s=[new ve,new ve,new ve,new ve];super(s,!0,!1,!0),w(this,"_flagWidth",0),w(this,"_flagHeight",0),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let o in bl)Object.defineProperty(this,o,bl[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new Q,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}static fromObject(e){const t=new Zi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zi.Properties.length;t++){const n=Zi.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-t).sub(this._origin).command=te.move,this.vertices[1].set(e,-t).sub(this._origin).command=te.line,this.vertices[2].set(e,t).sub(this._origin).command=te.line,this.vertices[3].set(-e,t).sub(this._origin).command=te.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=te.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Zi(0,0,this.width,this.height);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}},Fn=Zi;w(Fn,"Properties",["width","height"]);var bl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(X.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(X.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ji=class extends Fn{constructor(e,t,n,r,s,o){super(t,n,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null);for(let a in wl)Object.defineProperty(this,a,wl[a]);this.noStroke(),this.noFill(),e instanceof Te?this.texture=e:typeof e=="string"&&(this.texture=new Te(e)),this.origin=new Q,this._update(),typeof r=="number"&&(this.columns=r),typeof s=="number"&&(this.rows=s),typeof o=="number"&&(this.frameRate=o),this.index=0}static fromObject(e){const t=new Ji().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ji.Properties.length;t++){const n=Ji.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=G.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const t=new Ji(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&t.play(this._firstFrame,this._lastFrame),t.loop=this.loop,t.firstFrame=this.firstFrame,t.lastFrame=this.lastFrame,e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._texture,t=this._columns,n=this._rows;let r,s,o,a,l,c,d,h,f;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){d=e.image.width,h=e.image.height,r=d/t,s=h/n,a=this._amount,this.width!==r&&(this.width=r),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(G.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=G.performance.now()-this._startTime,f=this._lastFrame+1,l=1e3*(f-this._firstFrame)/this._frameRate,this._loop?o=o%l:o=Math.min(o,l),c=Mt(this._firstFrame,f,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%t,u=Math.floor(this._index/t),g=-r*p+(d-r)/2,m=-s*u+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),m!==e.offset.y&&(e.offset.y=m)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}},Fr=Ji;w(Fr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var wl={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},zs,vl=class extends Nn{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),za(this,zs,{}),this.attach(t),this.on(X.Types.insert,this.attach),this.on(X.Types.remove,this.detach)}get ids(){return $t(this,zs)}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}};zs=new WeakMap;var Kn=class extends xe{constructor(e,t,n,r,s,o,a){const l=a||xt.Resolution*3,c=[];for(let d=0;d<l;d++)c.push(new ve);super(c,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",ut),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in kl)Object.defineProperty(this,d,kl[d]);typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.startAngle=s),typeof o=="number"&&(this.endAngle=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Kn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=At(e,ut)===At(t,ut),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,f,p,u,g,m,_,y,b;for(s?l--:o||(l-=2),h=0,f=l-1;h<l;h++){switch(p=h/f,u=a[d],g=p*(t-e)+e,m=(t-e)/l,_=r*Math.cos(g),y=r*Math.sin(g),h){case 0:c=te.move;break;default:c=te.curve}u.command=c,u.x=_,u.y=y,u.controls.left.clear(),u.controls.right.clear(),u.command===te.curve&&(b=r*m/Math.PI,u.controls.left.x=b*Math.cos(g-et),u.controls.left.y=b*Math.sin(g-et),u.controls.right.x=b*Math.cos(g+et),u.controls.right.y=b*Math.sin(g+et),h===1&&u.controls.left.multiplyScalar(2),h===f&&u.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=te.close,d++):(l--,f=l-1),h=0;h<l;h++)p=h/f,u=a[d],g=(1-p)*(t-e)+e,m=(t-e)/l,_=n*Math.cos(g),y=n*Math.sin(g),c=te.curve,h<=0&&(c=s?te.move:te.line),u.command=c,u.x=_,u.y=y,u.controls.left.clear(),u.controls.right.clear(),u.command===te.curve&&(b=n*m/Math.PI,u.controls.left.x=b*Math.cos(g+et),u.controls.left.y=b*Math.sin(g+et),u.controls.right.x=b*Math.cos(g-et),u.controls.right.y=b*Math.sin(g-et),h===1&&u.controls.left.multiplyScalar(2),h===f&&u.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=te.line}else s||(a[d].command=te.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=te.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.startAngle,s=this.endAngle,o=this.vertices.length,a=new Kn(0,0,t,n,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<xe.Properties.length;l++){const c=xe.Properties[l];a[c]=this[c]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e}},Mr=Kn;w(Mr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var kl={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Ls=Math.cos,Ds=Math.sin,Zn=class extends xe{constructor(e,t,n,r){const s=r?Math.max(r,2):4,o=[];for(let a=0;a<s;a++)o.push(new ve(0,0,0,0,0,0));super(o,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let a in xl)Object.defineProperty(this,a,xl[a]);typeof n=="number"&&(this.radius=n),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Zn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let s=0;s<this.vertices.length;s++){const a=s/e*ut,l=n*Ls(a),c=n*Ds(a),d=r*Ls(a-et),h=r*Ds(a-et),f=r*Ls(a+et),p=r*Ds(a+et),u=this.vertices[s];u.command=s===0?te.move:te.curve,u.set(l,c),u.controls.left.set(d,h),u.controls.right.set(f,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Zn(0,0,this.radius,this.vertices.length);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Qi=Zn;w(Qi,"Properties",["radius"]);var xl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Hs=Math.cos,Ws=Math.sin,Jn=class extends xe{constructor(e,t,n,r,s){typeof r!="number"&&typeof n=="number"&&(r=n);const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve);super(a,!0,!0,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let l in Cl)Object.defineProperty(this,l,Cl[l]);typeof n=="number"&&(this.width=n*2),typeof r=="number"&&(this.height=r*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Jn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*ut,l=n*Hs(a),c=r*Ws(a),d=n*t*Hs(a-et),h=r*t*Ws(a-et),f=n*t*Hs(a+et),p=r*t*Ws(a+et),u=this.vertices[s];u.command=s===0?te.move:te.curve,u.set(l,c),u.controls.left.set(d,h),u.controls.right.set(f,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=this.width/2,n=this.height/2,r=this.vertices.length,s=new Jn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];e[n]=this[n]}return e}},er=Jn;w(er,"Properties",["width","height"]);var Cl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Dg=Math.ceil,Hg=Math.floor,Mn=class extends mn{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"noFill",xe.prototype.noFill),w(this,"noStroke",xe.prototype.noStroke),w(this,"corner",xe.prototype.corner),w(this,"center",xe.prototype.center),w(this,"getBoundingClientRect",xe.prototype.getBoundingClientRect),w(this,"_updateLength",xe.prototype._updateLength);for(let t in Sl)Object.defineProperty(this,t,Sl[t]);this._renderer.type="points",this._renderer.flagVertices=pl.bind(this),this._renderer.bindVertices=gl.bind(this),this._renderer.unbindVertices=ml.bind(this),this._renderer.flagFill=_l.bind(this),this._renderer.flagStroke=yl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new Mn().copy(Ps(Ns({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Mn.Properties.length;t++){const n=Mn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Mn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Mn.Properties.length;n++){const r=Mn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(t=>t.toObject()),G.each(Mn.Properties,function(t){typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n],s=this.vertices[n-1];if(!s)continue;const o=r.x,a=r.y,l=s.x,c=s.y,d=Ms(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=Dg(n),o=Hg(r);let a=0,l;this._renderer.vertices=[],this._renderer.collection=[];for(let c=0;c<this._collection.length;c++)c>=s&&c<=o&&(l=this._collection[c],this._renderer.collection.push(l),this._renderer.vertices[a*2+0]=l.x,this._renderer.vertices[a*2+1]=l.y,a++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}},Ar=Mn;w(Ar,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var Sl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(X.Types.insert,t).unbind(X.Types.remove,n),e instanceof Nn?this._collection=e:this._collection=new Nn(e||[]),this._collection.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}},Wg=Math.cos,jg=Math.sin,Qn=class extends xe{constructor(e,t,n,r){r=Math.max(r||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let s in Bl)Object.defineProperty(this,s,Bl[s]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.radius=n),typeof r=="number"&&(this.sides=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Qn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ut*s+Math.PI/2,a=this._width*Wg(o)/2,l=this._height*jg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?te.move:te.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=new Qn(0,0,0,this.sides);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,t.width=this.width,t.height=this.height,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];e[n]=this[n]}return e}},Vr=Qn;w(Vr,"Properties",["width","height","sides"]);var Bl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},ei=class extends xe{constructor(e,t,n,r,s){typeof s>"u"&&typeof n=="number"&&typeof r=="number"&&(s=Math.floor(Math.min(n,r)/12));const o=[];for(let a=0;a<10;a++)o.push(new ve(0,0,0,0,0,0,a===0?te.move:te.curve));super(o),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagRadius",!1),w(this,"_width",0),w(this,"_height",0),w(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let a in Tl)Object.defineProperty(this,a,Tl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Xg.bind(this),typeof n=="number"&&(this.width=n),typeof r=="number"&&(this.height=r),typeof s=="number"&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<ei.Properties.length;t++){const n=ei.Properties[t];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof Q?r:new Q().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 Q?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let s,o=e/2,a=t/2;s=this.vertices[0],s.x=-(o-n),s.y=-a,s=this.vertices[1],s.x=o-n,s.y=-a,s.controls.left.clear(),s.controls.right.x=n,s.controls.right.y=0,s=this.vertices[2],s.x=o,s.y=-(a-r),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=o,s.y=a-r,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=r,s=this.vertices[4],s.x=o-n,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(o-n),s.y=a,s.controls.left.clear(),s.controls.right.x=-n,s.controls.right.y=0,s=this.vertices[6],s.x=-o,s.y=a-r,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-o,s.y=-(a-r),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-r,s=this.vertices[8],s.x=-(o-n),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=this.width,n=this.height,r=this.radius,s=new ei(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let t=0;t<ei.Properties.length;t++){const n=ei.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},tr=ei;w(tr,"Properties",["width","height","radius"]);var Tl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof Q&&this._radius.unbind(X.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof Q&&this._radius.bind(X.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Xg(){this._flagRadius=!0}var qg=Math.cos,Yg=Math.sin,ti=class extends xe{constructor(e,t,n,r,s){arguments.length<=3&&(r=n,n=r/2),(typeof s!="number"||s<=0)&&(s=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let o in El)Object.defineProperty(this,o,El[o]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new ti().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<ti.Properties.length;t++){const n=ti.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ut*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*qg(o),c=a*Yg(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?te.move:te.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.sides,s=new ti(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let t=0;t<ti.Properties.length;t++){const n=ti.Properties[t];e[n]=this[n]}return e}},Ir=ti;w(Ir,"Properties",["innerRadius","outerRadius","sides"]);var El={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},js,$l=Math.min,Rl=Math.max;De.document&&(js=document.createElement("canvas"));var Ot=class extends mn{constructor(e,t,n,r){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in Nl)Object.defineProperty(this,s,Nl[s]);if(this._renderer.type="text",this._renderer.flagFill=Ug.bind(this),this._renderer.flagStroke=Gg.bind(this),this.value=e,typeof t=="number"&&(this.translation.x=t),typeof n=="number"&&(this.translation.y=n),this.dashes=[],this.dashes.offset=0,!G.isObject(r))return this;for(let s=0;s<Ot.Properties.length;s++){const o=Ot.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(js){const t=js.getContext("2d");t.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const n=t.measureText(e.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}else{const t=this.value.length*this.size*Ot.Ratio,n=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:t,height:n}}}static fromObject(e){const t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new Ot().copy(Ps(Ns({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<Ot.Properties.length;t++){const n=Ot.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Ot(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<Ot.Properties.length;n++){const r=Ot.Properties[n];t[r]=this[r]}return this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let t=0;t<Ot.Properties.length;t++){const n=Ot.Properties[t];e[n]=this[n]}return e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let t,n,r,s,o;this._update(!0),t=e?this.matrix:this.worldMatrix;const{width:a,height:l}=Ot.Measure(this),c=(this._linewidth||0)/2;switch(this.alignment){case"left":n=-c,r=a+c;break;case"right":n=-(a+c),r=c;break;default:n=-(a/2+c),r=a/2+c}switch(this.baseline){case"middle":s=-(l/2+c),o=l/2+c;break;default:s=-(l+c),o=c}const[d,h]=t.multiply(n,s),[f,p]=t.multiply(n,o),[u,g]=t.multiply(r,s),[m,_]=t.multiply(r,o);return s=$l(h,p,g,_),n=$l(d,f,u,m),r=Rl(d,f,u,m),o=Rl(h,p,g,_),{top:s,left:n,right:r,bottom:o,width:r-n,height:o-s}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}},Dt=Ot;w(Dt,"Ratio",.6),w(Dt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var Nl={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.unbind(X.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.bind(X.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.unbind(X.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.bind(X.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,G.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Ug(){this._flagFill=!0}function Gg(){this._flagStroke=!0}var Or=Math.min,zr=Math.max,Ti=class extends mn{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null);for(let t in Pl)Object.defineProperty(this,t,Pl[t]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)Fl.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Ti;for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:Un(e[s]):t[s]=e[s])}return"mask"in e&&(t.mask=n(e.mask)),"id"in e&&(t.id=e.id),t.children=e.children.map(n),t;function n(r){if(r&&r.renderer)switch(r.renderer.type){case"arc-segment":return Mr.fromObject(r);case"circle":return Qi.fromObject(r);case"ellipse":return er.fromObject(r);case"points":return Ar.fromObject(r);case"polygon":return Vr.fromObject(r);case"rectangle":return Fn.fromObject(r);case"rounded-rectangle":return tr.fromObject(r);case"star":return Ir.fromObject(r);case"path":return xe.fromObject(r);case"text":return Dt.fromObject(r);case"group":return Ti.fromObject(r);case"shape":return mn.fromObject(r);case"element":return Xn.fromObject(r)}return r}}copy(e){return super.copy.call(this,e),console.warn("Two.Group.copy is not supported yet."),this}clone(e){const t=new Ti,n=this.children.map(function(r){return r.clone()});return t.add(n),t.opacity=this.opacity,this.mask&&(t.mask=this.mask),t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.className=this.className,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,G.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}corner(){const e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){const n=this.children[t];n.translation.x-=e.left,n.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.children.length;r++){const s=this.children[r];s.isShape&&(s.translation.x-=t,s.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let s=0;s<r.children.length;s++)if(t=n(r.children[s]),t)return t}return null}return n(this)}getByClassName(e){const t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}getByType(e){const t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let s=0;s<r.children.length;s++){const o=r.children[s];n(o)}return t}return n(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){const n=e[t];if(!(n&&n.id))continue;const r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){const t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let r=0;r<e.length;r++){const s=e[r];if(!s||!this.children.ids[s.id])continue;const o=this.children.indexOf(s);o>=0&&this.children.splice(o,1)}return this}getBoundingClientRect(e){let t,n,r,s,o,a;this._update(!0);let l=1/0,c=-1/0,d=1/0,h=-1/0;const f=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const u=this.children[p];if(!(!u.visible||f.test(u._renderer.type))&&(t=u.getBoundingClientRect(e),r=typeof t.top!="number"||G.isNaN(t.top)||!isFinite(t.top),s=typeof t.left!="number"||G.isNaN(t.left)||!isFinite(t.left),o=typeof t.right!="number"||G.isNaN(t.right)||!isFinite(t.right),a=typeof t.bottom!="number"||G.isNaN(t.bottom)||!isFinite(t.bottom),!(r||s||o||a)))if(e){const[g,m]=n.multiply(t.left,t.top),[_,y]=n.multiply(t.right,t.top),[b,S]=n.multiply(t.left,t.bottom),[x,v]=n.multiply(t.right,t.bottom);d=Or(m,y,S,v,d),l=Or(g,_,b,x,l),c=zr(g,_,b,x,c),h=zr(m,y,S,v,h)}else d=Or(t.top,d),l=Or(t.left,l),c=zr(t.right,c),h=zr(t.bottom,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){const r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=this.length;let a=0;const l=r*o,c=s*o;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,l>a+t?(n.beginning=1,n.ending=1):c<a?(n.beginning=0,n.ending=0):l>a&&l<a+t?(n.beginning=(l-a)/t,n.ending=1):c>a&&c<a+t?(n.beginning=0,n.ending=(c-a)/t):(n.beginning=0,n.ending=1),a+=t}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}},Ke=Ti;w(Ke,"Children",vl),w(Ke,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var Pl={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=Ke.InsertChildren.bind(this),n=Ke.RemoveChildren.bind(this),r=Ke.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new vl(e),this._children.bind(X.Types.insert,t),this._children.bind(X.Types.remove,n),this._children.bind(X.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,G.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Fl(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var Lr=class extends xe{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Ml)Object.defineProperty(this,a,Ml[a]);this.vertices[0].command=te.move,this.vertices[1].command=te.line,this.automatic=!1}};w(Lr,"Properties",["left","right"]);var Ml={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(G.isObject(e))this.vertices.splice(0,1,e);else{const t=new Rt("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(G.isObject(e))this.vertices.splice(1,1,e);else{const t=new Rt("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},tn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Kg={start:"left",middle:"center",end:"right"},Al=["id","class","transform","xmlns","viewBox"],Zg=["x","y","width","height","href","xlink:href"];function Jg(e){return Kg[e]}function Qg(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function nr(e){return e.replace(/svg:/gi,"").toLowerCase()}function Vl(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){const n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function em(e,t){t||(t={});const n=e.split(";");for(let r=0;r<n.length;r++){const s=n[r].split(":"),o=s[0],a=s[1];if(typeof o>"u"||typeof a>"u")continue;const l=o.replace(/\s/g,""),c=a.replace(/\s/g,"");t[l]=c}return t}function tm(e){const t={},n=nm(e),r=Math.max(n.length,e.style.length);for(let s=0;s<r;s++){const o=e.style[s],a=n[s];o&&(t[o]=e.style[o]),a&&(t[a]=e.getAttribute(a))}return t}function nm(e){const t=e.getAttributeNames();for(let n=0;n<Al.length;n++){const r=Al[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function im(e,t){const n=t.split(/[\s,]/),r=-parseFloat(n[0]),s=-parseFloat(n[1]),o=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&s)for(let f=0;f<e.children.length;f++){const p=e.children[f];"translation"in p?p.translation.add(r,s):"x"in p?p.x=r:"y"in p&&(p.y=s)}const l=typeof e.x=="number",c=typeof e.y=="number",d=typeof e.width=="number",h=typeof e.height=="number";return l&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(d||h)&&(e.scale=new Q(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new Fn(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Ht(e,t,n){const r={},s={},o={};let a,l,c,d,h,f,p,u,g,m,_,y,b,S,x,v,B;if(e===null)return r;if(De.getComputedStyle){const k=De.getComputedStyle(e);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)f=e.attributes[a],/style/i.test(f.nodeName)?em(f.value,o):s[f.nodeName]=f.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&G.defaults(r,n),G.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;switch(p=ki(l),t._renderer.type){case"linear-gradient":Vl(p,t.left),Vl(p,t.right);break;case"radial-gradient":t.center.x+=p.translateX,t.center.y+=p.translateY,t.focal.x+=p.translateX,t.focal.y+=p.translateY,t.radius*=Math.max(p.scaleX,p.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;p=ki(l),t.translation.set(p.translateX,p.translateY),t.rotation=Math.PI*(p.rotation/180),t.scale=new Q(p.scaleX,p.scaleY),u=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),u&&(t.translation.x=u),g&&(t.translation.y=g);break;case"visible":if(t instanceof Ke){t._visible=d;break}t.visible=d;break;case"stroke-linecap":if(t instanceof Ke){t._cap=d;break}t.cap=d;break;case"stroke-linejoin":if(t instanceof Ke){t._join=d;break}t.join=d;break;case"stroke-miterlimit":if(t instanceof Ke){t._miter=d;break}t.miter=d;break;case"stroke-width":if(t instanceof Ke){t._linewidth=parseFloat(d);break}t.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(t instanceof Ke){t._opacity=parseFloat(d);break}t.opacity=parseFloat(d);break;case"clip-path":if(tn.cssBackgroundImage.test(d)&&(m=d.replace(tn.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)&&(y=ze.defs.current.get(m),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],b=nr(y.nodeName),t.mask=ze[b].call(this,y,{}),t._renderer.type){case"text":case"path":t.position.add(t.mask.position),t.mask.position.clear();break}break;case"fill":case"stroke":h=(t instanceof Ke?"_":"")+c,tn.cssBackgroundImage.test(d)?(m=d.replace(tn.cssBackgroundImage,"$1"),ze.defs.current&&ze.defs.current.contains(m)?(y=ze.defs.current.get(m),y.object||(b=nr(y.nodeName),y.object=ze[b].call(this,y,{})),y=y.object):(_=sm(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 Ae,v=t instanceof Ve,S||x||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Rt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.translation[c]=parseFloat(d);break;case"font-family":t instanceof Dt&&(t.family=d);break;case"font-size":t instanceof Dt&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Rt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.size=parseFloat(d));break;case"font-weight":t instanceof Dt&&(t.weight=d);break;case"font-style":t instanceof Dt&&(t.style=d);break;case"text-decoration":t instanceof Dt&&(t.decoration=d);break;case"line-height":t instanceof Dt&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function rm(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||nr(e.nodeName)==="#text"||t.add(s.id,s)}}function sm(e){for(;e.parent;)e=e.parent;return e.scene}var ze={svg:function(e){const t=ze.defs.current=new $r,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)rm(n[g],t);const r=ze.g.call(this,e),s=e.getAttribute("viewBox"),o=e.getAttribute("x"),a=e.getAttribute("y"),l=e.getAttribute("width"),c=e.getAttribute("height");r.defs=t;const d=s!==null,h=o!==null,f=a!==null,p=l!==null,u=c!==null;return h&&(r.x=parseFloat(o.replace(tn.unitSuffix,""))),f&&(r.y=parseFloat(a.replace(tn.unitSuffix,""))),p&&(r.width=parseFloat(l.replace(tn.unitSuffix,""))),u&&(r.height=parseFloat(c.replace(tn.unitSuffix,""))),d&&im(r,s),delete ze.defs.current,r},defs:function(e){return null},use:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Rt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!ze.defs.current.contains(s))return n=new Rt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=ze.defs.current.get(s).cloneNode(!0);for(let c=0;c<e.attributes.length;c++){const d=e.attributes[c],h=Zg.includes(d.nodeName),f=!a.hasAttribute(d.nodeName);(h||f)&&a.setAttribute(d.nodeName,d.value)}const l=nr(a.nodeName);return ze[l].call(this,a,t)},g:function(e,t){const n=new Ke;Ht.call(this,e,n,t),this.add(n);const r=tm.call(this,e);for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s],l=a.nodeName;if(!l)return;const c=nr(l);if(c in ze){const d=ze[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(e,t){let n;typeof e=="string"?n=e:n=e.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new xe(r,!0);return s.stroke="none",s.fill="black",Ht.call(this,e,s,t),s},polyline:function(e,t){const n=ze.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e=="string"?(n=e,e=null):n=e.getAttribute("d");let r=[],s=!1,o=!1;if(n){let l=new ve,c,d,h=n.match(/[a-df-z][^a-df-z]*/gi);const f=h.length-1;G.each(h.slice(0),function(p,u){const g=p.slice(1).trim().match(tn.path),m=p[0],_=m.toLowerCase();let y,b,S,x,v;const B=[];switch(u===0&&(h=[]),_){case"h":case"v":g.length>1&&(y=1);break;case"m":case"l":case"t":g.length>2&&(y=2);break;case"s":case"q":g.length>4&&(y=4);break;case"c":g.length>6&&(y=6);break;case"a":g.length>7&&(y=7);break}if(y){for(b=0,S=g.length,v=0;b<S;b+=y){if(x=m,v>0)switch(m){case"m":x="l";break;case"M":x="L";break}B.push(x+g.slice(b,b+y).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(p)}),G.each(h,function(p,u){let g,m,_;const y=p[0],b=y.toLowerCase();d=p.slice(1).trim().match(tn.path),o=y===b;let S,x,v,B,k,R,P,N,W,q,F,M,I,Z,T,$,j;switch(b){case"z":if(u>=f)s=!0;else{m=l.x,_=l.y,g=new ve(m,_,void 0,void 0,void 0,void 0,te.close);for(let z=r.length-1;z>=0;z--){const Y=r[z];if(/m/i.test(Y.command)){l=Y;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)?te.move:te.line),o&&g.addSelf(l),l=g;break;case"h":case"v":q=/h/i.test(b)?"x":"y",F=/x/i.test(q)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,te.line),g[q]=parseFloat(d[0]),g[F]=l[F],o&&(g[q]+=l[q]),l=g;break;case"c":case"s":S=l.x,x=l.y,c||(c=new Q),/c/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),R=parseFloat(d[3]),P=parseFloat(d[4]),N=parseFloat(d[5])):(W=As(l,c,o),v=W.x,B=W.y,k=parseFloat(d[0]),R=parseFloat(d[1]),P=parseFloat(d[2]),N=parseFloat(d[3])),o&&(v+=S,B+=x,k+=S,R+=x,P+=S,N+=x),l.controls.right.set(v-l.x,B-l.y),g=new ve(P,N,k-P,R-N,void 0,void 0,te.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,x=l.y,c||(c=new Q),/q/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),R=parseFloat(d[1]),P=parseFloat(d[2]),N=parseFloat(d[3])):(W=As(l,c,o),v=W.x,B=W.y,k=W.x,R=W.y,P=parseFloat(d[0]),N=parseFloat(d[1])),o&&(v+=S,B+=x,k+=S,R+=x,P+=S,N+=x),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),g=new ve(P,N,k-P,R-N,void 0,void 0,te.curve),l=g,c=g.controls.left;break;case"a":S=l.x,x=l.y,I=parseFloat(d[0]),Z=parseFloat(d[1]),T=parseFloat(d[2]),$=parseFloat(d[3]),j=parseFloat(d[4]),P=parseFloat(d[5]),N=parseFloat(d[6]),o&&(P+=S,N+=x),M=new ve(P,N),M.command=te.arc,M.rx=I,M.ry=Z,M.xAxisRotation=T,M.largeArcFlag=$,M.sweepFlag=j,g=M,l=M,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new xe(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},G.each(n.vertices,function(l){l.subSelf(a.centroid)}),Ht.call(this,e,n,t),n.translation.addSelf(a.centroid),n},circle:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("r")),o=new Qi(0,0,s);return o.stroke="none",o.fill="black",Ht.call(this,e,o,t),o.translation.x=n,o.translation.y=r,o},ellipse:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("rx")),o=parseFloat(e.getAttribute("ry")),a=new er(0,0,s,o);return a.stroke="none",a.fill="black",Ht.call(this,e,a,t),a.translation.x=n,a.translation.y=r,a},rect:function(e,t){const n=parseFloat(e.getAttribute("rx")),r=parseFloat(e.getAttribute("ry"));if(!G.isNaN(n)||!G.isNaN(r))return ze["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Fn(0,0,s,o);return c.stroke="none",c.fill="black",Ht.call(this,e,c,t),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(e,t){const n=parseFloat(e.getAttribute("rx"))||0,r=parseFloat(e.getAttribute("ry"))||0,s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Q(n,r),d=new tr(0,0,s,o,c);return d.stroke="none",d.fill="black",Ht.call(this,e,d,t),d.translation.x+=a,d.translation.y+=l,d},line:function(e,t){const n=parseFloat(e.getAttribute("x1")),r=parseFloat(e.getAttribute("y1")),s=parseFloat(e.getAttribute("x2")),o=parseFloat(e.getAttribute("y2")),a=new Lr(n,r,s,o).noFill();return Ht.call(this,e,a,t),a},lineargradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("x1")||0),o=parseFloat(e.getAttribute("y1")||0),a=parseFloat(e.getAttribute("x2")||0),l=parseFloat(e.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let p=0;p<e.children.length;p++){const u=e.children[p];let g=u.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=u.getAttribute("stop-color"),_=u.getAttribute("stop-opacity"),y=u.getAttribute("style"),b;m===null&&(b=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,m=b&&b.length>1?b[1]:void 0),_===null?(b=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,_=b&&b.length>1?parseFloat(b[1]):1):_=parseFloat(_),h.push(new en(g,m,_))}const f=new Ae(s,o,a,l,h);return f.spread=r,f.units=n,Ht.call(this,e,f,t),f},radialgradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("cx"))||0,o=parseFloat(e.getAttribute("cy"))||0,a=parseFloat(e.getAttribute("r")),l=parseFloat(e.getAttribute("fx")),c=parseFloat(e.getAttribute("fy"));G.isNaN(l)&&(l=s),G.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const f=[];for(let u=0;u<e.children.length;u++){const g=e.children[u];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let _=g.getAttribute("stop-color"),y=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),S;_===null&&(S=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,_=S&&S.length>1?S[1]:void 0),y===null?(S=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=S&&S.length>1?parseFloat(S[1]):1):y=parseFloat(y),f.push(new en(m,_,y))}const p=new Ve(s,o,a,f,l,c);return p.spread=r,p.units=n,Ht.call(this,e,p,t),p},text:function(e,t){const n=Jg(e.getAttribute("text-anchor"))||"left",r=Qg(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new Dt(s);return Ht.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return ze.defs.current&&!ze.defs.current.contains(e.id)&&ze.defs.current.add(e.id,e),null},image:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Rt("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(e.getAttribute("x"))||0,o=parseFloat(e.getAttribute("y"))||0,a=parseFloat(e.getAttribute("width")),l=parseFloat(e.getAttribute("height")),c=new Fr(r,s,o);return G.isNaN(a)||(c.width=a),G.isNaN(l)||(c.height=l),Ht.call(this,e,c,t),c}};function Il(e,t){const n=new XMLHttpRequest;return n.open("GET",e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Ei=class extends Fn{constructor(e,t,n,r){super(t,n,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null);for(let s in Ol)Object.defineProperty(this,s,Ol[s]);this._renderer.flagTextures=om.bind(this),this._renderer.bindTextures=am.bind(this),this._renderer.unbindTextures=lm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(zl.bind(this)):this.textures=[zl(e)],this.origin=new Q,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Ei.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ei.Properties.length;t++){const n=Ei.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=G.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const t=new Ei(this.textures,this.translation.x,this.translation.y,this.frameRate);return t._loop=this._loop,this._playing&&t.play(),e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.textures=this.textures.map(function(t){return t.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._textures;let t,n,r,s,o,a,l,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,G.isNaN(this._lastFrame)&&(this._lastFrame=s-1),r=G.performance.now()-this._startTime,c=this._lastFrame+1,o=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r=r%o:r=Math.min(r,o),l=Mt(this._firstFrame,c,r/o),l=Math.floor(l),l!==this._index&&(this._index=l,a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=a,l>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Te))&&(a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}},Dr=Ei;w(Dr,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Dr,"DefaultFrameRate",30);var Ol={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){const t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(X.Types.insert,t).unbind(X.Types.remove,n),this._textures=new Nn((e||[]).slice(0)),this._textures.bind(X.Types.insert,t).bind(X.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function om(){this._flagTextures=!0}function am(e){let t=e.length;for(;t--;)e[t].bind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function lm(e){let t=e.length;for(;t--;)e[t].unbind(X.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function zl(e){if(e instanceof Te)return e;if(typeof e=="string")return new Te(e)}var Xs=[],qs=Math.max,cm=Math.min,Ll=Math.abs,Hr=Math.sin,Wr=Math.cos,dm=Math.acos,jr=Math.sqrt,Be={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Be?e:"path"},group:{renderChild:function(e){const t=Be.getRendererType(e._renderer.type);Be[t].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=Xr(t),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,o&&(e.save(),s||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r){const a=Be.getRendererType(r._renderer.type);Be[a].render.call(r,e,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Be.getRendererType(l._renderer.type);Be[c].render.call(l,e)}return o&&e.restore(),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(e,t,n){let r,s,o,a,l,c,d,h,f,p,u,g,m,_,y,b,S,x,v,B,k,R,P,N,W,q,F,M,I,Z,T,$,j,z;if(z=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,I=this._mask,Z=this._clip,l=this._opacity*(z||1),c=this._visible,!t&&(!c||Z||l===0))return this;if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,f=this._miter,p=this._closed,u=this._renderer.vertices,g=u.length,m=g-1,T=Xr(r),j=this.dashes,T||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),I){const se=Be.getRendererType(I._renderer.type);Be[se].render.call(I,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const se=Be.getRendererType(a._renderer.type);Be[se].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const se=Be.getRendererType(s._renderer.type);Be[se].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),f&&(e.miterLimit=f),h&&(e.lineJoin=h),!p&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),j&&j.length>0&&(e.lineDashOffset=j.offset||0,e.setLineDash(j)),e.beginPath();let Y,V,O,J,ge,re,he;for(let se=0;se<g;se++)switch(b=u[se],F=b.x,M=b.y,b.command){case te.close:e.closePath();break;case te.arc:Y=b.rx,V=b.ry,O=b.xAxisRotation,J=b.largeArcFlag,ge=b.sweepFlag,_=p?At(se-1,g):qs(se-1,0),y=u[_],re=y.x,he=y.y,Be.renderSvgArcCommand(e,re,he,Y,V,J,ge,O,F,M);break;case te.curve:_=p?At(se-1,g):Math.max(se-1,0),y=u[_],P=y.controls&&y.controls.right||Q.zero,N=b.controls&&b.controls.left||Q.zero,y._relative?(k=P.x+y.x,R=P.y+y.y):(k=P.x,R=P.y),b._relative?(v=N.x+b.x,B=N.y+b.y):(v=N.x,B=N.y),e.bezierCurveTo(k,R,v,B,F,M),se>=m&&p&&(S=x,W=b.controls&&b.controls.right||Q.zero,q=S.controls&&S.controls.left||Q.zero,b._relative?(k=W.x+b.x,R=W.y+b.y):(k=W.x,R=W.y),S._relative?(v=q.x+S.x,B=q.y+S.y):(v=q.x,B=q.y),F=S.x,M=S.y,e.bezierCurveTo(k,R,v,B,F,M));break;case te.line:e.lineTo(F,M);break;case te.move:x=b,e.moveTo(F,M);break}return p&&e.closePath(),!Z&&!n&&(Be.isHidden.test(a)||($=a._renderer&&a._renderer.offset,$&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),$&&e.restore()),Be.isHidden.test(s)||($=s._renderer&&s._renderer.offset,$&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),$&&e.restore())),T||e.restore(),Z&&!n&&e.clip(),j&&j.length>0&&e.setLineDash(Xs),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,f,p,u,g,m,_,y,b;if(b=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(b||1),c=this._visible,!t&&(!c||l===0))return this;if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,f=h.length,m=Xr(r),y=this.dashes,d=this._size,m||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")e.fillStyle=a;else{const v=Be.getRendererType(a._renderer.type);Be[v].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const v=Be.getRendererType(s._renderer.type);Be[v].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o)}typeof l=="number"&&(e.globalAlpha=l),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=ki(x[0],x[3],x[1],x[4],x[2],x[5]),S/=Math.max(x.scaleX,x.scaleY));for(let v=0;v<f;v++)p=h[v],u=p.x,g=p.y,e.moveTo(u+S,g),e.arc(u,g,S,0,ut);return n||(Be.isHidden.test(a)||(_=a._renderer&&a._renderer.offset,_&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),_&&e.restore()),Be.isHidden.test(s)||(_=s._renderer&&s._renderer.offset,_&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),_&&e.restore())),m||e.restore(),y&&y.length>0&&e.setLineDash(Xs),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),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;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,f=this._fill,p=this._decoration,u=this._direction,g=Xr(c),m=f._renderer&&f._renderer.offset&&d._renderer&&d._renderer.offset,_=this.dashes,y=Be.alignments[this._alignment]||this._alignment,b=Be.baselines[this._baseline]||this._baseline;let S,x,v,B,k,R,P,N,W,q,F;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const M=Be.getRendererType(a._renderer.type);Be[M].render.call(a,e,!0)}if(m||(e.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),e.textAlign=y,e.textBaseline=b,e.direction=u,f)if(typeof f=="string")e.fillStyle=f;else{const M=Be.getRendererType(f._renderer.type);Be[M].render.call(f,e,this),e.fillStyle=f._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const M=Be.getRendererType(d._renderer.type);Be[M].render.call(d,e,this),e.strokeStyle=d._renderer.effect}h&&(e.lineWidth=h)}if(typeof s=="number"&&(e.globalAlpha=s),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),!l&&!n&&(Be.isHidden.test(f)||(f._renderer&&f._renderer.offset?(R=f._renderer.scale.x,P=f._renderer.scale.y,e.save(),e.translate(-f._renderer.offset.x,-f._renderer.offset.y),e.scale(R,P),S=this._size/f._renderer.scale.y,x=this._leading/f._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),v=f._renderer.offset.x/f._renderer.scale.x,B=f._renderer.offset.y/f._renderer.scale.y,e.fillText(this.value,v,B),e.restore()):e.fillText(this.value,0,0)),Be.isHidden.test(d)||(d._renderer&&d._renderer.offset?(R=d._renderer.scale.x,P=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(R,P),S=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,e.lineWidth=k,e.strokeText(this.value,v,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(p)){const M=e.measureText(this.value);let I=1;switch(p){case"underline":W=M.actualBoundingBoxDescent,F=M.actualBoundingBoxDescent;break;case"strikethrough":W=0,F=0,I=.5;break}switch(b){case"top":W+=this._size*I,F+=this._size*I;break;case"baseline":case"bottom":W-=this._size*I,F-=this._size*I;break}switch(y){case"left":case"start":N=0,q=M.width;break;case"right":case"end":N=-M.width,q=0;break;default:N=-M.width/2,q=M.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(N,W),e.lineTo(q,F),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),_&&_.length>0&&e.setLineDash(Xs),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=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 G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=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 G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(e){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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 Q||(this._renderer.offset=new Q),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 Q?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof Q||(this._renderer.scale=new Q),this._scale instanceof Q?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=Ll(r),s=Ll(s);const h=(t-c)/2,f=(n-d)/2,p=Wr(l)*h+Hr(l)*f,u=-Hr(l)*h+Wr(l)*f,g=p*p,m=u*u;let _=r*r,y=s*s;const b=g/_+m/y;if(b>1){const M=jr(b);r=M*r,s=M*s,_=r*r,y=s*s}const S=_*m+y*g,x=(_*y-S)/S;let v=jr(qs(0,x));o===a&&(v=-v);const B=v*r*u/s,k=-v*s*p/r,R=Wr(l)*B-Hr(l)*k+(t+c)/2,P=Hr(l)*B+Wr(l)*k+(n+d)/2,N=Dl(1,0,(p-B)/r,(u-k)/s),W=Dl((p-B)/r,(u-k)/s,(-p-B)/r,(-u-k)/s)%ut,q=N+W;hm(e,R,P,r,s,N,q,a===0,l)}},pt=class extends X{constructor(e){super();const t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=e.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=t),this.scene=new Ke,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=typeof n>"u"?Vs(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&G.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this.trigger(X.Types.resize,e,t,n)}render(){const e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Be.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(pt,"Utils",Be);function hm(e,t,n,r,s,o,a,l,c){const d=a-o,h=xi.Tolerance.epsilon,f=Math.abs(d)<h;let p=At(d,ut);p<h&&(f?p=0:p=ut),l===!0&&!f&&(p===ut?p=-ut:p=p-ut);for(let u=0;u<xt.Resolution;u++){const g=u/(xt.Resolution-1),m=o+g*p;let _=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,v=y-n;_=x*b-v*S+t,y=x*S+v*b+n}e.lineTo(_,y)}}function Dl(e,t,n,r){const s=e*n+t*r,o=jr(e*e+t*t)*jr(n*n+r*r);let a=dm(qs(-1,cm(1,s/o)));return e*r-t*n<0&&(a=-a),a}function Xr(e){return e[0]==1&&e[3]==0&&e[1]==0&&e[4]==1&&e[2]==0&&e[5]==0}var oe={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(e,t){const n=e,r=document.createElementNS(oe.ns,n);return n==="svg"&&(t=G.defaults(t||{},{version:oe.version})),t&&Object.keys(t).length>0&&oe.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(oe.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,s,o="";for(let a=0;a<n;a++){const l=e[a],c=t?At(a-1,n):Math.max(a-1,0),d=e[c];let h,f,p,u,g,m,_,y,b,S,x,v,B,k,R,P=Re(l.x),N=Re(l.y);switch(l.command){case te.close:h=te.close;break;case te.arc:x=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,R=l.sweepFlag,h=te.arc+" "+x+" "+v+" "+B+" "+k+" "+R+" "+P+" "+N;break;case te.curve:_=d.controls&&d.controls.right||Q.zero,y=l.controls&&l.controls.left||Q.zero,d.relative?(p=Re(_.x+d.x),u=Re(_.y+d.y)):(p=Re(_.x),u=Re(_.y)),l.relative?(g=Re(y.x+l.x),m=Re(y.y+l.y)):(g=Re(y.x),m=Re(y.y)),h=(a===0?te.move:te.curve)+" "+p+" "+u+" "+g+" "+m+" "+P+" "+N;break;case te.move:s=l,h=te.move+" "+P+" "+N;break;default:h=l.command+" "+P+" "+N}a>=r&&t&&(l.command===te.curve&&(f=s,b=l.controls&&l.controls.right||l,S=f.controls&&f.controls.left||f,l.relative?(p=Re(b.x+l.x),u=Re(b.y+l.y)):(p=Re(b.x),u=Re(b.y)),f.relative?(g=Re(S.x+f.x),m=Re(S.y+f.y)):(g=Re(S.x),m=Re(S.y)),P=Re(f.x),N=Re(f.y),h+=" C "+p+" "+u+" "+g+" "+m+" "+P+" "+N),l.command!==te.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+=te.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=oe.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in oe?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=oe.getRendererType(e._renderer.type);oe[t].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=oe.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=oe.getRendererType(s._renderer.type);oe[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(oe.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(oe.group.removeChild,n),this._flagOrder&&this.children.forEach(oe.group.orderChild,n),this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,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),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=oe.toString(this._renderer.vertices,this._closed);t.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,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=oe.getRendererType(this._stroke._renderer.type);oe[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?oe.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=oe.createElement("path",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=oe.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=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=ki(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=oe.pointsToString(this._renderer.collection,r);t.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,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=oe.getRendererType(this._stroke._renderer.type);oe[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?oe.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=oe.createElement("path",t),e.appendChild(this._renderer.elem)),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),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"]=oe.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t["dominant-baseline"]=oe.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=oe.getRendererType(this._fill._renderer.type);oe[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=oe.getRendererType(this._stroke._renderer.type);oe[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?oe.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=oe.createElement("text",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=oe.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=oe.getRendererType(this._mask._renderer.type);oe[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){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.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?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(e,t){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.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?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(e,t){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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 Q?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof Q?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?oe.setAttributes(this._renderer.image,r):this._renderer.image=oe.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&oe.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=oe.createElement("pattern",n)),this._renderer.elem.parentNode===null&&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),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Hl=class extends X{constructor(e){super(),this.domElement=e.domElement||oe.createElement("svg"),this.scene=new Ke,this.scene.parent=this,this.defs=oe.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(e,t){return this.width=e,this.height=t,oe.setAttributes(this.domElement,{width:e,height:t}),this.trigger(X.Types.resize,e,t)}render(){return oe.group.render.call(this.scene,this.domElement),oe.defs.update(this.domElement),this}};w(Hl,"Utils",oe);var Wt={create:function(e,t,n){const r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const o=e.getShaderInfoLog(r);throw e.deleteShader(r),new Rt("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
40
|
+
***************************************************************************** */var Br=function(){return Br=Object.assign||function(t){for(var n,r=1,s=arguments.length;r<s;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Br.apply(this,arguments)},Uu={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},gn={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Rs=500,Gu=function(){function e(t,n){return this.core=t,this.$LG=n,this.settings=Br(Br({},Uu),this.core.settings),this}return e.prototype.buildTemplates=function(){var t=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(t+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(t)},e.prototype.enableZoom=function(t){var n=this,r=this.settings.enableZoomAfter+t.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&t.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(t.detail.index).addClass("lg-zoomable"),t.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(gn.slideItemLoad+".zoom",this.enableZoom.bind(this))},e.prototype.getDragCords=function(t){return{x:t.pageX,y:t.pageY}},e.prototype.getSwipeCords=function(t){var n=t.touches[0].pageX,r=t.touches[0].pageY;return{x:n,y:r}},e.prototype.getDragAllowedAxises=function(t,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),s=0,o=0,a=r.getBoundingClientRect();t?(s=r.offsetHeight*t,o=r.offsetWidth*t):n?(s=a.height+n*a.height,o=a.width+n*a.width):(s=a.height,o=a.width);var l=s>this.containerRect.height,c=o>this.containerRect.width;return{allowX:c,allowY:l}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(t,n,r,s){if(!(Math.abs(n)<=0)){var o=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;t===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),h=d.allowY,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 p=this.getPossibleSwipeDragCords(n),f,g,m=o-this.pageX,y=a-this.pageY;if(t-n>1){var _=(t-n)/Math.abs(n);m=(n<0?-m:m)+this.left*(_+(n<0?-1:1)),y=(n<0?-y:y)+this.top*(_+(n<0?-1:1)),f=m/_,g=y/_}else{var _=(t-n)*n;f=m*_,g=y*_}r&&(u?this.isBeyondPossibleLeft(f,p.minX)?f=p.minX:this.isBeyondPossibleRight(f,p.maxX)&&(f=p.maxX):t>1&&(f<p.minX?f=p.minX:f>p.maxX&&(f=p.maxX)),h?this.isBeyondPossibleTop(g,p.minY)?g=p.minY:this.isBeyondPossibleBottom(g,p.maxY)&&(g=p.maxY):t>1&&(g<p.minY?g=p.minY:g>p.maxY&&(g=p.maxY))),this.setZoomStyles({x:f,y:g,scale:t}),this.left=f,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)},Rs),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")}},Rs+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},Rs+110)}},e.prototype.getNaturalWidth=function(t){var n=this.core.getSlideItem(t).find(".lg-image").first(),r=this.core.galleryItems[t].width;return r?parseFloat(r):n.get().naturalWidth},e.prototype.getActualSizeScale=function(t,n){var r,s;return t>=n?(r=t/n,s=r||2):s=1,s},e.prototype.getCurrentImageActualSizeScale=function(){var t=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=t.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},e.prototype.getPageCords=function(t){var n={};if(t)n.x=t.pageX||t.touches[0].pageX,n.y=t.pageY||t.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},e.prototype.setPageCords=function(t){var n=this.getPageCords(t);this.pageX=n.x,this.pageY=n.y},e.prototype.manageActualPixelClassNames=function(){var t=this.core.getElementById("lg-actual-size");t.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(t){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),t>1},e.prototype.getScale=function(t){var n=this.getCurrentImageActualSizeScale();return t<1?t=1:t>n&&(t=n),t},e.prototype.init=function(){var t=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){t.$LG(r.target).hasClass("lg-image")&&t.setActualSize(t.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var s=t.$LG(r.target);r.touches.length===1&&s.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),t.setActualSize(t.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on(gn.containerResize+".zoom "+gn.rotateRight+".zoom "+gn.rotateLeft+".zoom "+gn.flipHorizontal+".zoom "+gn.flipVertical+".zoom",function(){if(!(!t.core.lgOpened||!t.isImageSlide(t.core.index)||t.core.touchAction)){var r=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();t.top=0,t.left=0,t.setZoomEssentials(),t.setZoomSwipeStyles(r,{x:0,y:0}),t.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){t.core.lgOpened&&(t.scrollTop=t.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(t.isImageSlide(t.core.index)){var r=0;t.imageReset&&(t.resetImageTranslate(t.core.index),r=50),setTimeout(function(){var s=t.scale-t.settings.scale;s<1&&(s=1),t.beginZoom(s),t.zoomImage(s,-t.settings.scale,!0,!t.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){t.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){t.setActualSize(t.core.index)}),this.core.LGel.on(gn.beforeOpen+".zoom",function(){t.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(gn.afterOpen+".zoom",function(){t.scrollTop=t.$LG(window).scrollTop(),t.pageX=t.core.outer.width()/2,t.pageY=t.core.outer.height()/2+t.scrollTop,t.scale=1}),this.core.LGel.on(gn.afterSlide+".zoom",function(r){var s=r.detail.prevIndex;t.scale=1,t.positionChanged=!1,t.zoomInProgress=!1,t.resetZoom(s),t.resetImageTranslate(s),t.isImageSlide(t.core.index)&&t.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var t=this.scale+this.settings.scale;this.settings.infiniteZoom||(t=this.getScale(t)),this.beginZoom(t),this.zoomImage(t,Math.min(this.settings.scale,t-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(t){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(t!==void 0?t:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(t){return Math.sqrt((t.touches[0].pageX-t.touches[1].pageX)*(t.touches[0].pageX-t.touches[1].pageX)+(t.touches[0].pageY-t.touches[1].pageY)*(t.touches[0].pageY-t.touches[1].pageY))},e.prototype.pinchZoom=function(){var t=this,n=0,r=!1,s=1,o=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=t.core.getSlideItem(t.core.index),!!t.isImageSlide(t.core.index)&&l.touches.length===2){if(l.preventDefault(),t.core.outer.hasClass("lg-first-slide-loading"))return;s=t.scale||1,t.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),t.setPageCords(l),t.resetImageTranslate(t.core.index),t.core.touchAction="pinch",n=t.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&t.core.touchAction==="pinch"&&(t.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=t.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){o=t.scale;var h=Math.max(1,s+-d*.02);t.scale=Math.round((h+Number.EPSILON)*100)/100;var 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 p=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(s&&(this.isBeyondPossibleTop(u.y,p.minY)?u.y=p.minY:this.isBeyondPossibleBottom(u.y,p.maxY)&&(u.y=p.maxY)),r&&(this.isBeyondPossibleLeft(u.x,p.minX)?u.x=p.minX:this.isBeyondPossibleRight(u.x,p.maxX)&&(u.x=p.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(p){if(t.isImageSlide(t.core.index)&&(u=t.core.getSlideItem(t.core.index),(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))&&p.touches.length===1&&t.core.outer.hasClass("lg-zoomed"))){p.preventDefault(),l=new Date,t.core.touchAction="zoomSwipe",h=t.core.getSlideItem(t.core.index).find(".lg-img-wrap").first();var f=t.getDragAllowedAxises(0);a=f.allowY,o=f.allowX,(o||a)&&(n=t.getSwipeCords(p)),d=t.getPossibleSwipeDragCords(),t.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(p){if(p.touches.length===1&&t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){p.preventDefault(),t.core.touchAction="zoomSwipe",r=t.getSwipeCords(p);var f=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,f))}}),this.core.$inner.on("touchend.lg",function(p){if(t.core.touchAction==="zoomSwipe"&&(t.$LG(p.target).hasClass("lg-item")||u.get().contains(p.target))){if(p.preventDefault(),t.core.touchAction=void 0,t.core.outer.removeClass("lg-zoom-dragging"),!s)return;s=!1,c=new Date;var f=c.valueOf()-l.valueOf();t.touchendZoom(n,r,o,a,f)}})},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(p){if(t.isImageSlide(t.core.index)){var f=t.core.getSlideItem(t.core.index);if(t.$LG(p.target).hasClass("lg-item")||f.get().contains(p.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(p.target).hasClass("lg-object")&&(a||l)&&(p.preventDefault(),n=t.getDragCords(p),h=t.getPossibleSwipeDragCords(),s=!0,t.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(p){if(s){o=!0,r=t.getDragCords(p);var f=t.getZoomSwipeCords(n,r,a,l,h);t.setZoomSwipeStyles(u,f)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(p){if(s){if(d=new Date,s=!1,t.core.outer.removeClass("lg-zoom-dragging"),o&&(n.x!==r.x||n.y!==r.y)){r=t.getDragCords(p);var f=d.valueOf()-c.valueOf();t.touchendZoom(n,r,a,l,f)}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 Ku={ref:"gallery-container",class:"lightgallery-wrapper"},Zu={},xa=i.defineComponent({...Zu,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(e){const t=e,n={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.onFlipVertical},r=i.useTemplateRef("gallery-container"),s=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const o=await import("lightgallery");s.value=o.default(r.value,{...t.settings}),D.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var o;s.value&&((o=s.value)==null||o.destroy(),s.value=null)}),(o,a)=>(i.openBlock(),i.createElementBlock("div",Ku,[i.renderSlot(o.$slots,"default")],512))}}),st=class st{static init(){st.isInitialized||(st.isInitialized=!0,st.windowResizeHandler(),window.addEventListener("resize",st.windowResizeHandler))}static destroy(){window.removeEventListener("resize",st.windowResizeHandler),st.isInitialized=!1}static getDeviceTypeByResolution(){const t=Y.AppConfigProvider.getConfig().deviceTypeByResolution;return window.innerWidth<t.tablet?qe.phone:window.innerWidth<t.laptop?qe.tablet:qe.laptop}static initRefDependingOnDeviceResolution(t,n,r){const s=i.ref(r);return st.setRefValueDependingOnDeviceResolution(s,t,n,r),st.refsDependingOnDeviceResolution.push({r:s,phoneValue:t,tabletValue:n,defaultValue:r}),s}static isPhoneDevice(){return st.getDeviceTypeByResolution()===qe.phone}static isTabletDevice(){return st.getDeviceTypeByResolution()===qe.tablet}static isLaptopDevice(){return st.getDeviceTypeByResolution()===qe.laptop}static setRefValueDependingOnDeviceResolution(t,n,r,s){switch(st.getDeviceTypeByResolution()){case qe.phone:t.value=n;break;case qe.tablet:t.value=r;break;default:t.value=s;break}}static windowResizeHandler(){D.forEach(st.refsDependingOnDeviceResolution,t=>{st.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};C(st,"isInitialized",!1),C(st,"refsDependingOnDeviceResolution",[]);let vt=st;const Ju=["href"],Qu=["src","alt"],ef={},Ca=i.defineComponent({...ef,__name:"image-gallery",props:{images:{}},setup(e,{expose:t}){const n=i.ref(!1),r=i.ref(!1),s=i.ref({plugins:[Yu,Gu],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),o=()=>window.innerWidth*(vt.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=ka,p=I.NPopover;return i.openBlock(),i.createBlock(p,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:h[3]||(h[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:h[0]||(h[0]=f=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(u)])])]),default:i.withCtx(()=>[i.createVNode(xa,{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,(f,g)=>(i.openBlock(),i.createElementBlock("a",{key:g,href:f.image},[i.createElementVNode("img",{src:f.preview,alt:`Изображение #${g+1}`},null,8,Qu)],8,Ju))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),tf={class:"flex flex-col text-sm"},nf={},rf=i.defineComponent({...nf,__name:"product-stock-count",props:{product:{}},setup(e){return(t,n)=>{const r=Es,s=I.NPopover;return i.openBlock(),i.createBlock(s,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(t.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",tf,[(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})}}}),sf={class:"flex flex-row justify-between"},of={key:0},af={class:"ml-2 align-sub"},lf={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},cf={class:"@container"},df={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},hf={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},uf={class:"text-sc-dark-grey"},ff={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},pf={class:"text-gray-600"},gf={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},mf={key:3,class:"underline decoration-dashed"},yf={key:4,class:"sc-product-pack whitespace-nowrap"},_f={class:"text-gray-600"},bf={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},wf={class:"text-gray-600"},vf={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},kf={key:0},xf={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Cf={},Yi=i.defineComponent({...Cf,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){const n=e,r=i.computed(()=>D.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),s=i.computed(()=>D.sortBy(n.product.priceCoefficients,["coefficient.slug"])),o=i.computed(()=>{var h,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(()=>D.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return t({showProductImagesPreview:l}),(h,u)=>{var _,b,S,x,v;const p=ka,f=I.NText,g=va,m=Es,y=I.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",sf,[i.createVNode(f,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>[i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&h.eventEmitter}),onClick:d},i.toDisplayString(h.product.name),3),h.product.onOrder?(i.openBlock(),i.createElementBlock("span",of," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",af,[h.product.images&&h.product.images.length>0?(i.openBlock(),i.createBlock(Ca,{key:0,ref:"image-gallery",images:h.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",lf,[i.createVNode(p)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]),_:1}),h.showProductAddToCartButton||h.showProductEditButton||h.showProductRequiredButton||((_=h.productContextButtonsConfig)==null?void 0:_.length)>0?(i.openBlock(),i.createBlock(g,{key:0,product:h.product,"event-emitter":h.eventEmitter,"show-product-add-to-cart-button":h.showProductAddToCartButton,"show-product-edit-button":h.showProductEditButton,"show-product-required-button":h.showProductRequiredButton,"product-context-buttons-config":h.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",cf,[i.createElementVNode("div",df,[h.product.supplierSku?(i.openBlock(),i.createElementBlock("div",hf,[u[0]||(u[0]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",uf,i.toDisplayString(h.product.supplierSku),1)])):i.createCommentVNode("",!0),h.showCode?(i.openBlock(),i.createElementBlock("span",ff,[u[1]||(u[1]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",pf,i.toDisplayString(h.product.code),1)])):i.createCommentVNode("",!0),h.product.stockCount&&h.product.stockCount.length>0?(i.openBlock(),i.createBlock(rf,{key:2,product:h.product},{default:i.withCtx(()=>[i.createElementVNode("span",gf,[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",mf," Нет в наличии ")),(S=(b=h.product)==null?void 0:b.properties)!=null&&S.pack?(i.openBlock(),i.createElementBlock("span",yf,[u[3]||(u[3]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",_f,i.toDisplayString((v=(x=h.product)==null?void 0:x.properties)==null?void 0:v.pack),1)])):i.createCommentVNode("",!0),h.showPlanningDates&&o.value?(i.openBlock(),i.createElementBlock("span",bf,[u[4]||(u[4]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",wf,i.toDisplayString(o.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(y,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",vf,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,B=>(i.openBlock(),i.createBlock(Cr,{key:B.coefficient.slug,product:h.product,"cost-field-name":B.coefficient.slug??"","event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-price-history":h.showPriceHistory,"show-cost-date":h.showCostDate,"currency-rates":h.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","show-cost-date","currency-rates"]))),128)),i.createVNode(Cr,{product:h.product,"event-emitter":h.eventEmitter,"allow-price-click":h.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":h.showCostDate,"show-price-history":h.showPriceHistory,"currency-rates":h.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),h.showSlugs||h.showProperties?(i.openBlock(),i.createElementBlock("div",kf,[i.createElementVNode("ul",xf,[h.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:h.product.id,slug:h.product.slug},(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0),h.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(h.product.properties,(B,k)=>(i.openBlock(),i.createElementBlock("li",{key:k}," ("+i.toDisplayString(k)+"): "+i.toDisplayString(B),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Sf=(e,t,n)=>({key:e,title:t,className:"align-top",resizable:!0,render:r=>i.h(Cr,{product:r,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),Bf=(e,t)=>{if(e.length===0)return[];const n=[],r={};switch(D.isNil(t.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:s=>{var o,a;return i.h(I.NCheckbox,{checked:!!((o=t.isProductItemSelected)!=null&&o.call(t,s)),disabled:((a=t.isProductItemSelected)==null?void 0:a.call(t,s))==="disabled",onUpdateChecked:l=>{t.eventEmitter.emit("product:checked",{product:s,checked:l})}})}}),vt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,showProductRequiredButton:t.showProductRequiredButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:s=>i.h(Yi,{product:s,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})}),t.showProductCosts&&(D.forEach(e,s=>{D.forEach(s.priceCoefficients,o=>{r[o.coefficient.slug??""]||(r[o.coefficient.slug??""]=o.coefficient)})}),D.forEach(D.sortBy(r,["slug"]),s=>{n.push(Sf(s.slug??"",s.name,t))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:s=>i.h(Cr,{product:s,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})})),(t.showProductEditButton||t.showProductRequiredButton||t.showProductAddToCartButton||!D.isNil(t.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:s=>i.h(va,{product:s,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,showProductRequiredButton:t.showProductRequiredButton,productContextButtonsConfig:t.productContextButtonsConfig})});break}return n},Tf={key:0,class:"pt-0.5"},Ef={key:0},Rf={class:"line-through"},$f={key:0},Nf={key:1},Pf={class:"flex flex-row gap-1"},Ff={key:0},Mf={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Af={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Vf={},If=i.defineComponent({...Vf,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:Function,default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>{var $;return($=t==null?void 0:t.filteredItems)==null?void 0:$[t.categoryItem.id]}),s=i.computed(()=>{var $,M;return D.isArray(($=t.categoryItem)==null?void 0:$.categories)&&((M=t.categoryItem.categories)==null?void 0:M.length)>0}),o=i.computed(()=>{var $;return D.isArray(($=t.categoryItem)==null?void 0:$.products)?t.categoryItem.products:[]}),a=i.computed(()=>Object.entries(t.categoryItem.currencyRates??{}).map(([$,M])=>`${M} руб./${k($)}`).join(", ")),l=i.computed(()=>D.isUndefined(t.filteredItems)||r.value==="*"?o.value:o.value.filter($=>{var U;const M=(U=r.value)==null?void 0:U.products;return D.isArray(M)&&M.includes($.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>D.isFunction(t.showCategoryHideForClientButton)?t.showCategoryHideForClientButton(t.categoryItem):t.showCategoryHideForClientButton),h=i.computed(()=>D.isFunction(t.showCategoryPinButton)?t.showCategoryPinButton(t.categoryItem):t.showCategoryPinButton),u=i.computed(()=>D.isFunction(t.showCategoryRequiredButton)?t.showCategoryRequiredButton(t.categoryItem):t.showCategoryRequiredButton),p=i.computed(()=>D.isFunction(t.showCategoryEditButton)?t.showCategoryEditButton(t.categoryItem):t.showCategoryEditButton),f=i.computed(()=>D.isNil(t.categoryContextButtonsConfig)?[]:D.isFunction(t.categoryContextButtonsConfig)?t.categoryContextButtonsConfig(t.categoryItem):t.categoryContextButtonsConfig),g=i.computed(()=>new Y.ClientCategory(t.categoryItem)),m=i.ref(!1),y=i.ref(!1),_=i.computed(()=>!D.isUndefined(t.isCategoryItemSelected)),b=i.computed(()=>D.isFunction(t.isCategoryItemSelected)?t.isCategoryItemSelected(t.categoryItem):t.isCategoryItemSelected),S=i.computed(()=>J.value&&vt.getDeviceTypeByResolution()===qe.laptop?"auto":"fixed"),x=i.useTemplateRef("collapse-item-reference"),v=i.computed(()=>{var $,M;return(M=($=t.categoryItem.properties)==null?void 0:$.templateCost)==null?void 0:M.priceCoefficient}),B=i.computed(()=>{var $,M;return(M=($=t.categoryItem.properties)==null?void 0:$.templateCost)==null?void 0:M.increasePercent}),k=($,M="ru-RU")=>0 .toLocaleString(M,{style:"currency",currency:$,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),E=$=>{t.eventEmitter.emit("category:checked",{category:t.categoryItem,checked:$,target:x.value})},P=($,M)=>{t.eventEmitter.emit("category:header-click",{categoryItem:t.categoryItem,expanded:M,isLoadingState:m,target:x.value})},N=()=>{t.eventEmitter.emit("category:hide",{category:t.categoryItem,target:x.value})},j=()=>{t.eventEmitter.emit("category:required",{category:t.categoryItem,target:x.value})},X=()=>{t.eventEmitter.emit("category:attach",{category:t.categoryItem,target:x.value})},A=()=>{t.eventEmitter.emit("category:detach",{category:t.categoryItem,target:x.value})},V=()=>{t.eventEmitter.emit("category:edit",{category:t.categoryItem,target:x.value})},L=$=>{t.eventEmitter.emit("category:context-select",{category:t.categoryItem,key:$,target:x.value})},J=i.ref(0),F=i.computed(()=>J.value&&o.value.length>0?Bf(o.value,{eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductAddToCartButton:t.showProductAddToCartButton,isProductItemSelected:t.isProductItemSelected,showProductEditButton:t.showProductEditButton,showProductRequiredButton:t.showProductRequiredButton,currencyRates:t.categoryItem.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig}):[]),R=D.debounce(()=>{J.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",R)}),window.addEventListener("resize",R),R(),($,M)=>{const U=I.NCheckbox,z=mu,O=I.NTooltip,ee=fu,pe=ba,re=I.NTag,ge=lu,se=su,Pe=I.NButton,Fe=nu,Ke=_a,ze=ya,_t=ma,Jt=ga,Qt=I.NDropdown,Et=I.NDataTable,Mt=I.NAlert,bt=I.NSpin;return i.openBlock(),i.createBlock(wa,{ref:"collapse-item-reference",name:$.categoryItem.id,"data-id":$.categoryItem.id,"onHeader:click":P},{"pre-arrow":i.withCtx(()=>{var He,Ce,lt;return[_.value?(i.openBlock(),i.createElementBlock("div",Tf,[i.createVNode(U,{checked:b.value,disabled:b.value==="disabled","onUpdate:checked":E},null,8,["checked","disabled"])])):i.createCommentVNode("",!0),!d.value&&((He=g.value)!=null&&He.isDisabled)?(i.openBlock(),i.createBlock(O,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(z,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[1]||(M[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((Ce=g.value)==null?void 0:Ce.isFavorite)??!1?(i.openBlock(),i.createBlock(O,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ee,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[2]||(M[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0),((lt=g.value)==null?void 0:lt.isRequired)??!1?(i.openBlock(),i.createBlock(O,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(pe,{class:"pt-1.5"})]),default:i.withCtx(()=>[M[3]||(M[3]=i.createTextVNode(" Доп. продажа ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var He,Ce,lt,wt,Ze;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":$.categoryItem.isHidden,"text-gray-400":(He=g.value)==null?void 0:He.isDisabled})},[i.createVNode(O,{disabled:!$.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString($.categoryItem.name),1)]),default:i.withCtx(()=>[M[4]||(M[4]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:M[0]||(M[0]=i.withModifiers((...Z)=>i.unref(D.noop)&&i.unref(D.noop)(...Z),["prevent","stop"]))},[(Ce=$.categoryItem.properties)!=null&&Ce.m2Price?(i.openBlock(),i.createBlock(re,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((lt=$.categoryItem.properties)==null?void 0:lt.templateCost)&&$.categoryItem.properties.m2PriceRetail&&B.value}),round:""},{default:i.withCtx(()=>{var Z;return[i.createTextVNode(" Средняя стоимость: "+i.toDisplayString($.categoryItem.properties.m2Price)+" руб./м2 ",1),(Z=$.categoryItem.properties)!=null&&Z.templateCost&&$.categoryItem.properties.m2PriceRetail&&B.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[B.value?(i.openBlock(),i.createBlock(re,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[B.value?(i.openBlock(),i.createElementBlock("span",Ef,i.toDisplayString(B.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(re,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",Rf,i.toDisplayString($.categoryItem.properties.m2PriceRetail)+" руб./м2",1)]),_:1},8,["size"])]),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0)]}),_:1},8,["size","class"])):(wt=$.categoryItem.properties)!=null&&wt.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[v.value||B.value?(i.openBlock(),i.createBlock(re,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var Z;return[v.value?(i.openBlock(),i.createElementBlock("span",$f,i.toDisplayString((Z=v.value)==null?void 0:Z.name),1)):i.createCommentVNode("",!0),B.value?(i.openBlock(),i.createElementBlock("span",Nf,i.toDisplayString(B.value>0?"+":"")+i.toDisplayString(B.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(re,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),h.value&&((Ze=g.value)!=null&&Ze.manager)?(i.openBlock(),i.createBlock(re,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:A},{default:i.withCtx(()=>[i.createVNode(O,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var Z,ie;return[i.createElementVNode("span",Pf,[i.createVNode(ge),i.createTextVNode(" "+i.toDisplayString((ie=(Z=g.value)==null?void 0:Z.manager)==null?void 0:ie.name),1)])]}),default:i.withCtx(()=>{var Z,ie;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((ie=(Z=g.value)==null?void 0:Z.manager)==null?void 0:ie.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[$.showSlugs||$.showProperties?(i.openBlock(),i.createElementBlock("div",Ff,[i.createElementVNode("ul",Mf,[$.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:$.categoryItem.id,slug:$.categoryItem.slug},(He,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(He),1))),128)):i.createCommentVNode("",!0),$.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList($.categoryItem.properties,(He,Ce)=>(i.openBlock(),i.createElementBlock("li",{key:Ce}," ("+i.toDisplayString(Ce)+"): "+i.toDisplayString(He),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var He;return[i.createElementVNode("div",Af,[d.value?(i.openBlock(),i.createBlock(O,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Pe,{ghost:!0,size:i.unref(n),onClick:N},{default:i.withCtx(()=>{var Ce;return[(Ce=g.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createBlock(z,{key:1})):(i.openBlock(),i.createBlock(se,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce;return[(Ce=g.value)!=null&&Ce.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(g.value.hidingComment?`. Причина: '${g.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),h.value&&!((He=g.value)!=null&&He.manager)?(i.openBlock(),i.createBlock(O,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Pe,{ghost:!0,size:i.unref(n),onClick:X},{default:i.withCtx(()=>[i.createVNode(Fe)]),_:1},8,["size"])]),default:i.withCtx(()=>{var Ce,lt,wt;return[(Ce=g.value)!=null&&Ce.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((wt=(lt=g.value)==null?void 0:lt.manager)==null?void 0:wt.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createBlock(O,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Pe,{ghost:!0,disabled:u.value==="disabled",size:i.unref(n),onClick:j},{default:i.withCtx(()=>{var Ce;return[(Ce=g.value)!=null&&Ce.isRequired?(i.openBlock(),i.createBlock(ze,{key:1})):(i.openBlock(),i.createBlock(Ke,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>{var Ce;return[(Ce=g.value)!=null&&Ce.isRequired?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Убрать из списка дополнительных продаж")],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Категория, которую клиент должен брать.")],64))]}),_:1})):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createBlock(O,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Pe,{ghost:!0,size:i.unref(n),type:"primary",onClick:V},{default:i.withCtx(()=>[i.createVNode(_t)]),_:1},8,["size"])]),default:i.withCtx(()=>[M[5]||(M[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),f.value.length>0?(i.openBlock(),i.createBlock(Qt,{key:4,options:f.value,size:i.unref(n),trigger:"click",onSelect:L},{default:i.withCtx(()=>[i.createVNode(Pe,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(Jt)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot($.$slots,"default",{},()=>{var He;return[s.value?(i.openBlock(),i.createBlock(Ba,{key:0,"categories-items":$.categoryItem.categories??[],"has-products":c.value||m.value,"event-emitter":$.eventEmitter,"filtered-items":r.value?((He=r.value)==null?void 0:He.categories)??{}:void 0,"is-category-item-selected":$.isCategoryItemSelected,"show-slugs":$.showSlugs,"show-properties":$.showProperties,"allow-name-click":$.allowNameClick,"allow-price-click":$.allowPriceClick,"show-price-history":$.showPriceHistory,"show-cost-date":$.showCostDate,"show-category-required-button":$.showCategoryRequiredButton,"show-category-hide-for-client-button":$.showCategoryHideForClientButton,"show-category-pin-button":$.showCategoryPinButton,"show-category-edit-button":$.showCategoryEditButton,"category-context-buttons-config":$.categoryContextButtonsConfig,"is-product-item-selected":$.isProductItemSelected,"show-product-add-to-cart-button":$.showProductAddToCartButton,"show-product-costs":$.showProductCosts,"show-product-required-button":$.showProductRequiredButton,"show-product-edit-button":$.showProductEditButton,"product-context-buttons-config":$.productContextButtonsConfig},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config"])):i.createCommentVNode("",!0),c.value?(i.openBlock(),i.createBlock(Et,{key:1,columns:F.value,data:l.value,bordered:!0,loading:m.value,remote:!0,"row-key":Ce=>Ce.id,"table-layout":S.value,class:"mt-1"},null,8,["columns","data","loading","row-key","table-layout"])):i.createCommentVNode("",!0),!m.value&&!y.value&&!s.value&&!c.value?(i.openBlock(),i.createBlock(Mt,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(Mt,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),m.value?(i.openBlock(),i.createBlock(bt,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...M[6]||(M[6]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Of=jn(If,[["__scopeId","data-v-0610958f"]]),zf={class:"sc-collapse flex w-full flex-col"},Lf={},Sa=i.defineComponent({...Lf,__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",zf,[i.renderSlot(o.$slots,"default")]))}}),Df={},Ba=i.defineComponent({...Df,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},filteredItems:{default:void 0},isCategoryItemSelected:{},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){const t=e,n=i.inject(xr,"medium"),r=i.computed(()=>D.isUndefined(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(o=>{var a;return!!((a=t.filteredItems)!=null&&a[o.id])})),s=(o,a)=>{if(D.isUndefined(a))return;const l=a[o.id];if(l==="*")return;const c={};return c[o.id]=structuredClone(i.toRaw(l)),c};return(o,a)=>{const l=I.NSpin,c=I.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Sa,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Of,{key:d.id,"category-item":d,"event-emitter":o.eventEmitter,"filtered-items":s(d,o.filteredItems),"is-category-item-selected":o.isCategoryItemSelected,"show-slugs":o.showSlugs,"show-properties":o.showProperties,"allow-name-click":o.allowNameClick,"allow-price-click":o.allowPriceClick,"show-price-history":o.showPriceHistory,"show-cost-date":o.showCostDate,"show-category-required-button":o.showCategoryRequiredButton,"show-category-hide-for-client-button":o.showCategoryHideForClientButton,"show-category-pin-button":o.showCategoryPinButton,"show-category-edit-button":o.showCategoryEditButton,"category-context-buttons-config":o.categoryContextButtonsConfig,"is-product-item-selected":o.isProductItemSelected,"show-product-add-to-cart-button":o.showProductAddToCartButton,"show-product-costs":o.showProductCosts,"show-product-required-button":o.showProductRequiredButton,"show-product-edit-button":o.showProductEditButton,"product-context-buttons-config":o.productContextButtonsConfig},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config"]))),128))]),_:1})):o.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!o.hasProducts&&!o.loading&&o.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Hf={class:"text-sm"},Wf={class:"text-sm"},jf={},qf=i.defineComponent({...jf,__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,p,f,g;const n=e,r=i.ref(new Y.CartItemBase(n.cartItem??new Y.CartItemBase({product:n.product,quantity:((c=(l=n.product)==null?void 0:l.properties)==null?void 0:c.minCount)??1,length:((h=(d=n.product)==null?void 0:d.properties)==null?void 0:h.minLength)||((p=(u=n.product)==null?void 0:u.properties)!=null&&p.ignoreMinCountCheck?0:(g=(f=n.product)==null?void 0:f.properties)==null?void 0:g.minCount)||0}))),s=t,o=i.computed(()=>{var _,b,S,x,v,B,k,E,P;const m=((b=(_=n.product)==null?void 0:_.properties)==null?void 0:b.minLength)??((x=(S=n.product)==null?void 0:S.properties)!=null&&x.ignoreMinCountCheck?0:(B=(v=n.product)==null?void 0:v.properties)==null?void 0:B.minCount),y=(E=(k=n.product)==null?void 0:k.properties)==null?void 0:E.maxLength;return m||y?`(${m?`от ${m}`:""}${m&&y?" ":""}${y?`до ${y}`:""} ${(P=n.product)==null?void 0:P.unit})`:""}),a=()=>{Y.UnitsHelper.productIsMeasurable(n.product)||delete r.value.length,s("submit",r.value)};return(m,y)=>(i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.unref(Y.UnitsHelper).productIsMeasurable(m.product)?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:0,required:!0,feedback:m.validation.length.feedback||"","show-feedback":m.validation.length.showFeedback||i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01||!1,"validation-status":m.validation.length.validationStatus||void 0,label:"Метраж, "+m.product.unit+o.value+"м."},i.createSlots({default:i.withCtx(()=>{var _,b;return[i.createVNode(i.unref(I.NInputNumber),{value:r.value.length,"onUpdate:value":y[0]||(y[0]=S=>r.value.length=S),max:((_=m.product.properties)==null?void 0:_.maxLength)||void 0,min:((b=m.product.properties)==null?void 0:b.minLength)||i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product),step:i.unref(Y.UnitsHelper).getProductMultiplicity(m.product),validator:S=>S%i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product)===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]}),_:2},[!m.validation.length.feedback&&i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product)!==.01?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Hf,"Метраж должен быть кратен "+i.toDisplayString(i.unref(Y.UnitsHelper).getProductLengthMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status","label"])):i.createCommentVNode("",!0),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:m.validation.quantity.feedback||"","show-feedback":m.validation.quantity.showFeedback||i.unref(Y.UnitsHelper).getProductMultiplicity(m.product)!==1||!1,"validation-status":m.validation.quantity.validationStatus||void 0,label:"Количество"},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:r.value.quantity,"onUpdate:value":y[1]||(y[1]=_=>r.value.quantity=_),min:i.unref(Y.UnitsHelper).getProductMultiplicity(m.product),step:i.unref(Y.UnitsHelper).getProductMultiplicity(m.product),validator:_=>_%i.unref(Y.UnitsHelper).getProductMultiplicity(m.product)===0,placeholder:"Введите количество",class:"w-full"},null,8,["value","min","step","validator"])]),_:2},[!m.validation.quantity.feedback&&i.unref(Y.UnitsHelper).getProductMultiplicity(m.product)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Wf,"Количество должно быть кратно "+i.toDisplayString(i.unref(Y.UnitsHelper).getProductMultiplicity(m.product)),1)]),key:"0"}:void 0]),1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{feedback:m.validation.marker.feedback||"","show-feedback":m.validation.marker.showFeedback||!1,"validation-status":m.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInput),{value:r.value.marker,"onUpdate:value":y[2]||(y[2]=_=>r.value.marker=_),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NButton),{loading:m.isSubmitProcessing,disabled:r.value.length===0||r.value.quantity===0,type:"primary",class:"self-start",onClick:y[3]||(y[3]=_=>a())},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(m.cartItem?"Изменить":"В корзину"),1)]),_:1},8,["loading","disabled"])]),_:1}))}}),Xf={},Ta=i.defineComponent({...Xf,__name:"reference-select",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=new Y.Reference,l=i.computed(()=>{const f=o.value?[]:a,g=D.isUndefined(r.value)?f:r.value;return D.isArray(g)?g.map(m=>m.id):g==null?void 0:g.id}),c=i.computed(()=>Dt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,r.showEmptyValue)),d=f=>{var g;if(D.isArray(f)){const m=f.length>0?f.map(y=>{var _;return(_=c.value.find(b=>b.value===y))==null?void 0:_.item}):[];s("update:value",m)}else{const m=f===a.id||(g=c.value.find(y=>y.value===f))==null?void 0:g.item;s("update:value",m)}},h=i.useTemplateRef("select-component");return t({focus:()=>{var f;return(f=h.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=h.value)==null?void 0:f.blur()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(I.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":f.consistentMenuWidth,disabled:f.disabled||c.value.length===0,filterable:f.filterable,"max-tag-count":f.maxTagCount,multiple:o.value,options:c.value,placeholder:"",class:"w-full","onUpdate:value":d},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),Yf={},Uf=i.defineComponent({...Yf,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{}},emits:["update:value"],setup(e,{emit:t}){var S,x;const n=e,r=t,s=()=>{const v=Y.PriceCoefficient.getRetailPriceCoefficient();return D.unset(v,"isNewRec"),v},o=v=>!v||v.id===s().id,a=i.computed(()=>{var v;return((v=n.catalogItem)==null?void 0:v.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=v=>{var B,k,E,P;return v.id===s().id?(B=l.value)==null?void 0:B.getRetailCost():(P=(E=(k=l.value)==null?void 0:k.priceCoefficients)==null?void 0:E.find(N=>N.coefficient.id===v.id))==null?void 0:P.cost},d=i.computed(()=>{var B;const v=[...((B=Y.useReferencesStore().priceCoefficientsReference)==null?void 0:B.map(k=>structuredClone(i.toRaw(k))))??[],s()];return a.value&&v.forEach(k=>{var P;const E=c(k);E?k.name+=` (${E} ${(P=l.value)==null?void 0:P.currency})`:k.name=""}),v.filter(k=>k.name!=="")}),h=i.ref(n.value.coefficient),u=i.ref(((x=(S=n.value)==null?void 0:S.value)==null?void 0:x.toString())??null),p=i.ref(null),f=i.computed(()=>{var v,B;return(B=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:B.find(k=>k.coefficient.slug===Y.PriceCoefficientEnum.K0)}),g=i.ref(void 0),m=()=>{var B,k,E;g.value=void 0;let v=Number.parseFloat(((B=u.value)==null?void 0:B.replace(",","."))??"");if(v=Number.isNaN(v)?void 0:v,a.value)if(h.value||u.value){const P=s(),N=c(h.value??P)??0,j=N+N*((v??0)/100);p.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(j),j>(((k=l.value)==null?void 0:k.getRetailCost())??j)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),f.value&&j<(((E=f.value)==null?void 0:E.cost)??0)&&(g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else p.value=null;r("update:value",{value:Number.isNaN(v)?void 0:v,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})},y=v=>{D.isArray(v)||(h.value=v,!h.value&&u.value&&(h.value=s()),m())},_=()=>{h.value||(h.value=s()),m()},b=v=>{var k,E,P,N,j,X;const B=Number.parseFloat((v==null?void 0:v.replace(",","."))??"");if(a.value){let A=0;if(B<=0)h.value=void 0,u.value=null;else if(f.value&&B<(((k=f.value)==null?void 0:k.cost)??0))h.value=(E=f.value)==null?void 0:E.coefficient,A=(B-f.value.cost)*100/f.value.cost,g.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(B>(((P=l.value)==null?void 0:P.getRetailCost())??B)){h.value=s();const V=((N=l.value)==null?void 0:N.getRetailCost())??0;A=(B-V)*100/V,g.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const V=(X=(j=l.value)==null?void 0:j.priceCoefficients)==null?void 0:X.filter(L=>L.cost<B);if(V&&V.length>0){const L=V.at(-1);h.value=L==null?void 0:L.coefficient,A=(B-((L==null?void 0:L.cost)??0))*100/((L==null?void 0:L.cost)??1)}g.value={validationStatus:void 0,feedback:void 0}}u.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(A),r("update:value",{value:Number.isNaN(A)?void 0:A,coefficient:o(h.value)?void 0:structuredClone(i.toRaw(h.value))})}else r("update:value",{value:Number.isNaN(B)?void 0:B,coefficient:void 0})};return i.onMounted(()=>{var v,B,k,E;n.calculationType===Y.CalculationTypeEnum.m2Cost?p.value=((B=(v=n.value)==null?void 0:v.value)==null?void 0:B.toString())??null:!((k=n.value)!=null&&k.coefficient)&&((E=n.value)!=null&&E.value)&&(h.value=s()),m()}),(v,B)=>{var P,N,j;const k=I.NInput,E=I.NInputGroup;return i.openBlock(),i.createBlock(i.unref(I.NFormItem),{"show-label":!i.unref(D.isNil)(v.label),label:v.label,"show-feedback":!i.unref(D.isNil)(((P=g.value)==null?void 0:P.feedback)??v.feedback),feedback:((N=g.value)==null?void 0:N.feedback)??v.feedback,"validation-status":((j=g.value)==null?void 0:j.validationStatus)??v.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&v.calculationType!==i.unref(Y.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[v.calculationType!==i.unref(Y.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(E,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Ta,{class:"w-full min-w-0 flex-1",value:h.value,"reference-list":d.value,clearable:v.clearable,disabled:v.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled"]),i.createVNode(k,{value:u.value,"onUpdate:value":[B[0]||(B[0]=X=>u.value=X),_],clearable:v.clearable,disabled:v.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[B[3]||(B[3]=i.createTextVNode("%",-1))]),_:2},[u.value&&!u.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[B[2]||(B[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||v.calculationType===i.unref(Y.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:1,value:p.value,"onUpdate:value":[B[1]||(B[1]=X=>p.value=X),b],clearable:v.clearable,disabled:v.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var X;return[i.createTextVNode(i.toDisplayString((X=l.value)==null?void 0:X.currency),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Gf={class:"flex flex-row gap-1"},Kf={class:"sc-client-name flex flex-col gap-1 text-base"},Zf=["href"],Jf={key:1,class:"text-sc-grey"},Qf={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},ep={key:0},tp={key:1,class:"text-sm"},np={},Tr=i.defineComponent({...np,__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?$n.format(n.client.lastLoginAt,Y.AppConfigProvider.getConfig().dateFormats.uiDateWithTime):""),o=a=>{D.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=Es,d=I.NButton,h=I.NPopover;return i.openBlock(),i.createElementBlock("div",Gf,[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(D.isNil)(a.popoverPosition),placement:a.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Kf,[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",Jf," [ Деактивирован ] "))],8,Zf),a.showCityAndRegion&&a.client.city?(i.openBlock(),i.createElementBlock("span",Qf," г. "+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",ep,i.toDisplayString(a.client.alternativeName),1)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock("span",tp," Последний вход: "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),ip={class:"text-base"},rp={},Ea=i.defineComponent({...rp,__name:"contragent-with-short-info",props:{contragent:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("span",ip,i.toDisplayString(t.contragent.name),1))}}),sp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function op(e,t){return i.openBlock(),i.createElementBlock("svg",sp,[...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 ap=i.markRaw({name:"tabler-mail",render:op}),lp=["href"],cp={},dp=i.defineComponent({...cp,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{const r=ap;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,lp)],2)}}}),hp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function up(e,t){return i.openBlock(),i.createElementBlock("svg",hp,[...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 Ra=i.markRaw({name:"fa6-brands-viber",render:up}),fp={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},pp=["id"],gp=["id"],mp=["fill"],yp=["fill"];function _p(e,t){return i.openBlock(),i.createElementBlock("svg",fp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.SVGBRLHCcSy,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,pp),i.createElementVNode("linearGradient",{id:e.idMap.SVGHW6lecxh,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,gp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,mp),i.createElementVNode("path",{fill:"url(#"+e.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,yp),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 $a=i.markRaw({name:"logos-whatsapp-icon",render:_p,setup(){const e=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+e(),SVGHW6lecxh:"uicons-"+e()}}}}),bp={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},wp=["id"],vp=["fill"];function kp(e,t){return i.openBlock(),i.createElementBlock("svg",bp,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:e.idMap.SVGuySfwdaH,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,wp)]),i.createElementVNode("path",{fill:"url(#"+e.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,vp),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 Na=i.markRaw({name:"logos-telegram",render:kp,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),xp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cp(e,t){return i.openBlock(),i.createElementBlock("svg",xp,[...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 Pa=i.markRaw({name:"ion-call",render:Cp}),Sp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bp(e,t){return i.openBlock(),i.createElementBlock("svg",Sp,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"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 Tp=i.markRaw({name:"tabler-phone-call",render:Bp}),Ep={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},Rp=["href"],$p=["href"],Np=["href"],Pp=["href"],Fp={},Mp=i.defineComponent({...Fp,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{try{return t.phone?qi.parsePhoneNumberWithError(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),r=i.computed(()=>{var l;return D.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),s=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=Tp,h=Pa,u=Na,p=$a,f=Ra;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",Ep,[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,Rp)):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,$p)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(p)],8,Np)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(f)],8,Pp)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Ap={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Vp(e,t){return i.openBlock(),i.createElementBlock("svg",Ap,[...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 Ip=i.markRaw({name:"mdi-envelope",render:Vp}),Op={class:"flex flex-col gap-1"},zp={key:0,class:"mb-2 flex flex-col text-base"},Lp={key:0,class:"text-sc-dark-grey text-sm"},Dp={key:1,class:"whitespace-nowrap text-sm"},Hp={key:2,class:"whitespace-nowrap text-sm"},Wp={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},jp=["href"],qp=["href"],Xp=["href"],Yp=["href"],Up=["href"],Gp={key:0,class:"flex flex-col text-base"},Kp={key:0,class:"text-sc-dark-grey text-sm"},Zp={key:1,class:"mt-2 text-sm"},Jp={key:0,class:"-mt-1"},Qp={},eg=i.defineComponent({...Qp,__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?qi.parsePhoneNumberWithError(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),r=i.computed(()=>{var c;return D.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),s=i.computed(()=>{var c;return D.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),o=i.computed(()=>{var c;return D.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||t.contact.email),l=i.ref(!1);return(c,d)=>{var y,_;const h=Pa,u=Na,p=$a,f=Ra,g=Ip,m=I.NPopover;return i.openBlock(),i.createElementBlock("div",Op,[i.createVNode(m,{disabled:c.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var b,S,x,v;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(b=c.contact)!=null&&b.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${c.classes}`),style:i.normalizeStyle(c.styles),onMouseenter:d[0]||(d[0]=B=>l.value=!0),onFocusin:d[1]||(d[1]=B=>l.value=!0),onMouseleave:d[2]||(d[2]=B=>l.value=!1),onFocusout:d[3]||(d[3]=B=>l.value=!1)},[i.createElementVNode("div",null,[c.fullView&&(c.contact.name||(S=c.contact)!=null&&S.position)?(i.openBlock(),i.createElementBlock("div",zp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(x=c.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",Lp,i.toDisplayString((v=c.contact)==null?void 0:v.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),c.contact.phone?(i.openBlock(),i.createElementBlock("div",Dp,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),c.contact.email?(i.openBlock(),i.createElementBlock("div",Hp,i.toDisplayString(c.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",Wp,[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,jp)):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,qp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${o.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(p)],8,Xp)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${o.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(f)],8,Yp)):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,Up)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var b,S,x,v;return[c.contact.name?(i.openBlock(),i.createElementBlock("div",Gp,[i.createTextVNode(i.toDisplayString(c.contact.name)+" ",1),(b=c.contact)!=null&&b.position?(i.openBlock(),i.createElementBlock("span",Kp,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",Zp,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((v=c.contact)==null?void 0:v.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),c.fullView&&((y=c.contact)!=null&&y.comment)?(i.openBlock(),i.createElementBlock("div",Jp,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((_=c.contact)==null?void 0:_.comment),1)])):i.createCommentVNode("",!0)])}}}),tg={key:0,class:"flex w-fit items-center gap-2"},ng={key:1,class:"flex flex-wrap gap-1"},ig={key:0},rg={},Ui=i.defineComponent({...rg,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0}},setup(e){const t=e,n=i.computed(()=>{var r,s;return(s=(r=t.product)==null?void 0:r.properties)==null?void 0:s.planingProductionDate});return(r,s)=>{const o=I.NSpin;return r.isProductSearching?(i.openBlock(),i.createElementBlock("div",tg,[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",ng,[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",ig,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)]))}}}),sg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function og(e,t){return i.openBlock(),i.createElementBlock("svg",sg,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const Er=i.markRaw({name:"ion-close",render:og}),ag={class:"mr-3 flex flex-col gap-2"},lg=["onClick"],cg={class:"h-full p-2"},dg={},hg=i.defineComponent({...dg,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(e,{emit:t}){const n=e,r=i.useTemplateRef("drawing-template-containers"),s=t;return i.onMounted(()=>{n.settings.allTemplates.forEach((o,a)=>{var c;const l=(c=r.value)==null?void 0:c.at(a);l&&s("init-draw-template",l,o)})}),i.watch(()=>n.settings.allTemplates,(o,a)=>{i.nextTick(()=>{o.forEach((l,c)=>{var d;if(!a.includes(l)){const h=(d=r.value)==null?void 0:d.at(c);h&&s("init-draw-template",h,l)}})})},{deep:!0}),(o,a)=>{const l=Er;return i.openBlock(),i.createBlock(i.unref(I.NScrollbar),{style:{"max-height":"12.5rem",width:"auto"},trigger:"none"},{default:i.withCtx(()=>[i.createElementVNode("div",ag,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.settings.allTemplates,(c,d)=>(i.openBlock(),i.createElementBlock("div",{key:d,class:"group relative"},[i.createVNode(i.unref(I.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":d===o.selectTemplateIndex}]),onClick:h=>s("template:select",d)},[i.createElementVNode("div",cg,[i.createElementVNode("div",{ref_for:!0,ref:"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,lg)]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(c.label),1)]),_:2},1024),c.isCustom&&!c.isNewRec()?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,size:"tiny",quaternary:"",circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:h=>s("remove-custom-template",d)},{default:i.withCtx(()=>[i.createVNode(l)]),_:2},1032,["onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Fa=jn(hg,[["__scopeId","data-v-828c3059"]]),ug={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function fg(e,t){return i.openBlock(),i.createElementBlock("svg",ug,[...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 Ma=i.markRaw({name:"ion-trash",render:fg}),pg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gg(e,t){return i.openBlock(),i.createElementBlock("svg",pg,[...t[0]||(t[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Aa=i.markRaw({name:"ion-plus",render:gg}),mg={class:"flex flex-col gap-4"},yg={class:"flex flex-col gap-2"},_g={class:"mt-8 font-bold"},bg={class:"grid grow grid-cols-2 items-start gap-2"},wg={class:"flex flex-col gap-4"},vg={class:"flex gap-3"},kg={},Va=i.defineComponent({...kg,__name:"kozyrek-configurator-params-form",props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line","click:save-template"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(structuredClone(i.toRaw(n.value.configuratorParams))),o=i.ref(!1),a=()=>{s.value.length>0&&(r("update:params",s.value),l("configuratorParams",s.value))},l=(c,d)=>{const h=new Y.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.watch(()=>n.value.configuratorParams,c=>{s.value=D.cloneDeep(i.toRaw(c))},{deep:!0}),i.watch(()=>n.previewParams,c=>{s.value.linesWidths=c.linesWidths,s.value.linesAngles=c.linesAngles},{deep:!0}),(c,d)=>{const h=Aa,u=Ma,p=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"grid gap-2 md:grid-cols-2 md:gap-6"},{default:i.withCtx(()=>{var f,g,m,y,_,b,S,x,v;return[i.createElementVNode("div",mg,[d[10]||(d[10]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),c.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.startTailType,"onUpdate:value":[d[0]||(d[0]=B=>s.value.startTailType=B),a],options:c.settings.startTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",yg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value.linesAngles,(B,k)=>{var E,P,N,j,X,A;return i.openBlock(),i.createElementBlock("div",{key:k,class:"flex items-start gap-2"},[i.createElementVNode("div",_g,i.toDisplayString(k+1),1),i.createElementVNode("div",bg,[i.createVNode(i.unref(I.NFormItem),{label:"Ширина, мм",required:!0,feedback:((E=c.validation[`lines_widths[${k+1}]`])==null?void 0:E.feedback)||"","show-feedback":((P=c.validation[`lines_widths[${k+1}]`])==null?void 0:P.showFeedback)||!1,"validation-status":(N=c.validation[`lines_widths[${k+1}]`])==null?void 0:N.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.linesWidths[k],"onUpdate:value":[V=>s.value.linesWidths[k]=V,a],min:s.value.linesWidths.length>1?c.settings.minLineWidth:c.settings.stripMinWidth,max:c.settings.maxLineWidth,step:c.settings.lineWidthStep,validator:V=>V%c.settings.lineWidthStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{label:"Угол сгиба, °",required:!0,feedback:((j=c.validation[`lines_angles[${k+1}]`])==null?void 0:j.feedback)||"","show-feedback":((X=c.validation[`lines_angles[${k+1}]`])==null?void 0:X.showFeedback)||!1,"validation-status":(A=c.validation[`lines_angles[${k+1}]`])==null?void 0:A.validationStatus},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.linesAngles[k],"onUpdate:value":[V=>s.value.linesAngles[k]=V,a],min:c.settings.minLineAngle,max:c.settings.maxLineAngle,step:c.settings.lineAngleStep,validator:V=>V%c.settings.lineAngleStep===0,class:"w-full"},null,8,["value","onUpdate:value","min","max","step","validator"])]),_:2},1032,["feedback","show-feedback","validation-status"])]),i.createVNode(i.unref(I.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,size:"medium",onClick:V=>r("click:add-line",k)},{default:i.withCtx(()=>[i.createVNode(h)]),_:2},1032,["onClick"])),c.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:1,disabled:s.value.linesWidths.length===1,size:"medium",class:"ml-2",onClick:V=>r("click:remove-line",k)},{default:i.withCtx(()=>[i.createVNode(u)]),_:2},1032,["disabled","onClick"]))]),_:2},1024)])}),128))]),c.settings.endTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(I.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.endTailType,"onUpdate:value":[d[1]||(d[1]=B=>s.value.endTailType=B),a],options:c.settings.endTailConfigs.map(({label:B},k)=>({label:B,value:k})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),c.settings.allowSaveTemplates&&c.selectTemplateIndex===c.settings.allTemplates.length-1?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:2,type:"tertiary",class:"self-start",loading:o.value,onClick:d[2]||(d[2]=B=>r("click:save-template"))},{default:i.withCtx(()=>[...d[9]||(d[9]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",wg,[i.createVNode(i.unref(I.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:s.value.colorSide,"onUpdate:value":[d[3]||(d[3]=B=>s.value.colorSide=B),a],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((f=c.validation.length)==null?void 0:f.showFeedback)||!1,feedback:((g=c.validation.length)==null?void 0:g.feedback)||"","validation-status":(m=c.validation.length)==null?void 0:m.validationStatus,label:`Метраж${c.settings.stripMinLength?" от "+c.settings.stripMinLength:""}${c.settings.stripMaxLength?" до "+c.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:s.value.length,"onUpdate:value":[d[4]||(d[4]=B=>s.value.length=B),a],required:!0,max:c.settings.stripMaxLength||void 0,min:c.settings.stripMinLength,step:c.settings.lengthStep,validator:B=>B%c.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full"},null,8,["value","max","min","step","validator"])]),_:1},8,["show-feedback","feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((y=c.validation.quantity)==null?void 0:y.showFeedback)||!1,feedback:((_=c.validation.quantity)==null?void 0:_.feedback)||"","validation-status":(b=c.validation.quantity)==null?void 0:b.validationStatus,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:c.value.quantity,"onUpdate:value":d[5]||(d[5]=B=>c.value.quantity=B),min:1,validator:B=>Number.isInteger(B),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":((S=c.validation.marker)==null?void 0:S.showFeedback)||!1,feedback:((x=c.validation.marker)==null?void 0:x.feedback)||"","validation-status":(v=c.validation.marker)==null?void 0:v.validationStatus,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(p,{value:c.value.marker,"onUpdate:value":d[6]||(d[6]=B=>c.value.marker=B),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["show-feedback","feedback","validation-status"]),i.createElementVNode("div",vg,[i.createVNode(i.unref(I.NButton),{loading:c.isSubmitProcessing,type:"primary",class:"self-start",onClick:d[7]||(d[7]=B=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[8]||(d[8]=B=>r("click:view-switch"))},{default:i.withCtx(()=>[...d[11]||(d[11]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0)])])]}),_:1})}}});var Ia=Object.defineProperty,xg=Object.defineProperties,Cg=Object.getOwnPropertyDescriptors,Oa=Object.getOwnPropertySymbols,Sg=Object.prototype.hasOwnProperty,Bg=Object.prototype.propertyIsEnumerable,$s=(e,t,n)=>t in e?Ia(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ns=(e,t)=>{for(var n in t||(t={}))Sg.call(t,n)&&$s(e,n,t[n]);if(Oa)for(var n of Oa(t))Bg.call(t,n)&&$s(e,n,t[n]);return e},Ps=(e,t)=>xg(e,Cg(t)),za=(e,t)=>{for(var n in t)Ia(e,n,{get:t[n],enumerable:!0})},w=(e,t,n)=>($s(e,typeof t!="symbol"?t+"":t,n),n),La=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},$t=(e,t,n)=>(La(e,t,"read from private field"),n?n.call(e):t.get(e)),Da=(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)},Tg=(e,t,n,r)=>(La(e,t,"write to private field"),t.set(e,n),n),kt={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||"canvas",e.nodeType=1,e.getAttribute=function(n){return this[n]},e.setAttribute=function(n,r){return this[n]=r,this},e},polyfill:function(e,t){return kt.shim(e),typeof t<"u"&&(kt.Image=t),kt.isHeadless=!0,e}},Ha={};za(Ha,{Curve:()=>xi,getAnchorsFromArcData:()=>$g,getComponentOnCubicBezier:()=>Gi,getControlPoints:()=>el,getCurveBoundingBox:()=>Za,getCurveFromPoints:()=>Qa,getCurveLength:()=>Ka,getReflection:()=>As,integrate:()=>Ja,subdivide:()=>Ms});var Wa={};za(Wa,{HALF_PI:()=>Je,NumArray:()=>tn,TWO_PI:()=>ct,decomposeMatrix:()=>ki,getComputedMatrix:()=>Xa,getPoT:()=>Ya,lerp:()=>At,mod:()=>Vt,setMatrix:()=>qa,toFixed:()=>$e});var Le;typeof window<"u"?Le=window:typeof global<"u"?Le=global:typeof self<"u"&&(Le=self);var ja,ct=Math.PI*2,Je=Math.PI*.5;function ki(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function qa(e){ja=e}function Xa(e,t){t=t&&t.identity()||new ja;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 At(e,t,n){return n*(t-e)+e}var Fs=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Ya(e){let t=0;for(;Fs[t]&&Fs[t]<e;)t++;return Fs[t]}function Vt(e,t){for(;e<0;)e+=t;return e%t}var tn=Le.Float32Array||Array,Eg=Math.floor;function $e(e){return Eg(e*1e6)/1e6}var ne={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},q=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(q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),w(q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var Ua={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(q.Types.change))}}},Yt=class extends q{constructor(e=0,t=0){super(),w(this,"_x",0),w(this,"_y",0);for(let n in Ua)Object.defineProperty(this,n,Ua[n]);this.x=e,this.y=t}static add(e,t){return new Yt(e.x+t.x,e.y+t.y)}static sub(e,t){return new Yt(e.x-t.x,e.y-t.y)}static subtract(e,t){return Yt.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(Yt.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 Yt(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:$e(this.x),y:$e(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}},Q=Yt;w(Q,"zero",new Yt),w(Q,"left",new Yt(-1,0)),w(Q,"right",new Yt(1,0)),w(Q,"up",new Yt(0,-1)),w(Q,"down",new Yt(0,1));var ve=class extends Q{constructor(t=0,n=0,r=0,s=0,o=0,a=0,l=ne.move){super(t,n),w(this,"controls",{left:new Q,right:new Q}),w(this,"_command",ne.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 Ga)Object.defineProperty(this,d,Ga[d]);this.command=l,this.relative=!0;const c=ve.makeBroadcast(this);this.controls.left.set(r,s).addEventListener(q.Types.change,c),this.controls.right.set(o,a).addEventListener(q.Types.change,c)}static makeBroadcast(t){return n;function n(){t._bound&&t.dispatchEvent(q.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:$e(this.x),y:$e(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:$e(this.rx),ry:$e(this.ry),xAxisRotation:$e(this.xAxisRotation),largeArcFlag:$e(this.largeArcFlag),sweepFlag:$e(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},Ga={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(q.Types.change))}}},Rg=0,xt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.19",PublishDate:"2025-06-27T18:00:39.187Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Rg++}},xi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896257],[0,.7745966692414834],[.33998104358485626,.8611363115940526],[0,.5384693101056831,.906179845938664],[.2386191860831969,.6612093864662645,.932469514203152],[0,.4058451513773972,.7415311855993945,.9491079123427585],[.1834346424956498,.525532409916329,.7966664774136267,.9602898564975363],[0,.3242534234038089,.6133714327005904,.8360311073266358,.9681602395076261],[.14887433898163122,.4333953941292472,.6794095682990244,.8650633666889845,.9739065285171717],[0,.26954315595234496,.5190961292068118,.7301520055740494,.8870625997680953,.978228658146057],[.1252334085114689,.3678314989981802,.5873179542866175,.7699026741943047,.9041172563704749,.9815606342467192],[0,.2304583159551348,.44849275103644687,.6423493394403402,.8015780907333099,.9175983992229779,.9841830547185881],[.10805494870734367,.31911236892788974,.5152486363581541,.6872929048116855,.827201315069765,.9284348836635735,.9862838086968123],[0,.20119409399743451,.3941513470775634,.5709721726085388,.7244177313601701,.8482065834104272,.937273392400706,.9879925180204854],[.09501250983763744,.2816035507792589,.45801677765722737,.6178762444026438,.755404408355003,.8656312023878318,.9445750230732326,.9894009349916499]],weights:[[1],[.8888888888888888,.5555555555555556],[.6521451548625461,.34785484513745385],[.5688888888888889,.47862867049936647,.23692688505618908],[.46791393457269104,.3607615730481386,.17132449237917036],[.4179591836734694,.3818300505051189,.27970539148927664,.1294849661688697],[.362683783378362,.31370664587788727,.22238103445337448,.10122853629037626],[.3302393550012598,.31234707704000286,.26061069640293544,.1806481606948574,.08127438836157441],[.29552422471475287,.26926671930999635,.21908636251598204,.1494513491505806,.06667134430868814],[.2729250867779006,.26280454451024665,.23319376459199048,.18629021092773426,.1255803694649046,.05566856711617366],[.24914704581340277,.2334925365383548,.20316742672306592,.16007832854334622,.10693932599531843,.04717533638651183],[.2325515532308739,.22628318026289723,.2078160475368885,.17814598076194574,.13887351021978725,.09212149983772845,.04048400476531588],[.2152638534631578,.2051984637212956,.18553839747793782,.15720316715819355,.12151857068790319,.08015808715976021,.03511946033175186],[.2025782419255613,.19843148532711158,.1861610000155622,.16626920581699392,.13957067792615432,.10715922046717194,.07036604748810812,.03075324199611727],[.1894506104550685,.18260341504492358,.16915651939500254,.14959598881657674,.12462897125553388,.09515851168249279,.062253523938647894,.027152459411754096]]};function Gi(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Ms(e,t,n,r,s,o,a,l,c){c=c||xi.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new ve(a,l)];const h=[];for(let u=0;u<d;u++){const p=u/d,f=Gi(p,e,n,s,a),g=Gi(p,t,r,o,l);h.push(new ve(f,g))}return h}function Ka(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const y=a-e,_=l-t;return Math.sqrt(y*y+_*_)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),p=9*(r-o)+3*(l-t),f=6*(t+o)-12*r,g=3*(r-t);function m(y){const _=(d*y+h)*y+u,b=(p*y+f)*y+g;return Math.sqrt(_*_+b*b)}return Ja(m,0,1,c||xi.RecursionLimit)}function Za(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,p,f,g,m,y,_;for(let v=0;v<2;++v){if(v==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f);continue}y=u*u-4*p*h,_=Math.sqrt(y),!(y<0)&&(g=(-u+_)/(2*h),0<g&&g<1&&c.push(g),m=(-u-_)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)f=c[b],x=1-f,d[0][b]=x*x*x*e+3*x*x*f*n+3*x*f*f*s+f*f*f*a,d[1][b]=x*x*x*t+3*x*x*f*r+3*x*f*f*o+f*f*f*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 Ja(e,t,n,r){let s=xi.abscissas[r-2],o=xi.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const u=a*s[c];h+=o[c++]*(e(l+u)+e(l-u))}return a*h}function Qa(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Vt(s-1,n):Math.max(s-1,0),l=t?Vt(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];el(c,d,h),d.command=s===0?ne.move:ne.curve}}function el(e,t,n){const r=Q.angleBetween(e,t),s=Q.angleBetween(n,t);let o=Q.distanceBetween(e,t),a=Q.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=Je:l-=Je,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function As(e,t,n){return new Q(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function $g(e,t,n,r,s,o,a){const l=xt.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const h=d*o+s,u=n*Math.cos(h),p=r*Math.sin(h),f=new ve(u,p);f.command=ne.line}}var tl=Array.prototype.slice;function Ng(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}var G={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},isFunction:function(e){return typeof e=="function"},extend:function(e){const t=tl.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=tl.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=!Ng(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:Le.performance&&Le.performance.now?Le.performance:Date},It={hasEventListeners:typeof Le.addEventListener=="function",bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent("on"+t,n),It},unbind:function(e,t,n,r){return It.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent("on"+t,n),It},getRequestAnimationFrame:function(){const e=["ms","moz","webkit","o"];let t=0,n=Le.requestAnimationFrame;if(!n){for(let s=0;s<e.length;s++)n=Le[e[s]+"RequestAnimationFrame"]||n;n=n||r}function r(s,o){const a=new Date().getTime(),l=Math.max(0,16-(a-t)),c=Le.setTimeout(d,l);t=a+l;function d(){s(a+l)}return c}return n}},Ci=Le.document?Le.document.createElement("div"):{};Ci.id="help-two-load",Object.defineProperty(It,"temp",{enumerable:!0,get:function(){return G.isElement(Ci)&&!Le.document.head.contains(Ci)&&(Ci.style.display="none",Le.document.head.appendChild(Ci)),Ci}});var Nt=class extends Error{constructor(t){super(),w(this,"name","Two.js"),w(this,"message"),this.message=t}},Pg=Le.devicePixelRatio||1;function Fg(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Vs(e){return Pg/Fg(e)}var Rr=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}},dt,Nn=class extends Array{constructor(){super(),Da(this,dt,new q),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return $t(this,dt)}set _events(t){Tg(this,dt,t)}get _bound(){return $t(this,dt)._bound}set _bound(t){$t(this,dt)._bound=t}addEventListener(){return $t(this,dt).addEventListener.apply(this,arguments)}on(){return $t(this,dt).on.apply(this,arguments)}bind(){return $t(this,dt).bind.apply(this,arguments)}removeEventListener(){return $t(this,dt).removeEventListener.apply(this,arguments)}off(){return $t(this,dt).off.apply(this,arguments)}unbind(){return $t(this,dt).unbind.apply(this,arguments)}dispatchEvent(){return $t(this,dt).dispatchEvent.apply(this,arguments)}trigger(){return $t(this,dt).trigger.apply(this,arguments)}listen(){return $t(this,dt).listen.apply(this,arguments)}ignore(){return $t(this,dt).ignore.apply(this,arguments)}pop(){const t=super.pop.apply(this,arguments);return this.trigger(q.Types.remove,[t]),t}shift(){const t=super.shift.apply(this,arguments);return this.trigger(q.Types.remove,[t]),t}push(){const t=super.push.apply(this,arguments);return this.trigger(q.Types.insert,arguments),t}unshift(){const t=super.unshift.apply(this,arguments);return this.trigger(q.Types.insert,arguments),t}splice(){const t=super.splice.apply(this,arguments);if(this.trigger(q.Types.remove,t),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(q.Types.insert,n),this.trigger(q.Types.order)}return t}sort(){return super.sort.apply(this,arguments),this.trigger(q.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(q.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(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}};dt=new WeakMap;var nl=class extends q{constructor(){super(),w(this,"_flagId",!1),w(this,"_flagClassName",!1),w(this,"_renderer",{}),w(this,"_id",xt.Identifier+xt.uniqueId()),w(this,"_className",""),w(this,"classList",[]);for(let e in il)Object.defineProperty(this,e,il[e])}static fromObject(e){const t=new nl().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}}},qn=nl;w(qn,"Properties",["renderer","id","className"]);var il={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,rl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Le.document&&($r=document.createElement("a"));var Qe=class extends qn{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 sl)Object.defineProperty(this,n,sl[n]);if(this._renderer.type="texture",this._renderer.flagOffset=Mg.bind(this),this._renderer.flagScale=Ag.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new Q,typeof t=="function"){const n=(function(){this.unbind(q.Types.load,n),typeof t=="function"&&t()}).bind(this);this.bind(q.Types.load,n)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const n=Object.prototype.toString.call(e);(n==="[object HTMLImageElement]"||n==="[object HTMLCanvasElement]"||n==="[object HTMLVideoElement]"||n==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const t=new Qe().copy(e);return"id"in e&&(t.id=e.id),t}static getAbsoluteURL(e){return $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=Qe.getAbsoluteURL(e);if(Qe.ImageRegistry.contains(t))return Qe.ImageRegistry.get(t);let n;return kt.Image?(n=new kt.Image,kt.shim(n,"img")):Le.document?rl.video.test(t)?n=document.createElement("video"):n=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),n.crossOrigin="anonymous",n.referrerPolicy="no-referrer",n}static load(e,t){let n=e.image,r=Qe.getTag(n);e._flagImage&&(/canvas/i.test(r)?Qe.Register.canvas(e,t):(e._src=!kt.isHeadless&&n.getAttribute("two-src")||n.src,Qe.Register[r](e,t))),e._flagSrc&&(n||(n=Qe.getImage(e.src),e.image=n),r=Qe.getTag(n),Qe.Register[r](e,t))}clone(){const e=new Qe(this.src);return e.repeat=this.repeat,e.offset.copy(this.offset),e.scale=this.scale,e}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset=="number"||e.offset instanceof Q?e.offset:new Q().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof Q?e.scale:new Q().copy(e.scale),this}toObject(){const e=super.toObject.call(this);return e.renderer.type="texture",e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(q.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Qe.load(this,(function(){this.loaded=!0,this.trigger(q.Types.change).trigger(q.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Te=Qe;w(Te,"Properties",["src","loaded","repeat","scale","offset","image"]),w(Te,"RegularExpressions",rl),w(Te,"ImageRegistry",new Rr),w(Te,"Register",{canvas:function(e,t){e._src="#"+e.id,Qe.ImageRegistry.add(e.src,e.image),typeof t=="function"&&t()},img:function(e,t){const n=e.image,r=function(o){!kt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),typeof t=="function"&&t()},s=function(o){throw!kt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",s,!1)),new Nt("unable to load "+e.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!kt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",s,!1)),e._src=Qe.getAbsoluteURL(e._src),!(!kt.isHeadless&&n&&n.getAttribute("two-src"))&&(kt.isHeadless||n.setAttribute("two-src",e.src),Qe.ImageRegistry.add(e.src,n),kt.isHeadless?Qe.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(kt.isHeadless)throw new Nt("video textures are not implemented in headless environments.");const n=function(s){e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t=="function"&&t()},r=function(s){throw e.image.removeEventListener("canplaythrough",n,!1),e.image.removeEventListener("error",r,!1),new Nt("unable to load "+e.src)};e._src=Qe.getAbsoluteURL(e._src),e.image.getAttribute("two-src")||(e.image.setAttribute("two-src",e.src),Qe.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener("canplaythrough",n,!1),e.image.addEventListener("error",r,!1),e.image.src=e.src,e.image.load())}});var sl={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=Te.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}Te.ImageRegistry.contains(n)?this._image=Te.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(q.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(q.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof Q&&this._scale.unbind(q.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof Q&&this._scale.bind(q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Mg(){this._flagOffset=!0}function Ag(){this._flagScale=!0}var Ut=class extends qn{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 ol)Object.defineProperty(this,r,ol[r]);this._renderer.type="stop",this.offset=typeof e=="number"?e:Ut.Index<=0?0:1,this.opacity=typeof n=="number"?n:1,this.color=typeof t=="string"?t:Ut.Index<=0?"#fff":"#000",Ut.Index=(Ut.Index+1)%2}static fromObject(e){const t=new Ut().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ut.Properties.length;t++){const n=Ut.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Ut;return G.each(Ut.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",G.each(Ut.Properties,t=>{e[t]=this[t]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}},nn=Ut;w(nn,"Index",0),w(nn,"Properties",["offset","opacity","color"]);var ol={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)}}},Xn=class extends qn{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 al)Object.defineProperty(this,t,al[t]);this._renderer.type="gradient",this._renderer.flagStops=Vg.bind(this),this._renderer.bindStops=Ig.bind(this),this._renderer.unbindStops=Og.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 nn?r:new nn().copy(r)));const n=new Xn().copy(e);return"id"in e&&(n.id=e.id),n}clone(e){const t=this.stops.map(r=>r.clone()),n=new Xn(t);return G.each(Xn.Properties,r=>{n[r]=this[r]},this),e&&e.add(n),n}copy(e){super.copy.call(this,e);for(let t=0;t<Xn.Properties.length;t++){const n=Xn.Properties[t];n in e&&(this[n]=e[n])}return this}toObject(){const e={stops:this.stops.map(t=>t.toObject())};return G.each(Xn.Properties,t=>{e[t]=this[t]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(q.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}},Ye=Xn;w(Ye,"Stop",nn),w(Ye,"Properties",["spread","stops","units"]);var al={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(q.Types.insert,t).unbind(q.Types.remove,n),this._stops=new Nn((e||[]).slice(0)),this._stops.bind(q.Types.insert,t).bind(q.Types.remove,n),t(this._stops)}}};function Vg(){this._flagStops=!0}function Ig(e){let t=e.length;for(;t--;)e[t].bind(q.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Og(e){let t=e.length;for(;t--;)e[t].unbind(q.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Ki=class extends Ye{constructor(e,t,n,r,s){super(s),w(this,"_flagEndPoints",!1),w(this,"_left",null),w(this,"_right",null);for(let o in ll)Object.defineProperty(this,o,ll[o]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=zg.bind(this),this.left=new Q,this.right=new Q,typeof e=="number"&&(this.left.x=e),typeof t=="number"&&(this.left.y=t),typeof n=="number"&&(this.right.x=n),typeof r=="number"&&(this.right.y=r)}static fromObject(e){const t=new Ki().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ki.Properties.length;t++){const n=Ki.Properties[t];n in e&&(this[n]=e[n]instanceof Q?e[n]:new Q().copy(e[n]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Ki(this.left._x,this.left._y,this.right._x,this.right._y,t);return G.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(q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}},Ae=Ki;w(Ae,"Stop",nn),w(Ae,"Properties",["left","right"]);var ll={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof Q&&this._left.unbind(q.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof Q&&this._right.unbind(q.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function zg(){this._flagEndPoints=!0}var Yn=class extends Ye{constructor(e,t,n,r,s,o){super(r),w(this,"_flagRadius",!1),w(this,"_flagCenter",!1),w(this,"_flagFocal",!1),w(this,"_radius",0),w(this,"_center",null),w(this,"_focal",null);for(let a in cl)Object.defineProperty(this,a,cl[a]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Lg.bind(this),this._renderer.flagFocal=Dg.bind(this),this.center=new Q,this.radius=typeof n=="number"?n:1,this.focal=new Q,typeof e=="number"&&(this.center.x=e),typeof t=="number"&&(this.center.y=t),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof o=="number"&&(this.focal.y=o)}static fromObject(e){const t=new Yn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Yn.Properties.length;t++){const n=Yn.Properties[t];n in e&&(/(center|focal)i/.test(n)?this[n]=e[n]instanceof Q?e[n]:new Q().copy(e[n]):typeof e[n]=="number"&&(this[n]=e[MediaKeySystemAccess]))}return this}clone(e){const t=this.stops.map(function(r){return r.clone()}),n=new Yn(this.center._x,this.center._y,this._radius,t,this.focal._x,this.focal._y);return G.each(Ye.Properties.concat(Yn.Properties),function(r){n[r]=this[r]},this),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return G.each(Yn.Properties,function(t){e[t]=this[t]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}},Ve=Yn;w(Ve,"Stop",nn),w(Ve,"Properties",["center","radius","focal"]);var cl={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(q.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(q.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Lg(){this._flagCenter=!0}function Dg(){this._flagFocal=!0}function dl(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 hl(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ka(r,l,s,c,o,d,a,h,n)}function ul(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Ms(r,l,s,c,o,d,a,h,n)}function Un(e){switch(e.renderer.type){case"texture":return Te.fromObject(e);case"gradient":return Ye.fromObject(e);case"linear-gradient":return Ae.fromObject(e);case"radial-gradient":return Ve.fromObject(e)}return e}var Hg=Math.cos,Wg=Math.sin,fl=Math.tan,Is=[],Ot=class extends q{constructor(e,t,n,r,s,o){super(),w(this,"elements",new tn(9)),w(this,"manual",!1);let a=e;Array.isArray(a)||(a=Array.prototype.slice.call(arguments)),this.identity(),a.length>0&&this.set(a)}static Multiply(e,t,n){if(t.length<=3){const v=e;let B,k,E;const P=t[0]||0,N=t[1]||0,j=t[2]||0;return B=v[0]*P+v[1]*N+v[2]*j,k=v[3]*P+v[4]*N+v[5]*j,E=v[6]*P+v[7]*N+v[8]*j,[B,k,E]}const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5],d=e[6],h=e[7],u=e[8],p=t[0],f=t[1],g=t[2],m=t[3],y=t[4],_=t[5],b=t[6],S=t[7],x=t[8];return n=n||new tn(9),n[0]=r*p+s*m+o*b,n[1]=r*f+s*y+o*S,n[2]=r*g+s*_+o*x,n[3]=a*p+l*m+c*b,n[4]=a*f+l*y+c*S,n[5]=a*g+l*_+c*x,n[6]=d*p+h*m+u*b,n[7]=d*f+h*y+u*S,n[8]=d*g+h*_+u*x,n}static fromObject(e){return new Ot().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(q.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(q.Types.change)}identity(){return this.elements[0]=Ot.Identity[0],this.elements[1]=Ot.Identity[1],this.elements[2]=Ot.Identity[2],this.elements[3]=Ot.Identity[3],this.elements[4]=Ot.Identity[4],this.elements[5]=Ot.Identity[5],this.elements[6]=Ot.Identity[6],this.elements[7]=Ot.Identity[7],this.elements[8]=Ot.Identity[8],this.trigger(q.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(q.Types.change);if(typeof n>"u"&&(n=1),typeof r>"u"){e=e||0,t=t||0,n=n||0,s=this.elements;const A=s[0]*e+s[1]*t+s[2]*n,V=s[3]*e+s[4]*t+s[5]*n,L=s[6]*e+s[7]*t+s[8]*n;return[A,V,L]}const d=this.elements,h=[e,t,n,r,s,o,a,l,c],u=d[0],p=d[1],f=d[2],g=d[3],m=d[4],y=d[5],_=d[6],b=d[7],S=d[8],x=h[0],v=h[1],B=h[2],k=h[3],E=h[4],P=h[5],N=h[6],j=h[7],X=h[8];return this.elements[0]=u*x+p*k+f*N,this.elements[1]=u*v+p*E+f*j,this.elements[2]=u*B+p*P+f*X,this.elements[3]=g*x+m*k+y*N,this.elements[4]=g*v+m*E+y*j,this.elements[5]=g*B+m*P+y*X,this.elements[6]=_*x+b*k+S*N,this.elements[7]=_*v+b*E+S*j,this.elements[8]=_*B+b*P+S*X,this.trigger(q.Types.change)}inverse(e){const t=this.elements;e=e||new Ot;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,p=-h*o+l*c,f=d*o-a*c;let g=n*u+r*p+s*f;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]=p*g,e.elements[4]=(h*n-s*c)*g,e.elements[5]=(-l*n+s*o)*g,e.elements[6]=f*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=Hg(e),n=Wg(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=fl(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){const t=fl(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return Is.length=0,this.toTransformArray(e,Is),Is.map($e).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],p=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]=p;return}return[s,l,h,o,c,u,a,d,p]}if(r){t[0]=s,t[1]=l,t[2]=o,t[3]=c,t[4]=a,t[5]=d;return}return[s,l,o,c,a,d]}toArray(e,t){const n=this.elements,r=!!t,s=n[0],o=n[1],a=n[2],l=n[3],c=n[4],d=n[5];if(e){const h=n[6],u=n[7],p=n[8];if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d,t[6]=h,t[7]=u,t[8]=p;return}return[s,o,a,l,c,d,h,u,p]}if(r){t[0]=s,t[1]=o,t[2]=a,t[3]=l,t[4]=c,t[5]=d;return}return[s,o,a,l,c,d]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ot().copy(this)}},Gn=Ot;w(Gn,"Identity",[1,0,0,0,1,0,0,0,1]),qa(Gn);var Os=class extends qn{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=pl.bind(this),this.isShape=!0,this.matrix=new Gn,this.worldMatrix=new Gn,this.position=new Q,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const t=new Os().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 Q?this.position=e.position:this.position.copy(e.position)),"rotation"in e&&(this.rotation=e.rotation),"scale"in e&&(this.scale=typeof e.scale=="number"||e.scale instanceof Q?e.scale:new Q(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const t=new Os;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 Q?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof Q?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}},mn=Os;w(mn,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Pr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(q.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(q.Types.change,this._renderer.flagMatrix),pl.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 Q&&this._scale.unbind(q.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof Q&&this._scale.bind(q.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(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 Xa(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function pl(){this._flagMatrix=!0}var Si=Math.min,Bi=Math.max,jg=Math.ceil,qg=Math.floor,Xg=new Q,Pn=class extends mn{constructor(e,t,n,r){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagCap",!0),w(this,"_flagJoin",!0),w(this,"_flagMiter",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in gl)Object.defineProperty(this,s,gl[s]);this._renderer.type="path",this._renderer.flagVertices=ml.bind(this),this._renderer.bindVertices=yl.bind(this),this._renderer.unbindVertices=_l.bind(this),this._renderer.flagFill=bl.bind(this),this._renderer.flagStroke=wl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!r,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new Pn().copy(Ps(Ns({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e),this.vertices=[];for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Pn.Properties.length;t++){const n=Pn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Pn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Pn.Properties.length;n++){const r=Pn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(t=>t.toObject()),G.each(Pn.Properties,t=>{typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,s=e.top+e.height/2;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=s,this.mask.translation.y+=n),this}center(){const e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let r=0;r<this.vertices.length;r++){const s=this.vertices[r];s.x-=t,s.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,s,o,a,l=1/0,c=-1/0,d=1/0,h=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:u,scaleY:p}=ki(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof u=="number"&&typeof p=="number"&&(n=Math.max(u,p)*(this.linewidth||0)/2)}else n*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(r<=0)return{width:0,height:0};for(s=0;s<r;s++){a=this._renderer.vertices[s],o=this._renderer.vertices[(s+r-1)%r];const[u,p]=t.multiply(o.x,o.y),[f,g]=t.multiply(a.x,a.y);if(o.controls&&a.controls){let m=o.controls.right.x,y=o.controls.right.y;o.relative&&(m+=o.x,y+=o.y);let[_,b]=t.multiply(m,y),S=a.controls.left.x,x=a.controls.left.y;a.relative&&(S+=a.x,x+=a.y);let[v,B]=t.multiply(S,x);const k=Za(u,p,_,b,v,B,f,g);d=Si(k.min.y-n,d),l=Si(k.min.x-n,l),c=Bi(k.max.x+n,c),h=Bi(k.max.y+n,h)}else s<=1&&(d=Si(p-n,d),l=Si(u-n,l),c=Bi(u+n,c),h=Bi(p+n,h)),d=Si(g-n,d),l=Si(f-n,l),c=Bi(f+n,c),h=Bi(g+n,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}getPointAt(e,t){let n,r,s,o,a,l,c,d,h,u,p,f,g,m,y,_=this.length*Math.min(Math.max(e,0),1);const b=this.vertices.length,S=b-1;let x=null,v=null;for(let J=0,F=this._lengths.length,R=0;J<F;J++){if(R+this._lengths[J]>=_){this._closed?(n=Vt(J,b),r=Vt(J-1,b),J===0&&(n=r,r=J)):(n=J,r=Math.min(Math.max(J-1,0),S)),x=this.vertices[n],v=this.vertices[r],_-=R,this._lengths[J]!==0?e=_/this._lengths[J]:e=0;break}R+=this._lengths[J]}if(x===null||v===null)return null;if(x){if(!v)return x}else return v;y=v.controls&&v.controls.right,m=x.controls&&x.controls.left,a=v.x,u=v.y,l=(y||v).x,p=(y||v).y,c=(m||x).x,f=(m||x).y,d=x.x,g=x.y,y&&v.relative&&(l+=v.x,p+=v.y),m&&x.relative&&(c+=x.x,f+=x.y),o=Gi(e,a,l,c,d),h=Gi(e,u,p,f,g);const B=At(a,l,e),k=At(u,p,e),E=At(l,c,e),P=At(p,f,e),N=At(c,d,e),j=At(f,g,e),X=At(B,E,e),A=At(k,P,e),V=At(E,N,e),L=At(P,j,e);return G.isObject(t)?(t.x=o,t.y=h,t instanceof ve&&(t.controls.left.x=X,t.controls.left.y=A,t.controls.right.x=V,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,X-o,A-h,V-o,L-h,this._curved?ne.curve:ne.line),s.t=e,s)}plot(){if(this.curved)return Qa(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ne.move:ne.line;return this}subdivide(e){this._update();const t=this.vertices.length-1,n=this._closed||this.vertices[t]._command===ne.close;let r=this.vertices[t],s=[],o;return G.each(this.vertices,function(a,l){if(l<=0&&!n){r=a;return}if(a.command===ne.move){s.push(new ve(r.x,r.y)),l>0&&(s[s.length-1].command=ne.line),r=a;return}o=ul(a,r,e),s=s.concat(o),G.each(o,function(c,d){d<=0&&r.command===ne.move?c.command=ne.move:c.command=ne.line}),l>=t&&(this._closed&&this._automatic&&(r=a,o=ul(a,r,e),s=s.concat(o),G.each(o,function(c,d){d<=0&&r.command===ne.move?c.command=ne.move:c.command=ne.line})),s.push(new ve(a.x,a.y)),s[s.length-1].command=n?ne.close:ne.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=[]),G.each(this.vertices,function(a,l){if(l<=0||a.command===ne.move){s=a,this._lengths[l]=0;return}this._lengths[l]=hl(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=jg(s),l=qg(o);let c,d,h,u,p,f;for(this._renderer.vertices.length=0,f=0;f<e;f++)this._renderer.collection.length<=f&&this._renderer.collection.push(new ve),f>l&&!d?(p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(r,p),p.command=this._renderer.collection[f].command,this._renderer.vertices.push(p),d=p,h=this._collection[f-1],h&&h.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),h.relative?this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(Q.zero,1-p.t):this._renderer.collection[f-1].controls.right.copy(h.controls.right).lerp(h,1-p.t))):f>=a&&f<=l&&(p=this._renderer.collection[f].copy(this._collection[f]),this._renderer.vertices.push(p),f===l&&dl(this,r)?(d=p,!t&&d.controls&&(d.relative?d.controls.right.clear():d.controls.right.copy(d))):f===a&&dl(this,n)&&(c=p,c.command=ne.move,!t&&c.controls&&(c.relative?c.controls.left.clear():c.controls.left.copy(c))));a>0&&!c&&(f=a-1,p=this._renderer.collection[f].copy(this._collection[f]),this.getPointAt(n,p),p.command=ne.move,this._renderer.vertices.unshift(p),u=this._collection[f+1],u&&u.controls&&(p.controls.left.clear(),u.relative?this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(Q.zero,p.t):(Xg.copy(u),this._renderer.collection[f+1].controls.left.copy(u.controls.left).lerp(u,p.t))))}return mn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,mn.prototype.flagReset.call(this),this}},xe=Pn;w(xe,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),w(xe,"Utils",{getCurveLength:hl});var gl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.unbind(q.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.bind(q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.unbind(q.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.bind(q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(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";G.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(q.Types.insert,t).unbind(q.Types.remove,n),e instanceof Nn?this._collection=e:this._collection=new Nn(e||[]),this._collection.bind(q.Types.insert,t).bind(q.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,G.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 ml(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function yl(e){let t=e.length;for(;t--;)e[t].bind(q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function _l(e){let t=e.length;for(;t--;)e[t].unbind(q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function bl(){this._flagFill=!0}function wl(){this._flagStroke=!0}var Zi=class extends xe{constructor(e,t,n,r){const s=[new ve,new ve,new ve,new ve];super(s,!0,!1,!0),w(this,"_flagWidth",0),w(this,"_flagHeight",0),w(this,"_width",0),w(this,"_height",0),w(this,"_origin",null),this._renderer.type="rectangle";for(let o in vl)Object.defineProperty(this,o,vl[o]);this.width=typeof n=="number"?n:1,this.height=typeof r=="number"?r:1,this.origin=new Q,typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t),this._update()}static fromObject(e){const t=new Zi().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zi.Properties.length;t++){const n=Zi.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new ve),this.vertices[0].set(-e,-t).sub(this._origin).command=ne.move,this.vertices[1].set(e,-t).sub(this._origin).command=ne.line,this.vertices[2].set(e,t).sub(this._origin).command=ne.line,this.vertices[3].set(-e,t).sub(this._origin).command=ne.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=ne.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=new Zi(0,0,this.width,this.height);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}},Fn=Zi;w(Fn,"Properties",["width","height"]);var 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}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(q.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Ji=class extends Fn{constructor(e,t,n,r,s,o){super(t,n,0,0),w(this,"_flagTexture",!1),w(this,"_flagColumns",!1),w(this,"_flagRows",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_texture",null),w(this,"_columns",1),w(this,"_rows",1),w(this,"_frameRate",0),w(this,"_index",0),w(this,"_origin",null);for(let a in kl)Object.defineProperty(this,a,kl[a]);this.noStroke(),this.noFill(),e instanceof Te?this.texture=e:typeof e=="string"&&(this.texture=new Te(e)),this.origin=new Q,this._update(),typeof r=="number"&&(this.columns=r),typeof s=="number"&&(this.rows=s),typeof o=="number"&&(this.frameRate=o),this.index=0}static fromObject(e){const t=new Ji().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ji.Properties.length;t++){const n=Ji.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=G.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const t=new Ji(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&t.play(this._firstFrame,this._lastFrame),t.loop=this.loop,t.firstFrame=this.firstFrame,t.lastFrame=this.lastFrame,e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._texture,t=this._columns,n=this._rows;let r,s,o,a,l,c,d,h,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&&(G.isNaN(this._lastFrame)&&(this._lastFrame=a-1),o=G.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=At(this._firstFrame,u,o/l),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%t,f=Math.floor(this._index/t),g=-r*p+(d-r)/2,m=-s*f+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),m!==e.offset.y&&(e.offset.y=m)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}},Fr=Ji;w(Fr,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var kl={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}}},zs,xl=class extends Nn{constructor(t){t=Array.isArray(t)?t:Array.prototype.slice.call(arguments),super(t),Da(this,zs,{}),this.attach(t),this.on(q.Types.insert,this.attach),this.on(q.Types.remove,this.detach)}get ids(){return $t(this,zs)}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}};zs=new WeakMap;var Kn=class extends xe{constructor(e,t,n,r,s,o,a){const l=a||xt.Resolution*3,c=[];for(let d=0;d<l;d++)c.push(new ve);super(c,!0,!1,!0),w(this,"_flagStartAngle",!1),w(this,"_flagEndAngle",!1),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_startAngle",0),w(this,"_endAngle",ct),w(this,"_innerRadius",0),w(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let d in Cl)Object.defineProperty(this,d,Cl[d]);typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.startAngle=s),typeof o=="number"&&(this.endAngle=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Kn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,s=Vt(e,ct)===Vt(t,ct),o=n>0,a=this.vertices;let l=o?a.length/2:a.length,c,d=0,h,u,p,f,g,m,y,_,b;for(s?l--:o||(l-=2),h=0,u=l-1;h<l;h++){switch(p=h/u,f=a[d],g=p*(t-e)+e,m=(t-e)/l,y=r*Math.cos(g),_=r*Math.sin(g),h){case 0:c=ne.move;break;default:c=ne.curve}f.command=c,f.x=y,f.y=_,f.controls.left.clear(),f.controls.right.clear(),f.command===ne.curve&&(b=r*m/Math.PI,f.controls.left.x=b*Math.cos(g-Je),f.controls.left.y=b*Math.sin(g-Je),f.controls.right.x=b*Math.cos(g+Je),f.controls.right.y=b*Math.sin(g+Je),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++}if(o){for(s?(a[d].command=ne.close,d++):(l--,u=l-1),h=0;h<l;h++)p=h/u,f=a[d],g=(1-p)*(t-e)+e,m=(t-e)/l,y=n*Math.cos(g),_=n*Math.sin(g),c=ne.curve,h<=0&&(c=s?ne.move:ne.line),f.command=c,f.x=y,f.y=_,f.controls.left.clear(),f.controls.right.clear(),f.command===ne.curve&&(b=n*m/Math.PI,f.controls.left.x=b*Math.cos(g+Je),f.controls.left.y=b*Math.sin(g+Je),f.controls.right.x=b*Math.cos(g-Je),f.controls.right.y=b*Math.sin(g-Je),h===1&&f.controls.left.multiplyScalar(2),h===u&&f.controls.right.multiplyScalar(2)),d++;a[d].copy(a[0]),a[d].command=ne.line}else s||(a[d].command=ne.line,a[d].x=0,a[d].y=0,d++,a[d].copy(a[0]),a[d].command=ne.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.startAngle,s=this.endAngle,o=this.vertices.length,a=new Kn(0,0,t,n,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<xe.Properties.length;l++){const c=xe.Properties[l];a[c]=this[c]}return e&&e.add(a),a}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let t=0;t<Kn.Properties.length;t++){const n=Kn.Properties[t];e[n]=this[n]}return e}},Mr=Kn;w(Mr,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Cl={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}}},Ls=Math.cos,Ds=Math.sin,Zn=class extends xe{constructor(e,t,n,r){const s=r?Math.max(r,2):4,o=[];for(let a=0;a<s;a++)o.push(new ve(0,0,0,0,0,0));super(o,!0,!0,!0),w(this,"_flagRadius",!1),w(this,"_radius",0),this._renderer.type="circle";for(let a in Sl)Object.defineProperty(this,a,Sl[a]);typeof n=="number"&&(this.radius=n),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Zn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let s=0;s<this.vertices.length;s++){const a=s/e*ct,l=n*Ls(a),c=n*Ds(a),d=r*Ls(a-Je),h=r*Ds(a-Je),u=r*Ls(a+Je),p=r*Ds(a+Je),f=this.vertices[s];f.command=s===0?ne.move:ne.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=new Zn(0,0,this.radius,this.vertices.length);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let t=0;t<Zn.Properties.length;t++){const n=Zn.Properties[t];e[n]=this[n]}return e}},Qi=Zn;w(Qi,"Properties",["radius"]);var Sl={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Hs=Math.cos,Ws=Math.sin,Jn=class extends xe{constructor(e,t,n,r,s){typeof r!="number"&&typeof n=="number"&&(r=n);const o=s?Math.max(s,2):4,a=[];for(let l=0;l<o;l++)a.push(new ve);super(a,!0,!0,!0),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_width",0),w(this,"_height",0),this._renderer.type="ellipse";for(let l in Bl)Object.defineProperty(this,l,Bl[l]);typeof n=="number"&&(this.width=n*2),typeof r=="number"&&(this.height=r*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Jn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let s=0;s<this.vertices.length;s++){const a=s/e*ct,l=n*Hs(a),c=r*Ws(a),d=n*t*Hs(a-Je),h=r*t*Ws(a-Je),u=n*t*Hs(a+Je),p=r*t*Ws(a+Je),f=this.vertices[s];f.command=s===0?ne.move:ne.curve,f.set(l,c),f.controls.left.set(d,h),f.controls.right.set(u,p)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const t=this.width/2,n=this.height/2,r=this.vertices.length,s=new Jn(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let t=0;t<Jn.Properties.length;t++){const n=Jn.Properties[t];e[n]=this[n]}return e}},er=Jn;w(er,"Properties",["width","height"]);var Bl={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Yg=Math.ceil,Ug=Math.floor,Mn=class extends mn{constructor(e){super(),w(this,"_flagVertices",!0),w(this,"_flagLength",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagSize",!0),w(this,"_flagSizeAttenuation",!0),w(this,"_length",0),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_size",1),w(this,"_sizeAttenuation",!1),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_dashes",null),w(this,"noFill",xe.prototype.noFill),w(this,"noStroke",xe.prototype.noStroke),w(this,"corner",xe.prototype.corner),w(this,"center",xe.prototype.center),w(this,"getBoundingClientRect",xe.prototype.getBoundingClientRect),w(this,"_updateLength",xe.prototype._updateLength);for(let t in Tl)Object.defineProperty(this,t,Tl[t]);this._renderer.type="points",this._renderer.flagVertices=ml.bind(this),this._renderer.bindVertices=yl.bind(this),this._renderer.unbindVertices=_l.bind(this),this._renderer.flagFill=bl.bind(this),this._renderer.flagStroke=wl.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(e){const t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new Mn().copy(Ps(Ns({},e),{fill:t,stroke:n}));return"id"in e&&(r.id=e.id),r}copy(e){super.copy.call(this,e);for(let t=0;t<e.vertices.length;t++){const n=e.vertices[t];n instanceof ve?this.vertices.push(e.vertices[t].clone()):this.vertices.push(new ve().copy(n))}for(let t=0;t<Mn.Properties.length;t++){const n=Mn.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new Mn;for(let n=0;n<this.vertices.length;n++)t.vertices.push(this.vertices[n].clone());for(let n=0;n<Mn.Properties.length;n++){const r=Mn.Properties[n];t[r]=this[r]}return t.className=this.className,t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(t=>t.toObject()),G.each(Mn.Properties,function(t){typeof this[t]<"u"&&(this[t].toObject?e[t]=this[t].toObject():e[t]=this[t])},this),e}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n],s=this.vertices[n-1];if(!s)continue;const o=r.x,a=r.y,l=s.x,c=s.y,d=Ms(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=Yg(n),o=Ug(r);let a=0,l;this._renderer.vertices=[],this._renderer.collection=[];for(let c=0;c<this._collection.length;c++)c>=s&&c<=o&&(l=this._collection[c],this._renderer.collection.push(l),this._renderer.vertices[a*2+0]=l.x,this._renderer.vertices[a*2+1]=l.y,a++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}},Ar=Mn;w(Ar,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);var Tl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.unbind(q.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.bind(q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.unbind(q.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.bind(q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(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(q.Types.insert,t).unbind(q.Types.remove,n),e instanceof Nn?this._collection=e:this._collection=new Nn(e||[]),this._collection.bind(q.Types.insert,t).bind(q.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}}},Gg=Math.cos,Kg=Math.sin,Qn=class extends xe{constructor(e,t,n,r){r=Math.max(r||0,3),super(),w(this,"_flagWidth",!1),w(this,"_flagHeight",!1),w(this,"_flagSides",!1),w(this,"_radius",0),w(this,"_width",0),w(this,"_height",0),w(this,"_sides",0),this._renderer.type="polygon";for(let s in El)Object.defineProperty(this,s,El[s]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.radius=n),typeof r=="number"&&(this.sides=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new Qn().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ct*s+Math.PI/2,a=this._width*Gg(o)/2,l=this._height*Kg(o)/2;r>=n?this.vertices.push(new ve(a,l)):this.vertices[r].set(a,l),this.vertices[r].command=r===0?ne.move:ne.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=new Qn(0,0,0,this.sides);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.skewX=this.skewX,t.skewY=this.skewY,t.width=this.width,t.height=this.height,this.matrix.manual&&t.matrix.copy(this.matrix);for(let n=0;n<xe.Properties.length;n++){const r=xe.Properties[n];t[r]=this[r]}return e&&e.add(t),t}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let t=0;t<Qn.Properties.length;t++){const n=Qn.Properties[t];e[n]=this[n]}return e}},Vr=Qn;w(Vr,"Properties",["width","height","sides"]);var El={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},ei=class extends xe{constructor(e,t,n,r,s){typeof s>"u"&&typeof n=="number"&&typeof r=="number"&&(s=Math.floor(Math.min(n,r)/12));const o=[];for(let a=0;a<10;a++)o.push(new ve(0,0,0,0,0,0,a===0?ne.move:ne.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 Rl)Object.defineProperty(this,a,Rl[a]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Zg.bind(this),typeof n=="number"&&(this.width=n),typeof r=="number"&&(this.height=r),typeof s=="number"&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<ei.Properties.length;t++){const n=ei.Properties[t];if(n in e){const r=e[n];/radius/i.test(n)?this[n]=typeof r=="number"||r instanceof Q?r:new Q().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 Q?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let s,o=e/2,a=t/2;s=this.vertices[0],s.x=-(o-n),s.y=-a,s=this.vertices[1],s.x=o-n,s.y=-a,s.controls.left.clear(),s.controls.right.x=n,s.controls.right.y=0,s=this.vertices[2],s.x=o,s.y=-(a-r),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=o,s.y=a-r,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=r,s=this.vertices[4],s.x=o-n,s.y=a,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(o-n),s.y=a,s.controls.left.clear(),s.controls.right.x=-n,s.controls.right.y=0,s=this.vertices[6],s.x=-o,s.y=a-r,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-o,s.y=-(a-r),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-r,s=this.vertices[8],s.x=-(o-n),s.y=-a,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[9],s.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const t=this.width,n=this.height,r=this.radius,s=new ei(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let t=0;t<ei.Properties.length;t++){const n=ei.Properties[t];e[n]=this[n]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}},tr=ei;w(tr,"Properties",["width","height","radius"]);var Rl={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 Q&&this._radius.unbind(q.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof Q&&this._radius.bind(q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Zg(){this._flagRadius=!0}var Jg=Math.cos,Qg=Math.sin,ti=class extends xe{constructor(e,t,n,r,s){arguments.length<=3&&(r=n,n=r/2),(typeof s!="number"||s<=0)&&(s=5),super(),w(this,"_flagInnerRadius",!1),w(this,"_flagOuterRadius",!1),w(this,"_flagSides",!1),w(this,"_innerRadius",0),w(this,"_outerRadius",0),w(this,"_sides",0),this._renderer.type="star";for(let o in $l)Object.defineProperty(this,o,$l[o]);this.closed=!0,this.automatic=!1,typeof n=="number"&&(this.innerRadius=n),typeof r=="number"&&(this.outerRadius=r),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof t=="number"&&(this.translation.y=t)}static fromObject(e){const t=new ti().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<ti.Properties.length;t++){const n=ti.Properties[t];n in e&&typeof e[n]=="number"&&(this[n]=e[n])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,t=e+1;let n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){const s=(r+.5)/e,o=ct*s,a=(r%2?this._outerRadius:this._innerRadius)/2,l=a*Jg(o),c=a*Qg(o);r>=n?this.vertices.push(new ve(l,c)):this.vertices[r].set(l,c),this.vertices[r].command=r===0?ne.move:ne.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const t=this.innerRadius,n=this.outerRadius,r=this.sides,s=new ti(0,0,t,n,r);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let o=0;o<xe.Properties.length;o++){const a=xe.Properties[o];s[a]=this[a]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let t=0;t<ti.Properties.length;t++){const n=ti.Properties[t];e[n]=this[n]}return e}},Ir=ti;w(Ir,"Properties",["innerRadius","outerRadius","sides"]);var $l={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}}},js,Nl=Math.min,Pl=Math.max;Le.document&&(js=document.createElement("canvas"));var zt=class extends mn{constructor(e,t,n,r){super(),w(this,"_flagValue",!0),w(this,"_flagFamily",!0),w(this,"_flagSize",!0),w(this,"_flagLeading",!0),w(this,"_flagAlignment",!0),w(this,"_flagBaseline",!0),w(this,"_flagStyle",!0),w(this,"_flagWeight",!0),w(this,"_flagDecoration",!0),w(this,"_flagFill",!0),w(this,"_flagStroke",!0),w(this,"_flagLinewidth",!0),w(this,"_flagOpacity",!0),w(this,"_flagVisible",!0),w(this,"_flagMask",!1),w(this,"_flagClip",!1),w(this,"_flagDirection",!0),w(this,"_value",""),w(this,"_family","sans-serif"),w(this,"_size",13),w(this,"_leading",17),w(this,"_alignment","center"),w(this,"_baseline","middle"),w(this,"_style","normal"),w(this,"_weight",500),w(this,"_decoration","none"),w(this,"_direction","ltr"),w(this,"_fill","#000"),w(this,"_stroke","none"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_mask",null),w(this,"_clip",!1),w(this,"_dashes",null);for(let s in Fl)Object.defineProperty(this,s,Fl[s]);if(this._renderer.type="text",this._renderer.flagFill=em.bind(this),this._renderer.flagStroke=tm.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,!G.isObject(r))return this;for(let s=0;s<zt.Properties.length;s++){const o=zt.Properties[s];o in r&&(this[o]=r[o])}}static Measure(e){if(js){const t=js.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*zt.Ratio,n=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:t,height:n}}}static fromObject(e){const t=typeof e.fill=="string"?e.fill:Un(e.fill),n=typeof e.stroke=="string"?e.stroke:Un(e.stroke),r=new zt().copy(Ps(Ns({},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<zt.Properties.length;t++){const n=zt.Properties[t];n in e&&(this[n]=e[n])}return this}clone(e){const t=new zt(this.value);t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale;for(let n=0;n<zt.Properties.length;n++){const r=zt.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<zt.Properties.length;t++){const n=zt.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}=zt.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,p]=t.multiply(n,o),[f,g]=t.multiply(r,s),[m,y]=t.multiply(r,o);return s=Nl(h,p,g,y),n=Nl(d,u,f,m),r=Pl(d,u,f,m),o=Pl(h,p,g,y),{top:s,left:n,right:r,bottom:o,width:r-n,height:o-s}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}},Ht=zt;w(Ht,"Ratio",.6),w(Ht,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);var Fl={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.unbind(q.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Ye||this._fill instanceof Ae||this._fill instanceof Ve||this._fill instanceof Te)&&this._fill.bind(q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.unbind(q.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Ye||this._stroke instanceof Ae||this._stroke instanceof Ve||this._stroke instanceof Te)&&this._stroke.bind(q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,G.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 em(){this._flagFill=!0}function tm(){this._flagStroke=!0}var Or=Math.min,zr=Math.max,Ti=class extends mn{constructor(e){super(),w(this,"_flagAdditions",!1),w(this,"_flagSubtractions",!1),w(this,"_flagOrder",!1),w(this,"_flagOpacity",!0),w(this,"_flagBeginning",!1),w(this,"_flagEnding",!1),w(this,"_flagLength",!1),w(this,"_flagMask",!1),w(this,"_fill","#fff"),w(this,"_stroke","#000"),w(this,"_linewidth",1),w(this,"_opacity",1),w(this,"_visible",!0),w(this,"_cap","round"),w(this,"_join","round"),w(this,"_miter",4),w(this,"_closed",!0),w(this,"_curved",!1),w(this,"_automatic",!0),w(this,"_beginning",0),w(this,"_ending",1),w(this,"_length",0),w(this,"_mask",null);for(let t in Ml)Object.defineProperty(this,t,Ml[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++)Al.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)Al.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const t=new Ti;for(let r=0;r<Ti.Properties.length;r++){const s=Ti.Properties[r];s in e&&(/(fill|stroke)/i.test(s)?t[s]=typeof e[s]=="string"?e[s]:Un(e[s]):t[s]=e[s])}return"mask"in e&&(t.mask=n(e.mask)),"id"in e&&(t.id=e.id),t.children=e.children.map(n),t;function n(r){if(r&&r.renderer)switch(r.renderer.type){case"arc-segment":return Mr.fromObject(r);case"circle":return Qi.fromObject(r);case"ellipse":return er.fromObject(r);case"points":return Ar.fromObject(r);case"polygon":return Vr.fromObject(r);case"rectangle":return Fn.fromObject(r);case"rounded-rectangle":return tr.fromObject(r);case"star":return Ir.fromObject(r);case"path":return xe.fromObject(r);case"text":return Ht.fromObject(r);case"group":return Ti.fromObject(r);case"shape":return mn.fromObject(r);case"element":return qn.fromObject(r)}return r}}copy(e){return super.copy.call(this,e),console.warn("Two.Group.copy is not supported yet."),this}clone(e){const t=new Ti,n=this.children.map(function(r){return r.clone()});return t.add(n),t.opacity=this.opacity,this.mask&&(t.mask=this.mask),t.translation.copy(this.translation),t.rotation=this.rotation,t.scale=this.scale,t.className=this.className,this.matrix.manual&&t.matrix.copy(this.matrix),e&&e.add(t),t._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,G.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 p=0;p<this.children.length;p++){const f=this.children[p];if(!(!f.visible||u.test(f._renderer.type))&&(t=f.getBoundingClientRect(e),r=typeof t.top!="number"||G.isNaN(t.top)||!isFinite(t.top),s=typeof t.left!="number"||G.isNaN(t.left)||!isFinite(t.left),o=typeof t.right!="number"||G.isNaN(t.right)||!isFinite(t.right),a=typeof t.bottom!="number"||G.isNaN(t.bottom)||!isFinite(t.bottom),!(r||s||o||a)))if(e){const[g,m]=n.multiply(t.left,t.top),[y,_]=n.multiply(t.right,t.top),[b,S]=n.multiply(t.left,t.bottom),[x,v]=n.multiply(t.right,t.bottom);d=Or(m,_,S,v,d),l=Or(g,y,b,x,l),c=zr(g,y,b,x,c),h=zr(m,_,S,v,h)}else d=Or(t.top,d),l=Or(t.left,l),c=zr(t.right,c),h=zr(t.bottom,h)}return{top:d,left:l,right:c,bottom:h,width:c-l,height:h-d}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){const r=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),o=this.length;let a=0;const l=r*o,c=s*o;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,l>a+t?(n.beginning=1,n.ending=1):c<a?(n.beginning=0,n.ending=0):l>a&&l<a+t?(n.beginning=(l-a)/t,n.ending=1):c>a&&c<a+t?(n.beginning=0,n.ending=(c-a)/t):(n.beginning=0,n.ending=1),a+=t}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}},Ge=Ti;w(Ge,"Children",xl),w(Ge,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var Ml={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 xl(e),this._children.bind(q.Types.insert,t),this._children.bind(q.Types.remove,n),this._children.bind(q.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,G.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Al(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 Lr=class extends xe{constructor(t,n,r,s){const o=[new ve(t,n),new ve(r,s)];super(o);for(let a in Vl)Object.defineProperty(this,a,Vl[a]);this.vertices[0].command=ne.move,this.vertices[1].command=ne.line,this.automatic=!1}};w(Lr,"Properties",["left","right"]);var Vl={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(G.isObject(e))this.vertices.splice(0,1,e);else{const t=new Nt("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(G.isObject(e))this.vertices.splice(1,1,e);else{const t=new Nt("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}},rn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},nm={start:"left",middle:"center",end:"right"},Il=["id","class","transform","xmlns","viewBox"],im=["x","y","width","height","href","xlink:href"];function rm(e){return nm[e]}function sm(e){const t=e.getAttribute("dominant-baseline"),n=e.getAttribute("alignment-baseline");return t||n}function nr(e){return e.replace(/svg:/gi,"").toLowerCase()}function Ol(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 om(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 am(e){const t={},n=lm(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 lm(e){const t=e.getAttributeNames();for(let n=0;n<Il.length;n++){const r=Il[n],s=Array.prototype.indexOf.call(t,r);s>=0&&t.splice(s,1)}return t}function cm(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 p=e.children[u];"translation"in p?p.translation.add(r,s):"x"in p?p.x=r:"y"in p&&(p.y=s)}const l=typeof e.x=="number",c=typeof e.y=="number",d=typeof e.width=="number",h=typeof e.height=="number";return l&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(d||h)&&(e.scale=new Q(1,1)),d&&(e.scale.x=e.width/o),h&&(e.scale.y=e.height/a),e.mask=new Fn(0,0,o,a),e.mask.origin.set(-o/2,-a/2),e}function Wt(e,t,n){const r={},s={},o={};let a,l,c,d,h,u,p,f,g,m,y,_,b,S,x,v,B;if(e===null)return r;if(Le.getComputedStyle){const k=Le.getComputedStyle(e);for(a=k.length;a--;)c=k[a],d=k[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<e.attributes.length;a++)u=e.attributes[a],/style/i.test(u.nodeName)?om(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&&G.defaults(r,n),G.extend(r,o,s),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;switch(p=ki(l),t._renderer.type){case"linear-gradient":Ol(p,t.left),Ol(p,t.right);break;case"radial-gradient":t.center.x+=p.translateX,t.center.y+=p.translateY,t.focal.x+=p.translateX,t.focal.y+=p.translateY,t.radius*=Math.max(p.scaleX,p.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,l===null))break;p=ki(l),t.translation.set(p.translateX,p.translateY),t.rotation=Math.PI*(p.rotation/180),t.scale=new Q(p.scaleX,p.scaleY),f=parseFloat((r.x+"").replace("px")),g=parseFloat((r.y+"").replace("px")),f&&(t.translation.x=f),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(rn.cssBackgroundImage.test(d)&&(m=d.replace(rn.cssBackgroundImage,"$1"),Oe.defs.current&&Oe.defs.current.contains(m)&&(_=Oe.defs.current.get(m),_&&_.childNodes.length>0)))switch(_=_.childNodes[0],b=nr(_.nodeName),t.mask=Oe[b].call(this,_,{}),t._renderer.type){case"text":case"path":t.position.add(t.mask.position),t.mask.position.clear();break}break;case"fill":case"stroke":h=(t instanceof Ge?"_":"")+c,rn.cssBackgroundImage.test(d)?(m=d.replace(rn.cssBackgroundImage,"$1"),Oe.defs.current&&Oe.defs.current.contains(m)?(_=Oe.defs.current.get(m),_.object||(b=nr(_.nodeName),_.object=Oe[b].call(this,_,{})),_=_.object):(y=hm(this),_=y.getById(m)),t[h]=_):t[h]=d;break;case"id":t.id=d;break;case"class":case"className":t.classList=d.split(" "),t._flagClassName=!0;break;case"x":case"y":if(S=t instanceof Ye,x=t instanceof Ae,v=t instanceof Ve,S||x||v)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Nt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.translation[c]=parseFloat(d);break;case"font-family":t instanceof Ht&&(t.family=d);break;case"font-size":t instanceof Ht&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(B=new Nt("only pixel values are supported with the "+c+" attribute."),console.warn(B.name,B.message)),t.size=parseFloat(d));break;case"font-weight":t instanceof Ht&&(t.weight=d);break;case"font-style":t instanceof Ht&&(t.style=d);break;case"text-decoration":t instanceof Ht&&(t.decoration=d);break;case"line-height":t instanceof Ht&&(t.leading=d);break}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function dm(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){const s=e.childNodes[n];!s.id||nr(e.nodeName)==="#text"||t.add(s.id,s)}}function hm(e){for(;e.parent;)e=e.parent;return e.scene}var Oe={svg:function(e){const t=Oe.defs.current=new Rr,n=e.getElementsByTagName("defs");for(let g=0;g<n.length;g++)dm(n[g],t);const r=Oe.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,p=l!==null,f=c!==null;return h&&(r.x=parseFloat(o.replace(rn.unitSuffix,""))),u&&(r.y=parseFloat(a.replace(rn.unitSuffix,""))),p&&(r.width=parseFloat(l.replace(rn.unitSuffix,""))),f&&(r.height=parseFloat(c.replace(rn.unitSuffix,""))),d&&cm(r,s),delete Oe.defs.current,r},defs:function(e){return null},use:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Nt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const s=r.slice(1);if(!Oe.defs.current.contains(s))return n=new Nt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=Oe.defs.current.get(s).cloneNode(!0);for(let c=0;c<e.attributes.length;c++){const d=e.attributes[c],h=im.includes(d.nodeName),u=!a.hasAttribute(d.nodeName);(h||u)&&a.setAttribute(d.nodeName,d.value)}const l=nr(a.nodeName);return Oe[l].call(this,a,t)},g:function(e,t){const n=new Ge;Wt.call(this,e,n,t),this.add(n);const r=am.call(this,e);for(let s=0,o=e.childNodes.length;s<o;s++){const a=e.childNodes[s],l=a.nodeName;if(!l)return;const c=nr(l);if(c in Oe){const d=Oe[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(e,t){let n;typeof e=="string"?n=e:n=e.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(o,a,l){r.push(new ve(parseFloat(a),parseFloat(l)))});const s=new xe(r,!0);return s.stroke="none",s.fill="black",Wt.call(this,e,s,t),s},polyline:function(e,t){const n=Oe.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;G.each(h.slice(0),function(p,f){const g=p.slice(1).trim().match(rn.path),m=p[0],y=m.toLowerCase();let _,b,S,x,v;const B=[];switch(f===0&&(h=[]),y){case"h":case"v":g.length>1&&(_=1);break;case"m":case"l":case"t":g.length>2&&(_=2);break;case"s":case"q":g.length>4&&(_=4);break;case"c":g.length>6&&(_=6);break;case"a":g.length>7&&(_=7);break}if(_){for(b=0,S=g.length,v=0;b<S;b+=_){if(x=m,v>0)switch(m){case"m":x="l";break;case"M":x="L";break}B.push(x+g.slice(b,b+_).join(" ")),v++}h=Array.prototype.concat.apply(h,B)}else h.push(p)}),G.each(h,function(p,f){let g,m,y;const _=p[0],b=_.toLowerCase();d=p.slice(1).trim().match(rn.path),o=_===b;let S,x,v,B,k,E,P,N,j,X,A,V,L,J,F,R,$;switch(b){case"z":if(f>=u)s=!0;else{m=l.x,y=l.y,g=new ve(m,y,void 0,void 0,void 0,void 0,ne.close);for(let M=r.length-1;M>=0;M--){const U=r[M];if(/m/i.test(U.command)){l=U;break}}}break;case"m":case"l":c=void 0,m=parseFloat(d[0]),y=parseFloat(d[1]),g=new ve(m,y,void 0,void 0,void 0,void 0,/m/i.test(b)?ne.move:ne.line),o&&g.addSelf(l),l=g;break;case"h":case"v":X=/h/i.test(b)?"x":"y",A=/x/i.test(X)?"y":"x",g=new ve(void 0,void 0,void 0,void 0,void 0,void 0,ne.line),g[X]=parseFloat(d[0]),g[A]=l[A],o&&(g[X]+=l[X]),l=g;break;case"c":case"s":S=l.x,x=l.y,c||(c=new Q),/c/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[2]),E=parseFloat(d[3]),P=parseFloat(d[4]),N=parseFloat(d[5])):(j=As(l,c,o),v=j.x,B=j.y,k=parseFloat(d[0]),E=parseFloat(d[1]),P=parseFloat(d[2]),N=parseFloat(d[3])),o&&(v+=S,B+=x,k+=S,E+=x,P+=S,N+=x),l.controls.right.set(v-l.x,B-l.y),g=new ve(P,N,k-P,E-N,void 0,void 0,ne.curve),l=g,c=g.controls.left;break;case"t":case"q":S=l.x,x=l.y,c||(c=new Q),/q/i.test(b)?(v=parseFloat(d[0]),B=parseFloat(d[1]),k=parseFloat(d[0]),E=parseFloat(d[1]),P=parseFloat(d[2]),N=parseFloat(d[3])):(j=As(l,c,o),v=j.x,B=j.y,k=j.x,E=j.y,P=parseFloat(d[0]),N=parseFloat(d[1])),o&&(v+=S,B+=x,k+=S,E+=x,P+=S,N+=x),l.controls.right.set((v-l.x)*.33,(B-l.y)*.33),g=new ve(P,N,k-P,E-N,void 0,void 0,ne.curve),l=g,c=g.controls.left;break;case"a":S=l.x,x=l.y,L=parseFloat(d[0]),J=parseFloat(d[1]),F=parseFloat(d[2]),R=parseFloat(d[3]),$=parseFloat(d[4]),P=parseFloat(d[5]),N=parseFloat(d[6]),o&&(P+=S,N+=x),V=new ve(P,N),V.command=ne.arc,V.rx=L,V.ry=J,V.xAxisRotation=F,V.largeArcFlag=R,V.sweepFlag=$,g=V,l=V,c=void 0;break}g&&(Array.isArray(g)?r=r.concat(g):r.push(g))})}n=new xe(r,s,void 0,!0),n.stroke="none",n.fill="black";const a=n.getBoundingClientRect(!0);return a.centroid={x:a.left+a.width/2,y:a.top+a.height/2},G.each(n.vertices,function(l){l.subSelf(a.centroid)}),Wt.call(this,e,n,t),n.translation.addSelf(a.centroid),n},circle:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("r")),o=new Qi(0,0,s);return o.stroke="none",o.fill="black",Wt.call(this,e,o,t),o.translation.x=n,o.translation.y=r,o},ellipse:function(e,t){const n=parseFloat(e.getAttribute("cx")),r=parseFloat(e.getAttribute("cy")),s=parseFloat(e.getAttribute("rx")),o=parseFloat(e.getAttribute("ry")),a=new er(0,0,s,o);return a.stroke="none",a.fill="black",Wt.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(!G.isNaN(n)||!G.isNaN(r))return Oe["rounded-rect"](e);const s=parseFloat(e.getAttribute("width")),o=parseFloat(e.getAttribute("height")),a=s/2,l=o/2,c=new Fn(0,0,s,o);return c.stroke="none",c.fill="black",Wt.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 Q(n,r),d=new tr(0,0,s,o,c);return d.stroke="none",d.fill="black",Wt.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 Lr(n,r,s,o).noFill();return Wt.call(this,e,a,t),a},lineargradient:function(e,t){let n=e.getAttribute("gradientUnits"),r=e.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let s=parseFloat(e.getAttribute("x1")||0),o=parseFloat(e.getAttribute("y1")||0),a=parseFloat(e.getAttribute("x2")||0),l=parseFloat(e.getAttribute("y2")||0);const c=(a+s)/2,d=(l+o)/2;/userSpaceOnUse/i.test(n)&&(s-=c,o-=d,a-=c,l-=d);const h=[];for(let p=0;p<e.children.length;p++){const f=e.children[p];let g=f.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let m=f.getAttribute("stop-color"),y=f.getAttribute("stop-opacity"),_=f.getAttribute("style"),b;m===null&&(b=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,m=b&&b.length>1?b[1]:void 0),y===null?(b=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=b&&b.length>1?parseFloat(b[1]):1):y=parseFloat(y),h.push(new nn(g,m,y))}const u=new Ae(s,o,a,l,h);return u.spread=r,u.units=n,Wt.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"));G.isNaN(l)&&(l=s),G.isNaN(c)&&(c=o);const d=Math.abs(s+l)/2,h=Math.abs(o+c)/2;/userSpaceOnUse/i.test(n)&&(s-=d,o-=h,l-=d,c-=h);const u=[];for(let f=0;f<e.children.length;f++){const g=e.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let y=g.getAttribute("stop-color"),_=g.getAttribute("stop-opacity"),b=g.getAttribute("style"),S;y===null&&(S=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=S&&S.length>1?S[1]:void 0),_===null?(S=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,_=S&&S.length>1?parseFloat(S[1]):1):_=parseFloat(_),u.push(new nn(m,y,_))}const p=new Ve(s,o,a,u,l,c);return p.spread=r,p.units=n,Wt.call(this,e,p,t),p},text:function(e,t){const n=rm(e.getAttribute("text-anchor"))||"left",r=sm(e)||"baseline";let s="";e.childNodes.length>0&&e.childNodes[0].tagName==="TSPAN"?s=e.childNodes[0].textContent:s=e.textContent;const o=new Ht(s);return Wt.call(this,e,o,t),o.alignment=n,o.baseline=r,o},clippath:function(e,t){return Oe.defs.current&&!Oe.defs.current.contains(e.id)&&Oe.defs.current.add(e.id,e),null},image:function(e,t){let n;const r=e.getAttribute("href")||e.getAttribute("xlink:href");if(!r)return n=new Nt("encountered <image /> with no href."),console.warn(n.name,n.message),null;const s=parseFloat(e.getAttribute("x"))||0,o=parseFloat(e.getAttribute("y"))||0,a=parseFloat(e.getAttribute("width")),l=parseFloat(e.getAttribute("height")),c=new Fr(r,s,o);return G.isNaN(a)||(c.width=a),G.isNaN(l)||(c.height=l),Wt.call(this,e,c,t),c}};function zl(e,t){const n=new XMLHttpRequest;return n.open("GET",e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Ei=class extends Fn{constructor(e,t,n,r){super(t,n,0,0),w(this,"_flagTextures",!1),w(this,"_flagFrameRate",!1),w(this,"_flagIndex",!1),w(this,"_amount",1),w(this,"_duration",0),w(this,"_index",0),w(this,"_startTime",0),w(this,"_playing",!1),w(this,"_firstFrame",0),w(this,"_lastFrame",0),w(this,"_loop",!0),w(this,"_textures",null),w(this,"_frameRate",0),w(this,"_origin",null);for(let s in Ll)Object.defineProperty(this,s,Ll[s]);this._renderer.flagTextures=um.bind(this),this._renderer.bindTextures=fm.bind(this),this._renderer.unbindTextures=pm.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(Dl.bind(this)):this.textures=[Dl(e)],this.origin=new Q,this._update(),typeof r=="number"?this.frameRate=r:this.frameRate=Ei.DefaultFrameRate,this.index=0}static fromObject(e){const t=new Ei().copy(e);return"id"in e&&(t.id=e.id),t}copy(e){super.copy.call(this,e);for(let t=0;t<Ei.Properties.length;t++){const n=Ei.Properties[t];n in e&&(this[n]=e[n])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=G.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof t=="number"&&(this._lastFrame=t),typeof n=="function"?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const t=new Ei(this.textures,this.translation.x,this.translation.y,this.frameRate);return t._loop=this._loop,this._playing&&t.play(),e&&e.add(t),t}toObject(){const e=super.toObject.call(this);return e.textures=this.textures.map(function(t){return t.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}_update(){const e=this._textures;let t,n,r,s,o,a,l,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,G.isNaN(this._lastFrame)&&(this._lastFrame=s-1),r=G.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=At(this._firstFrame,c,r/o),l=Math.floor(l),l!==this._index&&(this._index=l,a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=a,l>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Te))&&(a=e[this._index],a.loaded&&(t=a.image.width,n=a.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=a)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}},Dr=Ei;w(Dr,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),w(Dr,"DefaultFrameRate",30);var Ll={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(q.Types.insert,t).unbind(q.Types.remove,n),this._textures=new Nn((e||[]).slice(0)),this._textures.bind(q.Types.insert,t).bind(q.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 um(){this._flagTextures=!0}function fm(e){let t=e.length;for(;t--;)e[t].bind(q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function pm(e){let t=e.length;for(;t--;)e[t].unbind(q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Dl(e){if(e instanceof Te)return e;if(typeof e=="string")return new Te(e)}var qs=[],Xs=Math.max,gm=Math.min,Hl=Math.abs,Hr=Math.sin,Wr=Math.cos,mm=Math.acos,jr=Math.sqrt,Be={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(e){return e in Be?e:"path"},group:{renderChild:function(e){const t=Be.getRendererType(e._renderer.type);Be[t].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=qr(t),o=!s||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,o&&(e.save(),s||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r){const a=Be.getRendererType(r._renderer.type);Be[a].render.call(r,e,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Be.getRendererType(l._renderer.type);Be[c].render.call(l,e)}return o&&e.restore(),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,g,m,y,_,b,S,x,v,B,k,E,P,N,j,X,A,V,L,J,F,R,$,M;if(M=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,L=this._mask,J=this._clip,l=this._opacity*(M||1),c=this._visible,!t&&(!c||J||l===0))return this;if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,d=this._cap,h=this._join,u=this._miter,p=this._closed,f=this._renderer.vertices,g=f.length,m=g-1,F=qr(r),$=this.dashes,F||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),L){const se=Be.getRendererType(L._renderer.type);Be[se].render.call(L,e,!0)}if(a)if(typeof a=="string")e.fillStyle=a;else{const se=Be.getRendererType(a._renderer.type);Be[se].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const se=Be.getRendererType(s._renderer.type);Be[se].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o),u&&(e.miterLimit=u),h&&(e.lineJoin=h),!p&&d&&(e.lineCap=d)}typeof l=="number"&&(e.globalAlpha=l),$&&$.length>0&&(e.lineDashOffset=$.offset||0,e.setLineDash($)),e.beginPath();let U,z,O,ee,pe,re,ge;for(let se=0;se<g;se++)switch(b=f[se],A=b.x,V=b.y,b.command){case ne.close:e.closePath();break;case ne.arc:U=b.rx,z=b.ry,O=b.xAxisRotation,ee=b.largeArcFlag,pe=b.sweepFlag,y=p?Vt(se-1,g):Xs(se-1,0),_=f[y],re=_.x,ge=_.y,Be.renderSvgArcCommand(e,re,ge,U,z,ee,pe,O,A,V);break;case ne.curve:y=p?Vt(se-1,g):Math.max(se-1,0),_=f[y],P=_.controls&&_.controls.right||Q.zero,N=b.controls&&b.controls.left||Q.zero,_._relative?(k=P.x+_.x,E=P.y+_.y):(k=P.x,E=P.y),b._relative?(v=N.x+b.x,B=N.y+b.y):(v=N.x,B=N.y),e.bezierCurveTo(k,E,v,B,A,V),se>=m&&p&&(S=x,j=b.controls&&b.controls.right||Q.zero,X=S.controls&&S.controls.left||Q.zero,b._relative?(k=j.x+b.x,E=j.y+b.y):(k=j.x,E=j.y),S._relative?(v=X.x+S.x,B=X.y+S.y):(v=X.x,B=X.y),A=S.x,V=S.y,e.bezierCurveTo(k,E,v,B,A,V));break;case ne.line:e.lineTo(A,V);break;case ne.move:x=b,e.moveTo(A,V);break}return p&&e.closePath(),!J&&!n&&(Be.isHidden.test(a)||(R=a._renderer&&a._renderer.offset,R&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),R&&e.restore()),Be.isHidden.test(s)||(R=s._renderer&&s._renderer.offset,R&&(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(),R&&e.restore())),F||e.restore(),J&&!n&&e.clip(),$&&$.length>0&&e.setLineDash(qs),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(e,t,n){let r,s,o,a,l,c,d,h,u,p,f,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(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,s=this._stroke,o=this._linewidth,a=this._fill,h=this._renderer.collection,u=h.length,m=qr(r),_=this.dashes,d=this._size,m||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")e.fillStyle=a;else{const v=Be.getRendererType(a._renderer.type);Be[v].render.call(a,e,this),e.fillStyle=a._renderer.effect}if(s){if(typeof s=="string")e.strokeStyle=s;else{const v=Be.getRendererType(s._renderer.type);Be[v].render.call(s,e,this),e.strokeStyle=s._renderer.effect}o&&(e.lineWidth=o)}typeof l=="number"&&(e.globalAlpha=l),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),e.beginPath();let S=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=ki(x[0],x[3],x[1],x[4],x[2],x[5]),S/=Math.max(x.scaleX,x.scaleY));for(let v=0;v<u;v++)p=h[v],f=p.x,g=p.y,e.moveTo(f+S,g),e.arc(f,g,S,0,ct);return n||(Be.isHidden.test(a)||(y=a._renderer&&a._renderer.offset,y&&(e.save(),e.translate(-a._renderer.offset.x,-a._renderer.offset.y),e.scale(a._renderer.scale.x,a._renderer.scale.y)),e.fill(),y&&e.restore()),Be.isHidden.test(s)||(y=s._renderer&&s._renderer.offset,y&&(e.save(),e.translate(-s._renderer.offset.x,-s._renderer.offset.y),e.scale(s._renderer.scale.x,s._renderer.scale.y),e.lineWidth=o/s._renderer.scale.x),e.stroke(),y&&e.restore())),m||e.restore(),_&&_.length>0&&e.setLineDash(qs),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),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;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,h=this._linewidth,u=this._fill,p=this._decoration,f=this._direction,g=qr(c),m=u._renderer&&u._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,_=Be.alignments[this._alignment]||this._alignment,b=Be.baselines[this._baseline]||this._baseline;let S,x,v,B,k,E,P,N,j,X,A;if(g||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const V=Be.getRendererType(a._renderer.type);Be[V].render.call(a,e,!0)}if(m||(e.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),e.textAlign=_,e.textBaseline=b,e.direction=f,u)if(typeof u=="string")e.fillStyle=u;else{const V=Be.getRendererType(u._renderer.type);Be[V].render.call(u,e,this),e.fillStyle=u._renderer.effect}if(d){if(typeof d=="string")e.strokeStyle=d;else{const V=Be.getRendererType(d._renderer.type);Be[V].render.call(d,e,this),e.strokeStyle=d._renderer.effect}h&&(e.lineWidth=h)}if(typeof s=="number"&&(e.globalAlpha=s),y&&y.length>0&&(e.lineDashOffset=y.offset||0,e.setLineDash(y)),!l&&!n&&(Be.isHidden.test(u)||(u._renderer&&u._renderer.offset?(E=u._renderer.scale.x,P=u._renderer.scale.y,e.save(),e.translate(-u._renderer.offset.x,-u._renderer.offset.y),e.scale(E,P),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(" "),v=u._renderer.offset.x/u._renderer.scale.x,B=u._renderer.offset.y/u._renderer.scale.y,e.fillText(this.value,v,B),e.restore()):e.fillText(this.value,0,0)),Be.isHidden.test(d)||(d._renderer&&d._renderer.offset?(E=d._renderer.scale.x,P=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(E,P),S=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,S+"px/",x+"px",this._family].join(" "),v=d._renderer.offset.x/d._renderer.scale.x,B=d._renderer.offset.y/d._renderer.scale.y,k=h/d._renderer.scale.x,e.lineWidth=k,e.strokeText(this.value,v,B),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(p)){const V=e.measureText(this.value);let L=1;switch(p){case"underline":j=V.actualBoundingBoxDescent,A=V.actualBoundingBoxDescent;break;case"strikethrough":j=0,A=0,L=.5;break}switch(b){case"top":j+=this._size*L,A+=this._size*L;break;case"baseline":case"bottom":j-=this._size*L,A-=this._size*L;break}switch(_){case"left":case"start":N=0,X=V.width;break;case"right":case"end":N=-V.width,X=0;break;default:N=-V.width/2,X=V.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(N,j),e.lineTo(X,A),e.stroke()}return g||e.restore(),l&&!n&&e.clip(),y&&y.length>0&&e.setLineDash(qs),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=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 G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=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 G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(e){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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 Q||(this._renderer.offset=new Q),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 Q?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof Q||(this._renderer.scale=new Q),this._scale instanceof Q?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,s,o,a,l,c,d){l=l*Math.PI/180,r=Hl(r),s=Hl(s);const h=(t-c)/2,u=(n-d)/2,p=Wr(l)*h+Hr(l)*u,f=-Hr(l)*h+Wr(l)*u,g=p*p,m=f*f;let y=r*r,_=s*s;const b=g/y+m/_;if(b>1){const V=jr(b);r=V*r,s=V*s,y=r*r,_=s*s}const S=y*m+_*g,x=(y*_-S)/S;let v=jr(Xs(0,x));o===a&&(v=-v);const B=v*r*f/s,k=-v*s*p/r,E=Wr(l)*B-Hr(l)*k+(t+c)/2,P=Hr(l)*B+Wr(l)*k+(n+d)/2,N=Wl(1,0,(p-B)/r,(f-k)/s),j=Wl((p-B)/r,(f-k)/s,(-p-B)/r,(-f-k)/s)%ct,X=N+j;ym(e,E,P,r,s,N,X,a===0,l)}},ht=class extends q{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"?Vs(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&G.extend(this.domElement.style,{width:e+"px",height:t+"px"}),this.trigger(q.Types.resize,e,t,n)}render(){const e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Be.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};w(ht,"Utils",Be);function ym(e,t,n,r,s,o,a,l,c){const d=a-o,h=xi.Tolerance.epsilon,u=Math.abs(d)<h;let p=Vt(d,ct);p<h&&(u?p=0:p=ct),l===!0&&!u&&(p===ct?p=-ct:p=p-ct);for(let f=0;f<xt.Resolution;f++){const g=f/(xt.Resolution-1),m=o+g*p;let y=t+r*Math.cos(m),_=n+s*Math.sin(m);if(c!==0){const b=Math.cos(c),S=Math.sin(c),x=y-t,v=_-n;y=x*b-v*S+t,_=x*S+v*b+n}e.lineTo(y,_)}}function Wl(e,t,n,r){const s=e*n+t*r,o=jr(e*e+t*t)*jr(n*n+r*r);let a=mm(Xs(-1,gm(1,s/o)));return e*r-t*n<0&&(a=-a),a}function qr(e){return e[0]==1&&e[3]==0&&e[1]==0&&e[4]==1&&e[2]==0&&e[5]==0}var oe={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(e,t){const n=e,r=document.createElementNS(oe.ns,n);return n==="svg"&&(t=G.defaults(t||{},{version:oe.version})),t&&Object.keys(t).length>0&&oe.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(oe.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?Vt(a-1,n):Math.max(a-1,0),d=e[c];let h,u,p,f,g,m,y,_,b,S,x,v,B,k,E,P=$e(l.x),N=$e(l.y);switch(l.command){case ne.close:h=ne.close;break;case ne.arc:x=l.rx,v=l.ry,B=l.xAxisRotation,k=l.largeArcFlag,E=l.sweepFlag,h=ne.arc+" "+x+" "+v+" "+B+" "+k+" "+E+" "+P+" "+N;break;case ne.curve:y=d.controls&&d.controls.right||Q.zero,_=l.controls&&l.controls.left||Q.zero,d.relative?(p=$e(y.x+d.x),f=$e(y.y+d.y)):(p=$e(y.x),f=$e(y.y)),l.relative?(g=$e(_.x+l.x),m=$e(_.y+l.y)):(g=$e(_.x),m=$e(_.y)),h=(a===0?ne.move:ne.curve)+" "+p+" "+f+" "+g+" "+m+" "+P+" "+N;break;case ne.move:s=l,h=ne.move+" "+P+" "+N;break;default:h=l.command+" "+P+" "+N}a>=r&&t&&(l.command===ne.curve&&(u=s,b=l.controls&&l.controls.right||l,S=u.controls&&u.controls.left||u,l.relative?(p=$e(b.x+l.x),f=$e(b.y+l.y)):(p=$e(b.x),f=$e(b.y)),u.relative?(g=$e(S.x+u.x),m=$e(S.y+u.y)):(g=$e(S.x),m=$e(S.y)),P=$e(u.x),N=$e(u.y),h+=" C "+p+" "+f+" "+g+" "+m+" "+P+" "+N),l.command!==ne.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+=ne.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=oe.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in oe?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=oe.getRendererType(e._renderer.type);oe[t].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=oe.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=oe.getRendererType(s._renderer.type);oe[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(oe.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(oe.group.removeChild,n),this._flagOrder&&this.children.forEach(oe.group.orderChild,n),this._flagMask)if(this._mask){const r=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,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),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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=oe.toString(this._renderer.vertices,this._closed);t.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,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=oe.getRendererType(this._stroke._renderer.type);oe[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?oe.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=oe.createElement("path",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=oe.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=oe.getRendererType(this._mask._renderer.type);oe[r].render.call(this._mask,e),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const o=this.worldMatrix.elements,a=ki(o[0],o[3],o[1],o[4],o[2],o[5]);r/=Math.max(a.scaleX,a.scaleY)}const s=oe.pointsToString(this._renderer.collection,r);t.d=s}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=oe.getRendererType(this._fill._renderer.type);oe[r].render.call(this._fill,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=oe.getRendererType(this._stroke._renderer.type);oe[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?oe.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=oe.createElement("path",t),e.appendChild(this._renderer.elem)),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),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"]=oe.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t["dominant-baseline"]=oe.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=oe.getRendererType(this._fill._renderer.type);oe[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=oe.getRendererType(this._stroke._renderer.type);oe[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?oe.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=oe.createElement("text",t),e.appendChild(this._renderer.elem)),this._flagClip){const r=oe.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=oe.getRendererType(this._mask._renderer.type);oe[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){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.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?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(e,t){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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?oe.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=oe.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?oe.setAttributes(o._renderer.elem,a):o._renderer.elem=oe.createElement("stop",a),r&&this._renderer.elem.appendChild(o._renderer.elem),o.flagReset()}}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(e,t){G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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 Q?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,s)){switch(n.width=s.width,n.height=s.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof Q?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?oe.setAttributes(this._renderer.image,r):this._renderer.image=oe.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&oe.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=oe.createElement("pattern",n)),this._renderer.elem.parentNode===null&&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),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},jl=class extends q{constructor(e){super(),this.domElement=e.domElement||oe.createElement("svg"),this.scene=new Ge,this.scene.parent=this,this.defs=oe.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(e,t){return this.width=e,this.height=t,oe.setAttributes(this.domElement,{width:e,height:t}),this.trigger(q.Types.resize,e,t)}render(){return oe.group.render.call(this.scene,this.domElement),oe.defs.update(this.domElement),this}};w(jl,"Utils",oe);var jt={create:function(e,t,n){const r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){const o=e.getShaderInfoLog(r);throw e.deleteShader(r),new Nt("unable to compile shader "+r+": "+o)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
41
41
|
precision mediump float;
|
|
42
42
|
attribute vec2 a_position;
|
|
43
43
|
|
|
@@ -100,30 +100,30 @@
|
|
|
100
100
|
}
|
|
101
101
|
gl_FragColor = texel;
|
|
102
102
|
}
|
|
103
|
-
`}},qr=Gn.Multiply,um=[1,0,0,0,1,0,0,0,1],An=new Qt(9),fm=pt.Utils,Wl=new Q,Ys=new Qt([0,0,1,0,0,1,0,1,1,0,1,1]),ye={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:De.document?De.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Gn,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)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;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new Qt(9)),this._matrix.toTransformArray(!0,An),qr(An,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q),this._scale instanceof Q?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const a=pt.Utils.getRendererType(this._mask._renderer.type);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=pt.Utils.getRendererType(a._renderer.type);ye[l].render.call(a,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,s,o,a,l,c,d,h,f,p,u,g,m;const _=t._renderer.vertices,y=this.canvas,b=this.ctx,S=e.renderer.ratio,x=Wl.copy(t._renderer.scale).multiply(S),v=t._stroke,B=t._linewidth,k=t._fill,R=t._renderer.opacity||t._opacity,P=t._cap,N=t._join,W=t._miter,q=t._closed,F=t.dashes,M=_.length,I=M-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 Z=t._renderer.rect.centroid,T=Z.x,$=Z.y;if(b.clearRect(0,0,y.width,y.height),k)if(typeof k=="string")b.fillStyle=k;else{const he=pt.Utils.getRendererType(k._renderer.type);ye[he].render.call(k,b,t),b.fillStyle=k._renderer.effect}if(v){if(typeof v=="string")b.strokeStyle=v;else{const he=pt.Utils.getRendererType(v._renderer.type);ye[he].render.call(v,b,t),b.strokeStyle=v._renderer.effect}B&&(b.lineWidth=B),W&&(b.miterLimit=W),N&&(b.lineJoin=N),!q&&P&&(b.lineCap=P)}typeof R=="number"&&(b.globalAlpha=R),F&&F.length>0&&(b.lineDashOffset=F.offset||0,b.setLineDash(F));let j,z,Y,V,O,J,ge,re;b.save(),b.scale(x.x,x.y),b.translate(T,$),b.beginPath();for(let he=0;he<_.length;he++){const se=_[he];switch(u=se.x,g=se.y,se.command){case te.close:b.closePath();break;case te.arc:z=se.rx,Y=se.ry,V=se.xAxisRotation,O=se.largeArcFlag,J=se.sweepFlag,n=q?At(he-1,M):Math.max(he-1,0),r=_[n],ge=r.x,re=r.y,fm.renderSvgArcCommand(b,ge,re,z,Y,O,J,V,u,g);break;case te.curve:n=q?At(he-1,M):Math.max(he-1,0),r=_[n],d=r.controls&&r.controls.right||Q.zero,h=se.controls&&se.controls.left||Q.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),se._relative?(o=h.x+se.x,a=h.y+se.y):(o=h.x,a=h.y),b.bezierCurveTo(l,c,o,a,u,g),he>=I&&q&&(s=j,f=se.controls&&se.controls.right||Q.zero,p=s.controls&&s.controls.left||Q.zero,se._relative?(l=f.x+se.x,c=f.y+se.y):(l=f.x,c=f.y),s._relative?(o=p.x+s.x,a=p.y+s.y):(o=p.x,a=p.y),u=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,u,g));break;case te.line:b.lineTo(u,g);break;case te.move:j=se,b.moveTo(u,g);break}}q&&b.closePath(),ye.isHidden.test(k)||(m=k._renderer&&k._renderer.offset,m&&(b.save(),b.translate(-k._renderer.offset.x,-k._renderer.offset.y),b.scale(k._renderer.scale.x,k._renderer.scale.y)),b.fill(),m&&b.restore()),ye.isHidden.test(v)||(m=v._renderer&&v._renderer.offset,m&&(b.save(),b.translate(-v._renderer.offset.x,-v._renderer.offset.y),b.scale(v._renderer.scale.x,v._renderer.scale.y),b.lineWidth=B/v._renderer.scale.x),b.stroke(),m&&b.restore()),b.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;e.forEach(function(d){const h=d.x,f=d.y,p=d.controls;let u,g,m,_,y,b;o=Math.min(f,o),r=Math.min(h,r),s=Math.max(h,s),a=Math.max(f,a),d.controls&&(y=p.left,b=p.right,!(!y||!b)&&(u=d._relative?y.x+h:y.x,g=d._relative?y.y+f:y.y,m=d._relative?b.x+h:b.x,_=d._relative?b.y+f:b.y,!(!u||!g||!m||!_)&&(o=Math.min(g,_,o),r=Math.min(u,m,r),s=Math.max(u,m,s),a=Math.max(g,_,a))))}),typeof t=="number"&&(o-=t,r-=t,s+=t,a+=t),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(e,t,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=pt.Utils.getRendererType(this._renderer.type),o=t[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new Qt(9)),this._matrix.toTransformArray(!0,An),qr(An,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let f,p;this._scale instanceof Q?(f=this._scale.x*r._renderer.scale.x,p=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,p=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=p<0?-p:p,c&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const f=pt.Utils.getRendererType(this._mask._renderer.type);ye[f].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,ye.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==o&&(e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,Ys,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),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(e,t){let n;const r=this.canvas,s=this.ctx,o=e.renderer.ratio,a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,f=t._size*o;let p=f;ye.isHidden.test(a)||(p+=l),r.width=Xa(p),r.height=r.width;const u=p/r.width,g=r.width/2,m=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const _=pt.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 _=pt.Utils.getRendererType(a._renderer.type);ye[_].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/u)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,m),s.scale(ye.precision,ye.precision),s.beginPath(),s.arc(0,0,f/u*.5,0,ut),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;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const s=n||this.parent,o=t[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=s._matrix.manual||s._flagMatrix,h=this._matrix.manual||this._flagMatrix,f=this._renderer.parent!==s,p=this._renderer.vertices,u=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||f){this._renderer.matrix||(this._renderer.matrix=new Qt(9)),this._matrix.toTransformArray(!0,An),qr(An,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let _,y;this._scale instanceof Q?(_=this._scale.x*s._renderer.scale.x,y=this._scale.y*s._renderer.scale.y):(_=this._scale*s._renderer.scale.x,y=this._scale*s._renderer.scale.y),this._renderer.scale.x=_<0?-_:_,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=s)}if(g){const _=this._renderer.positionBuffer;_&&e.deleteBuffer(_),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,p,e.STATIC_DRAW)}return m?(this._renderer.opacity=this._opacity*s._renderer.opacity,ye.updateTexture.call(ye,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(ye.isHidden.test(l)||(r+=c),r/=ye.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==o&&(e.useProgram(o),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform1f(o.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,u),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=Wl.copy(t._renderer.scale).multiply(s),a=t._stroke,l=t._linewidth,c=t._fill,d=t._renderer.opacity||t._opacity,h=t.dashes,f=t._decoration,p=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*o.y),1);const u=t._renderer.rect.centroid,g=u.x,m=u.y;let _,y,b,S,x,v,B,k,R,P,N;const W=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),W||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=p,c)if(typeof c=="string")r.fillStyle=c;else{const q=pt.Utils.getRendererType(c._renderer.type);ye[q].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const q=pt.Utils.getRendererType(a._renderer.type);ye[q].render.call(a,r,t),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=l)}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,m),ye.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,B),_=t._size/c._renderer.scale.y,y=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,b,S),r.restore()):r.fillText(t.value,0,0)),ye.isHidden.test(a)||(a._renderer&&a._renderer.offset?(v=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(v,B),_=t._size/a._renderer.scale.y,y=t._leading/a._renderer.scale.y,r.font=[t._style,t._weight,_+"px/",y+"px",t._family].join(" "),b=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(t.value,b,S),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(f)){const q=r.measureText(t.value);switch(f){case"underline":R=q.actualBoundingBoxDescent,N=q.actualBoundingBoxDescent;break;case"strikethrough":R=0,N=0;break}k=-q.width/2,P=q.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,R),r.lineTo(P,N),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=pt.Utils.baselines[e._baseline]||e._baseline;const r=n.measureText(e._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!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;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=t[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new Qt(9)),this._matrix.toTransformArray(!0,An),qr(An,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let h,f;this._scale instanceof Q?(h=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const h=pt.Utils.getRendererType(this._mask._renderer.type);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,Ys,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),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=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 G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=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 G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext("2d"))return;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Q||(this._renderer.offset=new Q),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Q?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let r,s;this._scale instanceof Q?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(e,t){const n=pt.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(),G.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 Rt("unable to link program: "+s);return n}},extensions:{init:function(e){const t={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];t[s]=ye.extensions.get(e,s)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new $r};ye.ctx=ye.canvas.getContext("2d");var jl=class extends 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 Qt(um),scale:1,opacity:1},this._flagMatrix=!0,e=G.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 Rt("unable to create a webgl context. Try using another renderer.");r=Wt.create(t,Wt.path.vertex,Wt.types.vertex),s=Wt.create(t,Wt.path.fragment,Wt.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=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,Ys,t.STATIC_DRAW),r=Wt.create(t,Wt.points.vertex,Wt.types.vertex),s=Wt.create(t,Wt.points.fragment,Wt.types.fragment),n=this.programs.points=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"?Vs(o):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,G.isObject(this.domElement.style)&&G.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(jl,"Utils",ye);var pm=G.extend({Error:Rt,getRatio:Vs,read:ze,xhr:Il},G,kt,La,Da),ir=class{constructor(e){w(this,"_events",new X),w(this,"type",""),w(this,"renderer",null),w(this,"scene",null),w(this,"width",0),w(this,"height",0),w(this,"frameCount",0),w(this,"timeDelta",0),w(this,"playing",!1);const t=G.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:ir.Types.svg,autostart:!1});if(G.each(t,function(n,r){/fullscreen/i.test(r)||/autostart/i.test(r)||(this[r]=n)},this),G.isElement(t.domElement)){const n=t.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+n)||(this.type=ir.Types[n])}this.renderer=new ir[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=gm.bind(this),this.fit.domElement=window,this.fit.attached=!0,G.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),G.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Vt.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=mm.bind(this),G.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,_m.bind(this)),this.scene=this.renderer.scene,ir.Instances.push(this),t.autostart&&rr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,rr.init(),this.trigger(X.Types.play)}pause(){return this.playing=!1,this.trigger(X.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices)for(typeof e.vertices.unbind=="function"&&e.vertices.unbind(),t=0;t<e.vertices.length;t++)n=e.vertices[t],typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind());if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);typeof e.children.unbind=="function"&&e.children.unbind()}return e}update(){const e=!!this._lastFrame,t=G.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(Vt.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 Lr(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,te.move),new ve(n,r,void 0,void 0,void 0,void 0,te.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,te.line),new ve(n,r,void 0,void 0,void 0,void 0,te.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,te.line)],c=new xe(l,!1,!1,!0);return c.noFill(),c.cap="round",c.join="round",this.scene.add(c),c}makeRectangle(e,t,n,r){const s=new Fn(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new tr(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Qi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new er(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Ir(e,t,n,r,s);return this.scene.add(o),o}makeCurve(e){const t=arguments.length;if(!Array.isArray(e)){e=[];for(let o=0;o<t;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];e.push(new ve(a,l))}}const n=arguments[t-1],r=new xe(e,!(typeof n=="boolean"&&n),!0),s=r.getBoundingClientRect();return r.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){const s=new Vr(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Mr(e,t,n,r,s,o,a);return this.scene.add(l),l}makePoints(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let s=0;s<t;s+=2){const o=arguments[s];if(typeof o!="number")break;const a=arguments[s+1];n.push(new Q(o,a))}}const r=new Ar(n);return this.scene.add(r),r}makePath(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let a=0;a<t;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];n.push(new ve(l,c))}}const r=arguments[t-1],s=new xe(n,!(typeof r=="boolean"&&r)),o=s.getBoundingClientRect();return typeof o.top=="number"&&typeof o.left=="number"&&typeof o.right=="number"&&typeof o.bottom=="number"&&s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makeText(e,t,n,r){const s=new Dt(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Ae(e,t,n,r,s);return this.add(o),o}makeRadialGradient(e,t,n){const r=Array.prototype.slice.call(arguments,3),s=new Ve(e,t,n,r);return this.add(s),s}makeSprite(e,t,n,r,s,o,a){const l=new Fr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new Dr(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Te(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new Ke;return this.scene.add(t),t.add(e),t}interpret(e,t,n){const r=e.tagName.toLowerCase();if(n=typeof n<"u"?n:!0,!(r in ze))return null;const s=ze[r].call(this,e);return n?this.add(t&&s instanceof Ke?s.children:s):s.parent&&s.remove(),s}load(e,t){const n=new Ke;let r,s,o;const a=(function(l){for(Vt.temp.innerHTML=l,s=0;s<Vt.temp.children.length;s++)r=Vt.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=Vt.temp.children.length<=1?Vt.temp.children[0]:Vt.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(Il(e,a),n):(a(e),n)}},ue=ir;w(ue,"NextFrameId",xt.NextFrameId),w(ue,"Types",xt.Types),w(ue,"Version",xt.Version),w(ue,"PublishDate",xt.PublishDate),w(ue,"Identifier",xt.Identifier),w(ue,"Resolution",xt.Resolution),w(ue,"AutoCalculateImportedMatrices",xt.AutoCalculateImportedMatrices),w(ue,"Instances",xt.Instances),w(ue,"uniqueId",xt.uniqueId),w(ue,"Anchor",ve),w(ue,"Collection",Nn),w(ue,"Events",X),w(ue,"Group",Ke),w(ue,"Matrix",Gn),w(ue,"Path",xe),w(ue,"Registry",$r),w(ue,"Element",Xn),w(ue,"Shape",mn),w(ue,"Text",Dt),w(ue,"Vector",Q),w(ue,"Gradient",Ye),w(ue,"ImageSequence",Dr),w(ue,"LinearGradient",Ae),w(ue,"RadialGradient",Ve),w(ue,"Sprite",Fr),w(ue,"Stop",en),w(ue,"Texture",Te),w(ue,"ArcSegment",Mr),w(ue,"Circle",Qi),w(ue,"Ellipse",er),w(ue,"Line",Lr),w(ue,"Points",Ar),w(ue,"Polygon",Vr),w(ue,"Rectangle",Fn),w(ue,"RoundedRectangle",tr),w(ue,"Star",Ir),w(ue,"CanvasRenderer",pt),w(ue,"SVGRenderer",Hl),w(ue,"WebGLRenderer",jl),w(ue,"Commands",te),w(ue,"Utils",pm);function gm(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function mm(){const e=this.renderer.domElement.parentElement;if(!e){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function _m(e,t){this.width=e,this.height=t,this.trigger(X.Types.resize,e,t)}var rr=Vt.getRequestAnimationFrame();function Xl(){for(let e=0;e<ue.Instances.length;e++){const t=ue.Instances[e];t.playing&&t.update()}ue.NextFrameId=rr(Xl)}rr.init=function(){Xl(),rr.init=function(){}};let nn;typeof window<"u"?nn=window:typeof global<"u"?nn=global:typeof self<"u"&&(nn=self);let ql;const ni=Math.PI*2,st=Math.PI*.5;function ym(e,t,n,r,s,o){let a;return arguments.length<=1?(a=e.a,t=e.b,n=e.c,r=e.d,s=e.e,o=e.f):a=e,{translateX:s,translateY:o,scaleX:Math.sqrt(a*a+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,a)/Math.PI}}function bm(e){ql=e}function wm(e,t){t=t&&t.identity()||new ql;let n=e;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let s=0;s<r.length;s++){const a=r[s].elements;t.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8],a[9])}return t}function rn(e,t,n){return n*(t-e)+e}function $i(e,t){for(;e<0;)e+=t;return e%t}const Yl=nn.Float32Array||Array,vm=Math.floor;function sn(e){return vm(e*1e6)/1e6}const pe={move:"M",line:"L",curve:"C",close:"Z"};class K{constructor(){C(this,"_events",{});C(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}}C(K,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),C(K,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Ul={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(K.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(K.Types.change))}}},lt=class lt extends K{constructor(n=0,r=0){super();C(this,"_x",0);C(this,"_y",0);for(let s in Ul)Object.defineProperty(this,s,Ul[s]);this.x=n,this.y=r}static add(n,r){return new lt(n.x+r.x,n.y+r.y)}static sub(n,r){return new lt(n.x-r.x,n.y-r.y)}static subtract(n,r){return lt.sub(n,r)}static ratioBetween(n,r){return(n.x*r.x+n.y*r.y)/(n.length()*r.length())}static angleBetween(n,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const s=n.x-r.x,o=n.y-r.y;return Math.atan2(o,s)}static distanceBetween(n,r){return Math.sqrt(lt.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const s=n.x-r.x,o=n.y-r.y;return s*s+o*o}set(n,r){return this.x=n,this.y=r,this}copy(n){return this.x=n.x,this.y=n.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new lt(this.x,this.y)}add(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x+=n,this.y+=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x+=n.x,this.y+=n.y):(this.x+=n,this.y+=r),this)}addSelf(n){return this.add.apply(this,arguments)}sub(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x-=n,this.y-=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x-=n.x,this.y-=n.y):(this.x-=n,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(n){return this.sub.apply(this,arguments)}subtractSelf(n){return this.sub.apply(this,arguments)}multiply(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x*=n,this.y*=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x*=n.x,this.y*=n.y):(this.x*=n,this.y*=r),this)}multiplySelf(n){return this.multiply.apply(this,arguments)}multiplyScalar(n){return this.multiply(n)}divide(n,r){return arguments.length<=0?this:(arguments.length<=1?typeof n=="number"?(this.x/=n,this.y/=n):n&&typeof n.x=="number"&&typeof n.y=="number"&&(this.x/=n.x,this.y/=n.y):(this.x/=n,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(n){return this.divide.apply(this,arguments)}divideScalar(n){return this.divide(n)}negate(){return this.multiply(-1)}dot(n){return this.x*n.x+this.y*n.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(n){return Math.sqrt(this.distanceToSquared(n))}distanceToSquared(n){const r=this.x-n.x,s=this.y-n.y;return r*r+s*s}setLength(n){return this.normalize().multiplyScalar(n)}equals(n,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(n)<r}lerp(n,r){const s=(n.x-this.x)*r+this.x,o=(n.y-this.y)*r+this.y;return this.set(s,o)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:sn(this.x),y:sn(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};C(lt,"zero",new lt),C(lt,"left",new lt(-1,0)),C(lt,"right",new lt(1,0)),C(lt,"up",new lt(0,-1)),C(lt,"down",new lt(0,1));let we=lt;class Ee extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=pe.move){super(n,r);C(this,"controls",{left:new we,right:new we});C(this,"_command",pe.move);C(this,"_relative",!0);C(this,"_rx",0);C(this,"_ry",0);C(this,"_xAxisRotation",0);C(this,"_largeArcFlag",0);C(this,"_sweepFlag",1);for(let h in Gl)Object.defineProperty(this,h,Gl[h]);this.command=c,this.relative=!0;const d=Ee.makeBroadcast(this);this.controls.left.set(s,o).addEventListener(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 Ee().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Ee().copy(this)}toObject(){return{x:sn(this.x),y:sn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:sn(this.rx),ry:sn(this.ry),xAxisRotation:sn(this.xAxisRotation),largeArcFlag:sn(this.largeArcFlag),sweepFlag:sn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Gl={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(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 km=0;const Us={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return km++}},Yr={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 Ur(e,t,n,r,s){const o=1-e;return o*o*o*t+3*o*o*e*n+3*o*e*e*r+e*e*e*s}function Kl(e,t,n,r,s,o,a,l,c){c=c||Yr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new Ee(a,l)];const h=[];for(let f=0;f<d;f++){const p=f/d,u=Ur(p,e,n,s,a),g=Ur(p,t,r,o,l);h.push(new Ee(u,g))}return h}function xm(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const _=a-e,y=l-t;return Math.sqrt(_*_+y*y)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,f=3*(n-e),p=9*(r-o)+3*(l-t),u=6*(t+o)-12*r,g=3*(r-t);function m(_){const y=(d*_+h)*_+f,b=(p*_+u)*_+g;return Math.sqrt(y*y+b*b)}return Sm(m,0,1,c||Yr.RecursionLimit)}function Cm(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,f,p,u,g,m,_,y;for(let v=0;v<2;++v){if(v==0?(f=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(f=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(f)<1e-12)continue;u=-p/f,0<u&&u<1&&c.push(u);continue}_=f*f-4*p*h,y=Math.sqrt(_),!(_<0)&&(g=(-f+y)/(2*h),0<g&&g<1&&c.push(g),m=(-f-y)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)u=c[b],x=1-u,d[0][b]=x*x*x*e+3*x*x*u*n+3*x*u*u*s+u*u*u*a,d[1][b]=x*x*x*t+3*x*x*u*r+3*x*u*u*o+u*u*u*l;return d[0][S]=e,d[1][S]=t,d[0][S+1]=a,d[1][S+1]=l,d[0].length=d[1].length=S+2,{min:{x:Math.min.apply(0,d[0]),y:Math.min.apply(0,d[1])},max:{x:Math.max.apply(0,d[0]),y:Math.max.apply(0,d[1])}}}function Sm(e,t,n,r){let s=Yr.abscissas[r-2],o=Yr.weights[r-2],a=.5*(n-t),l=a+t,c=0,d=r+1>>1,h=r&1?o[c++]*e(l):0;for(;c<d;){const f=a*s[c];h+=o[c++]*(e(l+f)+e(l-f))}return a*h}function Bm(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?$i(s-1,n):Math.max(s-1,0),l=t?$i(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Tm(c,d,h),d.command=s===0?pe.move:pe.curve}}function Tm(e,t,n){const r=we.angleBetween(e,t),s=we.angleBetween(n,t);let o=we.distanceBetween(e,t),a=we.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=st:l-=st,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}let sr=(yi=class extends K{constructor(){super();C(this,"_flagId",!1);C(this,"_flagClassName",!1);C(this,"_renderer",{});C(this,"_id",Us.Identifier+Us.uniqueId());C(this,"_className","");C(this,"classList",[]);for(let n in Zl)Object.defineProperty(this,n,Zl[n])}static fromObject(n){const r=new yi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return this.renderer.type=n.renderer.type,this.className=n.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},C(yi,"Properties",["renderer","id","className"]),yi);const Zl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){const t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}};class Gr extends Error{constructor(n){super();C(this,"name","Two.js");C(this,"message");this.message=n}}class Em{constructor(){C(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}}let Kr;const Jl={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};nn.document&&(Kr=document.createElement("a"));const He=class He extends sr{constructor(n,r){super();C(this,"_flagSrc",!1);C(this,"_flagImage",!1);C(this,"_flagVideo",!1);C(this,"_flagLoaded",!1);C(this,"_flagRepeat",!1);C(this,"_flagOffset",!1);C(this,"_flagScale",!1);C(this,"_src","");C(this,"_image",null);C(this,"_loaded",!1);C(this,"_repeat","no-repeat");C(this,"_scale",1);C(this,"_offset",null);for(let s in Ql)Object.defineProperty(this,s,Ql[s]);if(this._renderer.type="texture",this._renderer.flagOffset=$m.bind(this),this._renderer.flagScale=Rm.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 He().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Kr?(Kr.href=n,Kr.href):n}static loadHeadlessBuffer(n,r){n.image.onload=r,n.image.src=n.src}static getTag(n){return n&&n.nodeName&&n.nodeName.toLowerCase()||"img"}static getImage(n){const r=He.getAbsoluteURL(n);if(He.ImageRegistry.contains(r))return He.ImageRegistry.get(r);let s;return nn.document?Jl.video.test(r)?s=document.createElement("video"):s=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),s.crossOrigin="anonymous",s.referrerPolicy="no-referrer",s}static load(n,r){let s=n.image,o=He.getTag(s);n._flagImage&&(/canvas/i.test(o)?He.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,He.Register[o](n,r))),n._flagSrc&&(s||(s=He.getImage(n.src),n.image=s),o=He.getTag(s),He.Register[o](n,r))}clone(){const n=new He(this.src);return n.repeat=this.repeat,n.offset.copy(this.offset),n.scale=this.scale,n}copy(n){return this.src=n.src,this.repeat=n.repeat,this.offset=typeof n.offset=="number"||n.offset instanceof we?n.offset:new we().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we().copy(n.scale),this}toObject(){const n=super.toObject.call(this);return n.renderer.type="texture",n.src=this.src,n.repeat=this.repeat,n.offset=this.offset.toObject(),n.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),n}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(K.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,He.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}};C(He,"Properties",["src","loaded","repeat","scale","offset","image"]),C(He,"RegularExpressions",Jl),C(He,"ImageRegistry",new Em),C(He,"Register",{canvas:function(n,r){n._src="#"+n.id,He.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const s=n.image,o=function(l){s.removeEventListener&&typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof s.removeEventListener=="function"&&(s.removeEventListener("load",o,!1),s.removeEventListener("error",a,!1)),new Gr("unable to load "+n.src)};typeof s.width=="number"&&s.width>0&&typeof s.height=="number"&&s.height>0?o():typeof s.addEventListener=="function"&&(s.addEventListener("load",o,!1),s.addEventListener("error",a,!1)),n._src=He.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),He.ImageRegistry.add(n.src,s),n.image.src=n.src)},video:function(n,r){const s=function(a){n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},o=function(a){throw n.image.removeEventListener("canplaythrough",s,!1),n.image.removeEventListener("error",o,!1),new Gr("unable to load "+n.src)};n._src=He.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),He.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let ot=He;const Ql={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=ot.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}ot.ImageRegistry.contains(n)?this._image=ot.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(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 $m(){this._flagOffset=!0}function Rm(){this._flagScale=!0}class Ri extends Array{constructor(){super();pa(this,ct,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 Et(this,ct)}set _events(n){Hh(this,ct,n)}get _bound(){return Et(this,ct)._bound}set _bound(n){Et(this,ct)._bound=n}addEventListener(){return Et(this,ct).addEventListener.apply(this,arguments)}on(){return Et(this,ct).on.apply(this,arguments)}bind(){return Et(this,ct).bind.apply(this,arguments)}removeEventListener(){return Et(this,ct).removeEventListener.apply(this,arguments)}off(){return Et(this,ct).off.apply(this,arguments)}unbind(){return Et(this,ct).unbind.apply(this,arguments)}dispatchEvent(){return Et(this,ct).dispatchEvent.apply(this,arguments)}trigger(){return Et(this,ct).trigger.apply(this,arguments)}listen(){return Et(this,ct).listen.apply(this,arguments)}ignore(){return Et(this,ct).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(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}}ct=new WeakMap;const ec=Array.prototype.slice;function Nm(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}const Me={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},isFunction:function(e){return typeof e=="function"},extend:function(e){const t=ec.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]=r[s]}return e},defaults:function(e){const t=ec.call(arguments,1);for(let n=0;n<t.length;n++){const r=t[n];for(let s in r)e[s]===void 0&&(e[s]=r[s])}return e},each:function(e,t,n){const r=n||this,s=!Nm(e)&&Object.keys(e),o=(s||e).length;for(let a=0;a<o;a++){const l=s?s[a]:a;t.call(r,e[l],l,e)}return e},performance:nn.performance&&nn.performance.now?nn.performance:Date},Pt=class Pt extends sr{constructor(n,r,s){super();C(this,"_flagOffset",!0);C(this,"_flagOpacity",!0);C(this,"_flagColor",!0);C(this,"_offset",0);C(this,"_opacity",1);C(this,"_color","#fff");for(let o in tc)Object.defineProperty(this,o,tc[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Pt.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Pt.Index<=0?"#fff":"#000",Pt.Index=(Pt.Index+1)%2}static fromObject(n){const r=new Pt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Pt.Properties.length;r++){const s=Pt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Pt;return Me.each(Pt.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Me.each(Pt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};C(Pt,"Index",0),C(Pt,"Properties",["offset","opacity","color"]);let ii=Pt;const tc={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},cn=class cn extends sr{constructor(n){super();C(this,"_flagStops",!1);C(this,"_flagSpread",!1);C(this,"_flagUnits",!1);C(this,"_spread","");C(this,"_units","");for(let r in nc)Object.defineProperty(this,r,nc[r]);this._renderer.type="gradient",this._renderer.flagStops=Pm.bind(this),this._renderer.bindStops=Fm.bind(this),this._renderer.unbindStops=Mm.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof ii?o:new ii().copy(o)));const s=new cn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new cn(r);return Me.each(cn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<cn.Properties.length;r++){const s=cn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Me.each(cn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(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}};C(cn,"Stop",ii),C(cn,"Properties",["spread","stops","units"]);let nt=cn;const nc={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){const t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(K.Types.insert,t).unbind(K.Types.remove,n),this._stops=new Ri((e||[]).slice(0)),this._stops.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._stops)}}};function Pm(){this._flagStops=!0}function Fm(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Mm(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const Dn=class Dn extends nt{constructor(n,r,s,o,a){super(a);C(this,"_flagEndPoints",!1);C(this,"_left",null);C(this,"_right",null);for(let l in ic)Object.defineProperty(this,l,ic[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Am.bind(this),this.left=new we,this.right=new we,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new Dn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Dn.Properties.length;r++){const s=Dn.Properties[r];s in n&&(this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new Dn(this.left._x,this.left._y,this.right._x,this.right._y,r);return Me.each(nt.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(K.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};C(Dn,"Stop",ii),C(Dn,"Properties",["left","right"]);let Ct=Dn;const ic={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof we&&this._left.unbind(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 Am(){this._flagEndPoints=!0}const dn=class dn extends nt{constructor(n,r,s,o,a,l){super(o);C(this,"_flagRadius",!1);C(this,"_flagCenter",!1);C(this,"_flagFocal",!1);C(this,"_radius",0);C(this,"_center",null);C(this,"_focal",null);for(let c in rc)Object.defineProperty(this,c,rc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Vm.bind(this),this._renderer.flagFocal=Im.bind(this),this.center=new we,this.radius=typeof s=="number"?s:1,this.focal=new we,typeof n=="number"&&(this.center.x=n),typeof r=="number"&&(this.center.y=r),this.focal.copy(this.center),typeof a=="number"&&(this.focal.x=a),typeof l=="number"&&(this.focal.y=l)}static fromObject(n){const r=new dn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<dn.Properties.length;r++){const s=dn.Properties[r];s in n&&(/(center|focal)i/.test(s)?this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]):typeof n[s]=="number"&&(this[s]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new dn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Me.each(nt.Properties.concat(dn.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Me.each(dn.Properties,function(r){n[r]=this[r]},this),n.center=this.center.toObject(),n.focal=this.focal.toObject(),n}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(K.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};C(dn,"Stop",ii),C(dn,"Properties",["center","radius","focal"]);let St=dn;const rc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(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 Vm(){this._flagCenter=!0}function Im(){this._flagFocal=!0}function sc(e,t){if(t===0||t===1)return!0;const r=e._length*t;let s=0;for(let o=0;o<e._lengths.length;o++){const a=e._lengths[o];if(s>=r)return r-s>=0;s+=a}return!1}function Zr(e,t){const n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let r=0,s=0;r<e._lengths.length;r++){if(s+e._lengths[r]>=t)return t-=s,Math.max(r-1,0)+t/e._lengths[r];s+=e._lengths[r]}return-1}function oc(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),xm(r,l,s,c,o,d,a,h,n)}function ac(e,t,n){let r,s,o,a,l,c,d,h;const f=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(f||t).x,c=(f||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,f&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Kl(r,l,s,c,o,d,a,h,n)}function ri(e){switch(e.renderer.type){case"texture":return ot.fromObject(e);case"gradient":return nt.fromObject(e);case"linear-gradient":return Ct.fromObject(e);case"radial-gradient":return St.fromObject(e)}return e}const Om=Math.cos,zm=Math.sin,lc=Math.tan,Gs=[],Tt=class Tt extends K{constructor(n,r,s,o,a,l){super();C(this,"elements",new Yl(9));C(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const k=n;let R,P,N;const W=r[0]||0,q=r[1]||0,F=r[2]||0;return R=k[0]*W+k[1]*q+k[2]*F,P=k[3]*W+k[4]*q+k[5]*F,N=k[6]*W+k[7]*q+k[8]*F,[R,P,N]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],f=n[6],p=n[7],u=n[8],g=r[0],m=r[1],_=r[2],y=r[3],b=r[4],S=r[5],x=r[6],v=r[7],B=r[8];return s=s||new Yl(9),s[0]=o*g+a*y+l*x,s[1]=o*m+a*b+l*v,s[2]=o*_+a*S+l*B,s[3]=c*g+d*y+h*x,s[4]=c*m+d*b+h*v,s[5]=c*_+d*S+h*B,s[6]=f*g+p*y+u*x,s[7]=f*m+p*b+u*v,s[8]=f*_+p*S+u*B,s}static fromObject(n){return new Tt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const f=n;n=f[0],r=f[1],s=f[2],o=f[3],a=f[4],l=f[5],c=f[6],d=f[7],h=f[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=s,this.elements[3]=o,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=h,this.trigger(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]=Tt.Identity[0],this.elements[1]=Tt.Identity[1],this.elements[2]=Tt.Identity[2],this.elements[3]=Tt.Identity[3],this.elements[4]=Tt.Identity[4],this.elements[5]=Tt.Identity[5],this.elements[6]=Tt.Identity[6],this.elements[7]=Tt.Identity[7],this.elements[8]=Tt.Identity[8],this.trigger(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 I=a[0]*n+a[1]*r+a[2]*s,Z=a[3]*n+a[4]*r+a[5]*s,T=a[6]*n+a[7]*r+a[8]*s;return[I,Z,T]}const f=this.elements,p=[n,r,s,o,a,l,c,d,h],u=f[0],g=f[1],m=f[2],_=f[3],y=f[4],b=f[5],S=f[6],x=f[7],v=f[8],B=p[0],k=p[1],R=p[2],P=p[3],N=p[4],W=p[5],q=p[6],F=p[7],M=p[8];return this.elements[0]=u*B+g*P+m*q,this.elements[1]=u*k+g*N+m*F,this.elements[2]=u*R+g*W+m*M,this.elements[3]=_*B+y*P+b*q,this.elements[4]=_*k+y*N+b*F,this.elements[5]=_*R+y*W+b*M,this.elements[6]=S*B+x*P+v*q,this.elements[7]=S*k+x*N+v*F,this.elements[8]=S*R+x*W+v*M,this.trigger(K.Types.change)}inverse(n){const r=this.elements;n=n||new Tt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],f=r[7],p=r[8],u=p*c-d*f,g=-p*l+d*h,m=f*l-c*h;let _=s*u+o*g+a*m;return _?(_=1/_,n.elements[0]=u*_,n.elements[1]=(-p*o+a*f)*_,n.elements[2]=(d*o-a*c)*_,n.elements[3]=g*_,n.elements[4]=(p*s-a*h)*_,n.elements[5]=(-d*s+a*l)*_,n.elements[6]=m*_,n.elements[7]=(-f*s+o*h)*_,n.elements[8]=(c*s-o*l)*_,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=Om(n),s=zm(n);return this.multiply(r,-s,0,s,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=lc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=lc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Gs.length=0,this.toTransformArray(n,Gs),Gs.map(sn).join(" ")}toTransformArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const p=s[6],u=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=p,r[3]=l,r[4]=h,r[5]=u,r[6]=c,r[7]=f,r[8]=g;return}return[a,d,p,l,h,u,c,f,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=f;return}return[a,d,l,h,c,f]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],f=s[5];if(n){const p=s[6],u=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f,r[6]=p,r[7]=u,r[8]=g;return}return[a,l,c,d,h,f,p,u,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=f;return}return[a,l,c,d,h,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Tt().copy(this)}};C(Tt,"Identity",[1,0,0,0,1,0,0,0,1]);let or=Tt;bm(or);const vr=class vr extends sr{constructor(){super();C(this,"_flagMatrix",!0);C(this,"_flagScale",!1);C(this,"_matrix",null);C(this,"_worldMatrix",null);C(this,"_position",null);C(this,"_rotation",0);C(this,"_scale",1);C(this,"_skewX",0);C(this,"_skewY",0);for(let n in Jr)Object.defineProperty(this,n,Jr[n]);this._renderer.flagMatrix=cc.bind(this),this.isShape=!0,this.matrix=new or,this.worldMatrix=new or,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new vr().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return Jr.position.get.apply(this,arguments)}set translation(n){Jr.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof we?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new vr;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof we?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof we?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};C(vr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let _n=vr;const Jr={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(K.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(K.Types.change,this._renderer.flagMatrix),cc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(K.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof we&&this._scale.bind(K.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return wm(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function cc(){this._flagMatrix=!0}const Ni=Math.min,Pi=Math.max,Lm=Math.ceil,Dm=Math.floor,Hm=new we,Kt=class Kt extends _n{constructor(n,r,s,o){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagCap",!0);C(this,"_flagJoin",!0);C(this,"_flagMiter",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);for(let a in dc)Object.defineProperty(this,a,dc[a]);this._renderer.type="path",this._renderer.flagVertices=hc.bind(this),this._renderer.bindVertices=uc.bind(this),this._renderer.unbindVertices=fc.bind(this),this._renderer.flagFill=pc.bind(this),this._renderer.flagStroke=gc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new Kt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n),this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Ee?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Ee().copy(s))}for(let r=0;r<Kt.Properties.length;r++){const s=Kt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Kt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Kt.Properties.length;s++){const o=Kt.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Me.each(Kt.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,s=n.height/2,o=n.left+n.width/2,a=n.top+n.height/2;for(let l=0;l<this.vertices.length;l++){const c=this.vertices[l];c.x-=o,c.y-=a,c.x+=r,c.y+=s}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=s),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const a=this.vertices[o];a.x-=r,a.y-=s}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getBoundingClientRect(n){let r,s,o,a,l,c,d=1/0,h=-1/0,f=1/0,p=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:u,scaleY:g}=ym(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof u=="number"&&typeof g=="number"&&(s=Math.max(u,g)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[u,g]=r.multiply(l.x,l.y),[m,_]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,b=l.controls.right.y;l.relative&&(y+=l.x,b+=l.y);let[S,x]=r.multiply(y,b),v=c.controls.left.x,B=c.controls.left.y;c.relative&&(v+=c.x,B+=c.y);let[k,R]=r.multiply(v,B);const P=Cm(u,g,S,x,k,R,m,_);f=Ni(P.min.y-s,f),d=Ni(P.min.x-s,d),h=Pi(P.max.x+s,h),p=Pi(P.max.y+s,p)}else a<=1&&(f=Ni(g-s,f),d=Ni(u-s,d),h=Pi(u+s,h),p=Pi(g+s,p)),f=Ni(_-s,f),d=Ni(m-s,d),h=Pi(m+s,h),p=Pi(_+s,p)}return{top:f,left:d,right:h,bottom:p,width:h-d,height:p-f}}getPointAt(n,r){let s,o,a,l,c,d,h,f,p,u,g,m,_,y,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,v=x-1;let B=null,k=null;for(let $=0,j=this._lengths.length,z=0;$<j;$++){if(z+this._lengths[$]>=S){this._closed?(s=$i($,x),o=$i($-1,x),$===0&&(s=o,o=$)):(s=$,o=Math.min(Math.max($-1,0),v)),B=this.vertices[s],k=this.vertices[o],S-=z,this._lengths[$]!==0?n=S/this._lengths[$]:n=0;break}z+=this._lengths[$]}if(B===null||k===null)return null;if(B){if(!k)return B}else return k;b=k.controls&&k.controls.right,y=B.controls&&B.controls.left,c=k.x,u=k.y,d=(b||k).x,g=(b||k).y,h=(y||B).x,m=(y||B).y,f=B.x,_=B.y,b&&k.relative&&(d+=k.x,g+=k.y),y&&B.relative&&(h+=B.x,m+=B.y),l=Ur(n,c,d,h,f),p=Ur(n,u,g,m,_);const R=rn(c,d,n),P=rn(u,g,n),N=rn(d,h,n),W=rn(g,m,n),q=rn(h,f,n),F=rn(m,_,n),M=rn(R,N,n),I=rn(P,W,n),Z=rn(N,q,n),T=rn(W,F,n);return Me.isObject(r)?(r.x=l,r.y=p,r instanceof Ee&&(r.controls.left.x=M,r.controls.left.y=I,r.controls.right.x=Z,r.controls.right.y=T,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=p,r.controls.right.x-=l,r.controls.right.y-=p)),r.t=n,r):(a=new Ee(l,p,M-l,I-p,Z-l,T-p,this._curved?pe.curve:pe.line),a.t=n,a)}plot(){if(this.curved)return Bm(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?pe.move:pe.line;return this}subdivide(n){this._update();const r=this.vertices.length-1,s=this._closed||this.vertices[r]._command===pe.close;let o=this.vertices[r],a=[],l;return Me.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===pe.move){a.push(new Ee(o.x,o.y)),d>0&&(a[a.length-1].command=pe.line),o=c;return}l=ac(c,o,n),a=a.concat(l),Me.each(l,function(h,f){f<=0&&o.command===pe.move?h.command=pe.move:h.command=pe.line}),d>=r&&(this._closed&&this._automatic&&(o=c,l=ac(c,o,n),a=a.concat(l),Me.each(l,function(h,f){f<=0&&o.command===pe.move?h.command=pe.move:h.command=pe.line})),a.push(new Ee(c.x,c.y)),a[a.length-1].command=s?pe.close:pe.line),o=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const o=this.vertices.length-1;let a=this.vertices[o],l=0;return typeof this._lengths>"u"&&(this._lengths=[]),Me.each(this.vertices,function(c,d){if(d<=0||c.command===pe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=oc(c,a,n),l+=this._lengths[d],a=c},this),this._length=l,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const n=this._collection.length,r=this._closed,s=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),a=Zr(this,s*this._length),l=Zr(this,o*this._length),c=Lm(a),d=Dm(l);let h,f,p,u,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new Ee),m>d&&!f?(g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(o,g),g.command=this._renderer.collection[m].command,this._renderer.vertices.push(g),f=g,p=this._collection[m-1],p&&p.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),p.relative?this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(p,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&sc(this,o)?(f=g,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):m===c&&sc(this,s)&&(h=g,h.command=pe.move,!r&&h.controls&&(h.relative?h.controls.left.clear():h.controls.left.copy(h))));c>0&&!h&&(m=c-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(s,g),g.command=pe.move,this._renderer.vertices.unshift(g),u=this._collection[m+1],u&&u.controls&&(g.controls.left.clear(),u.relative?this._renderer.collection[m+1].controls.left.copy(u.controls.left).lerp(we.zero,g.t):(Hm.copy(u),this._renderer.collection[m+1].controls.left.copy(u.controls.left).lerp(u,g.t))))}return _n.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,_n.prototype.flagReset.call(this),this}};C(Kt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),C(Kt,"Utils",{getCurveLength:oc});let $e=Kt;const dc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.bind(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";Me.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof Ri?this._collection=e:this._collection=new Ri(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,Me.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function hc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function uc(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fc(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function pc(){this._flagFill=!0}function gc(){this._flagStroke=!0}const Wm=Math.ceil,jm=Math.floor,hn=class hn extends _n{constructor(n){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagSize",!0);C(this,"_flagSizeAttenuation",!0);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_size",1);C(this,"_sizeAttenuation",!1);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_dashes",null);C(this,"noFill",$e.prototype.noFill);C(this,"noStroke",$e.prototype.noStroke);C(this,"corner",$e.prototype.corner);C(this,"center",$e.prototype.center);C(this,"getBoundingClientRect",$e.prototype.getBoundingClientRect);C(this,"_updateLength",$e.prototype._updateLength);for(let r in mc)Object.defineProperty(this,r,mc[r]);this._renderer.type="points",this._renderer.flagVertices=hc.bind(this),this._renderer.bindVertices=uc.bind(this),this._renderer.unbindVertices=fc.bind(this),this._renderer.flagFill=pc.bind(this),this._renderer.flagStroke=gc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new hn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Ee?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Ee().copy(s))}for(let r=0;r<hn.Properties.length;r++){const s=hn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new hn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<hn.Properties.length;s++){const o=hn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Me.each(hn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}subdivide(n){this._update();let r=[];for(let s=0;s<this.vertices.length;s++){const o=this.vertices[s],a=this.vertices[s-1];if(!a)continue;const l=o.x,c=o.y,d=a.x,h=a.y,f=Kl(l,c,l,c,d,h,d,h,n);r=r.concat(f)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),s=Zr(this,n*this._length),o=Zr(this,r*this._length),a=Wm(s),l=jm(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};C(hn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Qr=hn;const mc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.bind(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 Ri?this._collection=e:this._collection=new Ri(e||[]),this._collection.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};class _c extends Ri{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);pa(this,Ss,{});this.attach(n),this.on(K.Types.insert,this.attach),this.on(K.Types.remove,this.detach)}get ids(){return Et(this,Ss)}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}}Ss=new WeakMap;const kn=class kn extends $e{constructor(n,r,s,o,a,l,c){const d=c||Us.Resolution*3,h=[];for(let f=0;f<d;f++)h.push(new Ee);super(h,!0,!1,!0);C(this,"_flagStartAngle",!1);C(this,"_flagEndAngle",!1);C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_startAngle",0);C(this,"_endAngle",ni);C(this,"_innerRadius",0);C(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in yc)Object.defineProperty(this,f,yc[f]);typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new kn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=$i(n,ni)===$i(r,ni),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,f=0,p,u,g,m,_,y,b,S,x;for(a?d--:l||(d-=2),p=0,u=d-1;p<d;p++){switch(g=p/u,m=c[f],_=g*(r-n)+n,y=(r-n)/d,b=o*Math.cos(_),S=o*Math.sin(_),p){case 0:h=pe.move;break;default:h=pe.curve}m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===pe.curve&&(x=o*y/Math.PI,m.controls.left.x=x*Math.cos(_-st),m.controls.left.y=x*Math.sin(_-st),m.controls.right.x=x*Math.cos(_+st),m.controls.right.y=x*Math.sin(_+st),p===1&&m.controls.left.multiplyScalar(2),p===u&&m.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=pe.close,f++):(d--,u=d-1),p=0;p<d;p++)g=p/u,m=c[f],_=(1-g)*(r-n)+n,y=(r-n)/d,b=s*Math.cos(_),S=s*Math.sin(_),h=pe.curve,p<=0&&(h=a?pe.move:pe.line),m.command=h,m.x=b,m.y=S,m.controls.left.clear(),m.controls.right.clear(),m.command===pe.curve&&(x=s*y/Math.PI,m.controls.left.x=x*Math.cos(_+st),m.controls.left.y=x*Math.sin(_+st),m.controls.right.x=x*Math.cos(_-st),m.controls.right.y=x*Math.sin(_-st),p===1&&m.controls.left.multiplyScalar(2),p===u&&m.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=pe.line}else a||(c[f].command=pe.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=pe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new kn(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<$e.Properties.length;d++){const h=$e.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];n[s]=this[s]}return n}};C(kn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ks=kn;const yc={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},Zs=Math.cos,Js=Math.sin,xn=class xn extends $e{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Ee(0,0,0,0,0,0));super(l,!0,!0,!0);C(this,"_flagRadius",!1);C(this,"_radius",0);this._renderer.type="circle";for(let c in bc)Object.defineProperty(this,c,bc[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new xn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*ni,d=s*Zs(c),h=s*Js(c),f=o*Zs(c-st),p=o*Js(c-st),u=o*Zs(c+st),g=o*Js(c+st),m=this.vertices[a];m.command=a===0?pe.move:pe.curve,m.set(d,h),m.controls.left.set(f,p),m.controls.right.set(u,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new xn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<$e.Properties.length;s++){const o=$e.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];n[s]=this[s]}return n}};C(xn,"Properties",["radius"]);let Qs=xn;const bc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},eo=Math.cos,to=Math.sin,Cn=class Cn extends $e{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Ee);super(c,!0,!0,!0);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_width",0);C(this,"_height",0);this._renderer.type="ellipse";for(let d in wc)Object.defineProperty(this,d,wc[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Cn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*ni,d=s*eo(c),h=o*to(c),f=s*r*eo(c-st),p=o*r*to(c-st),u=s*r*eo(c+st),g=o*r*to(c+st),m=this.vertices[a];m.command=a===0?pe.move:pe.curve,m.set(d,h),m.controls.left.set(f,p),m.controls.right.set(u,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new Cn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<$e.Properties.length;l++){const c=$e.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];n[s]=this[s]}return n}};C(Cn,"Properties",["width","height"]);let no=Cn;const wc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Xm=Math.cos,qm=Math.sin,Sn=class Sn extends $e{constructor(n,r,s,o){o=Math.max(o||0,3);super();C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagSides",!1);C(this,"_radius",0);C(this,"_width",0);C(this,"_height",0);C(this,"_sides",0);this._renderer.type="polygon";for(let a in vc)Object.defineProperty(this,a,vc[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Sn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ni*a+Math.PI/2,c=this._width*Xm(l)/2,d=this._height*qm(l)/2;o>=s?this.vertices.push(new Ee(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?pe.move:pe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=new Sn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<$e.Properties.length;s++){const o=$e.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];n[s]=this[s]}return n}};C(Sn,"Properties",["width","height","sides"]);let io=Sn;const vc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},bi=class bi extends $e{constructor(n,r,s,o){const a=[new Ee,new Ee,new Ee,new Ee];super(a,!0,!1,!0);C(this,"_flagWidth",0);C(this,"_flagHeight",0);C(this,"_width",0);C(this,"_height",0);C(this,"_origin",null);this._renderer.type="rectangle";for(let l in kc)Object.defineProperty(this,l,kc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new we,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new bi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bi.Properties.length;r++){const s=bi.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Ee),this.vertices[0].set(-n,-r).sub(this._origin).command=pe.move,this.vertices[1].set(n,-r).sub(this._origin).command=pe.line,this.vertices[2].set(n,r).sub(this._origin).command=pe.line,this.vertices[3].set(-n,r).sub(this._origin).command=pe.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=pe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new bi(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<$e.Properties.length;s++){const o=$e.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};C(bi,"Properties",["width","height"]);let ro=bi;const kc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(K.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(K.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Bn=class Bn extends $e{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Ee(0,0,0,0,0,0,c===0?pe.move:pe.curve));super(l);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagRadius",!1);C(this,"_width",0);C(this,"_height",0);C(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in xc)Object.defineProperty(this,c,xc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Ym.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),typeof a=="number"&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bn.Properties.length;r++){const s=Bn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof we?o:new we().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof we?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new Bn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<$e.Properties.length;l++){const c=$e.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<Bn.Properties.length;r++){const s=Bn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};C(Bn,"Properties",["width","height","radius"]);let so=Bn;const xc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof we&&this._radius.unbind(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 Ym(){this._flagRadius=!0}const Um=Math.cos,Gm=Math.sin,Tn=class Tn extends $e{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_flagSides",!1);C(this,"_innerRadius",0);C(this,"_outerRadius",0);C(this,"_sides",0);this._renderer.type="star";for(let l in Cc)Object.defineProperty(this,l,Cc[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Tn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Tn.Properties.length;r++){const s=Tn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ni*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*Um(l),h=c*Gm(l);o>=s?this.vertices.push(new Ee(d,h)):this.vertices[o].set(d,h),this.vertices[o].command=o===0?pe.move:pe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(n){const r=this.innerRadius,s=this.outerRadius,o=this.sides,a=new Tn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<$e.Properties.length;l++){const c=$e.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<Tn.Properties.length;r++){const s=Tn.Properties[r];n[s]=this[s]}return n}};C(Tn,"Properties",["innerRadius","outerRadius","sides"]);let oo=Tn;const Cc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}};let ao;const Sc=Math.min,Bc=Math.max;nn.document&&(ao=document.createElement("canvas"));const bt=class bt extends _n{constructor(n,r,s,o){super();C(this,"_flagValue",!0);C(this,"_flagFamily",!0);C(this,"_flagSize",!0);C(this,"_flagLeading",!0);C(this,"_flagAlignment",!0);C(this,"_flagBaseline",!0);C(this,"_flagStyle",!0);C(this,"_flagWeight",!0);C(this,"_flagDecoration",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_flagDirection",!0);C(this,"_value","");C(this,"_family","sans-serif");C(this,"_size",13);C(this,"_leading",17);C(this,"_alignment","center");C(this,"_baseline","middle");C(this,"_style","normal");C(this,"_weight",500);C(this,"_decoration","none");C(this,"_direction","ltr");C(this,"_fill","#000");C(this,"_stroke","none");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);for(let a in Tc)Object.defineProperty(this,a,Tc[a]);if(this._renderer.type="text",this._renderer.flagFill=Km.bind(this),this._renderer.flagStroke=Zm.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Me.isObject(o))return this;for(let a=0;a<bt.Properties.length;a++){const l=bt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(ao){const r=ao.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*bt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new bt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new bt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<bt.Properties.length;s++){const o=bt.Properties[s];r[o]=this[o]}return this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);n.renderer.type="text";for(let r=0;r<bt.Properties.length;r++){const s=bt.Properties[r];n[s]=this[s]}return n}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,s,o,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=bt.Measure(this),h=(this._linewidth||0)/2;switch(this.alignment){case"left":s=-h,o=c+h;break;case"right":s=-(c+h),o=h;break;default:s=-(c/2+h),o=c/2+h}switch(this.baseline){case"middle":a=-(d/2+h),l=d/2+h;break;default:a=-(d+h),l=h}const[f,p]=r.multiply(s,a),[u,g]=r.multiply(s,l),[m,_]=r.multiply(o,a),[y,b]=r.multiply(o,l);return a=Sc(p,g,_,b),s=Sc(f,u,m,y),o=Bc(f,u,m,y),l=Bc(p,g,_,b),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};C(bt,"Ratio",.6),C(bt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Fi=bt;const Tc={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof nt||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof ot)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof nt||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof ot)&&this._stroke.bind(K.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Me.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function Km(){this._flagFill=!0}function Zm(){this._flagStroke=!0}const es=Math.min,ts=Math.max,En=class En extends _n{constructor(n){super();C(this,"_flagAdditions",!1);C(this,"_flagSubtractions",!1);C(this,"_flagOrder",!1);C(this,"_flagOpacity",!0);C(this,"_flagBeginning",!1);C(this,"_flagEnding",!1);C(this,"_flagLength",!1);C(this,"_flagMask",!1);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_length",0);C(this,"_mask",null);for(let r in Ec)Object.defineProperty(this,r,Ec[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(n)?n:Array.prototype.slice.call(arguments)}static InsertChildren(n){for(let r=0;r<n.length;r++)$c.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)$c.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new En;for(let o=0;o<En.Properties.length;o++){const a=En.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ri(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return Ks.fromObject(o);case"circle":return Qs.fromObject(o);case"ellipse":return no.fromObject(o);case"points":return Qr.fromObject(o);case"polygon":return io.fromObject(o);case"rectangle":return ro.fromObject(o);case"rounded-rectangle":return so.fromObject(o);case"star":return oo.fromObject(o);case"path":return $e.fromObject(o);case"text":return Fi.fromObject(o);case"group":return En.fromObject(o);case"shape":return _n.fromObject(o);case"element":return sr.fromObject(o)}return o}}copy(n){return super.copy.call(this,n),console.warn("Two.Group.copy is not supported yet."),this}clone(n){const r=new En,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Me.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,f=1/0,p=-1/0;const u=/texture|gradient/i;s=n?this.matrix:this.worldMatrix;for(let g=0;g<this.children.length;g++){const m=this.children[g];if(!(!m.visible||u.test(m._renderer.type))&&(r=m.getBoundingClientRect(n),o=typeof r.top!="number"||Me.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Me.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Me.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Me.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[_,y]=s.multiply(r.left,r.top),[b,S]=s.multiply(r.right,r.top),[x,v]=s.multiply(r.left,r.bottom),[B,k]=s.multiply(r.right,r.bottom);f=es(y,S,v,k,f),d=es(_,b,x,B,d),h=ts(_,b,x,B,h),p=ts(y,S,v,k,p)}else f=es(r.top,f),d=es(r.left,d),h=ts(r.right,h),p=ts(r.bottom,p)}return{top:f,left:d,right:h,bottom:p,width:h-d,height:p-f}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,s;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=o*l,h=a*l;for(n=0;n<this.children.length;n++)s=this.children[n],r=s.length,d>c+r?(s.beginning=1,s.ending=1):h<c?(s.beginning=0,s.ending=0):d>c&&d<c+r?(s.beginning=(d-c)/r,s.ending=1):h>c&&h<c+r?(s.beginning=0,s.ending=(h-c)/r):(s.beginning=0,s.ending=1),c+=r}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};C(En,"Children",_c),C(En,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let yn=En;const Ec={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=yn.InsertChildren.bind(this),n=yn.RemoveChildren.bind(this),r=yn.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new _c(e),this._children.bind(K.Types.insert,t),this._children.bind(K.Types.remove,n),this._children.bind(K.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Me.isObject(e)&&!e.clip&&(e.clip=!0)}}};function $c(e,t){const n=e.parent;let r;if(n===t){s();return}if(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),o()),t){s();return}o(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function s(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function o(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}class ns extends $e{constructor(t,n,r,s){const o=[new Ee(t,n),new Ee(r,s)];super(o);for(let a in Rc)Object.defineProperty(this,a,Rc[a]);this.vertices[0].command=pe.move,this.vertices[1].command=pe.line,this.automatic=!1}}C(ns,"Properties",["left","right"]);const Rc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(Me.isObject(e))this.vertices.splice(0,1,e);else{const t=new Gr("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(Me.isObject(e))this.vertices.splice(1,1,e);else{const t=new Gr("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class lo{constructor(t=0,n=0){this.x=t,this.y=n}}class si{constructor(t=10,n=0,r="A"){C(this,"start",new lo);C(this,"end",new lo);this.width=t,this.angle=n,this.label=r}}const Ie={line:{color:"#000",size:5},previewLine:{color:"#000",size:2},anchorPoint:{color:"#FF8000",size:12,strokeSize:20},lineLabel:{color:"#FF8000",size:22,rotation:-.5},angleLabel:{size:22,color:"#088c00",rotation:-.5},colorSideLabel:{size:20,color:"#439227"}},Jm={class:"flex gap-3"},Qm={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},e0={ref:"drawing-container",class:"size-full"},t0={},Nc=i.defineComponent({...t0,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((T,$)=>new si(n.value.configuratorParams.linesWidths[$],T,`A-${$+1}`))),f=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),p=i.computed(()=>{var T,$;return n.value.configuratorParams.startTailType&&((T=n.settings.startTailConfigs)!=null&&T[n.value.configuratorParams.startTailType])?($=n.settings.startTailConfigs)==null?void 0:$[n.value.configuratorParams.startTailType].points:[]}),u=i.computed(()=>{var T,$;return n.value.configuratorParams.endTailType&&((T=n.settings.endTailConfigs)!=null&&T[n.value.configuratorParams.endTailType])?($=n.settings.endTailConfigs)==null?void 0:$[n.value.configuratorParams.endTailType].points:[]}),g=(T,$=!1)=>{T[0].start.x=0,T[0].start.y=0;let j=0;for(let z=0;z<T.length;z++){const Y=T[z],V=T[z-1]??new si(0,j);j+=!$||z>1?V.angle:0;const O=(!$||z>0?Y.angle:0)+j;if(T[z].end.x=Y.width*Math.cos(O*Math.PI/180)+T[z].start.x,T[z].end.y=Y.width*Math.sin(O*Math.PI/180)+T[z].start.y,z<T.length-1){const J=z+1;T[J].start.x=T[z].end.x,T[J].start.y=T[z].end.y}}return T},m=(T,$,j,z,Y=!1)=>{let V=g([...j,...z]);$.length>0&&(V=[...g($),...V]);let O=0,J=0,ge=0,re=0;V.forEach(Fe=>{O=Math.min(O,Fe.start.x,Fe.end.x),J=Math.min(J,Fe.start.y,Fe.end.y),ge=Math.max(ge,Fe.start.x,Fe.end.x),re=Math.max(re,Fe.start.y,Fe.end.y)});let he,se;O===0&&J===0&&ge===0&&re===0?(he=1,se=1):(he=T.width/Math.abs(ge-O),se=(Y?T.height:T.height-Ie.colorSideLabel.size)/Math.abs(re-J));const Pe=Math.min(he,se);return O=O<0?-O*Pe:0,J=J<0?-J*Pe:0,[Pe,O,J]},_=T=>{const $=new Qr([T]);return $._size=Ie.anchorPoint.size,$.fill=Ie.anchorPoint.color,$.stroke="transparent",$._linewidth=Ie.anchorPoint.strokeSize,l.push($),$},y=(T,$)=>{if(l=[],n.settings.allowChangeFirstPoint){const j=T[0],z=new we(j.vertices[0].x,j.vertices[0].y);z.bind(K.Types.change,()=>{j.vertices[0].copy(z)});const Y=_(z);$.add(Y)}T.forEach((j,z)=>{const Y=T[z+1],V=new we(j.vertices[1].x,j.vertices[1].y);V.bind(K.Types.change,()=>{j.vertices[1].copy(V),Y!==void 0&&Y.vertices[0].copy(V)});const O=_(V);$.add(O)})},b=T=>T*(Math.PI/180),S=(T,$,j)=>{const z=$.vertices.length-1;T.position.x=$.vertices[z].x,T.position.y=$.vertices[z].y;const Y=Math.atan2($.vertices[z].y-$.vertices[0].y,$.vertices[z].x-$.vertices[0].x);T.rotation=b(j)+Y},x=(T,$,j)=>{if($.vertices[0]===void 0)return;T.position.x=$.vertices[0].x,T.position.y=$.vertices[0].y;const z=$.vertices.length-1,Y=Math.atan2($.vertices[z].y-$.vertices[0].y,$.vertices[z].x-$.vertices[0].x);T.rotation=b(j)+Y},v=(T,$,j)=>{const z=new yn;if(T.length===0)return z;const Y=[];return[...T].reverse().forEach((V,O)=>{O!==0&&V.angle>0&&(V.angle*=-1),Y.push(V)}),T=g(Y,!0),x(z,$,T[0].angle),[$.vertices[0],$.vertices[1]].forEach(V=>{V.bind(K.Types.change,()=>{x(z,$,T[0].angle)})}),T.forEach(V=>{const O=V.start.x*j,J=V.end.x*j,ge=V.start.y*j,re=V.end.y*j,he=new ns(O,ge,J,re);he.linewidth=Ie.line.size,he.stroke=Ie.line.color,z.add(he)}),z},B=(T,$,j)=>{const z=new yn;return T.length===0||(T=g(T,!0),S(z,$,T[0].angle),[$.vertices[0],$.vertices[1]].forEach(Y=>{Y.bind(K.Types.change,()=>{S(z,$,T[0].angle)})}),T.forEach(Y=>{const V=Y.start.x*j,O=Y.end.x*j,J=Y.start.y*j,ge=Y.end.y*j,re=new ns(V,J,O,ge);re.linewidth=Ie.line.size,re.stroke=Ie.line.color,z.add(re)})),z},k=(T,$,j,z)=>{const Y=$.vertices[0].x+($.vertices[1].x-$.vertices[0].x)/2-8*Math.sin(T.angle*Math.PI/180),V=$.vertices[0].y+($.vertices[1].y-$.vertices[0].y)/2-8*Math.cos(T.angle*Math.PI/180),O=new Fi(T.label,Y+10,V-10);let J;O.size=Ie.lineLabel.size,O.weight=600,O.fill=Ie.lineLabel.color,O.id+=1,O.rotation=Ie.lineLabel.rotation,z>0&&(J=new Fi(`${T.angle}°`,$.vertices[0].x+25,$.vertices[0].y-25),J.size=Ie.angleLabel.size,J.weight=600,J.fill=Ie.angleLabel.color,J.rotation=Ie.angleLabel.rotation,J.id+=z,o.push(J),j.add(J)),j.add(O),P(O,$,0,J),P(O,$,1)},R=()=>{const{size:T}=Ie.colorSideLabel,$=0,j=0,z=f.value?T/2:T/2-T,Y=f.value?T/2-T:T/2,V=new yn;if(!c)return V;const O=5,J=Math.atan2(Y-z,j-$),ge=[new Ee($,z,0,0,0,0,ue.Commands.move),new Ee(j,Y,0,0,0,0,ue.Commands.line),new Ee(j-O*Math.cos(J-Math.PI/4),Y-O*Math.sin(J-Math.PI/4),0,0,0,0,ue.Commands.line),new Ee(j,Y,0,0,0,0,ue.Commands.move),new Ee(j-O*Math.cos(J+Math.PI/4),Y-O*Math.sin(J+Math.PI/4),0,0,0,0,ue.Commands.line)],re=new $e(ge,!1,!1,!0);re.noFill(),re.cap="round",re.join="round",re.linewidth=T/7,re.stroke=Ie.colorSideLabel.color,V.add(re);const he=new Fi(f.value?"Цвет снизу":"Цвет сверху",10,0);he.size=T,he.weight=600,he.fill=Ie.colorSideLabel.color,he.alignment="left",V.add(he);const se=V.getBoundingClientRect();return V.position.x=(c.width-se.width)*d+10,V.position.y=f.value?c.height+se.height*2:se.height/2,V},P=(T,$,j,z)=>{$.vertices[j].bind(K.Types.change,()=>{const Y=$.vertices.length-1,V=Math.atan2($.vertices[0].y-$.vertices[Y].y,$.vertices[0].x-$.vertices[Y].x)*180/Math.PI,O=$.vertices[0].x+($.vertices[Y].x-$.vertices[0].x)/2-8*Math.sin(V*Math.PI/180),J=$.vertices[0].y+($.vertices[Y].y-$.vertices[0].y)/2-8*Math.cos(V*Math.PI/180);T.position.x=O+10,T.position.y=J-10,T.rotation=-.5,z&&(z.position.x=$.vertices[0].x+25,z.position.y=$.vertices[0].y-25)})},N=(T,$,j,z,Y=!1)=>{var Ze;if(T.clear(),j.length===0){T.update();return}const V=g(j),[O,J,ge]=m(T,$,V,z,Y),re=new yn,he=new Array,se=new Array;Y||(o=[],a=[]),V.forEach((Le,dt)=>{const Zt=Le.start.x*O+J,Oe=Le.end.x*O+J,Ce=Le.start.y*O+ge,Je=Le.end.y*O+ge,Qe=new ns(Zt,Ce,Oe,Je);Qe.linewidth=Y?Ie.previewLine.size:Ie.line.size,Qe.stroke=Y?Ie.previewLine.color:Ie.line.color,a.push(Qe),he.push(Qe),re.add(Qe),!Y&&Le.label!==""&&k(Le,Qe,re,dt)});const Pe=he.at(-1);let Fe=re.getBoundingClientRect();if(!Y){const Le=R();se.push(Le)}if($.length>0){const Le=v($,he[0],O);re.add(Le)}if(z.length>0&&Pe){const Le=B(z,Pe,O);re.add(Le)}if(se.push(re),T.makeGroup(se),Fe=re.getBoundingClientRect(),re.position.x=0-Fe.left+(T.width-Fe.width)/(2*(Y?1:d)),re.position.y=0-Fe.top+(T.height-Fe.height)/(2*(Y?1:d)),T.update(),!Y){const Le=((Ze=n.value.configuratorParams)==null?void 0:Ze.colorSide)==="top";re.position.y=re.position.y+Ie.colorSideLabel.size*Number(Le),y(he,re),T.update()}},W=(T,$)=>{if(T&&!$.isNewRec()){const j=new ue({width:T.scrollWidth,height:T.scrollHeight});j.appendTo(T),N(j,[],$.points,[],!0)}},q=()=>{c&&N(c,p.value,h.value,u.value,!1)},F=T=>T*(180/Math.PI),M=(T,$)=>{const j=T[1].x-T[0].x,z=T[1].y-T[0].y,Y=$[1].x-$[0].x,V=$[1].y-$[0].y;let O=Math.atan2(j*V-z*Y,j*Y+z*V);return O=F(O),Math.round(O)*-1},I=T=>{const $=a.map((j,z,Y)=>{const V=Y[z-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let O=Math.ceil(j._length/T/n.settings.lineWidthStep)*n.settings.lineWidthStep;const J=o[z-1];O<(Y.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(O=Y.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),O>n.settings.maxLineWidth&&(O=n.settings.maxLineWidth);const ge=M(j.vertices,V.vertices);return J&&(J.value=`${ge}°`),new si(O,ge,`A-${z+1}`)});r("pointer:move",$)},Z=T=>{let $=null,j;const z=J=>{$=l.find(ge=>{const re=ge.renderer;return(re==null?void 0:re.elem)===J.target}),[j]=m(T,p.value,h.value.map(ge=>ge),u.value)},Y=J=>{if($){const ge=$.renderer,re=ge==null?void 0:ge.elem;if(!re)return;const he=re.getBoundingClientRect();$.vertices[0].x-=he.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+Ie.anchorPoint.size/2,$.vertices[0].y-=he.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+Ie.anchorPoint.size/2,I(j),T.update()}},V=()=>{$&&r("pointer:up",h.value),$=null},O=s.value;O&&(O.addEventListener("touchstart",z),O.addEventListener("touchend",V),O.addEventListener("mousedown",z),O.addEventListener("mouseup",V),O.addEventListener("mousemove",Y),O.addEventListener("touchmove",Y))};return i.onMounted(()=>{s.value&&(c=new ue({width:s.value.scrollWidth,height:s.value.scrollHeight,fullscreen:!1}).appendTo(s.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{q()},{deep:!0,immediate:!0}),Z(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(T,$)=>(i.openBlock(),i.createElementBlock("div",Jm,[i.createVNode(Na,{"select-template-index":T.selectTemplateIndex,settings:T.settings,"onTemplate:select":$[0]||($[0]=j=>r("template:select",j)),onInitDrawTemplate:W},null,8,["select-template-index","settings"]),i.createElementVNode("div",Qm,[i.createElementVNode("div",e0,null,512)])]))}}),n0={class:"flex max-w-[50rem] flex-col gap-3"},i0={},r0=i.defineComponent({...i0,__name:"kozyrek-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(n.settings),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),h=i.ref({quantity:{},marker:{},length:{}}),f=i.ref(0),p=(v=0)=>{const B=c.value.allTemplates.at(v);B!==void 0&&(f.value=v,l.value.configuratorParams.linesWidths=B.points.map(k=>D.isArray(k)?k[0]:k.width),l.value.configuratorParams.linesAngles=B.points.map(k=>D.isArray(k)?k[1]:k.angle),y()),m(l.value.configuratorParams)},u=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const B={label:v,points:l.value.configuratorParams.linesWidths.map((k,R)=>[k,l.value.configuratorParams.linesAngles[R]])};await U.HttpRequester.getInstance(U.ConfiguratorProvider).createTemplate(n.cartItem.category,B,h.value).then(()=>{c.value.addCustomTemplate(B),f.value=c.value.allTemplates.length-1}).catch(()=>{a.value=!1}),a.value=!1},g=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},m=async v=>{y(),s.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(n.cartItem.category,v,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},_=async()=>{o.value=!0,await(l.value.isNewRec()?U.HttpRequester.getInstance(U.CartProvider).addCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1}):U.HttpRequester.getInstance(U.CartProvider).patchCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1})),o.value=!1},y=()=>{const v={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,k)=>{v[`lines_widths[${k+1}]`]={},v[`lines_angles[${k+1}]`]={}}),h.value=v},b=v=>{d.value.linesWidths=v.map(B=>B.width),d.value.linesAngles=v.map(B=>B.angle)},S=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,y(),g(),m(l.value.configuratorParams)},x=(v,B)=>{d.value.linesWidths=v,d.value.linesAngles=B};return i.onBeforeMount(()=>{p()}),(v,B)=>(i.openBlock(),i.createElementBlock("div",n0,[i.createVNode(Nc,{value:l.value,"select-template-index":f.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":p},null,8,["value","select-template-index","settings"]),i.createVNode(Ma,{value:l.value,"onUpdate:value":B[0]||(B[0]=k=>l.value=k),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":f.value,"onUpdate:params":B[1]||(B[1]=k=>m(k)),"onUpdate:preview":x,onSubmit:_,"onClick:saveTemplate":u},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Mi extends U.Identity{constructor(n,r){super();C(this,"label","");C(this,"points",[]);C(this,"isCustom",!1);C(this,"id",-1);C(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>D.isArray(s)?new si(s[0],s[1],`A-${o+1}`):new si(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new si(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class co extends Mi{constructor(n){super(n);C(this,"isDefault");this.isDefault=n.isDefault??!1}}class s0{constructor(t){C(this,"minLineWidth");C(this,"maxLineWidth");C(this,"lineWidthStep");C(this,"minLineAngle");C(this,"maxLineAngle");C(this,"lineAngleStep");C(this,"stripMinWidth");C(this,"stripMaxWidth");C(this,"stripMinLength");C(this,"stripMaxLength");C(this,"allowShowTable");C(this,"showOnlyTemplates");C(this,"templates");C(this,"customTemplates",[]);C(this,"startTailConfigs");C(this,"endTailConfigs");C(this,"bendCountForExtended");C(this,"extendedProductCatalog");C(this,"allowChangeFirstPoint");C(this,"allowSaveTemplates");C(this,"userTemplatesPrefix");C(this,"lengthStep");this.minLineWidth=t.minLineWidth,this.maxLineWidth=t.maxLineWidth,this.lineWidthStep=t.lineWidthStep,this.minLineAngle=t.minLineAngle,this.maxLineAngle=t.maxLineAngle,this.lineAngleStep=t.lineAngleStep,this.stripMinWidth=t.stripMinWidth,this.stripMaxWidth=t.stripMaxWidth,this.stripMinLength=t.stripMinLength,this.stripMaxLength=t.stripMaxLength,this.allowShowTable=t.allowShowTable,this.showOnlyTemplates=t.showOnlyTemplates,this.templates=t.templates.map(n=>new Mi(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new co(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new co(n)),this.bendCountForExtended=t.bendCountForExtended,this.extendedProductCatalog=t.extendedProductCatalog,this.allowChangeFirstPoint=t.allowChangeFirstPoint,this.allowSaveTemplates=t.allowSaveTemplates,this.userTemplatesPrefix=t.userTemplatesPrefix,this.lengthStep=t.lengthStep,this.showOnlyTemplates||(this.customTemplates=t.customTemplates?Object.entries(t.customTemplates).map(([n,r])=>{const s=new Mi(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Mi))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Mi(t);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(t){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===t);n&&n!==-1&&this.customTemplates.splice(n,1)}}const o0={},Ai=i.defineComponent({...o0,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=D.debounce(()=>s("update:value",o.value),a.value),c=u=>{o.value=u,l()};i.watch(()=>r.value,u=>{o.value=u});const d=i.ref(null);return t({focus:()=>{var u;return(u=d.value)==null?void 0:u.focus()},blur:()=>{var u;return(u=d.value)==null?void 0:u.blur()},select:()=>{var u;return(u=d.value)==null?void 0:u.select()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(A.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:u.clearable,placeholder:u.placeholder,min:u.min,max:u.max,step:u.step,validator:u.validator},{prefix:i.withCtx(()=>[i.renderSlot(u.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),a0={class:"flex flex-col gap-3"},l0={},Pc=i.defineComponent({...l0,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("first-input-element"),o=i.ref(D.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new U.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=A.NInput;return i.openBlock(),i.createBlock(i.unref(A.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:c.validation.width.feedback||"","show-feedback":c.validation.width.showFeedback||!1,"validation-status":c.validation.width.validationStatus||void 0,label:`Ширина, ${c.settings.minWidth?" от "+c.settings.minWidth:""}${c.settings.maxWidth?" до "+c.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Ai,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=f=>o.value.width=f),a],class:"w-full",max:c.settings.maxWidth??void 0,min:c.settings.minWidth,validator:f=>!!f&&f>=c.settings.minWidth&&(!c.settings.maxWidth||f<=c.settings.maxWidth),placeholder:"Введите ширину"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:c.validation.length.feedback||"","show-feedback":c.validation.length.showFeedback||!1,"validation-status":c.validation.length.validationStatus||void 0,label:`Длина, ${c.settings.minLength?" от "+c.settings.minLength:""}${c.settings.maxLength?" до "+c.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=f=>o.value.length=f),a],placeholder:"Введите длину",max:c.settings.maxLength,min:c.settings.minLength,validator:f=>f>=c.settings.minLength&&f<=c.settings.maxLength,class:"w-full"},null,8,["value","max","min","validator"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:c.validation.quantity.feedback||"","show-feedback":c.validation.quantity.showFeedback||!1,"validation-status":c.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator:f=>f>0,class:"w-full","onUpdate:value":d[2]||(d[2]=f=>l("quantity",f??0))},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{feedback:c.validation.marker.feedback||"","show-feedback":c.validation.marker.showFeedback||!1,"validation-status":c.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:c.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=f=>l("marker",f))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",a0,[i.createVNode(i.unref(A.NButton),{disabled:c.value.product.isNewRec()||c.isProductSearching||c.isSubmitProcessing||c.value.length===0||c.value.width===0||c.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=f=>r("submit",c.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(c.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"]),c.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"tertiary",class:"self-start",onClick:d[5]||(d[5]=f=>r("click:view-switch"))},{default:i.withCtx(()=>[...d[6]||(d[6]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),c0={class:"w-104 px-5"},d0={},h0=i.defineComponent({...d0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(f=>{s.value.product=f}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?U.HttpRequester.getInstance(U.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):U.HttpRequester.getInstance(U.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,f)=>(i.openBlock(),i.createElementBlock("div",c0,[i.createVNode(Pc,{value:s.value,"onUpdate:value":f[0]||(f[0]=p=>s.value=p),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":f[1]||(f[1]=p=>c(p)),onSubmit:f[2]||(f[2]=p=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),u0={key:0,class:"flex items-baseline gap-1"},f0={key:0,class:"flex items-baseline gap-1"},p0={class:"flex gap-3"},g0={},Fc=i.defineComponent({...g0,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>vt.isPhoneDevice()),o=i.ref(D.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(p,u)=>{p&&p in o.value&&(o.value[p]=u??0),r("update:params",o.value),f("configuratorParams",o.value)},f=(p,u)=>{const g=new U.CartItemBase(n.value);g[p]=u,r("update:value",g)};return(p,u)=>{const g=A.NInput;return i.openBlock(),i.createBlock(i.unref(A.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:o.value.netType,"onUpdate:value":[u[0]||(u[0]=m=>o.value.netType=m),h],options:p.settings.netType.map(m=>({label:p.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:o.value.color,"onUpdate:value":u[1]||(u[1]=m=>o.value.color=m),options:p.settings.color.map(m=>({label:p.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:o.value.mountType,"onUpdate:value":[u[2]||(u[2]=m=>o.value.mountType=m),h],options:p.settings.mountType.map(m=>({label:p.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:p.validation.width.feedback||"","show-feedback":p.validation.width.showFeedback||o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType],"validation-status":p.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${p.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.width.showFeedback&&o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",u0,[i.createVNode(i.unref(A.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(A.NButton),{quaternary:"",type:"info",size:"tiny",onClick:u[4]||(u[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...u[11]||(u[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.width&&o.value.width-a.value,max:c.value,min:p.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":u[3]||(u[3]=m=>h("width",(m&&m+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:p.validation.height.feedback||"","show-feedback":p.validation.height.showFeedback||o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType],"validation-status":p.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${p.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.height.showFeedback&&o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",f0,[i.createVNode(i.unref(A.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(A.NButton),{quaternary:"",type:"info",size:"tiny",onClick:u[6]||(u[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...u[12]||(u[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.height&&o.value.height-l.value,max:d.value,min:p.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":u[5]||(u[5]=m=>h("height",(m&&m+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,feedback:p.validation.quantity.feedback||"","show-feedback":p.validation.quantity.showFeedback||!1,"validation-status":p.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:p.value.quantity,"onUpdate:value":u[7]||(u[7]=m=>p.value.quantity=m),min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(A.NFormItem),{feedback:p.validation.marker.feedback||"","show-feedback":p.validation.marker.showFeedback||!1,"validation-status":p.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:p.value.marker,"onUpdate:value":u[8]||(u[8]=m=>p.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Ui,{"is-product-searching":p.isProductSearching,product:p.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",p0,[i.createVNode(i.unref(A.NButton),{loading:p.isSubmitProcessing,disabled:p.isProductSearching||!p.value.product||p.value.product.isNewRec()||o.value.width<p.settings.minHeight-l.value||o.value.height<p.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:u[9]||(u[9]=m=>r("submit",p.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"default",onClick:u[10]||(u[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>[...u[13]||(u[13]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1})}}}),m0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",_0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",y0="/img/configurators/mosquitto/measurement-instructions/mount.png",b0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",w0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",v0={class:"flex flex-col gap-6"},k0={class:"flex gap-4"},x0={class:"flex flex-col gap-2"},C0={class:"flex gap-4"},S0={class:"flex flex-col gap-2"},B0={class:"flex gap-4"},T0={class:"flex flex-col gap-2"},E0={},Mc=i.defineComponent({...E0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=vt.initRefDependingOnDeviceResolution("small","small","medium"),r=vt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=A.NText;return i.openBlock(),i.createBlock(i.unref(A.NModal),{show:a.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",v0,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:m0,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),i.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:_0,alt:"measurement-height",class:"w-[7.5rem]"}),i.createElementVNode("div",{class:"flex flex-col gap-2"},[i.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),i.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),i.createElementVNode("div",k0,[l[9]||(l[9]=i.createElementVNode("img",{src:y0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",x0,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),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(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",C0,[l[15]||(l[15]=i.createElementVNode("img",{src:b0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",S0,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),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 помощью шурупов. ",-1))])])]),i.createElementVNode("div",B0,[l[21]||(l[21]=i.createElementVNode("img",{src:w0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",T0,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),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))])])])])]),_:1},8,["show","size","style"])}}}),$0={class:"flex flex-col items-center justify-between rounded-xl"},R0={class:"img-preview relative flex justify-center"},N0={},P0=i.defineComponent({...N0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>D.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=t;return(o,a)=>{const l=A.NButton;return i.openBlock(),i.createElementBlock("div",$0,[i.createElementVNode("div",R0,[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)])]),_:1})])}}}),ho=jn(P0,[["__scopeId","data-v-8b43aa68"]]),F0={class:"grid md:grid-cols-2"},M0={},A0=i.defineComponent({...M0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>vt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),f=async u=>{u.height>0&&u.width>0&&(d.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(n.cartItem.category,u,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},p=async()=>{h.value=!0,await(l.value.isNewRec()?U.HttpRequester.getInstance(U.CartProvider).addCartItem(n.client,l.value).then(u=>{r("submit-success",u)}).catch(()=>{h.value=!1}):U.HttpRequester.getInstance(U.CartProvider).patchCartItem(n.client,l.value).then(u=>{r("submit-success",u)}).catch(()=>{h.value=!1})),h.value=!1};return(u,g)=>{const m=Er;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Mc,{show:a.value,"onUpdate:show":g[0]||(g[0]=_=>a.value=_),"height-overlaps":u.settings.heightOverlaps,"width-overlaps":u.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",F0,[s.value?(i.openBlock(),i.createBlock(i.unref(A.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(A.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(A.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=_=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1})]),default:i.withCtx(()=>[i.createVNode(ho,{"configurator-params":l.value.configuratorParams,settings:u.settings,onOpenInstructions:g[3]||(g[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(ho,{key:0,"configurator-params":l.value.configuratorParams,settings:u.settings,onOpenInstructions:g[1]||(g[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(Fc,{value:l.value,"onUpdate:value":g[5]||(g[5]=_=>l.value=_),validation:c.value,settings:u.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=_=>f(_)),onSubmit:g[7]||(g[7]=_=>p()),"onClick:instructionsToggle":g[8]||(g[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=_=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),V0={},Ac=i.defineComponent({...V0,__name:"strip-configurator-line-item",props:{value:{},index:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{default:()=>({})}},emits:["update:value","click:add-line","click:remove-line"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=d=>{s("update:value",d??0,r.index,a)};i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{c()})});const c=()=>{var d;(d=o.value)==null||d.select()};return t({focusWidthInput:c}),(d,h)=>{const f=Fa,p=Pa;return i.openBlock(),i.createBlock(i.unref(A.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(Ui,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(A.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Ai,{ref:"width-input-element",value:d.value,class:"w-full",step:d.value<d.settings.minLineWidth?d.settings.minLineWidth-d.value:d.settings.lineWidthStep,validator:u=>!!u&&u>=d.settings.minLineWidth&&u%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(A.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=u=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(i.unref(A.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=u=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),I0={class:"my-2 flex w-full flex-col"},O0={class:"flex gap-3"},z0={},Vc=i.defineComponent({...z0,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit","click:add-line","click:remove-line"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>n.value[0].configuratorParams.linesWidths.map(h=>h).reduce((h,f)=>h+f,0)),o=i.computed(()=>n.settings.width-s.value),a=i.computed(()=>!n.value.some(({product:h})=>!h)),l=i.computed(()=>o.value===0?void 0:[{label:`${(o.value>0?"Остаток +":"Излишек ")+o.value} мм.`,key:o.value}]),c=(h,f,p)=>{const u=n.value.at(f);if(u)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:u.configuratorParams.linesWidths.toSpliced(f,1,h)};r("update:params",g,f,p),d("configuratorParams",g)}else u.product.id=-1},d=(h,f)=>{const p=n.value.map(u=>new U.CartItemBase(u));p.forEach(u=>{u[h]=f}),r("update:value",p)};return(h,f)=>{const p=A.NText,u=A.NInput;return i.openBlock(),i.createBlock(i.unref(A.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(m,_)=>(i.openBlock(),i.createBlock(Ac,{key:_,"auto-focus":!0,index:_,value:m.configuratorParams.linesWidths.at(_)??0,product:m.product,settings:h.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||h.value.length>=h.settings.maxLinesCount,"remove-line-button-disabled":h.value.length===1,"onUpdate:value":c,"onClick:addLine":f[0]||(f[0]=y=>r("click:add-line",y)),"onClick:removeLine":f[1]||(f[1]=y=>r("click:remove-line",y))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",I0,[o.value<0?(i.openBlock(),i.createBlock(p,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(h.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&h.value.length===h.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(p,{key:1,type:"error"},{default:i.withCtx(()=>[...f[8]||(f[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[f[9]||(f[9]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(p,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(h.settings.width)+" мм ",1)])]),i.createVNode(i.unref(A.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:f[2]||(f[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>[...f[10]||(f[10]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["loading","disabled"]),i.createVNode(i.unref(A.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:n.value[0].length,max:h.settings.maxLength||void 0,min:h.settings.minLength,step:h.settings.lengthStep,validator:m=>m%h.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":f[3]||(f[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":f[4]||(f[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(u,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":f[5]||(f[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",O0,[i.createVNode(i.unref(A.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=h.value[0])!=null&&g.length)||h.value[0].length>h.settings.maxLength||h.value[0].length<h.settings.minLength||h.value[0].quantity===0,type:"primary",class:"self-start",onClick:f[6]||(f[6]=m=>r("submit",h.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),h.settings.allowShowTable?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"tertiary",class:"self-start",onClick:f[7]||(f[7]=m=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[11]||(f[11]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0)])]}),_:1})}}}),L0={class:"flex grow flex-col"},D0=["src"],H0={class:"w-full"},W0={},Ic=i.defineComponent({...W0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",L0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,D0),i.createElementVNode("div",H0,[i.createTextVNode(" Число полос можно указать от "+i.toDisplayString(t.settings.minLinesCount)+" до "+i.toDisplayString(t.settings.maxLinesCount)+". ",1),n[0]||(n[0]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Минимальная ширина полосы "+i.toDisplayString(t.settings.minLineWidth)+" мм. ",1),n[1]||(n[1]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина всех полос "+i.toDisplayString(t.settings.width)+" мм. ",1),n[2]||(n[2]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Шаг ширины полосы - "+i.toDisplayString(t.settings.lineWidthStep)+" мм. ",1)])]))}}),j0={class:"w-104 flex grow flex-col px-5"},X0={},q0=i.defineComponent({...X0,__name:"strip-configurator",props:{settings:{},cartItems:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(p=>p).reduce((p,u)=>p+u,0)),c=p=>{p===void 0&&(p=s.value.length-1);const u=s.value.at(0);if(!u)return;u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(p+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=u.configuratorParams.linesWidths});const g=new U.CartItemBase({quantity:(u==null?void 0:u.quantity)??1,category:u==null?void 0:u.category,length:(u==null?void 0:u.length)??n.settings.minLength,marker:u==null?void 0:u.marker,configuratorParams:{linesWidths:u==null?void 0:u.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,g)},d=p=>{const u=s.value.at(0);u&&(u.configuratorParams.linesWidths=u.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=u.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete o[`linesWidths.${p}`],delete o[`linesWidths.${p}`])},h=async(p,u,g)=>{g.value=!0,await U.HttpRequester.getInstance(U.ConfiguratorProvider).searchProduct(s.value[u].category,{linesWidths:p.linesWidths.at(u)},o.value).then(m=>{s.value[u].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[u].product=new U.Product,g.value=!1}),g.value=!1},f=async()=>{a.value=!0,await(s.value[0].isNewRec()?U.HttpRequester.getInstance(U.CartProvider).addCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1}):U.HttpRequester.getInstance(U.CartProvider).patchCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1})),a.value=!1};return(p,u)=>(i.openBlock(),i.createElementBlock("div",j0,[i.createVNode(Ic,{value:s.value,"onUpdate:value":u[0]||(u[0]=g=>s.value=g),settings:p.settings},null,8,["value","settings"]),i.createVNode(Vc,{value:s.value,"onUpdate:value":u[1]||(u[1]=g=>s.value=g),validation:o.value,settings:p.settings,"is-submit-processing":a.value,"onUpdate:params":h,onSubmit:f,"onClick:addLine":c,"onClick:removeLine":d},null,8,["value","validation","settings","is-submit-processing"])]))}}),Y0={class:"flex flex-wrap gap-2"},U0={class:"flex flex-col"},G0={class:"flex flex-col"},K0={},Z0=i.defineComponent({...K0,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>U.AppConfigProvider.getConfig().dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return D.forOwn(U.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?Rn.startOfDay(new Date(a)):void 0,to:l?Rn.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,f,p,u,g,m;const c=A.NButton,d=A.NDatePicker;return i.openBlock(),i.createElementBlock("div",Y0,[i.createVNode(d,{value:((f=(h=a.dateRange)==null?void 0:h.from)==null?void 0:f.getTime())??null,clearable:a.clearable,"is-date-disabled":_=>{var y,b;return((y=a.dateRange)==null?void 0:y.to)&&_>((b=a.dateRange)==null?void 0:b.to)},disabled:(p=a.disabled)==null?void 0:p.from,format:a.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=_=>{var y,b;return o(_,(b=(y=a.dateRange)==null?void 0:y.to)==null?void 0:b.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",U0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(_,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:b=>{var S,x;return o((S=_==null?void 0:_.from)==null?void 0:S.getTime(),(x=_==null?void 0:_.to)==null?void 0:x.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(_.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((g=(u=a.dateRange)==null?void 0:u.to)==null?void 0:g.getTime())??null,clearable:a.clearable,"is-date-disabled":_=>{var y,b;return((y=a.dateRange)==null?void 0:y.from)&&_<((b=a.dateRange)==null?void 0:b.from)},disabled:(m=a.disabled)==null?void 0:m.to,format:a.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=_=>{var y,b;return o((b=(y=a.dateRange)==null?void 0:y.from)==null?void 0:b.getTime(),_)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",G0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(_,y)=>(i.openBlock(),i.createBlock(c,{key:y,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:b=>{var S,x;return o((S=_==null?void 0:_.from)==null?void 0:S.getTime(),(x=_==null?void 0:_.to)==null?void 0:x.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(_.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),J0={class:"sc-lbl-date text-nowrap"},Q0={},uo=i.defineComponent({...Q0,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>Rn.format(t.date,U.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>Rn.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",J0,i.toDisplayString(n.value),1),i.createElementVNode("span",{class:i.normalizeClass([{"text-sc-grey":s.isTimeSecondary,"ml-1":!s.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)],2))}}),e_={class:"flex flex-row gap-2.5"},t_={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},n_={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},i_={class:"mb-0.5 sm:mb-0 sm:ml-3"},r_={},s_=i.defineComponent({...r_,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Er,s=A.NButton,o=A.NPopover;return i.openBlock(),i.createElementBlock("div",e_,[i.createElementVNode("div",t_,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",n_,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",i_,[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)])])])])}}}),o_={key:0,class:"flex flex-row gap-2.5"},a_={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},l_={},c_=i.defineComponent({...l_,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=vt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=vt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},f=(u="other")=>{if(a.value){s("processing:cancel",y=>{a.value=y});return}let g=!1;s("closing",u,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},p=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,u=>{u?h():f("other")}),i.watch(()=>r.processing,u=>{a.value=u}),t({open:h,close:f}),(u,g)=>{const m=A.NButton,_=A.NModal;return i.openBlock(),i.createBlock(_,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:u.title,"action-class":u.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=y=>f("header")),onEsc:g[2]||(g[2]=y=>f("esc")),onMaskClick:g[3]||(g[3]=y=>f("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(u.$slots,"default")]),_:2},[u.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),key:"0"}:void 0,u.$slots.action||u.$slots["extra-action"]||u.acceptButton.show||u.cancelButton.show?{name:"action",fn:i.withCtx(()=>[u.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",o_,[i.renderSlot(u.$slots,"extra-action")])):i.createCommentVNode("",!0),u.$slots.action||u.acceptButton.show||u.cancelButton.show?(i.openBlock(),i.createElementBlock("div",a_,[i.renderSlot(u.$slots,"action",{disabled:a.value}),u.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value||!u.valid,size:i.unref(l),type:"primary",onClick:p},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(u.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),u.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=y=>f("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(u.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),d_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function h_(e,t){return i.openBlock(),i.createElementBlock("svg",d_,[...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 u_=i.markRaw({name:"ion-download-outline",render:h_}),f_={},p_=i.defineComponent({...f_,__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=u_,c=A.NUploadDragger,d=A.NUpload;return i.openBlock(),i.createBlock(d,{"default-upload":!1,max:1,action:"","directory-dnd":"",class:"content-center","onUpdate:fileList":s},{default:i.withCtx(()=>[i.createVNode(c,null,{default:i.withCtx(()=>[i.renderSlot(o.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(l,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(o.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3})}}}),g_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function m_(e,t){return i.openBlock(),i.createElementBlock("svg",g_,[...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 __=i.markRaw({name:"ion-checkmark-done-sharp",render:m_}),y_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function b_(e,t){return i.openBlock(),i.createElementBlock("svg",y_,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const w_=i.markRaw({name:"ion-options-outline",render:b_}),v_={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},k_={class:"flex-auto"},x_={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"},C_={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"},S_={},fo=i.defineComponent({...S_,__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=w_,f=A.NButton,p=A.NPopover,u=__,g=Er;return i.openBlock(),i.createElementBlock("div",v_,[i.createElementVNode("div",k_,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",x_,[i.createElementVNode("div",C_,[c.showEditButton?(i.openBlock(),i.createBlock(p,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.disabled||r.value,type:"info",ghost:"",size:"small",onClick:s},{default:i.withCtx(()=>[i.createVNode(h)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),c.showApplyButton?(i.openBlock(),i.createBlock(p,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),c.showCancelButton?(i.openBlock(),i.createBlock(p,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(f,{disabled:c.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),B_={},Oc=i.defineComponent({...B_,__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 i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(fo,{key:1,disabled:l.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(fo,{key:0,disabled:l.disabled,"show-edit-button":l.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),T_={},E_=i.defineComponent({...T_,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=D.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(A.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),$_={},R_=i.defineComponent({...$_,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=D.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(D.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(D.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof Xi.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?o(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const h=Xi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof Xi.ParseError)s.value=d;else throw h}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=s.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(s.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(Wh.VueTelInput),{modelValue:s.value,"onUpdate:modelValue":[d[0]||(d[0]=h=>s.value=h),a],"auto-default-country":!1,"auto-format":!0,"default-country":c.defaultCountry,disabled:c.disabled,"input-options":{placeholder:c.placeholder},"preferred-countries":c.preferredCountries,"only-countries":c.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),N_=jn(R_,[["__scopeId","data-v-751dbb0e"]]),P_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function F_(e,t){return i.openBlock(),i.createElementBlock("svg",P_,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const M_=i.markRaw({name:"tabler-external-link",render:F_}),A_={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},V_=["href"],I_={},O_=i.defineComponent({...I_,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=M_,s=A.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(D.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",A_,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,V_),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),z_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function L_(e,t){return i.openBlock(),i.createElementBlock("svg",z_,[...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 D_=i.markRaw({name:"ion-remove-circle-outline",render:L_});let is=[];const zc=new WeakMap;function H_(){is.forEach(e=>e(...zc.get(e))),is=[]}function Lc(e,...t){zc.set(e,t),!is.includes(e)&&is.push(e)===1&&requestAnimationFrame(H_)}function ar(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function lr(e){return e.composedPath()[0]||null}function cr(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function dr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Ut(e,t){const n=e.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}const Dc={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function W_(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 j_(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),s=(o,a=(o+e/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[s(0)*255,s(8)*255,s(4)*255]}const on="^\\s*",an="\\s*$",Vn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",zt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",oi="([0-9A-Fa-f])",ai="([0-9A-Fa-f]{2})",Hc=new RegExp(`${on}hsl\\s*\\(${zt},${Vn},${Vn}\\)${an}`),Wc=new RegExp(`${on}hsv\\s*\\(${zt},${Vn},${Vn}\\)${an}`),jc=new RegExp(`${on}hsla\\s*\\(${zt},${Vn},${Vn},${zt}\\)${an}`),Xc=new RegExp(`${on}hsva\\s*\\(${zt},${Vn},${Vn},${zt}\\)${an}`),X_=new RegExp(`${on}rgb\\s*\\(${zt},${zt},${zt}\\)${an}`),q_=new RegExp(`${on}rgba\\s*\\(${zt},${zt},${zt},${zt}\\)${an}`),Y_=new RegExp(`${on}#${oi}${oi}${oi}${an}`),U_=new RegExp(`${on}#${ai}${ai}${ai}${an}`),G_=new RegExp(`${on}#${oi}${oi}${oi}${oi}${an}`),K_=new RegExp(`${on}#${ai}${ai}${ai}${ai}${an}`);function Nt(e){return parseInt(e,16)}function Z_(e){try{let t;if(t=jc.exec(e))return[ss(t[1]),In(t[5]),In(t[9]),ci(t[13])];if(t=Hc.exec(e))return[ss(t[1]),In(t[5]),In(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function J_(e){try{let t;if(t=Xc.exec(e))return[ss(t[1]),In(t[5]),In(t[9]),ci(t[13])];if(t=Wc.exec(e))return[ss(t[1]),In(t[5]),In(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function li(e){try{let t;if(t=U_.exec(e))return[Nt(t[1]),Nt(t[2]),Nt(t[3]),1];if(t=X_.exec(e))return[gt(t[1]),gt(t[5]),gt(t[9]),1];if(t=q_.exec(e))return[gt(t[1]),gt(t[5]),gt(t[9]),ci(t[13])];if(t=Y_.exec(e))return[Nt(t[1]+t[1]),Nt(t[2]+t[2]),Nt(t[3]+t[3]),1];if(t=K_.exec(e))return[Nt(t[1]),Nt(t[2]),Nt(t[3]),ci(Nt(t[4])/255)];if(t=G_.exec(e))return[Nt(t[1]+t[1]),Nt(t[2]+t[2]),Nt(t[3]+t[3]),ci(Nt(t[4]+t[4])/255)];if(e in Dc)return li(Dc[e]);if(Hc.test(e)||jc.test(e)){const[n,r,s,o]=Z_(e);return[...j_(n,r,s),o]}else if(Wc.test(e)||Xc.test(e)){const[n,r,s,o]=J_(e);return[...W_(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function Q_(e){return e>1?1:e<0?0:e}function po(e,t,n,r){return`rgba(${gt(e)}, ${gt(t)}, ${gt(n)}, ${Q_(r)})`}function go(e,t,n,r,s){return gt((e*t*(1-r)+n*r)/s)}function ey(e,t){Array.isArray(e)||(e=li(e)),Array.isArray(t)||(t=li(t));const n=e[3],r=t[3],s=ci(n+r-n*r);return po(go(e[0],n,t[0],r,s),go(e[1],n,t[1],r,s),go(e[2],n,t[2],r,s),s)}function Ne(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:li(e);return typeof t.alpha=="number"?po(n,r,s,t.alpha):po(n,r,s,o)}function rs(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:li(e),{lightness:a=1,alpha:l=1}=t;return ty([n*a,r*a,s*a,o*l])}function ci(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ss(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function gt(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function In(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function ty(e){const[t,n,r]=e;return 3 in e?`rgba(${gt(t)}, ${gt(n)}, ${gt(r)}, ${ci(e[3])})`:`rgba(${gt(t)}, ${gt(n)}, ${gt(r)}, 1)`}function ny(e=8){return Math.random().toString(16).slice(2,2+e)}function qc(e){return Array.isArray(e)?e:[e]}const mo={STOP:"STOP"};function Yc(e,t){const n=t(e);e.children!==void 0&&n!==mo.STOP&&e.children.forEach(r=>Yc(r,t))}function iy(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 ry(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function sy(e){return e.children}function oy(e){return e.key}function ay(){return!1}function ly(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function cy(e){return e.disabled===!0}function dy(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function hy(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function _o(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function yo(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function uy(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function fy(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function py(e){return(e==null?void 0:e.type)==="group"}function gy(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 my extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function _y(e,t,n,r){return os(t.concat(e),n,r,!1)}function yy(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 by(e,t,n,r){const s=os(t,n,r,!1),o=os(e,n,r,!0),a=yy(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function bo(e,t){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=e;if(!a)return r!==void 0?{checkedKeys:uy(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:fy(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let f;s!==void 0?f=by(s,n,t,d):r!==void 0?f=_y(r,n,t,d):f=os(n,t,d,!1);const p=c==="parent",u=c==="child"||l,g=f,m=new Set,_=Math.max.apply(null,Array.from(h.keys()));for(let y=_;y>=0;y-=1){const b=y===0,S=h.get(y);for(const x of S){if(x.isLeaf)continue;const{key:v,shallowLoaded:B}=x;if(u&&B&&x.children.forEach(N=>{!N.disabled&&!N.isLeaf&&N.shallowLoaded&&g.has(N.key)&&g.delete(N.key)}),x.disabled||!B)continue;let k=!0,R=!1,P=!0;for(const N of x.children){const W=N.key;if(!N.disabled){if(P&&(P=!1),g.has(W))R=!0;else if(m.has(W)){R=!0,k=!1;break}else if(k=!1,R)break}}k&&!P?(p&&x.children.forEach(N=>{!N.disabled&&g.has(N.key)&&g.delete(N.key)}),g.add(v)):R&&m.add(v),b&&u&&g.has(v)&&g.delete(v)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function os(e,t,n,r){const{treeNodeMap:s,getChildren:o}=t,a=new Set,l=new Set(e);return e.forEach(c=>{const d=s.get(c);d!==void 0&&Yc(d,h=>{if(h.disabled)return mo.STOP;const{key:f}=h;if(!a.has(f)&&(a.add(f),l.add(f),dy(h.rawNode,o))){if(r)return mo.STOP;if(!n)throw new my}})}),l}function wy(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 vy(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function ky(e,t){const n=e.siblings,r=n.length,{index:s}=e;return t?n[(s+1)%r]:s===n.length-1?null:n[s+1]}function Uc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?xy:ky,o={reverse:t==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=wo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const f=Cy(d);f!=null&&f.isGroup?c(s(f,n)):n&&c(s(d,!0))}}}}return c(e),l}function xy(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 Cy(e){return e.parent}function wo(e,t={}){const{reverse:n=!1}=t,{children:r}=e;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=wo(d,t);if(h!==null)return h}else return d}}return null}const Sy={getChild(){return this.ignored?null:wo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Uc(this,"next",e)},getPrev(e={}){return Uc(this,"prev",e)}};function By(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 Ty(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var Ey={};function Gc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;Ey.NODE_ENV!=="production"&&hy(c,s)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===e.length,f.parent=o,!f.ignored){const p=s(c);Array.isArray(p)&&(f.children=Gc(p,t,n,r,s,f,a+1))}l.push(f),t.set(f.key,f),n.has(a)||n.set(a,[]),(h=n.get(a))===null||h===void 0||h.push(f)}),l}function $y(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=cy,getIgnored:a=ay,getIsGroup:l=py,getKey:c=oy}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:sy,h=t.ignoreEmptyChildren?x=>{const v=d(x);return Array.isArray(v)?v.length?v:null:v}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return o(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return ry(this.rawNode,h)},get shallowLoaded(){return ly(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return Ty(this,x)}},Sy),p=Gc(e,r,s,f,h);function u(x){if(x==null)return null;const v=r.get(x);return v&&!v.isGroup&&!v.ignored?v:null}function g(x){if(x==null)return null;const v=r.get(x);return v&&!v.ignored?v:null}function m(x,v){const B=g(x);return B?B.getPrev(v):null}function _(x,v){const B=g(x);return B?B.getNext(v):null}function y(x){const v=g(x);return v?v.getParent():null}function b(x){const v=g(x);return v?v.getChild():null}const S={treeNodes:p,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return By(p,x)},getNode:u,getPrev:m,getNext:_,getParent:y,getChild:b,getFirstAvailableNode(){return vy(p)},getPath(x,v={}){return wy(x,v,S)},getCheckedKeys(x,v={}){const{cascade:B=!0,leafOnly:k=!1,checkStrategy:R="all",allowNotLoaded:P=!1}=v;return bo({checkedKeys:_o(x),indeterminateKeys:yo(x),cascade:B,leafOnly:k,checkStrategy:R,allowNotLoaded:P},S)},check(x,v,B={}){const{cascade:k=!0,leafOnly:R=!1,checkStrategy:P="all",allowNotLoaded:N=!1}=B;return bo({checkedKeys:_o(v),indeterminateKeys:yo(v),keysToCheck:x==null?[]:qc(x),cascade:k,leafOnly:R,checkStrategy:P,allowNotLoaded:N},S)},uncheck(x,v,B={}){const{cascade:k=!0,leafOnly:R=!1,checkStrategy:P="all",allowNotLoaded:N=!1}=B;return bo({checkedKeys:_o(v),indeterminateKeys:yo(v),keysToUncheck:x==null?[]:qc(x),cascade:k,leafOnly:R,checkStrategy:P,allowNotLoaded:N},S)},getNonLeafKeys(x={}){return iy(p,x)}};return S}function as(e){return e.composedPath()[0]}const Ry={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Ny(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(as(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(as(a))},o=a=>{r&&(t.contains(as(a))||n(a))};return{mousedown:s,mouseup:o,touchstart:s,touchend:o}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function Kc(e,t,n){const r=Ry[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=Ny(e,t,n)),o}function Py(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Kc(e,t,n);return Object.keys(s).forEach(o=>{Bt(o,document,s[o],r)}),!0}return!1}function Fy(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Kc(e,t,n);return Object.keys(s).forEach(o=>{it(o,document,s[o],r)}),!0}return!1}function My(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function s(k,R,P){const N=k[R];return k[R]=function(){return P.apply(k,arguments),N.apply(k,arguments)},k}function o(k,R){k[R]=Event.prototype[R]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,R){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:R??l.get})}const h={bubble:{},capture:{}},f={};function p(){const k=function(R){const{type:P,eventPhase:N,bubbles:W}=R,q=as(R);if(N===2)return;const F=N===1?"capture":"bubble";let M=q;const I=[];for(;M===null&&(M=window),I.push(M),M!==window;)M=M.parentNode||null;const Z=h.capture[P],T=h.bubble[P];if(s(R,"stopPropagation",n),s(R,"stopImmediatePropagation",r),d(R,c),F==="capture"){if(Z===void 0)return;for(let $=I.length-1;$>=0&&!e.has(R);--$){const j=I[$],z=Z.get(j);if(z!==void 0){a.set(R,j);for(const Y of z){if(t.has(R))break;Y(R)}}if($===0&&!W&&T!==void 0){const Y=T.get(j);if(Y!==void 0)for(const V of Y){if(t.has(R))break;V(R)}}}}else if(F==="bubble"){if(T===void 0)return;for(let $=0;$<I.length&&!e.has(R);++$){const j=I[$],z=T.get(j);if(z!==void 0){a.set(R,j);for(const Y of z){if(t.has(R))break;Y(R)}}}}o(R,"stopPropagation"),o(R,"stopImmediatePropagation"),d(R)};return k.displayName="evtdUnifiedHandler",k}function u(){const k=function(R){const{type:P,eventPhase:N}=R;if(N!==2)return;const W=f[P];W!==void 0&&W.forEach(q=>q(R))};return k.displayName="evtdUnifiedWindowEventHandler",k}const g=p(),m=u();function _(k,R){const P=h[k];return P[R]===void 0&&(P[R]=new Map,window.addEventListener(R,g,k==="capture")),P[R]}function y(k){return f[k]===void 0&&(f[k]=new Set,window.addEventListener(k,m)),f[k]}function b(k,R){let P=k.get(R);return P===void 0&&k.set(R,P=new Set),P}function S(k,R,P,N){const W=h[R][P];if(W!==void 0){const q=W.get(k);if(q!==void 0&&q.has(N))return!0}return!1}function x(k,R){const P=f[k];return!!(P!==void 0&&P.has(R))}function v(k,R,P,N){let W;if(typeof N=="object"&&N.once===!0?W=Z=>{B(k,R,W,N),P(Z)}:W=P,Py(k,R,W,N))return;const F=N===!0||typeof N=="object"&&N.capture===!0?"capture":"bubble",M=_(F,k),I=b(M,R);if(I.has(W)||I.add(W),R===window){const Z=y(k);Z.has(W)||Z.add(W)}}function B(k,R,P,N){if(Fy(k,R,P,N))return;const q=N===!0||typeof N=="object"&&N.capture===!0,F=q?"capture":"bubble",M=_(F,k),I=b(M,R);if(R===window&&!S(R,q?"bubble":"capture",k,P)&&x(k,P)){const T=f[k];T.delete(P),T.size===0&&(window.removeEventListener(k,m),f[k]=void 0)}I.has(P)&&I.delete(P),I.size===0&&M.delete(R),M.size===0&&(window.removeEventListener(k,g,F==="capture"),h[F][k]=void 0)}return{on:v,off:B}}const{on:Bt,off:it}=My(),Vi="@@mmoContext",Ay={mounted(e,{value:t}){e[Vi]={handler:void 0},typeof t=="function"&&(e[Vi].handler=t,Bt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Vi];typeof t=="function"?n.handler?n.handler!==t&&(it("mousemoveoutside",e,n.handler),n.handler=t,Bt("mousemoveoutside",e,t)):(e[Vi].handler=t,Bt("mousemoveoutside",e,t)):n.handler&&(it("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Vi];t&&it("mousemoveoutside",e,t),e[Vi].handler=void 0}},Ii="@@coContext",ls={mounted(e,{value:t,modifiers:n}){e[Ii]={handler:void 0},typeof t=="function"&&(e[Ii].handler=t,Bt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Ii];typeof t=="function"?r.handler?r.handler!==t&&(it("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,Bt("clickoutside",e,t,{capture:n.capture})):(e[Ii].handler=t,Bt("clickoutside",e,t,{capture:n.capture})):r.handler&&(it("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Ii];n&&it("clickoutside",e,n,{capture:t.capture}),e[Ii].handler=void 0}};function Vy(e,t){console.error(`[vdirs/${e}]: ${t}`)}class Iy{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&&Vy("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const vo=new Iy,Oi="@@ziContext",Zc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Oi]={enabled:!!s,initialized:!1},s&&(vo.ensureZIndex(e,r),e[Oi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Oi].enabled;s&&!o&&(vo.ensureZIndex(e,r),e[Oi].initialized=!0),e[Oi].enabled=!!s},unmounted(e,t){if(!e[Oi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;vo.unregister(e,r)}};function Oy(e){const t=i.ref(!!e.value);if(t.value)return i.readonly(t);const n=i.watch(e,r=>{r&&(t.value=!0,n())});return i.readonly(t)}function jt(e){const t=i.computed(e),n=i.ref(t.value);return i.watch(t,r=>{n.value=r}),typeof e=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){e.set(r)}}}const zy=typeof window<"u";let zi,hr;(()=>{var e,t;zi=zy?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,hr=!1,zi!==void 0?zi.then(()=>{hr=!0}):hr=!0})();function Ly(e){if(hr)return;let t=!1;i.onMounted(()=>{hr||zi==null||zi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function ko(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function cs(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function Jc(e,t){return i.computed(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}const Dy=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Hy(){return Dy}function xo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function Co(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Co(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Co(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Qc(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=Co(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let On=null;function ed(){if(On===null&&(On=document.getElementById("v-binder-view-measurer"),On===null)){On=document.createElement("div"),On.id="v-binder-view-measurer";const{style:e}=On;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(On)}return On.getBoundingClientRect()}function Wy(e,t){const n=ed();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function So(e){const t=e.getBoundingClientRect(),n=ed();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function jy(e){return e.nodeType===9?null:e.parentNode}function td(e){if(e===null)return null;const t=jy(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:r,overflowY:s}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+s+r))return t}return td(t)}const nd=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;i.provide("VBinder",(t=i.getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=y=>{r.value=y,n&&e.syncTargetWithParent&&n.setTargetRef(y)};let o=[];const a=()=>{let y=r.value;for(;y=td(y),y!==null;)o.push(y);for(const b of o)Bt("scroll",b,f,!0)},l=()=>{for(const y of o)it("scroll",y,f,!0);o=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},h=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},f=()=>{Lc(p)},p=()=>{c.forEach(y=>y())},u=new Set,g=y=>{u.size===0&&Bt("resize",window,_),u.has(y)||u.add(y)},m=y=>{u.has(y)&&u.delete(y),u.size===0&&it("resize",window,_)},_=()=>{u.forEach(y=>y())};return i.onBeforeUnmount(()=>{it("resize",window,_),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return xo("binder",this.$slots)}}),id=i.defineComponent({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=i.inject("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?i.withDirectives(Qc("follower",this.$slots),[[t]]):Qc("follower",this.$slots)}}),Xy="@css-render/vue3-ssr";function qy(e,t){return`<style cssr-id="${e}">
|
|
103
|
+
`}},Xr=Gn.Multiply,_m=[1,0,0,0,1,0,0,0,1],An=new tn(9),bm=ht.Utils,ql=new Q,Ys=new tn([0,0,1,0,0,1,0,1,1,0,1,1]),_e={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Le.document?Le.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Gn,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)_e.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,s=this._matrix.manual||this._flagMatrix;if((r||s)&&(this._renderer.matrix||(this._renderer.matrix=new tn(9)),this._matrix.toTransformArray(!0,An),Xr(An,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q),this._scale instanceof Q?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){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=ht.Utils.getRendererType(this._mask._renderer.type);_e[a].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let o;if(this._flagSubtractions)for(o=0;o<this.subtractions.length;o++)_e.group.removeChild(this.subtractions[o],e);for(o=0;o<this.children.length;o++){const a=this.children[o],l=ht.Utils.getRendererType(a._renderer.type);_e[l].render.call(a,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,s,o,a,l,c,d,h,u,p,f,g,m;const y=t._renderer.vertices,_=this.canvas,b=this.ctx,S=e.renderer.ratio,x=ql.copy(t._renderer.scale).multiply(S),v=t._stroke,B=t._linewidth,k=t._fill,E=t._renderer.opacity||t._opacity,P=t._cap,N=t._join,j=t._miter,X=t._closed,A=t.dashes,V=y.length,L=V-1;_.width=Math.max(Math.ceil(t._renderer.rect.width*x.x),1),_.height=Math.max(Math.ceil(t._renderer.rect.height*x.y),1);const J=t._renderer.rect.centroid,F=J.x,R=J.y;if(b.clearRect(0,0,_.width,_.height),k)if(typeof k=="string")b.fillStyle=k;else{const ge=ht.Utils.getRendererType(k._renderer.type);_e[ge].render.call(k,b,t),b.fillStyle=k._renderer.effect}if(v){if(typeof v=="string")b.strokeStyle=v;else{const ge=ht.Utils.getRendererType(v._renderer.type);_e[ge].render.call(v,b,t),b.strokeStyle=v._renderer.effect}B&&(b.lineWidth=B),j&&(b.miterLimit=j),N&&(b.lineJoin=N),!X&&P&&(b.lineCap=P)}typeof E=="number"&&(b.globalAlpha=E),A&&A.length>0&&(b.lineDashOffset=A.offset||0,b.setLineDash(A));let $,M,U,z,O,ee,pe,re;b.save(),b.scale(x.x,x.y),b.translate(F,R),b.beginPath();for(let ge=0;ge<y.length;ge++){const se=y[ge];switch(f=se.x,g=se.y,se.command){case ne.close:b.closePath();break;case ne.arc:M=se.rx,U=se.ry,z=se.xAxisRotation,O=se.largeArcFlag,ee=se.sweepFlag,n=X?Vt(ge-1,V):Math.max(ge-1,0),r=y[n],pe=r.x,re=r.y,bm.renderSvgArcCommand(b,pe,re,M,U,O,ee,z,f,g);break;case ne.curve:n=X?Vt(ge-1,V):Math.max(ge-1,0),r=y[n],d=r.controls&&r.controls.right||Q.zero,h=se.controls&&se.controls.left||Q.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),se._relative?(o=h.x+se.x,a=h.y+se.y):(o=h.x,a=h.y),b.bezierCurveTo(l,c,o,a,f,g),ge>=L&&X&&(s=$,u=se.controls&&se.controls.right||Q.zero,p=s.controls&&s.controls.left||Q.zero,se._relative?(l=u.x+se.x,c=u.y+se.y):(l=u.x,c=u.y),s._relative?(o=p.x+s.x,a=p.y+s.y):(o=p.x,a=p.y),f=s.x,g=s.y,b.bezierCurveTo(l,c,o,a,f,g));break;case ne.line:b.lineTo(f,g);break;case ne.move:$=se,b.moveTo(f,g);break}}X&&b.closePath(),_e.isHidden.test(k)||(m=k._renderer&&k._renderer.offset,m&&(b.save(),b.translate(-k._renderer.offset.x,-k._renderer.offset.y),b.scale(k._renderer.scale.x,k._renderer.scale.y)),b.fill(),m&&b.restore()),_e.isHidden.test(v)||(m=v._renderer&&v._renderer.offset,m&&(b.save(),b.translate(-v._renderer.offset.x,-v._renderer.offset.y),b.scale(v._renderer.scale.x,v._renderer.scale.y),b.lineWidth=B/v._renderer.scale.x),b.stroke(),m&&b.restore()),b.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,s=-1/0,o=1/0,a=-1/0,l,c;e.forEach(function(d){const h=d.x,u=d.y,p=d.controls;let f,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&&(_=p.left,b=p.right,!(!_||!b)&&(f=d._relative?_.x+h:_.x,g=d._relative?_.y+u:_.y,m=d._relative?b.x+h:b.x,y=d._relative?b.y+u:b.y,!(!f||!g||!m||!y)&&(o=Math.min(g,y,o),r=Math.min(f,m,r),s=Math.max(f,m,s),a=Math.max(g,y,a))))}),typeof t=="number"&&(o-=t,r-=t,s+=t,a+=t),l=s-r,c=a-o,n.top=o,n.left=r,n.right=s,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-o},render:function(e,t,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=ht.Utils.getRendererType(this._renderer.type),o=t[s],a=r._matrix.manual||r._flagMatrix,l=this._matrix.manual||this._flagMatrix,c=this._renderer.parent!==r,d=this._flagVertices||this._flagFill||this._fill instanceof Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||l||c){this._renderer.matrix||(this._renderer.matrix=new tn(9)),this._matrix.toTransformArray(!0,An),Xr(An,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let u,p;this._scale instanceof Q?(u=this._scale.x*r._renderer.scale.x,p=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,p=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=p<0?-p:p,c&&(this._renderer.parent=r)}if(this._mask){e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1);const u=ht.Utils.getRendererType(this._mask._renderer.type);_e[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,_e.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),_e.updateTexture.call(_e,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==o&&(e.useProgram(o),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,Ys,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),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),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 p=u;_e.isHidden.test(a)||(p+=l),r.width=Ya(p),r.height=r.width;const f=p/r.width,g=r.width/2,m=r.height/2;if(s.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")s.fillStyle=c;else{const y=ht.Utils.getRendererType(c._renderer.type);_e[y].render.call(c,s,t),s.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")s.strokeStyle=a;else{const y=ht.Utils.getRendererType(a._renderer.type);_e[y].render.call(a,s,t),s.strokeStyle=a._renderer.effect}l&&(s.lineWidth=l/f)}typeof d=="number"&&(s.globalAlpha=d),h&&h.length>0&&(s.lineDashOffset=h.offset||0,s.setLineDash(h)),s.save(),s.translate(g,m),s.scale(_e.precision,_e.precision),s.beginPath(),s.arc(0,0,u/f*.5,0,ct),s.restore(),closed&&s.closePath(),_e.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(s.save(),s.translate(-c._renderer.offset.x,-c._renderer.offset.y),s.scale(c._renderer.scale.x,c._renderer.scale.y)),s.fill(),n&&s.restore()),_e.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(s.save(),s.translate(-a._renderer.offset.x,-a._renderer.offset.y),s.scale(a._renderer.scale.x,a._renderer.scale.y),s.lineWidth=l/a._renderer.scale.x),s.stroke(),n&&s.restore())},render:function(e,t,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),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,p=this._renderer.vertices,f=this._renderer.collection.length,g=this._flagVertices,m=this._flagFill||this._fill instanceof Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||s._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||h||u){this._renderer.matrix||(this._renderer.matrix=new tn(9)),this._matrix.toTransformArray(!0,An),Xr(An,s._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let y,_;this._scale instanceof Q?(y=this._scale.x*s._renderer.scale.x,_=this._scale.y*s._renderer.scale.y):(y=this._scale*s._renderer.scale.x,_=this._scale*s._renderer.scale.y),this._renderer.scale.x=y<0?-y:y,this._renderer.scale.y=_<0?-_:_,u&&(this._renderer.parent=s)}if(g){const y=this._renderer.positionBuffer;y&&e.deleteBuffer(y),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(o.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(o.position),e.bufferData(e.ARRAY_BUFFER,p,e.STATIC_DRAW)}return m?(this._renderer.opacity=this._opacity*s._renderer.opacity,_e.updateTexture.call(_e,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(_e.isHidden.test(l)||(r+=c),r/=_e.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==o&&(e.useProgram(o),t.resolution.flagged||e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),t.current=o),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(o,"u_resolution"),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),e.uniform1f(o.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,f),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(e,t){const n=this.canvas,r=this.ctx,s=e.renderer.ratio,o=ql.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,p=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*o.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*o.y),1);const f=t._renderer.rect.centroid,g=f.x,m=f.y;let y,_,b,S,x,v,B,k,E,P,N;const j=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),j||(r.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=p,c)if(typeof c=="string")r.fillStyle=c;else{const X=ht.Utils.getRendererType(c._renderer.type);_e[X].render.call(c,r,t),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const X=ht.Utils.getRendererType(a._renderer.type);_e[X].render.call(a,r,t),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=l)}if(typeof d=="number"&&(r.globalAlpha=d),h&&h.length>0&&(r.lineDashOffset=h.offset||0,r.setLineDash(h)),r.save(),r.scale(o.x,o.y),r.translate(g,m),_e.isHidden.test(c)||(c._renderer&&c._renderer.offset?(v=c._renderer.scale.x,B=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(v,B),y=t._size/c._renderer.scale.y,_=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,y+"px/",_+"px",t._family].join(" "),b=c._renderer.offset.x/c._renderer.scale.x,S=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,b,S),r.restore()):r.fillText(t.value,0,0)),_e.isHidden.test(a)||(a._renderer&&a._renderer.offset?(v=a._renderer.scale.x,B=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(v,B),y=t._size/a._renderer.scale.y,_=t._leading/a._renderer.scale.y,r.font=[t._style,t._weight,y+"px/",_+"px",t._family].join(" "),b=a._renderer.offset.x/a._renderer.scale.x,S=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(t.value,b,S),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(u)){const X=r.measureText(t.value);switch(u){case"underline":E=X.actualBoundingBoxDescent,N=X.actualBoundingBoxDescent;break;case"strikethrough":E=0,N=0;break}k=-X.width/2,P=X.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,E),r.lineTo(P,N),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){const n=_e.ctx;n.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" "),n.textAlign="center",n.textBaseline=ht.Utils.baselines[e._baseline]||e._baseline;const r=n.measureText(e._value);let s=r.width,o=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!_e.isHidden.test(this._stroke)&&(s+=this._linewidth*2,o+=this._linewidth*2);const a=s/2,l=o/2;switch(_e.alignments[e._alignment]||e._alignment){case _e.alignments.left:e.direction==="ltr"?(t.left=0,t.right=s):(t.left=-s,t.right=0);break;case _e.alignments.right:e.direction==="ltr"?(t.left=-s,t.right=0):(t.left=0,t.right=s);break;default:t.left=-a,t.right=a}switch(e._baseline){case"bottom":t.top=-o,t.bottom=0;break;case"top":t.top=0,t.bottom=o;break;case"baseline":t.top=-l*1.5,t.bottom=l*.5;break;default:t.top=-l,t.bottom=l}t.width=s,t.height=o,t.centroid||(t.centroid={}),t.centroid.x=a,t.centroid.y=l},render:function(e,t,n){if(!this._visible||!this._opacity)return this;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,s=t[this._renderer.type],o=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ae&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ve&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Te&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ae&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ve&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Te&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(o||a||l){this._renderer.matrix||(this._renderer.matrix=new tn(9)),this._matrix.toTransformArray(!0,An),Xr(An,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let h,u;this._scale instanceof Q?(h=this._scale.x*r._renderer.scale.x,u=this._scale.y*r._renderer.scale.y):(h=this._scale*r._renderer.scale.x,u=this._scale*r._renderer.scale.y),this._renderer.scale.x=h<0?-h:h,this._renderer.scale.y=u<0?-u:u,l&&(this._renderer.parent=r)}if(this._mask){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=ht.Utils.getRendererType(this._mask._renderer.type);_e[h].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,_e.text.getBoundingClientRect(this,this._renderer.rect),_e.updateTexture.call(_e,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==s&&(e.useProgram(s),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(s.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(s.position),e.bufferData(e.ARRAY_BUFFER,Ys,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),G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,s=this.left._y,o=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=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 G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(e,t){if(!(!e.canvas.getContext("2d")||!t)){if(G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,s=this.center._y,o=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=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 G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext("2d"))return;G.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof Q||(this._renderer.offset=new Q),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof Q?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof Q||(this._renderer.scale=new Q);let r,s;this._scale instanceof Q?(r=this._scale.x,s=this._scale.y):(r=this._scale,s=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=s<0?-s:s}return G.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(e,t){const n=ht.Utils.getRendererType(t._renderer.type);if(this[n].updateCanvas.call(_e,e,t),this.canvas.width<=0||this.canvas.height<=0){t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture;return}t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR)},program:{create:function(e,t){let n,r,s;if(n=e.createProgram(),G.each(t,function(o){e.attachShader(n,o)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw s=e.getProgramInfoLog(n),e.deleteProgram(n),new Nt("unable to link program: "+s);return n}},extensions:{init:function(e){const t={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const s=n[r];t[s]=_e.extensions.get(e,s)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new Rr};_e.ctx=_e.canvas.getContext("2d");var Xl=class extends q{constructor(e){super();let t,n,r,s;if(this.domElement=e.domElement||document.createElement("canvas"),typeof e.offscreenElement<"u"&&(_e.canvas=e.offscreenElement,_e.ctx=_e.canvas.getContext("2d")),this.scene=new Ge,this.scene.parent=this,this._renderer={type:"renderer",matrix:new tn(_m),scale:1,opacity:1},this._flagMatrix=!0,e=G.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext("webgl",e)||this.domElement.getContext("experimental-webgl",e),!this.ctx)throw new Nt("unable to create a webgl context. Try using another renderer.");r=jt.create(t,jt.path.vertex,jt.types.vertex),s=jt.create(t,jt.path.fragment,jt.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=_e.program.create(t,[r,s]),this.programs.text=this.programs.path,t.extensions=_e.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.rect=t.getUniformLocation(n,"u_rect");const o=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,o),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,Ys,t.STATIC_DRAW),r=jt.create(t,jt.points.vertex,jt.types.vertex),s=jt.create(t,jt.points.fragment,jt.types.fragment),n=this.programs.points=_e.program.create(t,[r,s]),n.position=t.getAttribLocation(n,"a_position"),n.matrix=t.getUniformLocation(n,"u_matrix"),n.size=t.getUniformLocation(n,"u_size"),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,s;const o=this.ctx;return this.width=e,this.height=t,this.ratio=typeof n>"u"?Vs(o):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,G.isObject(this.domElement.style)&&G.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(q.Types.resize,e,t,n)}render(){const e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),_e.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};w(Xl,"Utils",_e);var wm=G.extend({Error:Nt,getRatio:Vs,read:Oe,xhr:zl},G,kt,Ha,Wa),ir=class{constructor(e){w(this,"_events",new q),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=G.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:ir.Types.svg,autostart:!1});if(G.each(t,function(n,r){/fullscreen/i.test(r)||/autostart/i.test(r)||(this[r]=n)},this),G.isElement(t.domElement)){const n=t.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+n)||(this.type=ir.Types[n])}this.renderer=new ir[this.type](this),this.setPlaying(t.autostart),this.frameCount=0,t.fullscreen?(this.fit=vm.bind(this),this.fit.domElement=window,this.fit.attached=!0,G.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),G.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),It.bind(this.fit.domElement,"resize",this.fit),this.fit()):t.fitted?(this.fit=km.bind(this),G.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(q.Types.resize,xm.bind(this)),this.scene=this.renderer.scene,ir.Instances.push(this),t.autostart&&rr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener.apply(this,arguments)}on(){return this._events.addEventListener.apply(this,arguments)}bind(){return this._events.addEventListener.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener.apply(this,arguments)}off(){return this._events.removeEventListener.apply(this,arguments)}unbind(){return this._events.removeEventListener.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent.apply(this,arguments)}trigger(){return this._events.dispatchEvent.apply(this,arguments)}listen(){return this._events.listen.apply(this,arguments)}ignore(){return this._events.ignore.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,rr.init(),this.trigger(q.Types.play)}pause(){return this.playing=!1,this.trigger(q.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=G.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(It.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const n=this.width,r=this.height,s=this.renderer;return(n!==s.width||r!==s.height)&&s.setSize(n,r,this.ratio),this.trigger(q.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(q.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 Lr(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,ne.move),new ve(n,r,void 0,void 0,void 0,void 0,ne.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,ne.line),new ve(n,r,void 0,void 0,void 0,void 0,ne.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,ne.line)],c=new xe(l,!1,!1,!0);return c.noFill(),c.cap="round",c.join="round",this.scene.add(c),c}makeRectangle(e,t,n,r){const s=new Fn(e,t,n,r);return this.scene.add(s),s}makeRoundedRectangle(e,t,n,r,s){const o=new tr(e,t,n,r,s);return this.scene.add(o),o}makeCircle(e,t,n,r){const s=new Qi(e,t,n,r);return this.scene.add(s),s}makeEllipse(e,t,n,r,s){const o=new er(e,t,n,r,s);return this.scene.add(o),o}makeStar(e,t,n,r,s){const o=new Ir(e,t,n,r,s);return this.scene.add(o),o}makeCurve(e){const t=arguments.length;if(!Array.isArray(e)){e=[];for(let o=0;o<t;o+=2){const a=arguments[o];if(typeof a!="number")break;const l=arguments[o+1];e.push(new ve(a,l))}}const n=arguments[t-1],r=new xe(e,!(typeof n=="boolean"&&n),!0),s=r.getBoundingClientRect();return r.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){const s=new Vr(e,t,n,r);return this.scene.add(s),s}makeArcSegment(e,t,n,r,s,o,a){const l=new Mr(e,t,n,r,s,o,a);return this.scene.add(l),l}makePoints(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let s=0;s<t;s+=2){const o=arguments[s];if(typeof o!="number")break;const a=arguments[s+1];n.push(new Q(o,a))}}const r=new Ar(n);return this.scene.add(r),r}makePath(e){const t=arguments.length;let n=e;if(!Array.isArray(e)){n=[];for(let a=0;a<t;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];n.push(new ve(l,c))}}const r=arguments[t-1],s=new xe(n,!(typeof r=="boolean"&&r)),o=s.getBoundingClientRect();return typeof o.top=="number"&&typeof o.left=="number"&&typeof o.right=="number"&&typeof o.bottom=="number"&&s.center().translation.set(o.left+o.width/2,o.top+o.height/2),this.scene.add(s),s}makeText(e,t,n,r){const s=new Ht(e,t,n,r);return this.add(s),s}makeLinearGradient(e,t,n,r){const s=Array.prototype.slice.call(arguments,4),o=new Ae(e,t,n,r,s);return this.add(o),o}makeRadialGradient(e,t,n){const r=Array.prototype.slice.call(arguments,3),s=new Ve(e,t,n,r);return this.add(s),s}makeSprite(e,t,n,r,s,o,a){const l=new Fr(e,t,n,r,s,o);return a&&l.play(),this.add(l),l}makeImageSequence(e,t,n,r,s){const o=new Dr(e,t,n,r);return s&&o.play(),this.add(o),o}makeTexture(e,t){return new Te(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const t=new 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 Oe))return null;const s=Oe[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(It.temp.innerHTML=l,s=0;s<It.temp.children.length;s++)r=It.temp.children[s],o=this.interpret(r,!1,!1),o!==null&&n.add(o);if(typeof t=="function"){const c=It.temp.children.length<=1?It.temp.children[0]:It.temp.children;t(n,c)}}).bind(this);return/\.svg$/i.test(e)?(zl(e,a),n):(a(e),n)}},he=ir;w(he,"NextFrameId",xt.NextFrameId),w(he,"Types",xt.Types),w(he,"Version",xt.Version),w(he,"PublishDate",xt.PublishDate),w(he,"Identifier",xt.Identifier),w(he,"Resolution",xt.Resolution),w(he,"AutoCalculateImportedMatrices",xt.AutoCalculateImportedMatrices),w(he,"Instances",xt.Instances),w(he,"uniqueId",xt.uniqueId),w(he,"Anchor",ve),w(he,"Collection",Nn),w(he,"Events",q),w(he,"Group",Ge),w(he,"Matrix",Gn),w(he,"Path",xe),w(he,"Registry",Rr),w(he,"Element",qn),w(he,"Shape",mn),w(he,"Text",Ht),w(he,"Vector",Q),w(he,"Gradient",Ye),w(he,"ImageSequence",Dr),w(he,"LinearGradient",Ae),w(he,"RadialGradient",Ve),w(he,"Sprite",Fr),w(he,"Stop",nn),w(he,"Texture",Te),w(he,"ArcSegment",Mr),w(he,"Circle",Qi),w(he,"Ellipse",er),w(he,"Line",Lr),w(he,"Points",Ar),w(he,"Polygon",Vr),w(he,"Rectangle",Fn),w(he,"RoundedRectangle",tr),w(he,"Star",Ir),w(he,"CanvasRenderer",ht),w(he,"SVGRenderer",jl),w(he,"WebGLRenderer",Xl),w(he,"Commands",ne),w(he,"Utils",wm);function vm(){const e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function km(){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 xm(e,t){this.width=e,this.height=t,this.trigger(q.Types.resize,e,t)}var rr=It.getRequestAnimationFrame();function Yl(){for(let e=0;e<he.Instances.length;e++){const t=he.Instances[e];t.playing&&t.update()}he.NextFrameId=rr(Yl)}rr.init=function(){Yl(),rr.init=function(){}};let sn;typeof window<"u"?sn=window:typeof global<"u"?sn=global:typeof self<"u"&&(sn=self);let Ul;const ni=Math.PI*2,it=Math.PI*.5;function Cm(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 Sm(e){Ul=e}function Bm(e,t){t=t&&t.identity()||new Ul;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 on(e,t,n){return n*(t-e)+e}function Ri(e,t){for(;e<0;)e+=t;return e%t}const Gl=sn.Float32Array||Array,Tm=Math.floor;function an(e){return Tm(e*1e6)/1e6}const fe={move:"M",line:"L",curve:"C",close:"Z"};class K{constructor(){C(this,"_events",{});C(this,"_bound",!1)}addEventListener(t,n){return(this._events[t]||(this._events[t]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(t,n){if(!this._events)return this;if(!t&&!n)return this._events={},this._bound=!1,this;const r=t?[t]:Object.keys(this._events);for(let s=0,o=r.length;s<o;s++){t=r[s];let a=this._events[t];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let h=a[c];h=h.handler?h.handler:h,n!==h&&l.push(h)}this._events[t]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(t){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[t];if(r)for(let s=0;s<r.length;s++)r[s].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(t,n,r){const s=this;t&&(o.obj=t,o.name=n,o.handler=r,t.on(n,o));function o(){r.apply(s,arguments)}return s}ignore(t,n,r){return t.off(n,r),this}}C(K,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),C(K,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Kl={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))}}},ot=class ot extends K{constructor(n=0,r=0){super();C(this,"_x",0);C(this,"_y",0);for(let s in Kl)Object.defineProperty(this,s,Kl[s]);this.x=n,this.y=r}static add(n,r){return new ot(n.x+r.x,n.y+r.y)}static sub(n,r){return new ot(n.x-r.x,n.y-r.y)}static subtract(n,r){return ot.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(ot.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 ot(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:an(this.x),y:an(this.y)}}rotate(n){const r=this.x,s=this.y,o=Math.cos(n),a=Math.sin(n);return this.x=r*o-s*a,this.y=r*a+s*o,this}};C(ot,"zero",new ot),C(ot,"left",new ot(-1,0)),C(ot,"right",new ot(1,0)),C(ot,"up",new ot(0,-1)),C(ot,"down",new ot(0,1));let we=ot;class Ee extends we{constructor(n=0,r=0,s=0,o=0,a=0,l=0,c=fe.move){super(n,r);C(this,"controls",{left:new we,right:new we});C(this,"_command",fe.move);C(this,"_relative",!0);C(this,"_rx",0);C(this,"_ry",0);C(this,"_xAxisRotation",0);C(this,"_largeArcFlag",0);C(this,"_sweepFlag",1);for(let h in Zl)Object.defineProperty(this,h,Zl[h]);this.command=c,this.relative=!0;const d=Ee.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 Ee().copy(n)}copy(n){return this.x=n.x,this.y=n.y,typeof n.command=="string"&&(this.command=n.command),n.controls&&(n.controls.left&&this.controls.left.copy(n.controls.left),n.controls.right&&this.controls.right.copy(n.controls.right)),typeof n.relative=="boolean"&&(this.relative=n.relative),typeof n.rx=="number"&&(this.rx=n.rx),typeof n.ry=="number"&&(this.ry=n.ry),typeof n.xAxisRotation=="number"&&(this.xAxisRotation=n.xAxisRotation),typeof n.largeArcFlag=="number"&&(this.largeArcFlag=n.largeArcFlag),typeof n.sweepFlag=="number"&&(this.sweepFlag=n.sweepFlag),this}clone(){return new Ee().copy(this)}toObject(){return{x:an(this.x),y:an(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:an(this.rx),ry:an(this.ry),xAxisRotation:an(this.xAxisRotation),largeArcFlag:an(this.largeArcFlag),sweepFlag:an(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Zl={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 Em=0;const Us={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Em++}},Yr={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 Ur(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 Jl(e,t,n,r,s,o,a,l,c){c=c||Yr.RecursionLimit;const d=c+1;if(Math.abs(e-a)<.001&&Math.abs(t-l)<.001)return[new Ee(a,l)];const h=[];for(let u=0;u<d;u++){const p=u/d,f=Ur(p,e,n,s,a),g=Ur(p,t,r,o,l);h.push(new Ee(f,g))}return h}function Rm(e,t,n,r,s,o,a,l,c){if(e===n&&t===r&&s===a&&o===l){const y=a-e,_=l-t;return Math.sqrt(y*y+_*_)}const d=9*(n-s)+3*(a-e),h=6*(e+s)-12*n,u=3*(n-e),p=9*(r-o)+3*(l-t),f=6*(t+o)-12*r,g=3*(r-t);function m(y){const _=(d*y+h)*y+u,b=(p*y+f)*y+g;return Math.sqrt(_*_+b*b)}return Nm(m,0,1,c||Yr.RecursionLimit)}function $m(e,t,n,r,s,o,a,l){const c=[],d=[[],[]];let h,u,p,f,g,m,y,_;for(let v=0;v<2;++v){if(v==0?(u=6*e-12*n+6*s,h=-3*e+9*n-9*s+3*a,p=3*n-3*e):(u=6*t-12*r+6*o,h=-3*t+9*r-9*o+3*l,p=3*r-3*t),Math.abs(h)<1e-12){if(Math.abs(u)<1e-12)continue;f=-p/u,0<f&&f<1&&c.push(f);continue}y=u*u-4*p*h,_=Math.sqrt(y),!(y<0)&&(g=(-u+_)/(2*h),0<g&&g<1&&c.push(g),m=(-u-_)/(2*h),0<m&&m<1&&c.push(m))}let b=c.length,S=b,x;for(;b--;)f=c[b],x=1-f,d[0][b]=x*x*x*e+3*x*x*f*n+3*x*f*f*s+f*f*f*a,d[1][b]=x*x*x*t+3*x*x*f*r+3*x*f*f*o+f*f*f*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 Nm(e,t,n,r){let s=Yr.abscissas[r-2],o=Yr.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 Pm(e,t){const n=e.length,r=n-1;for(let s=0;s<n;s++){const o=e[s],a=t?Ri(s-1,n):Math.max(s-1,0),l=t?Ri(s+1,n):Math.min(s+1,r),c=e[a],d=o,h=e[l];Fm(c,d,h),d.command=s===0?fe.move:fe.curve}}function Fm(e,t,n){const r=we.angleBetween(e,t),s=we.angleBetween(n,t);let o=we.distanceBetween(e,t),a=we.distanceBetween(n,t),l=(r+s)/2;return o<1e-4||a<1e-4?(typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(o*=.33,a*=.33,s<r?l+=it:l-=it,t.controls.left.x=Math.cos(l)*o,t.controls.left.y=Math.sin(l)*o,l-=Math.PI,t.controls.right.x=Math.cos(l)*a,t.controls.right.y=Math.sin(l)*a,typeof t.relative=="boolean"&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}let sr=(_i=class extends K{constructor(){super();C(this,"_flagId",!1);C(this,"_flagClassName",!1);C(this,"_renderer",{});C(this,"_id",Us.Identifier+Us.uniqueId());C(this,"_className","");C(this,"classList",[]);for(let n in Ql)Object.defineProperty(this,n,Ql[n])}static fromObject(n){const r=new _i().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return this.renderer.type=n.renderer.type,this.className=n.className,this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}},C(_i,"Properties",["renderer","id","className"]),_i);const Ql={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 Gr extends Error{constructor(n){super();C(this,"name","Two.js");C(this,"message");this.message=n}}class Mm{constructor(){C(this,"map",{})}add(t,n){return this.map[t]=n,this}remove(t){return delete this.map[t],this}get(t){return this.map[t]}contains(t){return t in this.map}}let Kr;const ec={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};sn.document&&(Kr=document.createElement("a"));const De=class De extends sr{constructor(n,r){super();C(this,"_flagSrc",!1);C(this,"_flagImage",!1);C(this,"_flagVideo",!1);C(this,"_flagLoaded",!1);C(this,"_flagRepeat",!1);C(this,"_flagOffset",!1);C(this,"_flagScale",!1);C(this,"_src","");C(this,"_image",null);C(this,"_loaded",!1);C(this,"_repeat","no-repeat");C(this,"_scale",1);C(this,"_offset",null);for(let s in tc)Object.defineProperty(this,s,tc[s]);if(this._renderer.type="texture",this._renderer.flagOffset=Am.bind(this),this._renderer.flagScale=Vm.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 De().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return Kr?(Kr.href=n,Kr.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=De.getAbsoluteURL(n);if(De.ImageRegistry.contains(r))return De.ImageRegistry.get(r);let s;return sn.document?ec.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=De.getTag(s);n._flagImage&&(/canvas/i.test(o)?De.Register.canvas(n,r):(n._src=s.getAttribute("two-src")||s.src,De.Register[o](n,r))),n._flagSrc&&(s||(s=De.getImage(n.src),n.image=s),o=De.getTag(s),De.Register[o](n,r))}clone(){const n=new De(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,De.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}};C(De,"Properties",["src","loaded","repeat","scale","offset","image"]),C(De,"RegularExpressions",ec),C(De,"ImageRegistry",new Mm),C(De,"Register",{canvas:function(n,r){n._src="#"+n.id,De.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 Gr("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=De.getAbsoluteURL(n._src),!(s&&s.getAttribute("two-src"))&&(s.setAttribute("two-src",n.src),De.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 Gr("unable to load "+n.src)};n._src=De.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),De.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?s():(n.image.addEventListener("canplaythrough",s,!1),n.image.addEventListener("error",o,!1),n.image.src=n.src,n.image.load())}});let rt=De;const tc={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){const t=rt.getTag(e);let n;switch(t){case"canvas":n="#"+e.id;break;default:n=e.src}rt.ImageRegistry.contains(n)?this._image=rt.ImageRegistry.get(e.src):this._image=e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(K.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(K.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof we&&this._scale.unbind(K.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof we&&this._scale.bind(K.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Am(){this._flagOffset=!0}function Vm(){this._flagScale=!0}class $i extends Array{constructor(){super();pa(this,at,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 Rt(this,at)}set _events(n){jh(this,at,n)}get _bound(){return Rt(this,at)._bound}set _bound(n){Rt(this,at)._bound=n}addEventListener(){return Rt(this,at).addEventListener.apply(this,arguments)}on(){return Rt(this,at).on.apply(this,arguments)}bind(){return Rt(this,at).bind.apply(this,arguments)}removeEventListener(){return Rt(this,at).removeEventListener.apply(this,arguments)}off(){return Rt(this,at).off.apply(this,arguments)}unbind(){return Rt(this,at).unbind.apply(this,arguments)}dispatchEvent(){return Rt(this,at).dispatchEvent.apply(this,arguments)}trigger(){return Rt(this,at).trigger.apply(this,arguments)}listen(){return Rt(this,at).listen.apply(this,arguments)}ignore(){return Rt(this,at).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}}at=new WeakMap;const nc=Array.prototype.slice;function Im(e){if(e==null)return!1;const t=e.length;return typeof t=="number"&&t>=0&&t<4294967296}const Me={isNaN:function(e){return typeof e=="number"&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){const t=typeof e;return t==="function"||t==="object"&&!!e},isFunction:function(e){return typeof e=="function"},extend:function(e){const t=nc.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=nc.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=!Im(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:sn.performance&&sn.performance.now?sn.performance:Date},Ft=class Ft extends sr{constructor(n,r,s){super();C(this,"_flagOffset",!0);C(this,"_flagOpacity",!0);C(this,"_flagColor",!0);C(this,"_offset",0);C(this,"_opacity",1);C(this,"_color","#fff");for(let o in ic)Object.defineProperty(this,o,ic[o]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Ft.Index<=0?0:1,this.opacity=typeof s=="number"?s:1,this.color=typeof r=="string"?r:Ft.Index<=0?"#fff":"#000",Ft.Index=(Ft.Index+1)%2}static fromObject(n){const r=new Ft().copy(n);return"id"in n&&(r.id=n.id),r}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;return Me.each(Ft.Properties,function(s){r[s]=this[s]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Me.each(Ft.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};C(Ft,"Index",0),C(Ft,"Properties",["offset","opacity","color"]);let ii=Ft;const ic={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 hn extends sr{constructor(n){super();C(this,"_flagStops",!1);C(this,"_flagSpread",!1);C(this,"_flagUnits",!1);C(this,"_spread","");C(this,"_units","");for(let r in rc)Object.defineProperty(this,r,rc[r]);this._renderer.type="gradient",this._renderer.flagStops=Om.bind(this),this._renderer.bindStops=zm.bind(this),this._renderer.unbindStops=Lm.bind(this),this.spread="pad",this.units="objectBoundingBox",n&&(this.stops=n)}static fromObject(n){let r=n.stops;r&&r.length>0&&(r=r.map(o=>o instanceof ii?o:new ii().copy(o)));const s=new hn().copy(n);return"id"in n&&(s.id=n.id),s}clone(n){const r=this.stops.map(o=>o.clone()),s=new hn(r);return Me.each(hn.Properties,o=>{s[o]=this[o]},this),n&&n.add(s),s}copy(n){super.copy.call(this,n);for(let r=0;r<hn.Properties.length;r++){const s=hn.Properties[r];s in n&&(this[s]=n[s])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Me.each(hn.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}};C(hn,"Stop",ii),C(hn,"Properties",["spread","stops","units"]);let et=hn;const rc={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 $i((e||[]).slice(0)),this._stops.bind(K.Types.insert,t).bind(K.Types.remove,n),t(this._stops)}}};function Om(){this._flagStops=!0}function zm(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Lm(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}const Dn=class Dn extends et{constructor(n,r,s,o,a){super(a);C(this,"_flagEndPoints",!1);C(this,"_left",null);C(this,"_right",null);for(let l in sc)Object.defineProperty(this,l,sc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Dm.bind(this),this.left=new we,this.right=new we,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof s=="number"&&(this.right.x=s),typeof o=="number"&&(this.right.y=o)}static fromObject(n){const r=new Dn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Dn.Properties.length;r++){const s=Dn.Properties[r];s in n&&(this[s]=n[s]instanceof we?n[s]:new we().copy(n[s]))}return this}clone(n){const r=this.stops.map(function(o){return o.clone()}),s=new Dn(this.left._x,this.left._y,this.right._x,this.right._y,r);return Me.each(et.Properties,function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return n.left=this.left.toObject(),n.right=this.right.toObject(),n}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(K.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};C(Dn,"Stop",ii),C(Dn,"Properties",["left","right"]);let Ct=Dn;const sc={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 Dm(){this._flagEndPoints=!0}const un=class un extends et{constructor(n,r,s,o,a,l){super(o);C(this,"_flagRadius",!1);C(this,"_flagCenter",!1);C(this,"_flagFocal",!1);C(this,"_radius",0);C(this,"_center",null);C(this,"_focal",null);for(let c in oc)Object.defineProperty(this,c,oc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Hm.bind(this),this._renderer.flagFocal=Wm.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 un().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<un.Properties.length;r++){const s=un.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 un(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Me.each(et.Properties.concat(un.Properties),function(o){s[o]=this[o]},this),n&&n.add(s),s}toObject(){const n=super.toObject.call(this);return Me.each(un.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}};C(un,"Stop",ii),C(un,"Properties",["center","radius","focal"]);let St=un;const oc={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 Hm(){this._flagCenter=!0}function Wm(){this._flagFocal=!0}function ac(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 Zr(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 lc(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Rm(r,l,s,c,o,d,a,h,n)}function cc(e,t,n){let r,s,o,a,l,c,d,h;const u=t.controls&&t.controls.right,p=e.controls&&e.controls.left;return r=t.x,l=t.y,s=(u||t).x,c=(u||t).y,o=(p||e).x,d=(p||e).y,a=e.x,h=e.y,u&&t._relative&&(s+=t.x,c+=t.y),p&&e._relative&&(o+=e.x,d+=e.y),Jl(r,l,s,c,o,d,a,h,n)}function ri(e){switch(e.renderer.type){case"texture":return rt.fromObject(e);case"gradient":return et.fromObject(e);case"linear-gradient":return Ct.fromObject(e);case"radial-gradient":return St.fromObject(e)}return e}const jm=Math.cos,qm=Math.sin,dc=Math.tan,Gs=[],Tt=class Tt extends K{constructor(n,r,s,o,a,l){super();C(this,"elements",new Gl(9));C(this,"manual",!1);let c=n;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(n,r,s){if(r.length<=3){const k=n;let E,P,N;const j=r[0]||0,X=r[1]||0,A=r[2]||0;return E=k[0]*j+k[1]*X+k[2]*A,P=k[3]*j+k[4]*X+k[5]*A,N=k[6]*j+k[7]*X+k[8]*A,[E,P,N]}const o=n[0],a=n[1],l=n[2],c=n[3],d=n[4],h=n[5],u=n[6],p=n[7],f=n[8],g=r[0],m=r[1],y=r[2],_=r[3],b=r[4],S=r[5],x=r[6],v=r[7],B=r[8];return s=s||new Gl(9),s[0]=o*g+a*_+l*x,s[1]=o*m+a*b+l*v,s[2]=o*y+a*S+l*B,s[3]=c*g+d*_+h*x,s[4]=c*m+d*b+h*v,s[5]=c*y+d*S+h*B,s[6]=u*g+p*_+f*x,s[7]=u*m+p*b+f*v,s[8]=u*y+p*S+f*B,s}static fromObject(n){return new Tt().copy(n)}set(n,r,s,o,a,l,c,d,h){if(typeof r>"u"){const 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]=Tt.Identity[0],this.elements[1]=Tt.Identity[1],this.elements[2]=Tt.Identity[2],this.elements[3]=Tt.Identity[3],this.elements[4]=Tt.Identity[4],this.elements[5]=Tt.Identity[5],this.elements[6]=Tt.Identity[6],this.elements[7]=Tt.Identity[7],this.elements[8]=Tt.Identity[8],this.trigger(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,J=a[3]*n+a[4]*r+a[5]*s,F=a[6]*n+a[7]*r+a[8]*s;return[L,J,F]}const u=this.elements,p=[n,r,s,o,a,l,c,d,h],f=u[0],g=u[1],m=u[2],y=u[3],_=u[4],b=u[5],S=u[6],x=u[7],v=u[8],B=p[0],k=p[1],E=p[2],P=p[3],N=p[4],j=p[5],X=p[6],A=p[7],V=p[8];return this.elements[0]=f*B+g*P+m*X,this.elements[1]=f*k+g*N+m*A,this.elements[2]=f*E+g*j+m*V,this.elements[3]=y*B+_*P+b*X,this.elements[4]=y*k+_*N+b*A,this.elements[5]=y*E+_*j+b*V,this.elements[6]=S*B+x*P+v*X,this.elements[7]=S*k+x*N+v*A,this.elements[8]=S*E+x*j+v*V,this.trigger(K.Types.change)}inverse(n){const r=this.elements;n=n||new Tt;const s=r[0],o=r[1],a=r[2],l=r[3],c=r[4],d=r[5],h=r[6],u=r[7],p=r[8],f=p*c-d*u,g=-p*l+d*h,m=u*l-c*h;let y=s*f+o*g+a*m;return y?(y=1/y,n.elements[0]=f*y,n.elements[1]=(-p*o+a*u)*y,n.elements[2]=(d*o-a*c)*y,n.elements[3]=g*y,n.elements[4]=(p*s-a*h)*y,n.elements[5]=(-d*s+a*l)*y,n.elements[6]=m*y,n.elements[7]=(-u*s+o*h)*y,n.elements[8]=(c*s-o*l)*y,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=jm(n),s=qm(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=dc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=dc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Gs.length=0,this.toTransformArray(n,Gs),Gs.map(an).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 p=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=d,r[2]=p,r[3]=l,r[4]=h,r[5]=f,r[6]=c,r[7]=u,r[8]=g;return}return[a,d,p,l,h,f,c,u,g]}if(o){r[0]=a,r[1]=d,r[2]=l,r[3]=h,r[4]=c,r[5]=u;return}return[a,d,l,h,c,u]}toArray(n,r){const s=this.elements,o=!!r,a=s[0],l=s[1],c=s[2],d=s[3],h=s[4],u=s[5];if(n){const p=s[6],f=s[7],g=s[8];if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u,r[6]=p,r[7]=f,r[8]=g;return}return[a,l,c,d,h,u,p,f,g]}if(o){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=h,r[5]=u;return}return[a,l,c,d,h,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Tt().copy(this)}};C(Tt,"Identity",[1,0,0,0,1,0,0,0,1]);let or=Tt;Sm(or);const vr=class vr extends sr{constructor(){super();C(this,"_flagMatrix",!0);C(this,"_flagScale",!1);C(this,"_matrix",null);C(this,"_worldMatrix",null);C(this,"_position",null);C(this,"_rotation",0);C(this,"_scale",1);C(this,"_skewX",0);C(this,"_skewY",0);for(let n in Jr)Object.defineProperty(this,n,Jr[n]);this._renderer.flagMatrix=hc.bind(this),this.isShape=!0,this.matrix=new or,this.worldMatrix=new or,this.position=new we,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new vr().copy(n);return"id"in n&&(r.id=n.id),r}get renderer(){return this._renderer}set renderer(n){this._renderer=n}get translation(){return Jr.position.get.apply(this,arguments)}set translation(n){Jr.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof we?this.position=n.position:this.position.copy(n.position)),"rotation"in n&&(this.rotation=n.rotation),"scale"in n&&(this.scale=typeof n.scale=="number"||n.scale instanceof we?n.scale:new we(n.scale.x,n.scale.y)),"skewX"in n&&(this.skewX=n.skewX),"skewY"in n&&(this.skewY=n.skewY),"matrix"in n&&n.matrix.manual&&(this.matrix.copy(n.matrix),this.matrix.manual=!0),this}clone(n){const r=new vr;return r.position.copy(this.position),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer={type:"shape"},n.isShape=!0,n.translation=this.translation.toObject(),n.rotation=this.translation.rotation,n.scale=this.scale instanceof we?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}_update(n){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof we?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),n&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};C(vr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let yn=vr;const Jr={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),hc.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 Bm(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function hc(){this._flagMatrix=!0}const Ni=Math.min,Pi=Math.max,Xm=Math.ceil,Ym=Math.floor,Um=new we,Zt=class Zt extends yn{constructor(n,r,s,o){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagCap",!0);C(this,"_flagJoin",!0);C(this,"_flagMiter",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);for(let a in uc)Object.defineProperty(this,a,uc[a]);this._renderer.type="path",this._renderer.flagVertices=fc.bind(this),this._renderer.bindVertices=pc.bind(this),this._renderer.unbindVertices=gc.bind(this),this._renderer.flagFill=mc.bind(this),this._renderer.flagStroke=yc.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!s,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=n,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new Zt().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n),this.vertices=[];for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Ee?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Ee().copy(s))}for(let r=0;r<Zt.Properties.length;r++){const s=Zt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new Zt;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<Zt.Properties.length;s++){const o=Zt.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="path",n.vertices=this.vertices.map(r=>r.toObject()),Me.each(Zt.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,p=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,s=(this.linewidth||0)/2,o=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:f,scaleY:g}=Cm(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof f=="number"&&typeof g=="number"&&(s=Math.max(f,g)*(this.linewidth||0)/2)}else s*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(a=0;a<o;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+o-1)%o];const[f,g]=r.multiply(l.x,l.y),[m,y]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let _=l.controls.right.x,b=l.controls.right.y;l.relative&&(_+=l.x,b+=l.y);let[S,x]=r.multiply(_,b),v=c.controls.left.x,B=c.controls.left.y;c.relative&&(v+=c.x,B+=c.y);let[k,E]=r.multiply(v,B);const P=$m(f,g,S,x,k,E,m,y);u=Ni(P.min.y-s,u),d=Ni(P.min.x-s,d),h=Pi(P.max.x+s,h),p=Pi(P.max.y+s,p)}else a<=1&&(u=Ni(g-s,u),d=Ni(f-s,d),h=Pi(f+s,h),p=Pi(g+s,p)),u=Ni(y-s,u),d=Ni(m-s,d),h=Pi(m+s,h),p=Pi(y+s,p)}return{top:u,left:d,right:h,bottom:p,width:h-d,height:p-u}}getPointAt(n,r){let s,o,a,l,c,d,h,u,p,f,g,m,y,_,b,S=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,v=x-1;let B=null,k=null;for(let R=0,$=this._lengths.length,M=0;R<$;R++){if(M+this._lengths[R]>=S){this._closed?(s=Ri(R,x),o=Ri(R-1,x),R===0&&(s=o,o=R)):(s=R,o=Math.min(Math.max(R-1,0),v)),B=this.vertices[s],k=this.vertices[o],S-=M,this._lengths[R]!==0?n=S/this._lengths[R]:n=0;break}M+=this._lengths[R]}if(B===null||k===null)return null;if(B){if(!k)return B}else return k;b=k.controls&&k.controls.right,_=B.controls&&B.controls.left,c=k.x,f=k.y,d=(b||k).x,g=(b||k).y,h=(_||B).x,m=(_||B).y,u=B.x,y=B.y,b&&k.relative&&(d+=k.x,g+=k.y),_&&B.relative&&(h+=B.x,m+=B.y),l=Ur(n,c,d,h,u),p=Ur(n,f,g,m,y);const E=on(c,d,n),P=on(f,g,n),N=on(d,h,n),j=on(g,m,n),X=on(h,u,n),A=on(m,y,n),V=on(E,N,n),L=on(P,j,n),J=on(N,X,n),F=on(j,A,n);return Me.isObject(r)?(r.x=l,r.y=p,r instanceof Ee&&(r.controls.left.x=V,r.controls.left.y=L,r.controls.right.x=J,r.controls.right.y=F,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=p,r.controls.right.x-=l,r.controls.right.y-=p)),r.t=n,r):(a=new Ee(l,p,V-l,L-p,J-l,F-p,this._curved?fe.curve:fe.line),a.t=n,a)}plot(){if(this.curved)return Pm(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 Me.each(this.vertices,function(c,d){if(d<=0&&!s){o=c;return}if(c.command===fe.move){a.push(new Ee(o.x,o.y)),d>0&&(a[a.length-1].command=fe.line),o=c;return}l=cc(c,o,n),a=a.concat(l),Me.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=cc(c,o,n),a=a.concat(l),Me.each(l,function(h,u){u<=0&&o.command===fe.move?h.command=fe.move:h.command=fe.line})),a.push(new Ee(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=[]),Me.each(this.vertices,function(c,d){if(d<=0||c.command===fe.move){a=c,this._lengths[d]=0;return}this._lengths[d]=lc(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=Zr(this,s*this._length),l=Zr(this,o*this._length),c=Xm(a),d=Ym(l);let h,u,p,f,g,m;for(this._renderer.vertices.length=0,m=0;m<n;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new Ee),m>d&&!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,p=this._collection[m-1],p&&p.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),p.relative?this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(we.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(p.controls.right).lerp(p,1-g.t))):m>=c&&m<=d&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===d&&ac(this,o)?(u=g,!r&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===c&&ac(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),f=this._collection[m+1],f&&f.controls&&(g.controls.left.clear(),f.relative?this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(we.zero,g.t):(Um.copy(f),this._renderer.collection[m+1].controls.left.copy(f.controls.left).lerp(f,g.t))))}return yn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=!1,yn.prototype.flagReset.call(this),this}};C(Zt,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes"]),C(Zt,"Utils",{getCurveLength:lc});let Re=Zt;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}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof et||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof rt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof rt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof et||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof rt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof rt)&&this._stroke.bind(K.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=!!e,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;const t=this._automatic?"ignore":"listen";Me.each(this.vertices,function(n){n[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof $i?this._collection=e:this._collection=new $i(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,Me.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function fc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function pc(e){let t=e.length;for(;t--;)e[t].bind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function gc(e){let t=e.length;for(;t--;)e[t].unbind(K.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function mc(){this._flagFill=!0}function yc(){this._flagStroke=!0}const Gm=Math.ceil,Km=Math.floor,fn=class fn extends yn{constructor(n){super();C(this,"_flagVertices",!0);C(this,"_flagLength",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagSize",!0);C(this,"_flagSizeAttenuation",!0);C(this,"_length",0);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_size",1);C(this,"_sizeAttenuation",!1);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_dashes",null);C(this,"noFill",Re.prototype.noFill);C(this,"noStroke",Re.prototype.noStroke);C(this,"corner",Re.prototype.corner);C(this,"center",Re.prototype.center);C(this,"getBoundingClientRect",Re.prototype.getBoundingClientRect);C(this,"_updateLength",Re.prototype._updateLength);for(let r in _c)Object.defineProperty(this,r,_c[r]);this._renderer.type="points",this._renderer.flagVertices=fc.bind(this),this._renderer.bindVertices=pc.bind(this),this._renderer.unbindVertices=gc.bind(this),this._renderer.flagFill=mc.bind(this),this._renderer.flagStroke=yc.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new fn().copy({...n,fill:r,stroke:s});return"id"in n&&(o.id=n.id),o}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const s=n.vertices[r];s instanceof Ee?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Ee().copy(s))}for(let r=0;r<fn.Properties.length;r++){const s=fn.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new fn;for(let s=0;s<this.vertices.length;s++)r.vertices.push(this.vertices[s].clone());for(let s=0;s<fn.Properties.length;s++){const o=fn.Properties[s];r[o]=this[o]}return r.className=this.className,r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="points",n.vertices=this.vertices.map(r=>r.toObject()),Me.each(fn.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=Jl(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=Zr(this,n*this._length),o=Zr(this,r*this._length),a=Gm(s),l=Km(o);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let h=0;h<this._collection.length;h++)h>=a&&h<=l&&(d=this._collection[h],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};C(fn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes"]);let Qr=fn;const _c={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof et||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof rt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof rt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof et||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof rt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof rt)&&this._stroke.bind(K.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){const t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(K.Types.insert,t).unbind(K.Types.remove,n),e instanceof $i?this._collection=e:this._collection=new $i(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 bc extends $i{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);pa(this,Ss,{});this.attach(n),this.on(K.Types.insert,this.attach),this.on(K.Types.remove,this.detach)}get ids(){return Rt(this,Ss)}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}}Ss=new WeakMap;const kn=class kn extends Re{constructor(n,r,s,o,a,l,c){const d=c||Us.Resolution*3,h=[];for(let u=0;u<d;u++)h.push(new Ee);super(h,!0,!1,!0);C(this,"_flagStartAngle",!1);C(this,"_flagEndAngle",!1);C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_startAngle",0);C(this,"_endAngle",ni);C(this,"_innerRadius",0);C(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let u in wc)Object.defineProperty(this,u,wc[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 kn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,s=this._innerRadius,o=this._outerRadius,a=Ri(n,ni)===Ri(r,ni),l=s>0,c=this.vertices;let d=l?c.length/2:c.length,h,u=0,p,f,g,m,y,_,b,S,x;for(a?d--:l||(d-=2),p=0,f=d-1;p<d;p++){switch(g=p/f,m=c[u],y=g*(r-n)+n,_=(r-n)/d,b=o*Math.cos(y),S=o*Math.sin(y),p){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*_/Math.PI,m.controls.left.x=x*Math.cos(y-it),m.controls.left.y=x*Math.sin(y-it),m.controls.right.x=x*Math.cos(y+it),m.controls.right.y=x*Math.sin(y+it),p===1&&m.controls.left.multiplyScalar(2),p===f&&m.controls.right.multiplyScalar(2)),u++}if(l){for(a?(c[u].command=fe.close,u++):(d--,f=d-1),p=0;p<d;p++)g=p/f,m=c[u],y=(1-g)*(r-n)+n,_=(r-n)/d,b=s*Math.cos(y),S=s*Math.sin(y),h=fe.curve,p<=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*_/Math.PI,m.controls.left.x=x*Math.cos(y+it),m.controls.left.y=x*Math.sin(y+it),m.controls.right.x=x*Math.cos(y-it),m.controls.right.y=x*Math.sin(y-it),p===1&&m.controls.left.multiplyScalar(2),p===f&&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 kn(0,0,r,s,o,a,l);c.translation.copy(this.translation),c.rotation=this.rotation,c.scale=this.scale,c.skewX=this.skewX,c.skewY=this.skewY,this.matrix.manual&&c.matrix.copy(this.matrix);for(let d=0;d<Re.Properties.length;d++){const h=Re.Properties[d];c[h]=this[h]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<kn.Properties.length;r++){const s=kn.Properties[r];n[s]=this[s]}return n}};C(kn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ks=kn;const wc={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}}},Zs=Math.cos,Js=Math.sin,xn=class xn extends Re{constructor(n,r,s,o){const a=o?Math.max(o,2):4,l=[];for(let c=0;c<a;c++)l.push(new Ee(0,0,0,0,0,0));super(l,!0,!0,!0);C(this,"_flagRadius",!1);C(this,"_radius",0);this._renderer.type="circle";for(let c in vc)Object.defineProperty(this,c,vc[c]);typeof s=="number"&&(this.radius=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new xn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagRadius){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(n*2)),s=this._radius,o=s*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*ni,d=s*Zs(c),h=s*Js(c),u=o*Zs(c-it),p=o*Js(c-it),f=o*Zs(c+it),g=o*Js(c+it),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,p),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new xn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Re.Properties.length;s++){const o=Re.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<xn.Properties.length;r++){const s=xn.Properties[r];n[s]=this[s]}return n}};C(xn,"Properties",["radius"]);let Qs=xn;const vc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},eo=Math.cos,to=Math.sin,Cn=class Cn extends Re{constructor(n,r,s,o,a){typeof o!="number"&&typeof s=="number"&&(o=s);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Ee);super(c,!0,!0,!0);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_width",0);C(this,"_height",0);this._renderer.type="ellipse";for(let d in kc)Object.defineProperty(this,d,kc[d]);typeof s=="number"&&(this.width=s*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Cn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let n=this.vertices.length;!this._closed&&n>2&&(n-=1);const r=4/3*Math.tan(Math.PI/(this.vertices.length*2)),s=this._width/2,o=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*ni,d=s*eo(c),h=o*to(c),u=s*r*eo(c-it),p=o*r*to(c-it),f=s*r*eo(c+it),g=o*r*to(c+it),m=this.vertices[a];m.command=a===0?fe.move:fe.curve,m.set(d,h),m.controls.left.set(u,p),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=this.width/2,s=this.height/2,o=this.vertices.length,a=new Cn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const c=Re.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="ellipse";for(let r=0;r<Cn.Properties.length;r++){const s=Cn.Properties[r];n[s]=this[s]}return n}};C(Cn,"Properties",["width","height"]);let no=Cn;const kc={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Zm=Math.cos,Jm=Math.sin,Sn=class Sn extends Re{constructor(n,r,s,o){o=Math.max(o||0,3);super();C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagSides",!1);C(this,"_radius",0);C(this,"_width",0);C(this,"_height",0);C(this,"_sides",0);this._renderer.type="polygon";for(let a in xc)Object.defineProperty(this,a,xc[a]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.radius=s),typeof o=="number"&&(this.sides=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Sn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ni*a+Math.PI/2,c=this._width*Zm(l)/2,d=this._height*Jm(l)/2;o>=s?this.vertices.push(new Ee(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 Sn(0,0,0,this.sides);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,r.width=this.width,r.height=this.height,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Re.Properties.length;s++){const o=Re.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<Sn.Properties.length;r++){const s=Sn.Properties[r];n[s]=this[s]}return n}};C(Sn,"Properties",["width","height","sides"]);let io=Sn;const xc={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},bi=class bi extends Re{constructor(n,r,s,o){const a=[new Ee,new Ee,new Ee,new Ee];super(a,!0,!1,!0);C(this,"_flagWidth",0);C(this,"_flagHeight",0);C(this,"_width",0);C(this,"_height",0);C(this,"_origin",null);this._renderer.type="rectangle";for(let l in Cc)Object.defineProperty(this,l,Cc[l]);this.width=typeof s=="number"?s:1,this.height=typeof o=="number"?o:1,this.origin=new we,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new bi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<bi.Properties.length;r++){const s=bi.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const n=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Ee),this.vertices[0].set(-n,-r).sub(this._origin).command=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 bi(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let s=0;s<Re.Properties.length;s++){const o=Re.Properties[s];r[o]=this[o]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="rectangle",n.width=this.width,n.height=this.height,n.origin=this.origin.toObject(),n}};C(bi,"Properties",["width","height"]);let ro=bi;const Cc={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()}}},Bn=class Bn extends Re{constructor(n,r,s,o,a){typeof a>"u"&&typeof s=="number"&&typeof o=="number"&&(a=Math.floor(Math.min(s,o)/12));const l=[];for(let c=0;c<10;c++)l.push(new Ee(0,0,0,0,0,0,c===0?fe.move:fe.curve));super(l);C(this,"_flagWidth",!1);C(this,"_flagHeight",!1);C(this,"_flagRadius",!1);C(this,"_width",0);C(this,"_height",0);C(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in Sc)Object.defineProperty(this,c,Sc[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Qm.bind(this),typeof s=="number"&&(this.width=s),typeof o=="number"&&(this.height=o),typeof a=="number"&&(this.radius=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Bn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Bn.Properties.length;r++){const s=Bn.Properties[r];if(s in n){const o=n[s];/radius/i.test(s)?this[s]=typeof o=="number"||o instanceof we?o:new we().copy(o):typeof o=="number"&&(this[s]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let s,o;this._radius instanceof we?(s=this._radius.x,o=this._radius.y):(s=this._radius,o=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-s),a.y=-c,a=this.vertices[1],a.x=l-s,a.y=-c,a.controls.left.clear(),a.controls.right.x=s,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-o),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-o,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=o,a=this.vertices[4],a.x=l-s,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-s),a.y=c,a.controls.left.clear(),a.controls.right.x=-s,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-o,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-o),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-o,a=this.vertices[8],a.x=-(l-s),a.y=-c,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[9],a.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=this.width,s=this.height,o=this.radius,a=new Bn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const c=Re.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="rounded-rectangle";for(let r=0;r<Bn.Properties.length;r++){const s=Bn.Properties[r];n[s]=this[s]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};C(Bn,"Properties",["width","height","radius"]);let so=Bn;const Sc={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 Qm(){this._flagRadius=!0}const e0=Math.cos,t0=Math.sin,Tn=class Tn extends Re{constructor(n,r,s,o,a){arguments.length<=3&&(o=s,s=o/2),(typeof a!="number"||a<=0)&&(a=5);super();C(this,"_flagInnerRadius",!1);C(this,"_flagOuterRadius",!1);C(this,"_flagSides",!1);C(this,"_innerRadius",0);C(this,"_outerRadius",0);C(this,"_sides",0);this._renderer.type="star";for(let l in Bc)Object.defineProperty(this,l,Bc[l]);this.closed=!0,this.automatic=!1,typeof s=="number"&&(this.innerRadius=s),typeof o=="number"&&(this.outerRadius=o),typeof a=="number"&&(this.sides=a),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Tn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Tn.Properties.length;r++){const s=Tn.Properties[r];s in n&&typeof n[s]=="number"&&(this[s]=n[s])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let s=this.vertices.length;s>n&&(this.vertices.splice(n-1,s-n),s=n);for(let o=0;o<r;o++){const a=(o+.5)/n,l=ni*a,c=(o%2?this._outerRadius:this._innerRadius)/2,d=c*e0(l),h=c*t0(l);o>=s?this.vertices.push(new Ee(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 Tn(0,0,r,s,o);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let l=0;l<Re.Properties.length;l++){const c=Re.Properties[l];a[c]=this[c]}return n&&n.add(a),a}toObject(){const n=super.toObject.call(this);n.renderer.type="star";for(let r=0;r<Tn.Properties.length;r++){const s=Tn.Properties[r];n[s]=this[s]}return n}};C(Tn,"Properties",["innerRadius","outerRadius","sides"]);let oo=Tn;const Bc={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 ao;const Tc=Math.min,Ec=Math.max;sn.document&&(ao=document.createElement("canvas"));const mt=class mt extends yn{constructor(n,r,s,o){super();C(this,"_flagValue",!0);C(this,"_flagFamily",!0);C(this,"_flagSize",!0);C(this,"_flagLeading",!0);C(this,"_flagAlignment",!0);C(this,"_flagBaseline",!0);C(this,"_flagStyle",!0);C(this,"_flagWeight",!0);C(this,"_flagDecoration",!0);C(this,"_flagFill",!0);C(this,"_flagStroke",!0);C(this,"_flagLinewidth",!0);C(this,"_flagOpacity",!0);C(this,"_flagVisible",!0);C(this,"_flagMask",!1);C(this,"_flagClip",!1);C(this,"_flagDirection",!0);C(this,"_value","");C(this,"_family","sans-serif");C(this,"_size",13);C(this,"_leading",17);C(this,"_alignment","center");C(this,"_baseline","middle");C(this,"_style","normal");C(this,"_weight",500);C(this,"_decoration","none");C(this,"_direction","ltr");C(this,"_fill","#000");C(this,"_stroke","none");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_mask",null);C(this,"_clip",!1);C(this,"_dashes",null);for(let a in Rc)Object.defineProperty(this,a,Rc[a]);if(this._renderer.type="text",this._renderer.flagFill=n0.bind(this),this._renderer.flagStroke=i0.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof s=="number"&&(this.translation.y=s),this.dashes=[],this.dashes.offset=0,!Me.isObject(o))return this;for(let a=0;a<mt.Properties.length;a++){const l=mt.Properties[a];l in o&&(this[l]=o[l])}}static Measure(n){if(ao){const r=ao.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const s=r.measureText(n.value,0,0),o=s.actualBoundingBoxDescent+s.actualBoundingBoxAscent;return{width:s.width,height:o}}else{const r=this.value.length*this.size*mt.Ratio,s=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:s}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:ri(n.fill),s=typeof n.stroke=="string"?n.stroke:ri(n.stroke),o=new mt().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<mt.Properties.length;r++){const s=mt.Properties[r];s in n&&(this[s]=n[s])}return this}clone(n){const r=new mt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let s=0;s<mt.Properties.length;s++){const o=mt.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<mt.Properties.length;r++){const s=mt.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}=mt.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,p]=r.multiply(s,a),[f,g]=r.multiply(s,l),[m,y]=r.multiply(o,a),[_,b]=r.multiply(o,l);return a=Tc(p,g,y,b),s=Tc(u,f,m,_),o=Ec(u,f,m,_),l=Ec(p,g,y,b),{top:a,left:s,right:o,bottom:l,width:o-s,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};C(mt,"Ratio",.6),C(mt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes"]);let Fi=mt;const Rc={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof et||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof rt)&&this._fill.unbind(K.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof et||this._fill instanceof Ct||this._fill instanceof St||this._fill instanceof rt)&&this._fill.bind(K.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof et||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof rt)&&this._stroke.unbind(K.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof et||this._stroke instanceof Ct||this._stroke instanceof St||this._stroke instanceof rt)&&this._stroke.bind(K.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,Me.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!="number"&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}}};function n0(){this._flagFill=!0}function i0(){this._flagStroke=!0}const es=Math.min,ts=Math.max,En=class En extends yn{constructor(n){super();C(this,"_flagAdditions",!1);C(this,"_flagSubtractions",!1);C(this,"_flagOrder",!1);C(this,"_flagOpacity",!0);C(this,"_flagBeginning",!1);C(this,"_flagEnding",!1);C(this,"_flagLength",!1);C(this,"_flagMask",!1);C(this,"_fill","#fff");C(this,"_stroke","#000");C(this,"_linewidth",1);C(this,"_opacity",1);C(this,"_visible",!0);C(this,"_cap","round");C(this,"_join","round");C(this,"_miter",4);C(this,"_closed",!0);C(this,"_curved",!1);C(this,"_automatic",!0);C(this,"_beginning",0);C(this,"_ending",1);C(this,"_length",0);C(this,"_mask",null);for(let r in $c)Object.defineProperty(this,r,$c[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++)Nc.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Nc.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new En;for(let o=0;o<En.Properties.length;o++){const a=En.Properties[o];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:ri(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=s(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(s),r;function s(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return Ks.fromObject(o);case"circle":return Qs.fromObject(o);case"ellipse":return no.fromObject(o);case"points":return Qr.fromObject(o);case"polygon":return io.fromObject(o);case"rectangle":return ro.fromObject(o);case"rounded-rectangle":return so.fromObject(o);case"star":return oo.fromObject(o);case"path":return Re.fromObject(o);case"text":return Fi.fromObject(o);case"group":return En.fromObject(o);case"shape":return yn.fromObject(o);case"element":return sr.fromObject(o)}return o}}copy(n){return super.copy.call(this,n),console.warn("Two.Group.copy is not supported yet."),this}clone(n){const r=new En,s=this.children.map(function(o){return o.clone()});return r.add(s),r.opacity=this.opacity,this.mask&&(r.mask=this.mask),r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.className=this.className,this.matrix.manual&&r.matrix.copy(this.matrix),n&&n.add(r),r._update()}toObject(){const n=super.toObject.call(this);return n.renderer.type="group",n.children=[],n.opacity=this.opacity,n.className=this.className,n.mask=this.mask?this.mask.toObject():null,Me.each(this.children,(r,s)=>{n.children[s]=r.toObject()},this),n}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const s=this.children[r];s.translation.x-=n.left,s.translation.y-=n.top}return this.mask&&(this.mask.translation.x-=n.left,this.mask.translation.y-=n.top),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,s=n.top+n.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const a=this.children[o];a.isShape&&(a.translation.x-=r,a.translation.y-=s)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=s),this}getById(n){let r=null;function s(o){if(o.id===n)return o;if(o.children){if(o.children.ids[n])return o.children.ids[n];for(let a=0;a<o.children.length;a++)if(r=s(o.children[a]),r)return r}return null}return s(this)}getByClassName(n){const r=[];function s(o){if(Array.prototype.indexOf.call(o.classList,n)>=0&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}getByType(n){const r=[];function s(o){if(o instanceof n&&r.push(o),o.children)for(let a=0;a<o.children.length;a++){const l=o.children[a];s(l)}return r}return s(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const s=n[r];if(!(s&&s.id))continue;const o=Array.prototype.indexOf.call(this.children,s);o>=0&&this.children.splice(o,1),this.children.push(s)}return this}remove(n){const r=arguments.length,s=this.parent;if(r<=0&&s)return s.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let o=0;o<n.length;o++){const a=n[o];if(!a||!this.children.ids[a.id])continue;const l=this.children.indexOf(a);l>=0&&this.children.splice(l,1)}return this}getBoundingClientRect(n){let r,s,o,a,l,c;this._update(!0);let d=1/0,h=-1/0,u=1/0,p=-1/0;const f=/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||f.test(m._renderer.type))&&(r=m.getBoundingClientRect(n),o=typeof r.top!="number"||Me.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||Me.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||Me.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||Me.isNaN(r.bottom)||!isFinite(r.bottom),!(o||a||l||c)))if(n){const[y,_]=s.multiply(r.left,r.top),[b,S]=s.multiply(r.right,r.top),[x,v]=s.multiply(r.left,r.bottom),[B,k]=s.multiply(r.right,r.bottom);u=es(_,S,v,k,u),d=es(y,b,x,B,d),h=ts(y,b,x,B,h),p=ts(_,S,v,k,p)}else u=es(r.top,u),d=es(r.left,d),h=ts(r.right,h),p=ts(r.bottom,p)}return{top:u,left:d,right:h,bottom:p,width:h-d,height:p-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}};C(En,"Children",bc),C(En,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let _n=En;const $c={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){const t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){const n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){const t=_n.InsertChildren.bind(this),n=_n.RemoveChildren.bind(this),r=_n.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new bc(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,Me.isObject(e)&&!e.clip&&(e.clip=!0)}}};function Nc(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 ns extends Re{constructor(t,n,r,s){const o=[new Ee(t,n),new Ee(r,s)];super(o);for(let a in Pc)Object.defineProperty(this,a,Pc[a]);this.vertices[0].command=fe.move,this.vertices[1].command=fe.line,this.automatic=!1}}C(ns,"Properties",["left","right"]);const Pc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(Me.isObject(e))this.vertices.splice(0,1,e);else{const t=new Gr("Two.Line.x argument is not an object.");console.warn(t.name,t.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(Me.isObject(e))this.vertices.splice(1,1,e);else{const t=new Gr("Two.Line.y argument is not an object.");console.warn(t.name,t.message)}}}};class lo{constructor(t=0,n=0){this.x=t,this.y=n}}class si{constructor(t=10,n=0,r="A"){C(this,"start",new lo);C(this,"end",new lo);this.width=t,this.angle=n,this.label=r}}const Ie={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"}},r0={class:"flex gap-3"},s0={class:"kozyrek-preview w-fill h-[12.5rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},o0={ref:"drawing-container",class:"size-full"},a0={},Fc=i.defineComponent({...a0,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("drawing-container");let o=[],a=[],l=[],c=null;const d=.75,h=i.computed(()=>n.value.configuratorParams.linesAngles.map((F,R)=>new si(n.value.configuratorParams.linesWidths[R],F,`A-${R+1}`))),u=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),p=i.computed(()=>{var F,R;return n.value.configuratorParams.startTailType&&((F=n.settings.startTailConfigs)!=null&&F[n.value.configuratorParams.startTailType])?(R=n.settings.startTailConfigs)==null?void 0:R[n.value.configuratorParams.startTailType].points:[]}),f=i.computed(()=>{var F,R;return n.value.configuratorParams.endTailType&&((F=n.settings.endTailConfigs)!=null&&F[n.value.configuratorParams.endTailType])?(R=n.settings.endTailConfigs)==null?void 0:R[n.value.configuratorParams.endTailType].points:[]}),g=(F,R=!1)=>{F[0].start.x=0,F[0].start.y=0;let $=0;for(let M=0;M<F.length;M++){const U=F[M],z=F[M-1]??new si(0,$);$+=!R||M>1?z.angle:0;const O=(!R||M>0?U.angle:0)+$;if(F[M].end.x=U.width*Math.cos(O*Math.PI/180)+F[M].start.x,F[M].end.y=U.width*Math.sin(O*Math.PI/180)+F[M].start.y,M<F.length-1){const ee=M+1;F[ee].start.x=F[M].end.x,F[ee].start.y=F[M].end.y}}return F},m=(F,R,$,M,U=!1)=>{let z=g([...$,...M]);R.length>0&&(z=[...g(R),...z]);let O=0,ee=0,pe=0,re=0;z.forEach(Fe=>{O=Math.min(O,Fe.start.x,Fe.end.x),ee=Math.min(ee,Fe.start.y,Fe.end.y),pe=Math.max(pe,Fe.start.x,Fe.end.x),re=Math.max(re,Fe.start.y,Fe.end.y)});let ge,se;O===0&&ee===0&&pe===0&&re===0?(ge=1,se=1):(ge=F.width/Math.abs(pe-O),se=(U?F.height:F.height-Ie.colorSideLabel.size)/Math.abs(re-ee));const Pe=Math.min(ge,se);return O=O<0?-O*Pe:0,ee=ee<0?-ee*Pe:0,[Pe,O,ee]},y=F=>{const R=new Qr([F]);return R._size=Ie.anchorPoint.size,R.fill=Ie.anchorPoint.color,R.stroke="transparent",R._linewidth=Ie.anchorPoint.strokeSize,l.push(R),R},_=(F,R)=>{if(l=[],n.settings.allowChangeFirstPoint){const $=F[0],M=new we($.vertices[0].x,$.vertices[0].y);M.bind(K.Types.change,()=>{$.vertices[0].copy(M)});const U=y(M);R.add(U)}F.forEach(($,M)=>{const U=F[M+1],z=new we($.vertices[1].x,$.vertices[1].y);z.bind(K.Types.change,()=>{$.vertices[1].copy(z),U!==void 0&&U.vertices[0].copy(z)});const O=y(z);R.add(O)})},b=F=>F*(Math.PI/180),S=(F,R,$)=>{const M=R.vertices.length-1;F.position.x=R.vertices[M].x,F.position.y=R.vertices[M].y;const U=Math.atan2(R.vertices[M].y-R.vertices[0].y,R.vertices[M].x-R.vertices[0].x);F.rotation=b($)+U},x=(F,R,$)=>{if(R.vertices[0]===void 0)return;F.position.x=R.vertices[0].x,F.position.y=R.vertices[0].y;const M=R.vertices.length-1,U=Math.atan2(R.vertices[M].y-R.vertices[0].y,R.vertices[M].x-R.vertices[0].x);F.rotation=b($)+U},v=(F,R,$)=>{const M=new _n;if(F.length===0)return M;const U=[];return[...F].reverse().forEach((z,O)=>{O!==0&&z.angle>0&&(z.angle*=-1),U.push(z)}),F=g(U,!0),x(M,R,F[0].angle),[R.vertices[0],R.vertices[1]].forEach(z=>{z.bind(K.Types.change,()=>{x(M,R,F[0].angle)})}),F.forEach(z=>{const O=z.start.x*$,ee=z.end.x*$,pe=z.start.y*$,re=z.end.y*$,ge=new ns(O,pe,ee,re);ge.linewidth=Ie.line.size,ge.stroke=Ie.line.color,M.add(ge)}),M},B=(F,R,$)=>{const M=new _n;return F.length===0||(F=g(F,!0),S(M,R,F[0].angle),[R.vertices[0],R.vertices[1]].forEach(U=>{U.bind(K.Types.change,()=>{S(M,R,F[0].angle)})}),F.forEach(U=>{const z=U.start.x*$,O=U.end.x*$,ee=U.start.y*$,pe=U.end.y*$,re=new ns(z,ee,O,pe);re.linewidth=Ie.line.size,re.stroke=Ie.line.color,M.add(re)})),M},k=(F,R,$,M)=>{const U=R.vertices[0].x+(R.vertices[1].x-R.vertices[0].x)/2-8*Math.sin(F.angle*Math.PI/180),z=R.vertices[0].y+(R.vertices[1].y-R.vertices[0].y)/2-8*Math.cos(F.angle*Math.PI/180),O=new Fi(F.label,U+10,z-10);let ee;O.size=Ie.lineLabel.size,O.weight=600,O.fill=Ie.lineLabel.color,O.id+=1,O.rotation=Ie.lineLabel.rotation,M>0&&(ee=new Fi(`${F.angle}°`,R.vertices[0].x+25,R.vertices[0].y-25),ee.size=Ie.angleLabel.size,ee.weight=600,ee.fill=Ie.angleLabel.color,ee.rotation=Ie.angleLabel.rotation,ee.id+=M,o.push(ee),$.add(ee)),$.add(O),P(O,R,0,ee),P(O,R,1)},E=()=>{const{size:F}=Ie.colorSideLabel,R=0,$=0,M=u.value?F/2:F/2-F,U=u.value?F/2-F:F/2,z=new _n;if(!c)return z;const O=5,ee=Math.atan2(U-M,$-R),pe=[new Ee(R,M,0,0,0,0,he.Commands.move),new Ee($,U,0,0,0,0,he.Commands.line),new Ee($-O*Math.cos(ee-Math.PI/4),U-O*Math.sin(ee-Math.PI/4),0,0,0,0,he.Commands.line),new Ee($,U,0,0,0,0,he.Commands.move),new Ee($-O*Math.cos(ee+Math.PI/4),U-O*Math.sin(ee+Math.PI/4),0,0,0,0,he.Commands.line)],re=new Re(pe,!1,!1,!0);re.noFill(),re.cap="round",re.join="round",re.linewidth=F/7,re.stroke=Ie.colorSideLabel.color,z.add(re);const ge=new Fi(u.value?"Цвет снизу":"Цвет сверху",10,0);ge.size=F,ge.weight=600,ge.fill=Ie.colorSideLabel.color,ge.alignment="left",z.add(ge);const se=z.getBoundingClientRect();return z.position.x=(c.width-se.width)*d+10,z.position.y=u.value?c.height+se.height*2:se.height/2,z},P=(F,R,$,M)=>{R.vertices[$].bind(K.Types.change,()=>{const U=R.vertices.length-1,z=Math.atan2(R.vertices[0].y-R.vertices[U].y,R.vertices[0].x-R.vertices[U].x)*180/Math.PI,O=R.vertices[0].x+(R.vertices[U].x-R.vertices[0].x)/2-8*Math.sin(z*Math.PI/180),ee=R.vertices[0].y+(R.vertices[U].y-R.vertices[0].y)/2-8*Math.cos(z*Math.PI/180);F.position.x=O+10,F.position.y=ee-10,F.rotation=-.5,M&&(M.position.x=R.vertices[0].x+25,M.position.y=R.vertices[0].y-25)})},N=(F,R,$,M,U=!1)=>{var Ke;if(F.clear(),$.length===0){F.update();return}const z=g($),[O,ee,pe]=m(F,R,z,M,U),re=new _n,ge=new Array,se=new Array;U||(o=[],a=[]),z.forEach((ze,_t)=>{const Jt=ze.start.x*O+ee,Qt=ze.end.x*O+ee,Et=ze.start.y*O+pe,Mt=ze.end.y*O+pe,bt=new ns(Jt,Et,Qt,Mt);bt.linewidth=U?Ie.previewLine.size:Ie.line.size,bt.stroke=U?Ie.previewLine.color:Ie.line.color,a.push(bt),ge.push(bt),re.add(bt),!U&&ze.label!==""&&k(ze,bt,re,_t)});const Pe=ge.at(-1);let Fe=re.getBoundingClientRect();if(!U){const ze=E();se.push(ze)}if(R.length>0){const ze=v(R,ge[0],O);re.add(ze)}if(M.length>0&&Pe){const ze=B(M,Pe,O);re.add(ze)}if(se.push(re),F.makeGroup(se),Fe=re.getBoundingClientRect(),re.position.x=0-Fe.left+(F.width-Fe.width)/(2*(U?1:d)),re.position.y=0-Fe.top+(F.height-Fe.height)/(2*(U?1:d)),F.update(),!U){const ze=((Ke=n.value.configuratorParams)==null?void 0:Ke.colorSide)==="top";re.position.y=re.position.y+Ie.colorSideLabel.size*Number(ze),_(ge,re),F.update()}},j=(F,R)=>{if(F&&!R.isNewRec()){const $=new he({width:F.scrollWidth,height:F.scrollHeight});$.appendTo(F),N($,[],R.points,[],!0)}},X=()=>{c&&N(c,p.value,h.value,f.value,!1)},A=F=>F*(180/Math.PI),V=(F,R)=>{const $=F[1].x-F[0].x,M=F[1].y-F[0].y,U=R[1].x-R[0].x,z=R[1].y-R[0].y;let O=Math.atan2($*z-M*U,$*U+M*z);return O=A(O),Math.round(O)*-1},L=F=>{const R=a.map(($,M,U)=>{const z=U[M-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let O=Math.ceil($._length/F/n.settings.lineWidthStep)*n.settings.lineWidthStep;const ee=o[M-1];O<(U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(O=U.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),O>n.settings.maxLineWidth&&(O=n.settings.maxLineWidth);const pe=V($.vertices,z.vertices);return ee&&(ee.value=`${pe}°`),new si(O,pe,`A-${M+1}`)});r("pointer:move",R)},J=F=>{let R=null,$;const M=ee=>{R=l.find(pe=>{const re=pe.renderer;return(re==null?void 0:re.elem)===ee.target}),[$]=m(F,p.value,h.value.map(pe=>pe),f.value)},U=ee=>{if(R){const pe=R.renderer,re=pe==null?void 0:pe.elem;if(!re)return;const ge=re.getBoundingClientRect();R.vertices[0].x-=ge.x-(ee instanceof MouseEvent?ee.clientX:ee.targetTouches[0].clientX)+Ie.anchorPoint.size/2,R.vertices[0].y-=ge.y-(ee instanceof MouseEvent?ee.clientY:ee.targetTouches[0].clientY)+Ie.anchorPoint.size/2,L($),F.update()}},z=()=>{R&&r("pointer:up",h.value),R=null},O=s.value;O&&(O.addEventListener("touchstart",M),O.addEventListener("touchend",z),O.addEventListener("mousedown",M),O.addEventListener("mouseup",z),O.addEventListener("mousemove",U),O.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,()=>{X()},{deep:!0,immediate:!0}),J(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(F,R)=>(i.openBlock(),i.createElementBlock("div",r0,[i.createVNode(Fa,{"select-template-index":F.selectTemplateIndex,settings:F.settings,"onTemplate:select":R[0]||(R[0]=$=>r("template:select",$)),onInitDrawTemplate:j},null,8,["select-template-index","settings"]),i.createElementVNode("div",s0,[i.createElementVNode("div",o0,null,512)])]))}}),l0={class:"flex max-w-[50rem] flex-col gap-3"},c0={},d0=i.defineComponent({...c0,__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),p=(v=0)=>{const B=c.value.allTemplates.at(v);B!==void 0&&(u.value=v,l.value.configuratorParams.linesWidths=B.points.map(k=>D.isArray(k)?k[0]:k.width),l.value.configuratorParams.linesAngles=B.points.map(k=>D.isArray(k)?k[1]:k.angle),_()),m(l.value.configuratorParams)},f=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const B={label:v,points:l.value.configuratorParams.linesWidths.map((k,E)=>[k,l.value.configuratorParams.linesAngles[E]])};await Y.HttpRequester.getInstance(Y.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 v=>{_(),s.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,v,h.value).then(B=>{l.value.product=B}).catch(()=>{s.value=!1}),s.value=!1},y=async()=>{o.value=!0,await(l.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,l.value).then(v=>{r("submit-success",v)}).catch(()=>{o.value=!1})),o.value=!1},_=()=>{const v={quantity:h.value.quantity,marker:h.value.marker};l.value.configuratorParams.linesWidths.forEach((B,k)=>{v[`lines_widths[${k+1}]`]={},v[`lines_angles[${k+1}]`]={}}),h.value=v},b=v=>{d.value.linesWidths=v.map(B=>B.width),d.value.linesAngles=v.map(B=>B.angle)},S=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,_(),g(),m(l.value.configuratorParams)},x=(v,B)=>{d.value.linesWidths=v,d.value.linesAngles=B};return i.onBeforeMount(()=>{p()}),(v,B)=>(i.openBlock(),i.createElementBlock("div",l0,[i.createVNode(Fc,{value:l.value,"select-template-index":u.value,settings:c.value,"onPointer:up":S,"onPointer:move":b,"onTemplate:select":p},null,8,["value","select-template-index","settings"]),i.createVNode(Va,{value:l.value,"onUpdate:value":B[0]||(B[0]=k=>l.value=k),"preview-params":d.value,validation:h.value,settings:c.value,"is-submit-processing":o.value,"is-product-searching":s.value,"select-template-index":u.value,"onUpdate:params":B[1]||(B[1]=k=>m(k)),"onUpdate:preview":x,onSubmit:y,"onClick:saveTemplate":f},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])]))}});class Mi extends Y.Identity{constructor(n,r){super();C(this,"label","");C(this,"points",[]);C(this,"isCustom",!1);C(this,"id",-1);C(this,"guid","");n?(this.label=n.label,this.points=n.points.map((s,o)=>D.isArray(s)?new si(s[0],s[1],`A-${o+1}`):new si(s.width,s.angle,`A-${o+1}`))):(this.label="-- Новая конфигурация --",this.points=[new si(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class co extends Mi{constructor(n){super(n);C(this,"isDefault");this.isDefault=n.isDefault??!1}}class h0{constructor(t){C(this,"minLineWidth");C(this,"maxLineWidth");C(this,"lineWidthStep");C(this,"minLineAngle");C(this,"maxLineAngle");C(this,"lineAngleStep");C(this,"stripMinWidth");C(this,"stripMaxWidth");C(this,"stripMinLength");C(this,"stripMaxLength");C(this,"allowShowTable");C(this,"showOnlyTemplates");C(this,"templates");C(this,"customTemplates",[]);C(this,"startTailConfigs");C(this,"endTailConfigs");C(this,"bendCountForExtended");C(this,"extendedProductCatalog");C(this,"allowChangeFirstPoint");C(this,"allowSaveTemplates");C(this,"userTemplatesPrefix");C(this,"lengthStep");this.minLineWidth=t.minLineWidth,this.maxLineWidth=t.maxLineWidth,this.lineWidthStep=t.lineWidthStep,this.minLineAngle=t.minLineAngle,this.maxLineAngle=t.maxLineAngle,this.lineAngleStep=t.lineAngleStep,this.stripMinWidth=t.stripMinWidth,this.stripMaxWidth=t.stripMaxWidth,this.stripMinLength=t.stripMinLength,this.stripMaxLength=t.stripMaxLength,this.allowShowTable=t.allowShowTable,this.showOnlyTemplates=t.showOnlyTemplates,this.templates=t.templates.map(n=>new Mi(n)),this.templates.forEach((n,r)=>{n.id=r}),this.startTailConfigs=t.startTailConfigs.map(n=>new co(n)),this.endTailConfigs=t.endTailConfigs.map(n=>new co(n)),this.bendCountForExtended=t.bendCountForExtended,this.extendedProductCatalog=t.extendedProductCatalog,this.allowChangeFirstPoint=t.allowChangeFirstPoint,this.allowSaveTemplates=t.allowSaveTemplates,this.userTemplatesPrefix=t.userTemplatesPrefix,this.lengthStep=t.lengthStep,this.showOnlyTemplates||(this.customTemplates=t.customTemplates?Object.entries(t.customTemplates).map(([n,r])=>{const s=new Mi(r);return s.isCustom=!0,s.id=+n,s}):[],this.customTemplates.push(new Mi))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(t){var r,s;if(!this.allowSaveTemplates)return;const n=new Mi(t);n.isCustom=!0,n.id=(((r=this.customTemplates.at(-1))==null?void 0:r.id)??((s=this.templates.at(-1))==null?void 0:s.id)??0)+1,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(t){if(this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===t);n&&n!==-1&&this.customTemplates.splice(n,1)}}const u0={},Ai=i.defineComponent({...u0,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=D.debounce(()=>s("update:value",o.value),a.value),c=f=>{o.value=f,l()};i.watch(()=>r.value,f=>{o.value=f});const d=i.ref(null);return t({focus:()=>{var f;return(f=d.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blur()},select:()=>{var f;return(f=d.value)==null?void 0:f.select()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(I.NInputNumber),{ref_key:"inputReference",ref:d,value:o.value,"onUpdate:value":[g[0]||(g[0]=m=>o.value=m),c],clearable:f.clearable,placeholder:f.placeholder,min:f.min,max:f.max,step:f.step,validator:f.validator},{prefix:i.withCtx(()=>[i.renderSlot(f.$slots,"prefix")]),_:3},8,["value","clearable","placeholder","min","max","step","validator"]))}}),f0={class:"flex flex-col gap-3"},p0={},Mc=i.defineComponent({...p0,__name:"metal-for-doors-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","click:view-switch","submit"],setup(e,{emit:t}){const n=e,r=t,s=i.useTemplateRef("first-input-element"),o=i.ref(D.cloneDeep(i.toRaw(n.value.configuratorParams))),a=()=>{o.value.length>0&&o.value.width>0&&(r("update:params",o.value),l("configuratorParams",o.value))},l=(c,d)=>{const h=new Y.CartItemBase(n.value);h[c]=d,r("update:value",h)};return i.onMounted(()=>{n.value.isNewRec()&&i.nextTick(()=>{var c;(c=s.value)==null||c.focus()})}),(c,d)=>{const h=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{disabled:c.isSubmitProcessing,class:"flex flex-col gap-2"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:c.validation.width.feedback||"","show-feedback":c.validation.width.showFeedback||!1,"validation-status":c.validation.width.validationStatus||void 0,label:`Ширина, ${c.settings.minWidth?" от "+c.settings.minWidth:""}${c.settings.maxWidth?" до "+c.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(Ai,{ref:"first-input-element",value:o.value.width,"onUpdate:value":[d[0]||(d[0]=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(I.NFormItem),{required:!0,feedback:c.validation.length.feedback||"","show-feedback":c.validation.length.showFeedback||!1,"validation-status":c.validation.length.validationStatus||void 0,label:`Длина, ${c.settings.minLength?" от "+c.settings.minLength:""}${c.settings.maxLength?" до "+c.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.length,"onUpdate:value":[d[1]||(d[1]=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(I.NFormItem),{required:!0,feedback:c.validation.quantity.feedback||"","show-feedback":c.validation.quantity.showFeedback||!1,"validation-status":c.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:c.value.quantity,placeholder:"Введите количество",min:1,validator: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(I.NFormItem),{feedback:c.validation.marker.feedback||"","show-feedback":c.validation.marker.showFeedback||!1,"validation-status":c.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(h,{value:c.value.marker,placeholder:"Введите маркировку","onUpdate:value":d[3]||(d[3]=u=>l("marker",u))},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Ui,{"is-product-searching":c.isProductSearching,product:c.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",f0,[i.createVNode(i.unref(I.NButton),{disabled:c.value.product.isNewRec()||c.isProductSearching||c.isSubmitProcessing||c.value.length===0||c.value.width===0||c.value.quantity===0,type:"primary",class:"self-start",onClick:d[4]||(d[4]=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(I.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)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["disabled"])}}}),g0={class:"w-104 px-5"},m0={},y0=i.defineComponent({...m0,__name:"metal-for-doors-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItem),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.ref(!1),c=async h=>{a.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,h,o.value).then(u=>{s.value.product=u}).catch(()=>{a.value=!1}),a.value=!1},d=async()=>{l.value=!0,await(s.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,s.value).then(h=>{r("submit-success",h)}).catch(()=>{l.value=!1})),l.value=!1};return(h,u)=>(i.openBlock(),i.createElementBlock("div",g0,[i.createVNode(Mc,{value:s.value,"onUpdate:value":u[0]||(u[0]=p=>s.value=p),validation:o.value,settings:h.settings,"is-submit-processing":l.value,"onUpdate:params":u[1]||(u[1]=p=>c(p)),onSubmit:u[2]||(u[2]=p=>d())},null,8,["value","validation","settings","is-submit-processing"])]))}}),_0={key:0,class:"flex items-baseline gap-1"},b0={key:0,class:"flex items-baseline gap-1"},w0={class:"flex gap-3"},v0={},Ac=i.defineComponent({...v0,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>vt.isPhoneDevice()),o=i.ref(D.cloneDeep(i.toRaw(n.value.configuratorParams))),a=i.computed(()=>n.settings.widthOverlaps[o.value.mountType]??0),l=i.computed(()=>n.settings.heightOverlaps[o.value.mountType]??0),c=i.computed(()=>n.settings.maxWidths[o.value.netType]),d=i.computed(()=>n.settings.maxHeights[o.value.netType]-l.value),h=(p,f)=>{p&&p in o.value&&(o.value[p]=f??0),r("update:params",o.value),u("configuratorParams",o.value)},u=(p,f)=>{const g=new Y.CartItemBase(n.value);g[p]=f,r("update:value",g)};return(p,f)=>{const g=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"flex flex-col gap-2 px-4 md:max-w-96"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:o.value.netType,"onUpdate:value":[f[0]||(f[0]=m=>o.value.netType=m),h],options:p.settings.netType.map(m=>({label:p.settings.descriptions.net_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:o.value.color,"onUpdate:value":f[1]||(f[1]=m=>o.value.color=m),options:p.settings.color.map(m=>({label:p.settings.descriptions.color[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NSelect),{value:o.value.mountType,"onUpdate:value":[f[2]||(f[2]=m=>o.value.mountType=m),h],options:p.settings.mountType.map(m=>({label:p.settings.descriptions.mount_type[m],value:m}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:p.validation.width.feedback||"","show-feedback":p.validation.width.showFeedback||o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType],"validation-status":p.validation.width.validationStatus||void 0,label:`Ширина светового проёма от ${p.settings.minWidth-a.value} ${c.value?" до "+c.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.width.showFeedback&&o.value.width>=p.settings.minWidth&&o.value.width<=p.settings.maxWidths[o.value.netType]?(i.openBlock(),i.createElementBlock("div",_0,[i.createVNode(i.unref(I.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(o.value.width+a.value),1)]),_:1}),i.createVNode(i.unref(I.NButton),{quaternary:"",type:"info",size:"tiny",onClick:f[4]||(f[4]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...f[11]||(f[11]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.width&&o.value.width-a.value,max:c.value,min:p.settings.minWidth-a.value,placeholder:"Введите ширину светового проёма",class:"w-full","onUpdate:value":f[3]||(f[3]=m=>h("width",(m&&m+a.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:p.validation.height.feedback||"","show-feedback":p.validation.height.showFeedback||o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType],"validation-status":p.validation.height.validationStatus||void 0,label:`Высота светового проёма от ${p.settings.minHeight-l.value} ${d.value?" до "+d.value:""} мм.`},{feedback:i.withCtx(()=>[!p.validation.height.showFeedback&&o.value.height>=p.settings.minHeight&&o.value.height<=p.settings.maxHeights[o.value.netType]?(i.openBlock(),i.createElementBlock("div",b0,[i.createVNode(i.unref(I.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(o.value.height+l.value),1)]),_:1}),i.createVNode(i.unref(I.NButton),{quaternary:"",type:"info",size:"tiny",onClick:f[6]||(f[6]=m=>r("click:instructions-toggle"))},{default:i.withCtx(()=>[...f[12]||(f[12]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(Ai,{value:o.value.height&&o.value.height-l.value,max:d.value,min:p.settings.minHeight-l.value,placeholder:"Введите высоту светового проёма",class:"w-full","onUpdate:value":f[5]||(f[5]=m=>h("height",(m&&m+l.value)??void 0))},null,8,["value","max","min"])]),_:1},8,["feedback","show-feedback","validation-status","label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,feedback:p.validation.quantity.feedback||"","show-feedback":p.validation.quantity.showFeedback||!1,"validation-status":p.validation.quantity.validationStatus||void 0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:p.value.quantity,"onUpdate:value":f[7]||(f[7]=m=>p.value.quantity=m),min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full"},null,8,["value","validator"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(i.unref(I.NFormItem),{feedback:p.validation.marker.feedback||"","show-feedback":p.validation.marker.showFeedback||!1,"validation-status":p.validation.marker.validationStatus||void 0,label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(g,{value:p.value.marker,"onUpdate:value":f[8]||(f[8]=m=>p.value.marker=m),placeholder:"Введите маркировку"},null,8,["value"])]),_:1},8,["feedback","show-feedback","validation-status"]),i.createVNode(Ui,{"is-product-searching":p.isProductSearching,product:p.value.product},null,8,["is-product-searching","product"]),i.createElementVNode("div",w0,[i.createVNode(i.unref(I.NButton),{loading:p.isSubmitProcessing,disabled:p.isProductSearching||!p.value.product||p.value.product.isNewRec()||o.value.width<p.settings.minHeight-l.value||o.value.height<p.settings.minHeight-l.value,type:"primary",class:"self-start",onClick:f[9]||(f[9]=m=>r("submit",p.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(p.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(I.NButton),{key:0,type:"default",onClick:f[10]||(f[10]=m=>r("click:show-preview-drawer"))},{default:i.withCtx(()=>[...f[13]||(f[13]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1})}}}),k0="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",x0="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",C0="/img/configurators/mosquitto/measurement-instructions/mount.png",S0="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",B0="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",T0={class:"flex flex-col gap-6"},E0={class:"flex gap-4"},R0={class:"flex flex-col gap-2"},$0={class:"flex gap-4"},N0={class:"flex flex-col gap-2"},P0={class:"flex gap-4"},F0={class:"flex flex-col gap-2"},M0={},Vc=i.defineComponent({...M0,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(e,{emit:t}){const n=vt.initRefDependingOnDeviceResolution("small","small","medium"),r=vt.initRefDependingOnDeviceResolution(.98,.95,.8),s=i.computed(()=>window.innerWidth*r.value),o=t;return(a,l)=>{const c=I.NText;return i.openBlock(),i.createBlock(i.unref(I.NModal),{show:a.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${s.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>o("update:show",!1)),onEsc:l[1]||(l[1]=d=>o("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>o("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",T0,[i.createVNode(c,{type:"error",class:"text-base font-medium"},{default:i.withCtx(()=>[...l[3]||(l[3]=[i.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=i.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[i.createElementVNode("div",{class:"flex items-start gap-4"},[i.createElementVNode("img",{src:k0,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:x0,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",E0,[l[9]||(l[9]=i.createElementVNode("img",{src:C0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",R0,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(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(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",$0,[l[15]||(l[15]=i.createElementVNode("img",{src:S0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",N0,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(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 помощью шурупов. ",-1))])])]),i.createElementVNode("div",P0,[l[21]||(l[21]=i.createElementVNode("img",{src:B0,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",F0,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(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))])])])])]),_:1},8,["show","size","style"])}}}),A0={class:"flex flex-col items-center justify-between rounded-xl"},V0={class:"img-preview relative flex justify-center"},I0={},O0=i.defineComponent({...I0,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(e,{emit:t}){const n=e,r=i.computed(()=>D.keys(n.settings.crossbarCount).find(o=>n.settings.crossbarCount[Number(o)]&&(!n.settings.crossbarCount[Number(o)+1]||n.configuratorParams.height<n.settings.crossbarCount[Number(o)+1]-n.settings.heightOverlaps[n.configuratorParams.mountType]))),s=t;return(o,a)=>{const l=I.NButton;return i.openBlock(),i.createElementBlock("div",A0,[i.createElementVNode("div",V0,[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)])]),_:1})])}}}),ho=jn(O0,[["__scopeId","data-v-8b43aa68"]]),z0={class:"grid md:grid-cols-2"},L0={},D0=i.defineComponent({...L0,__name:"mosquito-configurator",props:{settings:{},cartItem:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>vt.isPhoneDevice()),o=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref({width:{},height:{},quantity:{},marker:{}}),d=i.ref(!1),h=i.ref(!1),u=async f=>{f.height>0&&f.width>0&&(d.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(n.cartItem.category,f,c.value).then(g=>{l.value.product=g}).catch(()=>{d.value=!1}),d.value=!1)},p=async()=>{h.value=!0,await(l.value.isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,l.value).then(f=>{r("submit-success",f)}).catch(()=>{h.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,l.value).then(f=>{r("submit-success",f)}).catch(()=>{h.value=!1})),h.value=!1};return(f,g)=>{const m=Er;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Vc,{show:a.value,"onUpdate:show":g[0]||(g[0]=y=>a.value=y),"height-overlaps":f.settings.heightOverlaps,"width-overlaps":f.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",z0,[s.value?(i.openBlock(),i.createBlock(i.unref(I.NDrawer),{key:1,show:o.value,"onUpdate:show":g[4]||(g[4]=y=>o.value=y),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(I.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:g[2]||(g[2]=y=>o.value=!1)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1})]),default:i.withCtx(()=>[i.createVNode(ho,{"configurator-params":l.value.configuratorParams,settings:f.settings,onOpenInstructions:g[3]||(g[3]=y=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(ho,{key:0,"configurator-params":l.value.configuratorParams,settings:f.settings,onOpenInstructions:g[1]||(g[1]=y=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(Ac,{value:l.value,"onUpdate:value":g[5]||(g[5]=y=>l.value=y),validation:c.value,settings:f.settings,"is-product-searching":d.value,"is-submit-processing":h.value,"onUpdate:params":g[6]||(g[6]=y=>u(y)),onSubmit:g[7]||(g[7]=y=>p()),"onClick:instructionsToggle":g[8]||(g[8]=y=>a.value=!a.value),"onClick:showPreviewDrawer":g[9]||(g[9]=y=>o.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),H0={},Ic=i.defineComponent({...H0,__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=Aa,p=Ma;return i.openBlock(),i.createBlock(i.unref(I.NFormItem),{label:`Полоса №${d.index+1}, мм`,required:!0},{feedback:i.withCtx(()=>[i.createVNode(Ui,{"is-product-searching":a.value,product:d.product},null,8,["is-product-searching","product"])]),default:i.withCtx(()=>[i.createVNode(i.unref(I.NDropdown),{trigger:"click",options:d.suggestionOption,placement:"bottom-start",size:"large",onSelect:l},{default:i.withCtx(()=>[i.createVNode(Ai,{ref:"width-input-element",value:d.value,class:"w-full",step:d.value<d.settings.minLineWidth?d.settings.minLineWidth-d.value:d.settings.lineWidthStep,validator:f=>!!f&&f>=d.settings.minLineWidth&&f%d.settings.lineWidthStep===0,placeholder:"Введите ширину","onUpdate:value":l},null,8,["value","step","validator"])]),_:1},8,["options"]),i.createVNode(i.unref(I.NButton),{disabled:d.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[0]||(h[0]=f=>s("click:add-line",d.index))},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"]),i.createVNode(i.unref(I.NButton),{disabled:d.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:h[1]||(h[1]=f=>s("click:remove-line",d.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["label"])}}}),W0={class:"my-2 flex w-full flex-col"},j0={class:"flex gap-3"},q0={},Oc=i.defineComponent({...q0,__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,p)=>{const f=n.value.at(u);if(f)if(h&&h>=n.settings.minLineWidth&&h%n.settings.lineWidthStep===0){const g={linesWidths:f.configuratorParams.linesWidths.toSpliced(u,1,h)};r("update:params",g,u,p),d("configuratorParams",g)}else f.product.id=-1},d=(h,u)=>{const p=n.value.map(f=>new Y.CartItemBase(f));p.forEach(f=>{f[h]=u}),r("update:value",p)};return(h,u)=>{const p=I.NText,f=I.NInput;return i.openBlock(),i.createBlock(i.unref(I.NForm),{class:"flex flex-col gap-2"},{default:i.withCtx(()=>{var g;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(h.value,(m,y)=>(i.openBlock(),i.createBlock(Ic,{key:y,"auto-focus":!0,index:y,value:m.configuratorParams.linesWidths.at(y)??0,product:m.product,settings:h.settings,"suggestion-option":l.value,"add-line-button-disabled":o.value<=0||h.value.length>=h.settings.maxLinesCount,"remove-line-button-disabled":h.value.length===1,"onUpdate:value":c,"onClick:addLine":u[0]||(u[0]=_=>r("click:add-line",_)),"onClick:removeLine":u[1]||(u[1]=_=>r("click:remove-line",_))},null,8,["index","value","product","settings","suggestion-option","add-line-button-disabled","remove-line-button-disabled"]))),128)),i.createElementVNode("div",W0,[o.value<0?(i.openBlock(),i.createBlock(p,{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(h.settings.width),1)]),_:1})):i.createCommentVNode("",!0),a.value&&h.value.length===h.settings.maxLinesCount&&o.value>0?(i.openBlock(),i.createBlock(p,{key:1,type:"error"},{default:i.withCtx(()=>[...u[8]||(u[8]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[u[9]||(u[9]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(p,{type:o.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(o.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(h.settings.width)+" мм ",1)])]),i.createVNode(i.unref(I.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value<=0||h.value.length>=h.settings.maxLinesCount,type:"primary",class:"self-center",onClick:u[2]||(u[2]=m=>r("click:add-line",h.value.length))},{default:i.withCtx(()=>[...u[10]||(u[10]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["loading","disabled"]),i.createVNode(i.unref(I.NFormItem),{required:!0,label:`Метраж ${h.settings.minLength?" от "+h.settings.minLength:""} ${h.settings.maxLength?" до "+h.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:n.value[0].length,max:h.settings.maxLength||void 0,min:h.settings.minLength,step:h.settings.lengthStep,validator:m=>m%h.settings.lengthStep===0,placeholder:"Введите метраж",class:"w-full","onUpdate:value":u[3]||(u[3]=m=>d("length",m??0))},null,8,["value","max","min","step","validator"])]),_:1},8,["label"]),i.createVNode(i.unref(I.NFormItem),{required:!0,label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(I.NInputNumber),{value:n.value[0].quantity,min:1,validator:m=>Number.isInteger(m),placeholder:"Введите количество",class:"w-full","onUpdate:value":u[4]||(u[4]=m=>d("quantity",m??0))},null,8,["value","validator"])]),_:1}),i.createVNode(i.unref(I.NFormItem),{label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(f,{value:n.value[0].marker,placeholder:"Введите маркировку","onUpdate:value":u[5]||(u[5]=m=>d("marker",m))},null,8,["value"])]),_:1}),i.createElementVNode("div",j0,[i.createVNode(i.unref(I.NButton),{loading:h.isSubmitProcessing,disabled:!a.value||o.value!=0||!((g=h.value[0])!=null&&g.length)||h.value[0].length>h.settings.maxLength||h.value[0].length<h.settings.minLength||h.value[0].quantity===0,type:"primary",class:"self-start",onClick: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(I.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)])]),_:1})):i.createCommentVNode("",!0)])]}),_:1})}}}),X0={class:"flex grow flex-col"},Y0=["src"],U0={class:"w-full"},G0={},zc=i.defineComponent({...G0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",X0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center",alt:"Штрипс"},null,8,Y0),i.createElementVNode("div",U0,[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)])]))}}),K0={class:"w-104 flex grow flex-col px-5"},Z0={},J0=i.defineComponent({...Z0,__name:"strip-configurator",props:{settings:{},cartItems:{},client:{}},emits:["submit-success"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.cartItems),o=i.ref({width:{},length:{},quantity:{},marker:{}}),a=i.ref(!1),l=i.computed(()=>s.value[0].configuratorParams.linesWidths.map(p=>p).reduce((p,f)=>p+f,0)),c=p=>{p===void 0&&(p=s.value.length-1);const f=s.value.at(0);if(!f)return;f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(p+1,0,0),s.value.forEach(m=>{m.configuratorParams.linesWidths=f.configuratorParams.linesWidths});const g=new Y.CartItemBase({quantity:(f==null?void 0:f.quantity)??1,category:f==null?void 0:f.category,length:(f==null?void 0:f.length)??n.settings.minLength,marker:f==null?void 0:f.marker,configuratorParams:{linesWidths:f==null?void 0:f.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,g)},d=p=>{const f=s.value.at(0);f&&(f.configuratorParams.linesWidths=f.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(g=>{g.configuratorParams.linesWidths=f.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete o[`linesWidths.${p}`],delete o[`linesWidths.${p}`])},h=async(p,f,g)=>{g.value=!0,await Y.HttpRequester.getInstance(Y.ConfiguratorProvider).searchProduct(s.value[f].category,{linesWidths:p.linesWidths.at(f)},o.value).then(m=>{s.value[f].product=m,s.value.length<n.settings.maxLinesCount&&l.value<n.settings.width&&c()}).catch(()=>{s.value[f].product=new Y.Product,g.value=!1}),g.value=!1},u=async()=>{a.value=!0,await(s.value[0].isNewRec()?Y.HttpRequester.getInstance(Y.CartProvider).addCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1}):Y.HttpRequester.getInstance(Y.CartProvider).patchCartItem(n.client,s.value[0]).then(p=>{r("submit-success",p)}).catch(()=>{a.value=!1})),a.value=!1};return(p,f)=>(i.openBlock(),i.createElementBlock("div",K0,[i.createVNode(zc,{value:s.value,"onUpdate:value":f[0]||(f[0]=g=>s.value=g),settings:p.settings},null,8,["value","settings"]),i.createVNode(Oc,{value:s.value,"onUpdate:value":f[1]||(f[1]=g=>s.value=g),validation:o.value,settings:p.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"])]))}}),Q0={class:"flex flex-wrap gap-2"},ey={class:"flex flex-col"},ty={class:"flex flex-col"},ny={},iy=i.defineComponent({...ny,__name:"date-range",props:{clearable:{type:Boolean,default:!0},dateRange:{default:void 0},dateFormat:{default:()=>Y.AppConfigProvider.getConfig().dateFormats.uiDate},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1}},emits:["update:date-range"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>{if(n.predefinedDateRanges)return n.predefinedDateRanges;if(n.useDefaultPredefinedDateRanges){const a={};return D.forOwn(Y.DateTimeProvider.defaultDateRanges(),(l,c)=>{a[c]={label:l.label,from:l.from??void 0,to:l.to??void 0}}),a}}),o=(a,l)=>{r("update:date-range",{from:a?$n.startOfDay(new Date(a)):void 0,to:l?$n.endOfDay(new Date(l)):void 0})};return(a,l)=>{var h,u,p,f,g,m;const c=I.NButton,d=I.NDatePicker;return i.openBlock(),i.createElementBlock("div",Q0,[i.createVNode(d,{value:((u=(h=a.dateRange)==null?void 0:h.from)==null?void 0:u.getTime())??null,clearable:a.clearable,"is-date-disabled":y=>{var _,b;return((_=a.dateRange)==null?void 0:_.to)&&y>((b=a.dateRange)==null?void 0:b.to)},disabled:(p=a.disabled)==null?void 0:p.from,format:a.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[0]||(l[0]=y=>{var _,b;return o(y,(b=(_=a.dateRange)==null?void 0:_.to)==null?void 0:b.getTime())})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",ey,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(y,_)=>(i.openBlock(),i.createBlock(c,{key:_,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:b=>{var S,x;return o((S=y==null?void 0:y.from)==null?void 0:S.getTime(),(x=y==null?void 0:y.to)==null?void 0:x.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"]),i.createVNode(d,{value:((g=(f=a.dateRange)==null?void 0:f.to)==null?void 0:g.getTime())??null,clearable:a.clearable,"is-date-disabled":y=>{var _,b;return((_=a.dateRange)==null?void 0:_.from)&&y<((b=a.dateRange)==null?void 0:b.from)},disabled:(m=a.disabled)==null?void 0:m.to,format:a.dateFormat,type:"date",class:"min-w-28 grow basis-[calc(50%-0.5rem)]",onUpdateValue:l[1]||(l[1]=y=>{var _,b;return o((b=(_=a.dateRange)==null?void 0:_.from)==null?void 0:b.getTime(),y)})},i.createSlots({_:2},[s.value?{name:"footer",fn:i.withCtx(()=>[i.createElementVNode("div",ty,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(s.value,(y,_)=>(i.openBlock(),i.createBlock(c,{key:_,class:"my-1 mr-2",size:"small",type:"info",ghost:"",onClick:b=>{var S,x;return o((S=y==null?void 0:y.from)==null?void 0:S.getTime(),(x=y==null?void 0:y.to)==null?void 0:x.getTime())}},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(y.label),1)]),_:2},1032,["onClick"]))),128))])]),key:"0"}:void 0]),1032,["value","clearable","is-date-disabled","disabled","format"])])}}}),ry={class:"sc-lbl-date text-nowrap"},sy={},uo=i.defineComponent({...sy,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>$n.format(t.date,Y.AppConfigProvider.getConfig().dateFormats.uiDate)),r=i.computed(()=>$n.format(t.date,"HH:mm"));return(s,o)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":s.isTimeOnSecondLine})},[i.createElementVNode("span",ry,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))}}),oy={class:"flex flex-row gap-2.5"},ay={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},ly={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},cy={class:"mb-0.5 sm:mb-0 sm:ml-3"},dy={},hy=i.defineComponent({...dy,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(e){return(t,n)=>{const r=Er,s=I.NButton,o=I.NPopover;return i.openBlock(),i.createElementBlock("div",oy,[i.createElementVNode("div",ay,[i.renderSlot(t.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",ly,[i.renderSlot(t.$slots,"extra-buttons"),i.createElementVNode("div",cy,[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)])])])])}}}),uy={key:0,class:"flex flex-row gap-2.5"},fy={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},py={},gy=i.defineComponent({...py,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.show),a=i.ref(r.processing),l=vt.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=vt.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>window.innerWidth*c.value),h=()=>{s("opening"),o.value=!0,s("update:show",o.value)},u=(f="other")=>{if(a.value){s("processing:cancel",_=>{a.value=_});return}let g=!1;s("closing",f,()=>{g=!0}),g||(o.value=!1,s("update:show",o.value))},p=()=>{s("accept",g=>{a.value=g})};return i.watch(()=>r.show,f=>{f?h():u("other")}),i.watch(()=>r.processing,f=>{a.value=f}),t({open:h,close:u}),(f,g)=>{const m=I.NButton,y=I.NModal;return i.openBlock(),i.createBlock(y,{loading:a.value,show:o.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:f.title,"action-class":f.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:g[1]||(g[1]=_=>u("header")),onEsc:g[2]||(g[2]=_=>u("esc")),onMaskClick:g[3]||(g[3]=_=>u("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(f.$slots,"default")]),_:2},[f.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),key:"0"}:void 0,f.$slots.action||f.$slots["extra-action"]||f.acceptButton.show||f.cancelButton.show?{name:"action",fn:i.withCtx(()=>[f.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",uy,[i.renderSlot(f.$slots,"extra-action")])):i.createCommentVNode("",!0),f.$slots.action||f.acceptButton.show||f.cancelButton.show?(i.openBlock(),i.createElementBlock("div",fy,[i.renderSlot(f.$slots,"action",{disabled:a.value}),f.acceptButton.show??!0?(i.openBlock(),i.createBlock(m,{key:0,disabled:a.value||!f.valid,size:i.unref(l),type:"primary",onClick:p},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),f.cancelButton.show??!0?(i.openBlock(),i.createBlock(m,{key:1,size:i.unref(l),type:"default",onClick:g[0]||(g[0]=_=>u("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(f.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","action-class"])}}}),my={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yy(e,t){return i.openBlock(),i.createElementBlock("svg",my,[...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 _y=i.markRaw({name:"ion-download-outline",render:yy}),by={},wy=i.defineComponent({...by,__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=_y,c=I.NUploadDragger,d=I.NUpload;return i.openBlock(),i.createBlock(d,{"default-upload":!1,max:1,action:"","directory-dnd":"",class:"content-center","onUpdate:fileList":s},{default:i.withCtx(()=>[i.createVNode(c,null,{default:i.withCtx(()=>[i.renderSlot(o.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(l,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(o.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3})}}}),vy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ky(e,t){return i.openBlock(),i.createElementBlock("svg",vy,[...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 xy=i.markRaw({name:"ion-checkmark-done-sharp",render:ky}),Cy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Sy(e,t){return i.openBlock(),i.createElementBlock("svg",Cy,[...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 By=i.markRaw({name:"ion-options-outline",render:Sy}),Ty={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Ey={class:"flex-auto"},Ry={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"},$y={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"},Ny={},fo=i.defineComponent({...Ny,__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=By,u=I.NButton,p=I.NPopover,f=xy,g=Er;return i.openBlock(),i.createElementBlock("div",Ty,[i.createElementVNode("div",Ey,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",Ry,[i.createElementVNode("div",$y,[c.showEditButton?(i.openBlock(),i.createBlock(p,{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))]),_:1})):i.createCommentVNode("",!0),c.showApplyButton?(i.openBlock(),i.createBlock(p,{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(f)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),c.showCancelButton?(i.openBlock(),i.createBlock(p,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(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))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),Py={},Lc=i.defineComponent({...Py,__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 i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{s.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[s.value?(i.openBlock(),i.createBlock(fo,{key:1,disabled:l.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:a},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-editor-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(i.openBlock(),i.createBlock(fo,{key:0,disabled:l.disabled,"show-edit-button":l.showEditButton,onEdit:c[0]||(c[0]=d=>s.value=!0)},{"extra-buttons":i.withCtx(()=>[i.renderSlot(l.$slots,"extra-viewer-buttons")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),Fy={},My=i.defineComponent({...Fy,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.value),o=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=D.debounce(()=>r("update:value",s.value),o.value),l=c=>{s.value=c,a()};return i.watch(()=>n.value,c=>{s.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(I.NInput),{value:s.value,"onUpdate:value":[d[0]||(d[0]=h=>s.value=h),l],clearable:c.clearable,placeholder:c.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),Ay={},Vy=i.defineComponent({...Ay,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref((n.value??"").replaceAll(/\D*/g,"")),o=D.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(D.isString(c))s.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(D.isObject(c)){if(s.value=c.formatted,!c.valid)return;d=c instanceof qi.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=qi.parsePhoneNumberWithError(`+${d}`);h.isValid()?s.value=h.format("E.164"):h.getPossibleCountries().length>0&&(s.value=`+${d}`)}catch(h){if(h instanceof qi.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(qh.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"]))}}),Iy=jn(Vy,[["__scopeId","data-v-751dbb0e"]]),Oy={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function zy(e,t){return i.openBlock(),i.createElementBlock("svg",Oy,[...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 Ly=i.markRaw({name:"tabler-external-link",render:zy}),Dy={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Hy=["href"],Wy={},jy=i.defineComponent({...Wy,__name:"external-link",props:{text:{},url:{},description:{}},setup(e){return(t,n)=>{const r=Ly,s=I.NTooltip;return i.openBlock(),i.createBlock(s,{disabled:i.unref(D.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Dy,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Hy),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),qy={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xy(e,t){return i.openBlock(),i.createElementBlock("svg",qy,[...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 Yy=i.markRaw({name:"ion-remove-circle-outline",render:Xy});let is=[];const Dc=new WeakMap;function Uy(){is.forEach(e=>e(...Dc.get(e))),is=[]}function Hc(e,...t){Dc.set(e,t),!is.includes(e)&&is.push(e)===1&&requestAnimationFrame(Uy)}function ar(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function lr(e){return e.composedPath()[0]||null}function cr(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function dr(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Gt(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 Wc={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 Gy(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 Ky(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 ln="^\\s*",cn="\\s*$",Vn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Lt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",oi="([0-9A-Fa-f])",ai="([0-9A-Fa-f]{2})",jc=new RegExp(`${ln}hsl\\s*\\(${Lt},${Vn},${Vn}\\)${cn}`),qc=new RegExp(`${ln}hsv\\s*\\(${Lt},${Vn},${Vn}\\)${cn}`),Xc=new RegExp(`${ln}hsla\\s*\\(${Lt},${Vn},${Vn},${Lt}\\)${cn}`),Yc=new RegExp(`${ln}hsva\\s*\\(${Lt},${Vn},${Vn},${Lt}\\)${cn}`),Zy=new RegExp(`${ln}rgb\\s*\\(${Lt},${Lt},${Lt}\\)${cn}`),Jy=new RegExp(`${ln}rgba\\s*\\(${Lt},${Lt},${Lt},${Lt}\\)${cn}`),Qy=new RegExp(`${ln}#${oi}${oi}${oi}${cn}`),e_=new RegExp(`${ln}#${ai}${ai}${ai}${cn}`),t_=new RegExp(`${ln}#${oi}${oi}${oi}${oi}${cn}`),n_=new RegExp(`${ln}#${ai}${ai}${ai}${ai}${cn}`);function Pt(e){return parseInt(e,16)}function i_(e){try{let t;if(t=Xc.exec(e))return[ss(t[1]),In(t[5]),In(t[9]),ci(t[13])];if(t=jc.exec(e))return[ss(t[1]),In(t[5]),In(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function r_(e){try{let t;if(t=Yc.exec(e))return[ss(t[1]),In(t[5]),In(t[9]),ci(t[13])];if(t=qc.exec(e))return[ss(t[1]),In(t[5]),In(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function li(e){try{let t;if(t=e_.exec(e))return[Pt(t[1]),Pt(t[2]),Pt(t[3]),1];if(t=Zy.exec(e))return[ut(t[1]),ut(t[5]),ut(t[9]),1];if(t=Jy.exec(e))return[ut(t[1]),ut(t[5]),ut(t[9]),ci(t[13])];if(t=Qy.exec(e))return[Pt(t[1]+t[1]),Pt(t[2]+t[2]),Pt(t[3]+t[3]),1];if(t=n_.exec(e))return[Pt(t[1]),Pt(t[2]),Pt(t[3]),ci(Pt(t[4])/255)];if(t=t_.exec(e))return[Pt(t[1]+t[1]),Pt(t[2]+t[2]),Pt(t[3]+t[3]),ci(Pt(t[4]+t[4])/255)];if(e in Wc)return li(Wc[e]);if(jc.test(e)||Xc.test(e)){const[n,r,s,o]=i_(e);return[...Ky(n,r,s),o]}else if(qc.test(e)||Yc.test(e)){const[n,r,s,o]=r_(e);return[...Gy(n,r,s),o]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function s_(e){return e>1?1:e<0?0:e}function po(e,t,n,r){return`rgba(${ut(e)}, ${ut(t)}, ${ut(n)}, ${s_(r)})`}function go(e,t,n,r,s){return ut((e*t*(1-r)+n*r)/s)}function o_(e,t){Array.isArray(e)||(e=li(e)),Array.isArray(t)||(t=li(t));const n=e[3],r=t[3],s=ci(n+r-n*r);return po(go(e[0],n,t[0],r,s),go(e[1],n,t[1],r,s),go(e[2],n,t[2],r,s),s)}function Ne(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:li(e);return typeof t.alpha=="number"?po(n,r,s,t.alpha):po(n,r,s,o)}function rs(e,t){const[n,r,s,o=1]=Array.isArray(e)?e:li(e),{lightness:a=1,alpha:l=1}=t;return a_([n*a,r*a,s*a,o*l])}function ci(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function ss(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function ut(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function In(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function a_(e){const[t,n,r]=e;return 3 in e?`rgba(${ut(t)}, ${ut(n)}, ${ut(r)}, ${ci(e[3])})`:`rgba(${ut(t)}, ${ut(n)}, ${ut(r)}, 1)`}function l_(e=8){return Math.random().toString(16).slice(2,2+e)}function Uc(e){return Array.isArray(e)?e:[e]}const mo={STOP:"STOP"};function Gc(e,t){const n=t(e);e.children!==void 0&&n!==mo.STOP&&e.children.forEach(r=>Gc(r,t))}function c_(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 d_(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function h_(e){return e.children}function u_(e){return e.key}function f_(){return!1}function p_(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function g_(e){return e.disabled===!0}function m_(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function y_(e,t){if(e.isLeaf===!0){const n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function yo(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function _o(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function __(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function b_(e,t){const n=new Set(e);return t.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function w_(e){return(e==null?void 0:e.type)==="group"}function v_(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 k_ extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function x_(e,t,n,r){return os(t.concat(e),n,r,!1)}function C_(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 S_(e,t,n,r){const s=os(t,n,r,!1),o=os(e,n,r,!0),a=C_(e,n),l=[];return s.forEach(c=>{(o.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>s.delete(c)),s}function bo(e,t){const{checkedKeys:n,keysToCheck:r,keysToUncheck:s,indeterminateKeys:o,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=e;if(!a)return r!==void 0?{checkedKeys:__(n,r),indeterminateKeys:Array.from(o)}:s!==void 0?{checkedKeys:b_(n,s),indeterminateKeys:Array.from(o)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(o)};const{levelTreeNodeMap:h}=t;let u;s!==void 0?u=S_(s,n,t,d):r!==void 0?u=x_(r,n,t,d):u=os(n,t,d,!1);const p=c==="parent",f=c==="child"||l,g=u,m=new Set,y=Math.max.apply(null,Array.from(h.keys()));for(let _=y;_>=0;_-=1){const b=_===0,S=h.get(_);for(const x of S){if(x.isLeaf)continue;const{key:v,shallowLoaded:B}=x;if(f&&B&&x.children.forEach(N=>{!N.disabled&&!N.isLeaf&&N.shallowLoaded&&g.has(N.key)&&g.delete(N.key)}),x.disabled||!B)continue;let k=!0,E=!1,P=!0;for(const N of x.children){const j=N.key;if(!N.disabled){if(P&&(P=!1),g.has(j))E=!0;else if(m.has(j)){E=!0,k=!1;break}else if(k=!1,E)break}}k&&!P?(p&&x.children.forEach(N=>{!N.disabled&&g.has(N.key)&&g.delete(N.key)}),g.add(v)):E&&m.add(v),b&&f&&g.has(v)&&g.delete(v)}}return{checkedKeys:Array.from(g),indeterminateKeys:Array.from(m)}}function os(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&&Gc(d,h=>{if(h.disabled)return mo.STOP;const{key:u}=h;if(!a.has(u)&&(a.add(u),l.add(u),m_(h.rawNode,o))){if(r)return mo.STOP;if(!n)throw new k_}})}),l}function B_(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 T_(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function E_(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 Kc(e,t,{loop:n=!1,includeDisabled:r=!1}={}){const s=t==="prev"?R_:E_,o={reverse:t==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===e){if(!a)a=!0;else if(!e.disabled&&!e.isGroup){l=e;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const h=wo(d,o);h!==null?l=h:c(s(d,n))}else{const h=s(d,!1);if(h!==null)c(h);else{const u=$_(d);u!=null&&u.isGroup?c(s(u,n)):n&&c(s(d,!0))}}}}return c(e),l}function R_(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 $_(e){return e.parent}function wo(e,t={}){const{reverse:n=!1}=t,{children:r}=e;if(r){const{length:s}=r,o=n?s-1:0,a=n?-1:s,l=n?-1:1;for(let c=o;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const h=wo(d,t);if(h!==null)return h}else return d}}return null}const N_={getChild(){return this.ignored?null:wo(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return Kc(this,"next",e)},getPrev(e={}){return Kc(this,"prev",e)}};function P_(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 F_(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}var M_={};function Zc(e,t,n,r,s,o=null,a=0){const l=[];return e.forEach((c,d)=>{var h;M_.NODE_ENV!=="production"&&y_(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 p=s(c);Array.isArray(p)&&(u.children=Zc(p,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 A_(e,t={}){var n;const r=new Map,s=new Map,{getDisabled:o=g_,getIgnored:a=f_,getIsGroup:l=w_,getKey:c=u_}=t,d=(n=t.getChildren)!==null&&n!==void 0?n:h_,h=t.ignoreEmptyChildren?x=>{const v=d(x);return Array.isArray(v)?v.length?v:null:v}: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 d_(this.rawNode,h)},get shallowLoaded(){return p_(this.rawNode,h)},get ignored(){return a(this.rawNode)},contains(x){return F_(this,x)}},N_),p=Zc(e,r,s,u,h);function f(x){if(x==null)return null;const v=r.get(x);return v&&!v.isGroup&&!v.ignored?v:null}function g(x){if(x==null)return null;const v=r.get(x);return v&&!v.ignored?v:null}function m(x,v){const B=g(x);return B?B.getPrev(v):null}function y(x,v){const B=g(x);return B?B.getNext(v):null}function _(x){const v=g(x);return v?v.getParent():null}function b(x){const v=g(x);return v?v.getChild():null}const S={treeNodes:p,treeNodeMap:r,levelTreeNodeMap:s,maxLevel:Math.max(...s.keys()),getChildren:h,getFlattenedNodes(x){return P_(p,x)},getNode:f,getPrev:m,getNext:y,getParent:_,getChild:b,getFirstAvailableNode(){return T_(p)},getPath(x,v={}){return B_(x,v,S)},getCheckedKeys(x,v={}){const{cascade:B=!0,leafOnly:k=!1,checkStrategy:E="all",allowNotLoaded:P=!1}=v;return bo({checkedKeys:yo(x),indeterminateKeys:_o(x),cascade:B,leafOnly:k,checkStrategy:E,allowNotLoaded:P},S)},check(x,v,B={}){const{cascade:k=!0,leafOnly:E=!1,checkStrategy:P="all",allowNotLoaded:N=!1}=B;return bo({checkedKeys:yo(v),indeterminateKeys:_o(v),keysToCheck:x==null?[]:Uc(x),cascade:k,leafOnly:E,checkStrategy:P,allowNotLoaded:N},S)},uncheck(x,v,B={}){const{cascade:k=!0,leafOnly:E=!1,checkStrategy:P="all",allowNotLoaded:N=!1}=B;return bo({checkedKeys:yo(v),indeterminateKeys:_o(v),keysToUncheck:x==null?[]:Uc(x),cascade:k,leafOnly:E,checkStrategy:P,allowNotLoaded:N},S)},getNonLeafKeys(x={}){return c_(p,x)}};return S}function as(e){return e.composedPath()[0]}const V_={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function I_(e,t,n){if(e==="mousemoveoutside"){const r=s=>{t.contains(as(s))||n(s)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const s=a=>{r=!t.contains(as(a))},o=a=>{r&&(t.contains(as(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 Jc(e,t,n){const r=V_[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=I_(e,t,n)),o}function O_(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Jc(e,t,n);return Object.keys(s).forEach(o=>{Bt(o,document,s[o],r)}),!0}return!1}function z_(e,t,n,r){if(e==="mousemoveoutside"||e==="clickoutside"){const s=Jc(e,t,n);return Object.keys(s).forEach(o=>{tt(o,document,s[o],r)}),!0}return!1}function L_(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function s(k,E,P){const N=k[E];return k[E]=function(){return P.apply(k,arguments),N.apply(k,arguments)},k}function o(k,E){k[E]=Event.prototype[E]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,E){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:E??l.get})}const h={bubble:{},capture:{}},u={};function p(){const k=function(E){const{type:P,eventPhase:N,bubbles:j}=E,X=as(E);if(N===2)return;const A=N===1?"capture":"bubble";let V=X;const L=[];for(;V===null&&(V=window),L.push(V),V!==window;)V=V.parentNode||null;const J=h.capture[P],F=h.bubble[P];if(s(E,"stopPropagation",n),s(E,"stopImmediatePropagation",r),d(E,c),A==="capture"){if(J===void 0)return;for(let R=L.length-1;R>=0&&!e.has(E);--R){const $=L[R],M=J.get($);if(M!==void 0){a.set(E,$);for(const U of M){if(t.has(E))break;U(E)}}if(R===0&&!j&&F!==void 0){const U=F.get($);if(U!==void 0)for(const z of U){if(t.has(E))break;z(E)}}}}else if(A==="bubble"){if(F===void 0)return;for(let R=0;R<L.length&&!e.has(E);++R){const $=L[R],M=F.get($);if(M!==void 0){a.set(E,$);for(const U of M){if(t.has(E))break;U(E)}}}}o(E,"stopPropagation"),o(E,"stopImmediatePropagation"),d(E)};return k.displayName="evtdUnifiedHandler",k}function f(){const k=function(E){const{type:P,eventPhase:N}=E;if(N!==2)return;const j=u[P];j!==void 0&&j.forEach(X=>X(E))};return k.displayName="evtdUnifiedWindowEventHandler",k}const g=p(),m=f();function y(k,E){const P=h[k];return P[E]===void 0&&(P[E]=new Map,window.addEventListener(E,g,k==="capture")),P[E]}function _(k){return u[k]===void 0&&(u[k]=new Set,window.addEventListener(k,m)),u[k]}function b(k,E){let P=k.get(E);return P===void 0&&k.set(E,P=new Set),P}function S(k,E,P,N){const j=h[E][P];if(j!==void 0){const X=j.get(k);if(X!==void 0&&X.has(N))return!0}return!1}function x(k,E){const P=u[k];return!!(P!==void 0&&P.has(E))}function v(k,E,P,N){let j;if(typeof N=="object"&&N.once===!0?j=J=>{B(k,E,j,N),P(J)}:j=P,O_(k,E,j,N))return;const A=N===!0||typeof N=="object"&&N.capture===!0?"capture":"bubble",V=y(A,k),L=b(V,E);if(L.has(j)||L.add(j),E===window){const J=_(k);J.has(j)||J.add(j)}}function B(k,E,P,N){if(z_(k,E,P,N))return;const X=N===!0||typeof N=="object"&&N.capture===!0,A=X?"capture":"bubble",V=y(A,k),L=b(V,E);if(E===window&&!S(E,X?"bubble":"capture",k,P)&&x(k,P)){const F=u[k];F.delete(P),F.size===0&&(window.removeEventListener(k,m),u[k]=void 0)}L.has(P)&&L.delete(P),L.size===0&&V.delete(E),V.size===0&&(window.removeEventListener(k,g,A==="capture"),h[A][k]=void 0)}return{on:v,off:B}}const{on:Bt,off:tt}=L_(),Vi="@@mmoContext",D_={mounted(e,{value:t}){e[Vi]={handler:void 0},typeof t=="function"&&(e[Vi].handler=t,Bt("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[Vi];typeof t=="function"?n.handler?n.handler!==t&&(tt("mousemoveoutside",e,n.handler),n.handler=t,Bt("mousemoveoutside",e,t)):(e[Vi].handler=t,Bt("mousemoveoutside",e,t)):n.handler&&(tt("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[Vi];t&&tt("mousemoveoutside",e,t),e[Vi].handler=void 0}},Ii="@@coContext",ls={mounted(e,{value:t,modifiers:n}){e[Ii]={handler:void 0},typeof t=="function"&&(e[Ii].handler=t,Bt("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const r=e[Ii];typeof t=="function"?r.handler?r.handler!==t&&(tt("clickoutside",e,r.handler,{capture:n.capture}),r.handler=t,Bt("clickoutside",e,t,{capture:n.capture})):(e[Ii].handler=t,Bt("clickoutside",e,t,{capture:n.capture})):r.handler&&(tt("clickoutside",e,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Ii];n&&tt("clickoutside",e,n,{capture:t.capture}),e[Ii].handler=void 0}};function H_(e,t){console.error(`[vdirs/${e}]: ${t}`)}class W_{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&&H_("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,t.forEach(n=>{const r=n[0],s=this.nextZIndex++;`${s}`!==r.style.zIndex&&(r.style.zIndex=`${s}`)})}}const vo=new W_,Oi="@@ziContext",Qc={mounted(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n;e[Oi]={enabled:!!s,initialized:!1},s&&(vo.ensureZIndex(e,r),e[Oi].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:r,enabled:s}=n,o=e[Oi].enabled;s&&!o&&(vo.ensureZIndex(e,r),e[Oi].initialized=!0),e[Oi].enabled=!!s},unmounted(e,t){if(!e[Oi].initialized)return;const{value:n={}}=t,{zIndex:r}=n;vo.unregister(e,r)}};function j_(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 qt(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 q_=typeof window<"u";let zi,hr;(()=>{var e,t;zi=q_?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,hr=!1,zi!==void 0?zi.then(()=>{hr=!0}):hr=!0})();function X_(e){if(hr)return;let t=!1;i.onMounted(()=>{hr||zi==null||zi.then(()=>{t||e()})}),i.onBeforeUnmount(()=>{t=!0})}function ko(e,t){return i.watch(e,n=>{n!==void 0&&(t.value=n)}),i.computed(()=>e.value===void 0?t.value:e.value)}function cs(){const e=i.ref(!1);return i.onMounted(()=>{e.value=!0}),i.readonly(e)}function ed(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 Y_=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function U_(){return Y_}function xo(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function Co(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Co(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Co(r.children,t,n)}else r.type!==i.Comment&&n.push(r)}}),n}function td(e,t,n="default"){const r=t[n];if(r===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const s=Co(r());if(s.length===1)return s[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let On=null;function nd(){if(On===null&&(On=document.getElementById("v-binder-view-measurer"),On===null)){On=document.createElement("div"),On.id="v-binder-view-measurer";const{style:e}=On;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(On)}return On.getBoundingClientRect()}function G_(e,t){const n=nd();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function So(e){const t=e.getBoundingClientRect(),n=nd();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 K_(e){return e.nodeType===9?null:e.parentNode}function id(e){if(e===null)return null;const t=K_(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 id(t)}const rd=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;i.provide("VBinder",(t=i.getCurrentInstance())===null||t===void 0?void 0:t.proxy);const n=i.inject("VBinder",null),r=i.ref(null),s=_=>{r.value=_,n&&e.syncTargetWithParent&&n.setTargetRef(_)};let o=[];const a=()=>{let _=r.value;for(;_=id(_),_!==null;)o.push(_);for(const b of o)Bt("scroll",b,u,!0)},l=()=>{for(const _ of o)tt("scroll",_,u,!0);o=[]},c=new Set,d=_=>{c.size===0&&a(),c.has(_)||c.add(_)},h=_=>{c.has(_)&&c.delete(_),c.size===0&&l()},u=()=>{Hc(p)},p=()=>{c.forEach(_=>_())},f=new Set,g=_=>{f.size===0&&Bt("resize",window,y),f.has(_)||f.add(_)},m=_=>{f.has(_)&&f.delete(_),f.size===0&&tt("resize",window,y)},y=()=>{f.forEach(_=>_())};return i.onBeforeUnmount(()=>{tt("resize",window,y),l()}),{targetRef:r,setTargetRef:s,addScrollListener:d,removeScrollListener:h,addResizeListener:g,removeResizeListener:m}},render(){return xo("binder",this.$slots)}}),sd=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(td("follower",this.$slots),[[t]]):td("follower",this.$slots)}}),Z_="@css-render/vue3-ssr";function J_(e,t){return`<style cssr-id="${e}">
|
|
104
104
|
${t}
|
|
105
|
-
</style>`}function
|
|
106
|
-
`+Object.entries(e).map(n=>t+` ${
|
|
105
|
+
</style>`}function Q_(e,t,n){const{styles:r,ids:s}=n;s.has(e)||r!==null&&(s.add(e),r.push(J_(e,t)))}const eb=typeof document<"u";function di(){if(eb)return;const e=i.inject(Z_,null);if(e!==null)return{adapter:(t,n)=>Q_(t,n,e),context:e}}function od(e,t){console.error(`[vueuc/${e}]: ${t}`)}function tb(e){let t=0;for(let n=0;n<e.length;++n)e[n]==="&"&&++t;return t}const ad=/\s*,(?![^(]*\))\s*/g,nb=/\s+/g;function ib(e,t){const n=[];return t.split(ad).forEach(r=>{let s=tb(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 rb(e,t){const n=[];return t.split(ad).forEach(r=>{e.forEach(s=>{n.push((s&&s+" ")+r)})}),n}function sb(e){let t=[""];return e.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?t=ib(t,n):t=rb(t,n))}),t.join(", ").replace(nb," ")}function ld(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function ds(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function ob(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function hs(e){return e?/^\s*@(s|m)/.test(e):!1}const ab=/[A-Z]/g;function cd(e){return e.replace(ab,t=>"-"+t.toLowerCase())}function lb(e,t=" "){return typeof e=="object"&&e!==null?` {
|
|
106
|
+
`+Object.entries(e).map(n=>t+` ${cd(n[0])}: ${n[1]};`).join(`
|
|
107
107
|
`)+`
|
|
108
|
-
`+t+"}":`: ${e};`}function
|
|
108
|
+
`+t+"}":`: ${e};`}function cb(e,t,n){return typeof e=="function"?e({context:t.context,props:n}):e}function dd(e,t,n,r){if(!t)return"";const s=cb(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 Bo(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))Bo(r,t,n);else if(typeof r=="function"){const s=r(t);Array.isArray(s)?Bo(s,t,n):s&&n(s)}else r&&n(r)})}function
|
|
113
|
+
`);return}l=cd(l),c!=null&&a.push(` ${l}${lb(c)}`)}),e&&a.push("}"),a.join(`
|
|
114
|
+
`)}function Bo(e,t,n){e&&e.forEach(r=>{if(Array.isArray(r))Bo(r,t,n);else if(typeof r=="function"){const s=r(t);Array.isArray(s)?Bo(s,t,n):s&&n(s)}else r&&n(r)})}function hd(e,t,n,r,s){const o=e.$;let a="";if(!o||typeof o=="string")hs(o)?a=o:t.push(o);else if(typeof o=="function"){const d=o({context:r.context,props:s});hs(d)?a=d:t.push(d)}else if(o.before&&o.before(r.context),!o.$||typeof o.$=="string")hs(o.$)?a=o.$:t.push(o.$);else if(o.$){const d=o.$({context:r.context,props:s});hs(d)?a=d:t.push(d)}const l=sb(t),c=dd(l,e.props,r,s);a?n.push(`${a} {`):c.length&&n.push(c),e.children&&Bo(e.children,{context:r.context,props:s},d=>{if(typeof d=="string"){const h=dd(l,{raw:d},r,s);n.push(h)}else hd(d,t,n,r,s)}),t.pop(),a&&n.push("}"),o&&o.after&&o.after(r.context)}function db(e,t,n){const r=[];return hd(e,[],r,t,n),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function To(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function sb(e,t,n,r){const{els:s}=t;if(n===void 0)s.forEach(od),t.els=[];else{const o=ds(n,r);o&&s.includes(o)&&(od(o),t.els=s.filter(a=>a!==o))}}function dd(e,t){e.push(t)}function ob(e,t,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=t.render(r),n=To(d)),c){c.adapter(n,d??t.render(r));return}l===void 0&&(l=document.head);const h=ds(n,l);if(h!==null&&!o)return h;const f=h??eb(n);if(d===void 0&&(d=t.render(r)),f.textContent=d,h!==null)return h;if(a){const p=l.querySelector(`meta[name="${a}"]`);if(p)return l.insertBefore(f,p),dd(t.els,f),f}return s?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),dd(t.els,f),f}function ab(e){return rb(this,this.instance,e)}function lb(e={}){const{id:t,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=e;return ob(this.instance,this,t,r,s,o,a,l,n)}function cb(e={}){const{id:t,parent:n}=e;sb(this.instance,this,t,n)}const us=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:ab,mount:lb,unmount:cb}},db=function(e,t,n,r){return Array.isArray(t)?us(e,{$:null},null,t):Array.isArray(n)?us(e,t,null,n):Array.isArray(r)?us(e,t,n,r):us(e,t,n,null)};function hd(e={}){const t={c:(...n)=>db(t,...n),use:(n,...r)=>n.install(t,...r),find:ds,context:{},config:e};return t}function hb(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return ds(e)!==null}const{c:zn}=hd(),Eo="vueuc-style";function ud(e){return e&-e}class fd{constructor(t,n){this.l=t,this.min=n;const r=new Array(t+1);for(let s=0;s<t+1;++s)r[s]=0;this.ft=r}add(t,n){if(n===0)return;const{l:r,ft:s}=this;for(t+=1;t<=r;)s[t]+=n,t+=ud(t)}get(t){return this.sum(t+1)-this.sum(t)}sum(t){if(t===void 0&&(t=this.l),t<=0)return 0;const{ft:n,min:r,l:s}=this;if(t>s)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let o=t*r;for(;t>0;)o+=n[t],t-=ud(t);return o}getBound(t){let n=0,r=this.l;for(;r>n;){const s=Math.floor((n+r)/2),o=this.sum(s);if(o>t){r=s;continue}else if(o<t){if(n===s)return this.sum(n+1)<=t?n+1:s;n=s}else return s}return n}}function pd(e){return typeof e=="string"?document.querySelector(e):e()}const ub=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:Oy(i.toRef(e,"show")),mergedTo:i.computed(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?xo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},xo("lazy-teleport",this.$slots)):null}}),fs={top:"bottom",bottom:"top",left:"right",right:"left"},gd={start:"end",center:"center",end:"start"},$o={top:"height",bottom:"height",left:"width",right:"width"},fb={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},pb={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},gb={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},md={top:!0,bottom:!1,left:!0,right:!1},_d={top:"end",bottom:"start",left:"end",right:"start"};function mb(e,t,n,r,s,o){if(!s||o)return{placement:e,top:0,left:0};const[a,l]=e.split("-");let c=l??"center",d={top:0,left:0};const h=(u,g,m)=>{let _=0,y=0;const b=n[u]-t[g]-t[u];return b>0&&r&&(m?y=md[g]?b:-b:_=md[g]?b:-b),{left:_,top:y}},f=a==="left"||a==="right";if(c!=="center"){const u=gb[e],g=fs[u],m=$o[u];if(n[m]>t[m]){if(t[u]+t[m]<n[m]){const _=(n[m]-t[m])/2;t[u]<_||t[g]<_?t[u]<t[g]?(c=gd[l],d=h(m,g,f)):d=h(m,u,f):c="center"}}else n[m]<t[m]&&t[g]<0&&t[u]>t[g]&&(c=gd[l])}else{const u=a==="bottom"||a==="top"?"left":"top",g=fs[u],m=$o[u],_=(n[m]-t[m])/2;(t[u]<_||t[g]<_)&&(t[u]>t[g]?(c=_d[u],d=h(m,u,f)):(c=_d[g],d=h(m,g,f)))}let p=a;return t[a]<n[$o[a]]&&t[a]<t[fs[a]]&&(p=fs[a]),{placement:c!=="center"?`${p}-${c}`:p,left:d.left,top:d.top}}function _b(e,t){return t?pb[e]:fb[e]}function yb(e,t,n,r,s,o){if(o)switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(e){case"bottom-start":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+s)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+s)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+s)}px`,transform:"translateX(-50%)"}}}const bb=zn([zn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),zn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[zn("> *",{pointerEvents:"all"})])]),yd=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=i.inject("VBinder"),n=jt(()=>e.enabled!==void 0?e.enabled:e.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:p}=e;p.includes("scroll")&&t.addScrollListener(c),p.includes("resize")&&t.addResizeListener(c)},a=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=di();bb.mount({id:"vueuc/binder",head:!0,anchorMetaName:Eo,ssr:l}),i.onBeforeUnmount(()=>{a()}),Ly(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const p=r.value;if(p===null)return;const u=t.targetRef,{x:g,y:m,overlap:_}=e,y=g!==void 0&&m!==void 0?Wy(g,m):So(u);p.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),p.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:b,minWidth:S,placement:x,internalShift:v,flip:B}=e;p.setAttribute("v-placement",x),_?p.setAttribute("v-overlap",""):p.removeAttribute("v-overlap");const{style:k}=p;b==="target"?k.width=`${y.width}px`:b!==void 0?k.width=b:k.width="",S==="target"?k.minWidth=`${y.width}px`:S!==void 0?k.minWidth=S:k.minWidth="";const R=So(p),P=So(s.value),{left:N,top:W,placement:q}=mb(x,y,R,v,B,_),F=_b(q,_),{left:M,top:I,transform:Z}=yb(q,P,y,W,N,_);p.setAttribute("v-placement",q),p.style.setProperty("--v-offset-left",`${Math.round(N)}px`),p.style.setProperty("--v-offset-top",`${Math.round(W)}px`),p.style.transform=`translateX(${M}) translateY(${I}) ${Z}`,p.style.setProperty("--v-transform-origin",F),p.style.transformOrigin=F};i.watch(n,p=>{p?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(p=>console.error(p))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(p=>{i.watch(i.toRef(e,p),c)}),["teleportDisabled"].forEach(p=>{i.watch(i.toRef(e,p),d)}),i.watch(i.toRef(e,"syncTrigger"),p=>{p.includes("resize")?t.addResizeListener(c):t.removeResizeListener(c),p.includes("scroll")?t.addScrollListener(c):t.removeScrollListener(c)});const h=cs(),f=jt(()=>{const{to:p}=e;if(p!==void 0)return p;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:f,syncPosition:c}},render(){return i.h(ub,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?i.withDirectives(n,[[Zc,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var hi=[],wb=function(){return hi.some(function(e){return e.activeTargets.length>0})},vb=function(){return hi.some(function(e){return e.skippedTargets.length>0})},bd="ResizeObserver loop completed with undelivered notifications.",kb=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:bd}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=bd),window.dispatchEvent(e)},ur;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ur||(ur={}));var ui=function(e){return Object.freeze(e)},xb=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,ui(this)}return e}(),wd=function(){function e(t,n,r,s){return this.x=t,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ui(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,s=t.top,o=t.right,a=t.bottom,l=t.left,c=t.width,d=t.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Ro=function(e){return e instanceof SVGElement&&"getBBox"in e},vd=function(e){if(Ro(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var s=e,o=s.offsetWidth,a=s.offsetHeight;return!(o||a||e.getClientRects().length)},kd=function(e){var t;if(e instanceof Element)return!0;var n=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(n&&e instanceof n.Element)},Cb=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},fr=typeof window<"u"?window:{},ps=new WeakMap,xd=/auto|scroll/,Sb=/^tb|vertical/,Bb=/msie|trident/i.test(fr.navigator&&fr.navigator.userAgent),ln=function(e){return parseFloat(e||"0")},Li=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new xb((n?t:e)||0,(n?e:t)||0)},Cd=ui({devicePixelContentBoxSize:Li(),borderBoxSize:Li(),contentBoxSize:Li(),contentRect:new wd(0,0,0,0)}),Sd=function(e,t){if(t===void 0&&(t=!1),ps.has(e)&&!t)return ps.get(e);if(vd(e))return ps.set(e,Cd),Cd;var n=getComputedStyle(e),r=Ro(e)&&e.ownerSVGElement&&e.getBBox(),s=!Bb&&n.boxSizing==="border-box",o=Sb.test(n.writingMode||""),a=!r&&xd.test(n.overflowY||""),l=!r&&xd.test(n.overflowX||""),c=r?0:ln(n.paddingTop),d=r?0:ln(n.paddingRight),h=r?0:ln(n.paddingBottom),f=r?0:ln(n.paddingLeft),p=r?0:ln(n.borderTopWidth),u=r?0:ln(n.borderRightWidth),g=r?0:ln(n.borderBottomWidth),m=r?0:ln(n.borderLeftWidth),_=f+d,y=c+h,b=m+u,S=p+g,x=l?e.offsetHeight-S-e.clientHeight:0,v=a?e.offsetWidth-b-e.clientWidth:0,B=s?_+b:0,k=s?y+S:0,R=r?r.width:ln(n.width)-B-v,P=r?r.height:ln(n.height)-k-x,N=R+_+v+b,W=P+y+x+S,q=ui({devicePixelContentBoxSize:Li(Math.round(R*devicePixelRatio),Math.round(P*devicePixelRatio),o),borderBoxSize:Li(N,W,o),contentBoxSize:Li(R,P,o),contentRect:new wd(f,c,R,P)});return ps.set(e,q),q},Bd=function(e,t,n){var r=Sd(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case ur.DEVICE_PIXEL_CONTENT_BOX:return a;case ur.BORDER_BOX:return s;default:return o}},Tb=function(){function e(t){var n=Sd(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=ui([n.borderBoxSize]),this.contentBoxSize=ui([n.contentBoxSize]),this.devicePixelContentBoxSize=ui([n.devicePixelContentBoxSize])}return e}(),Td=function(e){if(vd(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Eb=function(){var e=1/0,t=[];hi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new Tb(d.target),f=Td(d.target);l.push(h),d.lastReportedSize=Bd(d.target,d.observedBox),f<e&&(e=f)}),t.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var s=r[n];s()}return e},Ed=function(e){hi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Td(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},$b=function(){var e=0;for(Ed(e);wb();)e=Eb(),Ed(e);return vb()&&kb(),e>0},No,$d=[],Rb=function(){return $d.splice(0).forEach(function(e){return e()})},Nb=function(e){if(!No){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Rb()}).observe(n,r),No=function(){n.textContent="".concat(t?t--:t++)}}$d.push(e),No()},Pb=function(e){Nb(function(){requestAnimationFrame(e)})},gs=0,Fb=function(){return!!gs},Mb=250,Ab={attributes:!0,characterData:!0,childList:!0,subtree:!0},Rd=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Nd=function(e){return e===void 0&&(e=0),Date.now()+e},Po=!1,Vb=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var n=this;if(t===void 0&&(t=Mb),!Po){Po=!0;var r=Nd(t);Pb(function(){var s=!1;try{s=$b()}finally{if(Po=!1,t=r-Nd(),!Fb())return;s?n.run(1e3):t>0?n.run(t):n.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,n=function(){return t.observer&&t.observer.observe(document.body,Ab)};document.body?n():fr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Rd.forEach(function(n){return fr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Rd.forEach(function(n){return fr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Fo=new Vb,Pd=function(e){!gs&&e>0&&Fo.start(),gs+=e,!gs&&Fo.stop()},Ib=function(e){return!Ro(e)&&!Cb(e)&&getComputedStyle(e).display==="inline"},Ob=function(){function e(t,n){this.target=t,this.observedBox=n||ur.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Bd(this.target,this.observedBox,!0);return Ib(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),zb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),ms=new WeakMap,Fd=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},_s=function(){function e(){}return e.connect=function(t,n){var r=new zb(t,n);ms.set(t,r)},e.observe=function(t,n,r){var s=ms.get(t),o=s.observationTargets.length===0;Fd(s.observationTargets,n)<0&&(o&&hi.push(s),s.observationTargets.push(new Ob(n,r&&r.box)),Pd(1),Fo.schedule())},e.unobserve=function(t,n){var r=ms.get(t),s=Fd(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&hi.splice(hi.indexOf(r),1),r.observationTargets.splice(s,1),Pd(-1))},e.disconnect=function(t){var n=this,r=ms.get(t);r.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Lb=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");_s.connect(this,t)}return e.prototype.observe=function(t,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!kd(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");_s.observe(this,t,n)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!kd(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");_s.unobserve(this,t)},e.prototype.disconnect=function(){_s.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Db{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Lb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const n of t){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(t,n){this.elHandlersMap.set(t,n),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const pr=new Db,ys=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const n=i.getCurrentInstance().proxy;function r(s){const{onResize:o}=e;o!==void 0&&o(s)}i.onMounted(()=>{const s=n.$el;if(s===void 0){rd("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){rd("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(pr.registerHandler(s.nextElementSibling,r),t=!0)}),i.onBeforeUnmount(()=>{t&&pr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let bs;function Hb(){return typeof document>"u"?!1:(bs===void 0&&("matchMedia"in window?bs=window.matchMedia("(pointer:coarse)").matches:bs=!1),bs)}let Mo;function Md(){return typeof document>"u"?1:(Mo===void 0&&(Mo="chrome"in window?window.devicePixelRatio:1),Mo)}const Ad="VVirtualListXScroll";function Wb({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const r=i.ref(0),s=i.ref(0),o=i.computed(()=>{const d=e.value;if(d.length===0)return null;const h=new fd(d.length,0);return d.forEach((f,p)=>{h.add(p,f.width)}),h}),a=jt(()=>{const d=o.value;return d!==null?Math.max(d.getBound(s.value)-1,0):0}),l=d=>{const h=o.value;return h!==null?h.sum(d):0},c=jt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,e.value.length-1):0});return i.provide(Ad,{startIndexRef:a,endIndexRef:c,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Vd=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:r,renderColRef:s,renderItemWithColsRef:o}=i.inject(Ad);return{startIndex:e,endIndex:t,columns:n,renderCol:s,renderItemWithCols:o,getLeft:r}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:s,getLeft:o,item:a}=this;if(s!=null)return s({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:a,getLeft:o});if(r!=null){const l=[];for(let c=e;c<=t;++c){const d=n[c];l.push(r({column:d,left:o(c),item:a}))}return l}return null}}),jb=zn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[zn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[zn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Xb=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=di();jb.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Eo,ssr:t}),i.onMounted(()=>{const{defaultScrollIndex:F,defaultScrollKey:M}=e;F!=null?_({index:F}):M!=null&&_({key:M})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}_({top:u.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=jt(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let F=0;return e.columns.forEach(M=>{F+=M.width}),F}),o=i.computed(()=>{const F=new Map,{keyField:M}=e;return e.items.forEach((I,Z)=>{F.set(I[M],Z)}),F}),{scrollLeftRef:a,listWidthRef:l}=Wb({columnsRef:i.toRef(e,"columns"),renderColRef:i.toRef(e,"renderCol"),renderItemWithColsRef:i.toRef(e,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),h=new Map,f=i.computed(()=>{const{items:F,itemSize:M,keyField:I}=e,Z=new fd(F.length,M);return F.forEach((T,$)=>{const j=T[I],z=h.get(j);z!==void 0&&Z.add($,z)}),Z}),p=i.ref(0),u=i.ref(0),g=jt(()=>Math.max(f.value.getBound(u.value-cr(e.paddingTop))-1,0)),m=i.computed(()=>{const{value:F}=d;if(F===void 0)return[];const{items:M,itemSize:I}=e,Z=g.value,T=Math.min(Z+Math.ceil(F/I+1),M.length-1),$=[];for(let j=Z;j<=T;++j)$.push(M[j]);return $}),_=(F,M)=>{if(typeof F=="number"){x(F,M,"auto");return}const{left:I,top:Z,index:T,key:$,position:j,behavior:z,debounce:Y=!0}=F;if(I!==void 0||Z!==void 0)x(I,Z,z);else if(T!==void 0)S(T,z,Y);else if($!==void 0){const V=o.value.get($);V!==void 0&&S(V,z,Y)}else j==="bottom"?x(0,Number.MAX_SAFE_INTEGER,z):j==="top"&&x(0,0,z)};let y,b=null;function S(F,M,I){const{value:Z}=f,T=Z.sum(F)+cr(e.paddingTop);if(!I)c.value.scrollTo({left:0,top:T,behavior:M});else{y=F,b!==null&&window.clearTimeout(b),b=window.setTimeout(()=>{y=void 0,b=null},16);const{scrollTop:$,offsetHeight:j}=c.value;if(T>$){const z=Z.get(F);T+z<=$+j||c.value.scrollTo({left:0,top:T+z-j,behavior:M})}else c.value.scrollTo({left:0,top:T,behavior:M})}}function x(F,M,I){c.value.scrollTo({left:F,top:M,behavior:I})}function v(F,M){var I,Z,T;if(n||e.ignoreItemResize||q(M.target))return;const{value:$}=f,j=o.value.get(F),z=$.get(j),Y=(T=(Z=(I=M.borderBoxSize)===null||I===void 0?void 0:I[0])===null||Z===void 0?void 0:Z.blockSize)!==null&&T!==void 0?T:M.contentRect.height;if(Y===z)return;Y-e.itemSize===0?h.delete(F):h.set(F,Y-e.itemSize);const O=Y-z;if(O===0)return;$.add(j,O);const J=c.value;if(J!=null){if(y===void 0){const ge=$.sum(j);J.scrollTop>ge&&J.scrollBy(0,O)}else if(j<y)J.scrollBy(0,O);else if(j===y){const ge=$.sum(j);Y+ge>J.scrollTop+J.offsetHeight&&J.scrollBy(0,O)}W()}p.value++}const B=!Hb();let k=!1;function R(F){var M;(M=e.onScroll)===null||M===void 0||M.call(e,F),(!B||!k)&&W()}function P(F){var M;if((M=e.onWheel)===null||M===void 0||M.call(e,F),B){const I=c.value;if(I!=null){if(F.deltaX===0&&(I.scrollTop===0&&F.deltaY<=0||I.scrollTop+I.offsetHeight>=I.scrollHeight&&F.deltaY>=0))return;F.preventDefault(),I.scrollTop+=F.deltaY/Md(),I.scrollLeft+=F.deltaX/Md(),W(),k=!0,Lc(()=>{k=!1})}}}function N(F){if(n||q(F.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(F.contentRect.height===d.value)return}else if(F.contentRect.height===d.value&&F.contentRect.width===l.value)return;d.value=F.contentRect.height,l.value=F.contentRect.width;const{onResize:M}=e;M!==void 0&&M(F)}function W(){const{value:F}=c;F!=null&&(u.value=F.scrollTop,a.value=F.scrollLeft)}function q(F){let M=F;for(;M!==null;){if(M.style.display==="none")return!0;M=M.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:F}=e,M=dr(f.value.sum());return p.value,[e.itemsStyle,{boxSizing:"content-box",width:dr(s.value),height:F?"":M,minHeight:F?M:"",paddingTop:dr(e.paddingTop),paddingBottom:dr(e.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(p.value,{transform:`translateY(${dr(f.value.sum(g.value))})`})),viewportItems:m,listElRef:c,itemsElRef:i.ref(null),scrollTo:_,handleListResize:N,handleListScroll:R,handleListWheel:P,handleItemResize:v}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return i.h(ys,{onResize:this.handleListResize},{default:()=>{var s,o;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[t],h=n.get(d),f=a!=null?i.h(Vd,{index:h,item:c}):void 0,p=l!=null?i.h(Vd,{index:h,item:c}):void 0,u=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:p,index:h})[0];return e?i.h(ys,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>u}):(u.key=d,u)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),bn="v-hidden",qb=zn("[v-hidden]",{display:"none!important"}),Id=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=e;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(bn)&&h.removeAttribute(bn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const S of f)S.hasAttribute(bn)&&S.removeAttribute(bn);const p=l.offsetWidth,u=[],g=t.tail?d==null?void 0:d():null;let m=g?g.offsetWidth:0,_=!1;const y=l.children.length-(t.tail?1:0);for(let S=0;S<y-1;++S){if(S<0)continue;const x=f[S];if(_){x.hasAttribute(bn)||x.setAttribute(bn,"");continue}else x.hasAttribute(bn)&&x.removeAttribute(bn);const v=x.offsetWidth;if(m+=v,u[S]=v,m>p){const{updateCounter:B}=e;for(let k=S;k>=0;--k){const R=y-1-k;B!==void 0?B(R):h.textContent=`${R}`;const P=h.offsetWidth;if(m-=u[k],m+P<=p||k===0){_=!0,S=k-1,g&&(S===-1?(g.style.maxWidth=`${p-P}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:N}=e;N&&N(R);break}}}}const{onUpdateOverflow:b}=e;_?b!==void 0&&b(!0):(b!==void 0&&b(!1),h.setAttribute(bn,""))}const o=di();return qb.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Eo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:e}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(e,"default"),e.counter?e.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function Od(e){return e instanceof HTMLElement}function zd(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(Od(n)&&(Dd(n)||zd(n)))return!0}return!1}function Ld(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(Od(n)&&(Dd(n)||Ld(n)))return!0}return!1}function Dd(e){if(!Yb(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Yb(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let gr=[];const Ub=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:String,finalFocusTo:String,returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=ny(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return gr[gr.length-1]===t}function c(_){var y;_.code==="Escape"&&l()&&((y=e.onEsc)===null||y===void 0||y.call(e,_))}i.onMounted(()=>{i.watch(()=>e.active,_=>{_?(f(),Bt("keydown",document,c)):(it("keydown",document,c),s&&p())},{immediate:!0})}),i.onBeforeUnmount(()=>{it("keydown",document,c),s&&p()});function d(_){if(!o&&l()){const y=h();if(y===null||y.contains(lr(_)))return;u("first")}}function h(){const _=n.value;if(_===null)return null;let y=_;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var _;if(!e.disabled){if(gr.push(t),e.autoFocus){const{initialFocusTo:y}=e;y===void 0?u("first"):(_=pd(y))===null||_===void 0||_.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function p(){var _;if(e.disabled||(document.removeEventListener("focus",d,!0),gr=gr.filter(b=>b!==t),l()))return;const{finalFocusTo:y}=e;y!==void 0?(_=pd(y))===null||_===void 0||_.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function u(_){if(l()&&e.active){const y=n.value,b=r.value;if(y!==null&&b!==null){const S=h();if(S==null||S===b){o=!0,y.focus({preventScroll:!0}),o=!1;return}o=!0;const x=_==="first"?zd(S):Ld(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)?u("last"):u("first"))}function m(_){o||(_.relatedTarget!==null&&_.relatedTarget===n.value?u("last"):u("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,handleEndFocus:m}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function jk(e){return e}const Ao="n-internal-select-menu",Hd="n-internal-select-menu-body",Wd="n-drawer-body",jd="n-modal-body",Xd="n-popover-body",qd="__disabled__";function wn(e){const t=i.inject(jd,null),n=i.inject(Wd,null),r=i.inject(Xd,null),s=i.inject(Hd,null),o=i.ref();if(typeof document<"u"){o.value=document.fullscreenElement;const a=()=>{o.value=document.fullscreenElement};i.onMounted(()=>{Bt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{it("fullscreenchange",document,a)})}return jt(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?qd:l===!0?o.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}wn.tdkey=qd,wn.propTo={type:[String,Object,Boolean],default:void 0};function Gb(e){const t={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(t.isDeactivated=!1,!n){n=!0;return}e()}),i.onDeactivated(()=>{t.isDeactivated=!0,n||(n=!0)}),t}function Yd(e,t){t&&(i.onMounted(()=>{const{value:n}=e;n&&pr.registerHandler(n,t)}),i.watch(e,(n,r)=>{r&&pr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=e;n&&pr.unregisterHandler(n)}))}function Ud(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const Kb=/^(\d|\.)+$/,Gd=/(\d|\.)+/;function Vo(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e=="number"){const s=(e+n)*t;return s===0?"0":`${s}px`}else if(typeof e=="string")if(Kb.test(e)){const s=(Number(e)+n)*t;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Gd.exec(e);return s?e.replace(Gd,String((Number(s[0])+n)*t)):e}return e}function Kd(e){const{left:t,right:n,top:r,bottom:s}=Ut(e);return`${r} ${t} ${s} ${n}`}var Zd={};function Zb(e){let t=".",n="__",r="--",s;if(e){let g=e.blockPrefix;g&&(t=g),g=e.elementPrefix,g&&(n=g),g=e.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const m=g.context;m.bem={},m.bem.b=null,m.bem.els=null}};function a(g){let m,_;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(v=>`&${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${x!==void 0?`${n}${x}`:""}${r}${v}`).join(", ")}const S=m.bem.els;if(S!==null){if(Zd.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return b(S[0])}else return b()}}}function d(g){return{$({context:m,props:_}){g=typeof g=="string"?g:g({context:m,props:_});const y=m.bem.els;if(Zd.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${g}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(_==null?void 0:_.bPrefix)||t}${m.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${g})`}}}return Object.assign(o,{cB:(...g)=>s(a(g[0]),g[1],g[2]),cE:(...g)=>s(l(g[0]),g[1],g[2]),cM:(...g)=>s(c(g[0]),g[1],g[2]),cNotM:(...g)=>s(d(g[0]),g[1],g[2])}),o}const Jb=".n-",Qb="__",e1="--",Jd=hd(),Qd=Zb({blockPrefix:Jb,elementPrefix:Qb,modifierPrefix:e1});Jd.use(Qd);const{c:ae,find:qk}=Jd,{cB:fe,cE:_e,cM:Se,cNotM:Gt}=Qd,t1=(...e)=>ae(">",[fe(...e)]);function qe(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}let Io;function n1(){return Io===void 0&&(Io=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Io}const i1=new WeakSet;function r1(e){i1.add(e)}function eh(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}const th=new Set;function Ln(e,t){const n=`[naive/${e}]: ${t}`;th.has(n)||(th.add(n),console.error(n))}function nh(e,t){console.error(`[naive/${e}]: ${t}`)}function ih(e,t){throw new Error(`[naive/${e}]: ${t}`)}function mt(e,...t){if(Array.isArray(e))e.forEach(n=>mt(n,...t));else return e(...t)}function Oo(e,t=!0,n=[]){return e.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){Oo(r,t,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Oo(r.children,t,n)}else{if(r.type===i.Comment&&t)return;n.push(r)}}}),n}function s1(e,t="default",n=void 0){const r=e[t];if(!r)return nh("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=Oo(r(n));return s.length===1?s[0]:(nh("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function o1(e,t=[],n){const r={};return t.forEach(s=>{r[s]=e[s]}),Object.assign(r,n)}function zo(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(r=>{r&&r(n)})}}function Di(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?i.createTextVNode(e):typeof e=="number"?i.createTextVNode(String(e)):null}function ws(e){return e.some(t=>i.isVNode(t)?!(t.type===i.Comment||t.type===i.Fragment&&!ws(t.children)):!0)?e:null}function Lo(e,t){return e&&ws(e())||t()}function fi(e,t){const n=e&&ws(e());return t(n||null)}function rh(e){return!(e&&ws(e()))}const Do=i.defineComponent({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),pi="n-config-provider",a1="n";function gi(e={},t={defaultBordered:!0}){const n=i.inject(pi,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=e;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(a1),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function mi(e,t,n,r){n||ih("useThemeClass","cssVarsRef is not passed");const s=i.inject(pi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=di();let d;const h=`__${e}`,f=()=>{let p=h;const u=t?t.value:void 0,g=o==null?void 0:o.value;g&&(p+=`-${g}`),u&&(p+=`-${u}`);const{themeOverrides:m,builtinThemeOverrides:_}=r;m&&(p+=`-${To(JSON.stringify(m))}`),_&&(p+=`-${To(JSON.stringify(_))}`),l.value=p,d=()=>{const y=n.value;let b="";for(const S in y)b+=`${S}: ${y[S]};`;ae(`.${p}`,b).mount({id:p,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const sh="n-form-item";function l1(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(sh,null);i.provide(sh,null);const o=i.computed(n?()=>n(s):()=>{const{size:c}=e;if(c)return c;if(s){const{mergedSize:d}=s;if(d.value!==void 0)return d.value}return t}),a=i.computed(r?()=>r(s):()=>{const{disabled:c}=e;return c!==void 0?c:s?s.disabled.value:!1}),l=i.computed(()=>{const{status:c}=e;return c||(s==null?void 0:s.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{s&&s.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){s&&s.handleContentBlur()},nTriggerFormChange(){s&&s.handleContentChange()},nTriggerFormFocus(){s&&s.handleContentFocus()},nTriggerFormInput(){s&&s.handleContentInput()}}}const c1={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}};function Ho(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function mr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function _r(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?h1(l,f=>f.test(a)):d1(l,f=>f.test(a));let d;d=e.valueCallback?e.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const h=t.slice(a.length);return{value:d,rest:h}}}function d1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function h1(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function u1(e){return(t,n={})=>{const r=t.match(e.matchPattern);if(!r)return null;const s=r[0],o=t.match(e.parsePattern);if(!o)return null;let a=e.valueCallback?e.valueCallback(o[0]):o[0];a=n.valueCallback?n.valueCallback(a):a;const l=t.slice(s.length);return{value:a,rest:l}}}const f1={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},p1=(e,t,n)=>{let r;const s=f1[e];return typeof s=="string"?r=s:t===1?r=s.one:r=s.other.replace("{{count}}",t.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},g1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},m1=(e,t,n,r)=>g1[e],_1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},y1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},b1={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},w1={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},v1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},k1={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},x1={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:mr({values:_1,defaultWidth:"wide"}),quarter:mr({values:y1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mr({values:b1,defaultWidth:"wide"}),day:mr({values:w1,defaultWidth:"wide"}),dayPeriod:mr({values:v1,defaultWidth:"wide",formattingValues:k1,defaultFormattingWidth:"wide"})},C1=/^(\d+)(th|st|nd|rd)?/i,S1=/\d+/i,B1={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},T1={any:[/^b/i,/^(a|c)/i]},E1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},$1={any:[/1/i,/2/i,/3/i,/4/i]},R1={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},N1={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},P1={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},F1={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},M1={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},A1={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},V1={ordinalNumber:u1({matchPattern:C1,parsePattern:S1,valueCallback:e=>parseInt(e,10)}),era:_r({matchPatterns:B1,defaultMatchWidth:"wide",parsePatterns:T1,defaultParseWidth:"any"}),quarter:_r({matchPatterns:E1,defaultMatchWidth:"wide",parsePatterns:$1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:_r({matchPatterns:R1,defaultMatchWidth:"wide",parsePatterns:N1,defaultParseWidth:"any"}),day:_r({matchPatterns:P1,defaultMatchWidth:"wide",parsePatterns:F1,defaultParseWidth:"any"}),dayPeriod:_r({matchPatterns:M1,defaultMatchWidth:"any",parsePatterns:A1,defaultParseWidth:"any"})},I1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},O1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},z1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},L1={date:Ho({formats:I1,defaultWidth:"full"}),time:Ho({formats:O1,defaultWidth:"full"}),dateTime:Ho({formats:z1,defaultWidth:"full"})},D1={name:"en-US",locale:{code:"en-US",formatDistance:p1,formatLong:L1,formatRelative:m1,localize:x1,match:V1,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function oh(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=i.inject(pi,null)||{},r=i.computed(()=>{var o,a;return(a=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o[e])!==null&&a!==void 0?a:c1[e]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:D1}),localeRef:r}}const yr="naive-ui-style";function vs(e,t,n){if(!t)return;const r=di(),s=i.computed(()=>{const{value:l}=t;if(!l)return;const c=l[e];if(c)return c}),o=i.inject(pi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${e}Rtl`;if(hb(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:yr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const br={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:H1,fontFamily:W1,lineHeight:j1}=br,ah=ae("body",`
|
|
116
|
+
`)}function To(e){for(var t=0,n,r=0,s=e.length;s>=4;++r,s-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(s){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function hb(e,t,n,r){const{els:s}=t;if(n===void 0)s.forEach(ld),t.els=[];else{const o=ds(n,r);o&&s.includes(o)&&(ld(o),t.els=s.filter(a=>a!==o))}}function ud(e,t){e.push(t)}function ub(e,t,n,r,s,o,a,l,c){let d;if(n===void 0&&(d=t.render(r),n=To(d)),c){c.adapter(n,d??t.render(r));return}l===void 0&&(l=document.head);const h=ds(n,l);if(h!==null&&!o)return h;const u=h??ob(n);if(d===void 0&&(d=t.render(r)),u.textContent=d,h!==null)return h;if(a){const p=l.querySelector(`meta[name="${a}"]`);if(p)return l.insertBefore(u,p),ud(t.els,u),u}return s?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),ud(t.els,u),u}function fb(e){return db(this,this.instance,e)}function pb(e={}){const{id:t,ssr:n,props:r,head:s=!1,force:o=!1,anchorMetaName:a,parent:l}=e;return ub(this.instance,this,t,r,s,o,a,l,n)}function gb(e={}){const{id:t,parent:n}=e;hb(this.instance,this,t,n)}const us=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:fb,mount:pb,unmount:gb}},mb=function(e,t,n,r){return Array.isArray(t)?us(e,{$:null},null,t):Array.isArray(n)?us(e,t,null,n):Array.isArray(r)?us(e,t,n,r):us(e,t,n,null)};function fd(e={}){const t={c:(...n)=>mb(t,...n),use:(n,...r)=>n.install(t,...r),find:ds,context:{},config:e};return t}function yb(e,t){if(e===void 0)return!1;if(t){const{context:{ids:n}}=t;return n.has(e)}return ds(e)!==null}const{c:zn}=fd(),Eo="vueuc-style";function pd(e){return e&-e}class gd{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+=pd(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-=pd(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 md(e){return typeof e=="string"?document.querySelector(e):e()}const _b=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:j_(i.toRef(e,"show")),mergedTo:i.computed(()=>{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?xo("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},xo("lazy-teleport",this.$slots)):null}}),fs={top:"bottom",bottom:"top",left:"right",right:"left"},yd={start:"end",center:"center",end:"start"},Ro={top:"height",bottom:"height",left:"width",right:"width"},bb={"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"},wb={"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"},vb={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},_d={top:!0,bottom:!1,left:!0,right:!1},bd={top:"end",bottom:"start",left:"end",right:"start"};function kb(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=(f,g,m)=>{let y=0,_=0;const b=n[f]-t[g]-t[f];return b>0&&r&&(m?_=_d[g]?b:-b:y=_d[g]?b:-b),{left:y,top:_}},u=a==="left"||a==="right";if(c!=="center"){const f=vb[e],g=fs[f],m=Ro[f];if(n[m]>t[m]){if(t[f]+t[m]<n[m]){const y=(n[m]-t[m])/2;t[f]<y||t[g]<y?t[f]<t[g]?(c=yd[l],d=h(m,g,u)):d=h(m,f,u):c="center"}}else n[m]<t[m]&&t[g]<0&&t[f]>t[g]&&(c=yd[l])}else{const f=a==="bottom"||a==="top"?"left":"top",g=fs[f],m=Ro[f],y=(n[m]-t[m])/2;(t[f]<y||t[g]<y)&&(t[f]>t[g]?(c=bd[f],d=h(m,f,u)):(c=bd[g],d=h(m,g,u)))}let p=a;return t[a]<n[Ro[a]]&&t[a]<t[fs[a]]&&(p=fs[a]),{placement:c!=="center"?`${p}-${c}`:p,left:d.left,top:d.top}}function xb(e,t){return t?wb[e]:bb[e]}function Cb(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 Sb=zn([zn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),zn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[zn("> *",{pointerEvents:"all"})])]),wd=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=qt(()=>e.enabled!==void 0?e.enabled:e.show),r=i.ref(null),s=i.ref(null),o=()=>{const{syncTrigger:p}=e;p.includes("scroll")&&t.addScrollListener(c),p.includes("resize")&&t.addResizeListener(c)},a=()=>{t.removeScrollListener(c),t.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),o())});const l=di();Sb.mount({id:"vueuc/binder",head:!0,anchorMetaName:Eo,ssr:l}),i.onBeforeUnmount(()=>{a()}),X_(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const p=r.value;if(p===null)return;const f=t.targetRef,{x:g,y:m,overlap:y}=e,_=g!==void 0&&m!==void 0?G_(g,m):So(f);p.style.setProperty("--v-target-width",`${Math.round(_.width)}px`),p.style.setProperty("--v-target-height",`${Math.round(_.height)}px`);const{width:b,minWidth:S,placement:x,internalShift:v,flip:B}=e;p.setAttribute("v-placement",x),y?p.setAttribute("v-overlap",""):p.removeAttribute("v-overlap");const{style:k}=p;b==="target"?k.width=`${_.width}px`:b!==void 0?k.width=b:k.width="",S==="target"?k.minWidth=`${_.width}px`:S!==void 0?k.minWidth=S:k.minWidth="";const E=So(p),P=So(s.value),{left:N,top:j,placement:X}=kb(x,_,E,v,B,y),A=xb(X,y),{left:V,top:L,transform:J}=Cb(X,P,_,j,N,y);p.setAttribute("v-placement",X),p.style.setProperty("--v-offset-left",`${Math.round(N)}px`),p.style.setProperty("--v-offset-top",`${Math.round(j)}px`),p.style.transform=`translateX(${V}) translateY(${L}) ${J}`,p.style.setProperty("--v-transform-origin",A),p.style.transformOrigin=A};i.watch(n,p=>{p?(o(),d()):a()});const d=()=>{i.nextTick().then(c).catch(p=>console.error(p))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(p=>{i.watch(i.toRef(e,p),c)}),["teleportDisabled"].forEach(p=>{i.watch(i.toRef(e,p),d)}),i.watch(i.toRef(e,"syncTrigger"),p=>{p.includes("resize")?t.addResizeListener(c):t.removeResizeListener(c),p.includes("scroll")?t.addScrollListener(c):t.removeScrollListener(c)});const h=cs(),u=qt(()=>{const{to:p}=e;if(p!==void 0)return p;h.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:s,followerRef:r,mergedTo:u,syncPosition:c}},render(){return i.h(_b,{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,[[Qc,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var hi=[],Bb=function(){return hi.some(function(e){return e.activeTargets.length>0})},Tb=function(){return hi.some(function(e){return e.skippedTargets.length>0})},vd="ResizeObserver loop completed with undelivered notifications.",Eb=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:vd}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=vd),window.dispatchEvent(e)},ur;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(ur||(ur={}));var ui=function(e){return Object.freeze(e)},Rb=function(){function e(t,n){this.inlineSize=t,this.blockSize=n,ui(this)}return e}(),kd=function(){function e(t,n,r,s){return this.x=t,this.y=n,this.width=r,this.height=s,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ui(this)}return e.prototype.toJSON=function(){var t=this,n=t.x,r=t.y,s=t.top,o=t.right,a=t.bottom,l=t.left,c=t.width,d=t.height;return{x:n,y:r,top:s,right:o,bottom:a,left:l,width:c,height:d}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),$o=function(e){return e instanceof SVGElement&&"getBBox"in e},xd=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)},Cd=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)},$b=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},fr=typeof window<"u"?window:{},ps=new WeakMap,Sd=/auto|scroll/,Nb=/^tb|vertical/,Pb=/msie|trident/i.test(fr.navigator&&fr.navigator.userAgent),dn=function(e){return parseFloat(e||"0")},Li=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Rb((n?t:e)||0,(n?e:t)||0)},Bd=ui({devicePixelContentBoxSize:Li(),borderBoxSize:Li(),contentBoxSize:Li(),contentRect:new kd(0,0,0,0)}),Td=function(e,t){if(t===void 0&&(t=!1),ps.has(e)&&!t)return ps.get(e);if(xd(e))return ps.set(e,Bd),Bd;var n=getComputedStyle(e),r=$o(e)&&e.ownerSVGElement&&e.getBBox(),s=!Pb&&n.boxSizing==="border-box",o=Nb.test(n.writingMode||""),a=!r&&Sd.test(n.overflowY||""),l=!r&&Sd.test(n.overflowX||""),c=r?0:dn(n.paddingTop),d=r?0:dn(n.paddingRight),h=r?0:dn(n.paddingBottom),u=r?0:dn(n.paddingLeft),p=r?0:dn(n.borderTopWidth),f=r?0:dn(n.borderRightWidth),g=r?0:dn(n.borderBottomWidth),m=r?0:dn(n.borderLeftWidth),y=u+d,_=c+h,b=m+f,S=p+g,x=l?e.offsetHeight-S-e.clientHeight:0,v=a?e.offsetWidth-b-e.clientWidth:0,B=s?y+b:0,k=s?_+S:0,E=r?r.width:dn(n.width)-B-v,P=r?r.height:dn(n.height)-k-x,N=E+y+v+b,j=P+_+x+S,X=ui({devicePixelContentBoxSize:Li(Math.round(E*devicePixelRatio),Math.round(P*devicePixelRatio),o),borderBoxSize:Li(N,j,o),contentBoxSize:Li(E,P,o),contentRect:new kd(u,c,E,P)});return ps.set(e,X),X},Ed=function(e,t,n){var r=Td(e,n),s=r.borderBoxSize,o=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case ur.DEVICE_PIXEL_CONTENT_BOX:return a;case ur.BORDER_BOX:return s;default:return o}},Fb=function(){function e(t){var n=Td(t);this.target=t,this.contentRect=n.contentRect,this.borderBoxSize=ui([n.borderBoxSize]),this.contentBoxSize=ui([n.contentBoxSize]),this.devicePixelContentBoxSize=ui([n.devicePixelContentBoxSize])}return e}(),Rd=function(e){if(xd(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Mb=function(){var e=1/0,t=[];hi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var h=new Fb(d.target),u=Rd(d.target);l.push(h),d.lastReportedSize=Ed(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},$d=function(e){hi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(s){s.isActive()&&(Rd(s.target)>e?n.activeTargets.push(s):n.skippedTargets.push(s))})})},Ab=function(){var e=0;for($d(e);Bb();)e=Mb(),$d(e);return Tb()&&Eb(),e>0},No,Nd=[],Vb=function(){return Nd.splice(0).forEach(function(e){return e()})},Ib=function(e){if(!No){var t=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Vb()}).observe(n,r),No=function(){n.textContent="".concat(t?t--:t++)}}Nd.push(e),No()},Ob=function(e){Ib(function(){requestAnimationFrame(e)})},gs=0,zb=function(){return!!gs},Lb=250,Db={attributes:!0,characterData:!0,childList:!0,subtree:!0},Pd=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Fd=function(e){return e===void 0&&(e=0),Date.now()+e},Po=!1,Hb=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=Lb),!Po){Po=!0;var r=Fd(t);Ob(function(){var s=!1;try{s=Ab()}finally{if(Po=!1,t=r-Fd(),!zb())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,Db)};document.body?n():fr.addEventListener("DOMContentLoaded",n)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Pd.forEach(function(n){return fr.addEventListener(n,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Pd.forEach(function(n){return fr.removeEventListener(n,t.listener,!0)}),this.stopped=!0)},e}(),Fo=new Hb,Md=function(e){!gs&&e>0&&Fo.start(),gs+=e,!gs&&Fo.stop()},Wb=function(e){return!$o(e)&&!$b(e)&&getComputedStyle(e).display==="inline"},jb=function(){function e(t,n){this.target=t,this.observedBox=n||ur.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Ed(this.target,this.observedBox,!0);return Wb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),qb=function(){function e(t,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=n}return e}(),ms=new WeakMap,Ad=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},ys=function(){function e(){}return e.connect=function(t,n){var r=new qb(t,n);ms.set(t,r)},e.observe=function(t,n,r){var s=ms.get(t),o=s.observationTargets.length===0;Ad(s.observationTargets,n)<0&&(o&&hi.push(s),s.observationTargets.push(new jb(n,r&&r.box)),Md(1),Fo.schedule())},e.unobserve=function(t,n){var r=ms.get(t),s=Ad(r.observationTargets,n),o=r.observationTargets.length===1;s>=0&&(o&&hi.splice(hi.indexOf(r),1),r.observationTargets.splice(s,1),Md(-1))},e.disconnect=function(t){var n=this,r=ms.get(t);r.observationTargets.slice().forEach(function(s){return n.unobserve(t,s.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Xb=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.");ys.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(!Cd(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ys.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(!Cd(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ys.unobserve(this,t)},e.prototype.disconnect=function(){ys.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Yb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Xb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const n of t){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(t,n){this.elHandlersMap.set(t,n),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const pr=new Yb,_s=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){od("resize-observer","$el does not exist.");return}if(s.nextElementSibling!==s.nextSibling&&s.nodeType===3&&s.nodeValue!==""){od("resize-observer","$el can not be observed (it may be a text node).");return}s.nextElementSibling!==null&&(pr.registerHandler(s.nextElementSibling,r),t=!0)}),i.onBeforeUnmount(()=>{t&&pr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let bs;function Ub(){return typeof document>"u"?!1:(bs===void 0&&("matchMedia"in window?bs=window.matchMedia("(pointer:coarse)").matches:bs=!1),bs)}let Mo;function Vd(){return typeof document>"u"?1:(Mo===void 0&&(Mo="chrome"in window?window.devicePixelRatio:1),Mo)}const Id="VVirtualListXScroll";function Gb({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 gd(d.length,0);return d.forEach((u,p)=>{h.add(p,u.width)}),h}),a=qt(()=>{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=qt(()=>{const d=o.value;return d!==null?Math.min(d.getBound(s.value+r.value)+1,e.value.length-1):0});return i.provide(Id,{startIndexRef:a,endIndexRef:c,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:s}}const Od=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(Id);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}}),Kb=zn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[zn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[zn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Zb=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=di();Kb.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Eo,ssr:t}),i.onMounted(()=>{const{defaultScrollIndex:A,defaultScrollKey:V}=e;A!=null?y({index:A}):V!=null&&y({key:V})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:f.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const s=qt(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let A=0;return e.columns.forEach(V=>{A+=V.width}),A}),o=i.computed(()=>{const A=new Map,{keyField:V}=e;return e.items.forEach((L,J)=>{A.set(L[V],J)}),A}),{scrollLeftRef:a,listWidthRef:l}=Gb({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:A,itemSize:V,keyField:L}=e,J=new gd(A.length,V);return A.forEach((F,R)=>{const $=F[L],M=h.get($);M!==void 0&&J.add(R,M)}),J}),p=i.ref(0),f=i.ref(0),g=qt(()=>Math.max(u.value.getBound(f.value-cr(e.paddingTop))-1,0)),m=i.computed(()=>{const{value:A}=d;if(A===void 0)return[];const{items:V,itemSize:L}=e,J=g.value,F=Math.min(J+Math.ceil(A/L+1),V.length-1),R=[];for(let $=J;$<=F;++$)R.push(V[$]);return R}),y=(A,V)=>{if(typeof A=="number"){x(A,V,"auto");return}const{left:L,top:J,index:F,key:R,position:$,behavior:M,debounce:U=!0}=A;if(L!==void 0||J!==void 0)x(L,J,M);else if(F!==void 0)S(F,M,U);else if(R!==void 0){const z=o.value.get(R);z!==void 0&&S(z,M,U)}else $==="bottom"?x(0,Number.MAX_SAFE_INTEGER,M):$==="top"&&x(0,0,M)};let _,b=null;function S(A,V,L){const{value:J}=u,F=J.sum(A)+cr(e.paddingTop);if(!L)c.value.scrollTo({left:0,top:F,behavior:V});else{_=A,b!==null&&window.clearTimeout(b),b=window.setTimeout(()=>{_=void 0,b=null},16);const{scrollTop:R,offsetHeight:$}=c.value;if(F>R){const M=J.get(A);F+M<=R+$||c.value.scrollTo({left:0,top:F+M-$,behavior:V})}else c.value.scrollTo({left:0,top:F,behavior:V})}}function x(A,V,L){c.value.scrollTo({left:A,top:V,behavior:L})}function v(A,V){var L,J,F;if(n||e.ignoreItemResize||X(V.target))return;const{value:R}=u,$=o.value.get(A),M=R.get($),U=(F=(J=(L=V.borderBoxSize)===null||L===void 0?void 0:L[0])===null||J===void 0?void 0:J.blockSize)!==null&&F!==void 0?F:V.contentRect.height;if(U===M)return;U-e.itemSize===0?h.delete(A):h.set(A,U-e.itemSize);const O=U-M;if(O===0)return;R.add($,O);const ee=c.value;if(ee!=null){if(_===void 0){const pe=R.sum($);ee.scrollTop>pe&&ee.scrollBy(0,O)}else if($<_)ee.scrollBy(0,O);else if($===_){const pe=R.sum($);U+pe>ee.scrollTop+ee.offsetHeight&&ee.scrollBy(0,O)}j()}p.value++}const B=!Ub();let k=!1;function E(A){var V;(V=e.onScroll)===null||V===void 0||V.call(e,A),(!B||!k)&&j()}function P(A){var V;if((V=e.onWheel)===null||V===void 0||V.call(e,A),B){const L=c.value;if(L!=null){if(A.deltaX===0&&(L.scrollTop===0&&A.deltaY<=0||L.scrollTop+L.offsetHeight>=L.scrollHeight&&A.deltaY>=0))return;A.preventDefault(),L.scrollTop+=A.deltaY/Vd(),L.scrollLeft+=A.deltaX/Vd(),j(),k=!0,Hc(()=>{k=!1})}}}function N(A){if(n||X(A.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(A.contentRect.height===d.value)return}else if(A.contentRect.height===d.value&&A.contentRect.width===l.value)return;d.value=A.contentRect.height,l.value=A.contentRect.width;const{onResize:V}=e;V!==void 0&&V(A)}function j(){const{value:A}=c;A!=null&&(f.value=A.scrollTop,a.value=A.scrollLeft)}function X(A){let V=A;for(;V!==null;){if(V.style.display==="none")return!0;V=V.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:o,itemsStyle:i.computed(()=>{const{itemResizable:A}=e,V=dr(u.value.sum());return p.value,[e.itemsStyle,{boxSizing:"content-box",width:dr(s.value),height:A?"":V,minHeight:A?V:"",paddingTop:dr(e.paddingTop),paddingBottom:dr(e.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(p.value,{transform:`translateY(${dr(u.value.sum(g.value))})`})),viewportItems:m,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:N,handleListScroll:E,handleListWheel:P,handleItemResize:v}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:r}=this;return i.h(_s,{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(Od,{index:h,item:c}):void 0,p=l!=null?i.h(Od,{index:h,item:c}):void 0,f=this.$slots.default({item:c,renderedCols:u,renderedItemWithCols:p,index:h})[0];return e?i.h(_s,{key:d,onResize:g=>this.handleItemResize(d,g)},{default:()=>f}):(f.key=d,f)})}})]):(o=(s=this.$slots).empty)===null||o===void 0?void 0:o.call(s)])}})}}),bn="v-hidden",Jb=zn("[v-hidden]",{display:"none!important"}),zd=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=i.ref(null),r=i.ref(null);function s(a){const{value:l}=n,{getCounter:c,getTail:d}=e;let h;if(c!==void 0?h=c():h=r.value,!l||!h)return;h.hasAttribute(bn)&&h.removeAttribute(bn);const{children:u}=l;if(a.showAllItemsBeforeCalculate)for(const S of u)S.hasAttribute(bn)&&S.removeAttribute(bn);const p=l.offsetWidth,f=[],g=t.tail?d==null?void 0:d():null;let m=g?g.offsetWidth:0,y=!1;const _=l.children.length-(t.tail?1:0);for(let S=0;S<_-1;++S){if(S<0)continue;const x=u[S];if(y){x.hasAttribute(bn)||x.setAttribute(bn,"");continue}else x.hasAttribute(bn)&&x.removeAttribute(bn);const v=x.offsetWidth;if(m+=v,f[S]=v,m>p){const{updateCounter:B}=e;for(let k=S;k>=0;--k){const E=_-1-k;B!==void 0?B(E):h.textContent=`${E}`;const P=h.offsetWidth;if(m-=f[k],m+P<=p||k===0){y=!0,S=k-1,g&&(S===-1?(g.style.maxWidth=`${p-P}px`,g.style.boxSizing="border-box"):g.style.maxWidth="");const{onUpdateCount:N}=e;N&&N(E);break}}}}const{onUpdateOverflow:b}=e;y?b!==void 0&&b(!0):(b!==void 0&&b(!1),h.setAttribute(bn,""))}const o=di();return Jb.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Eo,ssr:o}),i.onMounted(()=>s({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:s}},render(){const{$slots:e}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(e,"default"),e.counter?e.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function Ld(e){return e instanceof HTMLElement}function Dd(e){for(let t=0;t<e.childNodes.length;t++){const n=e.childNodes[t];if(Ld(n)&&(Wd(n)||Dd(n)))return!0}return!1}function Hd(e){for(let t=e.childNodes.length-1;t>=0;t--){const n=e.childNodes[t];if(Ld(n)&&(Wd(n)||Hd(n)))return!0}return!1}function Wd(e){if(!Qb(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Qb(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}}let gr=[];const e1=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=l_(),n=i.ref(null),r=i.ref(null);let s=!1,o=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return gr[gr.length-1]===t}function c(y){var _;y.code==="Escape"&&l()&&((_=e.onEsc)===null||_===void 0||_.call(e,y))}i.onMounted(()=>{i.watch(()=>e.active,y=>{y?(u(),Bt("keydown",document,c)):(tt("keydown",document,c),s&&p())},{immediate:!0})}),i.onBeforeUnmount(()=>{tt("keydown",document,c),s&&p()});function d(y){if(!o&&l()){const _=h();if(_===null||_.contains(lr(y)))return;f("first")}}function h(){const y=n.value;if(y===null)return null;let _=y;for(;_=_.nextSibling,!(_===null||_ instanceof Element&&_.tagName==="DIV"););return _}function u(){var y;if(!e.disabled){if(gr.push(t),e.autoFocus){const{initialFocusTo:_}=e;_===void 0?f("first"):(y=md(_))===null||y===void 0||y.focus({preventScroll:!0})}s=!0,document.addEventListener("focus",d,!0)}}function p(){var y;if(e.disabled||(document.removeEventListener("focus",d,!0),gr=gr.filter(b=>b!==t),l()))return;const{finalFocusTo:_}=e;_!==void 0?(y=md(_))===null||y===void 0||y.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&a instanceof HTMLElement&&(o=!0,a.focus({preventScroll:!0}),o=!1)}function f(y){if(l()&&e.active){const _=n.value,b=r.value;if(_!==null&&b!==null){const S=h();if(S==null||S===b){o=!0,_.focus({preventScroll:!0}),o=!1;return}o=!0;const x=y==="first"?Dd(S):Hd(S);o=!1,x||(o=!0,_.focus({preventScroll:!0}),o=!1)}}}function g(y){if(o)return;const _=h();_!==null&&(y.relatedTarget!==null&&_.contains(y.relatedTarget)?f("last"):f("first"))}function m(y){o||(y.relatedTarget!==null&&y.relatedTarget===n.value?f("last"):f("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:g,handleEndFocus: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 Kk(e){return e}const Ao="n-internal-select-menu",jd="n-internal-select-menu-body",qd="n-drawer-body",Xd="n-modal-body",Yd="n-popover-body",Ud="__disabled__";function wn(e){const t=i.inject(Xd,null),n=i.inject(qd,null),r=i.inject(Yd,null),s=i.inject(jd,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(()=>{tt("fullscreenchange",document,a)})}return qt(()=>{var a;const{to:l}=e;return l!==void 0?l===!1?Ud:l===!0?o.value||"body":l:t!=null&&t.value?(a=t.value.$el)!==null&&a!==void 0?a:t.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:s!=null&&s.value?s.value:l??(o.value||"body")})}wn.tdkey=Ud,wn.propTo={type:[String,Object,Boolean],default:void 0};function t1(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 Gd(e,t){t&&(i.onMounted(()=>{const{value:n}=e;n&&pr.registerHandler(n,t)}),i.watch(e,(n,r)=>{r&&pr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=e;n&&pr.unregisterHandler(n)}))}function Kd(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const n1=/^(\d|\.)+$/,Zd=/(\d|\.)+/;function Vo(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(n1.test(e)){const s=(Number(e)+n)*t;return r?s===0?"0":`${s}px`:`${s}`}else{const s=Zd.exec(e);return s?e.replace(Zd,String((Number(s[0])+n)*t)):e}return e}function Jd(e){const{left:t,right:n,top:r,bottom:s}=Gt(e);return`${r} ${t} ${s} ${n}`}var Qd={};function i1(e){let t=".",n="__",r="--",s;if(e){let g=e.blockPrefix;g&&(t=g),g=e.elementPrefix,g&&(n=g),g=e.modifierPrefix,g&&(r=g)}const o={install(g){s=g.c;const m=g.context;m.bem={},m.bem.b=null,m.bem.els=null}};function a(g){let m,y;return{before(_){m=_.bem.b,y=_.bem.els,_.bem.els=null},after(_){_.bem.b=m,_.bem.els=y},$({context:_,props:b}){return g=typeof g=="string"?g:g({context:_,props:b}),_.bem.b=g,`${(b==null?void 0:b.bPrefix)||t}${_.bem.b}`}}}function l(g){let m;return{before(y){m=y.bem.els},after(y){y.bem.els=m},$({context:y,props:_}){return g=typeof g=="string"?g:g({context:y,props:_}),y.bem.els=g.split(",").map(b=>b.trim()),y.bem.els.map(b=>`${(_==null?void 0:_.bPrefix)||t}${y.bem.b}${n}${b}`).join(", ")}}}function c(g){return{$({context:m,props:y}){g=typeof g=="string"?g:g({context:m,props:y});const _=g.split(",").map(x=>x.trim());function b(x){return _.map(v=>`&${(y==null?void 0:y.bPrefix)||t}${m.bem.b}${x!==void 0?`${n}${x}`:""}${r}${v}`).join(", ")}const S=m.bem.els;if(S!==null){if(Qd.NODE_ENV!=="production"&&S.length>=2)throw Error(`[css-render/plugin-bem]: m(${g}) is invalid, using modifier inside multiple elements is not allowed`);return b(S[0])}else return b()}}}function d(g){return{$({context:m,props:y}){g=typeof g=="string"?g:g({context:m,props:y});const _=m.bem.els;if(Qd.NODE_ENV!=="production"&&_!==null&&_.length>=2)throw Error(`[css-render/plugin-bem]: notM(${g}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||t}${m.bem.b}${_!==null&&_.length>0?`${n}${_[0]}`:""}${r}${g})`}}}return Object.assign(o,{cB:(...g)=>s(a(g[0]),g[1],g[2]),cE:(...g)=>s(l(g[0]),g[1],g[2]),cM:(...g)=>s(c(g[0]),g[1],g[2]),cNotM:(...g)=>s(d(g[0]),g[1],g[2])}),o}const r1=".n-",s1="__",o1="--",eh=fd(),th=i1({blockPrefix:r1,elementPrefix:s1,modifierPrefix:o1});eh.use(th);const{c:ae,find:Jk}=eh,{cB:ue,cE:ye,cM:Se,cNotM:Kt}=th,a1=(...e)=>ae(">",[ue(...e)]);function Xe(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,n=>n.toUpperCase()))}let Io;function l1(){return Io===void 0&&(Io=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),Io}const c1=new WeakSet;function d1(e){c1.add(e)}function nh(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}const ih=new Set;function Ln(e,t){const n=`[naive/${e}]: ${t}`;ih.has(n)||(ih.add(n),console.error(n))}function rh(e,t){console.error(`[naive/${e}]: ${t}`)}function sh(e,t){throw new Error(`[naive/${e}]: ${t}`)}function ft(e,...t){if(Array.isArray(e))e.forEach(n=>ft(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 h1(e,t="default",n=void 0){const r=e[t];if(!r)return rh("getFirstSlotVNode",`slot[${t}] is empty`),null;const s=Oo(r(n));return s.length===1?s[0]:(rh("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function u1(e,t=[],n){const r={};return t.forEach(s=>{r[s]=e[s]}),Object.assign(r,n)}function zo(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(r=>{r&&r(n)})}}function Di(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?i.createTextVNode(e):typeof e=="number"?i.createTextVNode(String(e)):null}function ws(e){return e.some(t=>i.isVNode(t)?!(t.type===i.Comment||t.type===i.Fragment&&!ws(t.children)):!0)?e:null}function Lo(e,t){return e&&ws(e())||t()}function fi(e,t){const n=e&&ws(e());return t(n||null)}function oh(e){return!(e&&ws(e()))}const Do=i.defineComponent({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),pi="n-config-provider",f1="n";function gi(e={},t={defaultBordered:!0}){const n=i.inject(pi,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,s;const{bordered:o}=e;return o!==void 0?o:(s=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&s!==void 0?s:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(f1),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function mi(e,t,n,r){n||sh("useThemeClass","cssVarsRef is not passed");const s=i.inject(pi,null),o=s==null?void 0:s.mergedThemeHashRef,a=s==null?void 0:s.styleMountTarget,l=i.ref(""),c=di();let d;const h=`__${e}`,u=()=>{let p=h;const f=t?t.value:void 0,g=o==null?void 0:o.value;g&&(p+=`-${g}`),f&&(p+=`-${f}`);const{themeOverrides:m,builtinThemeOverrides:y}=r;m&&(p+=`-${To(JSON.stringify(m))}`),y&&(p+=`-${To(JSON.stringify(y))}`),l.value=p,d=()=>{const _=n.value;let b="";for(const S in _)b+=`${S}: ${_[S]};`;ae(`.${p}`,b).mount({id:p,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{u()}),{themeClass:l,onRender:()=>{d==null||d()}}}const ah="n-form-item";function p1(e,{defaultSize:t="medium",mergedSize:n,mergedDisabled:r}={}){const s=i.inject(ah,null);i.provide(ah,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 g1={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}};function Ho(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function mr(e){return(t,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let s;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=n!=null&&n.width?String(n.width):a;s=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=n!=null&&n.width?String(n.width):e.defaultWidth;s=e.values[l]||e.values[a]}const o=e.argumentCallback?e.argumentCallback(t):t;return s[o]}}function yr(e){return(t,n={})=>{const r=n.width,s=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],o=t.match(s);if(!o)return null;const a=o[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(l)?y1(l,u=>u.test(a)):m1(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 m1(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function y1(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function _1(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 b1={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"}},w1=(e,t,n)=>{let r;const s=b1[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},v1={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},k1=(e,t,n,r)=>v1[e],x1={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},C1={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},S1={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"]},B1={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"]},T1={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"}},E1={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"}},R1={ordinalNumber:(e,t)=>{const n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:mr({values:x1,defaultWidth:"wide"}),quarter:mr({values:C1,defaultWidth:"wide",argumentCallback:e=>e-1}),month:mr({values:S1,defaultWidth:"wide"}),day:mr({values:B1,defaultWidth:"wide"}),dayPeriod:mr({values:T1,defaultWidth:"wide",formattingValues:E1,defaultFormattingWidth:"wide"})},$1=/^(\d+)(th|st|nd|rd)?/i,N1=/\d+/i,P1={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},F1={any:[/^b/i,/^(a|c)/i]},M1={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},A1={any:[/1/i,/2/i,/3/i,/4/i]},V1={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},I1={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]},O1={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},z1={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]},L1={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},D1={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}},H1={ordinalNumber:_1({matchPattern:$1,parsePattern:N1,valueCallback:e=>parseInt(e,10)}),era:yr({matchPatterns:P1,defaultMatchWidth:"wide",parsePatterns:F1,defaultParseWidth:"any"}),quarter:yr({matchPatterns:M1,defaultMatchWidth:"wide",parsePatterns:A1,defaultParseWidth:"any",valueCallback:e=>e+1}),month:yr({matchPatterns:V1,defaultMatchWidth:"wide",parsePatterns:I1,defaultParseWidth:"any"}),day:yr({matchPatterns:O1,defaultMatchWidth:"wide",parsePatterns:z1,defaultParseWidth:"any"}),dayPeriod:yr({matchPatterns:L1,defaultMatchWidth:"any",parsePatterns:D1,defaultParseWidth:"any"})},W1={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},j1={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},q1={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},X1={date:Ho({formats:W1,defaultWidth:"full"}),time:Ho({formats:j1,defaultWidth:"full"}),dateTime:Ho({formats:q1,defaultWidth:"full"})},Y1={name:"en-US",locale:{code:"en-US",formatDistance:w1,formatLong:X1,formatRelative:k1,localize:R1,match:H1,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function lh(e){const{mergedLocaleRef:t,mergedDateLocaleRef:n}=i.inject(pi,null)||{},r=i.computed(()=>{var o,a;return(a=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o[e])!==null&&a!==void 0?a:g1[e]});return{dateLocaleRef:i.computed(()=>{var o;return(o=n==null?void 0:n.value)!==null&&o!==void 0?o:Y1}),localeRef:r}}const _r="naive-ui-style";function vs(e,t,n){if(!t)return;const r=di(),s=i.computed(()=>{const{value:l}=t;if(!l)return;const c=l[e];if(c)return c}),o=i.inject(pi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${e}Rtl`;if(yb(c,r))return;const{value:d}=s;d&&d.style.mount({id:c,head:!0,anchorMetaName:_r,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget})})};return r?a():i.onBeforeMount(a),s}const br={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:U1,fontFamily:G1,lineHeight:K1}=br,ch=ae("body",`
|
|
117
117
|
margin: 0;
|
|
118
|
-
font-size: ${
|
|
119
|
-
font-family: ${
|
|
120
|
-
line-height: ${
|
|
118
|
+
font-size: ${U1};
|
|
119
|
+
font-family: ${G1};
|
|
120
|
+
line-height: ${K1};
|
|
121
121
|
-webkit-text-size-adjust: 100%;
|
|
122
122
|
-webkit-tap-highlight-color: transparent;
|
|
123
123
|
`,[ae("input",`
|
|
124
124
|
font-family: inherit;
|
|
125
125
|
font-size: inherit;
|
|
126
|
-
`)]);var
|
|
126
|
+
`)]);var Z1={};function ks(e,t,n){if(!t){Z1.NODE_ENV!=="production"&&sh("use-style","No style is specified.");return}const r=di(),s=i.inject(pi,null),o=()=>{const a=n.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:_r,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget}),s!=null&&s.preflightStyleDisabled||ch.mount({id:"n-global",head:!0,anchorMetaName:_r,ssr:r,parent:s==null?void 0:s.styleMountTarget})};r?o():i.onBeforeMount(o)}function tx(e){return e}function pt(e,t,n,r,s,o){const a=di(),l=i.inject(pi,null);if(n){const d=()=>{const h=o==null?void 0:o.value;n.mount({id:h===void 0?t:h+t,head:!0,props:{bPrefix:h?`.${h}-`:void 0},anchorMetaName:_r,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ch.mount({id:"n-global",head:!0,anchorMetaName:_r,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:h,self:u,peers:p={}}={},themeOverrides:f={},builtinThemeOverrides:g={}}=s,{common:m,peers:y}=f,{common:_=void 0,[e]:{common:b=void 0,self:S=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:v=void 0,[e]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:k,peers:E={}}=B,P=D.merge({},h||b||_||r.common,v,k,m),N=D.merge((d=u||S||r.self)===null||d===void 0?void 0:d(P),g,B,f);return{common:P,self:N,peers:D.merge({},r.peers,x,p),peerOverrides:D.merge({},g.peers,E,y)}})}pt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const J1=ue("base-icon",`
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
line-height: 1em;
|
|
@@ -134,12 +134,12 @@ ${s}
|
|
|
134
134
|
`,[ae("svg",`
|
|
135
135
|
height: 1em;
|
|
136
136
|
width: 1em;
|
|
137
|
-
`)]),wr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){ks("-base-icon",
|
|
137
|
+
`)]),wr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){ks("-base-icon",J1,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)}}),dh=i.defineComponent({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const n=cs();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},t)}});function hh(e,t){const n=i.defineComponent({render(){return t()}});return i.defineComponent({name:D.upperFirst(e),setup(){var r;const s=(r=i.inject(pi,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var o;const a=(o=s==null?void 0:s.value)===null||o===void 0?void 0:o[e];return a?a():i.h(n,null)}}})}const Q1=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"})))}}),ew=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"}))}}),tw=hh("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"}))))),nw=hh("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"}))))),iw=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:rw}=br;function Wo({originalTransform:e="",left:t=0,top:n=0,transition:r=`all .3s ${rw} !important`}={}){return[ae("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:n,opacity:0}),ae("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),ae("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:n,transition:r})]}const sw=ue("base-clear",`
|
|
138
138
|
flex-shrink: 0;
|
|
139
139
|
height: 1em;
|
|
140
140
|
width: 1em;
|
|
141
141
|
position: relative;
|
|
142
|
-
`,[ae(">",[
|
|
142
|
+
`,[ae(">",[ye("clear",`
|
|
143
143
|
font-size: var(--n-clear-size);
|
|
144
144
|
height: 1em;
|
|
145
145
|
width: 1em;
|
|
@@ -151,14 +151,14 @@ ${s}
|
|
|
151
151
|
color: var(--n-clear-color-hover)!important;
|
|
152
152
|
`),ae("&:active",`
|
|
153
153
|
color: var(--n-clear-color-pressed)!important;
|
|
154
|
-
`)]),
|
|
154
|
+
`)]),ye("placeholder",`
|
|
155
155
|
display: flex;
|
|
156
|
-
`),
|
|
156
|
+
`),ye("clear, placeholder",`
|
|
157
157
|
position: absolute;
|
|
158
158
|
left: 50%;
|
|
159
159
|
top: 50%;
|
|
160
160
|
transform: translateX(-50%) translateY(-50%);
|
|
161
|
-
`,[Wo({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),
|
|
161
|
+
`,[Wo({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),ow=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return ks("-base-clear",sw,i.toRef(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return i.h("div",{class:`${e}-base-clear`},i.h(dh,null,{default:()=>{var t,n;return this.show?i.h("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Lo(this.$slots.icon,()=>[i.h(wr,{clsPrefix:e},{default:()=>i.h(tw,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))}}))}}),aw=ue("base-close",`
|
|
162
162
|
display: flex;
|
|
163
163
|
align-items: center;
|
|
164
164
|
justify-content: center;
|
|
@@ -186,7 +186,7 @@ ${s}
|
|
|
186
186
|
transform: translateY(-50%) translateX(-50%);
|
|
187
187
|
transition: inherit;
|
|
188
188
|
border-radius: inherit;
|
|
189
|
-
`),
|
|
189
|
+
`),Kt("disabled",[ae("&:hover",`
|
|
190
190
|
color: var(--n-close-icon-color-hover);
|
|
191
191
|
`),ae("&:hover::before",`
|
|
192
192
|
background-color: var(--n-close-color-hover);
|
|
@@ -202,7 +202,7 @@ ${s}
|
|
|
202
202
|
background-color: transparent;
|
|
203
203
|
`),Se("round",[ae("&::before",`
|
|
204
204
|
border-radius: 50%;
|
|
205
|
-
`)])]),
|
|
205
|
+
`)])]),lw=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 ks("-base-close",aw,i.toRef(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:n,absolute:r,round:s,isButtonTag:o}=e,a=o?"button":"div";return i.h(a,{type:o?"button":void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:o?void 0:"button",disabled:n,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,s&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},i.h(wr,{clsPrefix:t},{default:()=>i.h(nw,null)}))}}}),cw=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})}}),dw=ae([ae("@keyframes rotator",`
|
|
206
206
|
0% {
|
|
207
207
|
-webkit-transform: rotate(0deg);
|
|
208
208
|
transform: rotate(0deg);
|
|
@@ -210,32 +210,32 @@ ${s}
|
|
|
210
210
|
100% {
|
|
211
211
|
-webkit-transform: rotate(360deg);
|
|
212
212
|
transform: rotate(360deg);
|
|
213
|
-
}`),
|
|
213
|
+
}`),ue("base-loading",`
|
|
214
214
|
position: relative;
|
|
215
215
|
line-height: 0;
|
|
216
216
|
width: 1em;
|
|
217
217
|
height: 1em;
|
|
218
|
-
`,[
|
|
218
|
+
`,[ye("transition-wrapper",`
|
|
219
219
|
position: absolute;
|
|
220
220
|
width: 100%;
|
|
221
221
|
height: 100%;
|
|
222
|
-
`,[Wo()]),
|
|
222
|
+
`,[Wo()]),ye("placeholder",`
|
|
223
223
|
position: absolute;
|
|
224
224
|
left: 50%;
|
|
225
225
|
top: 50%;
|
|
226
226
|
transform: translateX(-50%) translateY(-50%);
|
|
227
|
-
`,[Wo({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),
|
|
227
|
+
`,[Wo({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),ye("container",`
|
|
228
228
|
animation: rotator 3s linear infinite both;
|
|
229
|
-
`,[
|
|
229
|
+
`,[ye("icon",`
|
|
230
230
|
height: 1em;
|
|
231
231
|
width: 1em;
|
|
232
|
-
`)])])]),jo="1.6s",
|
|
232
|
+
`)])])]),jo="1.6s",hw={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},uh=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}},hw),setup(e){ks("-base-loading",dw,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(dh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},i.h("div",{class:`${e}-base-loading__container`},i.h("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*o} ${2*o}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};270 ${o} ${o}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:o,cy:o,r:t-n/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:jo,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:fh}=br;function uw({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=fh,leaveCubicBezier:s=fh}={}){return[ae(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),ae(`&.${e}-transition-leave-active`,{transition:`all ${n} ${s}!important`}),ae(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),ae(`&.${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"},fw=li(de.neutralBase),ph=li(de.neutralInvertBase),pw=`rgba(${ph.slice(0,3).join(", ")}, `;function gh(e){return`${pw+String(e)})`}function gt(e){const t=Array.from(ph);return t[3]=Number(e),o_(fw,t)}const yi=Object.assign(Object.assign({name:"common"},br),{baseColor:de.neutralBase,primaryColor:de.primaryDefault,primaryColorHover:de.primaryHover,primaryColorPressed:de.primaryActive,primaryColorSuppl:de.primarySuppl,infoColor:de.infoDefault,infoColorHover:de.infoHover,infoColorPressed:de.infoActive,infoColorSuppl:de.infoSuppl,successColor:de.successDefault,successColorHover:de.successHover,successColorPressed:de.successActive,successColorSuppl:de.successSuppl,warningColor:de.warningDefault,warningColorHover:de.warningHover,warningColorPressed:de.warningActive,warningColorSuppl:de.warningSuppl,errorColor:de.errorDefault,errorColorHover:de.errorHover,errorColorPressed:de.errorActive,errorColorSuppl:de.errorSuppl,textColorBase:de.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:gt(de.alpha4),placeholderColor:gt(de.alpha4),placeholderColorDisabled:gt(de.alpha5),iconColor:gt(de.alpha4),iconColorHover:rs(gt(de.alpha4),{lightness:.75}),iconColorPressed:rs(gt(de.alpha4),{lightness:.9}),iconColorDisabled:gt(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:gt(Number(de.alphaClose)),closeIconColorHover:gt(Number(de.alphaClose)),closeIconColorPressed:gt(Number(de.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:gt(de.alpha4),clearColorHover:rs(gt(de.alpha4),{lightness:.75}),clearColorPressed:rs(gt(de.alpha4),{lightness:.9}),scrollbarColor:gh(de.alphaScrollbar),scrollbarColorHover:gh(de.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:gt(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:gt(de.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:gt(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)"}),gw={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function mw(e){const{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:s,scrollbarBorderRadius:o}=e;return Object.assign(Object.assign({},gw),{height:r,width:s,borderRadius:o,color:t,colorHover:n})}const mh={name:"Scrollbar",common:yi,self:mw},yw=ue("scrollbar",`
|
|
233
233
|
overflow: hidden;
|
|
234
234
|
position: relative;
|
|
235
235
|
z-index: auto;
|
|
236
236
|
height: 100%;
|
|
237
237
|
width: 100%;
|
|
238
|
-
`,[ae(">",[
|
|
238
|
+
`,[ae(">",[ue("scrollbar-container",`
|
|
239
239
|
width: 100%;
|
|
240
240
|
overflow: scroll;
|
|
241
241
|
height: 100%;
|
|
@@ -246,10 +246,10 @@ ${s}
|
|
|
246
246
|
width: 0;
|
|
247
247
|
height: 0;
|
|
248
248
|
display: none;
|
|
249
|
-
`),ae(">",[
|
|
249
|
+
`),ae(">",[ue("scrollbar-content",`
|
|
250
250
|
box-sizing: border-box;
|
|
251
251
|
min-width: 100%;
|
|
252
|
-
`)])])]),ae(">, +",[
|
|
252
|
+
`)])])]),ae(">, +",[ue("scrollbar-rail",`
|
|
253
253
|
position: absolute;
|
|
254
254
|
pointer-events: none;
|
|
255
255
|
user-select: none;
|
|
@@ -257,7 +257,7 @@ ${s}
|
|
|
257
257
|
-webkit-user-select: none;
|
|
258
258
|
`,[Se("horizontal",`
|
|
259
259
|
height: var(--n-scrollbar-height);
|
|
260
|
-
`,[ae(">",[
|
|
260
|
+
`,[ae(">",[ye("scrollbar",`
|
|
261
261
|
height: var(--n-scrollbar-height);
|
|
262
262
|
border-radius: var(--n-scrollbar-border-radius);
|
|
263
263
|
right: 0;
|
|
@@ -273,7 +273,7 @@ ${s}
|
|
|
273
273
|
left: var(--n-scrollbar-rail-left-horizontal-bottom);
|
|
274
274
|
`),Se("vertical",`
|
|
275
275
|
width: var(--n-scrollbar-width);
|
|
276
|
-
`,[ae(">",[
|
|
276
|
+
`,[ae(">",[ye("scrollbar",`
|
|
277
277
|
width: var(--n-scrollbar-width);
|
|
278
278
|
border-radius: var(--n-scrollbar-border-radius);
|
|
279
279
|
bottom: 0;
|
|
@@ -287,19 +287,19 @@ ${s}
|
|
|
287
287
|
right: var(--n-scrollbar-rail-right-vertical-right);
|
|
288
288
|
bottom: var(--n-scrollbar-rail-bottom-vertical-right);
|
|
289
289
|
left: var(--n-scrollbar-rail-left-vertical-right);
|
|
290
|
-
`),Se("disabled",[ae(">",[
|
|
290
|
+
`),Se("disabled",[ae(">",[ye("scrollbar","pointer-events: none;")])]),ae(">",[ye("scrollbar",`
|
|
291
291
|
z-index: 1;
|
|
292
292
|
position: absolute;
|
|
293
293
|
cursor: pointer;
|
|
294
294
|
pointer-events: all;
|
|
295
295
|
background-color: var(--n-scrollbar-color);
|
|
296
296
|
transition: background-color .2s var(--n-scrollbar-bezier);
|
|
297
|
-
`,[ow(),ae("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),uw=Object.assign(Object.assign({},_t.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),gh=i.defineComponent({name:"Scrollbar",props:uw,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=gi(e),s=vs("Scrollbar",r,t),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),p=i.ref(null),u=i.ref(null),g=i.ref(null),m=i.ref(null),_=i.ref(0),y=i.ref(0),b=i.ref(!1),S=i.ref(!1);let x=!1,v=!1,B,k,R=0,P=0,N=0,W=0;const q=Hy(),F=_t("Scrollbar","-scrollbar",hw,ph,e,t),M=i.computed(()=>{const{value:E}=p,{value:H}=h,{value:ee}=g;return E===null||H===null||ee===null?0:Math.min(E,ee*E/H+cr(F.value.self.width)*1.5)}),I=i.computed(()=>`${M.value}px`),Z=i.computed(()=>{const{value:E}=u,{value:H}=f,{value:ee}=m;return E===null||H===null||ee===null?0:ee*E/H+cr(F.value.self.height)*1.5}),T=i.computed(()=>`${Z.value}px`),$=i.computed(()=>{const{value:E}=p,{value:H}=_,{value:ee}=h,{value:le}=g;if(E===null||ee===null||le===null)return 0;{const ce=ee-E;return ce?H/ce*(le-M.value):0}}),j=i.computed(()=>`${$.value}px`),z=i.computed(()=>{const{value:E}=u,{value:H}=y,{value:ee}=f,{value:le}=m;if(E===null||ee===null||le===null)return 0;{const ce=ee-E;return ce?H/ce*(le-Z.value):0}}),Y=i.computed(()=>`${z.value}px`),V=i.computed(()=>{const{value:E}=p,{value:H}=h;return E!==null&&H!==null&&H>E}),O=i.computed(()=>{const{value:E}=u,{value:H}=f;return E!==null&&H!==null&&H>E}),J=i.computed(()=>{const{trigger:E}=e;return E==="none"||b.value}),ge=i.computed(()=>{const{trigger:E}=e;return E==="none"||S.value}),re=i.computed(()=>{const{container:E}=e;return E?E():a.value}),he=i.computed(()=>{const{content:E}=e;return E?E():l.value}),se=(E,H)=>{if(!e.scrollable)return;if(typeof E=="number"){dt(E,H??0,0,!1,"auto");return}const{left:ee,top:le,index:ce,elSize:me,position:be,behavior:ke,el:je,debounce:pn=!0}=E;(ee!==void 0||le!==void 0)&&dt(ee??0,le??0,0,!1,ke),je!==void 0?dt(0,je.offsetTop,je.offsetHeight,pn,ke):ce!==void 0&&me!==void 0?dt(0,ce*me,me,pn,ke):be==="bottom"?dt(0,Number.MAX_SAFE_INTEGER,0,!1,ke):be==="top"&&dt(0,0,0,!1,ke)},Pe=Gb(()=>{e.container||se({top:_.value,left:y.value})}),Fe=()=>{Pe.isDeactivated||ie()},Ze=E=>{if(Pe.isDeactivated)return;const{onResize:H}=e;H&&H(E),ie()},Le=(E,H)=>{if(!e.scrollable)return;const{value:ee}=re;ee&&(typeof E=="object"?ee.scrollBy(E):ee.scrollBy(E,H||0))};function dt(E,H,ee,le,ce){const{value:me}=re;if(me){if(le){const{scrollTop:be,offsetHeight:ke}=me;if(H>be){H+ee<=be+ke||me.scrollTo({left:E,top:H+ee-ke,behavior:ce});return}}me.scrollTo({left:E,top:H,behavior:ce})}}function Zt(){un(),Ue(),ie()}function Oe(){Ce()}function Ce(){Je(),Qe()}function Je(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{S.value=!1},e.duration)}function Qe(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{b.value=!1},e.duration)}function un(){B!==void 0&&window.clearTimeout(B),b.value=!0}function Ue(){k!==void 0&&window.clearTimeout(k),S.value=!0}function Ft(E){const{onScroll:H}=e;H&&H(E),fn()}function fn(){const{value:E}=re;E&&(_.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1))}function ht(){const{value:E}=he;E&&(h.value=E.offsetHeight,f.value=E.offsetWidth);const{value:H}=re;H&&(p.value=H.offsetHeight,u.value=H.offsetWidth);const{value:ee}=d,{value:le}=c;ee&&(m.value=ee.offsetWidth),le&&(g.value=le.offsetHeight)}function ne(){const{value:E}=re;E&&(_.value=E.scrollTop,y.value=E.scrollLeft*(s!=null&&s.value?-1:1),p.value=E.offsetHeight,u.value=E.offsetWidth,h.value=E.scrollHeight,f.value=E.scrollWidth);const{value:H}=d,{value:ee}=c;H&&(m.value=H.offsetWidth),ee&&(g.value=ee.offsetHeight)}function ie(){e.scrollable&&(e.useUnifiedContainer?ne():(ht(),fn()))}function We(E){var H;return!(!((H=o.value)===null||H===void 0)&&H.contains(lr(E)))}function kr(E){E.preventDefault(),E.stopPropagation(),v=!0,Bt("mousemove",window,Hi,!0),Bt("mouseup",window,wi,!0),P=y.value,N=s!=null&&s.value?window.innerWidth-E.clientX:E.clientX}function Hi(E){if(!v)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:H}=u,{value:ee}=f,{value:le}=Z;if(H===null||ee===null)return;const me=(s!=null&&s.value?window.innerWidth-E.clientX-N:E.clientX-N)*(ee-H)/(H-le),be=ee-H;let ke=P+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=re;if(je){je.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:pn}=e;pn&&pn(ke)}}function wi(E){E.preventDefault(),E.stopPropagation(),it("mousemove",window,Hi,!0),it("mouseup",window,wi,!0),v=!1,ie(),We(E)&&Ce()}function Wi(E){E.preventDefault(),E.stopPropagation(),x=!0,Bt("mousemove",window,Hn,!0),Bt("mouseup",window,vi,!0),R=_.value,W=E.clientY}function Hn(E){if(!x)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:H}=p,{value:ee}=h,{value:le}=M;if(H===null||ee===null)return;const me=(E.clientY-W)*(ee-H)/(H-le),be=ee-H;let ke=R+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=re;je&&(je.scrollTop=ke)}function vi(E){E.preventDefault(),E.stopPropagation(),it("mousemove",window,Hn,!0),it("mouseup",window,vi,!0),x=!1,ie(),We(E)&&Ce()}i.watchEffect(()=>{const{value:E}=O,{value:H}=V,{value:ee}=t,{value:le}=d,{value:ce}=c;le&&(E?le.classList.remove(`${ee}-scrollbar-rail--disabled`):le.classList.add(`${ee}-scrollbar-rail--disabled`)),ce&&(H?ce.classList.remove(`${ee}-scrollbar-rail--disabled`):ce.classList.add(`${ee}-scrollbar-rail--disabled`))}),i.onMounted(()=>{e.container||ie()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k),it("mousemove",window,Hn,!0),it("mouseup",window,vi,!0)});const ji=i.computed(()=>{const{common:{cubicBezierEaseInOut:E},self:{color:H,colorHover:ee,height:le,width:ce,borderRadius:me,railInsetHorizontalTop:be,railInsetHorizontalBottom:ke,railInsetVerticalRight:je,railInsetVerticalLeft:pn,railColor:Zo}}=F.value,{top:Jo,right:Qo,bottom:ea,left:ta}=Ut(be),{top:na,right:ia,bottom:ra,left:sa}=Ut(ke),{top:oa,right:aa,bottom:la,left:ca}=Ut(s!=null&&s.value?Kd(je):je),{top:da,right:ha,bottom:ua,left:fa}=Ut(s!=null&&s.value?Kd(pn):pn);return{"--n-scrollbar-bezier":E,"--n-scrollbar-color":H,"--n-scrollbar-color-hover":ee,"--n-scrollbar-border-radius":me,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":Jo,"--n-scrollbar-rail-right-horizontal-top":Qo,"--n-scrollbar-rail-bottom-horizontal-top":ea,"--n-scrollbar-rail-left-horizontal-top":ta,"--n-scrollbar-rail-top-horizontal-bottom":na,"--n-scrollbar-rail-right-horizontal-bottom":ia,"--n-scrollbar-rail-bottom-horizontal-bottom":ra,"--n-scrollbar-rail-left-horizontal-bottom":sa,"--n-scrollbar-rail-top-vertical-right":oa,"--n-scrollbar-rail-right-vertical-right":aa,"--n-scrollbar-rail-bottom-vertical-right":la,"--n-scrollbar-rail-left-vertical-right":ca,"--n-scrollbar-rail-top-vertical-left":da,"--n-scrollbar-rail-right-vertical-left":ha,"--n-scrollbar-rail-bottom-vertical-left":ua,"--n-scrollbar-rail-left-vertical-left":fa,"--n-scrollbar-rail-color":Zo}}),Jt=n?mi("scrollbar",void 0,ji,e):void 0;return Object.assign(Object.assign({},{scrollTo:se,scrollBy:Le,sync:ie,syncUnifiedContainer:ne,handleMouseEnterWrapper:Zt,handleMouseLeaveWrapper:Oe}),{mergedClsPrefix:t,rtlEnabled:s,containerScrollTop:_,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:V,needXBar:O,yBarSizePx:I,xBarSizePx:T,yBarTopPx:j,xBarLeftPx:Y,isShowXBar:J,isShowYBar:ge,isIos:q,handleScroll:Ft,handleContentResize:Fe,handleContainerResize:Ze,handleYScrollMouseDown:Wi,handleXScrollMouseDown:kr,cssVars:n?void 0:ji,themeClass:Jt==null?void 0:Jt.themeClass,onRender:Jt==null?void 0:Jt.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:s,internalHoistYRail:o,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const d=this.trigger==="none",h=(u,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,u],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?Do:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),f=()=>{var u,g;return(u=this.onRender)===null||u===void 0||u.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(g=t.default)===null||g===void 0?void 0:g.call(t):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(ys,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},t)})),o?null:h(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?Do:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?f():i.h(ys,{onResize:this.handleContainerResize},{default:f});return o?i.h(i.Fragment,null,p,h(this.themeClass,this.cssVars)):p}}),fw=gh,pw={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function gw(e){const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=e;return Object.assign(Object.assign({},pw),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}const mh={name:"Empty",common:_i,self:gw},mw=fe("empty",`
|
|
297
|
+
`,[uw(),ae("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),_w=Object.assign(Object.assign({},pt.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),yh=i.defineComponent({name:"Scrollbar",props:_w,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:r}=gi(e),s=vs("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),p=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),y=i.ref(0),_=i.ref(0),b=i.ref(!1),S=i.ref(!1);let x=!1,v=!1,B,k,E=0,P=0,N=0,j=0;const X=U_(),A=pt("Scrollbar","-scrollbar",yw,mh,e,t),V=i.computed(()=>{const{value:T}=p,{value:W}=h,{value:te}=g;return T===null||W===null||te===null?0:Math.min(T,te*T/W+cr(A.value.self.width)*1.5)}),L=i.computed(()=>`${V.value}px`),J=i.computed(()=>{const{value:T}=f,{value:W}=u,{value:te}=m;return T===null||W===null||te===null?0:te*T/W+cr(A.value.self.height)*1.5}),F=i.computed(()=>`${J.value}px`),R=i.computed(()=>{const{value:T}=p,{value:W}=y,{value:te}=h,{value:le}=g;if(T===null||te===null||le===null)return 0;{const ce=te-T;return ce?W/ce*(le-V.value):0}}),$=i.computed(()=>`${R.value}px`),M=i.computed(()=>{const{value:T}=f,{value:W}=_,{value:te}=u,{value:le}=m;if(T===null||te===null||le===null)return 0;{const ce=te-T;return ce?W/ce*(le-J.value):0}}),U=i.computed(()=>`${M.value}px`),z=i.computed(()=>{const{value:T}=p,{value:W}=h;return T!==null&&W!==null&&W>T}),O=i.computed(()=>{const{value:T}=f,{value:W}=u;return T!==null&&W!==null&&W>T}),ee=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}),se=(T,W)=>{if(!e.scrollable)return;if(typeof T=="number"){_t(T,W??0,0,!1,"auto");return}const{left:te,top:le,index:ce,elSize:me,position:be,behavior:ke,el:je,debounce:pn=!0}=T;(te!==void 0||le!==void 0)&&_t(te??0,le??0,0,!1,ke),je!==void 0?_t(0,je.offsetTop,je.offsetHeight,pn,ke):ce!==void 0&&me!==void 0?_t(0,ce*me,me,pn,ke):be==="bottom"?_t(0,Number.MAX_SAFE_INTEGER,0,!1,ke):be==="top"&&_t(0,0,0,!1,ke)},Pe=t1(()=>{e.container||se({top:y.value,left:_.value})}),Fe=()=>{Pe.isDeactivated||ie()},Ke=T=>{if(Pe.isDeactivated)return;const{onResize:W}=e;W&&W(T),ie()},ze=(T,W)=>{if(!e.scrollable)return;const{value:te}=re;te&&(typeof T=="object"?te.scrollBy(T):te.scrollBy(T,W||0))};function _t(T,W,te,le,ce){const{value:me}=re;if(me){if(le){const{scrollTop:be,offsetHeight:ke}=me;if(W>be){W+te<=be+ke||me.scrollTo({left:T,top:W+te-ke,behavior:ce});return}}me.scrollTo({left:T,top:W,behavior:ce})}}function Jt(){He(),Ce(),ie()}function Qt(){Et()}function Et(){Mt(),bt()}function Mt(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{S.value=!1},e.duration)}function bt(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{b.value=!1},e.duration)}function He(){B!==void 0&&window.clearTimeout(B),b.value=!0}function Ce(){k!==void 0&&window.clearTimeout(k),S.value=!0}function lt(T){const{onScroll:W}=e;W&&W(T),wt()}function wt(){const{value:T}=re;T&&(y.value=T.scrollTop,_.value=T.scrollLeft*(s!=null&&s.value?-1:1))}function Ze(){const{value:T}=ge;T&&(h.value=T.offsetHeight,u.value=T.offsetWidth);const{value:W}=re;W&&(p.value=W.offsetHeight,f.value=W.offsetWidth);const{value:te}=d,{value:le}=c;te&&(m.value=te.offsetWidth),le&&(g.value=le.offsetHeight)}function Z(){const{value:T}=re;T&&(y.value=T.scrollTop,_.value=T.scrollLeft*(s!=null&&s.value?-1:1),p.value=T.offsetHeight,f.value=T.offsetWidth,h.value=T.scrollHeight,u.value=T.scrollWidth);const{value:W}=d,{value:te}=c;W&&(m.value=W.offsetWidth),te&&(g.value=te.offsetHeight)}function ie(){e.scrollable&&(e.useUnifiedContainer?Z():(Ze(),wt()))}function We(T){var W;return!(!((W=o.value)===null||W===void 0)&&W.contains(lr(T)))}function kr(T){T.preventDefault(),T.stopPropagation(),v=!0,Bt("mousemove",window,Hi,!0),Bt("mouseup",window,wi,!0),P=_.value,N=s!=null&&s.value?window.innerWidth-T.clientX:T.clientX}function Hi(T){if(!v)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:W}=f,{value:te}=u,{value:le}=J;if(W===null||te===null)return;const me=(s!=null&&s.value?window.innerWidth-T.clientX-N:T.clientX-N)*(te-W)/(W-le),be=te-W;let ke=P+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=re;if(je){je.scrollLeft=ke*(s!=null&&s.value?-1:1);const{internalOnUpdateScrollLeft:pn}=e;pn&&pn(ke)}}function wi(T){T.preventDefault(),T.stopPropagation(),tt("mousemove",window,Hi,!0),tt("mouseup",window,wi,!0),v=!1,ie(),We(T)&&Et()}function Wi(T){T.preventDefault(),T.stopPropagation(),x=!0,Bt("mousemove",window,Hn,!0),Bt("mouseup",window,vi,!0),E=y.value,j=T.clientY}function Hn(T){if(!x)return;B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k);const{value:W}=p,{value:te}=h,{value:le}=V;if(W===null||te===null)return;const me=(T.clientY-j)*(te-W)/(W-le),be=te-W;let ke=E+me;ke=Math.min(be,ke),ke=Math.max(ke,0);const{value:je}=re;je&&(je.scrollTop=ke)}function vi(T){T.preventDefault(),T.stopPropagation(),tt("mousemove",window,Hn,!0),tt("mouseup",window,vi,!0),x=!1,ie(),We(T)&&Et()}i.watchEffect(()=>{const{value:T}=O,{value:W}=z,{value:te}=t,{value:le}=d,{value:ce}=c;le&&(T?le.classList.remove(`${te}-scrollbar-rail--disabled`):le.classList.add(`${te}-scrollbar-rail--disabled`)),ce&&(W?ce.classList.remove(`${te}-scrollbar-rail--disabled`):ce.classList.add(`${te}-scrollbar-rail--disabled`))}),i.onMounted(()=>{e.container||ie()}),i.onBeforeUnmount(()=>{B!==void 0&&window.clearTimeout(B),k!==void 0&&window.clearTimeout(k),tt("mousemove",window,Hn,!0),tt("mouseup",window,vi,!0)});const ji=i.computed(()=>{const{common:{cubicBezierEaseInOut:T},self:{color:W,colorHover:te,height:le,width:ce,borderRadius:me,railInsetHorizontalTop:be,railInsetHorizontalBottom:ke,railInsetVerticalRight:je,railInsetVerticalLeft:pn,railColor:Zo}}=A.value,{top:Jo,right:Qo,bottom:ea,left:ta}=Gt(be),{top:na,right:ia,bottom:ra,left:sa}=Gt(ke),{top:oa,right:aa,bottom:la,left:ca}=Gt(s!=null&&s.value?Jd(je):je),{top:da,right:ha,bottom:ua,left:fa}=Gt(s!=null&&s.value?Jd(pn):pn);return{"--n-scrollbar-bezier":T,"--n-scrollbar-color":W,"--n-scrollbar-color-hover":te,"--n-scrollbar-border-radius":me,"--n-scrollbar-width":ce,"--n-scrollbar-height":le,"--n-scrollbar-rail-top-horizontal-top":Jo,"--n-scrollbar-rail-right-horizontal-top":Qo,"--n-scrollbar-rail-bottom-horizontal-top":ea,"--n-scrollbar-rail-left-horizontal-top":ta,"--n-scrollbar-rail-top-horizontal-bottom":na,"--n-scrollbar-rail-right-horizontal-bottom":ia,"--n-scrollbar-rail-bottom-horizontal-bottom":ra,"--n-scrollbar-rail-left-horizontal-bottom":sa,"--n-scrollbar-rail-top-vertical-right":oa,"--n-scrollbar-rail-right-vertical-right":aa,"--n-scrollbar-rail-bottom-vertical-right":la,"--n-scrollbar-rail-left-vertical-right":ca,"--n-scrollbar-rail-top-vertical-left":da,"--n-scrollbar-rail-right-vertical-left":ha,"--n-scrollbar-rail-bottom-vertical-left":ua,"--n-scrollbar-rail-left-vertical-left":fa,"--n-scrollbar-rail-color":Zo}}),en=n?mi("scrollbar",void 0,ji,e):void 0;return Object.assign(Object.assign({},{scrollTo:se,scrollBy:ze,sync:ie,syncUnifiedContainer:Z,handleMouseEnterWrapper:Jt,handleMouseLeaveWrapper:Qt}),{mergedClsPrefix:t,rtlEnabled:s,containerScrollTop:y,wrapperRef:o,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:z,needXBar:O,yBarSizePx:L,xBarSizePx:F,yBarTopPx:$,xBarLeftPx:U,isShowXBar:ee,isShowYBar:pe,isIos:X,handleScroll:lt,handleContentResize:Fe,handleContainerResize:Ke,handleYScrollMouseDown:Wi,handleXScrollMouseDown:kr,cssVars:n?void 0:ji,themeClass:en==null?void 0:en.themeClass,onRender:en==null?void 0:en.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=(f,g)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,f],"data-scrollbar-rail":!0,style:[g||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?Do:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var f,g;return(f=this.onRender)===null||f===void 0||f.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,s&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(g=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(_s,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},t)})),o?null:h(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?Do:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:s?this.xBarLeftPx:void 0,left:s?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?u():i.h(_s,{onResize:this.handleContainerResize},{default:u});return o?i.h(i.Fragment,null,p,h(this.themeClass,this.cssVars)):p}}),bw=yh,ww={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function vw(e){const{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=e;return Object.assign(Object.assign({},ww),{fontSizeTiny:s,fontSizeSmall:o,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r})}const _h={name:"Empty",common:yi,self:vw},kw=ue("empty",`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
align-items: center;
|
|
301
301
|
font-size: var(--n-font-size);
|
|
302
|
-
`,[
|
|
302
|
+
`,[ye("icon",`
|
|
303
303
|
width: var(--n-icon-size);
|
|
304
304
|
height: var(--n-icon-size);
|
|
305
305
|
font-size: var(--n-icon-size);
|
|
@@ -307,17 +307,17 @@ ${s}
|
|
|
307
307
|
color: var(--n-icon-color);
|
|
308
308
|
transition:
|
|
309
309
|
color .3s var(--n-bezier);
|
|
310
|
-
`,[ae("+",[
|
|
310
|
+
`,[ae("+",[ye("description",`
|
|
311
311
|
margin-top: 8px;
|
|
312
|
-
`)])]),
|
|
312
|
+
`)])]),ye("description",`
|
|
313
313
|
transition: color .3s var(--n-bezier);
|
|
314
314
|
color: var(--n-text-color);
|
|
315
|
-
`),
|
|
315
|
+
`),ye("extra",`
|
|
316
316
|
text-align: center;
|
|
317
317
|
transition: color .3s var(--n-bezier);
|
|
318
318
|
margin-top: 12px;
|
|
319
319
|
color: var(--n-extra-text-color);
|
|
320
|
-
`)]),
|
|
320
|
+
`)]),xw=Object.assign(Object.assign({},pt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Cw=i.defineComponent({name:"Empty",props:xw,slots:Object,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:r}=gi(e),s=pt("Empty","-empty",kw,_h,e,t),{localeRef:o}=lh("Empty"),a=i.computed(()=>{var h,u,p;return(h=e.description)!==null&&h!==void 0?h:(p=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||p===void 0?void 0:p.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(iw,null))}),c=i.computed(()=>{const{size:h}=e,{common:{cubicBezierEaseInOut:u},self:{[Xe("iconSize",h)]:p,[Xe("fontSize",h)]:f,textColor:g,iconColor:m,extraTextColor:y}}=s.value;return{"--n-icon-size":p,"--n-font-size":f,"--n-bezier":u,"--n-text-color":g,"--n-icon-color":m,"--n-extra-text-color":y}}),d=n?mi("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(wr,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?i.h("div",{class:`${t}-empty__extra`},e.extra()):null)}}),Sw={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 Bw(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:p,fontSizeMedium:f,fontSizeLarge:g,fontSizeHuge:m,heightTiny:y,heightSmall:_,heightMedium:b,heightLarge:S,heightHuge:x}=e;return Object.assign(Object.assign({},Sw),{optionFontSizeTiny:u,optionFontSizeSmall:p,optionFontSizeMedium:f,optionFontSizeLarge:g,optionFontSizeHuge:m,optionHeightTiny:y,optionHeightSmall:_,optionHeightMedium:b,optionHeightLarge:S,optionHeightHuge:x,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:s,optionTextColor:o,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:h,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:h,actionTextColor:o,loadingColor:c})}const bh={name:"InternalSelectMenu",common:yi,peers:{Scrollbar:mh,Empty:_h},self:Bw},wh=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:r}=i.inject(Ao);return{labelField:n,nodeProps:r,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:r,tmNode:{rawNode:s}}=this,o=r==null?void 0:r(s),a=t?t(s,!1):Di(s[this.labelField],s,!1),l=i.h("div",Object.assign({},o,{class:[`${e}-base-select-group-header`,o==null?void 0:o.class]}),a);return s.render?s.render({node:l,option:s}):n?n({node:l,option:s,selected:!1}):l}});function Tw(e,t){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>e?i.h(wr,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>i.h(Q1)}):null})}const vh=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:p}=i.inject(Ao),f=qt(()=>{const{value:_}=n;return _?e.tmNode.key===_.key:!1});function g(_){const{tmNode:b}=e;b.disabled||u(_,b)}function m(_){const{tmNode:b}=e;b.disabled||p(_,b)}function y(_){const{tmNode:b}=e,{value:S}=f;b.disabled||S||p(_,b)}return{multiple:r,isGrouped:qt(()=>{const{tmNode:_}=e,{parent:b}=_;return b&&b.rawNode.type==="group"}),showCheckmark:d,nodeProps:h,isPending:f,isSelected:qt(()=>{const{value:_}=t,{value:b}=r;if(_===null)return!1;const S=e.tmNode.rawNode[c.value];if(b){const{value:x}=s;return x.has(S)}else return _===S}),labelField:l,renderLabel:o,renderOption:a,handleMouseMove:y,handleMouseEnter:m,handleClick:g}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:r,isGrouped:s,showCheckmark:o,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:h,handleMouseMove:u}=this,p=Tw(n,e),f=c?[c(t,n),o&&p]:[Di(t[this.labelField],t,n),o&&p],g=a==null?void 0:a(t),m=i.h("div",Object.assign({},g,{class:[`${e}-base-select-option`,t.class,g==null?void 0:g.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:s,[`${e}-base-select-option--pending`]:r,[`${e}-base-select-option--show-checkmark`]:o}],style:[(g==null?void 0:g.style)||"",t.style||""],onClick:zo([d,g==null?void 0:g.onClick]),onMouseenter:zo([h,g==null?void 0:g.onMouseenter]),onMousemove:zo([u,g==null?void 0:g.onMousemove])}),i.h("div",{class:`${e}-base-select-option__content`},f));return t.render?t.render({node:m,option:t,selected:n}):l?l({node:m,option:t,selected:n}):m}}),{cubicBezierEaseIn:kh,cubicBezierEaseOut:xh}=br;function Ch({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:s=""}={}){return[ae("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${kh}, transform ${t} ${kh} ${s&&`,${s}`}`}),ae("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${xh}, transform ${t} ${xh} ${s&&`,${s}`}`}),ae("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),ae("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Ew=ue("base-select-menu",`
|
|
321
321
|
line-height: 1.5;
|
|
322
322
|
outline: none;
|
|
323
323
|
z-index: 0;
|
|
@@ -327,37 +327,37 @@ ${s}
|
|
|
327
327
|
background-color .3s var(--n-bezier),
|
|
328
328
|
box-shadow .3s var(--n-bezier);
|
|
329
329
|
background-color: var(--n-color);
|
|
330
|
-
`,[
|
|
330
|
+
`,[ue("scrollbar",`
|
|
331
331
|
max-height: var(--n-height);
|
|
332
|
-
`),
|
|
332
|
+
`),ue("virtual-list",`
|
|
333
333
|
max-height: var(--n-height);
|
|
334
|
-
`),
|
|
334
|
+
`),ue("base-select-option",`
|
|
335
335
|
min-height: var(--n-option-height);
|
|
336
336
|
font-size: var(--n-option-font-size);
|
|
337
337
|
display: flex;
|
|
338
338
|
align-items: center;
|
|
339
|
-
`,[
|
|
339
|
+
`,[ye("content",`
|
|
340
340
|
z-index: 1;
|
|
341
341
|
white-space: nowrap;
|
|
342
342
|
text-overflow: ellipsis;
|
|
343
343
|
overflow: hidden;
|
|
344
|
-
`)]),
|
|
344
|
+
`)]),ue("base-select-group-header",`
|
|
345
345
|
min-height: var(--n-option-height);
|
|
346
346
|
font-size: .93em;
|
|
347
347
|
display: flex;
|
|
348
348
|
align-items: center;
|
|
349
|
-
`),
|
|
349
|
+
`),ue("base-select-menu-option-wrapper",`
|
|
350
350
|
position: relative;
|
|
351
351
|
width: 100%;
|
|
352
|
-
`),
|
|
352
|
+
`),ye("loading, empty",`
|
|
353
353
|
display: flex;
|
|
354
354
|
padding: 12px 32px;
|
|
355
355
|
flex: 1;
|
|
356
356
|
justify-content: center;
|
|
357
|
-
`),
|
|
357
|
+
`),ye("loading",`
|
|
358
358
|
color: var(--n-loading-color);
|
|
359
359
|
font-size: var(--n-loading-size);
|
|
360
|
-
`),
|
|
360
|
+
`),ye("header",`
|
|
361
361
|
padding: 8px var(--n-option-padding-left);
|
|
362
362
|
font-size: var(--n-option-font-size);
|
|
363
363
|
transition:
|
|
@@ -365,7 +365,7 @@ ${s}
|
|
|
365
365
|
border-color .3s var(--n-bezier);
|
|
366
366
|
border-bottom: 1px solid var(--n-action-divider-color);
|
|
367
367
|
color: var(--n-action-text-color);
|
|
368
|
-
`),
|
|
368
|
+
`),ye("action",`
|
|
369
369
|
padding: 8px var(--n-option-padding-left);
|
|
370
370
|
font-size: var(--n-option-font-size);
|
|
371
371
|
transition:
|
|
@@ -373,12 +373,12 @@ ${s}
|
|
|
373
373
|
border-color .3s var(--n-bezier);
|
|
374
374
|
border-top: 1px solid var(--n-action-divider-color);
|
|
375
375
|
color: var(--n-action-text-color);
|
|
376
|
-
`),
|
|
376
|
+
`),ue("base-select-group-header",`
|
|
377
377
|
position: relative;
|
|
378
378
|
cursor: default;
|
|
379
379
|
padding: var(--n-option-padding);
|
|
380
380
|
color: var(--n-group-header-text-color);
|
|
381
|
-
`),
|
|
381
|
+
`),ue("base-select-option",`
|
|
382
382
|
cursor: pointer;
|
|
383
383
|
position: relative;
|
|
384
384
|
padding: var(--n-option-padding);
|
|
@@ -413,18 +413,18 @@ ${s}
|
|
|
413
413
|
background-color: var(--n-option-color-active-pending);
|
|
414
414
|
`)])]),Se("disabled",`
|
|
415
415
|
cursor: not-allowed;
|
|
416
|
-
`,[
|
|
416
|
+
`,[Kt("selected",`
|
|
417
417
|
color: var(--n-option-text-color-disabled);
|
|
418
418
|
`),Se("selected",`
|
|
419
419
|
opacity: var(--n-option-opacity-disabled);
|
|
420
|
-
`)]),
|
|
420
|
+
`)]),ye("check",`
|
|
421
421
|
font-size: 16px;
|
|
422
422
|
position: absolute;
|
|
423
423
|
right: calc(var(--n-option-padding-right) - 4px);
|
|
424
424
|
top: calc(50% - 7px);
|
|
425
425
|
color: var(--n-option-check-color);
|
|
426
426
|
transition: color .3s var(--n-bezier);
|
|
427
|
-
`,[
|
|
427
|
+
`,[Ch({enterScale:"0.5"})])])]),Rw=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=gi(e),r=vs("InternalSelectMenu",n,t),s=pt("InternalSelectMenu","-internal-select-menu",Ew,bh,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(()=>v_(c.value)),h=i.ref(null);function u(){const{treeMate:z}=e;let O=null;const{value:ee}=e;ee===null?O=z.getFirstAvailableNode():(e.multiple?O=z.getNode((ee||[])[(ee||[]).length-1]):O=z.getNode(ee),(!O||O.disabled)&&(O=z.getFirstAvailableNode())),V(O||null)}function p(){const{value:z}=h;z&&!e.treeMate.getNode(z.key)&&(h.value=null)}let f;i.watch(()=>e.show,z=>{z?f=i.watch(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?u():p(),i.nextTick(L)):p()},{immediate:!0}):f==null||f()},{immediate:!0}),i.onBeforeUnmount(()=>{f==null||f()});const g=i.computed(()=>cr(s.value.self[Xe("optionHeight",e.size)])),m=i.computed(()=>Gt(s.value.self[Xe("padding",e.size)])),y=i.computed(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),_=i.computed(()=>{const z=c.value;return z&&z.length===0});function b(z){const{onToggle:O}=e;O&&O(z)}function S(z){const{onScroll:O}=e;O&&O(z)}function x(z){var O;(O=l.value)===null||O===void 0||O.sync(),S(z)}function v(){var z;(z=l.value)===null||z===void 0||z.sync()}function B(){const{value:z}=h;return z||null}function k(z,O){O.disabled||V(O,!1)}function E(z,O){O.disabled||b(O)}function P(z){var O;ar(z,"action")||(O=e.onKeyup)===null||O===void 0||O.call(e,z)}function N(z){var O;ar(z,"action")||(O=e.onKeydown)===null||O===void 0||O.call(e,z)}function j(z){var O;(O=e.onMousedown)===null||O===void 0||O.call(e,z),!e.focusable&&z.preventDefault()}function X(){const{value:z}=h;z&&V(z.getNext({loop:!0}),!0)}function A(){const{value:z}=h;z&&V(z.getPrev({loop:!0}),!0)}function V(z,O=!1){h.value=z,O&&L()}function L(){var z,O;const ee=h.value;if(!ee)return;const pe=d.value(ee.key);pe!==null&&(e.virtualScroll?(z=a.value)===null||z===void 0||z.scrollTo({index:pe}):(O=l.value)===null||O===void 0||O.scrollTo({index:pe,elSize:g.value}))}function J(z){var O,ee;!((O=o.value)===null||O===void 0)&&O.contains(z.target)&&((ee=e.onFocus)===null||ee===void 0||ee.call(e,z))}function F(z){var O,ee;!((O=o.value)===null||O===void 0)&&O.contains(z.relatedTarget)||(ee=e.onBlur)===null||ee===void 0||ee.call(e,z)}i.provide(Ao,{handleOptionMouseEnter:k,handleOptionClick:E,valueSetRef:y,pendingTmNodeRef:h,nodePropsRef:i.toRef(e,"nodeProps"),showCheckmarkRef:i.toRef(e,"showCheckmark"),multipleRef:i.toRef(e,"multiple"),valueRef:i.toRef(e,"value"),renderLabelRef:i.toRef(e,"renderLabel"),renderOptionRef:i.toRef(e,"renderOption"),labelFieldRef:i.toRef(e,"labelField"),valueFieldRef:i.toRef(e,"valueField")}),i.provide(jd,o),i.onMounted(()=>{const{value:z}=l;z&&z.sync()});const R=i.computed(()=>{const{size:z}=e,{common:{cubicBezierEaseInOut:O},self:{height:ee,borderRadius:pe,color:re,groupHeaderTextColor:ge,actionDividerColor:se,optionTextColorPressed:Pe,optionTextColor:Fe,optionTextColorDisabled:Ke,optionTextColorActive:ze,optionOpacityDisabled:_t,optionCheckColor:Jt,actionTextColor:Qt,optionColorPending:Et,optionColorActive:Mt,loadingColor:bt,loadingSize:He,optionColorActivePending:Ce,[Xe("optionFontSize",z)]:lt,[Xe("optionHeight",z)]:wt,[Xe("optionPadding",z)]:Ze}}=s.value;return{"--n-height":ee,"--n-action-divider-color":se,"--n-action-text-color":Qt,"--n-bezier":O,"--n-border-radius":pe,"--n-color":re,"--n-option-font-size":lt,"--n-group-header-text-color":ge,"--n-option-check-color":Jt,"--n-option-color-pending":Et,"--n-option-color-active":Mt,"--n-option-color-active-pending":Ce,"--n-option-height":wt,"--n-option-opacity-disabled":_t,"--n-option-text-color":Fe,"--n-option-text-color-active":ze,"--n-option-text-color-disabled":Ke,"--n-option-text-color-pressed":Pe,"--n-option-padding":Ze,"--n-option-padding-left":Gt(Ze,"left"),"--n-option-padding-right":Gt(Ze,"right"),"--n-loading-color":bt,"--n-loading-size":He}}),{inlineThemeDisabled:$}=e,M=$?mi("internal-select-menu",i.computed(()=>e.size[0]),R,e):void 0,U={selfRef:o,next:X,prev:A,getPendingTmNode:B};return Gd(o,e.onResize),Object.assign({mergedTheme:s,mergedClsPrefix:t,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:g,padding:m,flattenedNodes:c,empty:_,virtualListContainer(){const{value:z}=a;return z==null?void 0:z.listElRef},virtualListContent(){const{value:z}=a;return z==null?void 0:z.itemsElRef},doScroll:S,handleFocusin:J,handleFocusout:F,handleKeyUp:P,handleKeyDown:N,handleMouseDown:j,handleVirtualListResize:v,handleVirtualListScroll:x,cssVars:$?void 0:R,themeClass:M==null?void 0:M.themeClass,onRender:M==null?void 0:M.onRender},U)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:r,themeClass:s,onRender:o}=this;return o==null||o(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,s,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},fi(e.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(uh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Lo(e.empty,()=>[i.h(Cw,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(yh,{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(Zb,{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(wh,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(vh,{clsPrefix:n,key:a.key,tmNode:a})}):i.h("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(a=>a.isGroup?i.h(wh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(vh,{clsPrefix:n,key:a.key,tmNode:a})))}),fi(e.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(cw,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),$w={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Nw(e){const{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:s,fontSize:o,dividerColor:a}=e;return Object.assign(Object.assign({},$w),{fontSize:o,borderRadius:s,color:n,dividerColor:a,textColor:r,boxShadow:t})}const Sh={name:"Popover",common:yi,self:Nw},qo={top:"bottom",bottom:"top",left:"right",right:"left"},nt="var(--n-arrow-height) * 1.414",Pw=ae([ue("popover",`
|
|
428
428
|
transition:
|
|
429
429
|
box-shadow .3s var(--n-bezier),
|
|
430
430
|
background-color .3s var(--n-bezier),
|
|
@@ -434,34 +434,34 @@ ${s}
|
|
|
434
434
|
color: var(--n-text-color);
|
|
435
435
|
box-shadow: var(--n-box-shadow);
|
|
436
436
|
word-break: break-word;
|
|
437
|
-
`,[ae(">",[
|
|
437
|
+
`,[ae(">",[ue("scrollbar",`
|
|
438
438
|
height: inherit;
|
|
439
439
|
max-height: inherit;
|
|
440
|
-
`)]),
|
|
440
|
+
`)]),Kt("raw",`
|
|
441
441
|
background-color: var(--n-color);
|
|
442
442
|
border-radius: var(--n-border-radius);
|
|
443
|
-
`,[
|
|
443
|
+
`,[Kt("scrollable",[Kt("show-header-or-footer","padding: var(--n-padding);")])]),ye("header",`
|
|
444
444
|
padding: var(--n-padding);
|
|
445
445
|
border-bottom: 1px solid var(--n-divider-color);
|
|
446
446
|
transition: border-color .3s var(--n-bezier);
|
|
447
|
-
`),
|
|
447
|
+
`),ye("footer",`
|
|
448
448
|
padding: var(--n-padding);
|
|
449
449
|
border-top: 1px solid var(--n-divider-color);
|
|
450
450
|
transition: border-color .3s var(--n-bezier);
|
|
451
|
-
`),Se("scrollable, show-header-or-footer",[
|
|
451
|
+
`),Se("scrollable, show-header-or-footer",[ye("content",`
|
|
452
452
|
padding: var(--n-padding);
|
|
453
|
-
`)])]),
|
|
453
|
+
`)])]),ue("popover-shared",`
|
|
454
454
|
transform-origin: inherit;
|
|
455
|
-
`,[
|
|
455
|
+
`,[ue("popover-arrow-wrapper",`
|
|
456
456
|
position: absolute;
|
|
457
457
|
overflow: hidden;
|
|
458
458
|
pointer-events: none;
|
|
459
|
-
`,[
|
|
459
|
+
`,[ue("popover-arrow",`
|
|
460
460
|
transition: background-color .3s var(--n-bezier);
|
|
461
461
|
position: absolute;
|
|
462
462
|
display: block;
|
|
463
|
-
width: calc(${
|
|
464
|
-
height: calc(${
|
|
463
|
+
width: calc(${nt});
|
|
464
|
+
height: calc(${nt});
|
|
465
465
|
box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
|
|
466
466
|
transform: rotate(45deg);
|
|
467
467
|
background-color: var(--n-color);
|
|
@@ -487,60 +487,60 @@ ${s}
|
|
|
487
487
|
opacity .15s var(--n-bezier-ease-in),
|
|
488
488
|
transform .15s var(--n-bezier-ease-in);
|
|
489
489
|
`)]),Xt("top-start",`
|
|
490
|
-
top: calc(${
|
|
490
|
+
top: calc(${nt} / -2);
|
|
491
491
|
left: calc(${vn("top-start")} - var(--v-offset-left));
|
|
492
492
|
`),Xt("top",`
|
|
493
|
-
top: calc(${
|
|
494
|
-
transform: translateX(calc(${
|
|
493
|
+
top: calc(${nt} / -2);
|
|
494
|
+
transform: translateX(calc(${nt} / -2)) rotate(45deg);
|
|
495
495
|
left: 50%;
|
|
496
496
|
`),Xt("top-end",`
|
|
497
|
-
top: calc(${
|
|
497
|
+
top: calc(${nt} / -2);
|
|
498
498
|
right: calc(${vn("top-end")} + var(--v-offset-left));
|
|
499
499
|
`),Xt("bottom-start",`
|
|
500
|
-
bottom: calc(${
|
|
500
|
+
bottom: calc(${nt} / -2);
|
|
501
501
|
left: calc(${vn("bottom-start")} - var(--v-offset-left));
|
|
502
502
|
`),Xt("bottom",`
|
|
503
|
-
bottom: calc(${
|
|
504
|
-
transform: translateX(calc(${
|
|
503
|
+
bottom: calc(${nt} / -2);
|
|
504
|
+
transform: translateX(calc(${nt} / -2)) rotate(45deg);
|
|
505
505
|
left: 50%;
|
|
506
506
|
`),Xt("bottom-end",`
|
|
507
|
-
bottom: calc(${
|
|
507
|
+
bottom: calc(${nt} / -2);
|
|
508
508
|
right: calc(${vn("bottom-end")} + var(--v-offset-left));
|
|
509
509
|
`),Xt("left-start",`
|
|
510
|
-
left: calc(${
|
|
510
|
+
left: calc(${nt} / -2);
|
|
511
511
|
top: calc(${vn("left-start")} - var(--v-offset-top));
|
|
512
512
|
`),Xt("left",`
|
|
513
|
-
left: calc(${
|
|
514
|
-
transform: translateY(calc(${
|
|
513
|
+
left: calc(${nt} / -2);
|
|
514
|
+
transform: translateY(calc(${nt} / -2)) rotate(45deg);
|
|
515
515
|
top: 50%;
|
|
516
516
|
`),Xt("left-end",`
|
|
517
|
-
left: calc(${
|
|
517
|
+
left: calc(${nt} / -2);
|
|
518
518
|
bottom: calc(${vn("left-end")} + var(--v-offset-top));
|
|
519
519
|
`),Xt("right-start",`
|
|
520
|
-
right: calc(${
|
|
520
|
+
right: calc(${nt} / -2);
|
|
521
521
|
top: calc(${vn("right-start")} - var(--v-offset-top));
|
|
522
522
|
`),Xt("right",`
|
|
523
|
-
right: calc(${
|
|
524
|
-
transform: translateY(calc(${
|
|
523
|
+
right: calc(${nt} / -2);
|
|
524
|
+
transform: translateY(calc(${nt} / -2)) rotate(45deg);
|
|
525
525
|
top: 50%;
|
|
526
526
|
`),Xt("right-end",`
|
|
527
|
-
right: calc(${
|
|
527
|
+
right: calc(${nt} / -2);
|
|
528
528
|
bottom: calc(${vn("right-end")} + var(--v-offset-top));
|
|
529
|
-
`),...D.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),r=n?"width":"height";return e.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${
|
|
530
|
-
margin-${
|
|
529
|
+
`),...D.map({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),r=n?"width":"height";return e.map(s=>{const o=s.split("-")[1]==="end",l=`calc((${`var(--v-target-${r}, 0px)`} - ${nt}) / 2)`,c=vn(s);return ae(`[v-placement="${s}"] >`,[ue("popover-shared",[Se("center-arrow",[ue("popover-arrow",`${t}: calc(max(${l}, ${c}) ${o?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function vn(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Xt(e,t){const n=e.split("-")[0],r=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ae(`[v-placement="${e}"] >`,[ue("popover-shared",`
|
|
530
|
+
margin-${qo[n]}: var(--n-space);
|
|
531
531
|
`,[Se("show-arrow",`
|
|
532
|
-
margin-${
|
|
532
|
+
margin-${qo[n]}: var(--n-space-arrow);
|
|
533
533
|
`),Se("overlap",`
|
|
534
534
|
margin: 0;
|
|
535
|
-
`),
|
|
535
|
+
`),a1("popover-arrow-wrapper",`
|
|
536
536
|
right: 0;
|
|
537
537
|
left: 0;
|
|
538
538
|
top: 0;
|
|
539
539
|
bottom: 0;
|
|
540
540
|
${n}: 100%;
|
|
541
|
-
${
|
|
541
|
+
${qo[n]}: auto;
|
|
542
542
|
${r}
|
|
543
|
-
`,[fe("popover-arrow",t)])])])}const Ch=Object.assign(Object.assign({},_t.props),{to:wn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function Tw({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:s}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${s}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${s}-popover-arrow`,e],style:t}))}const Ew=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Ch,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o}=gi(e),a=_t("Popover","-popover",Bw,xh,e,s),l=i.ref(null),c=i.inject("NPopover"),d=i.ref(null),h=i.ref(e.show),f=i.ref(!1);i.watchEffect(()=>{const{show:k}=e;k&&!n1()&&!e.internalDeactivateImmediately&&(f.value=!0)});const p=i.computed(()=>{const{trigger:k,onClickoutside:R}=e,P=[],{positionManuallyRef:{value:N}}=c;return N||(k==="click"&&!R&&P.push([ls,x,void 0,{capture:!0}]),k==="hover"&&P.push([Ay,S])),R&&P.push([ls,x,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&f.value)&&P.push([i.vShow,e.show]),P}),u=i.computed(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:R,cubicBezierEaseOut:P},self:{space:N,spaceArrow:W,padding:q,fontSize:F,textColor:M,dividerColor:I,color:Z,boxShadow:T,borderRadius:$,arrowHeight:j,arrowOffset:z,arrowOffsetVertical:Y}}=a.value;return{"--n-box-shadow":T,"--n-bezier":k,"--n-bezier-ease-in":R,"--n-bezier-ease-out":P,"--n-font-size":F,"--n-text-color":M,"--n-color":Z,"--n-divider-color":I,"--n-border-radius":$,"--n-arrow-height":j,"--n-arrow-offset":z,"--n-arrow-offset-vertical":Y,"--n-padding":q,"--n-space":N,"--n-space-arrow":W}}),g=i.computed(()=>{const k=e.width==="trigger"?void 0:Vo(e.width),R=[];k&&R.push({width:k});const{maxWidth:P,minWidth:N}=e;return P&&R.push({maxWidth:Vo(P)}),N&&R.push({maxWidth:Vo(N)}),o||R.push(u.value),R}),m=o?mi("popover",void 0,u,e):void 0;c.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{c.setBodyInstance(null)}),i.watch(i.toRef(e,"show"),k=>{e.animated||(k?h.value=!0:h.value=!1)});function _(){var k;(k=l.value)===null||k===void 0||k.syncPosition()}function y(k){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&c.handleMouseEnter(k)}function b(k){e.trigger==="hover"&&e.keepAliveOnHover&&c.handleMouseLeave(k)}function S(k){e.trigger==="hover"&&!v().contains(lr(k))&&c.handleMouseMoveOutside(k)}function x(k){(e.trigger==="click"&&!v().contains(lr(k))||e.onClickoutside)&&c.handleClickOutside(k)}function v(){return c.getTriggerElement()}i.provide(Xd,d),i.provide(Wd,null),i.provide(jd,null);function B(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&f.value))return null;let R;const P=c.internalRenderBodyRef.value,{value:N}=s;if(P)R=P([`${N}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${N}-popover-shared--overlap`,e.showArrow&&`${N}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${N}-popover-shared--center-arrow`],d,g.value,y,b);else{const{value:W}=c.extraClassRef,{internalTrapFocus:q}=e,F=!rh(t.header)||!rh(t.footer),M=()=>{var I,Z;const T=F?i.h(i.Fragment,null,fi(t.header,z=>z?i.h("div",{class:[`${N}-popover__header`,e.headerClass],style:e.headerStyle},z):null),fi(t.default,z=>z?i.h("div",{class:[`${N}-popover__content`,e.contentClass],style:e.contentStyle},t):null),fi(t.footer,z=>z?i.h("div",{class:[`${N}-popover__footer`,e.footerClass],style:e.footerStyle},z):null)):e.scrollable?(I=t.default)===null||I===void 0?void 0:I.call(t):i.h("div",{class:[`${N}-popover__content`,e.contentClass],style:e.contentStyle},t),$=e.scrollable?i.h(fw,{contentClass:F?void 0:`${N}-popover__content ${(Z=e.contentClass)!==null&&Z!==void 0?Z:""}`,contentStyle:F?void 0:e.contentStyle},{default:()=>T}):T,j=e.showArrow?Tw({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:N}):null;return[$,j]};R=i.h("div",i.mergeProps({class:[`${N}-popover`,`${N}-popover-shared`,m==null?void 0:m.themeClass.value,W.map(I=>`${N}-${I}`),{[`${N}-popover--scrollable`]:e.scrollable,[`${N}-popover--show-header-or-footer`]:F,[`${N}-popover--raw`]:e.raw,[`${N}-popover-shared--overlap`]:e.overlap,[`${N}-popover-shared--show-arrow`]:e.showArrow,[`${N}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:d,style:g.value,onKeydown:c.handleKeydown,onMouseenter:y,onMouseleave:b},n),q?i.h(Ub,{active:e.show,autoFocus:!0},{default:M}):M())}return i.withDirectives(R,p.value)}return{displayed:f,namespace:r,isMounted:c.isMountedRef,zIndex:c.zIndexRef,followerRef:l,adjustedTo:wn(e),followerEnabled:h,renderContentNode:B}},render(){return i.h(yd,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===wn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var $w={};const Rw=Object.keys(Ch),Nw={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Pw(e,t,n){Nw[t].forEach(r=>{e.props?e.props=Object.assign({},e.props):e.props={};const s=e.props[r],o=n[r];s?e.props[r]=(...a)=>{s(...a),o(...a)}:e.props[r]=o})}const Fw={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:wn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Mw=Object.assign(Object.assign(Object.assign({},_t.props),Fw),{internalOnAfterLeave:Function,internalRenderBody:Function}),Aw=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Mw,slots:Object,__popover__:!0,setup(e){$w.NODE_ENV!=="production"&&i.watchEffect(()=>{e.maxWidth!==void 0&&Ln("popover","`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&Ln("popover","`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&Ln("popover","`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&Ln("popover","`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&Ln("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const t=cs(),n=i.ref(null),r=i.computed(()=>e.show),s=i.ref(e.defaultShow),o=ko(r,s),a=jt(()=>e.disabled?!1:o.value),l=()=>{if(e.disabled)return!0;const{getDisabled:I}=e;return!!(I!=null&&I())},c=()=>l()?!1:o.value,d=Jc(e,["arrow","showArrow"]),h=i.computed(()=>e.overlap?!1:d.value);let f=null;const p=i.ref(null),u=i.ref(null),g=jt(()=>e.x!==void 0&&e.y!==void 0);function m(I){const{"onUpdate:show":Z,onUpdateShow:T,onShow:$,onHide:j}=e;s.value=I,Z&&mt(Z,I),T&&mt(T,I),I&&$&&mt($,!0),I&&j&&mt(j,!1)}function _(){f&&f.syncPosition()}function y(){const{value:I}=p;I&&(window.clearTimeout(I),p.value=null)}function b(){const{value:I}=u;I&&(window.clearTimeout(I),u.value=null)}function S(){const I=l();if(e.trigger==="focus"&&!I){if(c())return;m(!0)}}function x(){const I=l();if(e.trigger==="focus"&&!I){if(!c())return;m(!1)}}function v(){const I=l();if(e.trigger==="hover"&&!I){if(b(),p.value!==null||c())return;const Z=()=>{m(!0),p.value=null},{delay:T}=e;T===0?Z():p.value=window.setTimeout(Z,T)}}function B(){const I=l();if(e.trigger==="hover"&&!I){if(y(),u.value!==null||!c())return;const Z=()=>{m(!1),u.value=null},{duration:T}=e;T===0?Z():u.value=window.setTimeout(Z,T)}}function k(){B()}function R(I){var Z;c()&&(e.trigger==="click"&&(y(),b(),m(!1)),(Z=e.onClickoutside)===null||Z===void 0||Z.call(e,I))}function P(){if(e.trigger==="click"&&!l()){y(),b();const I=!c();m(I)}}function N(I){e.internalTrapFocus&&I.key==="Escape"&&(y(),b(),m(!1))}function W(I){s.value=I}function q(){var I;return(I=n.value)===null||I===void 0?void 0:I.targetRef}function F(I){f=I}return i.provide("NPopover",{getTriggerElement:q,handleKeydown:N,handleMouseEnter:v,handleMouseLeave:B,handleClickOutside:R,handleMouseMoveOutside:k,setBodyInstance:F,positionManuallyRef:g,isMountedRef:t,zIndexRef:i.toRef(e,"zIndex"),extraClassRef:i.toRef(e,"internalExtraClass"),internalRenderBodyRef:i.toRef(e,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&m(!1)}),{binderInstRef:n,positionManually:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:W,handleClick:P,handleMouseEnter:v,handleMouseLeave:B,handleFocus:S,handleBlur:x,syncPosition:_}},render(){var e;const{positionManually:t,$slots:n}=this;let r,s=!1;if(!t&&(r=s1(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const o={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=r.type)===null||e===void 0)&&e.__popover__)s=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[o,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[o];else{const{internalInheritedEventHandlers:a}=this,l=[o,...a],c={onBlur:d=>{l.forEach(h=>{h.onBlur(d)})},onFocus:d=>{l.forEach(h=>{h.onFocus(d)})},onClick:d=>{l.forEach(h=>{h.onClick(d)})},onMouseenter:d=>{l.forEach(h=>{h.onMouseenter(d)})},onMouseleave:d=>{l.forEach(h=>{h.onMouseleave(d)})}};Pw(r,a?"nested":t?"manual":this.trigger,c)}}return i.h(nd,{ref:"binderInstRef",syncTarget:!s,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const o=this.getMergedShow();return[this.internalTrapFocus&&o?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[Zc,{enabled:o,zIndex:this.zIndex}]]):null,t?null:i.h(id,null,{default:()=>r}),i.h(Ew,o1(this.$props,Rw,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)}})]}})}}),Vw={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 Iw(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:s,infoColor:o,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:h,opacityDisabled:f,tagColor:p,closeIconColor:u,closeIconColorHover:g,closeIconColorPressed:m,borderRadiusSmall:_,fontSizeMini:y,fontSizeTiny:b,fontSizeSmall:S,fontSizeMedium:x,heightMini:v,heightTiny:B,heightSmall:k,heightMedium:R,closeColorHover:P,closeColorPressed:N,buttonColor2Hover:W,buttonColor2Pressed:q,fontWeightStrong:F}=e;return Object.assign(Object.assign({},Vw),{closeBorderRadius:_,heightTiny:v,heightSmall:B,heightMedium:k,heightLarge:R,borderRadius:_,opacityDisabled:f,fontSizeTiny:y,fontSizeSmall:b,fontSizeMedium:S,fontSizeLarge:x,fontWeightStrong:F,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:W,colorPressedCheckable:q,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:t,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:u,closeIconColorHover:g,closeIconColorPressed:m,closeColorHover:P,closeColorPressed:N,borderPrimary:`1px solid ${Ne(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Ne(s,{alpha:.12}),colorBorderedPrimary:Ne(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Ne(s,{alpha:.12}),closeColorPressedPrimary:Ne(s,{alpha:.18}),borderInfo:`1px solid ${Ne(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Ne(o,{alpha:.12}),colorBorderedInfo:Ne(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Ne(o,{alpha:.12}),closeColorPressedInfo:Ne(o,{alpha:.18}),borderSuccess:`1px solid ${Ne(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Ne(a,{alpha:.12}),colorBorderedSuccess:Ne(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Ne(a,{alpha:.12}),closeColorPressedSuccess:Ne(a,{alpha:.18}),borderWarning:`1px solid ${Ne(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Ne(l,{alpha:.15}),colorBorderedWarning:Ne(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Ne(l,{alpha:.12}),closeColorPressedWarning:Ne(l,{alpha:.18}),borderError:`1px solid ${Ne(c,{alpha:.23})}`,textColorError:c,colorError:Ne(c,{alpha:.1}),colorBorderedError:Ne(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Ne(c,{alpha:.12}),closeColorPressedError:Ne(c,{alpha:.18})})}const Ow={common:_i,self:Iw},zw={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Lw=fe("tag",`
|
|
543
|
+
`,[ue("popover-arrow",t)])])])}const Bh=Object.assign(Object.assign({},pt.props),{to:wn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function Fw({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 Mw=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Bh,setup(e,{slots:t,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:s,inlineThemeDisabled:o}=gi(e),a=pt("Popover","-popover",Pw,Sh,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:k}=e;k&&!l1()&&!e.internalDeactivateImmediately&&(u.value=!0)});const p=i.computed(()=>{const{trigger:k,onClickoutside:E}=e,P=[],{positionManuallyRef:{value:N}}=c;return N||(k==="click"&&!E&&P.push([ls,x,void 0,{capture:!0}]),k==="hover"&&P.push([D_,S])),E&&P.push([ls,x,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&P.push([i.vShow,e.show]),P}),f=i.computed(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:E,cubicBezierEaseOut:P},self:{space:N,spaceArrow:j,padding:X,fontSize:A,textColor:V,dividerColor:L,color:J,boxShadow:F,borderRadius:R,arrowHeight:$,arrowOffset:M,arrowOffsetVertical:U}}=a.value;return{"--n-box-shadow":F,"--n-bezier":k,"--n-bezier-ease-in":E,"--n-bezier-ease-out":P,"--n-font-size":A,"--n-text-color":V,"--n-color":J,"--n-divider-color":L,"--n-border-radius":R,"--n-arrow-height":$,"--n-arrow-offset":M,"--n-arrow-offset-vertical":U,"--n-padding":X,"--n-space":N,"--n-space-arrow":j}}),g=i.computed(()=>{const k=e.width==="trigger"?void 0:Vo(e.width),E=[];k&&E.push({width:k});const{maxWidth:P,minWidth:N}=e;return P&&E.push({maxWidth:Vo(P)}),N&&E.push({maxWidth:Vo(N)}),o||E.push(f.value),E}),m=o?mi("popover",void 0,f,e):void 0;c.setBodyInstance({syncPosition:y}),i.onBeforeUnmount(()=>{c.setBodyInstance(null)}),i.watch(i.toRef(e,"show"),k=>{e.animated||(k?h.value=!0:h.value=!1)});function y(){var k;(k=l.value)===null||k===void 0||k.syncPosition()}function _(k){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&c.handleMouseEnter(k)}function b(k){e.trigger==="hover"&&e.keepAliveOnHover&&c.handleMouseLeave(k)}function S(k){e.trigger==="hover"&&!v().contains(lr(k))&&c.handleMouseMoveOutside(k)}function x(k){(e.trigger==="click"&&!v().contains(lr(k))||e.onClickoutside)&&c.handleClickOutside(k)}function v(){return c.getTriggerElement()}i.provide(Yd,d),i.provide(qd,null),i.provide(Xd,null);function B(){if(m==null||m.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let E;const P=c.internalRenderBodyRef.value,{value:N}=s;if(P)E=P([`${N}-popover-shared`,m==null?void 0:m.themeClass.value,e.overlap&&`${N}-popover-shared--overlap`,e.showArrow&&`${N}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${N}-popover-shared--center-arrow`],d,g.value,_,b);else{const{value:j}=c.extraClassRef,{internalTrapFocus:X}=e,A=!oh(t.header)||!oh(t.footer),V=()=>{var L,J;const F=A?i.h(i.Fragment,null,fi(t.header,M=>M?i.h("div",{class:[`${N}-popover__header`,e.headerClass],style:e.headerStyle},M):null),fi(t.default,M=>M?i.h("div",{class:[`${N}-popover__content`,e.contentClass],style:e.contentStyle},t):null),fi(t.footer,M=>M?i.h("div",{class:[`${N}-popover__footer`,e.footerClass],style:e.footerStyle},M):null)):e.scrollable?(L=t.default)===null||L===void 0?void 0:L.call(t):i.h("div",{class:[`${N}-popover__content`,e.contentClass],style:e.contentStyle},t),R=e.scrollable?i.h(bw,{contentClass:A?void 0:`${N}-popover__content ${(J=e.contentClass)!==null&&J!==void 0?J:""}`,contentStyle:A?void 0:e.contentStyle},{default:()=>F}):F,$=e.showArrow?Fw({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:N}):null;return[R,$]};E=i.h("div",i.mergeProps({class:[`${N}-popover`,`${N}-popover-shared`,m==null?void 0:m.themeClass.value,j.map(L=>`${N}-${L}`),{[`${N}-popover--scrollable`]:e.scrollable,[`${N}-popover--show-header-or-footer`]:A,[`${N}-popover--raw`]:e.raw,[`${N}-popover-shared--overlap`]:e.overlap,[`${N}-popover-shared--show-arrow`]:e.showArrow,[`${N}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:d,style:g.value,onKeydown:c.handleKeydown,onMouseenter:_,onMouseleave:b},n),X?i.h(e1,{active:e.show,autoFocus:!0},{default:V}):V())}return i.withDirectives(E,p.value)}return{displayed:u,namespace:r,isMounted:c.isMountedRef,zIndex:c.zIndexRef,followerRef:l,adjustedTo:wn(e),followerEnabled:h,renderContentNode:B}},render(){return i.h(wd,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===wn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var Aw={};const Vw=Object.keys(Bh),Iw={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function Ow(e,t,n){Iw[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 zw={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:wn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},Lw=Object.assign(Object.assign(Object.assign({},pt.props),zw),{internalOnAfterLeave:Function,internalRenderBody:Function}),Dw=i.defineComponent({name:"Popover",inheritAttrs:!1,props:Lw,slots:Object,__popover__:!0,setup(e){Aw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.maxWidth!==void 0&&Ln("popover","`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&Ln("popover","`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&Ln("popover","`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&Ln("popover","`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&Ln("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const t=cs(),n=i.ref(null),r=i.computed(()=>e.show),s=i.ref(e.defaultShow),o=ko(r,s),a=qt(()=>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=ed(e,["arrow","showArrow"]),h=i.computed(()=>e.overlap?!1:d.value);let u=null;const p=i.ref(null),f=i.ref(null),g=qt(()=>e.x!==void 0&&e.y!==void 0);function m(L){const{"onUpdate:show":J,onUpdateShow:F,onShow:R,onHide:$}=e;s.value=L,J&&ft(J,L),F&&ft(F,L),L&&R&&ft(R,!0),L&&$&&ft($,!1)}function y(){u&&u.syncPosition()}function _(){const{value:L}=p;L&&(window.clearTimeout(L),p.value=null)}function b(){const{value:L}=f;L&&(window.clearTimeout(L),f.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 v(){const L=l();if(e.trigger==="hover"&&!L){if(b(),p.value!==null||c())return;const J=()=>{m(!0),p.value=null},{delay:F}=e;F===0?J():p.value=window.setTimeout(J,F)}}function B(){const L=l();if(e.trigger==="hover"&&!L){if(_(),f.value!==null||!c())return;const J=()=>{m(!1),f.value=null},{duration:F}=e;F===0?J():f.value=window.setTimeout(J,F)}}function k(){B()}function E(L){var J;c()&&(e.trigger==="click"&&(_(),b(),m(!1)),(J=e.onClickoutside)===null||J===void 0||J.call(e,L))}function P(){if(e.trigger==="click"&&!l()){_(),b();const L=!c();m(L)}}function N(L){e.internalTrapFocus&&L.key==="Escape"&&(_(),b(),m(!1))}function j(L){s.value=L}function X(){var L;return(L=n.value)===null||L===void 0?void 0:L.targetRef}function A(L){u=L}return i.provide("NPopover",{getTriggerElement:X,handleKeydown:N,handleMouseEnter:v,handleMouseLeave:B,handleClickOutside:E,handleMouseMoveOutside:k,setBodyInstance:A,positionManuallyRef:g,isMountedRef:t,zIndexRef:i.toRef(e,"zIndex"),extraClassRef:i.toRef(e,"internalExtraClass"),internalRenderBodyRef:i.toRef(e,"internalRenderBody")}),i.watchEffect(()=>{o.value&&l()&&m(!1)}),{binderInstRef:n,positionManually:g,mergedShowConsideringDisabledProp:a,uncontrolledShow:s,mergedShowArrow:h,getMergedShow:c,setShow:j,handleClick:P,handleMouseEnter:v,handleMouseLeave:B,handleFocus:S,handleBlur:x,syncPosition:y}},render(){var e;const{positionManually:t,$slots:n}=this;let r,s=!1;if(!t&&(r=h1(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)})}};Ow(r,a?"nested":t?"manual":this.trigger,c)}}return i.h(rd,{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}}),[[Qc,{enabled:o,zIndex:this.zIndex}]]):null,t?null:i.h(sd,null,{default:()=>r}),i.h(Mw,u1(this.$props,Vw,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)}})]}})}}),Hw={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 Ww(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:p,closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:m,borderRadiusSmall:y,fontSizeMini:_,fontSizeTiny:b,fontSizeSmall:S,fontSizeMedium:x,heightMini:v,heightTiny:B,heightSmall:k,heightMedium:E,closeColorHover:P,closeColorPressed:N,buttonColor2Hover:j,buttonColor2Pressed:X,fontWeightStrong:A}=e;return Object.assign(Object.assign({},Hw),{closeBorderRadius:y,heightTiny:v,heightSmall:B,heightMedium:k,heightLarge:E,borderRadius:y,opacityDisabled:u,fontSizeTiny:_,fontSizeSmall:b,fontSizeMedium:S,fontSizeLarge:x,fontWeightStrong:A,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:j,colorPressedCheckable:X,colorChecked:s,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${h}`,textColor:t,color:p,colorBordered:"rgb(250, 250, 252)",closeIconColor:f,closeIconColorHover:g,closeIconColorPressed:m,closeColorHover:P,closeColorPressed:N,borderPrimary:`1px solid ${Ne(s,{alpha:.3})}`,textColorPrimary:s,colorPrimary:Ne(s,{alpha:.12}),colorBorderedPrimary:Ne(s,{alpha:.1}),closeIconColorPrimary:s,closeIconColorHoverPrimary:s,closeIconColorPressedPrimary:s,closeColorHoverPrimary:Ne(s,{alpha:.12}),closeColorPressedPrimary:Ne(s,{alpha:.18}),borderInfo:`1px solid ${Ne(o,{alpha:.3})}`,textColorInfo:o,colorInfo:Ne(o,{alpha:.12}),colorBorderedInfo:Ne(o,{alpha:.1}),closeIconColorInfo:o,closeIconColorHoverInfo:o,closeIconColorPressedInfo:o,closeColorHoverInfo:Ne(o,{alpha:.12}),closeColorPressedInfo:Ne(o,{alpha:.18}),borderSuccess:`1px solid ${Ne(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:Ne(a,{alpha:.12}),colorBorderedSuccess:Ne(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:Ne(a,{alpha:.12}),closeColorPressedSuccess:Ne(a,{alpha:.18}),borderWarning:`1px solid ${Ne(l,{alpha:.35})}`,textColorWarning:l,colorWarning:Ne(l,{alpha:.15}),colorBorderedWarning:Ne(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:Ne(l,{alpha:.12}),closeColorPressedWarning:Ne(l,{alpha:.18}),borderError:`1px solid ${Ne(c,{alpha:.23})}`,textColorError:c,colorError:Ne(c,{alpha:.1}),colorBorderedError:Ne(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:Ne(c,{alpha:.12}),closeColorPressedError:Ne(c,{alpha:.18})})}const jw={common:yi,self:Ww},qw={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},Xw=ue("tag",`
|
|
544
544
|
--n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
|
|
545
545
|
white-space: nowrap;
|
|
546
546
|
position: relative;
|
|
@@ -564,7 +564,7 @@ ${s}
|
|
|
564
564
|
font-size: var(--n-font-size);
|
|
565
565
|
`,[Se("strong",`
|
|
566
566
|
font-weight: var(--n-font-weight-strong);
|
|
567
|
-
`),
|
|
567
|
+
`),ye("border",`
|
|
568
568
|
pointer-events: none;
|
|
569
569
|
position: absolute;
|
|
570
570
|
left: 0;
|
|
@@ -574,16 +574,16 @@ ${s}
|
|
|
574
574
|
border-radius: inherit;
|
|
575
575
|
border: var(--n-border);
|
|
576
576
|
transition: border-color .3s var(--n-bezier);
|
|
577
|
-
`),
|
|
577
|
+
`),ye("icon",`
|
|
578
578
|
display: flex;
|
|
579
579
|
margin: 0 4px 0 0;
|
|
580
580
|
color: var(--n-text-color);
|
|
581
581
|
transition: color .3s var(--n-bezier);
|
|
582
582
|
font-size: var(--n-avatar-size-override);
|
|
583
|
-
`),
|
|
583
|
+
`),ye("avatar",`
|
|
584
584
|
display: flex;
|
|
585
585
|
margin: 0 6px 0 0;
|
|
586
|
-
`),
|
|
586
|
+
`),ye("close",`
|
|
587
587
|
margin: var(--n-close-margin);
|
|
588
588
|
transition:
|
|
589
589
|
background-color .3s var(--n-bezier),
|
|
@@ -591,9 +591,9 @@ ${s}
|
|
|
591
591
|
`),Se("round",`
|
|
592
592
|
padding: 0 calc(var(--n-height) / 3);
|
|
593
593
|
border-radius: calc(var(--n-height) / 2);
|
|
594
|
-
`,[
|
|
594
|
+
`,[ye("icon",`
|
|
595
595
|
margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
|
|
596
|
-
`),
|
|
596
|
+
`),ye("avatar",`
|
|
597
597
|
margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
|
|
598
598
|
`),Se("closable",`
|
|
599
599
|
padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
|
|
@@ -607,10 +607,10 @@ ${s}
|
|
|
607
607
|
box-shadow: none;
|
|
608
608
|
color: var(--n-text-color-checkable);
|
|
609
609
|
background-color: var(--n-color-checkable);
|
|
610
|
-
`,[
|
|
610
|
+
`,[Kt("disabled",[ae("&:hover","background-color: var(--n-color-hover-checkable);",[Kt("checked","color: var(--n-text-color-hover-checkable);")]),ae("&:active","background-color: var(--n-color-pressed-checkable);",[Kt("checked","color: var(--n-text-color-pressed-checkable);")])]),Se("checked",`
|
|
611
611
|
color: var(--n-text-color-checked);
|
|
612
612
|
background-color: var(--n-color-checked);
|
|
613
|
-
`,[
|
|
613
|
+
`,[Kt("disabled",[ae("&:hover","background-color: var(--n-color-checked-hover);"),ae("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var Yw={};const Uw=Object.assign(Object.assign(Object.assign({},pt.props),qw),{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}),Gw="n-tag",Xo=i.defineComponent({name:"Tag",props:Uw,slots:Object,setup(e){Yw.NODE_ENV!=="production"&&i.watchEffect(()=>{e.onCheckedChange!==void 0&&Ln("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const t=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:s,mergedRtlRef:o}=gi(e),a=pt("Tag","-tag",Xw,jw,e,r);i.provide(Gw,{roundRef:i.toRef(e,"round")});function l(){if(!e.disabled&&e.checkable){const{checked:f,onCheckedChange:g,onUpdateChecked:m,"onUpdate:checked":y}=e;m&&m(!f),y&&y(!f),g&&g(!f)}}function c(f){if(e.triggerClickOnClose||f.stopPropagation(),!e.disabled){const{onClose:g}=e;g&&ft(g,f)}}const d={setTextContent(f){const{value:g}=t;g&&(g.textContent=f)}},h=vs("Tag",o,r),u=i.computed(()=>{const{type:f,size:g,color:{color:m,textColor:y}={}}=e,{common:{cubicBezierEaseInOut:_},self:{padding:b,closeMargin:S,borderRadius:x,opacityDisabled:v,textColorCheckable:B,textColorHoverCheckable:k,textColorPressedCheckable:E,textColorChecked:P,colorCheckable:N,colorHoverCheckable:j,colorPressedCheckable:X,colorChecked:A,colorCheckedHover:V,colorCheckedPressed:L,closeBorderRadius:J,fontWeightStrong:F,[Xe("colorBordered",f)]:R,[Xe("closeSize",g)]:$,[Xe("closeIconSize",g)]:M,[Xe("fontSize",g)]:U,[Xe("height",g)]:z,[Xe("color",f)]:O,[Xe("textColor",f)]:ee,[Xe("border",f)]:pe,[Xe("closeIconColor",f)]:re,[Xe("closeIconColorHover",f)]:ge,[Xe("closeIconColorPressed",f)]:se,[Xe("closeColorHover",f)]:Pe,[Xe("closeColorPressed",f)]:Fe}}=a.value,Ke=Gt(S);return{"--n-font-weight-strong":F,"--n-avatar-size-override":`calc(${z} - 8px)`,"--n-bezier":_,"--n-border-radius":x,"--n-border":pe,"--n-close-icon-size":M,"--n-close-color-pressed":Fe,"--n-close-color-hover":Pe,"--n-close-border-radius":J,"--n-close-icon-color":re,"--n-close-icon-color-hover":ge,"--n-close-icon-color-pressed":se,"--n-close-icon-color-disabled":re,"--n-close-margin-top":Ke.top,"--n-close-margin-right":Ke.right,"--n-close-margin-bottom":Ke.bottom,"--n-close-margin-left":Ke.left,"--n-close-size":$,"--n-color":m||(n.value?R:O),"--n-color-checkable":N,"--n-color-checked":A,"--n-color-checked-hover":V,"--n-color-checked-pressed":L,"--n-color-hover-checkable":j,"--n-color-pressed-checkable":X,"--n-font-size":U,"--n-height":z,"--n-opacity-disabled":v,"--n-padding":b,"--n-text-color":y||ee,"--n-text-color-checkable":B,"--n-text-color-checked":P,"--n-text-color-hover-checkable":k,"--n-text-color-pressed-checkable":E}}),p=s?mi("tag",i.computed(()=>{let f="";const{type:g,size:m,color:{color:y,textColor:_}={}}=e;return f+=g[0],f+=m[0],y&&(f+=`a${Kd(y)}`),_&&(f+=`b${Kd(_)}`),n.value&&(f+="c"),f}),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:p==null?void 0:p.themeClass,onRender:p==null?void 0:p.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:r,closable:s,color:{borderColor:o}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=fi(c.avatar,u=>u&&i.h("div",{class:`${n}-tag__avatar`},u)),h=fi(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(lw,{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)}}),Kw=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(uh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?i.h(ow,{clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>i.h(wr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Lo(t.default,()=>[i.h(ew,null)])})}):null})}}}),Zw={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function Jw(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:p,iconColor:f,iconColorDisabled:g,clearColor:m,clearColorHover:y,clearColorPressed:_,placeholderColor:b,placeholderColorDisabled:S,fontSizeTiny:x,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:E,heightSmall:P,heightMedium:N,heightLarge:j,fontWeight:X}=e;return Object.assign(Object.assign({},Zw),{fontSizeTiny:x,fontSizeSmall:v,fontSizeMedium:B,fontSizeLarge:k,heightTiny:E,heightSmall:P,heightMedium:N,heightLarge:j,borderRadius:t,fontWeight:X,textColor:n,textColorDisabled:r,placeholderColor:b,placeholderColorDisabled:S,color:s,colorDisabled:o,colorActive:s,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${Ne(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${Ne(a,{alpha:.2})}`,caretColor:a,arrowColor:f,arrowColorDisabled:g,loadingColor:a,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${d}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${Ne(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${Ne(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 ${Ne(h,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${Ne(h,{alpha:.2})}`,colorActiveError:s,caretColorError:h,clearColor:m,clearColorHover:y,clearColorPressed:_})}const Th={name:"InternalSelection",common:yi,peers:{Popover:Sh},self:Jw},Qw=ae([ue("base-selection",`
|
|
614
614
|
--n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
|
|
615
615
|
--n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
|
|
616
616
|
position: relative;
|
|
@@ -624,9 +624,9 @@ ${s}
|
|
|
624
624
|
min-height: var(--n-height);
|
|
625
625
|
line-height: 1.5;
|
|
626
626
|
font-size: var(--n-font-size);
|
|
627
|
-
`,[
|
|
627
|
+
`,[ue("base-loading",`
|
|
628
628
|
color: var(--n-loading-color);
|
|
629
|
-
`),
|
|
629
|
+
`),ue("base-selection-tags","min-height: var(--n-height);"),ye("border, state-border",`
|
|
630
630
|
position: absolute;
|
|
631
631
|
left: 0;
|
|
632
632
|
right: 0;
|
|
@@ -638,20 +638,20 @@ ${s}
|
|
|
638
638
|
transition:
|
|
639
639
|
box-shadow .3s var(--n-bezier),
|
|
640
640
|
border-color .3s var(--n-bezier);
|
|
641
|
-
`),
|
|
641
|
+
`),ye("state-border",`
|
|
642
642
|
z-index: 1;
|
|
643
643
|
border-color: #0000;
|
|
644
|
-
`),
|
|
644
|
+
`),ue("base-suffix",`
|
|
645
645
|
cursor: pointer;
|
|
646
646
|
position: absolute;
|
|
647
647
|
top: 50%;
|
|
648
648
|
transform: translateY(-50%);
|
|
649
649
|
right: 10px;
|
|
650
|
-
`,[
|
|
650
|
+
`,[ye("arrow",`
|
|
651
651
|
font-size: var(--n-arrow-size);
|
|
652
652
|
color: var(--n-arrow-color);
|
|
653
653
|
transition: color .3s var(--n-bezier);
|
|
654
|
-
`)]),
|
|
654
|
+
`)]),ue("base-selection-overlay",`
|
|
655
655
|
display: flex;
|
|
656
656
|
align-items: center;
|
|
657
657
|
white-space: nowrap;
|
|
@@ -663,17 +663,17 @@ ${s}
|
|
|
663
663
|
left: 0;
|
|
664
664
|
padding: var(--n-padding-single);
|
|
665
665
|
transition: color .3s var(--n-bezier);
|
|
666
|
-
`,[
|
|
666
|
+
`,[ye("wrapper",`
|
|
667
667
|
flex-basis: 0;
|
|
668
668
|
flex-grow: 1;
|
|
669
669
|
overflow: hidden;
|
|
670
670
|
text-overflow: ellipsis;
|
|
671
|
-
`)]),
|
|
671
|
+
`)]),ue("base-selection-placeholder",`
|
|
672
672
|
color: var(--n-placeholder-color);
|
|
673
|
-
`,[
|
|
673
|
+
`,[ye("inner",`
|
|
674
674
|
max-width: 100%;
|
|
675
675
|
overflow: hidden;
|
|
676
|
-
`)]),
|
|
676
|
+
`)]),ue("base-selection-tags",`
|
|
677
677
|
cursor: pointer;
|
|
678
678
|
outline: none;
|
|
679
679
|
box-sizing: border-box;
|
|
@@ -691,7 +691,7 @@ ${s}
|
|
|
691
691
|
color .3s var(--n-bezier),
|
|
692
692
|
box-shadow .3s var(--n-bezier),
|
|
693
693
|
background-color .3s var(--n-bezier);
|
|
694
|
-
`),
|
|
694
|
+
`),ue("base-selection-label",`
|
|
695
695
|
height: var(--n-height);
|
|
696
696
|
display: inline-flex;
|
|
697
697
|
width: 100%;
|
|
@@ -708,7 +708,7 @@ ${s}
|
|
|
708
708
|
border-radius: inherit;
|
|
709
709
|
background-color: var(--n-color);
|
|
710
710
|
align-items: center;
|
|
711
|
-
`,[
|
|
711
|
+
`,[ue("base-selection-input",`
|
|
712
712
|
font-size: inherit;
|
|
713
713
|
line-height: inherit;
|
|
714
714
|
outline: none;
|
|
@@ -721,38 +721,38 @@ ${s}
|
|
|
721
721
|
color: var(--n-text-color);
|
|
722
722
|
transition: color .3s var(--n-bezier);
|
|
723
723
|
caret-color: var(--n-caret-color);
|
|
724
|
-
`,[
|
|
724
|
+
`,[ye("content",`
|
|
725
725
|
text-overflow: ellipsis;
|
|
726
726
|
overflow: hidden;
|
|
727
727
|
white-space: nowrap;
|
|
728
|
-
`)]),
|
|
728
|
+
`)]),ye("render-label",`
|
|
729
729
|
color: var(--n-text-color);
|
|
730
|
-
`)]),
|
|
730
|
+
`)]),Kt("disabled",[ae("&:hover",[ye("state-border",`
|
|
731
731
|
box-shadow: var(--n-box-shadow-hover);
|
|
732
732
|
border: var(--n-border-hover);
|
|
733
|
-
`)]),Se("focus",[
|
|
733
|
+
`)]),Se("focus",[ye("state-border",`
|
|
734
734
|
box-shadow: var(--n-box-shadow-focus);
|
|
735
735
|
border: var(--n-border-focus);
|
|
736
|
-
`)]),Se("active",[
|
|
736
|
+
`)]),Se("active",[ye("state-border",`
|
|
737
737
|
box-shadow: var(--n-box-shadow-active);
|
|
738
738
|
border: var(--n-border-active);
|
|
739
|
-
`),
|
|
739
|
+
`),ue("base-selection-label","background-color: var(--n-color-active);"),ue("base-selection-tags","background-color: var(--n-color-active);")])]),Se("disabled","cursor: not-allowed;",[ye("arrow",`
|
|
740
740
|
color: var(--n-arrow-color-disabled);
|
|
741
|
-
`),
|
|
741
|
+
`),ue("base-selection-label",`
|
|
742
742
|
cursor: not-allowed;
|
|
743
743
|
background-color: var(--n-color-disabled);
|
|
744
|
-
`,[
|
|
744
|
+
`,[ue("base-selection-input",`
|
|
745
745
|
cursor: not-allowed;
|
|
746
746
|
color: var(--n-text-color-disabled);
|
|
747
|
-
`),
|
|
747
|
+
`),ye("render-label",`
|
|
748
748
|
color: var(--n-text-color-disabled);
|
|
749
|
-
`)]),
|
|
749
|
+
`)]),ue("base-selection-tags",`
|
|
750
750
|
cursor: not-allowed;
|
|
751
751
|
background-color: var(--n-color-disabled);
|
|
752
|
-
`),
|
|
752
|
+
`),ue("base-selection-placeholder",`
|
|
753
753
|
cursor: not-allowed;
|
|
754
754
|
color: var(--n-placeholder-color-disabled);
|
|
755
|
-
`)]),
|
|
755
|
+
`)]),ue("base-selection-input-tag",`
|
|
756
756
|
height: calc(var(--n-height) - 6px);
|
|
757
757
|
line-height: calc(var(--n-height) - 6px);
|
|
758
758
|
outline: none;
|
|
@@ -761,7 +761,7 @@ ${s}
|
|
|
761
761
|
margin-bottom: 3px;
|
|
762
762
|
max-width: 100%;
|
|
763
763
|
vertical-align: bottom;
|
|
764
|
-
`,[
|
|
764
|
+
`,[ye("input",`
|
|
765
765
|
font-size: inherit;
|
|
766
766
|
font-family: inherit;
|
|
767
767
|
min-width: 1px;
|
|
@@ -776,7 +776,7 @@ ${s}
|
|
|
776
776
|
cursor: pointer;
|
|
777
777
|
color: var(--n-text-color);
|
|
778
778
|
caret-color: var(--n-caret-color);
|
|
779
|
-
`),
|
|
779
|
+
`),ye("mirror",`
|
|
780
780
|
position: absolute;
|
|
781
781
|
left: 0;
|
|
782
782
|
top: 0;
|
|
@@ -785,39 +785,39 @@ ${s}
|
|
|
785
785
|
user-select: none;
|
|
786
786
|
-webkit-user-select: none;
|
|
787
787
|
opacity: 0;
|
|
788
|
-
`)]),["warning","error"].map(e=>Se(`${e}-status`,[
|
|
788
|
+
`)]),["warning","error"].map(e=>Se(`${e}-status`,[ye("state-border",`border: var(--n-border-${e});`),Kt("disabled",[ae("&:hover",[ye("state-border",`
|
|
789
789
|
box-shadow: var(--n-box-shadow-hover-${e});
|
|
790
790
|
border: var(--n-border-hover-${e});
|
|
791
|
-
`)]),Se("active",[
|
|
791
|
+
`)]),Se("active",[ye("state-border",`
|
|
792
792
|
box-shadow: var(--n-box-shadow-active-${e});
|
|
793
793
|
border: var(--n-border-active-${e});
|
|
794
|
-
`),
|
|
794
|
+
`),ue("base-selection-label",`background-color: var(--n-color-active-${e});`),ue("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),Se("focus",[ye("state-border",`
|
|
795
795
|
box-shadow: var(--n-box-shadow-focus-${e});
|
|
796
796
|
border: var(--n-border-focus-${e});
|
|
797
|
-
`)])])]))]),
|
|
797
|
+
`)])])]))]),ue("base-selection-popover",`
|
|
798
798
|
margin-bottom: -3px;
|
|
799
799
|
display: flex;
|
|
800
800
|
flex-wrap: wrap;
|
|
801
801
|
margin-right: -8px;
|
|
802
|
-
`),
|
|
802
|
+
`),ue("base-selection-tag-wrapper",`
|
|
803
803
|
max-width: 100%;
|
|
804
804
|
display: inline-flex;
|
|
805
805
|
padding: 0 7px 3px 0;
|
|
806
|
-
`,[ae("&:last-child","padding-right: 0;"),
|
|
806
|
+
`,[ae("&:last-child","padding-right: 0;"),ue("tag",`
|
|
807
807
|
font-size: 14px;
|
|
808
808
|
max-width: 100%;
|
|
809
|
-
`,[
|
|
809
|
+
`,[ye("content",`
|
|
810
810
|
line-height: 1.25;
|
|
811
811
|
text-overflow: ellipsis;
|
|
812
812
|
overflow: hidden;
|
|
813
|
-
`)])])]),Uw=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},_t.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=gi(e),r=vs("InternalSelection",n,t),s=i.ref(null),o=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),h=i.ref(null),f=i.ref(null),p=i.ref(null),u=i.ref(null),g=i.ref(!1),m=i.ref(!1),_=i.ref(!1),y=_t("InternalSelection","-internal-selection",Yw,Sh,e,i.toRef(e,"clsPrefix")),b=i.computed(()=>e.clearable&&!e.disabled&&(_.value||e.active)),S=i.computed(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Di(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=i.computed(()=>{const ne=e.selectedOption;if(ne)return ne[e.labelField]}),v=i.computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function B(){var ne;const{value:ie}=s;if(ie){const{value:We}=o;We&&(We.style.width=`${ie.offsetWidth}px`,e.maxTagCount!=="responsive"&&((ne=p.value)===null||ne===void 0||ne.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:ne}=u;ne&&(ne.style.display="none")}function R(){const{value:ne}=u;ne&&(ne.style.display="inline-block")}i.watch(i.toRef(e,"active"),ne=>{ne||k()}),i.watch(i.toRef(e,"pattern"),()=>{e.multiple&&i.nextTick(B)});function P(ne){const{onFocus:ie}=e;ie&&ie(ne)}function N(ne){const{onBlur:ie}=e;ie&&ie(ne)}function W(ne){const{onDeleteOption:ie}=e;ie&&ie(ne)}function q(ne){const{onClear:ie}=e;ie&&ie(ne)}function F(ne){const{onPatternInput:ie}=e;ie&&ie(ne)}function M(ne){var ie;(!ne.relatedTarget||!(!((ie=a.value)===null||ie===void 0)&&ie.contains(ne.relatedTarget)))&&P(ne)}function I(ne){var ie;!((ie=a.value)===null||ie===void 0)&&ie.contains(ne.relatedTarget)||N(ne)}function Z(ne){q(ne)}function T(){_.value=!0}function $(){_.value=!1}function j(ne){!e.active||!e.filterable||ne.target!==o.value&&ne.preventDefault()}function z(ne){W(ne)}const Y=i.ref(!1);function V(ne){if(ne.key==="Backspace"&&!Y.value&&!e.pattern.length){const{selectedOptions:ie}=e;ie!=null&&ie.length&&z(ie[ie.length-1])}}let O=null;function J(ne){const{value:ie}=s;if(ie){const We=ne.target.value;ie.textContent=We,B()}e.ignoreComposition&&Y.value?O=ne:F(ne)}function ge(){Y.value=!0}function re(){Y.value=!1,e.ignoreComposition&&F(O),O=null}function he(ne){var ie;m.value=!0,(ie=e.onPatternFocus)===null||ie===void 0||ie.call(e,ne)}function se(ne){var ie;m.value=!1,(ie=e.onPatternBlur)===null||ie===void 0||ie.call(e,ne)}function Pe(){var ne,ie;if(e.filterable)m.value=!1,(ne=d.value)===null||ne===void 0||ne.blur(),(ie=o.value)===null||ie===void 0||ie.blur();else if(e.multiple){const{value:We}=l;We==null||We.blur()}else{const{value:We}=c;We==null||We.blur()}}function Fe(){var ne,ie,We;e.filterable?(m.value=!1,(ne=d.value)===null||ne===void 0||ne.focus()):e.multiple?(ie=l.value)===null||ie===void 0||ie.focus():(We=c.value)===null||We===void 0||We.focus()}function Ze(){const{value:ne}=o;ne&&(R(),ne.focus())}function Le(){const{value:ne}=o;ne&&ne.blur()}function dt(ne){const{value:ie}=h;ie&&ie.setTextContent(`+${ne}`)}function Zt(){const{value:ne}=f;return ne}function Oe(){return o.value}let Ce=null;function Je(){Ce!==null&&window.clearTimeout(Ce)}function Qe(){e.active||(Je(),Ce=window.setTimeout(()=>{v.value&&(g.value=!0)},100))}function un(){Je()}function Ue(ne){ne||(Je(),g.value=!1)}i.watch(v,ne=>{ne||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const ne=d.value;ne&&(e.disabled?ne.removeAttribute("tabindex"):ne.tabIndex=m.value?-1:0)})}),Yd(a,e.onResize);const{inlineThemeDisabled:Ft}=e,fn=i.computed(()=>{const{size:ne}=e,{common:{cubicBezierEaseInOut:ie},self:{fontWeight:We,borderRadius:kr,color:Hi,placeholderColor:wi,textColor:Wi,paddingSingle:Hn,paddingMultiple:vi,caretColor:ji,colorDisabled:Jt,textColorDisabled:$n,placeholderColorDisabled:E,colorActive:H,boxShadowFocus:ee,boxShadowActive:le,boxShadowHover:ce,border:me,borderFocus:be,borderHover:ke,borderActive:je,arrowColor:pn,arrowColorDisabled:Zo,loadingColor:Jo,colorActiveWarning:Qo,boxShadowFocusWarning:ea,boxShadowActiveWarning:ta,boxShadowHoverWarning:na,borderWarning:ia,borderFocusWarning:ra,borderHoverWarning:sa,borderActiveWarning:oa,colorActiveError:aa,boxShadowFocusError:la,boxShadowActiveError:ca,boxShadowHoverError:da,borderError:ha,borderFocusError:ua,borderHoverError:fa,borderActiveError:Fk,clearColor:Mk,clearColorHover:Ak,clearColorPressed:Vk,clearSize:Ik,arrowSize:Ok,[qe("height",ne)]:zk,[qe("fontSize",ne)]:Lk}}=y.value,Bs=Ut(Hn),Ts=Ut(vi);return{"--n-bezier":ie,"--n-border":me,"--n-border-active":je,"--n-border-focus":be,"--n-border-hover":ke,"--n-border-radius":kr,"--n-box-shadow-active":le,"--n-box-shadow-focus":ee,"--n-box-shadow-hover":ce,"--n-caret-color":ji,"--n-color":Hi,"--n-color-active":H,"--n-color-disabled":Jt,"--n-font-size":Lk,"--n-height":zk,"--n-padding-single-top":Bs.top,"--n-padding-multiple-top":Ts.top,"--n-padding-single-right":Bs.right,"--n-padding-multiple-right":Ts.right,"--n-padding-single-left":Bs.left,"--n-padding-multiple-left":Ts.left,"--n-padding-single-bottom":Bs.bottom,"--n-padding-multiple-bottom":Ts.bottom,"--n-placeholder-color":wi,"--n-placeholder-color-disabled":E,"--n-text-color":Wi,"--n-text-color-disabled":$n,"--n-arrow-color":pn,"--n-arrow-color-disabled":Zo,"--n-loading-color":Jo,"--n-color-active-warning":Qo,"--n-box-shadow-focus-warning":ea,"--n-box-shadow-active-warning":ta,"--n-box-shadow-hover-warning":na,"--n-border-warning":ia,"--n-border-focus-warning":ra,"--n-border-hover-warning":sa,"--n-border-active-warning":oa,"--n-color-active-error":aa,"--n-box-shadow-focus-error":la,"--n-box-shadow-active-error":ca,"--n-box-shadow-hover-error":da,"--n-border-error":ha,"--n-border-focus-error":ua,"--n-border-hover-error":fa,"--n-border-active-error":Fk,"--n-clear-size":Ik,"--n-clear-color":Mk,"--n-clear-color-hover":Ak,"--n-clear-color-pressed":Vk,"--n-arrow-size":Ok,"--n-font-weight":We}}),ht=Ft?mi("internal-selection",i.computed(()=>e.size[0]),fn,e):void 0;return{mergedTheme:y,mergedClearable:b,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:S,label:x,selected:v,showTagsPanel:g,isComposing:Y,counterRef:h,counterWrapperRef:f,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:p,inputTagElRef:u,handleMouseDown:j,handleFocusin:M,handleClear:Z,handleMouseEnter:T,handleMouseLeave:$,handleDeleteOption:z,handlePatternKeyDown:V,handlePatternInputInput:J,handlePatternInputBlur:se,handlePatternInputFocus:he,handleMouseEnterCounter:Qe,handleMouseLeaveCounter:un,handleFocusout:I,handleCompositionEnd:re,handleCompositionStart:ge,onPopoverUpdateShow:Ue,focus:Fe,focusInput:Ze,blur:Pe,blurInput:Le,updateCounter:dt,getCounter:Zt,getTail:Oe,renderLabel:e.renderLabel,cssVars:Ft?void 0:fn,themeClass:ht==null?void 0:ht.themeClass,onRender:ht==null?void 0:ht.onRender}},render(){const{status:e,multiple:t,size:n,disabled:r,filterable:s,maxTagCount:o,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:h,renderLabel:f}=this;d==null||d();const p=o==="responsive",u=typeof o=="number",g=p||u,m=i.h(Do,null,{default:()=>i.h(jw,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var 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=F=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:F.value},h?h({option:F,handleClose:()=>{this.handleDeleteOption(F)}}):i.h(qo,{size:n,closable:!F.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(F)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(F,!0):Di(F[y],F,!0)})),S=()=>(u?this.selectedOptions.slice(0,o):this.selectedOptions).map(b),x=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,v=p?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(qo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(u){const F=this.selectedOptions.length-o;F>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(qo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${F}`})))}const k=p?s?i.h(Id,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v,tail:()=>x}):i.h(Id,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v}):u&&B?S().concat(B):S(),R=g?()=>i.h("div",{class:`${l}-base-selection-popover`},p?S():this.selectedOptions.map(b)):void 0,P=g?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,W=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,q=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,p?null:x,m):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,m);_=i.h(i.Fragment,null,g?i.h(Aw,Object.assign({},P,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>q,default:R}):q,W)}else if(s){const y=this.pattern||this.isComposing,b=this.active?!y:!this.selected,S=this.active?!1:this.selected;_=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:eh(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),S?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Di(this.label,this.selectedOption,!0))):null,b?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else _=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:eh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Di(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),m);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,e&&`${l}-base-selection--${e}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},_,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function Gw(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const Kw={name:"Select",common:_i,peers:{InternalSelection:Sh,InternalSelectMenu:_h},self:Gw},Zw=ae([fe("select",`
|
|
813
|
+
`)])])]),ev=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},pt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=gi(e),r=vs("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),p=i.ref(null),f=i.ref(null),g=i.ref(!1),m=i.ref(!1),y=i.ref(!1),_=pt("InternalSelection","-internal-selection",Qw,Th,e,i.toRef(e,"clsPrefix")),b=i.computed(()=>e.clearable&&!e.disabled&&(y.value||e.active)),S=i.computed(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Di(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=i.computed(()=>{const Z=e.selectedOption;if(Z)return Z[e.labelField]}),v=i.computed(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function B(){var Z;const{value:ie}=s;if(ie){const{value:We}=o;We&&(We.style.width=`${ie.offsetWidth}px`,e.maxTagCount!=="responsive"&&((Z=p.value)===null||Z===void 0||Z.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:Z}=f;Z&&(Z.style.display="none")}function E(){const{value:Z}=f;Z&&(Z.style.display="inline-block")}i.watch(i.toRef(e,"active"),Z=>{Z||k()}),i.watch(i.toRef(e,"pattern"),()=>{e.multiple&&i.nextTick(B)});function P(Z){const{onFocus:ie}=e;ie&&ie(Z)}function N(Z){const{onBlur:ie}=e;ie&&ie(Z)}function j(Z){const{onDeleteOption:ie}=e;ie&&ie(Z)}function X(Z){const{onClear:ie}=e;ie&&ie(Z)}function A(Z){const{onPatternInput:ie}=e;ie&&ie(Z)}function V(Z){var ie;(!Z.relatedTarget||!(!((ie=a.value)===null||ie===void 0)&&ie.contains(Z.relatedTarget)))&&P(Z)}function L(Z){var ie;!((ie=a.value)===null||ie===void 0)&&ie.contains(Z.relatedTarget)||N(Z)}function J(Z){X(Z)}function F(){y.value=!0}function R(){y.value=!1}function $(Z){!e.active||!e.filterable||Z.target!==o.value&&Z.preventDefault()}function M(Z){j(Z)}const U=i.ref(!1);function z(Z){if(Z.key==="Backspace"&&!U.value&&!e.pattern.length){const{selectedOptions:ie}=e;ie!=null&&ie.length&&M(ie[ie.length-1])}}let O=null;function ee(Z){const{value:ie}=s;if(ie){const We=Z.target.value;ie.textContent=We,B()}e.ignoreComposition&&U.value?O=Z:A(Z)}function pe(){U.value=!0}function re(){U.value=!1,e.ignoreComposition&&A(O),O=null}function ge(Z){var ie;m.value=!0,(ie=e.onPatternFocus)===null||ie===void 0||ie.call(e,Z)}function se(Z){var ie;m.value=!1,(ie=e.onPatternBlur)===null||ie===void 0||ie.call(e,Z)}function Pe(){var Z,ie;if(e.filterable)m.value=!1,(Z=d.value)===null||Z===void 0||Z.blur(),(ie=o.value)===null||ie===void 0||ie.blur();else if(e.multiple){const{value:We}=l;We==null||We.blur()}else{const{value:We}=c;We==null||We.blur()}}function Fe(){var Z,ie,We;e.filterable?(m.value=!1,(Z=d.value)===null||Z===void 0||Z.focus()):e.multiple?(ie=l.value)===null||ie===void 0||ie.focus():(We=c.value)===null||We===void 0||We.focus()}function Ke(){const{value:Z}=o;Z&&(E(),Z.focus())}function ze(){const{value:Z}=o;Z&&Z.blur()}function _t(Z){const{value:ie}=h;ie&&ie.setTextContent(`+${Z}`)}function Jt(){const{value:Z}=u;return Z}function Qt(){return o.value}let Et=null;function Mt(){Et!==null&&window.clearTimeout(Et)}function bt(){e.active||(Mt(),Et=window.setTimeout(()=>{v.value&&(g.value=!0)},100))}function He(){Mt()}function Ce(Z){Z||(Mt(),g.value=!1)}i.watch(v,Z=>{Z||(g.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const Z=d.value;Z&&(e.disabled?Z.removeAttribute("tabindex"):Z.tabIndex=m.value?-1:0)})}),Gd(a,e.onResize);const{inlineThemeDisabled:lt}=e,wt=i.computed(()=>{const{size:Z}=e,{common:{cubicBezierEaseInOut:ie},self:{fontWeight:We,borderRadius:kr,color:Hi,placeholderColor:wi,textColor:Wi,paddingSingle:Hn,paddingMultiple:vi,caretColor:ji,colorDisabled:en,textColorDisabled:Rn,placeholderColorDisabled:T,colorActive:W,boxShadowFocus:te,boxShadowActive:le,boxShadowHover:ce,border:me,borderFocus:be,borderHover:ke,borderActive:je,arrowColor:pn,arrowColorDisabled:Zo,loadingColor:Jo,colorActiveWarning:Qo,boxShadowFocusWarning:ea,boxShadowActiveWarning:ta,boxShadowHoverWarning:na,borderWarning:ia,borderFocusWarning:ra,borderHoverWarning:sa,borderActiveWarning:oa,colorActiveError:aa,boxShadowFocusError:la,boxShadowActiveError:ca,boxShadowHoverError:da,borderError:ha,borderFocusError:ua,borderHoverError:fa,borderActiveError:zk,clearColor:Lk,clearColorHover:Dk,clearColorPressed:Hk,clearSize:Wk,arrowSize:jk,[Xe("height",Z)]:qk,[Xe("fontSize",Z)]:Xk}}=_.value,Bs=Gt(Hn),Ts=Gt(vi);return{"--n-bezier":ie,"--n-border":me,"--n-border-active":je,"--n-border-focus":be,"--n-border-hover":ke,"--n-border-radius":kr,"--n-box-shadow-active":le,"--n-box-shadow-focus":te,"--n-box-shadow-hover":ce,"--n-caret-color":ji,"--n-color":Hi,"--n-color-active":W,"--n-color-disabled":en,"--n-font-size":Xk,"--n-height":qk,"--n-padding-single-top":Bs.top,"--n-padding-multiple-top":Ts.top,"--n-padding-single-right":Bs.right,"--n-padding-multiple-right":Ts.right,"--n-padding-single-left":Bs.left,"--n-padding-multiple-left":Ts.left,"--n-padding-single-bottom":Bs.bottom,"--n-padding-multiple-bottom":Ts.bottom,"--n-placeholder-color":wi,"--n-placeholder-color-disabled":T,"--n-text-color":Wi,"--n-text-color-disabled":Rn,"--n-arrow-color":pn,"--n-arrow-color-disabled":Zo,"--n-loading-color":Jo,"--n-color-active-warning":Qo,"--n-box-shadow-focus-warning":ea,"--n-box-shadow-active-warning":ta,"--n-box-shadow-hover-warning":na,"--n-border-warning":ia,"--n-border-focus-warning":ra,"--n-border-hover-warning":sa,"--n-border-active-warning":oa,"--n-color-active-error":aa,"--n-box-shadow-focus-error":la,"--n-box-shadow-active-error":ca,"--n-box-shadow-hover-error":da,"--n-border-error":ha,"--n-border-focus-error":ua,"--n-border-hover-error":fa,"--n-border-active-error":zk,"--n-clear-size":Wk,"--n-clear-color":Lk,"--n-clear-color-hover":Dk,"--n-clear-color-pressed":Hk,"--n-arrow-size":jk,"--n-font-weight":We}}),Ze=lt?mi("internal-selection",i.computed(()=>e.size[0]),wt,e):void 0;return{mergedTheme:_,mergedClearable:b,mergedClsPrefix:t,rtlEnabled:r,patternInputFocused:m,filterablePlaceholder:S,label:x,selected:v,showTagsPanel:g,isComposing:U,counterRef:h,counterWrapperRef:u,patternInputMirrorRef:s,patternInputRef:o,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:p,inputTagElRef:f,handleMouseDown:$,handleFocusin:V,handleClear:J,handleMouseEnter:F,handleMouseLeave:R,handleDeleteOption:M,handlePatternKeyDown:z,handlePatternInputInput:ee,handlePatternInputBlur:se,handlePatternInputFocus:ge,handleMouseEnterCounter:bt,handleMouseLeaveCounter:He,handleFocusout:L,handleCompositionEnd:re,handleCompositionStart:pe,onPopoverUpdateShow:Ce,focus:Fe,focusInput:Ke,blur:Pe,blurInput:ze,updateCounter:_t,getCounter:Jt,getTail:Qt,renderLabel:e.renderLabel,cssVars:lt?void 0:wt,themeClass:Ze==null?void 0:Ze.themeClass,onRender:Ze==null?void 0:Ze.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 p=o==="responsive",f=typeof o=="number",g=p||f,m=i.h(Do,null,{default:()=>i.h(Kw,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var _,b;return(b=(_=this.$slots).arrow)===null||b===void 0?void 0:b.call(_)}})});let y;if(t){const{labelField:_}=this,b=A=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:A.value},h?h({option:A,handleClose:()=>{this.handleDeleteOption(A)}}):i.h(Xo,{size:n,closable:!A.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(A)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(A,!0):Di(A[_],A,!0)})),S=()=>(f?this.selectedOptions.slice(0,o):this.selectedOptions).map(b),x=s?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,v=p?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(Xo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let B;if(f){const A=this.selectedOptions.length-o;A>0&&(B=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(Xo,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${A}`})))}const k=p?s?i.h(zd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v,tail:()=>x}):i.h(zd,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:S,counter:v}):f&&B?S().concat(B):S(),E=g?()=>i.h("div",{class:`${l}-base-selection-popover`},p?S():this.selectedOptions.map(b)):void 0,P=g?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,j=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,X=s?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,p?null:x,m):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,m);y=i.h(i.Fragment,null,g?i.h(Dw,Object.assign({},P,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>X,default:E}):X,j)}else if(s){const _=this.pattern||this.isComposing,b=this.active?!_:!this.selected,S=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:nh(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):Di(this.label,this.selectedOption,!0))):null,b?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,m)}else y=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:nh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},h?h({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):Di(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),m);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,e&&`${l}-base-selection--${e}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function tv(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const nv={name:"Select",common:yi,peers:{InternalSelection:Th,InternalSelectMenu:bh},self:tv},iv=ae([ue("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
817
817
|
position: relative;
|
|
818
818
|
font-weight: var(--n-font-weight);
|
|
819
|
-
`),
|
|
819
|
+
`),ue("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[kh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function xs(e){return e.type==="group"}function Bh(e){return e.type==="ignored"}function Yo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function Jw(e,t){return{getIsGroup:xs,getIgnored:Bh,getKey(r){return xs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function Qw(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(xs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Bh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function ev(e,t,n){const r=new Map;return e.forEach(s=>{xs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var tv={};const nv=Object.assign(Object.assign({},_t.props),{to:wn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),iv=i.defineComponent({name:"Select",props:nv,slots:Object,setup(e){tv.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&Ln("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&Ln("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=gi(e),o=_t("Select","-select",Zw,Kw,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=ko(l,a),d=i.ref(!1),h=i.ref(""),f=Jc(e,["items","options"]),p=i.ref([]),u=i.ref([]),g=i.computed(()=>u.value.concat(p.value).concat(f.value)),m=i.computed(()=>{const{filter:E}=e;if(E)return E;const{labelField:H,valueField:ee}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[H];if(typeof me=="string")return Yo(le,me);const be=ce[ee];return typeof be=="string"?Yo(le,be):typeof be=="number"?Yo(le,String(be)):!1}}),_=i.computed(()=>{if(e.remote)return f.value;{const{value:E}=g,{value:H}=h;return!H.length||!e.filterable?E:Qw(E,m.value,H,e.childrenField)}}),y=i.computed(()=>{const{valueField:E,childrenField:H}=e,ee=Jw(E,H);return $y(_.value,ee)}),b=i.computed(()=>ev(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=ko(i.toRef(e,"show"),S),v=i.ref(null),B=i.ref(null),k=i.ref(null),{localeRef:R}=oh("Select"),P=i.computed(()=>{var E;return(E=e.placeholder)!==null&&E!==void 0?E:R.value.placeholder}),N=[],W=i.ref(new Map),q=i.computed(()=>{const{fallbackOption:E}=e;if(E===void 0){const{labelField:H,valueField:ee}=e;return le=>({[H]:String(le),[ee]:le})}return E===!1?!1:H=>Object.assign(E(H),{value:H})});function F(E){const H=e.remote,{value:ee}=W,{value:le}=b,{value:ce}=q,me=[];return E.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(H&&ee.has(be))me.push(ee.get(be));else if(ce){const ke=ce(be);ke&&me.push(ke)}}),me}const M=i.computed(()=>{if(e.multiple){const{value:E}=c;return Array.isArray(E)?F(E):[]}return null}),I=i.computed(()=>{const{value:E}=c;return!e.multiple&&!Array.isArray(E)?E===null?null:F([E])[0]||null:null}),Z=l1(e),{mergedSizeRef:T,mergedDisabledRef:$,mergedStatusRef:j}=Z;function z(E,H){const{onChange:ee,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=Z;ee&&mt(ee,E,H),ce&&mt(ce,E,H),le&&mt(le,E,H),a.value=E,me(),be()}function Y(E){const{onBlur:H}=e,{nTriggerFormBlur:ee}=Z;H&&mt(H,E),ee()}function V(){const{onClear:E}=e;E&&mt(E)}function O(E){const{onFocus:H,showOnFocus:ee}=e,{nTriggerFormFocus:le}=Z;H&&mt(H,E),le(),ee&&se()}function J(E){const{onSearch:H}=e;H&&mt(H,E)}function ge(E){const{onScroll:H}=e;H&&mt(H,E)}function re(){var E;const{remote:H,multiple:ee}=e;if(H){const{value:le}=W;if(ee){const{valueField:ce}=e;(E=M.value)===null||E===void 0||E.forEach(me=>{le.set(me[ce],me)})}else{const ce=I.value;ce&&le.set(ce[e.valueField],ce)}}}function he(E){const{onUpdateShow:H,"onUpdate:show":ee}=e;H&&mt(H,E),ee&&mt(ee,E),S.value=E}function se(){$.value||(he(!0),S.value=!0,e.filterable&&Hn())}function Pe(){he(!1)}function Fe(){h.value="",u.value=N}const Ze=i.ref(!1);function Le(){e.filterable&&(Ze.value=!0)}function dt(){e.filterable&&(Ze.value=!1,x.value||Fe())}function Zt(){$.value||(x.value?e.filterable?Hn():Pe():se())}function Oe(E){var H,ee;!((ee=(H=k.value)===null||H===void 0?void 0:H.selfRef)===null||ee===void 0)&&ee.contains(E.relatedTarget)||(d.value=!1,Y(E),Pe())}function Ce(E){O(E),d.value=!0}function Je(){d.value=!0}function Qe(E){var H;!((H=v.value)===null||H===void 0)&&H.$el.contains(E.relatedTarget)||(d.value=!1,Y(E),Pe())}function un(){var E;(E=v.value)===null||E===void 0||E.focus(),Pe()}function Ue(E){var H;x.value&&(!((H=v.value)===null||H===void 0)&&H.$el.contains(lr(E))||Pe())}function Ft(E){if(!Array.isArray(E))return[];if(q.value)return Array.from(E);{const{remote:H}=e,{value:ee}=b;if(H){const{value:le}=W;return E.filter(ce=>ee.has(ce)||le.has(ce))}else return E.filter(le=>ee.has(le))}}function fn(E){ht(E.rawNode)}function ht(E){if($.value)return;const{tag:H,remote:ee,clearFilterAfterSelect:le,valueField:ce}=e;if(H&&!ee){const{value:me}=u,be=me[0]||null;if(be){const ke=p.value;ke.length?ke.push(be):p.value=[be],u.value=N}}if(ee&&W.value.set(E[ce],E),e.multiple){const me=Ft(c.value),be=me.findIndex(ke=>ke===E[ce]);if(~be){if(me.splice(be,1),H&&!ee){const ke=ne(E[ce]);~ke&&(p.value.splice(ke,1),le&&(h.value=""))}}else me.push(E[ce]),le&&(h.value="");z(me,F(me))}else{if(H&&!ee){const me=ne(E[ce]);~me?p.value=[p.value[me]]:p.value=N}Wi(),Pe(),z(E[ce],E)}}function ne(E){return p.value.findIndex(ee=>ee[e.valueField]===E)}function ie(E){x.value||se();const{value:H}=E.target;h.value=H;const{tag:ee,remote:le}=e;if(J(H),ee&&!le){if(!H){u.value=N;return}const{onCreate:ce}=e,me=ce?ce(H):{[e.labelField]:H,[e.valueField]:H},{valueField:be,labelField:ke}=e;f.value.some(je=>je[be]===me[be]||je[ke]===me[ke])||p.value.some(je=>je[be]===me[be]||je[ke]===me[ke])?u.value=N:u.value=[me]}}function We(E){E.stopPropagation();const{multiple:H}=e;!H&&e.filterable&&Pe(),V(),H?z([],[]):z(null,null)}function kr(E){!ar(E,"action")&&!ar(E,"empty")&&!ar(E,"header")&&E.preventDefault()}function Hi(E){ge(E)}function wi(E){var H,ee,le,ce,me;if(!e.keyboard){E.preventDefault();return}switch(E.key){case" ":if(e.filterable)break;E.preventDefault();case"Enter":if(!(!((H=v.value)===null||H===void 0)&&H.isComposing)){if(x.value){const be=(ee=k.value)===null||ee===void 0?void 0:ee.getPendingTmNode();be?fn(be):e.filterable||(Pe(),Wi())}else if(se(),e.tag&&Ze.value){const be=u.value[0];if(be){const ke=be[e.valueField],{value:je}=c;e.multiple&&Array.isArray(je)&&je.includes(ke)||ht(be)}}}E.preventDefault();break;case"ArrowUp":if(E.preventDefault(),e.loading)return;x.value&&((le=k.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(E.preventDefault(),e.loading)return;x.value?(ce=k.value)===null||ce===void 0||ce.next():se();break;case"Escape":x.value&&(r1(E),Pe()),(me=v.value)===null||me===void 0||me.focus();break}}function Wi(){var E;(E=v.value)===null||E===void 0||E.focus()}function Hn(){var E;(E=v.value)===null||E===void 0||E.focusInput()}function vi(){var E;x.value&&((E=B.value)===null||E===void 0||E.syncPosition())}re(),i.watch(i.toRef(e,"options"),re);const ji={focus:()=>{var E;(E=v.value)===null||E===void 0||E.focus()},focusInput:()=>{var E;(E=v.value)===null||E===void 0||E.focusInput()},blur:()=>{var E;(E=v.value)===null||E===void 0||E.blur()},blurInput:()=>{var E;(E=v.value)===null||E===void 0||E.blurInput()}},Jt=i.computed(()=>{const{self:{menuBoxShadow:E}}=o.value;return{"--n-menu-box-shadow":E}}),$n=s?mi("select",void 0,Jt,e):void 0;return Object.assign(Object.assign({},ji),{mergedStatus:j,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:y,isMounted:cs(),triggerRef:v,menuRef:k,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:wn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:P,selectedOption:I,selectedOptions:M,mergedSize:T,mergedDisabled:$,focused:d,activeWithoutMenuOpen:Ze,inlineThemeDisabled:s,onTriggerInputFocus:Le,onTriggerInputBlur:dt,handleTriggerOrMenuResize:vi,handleMenuFocus:Je,handleMenuBlur:Qe,handleMenuTabOut:un,handleTriggerClick:Zt,handleToggle:fn,handleDeleteOption:ht,handlePatternInput:ie,handleClear:We,handleTriggerBlur:Oe,handleTriggerFocus:Ce,handleKeydown:wi,handleMenuAfterLeave:Fe,handleMenuClickOutside:Ue,handleMenuScroll:Hi,handleMenuKeydown:wi,handleMenuMousedown:kr,mergedTheme:o,cssVars:s?void 0:Jt,themeClass:$n==null?void 0:$n.themeClass,onRender:$n==null?void 0:$n.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(nd,null,{default:()=>[i.h(id,null,{default:()=>i.h(Uw,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),i.h(yd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===wn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),i.withDirectives(i.h(xw,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,s;return[(s=(r=this.$slots).empty)===null||s===void 0?void 0:s.call(r)]},header:()=>{var r,s;return[(s=(r=this.$slots).header)===null||s===void 0?void 0:s.call(r)]},action:()=>{var r,s;return[(s=(r=this.$slots).action)===null||s===void 0?void 0:s.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[ls,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ls,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),rv={},Th=i.defineComponent({...rv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(b=>b.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(b=>({...b,class:r.wrapContent?`${b.class} consistent-menu-width`:b.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),f=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(D.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],v=S.filter(B=>!x.some(k=>k.id===B.id));l.value=r.optionsListConverter([...x,...v])}).finally(()=>{d.value=!1}))};let p="";const u=D.debounce(()=>f(p),800),g=b=>{p=b,u()},m=b=>{var S;if(D.isArray(b)){const x=b.length>0?b.map(v=>{var B;return i.toRaw((B=l.value.find(k=>k.value===v))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(v=>v.value===b))==null?void 0:S.item);s("update:value",x)}else s("update:value",null)};return t({focus:()=>{var b;return(b=h.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=h.value)==null?void 0:b.blurInput()}}),(b,S)=>(i.openBlock(),i.createBlock(i.unref(iv),{ref:"select-component","clear-filter-after-select":!0,clearable:b.clearable,"consistent-menu-width":b.consistentMenuWidth,disabled:b.disabled,filterable:!0,loading:d.value,multiple:o.value,options:c.value,placeholder:b.placeholder,remote:!0,value:a.value,"render-label":b.renderLabel,"render-tag":b.renderTag,onSearch:g,"onUpdate:value":m},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),sv={},Eh=i.defineComponent({...sv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?U.HttpRequester.getInstance(U.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?U.HttpRequester.getInstance(U.ProductDataProvider).publicSimpleSearch(f):new Promise(p=>{p([])}),l=f=>r.searchType==="categories"?Lt.convertReferencesToSelectOptionsList(f,!0,!1,p=>p!=null&&p.isNewRec()?"-":p.name):r.searchType==="products"?Lt.convertReferencesToSelectOptionsList(f,!0,!1,p=>p!=null&&p.isNewRec()?"-":`[${p.code}] ${p.name}`):[],c=(f,p)=>{if(r.renderLabel)return r.renderLabel(f,p);if(r.searchType==="products"){const u=f.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},u.code),i.h("span",{},[u.name])])}if(r.searchType==="categories"){const u=f.item;return i.h("div",{},[u.name])}};return t({focus:()=>{var f;return(f=o.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=o.value)==null?void 0:f.blur()}}),(f,p)=>(i.openBlock(),i.createBlock(Th,{ref:"select-component",value:f.value,clearable:f.clearable,disabled:f.disabled,placeholder:f.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":f.consistentMenuWidth,"wrap-content":f.wrapContent,"min-term-length":f.minTermLength,"render-label":c,"render-tag":f.renderTag,"onUpdate:value":p[0]||(p[0]=u=>s("update:value",u))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),ov={class:"col-span-2 flex flex-row gap-2.5"},av={class:"flex-1"},lv={class:"text-sc-grey"},cv={class:"ml-2.5"},dv={key:0,class:"flex-none"},hv={},uv=i.defineComponent({...hv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(f=>i.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(p=>i.toRaw(p)),...(D.isArray(f)?f:[f]).filter(p=>!a.value.some(u=>u.id===p.id))],i.nextTick(()=>{s.value=null}),l())},d=f=>{f&&(a.value=a.value.map(p=>p.id===f.id?f:i.toRaw(p)),l())},h=f=>{a.value=a.value.filter(p=>p.id!==f.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(f,p)=>{const u=A.NListItem,g=D_,m=A.NButton,_=A.NList;return i.openBlock(),i.createBlock(_,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(f.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Eh,{value:s.value,"onUpdate:value":[p[0]||(p[0]=y=>s.value=y),c],clearable:!0,disabled:f.disabled,"min-term-length":f.minTermLength,"search-type":f.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(u,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...p[1]||(p[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(u,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:f.disabled,quaternary:"",type:"error",onClick:b=>h(y)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",ov,[i.createElementVNode("span",av,[i.createElementVNode("span",lv,i.toDisplayString(y.code),1),i.createElementVNode("span",cv,i.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",dv,[i.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),fv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pv(e,t){return i.openBlock(),i.createElementBlock("svg",fv,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const gv=i.markRaw({name:"tabler-truck-filled",render:pv}),mv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _v(e,t){return i.openBlock(),i.createElementBlock("svg",mv,[...t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const yv=i.markRaw({name:"tabler-truck-delivery",render:_v}),bv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wv(e,t){return i.openBlock(),i.createElementBlock("svg",bv,[...t[0]||(t[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const vv=i.markRaw({name:"tabler-truck-loading",render:wv}),kv={class:"flex flex-col gap-1"},xv={key:0,class:"flex flex-row gap-1 text-base"},Cv={key:1,class:"text-sc-dark-grey text-sm"},Sv={class:"text-sc-grey mr-1.5"},Bv={key:0},Tv={key:1},Ev={key:2},$v={},Cs=i.defineComponent({...$v,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){const t=i.computed(()=>{var s;return(s=U.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>Rn.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,f,p,u,g,m,_;const a=vv,l=yv,c=gv;return i.openBlock(),i.createElementBlock("div",kv,[s.showType?(i.openBlock(),i.createElementBlock("span",xv,[((d=t.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((h=t.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((f=t.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((p=t.value)==null?void 0:p.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",Cv,[i.createElementVNode("span",Sv,i.toDisplayString(n.value),1),(g=(u=s.delivery)==null?void 0:u.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",Bv,i.toDisplayString(s.delivery.address.address),1)):i.createCommentVNode("",!0),(_=(m=s.delivery)==null?void 0:m.warehouse)!=null&&_.address?(i.openBlock(),i.createElementBlock("span",Tv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Ev,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Rv={class:"flex flex-col gap-2.5"},Nv={class:"text-base"},Pv=["href"],Fv={class:"text-sc-grey"},Mv={},$h=i.defineComponent({...Mv,__name:"order-common-info",props:{order:{},fields:{},orderUrl:{}},setup(e){const t=e,n=i.computed(()=>t.fields.includes(Ge.Id)?t.order.id:void 0),r=i.computed(()=>{var l,c;return t.fields.includes(Ge.Status)?(c=(l=U.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(t.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>t.fields.includes(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",Rv,[i.createElementVNode("span",Nv,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:l.orderUrl.replace(":id",l.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,Pv)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(uo,{date:l.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",Fv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Tr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Cs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Av={},Rh=i.defineComponent({...Av,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=U.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===t.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Vv={class:"flex flex-row gap-1.5"},Iv={class:"flex-none text-nowrap"},Ov={class:"flex flex-1 flex-col"},zv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Lv={key:0},Dv={key:1},Hv={},Nh=i.defineComponent({...Hv,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",Vv,[i.createElementVNode("span",Iv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",Ov,[i.createVNode(Yi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",zv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Lv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Dv,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createElementVNode("span",null,i.toDisplayString(`${t.product.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${t.product.currency}`),1)])])]))}}),Wv={},jv=i.defineComponent({...Wv,__name:"order-items-list",props:{order:{}},setup(e){const t=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(Yi,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(vt.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Nh,{product:o,index:a})}];case Xe.laptop:return s;default:return s}},n=i.ref(t()),r=()=>{n.value=t()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=A.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:s.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Ph=jn(jv,[["__scopeId","data-v-b15b9b70"]]),Xv={class:"text-base"},qv={},Uo=i.defineComponent({...qv,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",Xv,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),Yv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Uv={class:"col-span-2"},Gv={class:"col-span-2"},Kv={class:"btn btn-primary",href:"{{ invoice }}"},Zv={},Fh=i.defineComponent({...Zv,__name:"order-details",props:{order:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",null,[n[11]||(n[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Yv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Uo,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(Tr,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Ba,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[n[2]||(n[2]=i.createElementVNode("span",null,"Графический файл клиента",-1)),n[3]||(n[3]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[n[4]||(n[4]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Uv,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[n[5]||(n[5]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Rh,{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(Cs,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[n[7]||(n[7]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",Gv,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Uo,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",Kv," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),Jv={key:0},Qv={class:"text-sc-dark-grey my-2 text-center"},e2={key:1,class:"text-sc-dark-grey my-2 text-center"},t2={key:2},n2={class:"text-sc-dark-grey mt-4 text-right font-bold"},i2={class:"text-sc-primary"},r2={},Mh=i.defineComponent({...r2,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new U.Order(t.order)),s=()=>{n.value=!0,U.HttpRequester.getInstance(U.OrdersDataProvider).getOrder(t.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=A.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",Jv,[i.createElementVNode("div",Qv,[i.createVNode(c,{size:"small",class:"mb-2.5 align-middle"}),l[0]||(l[0]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):r.value.products.length===0?(i.openBlock(),i.createElementBlock("div",e2," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",t2,[i.createVNode(Ph,{order:r.value},null,8,["order"]),i.createElementVNode("div",n2,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",i2,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Fh,{order:r.value},null,8,["order"])]))}}}),s2={},o2=i.defineComponent({...s2,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(e){const t=e,n=()=>structuredClone(i.toRaw(t.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>U.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:D.constant(!0),renderExpand:S=>i.h(Mh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ge.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(uo,{date:S.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"Номер заказа",key:Ge.Id,resizable:!0,minWidth:70,render:S=>i.h("a",{href:t.orderUrl.replace(":id",S.id.toString()),target:"_blank",class:"text-base"},S.id)},{title:"Клиент",key:Ge.ClientInfo,resizable:!0,render:S=>i.h(Tr,{client:S.client})},{title:"Тип доставки",key:Ge.DeliveryInfo,resizable:!0,render:S=>i.h(Cs,{delivery:S.delivery})},{title:"Статус",key:Ge.Status,resizable:!0,minWidth:90,render:S=>{var x,v;return i.h("span",{class:"text-base"},[((v=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:v.name)??""])}},{title:"Напр. продаж",key:Ge.SalesDirections,resizable:!0,minWidth:70,render:S=>i.h("span",{class:"text-base"},[S.salesDirection.name])},{title:"Закреплено за",key:Ge.AttachedUser,resizable:!0,render:S=>{var x;return i.h("span",{class:"text-base"},[(x=S==null?void 0:S.attachedUser)==null?void 0:x.name])}}];switch(vt.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[y,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h($h,{order:S,fields:m,orderUrl:t.orderUrl})}];case Xe.laptop:return[y,...m.map(S=>b.find(x=>x.key===S)??_)];default:return[_]}},c=i.ref(l()),d=i.ref(new U.DataTablePagination(t.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{t.filters&&(o.value=!0,U.HttpRequester.getInstance(U.OrdersDataProvider).getOrders(t.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(m=>{d.value.itemCount!==m.meta.total&&(d.value.itemCount=m.meta.total),d.value.page!==m.meta.currentPage&&(d.value.page=m.meta.currentPage),d.value.pageCount!==m.meta.lastPage&&(d.value.pageCount=m.meta.lastPage),d.value.pageSize!==m.meta.perPage&&(d.value.pageSize=m.meta.perPage),s.value=m.data}).finally(()=>{o.value=!1}))},f=m=>{d.value.page=m,h()},p=m=>{d.value.pageSize=m,h()},u=m=>{D.isNull(m)?r.value=n():(r.value.field=m.columnKey.toString(),r.value.direction=m.order==="ascend"?"asc":"desc"),c.value.forEach(_=>{if(Object.hasOwn(_,"sortOrder")){const y=_;y.sortOrder=y.key===(m==null?void 0:m.columnKey)&&(m!=null&&m.sorter)&&m.order!==!1?m.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>t.filters,()=>{h()}),i.watch(()=>t.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,_)=>{const y=A.NDataTable;return i.openBlock(),i.createBlock(y,{columns:c.value,data:s.value,"row-key":b=>b.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":f,"onUpdate:pageSize":p,"onUpdate:sorter":u},null,8,["columns","data","row-key","pagination","loading"])}}}),a2=jn(o2,[["__scopeId","data-v-7c4554f4"]]),l2=["href"],c2={class:"text-sc-dark-grey"},d2={},h2=i.defineComponent({...d2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>Rn.format(n.order.createdAt,U.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{D.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:a.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(a.order.id),9,l2),i.createTextVNode(" от "+i.toDisplayString(s.value),1),a.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",c2,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),u2={class:"sc-page flex flex-col"},f2={class:"my-2 flex flex-row items-end"},p2={class:"sc-title grow"},g2={key:0,class:"sc-title-buttons flex-1 grow-0"},m2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},_2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},y2={},Ah=i.defineComponent({...y2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=A.NH1;return i.openBlock(),i.createElementBlock("div",u2,[i.createElementVNode("div",f2,[i.createElementVNode("div",p2,[i.renderSlot(t.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),t.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",g2,[i.createElementVNode("div",m2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",_2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),b2={class:"overflow-hidden transition-all duration-300"},w2={class:"text-lg font-medium leading-none"},v2={},Vh=i.defineComponent({...v2,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(vt.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.66;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?D.isUndefined(n.drawerWidth)?s.value=a():s.value=D.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=A.NDrawerContent,f=A.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",b2,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${s.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(f,{show:o.value,"onUpdate:show":d[0]||(d[0]=p=>o.value=p),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",w2,i.toDisplayString(c.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),k2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},x2={key:0},C2={class:"sc-page-preview-panel grow"},S2={key:1,class:"sc-page-preview-panel-extra flex-none"},B2={},T2=i.defineComponent({...B2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(e,{expose:t}){const n=i.ref(!1),r=()=>{n.value=!0},s=i.useTemplateRef("panel-component-ref");return t({scrollToTopOfPanel:a=>{var l;(l=s.value)==null||l.scrollIntoView({behavior:"smooth"}),a&&i.nextTick(()=>{var c,d;window.scrollTo({top:(((d=(c=s.value)==null?void 0:c.getBoundingClientRect())==null?void 0:d.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r}),(a,l)=>{const c=A.NButton;return i.openBlock(),i.createBlock(Ah,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",k2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",x2,[i.renderSlot(a.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(c,{class:"flex-none sm:px-10 sm:py-4",onClick:l[0]||(l[0]=d=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",C2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",S2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Vh,{"show-drawer":n.value,"onUpdate:showDrawer":l[1]||(l[1]=d=>n.value=d),title:a.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(a.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(a.$slots,"default")]),_:2},[a.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-header")]),key:"0"}:void 0,a.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[a.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title")]),key:"0"}:void 0,a.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-buttons")]),key:"1"}:void 0,a.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(a.$slots,"title-extra")]),key:"2"}:void 0]),1032,["title"])}}}),E2={},$2=i.defineComponent({...E2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=i.computed(()=>{var u;return D.isArray(r.value)?r.value.map(g=>g.id):((u=r.value)==null?void 0:u.id)??null}),l=i.computed(()=>{var m;let u=r.showEmptyValue?[U.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(_=>_.id);if(r.showActualOnly){const _=D.isArray(r.value)?r.value.map(y=>y.id):[(m=r.value)==null?void 0:m.id];g=D.union(g,r.managerReferenceList.filter(y=>!y.isActive).map(y=>y.id)),u=r.managerReferenceList.filter(y=>y.isActive||_.includes(y.id))}return Lt.convertReferencesToSelectOptionsList(u,!0,!0,_=>_.salesDirection.isNewRec()?_.name:`${_.name} (${_.salesDirection.name}) ${!r.showActualOnly&&!_.isActive?"[Не активен]":""}`,_=>g.includes(_.id)&&_.isActive)}),c=i.computed(()=>l.value.map(u=>({...u,class:r.wrapContent?`${u.class} consistent-menu-width`:u.class}))),d=i.useTemplateRef("select-component"),h=u=>{var g;if(D.isArray(u)){const m=u.length>0?u.map(_=>{var y;return(y=l.value.find(b=>b.value===_))==null?void 0:y.item}):[];s("update:value",m)}else{const m=u>0?(g=l.value.find(_=>_.value===u))==null?void 0:g.item:new U.Manager;s("update:value",m)}};return i.watch(()=>r.disabledManagerReferenceList,u=>{if(u.length>0&&r.value){const g=o.value?r.value:[r.value];D.some(g,m=>D.some(u,["id",m.id]))&&s("update:value",g.filter(m=>!D.some(u,["id",m.id])))}},{immediate:!0}),t({focus:()=>{var u;return(u=d.value)==null?void 0:u.focusInput()},blur:()=>{var u;return(u=d.value)==null?void 0:u.blurInput()}}),(u,g)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:a.value,clearable:u.clearable,disabled:l.value.length===0,"consistent-menu-width":u.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),R2={class:"m-0.5 flex flex-col p-0.5"},N2={class:"flex flex-row gap-1"},P2={key:0},F2={key:1},M2={key:2},A2={key:3},V2={class:"flex flex-row gap-1"},I2={key:0},O2={key:1},z2={key:2},L2={key:3},D2={},Ih=i.defineComponent({...D2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",R2,[i.createElementVNode("span",N2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",P2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",F2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",M2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",A2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",V2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",I2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",O2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",z2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",L2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Go={clearable:!1,value:"",field:void 0,disabled:!1},H2={},W2=i.defineComponent({...H2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Go,minTermLength:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"addressString"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=D.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):U.HttpRequester.getInstance(U.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},f=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Ih,{addr:y,selected:_},{default:D.constant("-")})},p=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},u=i.ref(null);function g(){u.value.focus()}return t({focus:g}),(m,_)=>{const y=A.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),j2={class:"m-0.5 flex flex-col p-0.5"},X2={class:"font-medium"},q2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},Y2={key:0},U2={key:1},G2={},Oh=i.defineComponent({...G2,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",j2,[i.createElementVNode("span",X2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",q2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",Y2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",U2," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),K2={},Z2=i.defineComponent({...K2,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Go,minTermLength:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"_"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=D.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await U.HttpRequester.getInstance(U.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},f=(m,_)=>{const y=l.value.find(b=>b.id===m.value)||{};return i.h(Oh,{bank:y,selected:_},{default:D.constant("-")})},p=m=>{d.cancel();const _=l.value.find(y=>y.id===m)||{};s("select",_)},u=i.ref(null);function g(){u.value.focus()}return t({focus:g}),(m,_)=>{const y=A.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:u,value:o.value,"onUpdate:value":[_[0]||(_[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":f,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),J2={class:"font-medium"},Q2={key:0,class:"flex flex-row gap-2"},ek={key:0,class:"text-xs font-light text-blue-800"},tk={key:1,class:"text-sc-dark-grey text-xs font-light"},nk={},zh=i.defineComponent({...nk,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(e){const t=e,n=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.state)==null?void 0:o.liquidationDate)??!1}),r=i.computed(()=>{var s,o;return((o=(s=t.org.rawData)==null?void 0:s.address)==null?void 0:o.value)??""});return(s,o)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",J2,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",Q2,[s.org.inn?(i.openBlock(),i.createElementBlock("span",ek,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",tk,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),ik={},rk=i.defineComponent({...ik,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Go,minTermLength:()=>{var e;return((e=U.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=_=>{var y,b;return!!(((b=(y=_.rawData)==null?void 0:y.state)==null?void 0:b.liquidationDate)??!1)},d=i.computed(()=>Lt.convertReferencesToSelectOptionsList(l.value,!1,!1,_=>_[r.field??"_"]??"-",_=>!r.allowSelectTerminated&&c(_)));i.watch(()=>r.value,_=>{o.value=_}),i.watch(o,()=>{s("update:value",o.value)});const h=D.debounce(()=>f(),800),f=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await U.HttpRequester.getInstance(U.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},p=(_,y)=>{const b=l.value.find(S=>S.id===_.value)||{};return i.h(zh,{org:b,selected:y},{default:D.constant("-")})},u=_=>{h.cancel();const y=l.value.find(b=>b.id===_)||{};(r.allowSelectTerminated||!c(y))&&s("select",y)},g=i.ref(null);function m(){g.value.focus()}return t({focus:m}),(_,y)=>{const b=A.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[y[0]||(y[0]=S=>o.value=S),i.unref(h)],clearable:_.clearable,disabled:_.disabled,loading:a.value,options:d.value,"render-label":p,placeholder:"",onSelect:u},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),sk={},ok=i.defineComponent({...sk,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=A.NButton,h=A.NPopover,f=A.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:l.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:l.disabled,ghost:l.ghost,loading:l.loading,size:l.size,type:l.type,quaternary:l.quaternary,circle:l.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(l.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(f,{show:s.value,"onUpdate:show":c[1]||(c[1]=p=>s.value=p),content:l.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:l.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=p=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),ak={key:0,class:"whitespace-pre-line"},lk={key:1,class:"text-sc-dark-grey"},ck={},dk=i.defineComponent({...ck,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=A.NInput;return i.openBlock(),i.createBlock(Oc,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",ak,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",lk," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:s.value,"onUpdate:value":c[0]||(c[0]=h=>s.value=h),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),hk={key:0,class:"text-sm"},uk={key:1},fk={},pk=i.defineComponent({...fk,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){const t=e,n=i.computed(()=>{let r="";return(t.showLabel??!1)&&(t.debt>0?r="Переплата: ":t.debt<0&&(r="Задолженность: ")),r});return(r,s)=>(i.openBlock(),i.createElementBlock("span",null,[r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",hk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0),!r.wrapAsSmall&&r.debt!==0?(i.openBlock(),i.createElementBlock("span",uk,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":r.debt>0,"text-red-700":r.debt<0})},i.toDisplayString(r.debt)+" ₽ ",3)])):i.createCommentVNode("",!0)]))}}),gk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mk(e,t){return i.openBlock(),i.createElementBlock("svg",gk,[...t[0]||(t[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const _k=i.markRaw({name:"ion-warning",render:mk}),yk={},bk=i.defineComponent({...yk,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=_k,s=A.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),wt=class wt{static init(t,n){wt.messagesService&&wt.notificationsService||(wt.messagesService=t,wt.notificationsService=n)}static getMessagesService(){if(!wt.messagesService)throw new Error("UI provider is not initialized.");return wt.messagesService}static getNotificationsService(){if(!wt.notificationsService)throw new Error("UI provider is not initialized.");return wt.notificationsService}static showNotificationsForErrorResponseData(t,n={}){var r,s;if(D.isEmpty(t.errors)){const o=(s=(r=t.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";wt.notificationsService?wt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:t.message,meta:`#${t.status}${a}: ${t.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",t)}else for(const o in t.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new U.FieldValidationResultData(t.errors[o].toString(),"error"):wt.messagesService?wt.messagesService.error(t.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",t.errors[o])}};C(wt,"messagesService"),C(wt,"notificationsService");let Ko=wt;const wk=i.computed(()=>U.useReferencesStore().deliveryTypeReference??[]),vk=i.computed(()=>U.useReferencesStore().managersList??[]),kk=i.computed(()=>U.useReferencesStore().opfReference??[]),xk=i.computed(()=>U.useReferencesStore().partnerGroupsReference??[]),Ck=i.computed(()=>U.useReferencesStore().priceCoefficientsReference??[]),Sk=i.computed(()=>U.useReferencesStore().productFilesTypesReference??[]),Bk=i.computed(()=>U.useReferencesStore().resourceTypesReference),Tk=i.computed(()=>U.useReferencesStore().salesDirectionsReference??[]),Ek=i.computed(()=>U.useReferencesStore().warehousesReference??[]),$k=i.computed(()=>Lt.convertReferencesToSelectOptionsList(U.useReferencesStore().channelPrimaryInterestsReference??[],!0,!0)),Rk=i.computed(()=>Lt.convertReferencesToSelectOptionsList(U.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!0)),Nk=e=>U.HttpRequester.getInstance(U.ReferenceDataProvider).searchCity(e),Pk=e=>Lt.convertReferencesToSelectOptionsList(e,!0,!1,t=>{var n,r,s;return t!=null&&t.isNewRec()?"-":`${t.name}, ${(n=t==null?void 0:t.region)==null?void 0:n.name}, ${(s=(r=t==null?void 0:t.region)==null?void 0:r.country)==null?void 0:s.name}`},t=>t==null?void 0:t.isNewRec());L.ConfiguratorSettingsKozyrek=s0,L.ContentHelper=Wn,L.KozyrekLine=si,L.KozyrekTailTemplate=co,L.KozyrekTemplate=Mi,L.OrdersTableFields=Ge,L.Point=lo,L.ScAddProductToCartForm=zf,L.ScAddressSuggestion=W2,L.ScAddressSuggestionLabel=Ih,L.ScBankSuggestion=Z2,L.ScBankSuggestionLabel=Oh,L.ScBaseDialog=c_,L.ScButtonWithConfirmAction=ok,L.ScCategoryCollapse=Ca,L.ScClientNameWithShortInfo=Tr,L.ScCollapse=xa,L.ScCollapseItem=ya,L.ScCommentEditor=dk,L.ScConfiguratorsProductInfo=Ui,L.ScContragentWithShortInfo=Ba,L.ScDateRange=Z0,L.ScDateTimeLabel=uo,L.ScDebouncedInput=E_,L.ScDebouncedInputNumber=Ai,L.ScDebt=pk,L.ScDialogHeader=s_,L.ScEmail=rp,L.ScExternalLink=O_,L.ScImageGallery=ka,L.ScInlineEditableItem=Oc,L.ScInlineView=fo,L.ScKozyrekConfigurator=r0,L.ScKozyrekConfiguratorParamsForm=Ma,L.ScKozyrekConfiguratorPreview=Nc,L.ScKozyrekConfiguratorTemplates=Na,L.ScLightGallery=va,L.ScManagerSelect=$2,L.ScMetalForDoorsConfigurator=h0,L.ScMetalForDoorsConfiguratorForm=Pc,L.ScMosquitoConfigurator=A0,L.ScMosquitoConfiguratorForm=Fc,L.ScMosquitoConfiguratorMeasurementInstructions=Mc,L.ScMosquitoConfiguratorPreview=ho,L.ScOrderCommonInfo=$h,L.ScOrderDeliveryLabel=Cs,L.ScOrderDetails=Fh,L.ScOrderInfo=Mh,L.ScOrderItemsList=Ph,L.ScOrderPayment=Rh,L.ScOrderProductInfo=Nh,L.ScOrdersList=a2,L.ScOrgSuggestion=rk,L.ScOrgSuggestionLabel=zh,L.ScPage=Ah,L.ScPageWithSlidingPanel=T2,L.ScPersonContactsBlock=Up,L.ScPhone=Ep,L.ScPhoneInput=N_,L.ScProductName=Yi,L.ScProductsList=uv,L.ScReferenceSelect=Sa,L.ScSearchableProductSelect=Eh,L.ScSearchableReferenceSelect=Th,L.ScSetClientPriceFormItem=Hf,L.ScShortTextOrderInfo=h2,L.ScSingleFileUploadSelector=p_,L.ScSlidingContentWithDrawer=Vh,L.ScStripConfigurator=q0,L.ScStripConfiguratorForm=Vc,L.ScStripConfiguratorLineItem=Ac,L.ScStripConfiguratorPreview=Ic,L.ScUserShortInfo=Uo,L.ScWarningIcon=bk,L.SelectOptionHelper=Lt,L.UiNotificationProvider=Ko,L.WindowResolutionEnum=Xe,L.WindowResolutionProvider=vt,L.channelPrimaryInterestOptionsList=$k,L.componentSizeInjectionKey=xr,L.deliveryTypeReferenceList=wk,L.managersReferenceList=vk,L.naiveUiTheme=Su,L.opfReferenceList=kk,L.partnerGroupReferenceList=xk,L.priceCoefficientsReferenceList=Ck,L.productFilesTypesReferenceList=Sk,L.renderConfig=Ie,L.resourceReferencesList=Bk,L.salesDirectionsReferenceList=Tk,L.searchCityReferenceDataHandler=Nk,L.searchCityReferenceLabelRenderer=Pk,L.sourcePrimaryInterestOptionsList=Rk,L.warehousesReferenceList=Ek,Object.defineProperty(L,Symbol.toStringTag,{value:"Module"})});
|
|
822
|
+
`,[Ch({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function xs(e){return e.type==="group"}function Eh(e){return e.type==="ignored"}function Yo(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function rv(e,t){return{getIsGroup:xs,getIgnored:Eh,getKey(r){return xs(r)?r.name||r.key||"key-required":r[e]},getChildren(r){return r[t]}}}function sv(e,t,n,r){if(!t)return e;function s(o){if(!Array.isArray(o))return[];const a=[];for(const l of o)if(xs(l)){const c=s(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Eh(l))continue;t(n,l)&&a.push(l)}return a}return s(e)}function ov(e,t,n){const r=new Map;return e.forEach(s=>{xs(s)?s[n].forEach(o=>{r.set(o[t],o)}):r.set(s[t],s)}),r}var av={};const lv=Object.assign(Object.assign({},pt.props),{to:wn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),cv=i.defineComponent({name:"Select",props:lv,slots:Object,setup(e){av.NODE_ENV!=="production"&&i.watchEffect(()=>{e.items!==void 0&&Ln("select","`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&Ln("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:s}=gi(e),o=pt("Select","-select",iv,nv,e,t),a=i.ref(e.defaultValue),l=i.toRef(e,"value"),c=ko(l,a),d=i.ref(!1),h=i.ref(""),u=ed(e,["items","options"]),p=i.ref([]),f=i.ref([]),g=i.computed(()=>f.value.concat(p.value).concat(u.value)),m=i.computed(()=>{const{filter:T}=e;if(T)return T;const{labelField:W,valueField:te}=e;return(le,ce)=>{if(!ce)return!1;const me=ce[W];if(typeof me=="string")return Yo(le,me);const be=ce[te];return typeof be=="string"?Yo(le,be):typeof be=="number"?Yo(le,String(be)):!1}}),y=i.computed(()=>{if(e.remote)return u.value;{const{value:T}=g,{value:W}=h;return!W.length||!e.filterable?T:sv(T,m.value,W,e.childrenField)}}),_=i.computed(()=>{const{valueField:T,childrenField:W}=e,te=rv(T,W);return A_(y.value,te)}),b=i.computed(()=>ov(g.value,e.valueField,e.childrenField)),S=i.ref(!1),x=ko(i.toRef(e,"show"),S),v=i.ref(null),B=i.ref(null),k=i.ref(null),{localeRef:E}=lh("Select"),P=i.computed(()=>{var T;return(T=e.placeholder)!==null&&T!==void 0?T:E.value.placeholder}),N=[],j=i.ref(new Map),X=i.computed(()=>{const{fallbackOption:T}=e;if(T===void 0){const{labelField:W,valueField:te}=e;return le=>({[W]:String(le),[te]:le})}return T===!1?!1:W=>Object.assign(T(W),{value:W})});function A(T){const W=e.remote,{value:te}=j,{value:le}=b,{value:ce}=X,me=[];return T.forEach(be=>{if(le.has(be))me.push(le.get(be));else if(W&&te.has(be))me.push(te.get(be));else if(ce){const ke=ce(be);ke&&me.push(ke)}}),me}const V=i.computed(()=>{if(e.multiple){const{value:T}=c;return Array.isArray(T)?A(T):[]}return null}),L=i.computed(()=>{const{value:T}=c;return!e.multiple&&!Array.isArray(T)?T===null?null:A([T])[0]||null:null}),J=p1(e),{mergedSizeRef:F,mergedDisabledRef:R,mergedStatusRef:$}=J;function M(T,W){const{onChange:te,"onUpdate:value":le,onUpdateValue:ce}=e,{nTriggerFormChange:me,nTriggerFormInput:be}=J;te&&ft(te,T,W),ce&&ft(ce,T,W),le&&ft(le,T,W),a.value=T,me(),be()}function U(T){const{onBlur:W}=e,{nTriggerFormBlur:te}=J;W&&ft(W,T),te()}function z(){const{onClear:T}=e;T&&ft(T)}function O(T){const{onFocus:W,showOnFocus:te}=e,{nTriggerFormFocus:le}=J;W&&ft(W,T),le(),te&&se()}function ee(T){const{onSearch:W}=e;W&&ft(W,T)}function pe(T){const{onScroll:W}=e;W&&ft(W,T)}function re(){var T;const{remote:W,multiple:te}=e;if(W){const{value:le}=j;if(te){const{valueField:ce}=e;(T=V.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:W,"onUpdate:show":te}=e;W&&ft(W,T),te&&ft(te,T),S.value=T}function se(){R.value||(ge(!0),S.value=!0,e.filterable&&Hn())}function Pe(){ge(!1)}function Fe(){h.value="",f.value=N}const Ke=i.ref(!1);function ze(){e.filterable&&(Ke.value=!0)}function _t(){e.filterable&&(Ke.value=!1,x.value||Fe())}function Jt(){R.value||(x.value?e.filterable?Hn():Pe():se())}function Qt(T){var W,te;!((te=(W=k.value)===null||W===void 0?void 0:W.selfRef)===null||te===void 0)&&te.contains(T.relatedTarget)||(d.value=!1,U(T),Pe())}function Et(T){O(T),d.value=!0}function Mt(){d.value=!0}function bt(T){var W;!((W=v.value)===null||W===void 0)&&W.$el.contains(T.relatedTarget)||(d.value=!1,U(T),Pe())}function He(){var T;(T=v.value)===null||T===void 0||T.focus(),Pe()}function Ce(T){var W;x.value&&(!((W=v.value)===null||W===void 0)&&W.$el.contains(lr(T))||Pe())}function lt(T){if(!Array.isArray(T))return[];if(X.value)return Array.from(T);{const{remote:W}=e,{value:te}=b;if(W){const{value:le}=j;return T.filter(ce=>te.has(ce)||le.has(ce))}else return T.filter(le=>te.has(le))}}function wt(T){Ze(T.rawNode)}function Ze(T){if(R.value)return;const{tag:W,remote:te,clearFilterAfterSelect:le,valueField:ce}=e;if(W&&!te){const{value:me}=f,be=me[0]||null;if(be){const ke=p.value;ke.length?ke.push(be):p.value=[be],f.value=N}}if(te&&j.value.set(T[ce],T),e.multiple){const me=lt(c.value),be=me.findIndex(ke=>ke===T[ce]);if(~be){if(me.splice(be,1),W&&!te){const ke=Z(T[ce]);~ke&&(p.value.splice(ke,1),le&&(h.value=""))}}else me.push(T[ce]),le&&(h.value="");M(me,A(me))}else{if(W&&!te){const me=Z(T[ce]);~me?p.value=[p.value[me]]:p.value=N}Wi(),Pe(),M(T[ce],T)}}function Z(T){return p.value.findIndex(te=>te[e.valueField]===T)}function ie(T){x.value||se();const{value:W}=T.target;h.value=W;const{tag:te,remote:le}=e;if(ee(W),te&&!le){if(!W){f.value=N;return}const{onCreate:ce}=e,me=ce?ce(W):{[e.labelField]:W,[e.valueField]:W},{valueField:be,labelField:ke}=e;u.value.some(je=>je[be]===me[be]||je[ke]===me[ke])||p.value.some(je=>je[be]===me[be]||je[ke]===me[ke])?f.value=N:f.value=[me]}}function We(T){T.stopPropagation();const{multiple:W}=e;!W&&e.filterable&&Pe(),z(),W?M([],[]):M(null,null)}function kr(T){!ar(T,"action")&&!ar(T,"empty")&&!ar(T,"header")&&T.preventDefault()}function Hi(T){pe(T)}function wi(T){var W,te,le,ce,me;if(!e.keyboard){T.preventDefault();return}switch(T.key){case" ":if(e.filterable)break;T.preventDefault();case"Enter":if(!(!((W=v.value)===null||W===void 0)&&W.isComposing)){if(x.value){const be=(te=k.value)===null||te===void 0?void 0:te.getPendingTmNode();be?wt(be):e.filterable||(Pe(),Wi())}else if(se(),e.tag&&Ke.value){const be=f.value[0];if(be){const ke=be[e.valueField],{value:je}=c;e.multiple&&Array.isArray(je)&&je.includes(ke)||Ze(be)}}}T.preventDefault();break;case"ArrowUp":if(T.preventDefault(),e.loading)return;x.value&&((le=k.value)===null||le===void 0||le.prev());break;case"ArrowDown":if(T.preventDefault(),e.loading)return;x.value?(ce=k.value)===null||ce===void 0||ce.next():se();break;case"Escape":x.value&&(d1(T),Pe()),(me=v.value)===null||me===void 0||me.focus();break}}function Wi(){var T;(T=v.value)===null||T===void 0||T.focus()}function Hn(){var T;(T=v.value)===null||T===void 0||T.focusInput()}function vi(){var T;x.value&&((T=B.value)===null||T===void 0||T.syncPosition())}re(),i.watch(i.toRef(e,"options"),re);const ji={focus:()=>{var T;(T=v.value)===null||T===void 0||T.focus()},focusInput:()=>{var T;(T=v.value)===null||T===void 0||T.focusInput()},blur:()=>{var T;(T=v.value)===null||T===void 0||T.blur()},blurInput:()=>{var T;(T=v.value)===null||T===void 0||T.blurInput()}},en=i.computed(()=>{const{self:{menuBoxShadow:T}}=o.value;return{"--n-menu-box-shadow":T}}),Rn=s?mi("select",void 0,en,e):void 0;return Object.assign(Object.assign({},ji),{mergedStatus:$,mergedClsPrefix:t,mergedBordered:n,namespace:r,treeMate:_,isMounted:cs(),triggerRef:v,menuRef:k,pattern:h,uncontrolledShow:S,mergedShow:x,adjustedTo:wn(e),uncontrolledValue:a,mergedValue:c,followerRef:B,localizedPlaceholder:P,selectedOption:L,selectedOptions:V,mergedSize:F,mergedDisabled:R,focused:d,activeWithoutMenuOpen:Ke,inlineThemeDisabled:s,onTriggerInputFocus:ze,onTriggerInputBlur:_t,handleTriggerOrMenuResize:vi,handleMenuFocus:Mt,handleMenuBlur:bt,handleMenuTabOut:He,handleTriggerClick:Jt,handleToggle:wt,handleDeleteOption:Ze,handlePatternInput:ie,handleClear:We,handleTriggerBlur:Qt,handleTriggerFocus:Et,handleKeydown:wi,handleMenuAfterLeave:Fe,handleMenuClickOutside:Ce,handleMenuScroll:Hi,handleMenuKeydown:wi,handleMenuMousedown:kr,mergedTheme:o,cssVars:s?void 0:en,themeClass:Rn==null?void 0:Rn.themeClass,onRender:Rn==null?void 0:Rn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(rd,null,{default:()=>[i.h(sd,null,{default:()=>i.h(ev,{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(wd,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===wn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),i.withDirectives(i.h(Rw,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],[ls,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ls,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),dv={},Rh=i.defineComponent({...dv,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=i.computed(()=>o.value?r.value.map(b=>b.id):r.value?r.value.id:null),l=i.ref(o.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(b=>({...b,class:r.wrapContent?`${b.class} consistent-menu-width`:b.class}))),d=i.ref(!1),h=i.useTemplateRef("select-component"),u=b=>{b.length<r.minTermLength||(d.value=!0,r.searchDataHandler(b,d).then(S=>{if(D.isEmpty(S))return;const x=o.value?r.value:r.value?[r.value]:[],v=S.filter(B=>!x.some(k=>k.id===B.id));l.value=r.optionsListConverter([...x,...v])}).finally(()=>{d.value=!1}))};let p="";const f=D.debounce(()=>u(p),800),g=b=>{p=b,f()},m=b=>{var S;if(D.isArray(b)){const x=b.length>0?b.map(v=>{var B;return i.toRaw((B=l.value.find(k=>k.value===v))==null?void 0:B.item)}):[];s("update:value",x)}else if(b>0){const x=i.toRaw((S=l.value.find(v=>v.value===b))==null?void 0:S.item);s("update:value",x)}else s("update:value",null)};return t({focus:()=>{var b;return(b=h.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=h.value)==null?void 0:b.blurInput()}}),(b,S)=>(i.openBlock(),i.createBlock(i.unref(cv),{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"]))}}),hv={},$h=i.defineComponent({...hv,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.useTemplateRef("select-component"),a=async u=>r.searchType==="categories"?Y.HttpRequester.getInstance(Y.ProductCategoryDataProvider).publicSimpleSearch(u):r.searchType==="products"?Y.HttpRequester.getInstance(Y.ProductDataProvider).publicSimpleSearch(u):new Promise(p=>{p([])}),l=u=>r.searchType==="categories"?Dt.convertReferencesToSelectOptionsList(u,!0,!1,p=>p!=null&&p.isNewRec()?"-":p.name):r.searchType==="products"?Dt.convertReferencesToSelectOptionsList(u,!0,!1,p=>p!=null&&p.isNewRec()?"-":`[${p.code}] ${p.name}`):[],c=(u,p)=>{if(r.renderLabel)return r.renderLabel(u,p);if(r.searchType==="products"){const f=u.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},f.code),i.h("span",{},[f.name])])}if(r.searchType==="categories"){const f=u.item;return i.h("div",{},[f.name])}};return 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,p)=>(i.openBlock(),i.createBlock(Rh,{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":p[0]||(p[0]=f=>s("update:value",f))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),uv={class:"col-span-2 flex flex-row gap-2.5"},fv={class:"flex-1"},pv={class:"text-sc-grey"},gv={class:"ml-2.5"},mv={key:0,class:"flex-none"},yv={},_v=i.defineComponent({...yv,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(null),o=()=>structuredClone(i.toRaw(n.value)),a=i.ref(o()),l=()=>{r("update:value",a.value.map(u=>i.toRaw(u)))},c=u=>{u&&(a.value=[...a.value.map(p=>i.toRaw(p)),...(D.isArray(u)?u:[u]).filter(p=>!a.value.some(f=>f.id===p.id))],i.nextTick(()=>{s.value=null}),l())},d=u=>{u&&(a.value=a.value.map(p=>p.id===u.id?u:i.toRaw(p)),l())},h=u=>{a.value=a.value.filter(p=>p.id!==u.id),l()};return i.watch(()=>n.value,()=>{a.value=o()}),(u,p)=>{const f=I.NListItem,g=Yy,m=I.NButton,y=I.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(u.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode($h,{value:s.value,"onUpdate:value":[p[0]||(p[0]=_=>s.value=_),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(f,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...p[1]||(p[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,_=>(i.openBlock(),i.createBlock(f,{key:_.id},{suffix:i.withCtx(()=>[i.createVNode(m,{disabled:u.disabled,quaternary:"",type:"error",onClick:b=>h(_)},{default:i.withCtx(()=>[i.createVNode(g)]),_:2},1032,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",uv,[i.createElementVNode("span",fv,[i.createElementVNode("span",pv,i.toDisplayString(_.code),1),i.createElementVNode("span",gv,i.toDisplayString(_.name),1)]),u.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",mv,[i.renderSlot(u.$slots,"item-extra",{item:_,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),bv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function wv(e,t){return i.openBlock(),i.createElementBlock("svg",bv,[...t[0]||(t[0]=[i.createElementVNode("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 vv=i.markRaw({name:"tabler-truck-filled",render:wv}),kv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xv(e,t){return i.openBlock(),i.createElementBlock("svg",kv,[...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 Cv=i.markRaw({name:"tabler-truck-delivery",render:xv}),Sv={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bv(e,t){return i.openBlock(),i.createElementBlock("svg",Sv,[...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 Tv=i.markRaw({name:"tabler-truck-loading",render:Bv}),Ev={class:"flex flex-col gap-1"},Rv={key:0,class:"flex flex-row gap-1 text-base"},$v={key:1,class:"text-sc-dark-grey text-sm"},Nv={class:"text-sc-grey mr-1.5"},Pv={key:0},Fv={key:1},Mv={key:2},Av={},Cs=i.defineComponent({...Av,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){const t=i.computed(()=>{var s;return(s=Y.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(o=>o.id===r.delivery.type)}),n=i.computed(()=>$n.format(r.delivery.date,"dd.MM.yyyy")),r=e;return(s,o)=>{var d,h,u,p,f,g,m,y;const a=Tv,l=Cv,c=vv;return i.openBlock(),i.createElementBlock("div",Ev,[s.showType?(i.openBlock(),i.createElementBlock("span",Rv,[((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((p=t.value)==null?void 0:p.name),1)])):i.createCommentVNode("",!0),s.showDetails?(i.openBlock(),i.createElementBlock("span",$v,[i.createElementVNode("span",Nv,i.toDisplayString(n.value),1),(g=(f=s.delivery)==null?void 0:f.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",Pv,i.toDisplayString(s.delivery.address.address),1)):i.createCommentVNode("",!0),(y=(m=s.delivery)==null?void 0:m.warehouse)!=null&&y.address?(i.openBlock(),i.createElementBlock("span",Fv,"со склада "+i.toDisplayString(s.delivery.warehouse.address),1)):(i.openBlock(),i.createElementBlock("span",Mv,"(не указано)"))])):i.createCommentVNode("",!0)])}}}),Vv={class:"flex flex-col gap-2.5"},Iv={class:"text-base"},Ov=["href"],zv={class:"text-sc-grey"},Lv={},Nh=i.defineComponent({...Lv,__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=Y.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(t.order.status??-1)))==null?void 0:c.name:void 0}),s=i.computed(()=>t.fields.includes(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",Vv,[i.createElementVNode("span",Iv,[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,Ov)):i.createCommentVNode("",!0),s.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(uo,{date:l.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",zv,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),o.value?(i.openBlock(),i.createBlock(Tr,{key:0,client:o.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Cs,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),Dv={},Ph=i.defineComponent({...Dv,__name:"order-payment",props:{payment:{}},setup(e){const t=e,n=i.computed(()=>{var r;return(r=Y.useReferencesStore().paymentTypeReference)==null?void 0:r.find(s=>s.id===t.payment.type)});return(r,s)=>{var o;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((o=n.value)==null?void 0:o.name)??"-"),1)}}}),Hv={class:"flex flex-row gap-1.5"},Wv={class:"flex-none text-nowrap"},jv={class:"flex flex-1 flex-col"},qv={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},Xv={key:0},Yv={key:1},Uv={},Fh=i.defineComponent({...Uv,__name:"order-product-info",props:{product:{},index:{}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",Hv,[i.createElementVNode("span",Wv,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",jv,[i.createVNode(Yi,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),i.createElementVNode("div",qv,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",Xv,i.toDisplayString(`${t.product.length} ${t.product.product.unit} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",Yv,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)])])]))}}),Gv={},Kv=i.defineComponent({...Gv,__name:"order-items-list",props:{order:{}},setup(e){const t=()=>{const s=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(o,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:o=>i.h("span",{class:"text-base"},[o.product.code])},{title:"Наименование",key:"name",resizable:!0,render:o=>i.h(Yi,{product:o.product,showCode:!1,showPlanningDates:!1})},{title:"Кол-во",key:"quantity",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-nowrap text-base"},o.product.getIsMeasurable()?[`${o.length} ${o.product.unit} x ${o.quantity} шт.`]:[`${o.quantity} ${o.product.unit}`])},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.costOneRub.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:o=>i.h("span",{class:"text-base"},[`${o.cost.toLocaleString("ru-ru",{minimumFractionDigits:2})} ${o.currency}`])}];switch(vt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:return[{title:"",key:"items",resizable:!0,render:(o,a)=>i.h(Fh,{product:o,index:a})}];case qe.laptop:return s;default:return s}},n=i.ref(t()),r=()=>{n.value=t()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(s,o)=>{const a=I.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[o[0]||(o[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:s.order.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1},null,8,["columns","data","row-key"])],64)}}}),Mh=jn(Kv,[["__scopeId","data-v-b15b9b70"]]),Zv={class:"text-base"},Jv={},Uo=i.defineComponent({...Jv,__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",Zv,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))}}),Qv={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},e2={class:"col-span-2"},t2={class:"col-span-2"},n2={class:"btn btn-primary",href:"{{ invoice }}"},i2={},Ah=i.defineComponent({...i2,__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",Qv,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[n[0]||(n[0]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Uo,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),n[10]||(n[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(Tr,{client:t.order.client,class:"col-span-2"},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[n[1]||(n[1]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Ea,{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",e2,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(Ph,{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(Cs,{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",t2,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[n[8]||(n[8]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Uo,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),t.order.invoices&&t.order.invoices.length>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:8},[n[9]||(n[9]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(r,s)=>(i.openBlock(),i.createElementBlock("div",{key:s,class:"col-span-2"},[i.createElementVNode("a",n2," Скачать счет №"+i.toDisplayString(s+1),1)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),r2={key:0},s2={class:"text-sc-dark-grey my-2 text-center"},o2={key:1,class:"text-sc-dark-grey my-2 text-center"},a2={key:2},l2={class:"text-sc-dark-grey mt-4 text-right font-bold"},c2={class:"text-sc-primary"},d2={},Vh=i.defineComponent({...d2,__name:"order-info",props:{order:{}},setup(e){const t=e,n=i.ref(!1),r=i.ref(new Y.Order(t.order)),s=()=>{n.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrder(t.order.id).then(a=>{r.value=a}).finally(()=>{n.value=!1})},o=i.computed(()=>(r.value.products??[]).reduce((a,l)=>a+l.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.onMounted(()=>{s()}),(a,l)=>{const c=I.NSpin;return n.value?(i.openBlock(),i.createElementBlock("div",r2,[i.createElementVNode("div",s2,[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",o2," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",a2,[i.createVNode(Mh,{order:r.value},null,8,["order"]),i.createElementVNode("div",l2,[l[1]||(l[1]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",c2,i.toDisplayString(o.value)+" ₽",1)]),i.createVNode(Ah,{order:r.value},null,8,["order"])]))}}}),h2={},u2=i.defineComponent({...h2,__name:"orders-list",props:{fields:{},orderUrl:{},filters:{},sort:{},pagination:{}},setup(e){const t=e,n=()=>structuredClone(i.toRaw(t.sort??{field:"id",direction:"desc"})),r=i.ref(n()),s=i.ref([]),o=i.ref(!1),a=i.computed(()=>Y.useReferencesStore().orderStatusReference),l=()=>{const m=t.fields.length>0?t.fields:[Ue.CreatedAt,Ue.Id,Ue.DeliveryInfo,Ue.Status,Ue.SalesDirections,Ue.AttachedUser],y={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},_={type:"expand",expandable:D.constant(!0),renderExpand:S=>i.h(Vh,{order:S,class:"pl-10 pt-3 pb-10"}),width:"30"},b=[{title:"Дата заказа",key:Ue.CreatedAt,resizable:!0,minWidth:100,render:S=>i.h(uo,{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(Tr,{client:S.client})},{title:"Тип доставки",key:Ue.DeliveryInfo,resizable:!0,render:S=>i.h(Cs,{delivery:S.delivery})},{title:"Статус",key:Ue.Status,resizable:!0,minWidth:90,render:S=>{var x,v;return i.h("span",{class:"text-base"},[((v=(x=a.value)==null?void 0:x.find(B=>B.id===(S.status??-1)))==null?void 0:v.name)??""])}},{title:"Напр. продаж",key: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(vt.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:return[_,{key:"order",title:"Заказ",resizable:!0,render:S=>i.h(Nh,{order:S,fields:m,orderUrl:t.orderUrl})}];case qe.laptop:return[_,...m.map(S=>b.find(x=>x.key===S)??y)];default:return[y]}},c=i.ref(l()),d=i.ref(new Y.DataTablePagination(t.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!1})),h=()=>{t.filters&&(o.value=!0,Y.HttpRequester.getInstance(Y.OrdersDataProvider).getOrders(t.filters,r.value,{page:d.value.page,pageSize:d.value.pageSize}).then(m=>{d.value.itemCount!==m.meta.total&&(d.value.itemCount=m.meta.total),d.value.page!==m.meta.currentPage&&(d.value.page=m.meta.currentPage),d.value.pageCount!==m.meta.lastPage&&(d.value.pageCount=m.meta.lastPage),d.value.pageSize!==m.meta.perPage&&(d.value.pageSize=m.meta.perPage),s.value=m.data}).finally(()=>{o.value=!1}))},u=m=>{d.value.page=m,h()},p=m=>{d.value.pageSize=m,h()},f=m=>{D.isNull(m)?r.value=n():(r.value.field=m.columnKey.toString(),r.value.direction=m.order==="ascend"?"asc":"desc"),c.value.forEach(y=>{if(Object.hasOwn(y,"sortOrder")){const _=y;_.sortOrder=_.key===(m==null?void 0:m.columnKey)&&(m!=null&&m.sorter)&&m.order!==!1?m.order:!1}}),h()},g=()=>{c.value=l()};return i.watch(()=>t.filters,()=>{h()}),i.watch(()=>t.sort,()=>{r.value=n(),h()}),i.onMounted(()=>{g(),window.addEventListener("resize",g),i.nextTick(()=>{h()})}),i.onUnmounted(()=>{window.removeEventListener("resize",g)}),(m,y)=>{const _=I.NDataTable;return i.openBlock(),i.createBlock(_,{columns:c.value,data:s.value,"row-key":b=>b.id,pagination:d.value,loading:o.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"pagination-behavior-on-filter":"first","onUpdate:page":u,"onUpdate:pageSize":p,"onUpdate:sorter":f},null,8,["columns","data","row-key","pagination","loading"])}}}),f2=jn(u2,[["__scopeId","data-v-7c4554f4"]]),p2=["href"],g2={class:"text-sc-dark-grey"},m2={},y2=i.defineComponent({...m2,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(e,{emit:t}){const n=e,r=t,s=i.computed(()=>$n.format(n.order.createdAt,Y.AppConfigProvider.getConfig().dateFormats.uiDateWithTime)),o=a=>{D.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:a.orderLink??"#",onClick:l[0]||(l[0]=c=>o(c))},i.toDisplayString(a.order.id),9,p2),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(", ",-1)),i.createElementVNode("span",g2,"автор: "+i.toDisplayString(a.order.creator.name)+" ["+i.toDisplayString(a.order.creator.type)+"]",1)],64))}}),_2={class:"sc-page flex flex-col"},b2={class:"my-2 flex flex-row items-end"},w2={class:"sc-title grow"},v2={key:0,class:"sc-title-buttons flex-1 grow-0"},k2={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},x2={key:0,class:"sc-title-extra mt-2 sm:mt-4"},C2={},Ih=i.defineComponent({...C2,__name:"page",props:{title:{}},setup(e){return(t,n)=>{const r=I.NH1;return i.openBlock(),i.createElementBlock("div",_2,[i.createElementVNode("div",b2,[i.createElementVNode("div",w2,[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",v2,[i.createElementVNode("div",k2,[i.renderSlot(t.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),t.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",x2,[i.renderSlot(t.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(t.$slots,"default")])}}}),S2={class:"overflow-hidden transition-all duration-300"},B2={class:"text-lg font-medium leading-none"},T2={},Oh=i.defineComponent({...T2,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(0),o=i.ref(n.showDrawer),a=()=>{switch(vt.getDeviceTypeByResolution()){case qe.phone:return window.innerWidth*.66;case qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{o.value?D.isUndefined(n.drawerWidth)?s.value=a():s.value=D.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:s.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>o.value,()=>{l(),r("update:show-drawer",o.value)}),i.watch(()=>n.showDrawer,c=>{o.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const h=I.NDrawerContent,u=I.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",S2,[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]=p=>o.value=p),resizable:!0,width:s.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(h,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",B2,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)}}}),E2={key:0,ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 sm:gap-8"},R2={key:0},$2={class:"sc-page-preview-panel grow"},N2={key:1,class:"sc-page-preview-panel-extra flex-none"},P2={},F2=i.defineComponent({...P2,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""}},setup(e,{expose:t}){const n=i.ref(!1),r=()=>{n.value=!0},s=i.useTemplateRef("panel-component-ref");return t({scrollToTopOfPanel:a=>{var l;(l=s.value)==null||l.scrollIntoView({behavior:"smooth"}),a&&i.nextTick(()=>{var c,d;window.scrollTo({top:(((d=(c=s.value)==null?void 0:c.getBoundingClientRect())==null?void 0:d.top)??0)+window.pageYOffset+a,behavior:"smooth"})})},showPanel:r}),(a,l)=>{const c=I.NButton;return i.openBlock(),i.createBlock(Ih,{title:a.title},i.createSlots({default:i.withCtx(()=>[a.$slots["preview-panel"]||a.$slots["preview-panel-extra"]||a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",E2,[a.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",R2,[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",$2,[i.renderSlot(a.$slots,"preview-panel")]),a.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",N2,[i.renderSlot(a.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)):i.createCommentVNode("",!0),i.createVNode(Oh,{"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"])}}}),M2={},A2=i.defineComponent({...M2,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.computed(()=>D.isArray(r.value)),a=i.computed(()=>{var f;return D.isArray(r.value)?r.value.map(g=>g.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{var m;let f=r.showEmptyValue?[Y.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=D.isArray(r.value)?r.value.map(_=>_.id):[(m=r.value)==null?void 0:m.id];g=D.union(g,r.managerReferenceList.filter(_=>!_.isActive).map(_=>_.id)),f=r.managerReferenceList.filter(_=>_.isActive||y.includes(_.id))}return Dt.convertReferencesToSelectOptionsList(f,!0,!0,y=>y.salesDirection.isNewRec()?y.name:`${y.name} (${y.salesDirection.name}) ${!r.showActualOnly&&!y.isActive?"[Не активен]":""}`,y=>g.includes(y.id)&&y.isActive)}),c=i.computed(()=>l.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),d=i.useTemplateRef("select-component"),h=f=>{var g;if(D.isArray(f)){const m=f.length>0?f.map(y=>{var _;return(_=l.value.find(b=>b.value===y))==null?void 0:_.item}):[];s("update:value",m)}else{const m=f>0?(g=l.value.find(y=>y.value===f))==null?void 0:g.item:new Y.Manager;s("update:value",m)}};return i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value){const g=o.value?r.value:[r.value];D.some(g,m=>D.some(f,["id",m.id]))&&s("update:value",g.filter(m=>!D.some(f,["id",m.id])))}},{immediate:!0}),t({focus:()=>{var f;return(f=d.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=d.value)==null?void 0:f.blurInput()}}),(f,g)=>(i.openBlock(),i.createBlock(i.unref(I.NSelect),{ref:"select-component",value:a.value,clearable:f.clearable,disabled:l.value.length===0,"consistent-menu-width":f.consistentMenuWidth,multiple:o.value,options:c.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),V2={class:"m-0.5 flex flex-col p-0.5"},I2={class:"flex flex-row gap-1"},O2={key:0},z2={key:1},L2={key:2},D2={key:3},H2={class:"flex flex-row gap-1"},W2={key:0},j2={key:1},q2={key:2},X2={key:3},Y2={},zh=i.defineComponent({...Y2,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",V2,[i.createElementVNode("span",I2,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",O2,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",z2,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",L2,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",D2,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",H2,[t.addr.street?(i.openBlock(),i.createElementBlock("span",W2,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",q2,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",X2,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Go={clearable:!1,value:"",field:void 0,disabled:!1},U2={},G2=i.defineComponent({...U2,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Go,minTermLength:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"addressString"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=D.debounce(()=>h(),800),h=async()=>{!o.value||o.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(o.value,a):Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchAddresses(o.value)).finally(()=>{a.value=!1}))},u=(m,y)=>{const _=l.value.find(b=>b.id===m.value)||{};return i.h(zh,{addr:_,selected:y},{default:D.constant("-")})},p=m=>{d.cancel();const y=l.value.find(_=>_.id===m)||{};s("select",y)},f=i.ref(null);function g(){f.value.focus()}return t({focus:g}),(m,y)=>{const _=I.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),K2={class:"m-0.5 flex flex-col p-0.5"},Z2={class:"font-medium"},J2={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},Q2={key:0},ek={key:1},tk={},Lh=i.defineComponent({...tk,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>(i.openBlock(),i.createElementBlock("div",K2,[i.createElementVNode("span",Z2,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",J2,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",Q2," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",ek," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),nk={},ik=i.defineComponent({...nk,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Go,minTermLength:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(m=>({label:m[r.field??"_"]??"-",value:m.id})));i.watch(()=>r.value,m=>{o.value=m}),i.watch(o,()=>{s("update:value",o.value)});const d=D.debounce(()=>h(),800),h=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchBank(o.value)}finally{a.value=!1}}},u=(m,y)=>{const _=l.value.find(b=>b.id===m.value)||{};return i.h(Lh,{bank:_,selected:y},{default:D.constant("-")})},p=m=>{d.cancel();const y=l.value.find(_=>_.id===m)||{};s("select",y)},f=i.ref(null);function g(){f.value.focus()}return t({focus:g}),(m,y)=>{const _=I.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:o.value,"onUpdate:value":[y[0]||(y[0]=b=>o.value=b),i.unref(d)],clearable:m.clearable,disabled:m.disabled,loading:a.value,options:c.value,"render-label":u,placeholder:"",onSelect:p},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),rk={class:"font-medium"},sk={key:0,class:"flex flex-row gap-2"},ok={key:0,class:"text-xs font-light text-blue-800"},ak={key:1,class:"text-sc-dark-grey text-xs font-light"},lk={},Dh=i.defineComponent({...lk,__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",rk,i.toDisplayString(s.org.name),1),s.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",sk,[s.org.inn?(i.openBlock(),i.createElementBlock("span",ok,i.toDisplayString(s.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",ak,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),ck={},dk=i.defineComponent({...ck,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Go,minTermLength:()=>{var e;return((e=Y.AppConfigProvider.getConfig())==null?void 0:e.minSearchTermLength)??3}}),emits:["select","update:value"],setup(e,{expose:t,emit:n}){const r=e,s=n,o=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=y=>{var _,b;return!!(((b=(_=y.rawData)==null?void 0:_.state)==null?void 0:b.liquidationDate)??!1)},d=i.computed(()=>Dt.convertReferencesToSelectOptionsList(l.value,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{o.value=y}),i.watch(o,()=>{s("update:value",o.value)});const h=D.debounce(()=>u(),800),u=async()=>{if(!(!o.value||o.value.length<r.minTermLength)){a.value=!0;try{l.value=await Y.HttpRequester.getInstance(Y.DataSuggestionProvider).searchOrganization(o.value)}finally{a.value=!1}}},p=(y,_)=>{const b=l.value.find(S=>S.id===y.value)||{};return i.h(Dh,{org:b,selected:_},{default:D.constant("-")})},f=y=>{h.cancel();const _=l.value.find(b=>b.id===y)||{};(r.allowSelectTerminated||!c(_))&&s("select",_)},g=i.ref(null);function m(){g.value.focus()}return t({focus:m}),(y,_)=>{const b=I.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:o.value,"onUpdate:value":[_[0]||(_[0]=S=>o.value=S),i.unref(h)],clearable:y.clearable,disabled:y.disabled,loading:a.value,options:d.value,"render-label":p,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),hk={},uk=i.defineComponent({...hk,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(!1),o=()=>{r("accept",()=>{s.value=!1})},a=()=>{n.disableConfirm?o():s.value=!0};return(l,c)=>{const d=I.NButton,h=I.NPopover,u=I.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(h,{disabled:l.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:l.disabled,ghost:l.ghost,loading:l.loading,size:l.size,type:l.type,quaternary:l.quaternary,circle:l.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(l.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(u,{show:s.value,"onUpdate:show":c[1]||(c[1]=p=>s.value=p),content:l.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:l.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:o},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=p=>s.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),fk={key:0,class:"whitespace-pre-line"},pk={key:1,class:"text-sc-dark-grey"},gk={},mk=i.defineComponent({...gk,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(e,{emit:t}){const n=e,r=t,s=i.ref(n.comment);i.watch(()=>s.value,l=>{s.value=l});const o=l=>{r("update:comment",s.value,l)},a=()=>{s.value=n.comment};return(l,c)=>{const d=I.NInput;return i.openBlock(),i.createBlock(Lc,{disabled:l.disabled,"onEditor:apply":o,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[l.comment?(i.openBlock(),i.createElementBlock("span",fk,i.toDisplayString(l.comment),1)):(i.openBlock(),i.createElementBlock("span",pk," - Комментарий отсутствует - "))])]),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"])}}}),yk={key:0,class:"text-sm"},_k={key:1},bk={},wk=i.defineComponent({...bk,__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",yk,[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",_k,[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)]))}}),vk={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function kk(e,t){return i.openBlock(),i.createElementBlock("svg",vk,[...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 xk=i.markRaw({name:"ion-warning",render:kk}),Ck={},Sk=i.defineComponent({...Ck,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(e){return(t,n)=>{const r=xk,s=I.NPopover;return i.openBlock(),i.createBlock(s,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),yt=class yt{static init(t,n){yt.messagesService&&yt.notificationsService||(yt.messagesService=t,yt.notificationsService=n)}static getMessagesService(){if(!yt.messagesService)throw new Error("UI provider is not initialized.");return yt.messagesService}static getNotificationsService(){if(!yt.notificationsService)throw new Error("UI provider is not initialized.");return yt.notificationsService}static showNotificationsForErrorResponseData(t,n={}){var r,s;if(D.isEmpty(t.errors)){const o=(s=(r=t.rawError)==null?void 0:r.config)==null?void 0:s.url,a=o?` [ ${o} ]`:"";yt.notificationsService?yt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:t.message,meta:`#${t.status}${a}: ${t.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",t)}else for(const o in t.errors)Object.prototype.hasOwnProperty.call(n,o)?n[o]=new Y.FieldValidationResultData(t.errors[o].toString(),"error"):yt.messagesService?yt.messagesService.error(t.errors[o].toString()):console.log("Show notification error response data: UI provider is not initialized.",t.errors[o])}};C(yt,"messagesService"),C(yt,"notificationsService");let Ko=yt;const Bk=i.computed(()=>Y.useReferencesStore().deliveryTypeReference??[]),Tk=i.computed(()=>Y.useReferencesStore().managersList??[]),Ek=i.computed(()=>Y.useReferencesStore().opfReference??[]),Rk=i.computed(()=>Y.useReferencesStore().partnerGroupsReference??[]),$k=i.computed(()=>Y.useReferencesStore().priceCoefficientsReference??[]),Nk=i.computed(()=>Y.useReferencesStore().productFilesTypesReference??[]),Pk=i.computed(()=>Y.useReferencesStore().resourceTypesReference),Fk=i.computed(()=>Y.useReferencesStore().salesDirectionsReference??[]),Mk=i.computed(()=>Y.useReferencesStore().warehousesReference??[]),Ak=i.computed(()=>Dt.convertReferencesToSelectOptionsList(Y.useReferencesStore().channelPrimaryInterestsReference??[],!0,!0)),Vk=i.computed(()=>Dt.convertReferencesToSelectOptionsList(Y.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!0)),Ik=e=>Y.HttpRequester.getInstance(Y.ReferenceDataProvider).searchCity(e),Ok=e=>Dt.convertReferencesToSelectOptionsList(e,!0,!1,t=>{var n,r,s;return t!=null&&t.isNewRec()?"-":`${t.name}, ${(n=t==null?void 0:t.region)==null?void 0:n.name}, ${(s=(r=t==null?void 0:t.region)==null?void 0:r.country)==null?void 0:s.name}`},t=>t==null?void 0:t.isNewRec());H.ConfiguratorSettingsKozyrek=h0,H.ContentHelper=Wn,H.KozyrekLine=si,H.KozyrekTailTemplate=co,H.KozyrekTemplate=Mi,H.OrdersTableFields=Ue,H.Point=lo,H.ScAddProductToCartForm=qf,H.ScAddressSuggestion=G2,H.ScAddressSuggestionLabel=zh,H.ScBankSuggestion=ik,H.ScBankSuggestionLabel=Lh,H.ScBaseDialog=gy,H.ScButtonWithConfirmAction=uk,H.ScCategoryCollapse=Ba,H.ScClientNameWithShortInfo=Tr,H.ScCollapse=Sa,H.ScCollapseItem=wa,H.ScCommentEditor=mk,H.ScConfiguratorsProductInfo=Ui,H.ScContragentWithShortInfo=Ea,H.ScDateRange=iy,H.ScDateTimeLabel=uo,H.ScDebouncedInput=My,H.ScDebouncedInputNumber=Ai,H.ScDebt=wk,H.ScDialogHeader=hy,H.ScEmail=dp,H.ScExternalLink=jy,H.ScImageGallery=Ca,H.ScInlineEditableItem=Lc,H.ScInlineView=fo,H.ScKozyrekConfigurator=d0,H.ScKozyrekConfiguratorParamsForm=Va,H.ScKozyrekConfiguratorPreview=Fc,H.ScKozyrekConfiguratorTemplates=Fa,H.ScLightGallery=xa,H.ScManagerSelect=A2,H.ScMetalForDoorsConfigurator=y0,H.ScMetalForDoorsConfiguratorForm=Mc,H.ScMosquitoConfigurator=D0,H.ScMosquitoConfiguratorForm=Ac,H.ScMosquitoConfiguratorMeasurementInstructions=Vc,H.ScMosquitoConfiguratorPreview=ho,H.ScOrderCommonInfo=Nh,H.ScOrderDeliveryLabel=Cs,H.ScOrderDetails=Ah,H.ScOrderInfo=Vh,H.ScOrderItemsList=Mh,H.ScOrderPayment=Ph,H.ScOrderProductInfo=Fh,H.ScOrdersList=f2,H.ScOrgSuggestion=dk,H.ScOrgSuggestionLabel=Dh,H.ScPage=Ih,H.ScPageWithSlidingPanel=F2,H.ScPersonContactsBlock=eg,H.ScPhone=Mp,H.ScPhoneInput=Iy,H.ScProductName=Yi,H.ScProductsList=_v,H.ScReferenceSelect=Ta,H.ScSearchableProductSelect=$h,H.ScSearchableReferenceSelect=Rh,H.ScSetClientPriceFormItem=Uf,H.ScShortTextOrderInfo=y2,H.ScSingleFileUploadSelector=wy,H.ScSlidingContentWithDrawer=Oh,H.ScStripConfigurator=J0,H.ScStripConfiguratorForm=Oc,H.ScStripConfiguratorLineItem=Ic,H.ScStripConfiguratorPreview=zc,H.ScUserShortInfo=Uo,H.ScWarningIcon=Sk,H.SelectOptionHelper=Dt,H.UiNotificationProvider=Ko,H.WindowResolutionEnum=qe,H.WindowResolutionProvider=vt,H.channelPrimaryInterestOptionsList=Ak,H.componentSizeInjectionKey=xr,H.deliveryTypeReferenceList=Bk,H.managersReferenceList=Tk,H.naiveUiTheme=Nu,H.opfReferenceList=Ek,H.partnerGroupReferenceList=Rk,H.priceCoefficientsReferenceList=$k,H.productFilesTypesReferenceList=Nk,H.renderConfig=Ie,H.resourceReferencesList=Pk,H.salesDirectionsReferenceList=Fk,H.searchCityReferenceDataHandler=Ik,H.searchCityReferenceLabelRenderer=Ok,H.sourcePrimaryInterestOptionsList=Vk,H.warehousesReferenceList=Mk,Object.defineProperty(H,Symbol.toStringTag,{value:"Module"})});
|
|
823
823
|
//# sourceMappingURL=sc-vue-ui-lib.umd.cjs.map
|