@snabcentr/vue-ui-lib 3.66.2 → 3.66.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(X,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("vue"),require("naive-ui"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","@snabcentr/common-lib","lodash-es","vue","naive-ui","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],j):(X=typeof globalThis<"u"?globalThis:X||self,j(X.SC_VueUiLib={},X["@snabcentr/common-lib"],X["lodash-es"],X.Vue,X["naive-ui"],X["date-fns"],X["libphonenumber-js"],X["ts-case-convert"],X["vue-tel-input"]))})(this,(function(X,j,M,i,A,je,or,Wo,af){"use strict";var t3=Object.defineProperty;var nf=X=>{throw TypeError(X)};var n3=(X,j,M)=>j in X?t3(X,j,{enumerable:!0,configurable:!0,writable:!0,value:M}):X[j]=M;var T=(X,j,M)=>n3(X,typeof j!="symbol"?j+"":j,M),rf=(X,j,M)=>j.has(X)||nf("Cannot "+M);var Mt=(X,j,M)=>(rf(X,j,"read from private field"),M?M.call(X):j.get(X)),Xa=(X,j,M)=>j.has(X)?nf("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(X):j.set(X,M),of=(X,j,M,i)=>(rf(X,j,"write to private field"),i?i.call(X,M):j.set(X,M),M);var Bi,gt,zo;const Ct=class Ct{static init(e,n){Ct.messagesService&&Ct.notificationsService||(Ct.messagesService=e,Ct.notificationsService=n)}static getMessagesService(){if(!Ct.messagesService)throw new Error("UI provider is not initialized.");return Ct.messagesService}static getNotificationsService(){if(!Ct.notificationsService)throw new Error("UI provider is not initialized.");return Ct.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,o;if(M.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";Ct.notificationsService?Ct.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const s in e.errors)Object.prototype.hasOwnProperty.call(n,s)?n[s]=new j.FieldValidationResultData(e.errors[s].toString(),"error"):Ct.messagesService?Ct.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};T(Ct,"messagesService"),T(Ct,"notificationsService");let sr=Ct;const ar=new WeakMap,lf=async t=>{const e=navigator.clipboard;if(e!=null&&e.writeText){await e.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select();const r=document.execCommand("copy");if(n.remove(),!r)throw new Error("Не удалось скопировать через execCommand.")},Ua=async t=>{const e=M.isNil(t)?"":String(t);if(e)try{await lf(e),sr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{sr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},cf=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),df=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":cf(t)?"click":"dblclick",uf={mounted(t,e){t.style.setProperty("cursor","pointer");const n=df(t,e),r=o=>{var a;n==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=ar.get(t);Ua(s==null?void 0:s.value).catch(M.noop)};ar.set(t,{value:e.value,eventName:n,handler:r}),t.addEventListener(n,r)},updated(t,e){const n=ar.get(t);n&&(n.value=e.value)},beforeUnmount(t){const e=ar.get(t);e&&(t.removeEventListener(e.eventName,e.handler),ar.delete(t))}},Ka=t=>{if(t.key!=="Enter"&&t.code!=="Enter")return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||e.type==="range")return;t.preventDefault();const r=[...t.currentTarget.querySelectorAll("input")].filter(a=>a.type!=="range"&&!a.readOnly&&!a.disabled),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);s&&(s.focus(),s.select())},Ga={mounted(t){t.addEventListener("keydown",Ka)},unmounted(t){t.removeEventListener("keydown",Ka)}};var Pe=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.ClientInfoShort="client_info_short",t.CreatedAt="created_at",t.ClientCity="client_city",t.DeliveryInfo="delivery_info",t.DeliveryDate="delivery_date",t.Id="id",t.PaymentType="payment_type",t.SalesDirections="sales_directions",t.Status="status",t.actions="actions",t))(Pe||{}),Je=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Je||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&M.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const hf={readAsFileData(t){return new Promise((e,n)=>{const r=new FileReader;r.addEventListener("load",()=>{e({name:t.name,content:r.result})}),r.addEventListener("error",()=>{n(new Error(`Не удалось прочитать файл «${t.name}».`))}),r.readAsDataURL(t)})}},nt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},zr=(t,e=".",n=!1)=>{const{key:r}=t,o=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!o.value.includes("-")&&((o.selectionStart??0)===0||o.value.length===0)||(r===e||r===(e==="."?",":"."))&&!o.value.includes(e)&&!o.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},rt=t=>t?Number.parseFloat(t.replace(",",".")):null,tt=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Tt{static convertReferencesToOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...l]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(M.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=M.isString(r.key)?M.get(d,r.key):r.key(c),h=M.isString(r.label)?M.get(d,r.label):r.label(c);return{type:"group",label:M.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Tt.convertReferencesToOptionsList(e,n,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Tt.convertReferencesToOptionsList(e,n,r,o,s,a)}}const ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},He={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[0]=[i.createElementVNode("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 jo=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:mf}),gf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pf(t,e){return i.openBlock(),i.createElementBlock("svg",gf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const Za=i.markRaw({name:"tabler-edit",render:pf}),yf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bf(t,e){return i.openBlock(),i.createElementBlock("svg",yf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const Qa=i.markRaw({name:"ion-checkmark-done-circle",render:bf}),_f={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wf(t,e){return i.openBlock(),i.createElementBlock("svg",_f,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-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 Ja=i.markRaw({name:"ion-checkmark-done-circle-outline",render:wf}),xf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function kf(t,e){return i.openBlock(),i.createElementBlock("svg",xf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const vf=i.markRaw({name:"fluent-pin32-regular",render:kf}),Cf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Sf(t,e){return i.openBlock(),i.createElementBlock("svg",Cf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const Bf=i.markRaw({name:"ion-eye-outline",render:Sf}),Tf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Nf(t,e){return i.openBlock(),i.createElementBlock("svg",Tf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 $f=i.markRaw({name:"fluent-pin32-filled",render:Nf}),Rf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ef(t,e){return i.openBlock(),i.createElementBlock("svg",Rf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const Pf=i.markRaw({name:"ion-bookmark-outline",render:Ef}),Ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vf(t,e){return i.openBlock(),i.createElementBlock("svg",Ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const Mf=i.markRaw({name:"ion-eye-off-sharp",render:Vf}),Af={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function If(t,e){return i.openBlock(),i.createElementBlock("svg",Af,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const Of=i.markRaw({name:"ion-chevron-forward-outline",render:If}),zf=["data-name"],Df={class:"sc-collapse-item-header flex flex-row gap-2.5"},Lf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Hf={key:0},Wf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},jf={class:"flex flex-1 flex-col"},qf={key:0,class:"sc-collapse-item-sub-title flex-1"},Xf={key:1,class:"sc-collapse-item-title-extra flex-none"},Yf={key:0,class:"sc-collapse-item-content"},Uf={},Kf=i.defineComponent({...Uf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("itemHeaderClickHandler",M.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=M.some(a,p=>p===r.name),d=i.computed(()=>M.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,o("header:click",r.name,u.value),s(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,o("header:click",r.name,u.value),s(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,o("header:click",r.name,u.value),s(r.name,u.value))},expanded:i.readonly(u)}),(p,b)=>{const y=Of;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",Df,[i.createElementVNode("div",Lf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Hf,[i.createElementVNode("div",Wf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",jf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",qf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Xf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Yf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,zf)}}}),Nn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},el=Nn(Kf,[["__scopeId","data-v-f1311d1c"]]),Gf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zf(t,e){return i.openBlock(),i.createElementBlock("svg",Gf,[...e[0]||(e[0]=[i.createElementVNode("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 tl=i.markRaw({name:"ion-cart-outline",render:Zf}),lr=Symbol(),Qf={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"}},Jf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},em={},nl=i.defineComponent({...em,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(lr,"medium"),r=i.computed(()=>M.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=i.computed(()=>M.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=i.computed(()=>M.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>M.isNil(e.productContextButtonsConfig)?[]:M.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,f)=>{var N;const g=Ja,m=Qa,p=A.NButton,b=A.NTooltip,y=Za,_=tl,C=jo,x=A.NDropdown;return i.openBlock(),i.createElementBlock("div",Jf,[s.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:s.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(m,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:o.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((N=a.value)==null?void 0:N.length)>0?(i.openBlock(),i.createBlock(x,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(C)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),tm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nm(t,e){return i.openBlock(),i.createElementBlock("svg",tm,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const im=i.markRaw({name:"tabler-history",render:nm}),rm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function om(t,e){return i.openBlock(),i.createElementBlock("svg",rm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const sm=i.markRaw({name:"mdi-percent-outline",render:om}),am={class:"flex flex-row gap-1"},lm={key:0,class:"flex gap-1"},cm={key:0,class:"flex text-nowrap text-sm line-through"},dm={key:1,class:"flex flex-row text-nowrap text-sm"},um={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},hm={},jn=i.defineComponent({...hm,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var b;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),o=i.computed(()=>M.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),s=i.computed(()=>{const y=M.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return o.value||!y||M.isNil(l.value)||M.isNil(y.cost)?!1:l.value<y.cost}),a=((b=j.useBaseConfigStateStore().getConfig())==null?void 0:b.defaultCurrency)??"RUB",l=i.computed(()=>o.value?o.value.cost:M.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?M.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?je.format(r.value.costDate,j.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(M.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!M.isNil(l.value)),f=i.computed(()=>M.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const y=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*y)}),m=i.computed(()=>M.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const y=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(y)});return(y,_)=>{var w;const C=A.NTag,x=A.NTooltip,N=sm,$=im;return i.openBlock(),i.createElementBlock("div",am,[t.showTag?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode(C,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!o.value}])},{default:i.withCtx(()=>{var v;return[i.createTextVNode(i.toDisplayString(((v=o.value)==null?void 0:v.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var v;return[i.createTextVNode(" "+i.toDisplayString(((v=o.value)==null?void 0:v.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":s.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",lm,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",cm,i.toDisplayString(m.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":s.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(w=o.value)==null?void 0:w.readOnly,"font-bold":!o.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var v;h.value&&((v=t.eventEmitter)==null||v.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(f.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!o.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode(N,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",dm," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(M.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",um,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(x,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode($,{class:"cursor-pointer",onClick:_[1]||(_[1]=v=>{var k;return(k=t.eventEmitter)==null?void 0:k.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),fm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mm(t,e){return i.openBlock(),i.createElementBlock("svg",fm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const qo=i.markRaw({name:"ion-information-circle-outline",render:mm}),gm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function pm(t,e){return i.openBlock(),i.createElementBlock("svg",gm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const il=i.markRaw({name:"ion-images",render:pm}),ym={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bm(t,e){return i.openBlock(),i.createElementBlock("svg",ym,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const _m=i.markRaw({name:"ion-bookmark",render:bm});/*!
1
+ (function(X,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("vue"),require("naive-ui"),require("date-fns"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","@snabcentr/common-lib","lodash-es","vue","naive-ui","date-fns","libphonenumber-js","ts-case-convert","vue-tel-input"],j):(X=typeof globalThis<"u"?globalThis:X||self,j(X.SC_VueUiLib={},X["@snabcentr/common-lib"],X["lodash-es"],X.Vue,X["naive-ui"],X["date-fns"],X["libphonenumber-js"],X["ts-case-convert"],X["vue-tel-input"]))})(this,(function(X,j,M,i,A,je,or,Wo,af){"use strict";var e3=Object.defineProperty;var nf=X=>{throw TypeError(X)};var t3=(X,j,M)=>j in X?e3(X,j,{enumerable:!0,configurable:!0,writable:!0,value:M}):X[j]=M;var T=(X,j,M)=>t3(X,typeof j!="symbol"?j+"":j,M),rf=(X,j,M)=>j.has(X)||nf("Cannot "+M);var Mt=(X,j,M)=>(rf(X,j,"read from private field"),M?M.call(X):j.get(X)),Xa=(X,j,M)=>j.has(X)?nf("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(X):j.set(X,M),of=(X,j,M,i)=>(rf(X,j,"write to private field"),i?i.call(X,M):j.set(X,M),M);var Bi,gt,zo;const Ct=class Ct{static init(e,n){Ct.messagesService&&Ct.notificationsService||(Ct.messagesService=e,Ct.notificationsService=n)}static getMessagesService(){if(!Ct.messagesService)throw new Error("UI provider is not initialized.");return Ct.messagesService}static getNotificationsService(){if(!Ct.notificationsService)throw new Error("UI provider is not initialized.");return Ct.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,o;if(M.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";Ct.notificationsService?Ct.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const s in e.errors)Object.prototype.hasOwnProperty.call(n,s)?n[s]=new j.FieldValidationResultData(e.errors[s].toString(),"error"):Ct.messagesService?Ct.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};T(Ct,"messagesService"),T(Ct,"notificationsService");let sr=Ct;const ar=new WeakMap,lf=async t=>{const e=navigator.clipboard;if(e!=null&&e.writeText){await e.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select();const r=document.execCommand("copy");if(n.remove(),!r)throw new Error("Не удалось скопировать через execCommand.")},Ua=async t=>{const e=M.isNil(t)?"":String(t);if(e)try{await lf(e),sr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{sr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},cf=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),df=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":cf(t)?"click":"dblclick",uf={mounted(t,e){t.style.setProperty("cursor","pointer");const n=df(t,e),r=o=>{var a;n==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=ar.get(t);Ua(s==null?void 0:s.value).catch(M.noop)};ar.set(t,{value:e.value,eventName:n,handler:r}),t.addEventListener(n,r)},updated(t,e){const n=ar.get(t);n&&(n.value=e.value)},beforeUnmount(t){const e=ar.get(t);e&&(t.removeEventListener(e.eventName,e.handler),ar.delete(t))}},Ka=t=>{if(t.key!=="Enter"&&t.code!=="Enter")return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||e.type==="range")return;t.preventDefault();const r=[...t.currentTarget.querySelectorAll("input")].filter(a=>a.type!=="range"&&!a.readOnly&&!a.disabled),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);s&&(s.focus(),s.select())},Ga={mounted(t){t.addEventListener("keydown",Ka)},unmounted(t){t.removeEventListener("keydown",Ka)}};var Pe=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.ClientInfoShort="client_info_short",t.CreatedAt="created_at",t.ClientCity="client_city",t.DeliveryInfo="delivery_info",t.DeliveryDate="delivery_date",t.Id="id",t.PaymentType="payment_type",t.SalesDirections="sales_directions",t.Status="status",t.actions="actions",t))(Pe||{}),Je=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Je||{});class ai{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&M.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ai.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ai.isVnodeEmpty(e()):!1}}const hf={readAsFileData(t){return new Promise((e,n)=>{const r=new FileReader;r.addEventListener("load",()=>{e({name:t.name,content:r.result})}),r.addEventListener("error",()=>{n(new Error(`Не удалось прочитать файл «${t.name}».`))}),r.readAsDataURL(t)})}},nt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},zr=(t,e=".",n=!1)=>{const{key:r}=t,o=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!o.value.includes("-")&&((o.selectionStart??0)===0||o.value.length===0)||(r===e||r===(e==="."?",":"."))&&!o.value.includes(e)&&!o.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},ot=t=>t?Number.parseFloat(t.replace(",",".")):null,tt=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Tt{static convertReferencesToOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):c.name,value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...l]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(M.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=M.isString(r.key)?M.get(d,r.key):r.key(c),h=M.isString(r.label)?M.get(d,r.label):r.label(c);return{type:"group",label:M.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Tt.convertReferencesToOptionsList(e,n,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Tt.convertReferencesToOptionsList(e,n,r,o,s,a)}}const ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},He={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mf(t,e){return i.openBlock(),i.createElementBlock("svg",ff,[...e[0]||(e[0]=[i.createElementVNode("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 jo=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:mf}),gf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function pf(t,e){return i.openBlock(),i.createElementBlock("svg",gf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const Za=i.markRaw({name:"tabler-edit",render:pf}),yf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bf(t,e){return i.openBlock(),i.createElementBlock("svg",yf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const Qa=i.markRaw({name:"ion-checkmark-done-circle",render:bf}),_f={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wf(t,e){return i.openBlock(),i.createElementBlock("svg",_f,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-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 Ja=i.markRaw({name:"ion-checkmark-done-circle-outline",render:wf}),xf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function kf(t,e){return i.openBlock(),i.createElementBlock("svg",xf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M22.15 3.237c-1.93-1.93-5.185-1.403-6.406 1.04l-3.175 6.35a1.5 1.5 0 0 1-.868.752L6.72 13.04a2 2 0 0 0-.782 3.312l4.149 4.149L4 26.586v1.415h1.414l6.086-6.086l4.149 4.149a2 2 0 0 0 3.311-.782l1.661-4.983a1.5 1.5 0 0 1 .752-.867l6.351-3.175c2.442-1.222 2.97-4.476 1.04-6.407zM17.533 5.17a2 2 0 0 1 3.203-.52l6.614 6.614a2 2 0 0 1-.52 3.203l-6.351 3.175a3.5 3.5 0 0 0-1.755 2.024l-1.661 4.982l-9.712-9.711l4.983-1.661a3.5 3.5 0 0 0 2.024-1.755z"},null,-1)])])}const vf=i.markRaw({name:"fluent-pin32-regular",render:kf}),Cf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Sf(t,e){return i.openBlock(),i.createElementBlock("svg",Cf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const Bf=i.markRaw({name:"ion-eye-outline",render:Sf}),Tf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Nf(t,e){return i.openBlock(),i.createElementBlock("svg",Tf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 $f=i.markRaw({name:"fluent-pin32-filled",render:Nf}),Rf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ef(t,e){return i.openBlock(),i.createElementBlock("svg",Rf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M352 48H160a48 48 0 0 0-48 48v368l144-128l144 128V96a48 48 0 0 0-48-48"},null,-1)])])}const Pf=i.markRaw({name:"ion-bookmark-outline",render:Ef}),Ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vf(t,e){return i.openBlock(),i.createElementBlock("svg",Ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const Mf=i.markRaw({name:"ion-eye-off-sharp",render:Vf}),Af={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function If(t,e){return i.openBlock(),i.createElementBlock("svg",Af,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const Of=i.markRaw({name:"ion-chevron-forward-outline",render:If}),zf=["data-name"],Df={class:"sc-collapse-item-header flex flex-row gap-2.5"},Lf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Hf={key:0},Wf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},jf={class:"flex flex-1 flex-col"},qf={key:0,class:"sc-collapse-item-sub-title flex-1"},Xf={key:1,class:"sc-collapse-item-title-extra flex-none"},Yf={key:0,class:"sc-collapse-item-content"},Uf={},Kf=i.defineComponent({...Uf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("itemHeaderClickHandler",M.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=M.some(a,p=>p===r.name),d=i.computed(()=>M.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,o("header:click",r.name,u.value),s(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,o("header:click",r.name,u.value),s(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,o("header:click",r.name,u.value),s(r.name,u.value))},expanded:i.readonly(u)}),(p,b)=>{const y=Of;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",Df,[i.createElementVNode("div",Lf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(y)],!0)],2)]),i.unref(ai).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Hf,[i.createElementVNode("div",Wf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",jf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ai).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",qf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ai).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Xf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Yf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,zf)}}}),Nn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},el=Nn(Kf,[["__scopeId","data-v-f1311d1c"]]),Gf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zf(t,e){return i.openBlock(),i.createElementBlock("svg",Gf,[...e[0]||(e[0]=[i.createElementVNode("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 tl=i.markRaw({name:"ion-cart-outline",render:Zf}),lr=Symbol(),Qf={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"}},Jf={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},em={},nl=i.defineComponent({...em,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(lr,"medium"),r=i.computed(()=>M.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=i.computed(()=>M.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=i.computed(()=>M.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>M.isNil(e.productContextButtonsConfig)?[]:M.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,f)=>{var N;const g=Ja,m=Qa,p=A.NButton,b=A.NTooltip,y=Za,_=tl,C=jo,x=A.NDropdown;return i.openBlock(),i.createElementBlock("div",Jf,[s.value?(i.openBlock(),i.createBlock(b,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:s.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(m,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createBlock(b,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:o.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(b,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((N=a.value)==null?void 0:N.length)>0?(i.openBlock(),i.createBlock(x,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(C)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),tm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nm(t,e){return i.openBlock(),i.createElementBlock("svg",tm,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const im=i.markRaw({name:"tabler-history",render:nm}),rm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function om(t,e){return i.openBlock(),i.createElementBlock("svg",rm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const sm=i.markRaw({name:"mdi-percent-outline",render:om}),am={class:"flex flex-row gap-1"},lm={key:0,class:"flex gap-1"},cm={key:0,class:"flex text-nowrap text-sm line-through"},dm={key:1,class:"flex flex-row text-nowrap text-sm"},um={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},hm={},jn=i.defineComponent({...hm,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var b;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"product"in e.product?e.product.product:e.product),o=i.computed(()=>M.find(r.value.priceCoefficients,["coefficient.slug",e.costFieldName])),s=i.computed(()=>{const y=M.find(r.value.priceCoefficients,["coefficient.slug","k0"]);return o.value||!y||M.isNil(l.value)||M.isNil(y.cost)?!1:l.value<y.cost}),a=((b=j.useBaseConfigStateStore().getConfig())==null?void 0:b.defaultCurrency)??"RUB",l=i.computed(()=>o.value?o.value.cost:M.get(e.product,e.costFieldName)),c=i.computed(()=>e.additionalThroughFieldName?M.get(e.product,e.additionalThroughFieldName):void 0),d=i.computed(()=>r.value.costDate?je.format(r.value.costDate,j.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),u=i.computed(()=>e.currencyRates||r.value.currency.signature===a?e.currencyRates:{[r.value.currency.signature]:r.value.costRub/r.value.cost}),h=i.computed(()=>(M.isFunction(e.allowPriceClick)?e.allowPriceClick(r.value):e.allowPriceClick)&&!M.isNil(l.value)),f=i.computed(()=>M.isNil(l.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value))),g=i.computed(()=>{if(r.value.currency.signature===a||!u.value||!u.value[r.value.currency.signature])return null;const y=u.value[r.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(l.value)*y)}),m=i.computed(()=>M.isNil(c.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(c.value)),p=i.computed(()=>{if(!c.value||!l.value||c.value===l.value||l.value===0)return null;const y=(l.value-c.value)/c.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(y)});return(y,_)=>{var w;const C=A.NTag,x=A.NTooltip,N=sm,$=im;return i.openBlock(),i.createElementBlock("div",am,[t.showTag?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode(C,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!o.value}])},{default:i.withCtx(()=>{var v;return[i.createTextVNode(i.toDisplayString(((v=o.value)==null?void 0:v.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var v;return[i.createTextVNode(" "+i.toDisplayString(((v=o.value)==null?void 0:v.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":s.value})},[c.value&&c.value!==l.value||p.value?(i.openBlock(),i.createElementBlock("div",lm,[c.value&&c.value!==l.value?(i.openBlock(),i.createElementBlock("span",cm,i.toDisplayString(m.value)+" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":s.value}])}," ("+i.toDisplayString(p.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(w=o.value)==null?void 0:w.readOnly,"font-bold":!o.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":h.value&&t.eventEmitter}),onClick:_[0]||(_[0]=()=>{var v;h.value&&((v=t.eventEmitter)==null||v.emit("cost:click",{product:r.value,cost:l.value}))})},i.toDisplayString(f.value),3),i.createTextVNode(" "+i.toDisplayString(t.showQuantityUnit?` ${r.value.currency.symbol}/${r.value.unit.name}`:"")+" ",1),l.value&&!o.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode(N,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(t.product.discount.name)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),g.value?(i.openBlock(),i.createElementBlock("span",dm," ~ "+i.toDisplayString(g.value)+" "+i.toDisplayString(t.showQuantityUnit?`₽/${r.value.unit.name}`:""),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(M.isNil)(d.value)?(i.openBlock(),i.createElementBlock("span",um,[i.createTextVNode(i.toDisplayString(d.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(x,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode($,{class:"cursor-pointer",onClick:_[1]||(_[1]=v=>{var k;return(k=t.eventEmitter)==null?void 0:k.emit("cost:show-price-history",{product:r.value})})})]),default:i.withCtx(()=>[_[2]||(_[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),fm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mm(t,e){return i.openBlock(),i.createElementBlock("svg",fm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const qo=i.markRaw({name:"ion-information-circle-outline",render:mm}),gm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function pm(t,e){return i.openBlock(),i.createElementBlock("svg",gm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const il=i.markRaw({name:"ion-images",render:pm}),ym={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function bm(t,e){return i.openBlock(),i.createElementBlock("svg",ym,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const _m=i.markRaw({name:"ion-bookmark",render:bm});/*!
2
2
  * lightgallery | 2.9.0 | October 1st 2025
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
@@ -37,7 +37,7 @@
37
37
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
38
38
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
39
39
  PERFORMANCE OF THIS SOFTWARE.
40
- ***************************************************************************** */var Lr=function(){return Lr=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Lr.apply(this,arguments)},km={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},$n={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Xo=500,vm=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Lr(Lr({},km),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on($n.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),o=0,s=0,a=r.getBoundingClientRect();e?(o=r.offsetHeight*e,s=r.offsetWidth*e):n?(o=a.height+n*a.height,s=a.width+n*a.width):(o=a.height,s=a.width);var l=o>this.containerRect.height,c=s>this.containerRect.width;return{allowX:c,allowY:l}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,o){if(!(!this.containerRect||Math.abs(n)<=0)){var s=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),u=d.allowY,h=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=s-l,this.pageY=a-c,this.positionChanged=!1);var f=this.getPossibleSwipeDragCords(n),g,m,p=s-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),g=p/y,m=b/y}else{var y=(e-n)*n;g=p*y,m=b*y}r&&(h?this.isBeyondPossibleLeft(g,f.minX)?g=f.minX:this.isBeyondPossibleRight(g,f.maxX)&&(g=f.maxX):e>1&&(g<f.minX?g=f.minX:g>f.maxX&&(g=f.maxX)),u?this.isBeyondPossibleTop(m,f.minY)?m=f.minY:this.isBeyondPossibleBottom(m,f.maxY)&&(m=f.maxY):e>1&&(m<f.minY?m=f.minY:m>f.maxY&&(m=f.maxY))),this.setZoomStyles({x:g,y:m,scale:e}),this.left=g,this.top=m,o&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},Xo),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var o=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),o.allowX&&o.allowY?n.addClass("reset-transition"):o.allowX&&!o.allowY?n.addClass("reset-transition-x"):!o.allowX&&o.allowY&&n.addClass("reset-transition-y")}},Xo+50)},t.prototype.setZoomStyles=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),o=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),o.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var s="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",s)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var o=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!o.src||r.core.outer.hasClass("lg-first-slide-loading"))){var s=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(s),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},Xo+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,o;return e>=n?(r=e/n,o=r||2):o=1,o},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var o=e.$LG(r.target);r.touches.length===1&&o.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on($n.containerResize+".zoom "+$n.rotateRight+".zoom "+$n.rotateLeft+".zoom "+$n.flipHorizontal+".zoom "+$n.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var o=e.scale-e.settings.scale;o<1&&(o=1),e.beginZoom(o),e.zoomImage(o,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on($n.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on($n.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on($n.afterSlide+".zoom",function(r){var o=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(o),e.resetImageTranslate(o),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,n=0,r=!1,o=1,s=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;o=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){s=e.scale;var u=Math.max(1,o+-d*.02);e.scale=Math.round((u+Number.EPSILON)*100)/100;var h=e.scale-s;e.zoomImage(e.scale,Math.round((h+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,o,s){var a=n.x-e.x,l=n.y-e.y,c=Math.abs(a)/s+1,d=Math.abs(l)/s+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+a,h.y=this.top+l;var f=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(o&&(this.isBeyondPossibleTop(h.y,f.minY)?h.y=f.minY:this.isBeyondPossibleBottom(h.y,f.maxY)&&(h.y=f.maxY)),r&&(this.isBeyondPossibleLeft(h.x,f.minX)?h.x=f.minX:this.isBeyondPossibleRight(h.x,f.maxX)&&(h.x=f.maxX)),o?this.top=h.y:h.y=this.top,r?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(u,h),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,o,s){var a={};if(o){if(a.y=this.top+(n.y-e.y),this.isBeyondPossibleTop(a.y,s.minY)){var l=s.minY-a.y;a.y=s.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,s.maxY)){var c=a.y-s.maxY;a.y=s.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-e.x),this.isBeyondPossibleLeft(a.x,s.minX)){var d=s.minX-a.x;a.x=s.minX-d/6}else if(this.isBeyondPossibleRight(a.x,s.maxX)){var u=a.x-s.maxX;a.x=s.maxX+u/6}}else a.x=this.left;return a},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,o=n.get().getBoundingClientRect(),s=o.height,a=o.width;e&&(s=s+e*s,a=a+e*a);var l=(s-this.containerRect.height)/2,c=(this.containerRect.height-s)/2+r,d=(a-this.containerRect.width)/2,u=(this.containerRect.width-a)/2,h={minY:l,maxY:c,minX:d,maxX:u};return h},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},o=!1,s=!1,a=!1,l=new Date,c=new Date,d,u,h=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(f){if(e.isImageSlide(e.core.index)&&(h=e.core.getSlideItem(e.core.index),(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))&&f.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){f.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);a=g.allowY,s=g.allowX,(s||a)&&(n=e.getSwipeCords(f)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(f){if(f.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){f.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(f);var g=e.getZoomSwipeCords(n,r,s,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(o=!0,e.setZoomSwipeStyles(u,g))}}),this.core.$inner.on("touchend.lg",function(f){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){if(f.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!o)return;o=!1,c=new Date;var g=c.valueOf()-l.valueOf();e.touchendZoom(n,r,s,a,g)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},o=!1,s=!1,a=!1,l=!1,c,d,u,h;this.core.outer.on("mousedown.lg.zoom",function(f){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(f.target).hasClass("lg-item")||g.get().contains(f.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);l=m.allowY,a=m.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(f.target).hasClass("lg-object")&&(a||l)&&(f.preventDefault(),n=e.getDragCords(f),u=e.getPossibleSwipeDragCords(),o=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(f){if(o){s=!0,r=e.getDragCords(f);var g=e.getZoomSwipeCords(n,r,a,l,u);e.setZoomSwipeStyles(h,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(f){if(o){if(d=new Date,o=!1,e.core.outer.removeClass("lg-zoom-dragging"),s&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(f);var g=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,g)}s=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const Cm={ref:"gallery-container",class:"lightgallery-wrapper"},Sm={},rl=i.defineComponent({...Sm,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=i.useTemplateRef("gallery-container"),o=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const s=await import("lightgallery");o.value=s.default(r.value,{...e.settings}),M.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var s;o.value&&((s=o.value)==null||s.destroy(),o.value=null)}),(s,a)=>(i.openBlock(),i.createElementBlock("div",Cm,[i.renderSlot(s.$slots,"default")],512))}}),ft=class ft{static init(){ft.isInitialized||(ft.isInitialized=!0,ft.windowResizeHandler(),window.addEventListener("resize",ft.windowResizeHandler))}static destroy(){window.removeEventListener("resize",ft.windowResizeHandler),ft.isInitialized=!1}static getDeviceTypeByResolution(){const e=j.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Je.phone:window.innerWidth<e.laptop?Je.tablet:Je.laptop}static initRefDependingOnDeviceResolution(e,n,r){const o=i.ref(r);return ft.setRefValueDependingOnDeviceResolution(o,e,n,r),ft.refsDependingOnDeviceResolution.push({r:o,phoneValue:e,tabletValue:n,defaultValue:r}),o}static isPhoneDevice(){return ft.getDeviceTypeByResolution()===Je.phone}static isTabletDevice(){return ft.getDeviceTypeByResolution()===Je.tablet}static isLaptopDevice(){return ft.getDeviceTypeByResolution()===Je.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,o){switch(ft.getDeviceTypeByResolution()){case Je.phone:e.value=n;break;case Je.tablet:e.value=r;break;default:e.value=o;break}}static windowResizeHandler(){M.forEach(ft.refsDependingOnDeviceResolution,e=>{ft.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};T(ft,"isInitialized",!1),T(ft,"refsDependingOnDeviceResolution",[]);let ot=ft;const Bm=["href"],Tm=["src","alt"],Nm={},ol=i.defineComponent({...Nm,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),o=i.ref({plugins:[xm,vm],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),s=()=>window.innerWidth*(ot.getDeviceTypeByResolution()===Je.phone?.7:.8),a=i.ref(s()),l=()=>{a.value=s()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,u)=>{const h=il,f=A.NPopover;return i.openBlock(),i.createBlock(f,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:u[3]||(u[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:u[0]||(u[0]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(h)])])]),default:i.withCtx(()=>[i.createVNode(rl,{settings:o.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:u[1]||(u[1]=()=>{r.value=!0}),onAfterClose:u[2]||(u[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,m)=>(i.openBlock(),i.createElementBlock("a",{key:m,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${m+1}`},null,8,Tm)],8,Bm))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),$m={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},Rm={class:"pr-3"},Em={class:"text-right"},Pm={},Fm=i.defineComponent({...Pm,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=qo,o=A.NPopover;return i.openBlock(),i.createBlock(o,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",$m,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(s,a)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:a},[i.createElementVNode("span",Rm,i.toDisplayString(s.warehouse.name),1),i.createElementVNode("span",Em,[i.createTextVNode(i.toDisplayString(s.count??"В наличии")+" ",1),s.count?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(t.product.unit.name),1)],64)):i.createCommentVNode("",!0)])],64))),128))])]),_:3})}}}),Vm={class:"flex flex-row justify-between"},Mm={class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},Am={key:0},Im={class:"ml-2 align-sub"},Om={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},zm={class:"@container"},Dm={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},Lm={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Hm={class:"text-sc-dark-grey"},Wm={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},jm={class:"text-gray-600"},qm={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Xm={key:3,class:"underline decoration-dashed"},Ym={key:4,class:"sc-product-pack whitespace-nowrap"},Um={class:"text-gray-600"},Km={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Gm={class:"text-gray-600"},Zm={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},Qm={key:0},Jm={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},eg={},dr=i.defineComponent({...eg,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>M.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),o=i.computed(()=>M.sortBy(n.product.priceCoefficients,["coefficient.slug"])),s=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(()=>M.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=i.computed(()=>{var h;return n.showProductAddToCartButton||n.showProductEditButton||n.showProductRequiredButton||(((h=n.productContextButtonsConfig)==null?void 0:h.length)??0)>0}),u=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,f)=>{var N,$,w,v;const g=_m,m=A.NTooltip,p=tl,b=il,y=A.NText,_=nl,C=qo,x=A.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Vm,[i.createVNode(y,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var k,B;return[i.createElementVNode("div",Mm,[((k=t.product)==null?void 0:k.isFavorite)??!1?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),((B=t.product)==null?void 0:B.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(m,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{class:"!text-green-700"})]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:u},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",Am," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Im,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(ol,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Om,[i.createVNode(b)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),d.value?(i.openBlock(),i.createBlock(_,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",zm,[i.createElementVNode("div",Dm,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",Lm,[f[2]||(f[2]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",Hm,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",Wm,[f[3]||(f[3]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",jm,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(Fm,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",qm,[f[4]||(f[4]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(C,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",Xm," Нет в наличии ")),t.product.pack??(($=(N=t.product)==null?void 0:N.properties)==null?void 0:$.pack)?(i.openBlock(),i.createElementBlock("span",Ym,[f[5]||(f[5]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",Um,i.toDisplayString(t.product.pack??((v=(w=t.product)==null?void 0:w.properties)==null?void 0:v.pack)),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&s.value?(i.openBlock(),i.createElementBlock("span",Km,[f[6]||(f[6]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",Gm,i.toDisplayString(s.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(x,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",Zm,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,k=>(i.openBlock(),i.createBlock(jn,{key:k.coefficient.slug,product:t.product,"cost-field-name":k.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(jn,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",Qm,[i.createElementVNode("ul",Jm,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(k,B)=>(i.openBlock(),i.createElementBlock("li",{key:B}," ("+i.toDisplayString(B)+"): "+i.toDisplayString(k),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(k,B)=>(i.openBlock(),i.createElementBlock("li",{key:B}," ("+i.toDisplayString(B)+"): "+i.toDisplayString(k),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),tg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(jn,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),ng=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(M.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:o=>{var s,a;return i.h(A.NCheckbox,{checked:!!((s=e.isProductItemSelected)!=null&&s.call(e,o)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,o))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:o,checked:l})}})}}),ot.getDeviceTypeByResolution()){case Je.phone:case Je.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:o=>i.h(dr,{product:o,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:o=>i.h(dr,{product:o,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(M.forEach(t,o=>{M.forEach(o.priceCoefficients,s=>{r[s.coefficient.slug??""]||(r[s.coefficient.slug??""]=s.coefficient)})}),M.forEach(M.sortBy(r,["slug"]),o=>{n.push(tg(o.slug??"",o.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:o=>i.h(jn,{product:o,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!M.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:o=>i.h(nl,{product:o,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},ig={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function rg(t,e){return i.openBlock(),i.createElementBlock("svg",ig,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Hr=i.markRaw({name:"ion-trash",render:rg}),og={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sg(t,e){return i.openBlock(),i.createElementBlock("svg",og,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const sl=i.markRaw({name:"ion-plus",render:sg}),ag={key:0,class:"flex w-fit items-center gap-2"},lg={key:1,class:"flex flex-wrap gap-1"},cg={key:0},dg={key:2},ug={},ur=i.defineComponent({...ug,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,o;return(o=(r=e.product)==null?void 0:r.properties)==null?void 0:o.planingProductionDate});return(r,o)=>{const s=A.NSpin,a=A.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",ag,[i.createVNode(s,{size:17,class:"w-fit"}),o[0]||(o[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",lg,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit.name),1),n.value?(i.openBlock(),i.createElementBlock("div",cg,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",dg,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),hg={class:"flex flex-col gap-4"},fg={class:"flex flex-col gap-2"},mg={class:"mt-8 font-bold"},gg={class:"grid grow grid-cols-2 items-start gap-2"},pg={key:2,class:"text-red-500 text-sm"},yg={key:3,class:"text-red-500 text-sm mb-2"},bg={class:"flex flex-col gap-4"},_g={key:1},wg={class:"text-lg font-semibold"},xg={class:"flex gap-3"},kg={},vg=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","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:n}){var b;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{var _,C,x;const y={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),He.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation((C=r.validation.quantity)==null?void 0:C.feedback)],marker:[He.serverValidation((x=r.validation.marker)==null?void 0:x.feedback)]};return M.forEach(l.value.configuratorParams.linesWidths,(N,$)=>{var k;const v=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${$}`]=[ae.required,ae.min(v),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),He.serverValidation((k=r.validation[`lines_widths[${$+1}]`])==null?void 0:k.feedback)]}),M.forEach(l.value.configuratorParams.linesAngles,(N,$)=>{var w;y[`configuratorParams.linesAngles.${$}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),He.serverValidation((w=r.validation[`lines_angles[${$+1}]`])==null?void 0:w.feedback)]}),y}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>{var N;const{length:y}=l.value.configuratorParams,{quantity:_}=l.value,C=((N=l.value.product)==null?void 0:N.costRub)||0;if(!y||!_||C===0)return null;const x=y/1e3;return(C*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=i.computed(()=>M.reduce(l.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),f=i.computed(()=>{const y=h.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),g=i.computed(()=>{const{configuratorParams:y}=l.value,_=M.every(y.linesWidths,$=>!!($&&$>0)),C=M.every(y.linesAngles,$=>!M.isNil($)),x=!!(l.value.quantity&&l.value.quantity>0),N=y.length>0&&y.length>0;return _&&C&&x&&N&&f.value}),m=()=>{i.nextTick(()=>{var y;(y=s.value)==null||y.validate(_=>{_||(o("update:params",l.value.configuratorParams),p("configuratorParams",l.value.configuratorParams))}).catch(M.noop)})},p=(y,_)=>{const C=new j.OrderItemBase(l.value);C[y]=_,y==="configuratorParams"&&(C.product=new j.ClientProduct),o("update:value",C)};return i.watch(()=>r.previewParams,y=>{l.value.configuratorParams.linesWidths=y.linesWidths,l.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),i.watch(()=>r.value,y=>{l.value=M.cloneDeep(y)},{deep:!0}),e({validate:(b=s.value)==null?void 0:b.validate,formReference:s}),(y,_)=>{const C=sl,x=Hr,N=A.NCheckbox;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message",onKeydown:_[20]||(_[20]=i.withKeys(i.withModifiers($=>o("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var $;return[i.createElementVNode("div",hg,[_[22]||(_[22]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(A.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),m],options:t.settings.startTailConfigs.map(({label:w},v)=>({label:w,value:v})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",fg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,v)=>(i.openBlock(),i.createElementBlock("div",{key:v,class:"flex items-start gap-2"},[i.createElementVNode("div",mg,i.toDisplayString(v+1),1),i.createElementVNode("div",gg,[i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.linesWidths.${v}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.configuratorParams.linesWidths[v],"onUpdate:value":[k=>l.value.configuratorParams.linesWidths[v]=k,_[2]||(_[2]=k=>m())],parse:i.unref(rt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=k=>i.unref(nt)(k)),onInput:k=>i.unref(tt)(t.validation,`lines_widths[${v+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.linesAngles.${v}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.configuratorParams.linesAngles[v],"onUpdate:value":[k=>l.value.configuratorParams.linesAngles[v]=k,_[4]||(_[4]=k=>m())],parse:i.unref(rt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=k=>i.unref(nt)(k,!0)),onInput:k=>i.unref(tt)(t.validation,`lines_angles[${v+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(A.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,size:"medium",onClick:k=>o("click:add-line",v)},{default:i.withCtx(()=>[i.createVNode(C)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:k=>o("click:remove-line",v)},{default:i.withCtx(()=>[i.createVNode(x)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.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:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),m],options:t.settings.endTailConfigs.map(({label:w},v)=>({label:w,value:v})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(ur,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),f.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",pg," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(h.value)+" мм. ",1)),g.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",yg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===(($=t.settings.allTemplates)==null?void 0:$.length)-1?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=w=>o("click:save-template"))},{default:i.withCtx(()=>[..._[21]||(_[21]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",bg,[i.createVNode(i.unref(A.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),m],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.value.configuratorParams.length=w),_[11]||(_[11]=w=>m())],parse:i.unref(rt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>i.unref(nt)(w)),onInput:_[10]||(_[10]=w=>i.unref(tt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>p("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>i.unref(nt)(w,!1)),onInput:_[14]||(_[14]=w=>i.unref(tt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>i.unref(tt)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,p("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(N,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.value.isAdditionalSale=w??!1,p("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[..._[23]||(_[23]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",_g,[_[24]||(_[24]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",wg,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",xg,[i.createVNode(i.unref(A.NButton),{loading:t.isSubmitProcessing,disabled:!g.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>o("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}}),al=Nn(vg,[["__scopeId","data-v-47ba4507"]]);var ll=Object.defineProperty,Cg=Object.defineProperties,Sg=Object.getOwnPropertyDescriptors,cl=Object.getOwnPropertySymbols,Bg=Object.prototype.hasOwnProperty,Tg=Object.prototype.propertyIsEnumerable,dl=t=>{throw TypeError(t)},Yo=(t,e,n)=>e in t?ll(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Uo=(t,e)=>{for(var n in e||(e={}))Bg.call(e,n)&&Yo(t,n,e[n]);if(cl)for(var n of cl(e))Tg.call(e,n)&&Yo(t,n,e[n]);return t},Ko=(t,e)=>Cg(t,Sg(e)),ul=(t,e)=>{for(var n in e)ll(t,n,{get:e[n],enumerable:!0})},S=(t,e,n)=>Yo(t,typeof e!="symbol"?e+"":e,n),hl=(t,e,n)=>e.has(t)||dl("Cannot "+n),At=(t,e,n)=>(hl(t,e,"read from private field"),n?n.call(t):e.get(t)),fl=(t,e,n)=>e.has(t)?dl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ng=(t,e,n,r)=>(hl(t,e,"write to private field"),e.set(t,n),n),Nt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return Nt.shim(t),typeof e<"u"&&(Nt.Image=e),Nt.isHeadless=!0,t}},ml={};ul(ml,{Curve:()=>Oi,getAnchorsFromArcData:()=>Eg,getComponentOnCubicBezier:()=>hr,getControlPoints:()=>Sl,getCurveBoundingBox:()=>kl,getCurveFromPoints:()=>Cl,getCurveLength:()=>xl,getReflection:()=>Jo,integrate:()=>vl,subdivide:()=>Qo});var gl={};ul(gl,{HALF_PI:()=>st,NumArray:()=>hn,TWO_PI:()=>yt,decomposeMatrix:()=>li,getComputedMatrix:()=>Go,getEffectiveStrokeWidth:()=>fn,getPoT:()=>bl,lerp:()=>Dt,mod:()=>Lt,setMatrix:()=>yl,toFixed:()=>Ie});var Ye;typeof window<"u"?Ye=window:typeof global<"u"?Ye=global:typeof self<"u"&&(Ye=self);var pl,yt=Math.PI*2,st=Math.PI*.5;function li(t,e,n,r,o,s){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,o=t.e,s=t.f):a=t,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function yl(t){pl=t}function Go(t,e){e=e&&e.identity()||new pl;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let o=0;o<r.length;o++){const a=r[o].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Dt(t,e,n){return n*(e-t)+t}var Zo=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function bl(t){let e=0;for(;Zo[e]&&Zo[e]<t;)e++;return Zo[e]}function Lt(t,e){for(;t<0;)t+=e;return t%e}var hn=Ye.Float32Array||Array,$g=Math.floor;function Ie(t){return $g(t*1e6)/1e6}function fn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Go(t));const r=li(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),o=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return o>0?n/o:n}var oe={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Q=class{constructor(){S(this,"_events",{}),S(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let o=0,s=r.length;o<s;o++){e=r[o];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const o=this;e&&(s.obj=e,s.name=n,s.handler=r,e.on(n,s));function s(){r.apply(o,arguments)}return o}ignore(e,n,r){return e.off(n,r),this}};S(Q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),S(Q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var _l={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},tn=class ir extends Q{constructor(e=0,n=0){super(),S(this,"_x",0),S(this,"_y",0);for(let r in _l)Object.defineProperty(this,r,_l[r]);this.x=e,this.y=n}static add(e,n){return new ir(e.x+n.x,e.y+n.y)}static sub(e,n){return new ir(e.x-n.x,e.y-n.y)}static subtract(e,n){return ir.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const s=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,s)}const r=e.x-n.x,o=e.y-n.y;return Math.atan2(o,r)}static distanceBetween(e,n){return Math.sqrt(ir.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,o=e.y-n.y;return r*r+o*o}set(e,n){return this.x=e,this.y=n,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ir(this.x,this.y)}add(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=n),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=n),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,o=(e.y-this.y)*n+this.y;return this.set(r,o)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ie(this.x),y:Ie(this.y)}}rotate(e){const n=this.x,r=this.y,o=Math.cos(e),s=Math.sin(e);return this.x=n*o-r*s,this.y=n*s+r*o,this}};S(tn,"zero",new tn),S(tn,"left",new tn(-1,0)),S(tn,"right",new tn(1,0)),S(tn,"up",new tn(0,-1)),S(tn,"down",new tn(0,1));var re=tn,Be=class Ho extends re{constructor(e=0,n=0,r=0,o=0,s=0,a=0,l=oe.move){super(e,n),S(this,"controls",{left:new re,right:new re}),S(this,"_command",oe.move),S(this,"_relative",!0),S(this,"_rx",0),S(this,"_ry",0),S(this,"_xAxisRotation",0),S(this,"_largeArcFlag",0),S(this,"_sweepFlag",1);for(let d in wl)Object.defineProperty(this,d,wl[d]);this.command=l,this.relative=!0;const c=Ho.makeBroadcast(this);this.controls.left.set(r,o).addEventListener(Q.Types.change,c),this.controls.right.set(s,a).addEventListener(Q.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(Q.Types.change)}}static fromObject(e){return new Ho().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Ho().copy(this)}toObject(){return{x:Ie(this.x),y:Ie(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ie(this.rx),ry:Ie(this.ry),xAxisRotation:Ie(this.xAxisRotation),largeArcFlag:Ie(this.largeArcFlag),sweepFlag:Ie(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},wl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},Rg=0,$t={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Rg++}},Oi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function hr(t,e,n,r,o){const s=1-t;return s*s*s*e+3*s*s*t*n+3*s*t*t*r+t*t*t*o}function Qo(t,e,n,r,o,s,a,l,c){c=c||Oi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Be(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,g=hr(f,t,n,o,a),m=hr(f,e,r,s,l);u.push(new Be(g,m))}return u}function xl(t,e,n,r,o,s,a,l,c){if(t===n&&e===r&&o===a&&s===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-o)+3*(a-t),u=6*(t+o)-12*n,h=3*(n-t),f=9*(r-s)+3*(l-e),g=6*(e+s)-12*r,m=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(f*b+g)*b+m;return Math.sqrt(y*y+_*_)}return vl(p,0,1,c||Oi.RecursionLimit)}function kl(t,e,n,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,g,m,p,b,y;for(let N=0;N<2;++N){if(N===0?(h=6*t-12*n+6*o,u=-3*t+9*n-9*o+3*a,f=3*n-3*t):(h=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-f/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*f*u,y=Math.sqrt(b),!(b<0)&&(m=(-h+y)/(2*u),0<m&&m<1&&c.push(m),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,C=_,x;for(;_--;)g=c[_],x=1-g,d[0][_]=x*x*x*t+3*x*x*g*n+3*x*g*g*o+g*g*g*a,d[1][_]=x*x*x*e+3*x*x*g*r+3*x*g*g*s+g*g*g*l;return d[0][C]=t,d[1][C]=e,d[0][C+1]=a,d[1][C+1]=l,d[0].length=d[1].length=C+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 vl(t,e,n,r){let o=Oi.abscissas[r-2],s=Oi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(l):0;for(;c<d;){const h=a*o[c];u+=s[c++]*(t(l+h)+t(l-h))}return a*u}function Cl(t,e){const n=t.length,r=n-1;for(let o=0;o<n;o++){const s=t[o],a=e?Lt(o-1,n):Math.max(o-1,0),l=e?Lt(o+1,n):Math.min(o+1,r),c=t[a],d=s,u=t[l];Sl(c,d,u),d.command=o===0?oe.move:oe.curve}}function Sl(t,e,n){const r=re.angleBetween(t,e),o=re.angleBetween(n,e);let s=re.distanceBetween(t,e),a=re.distanceBetween(n,e),l=(r+o)/2;return s<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,a*=.33,o<r?l+=st:l-=st,e.controls.left.x=Math.cos(l)*s,e.controls.left.y=Math.sin(l)*s,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Jo(t,e,n){return new re(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function Eg(t,e,n,r,o,s,a){const l=$t.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const u=d*s+o,h=n*Math.cos(u),f=r*Math.sin(u),g=new Be(h,f);g.command=oe.line}}var Bl=Array.prototype.slice;function Pg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var ie={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Bl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let o in r)t[o]=r[o]}return t},defaults:function(t){const e=Bl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let o in r)t[o]===void 0&&(t[o]=r[o])}return t},each:function(t,e,n){const r=n||this,o=!Pg(t)&&Object.keys(t),s=(o||t).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,t[l],l,t)}return t},performance:Ye.performance&&Ye.performance.now?Ye.performance:Date},Ht={hasEventListeners:typeof Ye.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Ht},unbind:function(t,e,n,r){return Ht.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Ht},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=Ye.requestAnimationFrame;if(!n){for(let o=0;o<t.length;o++)n=Ye[t[o]+"RequestAnimationFrame"]||n;n=n||r}function r(o,s){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=Ye.setTimeout(d,l);e=a+l;function d(){o(a+l)}return c}return n}},zi=Ye.document?Ye.document.createElement("div"):{};zi.id="help-two-load",Object.defineProperty(Ht,"temp",{enumerable:!0,get:function(){return ie.isElement(zi)&&!Ye.document.head.contains(zi)&&(zi.style.display="none",Ye.document.head.appendChild(zi)),zi}});var It=class extends Error{constructor(e){super(),S(this,"name","Two.js"),S(this,"message"),this.message=e}},Fg=Ye.devicePixelRatio||1;function Vg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function es(t){return Fg/Vg(t)}var Wr=class{constructor(){S(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},bt,qn=class extends Array{constructor(){super(),fl(this,bt,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 At(this,bt)}set _events(e){Ng(this,bt,e)}get _bound(){return At(this,bt)._bound}set _bound(e){At(this,bt)._bound=e}addEventListener(){return At(this,bt).addEventListener.apply(this,arguments)}on(){return At(this,bt).on.apply(this,arguments)}bind(){return At(this,bt).bind.apply(this,arguments)}removeEventListener(){return At(this,bt).removeEventListener.apply(this,arguments)}off(){return At(this,bt).off.apply(this,arguments)}unbind(){return At(this,bt).unbind.apply(this,arguments)}dispatchEvent(){return At(this,bt).dispatchEvent.apply(this,arguments)}trigger(){return At(this,bt).trigger.apply(this,arguments)}listen(){return At(this,bt).listen.apply(this,arguments)}ignore(){return At(this,bt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(Q.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(Q.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(Q.Types.remove,e),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 e}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(e,n){const r=[];for(let o=0;o<this.length;o++){const s=this[o];let a;n?a=e.call(n,s,o):a=e(s,o),r.push(a)}return r}};bt=new WeakMap;var Tl=class sf extends Q{constructor(){super(),S(this,"_flagId",!1),S(this,"_flagClassName",!1),S(this,"_renderer",{}),S(this,"_id",$t.Identifier+$t.uniqueId()),S(this,"_className",""),S(this,"classList",[]);for(let e in Nl)Object.defineProperty(this,e,Nl[e])}static fromObject(e){const n=new sf().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};S(Tl,"Properties",["renderer","id","className"]);var Di=Tl,Nl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},jr,$l={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ye.document&&(jr=document.createElement("a"));var nn=class Xt extends Di{constructor(e,n){super(),S(this,"_flagSrc",!1),S(this,"_flagImage",!1),S(this,"_flagVideo",!1),S(this,"_flagLoaded",!1),S(this,"_flagRepeat",!1),S(this,"_flagOffset",!1),S(this,"_flagScale",!1),S(this,"_src",""),S(this,"_image",null),S(this,"_loaded",!1),S(this,"_repeat","no-repeat"),S(this,"_scale",1),S(this,"_offset",null);for(let r in Rl)Object.defineProperty(this,r,Rl[r]);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 re,typeof n=="function"){const r=(function(){this.unbind(Q.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(Q.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new Xt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return jr?(jr.href=e,jr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=Xt.getAbsoluteURL(e);if(Xt.ImageRegistry.contains(n))return Xt.ImageRegistry.get(n);let r;return Nt.Image?(r=new Nt.Image,Nt.shim(r,"img")):Ye.document?$l.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,o=Xt.getTag(r);e._flagImage&&(/canvas/i.test(o)?Xt.Register.canvas(e,n):(e._src=!Nt.isHeadless&&r.getAttribute("two-src")||r.src,Xt.Register[o](e,n))),e._flagSrc&&(r||(r=Xt.getImage(e.src),e.image=r),o=Xt.getTag(r),Xt.Register[o](e,n))}clone(){const e=new Xt(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 re?e.offset:new re().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof re?e.scale:new re().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,Xt.load(this,(function(){this.loaded=!0,this.trigger(Q.Types.change).trigger(Q.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};S(nn,"Properties",["src","loaded","repeat","scale","offset","image"]),S(nn,"RegularExpressions",$l),S(nn,"ImageRegistry",new Wr),S(nn,"Register",{canvas:function(t,e){t._src="#"+t.id,nn.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(s){!Nt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",o,!1)),typeof e=="function"&&e()},o=function(s){throw!Nt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",o,!1)),new It("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!Nt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",o,!1)),t._src=nn.getAbsoluteURL(t._src),!(!Nt.isHeadless&&n&&n.getAttribute("two-src"))&&(Nt.isHeadless||n.setAttribute("two-src",t.src),nn.ImageRegistry.add(t.src,n),Nt.isHeadless?nn.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(Nt.isHeadless)throw new It("video textures are not implemented in headless environments.");const n=function(o){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(o){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new It("unable to load "+t.src)};t._src=nn.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),nn.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Oe=nn,Rl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Oe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Oe.ImageRegistry.contains(n)?this._image=Oe.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(Q.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Q.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof re&&this._scale.unbind(Q.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof re&&this._scale.bind(Q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Mg(){this._flagOffset=!0}function Ag(){this._flagScale=!0}var ts=class un extends Di{constructor(e,n,r){super(),S(this,"_flagOffset",!0),S(this,"_flagOpacity",!0),S(this,"_flagColor",!0),S(this,"_offset",0),S(this,"_opacity",1),S(this,"_color","#fff");for(let o in El)Object.defineProperty(this,o,El[o]);this._renderer.type="stop",this.offset=typeof e=="number"?e:un.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:un.Index<=0?"#fff":"#000",un.Index=(un.Index+1)%2}static fromObject(e){const n=new un().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<un.Properties.length;n++){const r=un.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new un;return ie.each(un.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",ie.each(un.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};S(ts,"Index",0),S(ts,"Properties",["offset","opacity","color"]);var Xn=ts,El={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},ns=class Ri extends Di{constructor(e){super(),S(this,"_flagStops",!1),S(this,"_flagSpread",!1),S(this,"_flagUnits",!1),S(this,"_spread",""),S(this,"_units","");for(let n in Pl)Object.defineProperty(this,n,Pl[n]);this._renderer.type="gradient",this._renderer.flagStops=Ig.bind(this),this._renderer.bindStops=Og.bind(this),this._renderer.unbindStops=zg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(o=>o instanceof Xn?o:new Xn().copy(o)));const r=new Ri(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(o=>o.clone()),r=new Ri(n);return ie.each(Ri.Properties,o=>{r[o]=this[o]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return ie.each(Ri.Properties,n=>{e[n]=this[n]},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}};S(ns,"Stop",Xn),S(ns,"Properties",["spread","stops","units"]);var at=ns,Pl={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),this._stops=new qn((t||[]).slice(0)),this._stops.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._stops)}}};function Ig(){this._flagStops=!0}function Og(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function zg(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var is=class Mr extends at{constructor(e,n,r,o,s){super(s),S(this,"_flagEndPoints",!1),S(this,"_left",null),S(this,"_right",null);for(let a in Fl)Object.defineProperty(this,a,Fl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Dg.bind(this),this.left=new re,this.right=new re,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof o=="number"&&(this.right.y=o)}static fromObject(e){const n=new Mr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mr.Properties.length;n++){const r=Mr.Properties[n];r in e&&(this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(o){return o.clone()}),r=new Mr(this.left._x,this.left._y,this.right._x,this.right._y,n);return ie.each(at.Properties,function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};S(is,"Stop",Xn),S(is,"Properties",["left","right"]);var Ue=is,Fl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof re&&this._left.unbind(Q.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof re&&this._right.unbind(Q.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Dg(){this._flagEndPoints=!0}var rs=class Ei extends at{constructor(e,n,r,o,s,a){super(o),S(this,"_flagRadius",!1),S(this,"_flagCenter",!1),S(this,"_flagFocal",!1),S(this,"_radius",0),S(this,"_center",null),S(this,"_focal",null);for(let l in Vl)Object.defineProperty(this,l,Vl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Lg.bind(this),this._renderer.flagFocal=Hg.bind(this),this.center=new re,this.radius=typeof r=="number"?r:1,this.focal=new re,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(o){return o.clone()}),r=new Ei(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return ie.each(at.Properties.concat(Ei.Properties),function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return ie.each(Ei.Properties,function(n){e[n]=this[n]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};S(rs,"Stop",Xn),S(rs,"Properties",["center","radius","focal"]);var Ke=rs,Vl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(Q.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Q.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Lg(){this._flagCenter=!0}function Hg(){this._flagFocal=!0}function Ml(t,e){if(e===0||e===1)return!0;const r=t._length*e;let o=0;for(let s=0;s<t._lengths.length;s++){const a=t._lengths[s];if(o>=r)return r-o>=0;o+=a}return!1}function qr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,o=0;r<t._lengths.length;r++){if(o+t._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/t._lengths[r];o+=t._lengths[r]}return-1}function Al(t,e,n){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),xl(r,l,o,c,s,d,a,u,n)}function Il(t,e,n){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Qo(r,l,o,c,s,d,a,u,n)}function ci(t){switch(t.renderer.type){case"texture":return Oe.fromObject(t);case"gradient":return at.fromObject(t);case"linear-gradient":return Ue.fromObject(t);case"radial-gradient":return Ke.fromObject(t)}return t}var Wg=Math.cos,jg=Math.sin,Ol=Math.tan,os=[],zl=class Yt extends Q{constructor(e,n,r,o,s,a){super(),S(this,"elements",new hn(9)),S(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const $=e;let w,v,k;const B=n[0]||0,R=n[1]||0,E=n[2]||0;return w=$[0]*B+$[1]*R+$[2]*E,v=$[3]*B+$[4]*R+$[5]*E,k=$[6]*B+$[7]*R+$[8]*E,[w,v,k]}const o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],d=e[5],u=e[6],h=e[7],f=e[8],g=n[0],m=n[1],p=n[2],b=n[3],y=n[4],_=n[5],C=n[6],x=n[7],N=n[8];return r=r||new hn(9),r[0]=o*g+s*b+a*C,r[1]=o*m+s*y+a*x,r[2]=o*p+s*_+a*N,r[3]=l*g+c*b+d*C,r[4]=l*m+c*y+d*x,r[5]=l*p+c*_+d*N,r[6]=u*g+h*b+f*C,r[7]=u*m+h*y+f*x,r[8]=u*p+h*_+f*N,r}static fromObject(e){return new Yt().copy(e)}set(e,n,r,o,s,a,l,c,d){if(typeof n>"u"){const u=e;e=u[0],n=u[1],r=u[2],o=u[3],s=u[4],a=u[5],l=u[6],c=u[7],d=u[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=o,this.elements[4]=s,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,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]=Yt.Identity[0],this.elements[1]=Yt.Identity[1],this.elements[2]=Yt.Identity[2],this.elements[3]=Yt.Identity[3],this.elements[4]=Yt.Identity[4],this.elements[5]=Yt.Identity[5],this.elements[6]=Yt.Identity[6],this.elements[7]=Yt.Identity[7],this.elements[8]=Yt.Identity[8],this.trigger(Q.Types.change)}multiply(e,n,r,o,s,a,l,c,d){if(typeof n>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(Q.Types.change);if(typeof r>"u"&&(r=1),typeof o>"u"){e=e||0,n=n||0,r=r||0,s=this.elements;const W=s[0]*e+s[1]*n+s[2]*r,I=s[3]*e+s[4]*n+s[5]*r,Z=s[6]*e+s[7]*n+s[8]*r;return[W,I,Z]}const u=this.elements,h=[e,n,r,o,s,a,l,c,d],f=u[0],g=u[1],m=u[2],p=u[3],b=u[4],y=u[5],_=u[6],C=u[7],x=u[8],N=h[0],$=h[1],w=h[2],v=h[3],k=h[4],B=h[5],R=h[6],E=h[7],P=h[8];return this.elements[0]=f*N+g*v+m*R,this.elements[1]=f*$+g*k+m*E,this.elements[2]=f*w+g*B+m*P,this.elements[3]=p*N+b*v+y*R,this.elements[4]=p*$+b*k+y*E,this.elements[5]=p*w+b*B+y*P,this.elements[6]=_*N+C*v+x*R,this.elements[7]=_*$+C*k+x*E,this.elements[8]=_*w+C*B+x*P,this.trigger(Q.Types.change)}inverse(e){const n=this.elements;e=e||new Yt;const r=n[0],o=n[1],s=n[2],a=n[3],l=n[4],c=n[5],d=n[6],u=n[7],h=n[8],f=h*l-c*u,g=-h*a+c*d,m=u*a-l*d;let p=r*f+o*g+s*m;return p?(p=1/p,e.elements[0]=f*p,e.elements[1]=(-h*o+s*u)*p,e.elements[2]=(c*o-s*l)*p,e.elements[3]=g*p,e.elements[4]=(h*r-s*d)*p,e.elements[5]=(-c*r+s*a)*p,e.elements[6]=m*p,e.elements[7]=(-u*r+o*d)*p,e.elements[8]=(l*r-o*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=Wg(e),r=jg(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Ol(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Ol(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return os.length=0,this.toTransformArray(e,os),os.map(Ie).join(" ")}toTransformArray(e,n){const r=this.elements,o=!!n,s=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],g=r[8];if(o){n[0]=s,n[1]=c,n[2]=h,n[3]=a,n[4]=d,n[5]=f,n[6]=l,n[7]=u,n[8]=g;return}return[s,c,h,a,d,f,l,u,g]}if(o){n[0]=s,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=u;return}return[s,c,a,d,l,u]}toArray(e,n){const r=this.elements,o=!!n,s=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],g=r[8];if(o){n[0]=s,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u,n[6]=h,n[7]=f,n[8]=g;return}return[s,a,l,c,d,u,h,f,g]}if(o){n[0]=s,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u;return}return[s,a,l,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Yt().copy(this)}};S(zl,"Identity",[1,0,0,0,1,0,0,0,1]);var Li=zl;yl(Li);var Dl=class Ya extends Di{constructor(){super(),S(this,"_flagMatrix",!0),S(this,"_flagScale",!1),S(this,"_matrix",null),S(this,"_worldMatrix",null),S(this,"_position",null),S(this,"_rotation",0),S(this,"_scale",1),S(this,"_skewX",0),S(this,"_skewY",0);for(let e in Xr)Object.defineProperty(this,e,Xr[e]);this._renderer.flagMatrix=Ll.bind(this),this.isShape=!0,this.matrix=new Li,this.worldMatrix=new Li,this.position=new re,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Ya().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Xr.position.get.apply(this,arguments)}set translation(e){Xr.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 re?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 re?e.scale:new re(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const n=new Ya;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof re?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 re?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}};S(Dl,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Yn=Dl,Xr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Q.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Q.Types.change,this._renderer.flagMatrix),Ll.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof re&&this._scale.unbind(Q.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof re&&this._scale.bind(Q.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Go(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Ll(){this._flagMatrix=!0}var Hi=Math.min,Wi=Math.max,qg=Math.ceil,Xg=Math.floor,Yg=new re,ss=class ri extends Yn{constructor(e,n,r,o){super(),S(this,"_flagVertices",!0),S(this,"_flagLength",!0),S(this,"_flagFill",!0),S(this,"_flagStroke",!0),S(this,"_flagLinewidth",!0),S(this,"_flagOpacity",!0),S(this,"_flagVisible",!0),S(this,"_flagCap",!0),S(this,"_flagJoin",!0),S(this,"_flagMiter",!0),S(this,"_flagStrokeAttenuation",!0),S(this,"_flagMask",!1),S(this,"_flagClip",!1),S(this,"_length",0),S(this,"_fill","#fff"),S(this,"_stroke","#000"),S(this,"_linewidth",1),S(this,"_opacity",1),S(this,"_visible",!0),S(this,"_cap","round"),S(this,"_join","round"),S(this,"_miter",4),S(this,"_closed",!0),S(this,"_curved",!1),S(this,"_automatic",!0),S(this,"_beginning",0),S(this,"_ending",1),S(this,"_mask",null),S(this,"_clip",!1),S(this,"_dashes",null),S(this,"_strokeAttenuation",!0);for(let s in Hl)Object.defineProperty(this,s,Hl[s]);this._renderer.type="path",this._renderer.flagVertices=Wl.bind(this),this._renderer.bindVertices=jl.bind(this),this._renderer.unbindVertices=ql.bind(this),this._renderer.flagFill=Xl.bind(this),this._renderer.flagStroke=Yl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),o=new ri().copy(Ko(Uo({},e),{fill:n,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof Be?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Be().copy(r))}}for(let n=0;n<ri.Properties.length;n++){const r=ri.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ri;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ri.Properties.length;r++){const o=ri.Properties[r];n[o]=this[o]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),ie.each(ri.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,o=e.left+e.width/2,s=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=o,l.y-=s,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=n,this.mask.translation.y-=s,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const s=this.vertices[o];s.x-=n,s.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,o,s,a,l,c=1/0,d=-1/0,u=1/0,h=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,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}=li(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof f=="number"&&typeof g=="number"&&(r=Math.max(f,g)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(s=0;s<o;s++){l=this._renderer.vertices[s],a=this._renderer.vertices[(s+o-1)%o];const[f,g]=n.multiply(a.x,a.y),[m,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,C]=n.multiply(b,y),x=l.controls.left.x,N=l.controls.left.y;l.relative&&(x+=l.x,N+=l.y);let[$,w]=n.multiply(x,N);const v=kl(f,g,_,C,$,w,m,p);u=Hi(v.min.y-r,u),c=Hi(v.min.x-r,c),d=Wi(v.max.x+r,d),h=Wi(v.max.y+r,h)}else s<=1&&(u=Hi(g-r,u),c=Hi(f-r,c),d=Wi(f+r,d),h=Wi(g+r,h)),u=Hi(p-r,u),c=Hi(m-r,c),d=Wi(m+r,d),h=Wi(p+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}getPointAt(e,n){let r,o,s,a,l,c,d,u,h,f,g,m,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const C=this.vertices.length,x=C-1;let N=null,$=null;for(let te=0,D=this._lengths.length,L=0;te<D;te++){if(L+this._lengths[te]>=_){this._closed?(r=Lt(te,C),o=Lt(te-1,C),te===0&&(r=o,o=te)):(r=te,o=Math.min(Math.max(te-1,0),x)),N=this.vertices[r],$=this.vertices[o],_-=L,this._lengths[te]!==0?e=_/this._lengths[te]:e=0;break}L+=this._lengths[te]}if(N===null||$===null)return null;if(N){if(!$)return N}else return $;y=$.controls&&$.controls.right,b=N.controls&&N.controls.left,l=$.x,f=$.y,c=(y||$).x,g=(y||$).y,d=(b||N).x,m=(b||N).y,u=N.x,p=N.y,y&&$.relative&&(c+=$.x,g+=$.y),b&&N.relative&&(d+=N.x,m+=N.y),a=hr(e,l,c,d,u),h=hr(e,f,g,m,p);const w=Dt(l,c,e),v=Dt(f,g,e),k=Dt(c,d,e),B=Dt(g,m,e),R=Dt(d,u,e),E=Dt(m,p,e),P=Dt(w,k,e),W=Dt(v,B,e),I=Dt(k,R,e),Z=Dt(B,E,e);return ie.isObject(n)?(n.x=a,n.y=h,n instanceof Be&&(n.controls.left.x=P,n.controls.left.y=W,n.controls.right.x=I,n.controls.right.y=Z,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=h,n.controls.right.x-=a,n.controls.right.y-=h)),n.t=e,n):(s=new Be(a,h,P-a,W-h,I-a,Z-h,this._curved?oe.curve:oe.line),s.t=e,s)}plot(){if(this.curved)return Cl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?oe.move:oe.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===oe.close;let o=this.vertices[n],s=[],a;return ie.each(this.vertices,function(l,c){if(c<=0&&!r){o=l;return}if(l.command===oe.move){s.push(new Be(o.x,o.y)),c>0&&(s[s.length-1].command=oe.line),o=l;return}a=Il(l,o,e),s=s.concat(a),ie.each(a,function(d,u){u<=0&&o.command===oe.move?d.command=oe.move:d.command=oe.line}),c>=n&&(this._closed&&this._automatic&&(o=l,a=Il(l,o,e),s=s.concat(a),ie.each(a,function(d,u){u<=0&&o.command===oe.move?d.command=oe.move:d.command=oe.line})),s.push(new Be(l.x,l.y)),s[s.length-1].command=r?oe.close:oe.line),o=l},this),this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(e,n){n||this._update();const o=this.vertices.length-1;let s=this.vertices[o],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),ie.each(this.vertices,function(l,c){if(c<=0||l.command===oe.move){s=l,this._lengths[c]=0;return}this._lengths[c]=Al(l,s,e),a+=this._lengths[c],s=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),s=qr(this,r*this._length),a=qr(this,o*this._length),l=qg(s),c=Xg(a);let d,u,h,f,g,m;for(this._renderer.vertices.length=0,m=0;m<e;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new Be),m>c&&!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,h=this._collection[m-1],h&&h.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),h.relative?this._renderer.collection[m-1].controls.right.copy(h.controls.right).lerp(re.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(h.controls.right).lerp(h,1-g.t))):m>=l&&m<=c&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===c&&Ml(this,o)?(u=g,!n&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===l&&Ml(this,r)&&(d=g,d.command=oe.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(m=l-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(r,g),g.command=oe.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(re.zero,g.t):(Yg.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=this._flagStrokeAttenuation=!1,Yn.prototype.flagReset.call(this),this}};S(ss,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),S(ss,"Utils",{getCurveLength:Al});var $e=ss,Hl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";ie.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Wl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function jl(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ql(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Xl(){this._flagFill=!0}function Yl(){this._flagStroke=!0}var Ul=class Ar extends $e{constructor(e,n,r,o){const s=[new Be,new Be,new Be,new Be];super(s,!0,!1,!0),S(this,"_flagWidth",!1),S(this,"_flagHeight",!1),S(this,"_width",0),S(this,"_height",0),S(this,"_origin",null),this._renderer.type="rectangle";for(let a in Kl)Object.defineProperty(this,a,Kl[a]);this.width=typeof r=="number"?r:1,this.height=typeof o=="number"?o:1,this.origin=new re,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Ar().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ar.Properties.length;n++){const r=Ar.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof re&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Be),this.vertices[0].set(-e,-n).sub(this._origin).command=oe.move,this.vertices[1].set(e,-n).sub(this._origin).command=oe.line,this.vertices[2].set(e,n).sub(this._origin).command=oe.line,this.vertices[3].set(-e,n).sub(this._origin).command=oe.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=oe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Ar(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<$e.Properties.length;r++){const o=$e.Properties[r];n[o]instanceof re?n[o].copy(this[o]):n[o]=this[o]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};S(Ul,"Properties",["width","height","origin"]);var Un=Ul,Kl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(Q.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Gl=class Ir extends Un{constructor(e,n,r,o,s,a){super(n,r,0,0),S(this,"_flagTexture",!1),S(this,"_flagColumns",!1),S(this,"_flagRows",!1),S(this,"_flagFrameRate",!1),S(this,"_flagIndex",!1),S(this,"_amount",1),S(this,"_duration",0),S(this,"_startTime",0),S(this,"_playing",!1),S(this,"_firstFrame",0),S(this,"_lastFrame",0),S(this,"_loop",!0),S(this,"_texture",null),S(this,"_columns",1),S(this,"_rows",1),S(this,"_frameRate",0),S(this,"_index",0),S(this,"_origin",null),this._renderer.type="sprite";for(let l in Zl)Object.defineProperty(this,l,Zl[l]);this.noStroke(),this.noFill(),e instanceof Oe?this.texture=e:typeof e=="string"&&(this.texture=new Oe(e)),this.origin=new re,this._update(),typeof o=="number"&&(this.columns=o),typeof s=="number"&&(this.rows=s),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Ir().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ir.Properties.length;n++){const r=Ir.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ie.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const n=new Ir(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let o,s,a,l,c,d,u,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)){u=e.image.width,h=e.image.height,o=u/n,s=h/r,l=this._amount,this.width!==o&&(this.width=o),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(ie.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=ie.performance.now()-this._startTime,f=this._lastFrame+1,c=1e3*(f-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=Dt(this._firstFrame,f,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%n,m=Math.floor(this._index/n),p=-o*g+(u-o)/2,b=-s*m+(h-s)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};S(Gl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Yr=Gl,Zl={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},as,Ql=class extends qn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),fl(this,as,{}),this.attach(e),this.on(Q.Types.insert,this.attach),this.on(Q.Types.remove,this.detach)}get ids(){return At(this,as)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};as=new WeakMap;var Jl=class Pi extends $e{constructor(e,n,r,o,s,a,l){const c=l||$t.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new Be);super(d,!0,!1,!0),S(this,"_flagStartAngle",!1),S(this,"_flagEndAngle",!1),S(this,"_flagInnerRadius",!1),S(this,"_flagOuterRadius",!1),S(this,"_startAngle",0),S(this,"_endAngle",yt),S(this,"_innerRadius",0),S(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in ec)Object.defineProperty(this,u,ec[u]);typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.startAngle=s),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Pi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,o=this._outerRadius,s=Lt(e,yt)===Lt(n,yt),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,f,g,m,p,b,y,_,C;for(s?c--:a||(c-=2),h=0,f=c-1;h<c;h++){switch(g=h/f,m=l[u],p=g*(n-e)+e,b=(n-e)/c,y=o*Math.cos(p),_=o*Math.sin(p),h){case 0:d=oe.move;break;default:d=oe.curve}m.command=d,m.x=y,m.y=_,m.controls.left.clear(),m.controls.right.clear(),m.command===oe.curve&&(C=o*b/Math.PI,m.controls.left.x=C*Math.cos(p-st),m.controls.left.y=C*Math.sin(p-st),m.controls.right.x=C*Math.cos(p+st),m.controls.right.y=C*Math.sin(p+st),h===1&&m.controls.left.multiplyScalar(2),h===f&&m.controls.right.multiplyScalar(2)),u++}if(a){for(s?(l[u].command=oe.close,u++):(c--,f=c-1),h=0;h<c;h++)g=h/f,m=l[u],p=(1-g)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=oe.curve,h<=0&&(d=s?oe.move:oe.line),m.command=d,m.x=y,m.y=_,m.controls.left.clear(),m.controls.right.clear(),m.command===oe.curve&&(C=r*b/Math.PI,m.controls.left.x=C*Math.cos(p+st),m.controls.left.y=C*Math.sin(p+st),m.controls.right.x=C*Math.cos(p-st),m.controls.right.y=C*Math.sin(p-st),h===1&&m.controls.left.multiplyScalar(2),h===f&&m.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=oe.line}else s||(l[u].command=oe.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[u].command=oe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const n=this.innerRadius,r=this.outerRadius,o=this.startAngle,s=this.endAngle,a=this.vertices.length,l=new Pi(0,0,n,r,o,s,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<$e.Properties.length;c++){const d=$e.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];e[r]=this[r]}return e}};S(Jl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var ls=Jl,ec={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},cs=Math.cos,ds=Math.sin,tc=class Fi extends $e{constructor(e,n,r,o){const s=o?Math.max(o,2):4,a=[];for(let l=0;l<s;l++)a.push(new Be(0,0,0,0,0,0));super(a,!0,!0,!0),S(this,"_flagRadius",!1),S(this,"_radius",0),this._renderer.type="circle";for(let l in nc)Object.defineProperty(this,l,nc[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,o=r*n;for(let s=0;s<this.vertices.length;s++){const l=s/e*yt,c=r*cs(l),d=r*ds(l),u=o*cs(l-st),h=o*ds(l-st),f=o*cs(l+st),g=o*ds(l+st),m=this.vertices[s];m.command=s===0?oe.move:oe.curve,m.set(c,d),m.controls.left.set(u,h),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<$e.Properties.length;r++){const o=$e.Properties[r];n[o]=this[o]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};S(tc,"Properties",["radius"]);var Ur=tc,nc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},us=Math.cos,hs=Math.sin,ic=class Vi extends $e{constructor(e,n,r,o,s){typeof o!="number"&&typeof r=="number"&&(o=r);const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Be);super(l,!0,!0,!0),S(this,"_flagWidth",!1),S(this,"_flagHeight",!1),S(this,"_width",0),S(this,"_height",0),this._renderer.type="ellipse";for(let c in rc)Object.defineProperty(this,c,rc[c]);typeof r=="number"&&(this.width=r*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Vi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Vi.Properties.length;n++){const r=Vi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,o=this._height/2;for(let s=0;s<this.vertices.length;s++){const l=s/e*yt,c=r*us(l),d=o*hs(l),u=r*n*us(l-st),h=o*n*hs(l-st),f=r*n*us(l+st),g=o*n*hs(l+st),m=this.vertices[s];m.command=s===0?oe.move:oe.curve,m.set(c,d),m.controls.left.set(u,h),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(e){const n=this.width/2,r=this.height/2,o=this.vertices.length,s=new Vi(0,0,n,r,o);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 a=0;a<$e.Properties.length;a++){const l=$e.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Vi.Properties.length;n++){const r=Vi.Properties[n];e[r]=this[r]}return e}};S(ic,"Properties",["width","height"]);var Kr=ic,rc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Ug=Math.ceil,Kg=Math.floor,oc=class oi extends Yn{constructor(e){super(),S(this,"_flagVertices",!0),S(this,"_flagLength",!0),S(this,"_flagFill",!0),S(this,"_flagStroke",!0),S(this,"_flagLinewidth",!0),S(this,"_flagOpacity",!0),S(this,"_flagVisible",!0),S(this,"_flagSize",!0),S(this,"_flagSizeAttenuation",!0),S(this,"_flagStrokeAttenuation",!0),S(this,"_length",0),S(this,"_fill","#fff"),S(this,"_stroke","#000"),S(this,"_linewidth",1),S(this,"_opacity",1),S(this,"_visible",!0),S(this,"_size",1),S(this,"_sizeAttenuation",!1),S(this,"_beginning",0),S(this,"_ending",1),S(this,"_dashes",null),S(this,"_strokeAttenuation",!0),S(this,"noFill",$e.prototype.noFill),S(this,"noStroke",$e.prototype.noStroke),S(this,"corner",$e.prototype.corner),S(this,"center",$e.prototype.center),S(this,"getBoundingClientRect",$e.prototype.getBoundingClientRect),S(this,"_updateLength",$e.prototype._updateLength);for(let n in sc)Object.defineProperty(this,n,sc[n]);this._renderer.type="points",this._renderer.flagVertices=Wl.bind(this),this._renderer.bindVertices=jl.bind(this),this._renderer.unbindVertices=ql.bind(this),this._renderer.flagFill=Xl.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 n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),o=new oi().copy(Ko(Uo({},e),{fill:n,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof Be?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Be().copy(r))}for(let n=0;n<oi.Properties.length;n++){const r=oi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new oi;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<oi.Properties.length;r++){const o=oi.Properties[r];n[o]=this[o]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),ie.each(oi.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const o=this.vertices[r],s=this.vertices[r-1];if(!s)continue;const a=o.x,l=o.y,c=s.x,d=s.y,u=Qo(a,l,a,l,c,d,c,d,e);n=n.concat(u)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=qr(this,e*this._length),o=qr(this,n*this._length),s=Ug(r),a=Kg(o);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=s&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};S(oc,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var fs=oc,sc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},Gg=Math.cos,Zg=Math.sin,ac=class Mi extends $e{constructor(e,n,r,o){o=Math.max(o||0,3),super(),S(this,"_flagWidth",!1),S(this,"_flagHeight",!1),S(this,"_flagSides",!1),S(this,"_radius",0),S(this,"_width",0),S(this,"_height",0),S(this,"_sides",0),this._renderer.type="polygon";for(let s in lc)Object.defineProperty(this,s,lc[s]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let o=0;o<n;o++){const s=(o+.5)/e,a=yt*s+Math.PI/2,l=this._width*Gg(a)/2,c=this._height*Zg(a)/2;o>=r?this.vertices.push(new Be(l,c)):this.vertices[o].set(l,c),this.vertices[o].command=o===0?oe.move:oe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Mi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<$e.Properties.length;r++){const o=$e.Properties[r];n[o]=this[o]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};S(ac,"Properties",["width","height","sides"]);var ms=ac,lc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},cc=class Ai extends $e{constructor(e,n,r,o,s){typeof s>"u"&&typeof r=="number"&&typeof o=="number"&&(s=Math.floor(Math.min(r,o)/12));const a=[];for(let l=0;l<10;l++)a.push(new Be(0,0,0,0,0,0,l===0?oe.move:oe.curve));super(a),S(this,"_flagWidth",!1),S(this,"_flagHeight",!1),S(this,"_flagRadius",!1),S(this,"_width",0),S(this,"_height",0),S(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in dc)Object.defineProperty(this,l,dc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Qg.bind(this),typeof r=="number"&&(this.width=r),typeof o=="number"&&(this.height=o),(typeof s=="number"||s instanceof re)&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];if(r in e){const o=e[r];/radius/i.test(r)?this[r]=typeof o=="number"||o instanceof re?o:new re().copy(o):typeof o=="number"&&(this[r]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,o;this._radius instanceof re?(r=this._radius.x,o=this._radius.y):(r=this._radius,o=this._radius);let s,a=e/2,l=n/2;s=this.vertices[0],s.x=-(a-r),s.y=-l,s=this.vertices[1],s.x=a-r,s.y=-l,s.controls.left.clear(),s.controls.right.x=r,s.controls.right.y=0,s=this.vertices[2],s.x=a,s.y=-(l-o),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=a,s.y=l-o,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=o,s=this.vertices[4],s.x=a-r,s.y=l,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(a-r),s.y=l,s.controls.left.clear(),s.controls.right.x=-r,s.controls.right.y=0,s=this.vertices[6],s.x=-a,s.y=l-o,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-a,s.y=-(l-o),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-o,s=this.vertices[8],s.x=-(a-r),s.y=-l,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 n=this.width,r=this.height,o=this.radius,s=new Ai(0,0,n,r,o);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 a=0;a<$e.Properties.length;a++){const l=$e.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};S(cc,"Properties",["width","height","radius"]);var Gr=cc,dc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof re&&this._radius.unbind(Q.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof re&&this._radius.bind(Q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Qg(){this._flagRadius=!0}var Jg=Math.cos,ep=Math.sin,uc=class Ii extends $e{constructor(e,n,r,o,s){arguments.length<=3&&(o=r,r=o/2),(typeof s!="number"||s<=0)&&(s=5),super(),S(this,"_flagInnerRadius",!1),S(this,"_flagOuterRadius",!1),S(this,"_flagSides",!1),S(this,"_innerRadius",0),S(this,"_outerRadius",0),S(this,"_sides",0),this._renderer.type="star";for(let a in hc)Object.defineProperty(this,a,hc[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ii().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ii.Properties.length;n++){const r=Ii.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let o=0;o<n;o++){const s=(o+.5)/e,a=yt*s,l=(o%2?this._outerRadius:this._innerRadius)/2,c=l*Jg(a),d=l*ep(a);o>=r?this.vertices.push(new Be(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?oe.move:oe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,o=this.sides,s=new Ii(0,0,n,r,o);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 a=0;a<$e.Properties.length;a++){const l=$e.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Ii.Properties.length;n++){const r=Ii.Properties[n];e[r]=this[r]}return e}};S(uc,"Properties",["innerRadius","outerRadius","sides"]);var gs=uc,hc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ps,fc=Math.min,mc=Math.max;Ye.document&&(ps=document.createElement("canvas"));var ys=class Ut extends Yn{constructor(e,n,r,o){super(),S(this,"_flagValue",!0),S(this,"_flagFamily",!0),S(this,"_flagSize",!0),S(this,"_flagLeading",!0),S(this,"_flagAlignment",!0),S(this,"_flagBaseline",!0),S(this,"_flagStyle",!0),S(this,"_flagWeight",!0),S(this,"_flagDecoration",!0),S(this,"_flagFill",!0),S(this,"_flagStroke",!0),S(this,"_flagLinewidth",!0),S(this,"_flagOpacity",!0),S(this,"_flagVisible",!0),S(this,"_flagMask",!1),S(this,"_flagClip",!1),S(this,"_flagDirection",!0),S(this,"_flagStrokeAttenuation",!0),S(this,"_value",""),S(this,"_family","sans-serif"),S(this,"_size",13),S(this,"_leading",17),S(this,"_alignment","center"),S(this,"_baseline","middle"),S(this,"_style","normal"),S(this,"_weight",500),S(this,"_decoration","none"),S(this,"_direction","ltr"),S(this,"_fill","#000"),S(this,"_stroke","none"),S(this,"_linewidth",1),S(this,"_opacity",1),S(this,"_visible",!0),S(this,"_mask",null),S(this,"_clip",!1),S(this,"_dashes",null),S(this,"_strokeAttenuation",!0);for(let s in gc)Object.defineProperty(this,s,gc[s]);if(this._renderer.type="text",this._renderer.flagFill=tp.bind(this),this._renderer.flagStroke=np.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!ie.isObject(o))return this;for(let s=0;s<Ut.Properties.length;s++){const a=Ut.Properties[s];a in o&&(this[a]=o[a])}}static Measure(e){if(ps){const n=ps.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),o=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:o}}else{const n=this.value.length*this.size*Ut.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),o=new Ut().copy(Ko(Uo({},e),{fill:n,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){super.copy.call(this,e);for(let n=0;n<Ut.Properties.length;n++){const r=Ut.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Ut(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Ut.Properties.length;r++){const o=Ut.Properties[r];n[o]=this[o]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<Ut.Properties.length;n++){const r=Ut.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,o,s,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=Ut.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,o=l+d;break;case"right":r=-(l+d),o=d;break;default:r=-(l/2+d),o=l/2+d}switch(this.baseline){case"middle":s=-(c/2+d),a=c/2+d;break;default:s=-(c+d),a=d}const[u,h]=n.multiply(r,s),[f,g]=n.multiply(r,a),[m,p]=n.multiply(o,s),[b,y]=n.multiply(o,a);return s=fc(h,g,p,y),r=fc(u,f,m,b),o=mc(u,f,m,b),a=mc(h,g,p,y),{top:s,left:r,right:o,bottom:a,width:o-r,height:a-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}};S(ys,"Ratio",.6),S(ys,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var mn=ys,gc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function tp(){this._flagFill=!0}function np(){this._flagStroke=!0}var bs=class rr extends Un{constructor(e,n,r,o){super(n,r,0,0),S(this,"_flagTextures",!1),S(this,"_flagFrameRate",!1),S(this,"_flagIndex",!1),S(this,"_amount",1),S(this,"_duration",0),S(this,"_index",0),S(this,"_startTime",0),S(this,"_playing",!1),S(this,"_firstFrame",0),S(this,"_lastFrame",0),S(this,"_loop",!0),S(this,"_textures",null),S(this,"_frameRate",0),S(this,"_origin",null),this._renderer.type="image-sequence";for(let s in pc)Object.defineProperty(this,s,pc[s]);this._renderer.flagTextures=ip.bind(this),this._renderer.bindTextures=rp.bind(this),this._renderer.unbindTextures=op.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(yc.bind(this)):typeof e=="string"&&(this.textures=[yc(e)]),this.origin=new re,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=rr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new rr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<rr.Properties.length;n++){const r=rr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ie.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const n=new rr(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,o,s,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,ie.isNaN(this._lastFrame)&&(this._lastFrame=s-1),o=ie.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?o=o%a:o=Math.min(o,a),c=Dt(this._firstFrame,d,o/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Oe))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};S(bs,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),S(bs,"DefaultFrameRate",30);var _s=bs,pc={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),this._textures=new qn((t||[]).slice(0)),this._textures.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function ip(){this._flagTextures=!0}function rp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function op(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function yc(t){if(t instanceof Oe)return t;if(typeof t=="string")return new Oe(t)}var Zr=Math.min,Qr=Math.max,ws=class si extends Yn{constructor(e){super(),S(this,"_flagAdditions",!1),S(this,"_flagSubtractions",!1),S(this,"_flagOrder",!1),S(this,"_flagOpacity",!0),S(this,"_flagBeginning",!1),S(this,"_flagEnding",!1),S(this,"_flagLength",!1),S(this,"_flagMask",!1),S(this,"_fill","#fff"),S(this,"_stroke","#000"),S(this,"_linewidth",1),S(this,"_opacity",1),S(this,"_visible",!0),S(this,"_cap","round"),S(this,"_join","round"),S(this,"_miter",4),S(this,"_closed",!0),S(this,"_curved",!1),S(this,"_automatic",!0),S(this,"_beginning",0),S(this,"_ending",1),S(this,"_length",0),S(this,"_mask",null),S(this,"_strokeAttenuation",!0);for(let n in bc)Object.defineProperty(this,n,bc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)_c.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)_c.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new si;for(let o=0;o<si.Properties.length;o++){const s=si.Properties[o];s in e&&(/(fill|stroke)/i.test(s)?n[s]=typeof e[s]=="string"?e[s]:ci(e[s]):n[s]=e[s])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return ls.fromObject(o);case"circle":return Ur.fromObject(o);case"element":return Di.fromObject(o);case"ellipse":return Kr.fromObject(o);case"group":return si.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return _s.fromObject(o);case"path":return $e.fromObject(o);case"points":return fs.fromObject(o);case"polygon":return ms.fromObject(o);case"rectangle":return Un.fromObject(o);case"rounded-rectangle":return Gr.fromObject(o);case"shape":return Yn.fromObject(o);case"sprite":return Yr.fromObject(o);case"star":return gs.fromObject(o);case"text":return mn.fromObject(o)}return o}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<si.Properties.length;n++){const r=si.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new si,r=this.children.map(function(o){return o.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,ie.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const s=this.children[o];s.isShape&&(s.translation.x-=n,s.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(o){if(o.id===e)return o;if(o.children){if(o.children.ids[e])return o.children.ids[e];for(let s=0;s<o.children.length;s++)if(n=r(o.children[s]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(o){if(Array.prototype.indexOf.call(o.classList,e)>=0&&n.push(o),o.children)for(let s=0;s<o.children.length;s++){const a=o.children[s];r(a)}return n}return r(this)}getByType(e){const n=[];function r(o){if(o instanceof e&&n.push(o),o.children)for(let s=0;s<o.children.length;s++){const a=o.children[s];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const o=Array.prototype.indexOf.call(this.children,r);o>=0&&this.children.splice(o,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let o=0;o<e.length;o++){const s=e[o];if(!s||!this.children.ids[s.id])continue;const a=this.children.indexOf(s);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,o,s,a,l;this._update(!0);let c=1/0,d=-1/0,u=1/0,h=-1/0;const f=/texture|gradient/i;r=e?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))&&(n=m.getBoundingClientRect(e),o=typeof n.top!="number"||ie.isNaN(n.top)||!isFinite(n.top),s=typeof n.left!="number"||ie.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||ie.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||ie.isNaN(n.bottom)||!isFinite(n.bottom),!(o||s||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[C,x]=r.multiply(n.left,n.bottom),[N,$]=r.multiply(n.right,n.bottom);u=Zr(b,_,x,$,u),c=Zr(p,y,C,N,c),d=Qr(p,y,C,N,d),h=Qr(b,_,x,$,h)}else u=Zr(n.top,u),c=Zr(n.left,c),d=Qr(n.right,d),h=Qr(n.bottom,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=o*a,d=s*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};S(ws,"Children",Ql),S(ws,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var ut=ws,bc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=ut.InsertChildren.bind(this),n=ut.RemoveChildren.bind(this),r=ut.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Ql(t),this._children.bind(Q.Types.insert,e),this._children.bind(Q.Types.remove,n),this._children.bind(Q.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function _c(t,e){const n=t.parent;let r;if(n===e){o();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),s()),e){o();return}s(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function o(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function s(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Jr=class extends $e{constructor(e,n,r,o){const s=[new Be(e,n),new Be(r,o)];super(s);for(let a in wc)Object.defineProperty(this,a,wc[a]);this.vertices[0].command=oe.move,this.vertices[1].command=oe.line,this.automatic=!1}};S(Jr,"Properties",["left","right"]);var wc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(ie.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=oe.move;else{const e=new It("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(ie.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=oe.line;else{const e=new It("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},gn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},sp={start:"left",middle:"center",end:"right"},xc=["id","class","transform","xmlns","viewBox"],ap=["x","y","width","height","href","xlink:href"];function lp(t){return sp[t]}function cp(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function fr(t){return t.replace(/svg:/gi,"").toLowerCase()}function kc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function dp(t,e){e||(e={});const n=t.split(";");for(let r=0;r<n.length;r++){const o=n[r].split(":"),s=o[0],a=o[1];if(typeof s>"u"||typeof a>"u")continue;const l=s.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function up(t){const e={},n=hp(t),r=Math.max(n.length,t.style.length);for(let o=0;o<r;o++){const s=t.style[o],a=n[o];s&&(e[s]=t.style[s]),a&&(e[a]=t.getAttribute(a))}return e}function hp(t){const e=t.getAttributeNames();for(let n=0;n<xc.length;n++){const r=xc[n],o=Array.prototype.indexOf.call(e,r);o>=0&&e.splice(o,1)}return e}function fp(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),o=-parseFloat(n[1]),s=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&o)for(let h=0;h<t.children.length;h++){const f=t.children[h];"translation"in f?f.translation.add(r,o):"x"in f?f.x=r:"y"in f&&(f.y=o)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||u)&&(t.scale=new re(1,1)),d&&(t.scale.x=t.width/s),u&&(t.scale.y=t.height/a),t.mask=new Un(0,0,s,a),t.mask.origin.set(-s/2,-a/2),t}function Kt(t,e,n){const r={},o={},s={};let a,l,c,d,u,h,f,g,m,p,b,y,_,C,x,N,$;if(t===null)return r;if(Ye.getComputedStyle){const w=Ye.getComputedStyle(t);for(a=w.length;a--;)c=w[a],d=w[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)h=t.attributes[a],/style/i.test(h.nodeName)?dp(h.value,s):o[h.nodeName]=h.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ie.defaults(r,n),ie.extend(r,s,o),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(f=li(l),e._renderer.type){case"linear-gradient":kc(f,e.left),kc(f,e.right);break;case"radial-gradient":e.center.x+=f.translateX,e.center.y+=f.translateY,e.focal.x+=f.translateX,e.focal.y+=f.translateY,e.radius*=Math.max(f.scaleX,f.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;f=li(l),e.translation.set(f.translateX,f.translateY),e.rotation=Math.PI*(f.rotation/180),e.scale=new re(f.scaleX,f.scaleY),g=parseFloat((r.x+"").replace("px")),m=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),m&&(e.translation.y=m);break;case"visible":if(e instanceof ut){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof ut){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof ut){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof ut){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof ut){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof ut){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(gn.cssBackgroundImage.test(d)&&(p=d.replace(gn.cssBackgroundImage,"$1"),Xe.defs.current&&Xe.defs.current.contains(p)&&(y=Xe.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=fr(y.nodeName),e.mask=Xe[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":u=(e instanceof ut?"_":"")+c,gn.cssBackgroundImage.test(d)?(p=d.replace(gn.cssBackgroundImage,"$1"),Xe.defs.current&&Xe.defs.current.contains(p)?(y=Xe.defs.current.get(p),y.object||(_=fr(y.nodeName),y.object=Xe[_].call(this,y,{})),y=y.object):(b=gp(this),y=b.getById(p)),e[u]=y):e[u]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(C=e instanceof at,x=e instanceof Ue,N=e instanceof Ke,C||x||N)break;d.match("[a-z%]$")&&!d.endsWith("px")&&($=new It("only pixel values are supported with the "+c+" attribute."),console.warn($.name,$.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof mn&&(e.family=d);break;case"font-size":e instanceof mn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&($=new It("only pixel values are supported with the "+c+" attribute."),console.warn($.name,$.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof mn&&(e.weight=d);break;case"font-style":e instanceof mn&&(e.style=d);break;case"text-decoration":e instanceof mn&&(e.decoration=d);break;case"line-height":e instanceof mn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function mp(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const o=t.childNodes[n];!o.id||fr(t.nodeName)==="#text"||e.add(o.id,o)}}function gp(t){for(;t.parent;)t=t.parent;return t.scene}var Xe={svg:function(t){const e=Xe.defs.current=new Wr,n=t.getElementsByTagName("defs");for(let m=0;m<n.length;m++)mp(n[m],e);const r=Xe.g.call(this,t),o=t.getAttribute("viewBox"),s=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=o!==null,u=s!==null,h=a!==null,f=l!==null,g=c!==null;return u&&(r.x=parseFloat(s.replace(gn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(gn.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(gn.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(gn.unitSuffix,""))),d&&fp(r,o),delete Xe.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new It("encountered <use /> with no href."),console.warn(n.name,n.message),null;const o=r.slice(1);if(!Xe.defs.current.contains(o))return n=new It("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=Xe.defs.current.get(o).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=ap.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=fr(a.nodeName);return Xe[l].call(this,a,e)},g:function(t,e){const n=new ut;Kt.call(this,t,n,e),this.add(n);const r=up.call(this,t);for(let o=0,s=t.childNodes.length;o<s;o++){const a=t.childNodes[o],l=a.nodeName;if(!l)return;const c=fr(l);if(c in Xe){const d=Xe[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(s,a,l){r.push(new Be(parseFloat(a),parseFloat(l)))});const o=new $e(r,!0);return o.stroke="none",o.fill="black",Kt.call(this,t,o,e),o},polyline:function(t,e){const n=Xe.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],o=!1,s=!1;if(n){let l=new Be,c,d,u=n.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;ie.each(u.slice(0),function(f,g){const m=f.slice(1).trim().match(gn.path),p=f[0],b=p.toLowerCase();let y,_,C,x,N;const $=[];switch(g===0&&(u=[]),b){case"h":case"v":m.length>1&&(y=1);break;case"m":case"l":case"t":m.length>2&&(y=2);break;case"s":case"q":m.length>4&&(y=4);break;case"c":m.length>6&&(y=6);break;case"a":m.length>7&&(y=7);break}if(y){for(_=0,C=m.length,N=0;_<C;_+=y){if(x=p,N>0)switch(p){case"m":x="l";break;case"M":x="L";break}$.push(x+m.slice(_,_+y).join(" ")),N++}u=Array.prototype.concat.apply(u,$)}else u.push(f)}),ie.each(u,function(f,g){let m,p,b;const y=f[0],_=y.toLowerCase();d=f.slice(1).trim().match(gn.path),s=y===_;let C,x,N,$,w,v,k,B,R,E,P,W,I,Z,te,D,L;switch(_){case"z":if(g>=h)o=!0;else{p=l.x,b=l.y,m=new Be(p,b,void 0,void 0,void 0,void 0,oe.close);for(let H=r.length-1;H>=0;H--){const z=r[H];if(/m/i.test(z.command)){l=z;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),m=new Be(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?oe.move:oe.line),s&&m.addSelf(l),l=m;break;case"h":case"v":E=/h/i.test(_)?"x":"y",P=/x/i.test(E)?"y":"x",m=new Be(void 0,void 0,void 0,void 0,void 0,void 0,oe.line),m[E]=parseFloat(d[0]),m[P]=l[P],s&&(m[E]+=l[E]),l=m;break;case"c":case"s":C=l.x,x=l.y,c||(c=new re),/c/i.test(_)?(N=parseFloat(d[0]),$=parseFloat(d[1]),w=parseFloat(d[2]),v=parseFloat(d[3]),k=parseFloat(d[4]),B=parseFloat(d[5])):(R=Jo(l,c,s),N=R.x,$=R.y,w=parseFloat(d[0]),v=parseFloat(d[1]),k=parseFloat(d[2]),B=parseFloat(d[3])),s&&(N+=C,$+=x,w+=C,v+=x,k+=C,B+=x),l.controls.right.set(N-l.x,$-l.y),m=new Be(k,B,w-k,v-B,void 0,void 0,oe.curve),l=m,c=m.controls.left;break;case"t":case"q":C=l.x,x=l.y,c||(c=new re),/q/i.test(_)?(N=parseFloat(d[0]),$=parseFloat(d[1]),w=parseFloat(d[0]),v=parseFloat(d[1]),k=parseFloat(d[2]),B=parseFloat(d[3])):(R=Jo(l,c,s),N=R.x,$=R.y,w=R.x,v=R.y,k=parseFloat(d[0]),B=parseFloat(d[1])),s&&(N+=C,$+=x,w+=C,v+=x,k+=C,B+=x),l.controls.right.set((N-l.x)*.33,($-l.y)*.33),m=new Be(k,B,w-k,v-B,void 0,void 0,oe.curve),l=m,c=m.controls.left;break;case"a":C=l.x,x=l.y,I=parseFloat(d[0]),Z=parseFloat(d[1]),te=parseFloat(d[2]),D=parseFloat(d[3]),L=parseFloat(d[4]),k=parseFloat(d[5]),B=parseFloat(d[6]),s&&(k+=C,B+=x),W=new Be(k,B),W.command=oe.arc,W.rx=I,W.ry=Z,W.xAxisRotation=te,W.largeArcFlag=D,W.sweepFlag=L,m=W,l=W,c=void 0;break}m&&(Array.isArray(m)?r=r.concat(m):r.push(m))})}n=new $e(r,o,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},ie.each(n.vertices,function(l){l.subSelf(a.centroid)}),Kt.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("r")),s=new Ur(0,0,o);return s.stroke="none",s.fill="black",Kt.call(this,t,s,e),s.translation.x=n,s.translation.y=r,s},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("rx")),s=parseFloat(t.getAttribute("ry")),a=new Kr(0,0,o,s);return a.stroke="none",a.fill="black",Kt.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!ie.isNaN(n)||!ie.isNaN(r))return Xe["rounded-rect"](t);const o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=o/2,l=s/2,c=new Un(0,0,o,s);return c.stroke="none",c.fill="black",Kt.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=o/2,l=s/2,c=new re(n,r),d=new Gr(0,0,o,s,c);return d.stroke="none",d.fill="black",Kt.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),o=parseFloat(t.getAttribute("x2")),s=parseFloat(t.getAttribute("y2")),a=new Jr(n,r,o,s).noFill();return Kt.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let o=parseFloat(t.getAttribute("x1")||0),s=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+o)/2,d=(l+s)/2;/userSpaceOnUse/i.test(n)&&(o-=c,s-=d,a-=c,l-=d);const u=[];for(let f=0;f<t.children.length;f++){const g=t.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let p=g.getAttribute("stop-color"),b=g.getAttribute("stop-opacity"),y=g.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),u.push(new Xn(m,p,b))}const h=new Ue(o,s,a,l,u);return h.spread=r,h.units=n,Kt.call(this,t,h,e),h},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let o=parseFloat(t.getAttribute("cx"))||0,s=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));ie.isNaN(l)&&(l=o),ie.isNaN(c)&&(c=s);const d=Math.abs(o+l)/2,u=Math.abs(s+c)/2;/userSpaceOnUse/i.test(n)&&(o-=d,s-=u,l-=d,c-=u);const h=[];for(let g=0;g<t.children.length;g++){const m=t.children[g];let p=m.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=m.getAttribute("stop-color"),y=m.getAttribute("stop-opacity"),_=m.getAttribute("style"),C;b===null&&(C=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=C&&C.length>1?C[1]:void 0),y===null?(C=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=C&&C.length>1?parseFloat(C[1]):1):y=parseFloat(y),h.push(new Xn(p,b,y))}const f=new Ke(o,s,a,h,l,c);return f.spread=r,f.units=n,Kt.call(this,t,f,e),f},text:function(t,e){const n=lp(t.getAttribute("text-anchor"))||"left",r=cp(t)||"baseline";let o="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?o=t.childNodes[0].textContent:o=t.textContent;const s=new mn(o);return Kt.call(this,t,s,e),s.alignment=n,s.baseline=r,s},clippath:function(t,e){return Xe.defs.current&&!Xe.defs.current.contains(t.id)&&Xe.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new It("encountered <image /> with no href."),console.warn(n.name,n.message),null;const o=parseFloat(t.getAttribute("x"))||0,s=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Yr(r,o,s);return ie.isNaN(a)||(c.width=a),ie.isNaN(l)||(c.height=l),Kt.call(this,t,c,e),c}};function vc(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var xs=class Tn extends Un{constructor(e,n,r,o,s,a){super(n,r,o||1,s||1),S(this,"_flagTexture",!1),S(this,"_flagMode",!1),S(this,"_texture",null),S(this,"_mode","fill"),this._renderer.type="image";for(let l in Sc)Object.defineProperty(this,l,Sc[l]);this.noStroke(),this.noFill(),e instanceof Oe?this.texture=e:typeof e=="string"&&(this.texture=new Oe(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new Tn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Tn.Properties.length;n++){const r=Tn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Tn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,o=this.width,s=this.height,a=o/n,l=s/r;switch(this._mode){case Tn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Tn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case Tn.Modes.crop:break;case Tn.Modes.tile:{e.offset.x=(n-o)/2,e.offset.y=(r-s)/2,e.repeat="repeat";break}case Tn.Modes.stretch:default:e.scale=new re(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};S(xs,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),S(xs,"Properties",["texture","mode"]);var Cc=xs,Sc={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},ks=[],vs=Math.max,pp=Math.min,Bc=Math.abs,eo=Math.sin,to=Math.cos,yp=Math.acos,no=Math.sqrt,Ee={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Ee?t:"path"},group:{renderChild:function(t){const e=Ee.getRendererType(t._renderer.type);Ee[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,o=io(e),s=!o||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,s&&(t.save(),o||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=Ee.getRendererType(r._renderer.type);Ee[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Ee.getRendererType(l._renderer.type);Ee[c].render.call(l,t)}return s&&t.restore(),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,o,s,a,l,c,d,u,h,f,g,m,p,b,y,_,C,x,N,$,w,v,k,B,R,E,P,W,I,Z,te,D,L,H;if(H=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,I=this._mask,Z=this._clip,l=this._opacity*(H||1),c=this._visible,!e&&(!c||Z||l===0))return this;if(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,a=this._fill,d=this._cap,u=this._join,h=this._miter,f=this._closed,g=this._renderer.vertices,m=g.length,p=m-1,te=io(r),L=this.dashes,te||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),I){const ee=Ee.getRendererType(I._renderer.type);Ee[ee].render.call(I,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const ee=Ee.getRendererType(a._renderer.type);Ee[ee].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const ee=Ee.getRendererType(o._renderer.type);Ee[ee].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=fn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!f&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),L&&L.length>0&&(t.lineDashOffset=L.offset||0,t.setLineDash(L)),t.beginPath();let z,O,U,K,V,q,Y;for(let ee=0;ee<m;ee++)switch(_=g[ee],P=_.x,W=_.y,_.command){case oe.close:t.closePath();break;case oe.arc:z=_.rx,O=_.ry,U=_.xAxisRotation,K=_.largeArcFlag,V=_.sweepFlag,b=f?Lt(ee-1,m):vs(ee-1,0),y=g[b],q=y.x,Y=y.y,Ee.renderSvgArcCommand(t,q,Y,z,O,K,V,U,P,W);break;case oe.curve:b=f?Lt(ee-1,m):Math.max(ee-1,0),y=g[b],k=y.controls&&y.controls.right||re.zero,B=_.controls&&_.controls.left||re.zero,y._relative?(w=k.x+y.x,v=k.y+y.y):(w=k.x,v=k.y),_._relative?(N=B.x+_.x,$=B.y+_.y):(N=B.x,$=B.y),t.bezierCurveTo(w,v,N,$,P,W),ee>=p&&f&&(C=x,R=_.controls&&_.controls.right||re.zero,E=C.controls&&C.controls.left||re.zero,_._relative?(w=R.x+_.x,v=R.y+_.y):(w=R.x,v=R.y),C._relative?(N=E.x+C.x,$=E.y+C.y):(N=E.x,$=E.y),P=C.x,W=C.y,t.bezierCurveTo(w,v,N,$,P,W));break;case oe.line:t.lineTo(P,W);break;case oe.move:x=_,t.moveTo(P,W);break}return f&&t.closePath(),!Z&&!n&&(Ee.isHidden.test(a)||(D=a._renderer&&a._renderer.offset,D&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),D&&t.restore()),Ee.isHidden.test(o)||(D=o._renderer&&o._renderer.offset,D&&(t.save(),t.translate(-o._renderer.offset.x,-o._renderer.offset.y),t.scale(o._renderer.scale.x,o._renderer.scale.y),t.lineWidth=s/o._renderer.scale.x),t.stroke(),D&&t.restore())),te||t.restore(),Z&&!n&&t.clip(),L&&L.length>0&&t.setLineDash(ks),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,o,s,a,l,c,d,u,h,f,g,m,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,a=this._fill,u=this._renderer.collection,h=u.length,p=io(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const N=Ee.getRendererType(a._renderer.type);Ee[N].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const N=Ee.getRendererType(o._renderer.type);Ee[N].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=fn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let C=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=li(x[0],x[3],x[1],x[4],x[2],x[5]),C/=Math.max(x.scaleX,x.scaleY));for(let N=0;N<h;N++)f=u[N],g=f.x,m=f.y,t.moveTo(g+C,m),t.arc(g,m,C,0,yt);return n||(Ee.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Ee.isHidden.test(o)||(b=o._renderer&&o._renderer.offset,b&&(t.save(),t.translate(-o._renderer.offset.x,-o._renderer.offset.y),t.scale(o._renderer.scale.x,o._renderer.scale.y),t.lineWidth=s/o._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(ks),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,o=this._opacity*r,s=this._visible,a=this._mask,l=this._clip;if(!e&&(!s||l||o===0))return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,u=this._linewidth,h=this._fill,f=this._decoration,g=this._direction,m=io(c),p=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Ee.alignments[this._alignment]||this._alignment,_=Ee.baselines[this._baseline]||this._baseline;let C,x,N,$,w,v,k,B,R,E,P;if(m||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const W=Ee.getRendererType(a._renderer.type);Ee[W].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=g,h)if(typeof h=="string")t.fillStyle=h;else{const W=Ee.getRendererType(h._renderer.type);Ee[W].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const W=Ee.getRendererType(d._renderer.type);Ee[W].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=fn(this))}if(typeof o=="number"&&(t.globalAlpha=o),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&(Ee.isHidden.test(h)||(h._renderer&&h._renderer.offset?(v=h._renderer.scale.x,k=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(v,k),C=this._size/h._renderer.scale.y,x=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,C+"px/",x+"px",this._family].join(" "),N=h._renderer.offset.x/h._renderer.scale.x,$=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,N,$),t.restore()):t.fillText(this.value,0,0)),Ee.isHidden.test(d)||(d._renderer&&d._renderer.offset?(v=d._renderer.scale.x,k=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(v,k),C=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,C+"px/",x+"px",this._family].join(" "),N=d._renderer.offset.x/d._renderer.scale.x,$=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,N,$),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const W=t.measureText(this.value);let I=1;switch(f){case"underline":R=W.actualBoundingBoxDescent,P=W.actualBoundingBoxDescent;break;case"strikethrough":R=0,P=0,I=.5;break}switch(_){case"top":R+=this._size*I,P+=this._size*I;break;case"baseline":case"bottom":R-=this._size*I,P-=this._size*I;break}switch(y){case"left":case"start":B=0,E=W.width;break;case"right":case"end":B=-W.width,E=0;break;default:B=-W.width/2,E=W.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(B,R),t.lineTo(E,P),t.stroke()}return m||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(ks),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,o=this.left._y,s=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,o=(o-.5)*n.height,s=(s-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,o,s,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(ie.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,o=this.center._y,s=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,o=(o-.5)*n.height*.5,s=(s-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof re||(this._renderer.offset=new re),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof re?(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 re||(this._renderer.scale=new re),this._scale instanceof re?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,o,s,a,l,c,d){l=l*Math.PI/180,r=Bc(r),o=Bc(o);const u=(e-c)/2,h=(n-d)/2,f=to(l)*u+eo(l)*h,g=-eo(l)*u+to(l)*h,m=f*f,p=g*g;let b=r*r,y=o*o;const _=m/b+p/y;if(_>1){const W=no(_);r=W*r,o=W*o,b=r*r,y=o*o}const C=b*p+y*m,x=(b*y-C)/C;let N=no(vs(0,x));s===a&&(N=-N);const $=N*r*g/o,w=-N*o*f/r,v=to(l)*$-eo(l)*w+(e+c)/2,k=eo(l)*$+to(l)*w+(n+d)/2,B=Tc(1,0,(f-$)/r,(g-w)/o),R=Tc((f-$)/r,(g-w)/o,(-f-$)/r,(-g-w)/o)%yt,E=B+R;bp(t,v,k,r,o,B,E,a===0,l)}},_t=class extends Q{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new ut,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?es(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&ie.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(Q.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Ee.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};S(_t,"Utils",Ee);function bp(t,e,n,r,o,s,a,l,c){const d=a-s,u=Oi.Tolerance.epsilon,h=Math.abs(d)<u;let f=Lt(d,yt);f<u&&(h?f=0:f=yt),l===!0&&!h&&(f===yt?f=-yt:f=f-yt);for(let g=0;g<$t.Resolution;g++){const m=g/($t.Resolution-1),p=s+m*f;let b=e+r*Math.cos(p),y=n+o*Math.sin(p);if(c!==0){const _=Math.cos(c),C=Math.sin(c),x=b-e,N=y-n;b=x*_-N*C+e,y=x*C+N*_+n}t.lineTo(b,y)}}function Tc(t,e,n,r){const o=t*n+e*r,s=no(t*t+e*e)*no(n*n+r*r);let a=yp(vs(-1,pp(1,o/s)));return t*r-e*n<0&&(a=-a),a}function io(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var de={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const n=t,r=document.createElementNS(de.ns,n);return n==="svg"&&(e=ie.defaults(e||{},{version:de.version})),e&&Object.keys(e).length>0&&de.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(de.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,o,s="";for(let a=0;a<n;a++){const l=t[a],c=e?Lt(a-1,n):Math.max(a-1,0),d=t[c];let u,h,f,g,m,p,b,y,_,C,x,N,$,w,v,k=Ie(l.x),B=Ie(l.y);switch(l.command){case oe.close:u=oe.close;break;case oe.arc:x=l.rx,N=l.ry,$=l.xAxisRotation,w=l.largeArcFlag,v=l.sweepFlag,u=oe.arc+" "+x+" "+N+" "+$+" "+w+" "+v+" "+k+" "+B;break;case oe.curve:b=d.controls&&d.controls.right||re.zero,y=l.controls&&l.controls.left||re.zero,d.relative?(f=Ie(b.x+d.x),g=Ie(b.y+d.y)):(f=Ie(b.x),g=Ie(b.y)),l.relative?(m=Ie(y.x+l.x),p=Ie(y.y+l.y)):(m=Ie(y.x),p=Ie(y.y)),u=(a===0?oe.move:oe.curve)+" "+f+" "+g+" "+m+" "+p+" "+k+" "+B;break;case oe.move:o=l,u=oe.move+" "+k+" "+B;break;default:u=l.command+" "+k+" "+B}a>=r&&e&&(l.command===oe.curve&&(h=o,_=l.controls&&l.controls.right||l,C=h.controls&&h.controls.left||h,l.relative?(f=Ie(_.x+l.x),g=Ie(_.y+l.y)):(f=Ie(_.x),g=Ie(_.y)),h.relative?(m=Ie(C.x+h.x),p=Ie(C.y+h.y)):(m=Ie(C.x),p=Ie(C.y)),k=Ie(h.x),B=Ie(h.y),u+=" C "+f+" "+g+" "+m+" "+p+" "+k+" "+B),l.command!==oe.close&&(u+=" Z")),s+=u+" "}return s},pointsToString:function(t,e){let n="";const r=e*.5;for(let o=0;o<t.length;o++){const s=t[o].x,a=t[o].y-r;n+=oe.move+" "+s+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=de.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in de?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.children,0);for(let r=0;r<n.length;r++){const o=n[r],s=o.id,a=`[fill="url(#${s})"],[stroke="url(#${s})"],[clip-path="url(#${s})"]`;t.querySelector(a)||e.removeChild(o)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=de.getRendererType(t._renderer.type);de[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=de.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const o=this.children[r],s=de.getRendererType(o._renderer.type);de[s].render.call(o,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(de.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(de.group.removeChild,n),this._flagOrder&&this.children.forEach(de.group.orderChild,n),this._flagMask)if(this._mask){const r=de.getRendererType(this._mask._renderer.type);de[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=de.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=de.getRendererType(this._stroke._renderer.type);de[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=fn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=de.getClip(this,t),o=this._renderer.elem;this._clip?(o.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(o)):(r.removeAttribute("id"),o.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(o))}if(this._flagMask)if(this._mask){const r=de.getRendererType(this._mask._renderer.type);de[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const s=this.worldMatrix.elements,a=li(s[0],s[3],s[1],s[4],s[2],s[5]);r/=Math.max(a.scaleX,a.scaleY)}const o=de.pointsToString(this._renderer.collection,r);e.d=o}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=de.getRendererType(this._stroke._renderer.type);de[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=fn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("path",e),t.appendChild(this._renderer.elem)),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=de.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=de.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=de.getRendererType(this._stroke._renderer.type);de[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=fn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=de.getClip(this,t),o=this._renderer.elem;this._clip?(o.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(o)):(r.removeAttribute("id"),o.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(o))}if(this._flagMask)if(this._mask){const r=de.getRendererType(this._mask._renderer.type);de[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?de.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=de.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let o=0;o<this.stops.length;o++){const s=this.stops[o],a={};s._flagOffset&&(a.offset=100*s._offset+"%"),s._flagColor&&(a["stop-color"]=s._color),s._flagOpacity&&(a["stop-opacity"]=s._opacity),s._renderer.elem?de.setAttributes(s._renderer.elem,a):s._renderer.elem=de.createElement("stop",a),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?de.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=de.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let o=0;o<this.stops.length;o++){const s=this.stops[o],a={};s._flagOffset&&(a.offset=100*s._offset+"%"),s._flagColor&&(a["stop-color"]=s._color),s._flagOpacity&&(a["stop-opacity"]=s._opacity),s._renderer.elem?de.setAttributes(s._renderer.elem,a):s._renderer.elem=de.createElement("stop",a),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={},r={x:0,y:0},o=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(o.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=o.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,o&&(n.x-=o.width/2,n.y-=o.height/2,this._scale instanceof re?(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,o)){switch(n.width=o.width,n.height=o.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof re?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?de.setAttributes(this._renderer.image,r):this._renderer.image=de.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&de.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=de.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Nc=class extends Q{constructor(t){super(),this.domElement=t.domElement||de.createElement("svg"),this.scene=new ut,this.scene.parent=this,this.defs=de.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,de.setAttributes(this.domElement,{width:t,height:e}),this.trigger(Q.Types.resize,t,e)}render(){return de.group.render.call(this.scene,this.domElement),de.defs.update(this.domElement),this}};S(Nc,"Utils",de);var Gt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const s=t.getShaderInfoLog(r);throw t.deleteShader(r),new It("unable to compile shader "+r+": "+s)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
40
+ ***************************************************************************** */var Lr=function(){return Lr=Object.assign||function(e){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(e[s]=n[s])}return e},Lr.apply(this,arguments)},km={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:"lg-zoom-in",zoomOut:"lg-zoom-out"},enableZoomAfter:300,zoomPluginStrings:{zoomIn:"Zoom in",zoomOut:"Zoom out",viewActualSize:"View actual size"}},$n={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},Xo=500,vm=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=Lr(Lr({},km),this.core.settings),this}return t.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?'<button id="'+this.core.getIdName("lg-zoom-in")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomIn+'" class="lg-zoom-in lg-icon"></button><button id="'+this.core.getIdName("lg-zoom-out")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.zoomOut+'" class="lg-zoom-out lg-icon"></button>':"";this.settings.actualSize&&(e+='<button id="'+this.core.getIdName("lg-actual-size")+'" type="button" aria-label="'+this.settings.zoomPluginStrings.viewActualSize+'" class="'+this.settings.actualSizeIcons.zoomIn+' lg-icon"></button>'),this.core.outer.addClass("lg-use-transition-for-zoom"),this.core.$toolbar.first().append(e)},t.prototype.enableZoom=function(e){var n=this,r=this.settings.enableZoomAfter+e.detail.delay;this.$LG("body").first().hasClass("lg-from-hash")&&e.detail.delay?r=0:this.$LG("body").first().removeClass("lg-from-hash"),this.zoomableTimeout=setTimeout(function(){n.isImageSlide(n.core.index)&&(n.core.getSlideItem(e.detail.index).addClass("lg-zoomable"),e.detail.index===n.core.index&&n.setZoomEssentials())},r+30)},t.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on($n.slideItemLoad+".zoom",this.enableZoom.bind(this))},t.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},t.prototype.getSwipeCords=function(e){var n=e.touches[0].pageX,r=e.touches[0].pageY;return{x:n,y:r}},t.prototype.getDragAllowedAxises=function(e,n){if(!this.containerRect)return{allowX:!1,allowY:!1};var r=this.core.getSlideItem(this.core.index).find(".lg-image").first().get(),o=0,s=0,a=r.getBoundingClientRect();e?(o=r.offsetHeight*e,s=r.offsetWidth*e):n?(o=a.height+n*a.height,s=a.width+n*a.width):(o=a.height,s=a.width);var l=o>this.containerRect.height,c=s>this.containerRect.width;return{allowX:c,allowY:l}},t.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},t.prototype.zoomImage=function(e,n,r,o){if(!(!this.containerRect||Math.abs(n)<=0)){var s=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,l,c;e===1&&(this.positionChanged=!1);var d=this.getDragAllowedAxises(0,n),u=d.allowY,h=d.allowX;this.positionChanged&&(l=this.left/(this.scale-n),c=this.top/(this.scale-n),this.pageX=s-l,this.pageY=a-c,this.positionChanged=!1);var f=this.getPossibleSwipeDragCords(n),g,m,p=s-this.pageX,b=a-this.pageY;if(e-n>1){var y=(e-n)/Math.abs(n);p=(n<0?-p:p)+this.left*(y+(n<0?-1:1)),b=(n<0?-b:b)+this.top*(y+(n<0?-1:1)),g=p/y,m=b/y}else{var y=(e-n)*n;g=p*y,m=b*y}r&&(h?this.isBeyondPossibleLeft(g,f.minX)?g=f.minX:this.isBeyondPossibleRight(g,f.maxX)&&(g=f.maxX):e>1&&(g<f.minX?g=f.minX:g>f.maxX&&(g=f.maxX)),u?this.isBeyondPossibleTop(m,f.minY)?m=f.minY:this.isBeyondPossibleBottom(m,f.maxY)&&(m=f.maxY):e>1&&(m<f.minY?m=f.minY:m>f.maxY&&(m=f.maxY))),this.setZoomStyles({x:g,y:m,scale:e}),this.left=g,this.top=m,o&&this.setZoomImageSize()}},t.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var n=this.core.getSlideItem(e).find(".lg-image").first();this.imageReset=!1,n.removeClass("reset-transition reset-transition-y reset-transition-x"),this.core.outer.removeClass("lg-actual-size"),n.css("width","auto").css("height","auto"),setTimeout(function(){n.removeClass("no-transition")},10)}},t.prototype.setZoomImageSize=function(){var e=this,n=this.core.getSlideItem(this.core.index).find(".lg-image").first();setTimeout(function(){var r=e.getCurrentImageActualSizeScale();e.scale>=r&&(n.addClass("no-transition"),e.imageReset=!0)},Xo),setTimeout(function(){var r=e.getCurrentImageActualSizeScale();if(e.scale>=r){var o=e.getDragAllowedAxises(e.scale);n.css("width",n.get().naturalWidth+"px").css("height",n.get().naturalHeight+"px"),e.core.outer.addClass("lg-actual-size"),o.allowX&&o.allowY?n.addClass("reset-transition"):o.allowX&&!o.allowY?n.addClass("reset-transition-x"):!o.allowX&&o.allowY&&n.addClass("reset-transition-y")}},Xo+50)},t.prototype.setZoomStyles=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),r=this.core.getSlideItem(this.core.index).find(".lg-image").first(),o=this.core.outer.find(".lg-current .lg-dummy-img").first();this.scale=e.scale,r.css("transform","scale3d("+e.scale+", "+e.scale+", 1)"),o.css("transform","scale3d("+e.scale+", "+e.scale+", 1)");var s="translate3d("+e.x+"px, "+e.y+"px, 0)";n.css("transform",s)},t.prototype.setActualSize=function(e,n){var r=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var o=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(!(!o.src||r.core.outer.hasClass("lg-first-slide-loading"))){var s=r.getCurrentImageActualSizeScale(),a=r.scale;r.core.outer.hasClass("lg-zoomed")?r.scale=1:r.scale=r.getScale(s),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},Xo+110)}},t.prototype.getNaturalWidth=function(e){var n=this.core.getSlideItem(e).find(".lg-image").first(),r=this.core.galleryItems[e].width;return r?parseFloat(r):n.get().naturalWidth},t.prototype.getActualSizeScale=function(e,n){var r,o;return e>=n?(r=e/n,o=r||2):o=1,o},t.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(".lg-image").first(),n=e.get().offsetWidth,r=this.getNaturalWidth(this.core.index)||n;return this.getActualSizeScale(r,n)},t.prototype.getPageCords=function(e){var n={};if(e)n.x=e.pageX||e.touches[0].pageX,n.y=e.pageY||e.touches[0].pageY;else{var r=this.core.$content.get().getBoundingClientRect();n.x=r.width/2+r.left,n.y=r.height/2+this.scrollTop+r.top}return n},t.prototype.setPageCords=function(e){var n=this.getPageCords(e);this.pageX=n.x,this.pageY=n.y},t.prototype.manageActualPixelClassNames=function(){var e=this.core.getElementById("lg-actual-size");e.removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},t.prototype.beginZoom=function(e){return this.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e>1?(this.core.outer.addClass("lg-zoomed"),this.manageActualPixelClassNames()):this.resetZoom(),e>1},t.prototype.getScale=function(e){var n=this.getCurrentImageActualSizeScale();return e<1?e=1:e>n&&(e=n),e},t.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var n=null;this.core.outer.on("dblclick.lg",function(r){e.$LG(r.target).hasClass("lg-image")&&e.setActualSize(e.core.index,r)}),this.core.outer.on("touchstart.lg",function(r){var o=e.$LG(r.target);r.touches.length===1&&o.hasClass("lg-image")&&(n?(clearTimeout(n),n=null,r.preventDefault(),e.setActualSize(e.core.index,r)):n=setTimeout(function(){n=null},300))}),this.core.LGel.on($n.containerResize+".zoom "+$n.rotateRight+".zoom "+$n.rotateLeft+".zoom "+$n.flipHorizontal+".zoom "+$n.flipVertical+".zoom",function(){if(!(!e.core.lgOpened||!e.isImageSlide(e.core.index)||e.core.touchAction)){var r=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(r,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on("scroll.lg.zoom.global"+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById("lg-zoom-out").on("click.lg",function(){if(e.isImageSlide(e.core.index)){var r=0;e.imageReset&&(e.resetImageTranslate(e.core.index),r=50),setTimeout(function(){var o=e.scale-e.settings.scale;o<1&&(o=1),e.beginZoom(o),e.zoomImage(o,-e.settings.scale,!0,!e.settings.infiniteZoom)},r)}}),this.core.getElementById("lg-zoom-in").on("click.lg",function(){e.zoomIn()}),this.core.getElementById("lg-actual-size").on("click.lg",function(){e.setActualSize(e.core.index)}),this.core.LGel.on($n.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on($n.afterOpen+".zoom",function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on($n.afterSlide+".zoom",function(r){var o=r.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(o),e.resetImageTranslate(o),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},t.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},t.prototype.resetZoom=function(e){this.core.outer.removeClass("lg-zoomed lg-zoom-drag-transition");var n=this.core.getElementById("lg-actual-size"),r=this.core.getSlideItem(e!==void 0?e:this.core.index);n.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),r.find(".lg-img-wrap").first().removeAttr("style"),r.find(".lg-image").first().removeAttr("style"),this.scale=1,this.left=0,this.top=0,this.setPageCords()},t.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},t.prototype.pinchZoom=function(){var e=this,n=0,r=!1,o=1,s=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on("touchstart.lg",function(l){if(a=e.core.getSlideItem(e.core.index),!!e.isImageSlide(e.core.index)&&l.touches.length===2){if(l.preventDefault(),e.core.outer.hasClass("lg-first-slide-loading"))return;o=e.scale||1,e.core.outer.removeClass("lg-zoom-drag-transition lg-zoom-dragging"),e.setPageCords(l),e.resetImageTranslate(e.core.index),e.core.touchAction="pinch",n=e.getTouchDistance(l)}}),this.core.$inner.on("touchmove.lg",function(l){if(l.touches.length===2&&e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){l.preventDefault();var c=e.getTouchDistance(l),d=n-c;if(!r&&Math.abs(d)>5&&(r=!0),r){s=e.scale;var u=Math.max(1,o+-d*.02);e.scale=Math.round((u+Number.EPSILON)*100)/100;var h=e.scale-s;e.zoomImage(e.scale,Math.round((h+Number.EPSILON)*100)/100,!1,!1)}}}),this.core.$inner.on("touchend.lg",function(l){if(e.core.touchAction==="pinch"&&(e.$LG(l.target).hasClass("lg-item")||a.get().contains(l.target))){if(r=!1,n=0,e.scale<=1)e.resetZoom();else{var c=e.getCurrentImageActualSizeScale();if(e.scale>=c){var d=c-e.scale;d===0&&(d=.01),e.zoomImage(c,d,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass("lg-zoomed")}e.core.touchAction=void 0}})},t.prototype.touchendZoom=function(e,n,r,o,s){var a=n.x-e.x,l=n.y-e.y,c=Math.abs(a)/s+1,d=Math.abs(l)/s+1;c>2&&(c+=1),d>2&&(d+=1),a=a*c,l=l*d;var u=this.core.getSlideItem(this.core.index).find(".lg-img-wrap").first(),h={};h.x=this.left+a,h.y=this.top+l;var f=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(l)>15)&&(o&&(this.isBeyondPossibleTop(h.y,f.minY)?h.y=f.minY:this.isBeyondPossibleBottom(h.y,f.maxY)&&(h.y=f.maxY)),r&&(this.isBeyondPossibleLeft(h.x,f.minX)?h.x=f.minX:this.isBeyondPossibleRight(h.x,f.maxX)&&(h.x=f.maxX)),o?this.top=h.y:h.y=this.top,r?this.left=h.x:h.x=this.left,this.setZoomSwipeStyles(u,h),this.positionChanged=!0)},t.prototype.getZoomSwipeCords=function(e,n,r,o,s){var a={};if(o){if(a.y=this.top+(n.y-e.y),this.isBeyondPossibleTop(a.y,s.minY)){var l=s.minY-a.y;a.y=s.minY-l/6}else if(this.isBeyondPossibleBottom(a.y,s.maxY)){var c=a.y-s.maxY;a.y=s.maxY+c/6}}else a.y=this.top;if(r){if(a.x=this.left+(n.x-e.x),this.isBeyondPossibleLeft(a.x,s.minX)){var d=s.minX-a.x;a.x=s.minX-d/6}else if(this.isBeyondPossibleRight(a.x,s.maxX)){var u=a.x-s.maxX;a.x=s.maxX+u/6}}else a.x=this.left;return a},t.prototype.isBeyondPossibleLeft=function(e,n){return e>=n},t.prototype.isBeyondPossibleRight=function(e,n){return e<=n},t.prototype.isBeyondPossibleTop=function(e,n){return e>=n},t.prototype.isBeyondPossibleBottom=function(e,n){return e<=n},t.prototype.isImageSlide=function(e){var n=this.core.galleryItems[e];return this.core.getSlideType(n)==="image"},t.prototype.getPossibleSwipeDragCords=function(e){var n=this.core.getSlideItem(this.core.index).find(".lg-image").first(),r=this.core.mediaContainerPosition.bottom,o=n.get().getBoundingClientRect(),s=o.height,a=o.width;e&&(s=s+e*s,a=a+e*a);var l=(s-this.containerRect.height)/2,c=(this.containerRect.height-s)/2+r,d=(a-this.containerRect.width)/2,u=(this.containerRect.width-a)/2,h={minY:l,maxY:c,minX:d,maxX:u};return h},t.prototype.setZoomSwipeStyles=function(e,n){e.css("transform","translate3d("+n.x+"px, "+n.y+"px, 0)")},t.prototype.zoomSwipe=function(){var e=this,n={},r={},o=!1,s=!1,a=!1,l=new Date,c=new Date,d,u,h=this.core.getSlideItem(this.core.index);this.core.$inner.on("touchstart.lg",function(f){if(e.isImageSlide(e.core.index)&&(h=e.core.getSlideItem(e.core.index),(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))&&f.touches.length===1&&e.core.outer.hasClass("lg-zoomed"))){f.preventDefault(),l=new Date,e.core.touchAction="zoomSwipe",u=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var g=e.getDragAllowedAxises(0);a=g.allowY,s=g.allowX,(s||a)&&(n=e.getSwipeCords(f)),d=e.getPossibleSwipeDragCords(),e.core.outer.addClass("lg-zoom-dragging lg-zoom-drag-transition")}}),this.core.$inner.on("touchmove.lg",function(f){if(f.touches.length===1&&e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){f.preventDefault(),e.core.touchAction="zoomSwipe",r=e.getSwipeCords(f);var g=e.getZoomSwipeCords(n,r,s,a,d);(Math.abs(r.x-n.x)>15||Math.abs(r.y-n.y)>15)&&(o=!0,e.setZoomSwipeStyles(u,g))}}),this.core.$inner.on("touchend.lg",function(f){if(e.core.touchAction==="zoomSwipe"&&(e.$LG(f.target).hasClass("lg-item")||h.get().contains(f.target))){if(f.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass("lg-zoom-dragging"),!o)return;o=!1,c=new Date;var g=c.valueOf()-l.valueOf();e.touchendZoom(n,r,s,a,g)}})},t.prototype.zoomDrag=function(){var e=this,n={},r={},o=!1,s=!1,a=!1,l=!1,c,d,u,h;this.core.outer.on("mousedown.lg.zoom",function(f){if(e.isImageSlide(e.core.index)){var g=e.core.getSlideItem(e.core.index);if(e.$LG(f.target).hasClass("lg-item")||g.get().contains(f.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var m=e.getDragAllowedAxises(0);l=m.allowY,a=m.allowX,e.core.outer.hasClass("lg-zoomed")&&e.$LG(f.target).hasClass("lg-object")&&(a||l)&&(f.preventDefault(),n=e.getDragCords(f),u=e.getPossibleSwipeDragCords(),o=!0,e.core.outer.removeClass("lg-grab").addClass("lg-grabbing lg-zoom-drag-transition lg-zoom-dragging"))}}}),this.$LG(window).on("mousemove.lg.zoom.global"+this.core.lgId,function(f){if(o){s=!0,r=e.getDragCords(f);var g=e.getZoomSwipeCords(n,r,a,l,u);e.setZoomSwipeStyles(h,g)}}),this.$LG(window).on("mouseup.lg.zoom.global"+this.core.lgId,function(f){if(o){if(d=new Date,o=!1,e.core.outer.removeClass("lg-zoom-dragging"),s&&(n.x!==r.x||n.y!==r.y)){r=e.getDragCords(f);var g=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,g)}s=!1}e.core.outer.removeClass("lg-grabbing").addClass("lg-grab")})},t.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},t.prototype.destroy=function(){this.$LG(window).off(".lg.zoom.global"+this.core.lgId),this.core.LGel.off(".lg.zoom"),this.core.LGel.off(".zoom"),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},t})();const Cm={ref:"gallery-container",class:"lightgallery-wrapper"},Sm={},rl=i.defineComponent({...Sm,__name:"lightgallery",props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(t){const e=t,n={lgAfterAppendSlide:e.onAfterAppendSlide,lgInit:e.onInit,lgHasVideo:e.onHasVideo,lgContainerResize:e.onContainerResize,lgAfterAppendSubHtml:e.onAfterAppendSubHtml,lgBeforeOpen:e.onBeforeOpen,lgAfterOpen:e.onAfterOpen,lgSlideItemLoad:e.onSlideItemLoad,lgBeforeSlide:e.onBeforeSlide,lgAfterSlide:e.onAfterSlide,lgPosterClick:e.onPosterClick,lgDragStart:e.onDragStart,lgDragMove:e.onDragMove,lgDragEnd:e.onDragEnd,lgBeforeNextSlide:e.onBeforeNextSlide,lgBeforePrevSlide:e.onBeforePrevSlide,lgBeforeClose:e.onBeforeClose,lgAfterClose:e.onAfterClose,lgRotateLeft:e.onRotateLeft,lgRotateRight:e.onRotateRight,lgFlipHorizontal:e.onFlipHorizontal,lgFlipVertical:e.onFlipVertical},r=i.useTemplateRef("gallery-container"),o=i.ref(null);return i.onMounted(async()=>{if(!r.value)return;const s=await import("lightgallery");o.value=s.default(r.value,{...e.settings}),M.forOwn(n,(a,l)=>{var c;a&&((c=r.value)==null||c.addEventListener(l,a))})}),i.onBeforeUnmount(()=>{var s;o.value&&((s=o.value)==null||s.destroy(),o.value=null)}),(s,a)=>(i.openBlock(),i.createElementBlock("div",Cm,[i.renderSlot(s.$slots,"default")],512))}}),ft=class ft{static init(){ft.isInitialized||(ft.isInitialized=!0,ft.windowResizeHandler(),window.addEventListener("resize",ft.windowResizeHandler))}static destroy(){window.removeEventListener("resize",ft.windowResizeHandler),ft.isInitialized=!1}static getDeviceTypeByResolution(){const e=j.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Je.phone:window.innerWidth<e.laptop?Je.tablet:Je.laptop}static initRefDependingOnDeviceResolution(e,n,r){const o=i.ref(r);return ft.setRefValueDependingOnDeviceResolution(o,e,n,r),ft.refsDependingOnDeviceResolution.push({r:o,phoneValue:e,tabletValue:n,defaultValue:r}),o}static isPhoneDevice(){return ft.getDeviceTypeByResolution()===Je.phone}static isTabletDevice(){return ft.getDeviceTypeByResolution()===Je.tablet}static isLaptopDevice(){return ft.getDeviceTypeByResolution()===Je.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,o){switch(ft.getDeviceTypeByResolution()){case Je.phone:e.value=n;break;case Je.tablet:e.value=r;break;default:e.value=o;break}}static windowResizeHandler(){M.forEach(ft.refsDependingOnDeviceResolution,e=>{ft.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};T(ft,"isInitialized",!1),T(ft,"refsDependingOnDeviceResolution",[]);let it=ft;const Bm=["href"],Tm=["src","alt"],Nm={},ol=i.defineComponent({...Nm,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),o=i.ref({plugins:[xm,vm],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),s=()=>window.innerWidth*(it.getDeviceTypeByResolution()===Je.phone?.7:.8),a=i.ref(s()),l=()=>{a.value=s()},c=()=>{n.value=!0};return i.onUnmounted(()=>{window.removeEventListener("resize",l)}),e({show:c}),window.addEventListener("resize",l),(d,u)=>{const h=il,f=A.NPopover;return i.openBlock(),i.createBlock(f,{trigger:"manual",show:n.value,class:"sc-image",placement:"top-start",onClickoutside:u[3]||(u[3]=()=>{r.value||(n.value=!1)})},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:"inline-flex",onClick:u[0]||(u[0]=g=>n.value=!n.value)},[i.renderSlot(d.$slots,"default",{},()=>[i.createVNode(h)])])]),default:i.withCtx(()=>[i.createVNode(rl,{settings:o.value,style:i.normalizeStyle(`max-width: ${a.value}px`),class:"flex flex-row overflow-x-scroll",onAfterOpen:u[1]||(u[1]=()=>{r.value=!0}),onAfterClose:u[2]||(u[2]=()=>{r.value=!1,n.value=!1})},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.images,(g,m)=>(i.openBlock(),i.createElementBlock("a",{key:m,href:g.image},[i.createElementVNode("img",{src:g.preview,alt:`Изображение #${m+1}`},null,8,Tm)],8,Bm))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),$m={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},Rm={class:"pr-3"},Em={class:"text-right"},Pm={},Fm=i.defineComponent({...Pm,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=qo,o=A.NPopover;return i.openBlock(),i.createBlock(o,{trigger:"click",placement:"top-start",class:"sc-stock-count"},{trigger:i.withCtx(()=>[i.renderSlot(e.$slots,"default",{},()=>[i.createVNode(r)])]),default:i.withCtx(()=>[i.createElementVNode("div",$m,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.product.stockCount,(s,a)=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:a},[i.createElementVNode("span",Rm,i.toDisplayString(s.warehouse.name),1),i.createElementVNode("span",Em,[i.createTextVNode(i.toDisplayString(s.count??"В наличии")+" ",1),s.count?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(i.toDisplayString(t.product.unit.name),1)],64)):i.createCommentVNode("",!0)])],64))),128))])]),_:3})}}}),Vm={class:"flex flex-row justify-between"},Mm={class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},Am={key:0},Im={class:"ml-2 align-sub"},Om={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},zm={class:"@container"},Dm={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},Lm={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Hm={class:"text-sc-dark-grey"},Wm={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},jm={class:"text-gray-600"},qm={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Xm={key:3,class:"underline decoration-dashed"},Ym={key:4,class:"sc-product-pack whitespace-nowrap"},Um={class:"text-gray-600"},Km={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Gm={class:"text-gray-600"},Zm={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},Qm={key:0},Jm={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},eg={},dr=i.defineComponent({...eg,__name:"product-name",props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(t,{expose:e}){const n=t,r=i.computed(()=>M.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),o=i.computed(()=>M.sortBy(n.product.priceCoefficients,["coefficient.slug"])),s=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(()=>M.isFunction(n.allowNameClick)?n.allowNameClick(n.product):n.allowNameClick),d=i.computed(()=>{var h;return n.showProductAddToCartButton||n.showProductEditButton||n.showProductRequiredButton||(((h=n.productContextButtonsConfig)==null?void 0:h.length)??0)>0}),u=()=>{var h;c.value&&((h=n.eventEmitter)==null||h.emit("product:name-click",{product:n.product,exposedMethods:{showProductImagesPreview:l}}))};return e({showProductImagesPreview:l}),(h,f)=>{var N,$,w,v;const g=_m,m=A.NTooltip,p=tl,b=il,y=A.NText,_=nl,C=qo,x=A.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",Vm,[i.createVNode(y,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var k,B;return[i.createElementVNode("div",Mm,[((k=t.product)==null?void 0:k.isFavorite)??!1?(i.openBlock(),i.createBlock(m,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),((B=t.product)==null?void 0:B.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(m,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{class:"!text-green-700"})]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.createElementVNode("span",{class:i.normalizeClass({"cursor-pointer":c.value&&t.eventEmitter}),onClick:u},i.toDisplayString(t.product.name),3),t.product.onOrder?(i.openBlock(),i.createElementBlock("span",Am," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Im,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(ol,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Om,[i.createVNode(b)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),d.value?(i.openBlock(),i.createBlock(_,{key:0,product:t.product,"event-emitter":t.eventEmitter,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-edit-button":t.showProductEditButton,"show-product-required-button":t.showProductRequiredButton,"product-context-buttons-config":t.productContextButtonsConfig},null,8,["product","event-emitter","show-product-add-to-cart-button","show-product-edit-button","show-product-required-button","product-context-buttons-config"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",zm,[i.createElementVNode("div",Dm,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",Lm,[f[2]||(f[2]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",Hm,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",Wm,[f[3]||(f[3]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",jm,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(Fm,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",qm,[f[4]||(f[4]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(C,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",Xm," Нет в наличии ")),t.product.pack??(($=(N=t.product)==null?void 0:N.properties)==null?void 0:$.pack)?(i.openBlock(),i.createElementBlock("span",Ym,[f[5]||(f[5]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",Um,i.toDisplayString(t.product.pack??((v=(w=t.product)==null?void 0:w.properties)==null?void 0:v.pack)),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&s.value?(i.openBlock(),i.createElementBlock("span",Km,[f[6]||(f[6]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",Gm,i.toDisplayString(s.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(x,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",Zm,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,k=>(i.openBlock(),i.createBlock(jn,{key:k.coefficient.slug,product:t.product,"cost-field-name":k.coefficient.slug??"","event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates},null,8,["product","cost-field-name","event-emitter","allow-price-click","show-price-history","currency-rates"]))),128)),i.createVNode(jn,{product:t.product,"event-emitter":t.eventEmitter,"allow-price-click":t.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":t.showCostDate,"show-price-history":t.showPriceHistory,"currency-rates":t.currencyRates,"cost-field-name":"cost","additional-through-field-name":"retailCost",style:{"background-color":"var(--n-merged-td-color)"},class:"sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2"},null,8,["product","event-emitter","allow-price-click","show-cost-date","show-price-history","currency-rates"])])):i.createCommentVNode("",!0)]),_:1}),t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",Qm,[i.createElementVNode("ul",Jm,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},(k,B)=>(i.openBlock(),i.createElementBlock("li",{key:B}," ("+i.toDisplayString(B)+"): "+i.toDisplayString(k),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,(k,B)=>(i.openBlock(),i.createElementBlock("li",{key:B}," ("+i.toDisplayString(B)+"): "+i.toDisplayString(k),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),tg=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(jn,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),ng=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(M.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:o=>{var s,a;return i.h(A.NCheckbox,{checked:!!((s=e.isProductItemSelected)!=null&&s.call(e,o)),disabled:((a=e.isProductItemSelected)==null?void 0:a.call(e,o))==="disabled",onUpdateChecked:l=>{e.eventEmitter.emit("product:checked",{product:o,checked:l})}})}}),it.getDeviceTypeByResolution()){case Je.phone:case Je.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:o=>i.h(dr,{product:o,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig})});break;default:n.push({key:"name",title:"Наименование",className:"align-top",resizable:!0,render:o=>i.h(dr,{product:o,eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})}),e.showProductCosts&&(M.forEach(t,o=>{M.forEach(o.priceCoefficients,s=>{r[s.coefficient.slug??""]||(r[s.coefficient.slug??""]=s.coefficient)})}),M.forEach(M.sortBy(r,["slug"]),o=>{n.push(tg(o.slug??"",o.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:o=>i.h(jn,{product:o,costFieldName:"cost",additionalThroughFieldName:"retailCost",eventEmitter:e.eventEmitter,allowPriceClick:e.allowPriceClick,showQuantityUnit:!0,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,currencyRates:e.currencyRates})})),(e.showProductEditButton||e.showProductRequiredButton||e.showProductAddToCartButton||!M.isNil(e.productContextButtonsConfig))&&n.push({key:"actions",title:"",className:"align-top",width:"50",render:o=>i.h(nl,{product:o,eventEmitter:e.eventEmitter,showProductAddToCartButton:e.showProductAddToCartButton,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,productContextButtonsConfig:e.productContextButtonsConfig})});break}return n},ig={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function rg(t,e){return i.openBlock(),i.createElementBlock("svg",ig,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z"},null,-1)])])}const Hr=i.markRaw({name:"ion-trash",render:rg}),og={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sg(t,e){return i.openBlock(),i.createElementBlock("svg",og,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const sl=i.markRaw({name:"ion-plus",render:sg}),ag={key:0,class:"flex w-fit items-center gap-2"},lg={key:1,class:"flex flex-wrap gap-1"},cg={key:0},dg={key:2},ug={},ur=i.defineComponent({...ug,__name:"configurators-product-info",props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{var r,o;return(o=(r=e.product)==null?void 0:r.properties)==null?void 0:o.planingProductionDate});return(r,o)=>{const s=A.NSpin,a=A.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",ag,[i.createVNode(s,{size:17,class:"w-fit"}),o[0]||(o[0]=i.createElementVNode("div",null,"Выполняется поиск товара ...",-1))])):t.product&&!t.product.isNewRec()?(i.openBlock(),i.createElementBlock("div",lg,[i.createElementVNode("div",null,i.toDisplayString(t.product.code)+" - "+i.toDisplayString(t.product.name)+" - "+i.toDisplayString(t.product.costRub.toLocaleString())+" ₽ / "+i.toDisplayString(t.product.unit.name),1),n.value?(i.openBlock(),i.createElementBlock("div",cg,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",dg,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),hg={class:"flex flex-col gap-4"},fg={class:"flex flex-col gap-2"},mg={class:"mt-8 font-bold"},gg={class:"grid grow grid-cols-2 items-start gap-2"},pg={key:2,class:"text-red-500 text-sm"},yg={key:3,class:"text-red-500 text-sm mb-2"},bg={class:"flex flex-col gap-4"},_g={key:1},wg={class:"text-lg font-semibold"},xg={class:"flex gap-3"},kg={},vg=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","submit","click:add-line","click:remove-line","click:save-template"],setup(t,{expose:e,emit:n}){var b;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{var _,C,x;const y={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),He.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation((C=r.validation.quantity)==null?void 0:C.feedback)],marker:[He.serverValidation((x=r.validation.marker)==null?void 0:x.feedback)]};return M.forEach(l.value.configuratorParams.linesWidths,(N,$)=>{var k;const v=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;y[`configuratorParams.linesWidths.${$}`]=[ae.required,ae.min(v),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),He.serverValidation((k=r.validation[`lines_widths[${$+1}]`])==null?void 0:k.feedback)]}),M.forEach(l.value.configuratorParams.linesAngles,(N,$)=>{var w;y[`configuratorParams.linesAngles.${$}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),He.serverValidation((w=r.validation[`lines_angles[${$+1}]`])==null?void 0:w.feedback)]}),y}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>{var N;const{length:y}=l.value.configuratorParams,{quantity:_}=l.value,C=((N=l.value.product)==null?void 0:N.costRub)||0;if(!y||!_||C===0)return null;const x=y/1e3;return(C*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=i.computed(()=>M.reduce(l.value.configuratorParams.linesWidths,(y,_)=>y+(_||0),0)),f=i.computed(()=>{const y=h.value;return y>=r.settings.stripMinWidth&&y<=r.settings.stripMaxWidth}),g=i.computed(()=>{const{configuratorParams:y}=l.value,_=M.every(y.linesWidths,$=>!!($&&$>0)),C=M.every(y.linesAngles,$=>!M.isNil($)),x=!!(l.value.quantity&&l.value.quantity>0),N=y.length>0&&y.length>0;return _&&C&&x&&N&&f.value}),m=()=>{i.nextTick(()=>{var y;(y=s.value)==null||y.validate(_=>{_||(o("update:params",l.value.configuratorParams),p("configuratorParams",l.value.configuratorParams))}).catch(M.noop)})},p=(y,_)=>{const C=new j.OrderItemBase(l.value);C[y]=_,y==="configuratorParams"&&(C.product=new j.ClientProduct),o("update:value",C)};return i.watch(()=>r.previewParams,y=>{l.value.configuratorParams.linesWidths=y.linesWidths,l.value.configuratorParams.linesAngles=y.linesAngles},{deep:!0}),i.watch(()=>r.value,y=>{l.value=M.cloneDeep(y)},{deep:!0}),e({validate:(b=s.value)==null?void 0:b.validate,formReference:s}),(y,_)=>{const C=sl,x=Hr,N=A.NCheckbox;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message",onKeydown:_[20]||(_[20]=i.withKeys(i.withModifiers($=>o("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var $;return[i.createElementVNode("div",hg,[_[22]||(_[22]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(A.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),m],options:t.settings.startTailConfigs.map(({label:w},v)=>({label:w,value:v})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",fg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,v)=>(i.openBlock(),i.createElementBlock("div",{key:v,class:"flex items-start gap-2"},[i.createElementVNode("div",mg,i.toDisplayString(v+1),1),i.createElementVNode("div",gg,[i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.linesWidths.${v}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.configuratorParams.linesWidths[v],"onUpdate:value":[k=>l.value.configuratorParams.linesWidths[v]=k,_[2]||(_[2]=k=>m())],parse:i.unref(ot),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=k=>i.unref(nt)(k)),onInput:k=>i.unref(tt)(t.validation,`lines_widths[${v+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.linesAngles.${v}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.configuratorParams.linesAngles[v],"onUpdate:value":[k=>l.value.configuratorParams.linesAngles[v]=k,_[4]||(_[4]=k=>m())],parse:i.unref(ot),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=k=>i.unref(nt)(k,!0)),onInput:k=>i.unref(tt)(t.validation,`lines_angles[${v+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(A.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,size:"medium",onClick:k=>o("click:add-line",v)},{default:i.withCtx(()=>[i.createVNode(C)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:k=>o("click:remove-line",v)},{default:i.withCtx(()=>[i.createVNode(x)]),_:1},8,["disabled","onClick"]))]),_:2},1024)]))),128))]),t.settings.endTailConfigs&&t.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:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),m],options:t.settings.endTailConfigs.map(({label:w},v)=>({label:w,value:v})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(ur,{"is-product-searching":t.isProductSearching,product:l.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),f.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",pg," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(h.value)+" мм. ",1)),g.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",yg," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===(($=t.settings.allTemplates)==null?void 0:$.length)-1?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=w=>o("click:save-template"))},{default:i.withCtx(()=>[..._[21]||(_[21]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",bg,[i.createVNode(i.unref(A.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),m],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.value.configuratorParams.length=w),_[11]||(_[11]=w=>m())],parse:i.unref(ot),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>i.unref(nt)(w)),onInput:_[10]||(_[10]=w=>i.unref(tt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>p("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>i.unref(nt)(w,!1)),onInput:_[14]||(_[14]=w=>i.unref(tt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>i.unref(tt)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,p("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(N,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.value.isAdditionalSale=w??!1,p("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[..._[23]||(_[23]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",_g,[_[24]||(_[24]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",wg,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",xg,[i.createVNode(i.unref(A.NButton),{loading:t.isSubmitProcessing,disabled:!g.value||l.value.product.isNewRec(),type:"primary",class:"self-start",onClick:_[19]||(_[19]=w=>o("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])])]}),_:1},8,["model","rules"])}}}),al=Nn(vg,[["__scopeId","data-v-47ba4507"]]);var ll=Object.defineProperty,Cg=Object.defineProperties,Sg=Object.getOwnPropertyDescriptors,cl=Object.getOwnPropertySymbols,Bg=Object.prototype.hasOwnProperty,Tg=Object.prototype.propertyIsEnumerable,dl=t=>{throw TypeError(t)},Yo=(t,e,n)=>e in t?ll(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Uo=(t,e)=>{for(var n in e||(e={}))Bg.call(e,n)&&Yo(t,n,e[n]);if(cl)for(var n of cl(e))Tg.call(e,n)&&Yo(t,n,e[n]);return t},Ko=(t,e)=>Cg(t,Sg(e)),ul=(t,e)=>{for(var n in e)ll(t,n,{get:e[n],enumerable:!0})},S=(t,e,n)=>Yo(t,typeof e!="symbol"?e+"":e,n),hl=(t,e,n)=>e.has(t)||dl("Cannot "+n),At=(t,e,n)=>(hl(t,e,"read from private field"),n?n.call(t):e.get(t)),fl=(t,e,n)=>e.has(t)?dl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ng=(t,e,n,r)=>(hl(t,e,"write to private field"),e.set(t,n),n),Nt={Image:null,isHeadless:!1,shim:function(t,e){return t.tagName=t.nodeName=e||"canvas",t.nodeType=1,t.getAttribute=function(n){return this[n]},t.setAttribute=function(n,r){return this[n]=r,this},t},polyfill:function(t,e){return Nt.shim(t),typeof e<"u"&&(Nt.Image=e),Nt.isHeadless=!0,t}},ml={};ul(ml,{Curve:()=>Oi,getAnchorsFromArcData:()=>Eg,getComponentOnCubicBezier:()=>hr,getControlPoints:()=>Sl,getCurveBoundingBox:()=>kl,getCurveFromPoints:()=>Cl,getCurveLength:()=>xl,getReflection:()=>Jo,integrate:()=>vl,subdivide:()=>Qo});var gl={};ul(gl,{HALF_PI:()=>st,NumArray:()=>hn,TWO_PI:()=>yt,decomposeMatrix:()=>li,getComputedMatrix:()=>Go,getEffectiveStrokeWidth:()=>fn,getPoT:()=>bl,lerp:()=>Dt,mod:()=>Lt,setMatrix:()=>yl,toFixed:()=>Ie});var Ye;typeof window<"u"?Ye=window:typeof global<"u"?Ye=global:typeof self<"u"&&(Ye=self);var pl,yt=Math.PI*2,st=Math.PI*.5;function li(t,e,n,r,o,s){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,o=t.e,s=t.f):a=t,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function yl(t){pl=t}function Go(t,e){e=e&&e.identity()||new pl;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let o=0;o<r.length;o++){const a=r[o].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Dt(t,e,n){return n*(e-t)+t}var Zo=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function bl(t){let e=0;for(;Zo[e]&&Zo[e]<t;)e++;return Zo[e]}function Lt(t,e){for(;t<0;)t+=e;return t%e}var hn=Ye.Float32Array||Array,$g=Math.floor;function Ie(t){return $g(t*1e6)/1e6}function fn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||Go(t));const r=li(e.elements[0],e.elements[3],e.elements[1],e.elements[4],e.elements[2],e.elements[5]),o=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return o>0?n/o:n}var oe={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},Q=class{constructor(){S(this,"_events",{}),S(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let o=0,s=r.length;o<s;o++){e=r[o];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const o=this;e&&(s.obj=e,s.name=n,s.handler=r,e.on(n,s));function s(){r.apply(o,arguments)}return o}ignore(e,n,r){return e.off(n,r),this}};S(Q,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),S(Q,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var _l={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(Q.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},tn=class ir extends Q{constructor(e=0,n=0){super(),S(this,"_x",0),S(this,"_y",0);for(let r in _l)Object.defineProperty(this,r,_l[r]);this.x=e,this.y=n}static add(e,n){return new ir(e.x+n.x,e.y+n.y)}static sub(e,n){return new ir(e.x-n.x,e.y-n.y)}static subtract(e,n){return ir.sub(e,n)}static ratioBetween(e,n){return(e.x*n.x+e.y*n.y)/(e.length()*n.length())}static angleBetween(e,n){if(arguments.length>=4){const s=arguments[0]-arguments[2],a=arguments[1]-arguments[3];return Math.atan2(a,s)}const r=e.x-n.x,o=e.y-n.y;return Math.atan2(o,r)}static distanceBetween(e,n){return Math.sqrt(ir.distanceBetweenSquared(e,n))}static distanceBetweenSquared(e,n){const r=e.x-n.x,o=e.y-n.y;return r*r+o*o}set(e,n){return this.x=e,this.y=n,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new ir(this.x,this.y)}add(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x+=e,this.y+=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=n),this)}addSelf(e){return this.add.apply(this,arguments)}sub(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x-=e,this.y-=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=n),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x*=e,this.y*=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=n),this)}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,n){return arguments.length<=0?this:(arguments.length<=1?typeof e=="number"?(this.x/=e,this.y/=e):e&&typeof e.x=="number"&&typeof e.y=="number"&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=n),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,r=this.y-e.y;return n*n+r*r}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,n){return n=typeof n>"u"?1e-4:n,this.distanceTo(e)<n}lerp(e,n){const r=(e.x-this.x)*n+this.x,o=(e.y-this.y)*n+this.y;return this.set(r,o)}isZero(e){return e=typeof e>"u"?1e-4:e,this.length()<e}toString(){return this.x+", "+this.y}toObject(){return{x:Ie(this.x),y:Ie(this.y)}}rotate(e){const n=this.x,r=this.y,o=Math.cos(e),s=Math.sin(e);return this.x=n*o-r*s,this.y=n*s+r*o,this}};S(tn,"zero",new tn),S(tn,"left",new tn(-1,0)),S(tn,"right",new tn(1,0)),S(tn,"up",new tn(0,-1)),S(tn,"down",new tn(0,1));var re=tn,Be=class Ho extends re{constructor(e=0,n=0,r=0,o=0,s=0,a=0,l=oe.move){super(e,n),S(this,"controls",{left:new re,right:new re}),S(this,"_command",oe.move),S(this,"_relative",!0),S(this,"_rx",0),S(this,"_ry",0),S(this,"_xAxisRotation",0),S(this,"_largeArcFlag",0),S(this,"_sweepFlag",1);for(let d in wl)Object.defineProperty(this,d,wl[d]);this.command=l,this.relative=!0;const c=Ho.makeBroadcast(this);this.controls.left.set(r,o).addEventListener(Q.Types.change,c),this.controls.right.set(s,a).addEventListener(Q.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(Q.Types.change)}}static fromObject(e){return new Ho().copy(e)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command=="string"&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative=="boolean"&&(this.relative=e.relative),typeof e.rx=="number"&&(this.rx=e.rx),typeof e.ry=="number"&&(this.ry=e.ry),typeof e.xAxisRotation=="number"&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag=="number"&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag=="number"&&(this.sweepFlag=e.sweepFlag),this}clone(){return new Ho().copy(this)}toObject(){return{x:Ie(this.x),y:Ie(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Ie(this.rx),ry:Ie(this.ry),xAxisRotation:Ie(this.xAxisRotation),largeArcFlag:Ie(this.largeArcFlag),sweepFlag:Ie(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},wl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(Q.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(Q.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(Q.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(Q.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(Q.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(Q.Types.change))}}},Rg=0,$t={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.21",PublishDate:"2025-10-01T00:18:49.277Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return Rg++}},Oi={CollinearityEpsilon:Math.pow(10,-30),RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:Number.EPSILON},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function hr(t,e,n,r,o){const s=1-t;return s*s*s*e+3*s*s*t*n+3*s*t*t*r+t*t*t*o}function Qo(t,e,n,r,o,s,a,l,c){c=c||Oi.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Be(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,g=hr(f,t,n,o,a),m=hr(f,e,r,s,l);u.push(new Be(g,m))}return u}function xl(t,e,n,r,o,s,a,l,c){if(t===n&&e===r&&o===a&&s===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-o)+3*(a-t),u=6*(t+o)-12*n,h=3*(n-t),f=9*(r-s)+3*(l-e),g=6*(e+s)-12*r,m=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(f*b+g)*b+m;return Math.sqrt(y*y+_*_)}return vl(p,0,1,c||Oi.RecursionLimit)}function kl(t,e,n,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,g,m,p,b,y;for(let N=0;N<2;++N){if(N===0?(h=6*t-12*n+6*o,u=-3*t+9*n-9*o+3*a,f=3*n-3*t):(h=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-f/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*f*u,y=Math.sqrt(b),!(b<0)&&(m=(-h+y)/(2*u),0<m&&m<1&&c.push(m),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,C=_,x;for(;_--;)g=c[_],x=1-g,d[0][_]=x*x*x*t+3*x*x*g*n+3*x*g*g*o+g*g*g*a,d[1][_]=x*x*x*e+3*x*x*g*r+3*x*g*g*s+g*g*g*l;return d[0][C]=t,d[1][C]=e,d[0][C+1]=a,d[1][C+1]=l,d[0].length=d[1].length=C+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 vl(t,e,n,r){let o=Oi.abscissas[r-2],s=Oi.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(l):0;for(;c<d;){const h=a*o[c];u+=s[c++]*(t(l+h)+t(l-h))}return a*u}function Cl(t,e){const n=t.length,r=n-1;for(let o=0;o<n;o++){const s=t[o],a=e?Lt(o-1,n):Math.max(o-1,0),l=e?Lt(o+1,n):Math.min(o+1,r),c=t[a],d=s,u=t[l];Sl(c,d,u),d.command=o===0?oe.move:oe.curve}}function Sl(t,e,n){const r=re.angleBetween(t,e),o=re.angleBetween(n,e);let s=re.distanceBetween(t,e),a=re.distanceBetween(n,e),l=(r+o)/2;return s<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,a*=.33,o<r?l+=st:l-=st,e.controls.left.x=Math.cos(l)*s,e.controls.left.y=Math.sin(l)*s,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}function Jo(t,e,n){return new re(2*t.x-(e.x+t.x)-(n?t.x:0),2*t.y-(e.y+t.y)-(n?t.y:0))}function Eg(t,e,n,r,o,s,a){const l=$t.Resolution;for(let c=0;c<l;c++){let d=(c+1)/l;a&&(d=1-d);const u=d*s+o,h=n*Math.cos(u),f=r*Math.sin(u),g=new Be(h,f);g.command=oe.line}}var Bl=Array.prototype.slice;function Pg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var ie={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Bl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let o in r)t[o]=r[o]}return t},defaults:function(t){const e=Bl.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let o in r)t[o]===void 0&&(t[o]=r[o])}return t},each:function(t,e,n){const r=n||this,o=!Pg(t)&&Object.keys(t),s=(o||t).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,t[l],l,t)}return t},performance:Ye.performance&&Ye.performance.now?Ye.performance:Date},Ht={hasEventListeners:typeof Ye.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Ht},unbind:function(t,e,n,r){return Ht.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Ht},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=Ye.requestAnimationFrame;if(!n){for(let o=0;o<t.length;o++)n=Ye[t[o]+"RequestAnimationFrame"]||n;n=n||r}function r(o,s){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=Ye.setTimeout(d,l);e=a+l;function d(){o(a+l)}return c}return n}},zi=Ye.document?Ye.document.createElement("div"):{};zi.id="help-two-load",Object.defineProperty(Ht,"temp",{enumerable:!0,get:function(){return ie.isElement(zi)&&!Ye.document.head.contains(zi)&&(zi.style.display="none",Ye.document.head.appendChild(zi)),zi}});var It=class extends Error{constructor(e){super(),S(this,"name","Two.js"),S(this,"message"),this.message=e}},Fg=Ye.devicePixelRatio||1;function Vg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function es(t){return Fg/Vg(t)}var Wr=class{constructor(){S(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},bt,qn=class extends Array{constructor(){super(),fl(this,bt,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 At(this,bt)}set _events(e){Ng(this,bt,e)}get _bound(){return At(this,bt)._bound}set _bound(e){At(this,bt)._bound=e}addEventListener(){return At(this,bt).addEventListener.apply(this,arguments)}on(){return At(this,bt).on.apply(this,arguments)}bind(){return At(this,bt).bind.apply(this,arguments)}removeEventListener(){return At(this,bt).removeEventListener.apply(this,arguments)}off(){return At(this,bt).off.apply(this,arguments)}unbind(){return At(this,bt).unbind.apply(this,arguments)}dispatchEvent(){return At(this,bt).dispatchEvent.apply(this,arguments)}trigger(){return At(this,bt).trigger.apply(this,arguments)}listen(){return At(this,bt).listen.apply(this,arguments)}ignore(){return At(this,bt).ignore.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(Q.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(Q.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(Q.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(Q.Types.remove,e),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 e}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(e,n){const r=[];for(let o=0;o<this.length;o++){const s=this[o];let a;n?a=e.call(n,s,o):a=e(s,o),r.push(a)}return r}};bt=new WeakMap;var Tl=class sf extends Q{constructor(){super(),S(this,"_flagId",!1),S(this,"_flagClassName",!1),S(this,"_renderer",{}),S(this,"_id",$t.Identifier+$t.uniqueId()),S(this,"_className",""),S(this,"classList",[]);for(let e in Nl)Object.defineProperty(this,e,Nl[e])}static fromObject(e){const n=new sf().copy(e);return"id"in e&&(n.id=e.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type=="string"&&(this.renderer.type=e.renderer.type),typeof e.className=="string"&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const e=this._renderer.type;return this._renderer={type:e},typeof this.unbind=="function"&&this.unbind(),this}};S(Tl,"Properties",["renderer","id","className"]);var Di=Tl,Nl={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}},jr,$l={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ye.document&&(jr=document.createElement("a"));var nn=class Xt extends Di{constructor(e,n){super(),S(this,"_flagSrc",!1),S(this,"_flagImage",!1),S(this,"_flagVideo",!1),S(this,"_flagLoaded",!1),S(this,"_flagRepeat",!1),S(this,"_flagOffset",!1),S(this,"_flagScale",!1),S(this,"_src",""),S(this,"_image",null),S(this,"_loaded",!1),S(this,"_repeat","no-repeat"),S(this,"_scale",1),S(this,"_offset",null);for(let r in Rl)Object.defineProperty(this,r,Rl[r]);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 re,typeof n=="function"){const r=(function(){this.unbind(Q.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(Q.Types.load,r)}if(typeof e=="string")this.src=e;else if(typeof e=="object"){const r=Object.prototype.toString.call(e);(r==="[object HTMLImageElement]"||r==="[object HTMLCanvasElement]"||r==="[object HTMLVideoElement]"||r==="[object Image]")&&(this.image=e)}this._update()}fromObject(e){const n=new Xt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return jr?(jr.href=e,jr.href):e}static loadHeadlessBuffer(e,n){e.image.onload=n,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||"img"}static getImage(e){const n=Xt.getAbsoluteURL(e);if(Xt.ImageRegistry.contains(n))return Xt.ImageRegistry.get(n);let r;return Nt.Image?(r=new Nt.Image,Nt.shim(r,"img")):Ye.document?$l.video.test(n)?r=document.createElement("video"):r=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),r.crossOrigin="anonymous",r.referrerPolicy="no-referrer",r}static load(e,n){let r=e.image,o=Xt.getTag(r);e._flagImage&&(/canvas/i.test(o)?Xt.Register.canvas(e,n):(e._src=!Nt.isHeadless&&r.getAttribute("two-src")||r.src,Xt.Register[o](e,n))),e._flagSrc&&(r||(r=Xt.getImage(e.src),e.image=r),o=Xt.getTag(r),Xt.Register[o](e,n))}clone(){const e=new Xt(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 re?e.offset:new re().copy(e.offset),this.scale=typeof e.scale=="number"||e.scale instanceof re?e.scale:new re().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,Xt.load(this,(function(){this.loaded=!0,this.trigger(Q.Types.change).trigger(Q.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const e=this._renderer.elem;e.parentNode.removeChild(e)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};S(nn,"Properties",["src","loaded","repeat","scale","offset","image"]),S(nn,"RegularExpressions",$l),S(nn,"ImageRegistry",new Wr),S(nn,"Register",{canvas:function(t,e){t._src="#"+t.id,nn.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(s){!Nt.isHeadless&&n.removeEventListener&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",o,!1)),typeof e=="function"&&e()},o=function(s){throw!Nt.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",o,!1)),new It("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!Nt.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",o,!1)),t._src=nn.getAbsoluteURL(t._src),!(!Nt.isHeadless&&n&&n.getAttribute("two-src"))&&(Nt.isHeadless||n.setAttribute("two-src",t.src),nn.ImageRegistry.add(t.src,n),Nt.isHeadless?nn.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(Nt.isHeadless)throw new It("video textures are not implemented in headless environments.");const n=function(o){t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),t.image.width=t.image.videoWidth,t.image.height=t.image.videoHeight,typeof e=="function"&&e()},r=function(o){throw t.image.removeEventListener("canplaythrough",n,!1),t.image.removeEventListener("error",r,!1),new It("unable to load "+t.src)};t._src=nn.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),nn.ImageRegistry.add(t.src,t.image)),t.image.readyState>=4?n():(t.image.addEventListener("canplaythrough",n,!1),t.image.addEventListener("error",r,!1),t.image.src=t.src,t.image.load())}});var Oe=nn,Rl={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Oe.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Oe.ImageRegistry.contains(n)?this._image=Oe.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(Q.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(Q.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof re&&this._scale.unbind(Q.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof re&&this._scale.bind(Q.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Mg(){this._flagOffset=!0}function Ag(){this._flagScale=!0}var ts=class un extends Di{constructor(e,n,r){super(),S(this,"_flagOffset",!0),S(this,"_flagOpacity",!0),S(this,"_flagColor",!0),S(this,"_offset",0),S(this,"_opacity",1),S(this,"_color","#fff");for(let o in El)Object.defineProperty(this,o,El[o]);this._renderer.type="stop",this.offset=typeof e=="number"?e:un.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:un.Index<=0?"#fff":"#000",un.Index=(un.Index+1)%2}static fromObject(e){const n=new un().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<un.Properties.length;n++){const r=un.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new un;return ie.each(un.Properties,function(r){n[r]=this[r]},this),e&&e.stops&&e.stops.push(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="stop",ie.each(un.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};S(ts,"Index",0),S(ts,"Properties",["offset","opacity","color"]);var Xn=ts,El={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},ns=class Ri extends Di{constructor(e){super(),S(this,"_flagStops",!1),S(this,"_flagSpread",!1),S(this,"_flagUnits",!1),S(this,"_spread",""),S(this,"_units","");for(let n in Pl)Object.defineProperty(this,n,Pl[n]);this._renderer.type="gradient",this._renderer.flagStops=Ig.bind(this),this._renderer.bindStops=Og.bind(this),this._renderer.unbindStops=zg.bind(this),this.spread="pad",this.units="objectBoundingBox",e&&(this.stops=e)}static fromObject(e){let n=e.stops;n&&n.length>0&&(n=n.map(o=>o instanceof Xn?o:new Xn().copy(o)));const r=new Ri(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(o=>o.clone()),r=new Ri(n);return ie.each(Ri.Properties,o=>{r[o]=this[o]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Ri.Properties.length;n++){const r=Ri.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return ie.each(Ri.Properties,n=>{e[n]=this[n]},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}};S(ns,"Stop",Xn),S(ns,"Properties",["spread","stops","units"]);var at=ns,Pl={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),this._stops=new qn((t||[]).slice(0)),this._stops.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._stops)}}};function Ig(){this._flagStops=!0}function Og(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function zg(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var is=class Mr extends at{constructor(e,n,r,o,s){super(s),S(this,"_flagEndPoints",!1),S(this,"_left",null),S(this,"_right",null);for(let a in Fl)Object.defineProperty(this,a,Fl[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Dg.bind(this),this.left=new re,this.right=new re,typeof e=="number"&&(this.left.x=e),typeof n=="number"&&(this.left.y=n),typeof r=="number"&&(this.right.x=r),typeof o=="number"&&(this.right.y=o)}static fromObject(e){const n=new Mr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mr.Properties.length;n++){const r=Mr.Properties[n];r in e&&(this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]))}return this}clone(e){const n=this.stops.map(function(o){return o.clone()}),r=new Mr(this.left._x,this.left._y,this.right._x,this.right._y,n);return ie.each(at.Properties,function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};S(is,"Stop",Xn),S(is,"Properties",["left","right"]);var Ue=is,Fl={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof re&&this._left.unbind(Q.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof re&&this._right.unbind(Q.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(Q.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Dg(){this._flagEndPoints=!0}var rs=class Ei extends at{constructor(e,n,r,o,s,a){super(o),S(this,"_flagRadius",!1),S(this,"_flagCenter",!1),S(this,"_flagFocal",!1),S(this,"_radius",0),S(this,"_center",null),S(this,"_focal",null);for(let l in Vl)Object.defineProperty(this,l,Vl[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Lg.bind(this),this._renderer.flagFocal=Hg.bind(this),this.center=new re,this.radius=typeof r=="number"?r:1,this.focal=new re,typeof e=="number"&&(this.center.x=e),typeof n=="number"&&(this.center.y=n),this.focal.copy(this.center),typeof s=="number"&&(this.focal.x=s),typeof a=="number"&&(this.focal.y=a)}static fromObject(e){const n=new Ei().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ei.Properties.length;n++){const r=Ei.Properties[n];r in e&&(/(center|focal)i/.test(r)?this[r]=e[r]instanceof re?e[r]:new re().copy(e[r]):typeof e[r]=="number"&&(this[r]=e[MediaKeySystemAccess]))}return this}clone(e){const n=this.stops.map(function(o){return o.clone()}),r=new Ei(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return ie.each(at.Properties.concat(Ei.Properties),function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return ie.each(Ei.Properties,function(n){e[n]=this[n]},this),e.center=this.center.toObject(),e.focal=this.focal.toObject(),e}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(Q.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};S(rs,"Stop",Xn),S(rs,"Properties",["center","radius","focal"]);var Ke=rs,Vl={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(Q.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(Q.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(Q.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(Q.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Lg(){this._flagCenter=!0}function Hg(){this._flagFocal=!0}function Ml(t,e){if(e===0||e===1)return!0;const r=t._length*e;let o=0;for(let s=0;s<t._lengths.length;s++){const a=t._lengths[s];if(o>=r)return r-o>=0;o+=a}return!1}function qr(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,o=0;r<t._lengths.length;r++){if(o+t._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/t._lengths[r];o+=t._lengths[r]}return-1}function Al(t,e,n){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),xl(r,l,o,c,s,d,a,u,n)}function Il(t,e,n){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Qo(r,l,o,c,s,d,a,u,n)}function ci(t){switch(t.renderer.type){case"texture":return Oe.fromObject(t);case"gradient":return at.fromObject(t);case"linear-gradient":return Ue.fromObject(t);case"radial-gradient":return Ke.fromObject(t)}return t}var Wg=Math.cos,jg=Math.sin,Ol=Math.tan,os=[],zl=class Yt extends Q{constructor(e,n,r,o,s,a){super(),S(this,"elements",new hn(9)),S(this,"manual",!1);let l=e;Array.isArray(l)||(l=Array.prototype.slice.call(arguments)),this.identity(),l.length>0&&this.set(l)}static Multiply(e,n,r){if(n.length<=3){const $=e;let w,v,k;const B=n[0]||0,R=n[1]||0,E=n[2]||0;return w=$[0]*B+$[1]*R+$[2]*E,v=$[3]*B+$[4]*R+$[5]*E,k=$[6]*B+$[7]*R+$[8]*E,[w,v,k]}const o=e[0],s=e[1],a=e[2],l=e[3],c=e[4],d=e[5],u=e[6],h=e[7],f=e[8],g=n[0],m=n[1],p=n[2],b=n[3],y=n[4],_=n[5],C=n[6],x=n[7],N=n[8];return r=r||new hn(9),r[0]=o*g+s*b+a*C,r[1]=o*m+s*y+a*x,r[2]=o*p+s*_+a*N,r[3]=l*g+c*b+d*C,r[4]=l*m+c*y+d*x,r[5]=l*p+c*_+d*N,r[6]=u*g+h*b+f*C,r[7]=u*m+h*y+f*x,r[8]=u*p+h*_+f*N,r}static fromObject(e){return new Yt().copy(e)}set(e,n,r,o,s,a,l,c,d){if(typeof n>"u"){const u=e;e=u[0],n=u[1],r=u[2],o=u[3],s=u[4],a=u[5],l=u[6],c=u[7],d=u[8]}return this.elements[0]=e,this.elements[1]=n,this.elements[2]=r,this.elements[3]=o,this.elements[4]=s,this.elements[5]=a,this.elements[6]=l,this.elements[7]=c,this.elements[8]=d,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]=Yt.Identity[0],this.elements[1]=Yt.Identity[1],this.elements[2]=Yt.Identity[2],this.elements[3]=Yt.Identity[3],this.elements[4]=Yt.Identity[4],this.elements[5]=Yt.Identity[5],this.elements[6]=Yt.Identity[6],this.elements[7]=Yt.Identity[7],this.elements[8]=Yt.Identity[8],this.trigger(Q.Types.change)}multiply(e,n,r,o,s,a,l,c,d){if(typeof n>"u")return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(Q.Types.change);if(typeof r>"u"&&(r=1),typeof o>"u"){e=e||0,n=n||0,r=r||0,s=this.elements;const W=s[0]*e+s[1]*n+s[2]*r,I=s[3]*e+s[4]*n+s[5]*r,Z=s[6]*e+s[7]*n+s[8]*r;return[W,I,Z]}const u=this.elements,h=[e,n,r,o,s,a,l,c,d],f=u[0],g=u[1],m=u[2],p=u[3],b=u[4],y=u[5],_=u[6],C=u[7],x=u[8],N=h[0],$=h[1],w=h[2],v=h[3],k=h[4],B=h[5],R=h[6],E=h[7],P=h[8];return this.elements[0]=f*N+g*v+m*R,this.elements[1]=f*$+g*k+m*E,this.elements[2]=f*w+g*B+m*P,this.elements[3]=p*N+b*v+y*R,this.elements[4]=p*$+b*k+y*E,this.elements[5]=p*w+b*B+y*P,this.elements[6]=_*N+C*v+x*R,this.elements[7]=_*$+C*k+x*E,this.elements[8]=_*w+C*B+x*P,this.trigger(Q.Types.change)}inverse(e){const n=this.elements;e=e||new Yt;const r=n[0],o=n[1],s=n[2],a=n[3],l=n[4],c=n[5],d=n[6],u=n[7],h=n[8],f=h*l-c*u,g=-h*a+c*d,m=u*a-l*d;let p=r*f+o*g+s*m;return p?(p=1/p,e.elements[0]=f*p,e.elements[1]=(-h*o+s*u)*p,e.elements[2]=(c*o-s*l)*p,e.elements[3]=g*p,e.elements[4]=(h*r-s*d)*p,e.elements[5]=(-c*r+s*a)*p,e.elements[6]=m*p,e.elements[7]=(-u*r+o*d)*p,e.elements[8]=(l*r-o*a)*p,e):null}scale(e,n){return arguments.length<=1&&(n=e),this.multiply(e,0,0,0,n,0,0,0,1)}rotate(e){const n=Wg(e),r=jg(e);return this.multiply(n,-r,0,r,n,0,0,0,1)}translate(e,n){return this.multiply(1,0,e,0,1,n,0,0,1)}skewX(e){const n=Ol(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=Ol(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return os.length=0,this.toTransformArray(e,os),os.map(Ie).join(" ")}toTransformArray(e,n){const r=this.elements,o=!!n,s=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],g=r[8];if(o){n[0]=s,n[1]=c,n[2]=h,n[3]=a,n[4]=d,n[5]=f,n[6]=l,n[7]=u,n[8]=g;return}return[s,c,h,a,d,f,l,u,g]}if(o){n[0]=s,n[1]=c,n[2]=a,n[3]=d,n[4]=l,n[5]=u;return}return[s,c,a,d,l,u]}toArray(e,n){const r=this.elements,o=!!n,s=r[0],a=r[1],l=r[2],c=r[3],d=r[4],u=r[5];if(e){const h=r[6],f=r[7],g=r[8];if(o){n[0]=s,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u,n[6]=h,n[7]=f,n[8]=g;return}return[s,a,l,c,d,u,h,f,g]}if(o){n[0]=s,n[1]=a,n[2]=l,n[3]=c,n[4]=d,n[5]=u;return}return[s,a,l,c,d,u]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Yt().copy(this)}};S(zl,"Identity",[1,0,0,0,1,0,0,0,1]);var Li=zl;yl(Li);var Dl=class Ya extends Di{constructor(){super(),S(this,"_flagMatrix",!0),S(this,"_flagScale",!1),S(this,"_matrix",null),S(this,"_worldMatrix",null),S(this,"_position",null),S(this,"_rotation",0),S(this,"_scale",1),S(this,"_skewX",0),S(this,"_skewY",0);for(let e in Xr)Object.defineProperty(this,e,Xr[e]);this._renderer.flagMatrix=Ll.bind(this),this.isShape=!0,this.matrix=new Li,this.worldMatrix=new Li,this.position=new re,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new Ya().copy(e);return"id"in e&&(n.id=e.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return Xr.position.get.apply(this,arguments)}set translation(e){Xr.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 re?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 re?e.scale:new re(e.scale.x,e.scale.y)),"skewX"in e&&(this.skewX=e.skewX),"skewY"in e&&(this.skewY=e.skewY),"matrix"in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(e){const n=new Ya;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer={type:"shape"},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof re?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 re?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}};S(Dl,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var Yn=Dl,Xr={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(Q.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(Q.Types.change,this._renderer.flagMatrix),Ll.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof re&&this._scale.unbind(Q.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof re&&this._scale.bind(Q.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Go(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Ll(){this._flagMatrix=!0}var Hi=Math.min,Wi=Math.max,qg=Math.ceil,Xg=Math.floor,Yg=new re,ss=class ri extends Yn{constructor(e,n,r,o){super(),S(this,"_flagVertices",!0),S(this,"_flagLength",!0),S(this,"_flagFill",!0),S(this,"_flagStroke",!0),S(this,"_flagLinewidth",!0),S(this,"_flagOpacity",!0),S(this,"_flagVisible",!0),S(this,"_flagCap",!0),S(this,"_flagJoin",!0),S(this,"_flagMiter",!0),S(this,"_flagStrokeAttenuation",!0),S(this,"_flagMask",!1),S(this,"_flagClip",!1),S(this,"_length",0),S(this,"_fill","#fff"),S(this,"_stroke","#000"),S(this,"_linewidth",1),S(this,"_opacity",1),S(this,"_visible",!0),S(this,"_cap","round"),S(this,"_join","round"),S(this,"_miter",4),S(this,"_closed",!0),S(this,"_curved",!1),S(this,"_automatic",!0),S(this,"_beginning",0),S(this,"_ending",1),S(this,"_mask",null),S(this,"_clip",!1),S(this,"_dashes",null),S(this,"_strokeAttenuation",!0);for(let s in Hl)Object.defineProperty(this,s,Hl[s]);this._renderer.type="path",this._renderer.flagVertices=Wl.bind(this),this._renderer.bindVertices=jl.bind(this),this._renderer.unbindVertices=ql.bind(this),this._renderer.flagFill=Xl.bind(this),this._renderer.flagStroke=Yl.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!n,this.curved=!!r,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.cap="butt",this.join="miter",this.miter=4,this.vertices=e,this.automatic=!o,this.dashes=[],this.dashes.offset=0}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),o=new ri().copy(Ko(Uo({},e),{fill:n,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){if(super.copy.call(this,e),e.vertices){this.vertices=[];for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof Be?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Be().copy(r))}}for(let n=0;n<ri.Properties.length;n++){const r=ri.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new ri;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<ri.Properties.length;r++){const o=ri.Properties[r];n[o]=this[o]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="path",e.vertices=this.vertices.map(n=>n.toObject()),ie.each(ri.Properties,n=>{typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind=="function"&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind=="function"&&n.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const e=this.getBoundingClientRect(!0),n=e.width/2,r=e.height/2,o=e.left+e.width/2,s=e.top+e.height/2;for(let a=0;a<this.vertices.length;a++){const l=this.vertices[a];l.x-=o,l.y-=s,l.x+=n,l.y+=r}return this.mask&&(this.mask.translation.x-=o,this.mask.translation.x+=n,this.mask.translation.y-=s,this.mask.translation.y+=r),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let o=0;o<this.vertices.length;o++){const s=this.vertices[o];s.x-=n,s.y-=r}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getBoundingClientRect(e){let n,r,o,s,a,l,c=1/0,d=-1/0,u=1/0,h=-1/0;if(this._update(!0),n=e?this.matrix:this.worldMatrix,r=(this.linewidth||0)/2,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}=li(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof f=="number"&&typeof g=="number"&&(r=Math.max(f,g)*(this.linewidth||0)/2)}else r*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(o<=0)return{width:0,height:0};for(s=0;s<o;s++){l=this._renderer.vertices[s],a=this._renderer.vertices[(s+o-1)%o];const[f,g]=n.multiply(a.x,a.y),[m,p]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let b=a.controls.right.x,y=a.controls.right.y;a.relative&&(b+=a.x,y+=a.y);let[_,C]=n.multiply(b,y),x=l.controls.left.x,N=l.controls.left.y;l.relative&&(x+=l.x,N+=l.y);let[$,w]=n.multiply(x,N);const v=kl(f,g,_,C,$,w,m,p);u=Hi(v.min.y-r,u),c=Hi(v.min.x-r,c),d=Wi(v.max.x+r,d),h=Wi(v.max.y+r,h)}else s<=1&&(u=Hi(g-r,u),c=Hi(f-r,c),d=Wi(f+r,d),h=Wi(g+r,h)),u=Hi(p-r,u),c=Hi(m-r,c),d=Wi(m+r,d),h=Wi(p+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}getPointAt(e,n){let r,o,s,a,l,c,d,u,h,f,g,m,p,b,y,_=this.length*Math.min(Math.max(e,0),1);const C=this.vertices.length,x=C-1;let N=null,$=null;for(let te=0,D=this._lengths.length,L=0;te<D;te++){if(L+this._lengths[te]>=_){this._closed?(r=Lt(te,C),o=Lt(te-1,C),te===0&&(r=o,o=te)):(r=te,o=Math.min(Math.max(te-1,0),x)),N=this.vertices[r],$=this.vertices[o],_-=L,this._lengths[te]!==0?e=_/this._lengths[te]:e=0;break}L+=this._lengths[te]}if(N===null||$===null)return null;if(N){if(!$)return N}else return $;y=$.controls&&$.controls.right,b=N.controls&&N.controls.left,l=$.x,f=$.y,c=(y||$).x,g=(y||$).y,d=(b||N).x,m=(b||N).y,u=N.x,p=N.y,y&&$.relative&&(c+=$.x,g+=$.y),b&&N.relative&&(d+=N.x,m+=N.y),a=hr(e,l,c,d,u),h=hr(e,f,g,m,p);const w=Dt(l,c,e),v=Dt(f,g,e),k=Dt(c,d,e),B=Dt(g,m,e),R=Dt(d,u,e),E=Dt(m,p,e),P=Dt(w,k,e),W=Dt(v,B,e),I=Dt(k,R,e),Z=Dt(B,E,e);return ie.isObject(n)?(n.x=a,n.y=h,n instanceof Be&&(n.controls.left.x=P,n.controls.left.y=W,n.controls.right.x=I,n.controls.right.y=Z,(typeof n.relative!="boolean"||n.relative)&&(n.controls.left.x-=a,n.controls.left.y-=h,n.controls.right.x-=a,n.controls.right.y-=h)),n.t=e,n):(s=new Be(a,h,P-a,W-h,I-a,Z-h,this._curved?oe.curve:oe.line),s.t=e,s)}plot(){if(this.curved)return Cl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?oe.move:oe.line;return this}subdivide(e){this._update();const n=this.vertices.length-1,r=this._closed||this.vertices[n]._command===oe.close;let o=this.vertices[n],s=[],a;return ie.each(this.vertices,function(l,c){if(c<=0&&!r){o=l;return}if(l.command===oe.move){s.push(new Be(o.x,o.y)),c>0&&(s[s.length-1].command=oe.line),o=l;return}a=Il(l,o,e),s=s.concat(a),ie.each(a,function(d,u){u<=0&&o.command===oe.move?d.command=oe.move:d.command=oe.line}),c>=n&&(this._closed&&this._automatic&&(o=l,a=Il(l,o,e),s=s.concat(a),ie.each(a,function(d,u){u<=0&&o.command===oe.move?d.command=oe.move:d.command=oe.line})),s.push(new Be(l.x,l.y)),s[s.length-1].command=r?oe.close:oe.line),o=l},this),this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(e,n){n||this._update();const o=this.vertices.length-1;let s=this.vertices[o],a=0;return typeof this._lengths>"u"&&(this._lengths=[]),ie.each(this.vertices,function(l,c){if(c<=0||l.command===oe.move){s=l,this._lengths[c]=0;return}this._lengths[c]=Al(l,s,e),a+=this._lengths[c],s=l},this),this._length=a,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);const e=this._collection.length,n=this._closed,r=Math.min(this._beginning,this._ending),o=Math.max(this._beginning,this._ending),s=qr(this,r*this._length),a=qr(this,o*this._length),l=qg(s),c=Xg(a);let d,u,h,f,g,m;for(this._renderer.vertices.length=0,m=0;m<e;m++)this._renderer.collection.length<=m&&this._renderer.collection.push(new Be),m>c&&!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,h=this._collection[m-1],h&&h.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),h.relative?this._renderer.collection[m-1].controls.right.copy(h.controls.right).lerp(re.zero,1-g.t):this._renderer.collection[m-1].controls.right.copy(h.controls.right).lerp(h,1-g.t))):m>=l&&m<=c&&(g=this._renderer.collection[m].copy(this._collection[m]),this._renderer.vertices.push(g),m===c&&Ml(this,o)?(u=g,!n&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):m===l&&Ml(this,r)&&(d=g,d.command=oe.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(m=l-1,g=this._renderer.collection[m].copy(this._collection[m]),this.getPointAt(r,g),g.command=oe.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(re.zero,g.t):(Yg.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=this._flagStrokeAttenuation=!1,Yn.prototype.flagReset.call(this),this}};S(ss,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),S(ss,"Utils",{getCurveLength:Al});var $e=ss,Hl={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";ie.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Wl(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function jl(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ql(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Xl(){this._flagFill=!0}function Yl(){this._flagStroke=!0}var Ul=class Ar extends $e{constructor(e,n,r,o){const s=[new Be,new Be,new Be,new Be];super(s,!0,!1,!0),S(this,"_flagWidth",!1),S(this,"_flagHeight",!1),S(this,"_width",0),S(this,"_height",0),S(this,"_origin",null),this._renderer.type="rectangle";for(let a in Kl)Object.defineProperty(this,a,Kl[a]);this.width=typeof r=="number"?r:1,this.height=typeof o=="number"?o:1,this.origin=new re,typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n),this._update()}static fromObject(e){const n=new Ar().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ar.Properties.length;n++){const r=Ar.Properties[n];r in e&&(typeof e[r]=="number"?this[r]=e[r]:this[r]instanceof re&&this[r].copy(e[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const e=this._width/2,n=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Be),this.vertices[0].set(-e,-n).sub(this._origin).command=oe.move,this.vertices[1].set(e,-n).sub(this._origin).command=oe.line,this.vertices[2].set(e,n).sub(this._origin).command=oe.line,this.vertices[3].set(-e,n).sub(this._origin).command=oe.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=oe.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Ar(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<$e.Properties.length;r++){const o=$e.Properties[r];n[o]instanceof re?n[o].copy(this[o]):n[o]=this[o]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="rectangle",e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};S(Ul,"Properties",["width","height","origin"]);var Un=Ul,Kl={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(Q.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(Q.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Gl=class Ir extends Un{constructor(e,n,r,o,s,a){super(n,r,0,0),S(this,"_flagTexture",!1),S(this,"_flagColumns",!1),S(this,"_flagRows",!1),S(this,"_flagFrameRate",!1),S(this,"_flagIndex",!1),S(this,"_amount",1),S(this,"_duration",0),S(this,"_startTime",0),S(this,"_playing",!1),S(this,"_firstFrame",0),S(this,"_lastFrame",0),S(this,"_loop",!0),S(this,"_texture",null),S(this,"_columns",1),S(this,"_rows",1),S(this,"_frameRate",0),S(this,"_index",0),S(this,"_origin",null),this._renderer.type="sprite";for(let l in Zl)Object.defineProperty(this,l,Zl[l]);this.noStroke(),this.noFill(),e instanceof Oe?this.texture=e:typeof e=="string"&&(this.texture=new Oe(e)),this.origin=new re,this._update(),typeof o=="number"&&(this.columns=o),typeof s=="number"&&(this.rows=s),typeof a=="number"&&(this.frameRate=a),this.index=0}static fromObject(e){const n=new Ir().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ir.Properties.length;n++){const r=Ir.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ie.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(e){const n=new Ir(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="sprite",e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture,n=this._columns,r=this._rows;let o,s,a,l,c,d,u,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)){u=e.image.width,h=e.image.height,o=u/n,s=h/r,l=this._amount,this.width!==o&&(this.width=o),this.height!==s&&(this.height=s),this._playing&&this._frameRate>0&&(ie.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=ie.performance.now()-this._startTime,f=this._lastFrame+1,c=1e3*(f-this._firstFrame)/this._frameRate,this._loop?a=a%c:a=Math.min(a,c),d=Dt(this._firstFrame,f,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const g=this._index%n,m=Math.floor(this._index/n),p=-o*g+(u-o)/2,b=-s*m+(h-s)/2;p!==e.offset.x&&(e.offset.x=p),b!==e.offset.y&&(e.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};S(Gl,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var Yr=Gl,Zl={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},as,Ql=class extends qn{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),fl(this,as,{}),this.attach(e),this.on(Q.Types.insert,this.attach),this.on(Q.Types.remove,this.detach)}get ids(){return At(this,as)}attach(e){for(let n=0;n<e.length;n++){const r=e[n];r&&r.id&&(this.ids[r.id]=r)}return this}detach(e){for(let n=0;n<e.length;n++)delete this.ids[e[n].id];return this}};as=new WeakMap;var Jl=class Pi extends $e{constructor(e,n,r,o,s,a,l){const c=l||$t.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new Be);super(d,!0,!1,!0),S(this,"_flagStartAngle",!1),S(this,"_flagEndAngle",!1),S(this,"_flagInnerRadius",!1),S(this,"_flagOuterRadius",!1),S(this,"_startAngle",0),S(this,"_endAngle",yt),S(this,"_innerRadius",0),S(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in ec)Object.defineProperty(this,u,ec[u]);typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.startAngle=s),typeof a=="number"&&(this.endAngle=a),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Pi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const e=this._startAngle,n=this._endAngle,r=this._innerRadius,o=this._outerRadius,s=Lt(e,yt)===Lt(n,yt),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,f,g,m,p,b,y,_,C;for(s?c--:a||(c-=2),h=0,f=c-1;h<c;h++){switch(g=h/f,m=l[u],p=g*(n-e)+e,b=(n-e)/c,y=o*Math.cos(p),_=o*Math.sin(p),h){case 0:d=oe.move;break;default:d=oe.curve}m.command=d,m.x=y,m.y=_,m.controls.left.clear(),m.controls.right.clear(),m.command===oe.curve&&(C=o*b/Math.PI,m.controls.left.x=C*Math.cos(p-st),m.controls.left.y=C*Math.sin(p-st),m.controls.right.x=C*Math.cos(p+st),m.controls.right.y=C*Math.sin(p+st),h===1&&m.controls.left.multiplyScalar(2),h===f&&m.controls.right.multiplyScalar(2)),u++}if(a){for(s?(l[u].command=oe.close,u++):(c--,f=c-1),h=0;h<c;h++)g=h/f,m=l[u],p=(1-g)*(n-e)+e,b=(n-e)/c,y=r*Math.cos(p),_=r*Math.sin(p),d=oe.curve,h<=0&&(d=s?oe.move:oe.line),m.command=d,m.x=y,m.y=_,m.controls.left.clear(),m.controls.right.clear(),m.command===oe.curve&&(C=r*b/Math.PI,m.controls.left.x=C*Math.cos(p+st),m.controls.left.y=C*Math.sin(p+st),m.controls.right.x=C*Math.cos(p-st),m.controls.right.y=C*Math.sin(p-st),h===1&&m.controls.left.multiplyScalar(2),h===f&&m.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=oe.line}else s||(l[u].command=oe.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[u].command=oe.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(e){const n=this.innerRadius,r=this.outerRadius,o=this.startAngle,s=this.endAngle,a=this.vertices.length,l=new Pi(0,0,n,r,o,s,a);l.translation.copy(this.translation),l.rotation=this.rotation,l.scale=this.scale,l.skewX=this.skewX,l.skewY=this.skewY,this.matrix.manual&&l.matrix.copy(this.matrix);for(let c=0;c<$e.Properties.length;c++){const d=$e.Properties[c];l[d]=this[d]}return e&&e.add(l),l}toObject(){const e=super.toObject.call(this);e.renderer.type="arc-segment";for(let n=0;n<Pi.Properties.length;n++){const r=Pi.Properties[n];e[r]=this[r]}return e}};S(Jl,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var ls=Jl,ec={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},cs=Math.cos,ds=Math.sin,tc=class Fi extends $e{constructor(e,n,r,o){const s=o?Math.max(o,2):4,a=[];for(let l=0;l<s;l++)a.push(new Be(0,0,0,0,0,0));super(a,!0,!0,!0),S(this,"_flagRadius",!1),S(this,"_radius",0),this._renderer.type="circle";for(let l in nc)Object.defineProperty(this,l,nc[l]);typeof r=="number"&&(this.radius=r),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Fi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(e*2)),r=this._radius,o=r*n;for(let s=0;s<this.vertices.length;s++){const l=s/e*yt,c=r*cs(l),d=r*ds(l),u=o*cs(l-st),h=o*ds(l-st),f=o*cs(l+st),g=o*ds(l+st),m=this.vertices[s];m.command=s===0?oe.move:oe.curve,m.set(c,d),m.controls.left.set(u,h),m.controls.right.set(f,g)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Fi(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<$e.Properties.length;r++){const o=$e.Properties[r];n[o]=this[o]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="circle";for(let n=0;n<Fi.Properties.length;n++){const r=Fi.Properties[n];e[r]=this[r]}return e}};S(tc,"Properties",["radius"]);var Ur=tc,nc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},us=Math.cos,hs=Math.sin,ic=class Vi extends $e{constructor(e,n,r,o,s){typeof o!="number"&&typeof r=="number"&&(o=r);const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Be);super(l,!0,!0,!0),S(this,"_flagWidth",!1),S(this,"_flagHeight",!1),S(this,"_width",0),S(this,"_height",0),this._renderer.type="ellipse";for(let c in rc)Object.defineProperty(this,c,rc[c]);typeof r=="number"&&(this.width=r*2),typeof o=="number"&&(this.height=o*2),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Vi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Vi.Properties.length;n++){const r=Vi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&(e-=1);const n=4/3*Math.tan(Math.PI/(this.vertices.length*2)),r=this._width/2,o=this._height/2;for(let s=0;s<this.vertices.length;s++){const l=s/e*yt,c=r*us(l),d=o*hs(l),u=r*n*us(l-st),h=o*n*hs(l-st),f=r*n*us(l+st),g=o*n*hs(l+st),m=this.vertices[s];m.command=s===0?oe.move:oe.curve,m.set(c,d),m.controls.left.set(u,h),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(e){const n=this.width/2,r=this.height/2,o=this.vertices.length,s=new Vi(0,0,n,r,o);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 a=0;a<$e.Properties.length;a++){const l=$e.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="ellipse";for(let n=0;n<Vi.Properties.length;n++){const r=Vi.Properties[n];e[r]=this[r]}return e}};S(ic,"Properties",["width","height"]);var Kr=ic,rc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Ug=Math.ceil,Kg=Math.floor,oc=class oi extends Yn{constructor(e){super(),S(this,"_flagVertices",!0),S(this,"_flagLength",!0),S(this,"_flagFill",!0),S(this,"_flagStroke",!0),S(this,"_flagLinewidth",!0),S(this,"_flagOpacity",!0),S(this,"_flagVisible",!0),S(this,"_flagSize",!0),S(this,"_flagSizeAttenuation",!0),S(this,"_flagStrokeAttenuation",!0),S(this,"_length",0),S(this,"_fill","#fff"),S(this,"_stroke","#000"),S(this,"_linewidth",1),S(this,"_opacity",1),S(this,"_visible",!0),S(this,"_size",1),S(this,"_sizeAttenuation",!1),S(this,"_beginning",0),S(this,"_ending",1),S(this,"_dashes",null),S(this,"_strokeAttenuation",!0),S(this,"noFill",$e.prototype.noFill),S(this,"noStroke",$e.prototype.noStroke),S(this,"corner",$e.prototype.corner),S(this,"center",$e.prototype.center),S(this,"getBoundingClientRect",$e.prototype.getBoundingClientRect),S(this,"_updateLength",$e.prototype._updateLength);for(let n in sc)Object.defineProperty(this,n,sc[n]);this._renderer.type="points",this._renderer.flagVertices=Wl.bind(this),this._renderer.bindVertices=jl.bind(this),this._renderer.unbindVertices=ql.bind(this),this._renderer.flagFill=Xl.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 n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),o=new oi().copy(Ko(Uo({},e),{fill:n,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){super.copy.call(this,e);for(let n=0;n<e.vertices.length;n++){const r=e.vertices[n];r instanceof Be?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Be().copy(r))}for(let n=0;n<oi.Properties.length;n++){const r=oi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new oi;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<oi.Properties.length;r++){const o=oi.Properties[r];n[o]=this[o]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="points",e.vertices=this.vertices.map(n=>n.toObject()),ie.each(oi.Properties,function(n){typeof this[n]<"u"&&(this[n].toObject?e[n]=this[n].toObject():e[n]=this[n])},this),e}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){const n=this.vertices[e];typeof n.unbind=="function"&&n.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(e){this._update();let n=[];for(let r=0;r<this.vertices.length;r++){const o=this.vertices[r],s=this.vertices[r-1];if(!s)continue;const a=o.x,l=o.y,c=s.x,d=s.y,u=Qo(a,l,a,l,c,d,c,d,e);n=n.concat(u)}return this.vertices=n,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const e=Math.min(this._beginning,this._ending),n=Math.max(this._beginning,this._ending),r=qr(this,e*this._length),o=qr(this,n*this._length),s=Ug(r),a=Kg(o);let l=0,c;this._renderer.vertices=[],this._renderer.collection=[];for(let d=0;d<this._collection.length;d++)d>=s&&d<=a&&(c=this._collection[d],this._renderer.collection.push(c),this._renderer.vertices[l*2+0]=c.x,this._renderer.vertices[l*2+1]=c.y,l++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};S(oc,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var fs=oc,sc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),t instanceof qn?this._collection=t:this._collection=new qn(t||[]),this._collection.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},Gg=Math.cos,Zg=Math.sin,ac=class Mi extends $e{constructor(e,n,r,o){o=Math.max(o||0,3),super(),S(this,"_flagWidth",!1),S(this,"_flagHeight",!1),S(this,"_flagSides",!1),S(this,"_radius",0),S(this,"_width",0),S(this,"_height",0),S(this,"_sides",0),this._renderer.type="polygon";for(let s in lc)Object.defineProperty(this,s,lc[s]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.radius=r),typeof o=="number"&&(this.sides=o),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Mi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const e=this._sides,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let o=0;o<n;o++){const s=(o+.5)/e,a=yt*s+Math.PI/2,l=this._width*Gg(a)/2,c=this._height*Zg(a)/2;o>=r?this.vertices.push(new Be(l,c)):this.vertices[o].set(l,c),this.vertices[o].command=o===0?oe.move:oe.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=new Mi(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let r=0;r<$e.Properties.length;r++){const o=$e.Properties[r];n[o]=this[o]}return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);e.renderer.type="polygon";for(let n=0;n<Mi.Properties.length;n++){const r=Mi.Properties[n];e[r]=this[r]}return e}};S(ac,"Properties",["width","height","sides"]);var ms=ac,lc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},cc=class Ai extends $e{constructor(e,n,r,o,s){typeof s>"u"&&typeof r=="number"&&typeof o=="number"&&(s=Math.floor(Math.min(r,o)/12));const a=[];for(let l=0;l<10;l++)a.push(new Be(0,0,0,0,0,0,l===0?oe.move:oe.curve));super(a),S(this,"_flagWidth",!1),S(this,"_flagHeight",!1),S(this,"_flagRadius",!1),S(this,"_width",0),S(this,"_height",0),S(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in dc)Object.defineProperty(this,l,dc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Qg.bind(this),typeof r=="number"&&(this.width=r),typeof o=="number"&&(this.height=o),(typeof s=="number"||s instanceof re)&&(this.radius=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ai().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];if(r in e){const o=e[r];/radius/i.test(r)?this[r]=typeof o=="number"||o instanceof re?o:new re().copy(o):typeof o=="number"&&(this[r]=o)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const e=this._width,n=this._height;let r,o;this._radius instanceof re?(r=this._radius.x,o=this._radius.y):(r=this._radius,o=this._radius);let s,a=e/2,l=n/2;s=this.vertices[0],s.x=-(a-r),s.y=-l,s=this.vertices[1],s.x=a-r,s.y=-l,s.controls.left.clear(),s.controls.right.x=r,s.controls.right.y=0,s=this.vertices[2],s.x=a,s.y=-(l-o),s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[3],s.x=a,s.y=l-o,s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=o,s=this.vertices[4],s.x=a-r,s.y=l,s.controls.right.clear(),s.controls.left.clear(),s=this.vertices[5],s.x=-(a-r),s.y=l,s.controls.left.clear(),s.controls.right.x=-r,s.controls.right.y=0,s=this.vertices[6],s.x=-a,s.y=l-o,s.controls.left.clear(),s.controls.right.clear(),s=this.vertices[7],s.x=-a,s.y=-(l-o),s.controls.left.clear(),s.controls.right.x=0,s.controls.right.y=-o,s=this.vertices[8],s.x=-(a-r),s.y=-l,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 n=this.width,r=this.height,o=this.radius,s=new Ai(0,0,n,r,o);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 a=0;a<$e.Properties.length;a++){const l=$e.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="rounded-rectangle";for(let n=0;n<Ai.Properties.length;n++){const r=Ai.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};S(cc,"Properties",["width","height","radius"]);var Gr=cc,dc={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof re&&this._radius.unbind(Q.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof re&&this._radius.bind(Q.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Qg(){this._flagRadius=!0}var Jg=Math.cos,ep=Math.sin,uc=class Ii extends $e{constructor(e,n,r,o,s){arguments.length<=3&&(o=r,r=o/2),(typeof s!="number"||s<=0)&&(s=5),super(),S(this,"_flagInnerRadius",!1),S(this,"_flagOuterRadius",!1),S(this,"_flagSides",!1),S(this,"_innerRadius",0),S(this,"_outerRadius",0),S(this,"_sides",0),this._renderer.type="star";for(let a in hc)Object.defineProperty(this,a,hc[a]);this.closed=!0,this.automatic=!1,typeof r=="number"&&(this.innerRadius=r),typeof o=="number"&&(this.outerRadius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof e=="number"&&(this.translation.x=e),typeof n=="number"&&(this.translation.y=n)}static fromObject(e){const n=new Ii().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Ii.Properties.length;n++){const r=Ii.Properties[n];r in e&&typeof e[r]=="number"&&(this[r]=e[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const e=this._sides*2,n=e+1;let r=this.vertices.length;r>e&&(this.vertices.splice(e-1,r-e),r=e);for(let o=0;o<n;o++){const s=(o+.5)/e,a=yt*s,l=(o%2?this._outerRadius:this._innerRadius)/2,c=l*Jg(a),d=l*ep(a);o>=r?this.vertices.push(new Be(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?oe.move:oe.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(e){const n=this.innerRadius,r=this.outerRadius,o=this.sides,s=new Ii(0,0,n,r,o);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 a=0;a<$e.Properties.length;a++){const l=$e.Properties[a];s[l]=this[l]}return e&&e.add(s),s}toObject(){const e=super.toObject.call(this);e.renderer.type="star";for(let n=0;n<Ii.Properties.length;n++){const r=Ii.Properties[n];e[r]=this[r]}return e}};S(uc,"Properties",["innerRadius","outerRadius","sides"]);var gs=uc,hc={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},ps,fc=Math.min,mc=Math.max;Ye.document&&(ps=document.createElement("canvas"));var ys=class Ut extends Yn{constructor(e,n,r,o){super(),S(this,"_flagValue",!0),S(this,"_flagFamily",!0),S(this,"_flagSize",!0),S(this,"_flagLeading",!0),S(this,"_flagAlignment",!0),S(this,"_flagBaseline",!0),S(this,"_flagStyle",!0),S(this,"_flagWeight",!0),S(this,"_flagDecoration",!0),S(this,"_flagFill",!0),S(this,"_flagStroke",!0),S(this,"_flagLinewidth",!0),S(this,"_flagOpacity",!0),S(this,"_flagVisible",!0),S(this,"_flagMask",!1),S(this,"_flagClip",!1),S(this,"_flagDirection",!0),S(this,"_flagStrokeAttenuation",!0),S(this,"_value",""),S(this,"_family","sans-serif"),S(this,"_size",13),S(this,"_leading",17),S(this,"_alignment","center"),S(this,"_baseline","middle"),S(this,"_style","normal"),S(this,"_weight",500),S(this,"_decoration","none"),S(this,"_direction","ltr"),S(this,"_fill","#000"),S(this,"_stroke","none"),S(this,"_linewidth",1),S(this,"_opacity",1),S(this,"_visible",!0),S(this,"_mask",null),S(this,"_clip",!1),S(this,"_dashes",null),S(this,"_strokeAttenuation",!0);for(let s in gc)Object.defineProperty(this,s,gc[s]);if(this._renderer.type="text",this._renderer.flagFill=tp.bind(this),this._renderer.flagStroke=np.bind(this),this.value=e,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!ie.isObject(o))return this;for(let s=0;s<Ut.Properties.length;s++){const a=Ut.Properties[s];a in o&&(this[a]=o[a])}}static Measure(e){if(ps){const n=ps.getContext("2d");n.font=[e._style,e._weight,`${e._size}px/${e._leading}px`,e._family].join(" ");const r=n.measureText(e.value,0,0),o=r.actualBoundingBoxDescent+r.actualBoundingBoxAscent;return{width:r.width,height:o}}else{const n=this.value.length*this.size*Ut.Ratio,r=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:n,height:r}}}static fromObject(e){const n=typeof e.fill=="string"?e.fill:ci(e.fill),r=typeof e.stroke=="string"?e.stroke:ci(e.stroke),o=new Ut().copy(Ko(Uo({},e),{fill:n,stroke:r}));return"id"in e&&(o.id=e.id),o}copy(e){super.copy.call(this,e);for(let n=0;n<Ut.Properties.length;n++){const r=Ut.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Ut(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<Ut.Properties.length;r++){const o=Ut.Properties[r];n[o]=this[o]}return this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);e.renderer.type="text";for(let n=0;n<Ut.Properties.length;n++){const r=Ut.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(e){let n,r,o,s,a;this._update(!0),n=e?this.matrix:this.worldMatrix;const{width:l,height:c}=Ut.Measure(this),d=(this._linewidth||0)/2;switch(this.alignment){case"left":r=-d,o=l+d;break;case"right":r=-(l+d),o=d;break;default:r=-(l/2+d),o=l/2+d}switch(this.baseline){case"middle":s=-(c/2+d),a=c/2+d;break;default:s=-(c+d),a=d}const[u,h]=n.multiply(r,s),[f,g]=n.multiply(r,a),[m,p]=n.multiply(o,s),[b,y]=n.multiply(o,a);return s=fc(h,g,p,y),r=fc(u,f,m,b),o=mc(u,f,m,b),a=mc(h,g,p,y),{top:s,left:r,right:o,bottom:a,width:o-r,height:a-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}};S(ys,"Ratio",.6),S(ys,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var mn=ys,gc={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.unbind(Q.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof at||this._fill instanceof Ue||this._fill instanceof Ke||this._fill instanceof Oe)&&this._fill.bind(Q.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.unbind(Q.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof at||this._stroke instanceof Ue||this._stroke instanceof Ke||this._stroke instanceof Oe)&&this._stroke.bind(Q.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function tp(){this._flagFill=!0}function np(){this._flagStroke=!0}var bs=class rr extends Un{constructor(e,n,r,o){super(n,r,0,0),S(this,"_flagTextures",!1),S(this,"_flagFrameRate",!1),S(this,"_flagIndex",!1),S(this,"_amount",1),S(this,"_duration",0),S(this,"_index",0),S(this,"_startTime",0),S(this,"_playing",!1),S(this,"_firstFrame",0),S(this,"_lastFrame",0),S(this,"_loop",!0),S(this,"_textures",null),S(this,"_frameRate",0),S(this,"_origin",null),this._renderer.type="image-sequence";for(let s in pc)Object.defineProperty(this,s,pc[s]);this._renderer.flagTextures=ip.bind(this),this._renderer.bindTextures=rp.bind(this),this._renderer.unbindTextures=op.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(yc.bind(this)):typeof e=="string"&&(this.textures=[yc(e)]),this.origin=new re,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=rr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new rr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<rr.Properties.length;n++){const r=rr.Properties[n];r in e&&(this[r]=e[r])}return this}play(e,n,r){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=ie.performance.now(),typeof e=="number"&&(this._firstFrame=e),typeof n=="number"&&(this._lastFrame=n),typeof r=="function"?this._onLastFrame=r:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(e){const n=new rr(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image-sequence",e.textures=this.textures.map(function(n){return n.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){const n=this.textures[e];typeof n.dispose=="function"?n.dispose():typeof n.unbind=="function"&&n.unbind()}return this}_update(){const e=this._textures;let n,r,o,s,a,l,c,d;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(s=this._amount,ie.isNaN(this._lastFrame)&&(this._lastFrame=s-1),o=ie.performance.now()-this._startTime,d=this._lastFrame+1,a=1e3*(d-this._firstFrame)/this._frameRate,this._loop?o=o%a:o=Math.min(o,a),c=Dt(this._firstFrame,d,o/a),c=Math.floor(c),c!==this._index&&(this._index=c,l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r),this.fill=l,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Oe))&&(l=e[this._index],l.loaded&&(n=l.image.width,r=l.image.height,this.width!==n&&(this.width=n),this.height!==r&&(this.height=r)),this.fill=l)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};S(bs,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),S(bs,"DefaultFrameRate",30);var _s=bs,pc={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(Q.Types.insert,e).unbind(Q.Types.remove,n),this._textures=new qn((t||[]).slice(0)),this._textures.bind(Q.Types.insert,e).bind(Q.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function ip(){this._flagTextures=!0}function rp(t){let e=t.length;for(;e--;)t[e].bind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function op(t){let e=t.length;for(;e--;)t[e].unbind(Q.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function yc(t){if(t instanceof Oe)return t;if(typeof t=="string")return new Oe(t)}var Zr=Math.min,Qr=Math.max,ws=class si extends Yn{constructor(e){super(),S(this,"_flagAdditions",!1),S(this,"_flagSubtractions",!1),S(this,"_flagOrder",!1),S(this,"_flagOpacity",!0),S(this,"_flagBeginning",!1),S(this,"_flagEnding",!1),S(this,"_flagLength",!1),S(this,"_flagMask",!1),S(this,"_fill","#fff"),S(this,"_stroke","#000"),S(this,"_linewidth",1),S(this,"_opacity",1),S(this,"_visible",!0),S(this,"_cap","round"),S(this,"_join","round"),S(this,"_miter",4),S(this,"_closed",!0),S(this,"_curved",!1),S(this,"_automatic",!0),S(this,"_beginning",0),S(this,"_ending",1),S(this,"_length",0),S(this,"_mask",null),S(this,"_strokeAttenuation",!0);for(let n in bc)Object.defineProperty(this,n,bc[n]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let n=0;n<e.length;n++)_c.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)_c.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new si;for(let o=0;o<si.Properties.length;o++){const s=si.Properties[o];s in e&&(/(fill|stroke)/i.test(s)?n[s]=typeof e[s]=="string"?e[s]:ci(e[s]):n[s]=e[s])}return"mask"in e&&(n.mask=r(e.mask)),"id"in e&&(n.id=e.id),n.children=e.children.map(r),n;function r(o){if(o&&o.renderer)switch(o.renderer.type){case"arc-segment":return ls.fromObject(o);case"circle":return Ur.fromObject(o);case"element":return Di.fromObject(o);case"ellipse":return Kr.fromObject(o);case"group":return si.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return _s.fromObject(o);case"path":return $e.fromObject(o);case"points":return fs.fromObject(o);case"polygon":return ms.fromObject(o);case"rectangle":return Un.fromObject(o);case"rounded-rectangle":return Gr.fromObject(o);case"shape":return Yn.fromObject(o);case"sprite":return Yr.fromObject(o);case"star":return gs.fromObject(o);case"text":return mn.fromObject(o)}return o}}copy(e){super.copy.call(this,e),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let n=0;n<si.Properties.length;n++){const r=si.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new si,r=this.children.map(function(o){return o.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),e&&e.add(n),n._update()}toObject(){const e=super.toObject.call(this);return e.renderer.type="group",e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,ie.each(this.children,(n,r)=>{e.children[r]=n.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){const n=this.children[e];typeof n.dispose=="function"&&n.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const e=this.getBoundingClientRect(!0);for(let n=0;n<this.children.length;n++){const r=this.children[n];r.translation.x-=e.left,r.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){const e=this.getBoundingClientRect(!0),n=e.left+e.width/2-this.translation.x,r=e.top+e.height/2-this.translation.y;for(let o=0;o<this.children.length;o++){const s=this.children[o];s.isShape&&(s.translation.x-=n,s.translation.y-=r)}return this.mask&&(this.mask.translation.x-=n,this.mask.translation.y-=r),this}getById(e){let n=null;function r(o){if(o.id===e)return o;if(o.children){if(o.children.ids[e])return o.children.ids[e];for(let s=0;s<o.children.length;s++)if(n=r(o.children[s]),n)return n}return null}return r(this)}getByClassName(e){const n=[];function r(o){if(Array.prototype.indexOf.call(o.classList,e)>=0&&n.push(o),o.children)for(let s=0;s<o.children.length;s++){const a=o.children[s];r(a)}return n}return r(this)}getByType(e){const n=[];function r(o){if(o instanceof e&&n.push(o),o.children)for(let s=0;s<o.children.length;s++){const a=o.children[s];r(a)}return n}return r(this)}add(e){e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let n=0;n<e.length;n++){const r=e[n];if(!(r&&r.id))continue;const o=Array.prototype.indexOf.call(this.children,r);o>=0&&this.children.splice(o,1),this.children.push(r)}return this}remove(e){const n=arguments.length,r=this.parent;if(n<=0&&r)return r.remove(this),this;e instanceof Array?e=e.slice():e=Array.prototype.slice.call(arguments);for(let o=0;o<e.length;o++){const s=e[o];if(!s||!this.children.ids[s.id])continue;const a=this.children.indexOf(s);a>=0&&this.children.splice(a,1)}return this}getBoundingClientRect(e){let n,r,o,s,a,l;this._update(!0);let c=1/0,d=-1/0,u=1/0,h=-1/0;const f=/texture|gradient/i;r=e?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))&&(n=m.getBoundingClientRect(e),o=typeof n.top!="number"||ie.isNaN(n.top)||!isFinite(n.top),s=typeof n.left!="number"||ie.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||ie.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||ie.isNaN(n.bottom)||!isFinite(n.bottom),!(o||s||a||l)))if(e){const[p,b]=r.multiply(n.left,n.top),[y,_]=r.multiply(n.right,n.top),[C,x]=r.multiply(n.left,n.bottom),[N,$]=r.multiply(n.right,n.bottom);u=Zr(b,_,x,$,u),c=Zr(p,y,C,N,c),d=Qr(p,y,C,N,d),h=Qr(b,_,x,$,h)}else u=Zr(n.top,u),c=Zr(n.left,c),d=Qr(n.right,d),h=Qr(n.bottom,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){const e=arguments;return this.children.forEach(function(n){n.subdivide.apply(n,e)}),this}_update(){let e,n,r;if(this._flagBeginning||this._flagEnding){const o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),a=this.length;let l=0;const c=o*a,d=s*a;for(e=0;e<this.children.length;e++)r=this.children[e],n=r.length,c>l+n?(r.beginning=1,r.ending=1):d<l?(r.beginning=0,r.ending=0):c>l&&c<l+n?(r.beginning=(c-l)/n,r.ending=1):d>l&&d<l+n?(r.beginning=0,r.ending=(d-l)/n):(r.beginning=0,r.ending=1),l+=n}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&(this.additions.length=0,this._flagAdditions=!1),this._flagSubtractions&&(this.subtractions.length=0,this._flagSubtractions=!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};S(ws,"Children",Ql),S(ws,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var ut=ws,bc={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=ut.InsertChildren.bind(this),n=ut.RemoveChildren.bind(this),r=ut.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Ql(t),this._children.bind(Q.Types.insert,e),this._children.bind(Q.Types.remove,n),this._children.bind(Q.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,ie.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function _c(t,e){const n=t.parent;let r;if(n===e){o();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),s()),e){o();return}s(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function o(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function s(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}var Jr=class extends $e{constructor(e,n,r,o){const s=[new Be(e,n),new Be(r,o)];super(s);for(let a in wc)Object.defineProperty(this,a,wc[a]);this.vertices[0].command=oe.move,this.vertices[1].command=oe.line,this.automatic=!1}};S(Jr,"Properties",["left","right"]);var wc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(ie.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=oe.move;else{const e=new It("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(ie.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=oe.line;else{const e=new It("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},gn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},sp={start:"left",middle:"center",end:"right"},xc=["id","class","transform","xmlns","viewBox"],ap=["x","y","width","height","href","xlink:href"];function lp(t){return sp[t]}function cp(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function fr(t){return t.replace(/svg:/gi,"").toLowerCase()}function kc(t,e){if(e.x+=t.translateX,e.y+=t.translateY,e.x*=t.scaleX,e.y*=t.scaleY,t.rotation!==0){const n=e.length();e.x=n*Math.cos(t.rotation),e.y=n*Math.sin(t.rotation)}}function dp(t,e){e||(e={});const n=t.split(";");for(let r=0;r<n.length;r++){const o=n[r].split(":"),s=o[0],a=o[1];if(typeof s>"u"||typeof a>"u")continue;const l=s.replace(/\s/g,""),c=a.replace(/\s/g,"");e[l]=c}return e}function up(t){const e={},n=hp(t),r=Math.max(n.length,t.style.length);for(let o=0;o<r;o++){const s=t.style[o],a=n[o];s&&(e[s]=t.style[s]),a&&(e[a]=t.getAttribute(a))}return e}function hp(t){const e=t.getAttributeNames();for(let n=0;n<xc.length;n++){const r=xc[n],o=Array.prototype.indexOf.call(e,r);o>=0&&e.splice(o,1)}return e}function fp(t,e){const n=e.split(/[\s,]/),r=-parseFloat(n[0]),o=-parseFloat(n[1]),s=parseFloat(n[2]),a=parseFloat(n[3]);if(r&&o)for(let h=0;h<t.children.length;h++){const f=t.children[h];"translation"in f?f.translation.add(r,o):"x"in f?f.x=r:"y"in f&&(f.y=o)}const l=typeof t.x=="number",c=typeof t.y=="number",d=typeof t.width=="number",u=typeof t.height=="number";return l&&(t.translation.x+=t.x),c&&(t.translation.y+=t.y),(d||u)&&(t.scale=new re(1,1)),d&&(t.scale.x=t.width/s),u&&(t.scale.y=t.height/a),t.mask=new Un(0,0,s,a),t.mask.origin.set(-s/2,-a/2),t}function Kt(t,e,n){const r={},o={},s={};let a,l,c,d,u,h,f,g,m,p,b,y,_,C,x,N,$;if(t===null)return r;if(Ye.getComputedStyle){const w=Ye.getComputedStyle(t);for(a=w.length;a--;)c=w[a],d=w[c],typeof d<"u"&&(r[c]=d)}for(a=0;a<t.attributes.length;a++)h=t.attributes[a],/style/i.test(h.nodeName)?dp(h.value,s):o[h.nodeName]=h.value;typeof r.opacity<"u"&&(r["stroke-opacity"]=r.opacity,r["fill-opacity"]=r.opacity,delete r.opacity),n&&ie.defaults(r,n),ie.extend(r,s,o),r.visible=!(typeof r.display>"u"&&/none/i.test(r.display))||typeof r.visibility>"u"&&/hidden/i.test(r.visibility);for(c in r)switch(d=r[c],c){case"gradientTransform":if(/none/i.test(d)||(l=t.gradientTransform&&t.gradientTransform.baseVal&&t.gradientTransform.baseVal.length>0?t.gradientTransform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;switch(f=li(l),e._renderer.type){case"linear-gradient":kc(f,e.left),kc(f,e.right);break;case"radial-gradient":e.center.x+=f.translateX,e.center.y+=f.translateY,e.focal.x+=f.translateX,e.focal.y+=f.translateY,e.radius*=Math.max(f.scaleX,f.scaleY);break}break;case"transform":if(/none/i.test(d)||(l=t.transform&&t.transform.baseVal&&t.transform.baseVal.length>0?t.transform.baseVal[0].matrix:t.getCTM?t.getCTM():null,l===null))break;f=li(l),e.translation.set(f.translateX,f.translateY),e.rotation=Math.PI*(f.rotation/180),e.scale=new re(f.scaleX,f.scaleY),g=parseFloat((r.x+"").replace("px")),m=parseFloat((r.y+"").replace("px")),g&&(e.translation.x=g),m&&(e.translation.y=m);break;case"visible":if(e instanceof ut){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof ut){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof ut){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof ut){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof ut){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof ut){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(gn.cssBackgroundImage.test(d)&&(p=d.replace(gn.cssBackgroundImage,"$1"),Xe.defs.current&&Xe.defs.current.contains(p)&&(y=Xe.defs.current.get(p),y&&y.childNodes.length>0)))switch(y=y.childNodes[0],_=fr(y.nodeName),e.mask=Xe[_].call(this,y,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":u=(e instanceof ut?"_":"")+c,gn.cssBackgroundImage.test(d)?(p=d.replace(gn.cssBackgroundImage,"$1"),Xe.defs.current&&Xe.defs.current.contains(p)?(y=Xe.defs.current.get(p),y.object||(_=fr(y.nodeName),y.object=Xe[_].call(this,y,{})),y=y.object):(b=gp(this),y=b.getById(p)),e[u]=y):e[u]=d;break;case"id":e.id=d;break;case"class":case"className":e.classList=d.split(" "),e._flagClassName=!0;break;case"x":case"y":if(C=e instanceof at,x=e instanceof Ue,N=e instanceof Ke,C||x||N)break;d.match("[a-z%]$")&&!d.endsWith("px")&&($=new It("only pixel values are supported with the "+c+" attribute."),console.warn($.name,$.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof mn&&(e.family=d);break;case"font-size":e instanceof mn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&($=new It("only pixel values are supported with the "+c+" attribute."),console.warn($.name,$.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof mn&&(e.weight=d);break;case"font-style":e instanceof mn&&(e.style=d);break;case"text-decoration":e instanceof mn&&(e.decoration=d);break;case"line-height":e instanceof mn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function mp(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const o=t.childNodes[n];!o.id||fr(t.nodeName)==="#text"||e.add(o.id,o)}}function gp(t){for(;t.parent;)t=t.parent;return t.scene}var Xe={svg:function(t){const e=Xe.defs.current=new Wr,n=t.getElementsByTagName("defs");for(let m=0;m<n.length;m++)mp(n[m],e);const r=Xe.g.call(this,t),o=t.getAttribute("viewBox"),s=t.getAttribute("x"),a=t.getAttribute("y"),l=t.getAttribute("width"),c=t.getAttribute("height");r.defs=e;const d=o!==null,u=s!==null,h=a!==null,f=l!==null,g=c!==null;return u&&(r.x=parseFloat(s.replace(gn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(gn.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(gn.unitSuffix,""))),g&&(r.height=parseFloat(c.replace(gn.unitSuffix,""))),d&&fp(r,o),delete Xe.defs.current,r},defs:function(t){return null},use:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new It("encountered <use /> with no href."),console.warn(n.name,n.message),null;const o=r.slice(1);if(!Xe.defs.current.contains(o))return n=new It("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=Xe.defs.current.get(o).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=ap.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=fr(a.nodeName);return Xe[l].call(this,a,e)},g:function(t,e){const n=new ut;Kt.call(this,t,n,e),this.add(n);const r=up.call(this,t);for(let o=0,s=t.childNodes.length;o<s;o++){const a=t.childNodes[o],l=a.nodeName;if(!l)return;const c=fr(l);if(c in Xe){const d=Xe[c].call(n,a,r);d&&!d.parent&&n.add(d)}}return n},polygon:function(t,e){let n;typeof t=="string"?n=t:n=t.getAttribute("points");const r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(s,a,l){r.push(new Be(parseFloat(a),parseFloat(l)))});const o=new $e(r,!0);return o.stroke="none",o.fill="black",Kt.call(this,t,o,e),o},polyline:function(t,e){const n=Xe.polygon.call(this,t,e);return n.closed=!1,n},path:function(t,e){let n;typeof t=="string"?(n=t,t=null):n=t.getAttribute("d");let r=[],o=!1,s=!1;if(n){let l=new Be,c,d,u=n.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;ie.each(u.slice(0),function(f,g){const m=f.slice(1).trim().match(gn.path),p=f[0],b=p.toLowerCase();let y,_,C,x,N;const $=[];switch(g===0&&(u=[]),b){case"h":case"v":m.length>1&&(y=1);break;case"m":case"l":case"t":m.length>2&&(y=2);break;case"s":case"q":m.length>4&&(y=4);break;case"c":m.length>6&&(y=6);break;case"a":m.length>7&&(y=7);break}if(y){for(_=0,C=m.length,N=0;_<C;_+=y){if(x=p,N>0)switch(p){case"m":x="l";break;case"M":x="L";break}$.push(x+m.slice(_,_+y).join(" ")),N++}u=Array.prototype.concat.apply(u,$)}else u.push(f)}),ie.each(u,function(f,g){let m,p,b;const y=f[0],_=y.toLowerCase();d=f.slice(1).trim().match(gn.path),s=y===_;let C,x,N,$,w,v,k,B,R,E,P,W,I,Z,te,D,L;switch(_){case"z":if(g>=h)o=!0;else{p=l.x,b=l.y,m=new Be(p,b,void 0,void 0,void 0,void 0,oe.close);for(let H=r.length-1;H>=0;H--){const z=r[H];if(/m/i.test(z.command)){l=z;break}}}break;case"m":case"l":c=void 0,p=parseFloat(d[0]),b=parseFloat(d[1]),m=new Be(p,b,void 0,void 0,void 0,void 0,/m/i.test(_)?oe.move:oe.line),s&&m.addSelf(l),l=m;break;case"h":case"v":E=/h/i.test(_)?"x":"y",P=/x/i.test(E)?"y":"x",m=new Be(void 0,void 0,void 0,void 0,void 0,void 0,oe.line),m[E]=parseFloat(d[0]),m[P]=l[P],s&&(m[E]+=l[E]),l=m;break;case"c":case"s":C=l.x,x=l.y,c||(c=new re),/c/i.test(_)?(N=parseFloat(d[0]),$=parseFloat(d[1]),w=parseFloat(d[2]),v=parseFloat(d[3]),k=parseFloat(d[4]),B=parseFloat(d[5])):(R=Jo(l,c,s),N=R.x,$=R.y,w=parseFloat(d[0]),v=parseFloat(d[1]),k=parseFloat(d[2]),B=parseFloat(d[3])),s&&(N+=C,$+=x,w+=C,v+=x,k+=C,B+=x),l.controls.right.set(N-l.x,$-l.y),m=new Be(k,B,w-k,v-B,void 0,void 0,oe.curve),l=m,c=m.controls.left;break;case"t":case"q":C=l.x,x=l.y,c||(c=new re),/q/i.test(_)?(N=parseFloat(d[0]),$=parseFloat(d[1]),w=parseFloat(d[0]),v=parseFloat(d[1]),k=parseFloat(d[2]),B=parseFloat(d[3])):(R=Jo(l,c,s),N=R.x,$=R.y,w=R.x,v=R.y,k=parseFloat(d[0]),B=parseFloat(d[1])),s&&(N+=C,$+=x,w+=C,v+=x,k+=C,B+=x),l.controls.right.set((N-l.x)*.33,($-l.y)*.33),m=new Be(k,B,w-k,v-B,void 0,void 0,oe.curve),l=m,c=m.controls.left;break;case"a":C=l.x,x=l.y,I=parseFloat(d[0]),Z=parseFloat(d[1]),te=parseFloat(d[2]),D=parseFloat(d[3]),L=parseFloat(d[4]),k=parseFloat(d[5]),B=parseFloat(d[6]),s&&(k+=C,B+=x),W=new Be(k,B),W.command=oe.arc,W.rx=I,W.ry=Z,W.xAxisRotation=te,W.largeArcFlag=D,W.sweepFlag=L,m=W,l=W,c=void 0;break}m&&(Array.isArray(m)?r=r.concat(m):r.push(m))})}n=new $e(r,o,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},ie.each(n.vertices,function(l){l.subSelf(a.centroid)}),Kt.call(this,t,n,e),n.translation.addSelf(a.centroid),n},circle:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("r")),s=new Ur(0,0,o);return s.stroke="none",s.fill="black",Kt.call(this,t,s,e),s.translation.x=n,s.translation.y=r,s},ellipse:function(t,e){const n=parseFloat(t.getAttribute("cx")),r=parseFloat(t.getAttribute("cy")),o=parseFloat(t.getAttribute("rx")),s=parseFloat(t.getAttribute("ry")),a=new Kr(0,0,o,s);return a.stroke="none",a.fill="black",Kt.call(this,t,a,e),a.translation.x=n,a.translation.y=r,a},rect:function(t,e){const n=parseFloat(t.getAttribute("rx")),r=parseFloat(t.getAttribute("ry"));if(!ie.isNaN(n)||!ie.isNaN(r))return Xe["rounded-rect"](t);const o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=o/2,l=s/2,c=new Un(0,0,o,s);return c.stroke="none",c.fill="black",Kt.call(this,t,c,e),c.translation.x+=a,c.translation.y+=l,c},"rounded-rect":function(t,e){const n=parseFloat(t.getAttribute("rx"))||0,r=parseFloat(t.getAttribute("ry"))||0,o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=o/2,l=s/2,c=new re(n,r),d=new Gr(0,0,o,s,c);return d.stroke="none",d.fill="black",Kt.call(this,t,d,e),d.translation.x+=a,d.translation.y+=l,d},line:function(t,e){const n=parseFloat(t.getAttribute("x1")),r=parseFloat(t.getAttribute("y1")),o=parseFloat(t.getAttribute("x2")),s=parseFloat(t.getAttribute("y2")),a=new Jr(n,r,o,s).noFill();return Kt.call(this,t,a,e),a},lineargradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let o=parseFloat(t.getAttribute("x1")||0),s=parseFloat(t.getAttribute("y1")||0),a=parseFloat(t.getAttribute("x2")||0),l=parseFloat(t.getAttribute("y2")||0);const c=(a+o)/2,d=(l+s)/2;/userSpaceOnUse/i.test(n)&&(o-=c,s-=d,a-=c,l-=d);const u=[];for(let f=0;f<t.children.length;f++){const g=t.children[f];let m=g.getAttribute("offset");/%/gi.test(m)&&(m=parseFloat(m.replace(/%/gi,""))/100),m=parseFloat(m);let p=g.getAttribute("stop-color"),b=g.getAttribute("stop-opacity"),y=g.getAttribute("style"),_;p===null&&(_=y?y.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,p=_&&_.length>1?_[1]:void 0),b===null?(_=y?y.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=_&&_.length>1?parseFloat(_[1]):1):b=parseFloat(b),u.push(new Xn(m,p,b))}const h=new Ue(o,s,a,l,u);return h.spread=r,h.units=n,Kt.call(this,t,h,e),h},radialgradient:function(t,e){let n=t.getAttribute("gradientUnits"),r=t.getAttribute("spreadMethod");n||(n="objectBoundingBox"),r||(r="pad");let o=parseFloat(t.getAttribute("cx"))||0,s=parseFloat(t.getAttribute("cy"))||0,a=parseFloat(t.getAttribute("r")),l=parseFloat(t.getAttribute("fx")),c=parseFloat(t.getAttribute("fy"));ie.isNaN(l)&&(l=o),ie.isNaN(c)&&(c=s);const d=Math.abs(o+l)/2,u=Math.abs(s+c)/2;/userSpaceOnUse/i.test(n)&&(o-=d,s-=u,l-=d,c-=u);const h=[];for(let g=0;g<t.children.length;g++){const m=t.children[g];let p=m.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let b=m.getAttribute("stop-color"),y=m.getAttribute("stop-opacity"),_=m.getAttribute("style"),C;b===null&&(C=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,b=C&&C.length>1?C[1]:void 0),y===null?(C=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=C&&C.length>1?parseFloat(C[1]):1):y=parseFloat(y),h.push(new Xn(p,b,y))}const f=new Ke(o,s,a,h,l,c);return f.spread=r,f.units=n,Kt.call(this,t,f,e),f},text:function(t,e){const n=lp(t.getAttribute("text-anchor"))||"left",r=cp(t)||"baseline";let o="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?o=t.childNodes[0].textContent:o=t.textContent;const s=new mn(o);return Kt.call(this,t,s,e),s.alignment=n,s.baseline=r,s},clippath:function(t,e){return Xe.defs.current&&!Xe.defs.current.contains(t.id)&&Xe.defs.current.add(t.id,t),null},image:function(t,e){let n;const r=t.getAttribute("href")||t.getAttribute("xlink:href");if(!r)return n=new It("encountered <image /> with no href."),console.warn(n.name,n.message),null;const o=parseFloat(t.getAttribute("x"))||0,s=parseFloat(t.getAttribute("y"))||0,a=parseFloat(t.getAttribute("width")),l=parseFloat(t.getAttribute("height")),c=new Yr(r,o,s);return ie.isNaN(a)||(c.width=a),ie.isNaN(l)||(c.height=l),Kt.call(this,t,c,e),c}};function vc(t,e){const n=new XMLHttpRequest;return n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&e(n.responseText)},n.send(),n}var xs=class Tn extends Un{constructor(e,n,r,o,s,a){super(n,r,o||1,s||1),S(this,"_flagTexture",!1),S(this,"_flagMode",!1),S(this,"_texture",null),S(this,"_mode","fill"),this._renderer.type="image";for(let l in Sc)Object.defineProperty(this,l,Sc[l]);this.noStroke(),this.noFill(),e instanceof Oe?this.texture=e:typeof e=="string"&&(this.texture=new Oe(e)),typeof a=="string"&&(this.mode=a),this._update()}static fromObject(e){const n=new Tn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Tn.Properties.length;n++){const r=Tn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Tn(this.texture,this.translation.x,this.translation.y,this.width,this.height);return e&&e.add(n),n}toObject(){const e=super.toObject.call(this);return e.renderer.type="image",e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const e=this._texture;if(e&&(this._flagTexture&&(this.fill=e),e.loaded)){const n=e.image.width,r=e.image.height,o=this.width,s=this.height,a=o/n,l=s/r;switch(this._mode){case Tn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Tn.Modes.fit:{const c=Math.min(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="no-repeat";break}case Tn.Modes.crop:break;case Tn.Modes.tile:{e.offset.x=(n-o)/2,e.offset.y=(r-s)/2,e.repeat="repeat";break}case Tn.Modes.stretch:default:e.scale=new re(a,l),e.offset.x=0,e.offset.y=0,e.repeat="repeat"}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};S(xs,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),S(xs,"Properties",["texture","mode"]);var Cc=xs,Sc={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(t){this._mode=t,this._flagMode=!0}}},ks=[],vs=Math.max,pp=Math.min,Bc=Math.abs,eo=Math.sin,to=Math.cos,yp=Math.acos,no=Math.sqrt,Ee={isHidden:/(undefined|none|transparent)/i,alignments:{left:"start",middle:"center",right:"end"},baselines:{top:"top",middle:"middle",bottom:"bottom",baseline:"alphabetic"},getRendererType:function(t){return t in Ee?t:"path"},group:{renderChild:function(t){const e=Ee.getRendererType(t._renderer.type);Ee[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);const r=this._mask,o=io(e),s=!o||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=t,s&&(t.save(),o||t.transform(e[0],e[3],e[1],e[4],e[2],e[5])),r){const a=Ee.getRendererType(r._renderer.type);Ee[a].render.call(r,t,!0)}if(this._opacity>0&&this._scale!==0)for(let a=0;a<this.children.length;a++){const l=this.children[a],c=Ee.getRendererType(l._renderer.type);Ee[c].render.call(l,t)}return s&&t.restore(),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t,e,n){let r,o,s,a,l,c,d,u,h,f,g,m,p,b,y,_,C,x,N,$,w,v,k,B,R,E,P,W,I,Z,te,D,L,H;if(H=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,I=this._mask,Z=this._clip,l=this._opacity*(H||1),c=this._visible,!e&&(!c||Z||l===0))return this;if(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,a=this._fill,d=this._cap,u=this._join,h=this._miter,f=this._closed,g=this._renderer.vertices,m=g.length,p=m-1,te=io(r),L=this.dashes,te||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),I){const ee=Ee.getRendererType(I._renderer.type);Ee[ee].render.call(I,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const ee=Ee.getRendererType(a._renderer.type);Ee[ee].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const ee=Ee.getRendererType(o._renderer.type);Ee[ee].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=fn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!f&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),L&&L.length>0&&(t.lineDashOffset=L.offset||0,t.setLineDash(L)),t.beginPath();let z,O,U,K,V,q,Y;for(let ee=0;ee<m;ee++)switch(_=g[ee],P=_.x,W=_.y,_.command){case oe.close:t.closePath();break;case oe.arc:z=_.rx,O=_.ry,U=_.xAxisRotation,K=_.largeArcFlag,V=_.sweepFlag,b=f?Lt(ee-1,m):vs(ee-1,0),y=g[b],q=y.x,Y=y.y,Ee.renderSvgArcCommand(t,q,Y,z,O,K,V,U,P,W);break;case oe.curve:b=f?Lt(ee-1,m):Math.max(ee-1,0),y=g[b],k=y.controls&&y.controls.right||re.zero,B=_.controls&&_.controls.left||re.zero,y._relative?(w=k.x+y.x,v=k.y+y.y):(w=k.x,v=k.y),_._relative?(N=B.x+_.x,$=B.y+_.y):(N=B.x,$=B.y),t.bezierCurveTo(w,v,N,$,P,W),ee>=p&&f&&(C=x,R=_.controls&&_.controls.right||re.zero,E=C.controls&&C.controls.left||re.zero,_._relative?(w=R.x+_.x,v=R.y+_.y):(w=R.x,v=R.y),C._relative?(N=E.x+C.x,$=E.y+C.y):(N=E.x,$=E.y),P=C.x,W=C.y,t.bezierCurveTo(w,v,N,$,P,W));break;case oe.line:t.lineTo(P,W);break;case oe.move:x=_,t.moveTo(P,W);break}return f&&t.closePath(),!Z&&!n&&(Ee.isHidden.test(a)||(D=a._renderer&&a._renderer.offset,D&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),D&&t.restore()),Ee.isHidden.test(o)||(D=o._renderer&&o._renderer.offset,D&&(t.save(),t.translate(-o._renderer.offset.x,-o._renderer.offset.y),t.scale(o._renderer.scale.x,o._renderer.scale.y),t.lineWidth=s/o._renderer.scale.x),t.stroke(),D&&t.restore())),te||t.restore(),Z&&!n&&t.clip(),L&&L.length>0&&t.setLineDash(ks),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t,e,n){let r,o,s,a,l,c,d,u,h,f,g,m,p,b,y,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,o=this._stroke,s=this._linewidth,a=this._fill,u=this._renderer.collection,h=u.length,p=io(r),y=this.dashes,d=this._size,p||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const N=Ee.getRendererType(a._renderer.type);Ee[N].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const N=Ee.getRendererType(o._renderer.type);Ee[N].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=fn(this))}typeof l=="number"&&(t.globalAlpha=l),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),t.beginPath();let C=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=li(x[0],x[3],x[1],x[4],x[2],x[5]),C/=Math.max(x.scaleX,x.scaleY));for(let N=0;N<h;N++)f=u[N],g=f.x,m=f.y,t.moveTo(g+C,m),t.arc(g,m,C,0,yt);return n||(Ee.isHidden.test(a)||(b=a._renderer&&a._renderer.offset,b&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),b&&t.restore()),Ee.isHidden.test(o)||(b=o._renderer&&o._renderer.offset,b&&(t.save(),t.translate(-o._renderer.offset.x,-o._renderer.offset.y),t.scale(o._renderer.scale.x,o._renderer.scale.y),t.lineWidth=s/o._renderer.scale.x),t.stroke(),b&&t.restore())),p||t.restore(),y&&y.length>0&&t.setLineDash(ks),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t,e,n){const r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,o=this._opacity*r,s=this._visible,a=this._mask,l=this._clip;if(!e&&(!s||l||o===0))return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const c=this._matrix.elements,d=this._stroke,u=this._linewidth,h=this._fill,f=this._decoration,g=this._direction,m=io(c),p=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,b=this.dashes,y=Ee.alignments[this._alignment]||this._alignment,_=Ee.baselines[this._baseline]||this._baseline;let C,x,N,$,w,v,k,B,R,E,P;if(m||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const W=Ee.getRendererType(a._renderer.type);Ee[W].render.call(a,t,!0)}if(p||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=y,t.textBaseline=_,t.direction=g,h)if(typeof h=="string")t.fillStyle=h;else{const W=Ee.getRendererType(h._renderer.type);Ee[W].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const W=Ee.getRendererType(d._renderer.type);Ee[W].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=fn(this))}if(typeof o=="number"&&(t.globalAlpha=o),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),!l&&!n&&(Ee.isHidden.test(h)||(h._renderer&&h._renderer.offset?(v=h._renderer.scale.x,k=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(v,k),C=this._size/h._renderer.scale.y,x=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,C+"px/",x+"px",this._family].join(" "),N=h._renderer.offset.x/h._renderer.scale.x,$=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,N,$),t.restore()):t.fillText(this.value,0,0)),Ee.isHidden.test(d)||(d._renderer&&d._renderer.offset?(v=d._renderer.scale.x,k=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(v,k),C=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,C+"px/",x+"px",this._family].join(" "),N=d._renderer.offset.x/d._renderer.scale.x,$=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,N,$),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const W=t.measureText(this.value);let I=1;switch(f){case"underline":R=W.actualBoundingBoxDescent,P=W.actualBoundingBoxDescent;break;case"strikethrough":R=0,P=0,I=.5;break}switch(_){case"top":R+=this._size*I,P+=this._size*I;break;case"baseline":case"bottom":R-=this._size*I,P-=this._size*I;break}switch(y){case"left":case"start":B=0,E=W.width;break;case"right":case"end":B=-W.width,E=0;break;default:B=-W.width/2,E=W.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo(B,R),t.lineTo(E,P),t.stroke()}return m||t.restore(),l&&!n&&t.clip(),b&&b.length>0&&t.setLineDash(ks),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,o=this.left._y,s=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,o=(o-.5)*n.height,s=(s-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,o,s,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(ie.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,o=this.center._y,s=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,o=(o-.5)*n.height*.5,s=(s-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=t.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof re||(this._renderer.offset=new re),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,e&&(this._renderer.offset.x+=e.width/2,this._renderer.offset.y+=e.height/2,this._scale instanceof re?(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 re||(this._renderer.scale=new re),this._scale instanceof re?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(t,e,n,r,o,s,a,l,c,d){l=l*Math.PI/180,r=Bc(r),o=Bc(o);const u=(e-c)/2,h=(n-d)/2,f=to(l)*u+eo(l)*h,g=-eo(l)*u+to(l)*h,m=f*f,p=g*g;let b=r*r,y=o*o;const _=m/b+p/y;if(_>1){const W=no(_);r=W*r,o=W*o,b=r*r,y=o*o}const C=b*p+y*m,x=(b*y-C)/C;let N=no(vs(0,x));s===a&&(N=-N);const $=N*r*g/o,w=-N*o*f/r,v=to(l)*$-eo(l)*w+(e+c)/2,k=eo(l)*$+to(l)*w+(n+d)/2,B=Tc(1,0,(f-$)/r,(g-w)/o),R=Tc((f-$)/r,(g-w)/o,(-f-$)/r,(-g-w)/o)%yt,E=B+R;bp(t,v,k,r,o,B,E,a===0,l)}},_t=class extends Q{constructor(t){super();const e=t.smoothing!==!1;this.domElement=t.domElement||document.createElement("canvas"),this.ctx=this.domElement.getContext("2d"),this.overdraw=t.overdraw||!1,typeof this.ctx.imageSmoothingEnabled<"u"&&(this.ctx.imageSmoothingEnabled=e),this.scene=new ut,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?es(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&ie.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(Q.Types.resize,t,e,n)}render(){const t=this.ratio===1;return t||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Ee.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};S(_t,"Utils",Ee);function bp(t,e,n,r,o,s,a,l,c){const d=a-s,u=Oi.Tolerance.epsilon,h=Math.abs(d)<u;let f=Lt(d,yt);f<u&&(h?f=0:f=yt),l===!0&&!h&&(f===yt?f=-yt:f=f-yt);for(let g=0;g<$t.Resolution;g++){const m=g/($t.Resolution-1),p=s+m*f;let b=e+r*Math.cos(p),y=n+o*Math.sin(p);if(c!==0){const _=Math.cos(c),C=Math.sin(c),x=b-e,N=y-n;b=x*_-N*C+e,y=x*C+N*_+n}t.lineTo(b,y)}}function Tc(t,e,n,r){const o=t*n+e*r,s=no(t*t+e*e)*no(n*n+r*r);let a=yp(vs(-1,pp(1,o/s)));return t*r-e*n<0&&(a=-a),a}function io(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var de={version:1.1,ns:"http://www.w3.org/2000/svg",xlink:"http://www.w3.org/1999/xlink",alignments:{left:"start",center:"middle",right:"end"},baselines:{top:"hanging",middle:"middle",bottom:"ideographic",baseline:"alphabetic"},createElement:function(t,e){const n=t,r=document.createElementNS(de.ns,n);return n==="svg"&&(e=ie.defaults(e||{},{version:de.version})),e&&Object.keys(e).length>0&&de.setAttributes(r,e),r},setAttributes:function(t,e){const n=Object.keys(e);for(let r=0;r<n.length;r++)/href/.test(n[r])?t.setAttributeNS(de.xlink,n[r],e[n[r]]):t.setAttribute(n[r],e[n[r]]);return this},removeAttributes:function(t,e){for(let n in e)t.removeAttribute(n);return this},toString:function(t,e){let n=t.length,r=n-1,o,s="";for(let a=0;a<n;a++){const l=t[a],c=e?Lt(a-1,n):Math.max(a-1,0),d=t[c];let u,h,f,g,m,p,b,y,_,C,x,N,$,w,v,k=Ie(l.x),B=Ie(l.y);switch(l.command){case oe.close:u=oe.close;break;case oe.arc:x=l.rx,N=l.ry,$=l.xAxisRotation,w=l.largeArcFlag,v=l.sweepFlag,u=oe.arc+" "+x+" "+N+" "+$+" "+w+" "+v+" "+k+" "+B;break;case oe.curve:b=d.controls&&d.controls.right||re.zero,y=l.controls&&l.controls.left||re.zero,d.relative?(f=Ie(b.x+d.x),g=Ie(b.y+d.y)):(f=Ie(b.x),g=Ie(b.y)),l.relative?(m=Ie(y.x+l.x),p=Ie(y.y+l.y)):(m=Ie(y.x),p=Ie(y.y)),u=(a===0?oe.move:oe.curve)+" "+f+" "+g+" "+m+" "+p+" "+k+" "+B;break;case oe.move:o=l,u=oe.move+" "+k+" "+B;break;default:u=l.command+" "+k+" "+B}a>=r&&e&&(l.command===oe.curve&&(h=o,_=l.controls&&l.controls.right||l,C=h.controls&&h.controls.left||h,l.relative?(f=Ie(_.x+l.x),g=Ie(_.y+l.y)):(f=Ie(_.x),g=Ie(_.y)),h.relative?(m=Ie(C.x+h.x),p=Ie(C.y+h.y)):(m=Ie(C.x),p=Ie(C.y)),k=Ie(h.x),B=Ie(h.y),u+=" C "+f+" "+g+" "+m+" "+p+" "+k+" "+B),l.command!==oe.close&&(u+=" Z")),s+=u+" "}return s},pointsToString:function(t,e){let n="";const r=e*.5;for(let o=0;o<t.length;o++){const s=t[o].x,a=t[o].y-r;n+=oe.move+" "+s+" "+a+" ",n+="a "+r+" "+r+" 0 1 0 0.001 0 Z"}return n},getClip:function(t,e){let n=t._renderer.clip;return n||(n=t._renderer.clip=de.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in de?t:"path"},defs:{update:function(t){const{defs:e}=t;if(e._flagUpdate){const n=Array.prototype.slice.call(e.children,0);for(let r=0;r<n.length;r++){const o=n[r],s=o.id,a=`[fill="url(#${s})"],[stroke="url(#${s})"],[clip-path="url(#${s})"]`;t.querySelector(a)||e.removeChild(o)}e._flagUpdate=!1}}},group:{appendChild:function(t){const e=t._renderer.elem;if(!e)return;const n=e.nodeName;!n||/(radial|linear)gradient/i.test(n)||t._clip||this.elem.appendChild(e)},removeChild:function(t){const e=t._renderer.elem;!e||e.parentNode!=this.elem||!e.nodeName||t._clip||this.elem.removeChild(e)},orderChild:function(t){this.elem.appendChild(t._renderer.elem)},renderChild:function(t){const e=de.getRendererType(t._renderer.type);de[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=de.createElement("g",{id:this.id}),t.appendChild(this._renderer.elem));const e=this._matrix.manual||this._flagMatrix,n={domElement:t,elem:this._renderer.elem};e&&this._renderer.elem.setAttribute("transform","matrix("+this._matrix.toString()+")");for(let r=0;r<this.children.length;r++){const o=this.children[r],s=de.getRendererType(o._renderer.type);de[s].render.call(o,t)}if(this._flagId&&this._renderer.elem.setAttribute("id",this._id),this._flagOpacity&&this._renderer.elem.setAttribute("opacity",this._opacity),this._flagVisible&&this._renderer.elem.setAttribute("display",this._visible?"inline":"none"),this._flagClassName&&this._renderer.elem.setAttribute("class",this.classList.join(" ")),this._flagAdditions&&this.additions.forEach(de.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(de.group.removeChild,n),this._flagOrder&&this.children.forEach(de.group.orderChild,n),this._flagMask)if(this._mask){const r=de.getRendererType(this._mask._renderer.type);de[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices){const r=de.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=de.getRendererType(this._stroke._renderer.type);de[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=fn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this._flagCap&&(e["stroke-linecap"]=this._cap),this._flagJoin&&(e["stroke-linejoin"]=this._join),this._flagMiter&&(e["stroke-miterlimit"]=this._miter),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=de.getClip(this,t),o=this._renderer.elem;this._clip?(o.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(o)):(r.removeAttribute("id"),o.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(o))}if(this._flagMask)if(this._mask){const r=de.getRendererType(this._mask._renderer.type);de[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let r=this._size;if(!this._sizeAttenuation){const s=this.worldMatrix.elements,a=li(s[0],s[3],s[1],s[4],s[2],s[5]);r/=Math.max(a.scaleX,a.scaleY)}const o=de.pointsToString(this._renderer.collection,r);e.d=o}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=de.getRendererType(this._stroke._renderer.type);de[r].render.call(this._stroke,t,!0)}return this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=fn(this)),this._flagOpacity&&(e["stroke-opacity"]=this._opacity,e["fill-opacity"]=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("path",e),t.appendChild(this._renderer.elem)),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(t){this._update();const e={};if((this._matrix.manual||this._flagMatrix)&&(e.transform="matrix("+this._matrix.toString()+")"),this._flagId&&(e.id=this._id),this._flagFamily&&(e["font-family"]=this._family),this._flagSize&&(e["font-size"]=this._size),this._flagLeading&&(e["line-height"]=this._leading),this._flagAlignment&&(e["text-anchor"]=de.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=de.baselines[this._baseline]||this._baseline),this._flagStyle&&(e["font-style"]=this._style),this._flagWeight&&(e["font-weight"]=this._weight),this._flagDecoration&&(e["text-decoration"]=this._decoration),this._flagDirection&&(e.direction=this._direction),this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=de.getRendererType(this._fill._renderer.type);de[r].render.call(this._fill,t,!0)}if(this._flagFill&&(e.fill=this._fill&&this._fill.id?"url(#"+this._fill.id+")":this._fill,this._renderer.hasFillEffect&&typeof this._fill.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer){this._renderer.hasStrokeEffect=!0,this._stroke._update();const r=de.getRendererType(this._stroke._renderer.type);de[r].render.call(this._stroke,t,!0)}if(this._flagStroke&&(e.stroke=this._stroke&&this._stroke.id?"url(#"+this._stroke.id+")":this._stroke,this._renderer.hasStrokeEffect&&typeof this._stroke.id>"u"&&(t.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(e["stroke-width"]=fn(this)),this._flagOpacity&&(e.opacity=this._opacity),this._flagClassName&&(e.class=this.classList.join(" ")),this._flagVisible&&(e.visibility=this._visible?"visible":"hidden"),this.dashes&&this.dashes.length>0&&(e["stroke-dasharray"]=this.dashes.join(" "),e["stroke-dashoffset"]=this.dashes.offset||0),this._renderer.elem?de.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=de.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=de.getClip(this,t),o=this._renderer.elem;this._clip?(o.removeAttribute("id"),r.setAttribute("id",this.id),r.appendChild(o)):(r.removeAttribute("id"),o.setAttribute("id",this.id),this.parent._renderer.elem.appendChild(o))}if(this._flagMask)if(this._mask){const r=de.getRendererType(this._mask._renderer.type);de[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(t,e){ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?de.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=de.createElement("linearGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let o=0;o<this.stops.length;o++){const s=this.stops[o],a={};s._flagOffset&&(a.offset=100*s._offset+"%"),s._flagColor&&(a["stop-color"]=s._color),s._flagOpacity&&(a["stop-opacity"]=s._opacity),s._renderer.elem?de.setAttributes(s._renderer.elem,a):s._renderer.elem=de.createElement("stop",a),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?de.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=de.createElement("radialGradient",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._flagStops){const r=this._renderer.elem.childNodes.length!==this.stops.length;if(r)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let o=0;o<this.stops.length;o++){const s=this.stops[o],a={};s._flagOffset&&(a.offset=100*s._offset+"%"),s._flagColor&&(a["stop-color"]=s._color),s._flagOpacity&&(a["stop-opacity"]=s._opacity),s._renderer.elem?de.setAttributes(s._renderer.elem,a):s._renderer.elem=de.createElement("stop",a),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),e||this._update();const n={},r={x:0,y:0},o=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(o.nodeName.toLowerCase()){case"canvas":r.href=r["xlink:href"]=o.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,o&&(n.x-=o.width/2,n.y-=o.height/2,this._scale instanceof re?(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,o)){switch(n.width=o.width,n.height=o.height,this._repeat){case"no-repeat":n.width+=1,n.height+=1;break}this._scale instanceof re?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),/no-repeat/i.test(this._repeat)?r.preserveAspectRatio="xMidYMid":r.preserveAspectRatio="none",r.width=n.width,r.height=n.height}return(this._flagScale||this._flagLoaded)&&(this._renderer.image?de.setAttributes(this._renderer.image,r):this._renderer.image=de.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&de.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=de.createElement("pattern",n)),this._renderer.elem.parentNode===null&&t.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},Nc=class extends Q{constructor(t){super(),this.domElement=t.domElement||de.createElement("svg"),this.scene=new ut,this.scene.parent=this,this.defs=de.createElement("defs"),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow="hidden"}setSize(t,e){return this.width=t,this.height=e,de.setAttributes(this.domElement,{width:t,height:e}),this.trigger(Q.Types.resize,t,e)}render(){return de.group.render.call(this.scene,this.domElement),de.defs.update(this.domElement),this}};S(Nc,"Utils",de);var Gt={create:function(t,e,n){const r=t.createShader(t[n]);if(t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){const s=t.getShaderInfoLog(r);throw t.deleteShader(r),new It("unable to compile shader "+r+": "+s)}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
- `}},ro=Li.Multiply,_p=[1,0,0,0,1,0,0,0,1],Kn=new hn(9),wp=_t.Utils,$c=new re,Cs=new hn([0,0,1,0,0,1,0,1,1,0,1,1]),xe={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Ye.document?Ye.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Li,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)xe.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,o=this._matrix.manual||this._flagMatrix;if((r||o)&&(this._renderer.matrix||(this._renderer.matrix=new hn(9)),this._matrix.toTransformArray(!0,Kn),ro(Kn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re),this._scale instanceof re?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=_t.Utils.getRendererType(this._mask._renderer.type);xe[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let s;if(this._flagSubtractions)for(s=0;s<this.subtractions.length;s++)xe.group.removeChild(this.subtractions[s],t);for(s=0;s<this.children.length;s++){const a=this.children[s],l=_t.Utils.getRendererType(a._renderer.type);xe[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,o,s,a,l,c,d,u,h,f,g,m,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,C=t.renderer.ratio,x=$c.copy(e._renderer.scale).multiply(C),N=e._stroke,$=e._linewidth,w=e._fill,v=e._renderer.opacity||e._opacity,k=e._cap,B=e._join,R=e._miter,E=e._closed,P=e.dashes,W=b.length,I=W-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*x.y),1);const Z=e._renderer.rect.centroid,te=Z.x,D=Z.y;if(_.clearRect(0,0,y.width,y.height),w)if(typeof w=="string")_.fillStyle=w;else{const Y=_t.Utils.getRendererType(w._renderer.type);xe[Y].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(N){if(typeof N=="string")_.strokeStyle=N;else{const Y=_t.Utils.getRendererType(N._renderer.type);xe[Y].render.call(N,_,e),_.strokeStyle=N._renderer.effect}$&&(_.lineWidth=fn(e)),R&&(_.miterLimit=R),B&&(_.lineJoin=B),!E&&k&&(_.lineCap=k)}typeof v=="number"&&(_.globalAlpha=v),P&&P.length>0&&(_.lineDashOffset=P.offset||0,_.setLineDash(P));let L,H,z,O,U,K,V,q;_.save(),_.scale(x.x,x.y),_.translate(te,D),_.beginPath();for(let Y=0;Y<b.length;Y++){const ee=b[Y];switch(g=ee.x,m=ee.y,ee.command){case oe.close:_.closePath();break;case oe.arc:H=ee.rx,z=ee.ry,O=ee.xAxisRotation,U=ee.largeArcFlag,K=ee.sweepFlag,n=E?Lt(Y-1,W):Math.max(Y-1,0),r=b[n],V=r.x,q=r.y,wp.renderSvgArcCommand(_,V,q,H,z,U,K,O,g,m);break;case oe.curve:n=E?Lt(Y-1,W):Math.max(Y-1,0),r=b[n],d=r.controls&&r.controls.right||re.zero,u=ee.controls&&ee.controls.left||re.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ee._relative?(s=u.x+ee.x,a=u.y+ee.y):(s=u.x,a=u.y),_.bezierCurveTo(l,c,s,a,g,m),Y>=I&&E&&(o=L,h=ee.controls&&ee.controls.right||re.zero,f=o.controls&&o.controls.left||re.zero,ee._relative?(l=h.x+ee.x,c=h.y+ee.y):(l=h.x,c=h.y),o._relative?(s=f.x+o.x,a=f.y+o.y):(s=f.x,a=f.y),g=o.x,m=o.y,_.bezierCurveTo(l,c,s,a,g,m));break;case oe.line:_.lineTo(g,m);break;case oe.move:L=ee,_.moveTo(g,m);break}}E&&_.closePath(),xe.isHidden.test(w)||(p=w._renderer&&w._renderer.offset,p&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),p&&_.restore()),xe.isHidden.test(N)||(p=N._renderer&&N._renderer.offset,p&&(_.save(),_.translate(-N._renderer.offset.x,-N._renderer.offset.y),_.scale(N._renderer.scale.x,N._renderer.scale.y),_.lineWidth=$/N._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,o=-1/0,s=1/0,a=-1/0,l,c;t.forEach(function(d){const u=d.x,h=d.y,f=d.controls;let g,m,p,b,y,_;s=Math.min(h,s),r=Math.min(u,r),o=Math.max(u,o),a=Math.max(h,a),d.controls&&(y=f.left,_=f.right,!(!y||!_)&&(g=d._relative?y.x+u:y.x,m=d._relative?y.y+h:y.y,p=d._relative?_.x+u:_.x,b=d._relative?_.y+h:_.y,!(!g||!m||!p||!b)&&(s=Math.min(m,b,s),r=Math.min(g,p,r),o=Math.max(g,p,o),a=Math.max(m,b,a))))}),typeof e=="number"&&(s-=e,r-=e,o+=e,a+=e),l=o-r,c=a-s,n.top=s,n.left=r,n.right=o,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-s},render:function(t,e,n){if(!this._visible||!this._opacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,o=_t.Utils.getRendererType(this._renderer.type),s=e[o],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 Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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 hn(9)),this._matrix.toTransformArray(!0,Kn),ro(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let h,f;this._scale instanceof re?(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,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=_t.Utils.getRendererType(this._mask._renderer.type);xe[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,xe.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),xe.updateTexture.call(xe,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,Cs,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const u=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,o=this.ctx,s=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._size*s;let f=h;xe.isHidden.test(a)||(f+=l),r.width=bl(f),r.height=r.width;const g=f/r.width,m=r.width/2,p=r.height/2;if(o.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")o.fillStyle=c;else{const b=_t.Utils.getRendererType(c._renderer.type);xe[b].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")o.strokeStyle=a;else{const b=_t.Utils.getRendererType(a._renderer.type);xe[b].render.call(a,o,e),o.strokeStyle=a._renderer.effect}l&&(o.lineWidth=fn(e)/g)}typeof d=="number"&&(o.globalAlpha=d),u&&u.length>0&&(o.lineDashOffset=u.offset||0,o.setLineDash(u)),o.save(),o.translate(m,p),o.scale(xe.precision,xe.precision),o.beginPath(),o.arc(0,0,h/g*.5,0,yt),o.restore(),closed&&o.closePath(),xe.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(o.save(),o.translate(-c._renderer.offset.x,-c._renderer.offset.y),o.scale(c._renderer.scale.x,c._renderer.scale.y)),o.fill(),n&&o.restore()),xe.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(o.save(),o.translate(-a._renderer.offset.x,-a._renderer.offset.y),o.scale(a._renderer.scale.x,a._renderer.scale.y),o.lineWidth=l/a._renderer.scale.x),o.stroke(),n&&o.restore())},render:function(t,e,n){if(!this._visible||!this._opacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const o=n||this.parent,s=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=o._matrix.manual||o._flagMatrix,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==o,f=this._renderer.vertices,g=this._renderer.collection.length,m=this._flagVertices,p=this._flagFill||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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||o._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||u||h){this._renderer.matrix||(this._renderer.matrix=new hn(9)),this._matrix.toTransformArray(!0,Kn),ro(Kn,o._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let b,y;this._scale instanceof re?(b=this._scale.x*o._renderer.scale.x,y=this._scale.y*o._renderer.scale.y):(b=this._scale*o._renderer.scale.x,y=this._scale*o._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,h&&(this._renderer.parent=o)}if(m){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,f,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*o._renderer.opacity,xe.updateTexture.call(xe,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(xe.isHidden.test(l)||(r+=c),r/=xe.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==s&&(t.useProgram(s),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform1f(s.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,g),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,o=t.renderer.ratio,s=$c.copy(e._renderer.scale).multiply(o),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._decoration,f=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*s.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*s.y),1);const g=e._renderer.rect.centroid,m=g.x,p=g.y;let b,y,_,C,x,N,$,w,v,k,B;const R=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),R||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=f,c)if(typeof c=="string")r.fillStyle=c;else{const E=_t.Utils.getRendererType(c._renderer.type);xe[E].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const E=_t.Utils.getRendererType(a._renderer.type);xe[E].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=fn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(s.x,s.y),r.translate(m,p),xe.isHidden.test(c)||(c._renderer&&c._renderer.offset?(N=c._renderer.scale.x,$=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(N,$),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,C=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,C),r.restore()):r.fillText(e.value,0,0)),xe.isHidden.test(a)||(a._renderer&&a._renderer.offset?(N=a._renderer.scale.x,$=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(N,$),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,C=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,C),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const E=r.measureText(e.value);switch(h){case"underline":v=E.actualBoundingBoxDescent,B=E.actualBoundingBoxDescent;break;case"strikethrough":v=0,B=0;break}w=-E.width/2,k=E.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,v),r.lineTo(k,B),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=xe.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=_t.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let o=r.width,s=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!xe.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const a=o/2,l=s/2;switch(xe.alignments[t._alignment]||t._alignment){case xe.alignments.left:t.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case xe.alignments.right:t.direction==="ltr"?(e.left=-o,e.right=0):(e.left=0,e.right=o);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-s,e.bottom=0;break;case"top":e.top=0,e.bottom=s;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=o,e.height=s,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,o=e[this._renderer.type],s=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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(s||a||l){this._renderer.matrix||(this._renderer.matrix=new hn(9)),this._matrix.toTransformArray(!0,Kn),ro(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let u,h;this._scale instanceof re?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const u=_t.Utils.getRendererType(this._mask._renderer.type);xe[u].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,xe.text.getBoundingClientRect(this,this._renderer.rect),xe.updateTexture.call(xe,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,Cs,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,o=this.left._y,s=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,o=(o-.5)*n.height,s=(s-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,o,s,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(ie.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,o=this.center._y,s=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,o=(o-.5)*n.height*.5,s=(s-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof re||(this._renderer.offset=new re),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 re?(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 re||(this._renderer.scale=new re);let r,o;this._scale instanceof re?(r=this._scale.x,o=this._scale.y):(r=this._scale,o=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=o<0?-o:o}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=_t.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(xe,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,o;if(n=t.createProgram(),ie.each(e,function(s){t.attachShader(n,s)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw o=t.getProgramInfoLog(n),t.deleteProgram(n),new It("unable to link program: "+o);return n}},extensions:{init:function(t){const e={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const o=n[r];e[o]=xe.extensions.get(t,o)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Wr};xe.ctx=xe.canvas.getContext("2d");var Rc=class extends Q{constructor(t){super();let e,n,r,o;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(xe.canvas=t.offscreenElement,xe.ctx=xe.canvas.getContext("2d")),this.scene=new ut,this.scene.parent=this,this._renderer={type:"renderer",matrix:new hn(_p),scale:1,opacity:1},this._flagMatrix=!0,t=ie.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new It("unable to create a webgl context. Try using another renderer.");r=Gt.create(e,Gt.path.vertex,Gt.types.vertex),o=Gt.create(e,Gt.path.fragment,Gt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=xe.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=xe.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,Cs,e.STATIC_DRAW),r=Gt.create(e,Gt.points.vertex,Gt.types.vertex),o=Gt.create(e,Gt.points.fragment,Gt.types.fragment),n=this.programs.points=xe.program.create(e,[r,o]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,o;const s=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?es(s):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,ie.isObject(this.domElement.style)&&ie.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,o=e*this.ratio,s.viewport(0,0,r,o),this.programs.resolution.width=r,this.programs.resolution.height=o,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(Q.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),xe.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};S(Rc,"Utils",xe);var xp=ie.extend({Error:It,getRatio:es,read:Xe,xhr:vc},ie,Nt,ml,gl),Ce=class Or{constructor(e){S(this,"_events",new Q),S(this,"type",""),S(this,"renderer",null),S(this,"scene",null),S(this,"width",0),S(this,"height",0),S(this,"frameCount",0),S(this,"timeDelta",0),S(this,"playing",!1);const n=ie.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Or.Types.svg,autostart:!1});if(ie.each(n,function(r,o){/fullscreen/i.test(o)||/autostart/i.test(o)||(this[o]=r)},this),ie.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Or.Types[r])}this.renderer=new Or[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=kp.bind(this),this.fit.domElement=window,this.fit.attached=!0,ie.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ie.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ht.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=vp.bind(this),ie.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(Q.Types.resize,Cp.bind(this)),this.scene=this.renderer.scene,Or.Instances.push(this),n.autostart&&mr.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,mr.init(),this.trigger(Q.Types.play)}pause(){return this.playing=!1,this.trigger(Q.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,o;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)o=e.children[n],this.release(o);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const s=this.renderer.ctx;e._renderer.texture&&(s.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(s.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=ie.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ht.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,o=this.height,s=this.renderer;return(r!==s.width||o!==s.height)&&s.setSize(r,o,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,n,r,o){const s=new Jr(e,n,r,o);return this.scene.add(s),s}makeArrow(e,n,r,o,s){const a=typeof s=="number"?s:10,l=Math.atan2(o-n,r-e),c=[new Be(e,n,void 0,void 0,void 0,void 0,oe.move),new Be(r,o,void 0,void 0,void 0,void 0,oe.line),new Be(r-a*Math.cos(l-Math.PI/4),o-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,oe.line),new Be(r,o,void 0,void 0,void 0,void 0,oe.move),new Be(r-a*Math.cos(l+Math.PI/4),o-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,oe.line)],d=new $e(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,o){const s=new Un(e,n,r,o);return this.scene.add(s),s}makeRoundedRectangle(e,n,r,o,s){const a=new Gr(e,n,r,o,s);return this.scene.add(a),a}makeCircle(e,n,r,o){const s=new Ur(e,n,r,o);return this.scene.add(s),s}makeEllipse(e,n,r,o,s){const a=new Kr(e,n,r,o,s);return this.scene.add(a),a}makeStar(e,n,r,o,s){const a=new gs(e,n,r,o,s);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new Be(l,c))}}const r=arguments[n-1],o=new $e(e,!(typeof r=="boolean"&&r),!0),s=o.getBoundingClientRect();return o.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(o),o}makePolygon(e,n,r,o){const s=new ms(e,n,r,o);return this.scene.add(s),s}makeArcSegment(e,n,r,o,s,a,l){const c=new ls(e,n,r,o,s,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let s=0;s<n;s+=2){const a=arguments[s];if(typeof a!="number")break;const l=arguments[s+1];r.push(new re(a,l))}}const o=new fs(r);return this.scene.add(o),o}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new Be(c,d))}}const o=arguments[n-1],s=new $e(r,!(typeof o=="boolean"&&o)),a=s.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&s.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(s),s}makeText(e,n,r,o){const s=new mn(e,n,r,o);return this.add(s),s}makeLinearGradient(e,n,r,o){const s=Array.prototype.slice.call(arguments,4),a=new Ue(e,n,r,o,s);return this.add(a),a}makeRadialGradient(e,n,r){const o=Array.prototype.slice.call(arguments,3),s=new Ke(e,n,r,o);return this.add(s),s}makeSprite(e,n,r,o,s,a,l){const c=new Yr(e,n,r,o,s,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,o,s,a){const l=new Cc(e,n,r,o,s,a);return this.add(l),l}makeImageSequence(e,n,r,o,s){const a=new _s(e,n,r,o);return s&&a.play(),this.add(a),a}makeTexture(e,n){return new Oe(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new ut;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const o=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(o in Xe))return null;const s=Xe[o].call(this,e);return r?this.add(n&&s instanceof ut?s.children:s):s.parent&&s.remove(),s}load(e,n){const r=new ut;let o,s,a;const l=(function(c){for(Ht.temp.innerHTML=c,s=0;s<Ht.temp.children.length;s++)o=Ht.temp.children[s],a=this.interpret(o,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ht.temp.children.length<=1?Ht.temp.children[0]:Ht.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(vc(e,l),r):(l(e),r)}};S(Ce,"NextFrameId",$t.NextFrameId),S(Ce,"Types",$t.Types),S(Ce,"Version",$t.Version),S(Ce,"PublishDate",$t.PublishDate),S(Ce,"Identifier",$t.Identifier),S(Ce,"Resolution",$t.Resolution),S(Ce,"AutoCalculateImportedMatrices",$t.AutoCalculateImportedMatrices),S(Ce,"Instances",$t.Instances),S(Ce,"uniqueId",$t.uniqueId),S(Ce,"Anchor",Be),S(Ce,"Collection",qn),S(Ce,"Events",Q),S(Ce,"Group",ut),S(Ce,"Matrix",Li),S(Ce,"Path",$e),S(Ce,"Registry",Wr),S(Ce,"Element",Di),S(Ce,"Shape",Yn),S(Ce,"Text",mn),S(Ce,"Vector",re),S(Ce,"Gradient",at),S(Ce,"Image",Cc),S(Ce,"ImageSequence",_s),S(Ce,"LinearGradient",Ue),S(Ce,"RadialGradient",Ke),S(Ce,"Sprite",Yr),S(Ce,"Stop",Xn),S(Ce,"Texture",Oe),S(Ce,"ArcSegment",ls),S(Ce,"Circle",Ur),S(Ce,"Ellipse",Kr),S(Ce,"Line",Jr),S(Ce,"Points",fs),S(Ce,"Polygon",ms),S(Ce,"Rectangle",Un),S(Ce,"RoundedRectangle",Gr),S(Ce,"Star",gs),S(Ce,"CanvasRenderer",_t),S(Ce,"SVGRenderer",Nc),S(Ce,"WebGLRenderer",Rc),S(Ce,"Commands",oe),S(Ce,"Utils",xp);var pn=Ce;function kp(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function vp(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function Cp(t,e){this.width=t,this.height=e,this.trigger(Q.Types.resize,t,e)}var mr=Ht.getRequestAnimationFrame();function Ec(){for(let t=0;t<pn.Instances.length;t++){const e=pn.Instances[t];e.playing&&e.update()}pn.NextFrameId=mr(Ec)}mr.init=function(){Ec(),mr.init=function(){}};let yn;typeof window<"u"?yn=window:typeof global<"u"?yn=global:typeof self<"u"&&(yn=self);let Pc;const di=Math.PI*2,ht=Math.PI*.5;function Sp(t,e,n,r,o,s){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,o=t.e,s=t.f):a=t,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Bp(t){Pc=t}function Tp(t,e){e=e&&e.identity()||new Pc;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let o=0;o<r.length;o++){const a=r[o].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Zt(t,e,n){return n*(e-t)+t}function ji(t,e){for(;t<0;)t+=e;return t%e}const Fc=yn.Float32Array||Array,Np=Math.floor;function bn(t){return Np(t*1e6)/1e6}const pe={move:"M",line:"L",curve:"C",close:"Z"};class ne{constructor(){T(this,"_events",{});T(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let o=0,s=r.length;o<s;o++){e=r[o];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const o=this;e&&(s.obj=e,s.name=n,s.handler=r,e.on(n,s));function s(){r.apply(o,arguments)}return o}ignore(e,n,r){return e.off(n,r),this}}T(ne,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),T(ne,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Vc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ne.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ne.Types.change))}}},mt=class mt extends ne{constructor(n=0,r=0){super();T(this,"_x",0);T(this,"_y",0);for(let o in Vc)Object.defineProperty(this,o,Vc[o]);this.x=n,this.y=r}static add(n,r){return new mt(n.x+r.x,n.y+r.y)}static sub(n,r){return new mt(n.x-r.x,n.y-r.y)}static subtract(n,r){return mt.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 o=n.x-r.x,s=n.y-r.y;return Math.atan2(s,o)}static distanceBetween(n,r){return Math.sqrt(mt.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const o=n.x-r.x,s=n.y-r.y;return o*o+s*s}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 mt(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,o=this.y-n.y;return r*r+o*o}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 o=(n.x-this.x)*r+this.x,s=(n.y-this.y)*r+this.y;return this.set(o,s)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:bn(this.x),y:bn(this.y)}}rotate(n){const r=this.x,o=this.y,s=Math.cos(n),a=Math.sin(n);return this.x=r*s-o*a,this.y=r*a+o*s,this}};T(mt,"zero",new mt),T(mt,"left",new mt(-1,0)),T(mt,"right",new mt(1,0)),T(mt,"up",new mt(0,-1)),T(mt,"down",new mt(0,1));let be=mt;class Fe extends be{constructor(n=0,r=0,o=0,s=0,a=0,l=0,c=pe.move){super(n,r);T(this,"controls",{left:new be,right:new be});T(this,"_command",pe.move);T(this,"_relative",!0);T(this,"_rx",0);T(this,"_ry",0);T(this,"_xAxisRotation",0);T(this,"_largeArcFlag",0);T(this,"_sweepFlag",1);for(let u in Mc)Object.defineProperty(this,u,Mc[u]);this.command=c,this.relative=!0;const d=Fe.makeBroadcast(this);this.controls.left.set(o,s).addEventListener(ne.Types.change,d),this.controls.right.set(a,l).addEventListener(ne.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(ne.Types.change)}}static fromObject(n){return new Fe().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 Fe().copy(this)}toObject(){return{x:bn(this.x),y:bn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:bn(this.rx),ry:bn(this.ry),xAxisRotation:bn(this.xAxisRotation),largeArcFlag:bn(this.largeArcFlag),sweepFlag:bn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Mc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ne.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ne.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ne.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ne.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ne.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}}};let $p=0;const Ss={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return $p++}},oo={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function so(t,e,n,r,o){const s=1-t;return s*s*s*e+3*s*s*t*n+3*s*t*t*r+t*t*t*o}function Ac(t,e,n,r,o,s,a,l,c){c=c||oo.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Fe(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,g=so(f,t,n,o,a),m=so(f,e,r,s,l);u.push(new Fe(g,m))}return u}function Rp(t,e,n,r,o,s,a,l,c){if(t===n&&e===r&&o===a&&s===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-o)+3*(a-t),u=6*(t+o)-12*n,h=3*(n-t),f=9*(r-s)+3*(l-e),g=6*(e+s)-12*r,m=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(f*b+g)*b+m;return Math.sqrt(y*y+_*_)}return Pp(p,0,1,c||oo.RecursionLimit)}function Ep(t,e,n,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,g,m,p,b,y;for(let N=0;N<2;++N){if(N===0?(h=6*t-12*n+6*o,u=-3*t+9*n-9*o+3*a,f=3*n-3*t):(h=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-f/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*f*u,y=Math.sqrt(b),!(b<0)&&(m=(-h+y)/(2*u),0<m&&m<1&&c.push(m),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,C=_,x;for(;_--;)g=c[_],x=1-g,d[0][_]=x*x*x*t+3*x*x*g*n+3*x*g*g*o+g*g*g*a,d[1][_]=x*x*x*e+3*x*x*g*r+3*x*g*g*s+g*g*g*l;return d[0][C]=t,d[1][C]=e,d[0][C+1]=a,d[1][C+1]=l,d[0].length=d[1].length=C+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 Pp(t,e,n,r){let o=oo.abscissas[r-2],s=oo.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(l):0;for(;c<d;){const h=a*o[c];u+=s[c++]*(t(l+h)+t(l-h))}return a*u}function Fp(t,e){const n=t.length,r=n-1;for(let o=0;o<n;o++){const s=t[o],a=e?ji(o-1,n):Math.max(o-1,0),l=e?ji(o+1,n):Math.min(o+1,r),c=t[a],d=s,u=t[l];Vp(c,d,u),d.command=o===0?pe.move:pe.curve}}function Vp(t,e,n){const r=be.angleBetween(t,e),o=be.angleBetween(n,e);let s=be.distanceBetween(t,e),a=be.distanceBetween(n,e),l=(r+o)/2;return s<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,a*=.33,o<r?l+=ht:l-=ht,e.controls.left.x=Math.cos(l)*s,e.controls.left.y=Math.sin(l)*s,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let gr=(Bi=class extends ne{constructor(){super();T(this,"_flagId",!1);T(this,"_flagClassName",!1);T(this,"_renderer",{});T(this,"_id",Ss.Identifier+Ss.uniqueId());T(this,"_className","");T(this,"classList",[]);for(let n in Ic)Object.defineProperty(this,n,Ic[n])}static fromObject(n){const r=new Bi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},T(Bi,"Properties",["renderer","id","className"]),Bi);const Ic={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class ao extends Error{constructor(n){super();T(this,"name","Two.js");T(this,"message");this.message=n}}class Mp{constructor(){T(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let lo;const Oc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};yn.document&&(lo=document.createElement("a"));const Ze=class Ze extends gr{constructor(n,r){super();T(this,"_flagSrc",!1);T(this,"_flagImage",!1);T(this,"_flagVideo",!1);T(this,"_flagLoaded",!1);T(this,"_flagRepeat",!1);T(this,"_flagOffset",!1);T(this,"_flagScale",!1);T(this,"_src","");T(this,"_image",null);T(this,"_loaded",!1);T(this,"_repeat","no-repeat");T(this,"_scale",1);T(this,"_offset",null);for(let o in zc)Object.defineProperty(this,o,zc[o]);if(this._renderer.type="texture",this._renderer.flagOffset=Ap.bind(this),this._renderer.flagScale=Ip.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new be,typeof r=="function"){const o=(function(){this.unbind(ne.Types.load,o),typeof r=="function"&&r()}).bind(this);this.bind(ne.Types.load,o)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const o=Object.prototype.toString.call(n);(o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]"||o==="[object HTMLVideoElement]"||o==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new Ze().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return lo?(lo.href=n,lo.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=Ze.getAbsoluteURL(n);if(Ze.ImageRegistry.contains(r))return Ze.ImageRegistry.get(r);let o;return yn.document?Oc.video.test(r)?o=document.createElement("video"):o=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),o.crossOrigin="anonymous",o.referrerPolicy="no-referrer",o}static load(n,r){let o=n.image,s=Ze.getTag(o);n._flagImage&&(/canvas/i.test(s)?Ze.Register.canvas(n,r):(n._src=o.getAttribute("two-src")||o.src,Ze.Register[s](n,r))),n._flagSrc&&(o||(o=Ze.getImage(n.src),n.image=o),s=Ze.getTag(o),Ze.Register[s](n,r))}clone(){const n=new Ze(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 be?n.offset:new be().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof be?n.scale:new be().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(ne.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ze.load(this,(function(){this.loaded=!0,this.trigger(ne.Types.change).trigger(ne.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};T(Ze,"Properties",["src","loaded","repeat","scale","offset","image"]),T(Ze,"RegularExpressions",Oc),T(Ze,"ImageRegistry",new Mp),T(Ze,"Register",{canvas:function(n,r){n._src="#"+n.id,Ze.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const o=n.image,s=function(l){o.removeEventListener&&typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",a,!1)),new ao("unable to load "+n.src)};typeof o.width=="number"&&o.width>0&&typeof o.height=="number"&&o.height>0?s():typeof o.addEventListener=="function"&&(o.addEventListener("load",s,!1),o.addEventListener("error",a,!1)),n._src=Ze.getAbsoluteURL(n._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",n.src),Ze.ImageRegistry.add(n.src,o),n.image.src=n.src)},video:function(n,r){const o=function(a){n.image.removeEventListener("canplaythrough",o,!1),n.image.removeEventListener("error",s,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},s=function(a){throw n.image.removeEventListener("canplaythrough",o,!1),n.image.removeEventListener("error",s,!1),new ao("unable to load "+n.src)};n._src=Ze.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Ze.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?o():(n.image.addEventListener("canplaythrough",o,!1),n.image.addEventListener("error",s,!1),n.image.src=n.src,n.image.load())}});let Ge=Ze;const zc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Ge.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ge.ImageRegistry.contains(n)?this._image=Ge.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(ne.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ne.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof be&&this._scale.unbind(ne.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof be&&this._scale.bind(ne.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Ap(){this._flagOffset=!0}function Ip(){this._flagScale=!0}class ui extends Array{constructor(){super();Xa(this,gt,new ne);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 Mt(this,gt)}set _events(n){of(this,gt,n)}get _bound(){return Mt(this,gt)._bound}set _bound(n){Mt(this,gt)._bound=n}addEventListener(){return Mt(this,gt).addEventListener.apply(this,arguments)}on(){return Mt(this,gt).on.apply(this,arguments)}bind(){return Mt(this,gt).bind.apply(this,arguments)}removeEventListener(){return Mt(this,gt).removeEventListener.apply(this,arguments)}off(){return Mt(this,gt).off.apply(this,arguments)}unbind(){return Mt(this,gt).unbind.apply(this,arguments)}dispatchEvent(){return Mt(this,gt).dispatchEvent.apply(this,arguments)}trigger(){return Mt(this,gt).trigger.apply(this,arguments)}listen(){return Mt(this,gt).listen.apply(this,arguments)}ignore(){return Mt(this,gt).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(ne.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(ne.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(ne.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ne.Types.insert,r),this.trigger(ne.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(ne.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ne.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const o=[];for(let s=0;s<this.length;s++){const a=this[s];let l;r?l=n.call(r,a,s):l=n(a,s),o.push(l)}return o}}gt=new WeakMap;const Dc=Array.prototype.slice;function Op(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Me={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Dc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let o in r)t[o]=r[o]}return t},defaults:function(t){const e=Dc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let o in r)t[o]===void 0&&(t[o]=r[o])}return t},each:function(t,e,n){const r=n||this,o=!Op(t)&&Object.keys(t),s=(o||t).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,t[l],l,t)}return t},performance:yn.performance&&yn.performance.now?yn.performance:Date},zt=class zt extends gr{constructor(n,r,o){super();T(this,"_flagOffset",!0);T(this,"_flagOpacity",!0);T(this,"_flagColor",!0);T(this,"_offset",0);T(this,"_opacity",1);T(this,"_color","#fff");for(let s in Lc)Object.defineProperty(this,s,Lc[s]);this._renderer.type="stop",this.offset=typeof n=="number"?n:zt.Index<=0?0:1,this.opacity=typeof o=="number"?o:1,this.color=typeof r=="string"?r:zt.Index<=0?"#fff":"#000",zt.Index=(zt.Index+1)%2}static fromObject(n){const r=new zt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<zt.Properties.length;r++){const o=zt.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new zt;return Me.each(zt.Properties,function(o){r[o]=this[o]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Me.each(zt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};T(zt,"Index",0),T(zt,"Properties",["offset","opacity","color"]);let hi=zt;const Lc={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},vn=class vn extends gr{constructor(n){super();T(this,"_flagStops",!1);T(this,"_flagSpread",!1);T(this,"_flagUnits",!1);T(this,"_spread","");T(this,"_units","");for(let r in Hc)Object.defineProperty(this,r,Hc[r]);this._renderer.type="gradient",this._renderer.flagStops=zp.bind(this),this._renderer.bindStops=Dp.bind(this),this._renderer.unbindStops=Lp.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(s=>s instanceof hi?s:new hi().copy(s)));const o=new vn(r).copy(n);return"id"in n&&(o.id=n.id),o}clone(n){const r=this.stops.map(s=>s.clone()),o=new vn(r);return Me.each(vn.Properties,s=>{o[s]=this[s]},this),n&&n.add(o),o}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const o=vn.Properties[r];o in n&&(this[o]=n[o])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Me.each(vn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ne.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}};T(vn,"Stop",hi),T(vn,"Properties",["spread","stops","units"]);let lt=vn;const Hc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(ne.Types.insert,e).unbind(ne.Types.remove,n),this._stops=new ui((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._stops)}}};function zp(){this._flagStops=!0}function Dp(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Lp(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const ti=class ti extends lt{constructor(n,r,o,s,a){super(a);T(this,"_flagEndPoints",!1);T(this,"_left",null);T(this,"_right",null);for(let l in Wc)Object.defineProperty(this,l,Wc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Hp.bind(this),this.left=new be,this.right=new be,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof o=="number"&&(this.right.x=o),typeof s=="number"&&(this.right.y=s)}static fromObject(n){const r=new ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ti.Properties.length;r++){const o=ti.Properties[r];o in n&&(this[o]=n[o]instanceof be?n[o]:new be().copy(n[o]))}return this}clone(n){const r=this.stops.map(function(s){return s.clone()}),o=new ti(this.left._x,this.left._y,this.right._x,this.right._y,r);return Me.each(lt.Properties,function(s){o[s]=this[s]},this),n&&n.add(o),o}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(ne.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};T(ti,"Stop",hi),T(ti,"Properties",["left","right"]);let Rt=ti;const Wc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof be&&this._left.unbind(ne.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ne.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof be&&this._right.unbind(ne.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ne.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Hp(){this._flagEndPoints=!0}const Cn=class Cn extends lt{constructor(n,r,o,s,a,l){super(s);T(this,"_flagRadius",!1);T(this,"_flagCenter",!1);T(this,"_flagFocal",!1);T(this,"_radius",0);T(this,"_center",null);T(this,"_focal",null);for(let c in jc)Object.defineProperty(this,c,jc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Wp.bind(this),this._renderer.flagFocal=jp.bind(this),this.center=new be,this.radius=typeof o=="number"?o:1,this.focal=new be,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 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 o=Cn.Properties[r];o in n&&(/(center|focal)i/.test(o)?this[o]=n[o]instanceof be?n[o]:new be().copy(n[o]):typeof n[o]=="number"&&(this[o]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(s){return s.clone()}),o=new Cn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Me.each(lt.Properties.concat(Cn.Properties),function(s){o[s]=this[s]},this),n&&n.add(o),o}toObject(){const n=super.toObject.call(this);return Me.each(Cn.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(ne.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};T(Cn,"Stop",hi),T(Cn,"Properties",["center","radius","focal"]);let Et=Cn;const jc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(ne.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ne.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ne.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ne.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Wp(){this._flagCenter=!0}function jp(){this._flagFocal=!0}function qc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let o=0;for(let s=0;s<t._lengths.length;s++){const a=t._lengths[s];if(o>=r)return r-o>=0;o+=a}return!1}function co(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,o=0;r<t._lengths.length;r++){if(o+t._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/t._lengths[r];o+=t._lengths[r]}return-1}function Xc(t,e,n){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Rp(r,l,o,c,s,d,a,u,n)}function Yc(t,e,n){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Ac(r,l,o,c,s,d,a,u,n)}function fi(t){switch(t.renderer.type){case"texture":return Ge.fromObject(t);case"gradient":return lt.fromObject(t);case"linear-gradient":return Rt.fromObject(t);case"radial-gradient":return Et.fromObject(t)}return t}const qp=Math.cos,Xp=Math.sin,Uc=Math.tan,Bs=[],Ft=class Ft extends ne{constructor(n,r,o,s,a,l){super();T(this,"elements",new Fc(9));T(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,o){if(r.length<=3){const w=n;let v,k,B;const R=r[0]||0,E=r[1]||0,P=r[2]||0;return v=w[0]*R+w[1]*E+w[2]*P,k=w[3]*R+w[4]*E+w[5]*P,B=w[6]*R+w[7]*E+w[8]*P,[v,k,B]}const s=n[0],a=n[1],l=n[2],c=n[3],d=n[4],u=n[5],h=n[6],f=n[7],g=n[8],m=r[0],p=r[1],b=r[2],y=r[3],_=r[4],C=r[5],x=r[6],N=r[7],$=r[8];return o=o||new Fc(9),o[0]=s*m+a*y+l*x,o[1]=s*p+a*_+l*N,o[2]=s*b+a*C+l*$,o[3]=c*m+d*y+u*x,o[4]=c*p+d*_+u*N,o[5]=c*b+d*C+u*$,o[6]=h*m+f*y+g*x,o[7]=h*p+f*_+g*N,o[8]=h*b+f*C+g*$,o}static fromObject(n){return new Ft().copy(n)}set(n,r,o,s,a,l,c,d,u){if(typeof r>"u"){const h=n;n=h[0],r=h[1],o=h[2],s=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=o,this.elements[3]=s,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=u,this.trigger(ne.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(ne.Types.change)}identity(){return this.elements[0]=Ft.Identity[0],this.elements[1]=Ft.Identity[1],this.elements[2]=Ft.Identity[2],this.elements[3]=Ft.Identity[3],this.elements[4]=Ft.Identity[4],this.elements[5]=Ft.Identity[5],this.elements[6]=Ft.Identity[6],this.elements[7]=Ft.Identity[7],this.elements[8]=Ft.Identity[8],this.trigger(ne.Types.change)}multiply(n,r,o,s,a,l,c,d,u){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(ne.Types.change);if(typeof o>"u"&&(o=1),typeof s>"u"){n=n||0,r=r||0,o=o||0,a=this.elements;const I=a[0]*n+a[1]*r+a[2]*o,Z=a[3]*n+a[4]*r+a[5]*o,te=a[6]*n+a[7]*r+a[8]*o;return[I,Z,te]}const h=this.elements,f=[n,r,o,s,a,l,c,d,u],g=h[0],m=h[1],p=h[2],b=h[3],y=h[4],_=h[5],C=h[6],x=h[7],N=h[8],$=f[0],w=f[1],v=f[2],k=f[3],B=f[4],R=f[5],E=f[6],P=f[7],W=f[8];return this.elements[0]=g*$+m*k+p*E,this.elements[1]=g*w+m*B+p*P,this.elements[2]=g*v+m*R+p*W,this.elements[3]=b*$+y*k+_*E,this.elements[4]=b*w+y*B+_*P,this.elements[5]=b*v+y*R+_*W,this.elements[6]=C*$+x*k+N*E,this.elements[7]=C*w+x*B+N*P,this.elements[8]=C*v+x*R+N*W,this.trigger(ne.Types.change)}inverse(n){const r=this.elements;n=n||new Ft;const o=r[0],s=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],g=f*c-d*h,m=-f*l+d*u,p=h*l-c*u;let b=o*g+s*m+a*p;return b?(b=1/b,n.elements[0]=g*b,n.elements[1]=(-f*s+a*h)*b,n.elements[2]=(d*s-a*c)*b,n.elements[3]=m*b,n.elements[4]=(f*o-a*u)*b,n.elements[5]=(-d*o+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-h*o+s*u)*b,n.elements[8]=(c*o-s*l)*b,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=qp(n),o=Xp(n);return this.multiply(r,-o,0,o,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=Uc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Uc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Bs.length=0,this.toTransformArray(n,Bs),Bs.map(bn).join(" ")}toTransformArray(n,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],h=o[5];if(n){const f=o[6],g=o[7],m=o[8];if(s){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=u,r[5]=g,r[6]=c,r[7]=h,r[8]=m;return}return[a,d,f,l,u,g,c,h,m]}if(s){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(n,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],h=o[5];if(n){const f=o[6],g=o[7],m=o[8];if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=f,r[7]=g,r[8]=m;return}return[a,l,c,d,u,h,f,g,m]}if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ft().copy(this)}};T(Ft,"Identity",[1,0,0,0,1,0,0,0,1]);let pr=Ft;Bp(pr);const Vr=class Vr extends gr{constructor(){super();T(this,"_flagMatrix",!0);T(this,"_flagScale",!1);T(this,"_matrix",null);T(this,"_worldMatrix",null);T(this,"_position",null);T(this,"_rotation",0);T(this,"_scale",1);T(this,"_skewX",0);T(this,"_skewY",0);for(let n in uo)Object.defineProperty(this,n,uo[n]);this._renderer.flagMatrix=Kc.bind(this),this.isShape=!0,this.matrix=new pr,this.worldMatrix=new pr,this.position=new be,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 uo.position.get.apply(this,arguments)}set translation(n){uo.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 be?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 be?n.scale:new be(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 be?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 be?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}};T(Vr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Rn=Vr;const uo={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ne.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ne.Types.change,this._renderer.flagMatrix),Kc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof be&&this._scale.unbind(ne.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof be&&this._scale.bind(ne.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Tp(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Kc(){this._flagMatrix=!0}const qi=Math.min,Xi=Math.max,Yp=Math.ceil,Up=Math.floor,Kp=new be,sn=class sn extends Rn{constructor(n,r,o,s){super();T(this,"_flagVertices",!0);T(this,"_flagLength",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagCap",!0);T(this,"_flagJoin",!0);T(this,"_flagMiter",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_flagMask",!1);T(this,"_flagClip",!1);T(this,"_length",0);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_cap","round");T(this,"_join","round");T(this,"_miter",4);T(this,"_closed",!0);T(this,"_curved",!1);T(this,"_automatic",!0);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_mask",null);T(this,"_clip",!1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);for(let a in Gc)Object.defineProperty(this,a,Gc[a]);this._renderer.type="path",this._renderer.flagVertices=Zc.bind(this),this._renderer.bindVertices=Qc.bind(this),this._renderer.unbindVertices=Jc.bind(this),this._renderer.flagFill=ed.bind(this),this._renderer.flagStroke=td.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!o,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=!s,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),o=typeof n.stroke=="string"?n.stroke:fi(n.stroke),s=new sn().copy({...n,fill:r,stroke:o});return"id"in n&&(s.id=n.id),s}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const o=n.vertices[r];o instanceof Fe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Fe().copy(o))}}for(let r=0;r<sn.Properties.length;r++){const o=sn.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new sn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<sn.Properties.length;o++){const s=sn.Properties[o];r[s]=this[s]}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(sn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,o=n.height/2,s=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-=s,c.y-=a,c.x+=r,c.y+=o}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=o),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,o=n.top+n.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const a=this.vertices[s];a.x-=r,a.y-=o}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getBoundingClientRect(n){let r,o,s,a,l,c,d=1/0,u=-1/0,h=1/0,f=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,o=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:m}=Sp(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof m=="number"&&(o=Math.max(g,m)*(this.linewidth||0)/2)}else o*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(a=0;a<s;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+s-1)%s];const[g,m]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[C,x]=r.multiply(y,_),N=c.controls.left.x,$=c.controls.left.y;c.relative&&(N+=c.x,$+=c.y);let[w,v]=r.multiply(N,$);const k=Ep(g,m,C,x,w,v,p,b);h=qi(k.min.y-o,h),d=qi(k.min.x-o,d),u=Xi(k.max.x+o,u),f=Xi(k.max.y+o,f)}else a<=1&&(h=qi(m-o,h),d=qi(g-o,d),u=Xi(g+o,u),f=Xi(m+o,f)),h=qi(b-o,h),d=qi(p-o,d),u=Xi(p+o,u),f=Xi(b+o,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}getPointAt(n,r){let o,s,a,l,c,d,u,h,f,g,m,p,b,y,_,C=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,N=x-1;let $=null,w=null;for(let D=0,L=this._lengths.length,H=0;D<L;D++){if(H+this._lengths[D]>=C){this._closed?(o=ji(D,x),s=ji(D-1,x),D===0&&(o=s,s=D)):(o=D,s=Math.min(Math.max(D-1,0),N)),$=this.vertices[o],w=this.vertices[s],C-=H,this._lengths[D]!==0?n=C/this._lengths[D]:n=0;break}H+=this._lengths[D]}if($===null||w===null)return null;if($){if(!w)return $}else return w;_=w.controls&&w.controls.right,y=$.controls&&$.controls.left,c=w.x,g=w.y,d=(_||w).x,m=(_||w).y,u=(y||$).x,p=(y||$).y,h=$.x,b=$.y,_&&w.relative&&(d+=w.x,m+=w.y),y&&$.relative&&(u+=$.x,p+=$.y),l=so(n,c,d,u,h),f=so(n,g,m,p,b);const v=Zt(c,d,n),k=Zt(g,m,n),B=Zt(d,u,n),R=Zt(m,p,n),E=Zt(u,h,n),P=Zt(p,b,n),W=Zt(v,B,n),I=Zt(k,R,n),Z=Zt(B,E,n),te=Zt(R,P,n);return Me.isObject(r)?(r.x=l,r.y=f,r instanceof Fe&&(r.controls.left.x=W,r.controls.left.y=I,r.controls.right.x=Z,r.controls.right.y=te,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=f,r.controls.right.x-=l,r.controls.right.y-=f)),r.t=n,r):(a=new Fe(l,f,W-l,I-f,Z-l,te-f,this._curved?pe.curve:pe.line),a.t=n,a)}plot(){if(this.curved)return Fp(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,o=this._closed||this.vertices[r]._command===pe.close;let s=this.vertices[r],a=[],l;return Me.each(this.vertices,function(c,d){if(d<=0&&!o){s=c;return}if(c.command===pe.move){a.push(new Fe(s.x,s.y)),d>0&&(a[a.length-1].command=pe.line),s=c;return}l=Yc(c,s,n),a=a.concat(l),Me.each(l,function(u,h){h<=0&&s.command===pe.move?u.command=pe.move:u.command=pe.line}),d>=r&&(this._closed&&this._automatic&&(s=c,l=Yc(c,s,n),a=a.concat(l),Me.each(l,function(u,h){h<=0&&s.command===pe.move?u.command=pe.move:u.command=pe.line})),a.push(new Fe(c.x,c.y)),a[a.length-1].command=o?pe.close:pe.line),s=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const s=this.vertices.length-1;let a=this.vertices[s],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]=Xc(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,o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),a=co(this,o*this._length),l=co(this,s*this._length),c=Yp(a),d=Up(l);let u,h,f,g,m,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Fe),p>d&&!h?(m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,m),m.command=this._renderer.collection[p].command,this._renderer.vertices.push(m),h=m,f=this._collection[p-1],f&&f.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),f.relative?this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(be.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(f,1-m.t))):p>=c&&p<=d&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===d&&qc(this,s)?(h=m,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):p===c&&qc(this,o)&&(u=m,u.command=pe.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(p=c-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,m),m.command=pe.move,this._renderer.vertices.unshift(m),g=this._collection[p+1],g&&g.controls&&(m.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(be.zero,m.t):(Kp.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,m.t))))}return Rn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Rn.prototype.flagReset.call(this),this}};T(sn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),T(sn,"Utils",{getCurveLength:Xc});let Ae=sn;const Gc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Me.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ne.Types.insert,e).unbind(ne.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Me.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Zc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Qc(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Jc(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ed(){this._flagFill=!0}function td(){this._flagStroke=!0}const Gp=Math.ceil,Zp=Math.floor,Sn=class Sn extends Rn{constructor(n){super();T(this,"_flagVertices",!0);T(this,"_flagLength",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagSize",!0);T(this,"_flagSizeAttenuation",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_length",0);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_size",1);T(this,"_sizeAttenuation",!1);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);T(this,"noFill",Ae.prototype.noFill);T(this,"noStroke",Ae.prototype.noStroke);T(this,"corner",Ae.prototype.corner);T(this,"center",Ae.prototype.center);T(this,"getBoundingClientRect",Ae.prototype.getBoundingClientRect);T(this,"_updateLength",Ae.prototype._updateLength);for(let r in nd)Object.defineProperty(this,r,nd[r]);this._renderer.type="points",this._renderer.flagVertices=Zc.bind(this),this._renderer.bindVertices=Qc.bind(this),this._renderer.unbindVertices=Jc.bind(this),this._renderer.flagFill=ed.bind(this),this._renderer.flagStroke=td.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),o=typeof n.stroke=="string"?n.stroke:fi(n.stroke),s=new Sn().copy({...n,fill:r,stroke:o});return"id"in n&&(s.id=n.id),s}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const o=n.vertices[r];o instanceof Fe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Fe().copy(o))}for(let r=0;r<Sn.Properties.length;r++){const o=Sn.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new Sn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Sn.Properties.length;o++){const s=Sn.Properties[o];r[s]=this[s]}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(Sn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(n){this._update();let r=[];for(let o=0;o<this.vertices.length;o++){const s=this.vertices[o],a=this.vertices[o-1];if(!a)continue;const l=s.x,c=s.y,d=a.x,u=a.y,h=Ac(l,c,l,c,d,u,d,u,n);r=r.concat(h)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),o=co(this,n*this._length),s=co(this,r*this._length),a=Gp(o),l=Zp(s);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};T(Sn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let ho=Sn;const nd={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ne.Types.insert,e).unbind(ne.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class id extends ui{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Xa(this,zo,{});this.attach(n),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return Mt(this,zo)}attach(n){for(let r=0;r<n.length;r++){const o=n[r];o&&o.id&&(this.ids[o.id]=o)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}zo=new WeakMap;const Mn=class Mn extends Ae{constructor(n,r,o,s,a,l,c){const d=c||Ss.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Fe);super(u,!0,!1,!0);T(this,"_flagStartAngle",!1);T(this,"_flagEndAngle",!1);T(this,"_flagInnerRadius",!1);T(this,"_flagOuterRadius",!1);T(this,"_startAngle",0);T(this,"_endAngle",di);T(this,"_innerRadius",0);T(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in rd)Object.defineProperty(this,h,rd[h]);typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const o=Mn.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,o=this._innerRadius,s=this._outerRadius,a=ji(n,di)===ji(r,di),l=o>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,f,g,m,p,b,y,_,C,x;for(a?d--:l||(d-=2),f=0,g=d-1;f<d;f++){switch(m=f/g,p=c[h],b=m*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),C=s*Math.sin(b),f){case 0:u=pe.move;break;default:u=pe.curve}p.command=u,p.x=_,p.y=C,p.controls.left.clear(),p.controls.right.clear(),p.command===pe.curve&&(x=s*y/Math.PI,p.controls.left.x=x*Math.cos(b-ht),p.controls.left.y=x*Math.sin(b-ht),p.controls.right.x=x*Math.cos(b+ht),p.controls.right.y=x*Math.sin(b+ht),f===1&&p.controls.left.multiplyScalar(2),f===g&&p.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=pe.close,h++):(d--,g=d-1),f=0;f<d;f++)m=f/g,p=c[h],b=(1-m)*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),C=o*Math.sin(b),u=pe.curve,f<=0&&(u=a?pe.move:pe.line),p.command=u,p.x=_,p.y=C,p.controls.left.clear(),p.controls.right.clear(),p.command===pe.curve&&(x=o*y/Math.PI,p.controls.left.x=x*Math.cos(b+ht),p.controls.left.y=x*Math.sin(b+ht),p.controls.right.x=x*Math.cos(b-ht),p.controls.right.y=x*Math.sin(b-ht),f===1&&p.controls.left.multiplyScalar(2),f===g&&p.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=pe.line}else a||(c[h].command=pe.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].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,o=this.outerRadius,s=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new Mn(0,0,r,o,s,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<Ae.Properties.length;d++){const u=Ae.Properties[d];c[u]=this[u]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Mn.Properties.length;r++){const o=Mn.Properties[r];n[o]=this[o]}return n}};T(Mn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ts=Mn;const rd={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},Ns=Math.cos,$s=Math.sin,An=class An extends Ae{constructor(n,r,o,s){const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Fe(0,0,0,0,0,0));super(l,!0,!0,!0);T(this,"_flagRadius",!1);T(this,"_radius",0);this._renderer.type="circle";for(let c in od)Object.defineProperty(this,c,od[c]);typeof o=="number"&&(this.radius=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const o=An.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}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)),o=this._radius,s=o*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*di,d=o*Ns(c),u=o*$s(c),h=s*Ns(c-ht),f=s*$s(c-ht),g=s*Ns(c+ht),m=s*$s(c+ht),p=this.vertices[a];p.command=a===0?pe.move:pe.curve,p.set(d,u),p.controls.left.set(h,f),p.controls.right.set(g,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new An(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let o=0;o<Ae.Properties.length;o++){const s=Ae.Properties[o];r[s]=this[s]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<An.Properties.length;r++){const o=An.Properties[r];n[o]=this[o]}return n}};T(An,"Properties",["radius"]);let Rs=An;const od={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Es=Math.cos,Ps=Math.sin,In=class In extends Ae{constructor(n,r,o,s,a){typeof s!="number"&&typeof o=="number"&&(s=o);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Fe);super(c,!0,!0,!0);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_width",0);T(this,"_height",0);this._renderer.type="ellipse";for(let d in sd)Object.defineProperty(this,d,sd[d]);typeof o=="number"&&(this.width=o*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const o=In.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}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)),o=this._width/2,s=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*di,d=o*Es(c),u=s*Ps(c),h=o*r*Es(c-ht),f=s*r*Ps(c-ht),g=o*r*Es(c+ht),m=s*r*Ps(c+ht),p=this.vertices[a];p.command=a===0?pe.move:pe.curve,p.set(d,u),p.controls.left.set(h,f),p.controls.right.set(g,m)}}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,o=this.height/2,s=this.vertices.length,a=new In(0,0,r,o,s);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<Ae.Properties.length;l++){const c=Ae.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<In.Properties.length;r++){const o=In.Properties[r];n[o]=this[o]}return n}};T(In,"Properties",["width","height"]);let Fs=In;const sd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Qp=Math.cos,Jp=Math.sin,On=class On extends Ae{constructor(n,r,o,s){s=Math.max(s||0,3);super();T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_flagSides",!1);T(this,"_radius",0);T(this,"_width",0);T(this,"_height",0);T(this,"_sides",0);this._renderer.type="polygon";for(let a in ad)Object.defineProperty(this,a,ad[a]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.radius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const o=On.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let o=this.vertices.length;o>n&&(this.vertices.splice(n-1,o-n),o=n);for(let s=0;s<r;s++){const a=(s+.5)/n,l=di*a+Math.PI/2,c=this._width*Qp(l)/2,d=this._height*Jp(l)/2;s>=o?this.vertices.push(new Fe(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===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 On(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 o=0;o<Ae.Properties.length;o++){const s=Ae.Properties[o];r[s]=this[s]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<On.Properties.length;r++){const o=On.Properties[r];n[o]=this[o]}return n}};T(On,"Properties",["width","height","sides"]);let Vs=On;const ad={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Ti=class Ti extends Ae{constructor(n,r,o,s){const a=[new Fe,new Fe,new Fe,new Fe];super(a,!0,!1,!0);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_width",0);T(this,"_height",0);T(this,"_origin",null);this._renderer.type="rectangle";for(let l in ld)Object.defineProperty(this,l,ld[l]);this.width=typeof o=="number"?o:1,this.height=typeof s=="number"?s:1,this.origin=new be,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ti.Properties.length;r++){const o=Ti.Properties[r];o in n&&(typeof n[o]=="number"?this[o]=n[o]:this[o]instanceof be&&this[o].copy(n[o]))}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 Fe),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 Ti(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let o=0;o<Ae.Properties.length;o++){const s=Ae.Properties[o];r[s]instanceof be?r[s].copy(this[s]):r[s]=this[s]}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}};T(Ti,"Properties",["width","height","origin"]);let yr=Ti;const ld={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(ne.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ne.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},zn=class zn extends Ae{constructor(n,r,o,s,a){typeof a>"u"&&typeof o=="number"&&typeof s=="number"&&(a=Math.floor(Math.min(o,s)/12));const l=[];for(let c=0;c<10;c++)l.push(new Fe(0,0,0,0,0,0,c===0?pe.move:pe.curve));super(l);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_flagRadius",!1);T(this,"_width",0);T(this,"_height",0);T(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in cd)Object.defineProperty(this,c,cd[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=ey.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof a=="number"||a instanceof be)&&(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 zn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<zn.Properties.length;r++){const o=zn.Properties[r];if(o in n){const s=n[o];/radius/i.test(o)?this[o]=typeof s=="number"||s instanceof be?s:new be().copy(s):typeof s=="number"&&(this[o]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let o,s;this._radius instanceof be?(o=this._radius.x,s=this._radius.y):(o=this._radius,s=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-o),a.y=-c,a=this.vertices[1],a.x=l-o,a.y=-c,a.controls.left.clear(),a.controls.right.x=o,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-s),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-s,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=s,a=this.vertices[4],a.x=l-o,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-o),a.y=c,a.controls.left.clear(),a.controls.right.x=-o,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-s,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-s),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-s,a=this.vertices[8],a.x=-(l-o),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,o=this.height,s=this.radius,a=new zn(0,0,r,o,s);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<Ae.Properties.length;l++){const c=Ae.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<zn.Properties.length;r++){const o=zn.Properties[r];n[o]=this[o]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};T(zn,"Properties",["width","height","radius"]);let Ms=zn;const cd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof be&&this._radius.unbind(ne.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof be&&this._radius.bind(ne.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function ey(){this._flagRadius=!0}const ty=Math.cos,ny=Math.sin,Dn=class Dn extends Ae{constructor(n,r,o,s,a){arguments.length<=3&&(s=o,o=s/2),(typeof a!="number"||a<=0)&&(a=5);super();T(this,"_flagInnerRadius",!1);T(this,"_flagOuterRadius",!1);T(this,"_flagSides",!1);T(this,"_innerRadius",0);T(this,"_outerRadius",0);T(this,"_sides",0);this._renderer.type="star";for(let l in dd)Object.defineProperty(this,l,dd[l]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),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 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 o=Dn.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let o=this.vertices.length;o>n&&(this.vertices.splice(n-1,o-n),o=n);for(let s=0;s<r;s++){const a=(s+.5)/n,l=di*a,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*ty(l),u=c*ny(l);s>=o?this.vertices.push(new Fe(d,u)):this.vertices[s].set(d,u),this.vertices[s].command=s===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,o=this.outerRadius,s=this.sides,a=new Dn(0,0,r,o,s);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<Ae.Properties.length;l++){const c=Ae.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<Dn.Properties.length;r++){const o=Dn.Properties[r];n[o]=this[o]}return n}};T(Dn,"Properties",["innerRadius","outerRadius","sides"]);let As=Dn;const dd={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let Is;const ud=Math.min,hd=Math.max;yn.document&&(Is=document.createElement("canvas"));const St=class St extends Rn{constructor(n,r,o,s){super();T(this,"_flagValue",!0);T(this,"_flagFamily",!0);T(this,"_flagSize",!0);T(this,"_flagLeading",!0);T(this,"_flagAlignment",!0);T(this,"_flagBaseline",!0);T(this,"_flagStyle",!0);T(this,"_flagWeight",!0);T(this,"_flagDecoration",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagMask",!1);T(this,"_flagClip",!1);T(this,"_flagDirection",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_value","");T(this,"_family","sans-serif");T(this,"_size",13);T(this,"_leading",17);T(this,"_alignment","center");T(this,"_baseline","middle");T(this,"_style","normal");T(this,"_weight",500);T(this,"_decoration","none");T(this,"_direction","ltr");T(this,"_fill","#000");T(this,"_stroke","none");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_mask",null);T(this,"_clip",!1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);for(let a in fd)Object.defineProperty(this,a,fd[a]);if(this._renderer.type="text",this._renderer.flagFill=iy.bind(this),this._renderer.flagStroke=ry.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof o=="number"&&(this.translation.y=o),this.dashes=[],this.dashes.offset=0,!Me.isObject(s))return this;for(let a=0;a<St.Properties.length;a++){const l=St.Properties[a];l in s&&(this[l]=s[l])}}static Measure(n){if(Is){const r=Is.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const o=r.measureText(n.value,0,0),s=o.actualBoundingBoxDescent+o.actualBoundingBoxAscent;return{width:o.width,height:s}}else{const r=this.value.length*this.size*St.Ratio,o=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:o}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),o=typeof n.stroke=="string"?n.stroke:fi(n.stroke),s=new St().copy({...n,fill:r,stroke:o});return"id"in n&&(s.id=n.id),s}copy(n){super.copy.call(this,n);for(let r=0;r<St.Properties.length;r++){const o=St.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new St(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let o=0;o<St.Properties.length;o++){const s=St.Properties[o];r[s]=this[s]}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<St.Properties.length;r++){const o=St.Properties[r];n[o]=this[o]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,o,s,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=St.Measure(this),u=(this._linewidth||0)/2;switch(this.alignment){case"left":o=-u,s=c+u;break;case"right":o=-(c+u),s=u;break;default:o=-(c/2+u),s=c/2+u}switch(this.baseline){case"middle":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,f]=r.multiply(o,a),[g,m]=r.multiply(o,l),[p,b]=r.multiply(s,a),[y,_]=r.multiply(s,l);return a=ud(f,m,b,_),o=ud(h,g,p,y),s=hd(h,g,p,y),l=hd(f,m,b,_),{top:a,left:o,right:s,bottom:l,width:s-o,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}};T(St,"Ratio",.6),T(St,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Yi=St;const fd={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Me.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function iy(){this._flagFill=!0}function ry(){this._flagStroke=!0}const Ln=class Ln extends yr{constructor(n,r,o,s){super(r,o,0,0);T(this,"_flagTextures",!1);T(this,"_flagFrameRate",!1);T(this,"_flagIndex",!1);T(this,"_amount",1);T(this,"_duration",0);T(this,"_index",0);T(this,"_startTime",0);T(this,"_playing",!1);T(this,"_firstFrame",0);T(this,"_lastFrame",0);T(this,"_loop",!0);T(this,"_textures",null);T(this,"_frameRate",0);T(this,"_origin",null);this._renderer.type="image-sequence";for(let a in md)Object.defineProperty(this,a,md[a]);this._renderer.flagTextures=oy.bind(this),this._renderer.bindTextures=sy.bind(this),this._renderer.unbindTextures=ay.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(gd.bind(this)):typeof n=="string"&&(this.textures=[gd(n)]),this.origin=new be,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Ln.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Ln().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ln.Properties.length;r++){const o=Ln.Properties[r];o in n&&(this[o]=n[o])}return this}play(n,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Me.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof o=="function"?this._onLastFrame=o:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(n){const r=new Ln(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,o,s,a,l,c,d,u;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,Me.isNaN(this._lastFrame)&&(this._lastFrame=a-1),s=Me.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?s=s%l:s=Math.min(s,l),d=Zt(this._firstFrame,u,s/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,o=c.image.height,this.width!==r&&(this.width=r),this.height!==o&&(this.height=o),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Ge))&&(c=n[this._index],c.loaded&&(r=c.image.width,o=c.image.height,this.width!==r&&(this.width=r),this.height!==o&&(this.height=o)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};T(Ln,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),T(Ln,"DefaultFrameRate",30);let Os=Ln;const md={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(ne.Types.insert,e).unbind(ne.Types.remove,n),this._textures=new ui((t||[]).slice(0)),this._textures.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function oy(){this._flagTextures=!0}function sy(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function ay(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function gd(t){if(t instanceof Ge)return t;if(typeof t=="string")return new Ge(t)}const Ni=class Ni extends yr{constructor(n,r,o,s,a,l){super(r,o,0,0);T(this,"_flagTexture",!1);T(this,"_flagColumns",!1);T(this,"_flagRows",!1);T(this,"_flagFrameRate",!1);T(this,"_flagIndex",!1);T(this,"_amount",1);T(this,"_duration",0);T(this,"_startTime",0);T(this,"_playing",!1);T(this,"_firstFrame",0);T(this,"_lastFrame",0);T(this,"_loop",!0);T(this,"_texture",null);T(this,"_columns",1);T(this,"_rows",1);T(this,"_frameRate",0);T(this,"_index",0);T(this,"_origin",null);this._renderer.type="sprite";for(let c in pd)Object.defineProperty(this,c,pd[c]);this.noStroke(),this.noFill(),n instanceof Ge?this.texture=n:typeof n=="string"&&(this.texture=new Ge(n)),this.origin=new be,this._update(),typeof s=="number"&&(this.columns=s),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new Ni().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ni.Properties.length;r++){const o=Ni.Properties[r];o in n&&(this[o]=n[o])}return this}play(n,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Me.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof o=="function"?this._onLastFrame=o:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(n){const r=new Ni(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,o=this._rows;let s,a,l,c,d,u,h,f,g;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){h=n.image.width,f=n.image.height,s=h/r,a=f/o,c=this._amount,this.width!==s&&(this.width=s),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Me.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Me.performance.now()-this._startTime,g=this._lastFrame+1,d=1e3*(g-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Zt(this._firstFrame,g,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%r,p=Math.floor(this._index/r),b=-s*m+(h-s)/2,y=-a*p+(f-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};T(Ni,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let zs=Ni;const pd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},fo=Math.min,mo=Math.max,an=class an extends Rn{constructor(n){super();T(this,"_flagAdditions",!1);T(this,"_flagSubtractions",!1);T(this,"_flagOrder",!1);T(this,"_flagOpacity",!0);T(this,"_flagBeginning",!1);T(this,"_flagEnding",!1);T(this,"_flagLength",!1);T(this,"_flagMask",!1);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_cap","round");T(this,"_join","round");T(this,"_miter",4);T(this,"_closed",!0);T(this,"_curved",!1);T(this,"_automatic",!0);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_length",0);T(this,"_mask",null);T(this,"_strokeAttenuation",!0);for(let r in yd)Object.defineProperty(this,r,yd[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++)bd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)bd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new an;for(let s=0;s<an.Properties.length;s++){const a=an.Properties[s];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:fi(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=o(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(o),r;function o(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return Ts.fromObject(s);case"circle":return Rs.fromObject(s);case"element":return gr.fromObject(s);case"ellipse":return Fs.fromObject(s);case"group":return an.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return Os.fromObject(s);case"path":return Ae.fromObject(s);case"points":return ho.fromObject(s);case"polygon":return Vs.fromObject(s);case"rectangle":return yr.fromObject(s);case"rounded-rectangle":return Ms.fromObject(s);case"shape":return Rn.fromObject(s);case"sprite":return zs.fromObject(s);case"star":return As.fromObject(s);case"text":return Yi.fromObject(s)}return s}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<an.Properties.length;r++){const o=an.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new an,o=this.children.map(function(s){return s.clone()});return r.add(o),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,o)=>{n.children[o]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const o=this.children[r];o.translation.x-=n.left,o.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,o=n.top+n.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const a=this.children[s];a.isShape&&(a.translation.x-=r,a.translation.y-=o)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getById(n){let r=null;function o(s){if(s.id===n)return s;if(s.children){if(s.children.ids[n])return s.children.ids[n];for(let a=0;a<s.children.length;a++)if(r=o(s.children[a]),r)return r}return null}return o(this)}getByClassName(n){const r=[];function o(s){if(Array.prototype.indexOf.call(s.classList,n)>=0&&r.push(s),s.children)for(let a=0;a<s.children.length;a++){const l=s.children[a];o(l)}return r}return o(this)}getByType(n){const r=[];function o(s){if(s instanceof n&&r.push(s),s.children)for(let a=0;a<s.children.length;a++){const l=s.children[a];o(l)}return r}return o(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const o=n[r];if(!(o&&o.id))continue;const s=Array.prototype.indexOf.call(this.children,o);s>=0&&this.children.splice(s,1),this.children.push(o)}return this}remove(n){const r=arguments.length,o=this.parent;if(r<=0&&o)return o.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let s=0;s<n.length;s++){const a=n[s];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,o,s,a,l,c;this._update(!0);let d=1/0,u=-1/0,h=1/0,f=-1/0;const g=/texture|gradient/i;o=n?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const p=this.children[m];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),s=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),!(s||a||l||c)))if(n){const[b,y]=o.multiply(r.left,r.top),[_,C]=o.multiply(r.right,r.top),[x,N]=o.multiply(r.left,r.bottom),[$,w]=o.multiply(r.right,r.bottom);h=fo(y,C,N,w,h),d=fo(b,_,x,$,d),u=mo(b,_,x,$,u),f=mo(y,C,N,w,f)}else h=fo(r.top,h),d=fo(r.left,d),u=mo(r.right,u),f=mo(r.bottom,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,o;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=s*l,u=a*l;for(n=0;n<this.children.length;n++)o=this.children[n],r=o.length,d>c+r?(o.beginning=1,o.ending=1):u<c?(o.beginning=0,o.ending=0):d>c&&d<c+r?(o.beginning=(d-c)/r,o.ending=1):u>c&&u<c+r?(o.beginning=0,o.ending=(u-c)/r):(o.beginning=0,o.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}};T(an,"Children",id),T(an,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let En=an;const yd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=En.InsertChildren.bind(this),n=En.RemoveChildren.bind(this),r=En.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new id(t),this._children.bind(ne.Types.insert,e),this._children.bind(ne.Types.remove,n),this._children.bind(ne.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Me.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function bd(t,e){const n=t.parent;let r;if(n===e){o();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),s()),e){o();return}s(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function o(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function s(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class go extends Ae{constructor(e,n,r,o){const s=[new Fe(e,n),new Fe(r,o)];super(s);for(let a in _d)Object.defineProperty(this,a,_d[a]);this.vertices[0].command=pe.move,this.vertices[1].command=pe.line,this.automatic=!1}}T(go,"Properties",["left","right"]);const _d={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Me.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=pe.move;else{const e=new ao("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Me.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=pe.line;else{const e=new ao("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Ds{constructor(e=0,n=0){this.x=e,this.y=n}}class _n{constructor(e=10,n=0,r="A"){T(this,"start",new Ds);T(this,"end",new Ds);this.width=e,this.angle=n,this.label=r}}const qe={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"}},ly={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cy(t,e){return i.openBlock(),i.createElementBlock("svg",ly,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const po=i.markRaw({name:"ion-close",render:cy}),dy={class:"mr-3 flex flex-col gap-2"},uy=["onClick"],hy={class:"h-full p-2"},fy={},my=i.defineComponent({...fy,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.ref(!1),o=i.useTemplateRef("drawing-template-containers"),s=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((u,h)=>{var g;const f=(g=o.value)==null?void 0:g.at(h);f&&a("init-draw-template",f,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var g;const f=(g=s.value)==null?void 0:g.at(h);f&&a("init-draw-template",f,u)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((u,h)=>{var f;if(!(d!=null&&d.includes(u))){const g=(f=s.value)==null?void 0:f.at(h);g&&a("init-draw-template",g,u)}}),d.length>c.length&&d.forEach((u,h)=>{var g;const f=(g=s.value)==null?void 0:g.at(h);f&&(f.innerHTML="",a("init-draw-template",f,u))})})},{deep:!0}),(c,d)=>{const u=po;return i.openBlock(),i.createBlock(i.unref(A.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",dy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(h,f)=>(i.openBlock(),i.createElementBlock("div",{key:`${h.id}-${f}`,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":f===t.selectTemplateIndex}]),onClick:g=>a("template:select",f)},[i.createElementVNode("div",hy,[i.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,uy)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:g=>l(f)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),wd=Nn(my,[["__scopeId","data-v-afccb364"]]),gy={class:"flex gap-3 min-w-[20rem] relative"},py={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},yy={ref:"drawing-container",class:"size-full"},by={},xd=i.defineComponent({...by,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("drawing-container");let s=[],a=[],l=[],c=null;const d=.75,u=i.computed(()=>n.value.configuratorParams.linesAngles.map((D,L)=>new _n(n.value.configuratorParams.linesWidths[L],D,`A-${L+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var D,L;return n.value.configuratorParams.startTailType&&((D=n.settings.startTailConfigs)!=null&&D[n.value.configuratorParams.startTailType])?(L=n.settings.startTailConfigs)==null?void 0:L[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var L;const D=n.value.configuratorParams.endTailType!==void 0&&((L=n.settings.endTailConfigs)==null?void 0:L[n.value.configuratorParams.endTailType]);return!D||!D.points?[]:D.points.map((H,z)=>Array.isArray(H)?new _n(H[0],H[1],`A-${z+1}`):new _n(H.width,H.angle,`A-${z+1}`))}),m=(D,L=!1)=>{D[0].start.x=0,D[0].start.y=0;let H=0;for(let z=0;z<D.length;z++){const O=D[z],U=D[z-1]??new _n(0,H);H+=!L||z>1?U.angle:0;const K=(!L||z>0?O.angle:0)+H;if(D[z].end.x=O.width*Math.cos(K*Math.PI/180)+D[z].start.x,D[z].end.y=O.width*Math.sin(K*Math.PI/180)+D[z].start.y,z<D.length-1){const V=z+1;D[V].start.x=D[z].end.x,D[V].start.y=D[z].end.y}}return D},p=(D,L,H,z,O=!1)=>{let U=m([...H,...z]);L.length>0&&(U=[...m(L),...U]);let K=0,V=0,q=0,Y=0;U.forEach(Te=>{K=Math.min(K,Te.start.x,Te.end.x),V=Math.min(V,Te.start.y,Te.end.y),q=Math.max(q,Te.start.x,Te.end.x),Y=Math.max(Y,Te.start.y,Te.end.y)});let ee,ue;K===0&&V===0&&q===0&&Y===0?(ee=1,ue=1):(ee=D.width/Math.abs(q-K),ue=(O?D.height:D.height-qe.colorSideLabel.size)/Math.abs(Y-V));const ve=Math.min(ee,ue);return K=K<0?-K*ve:0,V=V<0?-V*ve:0,[ve,K,V]},b=D=>{const L=new ho([D]);return L._size=qe.anchorPoint.size,L.fill=qe.anchorPoint.color,L.stroke="transparent",L._linewidth=qe.anchorPoint.strokeSize,l.push(L),L},y=(D,L)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=D[0],z=new be(H.vertices[0].x,H.vertices[0].y);z.bind(ne.Types.change,()=>{H.vertices[0].copy(z)});const O=b(z);L.add(O)}D.forEach((H,z)=>{const O=D[z+1],U=new be(H.vertices[1].x,H.vertices[1].y);U.bind(ne.Types.change,()=>{H.vertices[1].copy(U),O!==void 0&&O.vertices[0].copy(U)});const K=b(U);L.add(K)})},_=D=>D*(Math.PI/180),C=(D,L,H)=>{const z=L.vertices.length-1;D.position.x=L.vertices[z].x,D.position.y=L.vertices[z].y;const O=Math.atan2(L.vertices[z].y-L.vertices[0].y,L.vertices[z].x-L.vertices[0].x);D.rotation=_(H)+O},x=(D,L,H)=>{if(L.vertices[0]===void 0)return;D.position.x=L.vertices[0].x,D.position.y=L.vertices[0].y;const z=L.vertices.length-1,O=Math.atan2(L.vertices[z].y-L.vertices[0].y,L.vertices[z].x-L.vertices[0].x);D.rotation=_(H)+O},N=(D,L,H)=>{const z=new En;if(D.length===0)return z;const O=[];return[...D].reverse().forEach((U,K)=>{K!==0&&U.angle>0&&(U.angle*=-1),O.push(U)}),D=m(O,!0),x(z,L,D[0].angle),[L.vertices[0],L.vertices[1]].forEach(U=>{U.bind(ne.Types.change,()=>{x(z,L,D[0].angle)})}),D.forEach(U=>{const K=U.start.x*H,V=U.end.x*H,q=U.start.y*H,Y=U.end.y*H,ee=new go(K,q,V,Y);ee.linewidth=qe.line.size,ee.stroke=qe.line.color,z.add(ee)}),z},$=(D,L,H)=>{const z=new En;return D.length===0||(D=m(D,!0),C(z,L,D[0].angle),[L.vertices[0],L.vertices[1]].forEach(O=>{O.bind(ne.Types.change,()=>{C(z,L,D[0].angle)})}),D.forEach(O=>{const U=O.start.x*H,K=O.end.x*H,V=O.start.y*H,q=O.end.y*H,Y=new go(U,V,K,q);Y.linewidth=qe.line.size,Y.stroke=qe.line.color,z.add(Y)})),z},w=(D,L,H,z)=>{const O=L.vertices[0].x+(L.vertices[1].x-L.vertices[0].x)/2-8*Math.sin(D.angle*Math.PI/180),U=L.vertices[0].y+(L.vertices[1].y-L.vertices[0].y)/2-8*Math.cos(D.angle*Math.PI/180),K=new Yi(D.label,O+10,U-10);let V;K.size=qe.lineLabel.size,K.weight=600,K.fill=qe.lineLabel.color,K.id+=1,K.rotation=qe.lineLabel.rotation,z>0&&(V=new Yi(`${D.angle}°`,L.vertices[0].x+25,L.vertices[0].y-25),V.size=qe.angleLabel.size,V.weight=600,V.fill=qe.angleLabel.color,V.rotation=qe.angleLabel.rotation,V.id+=z,s.push(V),H.add(V)),H.add(K),k(K,L,0,V),k(K,L,1)},v=()=>{const{size:D}=qe.colorSideLabel,L=0,H=0,z=h.value?D/2:D/2-D,O=h.value?D/2-D:D/2,U=new En;if(!c)return U;const K=5,V=Math.atan2(O-z,H-L),q=[new Fe(L,z,0,0,0,0,pn.Commands.move),new Fe(H,O,0,0,0,0,pn.Commands.line),new Fe(H-K*Math.cos(V-Math.PI/4),O-K*Math.sin(V-Math.PI/4),0,0,0,0,pn.Commands.line),new Fe(H,O,0,0,0,0,pn.Commands.move),new Fe(H-K*Math.cos(V+Math.PI/4),O-K*Math.sin(V+Math.PI/4),0,0,0,0,pn.Commands.line)],Y=new Ae(q,!1,!1,!0);Y.noFill(),Y.cap="round",Y.join="round",Y.linewidth=D/7,Y.stroke=qe.colorSideLabel.color,U.add(Y);const ee=new Yi(h.value?"Цвет снизу":"Цвет сверху",10,0);ee.size=D,ee.weight=600,ee.fill=qe.colorSideLabel.color,ee.alignment="left",U.add(ee);const ue=U.getBoundingClientRect();return U.position.x=(c.width-ue.width)*d+10,U.position.y=h.value?c.height+ue.height*2:ue.height/2,U},k=(D,L,H,z)=>{L.vertices[H].bind(ne.Types.change,()=>{const O=L.vertices.length-1,U=Math.atan2(L.vertices[0].y-L.vertices[O].y,L.vertices[0].x-L.vertices[O].x)*180/Math.PI,K=L.vertices[0].x+(L.vertices[O].x-L.vertices[0].x)/2-8*Math.sin(U*Math.PI/180),V=L.vertices[0].y+(L.vertices[O].y-L.vertices[0].y)/2-8*Math.cos(U*Math.PI/180);D.position.x=K+10,D.position.y=V-10,D.rotation=-.5,z&&(z.position.x=L.vertices[0].x+25,z.position.y=L.vertices[0].y-25)})},B=(D,L,H,z,O=!1)=>{var We;if(D.clear(),H.length===0){D.update();return}const U=m(H),[K,V,q]=p(D,L,U,z,O),Y=new En,ee=new Array,ue=new Array;O||(s=[],a=[]),U.forEach((ce,pt)=>{const Ne=ce.start.x*K+V,Vt=ce.end.x*K+V,jt=ce.start.y*K+q,ln=ce.end.y*K+q,Bt=new go(Ne,jt,Vt,ln);Bt.linewidth=O?qe.previewLine.size:qe.line.size,Bt.stroke=O?qe.previewLine.color:qe.line.color,a.push(Bt),ee.push(Bt),Y.add(Bt),!O&&ce.label!==""&&w(ce,Bt,Y,pt)});const ve=ee.at(-1);let Te=Y.getBoundingClientRect();if(!O){const ce=v();ue.push(ce)}if(L.length>0){const ce=N(L,ee[0],K);Y.add(ce)}if(z.length>0&&ve){const ce=$(z,ve,K);Y.add(ce)}if(ue.push(Y),D.makeGroup(ue),Te=Y.getBoundingClientRect(),Y.position.x=0-Te.left+(D.width-Te.width)/(2*(O?1:d)),Y.position.y=0-Te.top+(D.height-Te.height)/(2*(O?1:d)),D.update(),!O){const ce=((We=n.value.configuratorParams)==null?void 0:We.colorSide)==="top";Y.position.y=Y.position.y+qe.colorSideLabel.size*Number(ce),y(ee,Y),D.update()}},R=(D,L)=>{if(D&&!L.isNewRec()){const H=new pn({width:D.scrollWidth,height:D.scrollHeight});H.appendTo(D),B(H,[],L.points,[],!0)}},E=()=>{c&&B(c,f.value,u.value,g.value,!1)},P=D=>D*(180/Math.PI),W=(D,L)=>{const H=D[1].x-D[0].x,z=D[1].y-D[0].y,O=L[1].x-L[0].x,U=L[1].y-L[0].y;let K=Math.atan2(H*U-z*O,H*O+z*U);return K=P(K),Math.round(K)*-1},I=D=>{const L=a.map((H,z,O)=>{const U=O[z-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let K=Math.ceil(H._length/D/n.settings.lineWidthStep)*n.settings.lineWidthStep;const V=s[z-1];K<(O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(K=O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),K>n.settings.maxLineWidth&&(K=n.settings.maxLineWidth);const q=W(H.vertices,U.vertices);return V&&(V.value=`${q}°`),new _n(K,q,`A-${z+1}`)});r("pointer:move",L)},Z=D=>{let L=null,H;const z=V=>{L=l.find(q=>{const Y=q.renderer;return(Y==null?void 0:Y.elem)===V.target}),[H]=p(D,f.value,u.value.map(q=>q),g.value)},O=V=>{if(L){const q=L.renderer,Y=q==null?void 0:q.elem;if(!Y)return;const ee=Y.getBoundingClientRect();L.vertices[0].x-=ee.x-(V instanceof MouseEvent?V.clientX:V.targetTouches[0].clientX)+qe.anchorPoint.size/2,L.vertices[0].y-=ee.y-(V instanceof MouseEvent?V.clientY:V.targetTouches[0].clientY)+qe.anchorPoint.size/2,I(H),D.update()}},U=()=>{L&&r("pointer:up",u.value),L=null},K=o.value;K&&(K.addEventListener("touchstart",z,{passive:!0}),K.addEventListener("touchend",U,{passive:!0}),K.addEventListener("mousedown",z),K.addEventListener("mouseup",U),K.addEventListener("mousemove",O),K.addEventListener("touchmove",O,{passive:!0}))},te=(D,L)=>{r("remove-custom-template",D,L)};return i.onMounted(()=>{o.value&&(c=new pn({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{E()},{deep:!0,immediate:!0}),Z(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(D,L)=>(i.openBlock(),i.createElementBlock("div",gy,[i.createVNode(wd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":L[0]||(L[0]=H=>r("template:select",H)),onInitDrawTemplate:R,onRemoveCustomTemplate:te},null,8,["select-template-index","settings"]),i.createElementVNode("div",py,[i.createElementVNode("div",yy,null,512)])]))}});class Ui extends j.Identity{constructor(n,r){super();T(this,"label","");T(this,"points",[]);T(this,"isCustom",!1);T(this,"id",-1);T(this,"guid","");n?(this.label=n.label,this.points=n.points.map((o,s)=>M.isArray(o)?new _n(o[0],o[1],`A-${s+1}`):new _n(o.width,o.angle,`A-${s+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new _n(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Ls extends Ui{constructor(n){super(n);T(this,"isDefault");this.isDefault=n.isDefault??!1}}class kd{constructor(e){T(this,"minLineWidth");T(this,"maxLineWidth");T(this,"lineWidthStep");T(this,"minLineAngle");T(this,"maxLineAngle");T(this,"lineAngleStep");T(this,"stripMinWidth");T(this,"stripMaxWidth");T(this,"stripMinLength");T(this,"stripMaxLength");T(this,"allowShowTable");T(this,"showOnlyTemplates");T(this,"templates");T(this,"customTemplates",[]);T(this,"startTailConfigs");T(this,"endTailConfigs");T(this,"bendCountForExtended");T(this,"extendedProductCatalog");T(this,"allowChangeFirstPoint");T(this,"allowSaveTemplates");T(this,"userTemplatesPrefix");T(this,"lengthStep");T(this,"canSetDopProdaga");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(o=>new Ui(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(o=>new Ls(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new Ls(o)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,o])=>o.id!==-1).map(([o,s])=>{const a=new Ui(s);return a.isCustom=!0,a.id=+o,a}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new Ui({label:"-- Новая конфигурация --",points:[new _n(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(o=>!o.isNewRec()),r=new Ui(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const _y={class:"flex flex-col gap-3"},wy={class:"grid gap-5 md:grid-cols-5"},xy={},vd=i.defineComponent({...xy,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(new kd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),u=i.ref({quantity:{},marker:{},length:{}}),h=i.ref(0),f=i.useTemplateRef("kozyrek-configurator-params-form"),g=(k=0)=>{var R;const B=(R=c.value.allTemplates)==null?void 0:R.at(k);B!==void 0&&(h.value=k,l.value.configuratorParams.linesWidths=B.points.map(E=>M.isArray(E)?E[0]:E.width),l.value.configuratorParams.linesAngles=B.points.map(E=>M.isArray(E)?E[1]:E.angle),C()),y(l.value.configuratorParams)},m=async()=>{const k=prompt("Введите название шаблона:");if(!k)return;a.value=!0;const B={label:k,points:l.value.configuratorParams.linesWidths.map((E,P)=>[E,l.value.configuratorParams.linesAngles[P]])},R=E=>{E&&(c.value.addCustomTemplate(B),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:B,callback:R})},p=async(k,B)=>{var P;const R=(P=c.value.allTemplates)==null?void 0:P.at(k);if(!R||!R.isCustom)return;const E=W=>{W&&(c.value.removeCustomTemplate(R.id),g()),B==null||B()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:R.id,callback:E})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},y=async k=>{var B,R;l.value.product=new j.ClientProduct,(R=(B=f.value)==null?void 0:B.formReference)==null||R.validate(E=>{E||(C(),o.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:k,validationFieldResultData:u.value,callback:P=>{P?l.value.product=P:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},o.value=!1}}))}).catch(M.noop)},_=async()=>{var k,B;(B=(k=f.value)==null?void 0:k.formReference)==null||B.validate(R=>{R||(s.value=!0,r("submit",l.value,u.value,()=>{s.value=!1,i.nextTick(()=>{var E,P;(P=(E=f.value)==null?void 0:E.formReference)==null||P.restoreValidation()})}))}).catch(M.noop)},C=()=>{const k={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach((B,R)=>{k[`lines_widths[${R+1}]`]={},k[`lines_angles[${R+1}]`]={}}),u.value=k},x=k=>{d.value.linesWidths=k.map(B=>B.width),d.value.linesAngles=k.map(B=>B.angle)},N=k=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,C(),b(),y(l.value.configuratorParams)},$=(k,B)=>{d.value.linesWidths=k,d.value.linesAngles=B},w=k=>{const B=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,R=0;l.value.configuratorParams.linesWidths.splice(k+1,0,B),l.value.configuratorParams.linesAngles.splice(k+1,0,R),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],C(),b(),y(l.value.configuratorParams)},v=k=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(k,1),l.value.configuratorParams.linesAngles.splice(k,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],C(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,k=>{l.value=new j.OrderItemBase(k),g()}),(k,B)=>{const R=A.NButton;return i.openBlock(),i.createElementBlock("div",_y,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(R,{key:0,type:"tertiary",class:"self-end",onClick:B[0]||(B[0]=E=>r("click:view-switch"))},{default:i.withCtx(()=>[...B[3]||(B[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",wy,[i.createVNode(xd,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":N,"onPointer:move":x,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(al,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":B[1]||(B[1]=E=>l.value=E),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":s.value,"is-product-searching":o.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":B[2]||(B[2]=E=>y(E)),"onUpdate:preview":$,onSubmit:_,"onClick:saveTemplate":m,"onClick:addLine":w,"onClick:removeLine":v},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),ky={class:"flex flex-col items-center justify-between rounded-xl"},vy={class:"img-preview relative flex justify-center"},Cy={},Sy=i.defineComponent({...Cy,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:s}=n.configuratorParams,a=M.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return s>=c});if(a!==void 0)return String(Number(a)+1)}),o=e;return(s,a)=>{const l=A.NButton;return i.openBlock(),i.createElementBlock("div",ky,[i.createElementVNode("div",vy,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>o("open-instructions"))},{default:i.withCtx(()=>[...a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Hs=Nn(Sy,[["__scopeId","data-v-a67fd61e"]]),By={key:0,class:"flex items-baseline gap-1"},Ty={key:0,class:"flex items-baseline gap-1"},Ny={key:1},$y={class:"text-lg font-semibold"},Ry={key:2,class:"text-red-500 text-sm mb-2"},Ey={class:"flex gap-3"},Py={},Cd=i.defineComponent({...Py,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(t,{expose:e,emit:n}){var w;const r=t,o=n,s=i.computed(()=>ot.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),u=i.ref(M.cloneDeep(r.value)),h=i.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),f=i.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),m=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),p=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),b=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+f.value:0),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(g.value-h.value),ae.step(1),He.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-f.value),ae.max(m.value-f.value),ae.step(1),He.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]})),C=i.computed(()=>{var P;const v=p.value,k=b.value,{quantity:B}=r.value,R=((P=r.value.product)==null?void 0:P.costRub)||0;if(!v||!k||!B||R===0)return null;const E=v*k/1e6;return(R*B*E).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=i.computed(()=>{const v=p.value,k=b.value,B=!!(v&&v>=r.settings.minWidth&&v<=r.settings.maxWidths[u.value.configuratorParams.netType]),R=!!(k&&k>=r.settings.minHeight&&k<=r.settings.maxHeights[u.value.configuratorParams.netType]),E=!!(r.value.quantity&&r.value.quantity>0);return B&&R&&E}),N=(v,k)=>{var E,P;const B=u.value.configuratorParams;v&&v in B&&(B[v]=k);const R={...B,width:p.value??0,height:b.value??0};v==="width"&&((E=l.value)==null||E.validate().catch(M.noop)),v==="height"&&((P=c.value)==null||P.validate().catch(M.noop)),i.nextTick(()=>{var I,Z;!((I=l.value)!=null&&I.validationErrored)&&!((Z=c.value)!=null&&Z.validationErrored)&&R.height&&R.width&&o("update:params",R),$("configuratorParams",R)})},$=(v,k)=>{const B=new j.OrderItemBase(r.value);B[v]=k,v==="configuratorParams"&&(B.product=new j.ClientProduct),o("update:value",B)};return i.watch(()=>r.value,v=>{const k=M.cloneDeep(i.toRaw(v)),B=k.configuratorParams.mountType,R=r.settings.widthOverlaps[B]??0,E=r.settings.heightOverlaps[B]??0;k.configuratorParams.width&&k.configuratorParams.width>0&&(k.configuratorParams.width-=R),k.configuratorParams.height&&k.configuratorParams.height>0&&(k.configuratorParams.height-=E),u.value=k},{deep:!0}),i.onMounted(()=>{var v;(v=d.value)==null||v.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(v,k)=>{const B=A.NCheckbox;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:u.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message",onKeydown:k[25]||(k[25]=i.withKeys(i.withModifiers(R=>o("submit",u.value),["prevent"]),["enter"]))},{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:u.value.configuratorParams.netType,"onUpdate:value":[k[0]||(k[0]=R=>u.value.configuratorParams.netType=R),k[1]||(k[1]=R=>N("netType",R))],options:t.settings.netType.map(R=>({label:t.settings.descriptions.net_type[R],value:R}))},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:u.value.configuratorParams.color,"onUpdate:value":[k[2]||(k[2]=R=>u.value.configuratorParams.color=R),k[3]||(k[3]=R=>N("color",R))],options:t.settings.color.map(R=>({label:t.settings.descriptions.color[R],value:R}))},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:u.value.configuratorParams.mountType,"onUpdate:value":[k[4]||(k[4]=R=>u.value.configuratorParams.mountType=R),k[5]||(k[5]=R=>N("mountType",R))],options:t.settings.mountType.map(R=>({label:t.settings.descriptions.mount_type[R],value:R}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${g.value?" до "+(g.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",By,[i.createVNode(i.unref(A.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(A.NButton),{quaternary:"",type:"info",size:"tiny",onClick:k[10]||(k[10]=R=>o("click:instructions-toggle"))},{default:i.withCtx(()=>[...k[26]||(k[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[k[6]||(k[6]=R=>u.value.configuratorParams.width=R),k[9]||(k[9]=R=>N("width",R))],parse:i.unref(rt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:k[7]||(k[7]=R=>i.unref(nt)(R)),onInput:k[8]||(k[8]=R=>i.unref(tt)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-f.value} ${m.value?" до "+(m.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Ty,[i.createVNode(i.unref(A.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(A.NButton),{quaternary:"",type:"info",size:"tiny",onClick:k[15]||(k[15]=R=>o("click:instructions-toggle"))},{default:i.withCtx(()=>[...k[27]||(k[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[k[11]||(k[11]=R=>u.value.configuratorParams.height=R),k[14]||(k[14]=R=>N("height",R))],parse:i.unref(rt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:k[12]||(k[12]=R=>i.unref(nt)(R)),onInput:k[13]||(k[13]=R=>i.unref(tt)(t.validation,"height")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:u.value.quantity,"onUpdate:value":[k[16]||(k[16]=R=>u.value.quantity=R),k[19]||(k[19]=R=>$("quantity",R??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:k[17]||(k[17]=R=>i.unref(nt)(R,!1)),onInput:k[18]||(k[18]=R=>i.unref(tt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:k[20]||(k[20]=R=>i.unref(tt)(t.validation,"marker")),"onUpdate:value":k[21]||(k[21]=R=>{u.value.marker=R??null,$("marker",R??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),y.value?(i.openBlock(),i.createBlock(B,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":k[22]||(k[22]=R=>{u.value.isAdditionalSale=R??!1,$("isAdditionalSale",R??!1)})},{default:i.withCtx(()=>[...k[28]||(k[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(ur,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),C.value?(i.openBlock(),i.createElementBlock("div",Ny,[k[29]||(k[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",$y,i.toDisplayString(C.value)+" ₽",1)])):i.createCommentVNode("",!0),x.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ry," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Ey,[i.createVNode(i.unref(A.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:k[23]||(k[23]=R=>o("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"default",onClick:k[24]||(k[24]=R=>o("click:show-preview-drawer"))},{default:i.withCtx(()=>[...k[30]||(k[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),Fy="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",Vy="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",My="/img/configurators/mosquitto/measurement-instructions/mount.png",Ay="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Iy="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Oy={class:"flex flex-col gap-6"},zy={class:"flex gap-4"},Dy={class:"flex flex-col gap-2"},Ly={class:"flex gap-4"},Hy={class:"flex flex-col gap-2"},Wy={class:"flex gap-4"},jy={class:"flex flex-col gap-2"},qy={},Sd=i.defineComponent({...qy,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=ot.initRefDependingOnDeviceResolution("small","small","medium"),r=ot.initRefDependingOnDeviceResolution(.98,.95,.8),o=i.computed(()=>window.innerWidth*r.value),s=e;return(a,l)=>{const c=A.NText;return i.openBlock(),i.createBlock(i.unref(A.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${o.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>s("update:show",!1)),onEsc:l[1]||(l[1]=d=>s("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>s("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",Oy,[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:Fy,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:Vy,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",zy,[l[9]||(l[9]=i.createElementVNode("img",{src:My,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Dy,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",Ly,[l[15]||(l[15]=i.createElementVNode("img",{src:Ay,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Hy,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",Wy,[l[21]||(l[21]=i.createElementVNode("img",{src:Iy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",jy,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Xy={class:"grid md:grid-cols-2"},Yy={},Bd=i.defineComponent({...Yy,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>ot.isPhoneDevice()),s=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),u=i.ref(!1),h=i.ref(!1),f=i.computed(()=>i.inject("debounce-input-time",300)),g=M.debounce(async p=>{var b,y;l.value.product=new j.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:p,validationFieldResultData:d.value,callback:C=>{C?l.value.product=C:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(M.noop)},f.value),m=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,p=>{l.value=p},{deep:!0}),(p,b)=>{const y=po;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Sd,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",Xy,[o.value?(i.openBlock(),i.createBlock(i.unref(A.NDrawer),{key:1,show:s.value,"onUpdate:show":b[4]||(b[4]=_=>s.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:b[2]||(b[2]=_=>s.value=!1)},{default:i.withCtx(()=>[i.createVNode(y)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Hs,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Hs,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(Cd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":b[6]||(b[6]=_=>i.unref(g)(_)),onSubmit:b[7]||(b[7]=_=>m()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),Uy={},Td=i.defineComponent({...Uy,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var f;return!((f=c.value)!=null&&f.validationErrored)}),u=f=>{l.value=f,o("update:value",f,r.index,a)},h=()=>{var f;(f=s.value)==null||f.select()};return i.watch(()=>r.value,f=>{l.value=f}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(f,g)=>{const m=sl,p=Hr;return i.openBlock(),i.createBlock(i.unref(A.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(ur,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(A.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(rt),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=b=>i.unref(nt)(b)),onInput:g[1]||(g[1]=b=>i.unref(tt)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(Le),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(A.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[2]||(g[2]=b=>o("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"]),i.createVNode(i.unref(A.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[3]||(g[3]=b=>o("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),Ky={class:"my-2 flex w-full flex-col"},Gy={key:1},Zy={class:"text-lg font-semibold"},Qy={class:"flex gap-3"},Jy={},Nd=i.defineComponent({...Jy,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){var _;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{const C={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),He.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]};return M.forEach(l.value,(x,N)=>{var $;C[`configuratorParams.linesWidths.${N}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),He.serverValidation(($=r.validation[`linesWidths.${N}`])==null?void 0:$.feedback)]}),C}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((C,x)=>(C??0)+(x??0),0)),h=i.computed(()=>r.settings.width-u.value),f=i.computed(()=>!r.value.some(({product:C})=>!C||C.isNewRec())),g=i.computed(()=>r.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(C=>C.product.isNewRec())),m=i.computed(()=>C=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+C}]),p=i.computed(()=>{const{length:C}=r.value[0];return!C||u.value!==r.settings.width?null:(M.reduce(r.value,(N,$)=>{var v;const w=((v=$.product)==null?void 0:v.costRub)||0;return N+w},0)*r.value[0].quantity*C).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(C,x,N)=>{var w,v,k;l.value[x].product.id=-1;const{configuratorParams:$}=l.value[x];$.linesWidths[x]=C,y("configuratorParams",$),(k=(v=(w=a.value)==null?void 0:w.at(x))==null?void 0:v.formItemReference)==null||k.validate().catch(M.noop),i.nextTick(()=>{var B,R;(R=(B=a.value)==null?void 0:B.at(x))!=null&&R.isValid&&o("update:params",$,x,N)})},y=(C,x)=>{l.value.forEach(N=>{N[C]=x}),o("update:value",l.value)};return i.watch(()=>r.value,C=>{l.value=M.cloneDeep(C)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(C,x)=>{const N=A.NCheckbox;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:x[15]||(x[15]=i.withKeys(i.withModifiers($=>o("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var $;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(w,v)=>{var k,B;return i.openBlock(),i.createBlock(Td,{key:v,ref_for:!0,ref:"line-items-reference",value:((k=w.configuratorParams)==null?void 0:k.linesWidths.at(v))??null,"auto-focus":!0,index:v,path:`configuratorParams.linesWidths.${v}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":m.value(((B=w.configuratorParams)==null?void 0:B.linesWidths.at(v))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(R=>R.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":b,"onClick:addLine":x[0]||(x[0]=R=>o("click:add-line",R)),"onClick:removeLine":x[1]||(x[1]=R=>o("click:remove-line",R))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"])}),128)),i.createElementVNode("div",Ky,[h.value<0?(i.openBlock(),i.createBlock(i.unref(A.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(A.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...x[16]||(x[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[x[17]||(x[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(A.NText),{type:h.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(A.NButton),{disabled:g.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>o("click:add-line",l.value.length))},{default:i.withCtx(()=>[...x[18]||(x[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(A.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>l.value[0].length=w),x[6]||(x[6]=w=>y("length",w))],parse:i.unref(rt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:x[4]||(x[4]=w=>i.unref(nt)(w,!1)),onInput:x[5]||(x[5]=w=>i.unref(tt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>l.value[0].quantity=w),x[10]||(x[10]=w=>y("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[8]||(x[8]=w=>i.unref(nt)(w,!1)),onInput:x[9]||(x[9]=w=>i.unref(tt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>i.unref(tt)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{l.value[0].marker=w??null,y("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(N,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[13]||(x[13]=w=>{l.value[0].isAdditionalSale=w??!1,y("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[...x[19]||(x[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("div",Gy,[x[20]||(x[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Zy,i.toDisplayString(p.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Qy,[i.createVNode(i.unref(A.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!(($=l.value[0])!=null&&$.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:x[14]||(x[14]=w=>o("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),e0={class:"flex grow flex-col"},t0=["src"],n0={class:"w-full"},i0={},$d=i.defineComponent({...i0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",e0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,t0),i.createElementVNode("div",n0,[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)])]))}}),r0={class:"flex flex-col gap-2"},o0={class:"w-104 flex grow flex-col px-5"},s0={},Rd=i.defineComponent({...s0,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("strip-configurator-form"),s=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>i.inject("debounce-input-time",300)),d=i.computed(()=>{var m;return(m=s.value[0].configuratorParams)==null?void 0:m.linesWidths.reduce((p,b)=>(p??0)+(b??0),0)}),u=m=>{m===void 0&&(m=s.value.length-1);const p=s.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(m+1,0,null),s.value.forEach(y=>{y.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const b=new j.OrderItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});s.value=s.value.toSpliced(m+1,0,b)},h=m=>{const p=s.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(m,1),s.value.forEach(b=>{b.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),s.value=s.value.toSpliced(m,1),delete a[`linesWidths.${m}`],delete a[`linesWidths.${m}`])},f=M.debounce(async(m,p,b)=>{const y={linesWidths:m.linesWidths.at(p)};b.value=!0,a.value[`linesWidths.${p}`]={},s.value[p].product=new j.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:s.value[p].category,params:y,validationFieldResultData:a.value,callback:_=>{_?(s.value[p].product=_,p===s.value.length-1&&s.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(s.value[p].product=new j.ClientProduct,a.value[`linesWidths.${p}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),g=async()=>{var m,p;(p=(m=o.value)==null?void 0:m.formReference)==null||p.validate(b=>{if(!b){l.value=!0;const y=s.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,C;(C=(_=o.value)==null?void 0:_.formReference)==null||C.restoreValidation()})})}}).catch(M.noop)};return i.watch(()=>n.cartItems,m=>{s.value=m.map(p=>new j.OrderItemBase(p))}),(m,p)=>{const b=A.NButton;return i.openBlock(),i.createElementBlock("div",r0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=y=>r("click:view-switch"))},{default:i.withCtx(()=>[...p[3]||(p[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",o0,[i.createVNode($d,{value:s.value,"onUpdate:value":p[1]||(p[1]=y=>s.value=y),settings:t.settings},null,8,["value","settings"]),i.createVNode(Nd,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":p[2]||(p[2]=y=>s.value=y),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(f),onSubmit:g,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),a0={class:"flex flex-col gap-3"},l0={},Ed=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","submit"],setup(t,{expose:e,emit:n}){var g;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),He.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),He.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),u=()=>{o("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(m,p)=>{const b=new j.OrderItemBase(r.value);b[m]=p,m==="configuratorParams"&&(b.product=new j.ClientProduct),o("update:value",b)},f=()=>{var m;(m=a.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=M.cloneDeep(m)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{f()})}),e({validate:(g=s.value)==null?void 0:g.validate,formReference:s}),(m,p)=>{const b=A.NCheckbox;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(y=>o("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:i.unref(rt),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=y=>i.unref(nt)(y)),onInput:p[2]||(p[2]=y=>i.unref(tt)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:i.unref(rt),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=y=>i.unref(nt)(y)),onInput:p[5]||(p[5]=y=>i.unref(tt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=y=>i.unref(nt)(y,!1)),onInput:p[7]||(p[7]=y=>i.unref(tt)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=y=>h("quantity",y??0)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=y=>i.unref(tt)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=y=>h("marker",y??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=y=>{l.value.isAdditionalSale=y??!1,h("isAdditionalSale",y??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(ur,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",a0,[i.createVNode(i.unref(A.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:p[12]||(p[12]=y=>o("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),c0={class:"flex flex-col gap-2 w-72"},d0={},Pd=i.defineComponent({...d0,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("metal-for-doors-configurator-form"),s=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=i.computed(()=>i.inject("debounce-input-time",300)),u=M.debounce(async f=>{var g,m;s.value.product=new j.ClientProduct,(m=(g=o.value)==null?void 0:g.formReference)==null||m.validate(p=>{p||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:b=>{b?s.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(M.noop)},d.value),h=async()=>{var f,g;(g=(f=o.value)==null?void 0:f.formReference)==null||g.validate(m=>{m||(c.value=!0,r("submit",s.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var p,b;(b=(p=o.value)==null?void 0:p.formReference)==null||b.restoreValidation()})}))}).catch(M.noop)};return i.watch(()=>n.cartItem,f=>{s.value=new j.OrderItemBase(f)},{deep:!0}),(f,g)=>{const m=A.NButton;return i.openBlock(),i.createElementBlock("div",c0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ed,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":g[1]||(g[1]=p=>s.value=p),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=p=>i.unref(u)(p)),onSubmit:g[3]||(g[3]=p=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),u0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function h0(t,e){return i.openBlock(),i.createElementBlock("svg",u0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Fd=i.markRaw({name:"ion-add",render:h0}),f0={key:0,class:"-mt-1 text-sm text-gray-500"},m0={class:"font-bold"},g0={class:"flex flex-col gap-3"},p0={key:0,class:"mt-4 flex flex-col gap-1.5"},y0={class:"flex flex-col gap-1 text-sm text-gray-700"},b0={key:0},_0={key:1},w0={"form-array-name":"items",class:"flex flex-col gap-3"},x0={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},k0={key:0,class:"flex flex-wrap items-end gap-2"},v0={class:"whitespace-nowrap text-xl font-bold"},C0={key:0,class:"whitespace-nowrap text-lg text-gray-500"},S0={class:"font-bold"},B0={class:"font-bold"},T0={class:"flex gap-3"},N0={},Vd=i.defineComponent({...N0,__name:"sandwich-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","add-item","remove-item"],setup(t,{expose:e,emit:n}){var L;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.ref(M.cloneDeep(r.value)),l=i.ref({...r.validation}),c=H=>{var z;delete l.value[H],(z=s.value)==null||z.restoreValidation()};i.watch(()=>r.validation,H=>{l.value={...H},Object.values(H).some(O=>O==null?void 0:O.feedback)&&i.nextTick(()=>{var O;return(O=s.value)==null?void 0:O.validate(M.noop).catch(M.noop)})},{deep:!0});const d=i.computed(()=>r.value.category),u=i.ref(null),h=i.ref(null),f=i.computed(()=>d.value.products??[]),g=i.computed(()=>f.value.map(H=>({label:H.name,value:H.id}))),m=(H,z,O)=>{const U=H!=null&&H>0,K=z!=null&&z>0;return!U&&!K?null:U&&K?`от ${H} ${O} до ${z} ${O}`:U?`от ${H} ${O}`:`до ${z} ${O}`},p=i.computed(()=>{var H,z;return m(r.settings.minWidth,(z=(H=u.value)==null?void 0:H.properties)==null?void 0:z.width,"мм")}),b=i.computed(()=>{var H,z;return m(r.settings.minLength,(z=(H=u.value)==null?void 0:H.properties)==null?void 0:z.length,"мм")}),y=i.ref(null),_=i.ref(!1),C=i.computed(()=>{var z;const H={marker:[He.serverValidation((z=l.value.marker)==null?void 0:z.feedback)]};return a.value.configuratorParams.items.forEach((O,U)=>{var K,V,q,Y,ee,ue,ve;H[`configuratorParams.items.${U}.width`]=[ae.required,ae.min(r.settings.minWidth),...(V=(K=u.value)==null?void 0:K.properties)!=null&&V.width?[ae.max(u.value.properties.width)]:[],ae.step(1),He.serverValidation((q=l.value[`items.${U}.width`])==null?void 0:q.feedback)],H[`configuratorParams.items.${U}.length`]=[ae.required,ae.min(r.settings.minLength),...(ee=(Y=u.value)==null?void 0:Y.properties)!=null&&ee.length?[ae.max(u.value.properties.length)]:[],ae.step(1),He.serverValidation((ue=l.value[`items.${U}.length`])==null?void 0:ue.feedback)],H[`configuratorParams.items.${U}.count`]=[ae.required,ae.min(1),ae.step(1),He.serverValidation((ve=l.value[`items.${U}.count`])==null?void 0:ve.feedback)]}),H}),x=i.ref(r.settings.canSetDopProdaga??!1),N=i.computed(()=>a.value.configuratorParams.items.some(H=>{var z,O;return!u.value||!H.width||H.width<r.settings.minWidth||H.width>(((z=u.value.properties)==null?void 0:z.width)??0)||H.length===0||H.length<r.settings.minLength||H.length>(((O=u.value.properties)==null?void 0:O.length)??0)||!H.count||H.count<1})),$=i.computed(()=>!u.value||N.value||a.value.configuratorParams.items.length===0),w=i.ref(null),v=H=>{if(!H){u.value=null,h.value=null,a.value.product=new j.ClientProduct,y.value=null;return}const z=f.value.find(O=>O.id===H);z&&(u.value=z,h.value=H,a.value.product=z,te("product",a.value.product),a.value.configuratorParams.items.forEach(O=>{var U,K;(U=z.properties)!=null&&U.width&&O.width>z.properties.width&&(O.width=z.properties.width),(K=z.properties)!=null&&K.length&&O.length>z.properties.length&&(O.length=z.properties.length)}),B())};let k=!1;const B=()=>{k=!0,y.value=null,w.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},R=async()=>{var H;if(!u.value||a.value.configuratorParams.items.length===0||N.value){B();return}(H=s.value)==null||H.validate(z=>{if(z){B();return}if(_.value=!0,!u.value||!d.value){B(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:a.value.configuratorParams.items},callback:O=>{O?(y.value=O,a.value.configuratorParams.calculationId=O.id,a.value.quantity=O.quantity,i.nextTick(()=>{te("quantity",O.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,B()),te("configuratorParams",a.value.configuratorParams),E(),_.value=!1}})}).catch(()=>{B(),_.value=!1})},E=()=>{var z;if(!((z=u.value)!=null&&z.costRub)||!y.value){w.value=null;return}const H=y.value.quantity*u.value.costRub;w.value=Math.round(H*100)/100},P=H=>{var O,U;const z=a.value.configuratorParams.items[H];u.value&&((O=u.value.properties)!=null&&O.width&&z.width>u.value.properties.width&&(z.width=u.value.properties.width),(U=u.value.properties)!=null&&U.length&&z.length>u.value.properties.length&&(z.length=u.value.properties.length)),te("configuratorParams",a.value.configuratorParams),B()},W=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),te("configuratorParams",a.value.configuratorParams),B(),o("add-item",a.value.configuratorParams.items.length)},I=H=>{a.value.configuratorParams.items.splice(H,1),te("configuratorParams",a.value.configuratorParams),B(),o("remove-item",H)},Z=()=>{if(!($.value||_.value||r.isSubmitProcessing)){if(!y.value){R();return}o("submit",a.value)}},te=(H,z)=>{const O=new j.OrderItemBase(r.value);O[H]=z,o("update:value",O)};i.watch(()=>r.value,H=>{const z=M.cloneDeep(i.toRaw(H));(!z.configuratorParams.items||z.configuratorParams.items.length===0)&&(z.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=z,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,h.value=null),k?k=!1:D()},{deep:!0});const D=()=>{const{calculationId:H}=a.value.configuratorParams,z=a.value.quantity??0;H&&z>0&&a.value.product&&!a.value.product.isNewRec()&&(y.value={id:H,quantity:z,sheets:[]},E())};return i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),D()}),e({validate:(L=s.value)==null?void 0:L.validate,formReference:s}),(H,z)=>{const O=Hr,U=Fd;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:a.value,rules:C.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers(Z,["prevent"]),["enter"])},{default:i.withCtx(()=>{var K;return[i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:h.value,"onUpdate:value":[z[0]||(z[0]=V=>h.value=V),v],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((K=u.value)==null?void 0:K.costRub)!=null?(i.openBlock(),i.createElementBlock("div",f0,[i.createElementVNode("span",m0,i.toDisplayString(u.value.code),1),i.createTextVNode(" — "+i.toDisplayString(u.value.costRub.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт. ",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",g0,[u.value?(i.openBlock(),i.createElementBlock("div",p0,[z[7]||(z[7]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",y0,[p.value?(i.openBlock(),i.createElementBlock("div",b0,"Ширина "+i.toDisplayString(p.value)+".",1)):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createElementBlock("div",_0,"Длина "+i.toDisplayString(b.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",w0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(V,q)=>(i.openBlock(),i.createElementBlock("div",{key:q,class:"flex grow gap-2"},[i.createElementVNode("div",x0,[i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.items.${q}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:a.value.configuratorParams.items[q].width,"onUpdate:value":[Y=>a.value.configuratorParams.items[q].width=Y,Y=>P(q)],parse:i.unref(rt),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:z[1]||(z[1]=Y=>i.unref(nt)(Y)),onInput:Y=>c(`items.${q}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.items.${q}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:a.value.configuratorParams.items[q].length,"onUpdate:value":[Y=>a.value.configuratorParams.items[q].length=Y,Y=>P(q)],parse:i.unref(rt),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:z[2]||(z[2]=Y=>i.unref(nt)(Y)),onInput:Y=>c(`items.${q}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.items.${q}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:a.value.configuratorParams.items[q].count,"onUpdate:value":[Y=>a.value.configuratorParams.items[q].count=Y,Y=>P(q)],parse:i.unref(rt),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:z[3]||(z[3]=Y=>i.unref(nt)(Y,!1)),onInput:Y=>c(`items.${q}.count`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(A.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:Y=>I(q)},{default:i.withCtx(()=>[i.createVNode(O)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:1,disabled:N.value,type:"default",class:"self-center",onClick:W},{default:i.withCtx(()=>[i.createVNode(U),z[8]||(z[8]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:z[4]||(z[4]=V=>c("marker")),"onUpdate:value":z[5]||(z[5]=V=>te("marker",V??null)),onFocus:i.unref(Le)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(i.openBlock(),i.createBlock(i.unref(A.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":z[6]||(z[6]=V=>{a.value.isAdditionalSale=V??!1,te("isAdditionalSale",V??!1)})},{default:i.withCtx(()=>[...z[9]||(z[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(A.NSpin),{show:_.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var V;return[y.value&&u.value&&w.value?(i.openBlock(),i.createElementBlock("div",k0,[i.createElementVNode("div",null,[z[10]||(z[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",v0,i.toDisplayString(w.value.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol),1)]),y.value.quantity&&u.value?(i.openBlock(),i.createElementBlock("div",C0,[i.createElementVNode("span",S0,"("+i.toDisplayString(y.value.quantity)+" шт.",1),z[11]||(z[11]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",B0,i.toDisplayString((V=u.value.costRub)==null?void 0:V.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",T0,[y.value&&!_.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,loading:t.isSubmitProcessing,disabled:$.value||_.value,type:"primary",class:"self-start",onClick:Z},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:1,loading:_.value,disabled:$.value||_.value,type:"info",class:"self-start",onClick:R},{default:i.withCtx(()=>[...z[12]||(z[12]=[i.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules","onKeydown"])}}}),$0={class:"flex flex-col gap-2"},R0={class:"w-104 flex grow flex-col px-5"},E0={},Md=i.defineComponent({...E0,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("sandwich-configurator-form"),s=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=i.ref(!1),c=async()=>{var h,f;(f=(h=o.value)==null?void 0:h.formReference)==null||f.validate(g=>{if(!g){l.value=!0;const m=M.cloneDeep(s.value);"items"in m.configuratorParams&&delete m.configuratorParams.items,r("submit",m,a.value,()=>{l.value=!1,i.nextTick(()=>{var p,b;(b=(p=o.value)==null?void 0:p.formReference)==null||b.restoreValidation()})})}}).catch(M.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return i.onMounted(()=>{n.cartItem.configuratorParams.items.forEach((h,f)=>{a.value[`items.${f}.width`]={},a.value[`items.${f}.length`]={},a.value[`items.${f}.count`]={}})}),i.watch(()=>n.cartItem,h=>{s.value=new j.OrderItemBase(h)},{deep:!0}),(h,f)=>{const g=A.NButton;return i.openBlock(),i.createElementBlock("div",$0,[t.settings.allowShowTable&&s.value.isNewRec()?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=m=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[2]||(f[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",R0,[i.createVNode(Vd,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":f[1]||(f[1]=m=>s.value=m),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),P0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function F0(t,e){return i.openBlock(),i.createElementBlock("svg",P0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1)])])}const V0=i.markRaw({name:"ion-checkmark",render:F0}),M0={key:0,class:"-mt-1 text-sm text-gray-500"},A0={class:"font-bold"},I0={class:"flex flex-col gap-3"},O0={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},z0={class:"flex flex-col gap-1 text-sm text-gray-700"},D0={key:0},L0={key:1},H0={"form-array-name":"items",class:"flex flex-col gap-3"},W0={class:"min-w-0 flex-1"},j0={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},q0={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},X0={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},Y0={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},U0={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},K0={key:0,class:"lg:!flex-[2]"},G0={class:"font-bold"},Z0={key:1,class:"lg:!flex-[3]"},Q0={class:"font-bold"},J0={key:1,class:"min-w-0 flex flex-col items-end gap-1 text-right text-sm text-gray-700 border-t border-gray-200 pt-2"},eb={key:0},tb={class:"font-bold"},nb={key:1},ib={class:"font-bold"},rb={class:"flex flex-wrap items-center gap-3"},ob={},Ad=i.defineComponent({...ob,__name:"sandwich-m2-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},itemStates:{default:()=>[]}},emits:["submit","update:value","add-item","remove-item","item-reset"],setup(t,{expose:e,emit:n}){var K;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("widthInputs"),l=r.value==null?[]:M.cloneDeep(i.toRaw(r.value)),c=i.ref(l.map(V=>new j.OrderItemBase(V))),d=i.computed(()=>({items:c.value})),u=i.ref({...r.validation}),h=V=>{var q;delete u.value[V],(q=s.value)==null||q.restoreValidation()},f=i.ref(null),g=i.ref(null),m=i.computed(()=>{var V,q;return((q=(V=c.value[0])==null?void 0:V.category)==null?void 0:q.products)??[]}),p=i.computed(()=>m.value.map(V=>({label:V.name,value:V.id}))),b=(V,q,Y)=>{const ee=V!=null&&V>0,ue=q!=null&&q>0;return!ee&&!ue?null:ee&&ue?`от ${V} ${Y} до ${q} ${Y}`:ee?`от ${V} ${Y}`:`до ${q} ${Y}`},y=i.computed(()=>{var V,q;return b(r.settings.minWidth,(q=(V=f.value)==null?void 0:V.properties)==null?void 0:q.width,"мм")}),_=i.computed(()=>{var V,q;return b(r.settings.minLength,(q=(V=f.value)==null?void 0:V.properties)==null?void 0:q.length,"мм")}),C=i.computed(()=>{const V={};return c.value.forEach((q,Y)=>{var ee,ue,ve,Te,We,ce,pt,Ne;V[`items.${Y}.configuratorParams.width`]=[ae.required,ae.min(r.settings.minWidth),...(ue=(ee=f.value)==null?void 0:ee.properties)!=null&&ue.width?[ae.max(f.value.properties.width)]:[],ae.step(1),He.serverValidation((ve=u.value[`items.${Y}.width`])==null?void 0:ve.feedback)],V[`items.${Y}.configuratorParams.length`]=[ae.required,ae.min(r.settings.minLength),...(We=(Te=f.value)==null?void 0:Te.properties)!=null&&We.length?[ae.max(f.value.properties.length)]:[],ae.step(1),He.serverValidation((ce=u.value[`items.${Y}.length`])==null?void 0:ce.feedback)],V[`items.${Y}.quantity`]=[ae.required,ae.min(1),ae.step(1),He.serverValidation((pt=u.value[`items.${Y}.quantity`])==null?void 0:pt.feedback)],V[`items.${Y}.marker`]=[He.serverValidation((Ne=u.value[`items.${Y}.marker`])==null?void 0:Ne.feedback)]}),V});i.watch(()=>r.validation,V=>{u.value={...V},Object.values(V).some(Y=>Y==null?void 0:Y.feedback)&&i.nextTick(()=>{var Y;return(Y=s.value)==null?void 0:Y.validate(M.noop).catch(M.noop)})},{deep:!0});const x=i.ref(r.settings.canSetDopProdaga??!1),N=i.computed(()=>{const V=f.value;return V?c.value.some(q=>{var ve,Te;const Y=q.configuratorParams,ee=(ve=V.properties)==null?void 0:ve.width,ue=(Te=V.properties)==null?void 0:Te.length;return Y.width===0||Y.width<r.settings.minWidth||ee!=null&&Y.width>ee||Y.length===0||Y.length<r.settings.minLength||ue!=null&&Y.length>ue||q.quantity===0||q.quantity<1}):!0}),$=i.computed(()=>!f.value||N.value||c.value.length===0),w=i.computed(()=>{const V=c.value[0];return V!=null&&!V.isNewRec()}),v=V=>r.itemStates[V]??"idle",k=V=>v(V)==="success",B=V=>v(V)==="loading",R=i.computed(()=>c.value.length===0?!0:c.value.every((V,q)=>{const Y=v(q);return Y==="success"||Y==="loading"})),E=V=>V.width===0||V.length===0?0:V.width*V.length/1e6,P=V=>{var ve;const q=V.configuratorParams,Y=E(q),ee=((ve=f.value)==null?void 0:ve.costRub)??0,ue=V.quantity??0;return!Y||!ue?0:Math.round(Y*ee*ue*100)/100},W=i.computed(()=>M.sum(c.value.map(V=>{const q=V.configuratorParams;return!q.width||q.length===0||!V.quantity?0:q.width*q.length*V.quantity/1e6}))),I=i.computed(()=>Math.round(M.sum(c.value.map(V=>P(V)))*100)/100),Z=()=>{var V,q,Y;return new j.OrderItemBase({category:(V=c.value[0])==null?void 0:V.category,configurator:(q=c.value[0])==null?void 0:q.configurator,product:f.value??new j.ClientProduct,quantity:1,isAdditionalSale:(Y=c.value[0])==null?void 0:Y.isAdditionalSale,configuratorParams:{width:0,length:0}})},te=V=>{if(!V){f.value=null,g.value=null,c.value.forEach(Y=>{Y.product=new j.ClientProduct}),o("update:value",c.value);return}const q=m.value.find(Y=>Y.id===V);q&&(f.value=q,g.value=V,c.value.forEach((Y,ee)=>{var ue,ve;Y.product=q,(ue=q.properties)!=null&&ue.width&&Y.configuratorParams.width>q.properties.width&&(Y.configuratorParams.width=q.properties.width),(ve=q.properties)!=null&&ve.length&&Y.configuratorParams.length>q.properties.length&&(Y.configuratorParams.length=q.properties.length),o("item-reset",ee)}),o("update:value",c.value))},D=V=>{var ee,ue;const q=c.value[V],Y=f.value;Y&&((ee=Y.properties)!=null&&ee.width&&q.configuratorParams.width>Y.properties.width&&(q.configuratorParams.width=Y.properties.width),(ue=Y.properties)!=null&&ue.length&&q.configuratorParams.length>Y.properties.length&&(q.configuratorParams.length=Y.properties.length)),o("item-reset",V),o("update:value",c.value)},L=(V,q)=>{c.value[V].marker=q===null||q===""?void 0:q,o("item-reset",V),o("update:value",c.value)},H=V=>{c.value.forEach(q=>{q.isAdditionalSale=V}),o("update:value",c.value)},z=()=>{c.value.push(Z()),o("update:value",c.value),o("add-item",c.value.length),i.nextTick(()=>{var q,Y,ee,ue;const V=c.value.length-1;(Y=(q=a.value)==null?void 0:q[V])==null||Y.focus(),(ue=(ee=a.value)==null?void 0:ee[V])==null||ue.select()})},O=V=>{c.value.splice(V,1),o("update:value",c.value),o("remove-item",V)};i.watch(()=>r.value,V=>{var ue;const Y=(V==null?[]:M.cloneDeep(i.toRaw(V))).map(ve=>new j.OrderItemBase(ve));c.value=Y.length>0?Y:[Z()];const ee=(ue=c.value[0])==null?void 0:ue.product;ee&&!ee.isNewRec()?(f.value=ee,g.value=ee.id):(f.value=null,g.value=null)},{deep:!0});const U=()=>{var q;if(f.value!==null)return;const V=(q=m.value[0])==null?void 0:q.id;V!=null&&te(V)};return i.watch(m,()=>{U()}),i.onMounted(()=>{var q;c.value.length===0&&(c.value=[Z()]);const V=(q=c.value[0])==null?void 0:q.product;V&&!V.isNewRec()&&(f.value=V,g.value=V.id),U()}),e({validate:(K=s.value)==null?void 0:K.validate,formReference:s}),(V,q)=>{const Y=V0,ee=Hr,ue=Fd;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:d.value,rules:C.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var ve,Te;return[i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:g.value,"onUpdate:value":[q[0]||(q[0]=We=>g.value=We),te],options:p.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=f.value)==null?void 0:ve.costRub)!=null?(i.openBlock(),i.createElementBlock("div",M0,[i.createElementVNode("span",A0,i.toDisplayString(f.value.code),1),i.createTextVNode(" — "+i.toDisplayString(f.value.costRub.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol)+"/м² ",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",I0,[f.value?(i.openBlock(),i.createElementBlock("div",O0,[q[6]||(q[6]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",z0,[y.value?(i.openBlock(),i.createElementBlock("div",D0,"Ширина "+i.toDisplayString(y.value)+".",1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("div",L0,"Длина "+i.toDisplayString(_.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",H0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value.items,(We,ce)=>{var pt;return i.openBlock(),i.createElementBlock("div",{key:ce,class:i.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",k(ce)?"opacity-70":""])},[i.createElementVNode("div",W0,[i.createElementVNode("div",j0,[i.createElementVNode("div",q0,[i.createVNode(i.unref(A.NFormItem),{path:`items.${ce}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[ce].configuratorParams.width,"onUpdate:value":[Ne=>d.value.items[ce].configuratorParams.width=Ne,Ne=>D(ce)],parse:i.unref(rt),"show-button":!1,disabled:!f.value||k(ce)||B(ce),placeholder:"Ширина",class:"w-full",onKeydown:q[1]||(q[1]=Ne=>i.unref(nt)(Ne)),onInput:Ne=>h(`items.${ce}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`items.${ce}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:d.value.items[ce].configuratorParams.length,"onUpdate:value":[Ne=>d.value.items[ce].configuratorParams.length=Ne,Ne=>D(ce)],parse:i.unref(rt),"show-button":!1,disabled:!f.value||k(ce)||B(ce),placeholder:"Длина",class:"w-full",onKeydown:q[2]||(q[2]=Ne=>i.unref(nt)(Ne)),onInput:Ne=>h(`items.${ce}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createElementVNode("div",X0,[i.createVNode(i.unref(A.NFormItem),{path:`items.${ce}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:d.value.items[ce].quantity,"onUpdate:value":[Ne=>d.value.items[ce].quantity=Ne,Ne=>D(ce)],parse:i.unref(rt),"show-button":!1,disabled:!f.value||k(ce)||B(ce),placeholder:"Кол-во",class:"w-full",onKeydown:q[3]||(q[3]=Ne=>i.unref(nt)(Ne,!1)),onInput:Ne=>h(`items.${ce}.quantity`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`items.${ce}.marker`,label:"Маркировка",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:d.value.items[ce].marker??null,disabled:!f.value||k(ce)||B(ce),placeholder:"Маркировка",class:"w-full",onInput:Ne=>h(`items.${ce}.marker`),"onUpdate:value":Ne=>L(ce,Ne??null),onFocus:i.unref(Le)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),B(ce)||k(ce)?(i.openBlock(),i.createElementBlock("div",Y0,[B(ce)?(i.openBlock(),i.createBlock(i.unref(A.NSpin),{key:0,size:14})):k(ce)?(i.openBlock(),i.createBlock(Y,{key:1,class:"text-green-600 text-xl"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",U0,[We.configuratorParams.width>0&&We.configuratorParams.length>0?(i.openBlock(),i.createElementBlock("div",K0,[q[7]||(q[7]=i.createTextVNode(" Площадь (S) = ",-1)),i.createElementVNode("span",G0,i.toDisplayString(E(We.configuratorParams).toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),P(We)>0?(i.openBlock(),i.createElementBlock("div",Z0,[q[8]||(q[8]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",Q0,i.toDisplayString(P(We).toLocaleString())+" "+i.toDisplayString((pt=f.value)==null?void 0:pt.currency.symbol),1)])):i.createCommentVNode("",!0)])]),w.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,disabled:B(ce)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:Ne=>O(ce)},{default:i.withCtx(()=>[i.createVNode(ee)]),_:1},8,["disabled","onClick"]))],2)}),128))]),f.value?(i.openBlock(),i.createElementBlock("div",J0,[W.value>0?(i.openBlock(),i.createElementBlock("div",eb,[q[9]||(q[9]=i.createTextVNode(" Общая площадь: ",-1)),i.createElementVNode("span",tb,i.toDisplayString(W.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),I.value>0?(i.openBlock(),i.createElementBlock("div",nb,[q[10]||(q[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",ib,i.toDisplayString(I.value.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),x.value?(i.openBlock(),i.createBlock(i.unref(A.NCheckbox),{key:1,checked:((Te=c.value[0])==null?void 0:Te.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":q[4]||(q[4]=We=>H(We??!1))},{default:i.withCtx(()=>[...q[11]||(q[11]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createElementVNode("div",rb,[f.value&&!w.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,disabled:N.value,type:"default",onClick:z},{default:i.withCtx(()=>[i.createVNode(ue),q[12]||(q[12]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(A.NButton),{loading:t.isSubmitProcessing,disabled:$.value||R.value,type:"primary",class:"ml-auto",onClick:q[5]||(q[5]=We=>o("submit",c.value))},{default:i.withCtx(()=>{var We;return[i.createTextVNode(i.toDisplayString((We=c.value[0])!=null&&We.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[i.unref(Ga)]])}}}),sb={class:"flex flex-col gap-2"},ab={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},lb={},Id=i.defineComponent({...lb,__name:"sandwich-m2-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["click:view-switch","submit"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("sandwich-m2-configurator-form"),s=i.ref((n.cartItems??[]).map(C=>new j.OrderItemBase(C))),a=i.ref([]),l=i.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=C=>{c.forEach(x=>{l.value[`items.${C}.${x}`]={}})},u=C=>{c.forEach(x=>{delete l.value[`items.${C}.${x}`]})},h=i.computed(()=>a.value.includes("loading")),f=()=>({width:{},length:{},quantity:{},marker:{}}),g=(C,x)=>{let N=!1;return c.forEach($=>{var E,P;const w=`items.0.${$}`,v=(E=C[$])==null?void 0:E.feedback,B=((P=C[w])==null?void 0:P.feedback)??v,R=`items.${x}.${$}`;B?(l.value[R]=C[w]??C[$],N=!0):l.value[R]={}}),N},m=(C,x,N)=>new Promise($=>{const w=f();let v=!1;const k=B=>{if(v)return;v=!0;const R=g(w,x),E=(B===void 0?!R:B)&&!R;a.value[x]=E?"success":"error",i.nextTick(()=>{var P,W;(W=(P=o.value)==null?void 0:P.formReference)==null||W.restoreValidation()}),$(E)};a.value[x]="loading",r("submit",[M.cloneDeep(C)],w,k,{isFinalSuccessfulCompletion:N})}),p=async()=>{var N,$;try{await(($=(N=o.value)==null?void 0:N.formReference)==null?void 0:$.validate())}catch{return}const C=s.value.map((w,v)=>v).filter(w=>{const v=a.value[w]??"idle";return v!=="success"&&v!=="loading"});let x=!0;for(let w=0;w<C.length;w+=1){const v=C[w],k=s.value[v];if(!k)break;const R=w===C.length-1&&x;await m(k,v,R)||(x=!1)}},b=C=>{const x=C-1;a.value[x]="idle",d(x)},y=C=>{a.value.splice(C,1),u(C);for(let x=C;x<s.value.length;x+=1)d(x)},_=C=>{const x=a.value[C];(x==="success"||x==="error")&&(a.value[C]="idle")};return i.onMounted(()=>{(n.cartItems??[]).forEach((C,x)=>{a.value[x]="idle",d(x)})}),i.watch(()=>n.cartItems,C=>{const x=(C??[]).map(N=>new j.OrderItemBase(N));s.value=x,a.value=x.map(()=>"idle"),x.forEach((N,$)=>{d($)})},{deep:!0}),(C,x)=>{var $;const N=A.NButton;return i.openBlock(),i.createElementBlock("div",sb,[t.settings.allowShowTable&&(($=s.value[0])!=null&&$.isNewRec())?(i.openBlock(),i.createBlock(N,{key:0,type:"tertiary",class:"self-center",onClick:x[0]||(x[0]=w=>r("click:view-switch"))},{default:i.withCtx(()=>[...x[2]||(x[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ab,[i.createVNode(Ad,{ref:"sandwich-m2-configurator-form",value:s.value,"onUpdate:value":x[1]||(x[1]=w=>s.value=w),validation:l.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":h.value,"item-states":a.value,onSubmit:p,onAddItem:b,onRemoveItem:y,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),cb={key:0,class:"flex justify-center p-4"},db={key:1,class:"p-4 text-center text-red-500"},ub={key:2,class:"flex justify-center"},hb={class:"!bg-white p-4 m-2 rounded-md w-max"},fb={key:3,class:"p-4 text-center text-gray-500"},mb={},Od=i.defineComponent({...mb,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),o=i.ref(e.cartItem??null),s=i.ref(null),a=f=>{const g=f.configuratorParams;return[new j.OrderItemBase({...f,quantity:f.quantity??1,marker:f.marker,configuratorParams:{width:(g==null?void 0:g.width)??f.width??0,length:(g==null?void 0:g.length)??f.length??0}})]},l=i.ref(e.editor===j.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var g,m,p;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:((g=e.cartItem)==null?void 0:g.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const b=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:M.some(b.startTailConfigs,y=>y.isDefault)?(m=b.startTailConfigs)==null?void 0:m.findIndex(y=>y.isDefault):void 0,endTailType:M.some(b.endTailConfigs,y=>y.isDefault)?(p=b.endTailConfigs)==null?void 0:p.findIndex(y=>y.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{const b=e.settings;s.value=[new j.OrderItemBase({...f,length:b.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{width:b.minWidth,length:b.minLength}});break}case"sandwich":{o.value=new j.OrderItemBase({...f,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{l.value=[new j.OrderItemBase({...f,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}o.value&&(o.value.marker=void 0)},d=(f,g,m)=>{const p=b=>{m==null||m(),b&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:p,validation:g})},u=(f,g,m,p)=>{const b=f[0];if(!b){m==null||m();return}const y=(p==null?void 0:p.isFinalSuccessfulCompletion)===!0,_=C=>{m==null||m(C),y&&C&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:b,callback:_,validation:g,additionalParams:p})},h=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{e.cartItem||c()}),(f,g)=>{const m=A.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",cb,[i.createVNode(m,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",db,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),t.settings!==null&&(o.value!==null||s.value!==null||l.value!==null)?(i.openBlock(),i.createElementBlock("div",ub,[i.createElementVNode("div",hb,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(vd,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(i.openBlock(),i.createBlock(Bd,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(i.openBlock(),i.createBlock(Rd,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(i.openBlock(),i.createBlock(Pd,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(i.openBlock(),i.createBlock(Md,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich_m2"?(i.openBlock(),i.createBlock(Id,{key:5,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",fb,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function zd(t){return Object.values(j.ConfiguratorsEnum).includes(t)}function Dd(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==j.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&M.isArray(t.products)&&t.products.length>0}const gb={key:0,class:"pt-0.5"},pb={key:0},yb={class:"line-through"},bb={key:0},_b={key:1},wb={class:"flex flex-row gap-1"},xb={key:0},kb={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},vb={class:"flex flex-col gap-2.5 sm:flex-row"},Cb={class:"mt-2"},Sb={key:1,class:"flex flex-col"},Bb={},Tb=i.defineComponent({...Bb,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(lr,"medium"),r=i.computed(()=>{var K;return(K=e==null?void 0:e.filteredItems)==null?void 0:K[e.categoryItem.id]}),o=i.computed(()=>{var K,V;return M.isArray((K=e.categoryItem)==null?void 0:K.categories)&&((V=e.categoryItem.categories)==null?void 0:V.length)>0}),s=i.computed(()=>{var K;return M.isArray((K=e.categoryItem)==null?void 0:K.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([K,V])=>`${V} руб./${R(K)}`).join(", ")),l=i.computed(()=>M.isUndefined(e.filteredItems)||r.value==="*"?s.value:s.value.filter(K=>{var q;const V=(q=r.value)==null?void 0:q.products;return M.isArray(V)&&V.includes(K.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>M.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>M.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>M.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),f=i.computed(()=>M.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var K,V,q;return((K=e.categoryItem.properties)==null?void 0:K.configurator)!==void 0&&zd((V=e.categoryItem.properties)==null?void 0:V.configurator)&&Dd(e.categoryItem)&&((q=e.categoryItem.properties)==null?void 0:q.configuratorSettings)!==void 0&&(M.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),m=i.computed(()=>g.value&&(M.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),p=i.computed(()=>M.isNil(e.categoryContextButtonsConfig)?[]:M.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new j.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),C=i.computed(()=>!M.isUndefined(e.isCategoryItemSelected)),x=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),N=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),$=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=i.computed(()=>z.value&&ot.getDeviceTypeByResolution()===Je.laptop?"auto":"fixed"),v=i.useTemplateRef("collapse-item-reference"),k=i.computed(()=>{var K,V;return(V=(K=e.categoryItem.properties)==null?void 0:K.templateCost)==null?void 0:V.priceCoefficient}),B=i.computed(()=>{var K,V;return(V=(K=e.categoryItem.properties)==null?void 0:K.templateCost)==null?void 0:V.increasePercent}),R=(K,V="ru-RU")=>0 .toLocaleString(V,{style:"currency",currency:K,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),E=K=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:K,target:v.value})},P=(K,V)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:V,isLoadingState:y,target:v.value})},W=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:v.value})},I=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:v.value})},Z=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:v.value})},te=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:v.value})},D=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:v.value})},L=K=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:K,target:v.value})},H=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},z=i.ref(0),O=i.computed(()=>z.value&&s.value.length>0?ng(s.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),U=M.debounce(()=>{z.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",U)}),window.addEventListener("resize",U),U(),(K,V)=>{const q=A.NCheckbox,Y=Mf,ee=A.NTooltip,ue=Pf,ve=A.NTag,Te=$f,We=Bf,ce=A.NButton,pt=vf,Ne=Ja,Vt=Qa,jt=Za,ln=jo,Bt=A.NDropdown,Hn=A.NDataTable,cn=A.NAlert,en=A.NSpin;return i.openBlock(),i.createBlock(el,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":P},{"pre-arrow":i.withCtx(()=>{var Ve,J;return[C.value?(i.openBlock(),i.createElementBlock("div",gb,[i.createVNode(q,{checked:x.value,indeterminate:$.value,disabled:N.value,"onUpdate:checked":E},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Ve=b.value)!=null&&Ve.isDisabled)?(i.openBlock(),i.createBlock(ee,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Y,{class:"pt-1.5"})]),default:i.withCtx(()=>[V[1]||(V[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((J=b.value)==null?void 0:J.isFavorite)??!1?(i.openBlock(),i.createBlock(ee,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ue,{class:"pt-1.5"})]),default:i.withCtx(()=>[V[2]||(V[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Ve,J,le,De,ni;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Ve=b.value)==null?void 0:Ve.isDisabled})},[i.createVNode(ee,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[V[3]||(V[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:V[0]||(V[0]=i.withModifiers((...it)=>i.unref(M.noop)&&i.unref(M.noop)(...it),["prevent","stop"]))},[(J=t.categoryItem.properties)!=null&&J.m2Price?(i.openBlock(),i.createBlock(ve,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((le=t.categoryItem.properties)==null?void 0:le.templateCost)&&t.categoryItem.properties.m2PriceRetail&&B.value}),round:""},{default:i.withCtx(()=>{var it;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(it=t.categoryItem.properties)!=null&&it.templateCost&&t.categoryItem.properties.m2PriceRetail&&B.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[B.value?(i.openBlock(),i.createBlock(ve,{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",pb,i.toDisplayString(B.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(ve,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",yb,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"])):(De=t.categoryItem.properties)!=null&&De.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[k.value||B.value?(i.openBlock(),i.createBlock(ve,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var it;return[k.value?(i.openBlock(),i.createElementBlock("span",bb,i.toDisplayString((it=k.value)==null?void 0:it.name),1)):i.createCommentVNode("",!0),B.value?(i.openBlock(),i.createElementBlock("span",_b,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(ve,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),u.value&&((ni=b.value)!=null&&ni.manager)?(i.openBlock(),i.createBlock(ve,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:te},{default:i.withCtx(()=>[i.createVNode(ee,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var it,qt;return[i.createElementVNode("span",wb,[i.createVNode(Te),i.createTextVNode(" "+i.toDisplayString((qt=(it=b.value)==null?void 0:it.manager)==null?void 0:qt.name),1)])]}),default:i.withCtx(()=>{var it,qt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((qt=(it=b.value)==null?void 0:it.manager)==null?void 0:qt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",xb,[i.createElementVNode("ul",kb,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ve,J)=>(i.openBlock(),i.createElementBlock("li",{key:J}," ("+i.toDisplayString(J)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Ve,J)=>(i.openBlock(),i.createElementBlock("li",{key:J}," ("+i.toDisplayString(J)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Ve;return[i.createElementVNode("div",vb,[d.value?(i.openBlock(),i.createBlock(ee,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),onClick:W},{default:i.withCtx(()=>{var J;return[(J=b.value)!=null&&J.isDisabled?(i.openBlock(),i.createBlock(Y,{key:1})):(i.openBlock(),i.createBlock(We,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var J;return[(J=b.value)!=null&&J.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),u.value&&!((Ve=b.value)!=null&&Ve.manager)?(i.openBlock(),i.createBlock(ee,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),onClick:Z},{default:i.withCtx(()=>[i.createVNode(pt)]),_:1},8,["size"])]),default:i.withCtx(()=>{var J,le,De;return[(J=b.value)!=null&&J.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(le=b.value)==null?void 0:le.manager)==null?void 0:De.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(ee,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:I},{default:i.withCtx(()=>{var J;return[(J=b.value)!=null&&J.isRequired?(i.openBlock(),i.createBlock(Vt,{key:1})):(i.openBlock(),i.createBlock(Ne,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[V[4]||(V[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(ee,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),type:"primary",onClick:D},{default:i.withCtx(()=>[i.createVNode(jt)]),_:1},8,["size"])]),default:i.withCtx(()=>[V[5]||(V[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Bt,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:L},{default:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(ln)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(K.$slots,"default",{},()=>{var Ve,J,le;return[i.createElementVNode("div",Cb,[o.value?(i.openBlock(),i.createBlock(Hd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Ve=r.value)==null?void 0:Ve.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"])):i.createCommentVNode("",!0)]),g.value&&m.value?(i.openBlock(),i.createBlock(Od,{key:0,"event-emitter":t.eventEmitter,settings:(J=t.categoryItem.properties)==null?void 0:J.configuratorSettings,editor:(le=t.categoryItem.properties)==null?void 0:le.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(i.openBlock(),i.createElementBlock("div",Sb,[g.value?(i.openBlock(),i.createBlock(ce,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:H},{default:i.withCtx(()=>[...V[6]||(V[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Hn,{columns:O.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":De=>De.id,"table-layout":w.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!o.value&&!c.value?(i.openBlock(),i.createBlock(cn,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(cn,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(en,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...V[7]||(V[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Nb=Nn(Tb,[["__scopeId","data-v-607a5aad"]]),$b={class:"sc-collapse flex w-full flex-col"},Rb={},Ld=i.defineComponent({...Rb,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,o=(s,a)=>{r("on-item-header-click",s,a)};return i.provide("itemHeaderClickHandler",o),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(s,a)=>(i.openBlock(),i.createElementBlock("div",$b,[i.renderSlot(s.$slots,"default")]))}}),Eb={},Hd=i.defineComponent({...Eb,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(lr,"medium"),r=i.computed(()=>M.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var a;return!!((a=e.filteredItems)!=null&&a[s.id])})),o=(s,a)=>{if(M.isUndefined(a))return;const l=a[s.id];if(l==="*")return;const c={};return c[s.id]=structuredClone(i.toRaw(l)),c};return(s,a)=>{const l=A.NSpin,c=A.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Ld,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Nb,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":o(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"]))),128))]),_:1})):t.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Pb={},Wd=i.defineComponent({...Pb,__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},disabledItem:{type:Function,default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=new j.Reference,l=i.computed(()=>M.isNil(r.value)?s.value?[]:null:M.isArray(r.value)?r.value.map(g=>g.id):r.value.id),c=i.computed(()=>Tt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue,void 0,r.disabledItem)),d=g=>{var m;if(M.isArray(g)){const p=g.length>0?g.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];o("update:value",p)}else{const p=g===a.id||M.isNil(g)||(m=c.value.find(b=>b.value===g))==null?void 0:m.item;o("update:value",p)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=u.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=u.value)==null?void 0:g.blur()}}),(g,m)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.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"]))}}),Fb={},Vb=i.defineComponent({...Fb,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{},disabledCoefficient:{type:Function},visibleCoefficient:{type:Function}},emits:["update:value"],setup(t,{emit:e}){var x,N;const n=t,r=e,o=()=>{const $=j.PriceCoefficient.getRetailPriceCoefficient();return M.unset($,"isNewRec"),$},s=$=>!$||$.id===o().id,a=i.computed(()=>{var $;return(($=n.catalogItem)==null?void 0:$.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=$=>{var w,v,k,B;return $.id===o().id?(w=l.value)==null?void 0:w.getRetailCost():(B=(k=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:k.find(R=>R.coefficient.id===$.id))==null?void 0:B.cost},d=i.computed(()=>{var v;const w=[...((v=j.useReferencesStore().priceCoefficientsReference)==null?void 0:v.map(k=>structuredClone(i.toRaw(k))))??[],o()].filter(k=>{var B;return((B=n.visibleCoefficient)==null?void 0:B.call(n,k))??!0});return a.value&&w.forEach(k=>{var R;const B=c(k);B?k.name+=` (${B} ${(R=l.value)==null?void 0:R.currency.symbol})`:k.name=""}),w.filter(k=>k.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((N=(x=n.value)==null?void 0:x.value)==null?void 0:N.toString())??null),f=i.ref(null),g=i.computed(()=>{var $,w;return(w=($=l.value)==null?void 0:$.priceCoefficients)==null?void 0:w.find(v=>v.coefficient.slug===j.PriceCoefficientEnum.K0)}),m=i.ref(void 0),p=$=>Number.parseFloat(($??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),b=()=>{var w,v;m.value=void 0;let $=p(h.value);if($=Number.isNaN($)?void 0:$,a.value)if(u.value||h.value){const k=o(),B=c(u.value??k)??0,R=B+B*(($??0)/100);f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(R),R>(((w=l.value)==null?void 0:w.getRetailCost())??R)&&(m.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&R<(((v=g.value)==null?void 0:v.cost)??0)&&(m.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else f.value=null;r("update:value",{value:Number.isNaN($)?void 0:$,coefficient:s(u.value)?void 0:structuredClone(i.toRaw(u.value))})},y=$=>{M.isArray($)||M.isNull($)||(u.value=$,h.value=null,!u.value&&h.value&&(u.value=o()),b())},_=()=>{u.value||(u.value=o()),b()},C=$=>{var v,k,B,R,E;const w=p($);if(a.value){let P=0;if(w<=0)u.value=void 0,h.value=null;else if(g.value&&w<(((v=g.value)==null?void 0:v.cost)??0))u.value=(k=g.value)==null?void 0:k.coefficient,P=(w-g.value.cost)*100/g.value.cost,m.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>(((B=l.value)==null?void 0:B.getRetailCost())??w)){u.value=o();const W=((R=l.value)==null?void 0:R.getRetailCost())??0;P=(w-W)*100/W,m.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const W=((E=l.value)==null?void 0:E.priceCoefficients)??[],I=M.sortBy(W,[D=>D.cost]),te=I.filter(D=>D.cost<=w).at(-1)??I.at(0);te&&(u.value=te.coefficient,P=(w-te.cost)*100/te.cost),m.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(P),r("update:value",{value:Number.isNaN(P)?void 0:P,coefficient:s(u.value)?void 0:structuredClone(i.toRaw(u.value))})}else r("update:value",{value:Number.isNaN(w)?void 0:w,coefficient:void 0})};return i.onMounted(()=>{var $,w,v,k;n.calculationType===j.CalculationTypeEnum.m2Cost?f.value=((w=($=n.value)==null?void 0:$.value)==null?void 0:w.toString())??null:!((v=n.value)!=null&&v.coefficient)&&((k=n.value)!=null&&k.value)&&(u.value=o()),b()}),($,w)=>{var B,R,E;const v=A.NInput,k=A.NInputGroup;return i.openBlock(),i.createBlock(i.unref(A.NFormItem),{"show-label":!i.unref(M.isNil)(t.label),label:t.label,"show-feedback":!i.unref(M.isNil)(((B=m.value)==null?void 0:B.feedback)??t.feedback),feedback:((R=m.value)==null?void 0:R.feedback)??t.feedback,"validation-status":((E=m.value)==null?void 0:E.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(j.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(j.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Wd,{class:"w-full min-w-0 flex-1",value:u.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"disabled-item":t.disabledCoefficient,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled","disabled-item"]),i.createVNode(v,{value:h.value,"onUpdate:value":[w[0]||(w[0]=P=>h.value=P),_],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[w[3]||(w[3]=i.createTextVNode("%",-1))]),_:2},[h.value&&!h.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[w[2]||(w[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(j.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(v,{key:1,value:f.value,"onUpdate:value":[w[1]||(w[1]=P=>f.value=P),C],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var P;return[i.createTextVNode(i.toDisplayString((P=l.value)==null?void 0:P.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Mb={key:0,class:"flex flex-row gap-2.5"},Ab={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},Ib={},jd=i.defineComponent({...Ib,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.show),a=i.ref(r.processing),l=ot.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=ot.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{o("opening"),s.value=!0,o("update:show",s.value)},h=(g="other")=>{if(a.value){o("processing:cancel",y=>{a.value=y});return}let m=!1;o("closing",g,()=>{m=!0}),m||(s.value=!1,o("update:show",s.value))},f=()=>{o("accept",m=>{a.value=m})};return i.watch(()=>r.show,g=>{g?u():h("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:u,close:h,acceptHandler:f}),(g,m)=>{const p=A.NButton,b=A.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:s.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:m[1]||(m[1]=y=>h("header")),onEsc:m[2]||(m[2]=y=>h("esc")),onMaskClick:m[3]||(m[3]=y=>h("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(g.$slots,"default")]),_:2},[g.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(g.$slots,"header")]),key:"0"}:void 0,g.$slots.action||g.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[g.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Mb,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",Ab,[i.renderSlot(g.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:m[0]||(m[0]=y=>h("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),Ob={class:"text-sm"},zb={},Db=i.defineComponent({...zb,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),o=i.useTemplateRef("base-dialog-reference"),s=i.ref(null),a=i.computed(()=>{var w,v,k;return((w=s.value)==null?void 0:w.unit.isLinear)&&((k=(v=s.value)==null?void 0:v.properties)==null?void 0:k.isLengthConfigurator)}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),u=i.ref(null),h=n,f=()=>({length:{},quantity:{},marker:{}}),g=i.ref(f()),m=i.ref(!1),p=i.computed(()=>{var R,E,P,W;if(!s.value)return{};const w=j.UnitsHelper.getProductLengthMultiplicity(s.value),v=j.UnitsHelper.getProductMultiplicity(s.value),k=((E=(R=s.value)==null?void 0:R.properties)==null?void 0:E.minLength)||w,B=(W=(P=s.value)==null?void 0:P.properties)==null?void 0:W.maxLength;return{length:[ae.required,ae.min(k??.1),ae.max(B),ae.step(w),He.serverValidation(g.value.length.feedback)],quantity:[ae.required,ae.min(v),ae.step(v),He.serverValidation(g.value.quantity.feedback)],marker:[He.serverValidation(g.value.marker.feedback)]}}),b=i.computed(()=>{var w,v,k;return s.value?((w=s.value.properties)==null?void 0:w.lengthStep)??((v=s.value.properties)!=null&&v.ignoreMinCountCheck?0:((k=s.value.properties)==null?void 0:k.minCount)??0):0}),y=i.computed(()=>{var k,B,R,E,P,W,I,Z,te;if(!s.value)return"";const w=((B=(k=s.value)==null?void 0:k.properties)==null?void 0:B.minLength)??((E=(R=s.value)==null?void 0:R.properties)!=null&&E.ignoreMinCountCheck?0:(W=(P=s.value)==null?void 0:P.properties)==null?void 0:W.minCount),v=(Z=(I=s.value)==null?void 0:I.properties)==null?void 0:Z.maxLength;return w||v?`(${w?`от ${w}`:""}${w&&v?" ":""}${v?`до ${v}`:""} ${(te=s.value)==null?void 0:te.unit.name})`:""}),_=w=>{var E,P;if(!((P=(E=s.value)==null?void 0:E.properties)!=null&&P.isLengthConfigurator)||!u.value||M.isNil(w)||b.value===0)return;const v=w/b.value,k=Math.round(v),B=j.UnitsHelper.getProductMultiplicity(s.value),R=Math.max(k,B);u.value.quantity=R},C=w=>{var R,E,P,W;if(!((E=(R=s.value)==null?void 0:R.properties)!=null&&E.isLengthConfigurator)||!u.value||M.isNil(w)||b.value===0)return;const v=w*b.value,k=((P=s.value.properties)==null?void 0:P.minLength)||j.UnitsHelper.getProductLengthMultiplicity(s.value),B=(W=s.value.properties)==null?void 0:W.maxLength;k!==void 0&&v<k?u.value.length=k:B!==void 0&&v>B?u.value.length=B:u.value.length=v},x=async w=>{var k;const v=M.cloneDeep(u.value);try{await((k=r.value)==null?void 0:k.validate(B=>{if(!B){if(!s.value||!v)return;j.UnitsHelper.productIsMeasurable(s.value)||delete v.length,a.value&&b.value&&(v.length=b.value),m.value=!0,h("submit",v,g.value,()=>{m.value=!1,w(!1),i.nextTick(()=>{var R;(R=r.value)==null||R.validate(M.noop).catch(M.noop)})})}}))}catch{}},N=()=>{s.value=null,l.value=void 0,u.value=null,g.value=f()};return e({show:(w,v)=>{var k,B,R,E,P;if(s.value=w,l.value=v==null?void 0:v.cartItemData,c.value=v==null?void 0:v.orderId,d.value=(v==null?void 0:v.canSetDopProdaga)??!1,u.value=new j.OrderItemBase((v==null?void 0:v.cartItemData)??new j.OrderItemBase({product:w,quantity:j.UnitsHelper.productIsMeasurable(s.value)?1:((k=w==null?void 0:w.properties)==null?void 0:k.minCount)??1,length:((B=w==null?void 0:w.properties)==null?void 0:B.minLength)||((R=w==null?void 0:w.properties)!=null&&R.ignoreMinCountCheck?0:(E=w==null?void 0:w.properties)==null?void 0:E.minCount)||0})),(P=w==null?void 0:w.properties)!=null&&P.isLengthConfigurator&&u.value&&b.value>0){const W=b.value,I=u.value.quantity||1;u.value.length=I*W}},closeDialog:N}),(w,v)=>{var P;const k=A.NFormItem,B=A.NInputGroupLabel,R=A.NInputGroup,E=A.NCheckbox;return i.openBlock(),i.createBlock(jd,{ref:"base-dialog-reference",show:!i.unref(M.isNil)(s.value)&&!i.unref(M.isNil)(u.value),title:`${l.value?"Изменение":"Добавление"} товара ${(P=s.value)==null?void 0:P.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:m.value,"modal-width":500,onAccept:x,onClosing:N},{default:i.withCtx(()=>{var W;return[s.value&&u.value?(i.openBlock(),i.createBlock(i.unref(A.NForm),{key:0,ref:"form-reference",model:u.value,rules:p.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers((W=o.value)==null?void 0:W.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>[i.unref(j.UnitsHelper).productIsMeasurable(s.value)?(i.openBlock(),i.createBlock(k,{key:0,path:"length",label:`Метраж, ${y.value+s.value.unit.name}`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:u.value.length,"onUpdate:value":[v[0]||(v[0]=I=>u.value.length=I),_],parse:i.unref(rt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:v[1]||(v[1]=I=>i.unref(zr)(I,".",!1)),onInput:v[2]||(v[2]=I=>i.unref(tt)(g.value,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(k,{path:"quantity",label:"Количество, шт."},{default:i.withCtx(()=>[i.createVNode(R,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[3]||(v[3]=I=>u.value.quantity=I),C],parse:i.unref(rt),step:i.unref(j.UnitsHelper).getProductMultiplicity(s.value),"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[4]||(v[4]=I=>i.unref(zr)(I,".",!1)),onInput:v[5]||(v[5]=I=>i.unref(tt)(g.value,"quantity")),onFocus:i.unref(Le)},null,8,["value","parse","step","onFocus"]),a.value?(i.openBlock(),i.createBlock(B,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(b.value)+" "+i.toDisplayString(s.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!g.value.quantity.feedback&&i.unref(j.UnitsHelper).getProductMultiplicity(s.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Ob,"Количество должно быть кратно "+i.toDisplayString(i.unref(j.UnitsHelper).getProductMultiplicity(s.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.unref(j.UnitsHelper).productIsMeasurable(s.value)?(i.openBlock(),i.createBlock(k,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[6]||(v[6]=I=>i.unref(tt)(g.value,"marker")),"onUpdate:value":v[7]||(v[7]=I=>u.value.marker=I??null),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(E,{key:2,checked:u.value.isAdditionalSale,"onUpdate:checked":v[8]||(v[8]=I=>u.value.isAdditionalSale=I),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...v[9]||(v[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),Lb={class:"flex flex-row gap-1"},Hb={class:"sc-client-name flex flex-col gap-1 text-base"},Wb=["href"],jb={key:1,class:"text-sc-grey"},qb={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Xb={key:0},Yb={key:1,class:"text-sm"},Ub={},br=i.defineComponent({...Ub,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>n.client.lastLoginAt?je.format(n.client.lastLoginAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=a=>{M.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=qo,d=A.NButton,u=A.NPopover;return i.openBlock(),i.createElementBlock("div",Lb,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(u,{disabled:i.unref(M.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Hb,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>s(h))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",jb," [ Деактивирован ] "))],8,Wb),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",qb," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",Xb,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("span",Yb," Последний вход: "+i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Kb={class:"text-base"},Gb={},qd=i.defineComponent({...Gb,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",Kb,i.toDisplayString(t.contragent.name),1))}}),Zb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qb(t,e){return i.openBlock(),i.createElementBlock("svg",Zb,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const Jb=i.markRaw({name:"tabler-mail",render:Qb}),e_=["href"],t_={},n_=i.defineComponent({...t_,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=Jb;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,e_)],2)}}}),i_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function r_(t,e){return i.openBlock(),i.createElementBlock("svg",i_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const Xd=i.markRaw({name:"fa6-brands-viber",render:r_}),o_={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},s_=["id"],a_=["id"],l_=["fill"],c_=["fill"];function d_(t,e){return i.openBlock(),i.createElementBlock("svg",o_,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,s_),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,a_)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,l_),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,c_),e[2]||(e[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Yd=i.markRaw({name:"logos-whatsapp-icon",render:d_,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),u_={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},h_=["id"],f_=["fill"];function m_(t,e){return i.openBlock(),i.createElementBlock("svg",u_,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,h_)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,f_),e[1]||(e[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Ud=i.markRaw({name:"logos-telegram",render:m_,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),g_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function p_(t,e){return i.openBlock(),i.createElementBlock("svg",g_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)])])}const Kd=i.markRaw({name:"ion-call",render:p_}),y_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b_(t,e){return i.openBlock(),i.createElementBlock("svg",y_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"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 __=i.markRaw({name:"tabler-phone-call",render:b_}),w_={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},x_=["href"],k_=["href"],v_=["href"],C_=["href"],S_={},B_=i.defineComponent({...S_,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?or.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return M.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),o=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),s=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=__,u=Kd,h=Ud,f=Yd,g=Xd;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]=m=>a.value=!a.value),onFocusout:c[1]||(c[1]=m=>a.value=!1),onMouseleave:c[2]||(c[2]=m=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(o.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",w_,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${s.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(u)],8,x_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${s.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(h)],8,k_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${s.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(f)],8,v_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${s.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(g)],8,C_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),T_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N_(t,e){return i.openBlock(),i.createElementBlock("svg",T_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const $_=i.markRaw({name:"mdi-envelope",render:N_}),R_={class:"flex flex-col gap-1"},E_={key:0,class:"mb-2 flex flex-col text-base"},P_={key:0,class:"text-sc-dark-grey text-sm"},F_={key:1,class:"whitespace-nowrap text-sm"},V_={key:2,class:"whitespace-nowrap text-sm"},M_={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},A_=["href"],I_=["href"],O_=["href"],z_=["href"],D_=["href"],L_={key:0,class:"flex flex-col text-base"},H_={key:0,class:"text-sc-dark-grey text-sm"},W_={key:1,class:"mt-2 text-sm"},j_={key:0,class:"-mt-1"},q_={},X_=i.defineComponent({...q_,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?or.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return M.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),o=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),s=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const u=Kd,h=Ud,f=Yd,g=Xd,m=$_,p=A.NPopover;return i.openBlock(),i.createElementBlock("div",R_,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,C,x,N;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=$=>l.value=!0),onFocusin:d[1]||(d[1]=$=>l.value=!0),onMouseleave:d[2]||(d[2]=$=>l.value=!1),onFocusout:d[3]||(d[3]=$=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(C=t.contact)!=null&&C.position)?(i.openBlock(),i.createElementBlock("div",E_,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(x=t.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",P_,i.toDisplayString((N=t.contact)==null?void 0:N.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",F_,i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",V_,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",M_,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${s.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(u)],8,A_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${s.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(h)],8,I_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${s.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(f)],8,O_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${s.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(g)],8,z_)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(m)],8,D_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,C,x,N;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",L_,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",H_,i.toDisplayString((C=t.contact)==null?void 0:C.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(x=t.contact)!=null&&x.comment?(i.openBlock(),i.createElementBlock("div",W_,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((N=t.contact)==null?void 0:N.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",j_,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}});class Y_{constructor(e){T(this,"minHeight");T(this,"maxHeights");T(this,"minWidth");T(this,"maxWidths");T(this,"netType");T(this,"color");T(this,"mountType");T(this,"descriptions");T(this,"crossbarCount");T(this,"heightOverlaps");T(this,"widthOverlaps");T(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Wo.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Wo.objectToSnake(e.heightOverlaps),this.widthOverlaps=Wo.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function U_(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==j.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&M.isArray(t.products)&&t.products.length>0}const K_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G_(t,e){return i.openBlock(),i.createElementBlock("svg",K_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M16 12a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2"},null,-1)])])}const Z_=i.markRaw({name:"mdi-dots-horizontal",render:G_}),Gd="date-range.dialog.mode",Zd=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Qd=(t,e,n)=>{let r=t??void 0,o=e??void 0;return r&&o&&r>o&&(n!=null&&n.from?o=r:n!=null&&n.to?r=o:[r,o]=[o,r]),{from:r?je.startOfDay(r):void 0,to:o?je.endOfDay(o):void 0}},Q_={class:"text-center font-semibold"},J_={class:"grid grid-cols-3 gap-1"},e1=["onPointerdown","onPointerenter","onKeydown"],t1={},n1=i.defineComponent({...t1,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=A.useThemeVars(),s=i.computed(()=>({"--sc-primary-color":o.value.primaryColor,"--sc-primary-color-hover":o.value.primaryColorHover,"--sc-primary-color-suppl":o.value.primaryColorSuppl,"--sc-hover-color":o.value.hoverColor})),a=w=>{const v=new Date().getFullYear();return w&&je.isValid(w)?w.getFullYear():v},l=i.ref(a(n.from??n.to)),c=ot.initRefDependingOnDeviceResolution(1,3,3),d=i.computed(()=>c.value===1?[l.value]:[l.value-1,l.value,l.value+1]),u=i.ref(null),h=i.ref(null),f=i.ref(!1),g=i.ref(null),m=i.computed(()=>{const{from:w,to:v}=n;return!w||!v||!je.isSameDay(w,je.startOfMonth(w))||!je.isSameDay(v,je.endOfMonth(v))?null:[w.getFullYear()*12+w.getMonth(),v.getFullYear()*12+v.getMonth()]}),p=i.computed(()=>f.value&&h.value!==null&&g.value!==null?b(h.value,g.value):u.value!==null?g.value===null?[u.value,u.value]:b(u.value,g.value):m.value),b=(w,v)=>w<=v?[w,v]:[v,w],y=(w,v)=>{const k=w*12+v,B=p.value;return B&&k>=B[0]&&k<=B[1]?[k===B[0]||k===B[1]?"sc-month--bound":"sc-month--in-range"]:[]},_=(w,v)=>{const[k,B]=b(w,v);u.value=null,r("select",{from:new Date(Math.floor(k/12),k%12,1),to:je.endOfMonth(new Date(Math.floor(B/12),B%12,1))})},C=w=>{u.value===null?(u.value=w,r("select",{from:new Date(Math.floor(w/12),w%12,1),to:je.endOfMonth(new Date(Math.floor(w/12),w%12,1))})):_(u.value,w)},x=()=>{globalThis.removeEventListener("pointerup",x);const w=h.value;if(w!==null){if(h.value=null,f.value){f.value=!1,g.value!==null&&_(w,g.value);return}C(w)}},N=(w,v)=>{h.value=w*12+v,f.value=!1,globalThis.addEventListener("pointerup",x)},$=(w,v)=>{const k=w*12+v;g.value=k,h.value!==null&&k!==h.value&&(f.value=!0)};return i.watch(()=>[n.from,n.to],()=>{const w=n.from??n.to;if(!w||!je.isValid(w))return;const v=w.getFullYear();(v<l.value-1||v>l.value+1)&&(l.value=v)}),i.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",x)}),(w,v)=>{const k=A.NButton;return i.openBlock(),i.createElementBlock("div",{class:"flex select-none items-start gap-2",style:i.normalizeStyle(s.value),onPointerleave:v[2]||(v[2]=B=>g.value=null)},[i.createVNode(k,{size:"small",quaternary:"",class:"mt-5",onClick:v[0]||(v[0]=B=>l.value-=1)},{default:i.withCtx(()=>[...v[3]||(v[3]=[i.createTextVNode(" ‹ ",-1)])]),_:1}),i.createElementVNode("div",{class:i.normalizeClass(["grid flex-1 gap-4 sm:gap-8",d.value.length===1?"grid-cols-1":"grid-cols-3"])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,B=>(i.openBlock(),i.createElementBlock("div",{key:B,class:"flex flex-col gap-1"},[i.createElementVNode("div",Q_,i.toDisplayString(B),1),i.createElementVNode("div",J_,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Zd),(R,E)=>(i.openBlock(),i.createElementBlock("button",{key:R,type:"button",class:i.normalizeClass(["sc-month cursor-pointer rounded border-0 px-1 py-1 text-sm",y(B,E)]),onPointerdown:i.withModifiers(P=>N(B,E),["prevent"]),onPointerenter:P=>$(B,E),onKeydown:[i.withKeys(i.withModifiers(P=>C(B*12+E),["prevent"]),["enter"]),i.withKeys(i.withModifiers(P=>C(B*12+E),["prevent"]),["space"])]},i.toDisplayString(R),43,e1))),128))])]))),128))],2),i.createVNode(k,{size:"small",quaternary:"",class:"mt-5",onClick:v[1]||(v[1]=B=>l.value+=1)},{default:i.withCtx(()=>[...v[4]||(v[4]=[i.createTextVNode(" › ",-1)])]),_:1})],36)}}}),i1=Nn(n1,[["__scopeId","data-v-7dd4941e"]]),r1={class:"sc-date-range-sidebar flex flex-col gap-1"},o1={class:"flex items-center justify-center gap-1"},s1={class:"min-w-12 text-center font-semibold"},a1={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},l1={},c1=i.defineComponent({...l1,__name:"month-year-sidebar",props:{year:{},month:{}},emits:["update:year","select-month","today"],setup(t,{emit:e}){const n=e;return(r,o)=>{const s=A.NButton;return i.openBlock(),i.createElementBlock("div",r1,[i.createElementVNode("div",o1,[i.createVNode(s,{size:"small",quaternary:"",onClick:o[0]||(o[0]=a=>n("update:year",t.year-1))},{default:i.withCtx(()=>[...o[3]||(o[3]=[i.createTextVNode(" ‹ ",-1)])]),_:1}),i.createElementVNode("span",s1,i.toDisplayString(t.year),1),i.createVNode(s,{size:"small",quaternary:"",onClick:o[1]||(o[1]=a=>n("update:year",t.year+1))},{default:i.withCtx(()=>[...o[4]||(o[4]=[i.createTextVNode(" › ",-1)])]),_:1})]),i.createElementVNode("div",a1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Zd),(a,l)=>(i.openBlock(),i.createBlock(s,{key:a,size:"small",quaternary:"",type:l===t.month?"primary":"default",onClick:c=>n("select-month",l)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a),1)]),_:2},1032,["type","onClick"]))),128))]),i.createVNode(s,{size:"small",text:"",type:"info",onClick:o[2]||(o[2]=a=>n("today"))},{default:i.withCtx(()=>[...o[5]||(o[5]=[i.createTextVNode(" Сегодня ",-1)])]),_:1})])}}}),d1={},Jd=i.defineComponent({...d1,__name:"date-range-input",props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>j.useBaseConfigStateStore().config.dateFormats.uiDate}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=ot.initRefDependingOnDeviceResolution(!0,!1,!1),s=i.ref(null),a=i.ref(!1),l=i.ref(0),c=i.ref(new Date),d=i.computed(()=>{const C=n.value&&je.isValid(n.value)?n.value:c.value;return C.getFullYear()===c.value.getFullYear()?C.getMonth():null});let u=0;const h=C=>{var x,N;(N=(x=C.target)==null?void 0:x.closest)!=null&&N.call(x,".n-base-clear")&&(u=performance.now())},f=C=>{C&&performance.now()-u<300||(a.value=C,C&&(c.value=n.value&&je.isValid(n.value)?n.value:new Date))},g=C=>{r("update:value",C===null?null:new Date(C))},m=(C,x)=>{const N=new Date(C,x,1);if(c.value=N,n.value&&je.isValid(n.value)){const $=Math.min(je.getDate(n.value),je.getDaysInMonth(N));r("update:value",new Date(C,x,$));return}l.value+=1,i.nextTick().then(()=>{var $;return($=s.value)==null?void 0:$.focus()})},p=(C,x)=>{c.value=je.addYears(je.addMonths(c.value,C),x)},b=C=>{m(C,c.value.getMonth())},y=C=>{m(c.value.getFullYear(),C)},_=()=>{a.value=!1,r("update:value",new Date)};return(C,x)=>{const N=A.NButton,$=A.NDatePicker;return i.openBlock(),i.createBlock($,{ref_key:"pickerReference",ref:s,key:l.value,value:n.value?n.value.getTime():null,show:a.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,format:t.dateFormat,actions:[],"default-calendar-start-time":c.value.getTime(),type:"date",class:"min-w-28",onMousedownCapture:h,"onUpdate:show":f,"onUpdate:value":g,onNextMonth:x[0]||(x[0]=w=>p(1,0)),onPrevMonth:x[1]||(x[1]=w=>p(-1,0)),onNextYear:x[2]||(x[2]=w=>p(0,1)),onPrevYear:x[3]||(x[3]=w=>p(0,-1))},{footer:i.withCtx(()=>[i.unref(o)?(i.openBlock(),i.createBlock(N,{key:1,size:"small",text:"",type:"info",onClick:_},{default:i.withCtx(()=>[...x[4]||(x[4]=[i.createTextVNode(" Сегодня ",-1)])]),_:1})):(i.openBlock(),i.createBlock(c1,{key:0,year:c.value.getFullYear(),month:d.value,"onUpdate:year":b,onSelectMonth:y,onToday:_},null,8,["year","month"]))]),_:1},8,["value","show","clearable","disabled","placeholder","format","default-calendar-start-time"])}}}),u1={class:"@container"},h1={class:"flex flex-col gap-1 @xs:flex-row @xs:items-center"},f1={},eu=i.defineComponent({...f1,__name:"date-range-fields",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},from:{default:null},to:{default:null},placeholderFrom:{default:"Дата начала"},placeholderTo:{default:"Дата окончания"},dateFormat:{default:void 0}},emits:["update:from","update:to"],setup(t,{emit:e}){const n=e;return(r,o)=>{var s,a;return i.openBlock(),i.createElementBlock("div",u1,[i.createElementVNode("div",h1,[i.createVNode(Jd,{value:t.from,clearable:t.clearable,disabled:(s=t.disabled)==null?void 0:s.from,placeholder:t.placeholderFrom,"date-format":t.dateFormat,class:"@xs:flex-1","onUpdate:value":o[0]||(o[0]=l=>n("update:from",l))},null,8,["value","clearable","disabled","placeholder","date-format"]),o[2]||(o[2]=i.createElementVNode("span",{class:"hidden text-gray-400 @xs:inline"},"–",-1)),i.createVNode(Jd,{value:t.to,clearable:t.clearable,disabled:(a=t.disabled)==null?void 0:a.to,placeholder:t.placeholderTo,"date-format":t.dateFormat,class:"@xs:flex-1","onUpdate:value":o[1]||(o[1]=l=>n("update:to",l))},null,8,["value","clearable","disabled","placeholder","date-format"])])])}}}),m1={class:"flex flex-col items-stretch gap-3 sm:flex-row"},g1={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},p1={class:"flex flex-col items-stretch pr-3"},y1={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},b1={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},_1={},w1=i.defineComponent({..._1,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(t,{emit:e}){const n=t,r=e,o="custom",s=ot.initRefDependingOnDeviceResolution(!0,!1,!1),a=j.DateTimeProvider.standardPeriods(),l=i.ref(j.STANDARD_PERIOD_GROUPS[0].key),c=i.computed(()=>{const h=j.STANDARD_PERIOD_GROUPS.map(f=>({key:f.key,value:f.key,label:f.label}));return M.isEmpty(n.customPeriods)||h.push({key:o,value:o,label:"Пользовательские"}),h}),d=h=>Object.entries(h).map(([f,g])=>({value:f,label:g.label,item:g})),u=i.computed(()=>{if(l.value===o)return[{type:"group",key:o,children:d(n.customPeriods??{})}];const h=Object.entries(a).filter(([,g])=>g.group===l.value),f=Object.fromEntries(h);return l.value!=="other"?[{type:"group",key:l.value,children:d(f)}]:j.STANDARD_PERIOD_SECTIONS.map(g=>{const m=h.filter(([,p])=>p.section===g.key);return{type:"group",key:g.key,label:g.label,children:d(Object.fromEntries(m))}}).filter(g=>{var m;return(((m=g.children)==null?void 0:m.length)??0)>0})});return(h,f)=>{const g=A.NButton,m=A.NScrollbar,p=A.NSelect,b=A.NMenu;return i.openBlock(),i.createElementBlock("div",m1,[i.createElementVNode("div",g1,[i.createVNode(m,{class:"max-h-96"},{default:i.withCtx(()=>[i.createElementVNode("div",p1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,y=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:y.key},[y.label?(i.openBlock(),i.createElementBlock("div",y1,i.toDisplayString(y.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(y.children,_=>(i.openBlock(),i.createBlock(g,{key:_.value,size:"small",quaternary:"",type:_.value===t.activeKey?"primary":"default",class:"justify-start",onClick:C=>r("apply",_),onMouseenter:C=>r("preview",_),onMouseleave:f[0]||(f[0]=C=>r("preview"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(_.label),1)]),_:2},1032,["type","onClick","onMouseenter"]))),128))],64))),128))])]),_:1})]),i.unref(s)?(i.openBlock(),i.createBlock(p,{key:0,value:l.value,options:c.value,class:"order-1","onUpdate:value":f[1]||(f[1]=y=>l.value=y)},null,8,["value","options"])):(i.openBlock(),i.createElementBlock("div",b1,[i.createVNode(b,{value:l.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=y=>l.value=y)},null,8,["value","options"])]))])}}}),x1={class:"flex flex-col gap-3"},k1={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},v1={key:0,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},C1={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},S1={class:"flex gap-2"},B1={},T1=i.defineComponent({...B1,__name:"date-range-dialog",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},show:{type:Boolean},dateRange:{default:void 0},customPeriods:{default:void 0},dateFormat:{default:void 0}},emits:["update:show","select"],setup(t,{emit:e}){const n=t,r=e,o=ot.initRefDependingOnDeviceResolution("100%","90%","44rem"),s=i.ref("custom"),a=()=>j.PreferencesStorageProvider.getActualDataFromStorage(Gd)==="standard"?"standard":"custom",l=i.ref({}),c=i.ref(null),d=i.ref(null),u=i.computed(()=>c.value??l.value),h=(x,N)=>{var v,k;const $=(v=n.disabled)!=null&&v.from?l.value.from:x,w=(k=n.disabled)!=null&&k.to?l.value.to:N;c.value=null,l.value=Qd($,w,n.disabled)},f=x=>{d.value=null,h(x,l.value.to)},g=x=>{d.value=null,h(l.value.from,x)},m=()=>{d.value=null,h(null,null)},p=x=>{d.value=null,h(x.from,x.to)},b=x=>{const N=x.item;h(N.from,N.to),d.value=String(x.value)},y=x=>{const N=x==null?void 0:x.item;c.value=N?{from:N.from,to:N.to}:null},_=()=>{c.value=null,s.value=s.value==="custom"?"standard":"custom";const x=Gd;j.PreferencesStorageProvider.saveActualDataToStorage(x,s.value,je.addYears(je.startOfToday(),1))},C=()=>{r("select",l.value),r("update:show",!1)};return i.watch(()=>n.show,x=>{x&&(s.value=a(),d.value=null,c.value=null,l.value={...n.dateRange})}),(x,N)=>{const $=A.NButton,w=A.NModal;return i.openBlock(),i.createBlock(w,{show:t.show,preset:"card",title:"Выберите период",closable:"",style:i.normalizeStyle({width:i.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":N[1]||(N[1]=v=>r("update:show",v))},{footer:i.withCtx(()=>[i.createElementVNode("div",C1,[i.createVNode($,{text:"",type:"info",onClick:_},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),i.createElementVNode("div",S1,[i.createVNode($,{type:"primary",onClick:C},{default:i.withCtx(()=>[...N[3]||(N[3]=[i.createTextVNode(" Выбрать ",-1)])]),_:1}),i.createVNode($,{onClick:N[0]||(N[0]=v=>r("update:show",!1))},{default:i.withCtx(()=>[...N[4]||(N[4]=[i.createTextVNode("Отмена",-1)])]),_:1})])])]),default:i.withCtx(()=>[i.createElementVNode("div",x1,[i.createElementVNode("div",k1,[i.createVNode(eu,{from:u.value.from,to:u.value.to,clearable:t.clearable,disabled:t.disabled,"date-format":t.dateFormat,class:"flex-1","onUpdate:from":f,"onUpdate:to":g},null,8,["from","to","clearable","disabled","date-format"]),t.clearable?(i.openBlock(),i.createBlock($,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:m},{default:i.withCtx(()=>[...N[2]||(N[2]=[i.createTextVNode(" Очистить период ",-1)])]),_:1})):i.createCommentVNode("",!0)]),s.value==="custom"?(i.openBlock(),i.createElementBlock("div",v1,[i.createVNode(i1,{from:l.value.from,to:l.value.to,onSelect:p},null,8,["from","to"])])):(i.openBlock(),i.createBlock(w1,{key:1,"active-key":d.value,"custom-periods":t.customPeriods,onApply:b,onPreview:y},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),N1={class:"flex w-full min-w-28 items-center gap-1"},$1={},R1=i.defineComponent({...$1,__name:"date-range",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},dateRange:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1},placeholderFrom:{default:"Дата начала"},placeholderTo:{default:"Дата окончания"},dateFormat:{default:void 0}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.computed(()=>{const u={...n.useDefaultPredefinedDateRanges?j.DateTimeProvider.defaultDateRanges():{},...n.predefinedDateRanges};return M.isEmpty(u)?void 0:u}),a=(u,h)=>{r("update:date-range",Qd(u,h,n.disabled))},l=u=>{var h;a(u,(h=n.dateRange)==null?void 0:h.to)},c=u=>{var h;a((h=n.dateRange)==null?void 0:h.from,u)},d=u=>{a(u.from,u.to)};return(u,h)=>{var m,p,b,y;const f=Z_,g=A.NButton;return i.openBlock(),i.createElementBlock("div",N1,[i.createVNode(eu,{from:(m=t.dateRange)==null?void 0:m.from,to:(p=t.dateRange)==null?void 0:p.to,clearable:t.clearable,disabled:t.disabled,"placeholder-from":t.placeholderFrom,"placeholder-to":t.placeholderTo,"date-format":t.dateFormat,class:"flex-1","onUpdate:from":l,"onUpdate:to":c},null,8,["from","to","clearable","disabled","placeholder-from","placeholder-to","date-format"]),i.createVNode(g,{disabled:!!((b=t.disabled)!=null&&b.from&&((y=t.disabled)!=null&&y.to)),title:"Выбрать период","aria-label":"Выбрать период",onClick:h[0]||(h[0]=_=>o.value=!0)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(T1,{show:o.value,"onUpdate:show":h[1]||(h[1]=_=>o.value=_),"date-range":t.dateRange,clearable:t.clearable,disabled:t.disabled,"custom-periods":s.value,"date-format":t.dateFormat,onSelect:d},null,8,["show","date-range","clearable","disabled","custom-periods","date-format"])])}}}),E1={class:"sc-lbl-date text-nowrap"},P1={},yo=i.defineComponent({...P1,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>je.format(e.date,j.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>je.format(e.date,"HH:mm"));return(o,s)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",E1,i.toDisplayString(n.value),1),t.isShowTime?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)):i.createCommentVNode("",!0)],2))}}),F1={class:"flex flex-row gap-2.5"},V1={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},M1={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},A1={class:"mb-0.5 sm:mb-0 sm:ml-3"},I1={},O1=i.defineComponent({...I1,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=po,o=A.NButton,s=A.NPopover;return i.openBlock(),i.createElementBlock("div",F1,[i.createElementVNode("div",V1,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",M1,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",A1,[t.showCloseButton?(i.openBlock(),i.createBlock(s,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(o,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),z1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function D1(t,e){return i.openBlock(),i.createElementBlock("svg",z1,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const L1=i.markRaw({name:"ion-download-outline",render:D1}),H1={},W1=i.defineComponent({...H1,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,o=i.ref([]),s=i.computed(()=>o.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{o.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=L1;return i.openBlock(),i.createBlock(i.unref(A.NUpload),{"file-list":s.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),j1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function q1(t,e){return i.openBlock(),i.createElementBlock("svg",j1,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)])])}const X1=i.markRaw({name:"ion-checkmark-done-sharp",render:q1}),Y1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function U1(t,e){return i.openBlock(),i.createElementBlock("svg",Y1,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const K1=i.markRaw({name:"ion-options-outline",render:U1}),G1={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},Z1={class:"flex-auto"},Q1={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"},J1={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"},ew={},Ws=i.defineComponent({...ew,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(t,{emit:e}){const n=e,r=i.ref(!1),o=()=>{n("edit")},s=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",s)},l=()=>{n("cancel",s)};return(c,d)=>{const u=K1,h=A.NButton,f=A.NPopover,g=X1,m=po;return i.openBlock(),i.createElementBlock("div",G1,[i.createElementVNode("div",Z1,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",Q1,[i.createElementVNode("div",J1,[t.showEditButton?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:o},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(f,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),tw={},tu=i.defineComponent({...tw,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.showEditor),s=l=>{r("editor:apply",d=>{o.value=!d,l()})},a=l=>{o.value=!1,l(),r("editor:cancel")};return i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{o.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[o.value?(i.openBlock(),i.createBlock(Ws,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:s,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(Ws,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>o.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"]))]))}}),nw={},iw=i.defineComponent({...nw,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.value),s=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=M.debounce(()=>r("update:value",o.value),s.value),l=c=>{o.value=c,a()};return i.watch(()=>n.value,c=>{o.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(A.NInput),{value:o.value,"onUpdate:value":[d[0]||(d[0]=u=>o.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),rw={},ow=i.defineComponent({...rw,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input","focus"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=M.debounce(()=>o("update:value",s.value),a.value),c=g=>{s.value=g,l()};i.watch(()=>r.value,g=>{s.value=g});const d=i.ref(null);return e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blur()},select:()=>{var g;return(g=d.value)==null?void 0:g.select()}}),(g,m)=>(i.openBlock(),i.createBlock(i.unref(A.NInputNumber),{ref_key:"inputReference",ref:d,value:s.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:m[0]||(m[0]=p=>o("keydown",p)),onInput:m[1]||(m[1]=p=>o("input",p)),onFocus:m[2]||(m[2]=p=>o("focus",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),sw={},aw=i.defineComponent({...sw,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref((n.value??"").replaceAll(/\D*/g,"")),s=M.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(M.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(M.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof or.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?s(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const u=or.parsePhoneNumberWithError(`+${d}`);u.isValid()?o.value=u.format("E.164"):u.getPossibleCountries().length>0&&(o.value=`+${d}`)}catch(u){if(u instanceof or.ParseError)o.value=d;else throw u}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=o.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(o.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(af.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>o.value=u),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),lw=Nn(aw,[["__scopeId","data-v-751dbb0e"]]),cw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function dw(t,e){return i.openBlock(),i.createElementBlock("svg",cw,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const uw=i.markRaw({name:"tabler-external-link",render:dw}),hw={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},fw=["href"],mw={},gw=i.defineComponent({...mw,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=uw,o=A.NTooltip;return i.openBlock(),i.createBlock(o,{disabled:i.unref(M.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",hw,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,fw),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),pw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yw(t,e){return i.openBlock(),i.createElementBlock("svg",pw,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const bw=i.markRaw({name:"ion-remove-circle-outline",render:yw});let bo=[];const nu=new WeakMap;function _w(){bo.forEach(t=>t(...nu.get(t))),bo=[]}function iu(t,...e){nu.set(t,e),!bo.includes(t)&&bo.push(t)===1&&requestAnimationFrame(_w)}function _r(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function wr(t){return t.composedPath()[0]||null}function xr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function kr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function rn(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const ru={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 ww(t,e,n){e/=100,n/=100;let r=(o,s=(o+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function xw(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),o=(s,a=(s+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const wn="^\\s*",xn="\\s*$",Gn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Wt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",mi="([0-9A-Fa-f])",gi="([0-9A-Fa-f]{2})",ou=new RegExp(`${wn}hsl\\s*\\(${Wt},${Gn},${Gn}\\)${xn}`),su=new RegExp(`${wn}hsv\\s*\\(${Wt},${Gn},${Gn}\\)${xn}`),au=new RegExp(`${wn}hsla\\s*\\(${Wt},${Gn},${Gn},${Wt}\\)${xn}`),lu=new RegExp(`${wn}hsva\\s*\\(${Wt},${Gn},${Gn},${Wt}\\)${xn}`),kw=new RegExp(`${wn}rgb\\s*\\(${Wt},${Wt},${Wt}\\)${xn}`),vw=new RegExp(`${wn}rgba\\s*\\(${Wt},${Wt},${Wt},${Wt}\\)${xn}`),Cw=new RegExp(`${wn}#${mi}${mi}${mi}${xn}`),Sw=new RegExp(`${wn}#${gi}${gi}${gi}${xn}`),Bw=new RegExp(`${wn}#${mi}${mi}${mi}${mi}${xn}`),Tw=new RegExp(`${wn}#${gi}${gi}${gi}${gi}${xn}`);function Ot(t){return parseInt(t,16)}function Nw(t){try{let e;if(e=au.exec(t))return[wo(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=ou.exec(t))return[wo(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function $w(t){try{let e;if(e=lu.exec(t))return[wo(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=su.exec(t))return[wo(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function pi(t){try{let e;if(e=Sw.exec(t))return[Ot(e[1]),Ot(e[2]),Ot(e[3]),1];if(e=kw.exec(t))return[wt(e[1]),wt(e[5]),wt(e[9]),1];if(e=vw.exec(t))return[wt(e[1]),wt(e[5]),wt(e[9]),yi(e[13])];if(e=Cw.exec(t))return[Ot(e[1]+e[1]),Ot(e[2]+e[2]),Ot(e[3]+e[3]),1];if(e=Tw.exec(t))return[Ot(e[1]),Ot(e[2]),Ot(e[3]),yi(Ot(e[4])/255)];if(e=Bw.exec(t))return[Ot(e[1]+e[1]),Ot(e[2]+e[2]),Ot(e[3]+e[3]),yi(Ot(e[4]+e[4])/255)];if(t in ru)return pi(ru[t]);if(ou.test(t)||au.test(t)){const[n,r,o,s]=Nw(t);return[...xw(n,r,o),s]}else if(su.test(t)||lu.test(t)){const[n,r,o,s]=$w(t);return[...ww(n,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function Rw(t){return t>1?1:t<0?0:t}function js(t,e,n,r){return`rgba(${wt(t)}, ${wt(e)}, ${wt(n)}, ${Rw(r)})`}function qs(t,e,n,r,o){return wt((t*e*(1-r)+n*r)/o)}function Ew(t,e){Array.isArray(t)||(t=pi(t)),Array.isArray(e)||(e=pi(e));const n=t[3],r=e[3],o=yi(n+r-n*r);return js(qs(t[0],n,e[0],r,o),qs(t[1],n,e[1],r,o),qs(t[2],n,e[2],r,o),o)}function ze(t,e){const[n,r,o,s=1]=Array.isArray(t)?t:pi(t);return typeof e.alpha=="number"?js(n,r,o,e.alpha):js(n,r,o,s)}function _o(t,e){const[n,r,o,s=1]=Array.isArray(t)?t:pi(t),{lightness:a=1,alpha:l=1}=e;return Pw([n*a,r*a,o*a,s*l])}function yi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function wo(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function wt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Zn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function Pw(t){const[e,n,r]=t;return 3 in t?`rgba(${wt(e)}, ${wt(n)}, ${wt(r)}, ${yi(t[3])})`:`rgba(${wt(e)}, ${wt(n)}, ${wt(r)}, 1)`}function Fw(t=8){return Math.random().toString(16).slice(2,2+t)}function cu(t){return Array.isArray(t)?t:[t]}const Xs={STOP:"STOP"};function du(t,e){const n=e(t);t.children!==void 0&&n!==Xs.STOP&&t.children.forEach(r=>du(r,e))}function Vw(t,e={}){const{preserveGroup:n=!1}=e,r=[],o=n?a=>{a.isLeaf||(r.push(a.key),s(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),s(a.children))};function s(a){a.forEach(o)}return s(t),r}function Mw(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function Aw(t){return t.children}function Iw(t){return t.key}function Ow(){return!1}function zw(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function Dw(t){return t.disabled===!0}function Lw(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function Hw(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Ys(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Us(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function Ww(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function jw(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function qw(t){return(t==null?void 0:t.type)==="group"}function Xw(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class Yw extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function Uw(t,e,n,r){return xo(e.concat(t),n,r,!1)}function Kw(t,e){const n=new Set;return t.forEach(r=>{const o=e.treeNodeMap.get(r);if(o!==void 0){let s=o.parent;for(;s!==null&&!(s.disabled||n.has(s.key));)n.add(s.key),s=s.parent}}),n}function Gw(t,e,n,r){const o=xo(e,n,r,!1),s=xo(t,n,r,!0),a=Kw(t,n),l=[];return o.forEach(c=>{(s.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>o.delete(c)),o}function Ks(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:o,indeterminateKeys:s,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:Ww(n,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:jw(n,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let h;o!==void 0?h=Gw(o,n,e,d):r!==void 0?h=Uw(r,n,e,d):h=xo(n,e,d,!1);const f=c==="parent",g=c==="child"||l,m=h,p=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,C=u.get(y);for(const x of C){if(x.isLeaf)continue;const{key:N,shallowLoaded:$}=x;if(g&&$&&x.children.forEach(B=>{!B.disabled&&!B.isLeaf&&B.shallowLoaded&&m.has(B.key)&&m.delete(B.key)}),x.disabled||!$)continue;let w=!0,v=!1,k=!0;for(const B of x.children){const R=B.key;if(!B.disabled){if(k&&(k=!1),m.has(R))v=!0;else if(p.has(R)){v=!0,w=!1;break}else if(w=!1,v)break}}w&&!k?(f&&x.children.forEach(B=>{!B.disabled&&m.has(B.key)&&m.delete(B.key)}),m.add(N)):v&&p.add(N),_&&g&&m.has(N)&&m.delete(N)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(p)}}function xo(t,e,n,r){const{treeNodeMap:o,getChildren:s}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=o.get(c);d!==void 0&&du(d,u=>{if(u.disabled)return Xs.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),Lw(u.rawNode,s))){if(r)return Xs.STOP;if(!n)throw new Yw}})}),l}function Zw(t,{includeGroup:e=!1,includeSelf:n=!0},r){var o;const s=r.treeNodeMap;let a=t==null?null:(o=s.get(t))!==null&&o!==void 0?o:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function Qw(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function Jw(t,e){const n=t.siblings,r=n.length,{index:o}=t;return e?n[(o+1)%r]:o===n.length-1?null:n[o+1]}function uu(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const o=e==="prev"?ex:Jw,s={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const u=Gs(d,s);u!==null?l=u:c(o(d,n))}else{const u=o(d,!1);if(u!==null)c(u);else{const h=tx(d);h!=null&&h.isGroup?c(o(h,n)):n&&c(o(d,!0))}}}}return c(t),l}function ex(t,e){const n=t.siblings,r=n.length,{index:o}=t;return e?n[(o-1+r)%r]:o===0?null:n[o-1]}function tx(t){return t.parent}function Gs(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:o}=r,s=n?o-1:0,a=n?-1:o,l=n?-1:1;for(let c=s;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=Gs(d,e);if(u!==null)return u}else return d}}return null}const nx={getChild(){return this.ignored?null:Gs(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return uu(this,"next",t)},getPrev(t={}){return uu(this,"prev",t)}};function ix(t,e){const n=e?new Set(e):void 0,r=[];function o(s){s.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&o(a.children)})}return o(t),r}function rx(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var ox={};function hu(t,e,n,r,o,s=null,a=0){const l=[];return t.forEach((c,d)=>{var u;ox.NODE_ENV!=="production"&&Hw(c,o)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=s,!h.ignored){const f=o(c);Array.isArray(f)&&(h.children=hu(f,e,n,r,o,h,a+1))}l.push(h),e.set(h.key,h),n.has(a)||n.set(a,[]),(u=n.get(a))===null||u===void 0||u.push(h)}),l}function sx(t,e={}){var n;const r=new Map,o=new Map,{getDisabled:s=Dw,getIgnored:a=Ow,getIsGroup:l=qw,getKey:c=Iw}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:Aw,u=e.ignoreEmptyChildren?x=>{const N=d(x);return Array.isArray(N)?N.length?N:null:N}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return Mw(this.rawNode,u)},get shallowLoaded(){return zw(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(x){return rx(this,x)}},nx),f=hu(t,r,o,h,u);function g(x){if(x==null)return null;const N=r.get(x);return N&&!N.isGroup&&!N.ignored?N:null}function m(x){if(x==null)return null;const N=r.get(x);return N&&!N.ignored?N:null}function p(x,N){const $=m(x);return $?$.getPrev(N):null}function b(x,N){const $=m(x);return $?$.getNext(N):null}function y(x){const N=m(x);return N?N.getParent():null}function _(x){const N=m(x);return N?N.getChild():null}const C={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(x){return ix(f,x)},getNode:g,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return Qw(f)},getPath(x,N={}){return Zw(x,N,C)},getCheckedKeys(x,N={}){const{cascade:$=!0,leafOnly:w=!1,checkStrategy:v="all",allowNotLoaded:k=!1}=N;return Ks({checkedKeys:Ys(x),indeterminateKeys:Us(x),cascade:$,leafOnly:w,checkStrategy:v,allowNotLoaded:k},C)},check(x,N,$={}){const{cascade:w=!0,leafOnly:v=!1,checkStrategy:k="all",allowNotLoaded:B=!1}=$;return Ks({checkedKeys:Ys(N),indeterminateKeys:Us(N),keysToCheck:x==null?[]:cu(x),cascade:w,leafOnly:v,checkStrategy:k,allowNotLoaded:B},C)},uncheck(x,N,$={}){const{cascade:w=!0,leafOnly:v=!1,checkStrategy:k="all",allowNotLoaded:B=!1}=$;return Ks({checkedKeys:Ys(N),indeterminateKeys:Us(N),keysToUncheck:x==null?[]:cu(x),cascade:w,leafOnly:v,checkStrategy:k,allowNotLoaded:B},C)},getNonLeafKeys(x={}){return Vw(f,x)}};return C}function ko(t){return t.composedPath()[0]}const ax={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function lx(t,e,n){if(t==="mousemoveoutside"){const r=o=>{e.contains(ko(o))||n(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=a=>{r=!e.contains(ko(a))},s=a=>{r&&(e.contains(ko(a))||n(a))};return{mousedown:o,mouseup:s,touchstart:o,touchend:s}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function fu(t,e,n){const r=ax[t];let o=r.get(e);o===void 0&&r.set(e,o=new WeakMap);let s=o.get(n);return s===void 0&&o.set(n,s=lx(t,e,n)),s}function cx(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=fu(t,e,n);return Object.keys(o).forEach(s=>{Pt(s,document,o[s],r)}),!0}return!1}function dx(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=fu(t,e,n);return Object.keys(o).forEach(s=>{ct(s,document,o[s],r)}),!0}return!1}function ux(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function o(w,v,k){const B=w[v];return w[v]=function(){return k.apply(w,arguments),B.apply(w,arguments)},w}function s(w,v){w[v]=Event.prototype[v]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=a.get(this))!==null&&w!==void 0?w:null}function d(w,v){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:v??l.get})}const u={bubble:{},capture:{}},h={};function f(){const w=function(v){const{type:k,eventPhase:B,bubbles:R}=v,E=ko(v);if(B===2)return;const P=B===1?"capture":"bubble";let W=E;const I=[];for(;W===null&&(W=window),I.push(W),W!==window;)W=W.parentNode||null;const Z=u.capture[k],te=u.bubble[k];if(o(v,"stopPropagation",n),o(v,"stopImmediatePropagation",r),d(v,c),P==="capture"){if(Z===void 0)return;for(let D=I.length-1;D>=0&&!t.has(v);--D){const L=I[D],H=Z.get(L);if(H!==void 0){a.set(v,L);for(const z of H){if(e.has(v))break;z(v)}}if(D===0&&!R&&te!==void 0){const z=te.get(L);if(z!==void 0)for(const O of z){if(e.has(v))break;O(v)}}}}else if(P==="bubble"){if(te===void 0)return;for(let D=0;D<I.length&&!t.has(v);++D){const L=I[D],H=te.get(L);if(H!==void 0){a.set(v,L);for(const z of H){if(e.has(v))break;z(v)}}}}s(v,"stopPropagation"),s(v,"stopImmediatePropagation"),d(v)};return w.displayName="evtdUnifiedHandler",w}function g(){const w=function(v){const{type:k,eventPhase:B}=v;if(B!==2)return;const R=h[k];R!==void 0&&R.forEach(E=>E(v))};return w.displayName="evtdUnifiedWindowEventHandler",w}const m=f(),p=g();function b(w,v){const k=u[w];return k[v]===void 0&&(k[v]=new Map,window.addEventListener(v,m,w==="capture")),k[v]}function y(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,p)),h[w]}function _(w,v){let k=w.get(v);return k===void 0&&w.set(v,k=new Set),k}function C(w,v,k,B){const R=u[v][k];if(R!==void 0){const E=R.get(w);if(E!==void 0&&E.has(B))return!0}return!1}function x(w,v){const k=h[w];return!!(k!==void 0&&k.has(v))}function N(w,v,k,B){let R;if(typeof B=="object"&&B.once===!0?R=Z=>{$(w,v,R,B),k(Z)}:R=k,cx(w,v,R,B))return;const P=B===!0||typeof B=="object"&&B.capture===!0?"capture":"bubble",W=b(P,w),I=_(W,v);if(I.has(R)||I.add(R),v===window){const Z=y(w);Z.has(R)||Z.add(R)}}function $(w,v,k,B){if(dx(w,v,k,B))return;const E=B===!0||typeof B=="object"&&B.capture===!0,P=E?"capture":"bubble",W=b(P,w),I=_(W,v);if(v===window&&!C(v,E?"bubble":"capture",w,k)&&x(w,k)){const te=h[w];te.delete(k),te.size===0&&(window.removeEventListener(w,p),h[w]=void 0)}I.has(k)&&I.delete(k),I.size===0&&W.delete(v),W.size===0&&(window.removeEventListener(w,m,P==="capture"),u[P][w]=void 0)}return{on:N,off:$}}const{on:Pt,off:ct}=ux(),Ki="@@mmoContext",hx={mounted(t,{value:e}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,Pt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ki];typeof e=="function"?n.handler?n.handler!==e&&(ct("mousemoveoutside",t,n.handler),n.handler=e,Pt("mousemoveoutside",t,e)):(t[Ki].handler=e,Pt("mousemoveoutside",t,e)):n.handler&&(ct("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ki];e&&ct("mousemoveoutside",t,e),t[Ki].handler=void 0}},Gi="@@coContext",vo={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,Pt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(ct("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Pt("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,Pt("clickoutside",t,e,{capture:n.capture})):r.handler&&(ct("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&ct("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function fx(t,e){console.error(`[vdirs/${t}]: ${e}`)}class mx{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:o}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${o}`,r.set(e,o),this.nextZIndex=o+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&fx("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const Zs=new mx,Zi="@@ziContext",mu={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n;t[Zi]={enabled:!!o,initialized:!1},o&&(Zs.ensureZIndex(t,r),t[Zi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n,s=t[Zi].enabled;o&&!s&&(Zs.ensureZIndex(t,r),t[Zi].initialized=!0),t[Zi].enabled=!!o},unmounted(t,e){if(!t[Zi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Zs.unregister(t,r)}};function gx(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function Qt(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const px=typeof window<"u";let Qi,vr;(()=>{var t,e;Qi=px?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,vr=!1,Qi!==void 0?Qi.then(()=>{vr=!0}):vr=!0})();function yx(t){if(vr)return;let e=!1;i.onMounted(()=>{vr||Qi==null||Qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Qs(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function Co(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function gu(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const bx=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function _x(){return bx}function Js(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function ea(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ea(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ea(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function pu(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const o=ea(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Qn=null;function yu(){if(Qn===null&&(Qn=document.getElementById("v-binder-view-measurer"),Qn===null)){Qn=document.createElement("div"),Qn.id="v-binder-view-measurer";const{style:t}=Qn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Qn)}return Qn.getBoundingClientRect()}function wx(t,e){const n=yu();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function ta(t){const e=t.getBoundingClientRect(),n=yu();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function xx(t){return t.nodeType===9?null:t.parentNode}function bu(t){if(t===null)return null;const e=xx(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+o+r))return e}return bu(e)}const _u=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),o=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let s=[];const a=()=>{let y=r.value;for(;y=bu(y),y!==null;)s.push(y);for(const _ of s)Pt("scroll",_,h,!0)},l=()=>{for(const y of s)ct("scroll",y,h,!0);s=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},h=()=>{iu(f)},f=()=>{c.forEach(y=>y())},g=new Set,m=y=>{g.size===0&&Pt("resize",window,b),g.has(y)||g.add(y)},p=y=>{g.has(y)&&g.delete(y),g.size===0&&ct("resize",window,b)},b=()=>{g.forEach(y=>y())};return i.onBeforeUnmount(()=>{ct("resize",window,b),l()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:m,removeResizeListener:p}},render(){return Js("binder",this.$slots)}}),wu=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(pu("follower",this.$slots),[[e]]):pu("follower",this.$slots)}}),kx="@css-render/vue3-ssr";function vx(t,e){return`<style cssr-id="${t}">
103
+ `}},ro=Li.Multiply,_p=[1,0,0,0,1,0,0,0,1],Kn=new hn(9),wp=_t.Utils,$c=new re,Cs=new hn([0,0,1,0,0,1,0,1,1,0,1,1]),xe={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Ye.document?Ye.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Li,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)xe.group.removeChild(t.children[n],e);t._renderer.texture&&(e.deleteTexture(t._renderer.texture),delete t._renderer.texture),t._renderer.positionBuffer&&(e.deleteBuffer(t._renderer.positionBuffer),delete t._renderer.positionBuffer)},render:function(t,e){if(!this._visible)return;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,o=this._matrix.manual||this._flagMatrix;if((r||o)&&(this._renderer.matrix||(this._renderer.matrix=new hn(9)),this._matrix.toTransformArray(!0,Kn),ro(Kn,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re),this._scale instanceof re?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const a=_t.Utils.getRendererType(this._mask._renderer.type);xe[a].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let s;if(this._flagSubtractions)for(s=0;s<this.subtractions.length;s++)xe.group.removeChild(this.subtractions[s],t);for(s=0;s<this.children.length;s++){const a=this.children[s],l=_t.Utils.getRendererType(a._renderer.type);xe[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(t,e){let n,r,o,s,a,l,c,d,u,h,f,g,m,p;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,C=t.renderer.ratio,x=$c.copy(e._renderer.scale).multiply(C),N=e._stroke,$=e._linewidth,w=e._fill,v=e._renderer.opacity||e._opacity,k=e._cap,B=e._join,R=e._miter,E=e._closed,P=e.dashes,W=b.length,I=W-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*x.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*x.y),1);const Z=e._renderer.rect.centroid,te=Z.x,D=Z.y;if(_.clearRect(0,0,y.width,y.height),w)if(typeof w=="string")_.fillStyle=w;else{const Y=_t.Utils.getRendererType(w._renderer.type);xe[Y].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(N){if(typeof N=="string")_.strokeStyle=N;else{const Y=_t.Utils.getRendererType(N._renderer.type);xe[Y].render.call(N,_,e),_.strokeStyle=N._renderer.effect}$&&(_.lineWidth=fn(e)),R&&(_.miterLimit=R),B&&(_.lineJoin=B),!E&&k&&(_.lineCap=k)}typeof v=="number"&&(_.globalAlpha=v),P&&P.length>0&&(_.lineDashOffset=P.offset||0,_.setLineDash(P));let L,H,z,O,U,K,V,q;_.save(),_.scale(x.x,x.y),_.translate(te,D),_.beginPath();for(let Y=0;Y<b.length;Y++){const ee=b[Y];switch(g=ee.x,m=ee.y,ee.command){case oe.close:_.closePath();break;case oe.arc:H=ee.rx,z=ee.ry,O=ee.xAxisRotation,U=ee.largeArcFlag,K=ee.sweepFlag,n=E?Lt(Y-1,W):Math.max(Y-1,0),r=b[n],V=r.x,q=r.y,wp.renderSvgArcCommand(_,V,q,H,z,U,K,O,g,m);break;case oe.curve:n=E?Lt(Y-1,W):Math.max(Y-1,0),r=b[n],d=r.controls&&r.controls.right||re.zero,u=ee.controls&&ee.controls.left||re.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),ee._relative?(s=u.x+ee.x,a=u.y+ee.y):(s=u.x,a=u.y),_.bezierCurveTo(l,c,s,a,g,m),Y>=I&&E&&(o=L,h=ee.controls&&ee.controls.right||re.zero,f=o.controls&&o.controls.left||re.zero,ee._relative?(l=h.x+ee.x,c=h.y+ee.y):(l=h.x,c=h.y),o._relative?(s=f.x+o.x,a=f.y+o.y):(s=f.x,a=f.y),g=o.x,m=o.y,_.bezierCurveTo(l,c,s,a,g,m));break;case oe.line:_.lineTo(g,m);break;case oe.move:L=ee,_.moveTo(g,m);break}}E&&_.closePath(),xe.isHidden.test(w)||(p=w._renderer&&w._renderer.offset,p&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),p&&_.restore()),xe.isHidden.test(N)||(p=N._renderer&&N._renderer.offset,p&&(_.save(),_.translate(-N._renderer.offset.x,-N._renderer.offset.y),_.scale(N._renderer.scale.x,N._renderer.scale.y),_.lineWidth=$/N._renderer.scale.x),_.stroke(),p&&_.restore()),_.restore()},getBoundingClientRect:function(t,e,n){let r=1/0,o=-1/0,s=1/0,a=-1/0,l,c;t.forEach(function(d){const u=d.x,h=d.y,f=d.controls;let g,m,p,b,y,_;s=Math.min(h,s),r=Math.min(u,r),o=Math.max(u,o),a=Math.max(h,a),d.controls&&(y=f.left,_=f.right,!(!y||!_)&&(g=d._relative?y.x+u:y.x,m=d._relative?y.y+h:y.y,p=d._relative?_.x+u:_.x,b=d._relative?_.y+h:_.y,!(!g||!m||!p||!b)&&(s=Math.min(m,b,s),r=Math.min(g,p,r),o=Math.max(g,p,o),a=Math.max(m,b,a))))}),typeof e=="number"&&(s-=e,r-=e,o+=e,a+=e),l=o-r,c=a-s,n.top=s,n.left=r,n.right=o,n.bottom=a,n.width=l,n.height=c,n.centroid||(n.centroid={}),n.centroid.x=-r,n.centroid.y=-s},render:function(t,e,n){if(!this._visible||!this._opacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,o=_t.Utils.getRendererType(this._renderer.type),s=e[o],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 Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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 hn(9)),this._matrix.toTransformArray(!0,Kn),ro(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let h,f;this._scale instanceof re?(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,c&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const h=_t.Utils.getRendererType(this._mask._renderer.type);xe[h].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,xe.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),xe.updateTexture.call(xe,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==s&&(t.useProgram(s),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,Cs,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const u=this._renderer.rect;return t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform4f(s.rect,u.left,u.top,u.right,u.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(t,e){let n;const r=this.canvas,o=this.ctx,s=t.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._size*s;let f=h;xe.isHidden.test(a)||(f+=l),r.width=bl(f),r.height=r.width;const g=f/r.width,m=r.width/2,p=r.height/2;if(o.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")o.fillStyle=c;else{const b=_t.Utils.getRendererType(c._renderer.type);xe[b].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")o.strokeStyle=a;else{const b=_t.Utils.getRendererType(a._renderer.type);xe[b].render.call(a,o,e),o.strokeStyle=a._renderer.effect}l&&(o.lineWidth=fn(e)/g)}typeof d=="number"&&(o.globalAlpha=d),u&&u.length>0&&(o.lineDashOffset=u.offset||0,o.setLineDash(u)),o.save(),o.translate(m,p),o.scale(xe.precision,xe.precision),o.beginPath(),o.arc(0,0,h/g*.5,0,yt),o.restore(),closed&&o.closePath(),xe.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(o.save(),o.translate(-c._renderer.offset.x,-c._renderer.offset.y),o.scale(c._renderer.scale.x,c._renderer.scale.y)),o.fill(),n&&o.restore()),xe.isHidden.test(a)||(n=a._renderer&&a._renderer.offset,n&&(o.save(),o.translate(-a._renderer.offset.x,-a._renderer.offset.y),o.scale(a._renderer.scale.x,a._renderer.scale.y),o.lineWidth=l/a._renderer.scale.x),o.stroke(),n&&o.restore())},render:function(t,e,n){if(!this._visible||!this._opacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const o=n||this.parent,s=e[this._renderer.type],a=this._sizeAttenuation,l=this._stroke,c=this._linewidth,d=o._matrix.manual||o._flagMatrix,u=this._matrix.manual||this._flagMatrix,h=this._renderer.parent!==o,f=this._renderer.vertices,g=this._renderer.collection.length,m=this._flagVertices,p=this._flagFill||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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||o._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(d||u||h){this._renderer.matrix||(this._renderer.matrix=new hn(9)),this._matrix.toTransformArray(!0,Kn),ro(Kn,o._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let b,y;this._scale instanceof re?(b=this._scale.x*o._renderer.scale.x,y=this._scale.y*o._renderer.scale.y):(b=this._scale*o._renderer.scale.x,y=this._scale*o._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,h&&(this._renderer.parent=o)}if(m){const b=this._renderer.positionBuffer;b&&t.deleteBuffer(b),this._renderer.positionBuffer=t.createBuffer(),t.bindBuffer(t.ARRAY_BUFFER,this._renderer.positionBuffer),t.vertexAttribPointer(s.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(s.position),t.bufferData(t.ARRAY_BUFFER,f,t.STATIC_DRAW)}return p?(this._renderer.opacity=this._opacity*o._renderer.opacity,xe.updateTexture.call(xe,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(xe.isHidden.test(l)||(r+=c),r/=xe.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==s&&(t.useProgram(s),e.resolution.flagged||t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture),t.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),t.uniform1f(s.size,r*e.resolution.ratio),t.drawArrays(t.POINTS,0,g),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(t,e){const n=this.canvas,r=this.ctx,o=t.renderer.ratio,s=$c.copy(e._renderer.scale).multiply(o),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,h=e._decoration,f=e._direction;n.width=Math.max(Math.ceil(e._renderer.rect.width*s.x),1),n.height=Math.max(Math.ceil(e._renderer.rect.height*s.y),1);const g=e._renderer.rect.centroid,m=g.x,p=g.y;let b,y,_,C,x,N,$,w,v,k,B;const R=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),R||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=f,c)if(typeof c=="string")r.fillStyle=c;else{const E=_t.Utils.getRendererType(c._renderer.type);xe[E].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const E=_t.Utils.getRendererType(a._renderer.type);xe[E].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=fn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(s.x,s.y),r.translate(m,p),xe.isHidden.test(c)||(c._renderer&&c._renderer.offset?(N=c._renderer.scale.x,$=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(N,$),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,C=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,C),r.restore()):r.fillText(e.value,0,0)),xe.isHidden.test(a)||(a._renderer&&a._renderer.offset?(N=a._renderer.scale.x,$=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(N,$),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,C=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,C),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const E=r.measureText(e.value);switch(h){case"underline":v=E.actualBoundingBoxDescent,B=E.actualBoundingBoxDescent;break;case"strikethrough":v=0,B=0;break}w=-E.width/2,k=E.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,v),r.lineTo(k,B),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=xe.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=_t.Utils.baselines[t._baseline]||t._baseline;const r=n.measureText(t._value);let o=r.width,s=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!xe.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const a=o/2,l=s/2;switch(xe.alignments[t._alignment]||t._alignment){case xe.alignments.left:t.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case xe.alignments.right:t.direction==="ltr"?(e.left=-o,e.right=0):(e.left=0,e.right=o);break;default:e.left=-a,e.right=a}switch(t._baseline){case"bottom":e.top=-s,e.bottom=0;break;case"top":e.top=0,e.bottom=s;break;case"baseline":e.top=-l*1.5,e.bottom=l*.5;break;default:e.top=-l,e.bottom=l}e.width=o,e.height=s,e.centroid||(e.centroid={}),e.centroid.x=a,e.centroid.y=l},render:function(t,e,n){if(!this._visible||!this._opacity)return this;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,o=e[this._renderer.type],s=r._matrix.manual||r._flagMatrix,a=this._matrix.manual||this._flagMatrix,l=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Ue&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Oe&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Ue&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Oe&&(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(s||a||l){this._renderer.matrix||(this._renderer.matrix=new hn(9)),this._matrix.toTransformArray(!0,Kn),ro(Kn,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let u,h;this._scale instanceof re?(u=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=h<0?-h:h,l&&(this._renderer.parent=r)}if(this._mask){t.clear(t.STENCIL_BUFFER_BIT),t.enable(t.STENCIL_TEST),t.stencilFunc(t.ALWAYS,1,0),t.stencilOp(t.KEEP,t.KEEP,t.REPLACE),t.colorMask(!1,!1,!1,!1);const u=_t.Utils.getRendererType(this._mask._renderer.type);xe[u].render.call(this._mask,t,e,this),t.stencilFunc(t.EQUAL,1,255),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,xe.text.getBoundingClientRect(this,this._renderer.rect),xe.updateTexture.call(xe,t,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;e.current!==o&&(t.useProgram(o),t.bindBuffer(t.ARRAY_BUFFER,e.buffers.position),t.vertexAttribPointer(o.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(o.position),t.bufferData(t.ARRAY_BUFFER,Cs,t.STATIC_DRAW),e.resolution.flagged||t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&t.uniform2f(t.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),t.bindTexture(t.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return t.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),t.uniform4f(o.rect,d.left,d.top,d.right,d.bottom),t.drawArrays(t.TRIANGLES,0,6),this._mask&&t.disable(t.STENCIL_TEST),ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,o=this.left._y,s=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width,o=(o-.5)*n.height,s=(s-.5)*n.width,a=(a-.5)*n.height),this._renderer.effect=t.createLinearGradient(r,o,s,a);for(let l=0;l<this.stops.length;l++){const c=this.stops[l];this._renderer.effect.addColorStop(c._offset,c._color)}}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(ie.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,o=this.center._y,s=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(n=e.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,o=(o-.5)*n.height*.5,s=(s-.5)*n.width*.5,a=(a-.5)*n.height*.5,l*=Math.min(n.width,n.height)),this._renderer.effect=t.createRadialGradient(r,o,0,s,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 ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;ie.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=t.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof re||(this._renderer.offset=new re),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 re?(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 re||(this._renderer.scale=new re);let r,o;this._scale instanceof re?(r=this._scale.x,o=this._scale.y):(r=this._scale,o=this._scale),this._renderer.scale.x=r<0?-r:r,this._renderer.scale.y=o<0?-o:o}return ie.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=_t.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(xe,t,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&t.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=t.createTexture()),t.bindTexture(t.TEXTURE_2D,e._renderer.texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,this.canvas),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR)},program:{create:function(t,e){let n,r,o;if(n=t.createProgram(),ie.each(e,function(s){t.attachShader(n,s)}),t.linkProgram(n),r=t.getProgramParameter(n,t.LINK_STATUS),!r)throw o=t.getProgramInfoLog(n),t.deleteProgram(n),new It("unable to link program: "+o);return n}},extensions:{init:function(t){const e={},n=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<n.length;r++){const o=n[r];e[o]=xe.extensions.get(t,o)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new Wr};xe.ctx=xe.canvas.getContext("2d");var Rc=class extends Q{constructor(t){super();let e,n,r,o;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(xe.canvas=t.offscreenElement,xe.ctx=xe.canvas.getContext("2d")),this.scene=new ut,this.scene.parent=this,this._renderer={type:"renderer",matrix:new hn(_p),scale:1,opacity:1},this._flagMatrix=!0,t=ie.defaults(t||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=t.overdraw,e=this.ctx=this.domElement.getContext("webgl",t)||this.domElement.getContext("experimental-webgl",t),!this.ctx)throw new It("unable to create a webgl context. Try using another renderer.");r=Gt.create(e,Gt.path.vertex,Gt.types.vertex),o=Gt.create(e,Gt.path.fragment,Gt.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=xe.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=xe.extensions.init(e),e.renderer=this,n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.rect=e.getUniformLocation(n,"u_rect");const s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(n.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(n.position),e.bufferData(e.ARRAY_BUFFER,Cs,e.STATIC_DRAW),r=Gt.create(e,Gt.points.vertex,Gt.types.vertex),o=Gt.create(e,Gt.points.fragment,Gt.types.fragment),n=this.programs.points=xe.program.create(e,[r,o]),n.position=e.getAttribLocation(n,"a_position"),n.matrix=e.getUniformLocation(n,"u_matrix"),n.size=e.getUniformLocation(n,"u_size"),e.enable(e.BLEND),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),e.blendEquation(e.FUNC_ADD),e.blendFunc(e.ONE,e.ONE_MINUS_SRC_ALPHA)}setSize(t,e,n){let r,o;const s=this.ctx;return this.width=t,this.height=e,this.ratio=typeof n>"u"?es(s):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,ie.isObject(this.domElement.style)&&ie.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=t*this.ratio,o=e*this.ratio,s.viewport(0,0,r,o),this.programs.resolution.width=r,this.programs.resolution.height=o,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(Q.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),xe.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};S(Rc,"Utils",xe);var xp=ie.extend({Error:It,getRatio:es,read:Xe,xhr:vc},ie,Nt,ml,gl),Ce=class Or{constructor(e){S(this,"_events",new Q),S(this,"type",""),S(this,"renderer",null),S(this,"scene",null),S(this,"width",0),S(this,"height",0),S(this,"frameCount",0),S(this,"timeDelta",0),S(this,"playing",!1);const n=ie.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Or.Types.svg,autostart:!1});if(ie.each(n,function(r,o){/fullscreen/i.test(o)||/autostart/i.test(o)||(this[o]=r)},this),ie.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Or.Types[r])}this.renderer=new Or[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=kp.bind(this),this.fit.domElement=window,this.fit.attached=!0,ie.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),ie.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Ht.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=vp.bind(this),ie.extend(this.renderer.domElement.style,{display:"block"})):typeof n.width=="number"&&typeof n.height=="number"&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(Q.Types.resize,Cp.bind(this)),this.scene=this.renderer.scene,Or.Instances.push(this),n.autostart&&mr.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,mr.init(),this.trigger(Q.Types.play)}pause(){return this.playing=!1,this.trigger(Q.Types.pause)}setPlaying(e){this.playing=e}release(e){let n,r,o;if(typeof e>"u")return this.release(this.scene);if(typeof e.unbind=="function"&&e.unbind(),typeof e.fill=="object"&&"unbind"in e.fill&&e.fill.unbind(),typeof e.stroke=="object"&&"unbind"in e.stroke&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind=="function")try{e.vertices.unbind()}catch{}for(n=0;n<e.vertices.length;n++)r=e.vertices[n],typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}if(e.children){for(n=0;n<e.children.length;n++)o=e.children[n],this.release(o);if(typeof e.children.unbind=="function")try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const s=this.renderer.ctx;e._renderer.texture&&(s.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(s.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type==="CanvasRenderer"&&e._renderer.context&&delete e._renderer.context}return e}update(){const e=!!this._lastFrame,n=ie.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Ht.bind(this.fit.domElement,"resize",this.fit),this.fit.attached=!0,this.fit());const r=this.width,o=this.height,s=this.renderer;return(r!==s.width||o!==s.height)&&s.setSize(r,o,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,n,r,o){const s=new Jr(e,n,r,o);return this.scene.add(s),s}makeArrow(e,n,r,o,s){const a=typeof s=="number"?s:10,l=Math.atan2(o-n,r-e),c=[new Be(e,n,void 0,void 0,void 0,void 0,oe.move),new Be(r,o,void 0,void 0,void 0,void 0,oe.line),new Be(r-a*Math.cos(l-Math.PI/4),o-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,oe.line),new Be(r,o,void 0,void 0,void 0,void 0,oe.move),new Be(r-a*Math.cos(l+Math.PI/4),o-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,oe.line)],d=new $e(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,n,r,o){const s=new Un(e,n,r,o);return this.scene.add(s),s}makeRoundedRectangle(e,n,r,o,s){const a=new Gr(e,n,r,o,s);return this.scene.add(a),a}makeCircle(e,n,r,o){const s=new Ur(e,n,r,o);return this.scene.add(s),s}makeEllipse(e,n,r,o,s){const a=new Kr(e,n,r,o,s);return this.scene.add(a),a}makeStar(e,n,r,o,s){const a=new gs(e,n,r,o,s);return this.scene.add(a),a}makeCurve(e){const n=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<n;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new Be(l,c))}}const r=arguments[n-1],o=new $e(e,!(typeof r=="boolean"&&r),!0),s=o.getBoundingClientRect();return o.center().translation.set(s.left+s.width/2,s.top+s.height/2),this.scene.add(o),o}makePolygon(e,n,r,o){const s=new ms(e,n,r,o);return this.scene.add(s),s}makeArcSegment(e,n,r,o,s,a,l){const c=new ls(e,n,r,o,s,a,l);return this.scene.add(c),c}makePoints(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let s=0;s<n;s+=2){const a=arguments[s];if(typeof a!="number")break;const l=arguments[s+1];r.push(new re(a,l))}}const o=new fs(r);return this.scene.add(o),o}makePath(e){const n=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<n;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new Be(c,d))}}const o=arguments[n-1],s=new $e(r,!(typeof o=="boolean"&&o)),a=s.getBoundingClientRect();return typeof a.top=="number"&&typeof a.left=="number"&&typeof a.right=="number"&&typeof a.bottom=="number"&&s.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(s),s}makeText(e,n,r,o){const s=new mn(e,n,r,o);return this.add(s),s}makeLinearGradient(e,n,r,o){const s=Array.prototype.slice.call(arguments,4),a=new Ue(e,n,r,o,s);return this.add(a),a}makeRadialGradient(e,n,r){const o=Array.prototype.slice.call(arguments,3),s=new Ke(e,n,r,o);return this.add(s),s}makeSprite(e,n,r,o,s,a,l){const c=new Yr(e,n,r,o,s,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,o,s,a){const l=new Cc(e,n,r,o,s,a);return this.add(l),l}makeImageSequence(e,n,r,o,s){const a=new _s(e,n,r,o);return s&&a.play(),this.add(a),a}makeTexture(e,n){return new Oe(e,n)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const n=new ut;return this.scene.add(n),n.add(e),n}interpret(e,n,r){const o=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(o in Xe))return null;const s=Xe[o].call(this,e);return r?this.add(n&&s instanceof ut?s.children:s):s.parent&&s.remove(),s}load(e,n){const r=new ut;let o,s,a;const l=(function(c){for(Ht.temp.innerHTML=c,s=0;s<Ht.temp.children.length;s++)o=Ht.temp.children[s],a=this.interpret(o,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Ht.temp.children.length<=1?Ht.temp.children[0]:Ht.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(vc(e,l),r):(l(e),r)}};S(Ce,"NextFrameId",$t.NextFrameId),S(Ce,"Types",$t.Types),S(Ce,"Version",$t.Version),S(Ce,"PublishDate",$t.PublishDate),S(Ce,"Identifier",$t.Identifier),S(Ce,"Resolution",$t.Resolution),S(Ce,"AutoCalculateImportedMatrices",$t.AutoCalculateImportedMatrices),S(Ce,"Instances",$t.Instances),S(Ce,"uniqueId",$t.uniqueId),S(Ce,"Anchor",Be),S(Ce,"Collection",qn),S(Ce,"Events",Q),S(Ce,"Group",ut),S(Ce,"Matrix",Li),S(Ce,"Path",$e),S(Ce,"Registry",Wr),S(Ce,"Element",Di),S(Ce,"Shape",Yn),S(Ce,"Text",mn),S(Ce,"Vector",re),S(Ce,"Gradient",at),S(Ce,"Image",Cc),S(Ce,"ImageSequence",_s),S(Ce,"LinearGradient",Ue),S(Ce,"RadialGradient",Ke),S(Ce,"Sprite",Yr),S(Ce,"Stop",Xn),S(Ce,"Texture",Oe),S(Ce,"ArcSegment",ls),S(Ce,"Circle",Ur),S(Ce,"Ellipse",Kr),S(Ce,"Line",Jr),S(Ce,"Points",fs),S(Ce,"Polygon",ms),S(Ce,"Rectangle",Un),S(Ce,"RoundedRectangle",Gr),S(Ce,"Star",gs),S(Ce,"CanvasRenderer",_t),S(Ce,"SVGRenderer",Nc),S(Ce,"WebGLRenderer",Rc),S(Ce,"Commands",oe),S(Ce,"Utils",xp);var pn=Ce;function kp(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function vp(){const t=this.renderer.domElement.parentElement;if(!t){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=t.getBoundingClientRect(),n=this.width=e.width,r=this.height=e.height;this.renderer.setSize(n,r,this.ratio)}function Cp(t,e){this.width=t,this.height=e,this.trigger(Q.Types.resize,t,e)}var mr=Ht.getRequestAnimationFrame();function Ec(){for(let t=0;t<pn.Instances.length;t++){const e=pn.Instances[t];e.playing&&e.update()}pn.NextFrameId=mr(Ec)}mr.init=function(){Ec(),mr.init=function(){}};let yn;typeof window<"u"?yn=window:typeof global<"u"?yn=global:typeof self<"u"&&(yn=self);let Pc;const di=Math.PI*2,ht=Math.PI*.5;function Sp(t,e,n,r,o,s){let a;return arguments.length<=1?(a=t.a,e=t.b,n=t.c,r=t.d,o=t.e,s=t.f):a=t,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Bp(t){Pc=t}function Tp(t,e){e=e&&e.identity()||new Pc;let n=t;const r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let o=0;o<r.length;o++){const a=r[o].elements;e.multiply(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7],a[8])}return e}function Zt(t,e,n){return n*(e-t)+t}function ji(t,e){for(;t<0;)t+=e;return t%e}const Fc=yn.Float32Array||Array,Np=Math.floor;function bn(t){return Np(t*1e6)/1e6}const pe={move:"M",line:"L",curve:"C",close:"Z"};class ne{constructor(){T(this,"_events",{});T(this,"_bound",!1)}addEventListener(e,n){return(this._events[e]||(this._events[e]=[])).push(n),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,n){if(!this._events)return this;if(!e&&!n)return this._events={},this._bound=!1,this;const r=e?[e]:Object.keys(this._events);for(let o=0,s=r.length;o<s;o++){e=r[o];let a=this._events[e];if(a){let l=[];if(n)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,n!==u&&l.push(u)}this._events[e]=l}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;const n=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...n);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,n,r){const o=this;e&&(s.obj=e,s.name=n,s.handler=r,e.on(n,s));function s(){r.apply(o,arguments)}return o}ignore(e,n,r){return e.off(n,r),this}}T(ne,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),T(ne,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Vc={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ne.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ne.Types.change))}}},mt=class mt extends ne{constructor(n=0,r=0){super();T(this,"_x",0);T(this,"_y",0);for(let o in Vc)Object.defineProperty(this,o,Vc[o]);this.x=n,this.y=r}static add(n,r){return new mt(n.x+r.x,n.y+r.y)}static sub(n,r){return new mt(n.x-r.x,n.y-r.y)}static subtract(n,r){return mt.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 o=n.x-r.x,s=n.y-r.y;return Math.atan2(s,o)}static distanceBetween(n,r){return Math.sqrt(mt.distanceBetweenSquared(n,r))}static distanceBetweenSquared(n,r){const o=n.x-r.x,s=n.y-r.y;return o*o+s*s}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 mt(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,o=this.y-n.y;return r*r+o*o}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 o=(n.x-this.x)*r+this.x,s=(n.y-this.y)*r+this.y;return this.set(o,s)}isZero(n){return n=typeof n>"u"?1e-4:n,this.length()<n}toString(){return this.x+", "+this.y}toObject(){return{x:bn(this.x),y:bn(this.y)}}rotate(n){const r=this.x,o=this.y,s=Math.cos(n),a=Math.sin(n);return this.x=r*s-o*a,this.y=r*a+o*s,this}};T(mt,"zero",new mt),T(mt,"left",new mt(-1,0)),T(mt,"right",new mt(1,0)),T(mt,"up",new mt(0,-1)),T(mt,"down",new mt(0,1));let be=mt;class Fe extends be{constructor(n=0,r=0,o=0,s=0,a=0,l=0,c=pe.move){super(n,r);T(this,"controls",{left:new be,right:new be});T(this,"_command",pe.move);T(this,"_relative",!0);T(this,"_rx",0);T(this,"_ry",0);T(this,"_xAxisRotation",0);T(this,"_largeArcFlag",0);T(this,"_sweepFlag",1);for(let u in Mc)Object.defineProperty(this,u,Mc[u]);this.command=c,this.relative=!0;const d=Fe.makeBroadcast(this);this.controls.left.set(o,s).addEventListener(ne.Types.change,d),this.controls.right.set(a,l).addEventListener(ne.Types.change,d)}static makeBroadcast(n){return r;function r(){n._bound&&n.dispatchEvent(ne.Types.change)}}static fromObject(n){return new Fe().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 Fe().copy(this)}toObject(){return{x:bn(this.x),y:bn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:bn(this.rx),ry:bn(this.ry),xAxisRotation:bn(this.xAxisRotation),largeArcFlag:bn(this.largeArcFlag),sweepFlag:bn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const Mc={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ne.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ne.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ne.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ne.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ne.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ne.Types.change))}}};let $p=0;const Ss={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return $p++}},oo={RecursionLimit:16,abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function so(t,e,n,r,o){const s=1-t;return s*s*s*e+3*s*s*t*n+3*s*t*t*r+t*t*t*o}function Ac(t,e,n,r,o,s,a,l,c){c=c||oo.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Fe(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,g=so(f,t,n,o,a),m=so(f,e,r,s,l);u.push(new Fe(g,m))}return u}function Rp(t,e,n,r,o,s,a,l,c){if(t===n&&e===r&&o===a&&s===l){const b=a-t,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(n-o)+3*(a-t),u=6*(t+o)-12*n,h=3*(n-t),f=9*(r-s)+3*(l-e),g=6*(e+s)-12*r,m=3*(r-e);function p(b){const y=(d*b+u)*b+h,_=(f*b+g)*b+m;return Math.sqrt(y*y+_*_)}return Pp(p,0,1,c||oo.RecursionLimit)}function Ep(t,e,n,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,g,m,p,b,y;for(let N=0;N<2;++N){if(N===0?(h=6*t-12*n+6*o,u=-3*t+9*n-9*o+3*a,f=3*n-3*t):(h=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,f=3*r-3*e),Math.abs(u)<.001){if(Math.abs(h)<.001)continue;g=-f/h,0<g&&g<1&&c.push(g);continue}b=h*h-4*f*u,y=Math.sqrt(b),!(b<0)&&(m=(-h+y)/(2*u),0<m&&m<1&&c.push(m),p=(-h-y)/(2*u),0<p&&p<1&&c.push(p))}let _=c.length,C=_,x;for(;_--;)g=c[_],x=1-g,d[0][_]=x*x*x*t+3*x*x*g*n+3*x*g*g*o+g*g*g*a,d[1][_]=x*x*x*e+3*x*x*g*r+3*x*g*g*s+g*g*g*l;return d[0][C]=t,d[1][C]=e,d[0][C+1]=a,d[1][C+1]=l,d[0].length=d[1].length=C+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 Pp(t,e,n,r){let o=oo.abscissas[r-2],s=oo.weights[r-2],a=.5*(n-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*t(l):0;for(;c<d;){const h=a*o[c];u+=s[c++]*(t(l+h)+t(l-h))}return a*u}function Fp(t,e){const n=t.length,r=n-1;for(let o=0;o<n;o++){const s=t[o],a=e?ji(o-1,n):Math.max(o-1,0),l=e?ji(o+1,n):Math.min(o+1,r),c=t[a],d=s,u=t[l];Vp(c,d,u),d.command=o===0?pe.move:pe.curve}}function Vp(t,e,n){const r=be.angleBetween(t,e),o=be.angleBetween(n,e);let s=be.distanceBetween(t,e),a=be.distanceBetween(n,e),l=(r+o)/2;return s<.001||a<.001?(typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.copy(e),e.controls.right.copy(e)),e):(s*=.33,a*=.33,o<r?l+=ht:l-=ht,e.controls.left.x=Math.cos(l)*s,e.controls.left.y=Math.sin(l)*s,l-=Math.PI,e.controls.right.x=Math.cos(l)*a,e.controls.right.y=Math.sin(l)*a,typeof e.relative=="boolean"&&!e.relative&&(e.controls.left.x+=e.x,e.controls.left.y+=e.y,e.controls.right.x+=e.x,e.controls.right.y+=e.y),e)}let gr=(Bi=class extends ne{constructor(){super();T(this,"_flagId",!1);T(this,"_flagClassName",!1);T(this,"_renderer",{});T(this,"_id",Ss.Identifier+Ss.uniqueId());T(this,"_className","");T(this,"classList",[]);for(let n in Ic)Object.defineProperty(this,n,Ic[n])}static fromObject(n){const r=new Bi().copy(n);return"id"in n&&(r.id=n.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(n){return n.renderer&&typeof n.renderer.type=="string"&&(this.renderer.type=n.renderer.type),typeof n.className=="string"&&(this.className=n.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){const n=this._renderer.type;return this._renderer={type:n},typeof this.unbind=="function"&&this.unbind(),this}},T(Bi,"Properties",["renderer","id","className"]),Bi);const Ic={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(t){const e=this._id;t!==this._id&&(this._id=t,this._flagId=!0,this.parent&&(delete this.parent.children.ids[e],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(t){this._className!==t&&(this._flagClassName=!0,this.classList=t.split(/\s+?/),this._className=t)}}};class ao extends Error{constructor(n){super();T(this,"name","Two.js");T(this,"message");this.message=n}}class Mp{constructor(){T(this,"map",{})}add(e,n){return this.map[e]=n,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let lo;const Oc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};yn.document&&(lo=document.createElement("a"));const Ze=class Ze extends gr{constructor(n,r){super();T(this,"_flagSrc",!1);T(this,"_flagImage",!1);T(this,"_flagVideo",!1);T(this,"_flagLoaded",!1);T(this,"_flagRepeat",!1);T(this,"_flagOffset",!1);T(this,"_flagScale",!1);T(this,"_src","");T(this,"_image",null);T(this,"_loaded",!1);T(this,"_repeat","no-repeat");T(this,"_scale",1);T(this,"_offset",null);for(let o in zc)Object.defineProperty(this,o,zc[o]);if(this._renderer.type="texture",this._renderer.flagOffset=Ap.bind(this),this._renderer.flagScale=Ip.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new be,typeof r=="function"){const o=(function(){this.unbind(ne.Types.load,o),typeof r=="function"&&r()}).bind(this);this.bind(ne.Types.load,o)}if(typeof n=="string")this.src=n;else if(typeof n=="object"){const o=Object.prototype.toString.call(n);(o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]"||o==="[object HTMLVideoElement]"||o==="[object Image]")&&(this.image=n)}this._update()}fromObject(n){const r=new Ze().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return lo?(lo.href=n,lo.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=Ze.getAbsoluteURL(n);if(Ze.ImageRegistry.contains(r))return Ze.ImageRegistry.get(r);let o;return yn.document?Oc.video.test(r)?o=document.createElement("video"):o=document.createElement("img"):console.warn("Two.js: no prototypical image defined for Two.Texture"),o.crossOrigin="anonymous",o.referrerPolicy="no-referrer",o}static load(n,r){let o=n.image,s=Ze.getTag(o);n._flagImage&&(/canvas/i.test(s)?Ze.Register.canvas(n,r):(n._src=o.getAttribute("two-src")||o.src,Ze.Register[s](n,r))),n._flagSrc&&(o||(o=Ze.getImage(n.src),n.image=o),s=Ze.getTag(o),Ze.Register[s](n,r))}clone(){const n=new Ze(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 be?n.offset:new be().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof be?n.scale:new be().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(ne.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Ze.load(this,(function(){this.loaded=!0,this.trigger(ne.Types.change).trigger(ne.Types.load)}).bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),"elem"in this._renderer){const n=this._renderer.elem;n.parentNode.removeChild(n)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};T(Ze,"Properties",["src","loaded","repeat","scale","offset","image"]),T(Ze,"RegularExpressions",Oc),T(Ze,"ImageRegistry",new Mp),T(Ze,"Register",{canvas:function(n,r){n._src="#"+n.id,Ze.ImageRegistry.add(n.src,n.image),typeof r=="function"&&r()},img:function(n,r){const o=n.image,s=function(l){o.removeEventListener&&typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",a,!1)),typeof r=="function"&&r()},a=function(l){throw typeof o.removeEventListener=="function"&&(o.removeEventListener("load",s,!1),o.removeEventListener("error",a,!1)),new ao("unable to load "+n.src)};typeof o.width=="number"&&o.width>0&&typeof o.height=="number"&&o.height>0?s():typeof o.addEventListener=="function"&&(o.addEventListener("load",s,!1),o.addEventListener("error",a,!1)),n._src=Ze.getAbsoluteURL(n._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",n.src),Ze.ImageRegistry.add(n.src,o),n.image.src=n.src)},video:function(n,r){const o=function(a){n.image.removeEventListener("canplaythrough",o,!1),n.image.removeEventListener("error",s,!1),n.image.width=n.image.videoWidth,n.image.height=n.image.videoHeight,typeof r=="function"&&r()},s=function(a){throw n.image.removeEventListener("canplaythrough",o,!1),n.image.removeEventListener("error",s,!1),new ao("unable to load "+n.src)};n._src=Ze.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Ze.ImageRegistry.add(n.src,n.image)),n.image.readyState>=4?o():(n.image.addEventListener("canplaythrough",o,!1),n.image.addEventListener("error",s,!1),n.image.src=n.src,n.image.load())}});let Ge=Ze;const zc={src:{enumerable:!0,get:function(){return this._src},set:function(t){this._src=t,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(t){this._loaded=t,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(t){this._repeat=t,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(t){const e=Ge.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ge.ImageRegistry.contains(n)?this._image=Ge.ImageRegistry.get(t.src):this._image=t,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset&&this._offset.unbind(ne.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ne.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof be&&this._scale.unbind(ne.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof be&&this._scale.bind(ne.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Ap(){this._flagOffset=!0}function Ip(){this._flagScale=!0}class ui extends Array{constructor(){super();Xa(this,gt,new ne);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 Mt(this,gt)}set _events(n){of(this,gt,n)}get _bound(){return Mt(this,gt)._bound}set _bound(n){Mt(this,gt)._bound=n}addEventListener(){return Mt(this,gt).addEventListener.apply(this,arguments)}on(){return Mt(this,gt).on.apply(this,arguments)}bind(){return Mt(this,gt).bind.apply(this,arguments)}removeEventListener(){return Mt(this,gt).removeEventListener.apply(this,arguments)}off(){return Mt(this,gt).off.apply(this,arguments)}unbind(){return Mt(this,gt).unbind.apply(this,arguments)}dispatchEvent(){return Mt(this,gt).dispatchEvent.apply(this,arguments)}trigger(){return Mt(this,gt).trigger.apply(this,arguments)}listen(){return Mt(this,gt).listen.apply(this,arguments)}ignore(){return Mt(this,gt).ignore.apply(this,arguments)}pop(){const n=super.pop.apply(this,arguments);return this.trigger(ne.Types.remove,[n]),n}shift(){const n=super.shift.apply(this,arguments);return this.trigger(ne.Types.remove,[n]),n}push(){const n=super.push.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),n}unshift(){const n=super.unshift.apply(this,arguments);return this.trigger(ne.Types.insert,arguments),n}splice(){const n=super.splice.apply(this,arguments);if(this.trigger(ne.Types.remove,n),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ne.Types.insert,r),this.trigger(ne.Types.order)}return n}sort(){return super.sort.apply(this,arguments),this.trigger(ne.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ne.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(n,r){const o=[];for(let s=0;s<this.length;s++){const a=this[s];let l;r?l=n.call(r,a,s):l=n(a,s),o.push(l)}return o}}gt=new WeakMap;const Dc=Array.prototype.slice;function Op(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const Me={isNaN:function(t){return typeof t=="number"&&t!==+t},isElement:function(t){return!!(t&&t.nodeType===1)},isObject:function(t){const e=typeof t;return e==="function"||e==="object"&&!!t},isFunction:function(t){return typeof t=="function"},extend:function(t){const e=Dc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let o in r)t[o]=r[o]}return t},defaults:function(t){const e=Dc.call(arguments,1);for(let n=0;n<e.length;n++){const r=e[n];for(let o in r)t[o]===void 0&&(t[o]=r[o])}return t},each:function(t,e,n){const r=n||this,o=!Op(t)&&Object.keys(t),s=(o||t).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,t[l],l,t)}return t},performance:yn.performance&&yn.performance.now?yn.performance:Date},zt=class zt extends gr{constructor(n,r,o){super();T(this,"_flagOffset",!0);T(this,"_flagOpacity",!0);T(this,"_flagColor",!0);T(this,"_offset",0);T(this,"_opacity",1);T(this,"_color","#fff");for(let s in Lc)Object.defineProperty(this,s,Lc[s]);this._renderer.type="stop",this.offset=typeof n=="number"?n:zt.Index<=0?0:1,this.opacity=typeof o=="number"?o:1,this.color=typeof r=="string"?r:zt.Index<=0?"#fff":"#000",zt.Index=(zt.Index+1)%2}static fromObject(n){const r=new zt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<zt.Properties.length;r++){const o=zt.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new zt;return Me.each(zt.Properties,function(o){r[o]=this[o]},this),n&&n.stops&&n.stops.push(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="stop",Me.each(zt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};T(zt,"Index",0),T(zt,"Properties",["offset","opacity","color"]);let hi=zt;const Lc={offset:{enumerable:!0,get:function(){return this._offset},set:function(t){this._offset=t,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(t){this._color=t,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},vn=class vn extends gr{constructor(n){super();T(this,"_flagStops",!1);T(this,"_flagSpread",!1);T(this,"_flagUnits",!1);T(this,"_spread","");T(this,"_units","");for(let r in Hc)Object.defineProperty(this,r,Hc[r]);this._renderer.type="gradient",this._renderer.flagStops=zp.bind(this),this._renderer.bindStops=Dp.bind(this),this._renderer.unbindStops=Lp.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(s=>s instanceof hi?s:new hi().copy(s)));const o=new vn(r).copy(n);return"id"in n&&(o.id=n.id),o}clone(n){const r=this.stops.map(s=>s.clone()),o=new vn(r);return Me.each(vn.Properties,s=>{o[s]=this[s]},this),n&&n.add(o),o}copy(n){super.copy.call(this,n);for(let r=0;r<vn.Properties.length;r++){const o=vn.Properties[r];o in n&&(this[o]=n[o])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return Me.each(vn.Properties,r=>{n[r]=this[r]},this),n}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ne.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}};T(vn,"Stop",hi),T(vn,"Properties",["spread","stops","units"]);let lt=vn;const Hc={spread:{enumerable:!0,get:function(){return this._spread},set:function(t){this._spread=t,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(t){this._units=t,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(t){const e=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(ne.Types.insert,e).unbind(ne.Types.remove,n),this._stops=new ui((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._stops)}}};function zp(){this._flagStops=!0}function Dp(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Lp(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const ti=class ti extends lt{constructor(n,r,o,s,a){super(a);T(this,"_flagEndPoints",!1);T(this,"_left",null);T(this,"_right",null);for(let l in Wc)Object.defineProperty(this,l,Wc[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Hp.bind(this),this.left=new be,this.right=new be,typeof n=="number"&&(this.left.x=n),typeof r=="number"&&(this.left.y=r),typeof o=="number"&&(this.right.x=o),typeof s=="number"&&(this.right.y=s)}static fromObject(n){const r=new ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<ti.Properties.length;r++){const o=ti.Properties[r];o in n&&(this[o]=n[o]instanceof be?n[o]:new be().copy(n[o]))}return this}clone(n){const r=this.stops.map(function(s){return s.clone()}),o=new ti(this.left._x,this.left._y,this.right._x,this.right._y,r);return Me.each(lt.Properties,function(s){o[s]=this[s]},this),n&&n.add(o),o}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(ne.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};T(ti,"Stop",hi),T(ti,"Properties",["left","right"]);let Rt=ti;const Wc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof be&&this._left.unbind(ne.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ne.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(t){this._right instanceof be&&this._right.unbind(ne.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ne.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Hp(){this._flagEndPoints=!0}const Cn=class Cn extends lt{constructor(n,r,o,s,a,l){super(s);T(this,"_flagRadius",!1);T(this,"_flagCenter",!1);T(this,"_flagFocal",!1);T(this,"_radius",0);T(this,"_center",null);T(this,"_focal",null);for(let c in jc)Object.defineProperty(this,c,jc[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Wp.bind(this),this._renderer.flagFocal=jp.bind(this),this.center=new be,this.radius=typeof o=="number"?o:1,this.focal=new be,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 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 o=Cn.Properties[r];o in n&&(/(center|focal)i/.test(o)?this[o]=n[o]instanceof be?n[o]:new be().copy(n[o]):typeof n[o]=="number"&&(this[o]=n[MediaKeySystemAccess]))}return this}clone(n){const r=this.stops.map(function(s){return s.clone()}),o=new Cn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return Me.each(lt.Properties.concat(Cn.Properties),function(s){o[s]=this[s]},this),n&&n.add(o),o}toObject(){const n=super.toObject.call(this);return Me.each(Cn.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(ne.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};T(Cn,"Stop",hi),T(Cn,"Properties",["center","radius","focal"]);let Et=Cn;const jc={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(t){this._center&&this._center.unbind(ne.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ne.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ne.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ne.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function Wp(){this._flagCenter=!0}function jp(){this._flagFocal=!0}function qc(t,e){if(e===0||e===1)return!0;const r=t._length*e;let o=0;for(let s=0;s<t._lengths.length;s++){const a=t._lengths[s];if(o>=r)return r-o>=0;o+=a}return!1}function co(t,e){const n=t._length;if(e<=0)return 0;if(e>=n)return t._lengths.length-1;for(let r=0,o=0;r<t._lengths.length;r++){if(o+t._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/t._lengths[r];o+=t._lengths[r]}return-1}function Xc(t,e,n){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Rp(r,l,o,c,s,d,a,u,n)}function Yc(t,e,n){let r,o,s,a,l,c,d,u;const h=e.controls&&e.controls.right,f=t.controls&&t.controls.left;return r=e.x,l=e.y,o=(h||e).x,c=(h||e).y,s=(f||t).x,d=(f||t).y,a=t.x,u=t.y,h&&e._relative&&(o+=e.x,c+=e.y),f&&t._relative&&(s+=t.x,d+=t.y),Ac(r,l,o,c,s,d,a,u,n)}function fi(t){switch(t.renderer.type){case"texture":return Ge.fromObject(t);case"gradient":return lt.fromObject(t);case"linear-gradient":return Rt.fromObject(t);case"radial-gradient":return Et.fromObject(t)}return t}const qp=Math.cos,Xp=Math.sin,Uc=Math.tan,Bs=[],Ft=class Ft extends ne{constructor(n,r,o,s,a,l){super();T(this,"elements",new Fc(9));T(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,o){if(r.length<=3){const w=n;let v,k,B;const R=r[0]||0,E=r[1]||0,P=r[2]||0;return v=w[0]*R+w[1]*E+w[2]*P,k=w[3]*R+w[4]*E+w[5]*P,B=w[6]*R+w[7]*E+w[8]*P,[v,k,B]}const s=n[0],a=n[1],l=n[2],c=n[3],d=n[4],u=n[5],h=n[6],f=n[7],g=n[8],m=r[0],p=r[1],b=r[2],y=r[3],_=r[4],C=r[5],x=r[6],N=r[7],$=r[8];return o=o||new Fc(9),o[0]=s*m+a*y+l*x,o[1]=s*p+a*_+l*N,o[2]=s*b+a*C+l*$,o[3]=c*m+d*y+u*x,o[4]=c*p+d*_+u*N,o[5]=c*b+d*C+u*$,o[6]=h*m+f*y+g*x,o[7]=h*p+f*_+g*N,o[8]=h*b+f*C+g*$,o}static fromObject(n){return new Ft().copy(n)}set(n,r,o,s,a,l,c,d,u){if(typeof r>"u"){const h=n;n=h[0],r=h[1],o=h[2],s=h[3],a=h[4],l=h[5],c=h[6],d=h[7],u=h[8]}return this.elements[0]=n,this.elements[1]=r,this.elements[2]=o,this.elements[3]=s,this.elements[4]=a,this.elements[5]=l,this.elements[6]=c,this.elements[7]=d,this.elements[8]=u,this.trigger(ne.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(ne.Types.change)}identity(){return this.elements[0]=Ft.Identity[0],this.elements[1]=Ft.Identity[1],this.elements[2]=Ft.Identity[2],this.elements[3]=Ft.Identity[3],this.elements[4]=Ft.Identity[4],this.elements[5]=Ft.Identity[5],this.elements[6]=Ft.Identity[6],this.elements[7]=Ft.Identity[7],this.elements[8]=Ft.Identity[8],this.trigger(ne.Types.change)}multiply(n,r,o,s,a,l,c,d,u){if(typeof r>"u")return this.elements[0]*=n,this.elements[1]*=n,this.elements[2]*=n,this.elements[3]*=n,this.elements[4]*=n,this.elements[5]*=n,this.elements[6]*=n,this.elements[7]*=n,this.elements[8]*=n,this.trigger(ne.Types.change);if(typeof o>"u"&&(o=1),typeof s>"u"){n=n||0,r=r||0,o=o||0,a=this.elements;const I=a[0]*n+a[1]*r+a[2]*o,Z=a[3]*n+a[4]*r+a[5]*o,te=a[6]*n+a[7]*r+a[8]*o;return[I,Z,te]}const h=this.elements,f=[n,r,o,s,a,l,c,d,u],g=h[0],m=h[1],p=h[2],b=h[3],y=h[4],_=h[5],C=h[6],x=h[7],N=h[8],$=f[0],w=f[1],v=f[2],k=f[3],B=f[4],R=f[5],E=f[6],P=f[7],W=f[8];return this.elements[0]=g*$+m*k+p*E,this.elements[1]=g*w+m*B+p*P,this.elements[2]=g*v+m*R+p*W,this.elements[3]=b*$+y*k+_*E,this.elements[4]=b*w+y*B+_*P,this.elements[5]=b*v+y*R+_*W,this.elements[6]=C*$+x*k+N*E,this.elements[7]=C*w+x*B+N*P,this.elements[8]=C*v+x*R+N*W,this.trigger(ne.Types.change)}inverse(n){const r=this.elements;n=n||new Ft;const o=r[0],s=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],h=r[7],f=r[8],g=f*c-d*h,m=-f*l+d*u,p=h*l-c*u;let b=o*g+s*m+a*p;return b?(b=1/b,n.elements[0]=g*b,n.elements[1]=(-f*s+a*h)*b,n.elements[2]=(d*s-a*c)*b,n.elements[3]=m*b,n.elements[4]=(f*o-a*u)*b,n.elements[5]=(-d*o+a*l)*b,n.elements[6]=p*b,n.elements[7]=(-h*o+s*u)*b,n.elements[8]=(c*o-s*l)*b,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=qp(n),o=Xp(n);return this.multiply(r,-o,0,o,r,0,0,0,1)}translate(n,r){return this.multiply(1,0,n,0,1,r,0,0,1)}skewX(n){const r=Uc(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=Uc(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Bs.length=0,this.toTransformArray(n,Bs),Bs.map(bn).join(" ")}toTransformArray(n,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],h=o[5];if(n){const f=o[6],g=o[7],m=o[8];if(s){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=u,r[5]=g,r[6]=c,r[7]=h,r[8]=m;return}return[a,d,f,l,u,g,c,h,m]}if(s){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=h;return}return[a,d,l,u,c,h]}toArray(n,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],h=o[5];if(n){const f=o[6],g=o[7],m=o[8];if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h,r[6]=f,r[7]=g,r[8]=m;return}return[a,l,c,d,u,h,f,g,m]}if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=h;return}return[a,l,c,d,u,h]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ft().copy(this)}};T(Ft,"Identity",[1,0,0,0,1,0,0,0,1]);let pr=Ft;Bp(pr);const Vr=class Vr extends gr{constructor(){super();T(this,"_flagMatrix",!0);T(this,"_flagScale",!1);T(this,"_matrix",null);T(this,"_worldMatrix",null);T(this,"_position",null);T(this,"_rotation",0);T(this,"_scale",1);T(this,"_skewX",0);T(this,"_skewY",0);for(let n in uo)Object.defineProperty(this,n,uo[n]);this._renderer.flagMatrix=Kc.bind(this),this.isShape=!0,this.matrix=new pr,this.worldMatrix=new pr,this.position=new be,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 uo.position.get.apply(this,arguments)}set translation(n){uo.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 be?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 be?n.scale:new be(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 be?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 be?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}};T(Vr,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Rn=Vr;const uo={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ne.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ne.Types.change,this._renderer.flagMatrix),Kc.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(t){this._rotation=t,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(t){this._scale instanceof be&&this._scale.unbind(ne.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof be&&this._scale.bind(ne.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(t){this._skewX=t,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(t){this._skewY=t,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(t){this._matrix=t,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Tp(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function Kc(){this._flagMatrix=!0}const qi=Math.min,Xi=Math.max,Yp=Math.ceil,Up=Math.floor,Kp=new be,sn=class sn extends Rn{constructor(n,r,o,s){super();T(this,"_flagVertices",!0);T(this,"_flagLength",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagCap",!0);T(this,"_flagJoin",!0);T(this,"_flagMiter",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_flagMask",!1);T(this,"_flagClip",!1);T(this,"_length",0);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_cap","round");T(this,"_join","round");T(this,"_miter",4);T(this,"_closed",!0);T(this,"_curved",!1);T(this,"_automatic",!0);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_mask",null);T(this,"_clip",!1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);for(let a in Gc)Object.defineProperty(this,a,Gc[a]);this._renderer.type="path",this._renderer.flagVertices=Zc.bind(this),this._renderer.bindVertices=Qc.bind(this),this._renderer.unbindVertices=Jc.bind(this),this._renderer.flagFill=ed.bind(this),this._renderer.flagStroke=td.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!r,this.curved=!!o,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=!s,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),o=typeof n.stroke=="string"?n.stroke:fi(n.stroke),s=new sn().copy({...n,fill:r,stroke:o});return"id"in n&&(s.id=n.id),s}copy(n){if(super.copy.call(this,n),n.vertices){this.vertices=[];for(let r=0;r<n.vertices.length;r++){const o=n.vertices[r];o instanceof Fe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Fe().copy(o))}}for(let r=0;r<sn.Properties.length;r++){const o=sn.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new sn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<sn.Properties.length;o++){const s=sn.Properties[o];r[s]=this[s]}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(sn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind(),r.controls&&(r.controls.left&&typeof r.controls.left.unbind=="function"&&r.controls.left.unbind(),r.controls.right&&typeof r.controls.right.unbind=="function"&&r.controls.right.unbind())}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}corner(){const n=this.getBoundingClientRect(!0),r=n.width/2,o=n.height/2,s=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-=s,c.y-=a,c.x+=r,c.y+=o}return this.mask&&(this.mask.translation.x-=s,this.mask.translation.x+=r,this.mask.translation.y-=a,this.mask.translation.y+=o),this}center(){const n=this.getBoundingClientRect(!0),r=n.left+n.width/2-this.translation.x,o=n.top+n.height/2-this.translation.y;for(let s=0;s<this.vertices.length;s++){const a=this.vertices[s];a.x-=r,a.y-=o}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getBoundingClientRect(n){let r,o,s,a,l,c,d=1/0,u=-1/0,h=1/0,f=-1/0;if(this._update(!0),r=n?this.matrix:this.worldMatrix,o=(this.linewidth||0)/2,s=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke))if(this.matrix.manual){const{scaleX:g,scaleY:m}=Sp(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof g=="number"&&typeof m=="number"&&(o=Math.max(g,m)*(this.linewidth||0)/2)}else o*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(a=0;a<s;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+s-1)%s];const[g,m]=r.multiply(l.x,l.y),[p,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[C,x]=r.multiply(y,_),N=c.controls.left.x,$=c.controls.left.y;c.relative&&(N+=c.x,$+=c.y);let[w,v]=r.multiply(N,$);const k=Ep(g,m,C,x,w,v,p,b);h=qi(k.min.y-o,h),d=qi(k.min.x-o,d),u=Xi(k.max.x+o,u),f=Xi(k.max.y+o,f)}else a<=1&&(h=qi(m-o,h),d=qi(g-o,d),u=Xi(g+o,u),f=Xi(m+o,f)),h=qi(b-o,h),d=qi(p-o,d),u=Xi(p+o,u),f=Xi(b+o,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}getPointAt(n,r){let o,s,a,l,c,d,u,h,f,g,m,p,b,y,_,C=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,N=x-1;let $=null,w=null;for(let D=0,L=this._lengths.length,H=0;D<L;D++){if(H+this._lengths[D]>=C){this._closed?(o=ji(D,x),s=ji(D-1,x),D===0&&(o=s,s=D)):(o=D,s=Math.min(Math.max(D-1,0),N)),$=this.vertices[o],w=this.vertices[s],C-=H,this._lengths[D]!==0?n=C/this._lengths[D]:n=0;break}H+=this._lengths[D]}if($===null||w===null)return null;if($){if(!w)return $}else return w;_=w.controls&&w.controls.right,y=$.controls&&$.controls.left,c=w.x,g=w.y,d=(_||w).x,m=(_||w).y,u=(y||$).x,p=(y||$).y,h=$.x,b=$.y,_&&w.relative&&(d+=w.x,m+=w.y),y&&$.relative&&(u+=$.x,p+=$.y),l=so(n,c,d,u,h),f=so(n,g,m,p,b);const v=Zt(c,d,n),k=Zt(g,m,n),B=Zt(d,u,n),R=Zt(m,p,n),E=Zt(u,h,n),P=Zt(p,b,n),W=Zt(v,B,n),I=Zt(k,R,n),Z=Zt(B,E,n),te=Zt(R,P,n);return Me.isObject(r)?(r.x=l,r.y=f,r instanceof Fe&&(r.controls.left.x=W,r.controls.left.y=I,r.controls.right.x=Z,r.controls.right.y=te,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=f,r.controls.right.x-=l,r.controls.right.y-=f)),r.t=n,r):(a=new Fe(l,f,W-l,I-f,Z-l,te-f,this._curved?pe.curve:pe.line),a.t=n,a)}plot(){if(this.curved)return Fp(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,o=this._closed||this.vertices[r]._command===pe.close;let s=this.vertices[r],a=[],l;return Me.each(this.vertices,function(c,d){if(d<=0&&!o){s=c;return}if(c.command===pe.move){a.push(new Fe(s.x,s.y)),d>0&&(a[a.length-1].command=pe.line),s=c;return}l=Yc(c,s,n),a=a.concat(l),Me.each(l,function(u,h){h<=0&&s.command===pe.move?u.command=pe.move:u.command=pe.line}),d>=r&&(this._closed&&this._automatic&&(s=c,l=Yc(c,s,n),a=a.concat(l),Me.each(l,function(u,h){h<=0&&s.command===pe.move?u.command=pe.move:u.command=pe.line})),a.push(new Fe(c.x,c.y)),a[a.length-1].command=o?pe.close:pe.line),s=c},this),this._automatic=!1,this._curved=!1,this.vertices=a,this}_updateLength(n,r){r||this._update();const s=this.vertices.length-1;let a=this.vertices[s],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]=Xc(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,o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),a=co(this,o*this._length),l=co(this,s*this._length),c=Yp(a),d=Up(l);let u,h,f,g,m,p;for(this._renderer.vertices.length=0,p=0;p<n;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Fe),p>d&&!h?(m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(s,m),m.command=this._renderer.collection[p].command,this._renderer.vertices.push(m),h=m,f=this._collection[p-1],f&&f.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),f.relative?this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(be.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(f.controls.right).lerp(f,1-m.t))):p>=c&&p<=d&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===d&&qc(this,s)?(h=m,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):p===c&&qc(this,o)&&(u=m,u.command=pe.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(p=c-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,m),m.command=pe.move,this._renderer.vertices.unshift(m),g=this._collection[p+1],g&&g.controls&&(m.controls.left.clear(),g.relative?this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(be.zero,m.t):(Kp.copy(g),this._renderer.collection[p+1].controls.left.copy(g.controls.left).lerp(g,m.t))))}return Rn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Rn.prototype.flagReset.call(this),this}};T(sn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),T(sn,"Utils",{getCurveLength:Xc});let Ae=sn;const Gc={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=!!t,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=!!t,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){if(t===this._automatic)return;this._automatic=!!t;const e=this._automatic?"ignore":"listen";Me.each(this.vertices,function(n){n[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ne.Types.insert,e).unbind(ne.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Me.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function Zc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Qc(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Jc(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function ed(){this._flagFill=!0}function td(){this._flagStroke=!0}const Gp=Math.ceil,Zp=Math.floor,Sn=class Sn extends Rn{constructor(n){super();T(this,"_flagVertices",!0);T(this,"_flagLength",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagSize",!0);T(this,"_flagSizeAttenuation",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_length",0);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_size",1);T(this,"_sizeAttenuation",!1);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);T(this,"noFill",Ae.prototype.noFill);T(this,"noStroke",Ae.prototype.noStroke);T(this,"corner",Ae.prototype.corner);T(this,"center",Ae.prototype.center);T(this,"getBoundingClientRect",Ae.prototype.getBoundingClientRect);T(this,"_updateLength",Ae.prototype._updateLength);for(let r in nd)Object.defineProperty(this,r,nd[r]);this._renderer.type="points",this._renderer.flagVertices=Zc.bind(this),this._renderer.bindVertices=Qc.bind(this),this._renderer.unbindVertices=Jc.bind(this),this._renderer.flagFill=ed.bind(this),this._renderer.flagStroke=td.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill="#fff",this.stroke="#000",this.linewidth=1,this.opacity=1,this.className="",this.visible=!0,this.vertices=n,this.dashes=[],this.dashes.offset=0}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),o=typeof n.stroke=="string"?n.stroke:fi(n.stroke),s=new Sn().copy({...n,fill:r,stroke:o});return"id"in n&&(s.id=n.id),s}copy(n){super.copy.call(this,n);for(let r=0;r<n.vertices.length;r++){const o=n.vertices[r];o instanceof Fe?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Fe().copy(o))}for(let r=0;r<Sn.Properties.length;r++){const o=Sn.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new Sn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Sn.Properties.length;o++){const s=Sn.Properties[o];r[s]=this[s]}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(Sn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?n[r]=this[r].toObject():n[r]=this[r])},this),n}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let n=0;n<this.vertices.length;n++){const r=this.vertices[n];typeof r.unbind=="function"&&r.unbind()}return typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}subdivide(n){this._update();let r=[];for(let o=0;o<this.vertices.length;o++){const s=this.vertices[o],a=this.vertices[o-1];if(!a)continue;const l=s.x,c=s.y,d=a.x,u=a.y,h=Ac(l,c,l,c,d,u,d,u,n);r=r.concat(h)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const n=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),o=co(this,n*this._length),s=co(this,r*this._length),a=Gp(o),l=Zp(s);let c=0,d;this._renderer.vertices=[],this._renderer.collection=[];for(let u=0;u<this._collection.length;u++)u>=a&&u<=l&&(d=this._collection[u],this._renderer.collection.push(d),this._renderer.vertices[c*2+0]=d.x,this._renderer.vertices[c*2+1]=d.y,c++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};T(Sn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let ho=Sn;const nd={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(t){this._sizeAttenuation=t,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._beginning=t,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._ending=t,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(t){const e=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(ne.Types.insert,e).unbind(ne.Types.remove,n),t instanceof ui?this._collection=t:this._collection=new ui(t||[]),this._collection.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class id extends ui{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);Xa(this,zo,{});this.attach(n),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return Mt(this,zo)}attach(n){for(let r=0;r<n.length;r++){const o=n[r];o&&o.id&&(this.ids[o.id]=o)}return this}detach(n){for(let r=0;r<n.length;r++)delete this.ids[n[r].id];return this}}zo=new WeakMap;const Mn=class Mn extends Ae{constructor(n,r,o,s,a,l,c){const d=c||Ss.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Fe);super(u,!0,!1,!0);T(this,"_flagStartAngle",!1);T(this,"_flagEndAngle",!1);T(this,"_flagInnerRadius",!1);T(this,"_flagOuterRadius",!1);T(this,"_startAngle",0);T(this,"_endAngle",di);T(this,"_innerRadius",0);T(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in rd)Object.defineProperty(this,h,rd[h]);typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),typeof a=="number"&&(this.startAngle=a),typeof l=="number"&&(this.endAngle=l),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new Mn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Mn.Properties.length;r++){const o=Mn.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const n=this._startAngle,r=this._endAngle,o=this._innerRadius,s=this._outerRadius,a=ji(n,di)===ji(r,di),l=o>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,f,g,m,p,b,y,_,C,x;for(a?d--:l||(d-=2),f=0,g=d-1;f<d;f++){switch(m=f/g,p=c[h],b=m*(r-n)+n,y=(r-n)/d,_=s*Math.cos(b),C=s*Math.sin(b),f){case 0:u=pe.move;break;default:u=pe.curve}p.command=u,p.x=_,p.y=C,p.controls.left.clear(),p.controls.right.clear(),p.command===pe.curve&&(x=s*y/Math.PI,p.controls.left.x=x*Math.cos(b-ht),p.controls.left.y=x*Math.sin(b-ht),p.controls.right.x=x*Math.cos(b+ht),p.controls.right.y=x*Math.sin(b+ht),f===1&&p.controls.left.multiplyScalar(2),f===g&&p.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=pe.close,h++):(d--,g=d-1),f=0;f<d;f++)m=f/g,p=c[h],b=(1-m)*(r-n)+n,y=(r-n)/d,_=o*Math.cos(b),C=o*Math.sin(b),u=pe.curve,f<=0&&(u=a?pe.move:pe.line),p.command=u,p.x=_,p.y=C,p.controls.left.clear(),p.controls.right.clear(),p.command===pe.curve&&(x=o*y/Math.PI,p.controls.left.x=x*Math.cos(b+ht),p.controls.left.y=x*Math.sin(b+ht),p.controls.right.x=x*Math.cos(b-ht),p.controls.right.y=x*Math.sin(b-ht),f===1&&p.controls.left.multiplyScalar(2),f===g&&p.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=pe.line}else a||(c[h].command=pe.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].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,o=this.outerRadius,s=this.startAngle,a=this.endAngle,l=this.vertices.length,c=new Mn(0,0,r,o,s,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<Ae.Properties.length;d++){const u=Ae.Properties[d];c[u]=this[u]}return n&&n.add(c),c}toObject(){const n=super.toObject.call(this);n.renderer.type="arc-segment";for(let r=0;r<Mn.Properties.length;r++){const o=Mn.Properties[r];n[o]=this[o]}return n}};T(Mn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Ts=Mn;const rd={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(t){this._startAngle=t,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(t){this._endAngle=t,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}}},Ns=Math.cos,$s=Math.sin,An=class An extends Ae{constructor(n,r,o,s){const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Fe(0,0,0,0,0,0));super(l,!0,!0,!0);T(this,"_flagRadius",!1);T(this,"_radius",0);this._renderer.type="circle";for(let c in od)Object.defineProperty(this,c,od[c]);typeof o=="number"&&(this.radius=o),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new An().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<An.Properties.length;r++){const o=An.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}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)),o=this._radius,s=o*r;for(let a=0;a<this.vertices.length;a++){const c=a/n*di,d=o*Ns(c),u=o*$s(c),h=s*Ns(c-ht),f=s*$s(c-ht),g=s*Ns(c+ht),m=s*$s(c+ht),p=this.vertices[a];p.command=a===0?pe.move:pe.curve,p.set(d,u),p.controls.left.set(h,f),p.controls.right.set(g,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new An(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let o=0;o<Ae.Properties.length;o++){const s=Ae.Properties[o];r[s]=this[s]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="circle";for(let r=0;r<An.Properties.length;r++){const o=An.Properties[r];n[o]=this[o]}return n}};T(An,"Properties",["radius"]);let Rs=An;const od={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},Es=Math.cos,Ps=Math.sin,In=class In extends Ae{constructor(n,r,o,s,a){typeof s!="number"&&typeof o=="number"&&(s=o);const l=a?Math.max(a,2):4,c=[];for(let d=0;d<l;d++)c.push(new Fe);super(c,!0,!0,!0);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_width",0);T(this,"_height",0);this._renderer.type="ellipse";for(let d in sd)Object.defineProperty(this,d,sd[d]);typeof o=="number"&&(this.width=o*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new In().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<In.Properties.length;r++){const o=In.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}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)),o=this._width/2,s=this._height/2;for(let a=0;a<this.vertices.length;a++){const c=a/n*di,d=o*Es(c),u=s*Ps(c),h=o*r*Es(c-ht),f=s*r*Ps(c-ht),g=o*r*Es(c+ht),m=s*r*Ps(c+ht),p=this.vertices[a];p.command=a===0?pe.move:pe.curve,p.set(d,u),p.controls.left.set(h,f),p.controls.right.set(g,m)}}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,o=this.height/2,s=this.vertices.length,a=new In(0,0,r,o,s);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<Ae.Properties.length;l++){const c=Ae.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<In.Properties.length;r++){const o=In.Properties[r];n[o]=this[o]}return n}};T(In,"Properties",["width","height"]);let Fs=In;const sd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}}},Qp=Math.cos,Jp=Math.sin,On=class On extends Ae{constructor(n,r,o,s){s=Math.max(s||0,3);super();T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_flagSides",!1);T(this,"_radius",0);T(this,"_width",0);T(this,"_height",0);T(this,"_sides",0);this._renderer.type="polygon";for(let a in ad)Object.defineProperty(this,a,ad[a]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.radius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r)}static fromObject(n){const r=new On().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<On.Properties.length;r++){const o=On.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const n=this._sides,r=n+1;let o=this.vertices.length;o>n&&(this.vertices.splice(n-1,o-n),o=n);for(let s=0;s<r;s++){const a=(s+.5)/n,l=di*a+Math.PI/2,c=this._width*Qp(l)/2,d=this._height*Jp(l)/2;s>=o?this.vertices.push(new Fe(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===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 On(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 o=0;o<Ae.Properties.length;o++){const s=Ae.Properties[o];r[s]=this[s]}return n&&n.add(r),r}toObject(){const n=super.toObject.call(this);n.renderer.type="polygon";for(let r=0;r<On.Properties.length;r++){const o=On.Properties[r];n[o]=this[o]}return n}};T(On,"Properties",["width","height","sides"]);let Vs=On;const ad={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this.width=t*2,this.height=t*2}},width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}},Ti=class Ti extends Ae{constructor(n,r,o,s){const a=[new Fe,new Fe,new Fe,new Fe];super(a,!0,!1,!0);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_width",0);T(this,"_height",0);T(this,"_origin",null);this._renderer.type="rectangle";for(let l in ld)Object.defineProperty(this,l,ld[l]);this.width=typeof o=="number"?o:1,this.height=typeof s=="number"?s:1,this.origin=new be,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ti().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ti.Properties.length;r++){const o=Ti.Properties[r];o in n&&(typeof n[o]=="number"?this[o]=n[o]:this[o]instanceof be&&this[o].copy(n[o]))}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 Fe),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 Ti(0,0,this.width,this.height);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let o=0;o<Ae.Properties.length;o++){const s=Ae.Properties[o];r[s]instanceof be?r[s].copy(this[s]):r[s]=this[s]}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}};T(Ti,"Properties",["width","height","origin"]);let yr=Ti;const ld={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(t){this._origin&&this._origin.unbind(ne.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ne.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},zn=class zn extends Ae{constructor(n,r,o,s,a){typeof a>"u"&&typeof o=="number"&&typeof s=="number"&&(a=Math.floor(Math.min(o,s)/12));const l=[];for(let c=0;c<10;c++)l.push(new Fe(0,0,0,0,0,0,c===0?pe.move:pe.curve));super(l);T(this,"_flagWidth",!1);T(this,"_flagHeight",!1);T(this,"_flagRadius",!1);T(this,"_width",0);T(this,"_height",0);T(this,"_radius",12);this._renderer.type="rounded-rectangle";for(let c in cd)Object.defineProperty(this,c,cd[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=ey.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof a=="number"||a instanceof be)&&(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 zn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<zn.Properties.length;r++){const o=zn.Properties[r];if(o in n){const s=n[o];/radius/i.test(o)?this[o]=typeof s=="number"||s instanceof be?s:new be().copy(s):typeof s=="number"&&(this[o]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const n=this._width,r=this._height;let o,s;this._radius instanceof be?(o=this._radius.x,s=this._radius.y):(o=this._radius,s=this._radius);let a,l=n/2,c=r/2;a=this.vertices[0],a.x=-(l-o),a.y=-c,a=this.vertices[1],a.x=l-o,a.y=-c,a.controls.left.clear(),a.controls.right.x=o,a.controls.right.y=0,a=this.vertices[2],a.x=l,a.y=-(c-s),a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[3],a.x=l,a.y=c-s,a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=s,a=this.vertices[4],a.x=l-o,a.y=c,a.controls.right.clear(),a.controls.left.clear(),a=this.vertices[5],a.x=-(l-o),a.y=c,a.controls.left.clear(),a.controls.right.x=-o,a.controls.right.y=0,a=this.vertices[6],a.x=-l,a.y=c-s,a.controls.left.clear(),a.controls.right.clear(),a=this.vertices[7],a.x=-l,a.y=-(c-s),a.controls.left.clear(),a.controls.right.x=0,a.controls.right.y=-s,a=this.vertices[8],a.x=-(l-o),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,o=this.height,s=this.radius,a=new zn(0,0,r,o,s);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<Ae.Properties.length;l++){const c=Ae.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<zn.Properties.length;r++){const o=zn.Properties[r];n[o]=this[o]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};T(zn,"Properties",["width","height","radius"]);let Ms=zn;const cd={width:{enumerable:!0,get:function(){return this._width},set:function(t){this._width=t,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(t){this._height=t,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof be&&this._radius.unbind(ne.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof be&&this._radius.bind(ne.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function ey(){this._flagRadius=!0}const ty=Math.cos,ny=Math.sin,Dn=class Dn extends Ae{constructor(n,r,o,s,a){arguments.length<=3&&(s=o,o=s/2),(typeof a!="number"||a<=0)&&(a=5);super();T(this,"_flagInnerRadius",!1);T(this,"_flagOuterRadius",!1);T(this,"_flagSides",!1);T(this,"_innerRadius",0);T(this,"_outerRadius",0);T(this,"_sides",0);this._renderer.type="star";for(let l in dd)Object.defineProperty(this,l,dd[l]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.innerRadius=o),typeof s=="number"&&(this.outerRadius=s),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 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 o=Dn.Properties[r];o in n&&typeof n[o]=="number"&&(this[o]=n[o])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const n=this._sides*2,r=n+1;let o=this.vertices.length;o>n&&(this.vertices.splice(n-1,o-n),o=n);for(let s=0;s<r;s++){const a=(s+.5)/n,l=di*a,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*ty(l),u=c*ny(l);s>=o?this.vertices.push(new Fe(d,u)):this.vertices[s].set(d,u),this.vertices[s].command=s===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,o=this.outerRadius,s=this.sides,a=new Dn(0,0,r,o,s);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<Ae.Properties.length;l++){const c=Ae.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<Dn.Properties.length;r++){const o=Dn.Properties[r];n[o]=this[o]}return n}};T(Dn,"Properties",["innerRadius","outerRadius","sides"]);let As=Dn;const dd={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(t){this._innerRadius=t,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(t){this._outerRadius=t,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(t){this._sides=t,this._flagSides=!0}}};let Is;const ud=Math.min,hd=Math.max;yn.document&&(Is=document.createElement("canvas"));const St=class St extends Rn{constructor(n,r,o,s){super();T(this,"_flagValue",!0);T(this,"_flagFamily",!0);T(this,"_flagSize",!0);T(this,"_flagLeading",!0);T(this,"_flagAlignment",!0);T(this,"_flagBaseline",!0);T(this,"_flagStyle",!0);T(this,"_flagWeight",!0);T(this,"_flagDecoration",!0);T(this,"_flagFill",!0);T(this,"_flagStroke",!0);T(this,"_flagLinewidth",!0);T(this,"_flagOpacity",!0);T(this,"_flagVisible",!0);T(this,"_flagMask",!1);T(this,"_flagClip",!1);T(this,"_flagDirection",!0);T(this,"_flagStrokeAttenuation",!0);T(this,"_value","");T(this,"_family","sans-serif");T(this,"_size",13);T(this,"_leading",17);T(this,"_alignment","center");T(this,"_baseline","middle");T(this,"_style","normal");T(this,"_weight",500);T(this,"_decoration","none");T(this,"_direction","ltr");T(this,"_fill","#000");T(this,"_stroke","none");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_mask",null);T(this,"_clip",!1);T(this,"_dashes",null);T(this,"_strokeAttenuation",!0);for(let a in fd)Object.defineProperty(this,a,fd[a]);if(this._renderer.type="text",this._renderer.flagFill=iy.bind(this),this._renderer.flagStroke=ry.bind(this),this.value=n,typeof r=="number"&&(this.translation.x=r),typeof o=="number"&&(this.translation.y=o),this.dashes=[],this.dashes.offset=0,!Me.isObject(s))return this;for(let a=0;a<St.Properties.length;a++){const l=St.Properties[a];l in s&&(this[l]=s[l])}}static Measure(n){if(Is){const r=Is.getContext("2d");r.font=[n._style,n._weight,`${n._size}px/${n._leading}px`,n._family].join(" ");const o=r.measureText(n.value,0,0),s=o.actualBoundingBoxDescent+o.actualBoundingBoxAscent;return{width:o.width,height:s}}else{const r=this.value.length*this.size*St.Ratio,o=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:o}}}static fromObject(n){const r=typeof n.fill=="string"?n.fill:fi(n.fill),o=typeof n.stroke=="string"?n.stroke:fi(n.stroke),s=new St().copy({...n,fill:r,stroke:o});return"id"in n&&(s.id=n.id),s}copy(n){super.copy.call(this,n);for(let r=0;r<St.Properties.length;r++){const o=St.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new St(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let o=0;o<St.Properties.length;o++){const s=St.Properties[o];r[s]=this[s]}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<St.Properties.length;r++){const o=St.Properties[r];n[o]=this[o]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&this.fill&&"dispose"in this.fill?this.fill.dispose():typeof this.fill=="object"&&this.fill&&"unbind"in this.fill&&this.fill.unbind(),typeof this.stroke=="object"&&this.stroke&&"dispose"in this.stroke?this.stroke.dispose():typeof this.stroke=="object"&&this.stroke&&"unbind"in this.stroke&&this.stroke.unbind(),this}noFill(){return this.fill="none",this}noStroke(){return this.stroke="none",this.linewidth=0,this}getBoundingClientRect(n){let r,o,s,a,l;this._update(!0),r=n?this.matrix:this.worldMatrix;const{width:c,height:d}=St.Measure(this),u=(this._linewidth||0)/2;switch(this.alignment){case"left":o=-u,s=c+u;break;case"right":o=-(c+u),s=u;break;default:o=-(c/2+u),s=c/2+u}switch(this.baseline){case"middle":a=-(d/2+u),l=d/2+u;break;default:a=-(d+u),l=u}const[h,f]=r.multiply(o,a),[g,m]=r.multiply(o,l),[p,b]=r.multiply(s,a),[y,_]=r.multiply(s,l);return a=ud(f,m,b,_),o=ud(h,g,p,y),s=hd(h,g,p,y),l=hd(f,m,b,_),{top:a,left:o,right:s,bottom:l,width:s-o,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}};T(St,"Ratio",.6),T(St,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let Yi=St;const fd={value:{enumerable:!0,get:function(){return this._value},set:function(t){this._value=t,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(t){this._family=t,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(t){this._size=t,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(t){this._leading=t,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(t){this._alignment=t,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(t){this._style=t,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(t){this._weight=t,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(t){this._decoration=t,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(t){this._direction=t,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(t){this._baseline=t,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._opacity=t,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._visible=t,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof lt||this._fill instanceof Rt||this._fill instanceof Et||this._fill instanceof Ge)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof lt||this._stroke instanceof Rt||this._stroke instanceof Et||this._stroke instanceof Ge)&&this._stroke.bind(ne.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Me.isObject(t)&&!t.clip&&(t.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(t){this._clip=t,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(t){typeof t.offset!="number"&&(t.offset=this.dashes&&this._dashes.offset||0),this._dashes=t}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function iy(){this._flagFill=!0}function ry(){this._flagStroke=!0}const Ln=class Ln extends yr{constructor(n,r,o,s){super(r,o,0,0);T(this,"_flagTextures",!1);T(this,"_flagFrameRate",!1);T(this,"_flagIndex",!1);T(this,"_amount",1);T(this,"_duration",0);T(this,"_index",0);T(this,"_startTime",0);T(this,"_playing",!1);T(this,"_firstFrame",0);T(this,"_lastFrame",0);T(this,"_loop",!0);T(this,"_textures",null);T(this,"_frameRate",0);T(this,"_origin",null);this._renderer.type="image-sequence";for(let a in md)Object.defineProperty(this,a,md[a]);this._renderer.flagTextures=oy.bind(this),this._renderer.bindTextures=sy.bind(this),this._renderer.unbindTextures=ay.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(gd.bind(this)):typeof n=="string"&&(this.textures=[gd(n)]),this.origin=new be,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Ln.DefaultFrameRate,this.index=0}static fromObject(n){const r=new Ln().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ln.Properties.length;r++){const o=Ln.Properties[r];o in n&&(this[o]=n[o])}return this}play(n,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Me.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof o=="function"?this._onLastFrame=o:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(n){const r=new Ln(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="image-sequence",n.textures=this.textures.map(function(r){return r.toObject()}),n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){if(super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this.textures&&typeof this.textures.unbind=="function")try{this.textures.unbind()}catch{}if(this.textures)for(let n=0;n<this.textures.length;n++){const r=this.textures[n];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const n=this._textures;let r,o,s,a,l,c,d,u;return n&&(this._flagTextures&&(this._amount=n.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(a=this._amount,Me.isNaN(this._lastFrame)&&(this._lastFrame=a-1),s=Me.performance.now()-this._startTime,u=this._lastFrame+1,l=1e3*(u-this._firstFrame)/this._frameRate,this._loop?s=s%l:s=Math.min(s,l),d=Zt(this._firstFrame,u,s/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=n[this._index],c.loaded&&(r=c.image.width,o=c.image.height,this.width!==r&&(this.width=r),this.height!==o&&(this.height=o),this.fill=c,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Ge))&&(c=n[this._index],c.loaded&&(r=c.image.width,o=c.image.height,this.width!==r&&(this.width=r),this.height!==o&&(this.height=o)),this.fill=c)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};T(Ln,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),T(Ln,"DefaultFrameRate",30);let Os=Ln;const md={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(t){const e=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(ne.Types.insert,e).unbind(ne.Types.remove,n),this._textures=new ui((t||[]).slice(0)),this._textures.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}};function oy(){this._flagTextures=!0}function sy(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function ay(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function gd(t){if(t instanceof Ge)return t;if(typeof t=="string")return new Ge(t)}const Ni=class Ni extends yr{constructor(n,r,o,s,a,l){super(r,o,0,0);T(this,"_flagTexture",!1);T(this,"_flagColumns",!1);T(this,"_flagRows",!1);T(this,"_flagFrameRate",!1);T(this,"_flagIndex",!1);T(this,"_amount",1);T(this,"_duration",0);T(this,"_startTime",0);T(this,"_playing",!1);T(this,"_firstFrame",0);T(this,"_lastFrame",0);T(this,"_loop",!0);T(this,"_texture",null);T(this,"_columns",1);T(this,"_rows",1);T(this,"_frameRate",0);T(this,"_index",0);T(this,"_origin",null);this._renderer.type="sprite";for(let c in pd)Object.defineProperty(this,c,pd[c]);this.noStroke(),this.noFill(),n instanceof Ge?this.texture=n:typeof n=="string"&&(this.texture=new Ge(n)),this.origin=new be,this._update(),typeof s=="number"&&(this.columns=s),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(n){const r=new Ni().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ni.Properties.length;r++){const o=Ni.Properties[r];o in n&&(this[o]=n[o])}return this}play(n,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=Me.performance.now(),typeof n=="number"&&(this._firstFrame=n),typeof r=="number"&&(this._lastFrame=r),typeof o=="function"?this._onLastFrame=o:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(n){const r=new Ni(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&r.play(this._firstFrame,this._lastFrame),r.loop=this.loop,r.firstFrame=this.firstFrame,r.lastFrame=this.lastFrame,n&&n.add(r),r}toObject(){const n=super.toObject.call(this);return n.renderer.type="sprite",n.texture=this.texture.toObject(),n.columns=this.columns,n.rows=this.rows,n.frameRate=this.frameRate,n.index=this.index,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,n.loop=this.loop,n}dispose(){return super.dispose(),this._playing&&(this._playing=!1),this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose=="function"?this._texture.dispose():this._texture&&typeof this._texture.unbind=="function"&&this._texture.unbind(),this}_update(){const n=this._texture,r=this._columns,o=this._rows;let s,a,l,c,d,u,h,f,g;if(n&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=n),n.loaded)){h=n.image.width,f=n.image.height,s=h/r,a=f/o,c=this._amount,this.width!==s&&(this.width=s),this.height!==a&&(this.height=a),this._playing&&this._frameRate>0&&(Me.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=Me.performance.now()-this._startTime,g=this._lastFrame+1,d=1e3*(g-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Zt(this._firstFrame,g,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%r,p=Math.floor(this._index/r),b=-s*m+(h-s)/2,y=-a*p+(f-a)/2;b!==n.offset.x&&(n.offset.x=b),y!==n.offset.y&&(n.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};T(Ni,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let zs=Ni;const pd={texture:{enumerable:!0,get:function(){return this._texture},set:function(t){this._texture=t,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(t){this._columns=t,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(t){this._rows=t,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(t){this._frameRate=t,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(t){this._index=t,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(t){this._firstFrame=t}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(t){this._lastFrame=t}},loop:{enumerable:!0,get:function(){return this._loop},set:function(t){this._loop=!!t}}},fo=Math.min,mo=Math.max,an=class an extends Rn{constructor(n){super();T(this,"_flagAdditions",!1);T(this,"_flagSubtractions",!1);T(this,"_flagOrder",!1);T(this,"_flagOpacity",!0);T(this,"_flagBeginning",!1);T(this,"_flagEnding",!1);T(this,"_flagLength",!1);T(this,"_flagMask",!1);T(this,"_fill","#fff");T(this,"_stroke","#000");T(this,"_linewidth",1);T(this,"_opacity",1);T(this,"_visible",!0);T(this,"_cap","round");T(this,"_join","round");T(this,"_miter",4);T(this,"_closed",!0);T(this,"_curved",!1);T(this,"_automatic",!0);T(this,"_beginning",0);T(this,"_ending",1);T(this,"_length",0);T(this,"_mask",null);T(this,"_strokeAttenuation",!0);for(let r in yd)Object.defineProperty(this,r,yd[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++)bd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)bd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new an;for(let s=0;s<an.Properties.length;s++){const a=an.Properties[s];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:fi(n[a]):r[a]=n[a])}return"mask"in n&&(r.mask=o(n.mask)),"id"in n&&(r.id=n.id),r.children=n.children.map(o),r;function o(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return Ts.fromObject(s);case"circle":return Rs.fromObject(s);case"element":return gr.fromObject(s);case"ellipse":return Fs.fromObject(s);case"group":return an.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return Os.fromObject(s);case"path":return Ae.fromObject(s);case"points":return ho.fromObject(s);case"polygon":return Vs.fromObject(s);case"rectangle":return yr.fromObject(s);case"rounded-rectangle":return Ms.fromObject(s);case"shape":return Rn.fromObject(s);case"sprite":return zs.fromObject(s);case"star":return As.fromObject(s);case"text":return Yi.fromObject(s)}return s}}copy(n){super.copy.call(this,n),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<an.Properties.length;r++){const o=an.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new an,o=this.children.map(function(s){return s.clone()});return r.add(o),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,o)=>{n.children[o]=r.toObject()},this),n}dispose(){if(super.dispose(),this.children)for(let n=0;n<this.children.length;n++){const r=this.children[n];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}corner(){const n=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const o=this.children[r];o.translation.x-=n.left,o.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,o=n.top+n.height/2-this.translation.y;for(let s=0;s<this.children.length;s++){const a=this.children[s];a.isShape&&(a.translation.x-=r,a.translation.y-=o)}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.y-=o),this}getById(n){let r=null;function o(s){if(s.id===n)return s;if(s.children){if(s.children.ids[n])return s.children.ids[n];for(let a=0;a<s.children.length;a++)if(r=o(s.children[a]),r)return r}return null}return o(this)}getByClassName(n){const r=[];function o(s){if(Array.prototype.indexOf.call(s.classList,n)>=0&&r.push(s),s.children)for(let a=0;a<s.children.length;a++){const l=s.children[a];o(l)}return r}return o(this)}getByType(n){const r=[];function o(s){if(s instanceof n&&r.push(s),s.children)for(let a=0;a<s.children.length;a++){const l=s.children[a];o(l)}return r}return o(this)}add(n){n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let r=0;r<n.length;r++){const o=n[r];if(!(o&&o.id))continue;const s=Array.prototype.indexOf.call(this.children,o);s>=0&&this.children.splice(s,1),this.children.push(o)}return this}remove(n){const r=arguments.length,o=this.parent;if(r<=0&&o)return o.remove(this),this;n instanceof Array?n=n.slice():n=Array.prototype.slice.call(arguments);for(let s=0;s<n.length;s++){const a=n[s];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,o,s,a,l,c;this._update(!0);let d=1/0,u=-1/0,h=1/0,f=-1/0;const g=/texture|gradient/i;o=n?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const p=this.children[m];if(!(!p.visible||g.test(p._renderer.type))&&(r=p.getBoundingClientRect(n),s=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),!(s||a||l||c)))if(n){const[b,y]=o.multiply(r.left,r.top),[_,C]=o.multiply(r.right,r.top),[x,N]=o.multiply(r.left,r.bottom),[$,w]=o.multiply(r.right,r.bottom);h=fo(y,C,N,w,h),d=fo(b,_,x,$,d),u=mo(b,_,x,$,u),f=mo(y,C,N,w,f)}else h=fo(r.top,h),d=fo(r.left,d),u=mo(r.right,u),f=mo(r.bottom,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}noFill(){return this.children.forEach(function(n){n.noFill()}),this}noStroke(){return this.children.forEach(function(n){n.noStroke()}),this}subdivide(){const n=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,n)}),this}_update(){let n,r,o;if(this._flagBeginning||this._flagEnding){const s=Math.min(this._beginning,this._ending),a=Math.max(this._beginning,this._ending),l=this.length;let c=0;const d=s*l,u=a*l;for(n=0;n<this.children.length;n++)o=this.children[n],r=o.length,d>c+r?(o.beginning=1,o.ending=1):u<c?(o.beginning=0,o.ending=0):d>c&&d<c+r?(o.beginning=(d-c)/r,o.ending=1):u>c&&u<c+r?(o.beginning=0,o.ending=(u-c)/r):(o.beginning=0,o.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}};T(an,"Children",id),T(an,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let En=an;const yd={visible:{enumerable:!0,get:function(){return this._visible},set:function(t){this._flagVisible=this._visible!==t||this._flagVisible,this._visible=t}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(t){this._flagOpacity=this._opacity!==t||this._flagOpacity,this._opacity=t}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(t){this._flagBeginning=this._beginning!==t||this._flagBeginning,this._beginning=t}},ending:{enumerable:!0,get:function(){return this._ending},set:function(t){this._flagEnding=this._ending!==t||this._flagEnding,this._ending=t}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let t=0;t<this.children.length;t++){const e=this.children[t];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(t){this._fill=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.fill=t}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){this._stroke=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.stroke=t}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(t){this._linewidth=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.linewidth=t}}},join:{enumerable:!0,get:function(){return this._join},set:function(t){this._join=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.join=t}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(t){this._miter=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.miter=t}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(t){this._cap=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.cap=t}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(t){this._closed=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.closed=t}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(t){this._curved=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.curved=t}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(t){this._automatic=t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.automatic=t}}},children:{enumerable:!0,get:function(){return this._children},set:function(t){const e=En.InsertChildren.bind(this),n=En.RemoveChildren.bind(this),r=En.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new id(t),this._children.bind(ne.Types.insert,e),this._children.bind(ne.Types.remove,n),this._children.bind(ne.Types.order,r),t.length>0&&e(t)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,Me.isObject(t)&&!t.clip&&(t.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(t){this._strokeAttenuation=!!t;for(let e=0;e<this.children.length;e++){const n=this.children[e];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=t)}}}};function bd(t,e){const n=t.parent;let r;if(n===e){o();return}if(n&&n.children.ids[t.id]&&(r=Array.prototype.indexOf.call(n.children,t),n.children.splice(r,1),s()),e){o();return}s(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete t.parent;function o(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,t),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,t),r>=0&&e.additions.splice(r,1)),t.parent=e,e.additions.push(t),e._flagAdditions=!0}function s(){r=Array.prototype.indexOf.call(n.additions,t),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,t),r<0&&(n.subtractions.push(t),n._flagSubtractions=!0)}}class go extends Ae{constructor(e,n,r,o){const s=[new Fe(e,n),new Fe(r,o)];super(s);for(let a in _d)Object.defineProperty(this,a,_d[a]);this.vertices[0].command=pe.move,this.vertices[1].command=pe.line,this.automatic=!1}}T(go,"Properties",["left","right"]);const _d={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(Me.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=pe.move;else{const e=new ao("Two.Line.left argument is not an object.");console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(t){if(Me.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=pe.line;else{const e=new ao("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Ds{constructor(e=0,n=0){this.x=e,this.y=n}}class _n{constructor(e=10,n=0,r="A"){T(this,"start",new Ds);T(this,"end",new Ds);this.width=e,this.angle=n,this.label=r}}const qe={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"}},ly={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function cy(t,e){return i.openBlock(),i.createElementBlock("svg",ly,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z"},null,-1)])])}const po=i.markRaw({name:"ion-close",render:cy}),dy={class:"mr-3 flex flex-col gap-2"},uy=["onClick"],hy={class:"h-full p-2"},fy={},my=i.defineComponent({...fy,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(t,{emit:e}){const n=t,r=i.ref(!1),o=i.useTemplateRef("drawing-template-containers"),s=i.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return i.onMounted(()=>{var c,d;(c=n.settings.templates)==null||c.forEach((u,h)=>{var g;const f=(g=o.value)==null?void 0:g.at(h);f&&a("init-draw-template",f,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var g;const f=(g=s.value)==null?void 0:g.at(h);f&&a("init-draw-template",f,u)})}),i.watch(()=>[...n.settings.customTemplates],(c,d)=>{i.nextTick(()=>{c.forEach((u,h)=>{var f;if(!(d!=null&&d.includes(u))){const g=(f=s.value)==null?void 0:f.at(h);g&&a("init-draw-template",g,u)}}),d.length>c.length&&d.forEach((u,h)=>{var g;const f=(g=s.value)==null?void 0:g.at(h);f&&(f.innerHTML="",a("init-draw-template",f,u))})})},{deep:!0}),(c,d)=>{const u=po;return i.openBlock(),i.createBlock(i.unref(A.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",dy,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.settings.allTemplates,(h,f)=>(i.openBlock(),i.createElementBlock("div",{key:`${h.id}-${f}`,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":f===t.selectTemplateIndex}]),onClick:g=>a("template:select",f)},[i.createElementVNode("div",hy,[i.createElementVNode("div",{ref_for:!0,ref:h.isCustom&&h.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,uy)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,size:"tiny",quaternary:"",loading:r.value,disabled:r.value,circle:"",class:"!absolute right-0.5 top-0.5 !hidden group-hover:!flex",onClick:g=>l(f)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),wd=Nn(my,[["__scopeId","data-v-afccb364"]]),gy={class:"flex gap-3 min-w-[20rem] relative"},py={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},yy={ref:"drawing-container",class:"size-full"},by={},xd=i.defineComponent({...by,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("drawing-container");let s=[],a=[],l=[],c=null;const d=.75,u=i.computed(()=>n.value.configuratorParams.linesAngles.map((D,L)=>new _n(n.value.configuratorParams.linesWidths[L],D,`A-${L+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var D,L;return n.value.configuratorParams.startTailType&&((D=n.settings.startTailConfigs)!=null&&D[n.value.configuratorParams.startTailType])?(L=n.settings.startTailConfigs)==null?void 0:L[n.value.configuratorParams.startTailType].points:[]}),g=i.computed(()=>{var L;const D=n.value.configuratorParams.endTailType!==void 0&&((L=n.settings.endTailConfigs)==null?void 0:L[n.value.configuratorParams.endTailType]);return!D||!D.points?[]:D.points.map((H,z)=>Array.isArray(H)?new _n(H[0],H[1],`A-${z+1}`):new _n(H.width,H.angle,`A-${z+1}`))}),m=(D,L=!1)=>{D[0].start.x=0,D[0].start.y=0;let H=0;for(let z=0;z<D.length;z++){const O=D[z],U=D[z-1]??new _n(0,H);H+=!L||z>1?U.angle:0;const K=(!L||z>0?O.angle:0)+H;if(D[z].end.x=O.width*Math.cos(K*Math.PI/180)+D[z].start.x,D[z].end.y=O.width*Math.sin(K*Math.PI/180)+D[z].start.y,z<D.length-1){const V=z+1;D[V].start.x=D[z].end.x,D[V].start.y=D[z].end.y}}return D},p=(D,L,H,z,O=!1)=>{let U=m([...H,...z]);L.length>0&&(U=[...m(L),...U]);let K=0,V=0,q=0,Y=0;U.forEach(Te=>{K=Math.min(K,Te.start.x,Te.end.x),V=Math.min(V,Te.start.y,Te.end.y),q=Math.max(q,Te.start.x,Te.end.x),Y=Math.max(Y,Te.start.y,Te.end.y)});let ee,ue;K===0&&V===0&&q===0&&Y===0?(ee=1,ue=1):(ee=D.width/Math.abs(q-K),ue=(O?D.height:D.height-qe.colorSideLabel.size)/Math.abs(Y-V));const ve=Math.min(ee,ue);return K=K<0?-K*ve:0,V=V<0?-V*ve:0,[ve,K,V]},b=D=>{const L=new ho([D]);return L._size=qe.anchorPoint.size,L.fill=qe.anchorPoint.color,L.stroke="transparent",L._linewidth=qe.anchorPoint.strokeSize,l.push(L),L},y=(D,L)=>{if(l=[],n.settings.allowChangeFirstPoint){const H=D[0],z=new be(H.vertices[0].x,H.vertices[0].y);z.bind(ne.Types.change,()=>{H.vertices[0].copy(z)});const O=b(z);L.add(O)}D.forEach((H,z)=>{const O=D[z+1],U=new be(H.vertices[1].x,H.vertices[1].y);U.bind(ne.Types.change,()=>{H.vertices[1].copy(U),O!==void 0&&O.vertices[0].copy(U)});const K=b(U);L.add(K)})},_=D=>D*(Math.PI/180),C=(D,L,H)=>{const z=L.vertices.length-1;D.position.x=L.vertices[z].x,D.position.y=L.vertices[z].y;const O=Math.atan2(L.vertices[z].y-L.vertices[0].y,L.vertices[z].x-L.vertices[0].x);D.rotation=_(H)+O},x=(D,L,H)=>{if(L.vertices[0]===void 0)return;D.position.x=L.vertices[0].x,D.position.y=L.vertices[0].y;const z=L.vertices.length-1,O=Math.atan2(L.vertices[z].y-L.vertices[0].y,L.vertices[z].x-L.vertices[0].x);D.rotation=_(H)+O},N=(D,L,H)=>{const z=new En;if(D.length===0)return z;const O=[];return[...D].reverse().forEach((U,K)=>{K!==0&&U.angle>0&&(U.angle*=-1),O.push(U)}),D=m(O,!0),x(z,L,D[0].angle),[L.vertices[0],L.vertices[1]].forEach(U=>{U.bind(ne.Types.change,()=>{x(z,L,D[0].angle)})}),D.forEach(U=>{const K=U.start.x*H,V=U.end.x*H,q=U.start.y*H,Y=U.end.y*H,ee=new go(K,q,V,Y);ee.linewidth=qe.line.size,ee.stroke=qe.line.color,z.add(ee)}),z},$=(D,L,H)=>{const z=new En;return D.length===0||(D=m(D,!0),C(z,L,D[0].angle),[L.vertices[0],L.vertices[1]].forEach(O=>{O.bind(ne.Types.change,()=>{C(z,L,D[0].angle)})}),D.forEach(O=>{const U=O.start.x*H,K=O.end.x*H,V=O.start.y*H,q=O.end.y*H,Y=new go(U,V,K,q);Y.linewidth=qe.line.size,Y.stroke=qe.line.color,z.add(Y)})),z},w=(D,L,H,z)=>{const O=L.vertices[0].x+(L.vertices[1].x-L.vertices[0].x)/2-8*Math.sin(D.angle*Math.PI/180),U=L.vertices[0].y+(L.vertices[1].y-L.vertices[0].y)/2-8*Math.cos(D.angle*Math.PI/180),K=new Yi(D.label,O+10,U-10);let V;K.size=qe.lineLabel.size,K.weight=600,K.fill=qe.lineLabel.color,K.id+=1,K.rotation=qe.lineLabel.rotation,z>0&&(V=new Yi(`${D.angle}°`,L.vertices[0].x+25,L.vertices[0].y-25),V.size=qe.angleLabel.size,V.weight=600,V.fill=qe.angleLabel.color,V.rotation=qe.angleLabel.rotation,V.id+=z,s.push(V),H.add(V)),H.add(K),k(K,L,0,V),k(K,L,1)},v=()=>{const{size:D}=qe.colorSideLabel,L=0,H=0,z=h.value?D/2:D/2-D,O=h.value?D/2-D:D/2,U=new En;if(!c)return U;const K=5,V=Math.atan2(O-z,H-L),q=[new Fe(L,z,0,0,0,0,pn.Commands.move),new Fe(H,O,0,0,0,0,pn.Commands.line),new Fe(H-K*Math.cos(V-Math.PI/4),O-K*Math.sin(V-Math.PI/4),0,0,0,0,pn.Commands.line),new Fe(H,O,0,0,0,0,pn.Commands.move),new Fe(H-K*Math.cos(V+Math.PI/4),O-K*Math.sin(V+Math.PI/4),0,0,0,0,pn.Commands.line)],Y=new Ae(q,!1,!1,!0);Y.noFill(),Y.cap="round",Y.join="round",Y.linewidth=D/7,Y.stroke=qe.colorSideLabel.color,U.add(Y);const ee=new Yi(h.value?"Цвет снизу":"Цвет сверху",10,0);ee.size=D,ee.weight=600,ee.fill=qe.colorSideLabel.color,ee.alignment="left",U.add(ee);const ue=U.getBoundingClientRect();return U.position.x=(c.width-ue.width)*d+10,U.position.y=h.value?c.height+ue.height*2:ue.height/2,U},k=(D,L,H,z)=>{L.vertices[H].bind(ne.Types.change,()=>{const O=L.vertices.length-1,U=Math.atan2(L.vertices[0].y-L.vertices[O].y,L.vertices[0].x-L.vertices[O].x)*180/Math.PI,K=L.vertices[0].x+(L.vertices[O].x-L.vertices[0].x)/2-8*Math.sin(U*Math.PI/180),V=L.vertices[0].y+(L.vertices[O].y-L.vertices[0].y)/2-8*Math.cos(U*Math.PI/180);D.position.x=K+10,D.position.y=V-10,D.rotation=-.5,z&&(z.position.x=L.vertices[0].x+25,z.position.y=L.vertices[0].y-25)})},B=(D,L,H,z,O=!1)=>{var We;if(D.clear(),H.length===0){D.update();return}const U=m(H),[K,V,q]=p(D,L,U,z,O),Y=new En,ee=new Array,ue=new Array;O||(s=[],a=[]),U.forEach((ce,pt)=>{const Ne=ce.start.x*K+V,Vt=ce.end.x*K+V,jt=ce.start.y*K+q,ln=ce.end.y*K+q,Bt=new go(Ne,jt,Vt,ln);Bt.linewidth=O?qe.previewLine.size:qe.line.size,Bt.stroke=O?qe.previewLine.color:qe.line.color,a.push(Bt),ee.push(Bt),Y.add(Bt),!O&&ce.label!==""&&w(ce,Bt,Y,pt)});const ve=ee.at(-1);let Te=Y.getBoundingClientRect();if(!O){const ce=v();ue.push(ce)}if(L.length>0){const ce=N(L,ee[0],K);Y.add(ce)}if(z.length>0&&ve){const ce=$(z,ve,K);Y.add(ce)}if(ue.push(Y),D.makeGroup(ue),Te=Y.getBoundingClientRect(),Y.position.x=0-Te.left+(D.width-Te.width)/(2*(O?1:d)),Y.position.y=0-Te.top+(D.height-Te.height)/(2*(O?1:d)),D.update(),!O){const ce=((We=n.value.configuratorParams)==null?void 0:We.colorSide)==="top";Y.position.y=Y.position.y+qe.colorSideLabel.size*Number(ce),y(ee,Y),D.update()}},R=(D,L)=>{if(D&&!L.isNewRec()){const H=new pn({width:D.scrollWidth,height:D.scrollHeight});H.appendTo(D),B(H,[],L.points,[],!0)}},E=()=>{c&&B(c,f.value,u.value,g.value,!1)},P=D=>D*(180/Math.PI),W=(D,L)=>{const H=D[1].x-D[0].x,z=D[1].y-D[0].y,O=L[1].x-L[0].x,U=L[1].y-L[0].y;let K=Math.atan2(H*U-z*O,H*O+z*U);return K=P(K),Math.round(K)*-1},I=D=>{const L=a.map((H,z,O)=>{const U=O[z-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let K=Math.ceil(H._length/D/n.settings.lineWidthStep)*n.settings.lineWidthStep;const V=s[z-1];K<(O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(K=O.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),K>n.settings.maxLineWidth&&(K=n.settings.maxLineWidth);const q=W(H.vertices,U.vertices);return V&&(V.value=`${q}°`),new _n(K,q,`A-${z+1}`)});r("pointer:move",L)},Z=D=>{let L=null,H;const z=V=>{L=l.find(q=>{const Y=q.renderer;return(Y==null?void 0:Y.elem)===V.target}),[H]=p(D,f.value,u.value.map(q=>q),g.value)},O=V=>{if(L){const q=L.renderer,Y=q==null?void 0:q.elem;if(!Y)return;const ee=Y.getBoundingClientRect();L.vertices[0].x-=ee.x-(V instanceof MouseEvent?V.clientX:V.targetTouches[0].clientX)+qe.anchorPoint.size/2,L.vertices[0].y-=ee.y-(V instanceof MouseEvent?V.clientY:V.targetTouches[0].clientY)+qe.anchorPoint.size/2,I(H),D.update()}},U=()=>{L&&r("pointer:up",u.value),L=null},K=o.value;K&&(K.addEventListener("touchstart",z,{passive:!0}),K.addEventListener("touchend",U,{passive:!0}),K.addEventListener("mousedown",z),K.addEventListener("mouseup",U),K.addEventListener("mousemove",O),K.addEventListener("touchmove",O,{passive:!0}))},te=(D,L)=>{r("remove-custom-template",D,L)};return i.onMounted(()=>{o.value&&(c=new pn({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{E()},{deep:!0,immediate:!0}),Z(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(D,L)=>(i.openBlock(),i.createElementBlock("div",gy,[i.createVNode(wd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":L[0]||(L[0]=H=>r("template:select",H)),onInitDrawTemplate:R,onRemoveCustomTemplate:te},null,8,["select-template-index","settings"]),i.createElementVNode("div",py,[i.createElementVNode("div",yy,null,512)])]))}});class Ui extends j.Identity{constructor(n,r){super();T(this,"label","");T(this,"points",[]);T(this,"isCustom",!1);T(this,"id",-1);T(this,"guid","");n?(this.label=n.label,this.points=n.points.map((o,s)=>M.isArray(o)?new _n(o[0],o[1],`A-${s+1}`):new _n(o.width,o.angle,`A-${s+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new _n(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Ls extends Ui{constructor(n){super(n);T(this,"isDefault");this.isDefault=n.isDefault??!1}}class kd{constructor(e){T(this,"minLineWidth");T(this,"maxLineWidth");T(this,"lineWidthStep");T(this,"minLineAngle");T(this,"maxLineAngle");T(this,"lineAngleStep");T(this,"stripMinWidth");T(this,"stripMaxWidth");T(this,"stripMinLength");T(this,"stripMaxLength");T(this,"allowShowTable");T(this,"showOnlyTemplates");T(this,"templates");T(this,"customTemplates",[]);T(this,"startTailConfigs");T(this,"endTailConfigs");T(this,"bendCountForExtended");T(this,"extendedProductCatalog");T(this,"allowChangeFirstPoint");T(this,"allowSaveTemplates");T(this,"userTemplatesPrefix");T(this,"lengthStep");T(this,"canSetDopProdaga");var n,r;this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(o=>new Ui(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(o=>new Ls(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new Ls(o)))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,o])=>o.id!==-1).map(([o,s])=>{const a=new Ui(s);return a.isCustom=!0,a.id=+o,a}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new Ui({label:"-- Новая конфигурация --",points:[new _n(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findLast(o=>!o.isNewRec()),r=new Ui(e);r.isCustom=!0,r.id=n?n.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const n=this.customTemplates.findIndex(r=>r.id===e);n!==-1&&this.customTemplates.splice(n,1)}}const _y={class:"flex flex-col gap-3"},wy={class:"grid gap-5 md:grid-cols-5"},xy={},vd=i.defineComponent({...xy,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.ref(new kd(n.settings)),d=i.ref({linesWidths:[...n.cartItem.configuratorParams.linesWidths],linesAngles:[...n.cartItem.configuratorParams.linesAngles]}),u=i.ref({quantity:{},marker:{},length:{}}),h=i.ref(0),f=i.useTemplateRef("kozyrek-configurator-params-form"),g=(k=0)=>{var R;const B=(R=c.value.allTemplates)==null?void 0:R.at(k);B!==void 0&&(h.value=k,l.value.configuratorParams.linesWidths=B.points.map(E=>M.isArray(E)?E[0]:E.width),l.value.configuratorParams.linesAngles=B.points.map(E=>M.isArray(E)?E[1]:E.angle),C()),y(l.value.configuratorParams)},m=async()=>{const k=prompt("Введите название шаблона:");if(!k)return;a.value=!0;const B={label:k,points:l.value.configuratorParams.linesWidths.map((E,P)=>[E,l.value.configuratorParams.linesAngles[P]])},R=E=>{E&&(c.value.addCustomTemplate(B),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:B,callback:R})},p=async(k,B)=>{var P;const R=(P=c.value.allTemplates)==null?void 0:P.at(k);if(!R||!R.isCustom)return;const E=W=>{W&&(c.value.removeCustomTemplate(R.id),g()),B==null||B()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:R.id,callback:E})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},y=async k=>{var B,R;l.value.product=new j.ClientProduct,(R=(B=f.value)==null?void 0:B.formReference)==null||R.validate(E=>{E||(C(),o.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:k,validationFieldResultData:u.value,callback:P=>{P?l.value.product=P:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},o.value=!1}}))}).catch(M.noop)},_=async()=>{var k,B;(B=(k=f.value)==null?void 0:k.formReference)==null||B.validate(R=>{R||(s.value=!0,r("submit",l.value,u.value,()=>{s.value=!1,i.nextTick(()=>{var E,P;(P=(E=f.value)==null?void 0:E.formReference)==null||P.restoreValidation()})}))}).catch(M.noop)},C=()=>{const k={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach((B,R)=>{k[`lines_widths[${R+1}]`]={},k[`lines_angles[${R+1}]`]={}}),u.value=k},x=k=>{d.value.linesWidths=k.map(B=>B.width),d.value.linesAngles=k.map(B=>B.angle)},N=k=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,C(),b(),y(l.value.configuratorParams)},$=(k,B)=>{d.value.linesWidths=k,d.value.linesAngles=B},w=k=>{const B=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,R=0;l.value.configuratorParams.linesWidths.splice(k+1,0,B),l.value.configuratorParams.linesAngles.splice(k+1,0,R),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],C(),b(),y(l.value.configuratorParams)},v=k=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(k,1),l.value.configuratorParams.linesAngles.splice(k,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],C(),b(),y(l.value.configuratorParams))};return i.onBeforeMount(()=>{g()}),i.watch(()=>n.cartItem,k=>{l.value=new j.OrderItemBase(k),g()}),(k,B)=>{const R=A.NButton;return i.openBlock(),i.createElementBlock("div",_y,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(R,{key:0,type:"tertiary",class:"self-end",onClick:B[0]||(B[0]=E=>r("click:view-switch"))},{default:i.withCtx(()=>[...B[3]||(B[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",wy,[i.createVNode(xd,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":N,"onPointer:move":x,"onTemplate:select":g,onRemoveCustomTemplate:p},null,8,["value","select-template-index","settings"]),i.createVNode(al,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":B[1]||(B[1]=E=>l.value=E),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":s.value,"is-product-searching":o.value,"select-template-index":h.value,class:"col-span-2","onUpdate:params":B[2]||(B[2]=E=>y(E)),"onUpdate:preview":$,onSubmit:_,"onClick:saveTemplate":m,"onClick:addLine":w,"onClick:removeLine":v},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),ky={class:"flex flex-col items-center justify-between rounded-xl"},vy={class:"img-preview relative flex justify-center"},Cy={},Sy=i.defineComponent({...Cy,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(t,{emit:e}){const n=t,r=i.computed(()=>{const{height:s}=n.configuratorParams,a=M.keys(n.settings.crossbarCount).reverse().find(l=>{const c=n.settings.crossbarCount[Number(l)];return s>=c});if(a!==void 0)return String(Number(a)+1)}),o=e;return(s,a)=>{const l=A.NButton;return i.openBlock(),i.createElementBlock("div",ky,[i.createElementVNode("div",vy,[a[1]||(a[1]=i.createElementVNode("div",{class:"window"},null,-1)),i.createElementVNode("div",{class:i.normalizeClass(["net",`net-${t.configuratorParams.netType}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["frame",`frame-${t.configuratorParams.color}`])},null,2),r.value?(i.openBlock(),i.createElementBlock("div",{key:0,class:i.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${t.configuratorParams.color}`])},null,2)):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass(["mount",`mount-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2),i.createElementVNode("div",{class:i.normalizeClass(["cut-preview",`cut-preview-${t.configuratorParams.mountType}-${t.configuratorParams.color}`])},null,2)]),i.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>o("open-instructions"))},{default:i.withCtx(()=>[...a[2]||(a[2]=[i.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Hs=Nn(Sy,[["__scopeId","data-v-a67fd61e"]]),By={key:0,class:"flex items-baseline gap-1"},Ty={key:0,class:"flex items-baseline gap-1"},Ny={key:1},$y={class:"text-lg font-semibold"},Ry={key:2,class:"text-red-500 text-sm mb-2"},Ey={class:"flex gap-3"},Py={},Cd=i.defineComponent({...Py,__name:"mosquito-configurator-form",props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:instructions-toggle","click:show-preview-drawer"],setup(t,{expose:e,emit:n}){var w;const r=t,o=n,s=i.computed(()=>it.isPhoneDevice()),a=i.useTemplateRef("form-reference"),l=i.useTemplateRef("width-form-item-reference"),c=i.useTemplateRef("height-form-item-reference"),d=i.useTemplateRef("width-input-reference"),u=i.ref(M.cloneDeep(r.value)),h=i.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),f=i.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),g=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),m=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),p=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),b=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+f.value:0),y=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(g.value-h.value),ae.step(1),He.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-f.value),ae.max(m.value-f.value),ae.step(1),He.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]})),C=i.computed(()=>{var P;const v=p.value,k=b.value,{quantity:B}=r.value,R=((P=r.value.product)==null?void 0:P.costRub)||0;if(!v||!k||!B||R===0)return null;const E=v*k/1e6;return(R*B*E).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=i.computed(()=>{const v=p.value,k=b.value,B=!!(v&&v>=r.settings.minWidth&&v<=r.settings.maxWidths[u.value.configuratorParams.netType]),R=!!(k&&k>=r.settings.minHeight&&k<=r.settings.maxHeights[u.value.configuratorParams.netType]),E=!!(r.value.quantity&&r.value.quantity>0);return B&&R&&E}),N=(v,k)=>{var E,P;const B=u.value.configuratorParams;v&&v in B&&(B[v]=k);const R={...B,width:p.value??0,height:b.value??0};v==="width"&&((E=l.value)==null||E.validate().catch(M.noop)),v==="height"&&((P=c.value)==null||P.validate().catch(M.noop)),i.nextTick(()=>{var I,Z;!((I=l.value)!=null&&I.validationErrored)&&!((Z=c.value)!=null&&Z.validationErrored)&&R.height&&R.width&&o("update:params",R),$("configuratorParams",R)})},$=(v,k)=>{const B=new j.OrderItemBase(r.value);B[v]=k,v==="configuratorParams"&&(B.product=new j.ClientProduct),o("update:value",B)};return i.watch(()=>r.value,v=>{const k=M.cloneDeep(i.toRaw(v)),B=k.configuratorParams.mountType,R=r.settings.widthOverlaps[B]??0,E=r.settings.heightOverlaps[B]??0;k.configuratorParams.width&&k.configuratorParams.width>0&&(k.configuratorParams.width-=R),k.configuratorParams.height&&k.configuratorParams.height>0&&(k.configuratorParams.height-=E),u.value=k},{deep:!0}),i.onMounted(()=>{var v;(v=d.value)==null||v.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(v,k)=>{const B=A.NCheckbox;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:u.value,rules:_.value,class:"flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message",onKeydown:k[25]||(k[25]=i.withKeys(i.withModifiers(R=>o("submit",u.value),["prevent"]),["enter"]))},{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:u.value.configuratorParams.netType,"onUpdate:value":[k[0]||(k[0]=R=>u.value.configuratorParams.netType=R),k[1]||(k[1]=R=>N("netType",R))],options:t.settings.netType.map(R=>({label:t.settings.descriptions.net_type[R],value:R}))},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:u.value.configuratorParams.color,"onUpdate:value":[k[2]||(k[2]=R=>u.value.configuratorParams.color=R),k[3]||(k[3]=R=>N("color",R))],options:t.settings.color.map(R=>({label:t.settings.descriptions.color[R],value:R}))},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:u.value.configuratorParams.mountType,"onUpdate:value":[k[4]||(k[4]=R=>u.value.configuratorParams.mountType=R),k[5]||(k[5]=R=>N("mountType",R))],options:t.settings.mountType.map(R=>({label:t.settings.descriptions.mount_type[R],value:R}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${g.value?" до "+(g.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&p.value>=t.settings.minWidth&&p.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",By,[i.createVNode(i.unref(A.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(p.value),1)]),_:1}),i.createVNode(i.unref(A.NButton),{quaternary:"",type:"info",size:"tiny",onClick:k[10]||(k[10]=R=>o("click:instructions-toggle"))},{default:i.withCtx(()=>[...k[26]||(k[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[k[6]||(k[6]=R=>u.value.configuratorParams.width=R),k[9]||(k[9]=R=>N("width",R))],parse:i.unref(ot),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:k[7]||(k[7]=R=>i.unref(nt)(R)),onInput:k[8]||(k[8]=R=>i.unref(tt)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-f.value} ${m.value?" до "+(m.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&b.value>=t.settings.minHeight&&b.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Ty,[i.createVNode(i.unref(A.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(b.value),1)]),_:1}),i.createVNode(i.unref(A.NButton),{quaternary:"",type:"info",size:"tiny",onClick:k[15]||(k[15]=R=>o("click:instructions-toggle"))},{default:i.withCtx(()=>[...k[27]||(k[27]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[k[11]||(k[11]=R=>u.value.configuratorParams.height=R),k[14]||(k[14]=R=>N("height",R))],parse:i.unref(ot),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:k[12]||(k[12]=R=>i.unref(nt)(R)),onInput:k[13]||(k[13]=R=>i.unref(tt)(t.validation,"height")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:u.value.quantity,"onUpdate:value":[k[16]||(k[16]=R=>u.value.quantity=R),k[19]||(k[19]=R=>$("quantity",R??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:k[17]||(k[17]=R=>i.unref(nt)(R,!1)),onInput:k[18]||(k[18]=R=>i.unref(tt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:k[20]||(k[20]=R=>i.unref(tt)(t.validation,"marker")),"onUpdate:value":k[21]||(k[21]=R=>{u.value.marker=R??null,$("marker",R??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),y.value?(i.openBlock(),i.createBlock(B,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":k[22]||(k[22]=R=>{u.value.isAdditionalSale=R??!1,$("isAdditionalSale",R??!1)})},{default:i.withCtx(()=>[...k[28]||(k[28]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(ur,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),C.value?(i.openBlock(),i.createElementBlock("div",Ny,[k[29]||(k[29]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",$y,i.toDisplayString(C.value)+" ₽",1)])):i.createCommentVNode("",!0),x.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",Ry," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",Ey,[i.createVNode(i.unref(A.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:k[23]||(k[23]=R=>o("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,type:"default",onClick:k[24]||(k[24]=R=>o("click:show-preview-drawer"))},{default:i.withCtx(()=>[...k[30]||(k[30]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])}}}),Fy="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",Vy="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",My="/img/configurators/mosquitto/measurement-instructions/mount.png",Ay="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",Iy="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Oy={class:"flex flex-col gap-6"},zy={class:"flex gap-4"},Dy={class:"flex flex-col gap-2"},Ly={class:"flex gap-4"},Hy={class:"flex flex-col gap-2"},Wy={class:"flex gap-4"},jy={class:"flex flex-col gap-2"},qy={},Sd=i.defineComponent({...qy,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=it.initRefDependingOnDeviceResolution("small","small","medium"),r=it.initRefDependingOnDeviceResolution(.98,.95,.8),o=i.computed(()=>window.innerWidth*r.value),s=e;return(a,l)=>{const c=A.NText;return i.openBlock(),i.createBlock(i.unref(A.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${o.value}px`),title:"Руководство по замеру","action-class":"grid grid-cols-2 !justify-between",preset:"dialog",onClose:l[0]||(l[0]=d=>s("update:show",!1)),onEsc:l[1]||(l[1]=d=>s("update:show",!1)),onMaskClick:l[2]||(l[2]=d=>s("update:show",!1))},{default:i.withCtx(()=>[i.createElementVNode("div",Oy,[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:Fy,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:Vy,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",zy,[l[9]||(l[9]=i.createElementVNode("img",{src:My,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Dy,[l[8]||(l[8]=i.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),i.createElementVNode("span",null,[l[4]||(l[4]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.frame)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=i.createElementVNode("br",null,null,-1)),l[7]||(l[7]=i.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),i.createElementVNode("div",Ly,[l[15]||(l[15]=i.createElementVNode("img",{src:Ay,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",Hy,[l[14]||(l[14]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),i.createElementVNode("span",null,[l[10]||(l[10]=i.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=i.createElementVNode("br",null,null,-1)),l[13]||(l[13]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),i.createElementVNode("div",Wy,[l[21]||(l[21]=i.createElementVNode("img",{src:Iy,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",jy,[l[20]||(l[20]=i.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),i.createElementVNode("span",null,[l[16]||(l[16]=i.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=i.createElementVNode("br",null,null,-1)),i.createTextVNode(" Ширина светового проема +"+i.toDisplayString(t.widthOverlaps.external_metal)+" мм. Высота светового проема +"+i.toDisplayString(t.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=i.createElementVNode("br",null,null,-1)),l[19]||(l[19]=i.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Xy={class:"grid md:grid-cols-2"},Yy={},Bd=i.defineComponent({...Yy,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>it.isPhoneDevice()),s=i.ref(!1),a=i.ref(!1),l=i.ref(n.cartItem),c=i.useTemplateRef("mosquito-configurator-form"),d=i.ref({width:{},height:{},quantity:{},marker:{}}),u=i.ref(!1),h=i.ref(!1),f=i.computed(()=>i.inject("debounce-input-time",300)),g=M.debounce(async p=>{var b,y;l.value.product=new j.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:p,validationFieldResultData:d.value,callback:C=>{C?l.value.product=C:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(M.noop)},f.value),m=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,p=>{l.value=p},{deep:!0}),(p,b)=>{const y=po;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(Sd,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",Xy,[o.value?(i.openBlock(),i.createBlock(i.unref(A.NDrawer),{key:1,show:s.value,"onUpdate:show":b[4]||(b[4]=_=>s.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:b[2]||(b[2]=_=>s.value=!1)},{default:i.withCtx(()=>[i.createVNode(y)]),_:1})]),default:i.withCtx(()=>[i.createVNode(Hs,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(Hs,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(Cd,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":b[6]||(b[6]=_=>i.unref(g)(_)),onSubmit:b[7]||(b[7]=_=>m()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),Uy={},Td=i.defineComponent({...Uy,__name:"strip-configurator-line-item",props:{value:{},index:{},path:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},validation:{}},emits:["update:value","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useTemplateRef("width-input-element"),a=i.ref(!1),l=i.ref(r.value),c=i.useTemplateRef("form-item-reference"),d=i.computed(()=>{var f;return!((f=c.value)!=null&&f.validationErrored)}),u=f=>{l.value=f,o("update:value",f,r.index,a)},h=()=>{var f;(f=s.value)==null||f.select()};return i.watch(()=>r.value,f=>{l.value=f}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(f,g)=>{const m=sl,p=Hr;return i.openBlock(),i.createBlock(i.unref(A.NFormItem),{ref:"form-item-reference",path:t.path,label:`Полоса №${t.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:i.withCtx(()=>[d.value?(i.openBlock(),i.createBlock(ur,{key:0,"is-product-searching":a.value,product:t.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(A.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(ot),placeholder:"Введите ширину",onKeydown:g[0]||(g[0]=b=>i.unref(nt)(b)),onInput:g[1]||(g[1]=b=>i.unref(tt)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(Le),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(A.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[2]||(g[2]=b=>o("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"]),i.createVNode(i.unref(A.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:g[3]||(g[3]=b=>o("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),Ky={class:"my-2 flex w-full flex-col"},Gy={key:1},Zy={class:"text-lg font-semibold"},Qy={class:"flex gap-3"},Jy={},Nd=i.defineComponent({...Jy,__name:"strip-configurator-form",props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","click:add-line","click:remove-line"],setup(t,{expose:e,emit:n}){var _;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("line-items-reference"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>{const C={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),He.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]};return M.forEach(l.value,(x,N)=>{var $;C[`configuratorParams.linesWidths.${N}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),He.serverValidation(($=r.validation[`linesWidths.${N}`])==null?void 0:$.feedback)]}),C}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((C,x)=>(C??0)+(x??0),0)),h=i.computed(()=>r.settings.width-u.value),f=i.computed(()=>!r.value.some(({product:C})=>!C||C.isNewRec())),g=i.computed(()=>r.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(C=>C.product.isNewRec())),m=i.computed(()=>C=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+C}]),p=i.computed(()=>{const{length:C}=r.value[0];return!C||u.value!==r.settings.width?null:(M.reduce(r.value,(N,$)=>{var v;const w=((v=$.product)==null?void 0:v.costRub)||0;return N+w},0)*r.value[0].quantity*C).toLocaleString("ru-ru",{minimumFractionDigits:2})}),b=(C,x,N)=>{var w,v,k;l.value[x].product.id=-1;const{configuratorParams:$}=l.value[x];$.linesWidths[x]=C,y("configuratorParams",$),(k=(v=(w=a.value)==null?void 0:w.at(x))==null?void 0:v.formItemReference)==null||k.validate().catch(M.noop),i.nextTick(()=>{var B,R;(R=(B=a.value)==null?void 0:B.at(x))!=null&&R.isValid&&o("update:params",$,x,N)})},y=(C,x)=>{l.value.forEach(N=>{N[C]=x}),o("update:value",l.value)};return i.watch(()=>r.value,C=>{l.value=M.cloneDeep(C)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(C,x)=>{const N=A.NCheckbox;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:x[15]||(x[15]=i.withKeys(i.withModifiers($=>o("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>{var $;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(w,v)=>{var k,B;return i.openBlock(),i.createBlock(Td,{key:v,ref_for:!0,ref:"line-items-reference",value:((k=w.configuratorParams)==null?void 0:k.linesWidths.at(v))??null,"auto-focus":!0,index:v,path:`configuratorParams.linesWidths.${v}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":m.value(((B=w.configuratorParams)==null?void 0:B.linesWidths.at(v))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(R=>R.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"onUpdate:value":b,"onClick:addLine":x[0]||(x[0]=R=>o("click:add-line",R)),"onClick:removeLine":x[1]||(x[1]=R=>o("click:remove-line",R))},null,8,["value","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled"])}),128)),i.createElementVNode("div",Ky,[h.value<0?(i.openBlock(),i.createBlock(i.unref(A.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(A.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...x[16]||(x[16]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[x[17]||(x[17]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(A.NText),{type:h.value>=0?"Success":"error"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.value),1)]),_:1},8,["type"]),i.createTextVNode(" из "+i.toDisplayString(t.settings.width)+" мм ",1)])]),i.createVNode(i.unref(A.NButton),{disabled:g.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>o("click:add-line",l.value.length))},{default:i.withCtx(()=>[...x[18]||(x[18]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(A.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>l.value[0].length=w),x[6]||(x[6]=w=>y("length",w))],parse:i.unref(ot),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:x[4]||(x[4]=w=>i.unref(nt)(w,!1)),onInput:x[5]||(x[5]=w=>i.unref(tt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>l.value[0].quantity=w),x[10]||(x[10]=w=>y("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[8]||(x[8]=w=>i.unref(nt)(w,!1)),onInput:x[9]||(x[9]=w=>i.unref(tt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>i.unref(tt)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{l.value[0].marker=w??null,y("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(N,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":x[13]||(x[13]=w=>{l.value[0].isAdditionalSale=w??!1,y("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[...x[19]||(x[19]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),p.value?(i.openBlock(),i.createElementBlock("div",Gy,[x[20]||(x[20]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",Zy,i.toDisplayString(p.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",Qy,[i.createVNode(i.unref(A.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!(($=l.value[0])!=null&&$.length)||l.value[0].length>t.settings.maxLength||l.value[0].length<t.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:x[14]||(x[14]=w=>o("submit",l.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])}}}),e0={class:"flex grow flex-col"},t0=["src"],n0={class:"w-full"},i0={},$d=i.defineComponent({...i0,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",e0,[i.createElementVNode("img",{src:"/img/configurators/strip/strip-"+t.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,t0),i.createElementVNode("div",n0,[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)])]))}}),r0={class:"flex flex-col gap-2"},o0={class:"w-104 flex grow flex-col px-5"},s0={},Rd=i.defineComponent({...s0,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("strip-configurator-form"),s=i.ref(n.cartItems),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.computed(()=>i.inject("debounce-input-time",300)),d=i.computed(()=>{var m;return(m=s.value[0].configuratorParams)==null?void 0:m.linesWidths.reduce((p,b)=>(p??0)+(b??0),0)}),u=m=>{m===void 0&&(m=s.value.length-1);const p=s.value.at(0);if(!p)return;p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(m+1,0,null),s.value.forEach(y=>{y.configuratorParams.linesWidths=p.configuratorParams.linesWidths});const b=new j.OrderItemBase({quantity:(p==null?void 0:p.quantity)??1,category:p==null?void 0:p.category,length:(p==null?void 0:p.length)??n.settings.minLength,marker:p==null?void 0:p.marker,configuratorParams:{linesWidths:p==null?void 0:p.configuratorParams.linesWidths}});s.value=s.value.toSpliced(m+1,0,b)},h=m=>{const p=s.value.at(0);p&&(p.configuratorParams.linesWidths=p.configuratorParams.linesWidths.toSpliced(m,1),s.value.forEach(b=>{b.configuratorParams.linesWidths=p.configuratorParams.linesWidths}),s.value=s.value.toSpliced(m,1),delete a[`linesWidths.${m}`],delete a[`linesWidths.${m}`])},f=M.debounce(async(m,p,b)=>{const y={linesWidths:m.linesWidths.at(p)};b.value=!0,a.value[`linesWidths.${p}`]={},s.value[p].product=new j.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:s.value[p].category,params:y,validationFieldResultData:a.value,callback:_=>{_?(s.value[p].product=_,p===s.value.length-1&&s.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(s.value[p].product=new j.ClientProduct,a.value[`linesWidths.${p}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),g=async()=>{var m,p;(p=(m=o.value)==null?void 0:m.formReference)==null||p.validate(b=>{if(!b){l.value=!0;const y=s.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,C;(C=(_=o.value)==null?void 0:_.formReference)==null||C.restoreValidation()})})}}).catch(M.noop)};return i.watch(()=>n.cartItems,m=>{s.value=m.map(p=>new j.OrderItemBase(p))}),(m,p)=>{const b=A.NButton;return i.openBlock(),i.createElementBlock("div",r0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=y=>r("click:view-switch"))},{default:i.withCtx(()=>[...p[3]||(p[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",o0,[i.createVNode($d,{value:s.value,"onUpdate:value":p[1]||(p[1]=y=>s.value=y),settings:t.settings},null,8,["value","settings"]),i.createVNode(Nd,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":p[2]||(p[2]=y=>s.value=y),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(f),onSubmit:g,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),a0={class:"flex flex-col gap-3"},l0={},Ed=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","submit"],setup(t,{expose:e,emit:n}){var g;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(M.cloneDeep(r.value)),c=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth),...r.settings.maxWidth?[ae.max(r.settings.maxWidth)]:[],ae.step(1),He.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),He.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),He.serverValidation(r.validation.quantity.feedback)],marker:[He.serverValidation(r.validation.marker.feedback)]})),d=i.ref(r.settings.canSetDopProdaga??!1),u=()=>{o("update:params",l.value.configuratorParams),h("configuratorParams",l.value.configuratorParams)},h=(m,p)=>{const b=new j.OrderItemBase(r.value);b[m]=p,m==="configuratorParams"&&(b.product=new j.ClientProduct),o("update:value",b)},f=()=>{var m;(m=a.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=M.cloneDeep(m)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{f()})}),e({validate:(g=s.value)==null?void 0:g.validate,formReference:s}),(m,p)=>{const b=A.NCheckbox;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:p[13]||(p[13]=i.withKeys(i.withModifiers(y=>o("submit",l.value),["prevent"]),["enter"]))},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[p[0]||(p[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:i.unref(ot),"show-button":!1,placeholder:"Введите ширину",onKeydown:p[1]||(p[1]=y=>i.unref(nt)(y)),onInput:p[2]||(p[2]=y=>i.unref(tt)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[p[3]||(p[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:i.unref(ot),"show-button":!1,class:"w-full",onKeydown:p[4]||(p[4]=y=>i.unref(nt)(y)),onInput:p[5]||(p[5]=y=>i.unref(tt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(A.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:p[6]||(p[6]=y=>i.unref(nt)(y,!1)),onInput:p[7]||(p[7]=y=>i.unref(tt)(t.validation,"quantity")),"onUpdate:value":p[8]||(p[8]=y=>h("quantity",y??0)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:p[9]||(p[9]=y=>i.unref(tt)(t.validation,"marker")),"onUpdate:value":p[10]||(p[10]=y=>h("marker",y??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":p[11]||(p[11]=y=>{l.value.isAdditionalSale=y??!1,h("isAdditionalSale",y??!1)})},{default:i.withCtx(()=>[...p[14]||(p[14]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(ur,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",a0,[i.createVNode(i.unref(A.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:p[12]||(p[12]=y=>o("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])}}}),c0={class:"flex flex-col gap-2 w-72"},d0={},Pd=i.defineComponent({...d0,__name:"metal-for-doors-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("metal-for-doors-configurator-form"),s=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{}}),l=i.ref(!1),c=i.ref(!1),d=i.computed(()=>i.inject("debounce-input-time",300)),u=M.debounce(async f=>{var g,m;s.value.product=new j.ClientProduct,(m=(g=o.value)==null?void 0:g.formReference)==null||m.validate(p=>{p||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:b=>{b?s.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(M.noop)},d.value),h=async()=>{var f,g;(g=(f=o.value)==null?void 0:f.formReference)==null||g.validate(m=>{m||(c.value=!0,r("submit",s.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var p,b;(b=(p=o.value)==null?void 0:p.formReference)==null||b.restoreValidation()})}))}).catch(M.noop)};return i.watch(()=>n.cartItem,f=>{s.value=new j.OrderItemBase(f)},{deep:!0}),(f,g)=>{const m=A.NButton;return i.openBlock(),i.createElementBlock("div",c0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[4]||(g[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Ed,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":g[1]||(g[1]=p=>s.value=p),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":g[2]||(g[2]=p=>i.unref(u)(p)),onSubmit:g[3]||(g[3]=p=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),u0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function h0(t,e){return i.openBlock(),i.createElementBlock("svg",u0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const Fd=i.markRaw({name:"ion-add",render:h0}),f0={key:0,class:"-mt-1 text-sm text-gray-500"},m0={class:"font-bold"},g0={class:"flex flex-col gap-3"},p0={key:0,class:"mt-4 flex flex-col gap-1.5"},y0={class:"flex flex-col gap-1 text-sm text-gray-700"},b0={key:0},_0={key:1},w0={"form-array-name":"items",class:"flex flex-col gap-3"},x0={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},k0={key:0,class:"flex flex-wrap items-end gap-2"},v0={class:"whitespace-nowrap text-xl font-bold"},C0={key:0,class:"whitespace-nowrap text-lg text-gray-500"},S0={class:"font-bold"},B0={class:"font-bold"},T0={class:"flex gap-3"},N0={},Vd=i.defineComponent({...N0,__name:"sandwich-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:["update:value","update:params","submit","add-item","remove-item"],setup(t,{expose:e,emit:n}){var L;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.ref(M.cloneDeep(r.value)),l=i.ref({...r.validation}),c=H=>{var z;delete l.value[H],(z=s.value)==null||z.restoreValidation()};i.watch(()=>r.validation,H=>{l.value={...H},Object.values(H).some(O=>O==null?void 0:O.feedback)&&i.nextTick(()=>{var O;return(O=s.value)==null?void 0:O.validate(M.noop).catch(M.noop)})},{deep:!0});const d=i.computed(()=>r.value.category),u=i.ref(null),h=i.ref(null),f=i.computed(()=>d.value.products??[]),g=i.computed(()=>f.value.map(H=>({label:H.name,value:H.id}))),m=(H,z,O)=>{const U=H!=null&&H>0,K=z!=null&&z>0;return!U&&!K?null:U&&K?`от ${H} ${O} до ${z} ${O}`:U?`от ${H} ${O}`:`до ${z} ${O}`},p=i.computed(()=>{var H,z;return m(r.settings.minWidth,(z=(H=u.value)==null?void 0:H.properties)==null?void 0:z.width,"мм")}),b=i.computed(()=>{var H,z;return m(r.settings.minLength,(z=(H=u.value)==null?void 0:H.properties)==null?void 0:z.length,"мм")}),y=i.ref(null),_=i.ref(!1),C=i.computed(()=>{var z;const H={marker:[He.serverValidation((z=l.value.marker)==null?void 0:z.feedback)]};return a.value.configuratorParams.items.forEach((O,U)=>{var K,V,q,Y,ee,ue,ve;H[`configuratorParams.items.${U}.width`]=[ae.required,ae.min(r.settings.minWidth),...(V=(K=u.value)==null?void 0:K.properties)!=null&&V.width?[ae.max(u.value.properties.width)]:[],ae.step(1),He.serverValidation((q=l.value[`items.${U}.width`])==null?void 0:q.feedback)],H[`configuratorParams.items.${U}.length`]=[ae.required,ae.min(r.settings.minLength),...(ee=(Y=u.value)==null?void 0:Y.properties)!=null&&ee.length?[ae.max(u.value.properties.length)]:[],ae.step(1),He.serverValidation((ue=l.value[`items.${U}.length`])==null?void 0:ue.feedback)],H[`configuratorParams.items.${U}.count`]=[ae.required,ae.min(1),ae.step(1),He.serverValidation((ve=l.value[`items.${U}.count`])==null?void 0:ve.feedback)]}),H}),x=i.ref(r.settings.canSetDopProdaga??!1),N=i.computed(()=>a.value.configuratorParams.items.some(H=>{var z,O;return!u.value||!H.width||H.width<r.settings.minWidth||H.width>(((z=u.value.properties)==null?void 0:z.width)??0)||H.length===0||H.length<r.settings.minLength||H.length>(((O=u.value.properties)==null?void 0:O.length)??0)||!H.count||H.count<1})),$=i.computed(()=>!u.value||N.value||a.value.configuratorParams.items.length===0),w=i.ref(null),v=H=>{if(!H){u.value=null,h.value=null,a.value.product=new j.ClientProduct,y.value=null;return}const z=f.value.find(O=>O.id===H);z&&(u.value=z,h.value=H,a.value.product=z,te("product",a.value.product),a.value.configuratorParams.items.forEach(O=>{var U,K;(U=z.properties)!=null&&U.width&&O.width>z.properties.width&&(O.width=z.properties.width),(K=z.properties)!=null&&K.length&&O.length>z.properties.length&&(O.length=z.properties.length)}),B())};let k=!1;const B=()=>{k=!0,y.value=null,w.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},R=async()=>{var H;if(!u.value||a.value.configuratorParams.items.length===0||N.value){B();return}(H=s.value)==null||H.validate(z=>{if(z){B();return}if(_.value=!0,!u.value||!d.value){B(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:a.value.configuratorParams.items},callback:O=>{O?(y.value=O,a.value.configuratorParams.calculationId=O.id,a.value.quantity=O.quantity,i.nextTick(()=>{te("quantity",O.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,B()),te("configuratorParams",a.value.configuratorParams),E(),_.value=!1}})}).catch(()=>{B(),_.value=!1})},E=()=>{var z;if(!((z=u.value)!=null&&z.costRub)||!y.value){w.value=null;return}const H=y.value.quantity*u.value.costRub;w.value=Math.round(H*100)/100},P=H=>{var O,U;const z=a.value.configuratorParams.items[H];u.value&&((O=u.value.properties)!=null&&O.width&&z.width>u.value.properties.width&&(z.width=u.value.properties.width),(U=u.value.properties)!=null&&U.length&&z.length>u.value.properties.length&&(z.length=u.value.properties.length)),te("configuratorParams",a.value.configuratorParams),B()},W=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),te("configuratorParams",a.value.configuratorParams),B(),o("add-item",a.value.configuratorParams.items.length)},I=H=>{a.value.configuratorParams.items.splice(H,1),te("configuratorParams",a.value.configuratorParams),B(),o("remove-item",H)},Z=()=>{if(!($.value||_.value||r.isSubmitProcessing)){if(!y.value){R();return}o("submit",a.value)}},te=(H,z)=>{const O=new j.OrderItemBase(r.value);O[H]=z,o("update:value",O)};i.watch(()=>r.value,H=>{const z=M.cloneDeep(i.toRaw(H));(!z.configuratorParams.items||z.configuratorParams.items.length===0)&&(z.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=z,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,h.value=null),k?k=!1:D()},{deep:!0});const D=()=>{const{calculationId:H}=a.value.configuratorParams,z=a.value.quantity??0;H&&z>0&&a.value.product&&!a.value.product.isNewRec()&&(y.value={id:H,quantity:z,sheets:[]},E())};return i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),D()}),e({validate:(L=s.value)==null?void 0:L.validate,formReference:s}),(H,z)=>{const O=Hr,U=Fd;return i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:a.value,rules:C.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers(Z,["prevent"]),["enter"])},{default:i.withCtx(()=>{var K;return[i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:h.value,"onUpdate:value":[z[0]||(z[0]=V=>h.value=V),v],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((K=u.value)==null?void 0:K.costRub)!=null?(i.openBlock(),i.createElementBlock("div",f0,[i.createElementVNode("span",m0,i.toDisplayString(u.value.code),1),i.createTextVNode(" — "+i.toDisplayString(u.value.costRub.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт. ",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",g0,[u.value?(i.openBlock(),i.createElementBlock("div",p0,[z[7]||(z[7]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",y0,[p.value?(i.openBlock(),i.createElementBlock("div",b0,"Ширина "+i.toDisplayString(p.value)+".",1)):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createElementBlock("div",_0,"Длина "+i.toDisplayString(b.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",w0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(V,q)=>(i.openBlock(),i.createElementBlock("div",{key:q,class:"flex grow gap-2"},[i.createElementVNode("div",x0,[i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.items.${q}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:a.value.configuratorParams.items[q].width,"onUpdate:value":[Y=>a.value.configuratorParams.items[q].width=Y,Y=>P(q)],parse:i.unref(ot),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:z[1]||(z[1]=Y=>i.unref(nt)(Y)),onInput:Y=>c(`items.${q}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.items.${q}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:a.value.configuratorParams.items[q].length,"onUpdate:value":[Y=>a.value.configuratorParams.items[q].length=Y,Y=>P(q)],parse:i.unref(ot),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:z[2]||(z[2]=Y=>i.unref(nt)(Y)),onInput:Y=>c(`items.${q}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`configuratorParams.items.${q}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:a.value.configuratorParams.items[q].count,"onUpdate:value":[Y=>a.value.configuratorParams.items[q].count=Y,Y=>P(q)],parse:i.unref(ot),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:z[3]||(z[3]=Y=>i.unref(nt)(Y,!1)),onInput:Y=>c(`items.${q}.count`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(A.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:Y=>I(q)},{default:i.withCtx(()=>[i.createVNode(O)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:1,disabled:N.value,type:"default",class:"self-center",onClick:W},{default:i.withCtx(()=>[i.createVNode(U),z[8]||(z[8]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),i.createVNode(i.unref(A.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:z[4]||(z[4]=V=>c("marker")),"onUpdate:value":z[5]||(z[5]=V=>te("marker",V??null)),onFocus:i.unref(Le)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(i.openBlock(),i.createBlock(i.unref(A.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":z[6]||(z[6]=V=>{a.value.isAdditionalSale=V??!1,te("isAdditionalSale",V??!1)})},{default:i.withCtx(()=>[...z[9]||(z[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(A.NSpin),{show:_.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var V;return[y.value&&u.value&&w.value?(i.openBlock(),i.createElementBlock("div",k0,[i.createElementVNode("div",null,[z[10]||(z[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",v0,i.toDisplayString(w.value.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol),1)]),y.value.quantity&&u.value?(i.openBlock(),i.createElementBlock("div",C0,[i.createElementVNode("span",S0,"("+i.toDisplayString(y.value.quantity)+" шт.",1),z[11]||(z[11]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",B0,i.toDisplayString((V=u.value.costRub)==null?void 0:V.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",T0,[y.value&&!_.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,loading:t.isSubmitProcessing,disabled:$.value||_.value,type:"primary",class:"self-start",onClick:Z},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:1,loading:_.value,disabled:$.value||_.value,type:"info",class:"self-start",onClick:R},{default:i.withCtx(()=>[...z[12]||(z[12]=[i.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules","onKeydown"])}}}),$0={class:"flex flex-col gap-2"},R0={class:"w-104 flex grow flex-col px-5"},E0={},Md=i.defineComponent({...E0,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:["submit","click:view-switch"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("sandwich-configurator-form"),s=i.ref(n.cartItem),a=i.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=i.ref(!1),c=async()=>{var h,f;(f=(h=o.value)==null?void 0:h.formReference)==null||f.validate(g=>{if(!g){l.value=!0;const m=M.cloneDeep(s.value);"items"in m.configuratorParams&&delete m.configuratorParams.items,r("submit",m,a.value,()=>{l.value=!1,i.nextTick(()=>{var p,b;(b=(p=o.value)==null?void 0:p.formReference)==null||b.restoreValidation()})})}}).catch(M.noop)},d=h=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}},u=h=>{delete a.value[`items.${h}.width`],delete a.value[`items.${h}.length`],delete a.value[`items.${h}.count`]};return i.onMounted(()=>{n.cartItem.configuratorParams.items.forEach((h,f)=>{a.value[`items.${f}.width`]={},a.value[`items.${f}.length`]={},a.value[`items.${f}.count`]={}})}),i.watch(()=>n.cartItem,h=>{s.value=new j.OrderItemBase(h)},{deep:!0}),(h,f)=>{const g=A.NButton;return i.openBlock(),i.createElementBlock("div",$0,[t.settings.allowShowTable&&s.value.isNewRec()?(i.openBlock(),i.createBlock(g,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=m=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[2]||(f[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",R0,[i.createVNode(Vd,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":f[1]||(f[1]=m=>s.value=m),validation:a.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),P0={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function F0(t,e){return i.openBlock(),i.createElementBlock("svg",P0,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1)])])}const V0=i.markRaw({name:"ion-checkmark",render:F0}),M0={key:0,class:"-mt-1 text-sm text-gray-500"},A0={class:"font-bold"},I0={class:"flex flex-col gap-3"},O0={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},z0={class:"flex flex-col gap-1 text-sm text-gray-700"},D0={key:0},L0={key:1},H0={"form-array-name":"items",class:"flex flex-col gap-3"},W0={class:"min-w-0 flex-1"},j0={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},q0={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},X0={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},Y0={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},U0={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},K0={key:0,class:"lg:!flex-[2]"},G0={class:"font-bold"},Z0={key:1,class:"lg:!flex-[3]"},Q0={class:"font-bold"},J0={key:1,class:"min-w-0 flex flex-col items-end gap-1 text-right text-sm text-gray-700 border-t border-gray-200 pt-2"},eb={key:0},tb={class:"font-bold"},nb={key:1},ib={class:"font-bold"},rb={class:"flex flex-wrap items-center gap-3"},ob={},Ad=i.defineComponent({...ob,__name:"sandwich-m2-configurator-form",props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},itemStates:{default:()=>[]}},emits:["submit","update:value","add-item","remove-item","item-reset"],setup(t,{expose:e,emit:n}){var K;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("widthInputs"),l=r.value==null?[]:M.cloneDeep(i.toRaw(r.value)),c=i.ref(l.map(V=>new j.OrderItemBase(V))),d=i.computed(()=>({items:c.value})),u=i.ref({...r.validation}),h=V=>{var q;delete u.value[V],(q=s.value)==null||q.restoreValidation()},f=i.ref(null),g=i.ref(null),m=i.computed(()=>{var V,q;return((q=(V=c.value[0])==null?void 0:V.category)==null?void 0:q.products)??[]}),p=i.computed(()=>m.value.map(V=>({label:V.name,value:V.id}))),b=(V,q,Y)=>{const ee=V!=null&&V>0,ue=q!=null&&q>0;return!ee&&!ue?null:ee&&ue?`от ${V} ${Y} до ${q} ${Y}`:ee?`от ${V} ${Y}`:`до ${q} ${Y}`},y=i.computed(()=>{var V,q;return b(r.settings.minWidth,(q=(V=f.value)==null?void 0:V.properties)==null?void 0:q.width,"мм")}),_=i.computed(()=>{var V,q;return b(r.settings.minLength,(q=(V=f.value)==null?void 0:V.properties)==null?void 0:q.length,"мм")}),C=i.computed(()=>{const V={};return c.value.forEach((q,Y)=>{var ee,ue,ve,Te,We,ce,pt,Ne;V[`items.${Y}.configuratorParams.width`]=[ae.required,ae.min(r.settings.minWidth),...(ue=(ee=f.value)==null?void 0:ee.properties)!=null&&ue.width?[ae.max(f.value.properties.width)]:[],ae.step(1),He.serverValidation((ve=u.value[`items.${Y}.width`])==null?void 0:ve.feedback)],V[`items.${Y}.configuratorParams.length`]=[ae.required,ae.min(r.settings.minLength),...(We=(Te=f.value)==null?void 0:Te.properties)!=null&&We.length?[ae.max(f.value.properties.length)]:[],ae.step(1),He.serverValidation((ce=u.value[`items.${Y}.length`])==null?void 0:ce.feedback)],V[`items.${Y}.quantity`]=[ae.required,ae.min(1),ae.step(1),He.serverValidation((pt=u.value[`items.${Y}.quantity`])==null?void 0:pt.feedback)],V[`items.${Y}.marker`]=[He.serverValidation((Ne=u.value[`items.${Y}.marker`])==null?void 0:Ne.feedback)]}),V});i.watch(()=>r.validation,V=>{u.value={...V},Object.values(V).some(Y=>Y==null?void 0:Y.feedback)&&i.nextTick(()=>{var Y;return(Y=s.value)==null?void 0:Y.validate(M.noop).catch(M.noop)})},{deep:!0});const x=i.ref(r.settings.canSetDopProdaga??!1),N=i.computed(()=>{const V=f.value;return V?c.value.some(q=>{var ve,Te;const Y=q.configuratorParams,ee=(ve=V.properties)==null?void 0:ve.width,ue=(Te=V.properties)==null?void 0:Te.length;return Y.width===0||Y.width<r.settings.minWidth||ee!=null&&Y.width>ee||Y.length===0||Y.length<r.settings.minLength||ue!=null&&Y.length>ue||q.quantity===0||q.quantity<1}):!0}),$=i.computed(()=>!f.value||N.value||c.value.length===0),w=i.computed(()=>{const V=c.value[0];return V!=null&&!V.isNewRec()}),v=V=>r.itemStates[V]??"idle",k=V=>v(V)==="success",B=V=>v(V)==="loading",R=i.computed(()=>c.value.length===0?!0:c.value.every((V,q)=>{const Y=v(q);return Y==="success"||Y==="loading"})),E=V=>V.width===0||V.length===0?0:V.width*V.length/1e6,P=V=>{var ve;const q=V.configuratorParams,Y=E(q),ee=((ve=f.value)==null?void 0:ve.costRub)??0,ue=V.quantity??0;return!Y||!ue?0:Math.round(Y*ee*ue*100)/100},W=i.computed(()=>M.sum(c.value.map(V=>{const q=V.configuratorParams;return!q.width||q.length===0||!V.quantity?0:q.width*q.length*V.quantity/1e6}))),I=i.computed(()=>Math.round(M.sum(c.value.map(V=>P(V)))*100)/100),Z=()=>{var V,q,Y;return new j.OrderItemBase({category:(V=c.value[0])==null?void 0:V.category,configurator:(q=c.value[0])==null?void 0:q.configurator,product:f.value??new j.ClientProduct,quantity:1,isAdditionalSale:(Y=c.value[0])==null?void 0:Y.isAdditionalSale,configuratorParams:{width:0,length:0}})},te=V=>{if(!V){f.value=null,g.value=null,c.value.forEach(Y=>{Y.product=new j.ClientProduct}),o("update:value",c.value);return}const q=m.value.find(Y=>Y.id===V);q&&(f.value=q,g.value=V,c.value.forEach((Y,ee)=>{var ue,ve;Y.product=q,(ue=q.properties)!=null&&ue.width&&Y.configuratorParams.width>q.properties.width&&(Y.configuratorParams.width=q.properties.width),(ve=q.properties)!=null&&ve.length&&Y.configuratorParams.length>q.properties.length&&(Y.configuratorParams.length=q.properties.length),o("item-reset",ee)}),o("update:value",c.value))},D=V=>{var ee,ue;const q=c.value[V],Y=f.value;Y&&((ee=Y.properties)!=null&&ee.width&&q.configuratorParams.width>Y.properties.width&&(q.configuratorParams.width=Y.properties.width),(ue=Y.properties)!=null&&ue.length&&q.configuratorParams.length>Y.properties.length&&(q.configuratorParams.length=Y.properties.length)),o("item-reset",V),o("update:value",c.value)},L=(V,q)=>{c.value[V].marker=q===null||q===""?void 0:q,o("item-reset",V),o("update:value",c.value)},H=V=>{c.value.forEach(q=>{q.isAdditionalSale=V}),o("update:value",c.value)},z=()=>{c.value.push(Z()),o("update:value",c.value),o("add-item",c.value.length),i.nextTick(()=>{var q,Y,ee,ue;const V=c.value.length-1;(Y=(q=a.value)==null?void 0:q[V])==null||Y.focus(),(ue=(ee=a.value)==null?void 0:ee[V])==null||ue.select()})},O=V=>{c.value.splice(V,1),o("update:value",c.value),o("remove-item",V)};i.watch(()=>r.value,V=>{var ue;const Y=(V==null?[]:M.cloneDeep(i.toRaw(V))).map(ve=>new j.OrderItemBase(ve));c.value=Y.length>0?Y:[Z()];const ee=(ue=c.value[0])==null?void 0:ue.product;ee&&!ee.isNewRec()?(f.value=ee,g.value=ee.id):(f.value=null,g.value=null)},{deep:!0});const U=()=>{var q;if(f.value!==null)return;const V=(q=m.value[0])==null?void 0:q.id;V!=null&&te(V)};return i.watch(m,()=>{U()}),i.onMounted(()=>{var q;c.value.length===0&&(c.value=[Z()]);const V=(q=c.value[0])==null?void 0:q.product;V&&!V.isNewRec()&&(f.value=V,g.value=V.id),U()}),e({validate:(K=s.value)==null?void 0:K.validate,formReference:s}),(V,q)=>{const Y=V0,ee=Hr,ue=Fd;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(A.NForm),{ref:"form-reference",model:d.value,rules:C.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var ve,Te;return[i.createVNode(i.unref(A.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NSelect),{value:g.value,"onUpdate:value":[q[0]||(q[0]=We=>g.value=We),te],options:p.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=f.value)==null?void 0:ve.costRub)!=null?(i.openBlock(),i.createElementBlock("div",M0,[i.createElementVNode("span",A0,i.toDisplayString(f.value.code),1),i.createTextVNode(" — "+i.toDisplayString(f.value.costRub.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol)+"/м² ",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",I0,[f.value?(i.openBlock(),i.createElementBlock("div",O0,[q[6]||(q[6]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",z0,[y.value?(i.openBlock(),i.createElementBlock("div",D0,"Ширина "+i.toDisplayString(y.value)+".",1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("div",L0,"Длина "+i.toDisplayString(_.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",H0,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value.items,(We,ce)=>{var pt;return i.openBlock(),i.createElementBlock("div",{key:ce,class:i.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",k(ce)?"opacity-70":""])},[i.createElementVNode("div",W0,[i.createElementVNode("div",j0,[i.createElementVNode("div",q0,[i.createVNode(i.unref(A.NFormItem),{path:`items.${ce}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[ce].configuratorParams.width,"onUpdate:value":[Ne=>d.value.items[ce].configuratorParams.width=Ne,Ne=>D(ce)],parse:i.unref(ot),"show-button":!1,disabled:!f.value||k(ce)||B(ce),placeholder:"Ширина",class:"w-full",onKeydown:q[1]||(q[1]=Ne=>i.unref(nt)(Ne)),onInput:Ne=>h(`items.${ce}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`items.${ce}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:d.value.items[ce].configuratorParams.length,"onUpdate:value":[Ne=>d.value.items[ce].configuratorParams.length=Ne,Ne=>D(ce)],parse:i.unref(ot),"show-button":!1,disabled:!f.value||k(ce)||B(ce),placeholder:"Длина",class:"w-full",onKeydown:q[2]||(q[2]=Ne=>i.unref(nt)(Ne)),onInput:Ne=>h(`items.${ce}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createElementVNode("div",X0,[i.createVNode(i.unref(A.NFormItem),{path:`items.${ce}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:d.value.items[ce].quantity,"onUpdate:value":[Ne=>d.value.items[ce].quantity=Ne,Ne=>D(ce)],parse:i.unref(ot),"show-button":!1,disabled:!f.value||k(ce)||B(ce),placeholder:"Кол-во",class:"w-full",onKeydown:q[3]||(q[3]=Ne=>i.unref(nt)(Ne,!1)),onInput:Ne=>h(`items.${ce}.quantity`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(A.NFormItem),{path:`items.${ce}.marker`,label:"Маркировка",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:d.value.items[ce].marker??null,disabled:!f.value||k(ce)||B(ce),placeholder:"Маркировка",class:"w-full",onInput:Ne=>h(`items.${ce}.marker`),"onUpdate:value":Ne=>L(ce,Ne??null),onFocus:i.unref(Le)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),B(ce)||k(ce)?(i.openBlock(),i.createElementBlock("div",Y0,[B(ce)?(i.openBlock(),i.createBlock(i.unref(A.NSpin),{key:0,size:14})):k(ce)?(i.openBlock(),i.createBlock(Y,{key:1,class:"text-green-600 text-xl"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",U0,[We.configuratorParams.width>0&&We.configuratorParams.length>0?(i.openBlock(),i.createElementBlock("div",K0,[q[7]||(q[7]=i.createTextVNode(" Площадь (S) = ",-1)),i.createElementVNode("span",G0,i.toDisplayString(E(We.configuratorParams).toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),P(We)>0?(i.openBlock(),i.createElementBlock("div",Z0,[q[8]||(q[8]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",Q0,i.toDisplayString(P(We).toLocaleString())+" "+i.toDisplayString((pt=f.value)==null?void 0:pt.currency.symbol),1)])):i.createCommentVNode("",!0)])]),w.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,disabled:B(ce)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:Ne=>O(ce)},{default:i.withCtx(()=>[i.createVNode(ee)]),_:1},8,["disabled","onClick"]))],2)}),128))]),f.value?(i.openBlock(),i.createElementBlock("div",J0,[W.value>0?(i.openBlock(),i.createElementBlock("div",eb,[q[9]||(q[9]=i.createTextVNode(" Общая площадь: ",-1)),i.createElementVNode("span",tb,i.toDisplayString(W.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),I.value>0?(i.openBlock(),i.createElementBlock("div",nb,[q[10]||(q[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",ib,i.toDisplayString(I.value.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),x.value?(i.openBlock(),i.createBlock(i.unref(A.NCheckbox),{key:1,checked:((Te=c.value[0])==null?void 0:Te.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":q[4]||(q[4]=We=>H(We??!1))},{default:i.withCtx(()=>[...q[11]||(q[11]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createElementVNode("div",rb,[f.value&&!w.value?(i.openBlock(),i.createBlock(i.unref(A.NButton),{key:0,disabled:N.value,type:"default",onClick:z},{default:i.withCtx(()=>[i.createVNode(ue),q[12]||(q[12]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(A.NButton),{loading:t.isSubmitProcessing,disabled:$.value||R.value,type:"primary",class:"ml-auto",onClick:q[5]||(q[5]=We=>o("submit",c.value))},{default:i.withCtx(()=>{var We;return[i.createTextVNode(i.toDisplayString((We=c.value[0])!=null&&We.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[i.unref(Ga)]])}}}),sb={class:"flex flex-col gap-2"},ab={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},lb={},Id=i.defineComponent({...lb,__name:"sandwich-m2-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:["click:view-switch","submit"],setup(t,{emit:e}){const n=t,r=e,o=i.useTemplateRef("sandwich-m2-configurator-form"),s=i.ref((n.cartItems??[]).map(C=>new j.OrderItemBase(C))),a=i.ref([]),l=i.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=C=>{c.forEach(x=>{l.value[`items.${C}.${x}`]={}})},u=C=>{c.forEach(x=>{delete l.value[`items.${C}.${x}`]})},h=i.computed(()=>a.value.includes("loading")),f=()=>({width:{},length:{},quantity:{},marker:{}}),g=(C,x)=>{let N=!1;return c.forEach($=>{var E,P;const w=`items.0.${$}`,v=(E=C[$])==null?void 0:E.feedback,B=((P=C[w])==null?void 0:P.feedback)??v,R=`items.${x}.${$}`;B?(l.value[R]=C[w]??C[$],N=!0):l.value[R]={}}),N},m=(C,x,N)=>new Promise($=>{const w=f();let v=!1;const k=B=>{if(v)return;v=!0;const R=g(w,x),E=(B===void 0?!R:B)&&!R;a.value[x]=E?"success":"error",i.nextTick(()=>{var P,W;(W=(P=o.value)==null?void 0:P.formReference)==null||W.restoreValidation()}),$(E)};a.value[x]="loading",r("submit",[M.cloneDeep(C)],w,k,{isFinalSuccessfulCompletion:N})}),p=async()=>{var N,$;try{await(($=(N=o.value)==null?void 0:N.formReference)==null?void 0:$.validate())}catch{return}const C=s.value.map((w,v)=>v).filter(w=>{const v=a.value[w]??"idle";return v!=="success"&&v!=="loading"});let x=!0;for(let w=0;w<C.length;w+=1){const v=C[w],k=s.value[v];if(!k)break;const R=w===C.length-1&&x;await m(k,v,R)||(x=!1)}},b=C=>{const x=C-1;a.value[x]="idle",d(x)},y=C=>{a.value.splice(C,1),u(C);for(let x=C;x<s.value.length;x+=1)d(x)},_=C=>{const x=a.value[C];(x==="success"||x==="error")&&(a.value[C]="idle")};return i.onMounted(()=>{(n.cartItems??[]).forEach((C,x)=>{a.value[x]="idle",d(x)})}),i.watch(()=>n.cartItems,C=>{const x=(C??[]).map(N=>new j.OrderItemBase(N));s.value=x,a.value=x.map(()=>"idle"),x.forEach((N,$)=>{d($)})},{deep:!0}),(C,x)=>{var $;const N=A.NButton;return i.openBlock(),i.createElementBlock("div",sb,[t.settings.allowShowTable&&(($=s.value[0])!=null&&$.isNewRec())?(i.openBlock(),i.createBlock(N,{key:0,type:"tertiary",class:"self-center",onClick:x[0]||(x[0]=w=>r("click:view-switch"))},{default:i.withCtx(()=>[...x[2]||(x[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",ab,[i.createVNode(Ad,{ref:"sandwich-m2-configurator-form",value:s.value,"onUpdate:value":x[1]||(x[1]=w=>s.value=w),validation:l.value,settings:t.settings,"event-emitter":t.eventEmitter,"is-submit-processing":h.value,"item-states":a.value,onSubmit:p,onAddItem:b,onRemoveItem:y,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),cb={key:0,class:"flex justify-center p-4"},db={key:1,class:"p-4 text-center text-red-500"},ub={key:2,class:"flex justify-center"},hb={class:"!bg-white p-4 m-2 rounded-md w-max"},fb={key:3,class:"p-4 text-center text-gray-500"},mb={},Od=i.defineComponent({...mb,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),o=i.ref(e.cartItem??null),s=i.ref(null),a=f=>{const g=f.configuratorParams;return[new j.OrderItemBase({...f,quantity:f.quantity??1,marker:f.marker,configuratorParams:{width:(g==null?void 0:g.width)??f.width??0,length:(g==null?void 0:g.length)??f.length??0}})]},l=i.ref(e.editor===j.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var g,m,p;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:((g=e.cartItem)==null?void 0:g.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const b=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:M.some(b.startTailConfigs,y=>y.isDefault)?(m=b.startTailConfigs)==null?void 0:m.findIndex(y=>y.isDefault):void 0,endTailType:M.some(b.endTailConfigs,y=>y.isDefault)?(p=b.endTailConfigs)==null?void 0:p.findIndex(y=>y.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{const b=e.settings;s.value=[new j.OrderItemBase({...f,length:b.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{width:b.minWidth,length:b.minLength}});break}case"sandwich":{o.value=new j.OrderItemBase({...f,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{l.value=[new j.OrderItemBase({...f,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}o.value&&(o.value.marker=void 0)},d=(f,g,m)=>{const p=b=>{m==null||m(),b&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:p,validation:g})},u=(f,g,m,p)=>{const b=f[0];if(!b){m==null||m();return}const y=(p==null?void 0:p.isFinalSuccessfulCompletion)===!0,_=C=>{m==null||m(C),y&&C&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:b,callback:_,validation:g,additionalParams:p})},h=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{e.cartItem||c()}),(f,g)=>{const m=A.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",cb,[i.createVNode(m,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",db,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),t.settings!==null&&(o.value!==null||s.value!==null||l.value!==null)?(i.openBlock(),i.createElementBlock("div",ub,[i.createElementVNode("div",hb,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(vd,{key:0,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="mosquitto"?(i.openBlock(),i.createBlock(Bd,{key:1,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="strip"?(i.openBlock(),i.createBlock(Rd,{key:2,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":s.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):t.editor==="metal_for_doors"?(i.openBlock(),i.createBlock(Pd,{key:3,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich"?(i.openBlock(),i.createBlock(Md,{key:4,"event-emitter":t.eventEmitter,settings:t.settings,"cart-item":o.value,"onClick:viewSwitch":h,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):t.editor==="sandwich_m2"?(i.openBlock(),i.createBlock(Id,{key:5,"event-emitter":t.eventEmitter,settings:t.settings,"cart-items":l.value,"onClick:viewSwitch":h,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):i.createCommentVNode("",!0)])])):(i.openBlock(),i.createElementBlock("div",fb,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function zd(t){return Object.values(j.ConfiguratorsEnum).includes(t)}function Dd(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==j.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&M.isArray(t.products)&&t.products.length>0}const gb={key:0,class:"pt-0.5"},pb={key:0},yb={class:"line-through"},bb={key:0},_b={key:1},wb={class:"flex flex-row gap-1"},xb={key:0},kb={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},vb={class:"flex flex-col gap-2.5 sm:flex-row"},Cb={class:"mt-2"},Sb={key:1,class:"flex flex-col"},Bb={},Tb=i.defineComponent({...Bb,__name:"category-collapse-item",props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(lr,"medium"),r=i.computed(()=>{var K;return(K=e==null?void 0:e.filteredItems)==null?void 0:K[e.categoryItem.id]}),o=i.computed(()=>{var K,V;return M.isArray((K=e.categoryItem)==null?void 0:K.categories)&&((V=e.categoryItem.categories)==null?void 0:V.length)>0}),s=i.computed(()=>{var K;return M.isArray((K=e.categoryItem)==null?void 0:K.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([K,V])=>`${V} руб./${R(K)}`).join(", ")),l=i.computed(()=>M.isUndefined(e.filteredItems)||r.value==="*"?s.value:s.value.filter(K=>{var q;const V=(q=r.value)==null?void 0:q.products;return M.isArray(V)&&V.includes(K.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>M.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>M.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>M.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),f=i.computed(()=>M.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),g=i.computed(()=>{var K,V,q;return((K=e.categoryItem.properties)==null?void 0:K.configurator)!==void 0&&zd((V=e.categoryItem.properties)==null?void 0:V.configurator)&&Dd(e.categoryItem)&&((q=e.categoryItem.properties)==null?void 0:q.configuratorSettings)!==void 0&&(M.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),m=i.computed(()=>g.value&&(M.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),p=i.computed(()=>M.isNil(e.categoryContextButtonsConfig)?[]:M.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),b=i.computed(()=>new j.ClientCategory(e.categoryItem)),y=i.ref(!1),_=i.ref(!1),C=i.computed(()=>!M.isUndefined(e.isCategoryItemSelected)),x=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),N=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),$=i.computed(()=>M.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=i.computed(()=>z.value&&it.getDeviceTypeByResolution()===Je.laptop?"auto":"fixed"),v=i.useTemplateRef("collapse-item-reference"),k=i.computed(()=>{var K,V;return(V=(K=e.categoryItem.properties)==null?void 0:K.templateCost)==null?void 0:V.priceCoefficient}),B=i.computed(()=>{var K,V;return(V=(K=e.categoryItem.properties)==null?void 0:K.templateCost)==null?void 0:V.increasePercent}),R=(K,V="ru-RU")=>0 .toLocaleString(V,{style:"currency",currency:K,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),E=K=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:K,target:v.value})},P=(K,V)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:V,isLoadingState:y,target:v.value})},W=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:v.value})},I=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:v.value})},Z=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:v.value})},te=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:v.value})},D=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:v.value})},L=K=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:K,target:v.value})},H=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},z=i.ref(0),O=i.computed(()=>z.value&&s.value.length>0?ng(s.value,{eventEmitter:e.eventEmitter,showSlugs:e.showSlugs,showProperties:e.showProperties,showProductCosts:e.showProductCosts,allowNameClick:e.allowNameClick,allowPriceClick:e.allowPriceClick,showPriceHistory:e.showPriceHistory,showCostDate:e.showCostDate,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),U=M.debounce(()=>{z.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",U)}),window.addEventListener("resize",U),U(),(K,V)=>{const q=A.NCheckbox,Y=Mf,ee=A.NTooltip,ue=Pf,ve=A.NTag,Te=$f,We=Bf,ce=A.NButton,pt=vf,Ne=Ja,Vt=Qa,jt=Za,ln=jo,Bt=A.NDropdown,Hn=A.NDataTable,cn=A.NAlert,en=A.NSpin;return i.openBlock(),i.createBlock(el,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":P},{"pre-arrow":i.withCtx(()=>{var Ve,J;return[C.value?(i.openBlock(),i.createElementBlock("div",gb,[i.createVNode(q,{checked:x.value,indeterminate:$.value,disabled:N.value,"onUpdate:checked":E},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Ve=b.value)!=null&&Ve.isDisabled)?(i.openBlock(),i.createBlock(ee,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(Y,{class:"pt-1.5"})]),default:i.withCtx(()=>[V[1]||(V[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((J=b.value)==null?void 0:J.isFavorite)??!1?(i.openBlock(),i.createBlock(ee,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ue,{class:"pt-1.5"})]),default:i.withCtx(()=>[V[2]||(V[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Ve,J,le,De,ni;return[i.createElementVNode("div",{class:i.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":t.categoryItem.isHidden,"text-gray-400":(Ve=b.value)==null?void 0:Ve.isDisabled})},[i.createVNode(ee,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[V[3]||(V[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:V[0]||(V[0]=i.withModifiers((...rt)=>i.unref(M.noop)&&i.unref(M.noop)(...rt),["prevent","stop"]))},[(J=t.categoryItem.properties)!=null&&J.m2Price?(i.openBlock(),i.createBlock(ve,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((le=t.categoryItem.properties)==null?void 0:le.templateCost)&&t.categoryItem.properties.m2PriceRetail&&B.value}),round:""},{default:i.withCtx(()=>{var rt;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(rt=t.categoryItem.properties)!=null&&rt.templateCost&&t.categoryItem.properties.m2PriceRetail&&B.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[B.value?(i.openBlock(),i.createBlock(ve,{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",pb,i.toDisplayString(B.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(ve,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",yb,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"])):(De=t.categoryItem.properties)!=null&&De.templateCost?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[k.value||B.value?(i.openBlock(),i.createBlock(ve,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var rt;return[k.value?(i.openBlock(),i.createElementBlock("span",bb,i.toDisplayString((rt=k.value)==null?void 0:rt.name),1)):i.createCommentVNode("",!0),B.value?(i.openBlock(),i.createElementBlock("span",_b,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(ve,{key:2,size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createTextVNode(" Фиксированный курс: "+i.toDisplayString(a.value),1)]),_:1},8,["size"])):i.createCommentVNode("",!0),u.value&&((ni=b.value)!=null&&ni.manager)?(i.openBlock(),i.createBlock(ve,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:te},{default:i.withCtx(()=>[i.createVNode(ee,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var rt,qt;return[i.createElementVNode("span",wb,[i.createVNode(Te),i.createTextVNode(" "+i.toDisplayString((qt=(rt=b.value)==null?void 0:rt.manager)==null?void 0:qt.name),1)])]}),default:i.withCtx(()=>{var rt,qt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((qt=(rt=b.value)==null?void 0:rt.manager)==null?void 0:qt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",xb,[i.createElementVNode("ul",kb,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ve,J)=>(i.openBlock(),i.createElementBlock("li",{key:J}," ("+i.toDisplayString(J)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.categoryItem.properties,(Ve,J)=>(i.openBlock(),i.createElementBlock("li",{key:J}," ("+i.toDisplayString(J)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Ve;return[i.createElementVNode("div",vb,[d.value?(i.openBlock(),i.createBlock(ee,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),onClick:W},{default:i.withCtx(()=>{var J;return[(J=b.value)!=null&&J.isDisabled?(i.openBlock(),i.createBlock(Y,{key:1})):(i.openBlock(),i.createBlock(We,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var J;return[(J=b.value)!=null&&J.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(b.value.hidingComment?`. Причина: '${b.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),u.value&&!((Ve=b.value)!=null&&Ve.manager)?(i.openBlock(),i.createBlock(ee,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),onClick:Z},{default:i.withCtx(()=>[i.createVNode(pt)]),_:1},8,["size"])]),default:i.withCtx(()=>{var J,le,De;return[(J=b.value)!=null&&J.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(le=b.value)==null?void 0:le.manager)==null?void 0:De.name)??"-")+'"',1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode("Закрепить")],64))]}),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(ee,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:I},{default:i.withCtx(()=>{var J;return[(J=b.value)!=null&&J.isRequired?(i.openBlock(),i.createBlock(Vt,{key:1})):(i.openBlock(),i.createBlock(Ne,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[V[4]||(V[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(ee,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),type:"primary",onClick:D},{default:i.withCtx(()=>[i.createVNode(jt)]),_:1},8,["size"])]),default:i.withCtx(()=>[V[5]||(V[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),p.value.length>0?(i.openBlock(),i.createBlock(Bt,{key:4,options:p.value,size:i.unref(n),trigger:"click",onSelect:L},{default:i.withCtx(()=>[i.createVNode(ce,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(ln)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(K.$slots,"default",{},()=>{var Ve,J,le;return[i.createElementVNode("div",Cb,[o.value?(i.openBlock(),i.createBlock(Hd,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||y.value,"event-emitter":t.eventEmitter,"filtered-items":r.value?((Ve=r.value)==null?void 0:Ve.categories)??{}:void 0,"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["categories-items","has-products","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"])):i.createCommentVNode("",!0)]),g.value&&m.value?(i.openBlock(),i.createBlock(Od,{key:0,"event-emitter":t.eventEmitter,settings:(J=t.categoryItem.properties)==null?void 0:J.configuratorSettings,editor:(le=t.categoryItem.properties)==null?void 0:le.configurator,category:t.categoryItem},null,8,["event-emitter","settings","editor","category"])):c.value?(i.openBlock(),i.createElementBlock("div",Sb,[g.value?(i.openBlock(),i.createBlock(ce,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:H},{default:i.withCtx(()=>[...V[6]||(V[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Hn,{columns:O.value,data:l.value,bordered:!0,loading:y.value,remote:!0,"row-key":De=>De.id,"table-layout":w.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):i.createCommentVNode("",!0),!y.value&&!_.value&&!o.value&&!c.value?(i.openBlock(),i.createBlock(cn,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(cn,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createBlock(en,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...V[7]||(V[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Nb=Nn(Tb,[["__scopeId","data-v-607a5aad"]]),$b={class:"sc-collapse flex w-full flex-col"},Rb={},Ld=i.defineComponent({...Rb,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(t,{emit:e}){const n=t,r=e,o=(s,a)=>{r("on-item-header-click",s,a)};return i.provide("itemHeaderClickHandler",o),i.provide("defaultExpandedNames",n.defaultExpandedNames),i.provide("expandedNames",n.expandedNames),(s,a)=>(i.openBlock(),i.createElementBlock("div",$b,[i.renderSlot(s.$slots,"default")]))}}),Eb={},Hd=i.defineComponent({...Eb,__name:"category-collapse",props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(t){const e=t,n=i.inject(lr,"medium"),r=i.computed(()=>M.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var a;return!!((a=e.filteredItems)!=null&&a[s.id])})),o=(s,a)=>{if(M.isUndefined(a))return;const l=a[s.id];if(l==="*")return;const c={};return c[s.id]=structuredClone(i.toRaw(l)),c};return(s,a)=>{const l=A.NSpin,c=A.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(Ld,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Nb,{key:d.id,"category-item":d,"event-emitter":t.eventEmitter,"filtered-items":o(d,t.filteredItems),"is-category-item-selected":t.isCategoryItemSelected,"show-slugs":t.showSlugs,"show-properties":t.showProperties,"allow-name-click":t.allowNameClick,"allow-price-click":t.allowPriceClick,"show-price-history":t.showPriceHistory,"show-cost-date":t.showCostDate,"show-category-required-button":t.showCategoryRequiredButton,"show-category-hide-for-client-button":t.showCategoryHideForClientButton,"show-category-pin-button":t.showCategoryPinButton,"show-category-edit-button":t.showCategoryEditButton,"category-context-buttons-config":t.categoryContextButtonsConfig,"is-product-item-selected":t.isProductItemSelected,"show-product-add-to-cart-button":t.showProductAddToCartButton,"show-product-costs":t.showProductCosts,"show-product-required-button":t.showProductRequiredButton,"show-product-edit-button":t.showProductEditButton,"product-context-buttons-config":t.productContextButtonsConfig,"show-configurator":t.showConfigurator,"can-show-configurator":t.canShowConfigurator},null,8,["category-item","event-emitter","filtered-items","is-category-item-selected","show-slugs","show-properties","allow-name-click","allow-price-click","show-price-history","show-cost-date","show-category-required-button","show-category-hide-for-client-button","show-category-pin-button","show-category-edit-button","category-context-buttons-config","is-product-item-selected","show-product-add-to-cart-button","show-product-costs","show-product-required-button","show-product-edit-button","product-context-buttons-config","show-configurator","can-show-configurator"]))),128))]),_:1})):t.loading?(i.openBlock(),i.createBlock(l,{key:1,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...a[0]||(a[0]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0),!t.hasProducts&&!t.loading&&t.categoriesItems.length>0&&r.value.length===0?(i.openBlock(),i.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):i.createCommentVNode("",!0)],64)}}}),Pb={},Wd=i.defineComponent({...Pb,__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},disabledItem:{type:Function,default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=new j.Reference,l=i.computed(()=>M.isNil(r.value)?s.value?[]:null:M.isArray(r.value)?r.value.map(g=>g.id):r.value.id),c=i.computed(()=>Tt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue,void 0,r.disabledItem)),d=g=>{var m;if(M.isArray(g)){const p=g.length>0?g.map(b=>{var y;return(y=c.value.find(_=>_.value===b))==null?void 0:y.item}):[];o("update:value",p)}else{const p=g===a.id||M.isNil(g)||(m=c.value.find(b=>b.value===g))==null?void 0:m.item;o("update:value",p)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var g;return(g=u.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=u.value)==null?void 0:g.blur()}}),(g,m)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.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"]))}}),Fb={},Vb=i.defineComponent({...Fb,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{},disabledCoefficient:{type:Function},visibleCoefficient:{type:Function}},emits:["update:value"],setup(t,{emit:e}){var x,N;const n=t,r=e,o=()=>{const $=j.PriceCoefficient.getRetailPriceCoefficient();return M.unset($,"isNewRec"),$},s=$=>!$||$.id===o().id,a=i.computed(()=>{var $;return(($=n.catalogItem)==null?void 0:$.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=$=>{var w,v,k,B;return $.id===o().id?(w=l.value)==null?void 0:w.getRetailCost():(B=(k=(v=l.value)==null?void 0:v.priceCoefficients)==null?void 0:k.find(R=>R.coefficient.id===$.id))==null?void 0:B.cost},d=i.computed(()=>{var v;const w=[...((v=j.useReferencesStore().priceCoefficientsReference)==null?void 0:v.map(k=>structuredClone(i.toRaw(k))))??[],o()].filter(k=>{var B;return((B=n.visibleCoefficient)==null?void 0:B.call(n,k))??!0});return a.value&&w.forEach(k=>{var R;const B=c(k);B?k.name+=` (${B} ${(R=l.value)==null?void 0:R.currency.symbol})`:k.name=""}),w.filter(k=>k.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((N=(x=n.value)==null?void 0:x.value)==null?void 0:N.toString())??null),f=i.ref(null),g=i.computed(()=>{var $,w;return(w=($=l.value)==null?void 0:$.priceCoefficients)==null?void 0:w.find(v=>v.coefficient.slug===j.PriceCoefficientEnum.K0)}),m=i.ref(void 0),p=$=>Number.parseFloat(($??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),b=()=>{var w,v;m.value=void 0;let $=p(h.value);if($=Number.isNaN($)?void 0:$,a.value)if(u.value||h.value){const k=o(),B=c(u.value??k)??0,R=B+B*(($??0)/100);f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(R),R>(((w=l.value)==null?void 0:w.getRetailCost())??R)&&(m.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),g.value&&R<(((v=g.value)==null?void 0:v.cost)??0)&&(m.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else f.value=null;r("update:value",{value:Number.isNaN($)?void 0:$,coefficient:s(u.value)?void 0:structuredClone(i.toRaw(u.value))})},y=$=>{M.isArray($)||M.isNull($)||(u.value=$,h.value=null,!u.value&&h.value&&(u.value=o()),b())},_=()=>{u.value||(u.value=o()),b()},C=$=>{var v,k,B,R,E;const w=p($);if(a.value){let P=0;if(w<=0)u.value=void 0,h.value=null;else if(g.value&&w<(((v=g.value)==null?void 0:v.cost)??0))u.value=(k=g.value)==null?void 0:k.coefficient,P=(w-g.value.cost)*100/g.value.cost,m.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>(((B=l.value)==null?void 0:B.getRetailCost())??w)){u.value=o();const W=((R=l.value)==null?void 0:R.getRetailCost())??0;P=(w-W)*100/W,m.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const W=((E=l.value)==null?void 0:E.priceCoefficients)??[],I=M.sortBy(W,[D=>D.cost]),te=I.filter(D=>D.cost<=w).at(-1)??I.at(0);te&&(u.value=te.coefficient,P=(w-te.cost)*100/te.cost),m.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(P),r("update:value",{value:Number.isNaN(P)?void 0:P,coefficient:s(u.value)?void 0:structuredClone(i.toRaw(u.value))})}else r("update:value",{value:Number.isNaN(w)?void 0:w,coefficient:void 0})};return i.onMounted(()=>{var $,w,v,k;n.calculationType===j.CalculationTypeEnum.m2Cost?f.value=((w=($=n.value)==null?void 0:$.value)==null?void 0:w.toString())??null:!((v=n.value)!=null&&v.coefficient)&&((k=n.value)!=null&&k.value)&&(u.value=o()),b()}),($,w)=>{var B,R,E;const v=A.NInput,k=A.NInputGroup;return i.openBlock(),i.createBlock(i.unref(A.NFormItem),{"show-label":!i.unref(M.isNil)(t.label),label:t.label,"show-feedback":!i.unref(M.isNil)(((B=m.value)==null?void 0:B.feedback)??t.feedback),feedback:((R=m.value)==null?void 0:R.feedback)??t.feedback,"validation-status":((E=m.value)==null?void 0:E.validationStatus)??t.validationStatus},{default:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass([{"sm:grid-cols-3":a.value&&t.calculationType!==i.unref(j.CalculationTypeEnum).m2Cost},"grid w-full grid-cols-1 gap-2"])},[t.calculationType!==i.unref(j.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(k,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(Wd,{class:"w-full min-w-0 flex-1",value:u.value,"reference-list":d.value,clearable:t.clearable,disabled:t.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"disabled-item":t.disabledCoefficient,"onUpdate:value":y},null,8,["value","reference-list","clearable","disabled","disabled-item"]),i.createVNode(v,{value:h.value,"onUpdate:value":[w[0]||(w[0]=P=>h.value=P),_],clearable:t.clearable,disabled:t.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},i.createSlots({suffix:i.withCtx(()=>[w[3]||(w[3]=i.createTextVNode("%",-1))]),_:2},[h.value&&!h.value.startsWith("-")?{name:"prefix",fn:i.withCtx(()=>[w[2]||(w[2]=i.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):i.createCommentVNode("",!0),a.value||t.calculationType===i.unref(j.CalculationTypeEnum).m2Cost?(i.openBlock(),i.createBlock(v,{key:1,value:f.value,"onUpdate:value":[w[1]||(w[1]=P=>f.value=P),C],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var P;return[i.createTextVNode(i.toDisplayString((P=l.value)==null?void 0:P.currency.symbol),1)]}),key:"0"}:void 0]),1032,["value","clearable","disabled"])):i.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),Mb={key:0,class:"flex flex-row gap-2.5"},Ab={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},Ib={},jd=i.defineComponent({...Ib,__name:"base-dialog",props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:"small",scale:.98},tablet:{size:"small",scale:.9},default:{size:"medium",scale:.7}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:"ОК"})},cancelButton:{default:()=>({show:!0,text:"Отмена"})},trapFocus:{type:Boolean,default:!0}},emits:["update:show","opening","closing","accept","processing:cancel"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.show),a=i.ref(r.processing),l=it.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=it.initRefDependingOnDeviceResolution(r.sizes.phone.scale,r.sizes.tablet.scale,r.sizes.default.scale),d=i.computed(()=>r.modalWidth??window.innerWidth*c.value),u=()=>{o("opening"),s.value=!0,o("update:show",s.value)},h=(g="other")=>{if(a.value){o("processing:cancel",y=>{a.value=y});return}let m=!1;o("closing",g,()=>{m=!0}),m||(s.value=!1,o("update:show",s.value))},f=()=>{o("accept",m=>{a.value=m})};return i.watch(()=>r.show,g=>{g?u():h("other")}),i.watch(()=>r.processing,g=>{a.value=g}),e({open:u,close:h,acceptHandler:f}),(g,m)=>{const p=A.NButton,b=A.NModal;return i.openBlock(),i.createBlock(b,{loading:a.value,show:s.value,"show-icon":!1,size:i.unref(l),style:i.normalizeStyle(`width: ${d.value}px`),title:t.title,"trap-focus":t.trapFocus??!0,"action-class":g.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:m[1]||(m[1]=y=>h("header")),onEsc:m[2]||(m[2]=y=>h("esc")),onMaskClick:m[3]||(m[3]=y=>h("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(g.$slots,"default")]),_:2},[g.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(g.$slots,"header")]),key:"0"}:void 0,g.$slots.action||g.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[g.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",Mb,[i.renderSlot(g.$slots,"extra-action")])):i.createCommentVNode("",!0),g.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",Ab,[i.renderSlot(g.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(p,{key:0,disabled:a.value||!t.valid,size:i.unref(l),type:"primary",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(p,{key:1,size:i.unref(l),type:"default",onClick:m[0]||(m[0]=y=>h("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),Ob={class:"text-sm"},zb={},Db=i.defineComponent({...zb,__name:"add-product-to-cart-dialog",emits:["submit"],setup(t,{expose:e,emit:n}){const r=i.useTemplateRef("form-reference"),o=i.useTemplateRef("base-dialog-reference"),s=i.ref(null),a=i.computed(()=>{var w,v,k;return((w=s.value)==null?void 0:w.unit.isLinear)&&((k=(v=s.value)==null?void 0:v.properties)==null?void 0:k.isLengthConfigurator)}),l=i.ref(void 0),c=i.ref(void 0),d=i.ref(!0),u=i.ref(null),h=n,f=()=>({length:{},quantity:{},marker:{}}),g=i.ref(f()),m=i.ref(!1),p=i.computed(()=>{var R,E,P,W;if(!s.value)return{};const w=j.UnitsHelper.getProductLengthMultiplicity(s.value),v=j.UnitsHelper.getProductMultiplicity(s.value),k=((E=(R=s.value)==null?void 0:R.properties)==null?void 0:E.minLength)||w,B=(W=(P=s.value)==null?void 0:P.properties)==null?void 0:W.maxLength;return{length:[ae.required,ae.min(k??.1),ae.max(B),ae.step(w),He.serverValidation(g.value.length.feedback)],quantity:[ae.required,ae.min(v),ae.step(v),He.serverValidation(g.value.quantity.feedback)],marker:[He.serverValidation(g.value.marker.feedback)]}}),b=i.computed(()=>{var w,v,k;return s.value?((w=s.value.properties)==null?void 0:w.lengthStep)??((v=s.value.properties)!=null&&v.ignoreMinCountCheck?0:((k=s.value.properties)==null?void 0:k.minCount)??0):0}),y=i.computed(()=>{var k,B,R,E,P,W,I,Z,te;if(!s.value)return"";const w=((B=(k=s.value)==null?void 0:k.properties)==null?void 0:B.minLength)??((E=(R=s.value)==null?void 0:R.properties)!=null&&E.ignoreMinCountCheck?0:(W=(P=s.value)==null?void 0:P.properties)==null?void 0:W.minCount),v=(Z=(I=s.value)==null?void 0:I.properties)==null?void 0:Z.maxLength;return w||v?`(${w?`от ${w}`:""}${w&&v?" ":""}${v?`до ${v}`:""} ${(te=s.value)==null?void 0:te.unit.name})`:""}),_=w=>{var E,P;if(!((P=(E=s.value)==null?void 0:E.properties)!=null&&P.isLengthConfigurator)||!u.value||M.isNil(w)||b.value===0)return;const v=w/b.value,k=Math.round(v),B=j.UnitsHelper.getProductMultiplicity(s.value),R=Math.max(k,B);u.value.quantity=R},C=w=>{var R,E,P,W;if(!((E=(R=s.value)==null?void 0:R.properties)!=null&&E.isLengthConfigurator)||!u.value||M.isNil(w)||b.value===0)return;const v=w*b.value,k=((P=s.value.properties)==null?void 0:P.minLength)||j.UnitsHelper.getProductLengthMultiplicity(s.value),B=(W=s.value.properties)==null?void 0:W.maxLength;k!==void 0&&v<k?u.value.length=k:B!==void 0&&v>B?u.value.length=B:u.value.length=v},x=async w=>{var k;const v=M.cloneDeep(u.value);try{await((k=r.value)==null?void 0:k.validate(B=>{if(!B){if(!s.value||!v)return;j.UnitsHelper.productIsMeasurable(s.value)||delete v.length,a.value&&b.value&&(v.length=b.value),m.value=!0,h("submit",v,g.value,()=>{m.value=!1,w(!1),i.nextTick(()=>{var R;(R=r.value)==null||R.validate(M.noop).catch(M.noop)})})}}))}catch{}},N=()=>{s.value=null,l.value=void 0,u.value=null,g.value=f()};return e({show:(w,v)=>{var k,B,R,E,P;if(s.value=w,l.value=v==null?void 0:v.cartItemData,c.value=v==null?void 0:v.orderId,d.value=(v==null?void 0:v.canSetDopProdaga)??!1,u.value=new j.OrderItemBase((v==null?void 0:v.cartItemData)??new j.OrderItemBase({product:w,quantity:j.UnitsHelper.productIsMeasurable(s.value)?1:((k=w==null?void 0:w.properties)==null?void 0:k.minCount)??1,length:((B=w==null?void 0:w.properties)==null?void 0:B.minLength)||((R=w==null?void 0:w.properties)!=null&&R.ignoreMinCountCheck?0:(E=w==null?void 0:w.properties)==null?void 0:E.minCount)||0})),(P=w==null?void 0:w.properties)!=null&&P.isLengthConfigurator&&u.value&&b.value>0){const W=b.value,I=u.value.quantity||1;u.value.length=I*W}},closeDialog:N}),(w,v)=>{var P;const k=A.NFormItem,B=A.NInputGroupLabel,R=A.NInputGroup,E=A.NCheckbox;return i.openBlock(),i.createBlock(jd,{ref:"base-dialog-reference",show:!i.unref(M.isNil)(s.value)&&!i.unref(M.isNil)(u.value),title:`${l.value?"Изменение":"Добавление"} товара ${(P=s.value)==null?void 0:P.name} в ${c.value?` заказ №${c.value}`:"корзину"}`,"accept-button":{show:!0,text:l.value?"Изменить":"Добавить"},processing:m.value,"modal-width":500,onAccept:x,onClosing:N},{default:i.withCtx(()=>{var W;return[s.value&&u.value?(i.openBlock(),i.createBlock(i.unref(A.NForm),{key:0,ref:"form-reference",model:u.value,rules:p.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message",onKeydown:i.withKeys(i.withModifiers((W=o.value)==null?void 0:W.acceptHandler,["prevent"]),["enter"])},{default:i.withCtx(()=>[i.unref(j.UnitsHelper).productIsMeasurable(s.value)?(i.openBlock(),i.createBlock(k,{key:0,path:"length",label:`Метраж, ${y.value+s.value.unit.name}`},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:u.value.length,"onUpdate:value":[v[0]||(v[0]=I=>u.value.length=I),_],parse:i.unref(ot),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:v[1]||(v[1]=I=>i.unref(zr)(I,".",!1)),onInput:v[2]||(v[2]=I=>i.unref(tt)(g.value,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"])):i.createCommentVNode("",!0),i.createVNode(k,{path:"quantity",label:"Количество, шт."},{default:i.withCtx(()=>[i.createVNode(R,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(A.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[3]||(v[3]=I=>u.value.quantity=I),C],parse:i.unref(ot),step:i.unref(j.UnitsHelper).getProductMultiplicity(s.value),"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[4]||(v[4]=I=>i.unref(zr)(I,".",!1)),onInput:v[5]||(v[5]=I=>i.unref(tt)(g.value,"quantity")),onFocus:i.unref(Le)},null,8,["value","parse","step","onFocus"]),a.value?(i.openBlock(),i.createBlock(B,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(b.value)+" "+i.toDisplayString(s.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!g.value.quantity.feedback&&i.unref(j.UnitsHelper).getProductMultiplicity(s.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",Ob,"Количество должно быть кратно "+i.toDisplayString(i.unref(j.UnitsHelper).getProductMultiplicity(s.value)),1)]),key:"0"}:void 0]),1024)]),_:1}),i.unref(j.UnitsHelper).productIsMeasurable(s.value)?(i.openBlock(),i.createBlock(k,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[6]||(v[6]=I=>i.unref(tt)(g.value,"marker")),"onUpdate:value":v[7]||(v[7]=I=>u.value.marker=I??null),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),d.value?(i.openBlock(),i.createBlock(E,{key:2,checked:u.value.isAdditionalSale,"onUpdate:checked":v[8]||(v[8]=I=>u.value.isAdditionalSale=I),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...v[9]||(v[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules","onKeydown"])):i.createCommentVNode("",!0)]}),_:1},8,["show","title","accept-button","processing"])}}}),Lb={class:"flex flex-row gap-1"},Hb={class:"sc-client-name flex flex-col gap-1 text-base"},Wb=["href"],jb={key:1,class:"text-sc-grey"},qb={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Xb={key:0},Yb={key:1,class:"text-sm"},Ub={},br=i.defineComponent({...Ub,__name:"client-name-with-short-info",props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:["click:client-name","click:client-info"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>n.client.lastLoginAt?je.format(n.client.lastLoginAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=a=>{M.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=qo,d=A.NButton,u=A.NPopover;return i.openBlock(),i.createElementBlock("div",Lb,[t.showClientInfoIcon?(i.openBlock(),i.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=h=>a.$emit("click:client-info",t.client))},{default:i.withCtx(()=>[i.createVNode(c)]),_:1})):i.createCommentVNode("",!0),i.createVNode(u,{disabled:i.unref(M.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",Hb,[i.createElementVNode("a",{href:t.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=h=>s(h))},[i.createElementVNode("span",{class:i.normalizeClass({"line-through":!t.client.isActive})},i.toDisplayString(t.client.name),3),t.showSalesDirection&&t.client.salesDirection?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"line-through":!t.client.isActive})}," ("+i.toDisplayString(t.client.salesDirection.name)+") ",3)):i.createCommentVNode("",!0),t.client.isActive?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",jb," [ Деактивирован ] "))],8,Wb),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",qb," г. "+i.toDisplayString(t.client.city.name)+", "+i.toDisplayString(t.client.city.region.name),1)):i.createCommentVNode("",!0)])]),default:i.withCtx(()=>[t.client.alternativeName?(i.openBlock(),i.createElementBlock("div",Xb,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("span",Yb," Последний вход: "+i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Kb={class:"text-base"},Gb={},qd=i.defineComponent({...Gb,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("span",Kb,i.toDisplayString(t.contragent.name),1))}}),Zb={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Qb(t,e){return i.openBlock(),i.createElementBlock("svg",Zb,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}),i.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const Jb=i.markRaw({name:"tabler-mail",render:Qb}),e_=["href"],t_={},n_=i.defineComponent({...t_,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=Jb;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,e_)],2)}}}),i_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function r_(t,e){return i.openBlock(),i.createElementBlock("svg",i_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6"},null,-1)])])}const Xd=i.markRaw({name:"fa6-brands-viber",render:r_}),o_={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},s_=["id"],a_=["id"],l_=["fill"],c_=["fill"];function d_(t,e){return i.openBlock(),i.createElementBlock("svg",o_,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,s_),i.createElementVNode("linearGradient",{id:t.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,a_)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGBRLHCcSy+")",d:"M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004"},null,8,l_),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGHW6lecxh+")",d:"M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z"},null,8,c_),e[2]||(e[2]=i.createElementVNode("path",{fill:"#FFF",d:"M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64"},null,-1))])}const Yd=i.markRaw({name:"logos-whatsapp-icon",render:d_,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),u_={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},h_=["id"],f_=["fill"];function m_(t,e){return i.openBlock(),i.createElementBlock("svg",u_,[i.createElementVNode("defs",null,[i.createElementVNode("linearGradient",{id:t.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[i.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),i.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,h_)]),i.createElementVNode("path",{fill:"url(#"+t.idMap.SVGuySfwdaH+")",d:"M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0"},null,8,f_),e[1]||(e[1]=i.createElementVNode("path",{fill:"#FFF",d:"M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072"},null,-1))])}const Ud=i.markRaw({name:"logos-telegram",render:m_,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),g_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function p_(t,e){return i.openBlock(),i.createElementBlock("svg",g_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480"},null,-1)])])}const Kd=i.markRaw({name:"ion-call",render:p_}),y_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function b_(t,e){return i.openBlock(),i.createElementBlock("svg",y_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"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 __=i.markRaw({name:"tabler-phone-call",render:b_}),w_={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},x_=["href"],k_=["href"],v_=["href"],C_=["href"],S_={},B_=i.defineComponent({...S_,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?or.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return M.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),o=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),s=i.computed(()=>{var l;return M.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=__,u=Kd,h=Ud,f=Yd,g=Xd;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]=m=>a.value=!a.value),onFocusout:c[1]||(c[1]=m=>a.value=!1),onMouseleave:c[2]||(c[2]=m=>a.value=!1)},[i.createElementVNode("div",{class:i.normalizeClass({"flex flex-row items-center gap-1":t.showPhoneIcon})},[t.showPhoneIcon?(i.openBlock(),i.createBlock(d,{key:0})):i.createCommentVNode("",!0),i.createTextVNode(" "+i.toDisplayString(o.value),1)],2),r.value&&a.value?(i.openBlock(),i.createElementBlock("div",w_,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${s.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[i.createVNode(u)],8,x_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${s.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(h)],8,k_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${s.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[i.createVNode(f)],8,v_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${s.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[i.createVNode(g)],8,C_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),T_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function N_(t,e){return i.openBlock(),i.createElementBlock("svg",T_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2"},null,-1)])])}const $_=i.markRaw({name:"mdi-envelope",render:N_}),R_={class:"flex flex-col gap-1"},E_={key:0,class:"mb-2 flex flex-col text-base"},P_={key:0,class:"text-sc-dark-grey text-sm"},F_={key:1,class:"whitespace-nowrap text-sm"},V_={key:2,class:"whitespace-nowrap text-sm"},M_={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},A_=["href"],I_=["href"],O_=["href"],z_=["href"],D_=["href"],L_={key:0,class:"flex flex-col text-base"},H_={key:0,class:"text-sc-dark-grey text-sm"},W_={key:1,class:"mt-2 text-sm"},j_={key:0,class:"-mt-1"},q_={},X_=i.defineComponent({...q_,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(t){const e=t,n=i.computed(()=>{try{return e.contact.phone?or.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),r=i.computed(()=>{var c;return M.isString(n.value)?!1:((c=n.value)==null?void 0:c.isValid())??!1}),o=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("INTERNATIONAL"))??""}),s=i.computed(()=>{var c;return M.isString(n.value)?n.value:((c=n.value)==null?void 0:c.format("E.164"))??""}),a=i.computed(()=>r.value||e.contact.email),l=i.ref(!1);return(c,d)=>{var b,y;const u=Kd,h=Ud,f=Yd,g=Xd,m=$_,p=A.NPopover;return i.openBlock(),i.createElementBlock("div",R_,[i.createVNode(p,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var _,C,x,N;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(_=t.contact)!=null&&_.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:d[0]||(d[0]=$=>l.value=!0),onFocusin:d[1]||(d[1]=$=>l.value=!0),onMouseleave:d[2]||(d[2]=$=>l.value=!1),onFocusout:d[3]||(d[3]=$=>l.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(C=t.contact)!=null&&C.position)?(i.openBlock(),i.createElementBlock("div",E_,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(x=t.contact)!=null&&x.position?(i.openBlock(),i.createElementBlock("span",P_,i.toDisplayString((N=t.contact)==null?void 0:N.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),t.contact.phone?(i.openBlock(),i.createElementBlock("div",F_,i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",V_,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),a.value&&l.value?(i.openBlock(),i.createElementBlock("div",M_,[r.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${s.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(u)],8,A_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${s.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(h)],8,I_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${s.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(f)],8,O_)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${s.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(g)],8,z_)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(m)],8,D_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var _,C,x,N;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",L_,[i.createTextVNode(i.toDisplayString(t.contact.name)+" ",1),(_=t.contact)!=null&&_.position?(i.openBlock(),i.createElementBlock("span",H_,i.toDisplayString((C=t.contact)==null?void 0:C.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(x=t.contact)!=null&&x.comment?(i.openBlock(),i.createElementBlock("div",W_,[d[4]||(d[4]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((N=t.contact)==null?void 0:N.comment),1)])):i.createCommentVNode("",!0)]}),_:1},8,["disabled"]),t.fullView&&((b=t.contact)!=null&&b.comment)?(i.openBlock(),i.createElementBlock("div",j_,[d[5]||(d[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((y=t.contact)==null?void 0:y.comment),1)])):i.createCommentVNode("",!0)])}}});class Y_{constructor(e){T(this,"minHeight");T(this,"maxHeights");T(this,"minWidth");T(this,"maxWidths");T(this,"netType");T(this,"color");T(this,"mountType");T(this,"descriptions");T(this,"crossbarCount");T(this,"heightOverlaps");T(this,"widthOverlaps");T(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Wo.objectToSnake(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=Wo.objectToSnake(e.heightOverlaps),this.widthOverlaps=Wo.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function U_(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==j.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&M.isArray(t.products)&&t.products.length>0}const K_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G_(t,e){return i.openBlock(),i.createElementBlock("svg",K_,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M16 12a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2"},null,-1)])])}const Z_=i.markRaw({name:"mdi-dots-horizontal",render:G_}),Gd="date-range.dialog.mode",Zd=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Qd=(t,e,n)=>{let r=t??void 0,o=e??void 0;return r&&o&&r>o&&(n!=null&&n.from?o=r:n!=null&&n.to?r=o:[r,o]=[o,r]),{from:r?je.startOfDay(r):void 0,to:o?je.endOfDay(o):void 0}},Q_={class:"text-center font-semibold"},J_={class:"grid grid-cols-3 gap-1"},e1=["onPointerdown","onPointerenter","onKeydown"],t1={},n1=i.defineComponent({...t1,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=A.useThemeVars(),s=i.computed(()=>({"--sc-primary-color":o.value.primaryColor,"--sc-primary-color-hover":o.value.primaryColorHover,"--sc-primary-color-suppl":o.value.primaryColorSuppl,"--sc-hover-color":o.value.hoverColor})),a=w=>{const v=new Date().getFullYear();return w&&je.isValid(w)?w.getFullYear():v},l=i.ref(a(n.from??n.to)),c=it.initRefDependingOnDeviceResolution(1,3,3),d=i.computed(()=>c.value===1?[l.value]:[l.value-1,l.value,l.value+1]),u=i.ref(null),h=i.ref(null),f=i.ref(!1),g=i.ref(null),m=i.computed(()=>{const{from:w,to:v}=n;return!w||!v||!je.isSameDay(w,je.startOfMonth(w))||!je.isSameDay(v,je.endOfMonth(v))?null:[w.getFullYear()*12+w.getMonth(),v.getFullYear()*12+v.getMonth()]}),p=i.computed(()=>f.value&&h.value!==null&&g.value!==null?b(h.value,g.value):u.value!==null?g.value===null?[u.value,u.value]:b(u.value,g.value):m.value),b=(w,v)=>w<=v?[w,v]:[v,w],y=(w,v)=>{const k=w*12+v,B=p.value;return B&&k>=B[0]&&k<=B[1]?[k===B[0]||k===B[1]?"sc-month--bound":"sc-month--in-range"]:[]},_=(w,v)=>{const[k,B]=b(w,v);u.value=null,r("select",{from:new Date(Math.floor(k/12),k%12,1),to:je.endOfMonth(new Date(Math.floor(B/12),B%12,1))})},C=w=>{u.value===null?(u.value=w,r("select",{from:new Date(Math.floor(w/12),w%12,1),to:je.endOfMonth(new Date(Math.floor(w/12),w%12,1))})):_(u.value,w)},x=()=>{globalThis.removeEventListener("pointerup",x);const w=h.value;if(w!==null){if(h.value=null,f.value){f.value=!1,g.value!==null&&_(w,g.value);return}C(w)}},N=(w,v)=>{h.value=w*12+v,f.value=!1,globalThis.addEventListener("pointerup",x)},$=(w,v)=>{const k=w*12+v;g.value=k,h.value!==null&&k!==h.value&&(f.value=!0)};return i.watch(()=>[n.from,n.to],()=>{const w=n.from??n.to;if(!w||!je.isValid(w))return;const v=w.getFullYear();(v<l.value-1||v>l.value+1)&&(l.value=v)}),i.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",x)}),(w,v)=>{const k=A.NButton;return i.openBlock(),i.createElementBlock("div",{class:"flex select-none items-start gap-2",style:i.normalizeStyle(s.value),onPointerleave:v[2]||(v[2]=B=>g.value=null)},[i.createVNode(k,{size:"small",quaternary:"",class:"mt-5",onClick:v[0]||(v[0]=B=>l.value-=1)},{default:i.withCtx(()=>[...v[3]||(v[3]=[i.createTextVNode(" ‹ ",-1)])]),_:1}),i.createElementVNode("div",{class:i.normalizeClass(["grid flex-1 gap-4 sm:gap-8",d.value.length===1?"grid-cols-1":"grid-cols-3"])},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value,B=>(i.openBlock(),i.createElementBlock("div",{key:B,class:"flex flex-col gap-1"},[i.createElementVNode("div",Q_,i.toDisplayString(B),1),i.createElementVNode("div",J_,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Zd),(R,E)=>(i.openBlock(),i.createElementBlock("button",{key:R,type:"button",class:i.normalizeClass(["sc-month cursor-pointer rounded border-0 px-1 py-1 text-sm",y(B,E)]),onPointerdown:i.withModifiers(P=>N(B,E),["prevent"]),onPointerenter:P=>$(B,E),onKeydown:[i.withKeys(i.withModifiers(P=>C(B*12+E),["prevent"]),["enter"]),i.withKeys(i.withModifiers(P=>C(B*12+E),["prevent"]),["space"])]},i.toDisplayString(R),43,e1))),128))])]))),128))],2),i.createVNode(k,{size:"small",quaternary:"",class:"mt-5",onClick:v[1]||(v[1]=B=>l.value+=1)},{default:i.withCtx(()=>[...v[4]||(v[4]=[i.createTextVNode(" › ",-1)])]),_:1})],36)}}}),i1=Nn(n1,[["__scopeId","data-v-7dd4941e"]]),r1={class:"sc-date-range-sidebar flex flex-col gap-1"},o1={class:"flex items-center justify-center gap-1"},s1={class:"min-w-12 text-center font-semibold"},a1={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},l1={},c1=i.defineComponent({...l1,__name:"month-year-sidebar",props:{year:{},month:{}},emits:["update:year","select-month","today"],setup(t,{emit:e}){const n=e;return(r,o)=>{const s=A.NButton;return i.openBlock(),i.createElementBlock("div",r1,[i.createElementVNode("div",o1,[i.createVNode(s,{size:"small",quaternary:"",onClick:o[0]||(o[0]=a=>n("update:year",t.year-1))},{default:i.withCtx(()=>[...o[3]||(o[3]=[i.createTextVNode(" ‹ ",-1)])]),_:1}),i.createElementVNode("span",s1,i.toDisplayString(t.year),1),i.createVNode(s,{size:"small",quaternary:"",onClick:o[1]||(o[1]=a=>n("update:year",t.year+1))},{default:i.withCtx(()=>[...o[4]||(o[4]=[i.createTextVNode(" › ",-1)])]),_:1})]),i.createElementVNode("div",a1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref(Zd),(a,l)=>(i.openBlock(),i.createBlock(s,{key:a,size:"small",quaternary:"",type:l===t.month?"primary":"default",onClick:c=>n("select-month",l)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a),1)]),_:2},1032,["type","onClick"]))),128))]),i.createVNode(s,{size:"small",text:"",type:"info",onClick:o[2]||(o[2]=a=>n("today"))},{default:i.withCtx(()=>[...o[5]||(o[5]=[i.createTextVNode(" Сегодня ",-1)])]),_:1})])}}}),d1={},Jd=i.defineComponent({...d1,__name:"date-range-input",props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>j.useBaseConfigStateStore().config.dateFormats.uiDate}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=it.initRefDependingOnDeviceResolution(!0,!1,!1),s=i.ref(null),a=i.ref(!1),l=i.ref(0),c=i.ref(new Date),d=i.computed(()=>{const C=n.value&&je.isValid(n.value)?n.value:c.value;return C.getFullYear()===c.value.getFullYear()?C.getMonth():null});let u=0;const h=C=>{var x,N;(N=(x=C.target)==null?void 0:x.closest)!=null&&N.call(x,".n-base-clear")&&(u=performance.now())},f=C=>{C&&performance.now()-u<300||(a.value=C,C&&(c.value=n.value&&je.isValid(n.value)?n.value:new Date))},g=C=>{r("update:value",C===null?null:new Date(C))},m=(C,x)=>{const N=new Date(C,x,1);if(c.value=N,n.value&&je.isValid(n.value)){const $=Math.min(je.getDate(n.value),je.getDaysInMonth(N));r("update:value",new Date(C,x,$));return}l.value+=1,i.nextTick().then(()=>{var $;return($=s.value)==null?void 0:$.focus()})},p=(C,x)=>{c.value=je.addYears(je.addMonths(c.value,C),x)},b=C=>{m(C,c.value.getMonth())},y=C=>{m(c.value.getFullYear(),C)},_=()=>{a.value=!1,r("update:value",new Date)};return(C,x)=>{const N=A.NButton,$=A.NDatePicker;return i.openBlock(),i.createBlock($,{ref_key:"pickerReference",ref:s,key:l.value,value:n.value?n.value.getTime():null,show:a.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,format:t.dateFormat,actions:[],"default-calendar-start-time":c.value.getTime(),type:"date",class:"w-full min-w-0",onMousedownCapture:h,"onUpdate:show":f,"onUpdate:value":g,onNextMonth:x[0]||(x[0]=w=>p(1,0)),onPrevMonth:x[1]||(x[1]=w=>p(-1,0)),onNextYear:x[2]||(x[2]=w=>p(0,1)),onPrevYear:x[3]||(x[3]=w=>p(0,-1))},{footer:i.withCtx(()=>[i.unref(o)?(i.openBlock(),i.createBlock(N,{key:1,size:"small",text:"",type:"info",onClick:_},{default:i.withCtx(()=>[...x[4]||(x[4]=[i.createTextVNode(" Сегодня ",-1)])]),_:1})):(i.openBlock(),i.createBlock(c1,{key:0,year:c.value.getFullYear(),month:d.value,"onUpdate:year":b,onSelectMonth:y,onToday:_},null,8,["year","month"]))]),_:1},8,["value","show","clearable","disabled","placeholder","format","default-calendar-start-time"])}}}),u1={key:0,class:"text-gray-400"},h1={},eu=i.defineComponent({...h1,__name:"date-range-fields",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},from:{default:null},to:{default:null},placeholderFrom:{default:"Дата начала"},placeholderTo:{default:"Дата окончания"},dateFormat:{default:void 0}},emits:["update:from","update:to"],setup(t,{emit:e}){const n=it.initRefDependingOnDeviceResolution(!0,!1,!1),r=e;return(o,s)=>{var a,l;return i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(["flex w-full min-w-0 gap-1",i.unref(n)?"flex-col":"flex-row items-center"])},[i.createVNode(Jd,{value:t.from,clearable:t.clearable,disabled:(a=t.disabled)==null?void 0:a.from,placeholder:t.placeholderFrom,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:value":s[0]||(s[0]=c=>r("update:from",c))},null,8,["value","clearable","disabled","placeholder","date-format"]),i.unref(n)?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("span",u1," – ")),i.createVNode(Jd,{value:t.to,clearable:t.clearable,disabled:(l=t.disabled)==null?void 0:l.to,placeholder:t.placeholderTo,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:value":s[1]||(s[1]=c=>r("update:to",c))},null,8,["value","clearable","disabled","placeholder","date-format"])],2)}}}),f1={class:"flex flex-col items-stretch gap-3 sm:flex-row"},m1={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},g1={class:"flex flex-col items-stretch pr-3"},p1={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},y1={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},b1={},_1=i.defineComponent({...b1,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(t,{emit:e}){const n=t,r=e,o="custom",s=it.initRefDependingOnDeviceResolution(!0,!1,!1),a=j.DateTimeProvider.standardPeriods(),l=i.ref(j.STANDARD_PERIOD_GROUPS[0].key),c=i.computed(()=>{const h=j.STANDARD_PERIOD_GROUPS.map(f=>({key:f.key,value:f.key,label:f.label}));return M.isEmpty(n.customPeriods)||h.push({key:o,value:o,label:"Пользовательские"}),h}),d=h=>Object.entries(h).map(([f,g])=>({value:f,label:g.label,item:g})),u=i.computed(()=>{if(l.value===o)return[{type:"group",key:o,children:d(n.customPeriods??{})}];const h=Object.entries(a).filter(([,g])=>g.group===l.value),f=Object.fromEntries(h);return l.value!=="other"?[{type:"group",key:l.value,children:d(f)}]:j.STANDARD_PERIOD_SECTIONS.map(g=>{const m=h.filter(([,p])=>p.section===g.key);return{type:"group",key:g.key,label:g.label,children:d(Object.fromEntries(m))}}).filter(g=>{var m;return(((m=g.children)==null?void 0:m.length)??0)>0})});return(h,f)=>{const g=A.NButton,m=A.NScrollbar,p=A.NSelect,b=A.NMenu;return i.openBlock(),i.createElementBlock("div",f1,[i.createElementVNode("div",m1,[i.createVNode(m,{class:"max-h-96"},{default:i.withCtx(()=>[i.createElementVNode("div",g1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,y=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:y.key},[y.label?(i.openBlock(),i.createElementBlock("div",p1,i.toDisplayString(y.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(y.children,_=>(i.openBlock(),i.createBlock(g,{key:_.value,size:"small",quaternary:"",type:_.value===t.activeKey?"primary":"default",class:"justify-start",onClick:C=>r("apply",_),onMouseenter:C=>r("preview",_),onMouseleave:f[0]||(f[0]=C=>r("preview"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(_.label),1)]),_:2},1032,["type","onClick","onMouseenter"]))),128))],64))),128))])]),_:1})]),i.unref(s)?(i.openBlock(),i.createBlock(p,{key:0,value:l.value,options:c.value,class:"order-1","onUpdate:value":f[1]||(f[1]=y=>l.value=y)},null,8,["value","options"])):(i.openBlock(),i.createElementBlock("div",y1,[i.createVNode(b,{value:l.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=y=>l.value=y)},null,8,["value","options"])]))])}}}),w1={class:"flex flex-col gap-3"},x1={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},k1={key:0,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},v1={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},C1={class:"flex gap-2"},S1={},B1=i.defineComponent({...S1,__name:"date-range-dialog",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},show:{type:Boolean},dateRange:{default:void 0},customPeriods:{default:void 0},dateFormat:{default:void 0}},emits:["update:show","select"],setup(t,{emit:e}){const n=t,r=e,o=it.initRefDependingOnDeviceResolution("100%","90%","44rem"),s=i.ref("custom"),a=()=>j.PreferencesStorageProvider.getActualDataFromStorage(Gd)==="standard"?"standard":"custom",l=i.ref({}),c=i.ref(null),d=i.ref(null),u=i.computed(()=>c.value??l.value),h=(x,N)=>{var v,k;const $=(v=n.disabled)!=null&&v.from?l.value.from:x,w=(k=n.disabled)!=null&&k.to?l.value.to:N;c.value=null,l.value=Qd($,w,n.disabled)},f=x=>{d.value=null,h(x,l.value.to)},g=x=>{d.value=null,h(l.value.from,x)},m=()=>{d.value=null,h(null,null)},p=x=>{d.value=null,h(x.from,x.to)},b=x=>{const N=x.item;h(N.from,N.to),d.value=String(x.value)},y=x=>{const N=x==null?void 0:x.item;c.value=N?{from:N.from,to:N.to}:null},_=()=>{c.value=null,s.value=s.value==="custom"?"standard":"custom";const x=Gd;j.PreferencesStorageProvider.saveActualDataToStorage(x,s.value,je.addYears(je.startOfToday(),1))},C=()=>{r("select",l.value),r("update:show",!1)};return i.watch(()=>n.show,x=>{x&&(s.value=a(),d.value=null,c.value=null,l.value={...n.dateRange})}),(x,N)=>{const $=A.NButton,w=A.NModal;return i.openBlock(),i.createBlock(w,{show:t.show,preset:"card",title:"Выберите период",closable:"",style:i.normalizeStyle({width:i.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":N[1]||(N[1]=v=>r("update:show",v))},{footer:i.withCtx(()=>[i.createElementVNode("div",v1,[i.createVNode($,{text:"",type:"info",onClick:_},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),i.createElementVNode("div",C1,[i.createVNode($,{type:"primary",onClick:C},{default:i.withCtx(()=>[...N[3]||(N[3]=[i.createTextVNode(" Выбрать ",-1)])]),_:1}),i.createVNode($,{onClick:N[0]||(N[0]=v=>r("update:show",!1))},{default:i.withCtx(()=>[...N[4]||(N[4]=[i.createTextVNode("Отмена",-1)])]),_:1})])])]),default:i.withCtx(()=>[i.createElementVNode("div",w1,[i.createElementVNode("div",x1,[i.createVNode(eu,{from:u.value.from,to:u.value.to,clearable:t.clearable,disabled:t.disabled,"date-format":t.dateFormat,class:"flex-1","onUpdate:from":f,"onUpdate:to":g},null,8,["from","to","clearable","disabled","date-format"]),t.clearable?(i.openBlock(),i.createBlock($,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:m},{default:i.withCtx(()=>[...N[2]||(N[2]=[i.createTextVNode(" Очистить период ",-1)])]),_:1})):i.createCommentVNode("",!0)]),s.value==="custom"?(i.openBlock(),i.createElementBlock("div",k1,[i.createVNode(i1,{from:l.value.from,to:l.value.to,onSelect:p},null,8,["from","to"])])):(i.openBlock(),i.createBlock(_1,{key:1,"active-key":d.value,"custom-periods":t.customPeriods,onApply:b,onPreview:y},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),T1={class:"flex w-full min-w-0 items-center gap-1"},N1={},$1=i.defineComponent({...N1,__name:"date-range",props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},dateRange:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1},placeholderFrom:{default:"Дата начала"},placeholderTo:{default:"Дата окончания"},dateFormat:{default:void 0}},emits:["update:date-range"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.computed(()=>{const u={...n.useDefaultPredefinedDateRanges?j.DateTimeProvider.defaultDateRanges():{},...n.predefinedDateRanges};return M.isEmpty(u)?void 0:u}),a=(u,h)=>{r("update:date-range",Qd(u,h,n.disabled))},l=u=>{var h;a(u,(h=n.dateRange)==null?void 0:h.to)},c=u=>{var h;a((h=n.dateRange)==null?void 0:h.from,u)},d=u=>{a(u.from,u.to)};return(u,h)=>{var m,p,b,y;const f=Z_,g=A.NButton;return i.openBlock(),i.createElementBlock("div",T1,[i.createVNode(eu,{from:(m=t.dateRange)==null?void 0:m.from,to:(p=t.dateRange)==null?void 0:p.to,clearable:t.clearable,disabled:t.disabled,"placeholder-from":t.placeholderFrom,"placeholder-to":t.placeholderTo,"date-format":t.dateFormat,class:"min-w-0 flex-1","onUpdate:from":l,"onUpdate:to":c},null,8,["from","to","clearable","disabled","placeholder-from","placeholder-to","date-format"]),i.createVNode(g,{disabled:!!((b=t.disabled)!=null&&b.from&&((y=t.disabled)!=null&&y.to)),title:"Выбрать период","aria-label":"Выбрать период",onClick:h[0]||(h[0]=_=>o.value=!0)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(B1,{show:o.value,"onUpdate:show":h[1]||(h[1]=_=>o.value=_),"date-range":t.dateRange,clearable:t.clearable,disabled:t.disabled,"custom-periods":s.value,"date-format":t.dateFormat,onSelect:d},null,8,["show","date-range","clearable","disabled","custom-periods","date-format"])])}}}),R1={class:"sc-lbl-date text-nowrap"},E1={},yo=i.defineComponent({...E1,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>je.format(e.date,j.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>je.format(e.date,"HH:mm"));return(o,s)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",R1,i.toDisplayString(n.value),1),t.isShowTime?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"text-sc-grey":t.isTimeSecondary,"ml-1":!t.isTimeOnSecondLine},"sc-lbl-time"])},i.toDisplayString(r.value),3)):i.createCommentVNode("",!0)],2))}}),P1={class:"flex flex-row gap-2.5"},F1={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},V1={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},M1={class:"mb-0.5 sm:mb-0 sm:ml-3"},A1={},I1=i.defineComponent({...A1,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=po,o=A.NButton,s=A.NPopover;return i.openBlock(),i.createElementBlock("div",P1,[i.createElementVNode("div",F1,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",V1,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",M1,[t.showCloseButton?(i.openBlock(),i.createBlock(s,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(o,{size:"small",type:"error",onClick:n[0]||(n[0]=a=>e.$emit("close"))},{default:i.withCtx(()=>[i.createVNode(r)]),_:1})]),default:i.withCtx(()=>[n[1]||(n[1]=i.createTextVNode(" Закрыть ",-1))]),_:1})):i.createCommentVNode("",!0)])])])])}}}),O1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function z1(t,e){return i.openBlock(),i.createElementBlock("svg",O1,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const D1=i.markRaw({name:"ion-download-outline",render:z1}),L1={},H1=i.defineComponent({...L1,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(t,{emit:e}){const n=t,r=e,o=i.ref([]),s=i.computed(()=>o.value.map(l=>(l.status=n.isError?"error":"finished",l))),a=l=>{o.value=l;const c={name:"",content:""};if(l.length===0){r("update:file",null);return}const d=l[0];c.name=d.name;const u=new FileReader;u.addEventListener("load",()=>{c.content=u.result??"",r("update:file",c)}),u.readAsDataURL(d.file)};return(l,c)=>{const d=D1;return i.openBlock(),i.createBlock(i.unref(A.NUpload),{"file-list":s.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:t.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:i.withCtx(()=>[i.createVNode(i.unref(A.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),W1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function j1(t,e){return i.openBlock(),i.createElementBlock("svg",W1,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"square","stroke-miterlimit":"10","stroke-width":"44",d:"M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273"},null,-1)])])}const q1=i.markRaw({name:"ion-checkmark-done-sharp",render:j1}),X1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Y1(t,e){return i.openBlock(),i.createElementBlock("svg",X1,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const U1=i.markRaw({name:"ion-options-outline",render:Y1}),K1={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},G1={class:"flex-auto"},Z1={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"},Q1={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"},J1={},Ws=i.defineComponent({...J1,__name:"inline-view",props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:["edit","apply","cancel"],setup(t,{emit:e}){const n=e,r=i.ref(!1),o=()=>{n("edit")},s=()=>{r.value=!1},a=()=>{r.value=!0,n("apply",s)},l=()=>{n("cancel",s)};return(c,d)=>{const u=U1,h=A.NButton,f=A.NPopover,g=q1,m=po;return i.openBlock(),i.createElementBlock("div",K1,[i.createElementVNode("div",G1,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",Z1,[i.createElementVNode("div",Q1,[t.showEditButton?(i.openBlock(),i.createBlock(f,{key:0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"info",ghost:"",size:"small",onClick:o},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[0]||(d[0]=i.createTextVNode(" Редактировать данные ",-1))]),_:1})):i.createCommentVNode("",!0),t.showApplyButton?(i.openBlock(),i.createBlock(f,{key:1,disabled:r.value,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"primary",size:"small",onClick:a},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[1]||(d[1]=i.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),t.showCancelButton?(i.openBlock(),i.createBlock(f,{key:2,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(h,{disabled:t.disabled||r.value,type:"error",size:"small",onClick:l},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),ew={},tu=i.defineComponent({...ew,__name:"inline-editable-item",props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:["editor:apply","editor:cancel"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.showEditor),s=l=>{r("editor:apply",d=>{o.value=!d,l()})},a=l=>{o.value=!1,l(),r("editor:cancel")};return i.onMounted(()=>{i.watch(()=>n.showEditor,l=>{o.value=l})}),(l,c)=>(i.openBlock(),i.createElementBlock("div",null,[o.value?(i.openBlock(),i.createBlock(Ws,{key:1,disabled:t.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:s,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(Ws,{key:0,disabled:t.disabled,"show-edit-button":t.showEditButton,onEdit:c[0]||(c[0]=d=>o.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"]))]))}}),tw={},nw=i.defineComponent({...tw,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.value),s=i.computed(()=>i.inject("debounce-input-time",n.debounceTime)),a=M.debounce(()=>r("update:value",o.value),s.value),l=c=>{o.value=c,a()};return i.watch(()=>n.value,c=>{o.value=c}),(c,d)=>(i.openBlock(),i.createBlock(i.unref(A.NInput),{value:o.value,"onUpdate:value":[d[0]||(d[0]=u=>o.value=u),l],clearable:t.clearable,placeholder:t.placeholder},{prefix:i.withCtx(()=>[i.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),iw={},rw=i.defineComponent({...iw,__name:"debounced-input-number",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:""},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:["update:value","keydown","input","focus"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.computed(()=>i.inject("debounce-input-time",r.debounceTime)),l=M.debounce(()=>o("update:value",s.value),a.value),c=g=>{s.value=g,l()};i.watch(()=>r.value,g=>{s.value=g});const d=i.ref(null);return e({focus:()=>{var g;return(g=d.value)==null?void 0:g.focus()},blur:()=>{var g;return(g=d.value)==null?void 0:g.blur()},select:()=>{var g;return(g=d.value)==null?void 0:g.select()}}),(g,m)=>(i.openBlock(),i.createBlock(i.unref(A.NInputNumber),{ref_key:"inputReference",ref:d,value:s.value??null,clearable:t.clearable,parse:t.parse,"show-button":t.showButton,placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,validator:t.validator,"onUpdate:value":c,onKeydown:m[0]||(m[0]=p=>o("keydown",p)),onInput:m[1]||(m[1]=p=>o("input",p)),onFocus:m[2]||(m[2]=p=>o("focus",p))},{prefix:i.withCtx(()=>[i.renderSlot(g.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),ow={},sw=i.defineComponent({...ow,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref((n.value??"").replaceAll(/\D*/g,"")),s=M.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(M.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(M.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof or.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}n.debounceTime?s(d):r("update:value",d)},l=c=>{const d=c.replaceAll(/\D*/g,"");try{const u=or.parsePhoneNumberWithError(`+${d}`);u.isValid()?o.value=u.format("E.164"):u.getPossibleCountries().length>0&&(o.value=`+${d}`)}catch(u){if(u instanceof or.ParseError)o.value=d;else throw u}};return i.watch(()=>n.value,c=>{var d;(c==null?void 0:c.replaceAll(/\D*/g,""))!==((d=o.value)==null?void 0:d.replaceAll(/\D*/g,""))&&l(c)},{immediate:!0}),i.onBeforeMount(()=>l(o.value??"")),(c,d)=>(i.openBlock(),i.createBlock(i.unref(af.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>o.value=u),a],"auto-default-country":!1,"auto-format":!0,"default-country":t.defaultCountry,disabled:t.disabled,"input-options":{placeholder:t.placeholder},"preferred-countries":t.preferredCountries,"only-countries":t.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),aw=Nn(sw,[["__scopeId","data-v-751dbb0e"]]),lw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function cw(t,e){return i.openBlock(),i.createElementBlock("svg",lw,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5"},null,-1)])])}const dw=i.markRaw({name:"tabler-external-link",render:cw}),uw={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},hw=["href"],fw={},mw=i.defineComponent({...fw,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=dw,o=A.NTooltip;return i.openBlock(),i.createBlock(o,{disabled:i.unref(M.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",uw,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,hw),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),gw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function pw(t,e){return i.openBlock(),i.createElementBlock("svg",gw,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const yw=i.markRaw({name:"ion-remove-circle-outline",render:pw});let bo=[];const nu=new WeakMap;function bw(){bo.forEach(t=>t(...nu.get(t))),bo=[]}function iu(t,...e){nu.set(t,e),!bo.includes(t)&&bo.push(t)===1&&requestAnimationFrame(bw)}function _r(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function wr(t){return t.composedPath()[0]||null}function xr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function kr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function rn(t,e){const n=t.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw new Error("[seemly/getMargin]:"+t+" is not a valid value.")}return e===void 0?r:r[e]}const ru={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(t,e,n){e/=100,n/=100;let r=(o,s=(o+t/60)%6)=>n-n*e*Math.max(Math.min(s,4-s,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function ww(t,e,n){e/=100,n/=100;let r=e*Math.min(n,1-n),o=(s,a=(s+t/30)%12)=>n-r*Math.max(Math.min(a-3,9-a,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const wn="^\\s*",xn="\\s*$",Gn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Wt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",mi="([0-9A-Fa-f])",gi="([0-9A-Fa-f]{2})",ou=new RegExp(`${wn}hsl\\s*\\(${Wt},${Gn},${Gn}\\)${xn}`),su=new RegExp(`${wn}hsv\\s*\\(${Wt},${Gn},${Gn}\\)${xn}`),au=new RegExp(`${wn}hsla\\s*\\(${Wt},${Gn},${Gn},${Wt}\\)${xn}`),lu=new RegExp(`${wn}hsva\\s*\\(${Wt},${Gn},${Gn},${Wt}\\)${xn}`),xw=new RegExp(`${wn}rgb\\s*\\(${Wt},${Wt},${Wt}\\)${xn}`),kw=new RegExp(`${wn}rgba\\s*\\(${Wt},${Wt},${Wt},${Wt}\\)${xn}`),vw=new RegExp(`${wn}#${mi}${mi}${mi}${xn}`),Cw=new RegExp(`${wn}#${gi}${gi}${gi}${xn}`),Sw=new RegExp(`${wn}#${mi}${mi}${mi}${mi}${xn}`),Bw=new RegExp(`${wn}#${gi}${gi}${gi}${gi}${xn}`);function Ot(t){return parseInt(t,16)}function Tw(t){try{let e;if(e=au.exec(t))return[wo(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=ou.exec(t))return[wo(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function Nw(t){try{let e;if(e=lu.exec(t))return[wo(e[1]),Zn(e[5]),Zn(e[9]),yi(e[13])];if(e=su.exec(t))return[wo(e[1]),Zn(e[5]),Zn(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function pi(t){try{let e;if(e=Cw.exec(t))return[Ot(e[1]),Ot(e[2]),Ot(e[3]),1];if(e=xw.exec(t))return[wt(e[1]),wt(e[5]),wt(e[9]),1];if(e=kw.exec(t))return[wt(e[1]),wt(e[5]),wt(e[9]),yi(e[13])];if(e=vw.exec(t))return[Ot(e[1]+e[1]),Ot(e[2]+e[2]),Ot(e[3]+e[3]),1];if(e=Bw.exec(t))return[Ot(e[1]),Ot(e[2]),Ot(e[3]),yi(Ot(e[4])/255)];if(e=Sw.exec(t))return[Ot(e[1]+e[1]),Ot(e[2]+e[2]),Ot(e[3]+e[3]),yi(Ot(e[4]+e[4])/255)];if(t in ru)return pi(ru[t]);if(ou.test(t)||au.test(t)){const[n,r,o,s]=Tw(t);return[...ww(n,r,o),s]}else if(su.test(t)||lu.test(t)){const[n,r,o,s]=Nw(t);return[..._w(n,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function $w(t){return t>1?1:t<0?0:t}function js(t,e,n,r){return`rgba(${wt(t)}, ${wt(e)}, ${wt(n)}, ${$w(r)})`}function qs(t,e,n,r,o){return wt((t*e*(1-r)+n*r)/o)}function Rw(t,e){Array.isArray(t)||(t=pi(t)),Array.isArray(e)||(e=pi(e));const n=t[3],r=e[3],o=yi(n+r-n*r);return js(qs(t[0],n,e[0],r,o),qs(t[1],n,e[1],r,o),qs(t[2],n,e[2],r,o),o)}function ze(t,e){const[n,r,o,s=1]=Array.isArray(t)?t:pi(t);return typeof e.alpha=="number"?js(n,r,o,e.alpha):js(n,r,o,s)}function _o(t,e){const[n,r,o,s=1]=Array.isArray(t)?t:pi(t),{lightness:a=1,alpha:l=1}=e;return Ew([n*a,r*a,o*a,s*l])}function yi(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function wo(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function wt(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function Zn(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function Ew(t){const[e,n,r]=t;return 3 in t?`rgba(${wt(e)}, ${wt(n)}, ${wt(r)}, ${yi(t[3])})`:`rgba(${wt(e)}, ${wt(n)}, ${wt(r)}, 1)`}function Pw(t=8){return Math.random().toString(16).slice(2,2+t)}function cu(t){return Array.isArray(t)?t:[t]}const Xs={STOP:"STOP"};function du(t,e){const n=e(t);t.children!==void 0&&n!==Xs.STOP&&t.children.forEach(r=>du(r,e))}function Fw(t,e={}){const{preserveGroup:n=!1}=e,r=[],o=n?a=>{a.isLeaf||(r.push(a.key),s(a.children))}:a=>{a.isLeaf||(a.isGroup||r.push(a.key),s(a.children))};function s(a){a.forEach(o)}return s(t),r}function Vw(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function Mw(t){return t.children}function Aw(t){return t.key}function Iw(){return!1}function Ow(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function zw(t){return t.disabled===!0}function Dw(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function Lw(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function Ys(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function Us(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function Hw(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function Ww(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function jw(t){return(t==null?void 0:t.type)==="group"}function qw(t){const e=new Map;return t.forEach((n,r)=>{e.set(n.key,r)}),n=>{var r;return(r=e.get(n))!==null&&r!==void 0?r:null}}class Xw extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function Yw(t,e,n,r){return xo(e.concat(t),n,r,!1)}function Uw(t,e){const n=new Set;return t.forEach(r=>{const o=e.treeNodeMap.get(r);if(o!==void 0){let s=o.parent;for(;s!==null&&!(s.disabled||n.has(s.key));)n.add(s.key),s=s.parent}}),n}function Kw(t,e,n,r){const o=xo(e,n,r,!1),s=xo(t,n,r,!0),a=Uw(t,n),l=[];return o.forEach(c=>{(s.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>o.delete(c)),o}function Ks(t,e){const{checkedKeys:n,keysToCheck:r,keysToUncheck:o,indeterminateKeys:s,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=t;if(!a)return r!==void 0?{checkedKeys:Hw(n,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:Ww(n,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let h;o!==void 0?h=Kw(o,n,e,d):r!==void 0?h=Yw(r,n,e,d):h=xo(n,e,d,!1);const f=c==="parent",g=c==="child"||l,m=h,p=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,C=u.get(y);for(const x of C){if(x.isLeaf)continue;const{key:N,shallowLoaded:$}=x;if(g&&$&&x.children.forEach(B=>{!B.disabled&&!B.isLeaf&&B.shallowLoaded&&m.has(B.key)&&m.delete(B.key)}),x.disabled||!$)continue;let w=!0,v=!1,k=!0;for(const B of x.children){const R=B.key;if(!B.disabled){if(k&&(k=!1),m.has(R))v=!0;else if(p.has(R)){v=!0,w=!1;break}else if(w=!1,v)break}}w&&!k?(f&&x.children.forEach(B=>{!B.disabled&&m.has(B.key)&&m.delete(B.key)}),m.add(N)):v&&p.add(N),_&&g&&m.has(N)&&m.delete(N)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(p)}}function xo(t,e,n,r){const{treeNodeMap:o,getChildren:s}=e,a=new Set,l=new Set(t);return t.forEach(c=>{const d=o.get(c);d!==void 0&&du(d,u=>{if(u.disabled)return Xs.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),Dw(u.rawNode,s))){if(r)return Xs.STOP;if(!n)throw new Xw}})}),l}function Gw(t,{includeGroup:e=!1,includeSelf:n=!0},r){var o;const s=r.treeNodeMap;let a=t==null?null:(o=s.get(t))!==null&&o!==void 0?o:null;const l={keyPath:[],treeNodePath:[],treeNode:a};if(a!=null&&a.ignored)return l.treeNode=null,l;for(;a;)!a.ignored&&(e||!a.isGroup)&&l.treeNodePath.push(a),a=a.parent;return l.treeNodePath.reverse(),n||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function Zw(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function Qw(t,e){const n=t.siblings,r=n.length,{index:o}=t;return e?n[(o+1)%r]:o===n.length-1?null:n[o+1]}function uu(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const o=e==="prev"?Jw:Qw,s={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===t){if(!a)a=!0;else if(!t.disabled&&!t.isGroup){l=t;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const u=Gs(d,s);u!==null?l=u:c(o(d,n))}else{const u=o(d,!1);if(u!==null)c(u);else{const h=ex(d);h!=null&&h.isGroup?c(o(h,n)):n&&c(o(d,!0))}}}}return c(t),l}function Jw(t,e){const n=t.siblings,r=n.length,{index:o}=t;return e?n[(o-1+r)%r]:o===0?null:n[o-1]}function ex(t){return t.parent}function Gs(t,e={}){const{reverse:n=!1}=e,{children:r}=t;if(r){const{length:o}=r,s=n?o-1:0,a=n?-1:o,l=n?-1:1;for(let c=s;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=Gs(d,e);if(u!==null)return u}else return d}}return null}const tx={getChild(){return this.ignored?null:Gs(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return uu(this,"next",t)},getPrev(t={}){return uu(this,"prev",t)}};function nx(t,e){const n=e?new Set(e):void 0,r=[];function o(s){s.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||n===void 0||n.has(a.key))&&o(a.children)})}return o(t),r}function ix(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var rx={};function hu(t,e,n,r,o,s=null,a=0){const l=[];return t.forEach((c,d)=>{var u;rx.NODE_ENV!=="production"&&Lw(c,o)&&console.error("[treemate]: node",c,"is invalid");const h=Object.create(r);if(h.rawNode=c,h.siblings=l,h.level=a,h.index=d,h.isFirstChild=d===0,h.isLastChild=d+1===t.length,h.parent=s,!h.ignored){const f=o(c);Array.isArray(f)&&(h.children=hu(f,e,n,r,o,h,a+1))}l.push(h),e.set(h.key,h),n.has(a)||n.set(a,[]),(u=n.get(a))===null||u===void 0||u.push(h)}),l}function ox(t,e={}){var n;const r=new Map,o=new Map,{getDisabled:s=zw,getIgnored:a=Iw,getIsGroup:l=jw,getKey:c=Aw}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:Mw,u=e.ignoreEmptyChildren?x=>{const N=d(x);return Array.isArray(N)?N.length?N:null:N}:d,h=Object.assign({get key(){return c(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return Vw(this.rawNode,u)},get shallowLoaded(){return Ow(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(x){return ix(this,x)}},tx),f=hu(t,r,o,h,u);function g(x){if(x==null)return null;const N=r.get(x);return N&&!N.isGroup&&!N.ignored?N:null}function m(x){if(x==null)return null;const N=r.get(x);return N&&!N.ignored?N:null}function p(x,N){const $=m(x);return $?$.getPrev(N):null}function b(x,N){const $=m(x);return $?$.getNext(N):null}function y(x){const N=m(x);return N?N.getParent():null}function _(x){const N=m(x);return N?N.getChild():null}const C={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(x){return nx(f,x)},getNode:g,getPrev:p,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return Zw(f)},getPath(x,N={}){return Gw(x,N,C)},getCheckedKeys(x,N={}){const{cascade:$=!0,leafOnly:w=!1,checkStrategy:v="all",allowNotLoaded:k=!1}=N;return Ks({checkedKeys:Ys(x),indeterminateKeys:Us(x),cascade:$,leafOnly:w,checkStrategy:v,allowNotLoaded:k},C)},check(x,N,$={}){const{cascade:w=!0,leafOnly:v=!1,checkStrategy:k="all",allowNotLoaded:B=!1}=$;return Ks({checkedKeys:Ys(N),indeterminateKeys:Us(N),keysToCheck:x==null?[]:cu(x),cascade:w,leafOnly:v,checkStrategy:k,allowNotLoaded:B},C)},uncheck(x,N,$={}){const{cascade:w=!0,leafOnly:v=!1,checkStrategy:k="all",allowNotLoaded:B=!1}=$;return Ks({checkedKeys:Ys(N),indeterminateKeys:Us(N),keysToUncheck:x==null?[]:cu(x),cascade:w,leafOnly:v,checkStrategy:k,allowNotLoaded:B},C)},getNonLeafKeys(x={}){return Fw(f,x)}};return C}function ko(t){return t.composedPath()[0]}const sx={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function ax(t,e,n){if(t==="mousemoveoutside"){const r=o=>{e.contains(ko(o))||n(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=a=>{r=!e.contains(ko(a))},s=a=>{r&&(e.contains(ko(a))||n(a))};return{mousedown:o,mouseup:s,touchstart:o,touchend:s}}return console.error(`[evtd/create-trap-handler]: name \`${t}\` is invalid. This could be a bug of evtd.`),{}}function fu(t,e,n){const r=sx[t];let o=r.get(e);o===void 0&&r.set(e,o=new WeakMap);let s=o.get(n);return s===void 0&&o.set(n,s=ax(t,e,n)),s}function lx(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=fu(t,e,n);return Object.keys(o).forEach(s=>{Pt(s,document,o[s],r)}),!0}return!1}function cx(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=fu(t,e,n);return Object.keys(o).forEach(s=>{ct(s,document,o[s],r)}),!0}return!1}function dx(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const t=new WeakMap,e=new WeakMap;function n(){t.set(this,!0)}function r(){t.set(this,!0),e.set(this,!0)}function o(w,v,k){const B=w[v];return w[v]=function(){return k.apply(w,arguments),B.apply(w,arguments)},w}function s(w,v){w[v]=Event.prototype[v]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var w;return(w=a.get(this))!==null&&w!==void 0?w:null}function d(w,v){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:v??l.get})}const u={bubble:{},capture:{}},h={};function f(){const w=function(v){const{type:k,eventPhase:B,bubbles:R}=v,E=ko(v);if(B===2)return;const P=B===1?"capture":"bubble";let W=E;const I=[];for(;W===null&&(W=window),I.push(W),W!==window;)W=W.parentNode||null;const Z=u.capture[k],te=u.bubble[k];if(o(v,"stopPropagation",n),o(v,"stopImmediatePropagation",r),d(v,c),P==="capture"){if(Z===void 0)return;for(let D=I.length-1;D>=0&&!t.has(v);--D){const L=I[D],H=Z.get(L);if(H!==void 0){a.set(v,L);for(const z of H){if(e.has(v))break;z(v)}}if(D===0&&!R&&te!==void 0){const z=te.get(L);if(z!==void 0)for(const O of z){if(e.has(v))break;O(v)}}}}else if(P==="bubble"){if(te===void 0)return;for(let D=0;D<I.length&&!t.has(v);++D){const L=I[D],H=te.get(L);if(H!==void 0){a.set(v,L);for(const z of H){if(e.has(v))break;z(v)}}}}s(v,"stopPropagation"),s(v,"stopImmediatePropagation"),d(v)};return w.displayName="evtdUnifiedHandler",w}function g(){const w=function(v){const{type:k,eventPhase:B}=v;if(B!==2)return;const R=h[k];R!==void 0&&R.forEach(E=>E(v))};return w.displayName="evtdUnifiedWindowEventHandler",w}const m=f(),p=g();function b(w,v){const k=u[w];return k[v]===void 0&&(k[v]=new Map,window.addEventListener(v,m,w==="capture")),k[v]}function y(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,p)),h[w]}function _(w,v){let k=w.get(v);return k===void 0&&w.set(v,k=new Set),k}function C(w,v,k,B){const R=u[v][k];if(R!==void 0){const E=R.get(w);if(E!==void 0&&E.has(B))return!0}return!1}function x(w,v){const k=h[w];return!!(k!==void 0&&k.has(v))}function N(w,v,k,B){let R;if(typeof B=="object"&&B.once===!0?R=Z=>{$(w,v,R,B),k(Z)}:R=k,lx(w,v,R,B))return;const P=B===!0||typeof B=="object"&&B.capture===!0?"capture":"bubble",W=b(P,w),I=_(W,v);if(I.has(R)||I.add(R),v===window){const Z=y(w);Z.has(R)||Z.add(R)}}function $(w,v,k,B){if(cx(w,v,k,B))return;const E=B===!0||typeof B=="object"&&B.capture===!0,P=E?"capture":"bubble",W=b(P,w),I=_(W,v);if(v===window&&!C(v,E?"bubble":"capture",w,k)&&x(w,k)){const te=h[w];te.delete(k),te.size===0&&(window.removeEventListener(w,p),h[w]=void 0)}I.has(k)&&I.delete(k),I.size===0&&W.delete(v),W.size===0&&(window.removeEventListener(w,m,P==="capture"),u[P][w]=void 0)}return{on:N,off:$}}const{on:Pt,off:ct}=dx(),Ki="@@mmoContext",ux={mounted(t,{value:e}){t[Ki]={handler:void 0},typeof e=="function"&&(t[Ki].handler=e,Pt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[Ki];typeof e=="function"?n.handler?n.handler!==e&&(ct("mousemoveoutside",t,n.handler),n.handler=e,Pt("mousemoveoutside",t,e)):(t[Ki].handler=e,Pt("mousemoveoutside",t,e)):n.handler&&(ct("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[Ki];e&&ct("mousemoveoutside",t,e),t[Ki].handler=void 0}},Gi="@@coContext",vo={mounted(t,{value:e,modifiers:n}){t[Gi]={handler:void 0},typeof e=="function"&&(t[Gi].handler=e,Pt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[Gi];typeof e=="function"?r.handler?r.handler!==e&&(ct("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Pt("clickoutside",t,e,{capture:n.capture})):(t[Gi].handler=e,Pt("clickoutside",t,e,{capture:n.capture})):r.handler&&(ct("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[Gi];n&&ct("clickoutside",t,n,{capture:e.capture}),t[Gi].handler=void 0}};function hx(t,e){console.error(`[vdirs/${t}]: ${e}`)}class fx{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,n){const{elementZIndex:r}=this;if(n!==void 0){e.style.zIndex=`${n}`,r.delete(e);return}const{nextZIndex:o}=this;r.has(e)&&r.get(e)+1===this.nextZIndex||(e.style.zIndex=`${o}`,r.set(e,o),this.nextZIndex=o+1,this.squashState())}unregister(e,n){const{elementZIndex:r}=this;r.has(e)?r.delete(e):n===void 0&&hx("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){const e=Array.from(this.elementZIndex.entries());e.sort((n,r)=>n[1]-r[1]),this.nextZIndex=2e3,e.forEach(n=>{const r=n[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const Zs=new fx,Zi="@@ziContext",mu={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n;t[Zi]={enabled:!!o,initialized:!1},o&&(Zs.ensureZIndex(t,r),t[Zi].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n,s=t[Zi].enabled;o&&!s&&(Zs.ensureZIndex(t,r),t[Zi].initialized=!0),t[Zi].enabled=!!o},unmounted(t,e){if(!t[Zi].initialized)return;const{value:n={}}=e,{zIndex:r}=n;Zs.unregister(t,r)}};function mx(t){const e=i.ref(!!t.value);if(e.value)return i.readonly(e);const n=i.watch(t,r=>{r&&(e.value=!0,n())});return i.readonly(e)}function Qt(t){const e=i.computed(t),n=i.ref(e.value);return i.watch(e,r=>{n.value=r}),typeof t=="function"?n:{__v_isRef:!0,get value(){return n.value},set value(r){t.set(r)}}}const gx=typeof window<"u";let Qi,vr;(()=>{var t,e;Qi=gx?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,vr=!1,Qi!==void 0?Qi.then(()=>{vr=!0}):vr=!0})();function px(t){if(vr)return;let e=!1;i.onMounted(()=>{vr||Qi==null||Qi.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Qs(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function Co(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function gu(t,e){return i.computed(()=>{for(const n of e)if(t[n]!==void 0)return t[n];return t[e[e.length-1]]})}const yx=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function bx(){return yx}function Js(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function ea(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ea(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ea(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function pu(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const o=ea(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let Qn=null;function yu(){if(Qn===null&&(Qn=document.getElementById("v-binder-view-measurer"),Qn===null)){Qn=document.createElement("div"),Qn.id="v-binder-view-measurer";const{style:t}=Qn;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(Qn)}return Qn.getBoundingClientRect()}function _x(t,e){const n=yu();return{top:e,left:t,height:0,width:0,right:n.width-t,bottom:n.height-e}}function ta(t){const e=t.getBoundingClientRect(),n=yu();return{left:e.left-n.left,top:e.top-n.top,bottom:n.height+n.top-e.bottom,right:n.width+n.left-e.right,width:e.width,height:e.height}}function wx(t){return t.nodeType===9?null:t.parentNode}function bu(t){if(t===null)return null;const e=wx(t);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:n,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(n+o+r))return e}return bu(e)}const _u=i.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(t){var e;i.provide("VBinder",(e=i.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const n=i.inject("VBinder",null),r=i.ref(null),o=y=>{r.value=y,n&&t.syncTargetWithParent&&n.setTargetRef(y)};let s=[];const a=()=>{let y=r.value;for(;y=bu(y),y!==null;)s.push(y);for(const _ of s)Pt("scroll",_,h,!0)},l=()=>{for(const y of s)ct("scroll",y,h,!0);s=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},h=()=>{iu(f)},f=()=>{c.forEach(y=>y())},g=new Set,m=y=>{g.size===0&&Pt("resize",window,b),g.has(y)||g.add(y)},p=y=>{g.has(y)&&g.delete(y),g.size===0&&ct("resize",window,b)},b=()=>{g.forEach(y=>y())};return i.onBeforeUnmount(()=>{ct("resize",window,b),l()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:m,removeResizeListener:p}},render(){return Js("binder",this.$slots)}}),wu=i.defineComponent({name:"Target",setup(){const{setTargetRef:t,syncTarget:e}=i.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:t,updated:t}}},render(){const{syncTarget:t,setTargetDirective:e}=this;return t?i.withDirectives(pu("follower",this.$slots),[[e]]):pu("follower",this.$slots)}}),xx="@css-render/vue3-ssr";function kx(t,e){return`<style cssr-id="${t}">
104
104
  ${e}
105
- </style>`}function Cx(t,e,n){const{styles:r,ids:o}=n;o.has(t)||r!==null&&(o.add(t),r.push(vx(t,e)))}const Sx=typeof document<"u";function bi(){if(Sx)return;const t=i.inject(kx,null);if(t!==null)return{adapter:(e,n)=>Cx(e,n,t),context:t}}function xu(t,e){console.error(`[vueuc/${t}]: ${e}`)}function Bx(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const ku=/\s*,(?![^(]*\))\s*/g,Tx=/\s+/g;function Nx(t,e){const n=[];return e.split(ku).forEach(r=>{let o=Bx(r);if(o){if(o===1){t.forEach(a=>{n.push(r.replace("&",a))});return}}else{t.forEach(a=>{n.push((a&&a+" ")+r)});return}let s=[r];for(;o--;){const a=[];s.forEach(l=>{t.forEach(c=>{a.push(l.replace("&",c))})}),s=a}s.forEach(a=>n.push(a))}),n}function $x(t,e){const n=[];return e.split(ku).forEach(r=>{t.forEach(o=>{n.push((o&&o+" ")+r)})}),n}function Rx(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=Nx(e,n):e=$x(e,n))}),e.join(", ").replace(Tx," ")}function vu(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function So(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function Ex(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function Bo(t){return t?/^\s*@(s|m)/.test(t):!1}const Px=/[A-Z]/g;function Cu(t){return t.replace(Px,e=>"-"+e.toLowerCase())}function Fx(t,e=" "){return typeof t=="object"&&t!==null?` {
105
+ </style>`}function vx(t,e,n){const{styles:r,ids:o}=n;o.has(t)||r!==null&&(o.add(t),r.push(kx(t,e)))}const Cx=typeof document<"u";function bi(){if(Cx)return;const t=i.inject(xx,null);if(t!==null)return{adapter:(e,n)=>vx(e,n,t),context:t}}function xu(t,e){console.error(`[vueuc/${t}]: ${e}`)}function Sx(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const ku=/\s*,(?![^(]*\))\s*/g,Bx=/\s+/g;function Tx(t,e){const n=[];return e.split(ku).forEach(r=>{let o=Sx(r);if(o){if(o===1){t.forEach(a=>{n.push(r.replace("&",a))});return}}else{t.forEach(a=>{n.push((a&&a+" ")+r)});return}let s=[r];for(;o--;){const a=[];s.forEach(l=>{t.forEach(c=>{a.push(l.replace("&",c))})}),s=a}s.forEach(a=>n.push(a))}),n}function Nx(t,e){const n=[];return e.split(ku).forEach(r=>{t.forEach(o=>{n.push((o&&o+" ")+r)})}),n}function $x(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=Tx(e,n):e=Nx(e,n))}),e.join(", ").replace(Bx," ")}function vu(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function So(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function Rx(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function Bo(t){return t?/^\s*@(s|m)/.test(t):!1}const Ex=/[A-Z]/g;function Cu(t){return t.replace(Ex,e=>"-"+e.toLowerCase())}function Px(t,e=" "){return typeof t=="object"&&t!==null?` {
106
106
  `+Object.entries(t).map(n=>e+` ${Cu(n[0])}: ${n[1]};`).join(`
107
107
  `)+`
108
- `+e+"}":`: ${t};`}function Vx(t,e,n){return typeof t=="function"?t({context:e.context,props:n}):t}function Su(t,e,n,r){if(!e)return"";const o=Vx(e,n,r);if(!o)return"";if(typeof o=="string")return`${t} {
108
+ `+e+"}":`: ${t};`}function Fx(t,e,n){return typeof t=="function"?t({context:e.context,props:n}):t}function Su(t,e,n,r){if(!e)return"";const o=Fx(e,n,r);if(!o)return"";if(typeof o=="string")return`${t} {
109
109
  ${o}
110
110
  }`;const s=Object.keys(o);if(s.length===0)return n.config.keepEmptyBlock?t+` {
111
111
  }`:"";const a=t?[t+" {"]:[];return s.forEach(l=>{const c=o[l];if(l==="raw"){a.push(`
112
112
  `+c+`
113
- `);return}l=Cu(l),c!=null&&a.push(` ${l}${Fx(c)}`)}),t&&a.push("}"),a.join(`
114
- `)}function na(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))na(r,e,n);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?na(o,e,n):o&&n(o)}else r&&n(r)})}function Bu(t,e,n,r,o){const s=t.$;let a="";if(!s||typeof s=="string")Bo(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});Bo(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")Bo(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});Bo(d)?a=d:e.push(d)}const l=Rx(e),c=Su(l,t.props,r,o);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&na(t.children,{context:r.context,props:o},d=>{if(typeof d=="string"){const u=Su(l,{raw:d},r,o);n.push(u)}else Bu(d,e,n,r,o)}),e.pop(),a&&n.push("}"),s&&s.after&&s.after(r.context)}function Mx(t,e,n){const r=[];return Bu(t,[],r,e,n),r.join(`
113
+ `);return}l=Cu(l),c!=null&&a.push(` ${l}${Px(c)}`)}),t&&a.push("}"),a.join(`
114
+ `)}function na(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))na(r,e,n);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?na(o,e,n):o&&n(o)}else r&&n(r)})}function Bu(t,e,n,r,o){const s=t.$;let a="";if(!s||typeof s=="string")Bo(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});Bo(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")Bo(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});Bo(d)?a=d:e.push(d)}const l=$x(e),c=Su(l,t.props,r,o);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&na(t.children,{context:r.context,props:o},d=>{if(typeof d=="string"){const u=Su(l,{raw:d},r,o);n.push(u)}else Bu(d,e,n,r,o)}),e.pop(),a&&n.push("}"),s&&s.after&&s.after(r.context)}function Vx(t,e,n){const r=[];return Bu(t,[],r,e,n),r.join(`
115
115
 
116
- `)}function ia(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Ax(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(vu),e.els=[];else{const s=So(n,r);s&&o.includes(s)&&(vu(s),e.els=o.filter(a=>a!==s))}}function Tu(t,e){t.push(e)}function Ix(t,e,n,r,o,s,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=ia(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=So(n,l);if(u!==null&&!s)return u;const h=u??Ex(n);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const f=l.querySelector(`meta[name="${a}"]`);if(f)return l.insertBefore(h,f),Tu(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),Tu(e.els,h),h}function Ox(t){return Mx(this,this.instance,t)}function zx(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return Ix(this.instance,this,e,r,o,s,a,l,n)}function Dx(t={}){const{id:e,parent:n}=t;Ax(this.instance,this,e,n)}const To=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:Ox,mount:zx,unmount:Dx}},Lx=function(t,e,n,r){return Array.isArray(e)?To(t,{$:null},null,e):Array.isArray(n)?To(t,e,null,n):Array.isArray(r)?To(t,e,n,r):To(t,e,n,null)};function Nu(t={}){const e={c:((...n)=>Lx(e,...n)),use:(n,...r)=>n.install(e,...r),find:So,context:{},config:t};return e}function Hx(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return So(t)!==null}const{c:Jn}=Nu(),ra="vueuc-style";function $u(t){return t&-t}class Ru{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=n,e+=$u(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=e*r;for(;e>0;)s+=n[e],e-=$u(e);return s}getBound(e){let n=0,r=this.l;for(;r>n;){const o=Math.floor((n+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(n===o)return this.sum(n+1)<=e?n+1:o;n=o}else return o}return n}}function Eu(t){return typeof t=="string"?document.querySelector(t):t()||null}const Wx=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:gx(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Js("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Js("lazy-teleport",this.$slots)):null}}),No={top:"bottom",bottom:"top",left:"right",right:"left"},Pu={start:"end",center:"center",end:"start"},oa={top:"height",bottom:"height",left:"width",right:"width"},jx={"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"},qx={"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"},Xx={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Fu={top:!0,bottom:!1,left:!0,right:!1},Vu={top:"end",bottom:"start",left:"end",right:"start"};function Yx(t,e,n,r,o,s){if(!o||s)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const u=(g,m,p)=>{let b=0,y=0;const _=n[g]-e[m]-e[g];return _>0&&r&&(p?y=Fu[m]?_:-_:b=Fu[m]?_:-_),{left:b,top:y}},h=a==="left"||a==="right";if(c!=="center"){const g=Xx[t],m=No[g],p=oa[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[g]<b||e[m]<b?e[g]<e[m]?(c=Pu[l],d=u(p,m,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[m]<0&&e[g]>e[m]&&(c=Pu[l])}else{const g=a==="bottom"||a==="top"?"left":"top",m=No[g],p=oa[g],b=(n[p]-e[p])/2;(e[g]<b||e[m]<b)&&(e[g]>e[m]?(c=Vu[g],d=u(p,g,h)):(c=Vu[m],d=u(p,m,h)))}let f=a;return e[a]<n[oa[a]]&&e[a]<e[No[a]]&&(f=No[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function Ux(t,e){return e?qx[t]:jx[t]}function Kx(t,e,n,r,o,s){if(s)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const Gx=Jn([Jn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Jn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Jn("> *",{pointerEvents:"all"})])]),Mu=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Qt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),o=i.ref(null),s=()=>{const{syncTrigger:f}=t;f.includes("scroll")&&e.addScrollListener(c),f.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),s())});const l=bi();Gx.mount({id:"vueuc/binder",head:!0,anchorMetaName:ra,ssr:l}),i.onBeforeUnmount(()=>{a()}),yx(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const g=e.targetRef,{x:m,y:p,overlap:b}=t,y=m!==void 0&&p!==void 0?wx(m,p):ta(g);f.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:C,placement:x,internalShift:N,flip:$}=t;f.setAttribute("v-placement",x),b?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:w}=f;_==="target"?w.width=`${y.width}px`:_!==void 0?w.width=_:w.width="",C==="target"?w.minWidth=`${y.width}px`:C!==void 0?w.minWidth=C:w.minWidth="";const v=ta(f),k=ta(o.value),{left:B,top:R,placement:E}=Yx(x,y,v,N,$,b),P=Ux(E,b),{left:W,top:I,transform:Z}=Kx(E,k,y,R,B,b);f.setAttribute("v-placement",E),f.style.setProperty("--v-offset-left",`${Math.round(B)}px`),f.style.setProperty("--v-offset-top",`${Math.round(R)}px`),f.style.transform=`translateX(${W}) translateY(${I}) ${Z}`,f.style.setProperty("--v-transform-origin",P),f.style.transformOrigin=P};i.watch(n,f=>{f?(s(),d()):a()});const d=()=>{i.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{i.watch(i.toRef(t,f),c)}),["teleportDisabled"].forEach(f=>{i.watch(i.toRef(t,f),d)}),i.watch(i.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),f.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=Co(),h=Qt(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(Wx,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[mu,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var _i=[],Zx=function(){return _i.some(function(t){return t.activeTargets.length>0})},Qx=function(){return _i.some(function(t){return t.skippedTargets.length>0})},Au="ResizeObserver loop completed with undelivered notifications.",Jx=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Au}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Au),window.dispatchEvent(t)},Cr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Cr||(Cr={}));var wi=function(t){return Object.freeze(t)},ek=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,wi(this)}return t})(),Iu=(function(){function t(e,n,r,o){return this.x=e,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,wi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,o=e.top,s=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:o,right:s,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),sa=function(t){return t instanceof SVGElement&&"getBBox"in t},Ou=function(t){if(sa(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||t.getClientRects().length)},zu=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},tk=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Sr=typeof window<"u"?window:{},$o=new WeakMap,Du=/auto|scroll/,nk=/^tb|vertical/,ik=/msie|trident/i.test(Sr.navigator&&Sr.navigator.userAgent),kn=function(t){return parseFloat(t||"0")},Ji=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new ek((n?e:t)||0,(n?t:e)||0)},Lu=wi({devicePixelContentBoxSize:Ji(),borderBoxSize:Ji(),contentBoxSize:Ji(),contentRect:new Iu(0,0,0,0)}),Hu=function(t,e){if(e===void 0&&(e=!1),$o.has(t)&&!e)return $o.get(t);if(Ou(t))return $o.set(t,Lu),Lu;var n=getComputedStyle(t),r=sa(t)&&t.ownerSVGElement&&t.getBBox(),o=!ik&&n.boxSizing==="border-box",s=nk.test(n.writingMode||""),a=!r&&Du.test(n.overflowY||""),l=!r&&Du.test(n.overflowX||""),c=r?0:kn(n.paddingTop),d=r?0:kn(n.paddingRight),u=r?0:kn(n.paddingBottom),h=r?0:kn(n.paddingLeft),f=r?0:kn(n.borderTopWidth),g=r?0:kn(n.borderRightWidth),m=r?0:kn(n.borderBottomWidth),p=r?0:kn(n.borderLeftWidth),b=h+d,y=c+u,_=p+g,C=f+m,x=l?t.offsetHeight-C-t.clientHeight:0,N=a?t.offsetWidth-_-t.clientWidth:0,$=o?b+_:0,w=o?y+C:0,v=r?r.width:kn(n.width)-$-N,k=r?r.height:kn(n.height)-w-x,B=v+b+N+_,R=k+y+x+C,E=wi({devicePixelContentBoxSize:Ji(Math.round(v*devicePixelRatio),Math.round(k*devicePixelRatio),s),borderBoxSize:Ji(B,R,s),contentBoxSize:Ji(v,k,s),contentRect:new Iu(h,c,v,k)});return $o.set(t,E),E},Wu=function(t,e,n){var r=Hu(t,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Cr.DEVICE_PIXEL_CONTENT_BOX:return a;case Cr.BORDER_BOX:return o;default:return s}},rk=(function(){function t(e){var n=Hu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=wi([n.borderBoxSize]),this.contentBoxSize=wi([n.contentBoxSize]),this.devicePixelContentBoxSize=wi([n.devicePixelContentBoxSize])}return t})(),ju=function(t){if(Ou(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},ok=function(){var t=1/0,e=[];_i.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new rk(d.target),h=ju(d.target);l.push(u),d.lastReportedSize=Wu(d.target,d.observedBox),h<t&&(t=h)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var o=r[n];o()}return t},qu=function(t){_i.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(ju(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})},sk=function(){var t=0;for(qu(t);Zx();)t=ok(),qu(t);return Qx()&&Jx(),t>0},aa,Xu=[],ak=function(){return Xu.splice(0).forEach(function(t){return t()})},lk=function(t){if(!aa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return ak()}).observe(n,r),aa=function(){n.textContent="".concat(e?e--:e++)}}Xu.push(t),aa()},ck=function(t){lk(function(){requestAnimationFrame(t)})},Ro=0,dk=function(){return!!Ro},uk=250,hk={attributes:!0,characterData:!0,childList:!0,subtree:!0},Yu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Uu=function(t){return t===void 0&&(t=0),Date.now()+t},la=!1,fk=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=uk),!la){la=!0;var r=Uu(e);ck(function(){var o=!1;try{o=sk()}finally{if(la=!1,e=r-Uu(),!dk())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,hk)};document.body?n():Sr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Yu.forEach(function(n){return Sr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Yu.forEach(function(n){return Sr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),ca=new fk,Ku=function(t){!Ro&&t>0&&ca.start(),Ro+=t,!Ro&&ca.stop()},mk=function(t){return!sa(t)&&!tk(t)&&getComputedStyle(t).display==="inline"},gk=(function(){function t(e,n){this.target=e,this.observedBox=n||Cr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Wu(this.target,this.observedBox,!0);return mk(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),pk=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Eo=new WeakMap,Gu=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Po=(function(){function t(){}return t.connect=function(e,n){var r=new pk(e,n);Eo.set(e,r)},t.observe=function(e,n,r){var o=Eo.get(e),s=o.observationTargets.length===0;Gu(o.observationTargets,n)<0&&(s&&_i.push(o),o.observationTargets.push(new gk(n,r&&r.box)),Ku(1),ca.schedule())},t.unobserve=function(e,n){var r=Eo.get(e),o=Gu(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&_i.splice(_i.indexOf(r),1),r.observationTargets.splice(o,1),Ku(-1))},t.disconnect=function(e){var n=this,r=Eo.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),yk=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Po.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!zu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Po.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!zu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Po.unobserve(this,e)},t.prototype.disconnect=function(){Po.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class bk{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||yk)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Br=new bk,Fo=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(o){const{onResize:s}=t;s!==void 0&&s(o)}i.onMounted(()=>{const o=n.$el;if(o===void 0){xu("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){xu("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Br.registerHandler(o.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&Br.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Vo;function _k(){return typeof document>"u"?!1:(Vo===void 0&&("matchMedia"in window?Vo=window.matchMedia("(pointer:coarse)").matches:Vo=!1),Vo)}let da;function Zu(){return typeof document>"u"?1:(da===void 0&&(da="chrome"in window?window.devicePixelRatio:1),da)}const Qu="VVirtualListXScroll";function wk({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),o=i.ref(0),s=i.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new Ru(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=Qt(()=>{const d=s.value;return d!==null?Math.max(d.getBound(o.value)-1,0):0}),l=d=>{const u=s.value;return u!==null?u.sum(d):0},c=Qt(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return i.provide(Qu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Ju=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=i.inject(Qu);return{startIndex:t,endIndex:e,columns:n,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:o,getLeft:s,item:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:s});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),xk=Jn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),kk=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=bi();xk.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ra,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:P,defaultScrollKey:W}=t;P!=null?b({index:P}):W!=null&&b({key:W})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const o=Qt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let P=0;return t.columns.forEach(W=>{P+=W.width}),P}),s=i.computed(()=>{const P=new Map,{keyField:W}=t;return t.items.forEach((I,Z)=>{P.set(I[W],Z)}),P}),{scrollLeftRef:a,listWidthRef:l}=wk({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:P,itemSize:W,keyField:I}=t,Z=new Ru(P.length,W);return P.forEach((te,D)=>{const L=te[I],H=u.get(L);H!==void 0&&Z.add(D,H)}),Z}),f=i.ref(0),g=i.ref(0),m=Qt(()=>Math.max(h.value.getBound(g.value-xr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:P}=d;if(P===void 0)return[];const{items:W,itemSize:I}=t,Z=m.value,te=Math.min(Z+Math.ceil(P/I+1),W.length-1),D=[];for(let L=Z;L<=te;++L)D.push(W[L]);return D}),b=(P,W)=>{if(typeof P=="number"){x(P,W,"auto");return}const{left:I,top:Z,index:te,key:D,position:L,behavior:H,debounce:z=!0}=P;if(I!==void 0||Z!==void 0)x(I,Z,H);else if(te!==void 0)C(te,H,z);else if(D!==void 0){const O=s.value.get(D);O!==void 0&&C(O,H,z)}else L==="bottom"?x(0,Number.MAX_SAFE_INTEGER,H):L==="top"&&x(0,0,H)};let y,_=null;function C(P,W,I){const{value:Z}=h,te=Z.sum(P)+xr(t.paddingTop);if(!I)c.value.scrollTo({left:0,top:te,behavior:W});else{y=P,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:D,offsetHeight:L}=c.value;if(te>D){const H=Z.get(P);te+H<=D+L||c.value.scrollTo({left:0,top:te+H-L,behavior:W})}else c.value.scrollTo({left:0,top:te,behavior:W})}}function x(P,W,I){c.value.scrollTo({left:P,top:W,behavior:I})}function N(P,W){var I,Z,te;if(n||t.ignoreItemResize||E(W.target))return;const{value:D}=h,L=s.value.get(P),H=D.get(L),z=(te=(Z=(I=W.borderBoxSize)===null||I===void 0?void 0:I[0])===null||Z===void 0?void 0:Z.blockSize)!==null&&te!==void 0?te:W.contentRect.height;if(z===H)return;z-t.itemSize===0?u.delete(P):u.set(P,z-t.itemSize);const U=z-H;if(U===0)return;D.add(L,U);const K=c.value;if(K!=null){if(y===void 0){const V=D.sum(L);K.scrollTop>V&&K.scrollBy(0,U)}else if(L<y)K.scrollBy(0,U);else if(L===y){const V=D.sum(L);z+V>K.scrollTop+K.offsetHeight&&K.scrollBy(0,U)}R()}f.value++}const $=!_k();let w=!1;function v(P){var W;(W=t.onScroll)===null||W===void 0||W.call(t,P),(!$||!w)&&R()}function k(P){var W;if((W=t.onWheel)===null||W===void 0||W.call(t,P),$){const I=c.value;if(I!=null){if(P.deltaX===0&&(I.scrollTop===0&&P.deltaY<=0||I.scrollTop+I.offsetHeight>=I.scrollHeight&&P.deltaY>=0))return;P.preventDefault(),I.scrollTop+=P.deltaY/Zu(),I.scrollLeft+=P.deltaX/Zu(),R(),w=!0,iu(()=>{w=!1})}}}function B(P){if(n||E(P.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(P.contentRect.height===d.value)return}else if(P.contentRect.height===d.value&&P.contentRect.width===l.value)return;d.value=P.contentRect.height,l.value=P.contentRect.width;const{onResize:W}=t;W!==void 0&&W(P)}function R(){const{value:P}=c;P!=null&&(g.value=P.scrollTop,a.value=P.scrollLeft)}function E(P){let W=P;for(;W!==null;){if(W.style.display==="none")return!0;W=W.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:i.computed(()=>{const{itemResizable:P}=t,W=kr(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:kr(o.value),height:P?"":W,minHeight:P?W:"",paddingTop:kr(t.paddingTop),paddingBottom:kr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${kr(h.value.sum(m.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:B,handleListScroll:v,handleListWheel:k,handleItemResize:N}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Fo,{onResize:this.handleListResize},{default:()=>{var o,s;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=n.get(d),h=a!=null?i.h(Ju,{index:u,item:c}):void 0,f=l!=null?i.h(Ju,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?i.h(Fo,{key:d,onResize:m=>this.handleItemResize(d,m)},{default:()=>g}):(g.key=d,g)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Pn="v-hidden",vk=Jn("[v-hidden]",{display:"none!important"}),eh=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function o(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Pn)&&u.removeAttribute(Pn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const C of h)C.hasAttribute(Pn)&&C.removeAttribute(Pn);const f=l.offsetWidth,g=[],m=e.tail?d==null?void 0:d():null;let p=m?m.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let C=0;C<y-1;++C){if(C<0)continue;const x=h[C];if(b){x.hasAttribute(Pn)||x.setAttribute(Pn,"");continue}else x.hasAttribute(Pn)&&x.removeAttribute(Pn);const N=x.offsetWidth;if(p+=N,g[C]=N,p>f){const{updateCounter:$}=t;for(let w=C;w>=0;--w){const v=y-1-w;$!==void 0?$(v):u.textContent=`${v}`;const k=u.offsetWidth;if(p-=g[w],p+k<=f||w===0){b=!0,C=w-1,m&&(C===-1?(m.style.maxWidth=`${f-k}px`,m.style.boxSizing="border-box"):m.style.maxWidth="");const{onUpdateCount:B}=t;B&&B(v);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Pn,""))}const s=bi();return vk.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ra,ssr:s}),i.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:o}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function th(t){return t instanceof HTMLElement}function nh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(th(n)&&(rh(n)||nh(n)))return!0}return!1}function ih(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(th(n)&&(rh(n)||ih(n)))return!0}return!1}function rh(t){if(!Ck(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function Ck(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Tr=[];const Sk=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=Fw(),n=i.ref(null),r=i.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Tr[Tr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(h(),Pt("keydown",document,c)):(ct("keydown",document,c),o&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{ct("keydown",document,c),o&&f()});function d(b){if(!s&&l()){const y=u();if(y===null||y.contains(wr(b)))return;g("first")}}function u(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function h(){var b;if(!t.disabled){if(Tr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?g("first"):(b=Eu(y))===null||b===void 0||b.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function f(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),Tr=Tr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=Eu(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function g(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const C=u();if(C==null||C===_){s=!0,y.focus({preventScroll:!0}),s=!1;return}s=!0;const x=b==="first"?nh(C):ih(C);s=!1,x||(s=!0,y.focus({preventScroll:!0}),s=!1)}}}function m(b){if(s)return;const y=u();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?g("last"):g("first"))}function p(b){s||(b.relatedTarget!==null&&b.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:m,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function r3(t){return t}const ua="n-internal-select-menu",oh="n-internal-select-menu-body",sh="n-drawer-body",ah="n-modal-body",lh="n-popover-body",ch="__disabled__";function Fn(t){const e=i.inject(ah,null),n=i.inject(sh,null),r=i.inject(lh,null),o=i.inject(oh,null),s=i.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};i.onMounted(()=>{Pt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{ct("fullscreenchange",document,a)})}return Qt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?ch:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}Fn.tdkey=ch,Fn.propTo={type:[String,Object,Boolean],default:void 0};function Bk(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function dh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&Br.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&Br.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&Br.unregisterHandler(n)}))}function uh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const Tk=/^(\d|\.)+$/,hh=/(\d|\.)+/;function ha(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+n)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(Tk.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=hh.exec(t);return o?t.replace(hh,String((Number(o[0])+n)*e)):t}return t}function fh(t){const{left:e,right:n,top:r,bottom:o}=rn(t);return`${r} ${e} ${o} ${n}`}var mh={};function Nk(t){let e=".",n="__",r="--",o;if(t){let m=t.blockPrefix;m&&(e=m),m=t.elementPrefix,m&&(n=m),m=t.modifierPrefix,m&&(r=m)}const s={install(m){o=m.c;const p=m.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(m){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return m=typeof m=="string"?m:m({context:y,props:_}),y.bem.b=m,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(m){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return m=typeof m=="string"?m:m({context:b,props:y}),b.bem.els=m.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(m){return{$({context:p,props:b}){m=typeof m=="string"?m:m({context:p,props:b});const y=m.split(",").map(x=>x.trim());function _(x){return y.map(N=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${x!==void 0?`${n}${x}`:""}${r}${N}`).join(", ")}const C=p.bem.els;if(C!==null){if(mh.NODE_ENV!=="production"&&C.length>=2)throw Error(`[css-render/plugin-bem]: m(${m}) is invalid, using modifier inside multiple elements is not allowed`);return _(C[0])}else return _()}}}function d(m){return{$({context:p,props:b}){m=typeof m=="string"?m:m({context:p,props:b});const y=p.bem.els;if(mh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${m}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${m})`}}}return Object.assign(s,{cB:((...m)=>o(a(m[0]),m[1],m[2])),cE:((...m)=>o(l(m[0]),m[1],m[2])),cM:((...m)=>o(c(m[0]),m[1],m[2])),cNotM:((...m)=>o(d(m[0]),m[1],m[2]))}),s}const $k=".n-",Rk="__",Ek="--",gh=Nu(),ph=Nk({blockPrefix:$k,elementPrefix:Rk,modifierPrefix:Ek});gh.use(ph);const{c:he,find:s3}=gh,{cB:ye,cE:we,cM:Re,cNotM:on}=ph,Pk=(...t)=>he(">",[ye(...t)]);function et(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let fa;function Fk(){return fa===void 0&&(fa=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),fa}const Vk=new WeakSet;function Mk(t){Vk.add(t)}function yh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const bh=new Set;function ei(t,e){const n=`[naive/${t}]: ${e}`;bh.has(n)||(bh.add(n),console.error(n))}function _h(t,e){console.error(`[naive/${t}]: ${e}`)}function wh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function xt(t,...e){if(Array.isArray(t))t.forEach(n=>xt(n,...e));else return t(...e)}function ma(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ma(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ma(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function Ak(t,e="default",n=void 0){const r=t[e];if(!r)return _h("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=ma(r(n));return o.length===1?o[0]:(_h("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function Ik(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function ga(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function er(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Mo(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Mo(e.children)):!0)?t:null}function pa(t,e){return t&&Mo(t())||e()}function xi(t,e){const n=t&&Mo(t());return e(n||null)}function xh(t){return!(t&&Mo(t()))}const ya=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ki="n-config-provider",Ok="n";function vi(t={},e={defaultBordered:!0}){const n=i.inject(ki,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,o;const{bordered:s}=t;return s!==void 0?s:(o=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(Ok),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Ci(t,e,n,r){n||wh("useThemeClass","cssVarsRef is not passed");const o=i.inject(ki,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=i.ref(""),c=bi();let d;const u=`__${t}`,h=()=>{let f=u;const g=e?e.value:void 0,m=s==null?void 0:s.value;m&&(f+=`-${m}`),g&&(f+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(f+=`-${ia(JSON.stringify(p))}`),b&&(f+=`-${ia(JSON.stringify(b))}`),l.value=f,d=()=>{const y=n.value;let _="";for(const C in y)_+=`${C}: ${y[C]};`;he(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const kh="n-form-item";function zk(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const o=i.inject(kh,null);i.provide(kh,null);const s=i.computed(n?()=>n(o):()=>{const{size:c}=t;if(c)return c;if(o){const{mergedSize:d}=o;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{o&&o.restoreValidation()}),{mergedSizeRef:s,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}const Dk={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ba(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Nr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;o=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function $r(t){return(e,n={})=>{const r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(o);if(!s)return null;const a=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Hk(l,h=>h.test(a)):Lk(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function Lk(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Hk(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Wk(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const o=r[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const jk={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"}},qk=(t,e,n)=>{let r;const o=jk[t];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},Xk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Yk=(t,e,n,r)=>Xk[t],Uk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Kk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Gk={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"]},Zk={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"]},Qk={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"}},Jk={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"}},ev={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Nr({values:Uk,defaultWidth:"wide"}),quarter:Nr({values:Kk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Nr({values:Gk,defaultWidth:"wide"}),day:Nr({values:Zk,defaultWidth:"wide"}),dayPeriod:Nr({values:Qk,defaultWidth:"wide",formattingValues:Jk,defaultFormattingWidth:"wide"})},tv=/^(\d+)(th|st|nd|rd)?/i,nv=/\d+/i,iv={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},rv={any:[/^b/i,/^(a|c)/i]},ov={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},sv={any:[/1/i,/2/i,/3/i,/4/i]},av={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},lv={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]},cv={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},dv={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]},uv={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},hv={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}},fv={ordinalNumber:Wk({matchPattern:tv,parsePattern:nv,valueCallback:t=>parseInt(t,10)}),era:$r({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:rv,defaultParseWidth:"any"}),quarter:$r({matchPatterns:ov,defaultMatchWidth:"wide",parsePatterns:sv,defaultParseWidth:"any",valueCallback:t=>t+1}),month:$r({matchPatterns:av,defaultMatchWidth:"wide",parsePatterns:lv,defaultParseWidth:"any"}),day:$r({matchPatterns:cv,defaultMatchWidth:"wide",parsePatterns:dv,defaultParseWidth:"any"}),dayPeriod:$r({matchPatterns:uv,defaultMatchWidth:"any",parsePatterns:hv,defaultParseWidth:"any"})},mv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},gv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},pv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},yv={date:ba({formats:mv,defaultWidth:"full"}),time:ba({formats:gv,defaultWidth:"full"}),dateTime:ba({formats:pv,defaultWidth:"full"})},bv={name:"en-US",locale:{code:"en-US",formatDistance:qk,formatLong:yv,formatRelative:Yk,localize:ev,match:fv,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function vh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ki,null)||{},r=i.computed(()=>{var s,a;return(a=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[t])!==null&&a!==void 0?a:Dk[t]});return{dateLocaleRef:i.computed(()=>{var s;return(s=n==null?void 0:n.value)!==null&&s!==void 0?s:bv}),localeRef:r}}const Rr="naive-ui-style";function Er(t,e,n){if(!e)return;const r=bi(),o=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=i.inject(ki,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(Hx(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Rr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():i.onBeforeMount(a),o}const Pr={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:_v,fontFamily:wv,lineHeight:xv}=Pr,Ch=he("body",`
116
+ `)}function ia(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function Mx(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(vu),e.els=[];else{const s=So(n,r);s&&o.includes(s)&&(vu(s),e.els=o.filter(a=>a!==s))}}function Tu(t,e){t.push(e)}function Ax(t,e,n,r,o,s,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=ia(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=So(n,l);if(u!==null&&!s)return u;const h=u??Rx(n);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const f=l.querySelector(`meta[name="${a}"]`);if(f)return l.insertBefore(h,f),Tu(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),Tu(e.els,h),h}function Ix(t){return Vx(this,this.instance,t)}function Ox(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return Ax(this.instance,this,e,r,o,s,a,l,n)}function zx(t={}){const{id:e,parent:n}=t;Mx(this.instance,this,e,n)}const To=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:Ix,mount:Ox,unmount:zx}},Dx=function(t,e,n,r){return Array.isArray(e)?To(t,{$:null},null,e):Array.isArray(n)?To(t,e,null,n):Array.isArray(r)?To(t,e,n,r):To(t,e,n,null)};function Nu(t={}){const e={c:((...n)=>Dx(e,...n)),use:(n,...r)=>n.install(e,...r),find:So,context:{},config:t};return e}function Lx(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return So(t)!==null}const{c:Jn}=Nu(),ra="vueuc-style";function $u(t){return t&-t}class Ru{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=n,e+=$u(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=e*r;for(;e>0;)s+=n[e],e-=$u(e);return s}getBound(e){let n=0,r=this.l;for(;r>n;){const o=Math.floor((n+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(n===o)return this.sum(n+1)<=e?n+1:o;n=o}else return o}return n}}function Eu(t){return typeof t=="string"?document.querySelector(t):t()||null}const Hx=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:mx(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Js("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Js("lazy-teleport",this.$slots)):null}}),No={top:"bottom",bottom:"top",left:"right",right:"left"},Pu={start:"end",center:"center",end:"start"},oa={top:"height",bottom:"height",left:"width",right:"width"},Wx={"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"},jx={"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"},qx={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Fu={top:!0,bottom:!1,left:!0,right:!1},Vu={top:"end",bottom:"start",left:"end",right:"start"};function Xx(t,e,n,r,o,s){if(!o||s)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const u=(g,m,p)=>{let b=0,y=0;const _=n[g]-e[m]-e[g];return _>0&&r&&(p?y=Fu[m]?_:-_:b=Fu[m]?_:-_),{left:b,top:y}},h=a==="left"||a==="right";if(c!=="center"){const g=qx[t],m=No[g],p=oa[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const b=(n[p]-e[p])/2;e[g]<b||e[m]<b?e[g]<e[m]?(c=Pu[l],d=u(p,m,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[m]<0&&e[g]>e[m]&&(c=Pu[l])}else{const g=a==="bottom"||a==="top"?"left":"top",m=No[g],p=oa[g],b=(n[p]-e[p])/2;(e[g]<b||e[m]<b)&&(e[g]>e[m]?(c=Vu[g],d=u(p,g,h)):(c=Vu[m],d=u(p,m,h)))}let f=a;return e[a]<n[oa[a]]&&e[a]<e[No[a]]&&(f=No[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function Yx(t,e){return e?jx[t]:Wx[t]}function Ux(t,e,n,r,o,s){if(s)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const Kx=Jn([Jn(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),Jn(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[Jn("> *",{pointerEvents:"all"})])]),Mu=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Qt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),o=i.ref(null),s=()=>{const{syncTrigger:f}=t;f.includes("scroll")&&e.addScrollListener(c),f.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),s())});const l=bi();Kx.mount({id:"vueuc/binder",head:!0,anchorMetaName:ra,ssr:l}),i.onBeforeUnmount(()=>{a()}),px(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const g=e.targetRef,{x:m,y:p,overlap:b}=t,y=m!==void 0&&p!==void 0?_x(m,p):ta(g);f.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:C,placement:x,internalShift:N,flip:$}=t;f.setAttribute("v-placement",x),b?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:w}=f;_==="target"?w.width=`${y.width}px`:_!==void 0?w.width=_:w.width="",C==="target"?w.minWidth=`${y.width}px`:C!==void 0?w.minWidth=C:w.minWidth="";const v=ta(f),k=ta(o.value),{left:B,top:R,placement:E}=Xx(x,y,v,N,$,b),P=Yx(E,b),{left:W,top:I,transform:Z}=Ux(E,k,y,R,B,b);f.setAttribute("v-placement",E),f.style.setProperty("--v-offset-left",`${Math.round(B)}px`),f.style.setProperty("--v-offset-top",`${Math.round(R)}px`),f.style.transform=`translateX(${W}) translateY(${I}) ${Z}`,f.style.setProperty("--v-transform-origin",P),f.style.transformOrigin=P};i.watch(n,f=>{f?(s(),d()):a()});const d=()=>{i.nextTick().then(c).catch(f=>console.error(f))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(f=>{i.watch(i.toRef(t,f),c)}),["teleportDisabled"].forEach(f=>{i.watch(i.toRef(t,f),d)}),i.watch(i.toRef(t,"syncTrigger"),f=>{f.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),f.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=Co(),h=Qt(()=>{const{to:f}=t;if(f!==void 0)return f;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(Hx,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[mu,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var _i=[],Gx=function(){return _i.some(function(t){return t.activeTargets.length>0})},Zx=function(){return _i.some(function(t){return t.skippedTargets.length>0})},Au="ResizeObserver loop completed with undelivered notifications.",Qx=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Au}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Au),window.dispatchEvent(t)},Cr;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Cr||(Cr={}));var wi=function(t){return Object.freeze(t)},Jx=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,wi(this)}return t})(),Iu=(function(){function t(e,n,r,o){return this.x=e,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,wi(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,o=e.top,s=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:o,right:s,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),sa=function(t){return t instanceof SVGElement&&"getBBox"in t},Ou=function(t){if(sa(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||t.getClientRects().length)},zu=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},ek=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Sr=typeof window<"u"?window:{},$o=new WeakMap,Du=/auto|scroll/,tk=/^tb|vertical/,nk=/msie|trident/i.test(Sr.navigator&&Sr.navigator.userAgent),kn=function(t){return parseFloat(t||"0")},Ji=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Jx((n?e:t)||0,(n?t:e)||0)},Lu=wi({devicePixelContentBoxSize:Ji(),borderBoxSize:Ji(),contentBoxSize:Ji(),contentRect:new Iu(0,0,0,0)}),Hu=function(t,e){if(e===void 0&&(e=!1),$o.has(t)&&!e)return $o.get(t);if(Ou(t))return $o.set(t,Lu),Lu;var n=getComputedStyle(t),r=sa(t)&&t.ownerSVGElement&&t.getBBox(),o=!nk&&n.boxSizing==="border-box",s=tk.test(n.writingMode||""),a=!r&&Du.test(n.overflowY||""),l=!r&&Du.test(n.overflowX||""),c=r?0:kn(n.paddingTop),d=r?0:kn(n.paddingRight),u=r?0:kn(n.paddingBottom),h=r?0:kn(n.paddingLeft),f=r?0:kn(n.borderTopWidth),g=r?0:kn(n.borderRightWidth),m=r?0:kn(n.borderBottomWidth),p=r?0:kn(n.borderLeftWidth),b=h+d,y=c+u,_=p+g,C=f+m,x=l?t.offsetHeight-C-t.clientHeight:0,N=a?t.offsetWidth-_-t.clientWidth:0,$=o?b+_:0,w=o?y+C:0,v=r?r.width:kn(n.width)-$-N,k=r?r.height:kn(n.height)-w-x,B=v+b+N+_,R=k+y+x+C,E=wi({devicePixelContentBoxSize:Ji(Math.round(v*devicePixelRatio),Math.round(k*devicePixelRatio),s),borderBoxSize:Ji(B,R,s),contentBoxSize:Ji(v,k,s),contentRect:new Iu(h,c,v,k)});return $o.set(t,E),E},Wu=function(t,e,n){var r=Hu(t,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Cr.DEVICE_PIXEL_CONTENT_BOX:return a;case Cr.BORDER_BOX:return o;default:return s}},ik=(function(){function t(e){var n=Hu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=wi([n.borderBoxSize]),this.contentBoxSize=wi([n.contentBoxSize]),this.devicePixelContentBoxSize=wi([n.devicePixelContentBoxSize])}return t})(),ju=function(t){if(Ou(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},rk=function(){var t=1/0,e=[];_i.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new ik(d.target),h=ju(d.target);l.push(u),d.lastReportedSize=Wu(d.target,d.observedBox),h<t&&(t=h)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var o=r[n];o()}return t},qu=function(t){_i.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(ju(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})},ok=function(){var t=0;for(qu(t);Gx();)t=rk(),qu(t);return Zx()&&Qx(),t>0},aa,Xu=[],sk=function(){return Xu.splice(0).forEach(function(t){return t()})},ak=function(t){if(!aa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return sk()}).observe(n,r),aa=function(){n.textContent="".concat(e?e--:e++)}}Xu.push(t),aa()},lk=function(t){ak(function(){requestAnimationFrame(t)})},Ro=0,ck=function(){return!!Ro},dk=250,uk={attributes:!0,characterData:!0,childList:!0,subtree:!0},Yu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Uu=function(t){return t===void 0&&(t=0),Date.now()+t},la=!1,hk=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=dk),!la){la=!0;var r=Uu(e);lk(function(){var o=!1;try{o=ok()}finally{if(la=!1,e=r-Uu(),!ck())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,uk)};document.body?n():Sr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Yu.forEach(function(n){return Sr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Yu.forEach(function(n){return Sr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),ca=new hk,Ku=function(t){!Ro&&t>0&&ca.start(),Ro+=t,!Ro&&ca.stop()},fk=function(t){return!sa(t)&&!ek(t)&&getComputedStyle(t).display==="inline"},mk=(function(){function t(e,n){this.target=e,this.observedBox=n||Cr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Wu(this.target,this.observedBox,!0);return fk(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),gk=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Eo=new WeakMap,Gu=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Po=(function(){function t(){}return t.connect=function(e,n){var r=new gk(e,n);Eo.set(e,r)},t.observe=function(e,n,r){var o=Eo.get(e),s=o.observationTargets.length===0;Gu(o.observationTargets,n)<0&&(s&&_i.push(o),o.observationTargets.push(new mk(n,r&&r.box)),Ku(1),ca.schedule())},t.unobserve=function(e,n){var r=Eo.get(e),o=Gu(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&_i.splice(_i.indexOf(r),1),r.observationTargets.splice(o,1),Ku(-1))},t.disconnect=function(e){var n=this,r=Eo.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),pk=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Po.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!zu(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Po.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!zu(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Po.unobserve(this,e)},t.prototype.disconnect=function(){Po.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class yk{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||pk)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Br=new yk,Fo=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(o){const{onResize:s}=t;s!==void 0&&s(o)}i.onMounted(()=>{const o=n.$el;if(o===void 0){xu("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){xu("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Br.registerHandler(o.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&Br.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Vo;function bk(){return typeof document>"u"?!1:(Vo===void 0&&("matchMedia"in window?Vo=window.matchMedia("(pointer:coarse)").matches:Vo=!1),Vo)}let da;function Zu(){return typeof document>"u"?1:(da===void 0&&(da="chrome"in window?window.devicePixelRatio:1),da)}const Qu="VVirtualListXScroll";function _k({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),o=i.ref(0),s=i.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new Ru(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=Qt(()=>{const d=s.value;return d!==null?Math.max(d.getBound(o.value)-1,0):0}),l=d=>{const u=s.value;return u!==null?u.sum(d):0},c=Qt(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return i.provide(Qu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Ju=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=i.inject(Qu);return{startIndex:t,endIndex:e,columns:n,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:o,getLeft:s,item:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:s});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),wk=Jn(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[Jn("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[Jn("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),xk=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=bi();wk.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:ra,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:P,defaultScrollKey:W}=t;P!=null?b({index:P}):W!=null&&b({key:W})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}b({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const o=Qt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let P=0;return t.columns.forEach(W=>{P+=W.width}),P}),s=i.computed(()=>{const P=new Map,{keyField:W}=t;return t.items.forEach((I,Z)=>{P.set(I[W],Z)}),P}),{scrollLeftRef:a,listWidthRef:l}=_k({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:P,itemSize:W,keyField:I}=t,Z=new Ru(P.length,W);return P.forEach((te,D)=>{const L=te[I],H=u.get(L);H!==void 0&&Z.add(D,H)}),Z}),f=i.ref(0),g=i.ref(0),m=Qt(()=>Math.max(h.value.getBound(g.value-xr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:P}=d;if(P===void 0)return[];const{items:W,itemSize:I}=t,Z=m.value,te=Math.min(Z+Math.ceil(P/I+1),W.length-1),D=[];for(let L=Z;L<=te;++L)D.push(W[L]);return D}),b=(P,W)=>{if(typeof P=="number"){x(P,W,"auto");return}const{left:I,top:Z,index:te,key:D,position:L,behavior:H,debounce:z=!0}=P;if(I!==void 0||Z!==void 0)x(I,Z,H);else if(te!==void 0)C(te,H,z);else if(D!==void 0){const O=s.value.get(D);O!==void 0&&C(O,H,z)}else L==="bottom"?x(0,Number.MAX_SAFE_INTEGER,H):L==="top"&&x(0,0,H)};let y,_=null;function C(P,W,I){const{value:Z}=h,te=Z.sum(P)+xr(t.paddingTop);if(!I)c.value.scrollTo({left:0,top:te,behavior:W});else{y=P,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:D,offsetHeight:L}=c.value;if(te>D){const H=Z.get(P);te+H<=D+L||c.value.scrollTo({left:0,top:te+H-L,behavior:W})}else c.value.scrollTo({left:0,top:te,behavior:W})}}function x(P,W,I){c.value.scrollTo({left:P,top:W,behavior:I})}function N(P,W){var I,Z,te;if(n||t.ignoreItemResize||E(W.target))return;const{value:D}=h,L=s.value.get(P),H=D.get(L),z=(te=(Z=(I=W.borderBoxSize)===null||I===void 0?void 0:I[0])===null||Z===void 0?void 0:Z.blockSize)!==null&&te!==void 0?te:W.contentRect.height;if(z===H)return;z-t.itemSize===0?u.delete(P):u.set(P,z-t.itemSize);const U=z-H;if(U===0)return;D.add(L,U);const K=c.value;if(K!=null){if(y===void 0){const V=D.sum(L);K.scrollTop>V&&K.scrollBy(0,U)}else if(L<y)K.scrollBy(0,U);else if(L===y){const V=D.sum(L);z+V>K.scrollTop+K.offsetHeight&&K.scrollBy(0,U)}R()}f.value++}const $=!bk();let w=!1;function v(P){var W;(W=t.onScroll)===null||W===void 0||W.call(t,P),(!$||!w)&&R()}function k(P){var W;if((W=t.onWheel)===null||W===void 0||W.call(t,P),$){const I=c.value;if(I!=null){if(P.deltaX===0&&(I.scrollTop===0&&P.deltaY<=0||I.scrollTop+I.offsetHeight>=I.scrollHeight&&P.deltaY>=0))return;P.preventDefault(),I.scrollTop+=P.deltaY/Zu(),I.scrollLeft+=P.deltaX/Zu(),R(),w=!0,iu(()=>{w=!1})}}}function B(P){if(n||E(P.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(P.contentRect.height===d.value)return}else if(P.contentRect.height===d.value&&P.contentRect.width===l.value)return;d.value=P.contentRect.height,l.value=P.contentRect.width;const{onResize:W}=t;W!==void 0&&W(P)}function R(){const{value:P}=c;P!=null&&(g.value=P.scrollTop,a.value=P.scrollLeft)}function E(P){let W=P;for(;W!==null;){if(W.style.display==="none")return!0;W=W.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:i.computed(()=>{const{itemResizable:P}=t,W=kr(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:kr(o.value),height:P?"":W,minHeight:P?W:"",paddingTop:kr(t.paddingTop),paddingBottom:kr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${kr(h.value.sum(m.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:b,handleListResize:B,handleListScroll:v,handleListWheel:k,handleItemResize:N}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Fo,{onResize:this.handleListResize},{default:()=>{var o,s;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=n.get(d),h=a!=null?i.h(Ju,{index:u,item:c}):void 0,f=l!=null?i.h(Ju,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?i.h(Fo,{key:d,onResize:m=>this.handleItemResize(d,m)},{default:()=>g}):(g.key=d,g)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Pn="v-hidden",kk=Jn("[v-hidden]",{display:"none!important"}),eh=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function o(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Pn)&&u.removeAttribute(Pn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const C of h)C.hasAttribute(Pn)&&C.removeAttribute(Pn);const f=l.offsetWidth,g=[],m=e.tail?d==null?void 0:d():null;let p=m?m.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let C=0;C<y-1;++C){if(C<0)continue;const x=h[C];if(b){x.hasAttribute(Pn)||x.setAttribute(Pn,"");continue}else x.hasAttribute(Pn)&&x.removeAttribute(Pn);const N=x.offsetWidth;if(p+=N,g[C]=N,p>f){const{updateCounter:$}=t;for(let w=C;w>=0;--w){const v=y-1-w;$!==void 0?$(v):u.textContent=`${v}`;const k=u.offsetWidth;if(p-=g[w],p+k<=f||w===0){b=!0,C=w-1,m&&(C===-1?(m.style.maxWidth=`${f-k}px`,m.style.boxSizing="border-box"):m.style.maxWidth="");const{onUpdateCount:B}=t;B&&B(v);break}}}}const{onUpdateOverflow:_}=t;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Pn,""))}const s=bi();return kk.mount({id:"vueuc/overflow",head:!0,anchorMetaName:ra,ssr:s}),i.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:o}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function th(t){return t instanceof HTMLElement}function nh(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(th(n)&&(rh(n)||nh(n)))return!0}return!1}function ih(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(th(n)&&(rh(n)||ih(n)))return!0}return!1}function rh(t){if(!vk(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function vk(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Tr=[];const Ck=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=Pw(),n=i.ref(null),r=i.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Tr[Tr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=t.onEsc)===null||y===void 0||y.call(t,b))}i.onMounted(()=>{i.watch(()=>t.active,b=>{b?(h(),Pt("keydown",document,c)):(ct("keydown",document,c),o&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{ct("keydown",document,c),o&&f()});function d(b){if(!s&&l()){const y=u();if(y===null||y.contains(wr(b)))return;g("first")}}function u(){const b=n.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function h(){var b;if(!t.disabled){if(Tr.push(e),t.autoFocus){const{initialFocusTo:y}=t;y===void 0?g("first"):(b=Eu(y))===null||b===void 0||b.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function f(){var b;if(t.disabled||(document.removeEventListener("focus",d,!0),Tr=Tr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=t;y!==void 0?(b=Eu(y))===null||b===void 0||b.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function g(b){if(l()&&t.active){const y=n.value,_=r.value;if(y!==null&&_!==null){const C=u();if(C==null||C===_){s=!0,y.focus({preventScroll:!0}),s=!1;return}s=!0;const x=b==="first"?nh(C):ih(C);s=!1,x||(s=!0,y.focus({preventScroll:!0}),s=!1)}}}function m(b){if(s)return;const y=u();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?g("last"):g("first"))}function p(b){s||(b.relatedTarget!==null&&b.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:m,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function i3(t){return t}const ua="n-internal-select-menu",oh="n-internal-select-menu-body",sh="n-drawer-body",ah="n-modal-body",lh="n-popover-body",ch="__disabled__";function Fn(t){const e=i.inject(ah,null),n=i.inject(sh,null),r=i.inject(lh,null),o=i.inject(oh,null),s=i.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};i.onMounted(()=>{Pt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{ct("fullscreenchange",document,a)})}return Qt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?ch:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}Fn.tdkey=ch,Fn.propTo={type:[String,Object,Boolean],default:void 0};function Sk(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function dh(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&Br.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&Br.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&Br.unregisterHandler(n)}))}function uh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const Bk=/^(\d|\.)+$/,hh=/(\d|\.)+/;function ha(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+n)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(Bk.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=hh.exec(t);return o?t.replace(hh,String((Number(o[0])+n)*e)):t}return t}function fh(t){const{left:e,right:n,top:r,bottom:o}=rn(t);return`${r} ${e} ${o} ${n}`}var mh={};function Tk(t){let e=".",n="__",r="--",o;if(t){let m=t.blockPrefix;m&&(e=m),m=t.elementPrefix,m&&(n=m),m=t.modifierPrefix,m&&(r=m)}const s={install(m){o=m.c;const p=m.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(m){let p,b;return{before(y){p=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=p,y.bem.els=b},$({context:y,props:_}){return m=typeof m=="string"?m:m({context:y,props:_}),y.bem.b=m,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(m){let p;return{before(b){p=b.bem.els},after(b){b.bem.els=p},$({context:b,props:y}){return m=typeof m=="string"?m:m({context:b,props:y}),b.bem.els=m.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${n}${_}`).join(", ")}}}function c(m){return{$({context:p,props:b}){m=typeof m=="string"?m:m({context:p,props:b});const y=m.split(",").map(x=>x.trim());function _(x){return y.map(N=>`&${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${x!==void 0?`${n}${x}`:""}${r}${N}`).join(", ")}const C=p.bem.els;if(C!==null){if(mh.NODE_ENV!=="production"&&C.length>=2)throw Error(`[css-render/plugin-bem]: m(${m}) is invalid, using modifier inside multiple elements is not allowed`);return _(C[0])}else return _()}}}function d(m){return{$({context:p,props:b}){m=typeof m=="string"?m:m({context:p,props:b});const y=p.bem.els;if(mh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${m}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${p.bem.b}${y!==null&&y.length>0?`${n}${y[0]}`:""}${r}${m})`}}}return Object.assign(s,{cB:((...m)=>o(a(m[0]),m[1],m[2])),cE:((...m)=>o(l(m[0]),m[1],m[2])),cM:((...m)=>o(c(m[0]),m[1],m[2])),cNotM:((...m)=>o(d(m[0]),m[1],m[2]))}),s}const Nk=".n-",$k="__",Rk="--",gh=Nu(),ph=Tk({blockPrefix:Nk,elementPrefix:$k,modifierPrefix:Rk});gh.use(ph);const{c:he,find:o3}=gh,{cB:ye,cE:we,cM:Re,cNotM:on}=ph,Ek=(...t)=>he(">",[ye(...t)]);function et(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let fa;function Pk(){return fa===void 0&&(fa=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),fa}const Fk=new WeakSet;function Vk(t){Fk.add(t)}function yh(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const bh=new Set;function ei(t,e){const n=`[naive/${t}]: ${e}`;bh.has(n)||(bh.add(n),console.error(n))}function _h(t,e){console.error(`[naive/${t}]: ${e}`)}function wh(t,e){throw new Error(`[naive/${t}]: ${e}`)}function xt(t,...e){if(Array.isArray(t))t.forEach(n=>xt(n,...e));else return t(...e)}function ma(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ma(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ma(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function Mk(t,e="default",n=void 0){const r=t[e];if(!r)return _h("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=ma(r(n));return o.length===1?o[0]:(_h("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function Ak(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function ga(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function er(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function Mo(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!Mo(e.children)):!0)?t:null}function pa(t,e){return t&&Mo(t())||e()}function xi(t,e){const n=t&&Mo(t());return e(n||null)}function xh(t){return!(t&&Mo(t()))}const ya=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),ki="n-config-provider",Ik="n";function vi(t={},e={defaultBordered:!0}){const n=i.inject(ki,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,o;const{bordered:s}=t;return s!==void 0?s:(o=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(Ik),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Ci(t,e,n,r){n||wh("useThemeClass","cssVarsRef is not passed");const o=i.inject(ki,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=i.ref(""),c=bi();let d;const u=`__${t}`,h=()=>{let f=u;const g=e?e.value:void 0,m=s==null?void 0:s.value;m&&(f+=`-${m}`),g&&(f+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:b}=r;p&&(f+=`-${ia(JSON.stringify(p))}`),b&&(f+=`-${ia(JSON.stringify(b))}`),l.value=f,d=()=>{const y=n.value;let _="";for(const C in y)_+=`${C}: ${y[C]};`;he(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const kh="n-form-item";function Ok(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const o=i.inject(kh,null);i.provide(kh,null);const s=i.computed(n?()=>n(o):()=>{const{size:c}=t;if(c)return c;if(o){const{mergedSize:d}=o;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{o&&o.restoreValidation()}),{mergedSizeRef:s,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}const zk={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ba(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Nr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;o=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function $r(t){return(e,n={})=>{const r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(o);if(!s)return null;const a=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?Lk(l,h=>h.test(a)):Dk(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function Dk(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function Lk(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function Hk(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const o=r[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const Wk={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"}},jk=(t,e,n)=>{let r;const o=Wk[t];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},qk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},Xk=(t,e,n,r)=>qk[t],Yk={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Uk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Kk={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"]},Gk={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"]},Zk={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"}},Qk={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"}},Jk={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Nr({values:Yk,defaultWidth:"wide"}),quarter:Nr({values:Uk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Nr({values:Kk,defaultWidth:"wide"}),day:Nr({values:Gk,defaultWidth:"wide"}),dayPeriod:Nr({values:Zk,defaultWidth:"wide",formattingValues:Qk,defaultFormattingWidth:"wide"})},ev=/^(\d+)(th|st|nd|rd)?/i,tv=/\d+/i,nv={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},iv={any:[/^b/i,/^(a|c)/i]},rv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ov={any:[/1/i,/2/i,/3/i,/4/i]},sv={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},av={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]},lv={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},cv={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]},dv={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},uv={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}},hv={ordinalNumber:Hk({matchPattern:ev,parsePattern:tv,valueCallback:t=>parseInt(t,10)}),era:$r({matchPatterns:nv,defaultMatchWidth:"wide",parsePatterns:iv,defaultParseWidth:"any"}),quarter:$r({matchPatterns:rv,defaultMatchWidth:"wide",parsePatterns:ov,defaultParseWidth:"any",valueCallback:t=>t+1}),month:$r({matchPatterns:sv,defaultMatchWidth:"wide",parsePatterns:av,defaultParseWidth:"any"}),day:$r({matchPatterns:lv,defaultMatchWidth:"wide",parsePatterns:cv,defaultParseWidth:"any"}),dayPeriod:$r({matchPatterns:dv,defaultMatchWidth:"any",parsePatterns:uv,defaultParseWidth:"any"})},fv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},mv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},gv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pv={date:ba({formats:fv,defaultWidth:"full"}),time:ba({formats:mv,defaultWidth:"full"}),dateTime:ba({formats:gv,defaultWidth:"full"})},yv={name:"en-US",locale:{code:"en-US",formatDistance:jk,formatLong:pv,formatRelative:Xk,localize:Jk,match:hv,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function vh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(ki,null)||{},r=i.computed(()=>{var s,a;return(a=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[t])!==null&&a!==void 0?a:zk[t]});return{dateLocaleRef:i.computed(()=>{var s;return(s=n==null?void 0:n.value)!==null&&s!==void 0?s:yv}),localeRef:r}}const Rr="naive-ui-style";function Er(t,e,n){if(!e)return;const r=bi(),o=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=i.inject(ki,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(Lx(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Rr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():i.onBeforeMount(a),o}const Pr={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:bv,fontFamily:_v,lineHeight:wv}=Pr,Ch=he("body",`
117
117
  margin: 0;
118
- font-size: ${_v};
119
- font-family: ${wv};
120
- line-height: ${xv};
118
+ font-size: ${bv};
119
+ font-family: ${_v};
120
+ line-height: ${wv};
121
121
  -webkit-text-size-adjust: 100%;
122
122
  -webkit-tap-highlight-color: transparent;
123
123
  `,[he("input",`
124
124
  font-family: inherit;
125
125
  font-size: inherit;
126
- `)]);var kv={};function Ao(t,e,n){if(!e){kv.NODE_ENV!=="production"&&wh("use-style","No style is specified.");return}const r=bi(),o=i.inject(ki,null),s=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Rr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||Ch.mount({id:"n-global",head:!0,anchorMetaName:Rr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():i.onBeforeMount(s)}function c3(t){return t}function kt(t,e,n,r,o,s){const a=bi(),l=i.inject(ki,null);if(n){const d=()=>{const u=s==null?void 0:s.value;n.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:Rr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Ch.mount({id:"n-global",head:!0,anchorMetaName:Rr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:u,self:h,peers:f={}}={},themeOverrides:g={},builtinThemeOverrides:m={}}=o,{common:p,peers:b}=g,{common:y=void 0,[t]:{common:_=void 0,self:C=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:N=void 0,[t]:$={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:w,peers:v={}}=$,k=M.merge({},u||_||y||r.common,N,w,p),B=M.merge((d=h||C||r.self)===null||d===void 0?void 0:d(k),m,$,g);return{common:k,self:B,peers:M.merge({},r.peers,x,f),peerOverrides:M.merge({},m.peers,v,b)}})}kt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const vv=ye("base-icon",`
126
+ `)]);var xv={};function Ao(t,e,n){if(!e){xv.NODE_ENV!=="production"&&wh("use-style","No style is specified.");return}const r=bi(),o=i.inject(ki,null),s=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Rr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||Ch.mount({id:"n-global",head:!0,anchorMetaName:Rr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():i.onBeforeMount(s)}function l3(t){return t}function kt(t,e,n,r,o,s){const a=bi(),l=i.inject(ki,null);if(n){const d=()=>{const u=s==null?void 0:s.value;n.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:Rr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Ch.mount({id:"n-global",head:!0,anchorMetaName:Rr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:u,self:h,peers:f={}}={},themeOverrides:g={},builtinThemeOverrides:m={}}=o,{common:p,peers:b}=g,{common:y=void 0,[t]:{common:_=void 0,self:C=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:N=void 0,[t]:$={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:w,peers:v={}}=$,k=M.merge({},u||_||y||r.common,N,w,p),B=M.merge((d=h||C||r.self)===null||d===void 0?void 0:d(k),m,$,g);return{common:k,self:B,peers:M.merge({},r.peers,x,f),peerOverrides:M.merge({},m.peers,v,b)}})}kt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const kv=ye("base-icon",`
127
127
  height: 1em;
128
128
  width: 1em;
129
129
  line-height: 1em;
@@ -134,7 +134,7 @@ ${o}
134
134
  `,[he("svg",`
135
135
  height: 1em;
136
136
  width: 1em;
137
- `)]),Fr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){Ao("-base-icon",vv,i.toRef(t,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),Sh=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=Co();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function Bh(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:M.upperFirst(t),setup(){var r;const o=(r=i.inject(ki,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var s;const a=(s=o==null?void 0:o.value)===null||s===void 0?void 0:s[t];return a?a():i.h(n,null)}}})}const Cv=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"})))}}),Sv=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"}))}}),Bv=Bh("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"}))))),Tv=Bh("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"}))))),Nv=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:$v}=Pr;function _a({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${$v} !important`}={}){return[he("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),he("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),he("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const Rv=ye("base-clear",`
137
+ `)]),Fr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){Ao("-base-icon",kv,i.toRef(t,"clsPrefix"))},render(){return i.h("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),Sh=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=Co();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function Bh(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:M.upperFirst(t),setup(){var r;const o=(r=i.inject(ki,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var s;const a=(s=o==null?void 0:o.value)===null||s===void 0?void 0:s[t];return a?a():i.h(n,null)}}})}const vv=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"})))}}),Cv=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"}))}}),Sv=Bh("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"}))))),Bv=Bh("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"}))))),Tv=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:Nv}=Pr;function _a({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${Nv} !important`}={}){return[he("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),he("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),he("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const $v=ye("base-clear",`
138
138
  flex-shrink: 0;
139
139
  height: 1em;
140
140
  width: 1em;
@@ -158,7 +158,7 @@ ${o}
158
158
  left: 50%;
159
159
  top: 50%;
160
160
  transform: translateX(-50%) translateY(-50%);
161
- `,[_a({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),Ev=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return Ao("-base-clear",Rv,i.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return i.h("div",{class:`${t}-base-clear`},i.h(Sh,null,{default:()=>{var e,n;return this.show?i.h("div",{key:"dismiss",class:`${t}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},pa(this.$slots.icon,()=>[i.h(Fr,{clsPrefix:t},{default:()=>i.h(Bv,null)})])):i.h("div",{key:"icon",class:`${t}-base-clear__placeholder`},(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e))}}))}}),Pv=ye("base-close",`
161
+ `,[_a({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),Rv=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return Ao("-base-clear",$v,i.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return i.h("div",{class:`${t}-base-clear`},i.h(Sh,null,{default:()=>{var e,n;return this.show?i.h("div",{key:"dismiss",class:`${t}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},pa(this.$slots.icon,()=>[i.h(Fr,{clsPrefix:t},{default:()=>i.h(Sv,null)})])):i.h("div",{key:"icon",class:`${t}-base-clear__placeholder`},(n=(e=this.$slots).placeholder)===null||n===void 0?void 0:n.call(e))}}))}}),Ev=ye("base-close",`
162
162
  display: flex;
163
163
  align-items: center;
164
164
  justify-content: center;
@@ -202,7 +202,7 @@ ${o}
202
202
  background-color: transparent;
203
203
  `),Re("round",[he("&::before",`
204
204
  border-radius: 50%;
205
- `)])]),Fv=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(t){return Ao("-base-close",Pv,i.toRef(t,"clsPrefix")),()=>{const{clsPrefix:e,disabled:n,absolute:r,round:o,isButtonTag:s}=t,a=s?"button":"div";return i.h(a,{type:s?"button":void 0,tabindex:n||!t.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:s?void 0:"button",disabled:n,class:[`${e}-base-close`,r&&`${e}-base-close--absolute`,n&&`${e}-base-close--disabled`,o&&`${e}-base-close--round`],onMousedown:l=>{t.focusable||l.preventDefault()},onClick:t.onClick},i.h(Fr,{clsPrefix:e},{default:()=>i.h(Tv,null)}))}}}),Vv=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(t){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:t.onFocus,onBlur:t.onBlur})}}),Mv=he([he("@keyframes rotator",`
205
+ `)])]),Pv=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(t){return Ao("-base-close",Ev,i.toRef(t,"clsPrefix")),()=>{const{clsPrefix:e,disabled:n,absolute:r,round:o,isButtonTag:s}=t,a=s?"button":"div";return i.h(a,{type:s?"button":void 0,tabindex:n||!t.focusable?-1:0,"aria-disabled":n,"aria-label":"close",role:s?void 0:"button",disabled:n,class:[`${e}-base-close`,r&&`${e}-base-close--absolute`,n&&`${e}-base-close--disabled`,o&&`${e}-base-close--round`],onMousedown:l=>{t.focusable||l.preventDefault()},onClick:t.onClick},i.h(Fr,{clsPrefix:e},{default:()=>i.h(Bv,null)}))}}}),Fv=i.defineComponent({props:{onFocus:Function,onBlur:Function},setup(t){return()=>i.h("div",{style:"width: 0; height: 0",tabindex:0,onFocus:t.onFocus,onBlur:t.onBlur})}}),Vv=he([he("@keyframes rotator",`
206
206
  0% {
207
207
  -webkit-transform: rotate(0deg);
208
208
  transform: rotate(0deg);
@@ -229,7 +229,7 @@ ${o}
229
229
  `,[we("icon",`
230
230
  height: 1em;
231
231
  width: 1em;
232
- `)])])]),wa="1.6s",Av={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},Th=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}},Av),setup(t){Ao("-base-loading",Mv,i.toRef(t,"clsPrefix"))},render(){const{clsPrefix:t,radius:e,strokeWidth:n,stroke:r,scale:o}=this,s=e/o;return i.h("div",{class:`${t}-base-loading`,role:"img","aria-label":"loading"},i.h(Sh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${t}-base-loading__transition-wrapper`},i.h("div",{class:`${t}-base-loading__container`},i.h("svg",{class:`${t}-base-loading__icon`,viewBox:`0 0 ${2*s} ${2*s}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${s} ${s};270 ${s} ${s}`,begin:"0s",dur:wa,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${t}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:s,cy:s,r:e-n/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${s} ${s};135 ${s} ${s};450 ${s} ${s}`,begin:"0s",dur:wa,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:wa,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:Nh}=Pr;function Iv({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=Nh,leaveCubicBezier:o=Nh}={}){return[he(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),he(`&.${t}-transition-leave-active`,{transition:`all ${n} ${o}!important`}),he(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),he(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const ge={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"},Ov=pi(ge.neutralBase),$h=pi(ge.neutralInvertBase),zv=`rgba(${$h.slice(0,3).join(", ")}, `;function Rh(t){return`${zv+String(t)})`}function vt(t){const e=Array.from($h);return e[3]=Number(t),Ew(Ov,e)}const Si=Object.assign(Object.assign({name:"common"},Pr),{baseColor:ge.neutralBase,primaryColor:ge.primaryDefault,primaryColorHover:ge.primaryHover,primaryColorPressed:ge.primaryActive,primaryColorSuppl:ge.primarySuppl,infoColor:ge.infoDefault,infoColorHover:ge.infoHover,infoColorPressed:ge.infoActive,infoColorSuppl:ge.infoSuppl,successColor:ge.successDefault,successColorHover:ge.successHover,successColorPressed:ge.successActive,successColorSuppl:ge.successSuppl,warningColor:ge.warningDefault,warningColorHover:ge.warningHover,warningColorPressed:ge.warningActive,warningColorSuppl:ge.warningSuppl,errorColor:ge.errorDefault,errorColorHover:ge.errorHover,errorColorPressed:ge.errorActive,errorColorSuppl:ge.errorSuppl,textColorBase:ge.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:vt(ge.alpha4),placeholderColor:vt(ge.alpha4),placeholderColorDisabled:vt(ge.alpha5),iconColor:vt(ge.alpha4),iconColorHover:_o(vt(ge.alpha4),{lightness:.75}),iconColorPressed:_o(vt(ge.alpha4),{lightness:.9}),iconColorDisabled:vt(ge.alpha5),opacity1:ge.alpha1,opacity2:ge.alpha2,opacity3:ge.alpha3,opacity4:ge.alpha4,opacity5:ge.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:vt(Number(ge.alphaClose)),closeIconColorHover:vt(Number(ge.alphaClose)),closeIconColorPressed:vt(Number(ge.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:vt(ge.alpha4),clearColorHover:_o(vt(ge.alpha4),{lightness:.75}),clearColorPressed:_o(vt(ge.alpha4),{lightness:.9}),scrollbarColor:Rh(ge.alphaScrollbar),scrollbarColorHover:Rh(ge.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:vt(ge.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ge.neutralPopover,tableColor:ge.neutralCard,cardColor:ge.neutralCard,modalColor:ge.neutralModal,bodyColor:ge.neutralBody,tagColor:"#eee",avatarColor:vt(ge.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:vt(ge.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:ge.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)"}),Dv={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function Lv(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:o,scrollbarBorderRadius:s}=t;return Object.assign(Object.assign({},Dv),{height:r,width:o,borderRadius:s,color:e,colorHover:n})}const xa={name:"Scrollbar",common:Si,self:Lv},Hv=ye("scrollbar",`
232
+ `)])])]),wa="1.6s",Mv={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},Th=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}},Mv),setup(t){Ao("-base-loading",Vv,i.toRef(t,"clsPrefix"))},render(){const{clsPrefix:t,radius:e,strokeWidth:n,stroke:r,scale:o}=this,s=e/o;return i.h("div",{class:`${t}-base-loading`,role:"img","aria-label":"loading"},i.h(Sh,null,{default:()=>this.show?i.h("div",{key:"icon",class:`${t}-base-loading__transition-wrapper`},i.h("div",{class:`${t}-base-loading__container`},i.h("svg",{class:`${t}-base-loading__icon`,viewBox:`0 0 ${2*s} ${2*s}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},i.h("g",null,i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${s} ${s};270 ${s} ${s}`,begin:"0s",dur:wa,fill:"freeze",repeatCount:"indefinite"}),i.h("circle",{class:`${t}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":n,"stroke-linecap":"round",cx:s,cy:s,r:e-n/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},i.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${s} ${s};135 ${s} ${s};450 ${s} ${s}`,begin:"0s",dur:wa,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:wa,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:Nh}=Pr;function Av({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=Nh,leaveCubicBezier:o=Nh}={}){return[he(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),he(`&.${t}-transition-leave-active`,{transition:`all ${n} ${o}!important`}),he(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),he(`&.${t}-transition-leave-from, &.${t}-transition-enter-to`,{opacity:1})]}const ge={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"},Iv=pi(ge.neutralBase),$h=pi(ge.neutralInvertBase),Ov=`rgba(${$h.slice(0,3).join(", ")}, `;function Rh(t){return`${Ov+String(t)})`}function vt(t){const e=Array.from($h);return e[3]=Number(t),Rw(Iv,e)}const Si=Object.assign(Object.assign({name:"common"},Pr),{baseColor:ge.neutralBase,primaryColor:ge.primaryDefault,primaryColorHover:ge.primaryHover,primaryColorPressed:ge.primaryActive,primaryColorSuppl:ge.primarySuppl,infoColor:ge.infoDefault,infoColorHover:ge.infoHover,infoColorPressed:ge.infoActive,infoColorSuppl:ge.infoSuppl,successColor:ge.successDefault,successColorHover:ge.successHover,successColorPressed:ge.successActive,successColorSuppl:ge.successSuppl,warningColor:ge.warningDefault,warningColorHover:ge.warningHover,warningColorPressed:ge.warningActive,warningColorSuppl:ge.warningSuppl,errorColor:ge.errorDefault,errorColorHover:ge.errorHover,errorColorPressed:ge.errorActive,errorColorSuppl:ge.errorSuppl,textColorBase:ge.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:vt(ge.alpha4),placeholderColor:vt(ge.alpha4),placeholderColorDisabled:vt(ge.alpha5),iconColor:vt(ge.alpha4),iconColorHover:_o(vt(ge.alpha4),{lightness:.75}),iconColorPressed:_o(vt(ge.alpha4),{lightness:.9}),iconColorDisabled:vt(ge.alpha5),opacity1:ge.alpha1,opacity2:ge.alpha2,opacity3:ge.alpha3,opacity4:ge.alpha4,opacity5:ge.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:vt(Number(ge.alphaClose)),closeIconColorHover:vt(Number(ge.alphaClose)),closeIconColorPressed:vt(Number(ge.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:vt(ge.alpha4),clearColorHover:_o(vt(ge.alpha4),{lightness:.75}),clearColorPressed:_o(vt(ge.alpha4),{lightness:.9}),scrollbarColor:Rh(ge.alphaScrollbar),scrollbarColorHover:Rh(ge.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:vt(ge.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ge.neutralPopover,tableColor:ge.neutralCard,cardColor:ge.neutralCard,modalColor:ge.neutralModal,bodyColor:ge.neutralBody,tagColor:"#eee",avatarColor:vt(ge.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:vt(ge.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:ge.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)"}),zv={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function Dv(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:o,scrollbarBorderRadius:s}=t;return Object.assign(Object.assign({},zv),{height:r,width:o,borderRadius:s,color:e,colorHover:n})}const xa={name:"Scrollbar",common:Si,self:Dv},Lv=ye("scrollbar",`
233
233
  overflow: hidden;
234
234
  position: relative;
235
235
  z-index: auto;
@@ -294,7 +294,7 @@ ${o}
294
294
  pointer-events: all;
295
295
  background-color: var(--n-scrollbar-color);
296
296
  transition: background-color .2s var(--n-scrollbar-bezier);
297
- `,[Iv(),he("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Wv=Object.assign(Object.assign({},kt.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"}}),Eh=i.defineComponent({name:"Scrollbar",props:Wv,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=vi(t),o=Er("Scrollbar",r,e),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),C=i.ref(!1);let x=!1,N=!1,$,w,v=0,k=0,B=0,R=0;const E=_x(),P=kt("Scrollbar","-scrollbar",Hv,xa,t,e),W=i.computed(()=>{const{value:F}=f,{value:G}=u,{value:se}=m;return F===null||G===null||se===null?0:Math.min(F,se*F/G+xr(P.value.self.width)*1.5)}),I=i.computed(()=>`${W.value}px`),Z=i.computed(()=>{const{value:F}=g,{value:G}=h,{value:se}=p;return F===null||G===null||se===null?0:se*F/G+xr(P.value.self.height)*1.5}),te=i.computed(()=>`${Z.value}px`),D=i.computed(()=>{const{value:F}=f,{value:G}=b,{value:se}=u,{value:fe}=m;if(F===null||se===null||fe===null)return 0;{const me=se-F;return me?G/me*(fe-W.value):0}}),L=i.computed(()=>`${D.value}px`),H=i.computed(()=>{const{value:F}=g,{value:G}=y,{value:se}=h,{value:fe}=p;if(F===null||se===null||fe===null)return 0;{const me=se-F;return me?G/me*(fe-Z.value):0}}),z=i.computed(()=>`${H.value}px`),O=i.computed(()=>{const{value:F}=f,{value:G}=u;return F!==null&&G!==null&&G>F}),U=i.computed(()=>{const{value:F}=g,{value:G}=h;return F!==null&&G!==null&&G>F}),K=i.computed(()=>{const{trigger:F}=t;return F==="none"||_.value}),V=i.computed(()=>{const{trigger:F}=t;return F==="none"||C.value}),q=i.computed(()=>{const{container:F}=t;return F?F():a.value}),Y=i.computed(()=>{const{content:F}=t;return F?F():l.value}),ee=(F,G)=>{if(!t.scrollable)return;if(typeof F=="number"){ce(F,G??0,0,!1,"auto");return}const{left:se,top:fe,index:me,elSize:_e,position:ke,behavior:Se,el:Qe,debounce:Bn=!0}=F;(se!==void 0||fe!==void 0)&&ce(se??0,fe??0,0,!1,Se),Qe!==void 0?ce(0,Qe.offsetTop,Qe.offsetHeight,Bn,Se):me!==void 0&&_e!==void 0?ce(0,me*_e,_e,Bn,Se):ke==="bottom"?ce(0,Number.MAX_SAFE_INTEGER,0,!1,Se):ke==="top"&&ce(0,0,0,!1,Se)},ue=Bk(()=>{t.container||ee({top:b.value,left:y.value})}),ve=()=>{ue.isDeactivated||le()},Te=F=>{if(ue.isDeactivated)return;const{onResize:G}=t;G&&G(F),le()},We=(F,G)=>{if(!t.scrollable)return;const{value:se}=q;se&&(typeof F=="object"?se.scrollBy(F):se.scrollBy(F,G||0))};function ce(F,G,se,fe,me){const{value:_e}=q;if(_e){if(fe){const{scrollTop:ke,offsetHeight:Se}=_e;if(G>ke){G+se<=ke+Se||_e.scrollTo({left:F,top:G+se-Se,behavior:me});return}}_e.scrollTo({left:F,top:G,behavior:me})}}function pt(){Bt(),Hn(),le()}function Ne(){Vt()}function Vt(){jt(),ln()}function jt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{C.value=!1},t.duration)}function ln(){$!==void 0&&window.clearTimeout($),$=window.setTimeout(()=>{_.value=!1},t.duration)}function Bt(){$!==void 0&&window.clearTimeout($),_.value=!0}function Hn(){w!==void 0&&window.clearTimeout(w),C.value=!0}function cn(F){const{onScroll:G}=t;G&&G(F),en()}function en(){const{value:F}=q;F&&(b.value=F.scrollTop,y.value=F.scrollLeft*(o!=null&&o.value?-1:1))}function Ve(){const{value:F}=Y;F&&(u.value=F.offsetHeight,h.value=F.offsetWidth);const{value:G}=q;G&&(f.value=G.offsetHeight,g.value=G.offsetWidth);const{value:se}=d,{value:fe}=c;se&&(p.value=se.offsetWidth),fe&&(m.value=fe.offsetHeight)}function J(){const{value:F}=q;F&&(b.value=F.scrollTop,y.value=F.scrollLeft*(o!=null&&o.value?-1:1),f.value=F.offsetHeight,g.value=F.offsetWidth,u.value=F.scrollHeight,h.value=F.scrollWidth);const{value:G}=d,{value:se}=c;G&&(p.value=G.offsetWidth),se&&(m.value=se.offsetHeight)}function le(){t.scrollable&&(t.useUnifiedContainer?J():(Ve(),en()))}function De(F){var G;return!(!((G=s.value)===null||G===void 0)&&G.contains(wr(F)))}function ni(F){F.preventDefault(),F.stopPropagation(),N=!0,Pt("mousemove",window,it,!0),Pt("mouseup",window,qt,!0),k=y.value,B=o!=null&&o.value?window.innerWidth-F.clientX:F.clientX}function it(F){if(!N)return;$!==void 0&&window.clearTimeout($),w!==void 0&&window.clearTimeout(w);const{value:G}=g,{value:se}=h,{value:fe}=Z;if(G===null||se===null)return;const _e=(o!=null&&o.value?window.innerWidth-F.clientX-B:F.clientX-B)*(se-G)/(G-fe),ke=se-G;let Se=k+_e;Se=Math.min(ke,Se),Se=Math.max(Se,0);const{value:Qe}=q;if(Qe){Qe.scrollLeft=Se*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:Bn}=t;Bn&&Bn(Se)}}function qt(F){F.preventDefault(),F.stopPropagation(),ct("mousemove",window,it,!0),ct("mouseup",window,qt,!0),N=!1,le(),De(F)&&Vt()}function tr(F){F.preventDefault(),F.stopPropagation(),x=!0,Pt("mousemove",window,ii,!0),Pt("mouseup",window,$i,!0),v=b.value,R=F.clientY}function ii(F){if(!x)return;$!==void 0&&window.clearTimeout($),w!==void 0&&window.clearTimeout(w);const{value:G}=f,{value:se}=u,{value:fe}=W;if(G===null||se===null)return;const _e=(F.clientY-R)*(se-G)/(G-fe),ke=se-G;let Se=v+_e;Se=Math.min(ke,Se),Se=Math.max(Se,0);const{value:Qe}=q;Qe&&(Qe.scrollTop=Se)}function $i(F){F.preventDefault(),F.stopPropagation(),ct("mousemove",window,ii,!0),ct("mouseup",window,$i,!0),x=!1,le(),De(F)&&Vt()}i.watchEffect(()=>{const{value:F}=U,{value:G}=O,{value:se}=e,{value:fe}=d,{value:me}=c;fe&&(F?fe.classList.remove(`${se}-scrollbar-rail--disabled`):fe.classList.add(`${se}-scrollbar-rail--disabled`)),me&&(G?me.classList.remove(`${se}-scrollbar-rail--disabled`):me.classList.add(`${se}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||le()}),i.onBeforeUnmount(()=>{$!==void 0&&window.clearTimeout($),w!==void 0&&window.clearTimeout(w),ct("mousemove",window,ii,!0),ct("mouseup",window,$i,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:F},self:{color:G,colorHover:se,height:fe,width:me,borderRadius:_e,railInsetHorizontalTop:ke,railInsetHorizontalBottom:Se,railInsetVerticalRight:Qe,railInsetVerticalLeft:Bn,railColor:$a}}=P.value,{top:Ra,right:Ea,bottom:Pa,left:Fa}=rn(ke),{top:Va,right:Ma,bottom:Aa,left:Ia}=rn(Se),{top:Oa,right:za,bottom:Da,left:La}=rn(o!=null&&o.value?fh(Qe):Qe),{top:Ha,right:Wa,bottom:ja,left:qa}=rn(o!=null&&o.value?fh(Bn):Bn);return{"--n-scrollbar-bezier":F,"--n-scrollbar-color":G,"--n-scrollbar-color-hover":se,"--n-scrollbar-border-radius":_e,"--n-scrollbar-width":me,"--n-scrollbar-height":fe,"--n-scrollbar-rail-top-horizontal-top":Ra,"--n-scrollbar-rail-right-horizontal-top":Ea,"--n-scrollbar-rail-bottom-horizontal-top":Pa,"--n-scrollbar-rail-left-horizontal-top":Fa,"--n-scrollbar-rail-top-horizontal-bottom":Va,"--n-scrollbar-rail-right-horizontal-bottom":Ma,"--n-scrollbar-rail-bottom-horizontal-bottom":Aa,"--n-scrollbar-rail-left-horizontal-bottom":Ia,"--n-scrollbar-rail-top-vertical-right":Oa,"--n-scrollbar-rail-right-vertical-right":za,"--n-scrollbar-rail-bottom-vertical-right":Da,"--n-scrollbar-rail-left-vertical-right":La,"--n-scrollbar-rail-top-vertical-left":Ha,"--n-scrollbar-rail-right-vertical-left":Wa,"--n-scrollbar-rail-bottom-vertical-left":ja,"--n-scrollbar-rail-left-vertical-left":qa,"--n-scrollbar-rail-color":$a}}),dn=n?Ci("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:ee,scrollBy:We,sync:le,syncUnifiedContainer:J,handleMouseEnterWrapper:pt,handleMouseLeaveWrapper:Ne}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:b,wrapperRef:s,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:O,needXBar:U,yBarSizePx:I,xBarSizePx:te,yBarTopPx:L,xBarLeftPx:z,isShowXBar:K,isShowYBar:V,isIos:E,handleScroll:cn,handleContentResize:ve,handleContainerResize:Te,handleYScrollMouseDown:tr,handleXScrollMouseDown:ni,cssVars:n?void 0:nr,themeClass:dn==null?void 0:dn.themeClass,onRender:dn==null?void 0:dn.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:s,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",u=(g,m)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[m||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?ya:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),h=()=>{var g,m;return(g=this.onRender)===null||g===void 0||g.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,o&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(m=e.default)===null||m===void 0?void 0:m.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(Fo,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),s?null:u(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?ya: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:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},f=this.container?h():i.h(Fo,{onResize:this.handleContainerResize},{default:h});return s?i.h(i.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),jv=Eh,qv={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function Xv(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},qv),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const Ph={name:"Empty",common:Si,self:Xv},Yv=ye("empty",`
297
+ `,[Av(),he("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Hv=Object.assign(Object.assign({},kt.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"}}),Eh=i.defineComponent({name:"Scrollbar",props:Hv,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=vi(t),o=Er("Scrollbar",r,e),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(null),p=i.ref(null),b=i.ref(0),y=i.ref(0),_=i.ref(!1),C=i.ref(!1);let x=!1,N=!1,$,w,v=0,k=0,B=0,R=0;const E=bx(),P=kt("Scrollbar","-scrollbar",Lv,xa,t,e),W=i.computed(()=>{const{value:F}=f,{value:G}=u,{value:se}=m;return F===null||G===null||se===null?0:Math.min(F,se*F/G+xr(P.value.self.width)*1.5)}),I=i.computed(()=>`${W.value}px`),Z=i.computed(()=>{const{value:F}=g,{value:G}=h,{value:se}=p;return F===null||G===null||se===null?0:se*F/G+xr(P.value.self.height)*1.5}),te=i.computed(()=>`${Z.value}px`),D=i.computed(()=>{const{value:F}=f,{value:G}=b,{value:se}=u,{value:fe}=m;if(F===null||se===null||fe===null)return 0;{const me=se-F;return me?G/me*(fe-W.value):0}}),L=i.computed(()=>`${D.value}px`),H=i.computed(()=>{const{value:F}=g,{value:G}=y,{value:se}=h,{value:fe}=p;if(F===null||se===null||fe===null)return 0;{const me=se-F;return me?G/me*(fe-Z.value):0}}),z=i.computed(()=>`${H.value}px`),O=i.computed(()=>{const{value:F}=f,{value:G}=u;return F!==null&&G!==null&&G>F}),U=i.computed(()=>{const{value:F}=g,{value:G}=h;return F!==null&&G!==null&&G>F}),K=i.computed(()=>{const{trigger:F}=t;return F==="none"||_.value}),V=i.computed(()=>{const{trigger:F}=t;return F==="none"||C.value}),q=i.computed(()=>{const{container:F}=t;return F?F():a.value}),Y=i.computed(()=>{const{content:F}=t;return F?F():l.value}),ee=(F,G)=>{if(!t.scrollable)return;if(typeof F=="number"){ce(F,G??0,0,!1,"auto");return}const{left:se,top:fe,index:me,elSize:_e,position:ke,behavior:Se,el:Qe,debounce:Bn=!0}=F;(se!==void 0||fe!==void 0)&&ce(se??0,fe??0,0,!1,Se),Qe!==void 0?ce(0,Qe.offsetTop,Qe.offsetHeight,Bn,Se):me!==void 0&&_e!==void 0?ce(0,me*_e,_e,Bn,Se):ke==="bottom"?ce(0,Number.MAX_SAFE_INTEGER,0,!1,Se):ke==="top"&&ce(0,0,0,!1,Se)},ue=Sk(()=>{t.container||ee({top:b.value,left:y.value})}),ve=()=>{ue.isDeactivated||le()},Te=F=>{if(ue.isDeactivated)return;const{onResize:G}=t;G&&G(F),le()},We=(F,G)=>{if(!t.scrollable)return;const{value:se}=q;se&&(typeof F=="object"?se.scrollBy(F):se.scrollBy(F,G||0))};function ce(F,G,se,fe,me){const{value:_e}=q;if(_e){if(fe){const{scrollTop:ke,offsetHeight:Se}=_e;if(G>ke){G+se<=ke+Se||_e.scrollTo({left:F,top:G+se-Se,behavior:me});return}}_e.scrollTo({left:F,top:G,behavior:me})}}function pt(){Bt(),Hn(),le()}function Ne(){Vt()}function Vt(){jt(),ln()}function jt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{C.value=!1},t.duration)}function ln(){$!==void 0&&window.clearTimeout($),$=window.setTimeout(()=>{_.value=!1},t.duration)}function Bt(){$!==void 0&&window.clearTimeout($),_.value=!0}function Hn(){w!==void 0&&window.clearTimeout(w),C.value=!0}function cn(F){const{onScroll:G}=t;G&&G(F),en()}function en(){const{value:F}=q;F&&(b.value=F.scrollTop,y.value=F.scrollLeft*(o!=null&&o.value?-1:1))}function Ve(){const{value:F}=Y;F&&(u.value=F.offsetHeight,h.value=F.offsetWidth);const{value:G}=q;G&&(f.value=G.offsetHeight,g.value=G.offsetWidth);const{value:se}=d,{value:fe}=c;se&&(p.value=se.offsetWidth),fe&&(m.value=fe.offsetHeight)}function J(){const{value:F}=q;F&&(b.value=F.scrollTop,y.value=F.scrollLeft*(o!=null&&o.value?-1:1),f.value=F.offsetHeight,g.value=F.offsetWidth,u.value=F.scrollHeight,h.value=F.scrollWidth);const{value:G}=d,{value:se}=c;G&&(p.value=G.offsetWidth),se&&(m.value=se.offsetHeight)}function le(){t.scrollable&&(t.useUnifiedContainer?J():(Ve(),en()))}function De(F){var G;return!(!((G=s.value)===null||G===void 0)&&G.contains(wr(F)))}function ni(F){F.preventDefault(),F.stopPropagation(),N=!0,Pt("mousemove",window,rt,!0),Pt("mouseup",window,qt,!0),k=y.value,B=o!=null&&o.value?window.innerWidth-F.clientX:F.clientX}function rt(F){if(!N)return;$!==void 0&&window.clearTimeout($),w!==void 0&&window.clearTimeout(w);const{value:G}=g,{value:se}=h,{value:fe}=Z;if(G===null||se===null)return;const _e=(o!=null&&o.value?window.innerWidth-F.clientX-B:F.clientX-B)*(se-G)/(G-fe),ke=se-G;let Se=k+_e;Se=Math.min(ke,Se),Se=Math.max(Se,0);const{value:Qe}=q;if(Qe){Qe.scrollLeft=Se*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:Bn}=t;Bn&&Bn(Se)}}function qt(F){F.preventDefault(),F.stopPropagation(),ct("mousemove",window,rt,!0),ct("mouseup",window,qt,!0),N=!1,le(),De(F)&&Vt()}function tr(F){F.preventDefault(),F.stopPropagation(),x=!0,Pt("mousemove",window,ii,!0),Pt("mouseup",window,$i,!0),v=b.value,R=F.clientY}function ii(F){if(!x)return;$!==void 0&&window.clearTimeout($),w!==void 0&&window.clearTimeout(w);const{value:G}=f,{value:se}=u,{value:fe}=W;if(G===null||se===null)return;const _e=(F.clientY-R)*(se-G)/(G-fe),ke=se-G;let Se=v+_e;Se=Math.min(ke,Se),Se=Math.max(Se,0);const{value:Qe}=q;Qe&&(Qe.scrollTop=Se)}function $i(F){F.preventDefault(),F.stopPropagation(),ct("mousemove",window,ii,!0),ct("mouseup",window,$i,!0),x=!1,le(),De(F)&&Vt()}i.watchEffect(()=>{const{value:F}=U,{value:G}=O,{value:se}=e,{value:fe}=d,{value:me}=c;fe&&(F?fe.classList.remove(`${se}-scrollbar-rail--disabled`):fe.classList.add(`${se}-scrollbar-rail--disabled`)),me&&(G?me.classList.remove(`${se}-scrollbar-rail--disabled`):me.classList.add(`${se}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||le()}),i.onBeforeUnmount(()=>{$!==void 0&&window.clearTimeout($),w!==void 0&&window.clearTimeout(w),ct("mousemove",window,ii,!0),ct("mouseup",window,$i,!0)});const nr=i.computed(()=>{const{common:{cubicBezierEaseInOut:F},self:{color:G,colorHover:se,height:fe,width:me,borderRadius:_e,railInsetHorizontalTop:ke,railInsetHorizontalBottom:Se,railInsetVerticalRight:Qe,railInsetVerticalLeft:Bn,railColor:$a}}=P.value,{top:Ra,right:Ea,bottom:Pa,left:Fa}=rn(ke),{top:Va,right:Ma,bottom:Aa,left:Ia}=rn(Se),{top:Oa,right:za,bottom:Da,left:La}=rn(o!=null&&o.value?fh(Qe):Qe),{top:Ha,right:Wa,bottom:ja,left:qa}=rn(o!=null&&o.value?fh(Bn):Bn);return{"--n-scrollbar-bezier":F,"--n-scrollbar-color":G,"--n-scrollbar-color-hover":se,"--n-scrollbar-border-radius":_e,"--n-scrollbar-width":me,"--n-scrollbar-height":fe,"--n-scrollbar-rail-top-horizontal-top":Ra,"--n-scrollbar-rail-right-horizontal-top":Ea,"--n-scrollbar-rail-bottom-horizontal-top":Pa,"--n-scrollbar-rail-left-horizontal-top":Fa,"--n-scrollbar-rail-top-horizontal-bottom":Va,"--n-scrollbar-rail-right-horizontal-bottom":Ma,"--n-scrollbar-rail-bottom-horizontal-bottom":Aa,"--n-scrollbar-rail-left-horizontal-bottom":Ia,"--n-scrollbar-rail-top-vertical-right":Oa,"--n-scrollbar-rail-right-vertical-right":za,"--n-scrollbar-rail-bottom-vertical-right":Da,"--n-scrollbar-rail-left-vertical-right":La,"--n-scrollbar-rail-top-vertical-left":Ha,"--n-scrollbar-rail-right-vertical-left":Wa,"--n-scrollbar-rail-bottom-vertical-left":ja,"--n-scrollbar-rail-left-vertical-left":qa,"--n-scrollbar-rail-color":$a}}),dn=n?Ci("scrollbar",void 0,nr,t):void 0;return Object.assign(Object.assign({},{scrollTo:ee,scrollBy:We,sync:le,syncUnifiedContainer:J,handleMouseEnterWrapper:pt,handleMouseLeaveWrapper:Ne}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:b,wrapperRef:s,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:O,needXBar:U,yBarSizePx:I,xBarSizePx:te,yBarTopPx:L,xBarLeftPx:z,isShowXBar:K,isShowYBar:V,isIos:E,handleScroll:cn,handleContentResize:ve,handleContainerResize:Te,handleYScrollMouseDown:tr,handleXScrollMouseDown:ni,cssVars:n?void 0:nr,themeClass:dn==null?void 0:dn.themeClass,onRender:dn==null?void 0:dn.onRender})},render(){var t;const{$slots:e,mergedClsPrefix:n,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:s,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(t=e.default)===null||t===void 0?void 0:t.call(e);const d=this.trigger==="none",u=(g,m)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,g],"data-scrollbar-rail":!0,style:[m||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?ya:i.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?i.h("div",{class:`${n}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),h=()=>{var g,m;return(g=this.onRender)===null||g===void 0||g.call(this),i.h("div",i.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${n}-scrollbar`,this.themeClass,o&&`${n}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(m=e.default)===null||m===void 0?void 0:m.call(e):i.h("div",{role:"none",ref:"containerRef",class:[`${n}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},i.h(Fo,{onResize:this.handleContentResize},{default:()=>i.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${n}-scrollbar-content`,this.contentClass]},e)})),s?null:u(void 0,void 0),c&&i.h("div",{ref:"xRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--horizontal`,`${n}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},i.h(d?ya: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:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},f=this.container?h():i.h(Fo,{onResize:this.handleContainerResize},{default:h});return s?i.h(i.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),Wv=Eh,jv={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function qv(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},jv),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const Ph={name:"Empty",common:Si,self:qv},Xv=ye("empty",`
298
298
  display: flex;
299
299
  flex-direction: column;
300
300
  align-items: center;
@@ -317,7 +317,7 @@ ${o}
317
317
  transition: color .3s var(--n-bezier);
318
318
  margin-top: 12px;
319
319
  color: var(--n-extra-text-color);
320
- `)]),Uv=Object.assign(Object.assign({},kt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Kv=i.defineComponent({name:"Empty",props:Uv,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=vi(t),o=kt("Empty","-empty",Yv,Ph,t,e),{localeRef:s}=vh("Empty"),a=i.computed(()=>{var u,h,f;return(u=t.description)!==null&&u!==void 0?u:(f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.description}),l=i.computed(()=>{var u,h;return((h=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>i.h(Nv,null))}),c=i.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:h},self:{[et("iconSize",u)]:f,[et("fontSize",u)]:g,textColor:m,iconColor:p,extraTextColor:b}}=o.value;return{"--n-icon-size":f,"--n-font-size":g,"--n-bezier":h,"--n-text-color":m,"--n-icon-color":p,"--n-extra-text-color":b}}),d=n?Ci("empty",i.computed(()=>{let u="";const{size:h}=t;return u+=h[0],u}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||s.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h(Fr,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),Gv={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 Zv(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:o,textColor2:s,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:h,fontSizeSmall:f,fontSizeMedium:g,fontSizeLarge:m,fontSizeHuge:p,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:C,heightHuge:x}=t;return Object.assign(Object.assign({},Gv),{optionFontSizeTiny:h,optionFontSizeSmall:f,optionFontSizeMedium:g,optionFontSizeLarge:m,optionFontSizeHuge:p,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:C,optionHeightHuge:x,borderRadius:e,color:n,groupHeaderTextColor:r,actionDividerColor:o,optionTextColor:s,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:s,loadingColor:c})}const Fh={name:"InternalSelectMenu",common:Si,peers:{Scrollbar:xa,Empty:Ph},self:Zv},Vh=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:n,nodePropsRef:r}=i.inject(ua);return{labelField:n,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:n,nodeProps:r,tmNode:{rawNode:o}}=this,s=r==null?void 0:r(o),a=e?e(o,!1):er(o[this.labelField],o,!1),l=i.h("div",Object.assign({},s,{class:[`${t}-base-select-group-header`,s==null?void 0:s.class]}),a);return o.render?o.render({node:l,option:o}):n?n({node:l,option:o,selected:!1}):l}});function Qv(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h(Fr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(Cv)}):null})}const Mh=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:n,multipleRef:r,valueSetRef:o,renderLabelRef:s,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:u,handleOptionClick:h,handleOptionMouseEnter:f}=i.inject(ua),g=Qt(()=>{const{value:y}=n;return y?t.tmNode.key===y.key:!1});function m(y){const{tmNode:_}=t;_.disabled||h(y,_)}function p(y){const{tmNode:_}=t;_.disabled||f(y,_)}function b(y){const{tmNode:_}=t,{value:C}=g;_.disabled||C||f(y,_)}return{multiple:r,isGrouped:Qt(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:u,isPending:g,isSelected:Qt(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const C=t.tmNode.rawNode[c.value];if(_){const{value:x}=o;return x.has(C)}else return y===C}),labelField:l,renderLabel:s,renderOption:a,handleMouseMove:b,handleMouseEnter:p,handleClick:m}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:o,showCheckmark:s,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:u,handleMouseMove:h}=this,f=Qv(n,t),g=c?[c(e,n),s&&f]:[er(e[this.labelField],e,n),s&&f],m=a==null?void 0:a(e),p=i.h("div",Object.assign({},m,{class:[`${t}-base-select-option`,e.class,m==null?void 0:m.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:n,[`${t}-base-select-option--grouped`]:o,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:s}],style:[(m==null?void 0:m.style)||"",e.style||""],onClick:ga([d,m==null?void 0:m.onClick]),onMouseenter:ga([u,m==null?void 0:m.onMouseenter]),onMousemove:ga([h,m==null?void 0:m.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},g));return e.render?e.render({node:p,option:e,selected:n}):l?l({node:p,option:e,selected:n}):p}}),{cubicBezierEaseIn:Ah,cubicBezierEaseOut:Ih}=Pr;function Oh({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:o=""}={}){return[he("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${Ah}, transform ${e} ${Ah} ${o&&`,${o}`}`}),he("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${Ih}, transform ${e} ${Ih} ${o&&`,${o}`}`}),he("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),he("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Jv=ye("base-select-menu",`
320
+ `)]),Yv=Object.assign(Object.assign({},kt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),Uv=i.defineComponent({name:"Empty",props:Yv,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=vi(t),o=kt("Empty","-empty",Xv,Ph,t,e),{localeRef:s}=vh("Empty"),a=i.computed(()=>{var u,h,f;return(u=t.description)!==null&&u!==void 0?u:(f=(h=r==null?void 0:r.value)===null||h===void 0?void 0:h.Empty)===null||f===void 0?void 0:f.description}),l=i.computed(()=>{var u,h;return((h=(u=r==null?void 0:r.value)===null||u===void 0?void 0:u.Empty)===null||h===void 0?void 0:h.renderIcon)||(()=>i.h(Tv,null))}),c=i.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:h},self:{[et("iconSize",u)]:f,[et("fontSize",u)]:g,textColor:m,iconColor:p,extraTextColor:b}}=o.value;return{"--n-icon-size":f,"--n-font-size":g,"--n-bezier":h,"--n-text-color":m,"--n-icon-color":p,"--n-extra-text-color":b}}),d=n?Ci("empty",i.computed(()=>{let u="";const{size:h}=t;return u+=h[0],u}),c,t):void 0;return{mergedClsPrefix:e,mergedRenderIcon:l,localizedDescription:i.computed(()=>a.value||s.value.description),cssVars:n?void 0:c,themeClass:d==null?void 0:d.themeClass,onRender:d==null?void 0:d.onRender}},render(){const{$slots:t,mergedClsPrefix:e,onRender:n}=this;return n==null||n(),i.h("div",{class:[`${e}-empty`,this.themeClass],style:this.cssVars},this.showIcon?i.h("div",{class:`${e}-empty__icon`},t.icon?t.icon():i.h(Fr,{clsPrefix:e},{default:this.mergedRenderIcon})):null,this.showDescription?i.h("div",{class:`${e}-empty__description`},t.default?t.default():this.localizedDescription):null,t.extra?i.h("div",{class:`${e}-empty__extra`},t.extra()):null)}}),Kv={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 Gv(t){const{borderRadius:e,popoverColor:n,textColor3:r,dividerColor:o,textColor2:s,primaryColorPressed:a,textColorDisabled:l,primaryColor:c,opacityDisabled:d,hoverColor:u,fontSizeTiny:h,fontSizeSmall:f,fontSizeMedium:g,fontSizeLarge:m,fontSizeHuge:p,heightTiny:b,heightSmall:y,heightMedium:_,heightLarge:C,heightHuge:x}=t;return Object.assign(Object.assign({},Kv),{optionFontSizeTiny:h,optionFontSizeSmall:f,optionFontSizeMedium:g,optionFontSizeLarge:m,optionFontSizeHuge:p,optionHeightTiny:b,optionHeightSmall:y,optionHeightMedium:_,optionHeightLarge:C,optionHeightHuge:x,borderRadius:e,color:n,groupHeaderTextColor:r,actionDividerColor:o,optionTextColor:s,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:c,optionOpacityDisabled:d,optionCheckColor:c,optionColorPending:u,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:u,actionTextColor:s,loadingColor:c})}const Fh={name:"InternalSelectMenu",common:Si,peers:{Scrollbar:xa,Empty:Ph},self:Gv},Vh=i.defineComponent({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:t,renderOptionRef:e,labelFieldRef:n,nodePropsRef:r}=i.inject(ua);return{labelField:n,nodeProps:r,renderLabel:t,renderOption:e}},render(){const{clsPrefix:t,renderLabel:e,renderOption:n,nodeProps:r,tmNode:{rawNode:o}}=this,s=r==null?void 0:r(o),a=e?e(o,!1):er(o[this.labelField],o,!1),l=i.h("div",Object.assign({},s,{class:[`${t}-base-select-group-header`,s==null?void 0:s.class]}),a);return o.render?o.render({node:l,option:o}):n?n({node:l,option:o,selected:!1}):l}});function Zv(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h(Fr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(vv)}):null})}const Mh=i.defineComponent({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(t){const{valueRef:e,pendingTmNodeRef:n,multipleRef:r,valueSetRef:o,renderLabelRef:s,renderOptionRef:a,labelFieldRef:l,valueFieldRef:c,showCheckmarkRef:d,nodePropsRef:u,handleOptionClick:h,handleOptionMouseEnter:f}=i.inject(ua),g=Qt(()=>{const{value:y}=n;return y?t.tmNode.key===y.key:!1});function m(y){const{tmNode:_}=t;_.disabled||h(y,_)}function p(y){const{tmNode:_}=t;_.disabled||f(y,_)}function b(y){const{tmNode:_}=t,{value:C}=g;_.disabled||C||f(y,_)}return{multiple:r,isGrouped:Qt(()=>{const{tmNode:y}=t,{parent:_}=y;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:u,isPending:g,isSelected:Qt(()=>{const{value:y}=e,{value:_}=r;if(y===null)return!1;const C=t.tmNode.rawNode[c.value];if(_){const{value:x}=o;return x.has(C)}else return y===C}),labelField:l,renderLabel:s,renderOption:a,handleMouseMove:b,handleMouseEnter:p,handleClick:m}},render(){const{clsPrefix:t,tmNode:{rawNode:e},isSelected:n,isPending:r,isGrouped:o,showCheckmark:s,nodeProps:a,renderOption:l,renderLabel:c,handleClick:d,handleMouseEnter:u,handleMouseMove:h}=this,f=Zv(n,t),g=c?[c(e,n),s&&f]:[er(e[this.labelField],e,n),s&&f],m=a==null?void 0:a(e),p=i.h("div",Object.assign({},m,{class:[`${t}-base-select-option`,e.class,m==null?void 0:m.class,{[`${t}-base-select-option--disabled`]:e.disabled,[`${t}-base-select-option--selected`]:n,[`${t}-base-select-option--grouped`]:o,[`${t}-base-select-option--pending`]:r,[`${t}-base-select-option--show-checkmark`]:s}],style:[(m==null?void 0:m.style)||"",e.style||""],onClick:ga([d,m==null?void 0:m.onClick]),onMouseenter:ga([u,m==null?void 0:m.onMouseenter]),onMousemove:ga([h,m==null?void 0:m.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},g));return e.render?e.render({node:p,option:e,selected:n}):l?l({node:p,option:e,selected:n}):p}}),{cubicBezierEaseIn:Ah,cubicBezierEaseOut:Ih}=Pr;function Oh({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:o=""}={}){return[he("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${Ah}, transform ${e} ${Ah} ${o&&`,${o}`}`}),he("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${Ih}, transform ${e} ${Ih} ${o&&`,${o}`}`}),he("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),he("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const Qv=ye("base-select-menu",`
321
321
  line-height: 1.5;
322
322
  outline: none;
323
323
  z-index: 0;
@@ -424,7 +424,7 @@ ${o}
424
424
  top: calc(50% - 7px);
425
425
  color: var(--n-option-check-color);
426
426
  transition: color .3s var(--n-bezier);
427
- `,[Oh({enterScale:"0.5"})])])]),e2=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},kt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=Er("InternalSelectMenu",n,e),o=kt("InternalSelectMenu","-internal-select-menu",Jv,Fh,t,i.toRef(t,"clsPrefix")),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>Xw(c.value)),u=i.ref(null);function h(){const{treeMate:O}=t;let U=null;const{value:K}=t;K===null?U=O.getFirstAvailableNode():(t.multiple?U=O.getNode((K||[])[(K||[]).length-1]):U=O.getNode(K),(!U||U.disabled)&&(U=O.getFirstAvailableNode())),W(U||null)}function f(){const{value:O}=u;O&&!t.treeMate.getNode(O.key)&&(u.value=null)}let g;i.watch(()=>t.show,O=>{O?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?h():f(),i.nextTick(I)):f()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const m=i.computed(()=>xr(o.value.self[et("optionHeight",t.size)])),p=i.computed(()=>rn(o.value.self[et("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const O=c.value;return O&&O.length===0});function _(O){const{onToggle:U}=t;U&&U(O)}function C(O){const{onScroll:U}=t;U&&U(O)}function x(O){var U;(U=l.value)===null||U===void 0||U.sync(),C(O)}function N(){var O;(O=l.value)===null||O===void 0||O.sync()}function $(){const{value:O}=u;return O||null}function w(O,U){U.disabled||W(U,!1)}function v(O,U){U.disabled||_(U)}function k(O){var U;_r(O,"action")||(U=t.onKeyup)===null||U===void 0||U.call(t,O)}function B(O){var U;_r(O,"action")||(U=t.onKeydown)===null||U===void 0||U.call(t,O)}function R(O){var U;(U=t.onMousedown)===null||U===void 0||U.call(t,O),!t.focusable&&O.preventDefault()}function E(){const{value:O}=u;O&&W(O.getNext({loop:!0}),!0)}function P(){const{value:O}=u;O&&W(O.getPrev({loop:!0}),!0)}function W(O,U=!1){u.value=O,U&&I()}function I(){var O,U;const K=u.value;if(!K)return;const V=d.value(K.key);V!==null&&(t.virtualScroll?(O=a.value)===null||O===void 0||O.scrollTo({index:V}):(U=l.value)===null||U===void 0||U.scrollTo({index:V,elSize:m.value}))}function Z(O){var U,K;!((U=s.value)===null||U===void 0)&&U.contains(O.target)&&((K=t.onFocus)===null||K===void 0||K.call(t,O))}function te(O){var U,K;!((U=s.value)===null||U===void 0)&&U.contains(O.relatedTarget)||(K=t.onBlur)===null||K===void 0||K.call(t,O)}i.provide(ua,{handleOptionMouseEnter:w,handleOptionClick:v,valueSetRef:b,pendingTmNodeRef:u,nodePropsRef:i.toRef(t,"nodeProps"),showCheckmarkRef:i.toRef(t,"showCheckmark"),multipleRef:i.toRef(t,"multiple"),valueRef:i.toRef(t,"value"),renderLabelRef:i.toRef(t,"renderLabel"),renderOptionRef:i.toRef(t,"renderOption"),labelFieldRef:i.toRef(t,"labelField"),valueFieldRef:i.toRef(t,"valueField")}),i.provide(oh,s),i.onMounted(()=>{const{value:O}=l;O&&O.sync()});const D=i.computed(()=>{const{size:O}=t,{common:{cubicBezierEaseInOut:U},self:{height:K,borderRadius:V,color:q,groupHeaderTextColor:Y,actionDividerColor:ee,optionTextColorPressed:ue,optionTextColor:ve,optionTextColorDisabled:Te,optionTextColorActive:We,optionOpacityDisabled:ce,optionCheckColor:pt,actionTextColor:Ne,optionColorPending:Vt,optionColorActive:jt,loadingColor:ln,loadingSize:Bt,optionColorActivePending:Hn,[et("optionFontSize",O)]:cn,[et("optionHeight",O)]:en,[et("optionPadding",O)]:Ve}}=o.value;return{"--n-height":K,"--n-action-divider-color":ee,"--n-action-text-color":Ne,"--n-bezier":U,"--n-border-radius":V,"--n-color":q,"--n-option-font-size":cn,"--n-group-header-text-color":Y,"--n-option-check-color":pt,"--n-option-color-pending":Vt,"--n-option-color-active":jt,"--n-option-color-active-pending":Hn,"--n-option-height":en,"--n-option-opacity-disabled":ce,"--n-option-text-color":ve,"--n-option-text-color-active":We,"--n-option-text-color-disabled":Te,"--n-option-text-color-pressed":ue,"--n-option-padding":Ve,"--n-option-padding-left":rn(Ve,"left"),"--n-option-padding-right":rn(Ve,"right"),"--n-loading-color":ln,"--n-loading-size":Bt}}),{inlineThemeDisabled:L}=t,H=L?Ci("internal-select-menu",i.computed(()=>t.size[0]),D,t):void 0,z={selfRef:s,next:E,prev:P,getPendingTmNode:$};return dh(s,t.onResize),Object.assign({mergedTheme:o,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:m,padding:p,flattenedNodes:c,empty:y,virtualListContainer(){const{value:O}=a;return O==null?void 0:O.listElRef},virtualListContent(){const{value:O}=a;return O==null?void 0:O.itemsElRef},doScroll:C,handleFocusin:Z,handleFocusout:te,handleKeyUp:k,handleKeyDown:B,handleMouseDown:R,handleVirtualListResize:N,handleVirtualListScroll:x,cssVars:L?void 0:D,themeClass:H==null?void 0:H.themeClass,onRender:H==null?void 0:H.onRender},z)},render(){const{$slots:t,virtualScroll:e,clsPrefix:n,mergedTheme:r,themeClass:o,onRender:s}=this;return s==null||s(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,o,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},xi(t.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(Th,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},pa(t.empty,()=>[i.h(Kv,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(Eh,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(kk,{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(Vh,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(Mh,{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(Vh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(Mh,{clsPrefix:n,key:a.key,tmNode:a})))}),xi(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(Vv,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),t2={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function n2(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:o,fontSize:s,dividerColor:a}=t;return Object.assign(Object.assign({},t2),{fontSize:s,borderRadius:o,color:n,dividerColor:a,textColor:r,boxShadow:e})}const zh={name:"Popover",common:Si,peers:{Scrollbar:xa},self:n2},ka={top:"bottom",bottom:"top",left:"right",right:"left"},dt="var(--n-arrow-height) * 1.414",i2=he([ye("popover",`
427
+ `,[Oh({enterScale:"0.5"})])])]),Jv=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},kt.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=Er("InternalSelectMenu",n,e),o=kt("InternalSelectMenu","-internal-select-menu",Qv,Fh,t,i.toRef(t,"clsPrefix")),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.computed(()=>t.treeMate.getFlattenedNodes()),d=i.computed(()=>qw(c.value)),u=i.ref(null);function h(){const{treeMate:O}=t;let U=null;const{value:K}=t;K===null?U=O.getFirstAvailableNode():(t.multiple?U=O.getNode((K||[])[(K||[]).length-1]):U=O.getNode(K),(!U||U.disabled)&&(U=O.getFirstAvailableNode())),W(U||null)}function f(){const{value:O}=u;O&&!t.treeMate.getNode(O.key)&&(u.value=null)}let g;i.watch(()=>t.show,O=>{O?g=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?h():f(),i.nextTick(I)):f()},{immediate:!0}):g==null||g()},{immediate:!0}),i.onBeforeUnmount(()=>{g==null||g()});const m=i.computed(()=>xr(o.value.self[et("optionHeight",t.size)])),p=i.computed(()=>rn(o.value.self[et("padding",t.size)])),b=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),y=i.computed(()=>{const O=c.value;return O&&O.length===0});function _(O){const{onToggle:U}=t;U&&U(O)}function C(O){const{onScroll:U}=t;U&&U(O)}function x(O){var U;(U=l.value)===null||U===void 0||U.sync(),C(O)}function N(){var O;(O=l.value)===null||O===void 0||O.sync()}function $(){const{value:O}=u;return O||null}function w(O,U){U.disabled||W(U,!1)}function v(O,U){U.disabled||_(U)}function k(O){var U;_r(O,"action")||(U=t.onKeyup)===null||U===void 0||U.call(t,O)}function B(O){var U;_r(O,"action")||(U=t.onKeydown)===null||U===void 0||U.call(t,O)}function R(O){var U;(U=t.onMousedown)===null||U===void 0||U.call(t,O),!t.focusable&&O.preventDefault()}function E(){const{value:O}=u;O&&W(O.getNext({loop:!0}),!0)}function P(){const{value:O}=u;O&&W(O.getPrev({loop:!0}),!0)}function W(O,U=!1){u.value=O,U&&I()}function I(){var O,U;const K=u.value;if(!K)return;const V=d.value(K.key);V!==null&&(t.virtualScroll?(O=a.value)===null||O===void 0||O.scrollTo({index:V}):(U=l.value)===null||U===void 0||U.scrollTo({index:V,elSize:m.value}))}function Z(O){var U,K;!((U=s.value)===null||U===void 0)&&U.contains(O.target)&&((K=t.onFocus)===null||K===void 0||K.call(t,O))}function te(O){var U,K;!((U=s.value)===null||U===void 0)&&U.contains(O.relatedTarget)||(K=t.onBlur)===null||K===void 0||K.call(t,O)}i.provide(ua,{handleOptionMouseEnter:w,handleOptionClick:v,valueSetRef:b,pendingTmNodeRef:u,nodePropsRef:i.toRef(t,"nodeProps"),showCheckmarkRef:i.toRef(t,"showCheckmark"),multipleRef:i.toRef(t,"multiple"),valueRef:i.toRef(t,"value"),renderLabelRef:i.toRef(t,"renderLabel"),renderOptionRef:i.toRef(t,"renderOption"),labelFieldRef:i.toRef(t,"labelField"),valueFieldRef:i.toRef(t,"valueField")}),i.provide(oh,s),i.onMounted(()=>{const{value:O}=l;O&&O.sync()});const D=i.computed(()=>{const{size:O}=t,{common:{cubicBezierEaseInOut:U},self:{height:K,borderRadius:V,color:q,groupHeaderTextColor:Y,actionDividerColor:ee,optionTextColorPressed:ue,optionTextColor:ve,optionTextColorDisabled:Te,optionTextColorActive:We,optionOpacityDisabled:ce,optionCheckColor:pt,actionTextColor:Ne,optionColorPending:Vt,optionColorActive:jt,loadingColor:ln,loadingSize:Bt,optionColorActivePending:Hn,[et("optionFontSize",O)]:cn,[et("optionHeight",O)]:en,[et("optionPadding",O)]:Ve}}=o.value;return{"--n-height":K,"--n-action-divider-color":ee,"--n-action-text-color":Ne,"--n-bezier":U,"--n-border-radius":V,"--n-color":q,"--n-option-font-size":cn,"--n-group-header-text-color":Y,"--n-option-check-color":pt,"--n-option-color-pending":Vt,"--n-option-color-active":jt,"--n-option-color-active-pending":Hn,"--n-option-height":en,"--n-option-opacity-disabled":ce,"--n-option-text-color":ve,"--n-option-text-color-active":We,"--n-option-text-color-disabled":Te,"--n-option-text-color-pressed":ue,"--n-option-padding":Ve,"--n-option-padding-left":rn(Ve,"left"),"--n-option-padding-right":rn(Ve,"right"),"--n-loading-color":ln,"--n-loading-size":Bt}}),{inlineThemeDisabled:L}=t,H=L?Ci("internal-select-menu",i.computed(()=>t.size[0]),D,t):void 0,z={selfRef:s,next:E,prev:P,getPendingTmNode:$};return dh(s,t.onResize),Object.assign({mergedTheme:o,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:m,padding:p,flattenedNodes:c,empty:y,virtualListContainer(){const{value:O}=a;return O==null?void 0:O.listElRef},virtualListContent(){const{value:O}=a;return O==null?void 0:O.itemsElRef},doScroll:C,handleFocusin:Z,handleFocusout:te,handleKeyUp:k,handleKeyDown:B,handleMouseDown:R,handleVirtualListResize:N,handleVirtualListScroll:x,cssVars:L?void 0:D,themeClass:H==null?void 0:H.themeClass,onRender:H==null?void 0:H.onRender},z)},render(){const{$slots:t,virtualScroll:e,clsPrefix:n,mergedTheme:r,themeClass:o,onRender:s}=this;return s==null||s(),i.h("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,o,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},xi(t.header,a=>a&&i.h("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},a)),this.loading?i.h("div",{class:`${n}-base-select-menu__loading`},i.h(Th,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},pa(t.empty,()=>[i.h(Uv,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(Eh,{ref:"scrollbarRef",theme:r.peers.Scrollbar,themeOverrides:r.peerOverrides.Scrollbar,scrollable:this.scrollable,container:e?this.virtualListContainer:void 0,content:e?this.virtualListContent:void 0,onScroll:e?void 0:this.doScroll},{default:()=>e?i.h(xk,{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(Vh,{key:a.key,clsPrefix:n,tmNode:a}):a.ignored?null:i.h(Mh,{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(Vh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(Mh,{clsPrefix:n,key:a.key,tmNode:a})))}),xi(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(Fv,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),eC={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function tC(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:o,fontSize:s,dividerColor:a}=t;return Object.assign(Object.assign({},eC),{fontSize:s,borderRadius:o,color:n,dividerColor:a,textColor:r,boxShadow:e})}const zh={name:"Popover",common:Si,peers:{Scrollbar:xa},self:tC},ka={top:"bottom",bottom:"top",left:"right",right:"left"},dt="var(--n-arrow-height) * 1.414",nC=he([ye("popover",`
428
428
  transition:
429
429
  box-shadow .3s var(--n-bezier),
430
430
  background-color .3s var(--n-bezier),
@@ -532,7 +532,7 @@ ${o}
532
532
  margin-${ka[n]}: var(--n-space-arrow);
533
533
  `),Re("overlap",`
534
534
  margin: 0;
535
- `),Pk("popover-arrow-wrapper",`
535
+ `),Ek("popover-arrow-wrapper",`
536
536
  right: 0;
537
537
  left: 0;
538
538
  top: 0;
@@ -540,7 +540,7 @@ ${o}
540
540
  ${n}: 100%;
541
541
  ${ka[n]}: auto;
542
542
  ${r}
543
- `,[ye("popover-arrow",e)])])])}const Dh=Object.assign(Object.assign({},kt.props),{to:Fn.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 r2({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:o}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${o}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${o}-popover-arrow`,t],style:e}))}const o2=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Dh,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:s,mergedRtlRef:a}=vi(t),l=kt("Popover","-popover",i2,zh,t,o),c=Er("Popover",a,o),d=i.ref(null),u=i.inject("NPopover"),h=i.ref(null),f=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:k}=t;k&&!Fk()&&!t.internalDeactivateImmediately&&(g.value=!0)});const m=i.computed(()=>{const{trigger:k,onClickoutside:B}=t,R=[],{positionManuallyRef:{value:E}}=u;return E||(k==="click"&&!B&&R.push([vo,$,void 0,{capture:!0}]),k==="hover"&&R.push([hx,N])),B&&R.push([vo,$,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&R.push([i.vShow,t.show]),R}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:B,cubicBezierEaseOut:R},self:{space:E,spaceArrow:P,padding:W,fontSize:I,textColor:Z,dividerColor:te,color:D,boxShadow:L,borderRadius:H,arrowHeight:z,arrowOffset:O,arrowOffsetVertical:U}}=l.value;return{"--n-box-shadow":L,"--n-bezier":k,"--n-bezier-ease-in":B,"--n-bezier-ease-out":R,"--n-font-size":I,"--n-text-color":Z,"--n-color":D,"--n-divider-color":te,"--n-border-radius":H,"--n-arrow-height":z,"--n-arrow-offset":O,"--n-arrow-offset-vertical":U,"--n-padding":W,"--n-space":E,"--n-space-arrow":P}}),b=i.computed(()=>{const k=t.width==="trigger"?void 0:ha(t.width),B=[];k&&B.push({width:k});const{maxWidth:R,minWidth:E}=t;return R&&B.push({maxWidth:ha(R)}),E&&B.push({maxWidth:ha(E)}),s||B.push(p.value),B}),y=s?Ci("popover",void 0,p,t):void 0;u.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{u.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),k=>{t.animated||(k?f.value=!0:f.value=!1)});function _(){var k;(k=d.value)===null||k===void 0||k.syncPosition()}function C(k){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(k)}function x(k){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(k)}function N(k){t.trigger==="hover"&&!w().contains(wr(k))&&u.handleMouseMoveOutside(k)}function $(k){(t.trigger==="click"&&!w().contains(wr(k))||t.onClickoutside)&&u.handleClickOutside(k)}function w(){return u.getTriggerElement()}i.provide(lh,h),i.provide(sh,null),i.provide(ah,null);function v(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let B;const R=u.internalRenderBodyRef.value,{value:E}=o;if(R)B=R([`${E}-popover-shared`,(c==null?void 0:c.value)&&`${E}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${E}-popover-shared--overlap`,t.showArrow&&`${E}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${E}-popover-shared--center-arrow`],h,b.value,C,x);else{const{value:P}=u.extraClassRef,{internalTrapFocus:W}=t,I=!xh(e.header)||!xh(e.footer),Z=()=>{var te,D;const L=I?i.h(i.Fragment,null,xi(e.header,O=>O?i.h("div",{class:[`${E}-popover__header`,t.headerClass],style:t.headerStyle},O):null),xi(e.default,O=>O?i.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e):null),xi(e.footer,O=>O?i.h("div",{class:[`${E}-popover__footer`,t.footerClass],style:t.footerStyle},O):null)):t.scrollable?(te=e.default)===null||te===void 0?void 0:te.call(e):i.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e),H=t.scrollable?i.h(jv,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:I?void 0:`${E}-popover__content ${(D=t.contentClass)!==null&&D!==void 0?D:""}`,contentStyle:I?void 0:t.contentStyle},{default:()=>L}):L,z=t.showArrow?r2({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:E}):null;return[H,z]};B=i.h("div",i.mergeProps({class:[`${E}-popover`,`${E}-popover-shared`,(c==null?void 0:c.value)&&`${E}-popover--rtl`,y==null?void 0:y.themeClass.value,P.map(te=>`${E}-${te}`),{[`${E}-popover--scrollable`]:t.scrollable,[`${E}-popover--show-header-or-footer`]:I,[`${E}-popover--raw`]:t.raw,[`${E}-popover-shared--overlap`]:t.overlap,[`${E}-popover-shared--show-arrow`]:t.showArrow,[`${E}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:b.value,onKeydown:u.handleKeydown,onMouseenter:C,onMouseleave:x},n),W?i.h(Sk,{active:t.show,autoFocus:!0},{default:Z}):Z())}return i.withDirectives(B,m.value)}return{displayed:g,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:Fn(t),followerEnabled:f,renderContentNode:v}},render(){return i.h(Mu,{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===Fn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var s2={};const a2=Object.keys(Dh),l2={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function c2(t,e,n){l2[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const o=t.props[r],s=n[r];o?t.props[r]=(...a)=>{o(...a),s(...a)}:t.props[r]=s})}const d2={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:Fn.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},u2=Object.assign(Object.assign(Object.assign({},kt.props),d2),{internalOnAfterLeave:Function,internalRenderBody:Function}),h2=i.defineComponent({name:"Popover",inheritAttrs:!1,props:u2,slots:Object,__popover__:!0,setup(t){s2.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&ei("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&ei("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&ei("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&ei("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&ei("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=Co(),n=i.ref(null),r=i.computed(()=>t.show),o=i.ref(t.defaultShow),s=Qs(r,o),a=Qt(()=>t.disabled?!1:s.value),l=()=>{if(t.disabled)return!0;const{getDisabled:I}=t;return!!(I!=null&&I())},c=()=>l()?!1:s.value,d=gu(t,["arrow","showArrow"]),u=i.computed(()=>t.overlap?!1:d.value);let h=null;const f=i.ref(null),g=i.ref(null),m=Qt(()=>t.x!==void 0&&t.y!==void 0);function p(I){const{"onUpdate:show":Z,onUpdateShow:te,onShow:D,onHide:L}=t;o.value=I,Z&&xt(Z,I),te&&xt(te,I),I&&D&&xt(D,!0),I&&L&&xt(L,!1)}function b(){h&&h.syncPosition()}function y(){const{value:I}=f;I&&(window.clearTimeout(I),f.value=null)}function _(){const{value:I}=g;I&&(window.clearTimeout(I),g.value=null)}function C(){const I=l();if(t.trigger==="focus"&&!I){if(c())return;p(!0)}}function x(){const I=l();if(t.trigger==="focus"&&!I){if(!c())return;p(!1)}}function N(){const I=l();if(t.trigger==="hover"&&!I){if(_(),f.value!==null||c())return;const Z=()=>{p(!0),f.value=null},{delay:te}=t;te===0?Z():f.value=window.setTimeout(Z,te)}}function $(){const I=l();if(t.trigger==="hover"&&!I){if(y(),g.value!==null||!c())return;const Z=()=>{p(!1),g.value=null},{duration:te}=t;te===0?Z():g.value=window.setTimeout(Z,te)}}function w(){$()}function v(I){var Z;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(Z=t.onClickoutside)===null||Z===void 0||Z.call(t,I))}function k(){if(t.trigger==="click"&&!l()){y(),_();const I=!c();p(I)}}function B(I){t.internalTrapFocus&&I.key==="Escape"&&(y(),_(),p(!1))}function R(I){o.value=I}function E(){var I;return(I=n.value)===null||I===void 0?void 0:I.targetRef}function P(I){h=I}return i.provide("NPopover",{getTriggerElement:E,handleKeydown:B,handleMouseEnter:N,handleMouseLeave:$,handleClickOutside:v,handleMouseMoveOutside:w,setBodyInstance:P,positionManuallyRef:m,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{s.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:m,mergedShowConsideringDisabledProp:a,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:c,setShow:R,handleClick:k,handleMouseEnter:N,handleMouseLeave:$,handleFocus:C,handleBlur:x,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,o=!1;if(!e&&(r=Ak(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const s={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)o=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[s,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[s];else{const{internalInheritedEventHandlers:a}=this,l=[s,...a],c={onBlur:d=>{l.forEach(u=>{u.onBlur(d)})},onFocus:d=>{l.forEach(u=>{u.onFocus(d)})},onClick:d=>{l.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{l.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{l.forEach(u=>{u.onMouseleave(d)})}};c2(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(_u,{ref:"binderInstRef",syncTarget:!o,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const s=this.getMergedShow();return[this.internalTrapFocus&&s?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[mu,{enabled:s,zIndex:this.zIndex}]]):null,e?null:i.h(wu,null,{default:()=>r}),i.h(o2,Ik(this.$props,a2,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:s})),{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)}})]}})}}),f2={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 m2(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:o,infoColor:s,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:h,tagColor:f,closeIconColor:g,closeIconColorHover:m,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:C,fontSizeMedium:x,heightMini:N,heightTiny:$,heightSmall:w,heightMedium:v,closeColorHover:k,closeColorPressed:B,buttonColor2Hover:R,buttonColor2Pressed:E,fontWeightStrong:P}=t;return Object.assign(Object.assign({},f2),{closeBorderRadius:b,heightTiny:N,heightSmall:$,heightMedium:w,heightLarge:v,borderRadius:b,opacityDisabled:h,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:C,fontSizeLarge:x,fontWeightStrong:P,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:R,colorPressedCheckable:E,colorChecked:o,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:m,closeIconColorPressed:p,closeColorHover:k,closeColorPressed:B,borderPrimary:`1px solid ${ze(o,{alpha:.3})}`,textColorPrimary:o,colorPrimary:ze(o,{alpha:.12}),colorBorderedPrimary:ze(o,{alpha:.1}),closeIconColorPrimary:o,closeIconColorHoverPrimary:o,closeIconColorPressedPrimary:o,closeColorHoverPrimary:ze(o,{alpha:.12}),closeColorPressedPrimary:ze(o,{alpha:.18}),borderInfo:`1px solid ${ze(s,{alpha:.3})}`,textColorInfo:s,colorInfo:ze(s,{alpha:.12}),colorBorderedInfo:ze(s,{alpha:.1}),closeIconColorInfo:s,closeIconColorHoverInfo:s,closeIconColorPressedInfo:s,closeColorHoverInfo:ze(s,{alpha:.12}),closeColorPressedInfo:ze(s,{alpha:.18}),borderSuccess:`1px solid ${ze(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:ze(a,{alpha:.12}),colorBorderedSuccess:ze(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:ze(a,{alpha:.12}),closeColorPressedSuccess:ze(a,{alpha:.18}),borderWarning:`1px solid ${ze(l,{alpha:.35})}`,textColorWarning:l,colorWarning:ze(l,{alpha:.15}),colorBorderedWarning:ze(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:ze(l,{alpha:.12}),closeColorPressedWarning:ze(l,{alpha:.18}),borderError:`1px solid ${ze(c,{alpha:.23})}`,textColorError:c,colorError:ze(c,{alpha:.1}),colorBorderedError:ze(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:ze(c,{alpha:.12}),closeColorPressedError:ze(c,{alpha:.18})})}const g2={common:Si,self:m2},p2={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},y2=ye("tag",`
543
+ `,[ye("popover-arrow",e)])])])}const Dh=Object.assign(Object.assign({},kt.props),{to:Fn.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 iC({arrowClass:t,arrowStyle:e,arrowWrapperClass:n,arrowWrapperStyle:r,clsPrefix:o}){return i.h("div",{key:"__popover-arrow__",style:r,class:[`${o}-popover-arrow-wrapper`,n]},i.h("div",{class:[`${o}-popover-arrow`,t],style:e}))}const rC=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:Dh,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:s,mergedRtlRef:a}=vi(t),l=kt("Popover","-popover",nC,zh,t,o),c=Er("Popover",a,o),d=i.ref(null),u=i.inject("NPopover"),h=i.ref(null),f=i.ref(t.show),g=i.ref(!1);i.watchEffect(()=>{const{show:k}=t;k&&!Pk()&&!t.internalDeactivateImmediately&&(g.value=!0)});const m=i.computed(()=>{const{trigger:k,onClickoutside:B}=t,R=[],{positionManuallyRef:{value:E}}=u;return E||(k==="click"&&!B&&R.push([vo,$,void 0,{capture:!0}]),k==="hover"&&R.push([ux,N])),B&&R.push([vo,$,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&g.value)&&R.push([i.vShow,t.show]),R}),p=i.computed(()=>{const{common:{cubicBezierEaseInOut:k,cubicBezierEaseIn:B,cubicBezierEaseOut:R},self:{space:E,spaceArrow:P,padding:W,fontSize:I,textColor:Z,dividerColor:te,color:D,boxShadow:L,borderRadius:H,arrowHeight:z,arrowOffset:O,arrowOffsetVertical:U}}=l.value;return{"--n-box-shadow":L,"--n-bezier":k,"--n-bezier-ease-in":B,"--n-bezier-ease-out":R,"--n-font-size":I,"--n-text-color":Z,"--n-color":D,"--n-divider-color":te,"--n-border-radius":H,"--n-arrow-height":z,"--n-arrow-offset":O,"--n-arrow-offset-vertical":U,"--n-padding":W,"--n-space":E,"--n-space-arrow":P}}),b=i.computed(()=>{const k=t.width==="trigger"?void 0:ha(t.width),B=[];k&&B.push({width:k});const{maxWidth:R,minWidth:E}=t;return R&&B.push({maxWidth:ha(R)}),E&&B.push({maxWidth:ha(E)}),s||B.push(p.value),B}),y=s?Ci("popover",void 0,p,t):void 0;u.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{u.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),k=>{t.animated||(k?f.value=!0:f.value=!1)});function _(){var k;(k=d.value)===null||k===void 0||k.syncPosition()}function C(k){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(k)}function x(k){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(k)}function N(k){t.trigger==="hover"&&!w().contains(wr(k))&&u.handleMouseMoveOutside(k)}function $(k){(t.trigger==="click"&&!w().contains(wr(k))||t.onClickoutside)&&u.handleClickOutside(k)}function w(){return u.getTriggerElement()}i.provide(lh,h),i.provide(sh,null),i.provide(ah,null);function v(){if(y==null||y.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&g.value))return null;let B;const R=u.internalRenderBodyRef.value,{value:E}=o;if(R)B=R([`${E}-popover-shared`,(c==null?void 0:c.value)&&`${E}-popover--rtl`,y==null?void 0:y.themeClass.value,t.overlap&&`${E}-popover-shared--overlap`,t.showArrow&&`${E}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${E}-popover-shared--center-arrow`],h,b.value,C,x);else{const{value:P}=u.extraClassRef,{internalTrapFocus:W}=t,I=!xh(e.header)||!xh(e.footer),Z=()=>{var te,D;const L=I?i.h(i.Fragment,null,xi(e.header,O=>O?i.h("div",{class:[`${E}-popover__header`,t.headerClass],style:t.headerStyle},O):null),xi(e.default,O=>O?i.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e):null),xi(e.footer,O=>O?i.h("div",{class:[`${E}-popover__footer`,t.footerClass],style:t.footerStyle},O):null)):t.scrollable?(te=e.default)===null||te===void 0?void 0:te.call(e):i.h("div",{class:[`${E}-popover__content`,t.contentClass],style:t.contentStyle},e),H=t.scrollable?i.h(Wv,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:I?void 0:`${E}-popover__content ${(D=t.contentClass)!==null&&D!==void 0?D:""}`,contentStyle:I?void 0:t.contentStyle},{default:()=>L}):L,z=t.showArrow?iC({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:E}):null;return[H,z]};B=i.h("div",i.mergeProps({class:[`${E}-popover`,`${E}-popover-shared`,(c==null?void 0:c.value)&&`${E}-popover--rtl`,y==null?void 0:y.themeClass.value,P.map(te=>`${E}-${te}`),{[`${E}-popover--scrollable`]:t.scrollable,[`${E}-popover--show-header-or-footer`]:I,[`${E}-popover--raw`]:t.raw,[`${E}-popover-shared--overlap`]:t.overlap,[`${E}-popover-shared--show-arrow`]:t.showArrow,[`${E}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:b.value,onKeydown:u.handleKeydown,onMouseenter:C,onMouseleave:x},n),W?i.h(Ck,{active:t.show,autoFocus:!0},{default:Z}):Z())}return i.withDirectives(B,m.value)}return{displayed:g,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:Fn(t),followerEnabled:f,renderContentNode:v}},render(){return i.h(Mu,{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===Fn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var oC={};const sC=Object.keys(Dh),aC={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function lC(t,e,n){aC[e].forEach(r=>{t.props?t.props=Object.assign({},t.props):t.props={};const o=t.props[r],s=n[r];o?t.props[r]=(...a)=>{o(...a),s(...a)}:t.props[r]=s})}const cC={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:Fn.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},dC=Object.assign(Object.assign(Object.assign({},kt.props),cC),{internalOnAfterLeave:Function,internalRenderBody:Function}),uC=i.defineComponent({name:"Popover",inheritAttrs:!1,props:dC,slots:Object,__popover__:!0,setup(t){oC.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&ei("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&ei("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&ei("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&ei("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&ei("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=Co(),n=i.ref(null),r=i.computed(()=>t.show),o=i.ref(t.defaultShow),s=Qs(r,o),a=Qt(()=>t.disabled?!1:s.value),l=()=>{if(t.disabled)return!0;const{getDisabled:I}=t;return!!(I!=null&&I())},c=()=>l()?!1:s.value,d=gu(t,["arrow","showArrow"]),u=i.computed(()=>t.overlap?!1:d.value);let h=null;const f=i.ref(null),g=i.ref(null),m=Qt(()=>t.x!==void 0&&t.y!==void 0);function p(I){const{"onUpdate:show":Z,onUpdateShow:te,onShow:D,onHide:L}=t;o.value=I,Z&&xt(Z,I),te&&xt(te,I),I&&D&&xt(D,!0),I&&L&&xt(L,!1)}function b(){h&&h.syncPosition()}function y(){const{value:I}=f;I&&(window.clearTimeout(I),f.value=null)}function _(){const{value:I}=g;I&&(window.clearTimeout(I),g.value=null)}function C(){const I=l();if(t.trigger==="focus"&&!I){if(c())return;p(!0)}}function x(){const I=l();if(t.trigger==="focus"&&!I){if(!c())return;p(!1)}}function N(){const I=l();if(t.trigger==="hover"&&!I){if(_(),f.value!==null||c())return;const Z=()=>{p(!0),f.value=null},{delay:te}=t;te===0?Z():f.value=window.setTimeout(Z,te)}}function $(){const I=l();if(t.trigger==="hover"&&!I){if(y(),g.value!==null||!c())return;const Z=()=>{p(!1),g.value=null},{duration:te}=t;te===0?Z():g.value=window.setTimeout(Z,te)}}function w(){$()}function v(I){var Z;c()&&(t.trigger==="click"&&(y(),_(),p(!1)),(Z=t.onClickoutside)===null||Z===void 0||Z.call(t,I))}function k(){if(t.trigger==="click"&&!l()){y(),_();const I=!c();p(I)}}function B(I){t.internalTrapFocus&&I.key==="Escape"&&(y(),_(),p(!1))}function R(I){o.value=I}function E(){var I;return(I=n.value)===null||I===void 0?void 0:I.targetRef}function P(I){h=I}return i.provide("NPopover",{getTriggerElement:E,handleKeydown:B,handleMouseEnter:N,handleMouseLeave:$,handleClickOutside:v,handleMouseMoveOutside:w,setBodyInstance:P,positionManuallyRef:m,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{s.value&&l()&&p(!1)}),{binderInstRef:n,positionManually:m,mergedShowConsideringDisabledProp:a,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:c,setShow:R,handleClick:k,handleMouseEnter:N,handleMouseLeave:$,handleFocus:C,handleBlur:x,syncPosition:b}},render(){var t;const{positionManually:e,$slots:n}=this;let r,o=!1;if(!e&&(r=Mk(n,"trigger"),r)){r=i.cloneVNode(r),r=r.type===i.Text?i.h("span",[r]):r;const s={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((t=r.type)===null||t===void 0)&&t.__popover__)o=!0,r.props||(r.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),r.props.internalSyncTargetWithParent=!0,r.props.internalInheritedEventHandlers?r.props.internalInheritedEventHandlers=[s,...r.props.internalInheritedEventHandlers]:r.props.internalInheritedEventHandlers=[s];else{const{internalInheritedEventHandlers:a}=this,l=[s,...a],c={onBlur:d=>{l.forEach(u=>{u.onBlur(d)})},onFocus:d=>{l.forEach(u=>{u.onFocus(d)})},onClick:d=>{l.forEach(u=>{u.onClick(d)})},onMouseenter:d=>{l.forEach(u=>{u.onMouseenter(d)})},onMouseleave:d=>{l.forEach(u=>{u.onMouseleave(d)})}};lC(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(_u,{ref:"binderInstRef",syncTarget:!o,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const s=this.getMergedShow();return[this.internalTrapFocus&&s?i.withDirectives(i.h("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[mu,{enabled:s,zIndex:this.zIndex}]]):null,e?null:i.h(wu,null,{default:()=>r}),i.h(rC,Ak(this.$props,sC,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:s})),{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)}})]}})}}),hC={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 fC(t){const{textColor2:e,primaryColorHover:n,primaryColorPressed:r,primaryColor:o,infoColor:s,successColor:a,warningColor:l,errorColor:c,baseColor:d,borderColor:u,opacityDisabled:h,tagColor:f,closeIconColor:g,closeIconColorHover:m,closeIconColorPressed:p,borderRadiusSmall:b,fontSizeMini:y,fontSizeTiny:_,fontSizeSmall:C,fontSizeMedium:x,heightMini:N,heightTiny:$,heightSmall:w,heightMedium:v,closeColorHover:k,closeColorPressed:B,buttonColor2Hover:R,buttonColor2Pressed:E,fontWeightStrong:P}=t;return Object.assign(Object.assign({},hC),{closeBorderRadius:b,heightTiny:N,heightSmall:$,heightMedium:w,heightLarge:v,borderRadius:b,opacityDisabled:h,fontSizeTiny:y,fontSizeSmall:_,fontSizeMedium:C,fontSizeLarge:x,fontWeightStrong:P,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:R,colorPressedCheckable:E,colorChecked:o,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:g,closeIconColorHover:m,closeIconColorPressed:p,closeColorHover:k,closeColorPressed:B,borderPrimary:`1px solid ${ze(o,{alpha:.3})}`,textColorPrimary:o,colorPrimary:ze(o,{alpha:.12}),colorBorderedPrimary:ze(o,{alpha:.1}),closeIconColorPrimary:o,closeIconColorHoverPrimary:o,closeIconColorPressedPrimary:o,closeColorHoverPrimary:ze(o,{alpha:.12}),closeColorPressedPrimary:ze(o,{alpha:.18}),borderInfo:`1px solid ${ze(s,{alpha:.3})}`,textColorInfo:s,colorInfo:ze(s,{alpha:.12}),colorBorderedInfo:ze(s,{alpha:.1}),closeIconColorInfo:s,closeIconColorHoverInfo:s,closeIconColorPressedInfo:s,closeColorHoverInfo:ze(s,{alpha:.12}),closeColorPressedInfo:ze(s,{alpha:.18}),borderSuccess:`1px solid ${ze(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:ze(a,{alpha:.12}),colorBorderedSuccess:ze(a,{alpha:.1}),closeIconColorSuccess:a,closeIconColorHoverSuccess:a,closeIconColorPressedSuccess:a,closeColorHoverSuccess:ze(a,{alpha:.12}),closeColorPressedSuccess:ze(a,{alpha:.18}),borderWarning:`1px solid ${ze(l,{alpha:.35})}`,textColorWarning:l,colorWarning:ze(l,{alpha:.15}),colorBorderedWarning:ze(l,{alpha:.12}),closeIconColorWarning:l,closeIconColorHoverWarning:l,closeIconColorPressedWarning:l,closeColorHoverWarning:ze(l,{alpha:.12}),closeColorPressedWarning:ze(l,{alpha:.18}),borderError:`1px solid ${ze(c,{alpha:.23})}`,textColorError:c,colorError:ze(c,{alpha:.1}),colorBorderedError:ze(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:ze(c,{alpha:.12}),closeColorPressedError:ze(c,{alpha:.18})})}const mC={common:Si,self:fC},gC={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},pC=ye("tag",`
544
544
  --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
545
545
  white-space: nowrap;
546
546
  position: relative;
@@ -610,7 +610,7 @@ ${o}
610
610
  `,[on("disabled",[he("&:hover","background-color: var(--n-color-hover-checkable);",[on("checked","color: var(--n-text-color-hover-checkable);")]),he("&:active","background-color: var(--n-color-pressed-checkable);",[on("checked","color: var(--n-text-color-pressed-checkable);")])]),Re("checked",`
611
611
  color: var(--n-text-color-checked);
612
612
  background-color: var(--n-color-checked);
613
- `,[on("disabled",[he("&:hover","background-color: var(--n-color-checked-hover);"),he("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var b2={};const _2=Object.assign(Object.assign(Object.assign({},kt.props),p2),{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}),w2="n-tag",va=i.defineComponent({name:"Tag",props:_2,slots:Object,setup(t){b2.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&ei("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:o,mergedRtlRef:s}=vi(t),a=kt("Tag","-tag",y2,g2,t,r);i.provide(w2,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:g,onCheckedChange:m,onUpdateChecked:p,"onUpdate:checked":b}=t;p&&p(!g),b&&b(!g),m&&m(!g)}}function c(g){if(t.triggerClickOnClose||g.stopPropagation(),!t.disabled){const{onClose:m}=t;m&&xt(m,g)}}const d={setTextContent(g){const{value:m}=e;m&&(m.textContent=g)}},u=Er("Tag",s,r),h=i.computed(()=>{const{type:g,size:m,color:{color:p,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:C,borderRadius:x,opacityDisabled:N,textColorCheckable:$,textColorHoverCheckable:w,textColorPressedCheckable:v,textColorChecked:k,colorCheckable:B,colorHoverCheckable:R,colorPressedCheckable:E,colorChecked:P,colorCheckedHover:W,colorCheckedPressed:I,closeBorderRadius:Z,fontWeightStrong:te,[et("colorBordered",g)]:D,[et("closeSize",m)]:L,[et("closeIconSize",m)]:H,[et("fontSize",m)]:z,[et("height",m)]:O,[et("color",g)]:U,[et("textColor",g)]:K,[et("border",g)]:V,[et("closeIconColor",g)]:q,[et("closeIconColorHover",g)]:Y,[et("closeIconColorPressed",g)]:ee,[et("closeColorHover",g)]:ue,[et("closeColorPressed",g)]:ve}}=a.value,Te=rn(C);return{"--n-font-weight-strong":te,"--n-avatar-size-override":`calc(${O} - 8px)`,"--n-bezier":y,"--n-border-radius":x,"--n-border":V,"--n-close-icon-size":H,"--n-close-color-pressed":ve,"--n-close-color-hover":ue,"--n-close-border-radius":Z,"--n-close-icon-color":q,"--n-close-icon-color-hover":Y,"--n-close-icon-color-pressed":ee,"--n-close-icon-color-disabled":q,"--n-close-margin-top":Te.top,"--n-close-margin-right":Te.right,"--n-close-margin-bottom":Te.bottom,"--n-close-margin-left":Te.left,"--n-close-size":L,"--n-color":p||(n.value?D:U),"--n-color-checkable":B,"--n-color-checked":P,"--n-color-checked-hover":W,"--n-color-checked-pressed":I,"--n-color-hover-checkable":R,"--n-color-pressed-checkable":E,"--n-font-size":z,"--n-height":O,"--n-opacity-disabled":N,"--n-padding":_,"--n-text-color":b||K,"--n-text-color-checkable":$,"--n-text-color-checked":k,"--n-text-color-hover-checkable":w,"--n-text-color-pressed-checkable":v}}),f=o?Ci("tag",i.computed(()=>{let g="";const{type:m,size:p,color:{color:b,textColor:y}={}}=t;return g+=m[0],g+=p[0],b&&(g+=`a${uh(b)}`),y&&(g+=`b${uh(y)}`),n.value&&(g+="c"),g}),h,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:u,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:o?void 0:h,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender})},render(){var t,e;const{mergedClsPrefix:n,rtlEnabled:r,closable:o,color:{borderColor:s}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=xi(c.avatar,h=>h&&i.h("div",{class:`${n}-tag__avatar`},h)),u=xi(c.icon,h=>h&&i.h("div",{class:`${n}-tag__icon`},h));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:u,[`${n}-tag--closable`]:o}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&o?i.h(Fv,{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:s}}):null)}}),x2=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(t,{slots:e}){return()=>{const{clsPrefix:n}=t;return i.h(Th,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(Ev,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h(Fr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>pa(e.default,()=>[i.h(Sv,null)])})}):null})}}}),k2={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function v2(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:o,inputColorDisabled:s,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:h,borderColor:f,iconColor:g,iconColorDisabled:m,clearColor:p,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:C,fontSizeTiny:x,fontSizeSmall:N,fontSizeMedium:$,fontSizeLarge:w,heightTiny:v,heightSmall:k,heightMedium:B,heightLarge:R,fontWeight:E}=t;return Object.assign(Object.assign({},k2),{fontSizeTiny:x,fontSizeSmall:N,fontSizeMedium:$,fontSizeLarge:w,heightTiny:v,heightSmall:k,heightMedium:B,heightLarge:R,borderRadius:e,fontWeight:E,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:C,color:o,colorDisabled:s,colorActive:o,border:`1px solid ${f}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${ze(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${ze(a,{alpha:.2})}`,caretColor:a,arrowColor:g,arrowColorDisabled:m,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 ${ze(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${ze(c,{alpha:.2})}`,colorActiveWarning:o,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${h}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${h}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${ze(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${ze(u,{alpha:.2})}`,colorActiveError:o,caretColorError:u,clearColor:p,clearColorHover:b,clearColorPressed:y})}const Lh={name:"InternalSelection",common:Si,peers:{Popover:zh},self:v2},C2=he([ye("base-selection",`
613
+ `,[on("disabled",[he("&:hover","background-color: var(--n-color-checked-hover);"),he("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var yC={};const bC=Object.assign(Object.assign(Object.assign({},kt.props),gC),{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}),_C="n-tag",va=i.defineComponent({name:"Tag",props:bC,slots:Object,setup(t){yC.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&ei("tag","`on-checked-change` is deprecated, please use `on-update:checked` instead")});const e=i.ref(null),{mergedBorderedRef:n,mergedClsPrefixRef:r,inlineThemeDisabled:o,mergedRtlRef:s}=vi(t),a=kt("Tag","-tag",pC,mC,t,r);i.provide(_C,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:g,onCheckedChange:m,onUpdateChecked:p,"onUpdate:checked":b}=t;p&&p(!g),b&&b(!g),m&&m(!g)}}function c(g){if(t.triggerClickOnClose||g.stopPropagation(),!t.disabled){const{onClose:m}=t;m&&xt(m,g)}}const d={setTextContent(g){const{value:m}=e;m&&(m.textContent=g)}},u=Er("Tag",s,r),h=i.computed(()=>{const{type:g,size:m,color:{color:p,textColor:b}={}}=t,{common:{cubicBezierEaseInOut:y},self:{padding:_,closeMargin:C,borderRadius:x,opacityDisabled:N,textColorCheckable:$,textColorHoverCheckable:w,textColorPressedCheckable:v,textColorChecked:k,colorCheckable:B,colorHoverCheckable:R,colorPressedCheckable:E,colorChecked:P,colorCheckedHover:W,colorCheckedPressed:I,closeBorderRadius:Z,fontWeightStrong:te,[et("colorBordered",g)]:D,[et("closeSize",m)]:L,[et("closeIconSize",m)]:H,[et("fontSize",m)]:z,[et("height",m)]:O,[et("color",g)]:U,[et("textColor",g)]:K,[et("border",g)]:V,[et("closeIconColor",g)]:q,[et("closeIconColorHover",g)]:Y,[et("closeIconColorPressed",g)]:ee,[et("closeColorHover",g)]:ue,[et("closeColorPressed",g)]:ve}}=a.value,Te=rn(C);return{"--n-font-weight-strong":te,"--n-avatar-size-override":`calc(${O} - 8px)`,"--n-bezier":y,"--n-border-radius":x,"--n-border":V,"--n-close-icon-size":H,"--n-close-color-pressed":ve,"--n-close-color-hover":ue,"--n-close-border-radius":Z,"--n-close-icon-color":q,"--n-close-icon-color-hover":Y,"--n-close-icon-color-pressed":ee,"--n-close-icon-color-disabled":q,"--n-close-margin-top":Te.top,"--n-close-margin-right":Te.right,"--n-close-margin-bottom":Te.bottom,"--n-close-margin-left":Te.left,"--n-close-size":L,"--n-color":p||(n.value?D:U),"--n-color-checkable":B,"--n-color-checked":P,"--n-color-checked-hover":W,"--n-color-checked-pressed":I,"--n-color-hover-checkable":R,"--n-color-pressed-checkable":E,"--n-font-size":z,"--n-height":O,"--n-opacity-disabled":N,"--n-padding":_,"--n-text-color":b||K,"--n-text-color-checkable":$,"--n-text-color-checked":k,"--n-text-color-hover-checkable":w,"--n-text-color-pressed-checkable":v}}),f=o?Ci("tag",i.computed(()=>{let g="";const{type:m,size:p,color:{color:b,textColor:y}={}}=t;return g+=m[0],g+=p[0],b&&(g+=`a${uh(b)}`),y&&(g+=`b${uh(y)}`),n.value&&(g+="c"),g}),h,t):void 0;return Object.assign(Object.assign({},d),{rtlEnabled:u,mergedClsPrefix:r,contentRef:e,mergedBordered:n,handleClick:l,handleCloseClick:c,cssVars:o?void 0:h,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender})},render(){var t,e;const{mergedClsPrefix:n,rtlEnabled:r,closable:o,color:{borderColor:s}={},round:a,onRender:l,$slots:c}=this;l==null||l();const d=xi(c.avatar,h=>h&&i.h("div",{class:`${n}-tag__avatar`},h)),u=xi(c.icon,h=>h&&i.h("div",{class:`${n}-tag__icon`},h));return i.h("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:r,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:a,[`${n}-tag--avatar`]:d,[`${n}-tag--icon`]:u,[`${n}-tag--closable`]:o}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},u||d,i.h("span",{class:`${n}-tag__content`,ref:"contentRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)),!this.checkable&&o?i.h(Pv,{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:s}}):null)}}),wC=i.defineComponent({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(t,{slots:e}){return()=>{const{clsPrefix:n}=t;return i.h(Th,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(Rv,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h(Fr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>pa(e.default,()=>[i.h(Cv,null)])})}):null})}}}),xC={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function kC(t){const{borderRadius:e,textColor2:n,textColorDisabled:r,inputColor:o,inputColorDisabled:s,primaryColor:a,primaryColorHover:l,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:h,borderColor:f,iconColor:g,iconColorDisabled:m,clearColor:p,clearColorHover:b,clearColorPressed:y,placeholderColor:_,placeholderColorDisabled:C,fontSizeTiny:x,fontSizeSmall:N,fontSizeMedium:$,fontSizeLarge:w,heightTiny:v,heightSmall:k,heightMedium:B,heightLarge:R,fontWeight:E}=t;return Object.assign(Object.assign({},xC),{fontSizeTiny:x,fontSizeSmall:N,fontSizeMedium:$,fontSizeLarge:w,heightTiny:v,heightSmall:k,heightMedium:B,heightLarge:R,borderRadius:e,fontWeight:E,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:C,color:o,colorDisabled:s,colorActive:o,border:`1px solid ${f}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${ze(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${ze(a,{alpha:.2})}`,caretColor:a,arrowColor:g,arrowColorDisabled:m,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 ${ze(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${ze(c,{alpha:.2})}`,colorActiveWarning:o,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${h}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${h}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${ze(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${ze(u,{alpha:.2})}`,colorActiveError:o,caretColorError:u,clearColor:p,clearColorHover:b,clearColorPressed:y})}const Lh={name:"InternalSelection",common:Si,peers:{Popover:zh},self:kC},vC=he([ye("base-selection",`
614
614
  --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
615
615
  --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
616
616
  position: relative;
@@ -810,7 +810,7 @@ ${o}
810
810
  line-height: 1.25;
811
811
  text-overflow: ellipsis;
812
812
  overflow: hidden;
813
- `)])])]),S2=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},kt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=Er("InternalSelection",n,e),o=i.ref(null),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=kt("InternalSelection","-internal-selection",C2,Lh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),C=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=i.computed(()=>{const J=t.selectedOption;if(J)return J[t.labelField]}),N=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function $(){var J;const{value:le}=o;if(le){const{value:De}=s;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((J=f.value)===null||J===void 0||J.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:J}=g;J&&(J.style.display="none")}function v(){const{value:J}=g;J&&(J.style.display="inline-block")}i.watch(i.toRef(t,"active"),J=>{J||w()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick($)});function k(J){const{onFocus:le}=t;le&&le(J)}function B(J){const{onBlur:le}=t;le&&le(J)}function R(J){const{onDeleteOption:le}=t;le&&le(J)}function E(J){const{onClear:le}=t;le&&le(J)}function P(J){const{onPatternInput:le}=t;le&&le(J)}function W(J){var le;(!J.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(J.relatedTarget)))&&k(J)}function I(J){var le;!((le=a.value)===null||le===void 0)&&le.contains(J.relatedTarget)||B(J)}function Z(J){E(J)}function te(){b.value=!0}function D(){b.value=!1}function L(J){!t.active||!t.filterable||J.target!==s.value&&J.preventDefault()}function H(J){R(J)}const z=i.ref(!1);function O(J){if(J.key==="Backspace"&&!z.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&H(le[le.length-1])}}let U=null;function K(J){const{value:le}=o;if(le){const De=J.target.value;le.textContent=De,$()}t.ignoreComposition&&z.value?U=J:P(J)}function V(){z.value=!0}function q(){z.value=!1,t.ignoreComposition&&P(U),U=null}function Y(J){var le;p.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,J)}function ee(J){var le;p.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,J)}function ue(){var J,le;if(t.filterable)p.value=!1,(J=d.value)===null||J===void 0||J.blur(),(le=s.value)===null||le===void 0||le.blur();else if(t.multiple){const{value:De}=l;De==null||De.blur()}else{const{value:De}=c;De==null||De.blur()}}function ve(){var J,le,De;t.filterable?(p.value=!1,(J=d.value)===null||J===void 0||J.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function Te(){const{value:J}=s;J&&(v(),J.focus())}function We(){const{value:J}=s;J&&J.blur()}function ce(J){const{value:le}=u;le&&le.setTextContent(`+${J}`)}function pt(){const{value:J}=h;return J}function Ne(){return s.value}let Vt=null;function jt(){Vt!==null&&window.clearTimeout(Vt)}function ln(){t.active||(jt(),Vt=window.setTimeout(()=>{N.value&&(m.value=!0)},100))}function Bt(){jt()}function Hn(J){J||(jt(),m.value=!1)}i.watch(N,J=>{J||(m.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const J=d.value;J&&(t.disabled?J.removeAttribute("tabindex"):J.tabIndex=p.value?-1:0)})}),dh(a,t.onResize);const{inlineThemeDisabled:cn}=t,en=i.computed(()=>{const{size:J}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:ni,color:it,placeholderColor:qt,textColor:tr,paddingSingle:ii,paddingMultiple:$i,caretColor:nr,colorDisabled:dn,textColorDisabled:Wn,placeholderColorDisabled:F,colorActive:G,boxShadowFocus:se,boxShadowActive:fe,boxShadowHover:me,border:_e,borderFocus:ke,borderHover:Se,borderActive:Qe,arrowColor:Bn,arrowColorDisabled:$a,loadingColor:Ra,colorActiveWarning:Ea,boxShadowFocusWarning:Pa,boxShadowActiveWarning:Fa,boxShadowHoverWarning:Va,borderWarning:Ma,borderFocusWarning:Aa,borderHoverWarning:Ia,borderActiveWarning:Oa,colorActiveError:za,boxShadowFocusError:Da,boxShadowActiveError:La,boxShadowHoverError:Ha,borderError:Wa,borderFocusError:ja,borderHoverError:qa,borderActiveError:YB,clearColor:UB,clearColorHover:KB,clearColorPressed:GB,clearSize:ZB,arrowSize:QB,[et("height",J)]:JB,[et("fontSize",J)]:e3}}=y.value,Do=rn(ii),Lo=rn($i);return{"--n-bezier":le,"--n-border":_e,"--n-border-active":Qe,"--n-border-focus":ke,"--n-border-hover":Se,"--n-border-radius":ni,"--n-box-shadow-active":fe,"--n-box-shadow-focus":se,"--n-box-shadow-hover":me,"--n-caret-color":nr,"--n-color":it,"--n-color-active":G,"--n-color-disabled":dn,"--n-font-size":e3,"--n-height":JB,"--n-padding-single-top":Do.top,"--n-padding-multiple-top":Lo.top,"--n-padding-single-right":Do.right,"--n-padding-multiple-right":Lo.right,"--n-padding-single-left":Do.left,"--n-padding-multiple-left":Lo.left,"--n-padding-single-bottom":Do.bottom,"--n-padding-multiple-bottom":Lo.bottom,"--n-placeholder-color":qt,"--n-placeholder-color-disabled":F,"--n-text-color":tr,"--n-text-color-disabled":Wn,"--n-arrow-color":Bn,"--n-arrow-color-disabled":$a,"--n-loading-color":Ra,"--n-color-active-warning":Ea,"--n-box-shadow-focus-warning":Pa,"--n-box-shadow-active-warning":Fa,"--n-box-shadow-hover-warning":Va,"--n-border-warning":Ma,"--n-border-focus-warning":Aa,"--n-border-hover-warning":Ia,"--n-border-active-warning":Oa,"--n-color-active-error":za,"--n-box-shadow-focus-error":Da,"--n-box-shadow-active-error":La,"--n-box-shadow-hover-error":Ha,"--n-border-error":Wa,"--n-border-focus-error":ja,"--n-border-hover-error":qa,"--n-border-active-error":YB,"--n-clear-size":ZB,"--n-clear-color":UB,"--n-clear-color-hover":KB,"--n-clear-color-pressed":GB,"--n-arrow-size":QB,"--n-font-weight":De}}),Ve=cn?Ci("internal-selection",i.computed(()=>t.size[0]),en,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:C,label:x,selected:N,showTagsPanel:m,isComposing:z,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:g,handleMouseDown:L,handleFocusin:W,handleClear:Z,handleMouseEnter:te,handleMouseLeave:D,handleDeleteOption:H,handlePatternKeyDown:O,handlePatternInputInput:K,handlePatternInputBlur:ee,handlePatternInputFocus:Y,handleMouseEnterCounter:ln,handleMouseLeaveCounter:Bt,handleFocusout:I,handleCompositionEnd:q,handleCompositionStart:V,onPopoverUpdateShow:Hn,focus:ve,focusInput:Te,blur:ue,blurInput:We,updateCounter:ce,getCounter:pt,getTail:Ne,renderLabel:t.renderLabel,cssVars:cn?void 0:en,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:o,maxTagCount:s,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const f=s==="responsive",g=typeof s=="number",m=f||g,p=i.h(ya,null,{default:()=>i.h(x2,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=P=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:P.value},u?u({option:P,handleClose:()=>{this.handleDeleteOption(P)}}):i.h(va,{size:n,closable:!P.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(P)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(P,!0):er(P[y],P,!0)})),C=()=>(g?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),x=o?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,N=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(va,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let $;if(g){const P=this.selectedOptions.length-s;P>0&&($=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(va,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${P}`})))}const w=f?o?i.h(eh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:C,counter:N,tail:()=>x}):i.h(eh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:C,counter:N}):g&&$?C().concat($):C(),v=m?()=>i.h("div",{class:`${l}-base-selection-popover`},f?C():this.selectedOptions.map(_)):void 0,k=m?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,R=(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,E=o?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,f?null:x,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,p);b=i.h(i.Fragment,null,m?i.h(h2,Object.assign({},k,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>E,default:v}):E,R)}else if(o){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,C=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:yh(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})),C?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else b=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:yh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function B2(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const T2={name:"Select",common:Si,peers:{InternalSelection:Lh,InternalSelectMenu:Fh},self:B2},N2=he([ye("select",`
813
+ `)])])]),CC=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},kt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=vi(t),r=Er("InternalSelection",n,e),o=i.ref(null),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),f=i.ref(null),g=i.ref(null),m=i.ref(!1),p=i.ref(!1),b=i.ref(!1),y=kt("InternalSelection","-internal-selection",vC,Lh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(b.value||t.active)),C=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):er(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=i.computed(()=>{const J=t.selectedOption;if(J)return J[t.labelField]}),N=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function $(){var J;const{value:le}=o;if(le){const{value:De}=s;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((J=f.value)===null||J===void 0||J.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:J}=g;J&&(J.style.display="none")}function v(){const{value:J}=g;J&&(J.style.display="inline-block")}i.watch(i.toRef(t,"active"),J=>{J||w()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick($)});function k(J){const{onFocus:le}=t;le&&le(J)}function B(J){const{onBlur:le}=t;le&&le(J)}function R(J){const{onDeleteOption:le}=t;le&&le(J)}function E(J){const{onClear:le}=t;le&&le(J)}function P(J){const{onPatternInput:le}=t;le&&le(J)}function W(J){var le;(!J.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(J.relatedTarget)))&&k(J)}function I(J){var le;!((le=a.value)===null||le===void 0)&&le.contains(J.relatedTarget)||B(J)}function Z(J){E(J)}function te(){b.value=!0}function D(){b.value=!1}function L(J){!t.active||!t.filterable||J.target!==s.value&&J.preventDefault()}function H(J){R(J)}const z=i.ref(!1);function O(J){if(J.key==="Backspace"&&!z.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&H(le[le.length-1])}}let U=null;function K(J){const{value:le}=o;if(le){const De=J.target.value;le.textContent=De,$()}t.ignoreComposition&&z.value?U=J:P(J)}function V(){z.value=!0}function q(){z.value=!1,t.ignoreComposition&&P(U),U=null}function Y(J){var le;p.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,J)}function ee(J){var le;p.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,J)}function ue(){var J,le;if(t.filterable)p.value=!1,(J=d.value)===null||J===void 0||J.blur(),(le=s.value)===null||le===void 0||le.blur();else if(t.multiple){const{value:De}=l;De==null||De.blur()}else{const{value:De}=c;De==null||De.blur()}}function ve(){var J,le,De;t.filterable?(p.value=!1,(J=d.value)===null||J===void 0||J.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function Te(){const{value:J}=s;J&&(v(),J.focus())}function We(){const{value:J}=s;J&&J.blur()}function ce(J){const{value:le}=u;le&&le.setTextContent(`+${J}`)}function pt(){const{value:J}=h;return J}function Ne(){return s.value}let Vt=null;function jt(){Vt!==null&&window.clearTimeout(Vt)}function ln(){t.active||(jt(),Vt=window.setTimeout(()=>{N.value&&(m.value=!0)},100))}function Bt(){jt()}function Hn(J){J||(jt(),m.value=!1)}i.watch(N,J=>{J||(m.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const J=d.value;J&&(t.disabled?J.removeAttribute("tabindex"):J.tabIndex=p.value?-1:0)})}),dh(a,t.onResize);const{inlineThemeDisabled:cn}=t,en=i.computed(()=>{const{size:J}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:ni,color:rt,placeholderColor:qt,textColor:tr,paddingSingle:ii,paddingMultiple:$i,caretColor:nr,colorDisabled:dn,textColorDisabled:Wn,placeholderColorDisabled:F,colorActive:G,boxShadowFocus:se,boxShadowActive:fe,boxShadowHover:me,border:_e,borderFocus:ke,borderHover:Se,borderActive:Qe,arrowColor:Bn,arrowColorDisabled:$a,loadingColor:Ra,colorActiveWarning:Ea,boxShadowFocusWarning:Pa,boxShadowActiveWarning:Fa,boxShadowHoverWarning:Va,borderWarning:Ma,borderFocusWarning:Aa,borderHoverWarning:Ia,borderActiveWarning:Oa,colorActiveError:za,boxShadowFocusError:Da,boxShadowActiveError:La,boxShadowHoverError:Ha,borderError:Wa,borderFocusError:ja,borderHoverError:qa,borderActiveError:XB,clearColor:YB,clearColorHover:UB,clearColorPressed:KB,clearSize:GB,arrowSize:ZB,[et("height",J)]:QB,[et("fontSize",J)]:JB}}=y.value,Do=rn(ii),Lo=rn($i);return{"--n-bezier":le,"--n-border":_e,"--n-border-active":Qe,"--n-border-focus":ke,"--n-border-hover":Se,"--n-border-radius":ni,"--n-box-shadow-active":fe,"--n-box-shadow-focus":se,"--n-box-shadow-hover":me,"--n-caret-color":nr,"--n-color":rt,"--n-color-active":G,"--n-color-disabled":dn,"--n-font-size":JB,"--n-height":QB,"--n-padding-single-top":Do.top,"--n-padding-multiple-top":Lo.top,"--n-padding-single-right":Do.right,"--n-padding-multiple-right":Lo.right,"--n-padding-single-left":Do.left,"--n-padding-multiple-left":Lo.left,"--n-padding-single-bottom":Do.bottom,"--n-padding-multiple-bottom":Lo.bottom,"--n-placeholder-color":qt,"--n-placeholder-color-disabled":F,"--n-text-color":tr,"--n-text-color-disabled":Wn,"--n-arrow-color":Bn,"--n-arrow-color-disabled":$a,"--n-loading-color":Ra,"--n-color-active-warning":Ea,"--n-box-shadow-focus-warning":Pa,"--n-box-shadow-active-warning":Fa,"--n-box-shadow-hover-warning":Va,"--n-border-warning":Ma,"--n-border-focus-warning":Aa,"--n-border-hover-warning":Ia,"--n-border-active-warning":Oa,"--n-color-active-error":za,"--n-box-shadow-focus-error":Da,"--n-box-shadow-active-error":La,"--n-box-shadow-hover-error":Ha,"--n-border-error":Wa,"--n-border-focus-error":ja,"--n-border-hover-error":qa,"--n-border-active-error":XB,"--n-clear-size":GB,"--n-clear-color":YB,"--n-clear-color-hover":UB,"--n-clear-color-pressed":KB,"--n-arrow-size":ZB,"--n-font-weight":De}}),Ve=cn?Ci("internal-selection",i.computed(()=>t.size[0]),en,t):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:C,label:x,selected:N,showTagsPanel:m,isComposing:z,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:g,handleMouseDown:L,handleFocusin:W,handleClear:Z,handleMouseEnter:te,handleMouseLeave:D,handleDeleteOption:H,handlePatternKeyDown:O,handlePatternInputInput:K,handlePatternInputBlur:ee,handlePatternInputFocus:Y,handleMouseEnterCounter:ln,handleMouseLeaveCounter:Bt,handleFocusout:I,handleCompositionEnd:q,handleCompositionStart:V,onPopoverUpdateShow:Hn,focus:ve,focusInput:Te,blur:ue,blurInput:We,updateCounter:ce,getCounter:pt,getTail:Ne,renderLabel:t.renderLabel,cssVars:cn?void 0:en,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:o,maxTagCount:s,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const f=s==="responsive",g=typeof s=="number",m=f||g,p=i.h(ya,null,{default:()=>i.h(wC,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=P=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:P.value},u?u({option:P,handleClose:()=>{this.handleDeleteOption(P)}}):i.h(va,{size:n,closable:!P.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(P)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(P,!0):er(P[y],P,!0)})),C=()=>(g?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),x=o?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,N=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(va,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let $;if(g){const P=this.selectedOptions.length-s;P>0&&($=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(va,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${P}`})))}const w=f?o?i.h(eh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:C,counter:N,tail:()=>x}):i.h(eh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:C,counter:N}):g&&$?C().concat($):C(),v=m?()=>i.h("div",{class:`${l}-base-selection-popover`},f?C():this.selectedOptions.map(_)):void 0,k=m?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,R=(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,E=o?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,f?null:x,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,p);b=i.h(i.Fragment,null,m?i.h(uC,Object.assign({},k,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>E,default:v}):E,R)}else if(o){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,C=this.active?!1:this.selected;b=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:yh(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})),C?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else b=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:yh(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):er(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function SC(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const BC={name:"Select",common:Si,peers:{InternalSelection:Lh,InternalSelectMenu:Fh},self:SC},TC=he([ye("select",`
814
814
  z-index: auto;
815
815
  outline: none;
816
816
  width: 100%;
@@ -819,4 +819,4 @@ ${o}
819
819
  `),ye("select-menu",`
820
820
  margin: 4px 0;
821
821
  box-shadow: var(--n-menu-box-shadow);
822
- `,[Oh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Io(t){return t.type==="group"}function Hh(t){return t.type==="ignored"}function Ca(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function $2(t,e){return{getIsGroup:Io,getIgnored:Hh,getKey(r){return Io(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function R2(t,e,n,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(Io(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Hh(l))continue;e(n,l)&&a.push(l)}return a}return o(t)}function E2(t,e,n){const r=new Map;return t.forEach(o=>{Io(o)?o[n].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var P2={};const F2=Object.assign(Object.assign({},kt.props),{to:Fn.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}),V2=i.defineComponent({name:"Select",props:F2,slots:Object,setup(t){P2.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:o}=vi(t),s=kt("Select","-select",N2,T2,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Qs(l,a),d=i.ref(!1),u=i.ref(""),h=gu(t,["items","options"]),f=i.ref([]),g=i.ref([]),m=i.computed(()=>g.value.concat(f.value).concat(h.value)),p=i.computed(()=>{const{filter:F}=t;if(F)return F;const{labelField:G,valueField:se}=t;return(fe,me)=>{if(!me)return!1;const _e=me[G];if(typeof _e=="string")return Ca(fe,_e);const ke=me[se];return typeof ke=="string"?Ca(fe,ke):typeof ke=="number"?Ca(fe,String(ke)):!1}}),b=i.computed(()=>{if(t.remote)return h.value;{const{value:F}=m,{value:G}=u;return!G.length||!t.filterable?F:R2(F,p.value,G,t.childrenField)}}),y=i.computed(()=>{const{valueField:F,childrenField:G}=t,se=$2(F,G);return sx(b.value,se)}),_=i.computed(()=>E2(m.value,t.valueField,t.childrenField)),C=i.ref(!1),x=Qs(i.toRef(t,"show"),C),N=i.ref(null),$=i.ref(null),w=i.ref(null),{localeRef:v}=vh("Select"),k=i.computed(()=>{var F;return(F=t.placeholder)!==null&&F!==void 0?F:v.value.placeholder}),B=[],R=i.ref(new Map),E=i.computed(()=>{const{fallbackOption:F}=t;if(F===void 0){const{labelField:G,valueField:se}=t;return fe=>({[G]:String(fe),[se]:fe})}return F===!1?!1:G=>Object.assign(F(G),{value:G})});function P(F){const G=t.remote,{value:se}=R,{value:fe}=_,{value:me}=E,_e=[];return F.forEach(ke=>{if(fe.has(ke))_e.push(fe.get(ke));else if(G&&se.has(ke))_e.push(se.get(ke));else if(me){const Se=me(ke);Se&&_e.push(Se)}}),_e}const W=i.computed(()=>{if(t.multiple){const{value:F}=c;return Array.isArray(F)?P(F):[]}return null}),I=i.computed(()=>{const{value:F}=c;return!t.multiple&&!Array.isArray(F)?F===null?null:P([F])[0]||null:null}),Z=zk(t),{mergedSizeRef:te,mergedDisabledRef:D,mergedStatusRef:L}=Z;function H(F,G){const{onChange:se,"onUpdate:value":fe,onUpdateValue:me}=t,{nTriggerFormChange:_e,nTriggerFormInput:ke}=Z;se&&xt(se,F,G),me&&xt(me,F,G),fe&&xt(fe,F,G),a.value=F,_e(),ke()}function z(F){const{onBlur:G}=t,{nTriggerFormBlur:se}=Z;G&&xt(G,F),se()}function O(){const{onClear:F}=t;F&&xt(F)}function U(F){const{onFocus:G,showOnFocus:se}=t,{nTriggerFormFocus:fe}=Z;G&&xt(G,F),fe(),se&&ee()}function K(F){const{onSearch:G}=t;G&&xt(G,F)}function V(F){const{onScroll:G}=t;G&&xt(G,F)}function q(){var F;const{remote:G,multiple:se}=t;if(G){const{value:fe}=R;if(se){const{valueField:me}=t;(F=W.value)===null||F===void 0||F.forEach(_e=>{fe.set(_e[me],_e)})}else{const me=I.value;me&&fe.set(me[t.valueField],me)}}}function Y(F){const{onUpdateShow:G,"onUpdate:show":se}=t;G&&xt(G,F),se&&xt(se,F),C.value=F}function ee(){D.value||(Y(!0),C.value=!0,t.filterable&&ii())}function ue(){Y(!1)}function ve(){u.value="",g.value=B}const Te=i.ref(!1);function We(){t.filterable&&(Te.value=!0)}function ce(){t.filterable&&(Te.value=!1,x.value||ve())}function pt(){D.value||(x.value?t.filterable?ii():ue():ee())}function Ne(F){var G,se;!((se=(G=w.value)===null||G===void 0?void 0:G.selfRef)===null||se===void 0)&&se.contains(F.relatedTarget)||(d.value=!1,z(F),ue())}function Vt(F){U(F),d.value=!0}function jt(){d.value=!0}function ln(F){var G;!((G=N.value)===null||G===void 0)&&G.$el.contains(F.relatedTarget)||(d.value=!1,z(F),ue())}function Bt(){var F;(F=N.value)===null||F===void 0||F.focus(),ue()}function Hn(F){var G;x.value&&(!((G=N.value)===null||G===void 0)&&G.$el.contains(wr(F))||ue())}function cn(F){if(!Array.isArray(F))return[];if(E.value)return Array.from(F);{const{remote:G}=t,{value:se}=_;if(G){const{value:fe}=R;return F.filter(me=>se.has(me)||fe.has(me))}else return F.filter(fe=>se.has(fe))}}function en(F){Ve(F.rawNode)}function Ve(F){if(D.value)return;const{tag:G,remote:se,clearFilterAfterSelect:fe,valueField:me}=t;if(G&&!se){const{value:_e}=g,ke=_e[0]||null;if(ke){const Se=f.value;Se.length?Se.push(ke):f.value=[ke],g.value=B}}if(se&&R.value.set(F[me],F),t.multiple){const _e=cn(c.value),ke=_e.findIndex(Se=>Se===F[me]);if(~ke){if(_e.splice(ke,1),G&&!se){const Se=J(F[me]);~Se&&(f.value.splice(Se,1),fe&&(u.value=""))}}else _e.push(F[me]),fe&&(u.value="");H(_e,P(_e))}else{if(G&&!se){const _e=J(F[me]);~_e?f.value=[f.value[_e]]:f.value=B}tr(),ue(),H(F[me],F)}}function J(F){return f.value.findIndex(se=>se[t.valueField]===F)}function le(F){x.value||ee();const{value:G}=F.target;u.value=G;const{tag:se,remote:fe}=t;if(K(G),se&&!fe){if(!G){g.value=B;return}const{onCreate:me}=t,_e=me?me(G):{[t.labelField]:G,[t.valueField]:G},{valueField:ke,labelField:Se}=t;h.value.some(Qe=>Qe[ke]===_e[ke]||Qe[Se]===_e[Se])||f.value.some(Qe=>Qe[ke]===_e[ke]||Qe[Se]===_e[Se])?g.value=B:g.value=[_e]}}function De(F){F.stopPropagation();const{multiple:G}=t;!G&&t.filterable&&ue(),O(),G?H([],[]):H(null,null)}function ni(F){!_r(F,"action")&&!_r(F,"empty")&&!_r(F,"header")&&F.preventDefault()}function it(F){V(F)}function qt(F){var G,se,fe,me,_e;if(!t.keyboard){F.preventDefault();return}switch(F.key){case" ":if(t.filterable)break;F.preventDefault();case"Enter":if(!(!((G=N.value)===null||G===void 0)&&G.isComposing)){if(x.value){const ke=(se=w.value)===null||se===void 0?void 0:se.getPendingTmNode();ke?en(ke):t.filterable||(ue(),tr())}else if(ee(),t.tag&&Te.value){const ke=g.value[0];if(ke){const Se=ke[t.valueField],{value:Qe}=c;t.multiple&&Array.isArray(Qe)&&Qe.includes(Se)||Ve(ke)}}}F.preventDefault();break;case"ArrowUp":if(F.preventDefault(),t.loading)return;x.value&&((fe=w.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(F.preventDefault(),t.loading)return;x.value?(me=w.value)===null||me===void 0||me.next():ee();break;case"Escape":x.value&&(Mk(F),ue()),(_e=N.value)===null||_e===void 0||_e.focus();break}}function tr(){var F;(F=N.value)===null||F===void 0||F.focus()}function ii(){var F;(F=N.value)===null||F===void 0||F.focusInput()}function $i(){var F;x.value&&((F=$.value)===null||F===void 0||F.syncPosition())}q(),i.watch(i.toRef(t,"options"),q);const nr={focus:()=>{var F;(F=N.value)===null||F===void 0||F.focus()},focusInput:()=>{var F;(F=N.value)===null||F===void 0||F.focusInput()},blur:()=>{var F;(F=N.value)===null||F===void 0||F.blur()},blurInput:()=>{var F;(F=N.value)===null||F===void 0||F.blurInput()}},dn=i.computed(()=>{const{self:{menuBoxShadow:F}}=s.value;return{"--n-menu-box-shadow":F}}),Wn=o?Ci("select",void 0,dn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:L,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:Co(),triggerRef:N,menuRef:w,pattern:u,uncontrolledShow:C,mergedShow:x,adjustedTo:Fn(t),uncontrolledValue:a,mergedValue:c,followerRef:$,localizedPlaceholder:k,selectedOption:I,selectedOptions:W,mergedSize:te,mergedDisabled:D,focused:d,activeWithoutMenuOpen:Te,inlineThemeDisabled:o,onTriggerInputFocus:We,onTriggerInputBlur:ce,handleTriggerOrMenuResize:$i,handleMenuFocus:jt,handleMenuBlur:ln,handleMenuTabOut:Bt,handleTriggerClick:pt,handleToggle:en,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:Ne,handleTriggerFocus:Vt,handleKeydown:qt,handleMenuAfterLeave:ve,handleMenuClickOutside:Hn,handleMenuScroll:it,handleMenuKeydown:qt,handleMenuMousedown:ni,mergedTheme:s,cssVars:o?void 0:dn,themeClass:Wn==null?void 0:Wn.themeClass,onRender:Wn==null?void 0:Wn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(_u,null,{default:()=>[i.h(wu,null,{default:()=>i.h(S2,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(Mu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Fn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(e2,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,o;return[(o=(r=this.$slots).empty)===null||o===void 0?void 0:o.call(r)]},header:()=>{var r,o;return[(o=(r=this.$slots).header)===null||o===void 0?void 0:o.call(r)]},action:()=>{var r,o;return[(o=(r=this.$slots).action)===null||o===void 0?void 0:o.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[vo,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[vo,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),M2={},Wh=i.defineComponent({...M2,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(C=>{if(M.isEmpty(C))return;const x=s.value?r.value:r.value?[r.value]:[],N=C.filter($=>!x.some(w=>w.id===$.id));l.value=r.optionsListConverter([...x,...N])}).finally(()=>{d.value=!1}))};let f="";const g=M.debounce(()=>h(f),800),m=_=>{f=_,g()},p=_=>{var C;if(M.isArray(_)){const x=_.length>0?_.map(N=>{var $;return i.toRaw(($=l.value.find(w=>w.value===N))==null?void 0:$.item)}):[];o("update:value",x)}else if(_>0){const x=i.toRaw((C=l.value.find(N=>N.value===_))==null?void 0:C.item);o("update:value",x)}else o("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,C)=>(i.openBlock(),i.createBlock(i.unref(V2),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:s.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:m,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),A2={},jh=i.defineComponent({...A2,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useTemplateRef("select-component"),a=async h=>r.searchType==="categories"?j.HttpRequester.getInstance(j.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?j.HttpRequester.getInstance(j.ProductDataProvider).publicSimpleSearch(h):new Promise(f=>{f([])}),l=h=>r.searchType==="categories"?Tt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?Tt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(h,f)=>{if(r.renderLabel)return r.renderLabel(h,f);if(r.searchType==="products"){const g=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=s.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=s.value)==null?void 0:h.blur()}}),(h,f)=>(i.openBlock(),i.createBlock(Wh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":f[0]||(f[0]=g=>o("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),I2={class:"col-span-2 flex flex-row gap-2.5"},O2={class:"flex-1"},z2={class:"text-sc-grey"},D2={class:"ml-2.5"},L2={key:0,class:"flex-none"},H2={},W2=i.defineComponent({...H2,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(null),s=()=>structuredClone(i.toRaw(n.value)),a=i.ref(s()),l=()=>{r("update:value",a.value.map(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(M.isArray(h)?h:[h]).filter(f=>!a.value.some(g=>g.id===f.id))],i.nextTick(()=>{o.value=null}),l())},d=h=>{h&&(a.value=a.value.map(f=>f.id===h.id?h:i.toRaw(f)),l())},u=h=>{a.value=a.value.filter(f=>f.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=s()}),(h,f)=>{const g=A.NListItem,m=bw,p=A.NButton,b=A.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(jh,{value:o.value,"onUpdate:value":[f[0]||(f[0]=y=>o.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...f[1]||(f[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(g,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(y)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",I2,[i.createElementVNode("span",O2,[i.createElementVNode("span",z2,i.toDisplayString(y.code),1),i.createElementVNode("span",D2,i.toDisplayString(y.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",L2,[i.renderSlot(h.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),j2={class:"flex flex-col"},q2={class:"flex flex-col gap-1.5 text-base text-nowrap"},X2={class:"font-medium"},Y2={class:"flex flex-col text-sc-dark-grey"},U2={key:0},K2={class:"font-medium"},G2={class:"font-medium"},Z2={class:"font-medium"},Q2={class:"font-medium"},J2={class:"font-medium"},eC={class:"font-medium"},tC={class:"font-medium"},nC={class:"font-medium"},iC={class:"font-medium"},rC={class:"font-medium"},oC={class:"flex flex-col gap-1.5 text-base text-nowrap"},sC={class:"font-medium"},aC={class:"flex flex-col text-sc-dark-grey"},lC={class:"font-medium"},cC={class:"font-medium"},dC={class:"flex flex-col gap-1.5 text-base text-nowrap"},uC={class:"font-medium"},hC={class:"text-sc-dark-grey"},fC={class:"font-medium"},mC={key:1,class:"text-base text-nowrap"},gC={class:"font-medium"},pC={},qh=i.defineComponent({...pC,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[j.ConfiguratorsEnum.Kozyrek,j.ConfiguratorsEnum.Mosquitto,j.ConfiguratorsEnum.Strip,j.ConfiguratorsEnum.MetalForDoors,j.ConfiguratorsEnum.Sandwich,j.ConfiguratorsEnum.SandwichM2],n=t,r=i.ref(!1),o=i.computed(()=>{var f,g;return((f=n.item.product.unit)==null?void 0:f.isLinear)&&((g=n.item.product.properties)==null?void 0:g.isLengthConfigurator)}),s=i.computed(()=>j.UnitsHelper.getProductLengthMultiplicity(n.item.product)),a=i.computed(()=>j.UnitsHelper.getProductMultiplicity(n.item.product)),l=i.computed(()=>a.value>1),c=i.ref({quantity:n.item.quantity});i.watch(()=>n.item,f=>{c.value={quantity:f.quantity}});const d=f=>{var g;f!==null&&(c.value.quantity=f,(g=n.eventEmitter)==null||g.emit("order-item:edit-quantity",{item:n.item,quantity:f,loaderRef:r}))},u=()=>{var f;(f=n.eventEmitter)==null||f.emit("order-item:open-configurator",{item:n.item})},h=()=>{var f;(f=n.eventEmitter)==null||f.emit("order-item:edit",{item:n.item})};return(f,g)=>{const m=A.NInputNumber;return i.openBlock(),i.createElementBlock("div",j2,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",q2,[i.createElementVNode("span",null,[g[1]||(g[1]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",X2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",Y2,[t.item.configurator===i.unref(j.ConfiguratorsEnum).Kozyrek?(i.openBlock(),i.createElementBlock("span",U2,[g[2]||(g[2]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",K2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Mosquitto?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("span",null,[g[3]||(g[3]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",G2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[g[4]||(g[4]=i.createTextVNode(" Высота: ",-1)),i.createElementVNode("span",Z2,i.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Strip?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.item.configuratorParams.linesWidths,(p,b)=>(i.openBlock(),i.createElementBlock("span",{key:b},[i.createTextVNode(" Полоса №"+i.toDisplayString(Number(b)+1)+": ",1),i.createElementVNode("span",Q2,i.toDisplayString(p)+" мм.",1)]))),128)),i.createElementVNode("span",null,[g[5]||(g[5]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",J2,i.toDisplayString(t.item.length)+" м.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).MetalForDoors?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("span",null,[g[6]||(g[6]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",eC,i.toDisplayString(t.item.width)+" мм.",1)]),i.createElementVNode("span",null,[g[7]||(g[7]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",tC,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Sandwich?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:4},i.renderList(t.item.configuratorParams.items??[],(p,b)=>(i.openBlock(),i.createElementBlock("span",{key:b},[i.createTextVNode(" Изделие №"+i.toDisplayString(Number(b)+1)+": ",1),i.createElementVNode("span",nC,i.toDisplayString(p.width)+"×"+i.toDisplayString(p.length)+" мм",1)]))),128)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).SandwichM2?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[i.createElementVNode("span",null,[g[8]||(g[8]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",iC,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[g[9]||(g[9]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",rC,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(u,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):o.value&&s.value>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("div",oC,[i.createElementVNode("span",null,[g[10]||(g[10]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",sC,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",aC,[i.createElementVNode("span",null,[g[11]||(g[11]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",lC,i.toDisplayString(s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)]),i.createElementVNode("span",null,[g[12]||(g[12]=i.createTextVNode(" Всего: ",-1)),i.createElementVNode("span",cC,i.toDisplayString(t.item.quantity*s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)])])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(h,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",dC,[i.createElementVNode("span",null,[g[13]||(g[13]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",uC,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("span",hC,[g[14]||(g[14]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",fC,i.toDisplayString(t.item.length??t.item.width)+" "+i.toDisplayString(t.item.product.unit.name),1)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(h,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[t.allowEdit?(i.openBlock(),i.createBlock(m,{key:0,value:c.value.quantity,parse:i.unref(rt),min:a.value,step:a.value,"show-button":l.value,"button-placement":"both",disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:g[0]||(g[0]=p=>i.unref(zr)(p,".",!1)),onFocus:i.unref(Le),"onUpdate:value":d},{suffix:i.withCtx(()=>[...g[15]||(g[15]=[i.createTextVNode(" шт. ",-1)])]),_:1},8,["value","parse","min","step","show-button","disabled","loading","onFocus"])):(i.openBlock(),i.createElementBlock("span",mC,[g[16]||(g[16]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",gC,i.toDisplayString(t.item.quantity)+" шт.",1)]))],64))])}}}),yC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function bC(t,e){return i.openBlock(),i.createElementBlock("svg",yC,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const _C=i.markRaw({name:"tabler-truck-filled",render:bC}),wC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xC(t,e){return i.openBlock(),i.createElementBlock("svg",wC,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const kC=i.markRaw({name:"tabler-truck-delivery",render:xC}),vC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function CC(t,e){return i.openBlock(),i.createElementBlock("svg",vC,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const SC=i.markRaw({name:"tabler-truck-loading",render:CC}),BC={class:"flex flex-col gap-1"},TC={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},NC={key:1,class:"text-base"},$C={class:"text-sc-dark-grey mr-1.5"},RC={key:0},EC={key:1},PC={},Oo=i.defineComponent({...PC,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var o;return(o=j.useReferencesStore().deliveryTypeReference)==null?void 0:o.find(s=>s.id===r.delivery.type)}),n=i.computed(()=>je.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(o,s)=>{var d,u,h,f,g,m,p,b;const a=SC,l=kC,c=_C;return i.openBlock(),i.createElementBlock("div",BC,[t.showType?(i.openBlock(),i.createElementBlock("span",TC,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=e.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",NC,[i.createElementVNode("span",$C,i.toDisplayString(n.value),1),(m=(g=t.delivery)==null?void 0:g.address)!=null&&m.address?(i.openBlock(),i.createElementBlock("span",RC,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",EC," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),FC={class:"flex flex-col gap-2.5"},VC={class:"text-base"},MC=["href"],AC={class:"text-sc-grey"},IC={},Xh=i.defineComponent({...IC,__name:"order-common-info",props:{order:{},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Pe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Pe.Status)?(c=(l=j.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),o=i.computed(()=>e.fields.includes(Pe.CreatedAt)),s=i.computed(()=>e.fields.includes(Pe.ClientInfo)||e.fields.includes(Pe.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Pe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",FC,[i.createElementVNode("span",VC,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,MC)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(yo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",AC,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),s.value?(i.openBlock(),i.createBlock(br,{key:0,client:s.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Oo,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),OC={},Sa=i.defineComponent({...OC,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=j.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((s=n.value)==null?void 0:s.name)??"-"),1)}}}),zC={class:"inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white bg-[#17a2b8]"},DC={},Ba=i.defineComponent({...DC,__name:"creator-user-type-tag",props:{userType:{},prefixText:{default:"Добавлено"}},setup(t){const e=(n,r)=>{const o={[j.UserTypeEnum.Manager]:"менеджером",[j.UserTypeEnum.Operator]:"оператором",[j.UserTypeEnum.Client]:"клиентом",[j.UserTypeEnum.Admin]:"администратором"};return`${r} ${o[n]}`};return(n,r)=>(i.openBlock(),i.createElementBlock("small",zC,i.toDisplayString(e(t.userType,t.prefixText)),1))}}),LC={class:"flex flex-row gap-1.5"},HC={class:"flex-none text-nowrap"},WC={class:"flex flex-1 flex-col"},jC={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},qC={key:0},XC={key:1},YC={},Yh=i.defineComponent({...YC,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>{const r=Ba;return i.openBlock(),i.createElementBlock("div",LC,[i.createElementVNode("span",HC,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",WC,[i.createVNode(dr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.creatorUser&&t.product.creatorUser.type?(i.openBlock(),i.createBlock(r,{key:0,"user-type":t.product.creatorUser.type,class:"mt-1 self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",jC,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",qC,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",XC,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),UC={},KC=i.defineComponent({...UC,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0}},setup(t){const e=()=>{const o=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(s,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:s=>i.h("span",{class:"text-base"},[s.product.code])},{title:"Наименование",key:"name",resizable:!0,width:"45%",render:s=>i.h("div",{},[i.h(dr,{product:s.product,showCode:!1,showPlanningDates:!1}),..."creatorUser"in s&&s.creatorUser&&s.creatorUser.type?[i.h(Ba,{class:"mt-1",userType:s.creatorUser.type,prefixText:"Добавлено"})]:[]])},{title:"Кол-во",key:"quantity",resizable:!1,width:215,render:s=>i.h(qh,{item:s})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:s=>i.h(jn,{product:s,costFieldName:"costOne",showQuantityUnit:!0})},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:s=>i.h(jn,{product:s,costFieldName:"cost",showQuantityUnit:!0})}];switch(ot.getDeviceTypeByResolution()){case Je.phone:case Je.tablet:return[{title:"",key:"items",resizable:!0,render:(s,a)=>i.h(Yh,{product:s,index:a})}];case Je.laptop:return o;default:return o}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(o,s)=>{const a=A.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[s[0]||(s[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Uh=Nn(KC,[["__scopeId","data-v-80c3e01a"]]),GC={class:"text-base"},ZC={},Ta=i.defineComponent({...ZC,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",GC,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))}}),QC={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},JC={class:"col-span-2"},eS={class:"col-span-2"},tS=["href"],nS={},Kh=i.defineComponent({...nS,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,o)=>(i.openBlock(),i.createElementBlock("div",null,[o[12]||(o[12]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",QC,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[o[1]||(o[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Ta,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),o[11]||(o[11]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(br,{client:t.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=s=>n("click:client-name",t.order.client,s))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o[2]||(o[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(qd,{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},[o[3]||(o[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=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},[o[5]||(o[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",JC,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[o[6]||(o[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Sa,{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},[o[7]||(o[7]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Oo,{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},[o[8]||(o[8]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",eS,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[o[9]||(o[9]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Ta,{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},[o[10]||(o[10]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(s,a)=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"col-span-2"},[i.createElementVNode("a",{class:"btn btn-primary",href:s}," Скачать счет №"+i.toDisplayString(a+1),9,tS)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),iS={key:0},rS={class:"text-sc-dark-grey my-2 text-center"},oS={key:1,class:"text-sc-dark-grey my-2 text-center"},sS={key:2},aS={class:"text-sc-dark-grey mt-4 text-right font-bold"},lS={class:"text-sc-primary"},cS={},Gh=i.defineComponent({...cS,__name:"order-info",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(new j.Order(n.order)),a=(c=!0)=>{c&&(o.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrder(n.order.id).then(d=>{s.value=d}).finally(()=>{c&&(o.value=!1)})},l=i.computed(()=>(s.value.products??[]).reduce((c,d)=>c+d.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(c,d)=>{const u=A.NSpin;return o.value?(i.openBlock(),i.createElementBlock("div",iS,[i.createElementVNode("div",rS,[i.createVNode(u,{size:"small",class:"mb-2.5 align-middle"}),d[1]||(d[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):s.value.products.length===0?(i.openBlock(),i.createElementBlock("div",oS," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",sS,[i.createVNode(Uh,{products:s.value.products},null,8,["products"]),i.createElementVNode("div",aS,[d[2]||(d[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",lS,i.toDisplayString(l.value)+" ₽",1)]),i.createVNode(Kh,{order:s.value,"onClick:clientName":d[0]||(d[0]=h=>r("click:client-name",s.value.client,h))},null,8,["order"])]))}}}),dS={},uS=i.defineComponent({...dS,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(lr,"small"),r=i.computed(()=>M.isNil(e.orderContextButtonsConfig)?[]:M.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),o=s=>{var a;(a=e.onOrderContextSelect)==null||a.call(e,e.order,s)};return(s,a)=>{var u;const l=jo,c=A.NButton,d=A.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:o},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),hS={},fS=i.defineComponent({...hS,__name:"orders-list",props:{fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0}},emits:["click:client-name","dblclick:row","update:pagination","update:sort"],setup(t,{emit:e}){const n=t,r=e,o=()=>M.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),s=i.ref(o()),a=i.ref([]),l=i.ref(!1),c=i.computed(()=>j.useReferencesStore().orderStatusReference),d=i.ref(700),u=B=>{var W,I;const R={onDblclick:()=>r("dblclick:row",B)};if(!n.useCellIndication)return R;const E=[];B.isOnOrder&&E.push("on-order"),B.isLargeOrder&&E.push("large-order"),B.isNotInStock&&E.push("not-in-stock");const P=(I=(W=c.value)==null?void 0:W.find(Z=>Z.id===(B.status??-1)))==null?void 0:I.slug;return P&&E.push("order-status",P),B.delivery.date&&je.isTomorrow(new Date(B.delivery.date))&&E.push("next-day-order"),E.length>0&&(R.class=E.join(" ")),R},h=()=>{const B=[Pe.CreatedAt,Pe.Id,Pe.ClientInfo,Pe.ClientCity,Pe.DeliveryDate,Pe.PaymentType,Pe.SalesDirections,Pe.Status,...n.showAttachedUserColumn?[Pe.AttachedUser]:[],Pe.actions],R=n.fields.length>0?n.fields:B,E={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},P={type:"expand",expandable:M.constant(!0),renderExpand:I=>i.h(Gh,{order:I,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",I.client,null)}}),width:"30"};let W=[{title:"Дата заказа",key:Pe.CreatedAt,resizable:!0,width:100,render:I=>i.h(yo,{date:I.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Pe.Id,resizable:!0,width:75,className:"order-id",render:I=>i.h("a",{href:n.orderUrl.replace(":id",I.id.toString()),class:"text-base"},I.id)},{title:"Дата доставки / самовывоза",key:Pe.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:I=>i.h(yo,{date:I.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Pe.ClientInfo,resizable:!0,minWidth:320,render:I=>i.h(br,{client:I.client,"onClick:client-name":()=>{r("click:client-name",I.client,null)}})},{title:"Тип доставки",key:Pe.DeliveryInfo,resizable:!0,minWidth:320,render:I=>i.h(Oo,{delivery:I.delivery})},{title:"Клиент",key:Pe.ClientInfoShort,resizable:!0,minWidth:320,render:I=>i.h(br,{client:I.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",I.client,null)}})},{title:"Город клиента",key:Pe.ClientCity,resizable:!0,minWidth:90,width:120,render:I=>{var Z;return i.h("span",{class:"text-base"},((Z=I.client)==null?void 0:Z.city.name)??"—")}},{title:"Статус",key:Pe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:I=>{var Z,te;return i.h("span",{class:"text-base"},[((te=(Z=c.value)==null?void 0:Z.find(D=>D.id===(I.status??-1)))==null?void 0:te.name)??""])}},{title:"Тип оплаты",key:Pe.PaymentType,resizable:!0,width:115,minWidth:95,render:I=>I.payment?i.h(Sa,{payment:I.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Pe.SalesDirections,resizable:!0,width:70,render:I=>{var Z;return i.h("span",{class:"text-base"},[((Z=I.salesDirection)==null?void 0:Z.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Pe.AttachedUser,resizable:!0,minWidth:120,render:I=>{var Z;return i.h("span",{class:"text-base"},[((Z=I==null?void 0:I.attachedUser)==null?void 0:Z.name)??""])}}]:[]];switch(n.orderContextButtonsConfig&&W.push({key:"actions",title:"",className:"align-top",width:50,render:I=>i.h(uS,{order:I,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(W=W.map(I=>[Pe.Id,Pe.CreatedAt,Pe.DeliveryDate].includes(I.key)?{...I,sorter:!0,sortOrder:!1,...I.width===void 0?{}:{width:I.width+16}}:I)),ot.getDeviceTypeByResolution()){case Je.phone:case Je.tablet:return[P,{key:"order",title:"Заказ",resizable:!0,render:I=>i.h(Xh,{order:I,fields:R,orderUrl:n.orderUrl})}];case Je.laptop:{const I=n.showAttachedUserColumn?R:R.filter(Z=>Z!==Pe.AttachedUser);return[P,...I.map(Z=>W.find(te=>te.key===Z)??E)]}default:return[E]}},f=i.ref(h()),g=i.ref(new j.TableDataPagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),m=i.computed(()=>({...g.value,prefix({itemCount:B}){return`Всего заказов: ${B}`}})),p=i.ref(null),b=i.ref(null),y=i.ref(null),_=()=>{y.value!==null&&(clearInterval(y.value),y.value=null)},C=()=>{_(),n.refreshInterval&&(y.value=setInterval(()=>{N()},n.refreshInterval))},x=()=>{var B,R;n.filters&&((B=b.value)==null||B.abort(),b.value=null,(R=p.value)==null||R.abort(),p.value=new AbortController,l.value=!0,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,s.value,{page:g.value.page,pageSize:g.value.pageSize},p.value.signal).then(E=>{g.value.itemCount!==E.meta.total&&(g.value.itemCount=E.meta.total),g.value.page!==E.meta.currentPage&&(g.value.page=E.meta.currentPage),g.value.pageCount!==E.meta.lastPage&&(g.value.pageCount=E.meta.lastPage),g.value.pageSize!==E.meta.perPage&&(g.value.pageSize=E.meta.perPage),a.value=E.data,l.value=!1}).catch(E=>{if((E==null?void 0:E.name)!=="CanceledError")throw l.value=!1,E}))},N=()=>{var B;!n.filters||l.value||((B=b.value)==null||B.abort(),b.value=new AbortController,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,s.value,{page:g.value.page,pageSize:g.value.pageSize},b.value.signal).then(R=>{a.value=a.value.map(E=>R.data.find(W=>W.id===E.id)??E),g.value.itemCount!==R.meta.total&&(g.value.itemCount=R.meta.total),g.value.pageCount!==R.meta.lastPage&&(g.value.pageCount=R.meta.lastPage)}).catch(R=>{if((R==null?void 0:R.name)!=="CanceledError")throw R}))},$=B=>{g.value.page=B,x(),r("update:pagination",g.value)},w=B=>{g.value.pageSize=B,g.value.page=1,x(),r("update:pagination",g.value)},v=B=>{if(M.isNull(B))s.value=o();else{const[R]=s.value;R.field=B.columnKey.toString(),R.direction=B.order==="ascend"?"asc":"desc",s.value=[R]}f.value.forEach(R=>{if(Object.hasOwn(R,"sortOrder")){const E=R;E.sortOrder=E.key===(B==null?void 0:B.columnKey)&&(B!=null&&B.sorter)&&B.order!==!1?B.order:!1}}),x(),r("update:sort",s.value)},k=()=>{f.value=h(),d.value=window.innerHeight};return i.watch(()=>n.filters,()=>{g.value.page=1,x(),C()}),i.watch(()=>n.sort,()=>{s.value=o(),g.value.page=1,x(),C()}),i.onMounted(()=>{k(),window.addEventListener("resize",k),i.nextTick(()=>{x(),C()})}),i.onUnmounted(()=>{var B,R;window.removeEventListener("resize",k),(B=p.value)==null||B.abort(),(R=b.value)==null||R.abort(),_()}),(B,R)=>{const E=A.NDataTable;return i.openBlock(),i.createBlock(E,{columns:f.value,data:a.value,"row-key":P=>P.id,"row-props":u,"scroll-x":t.tableMinWidth,pagination:m.value,loading:l.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":d.value*(i.unref(j.useBaseConfigStateStore)().config.tableDefaultHeightCoefficient??.6),"pagination-behavior-on-filter":"first","onUpdate:page":$,"onUpdate:pageSize":w,"onUpdate:sorter":v},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),mS=Nn(fS,[["__scopeId","data-v-25174a4c"]]),gS=["href"],pS={class:"text-sc-dark-grey"},yS={},bS=i.defineComponent({...yS,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>je.format(n.order.createdAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{M.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},i.toDisplayString(t.order.id),9,gS),i.createTextVNode(" от "+i.toDisplayString(o.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",pS,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),_S={class:"sc-page flex flex-col bg-inherit"},wS={class:"my-2 flex flex-row items-end"},xS={class:"sc-title grow"},kS={key:0,class:"sc-title-buttons flex-1 grow-0"},vS={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},CS={key:0,class:"sc-title-extra mt-2 sm:mt-4"},SS={},Zh=i.defineComponent({...SS,__name:"page",props:{title:{},stickyHeader:{type:Boolean},stickyTopOffset:{}},setup(t){return(e,n)=>{const r=A.NH1;return i.openBlock(),i.createElementBlock("div",_S,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?"sticky z-10 bg-inherit":void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",wS,[i.createElementVNode("div",xS,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",kS,[i.createElementVNode("div",vS,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",CS,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"sticky-extra")],6),i.renderSlot(e.$slots,"default")])}}}),BS={class:"overflow-hidden transition-all duration-300"},TS={class:"text-lg font-medium leading-none"},NS={},Qh=i.defineComponent({...NS,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(0),s=i.ref(n.showDrawer),a=()=>{switch(ot.getDeviceTypeByResolution()){case Je.phone:return window.innerWidth*.8;case Je.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?M.isUndefined(n.drawerWidth)?o.value=a():o.value=M.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:o.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),i.watch(()=>n.showDrawer,c=>{s.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=A.NDrawerContent,h=A.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",BS,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:s.value,"onUpdate:show":d[0]||(d[0]=f=>s.value=f),resizable:!0,width:o.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",TS,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),$S={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},RS={key:0},ES={class:"sc-page-preview-panel grow"},PS={key:1,class:"sc-page-preview-panel-extra flex-none"},FS={},VS=i.defineComponent({...FS,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},o=()=>{n.value=!1},s=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,u;window.scrollTo({top:(((u=(d=s.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:o}),(l,c)=>{const d=A.NButton;return i.openBlock(),i.createBlock(Zh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset},i.createSlots({default:i.withCtx(()=>[i.createVNode(Qh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",$S,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",RS,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",ES,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",PS,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset"])}}}),MS={},AS=i.defineComponent({...MS,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var m;return M.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>{const m=new j.Curator({id:-1,name:"",contacts:{},curatedDirection:new j.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[m]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{p.push(new j.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Tt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,m=>{const p=M.some(s.value?r.value:[r.value],["id",m.id])?` (${m.curatedDirection.name}) `:"";return m.curatedDirection.isNewRec()?m.name:`${m.name}${p}`})),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(M.isArray(m)){const p=m.length>0?m.map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];o("update:value",p)}else{const p=m>0?l.value.find(b=>b.id===m):null;o("update:value",p??null)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),IS={},OS=i.defineComponent({...IS,__name:"manager-operator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},operatorReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var m;return M.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=i.computed(()=>{var y;const m=[];r.operatorReferenceList.length>0&&m.push({type:"group",label:"Операторы",key:"operators",children:r.operatorReferenceList.map(_=>({label:_.name,value:_.id,item:_}))});let p=r.managerReferenceList;if(r.showActualOnly){const _=M.isArray(r.value)?r.value.map(C=>C.id):[(y=r.value)==null?void 0:y.id];p=p.filter(C=>C.isActive||_.includes(C.id))}const b=Tt.convertReferencesToSelectOptionsList(p,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,_=>`${_.name}${_.isActive?"":" [Не активен]"}`);return m.length>0&&b.length>0&&m.push({key:"manager-operator-divider",disabled:!0,render:()=>i.h("div",{class:"sc-manager-operator-select__divider"})}),m.push(...b),m}),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class??""} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(M.isArray(m)){const p=m.map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b));o("update:value",p)}else{const p=M.isNil(m)?null:l.value.find(b=>b.id===m)??null;o("update:value",p)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:d.value,placeholder:"",class:"w-full","onUpdate:value":h},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),zS={},DS=i.defineComponent({...zS,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var m;return M.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>r.showEmptyValue?[j.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var b;let m=l.value,p=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=M.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];p=M.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),m=m.filter(_=>(r.showEmptyValue?j.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return Tt.convertReferencesToSelectOptionsList(m,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&M.some(s.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>p.includes(y.id)&&y.isActive)}),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(M.isArray(m)){const p=m.length>0?m.filter(b=>!M.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];o("update:value",p)}else{const p=m>0&&!M.some(r.disabledManagerReferenceList,["id",m])?l.value.find(b=>b.id===m):new j.Manager;o("update:value",p??new j.Manager)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,m=>{if(m.length>0&&r.value)if(s.value){const p=r.value;M.some(p,b=>M.some(m,["id",b.id]))&&o("update:value",p.filter(b=>!M.some(m,["id",b.id])))}else{const p=r.value;M.some(m,["id",p.id])&&o("update:value",new j.Manager)}}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),LS={class:"m-0.5 flex flex-col p-0.5"},HS={class:"flex flex-row gap-1"},WS={key:0},jS={key:1},qS={key:2},XS={key:3},YS={class:"flex flex-row gap-1"},US={key:0},KS={key:1},GS={key:2},ZS={key:3},QS={},Jh=i.defineComponent({...QS,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",LS,[i.createElementVNode("span",HS,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",WS,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",jS,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",qS,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",XS,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",YS,[t.addr.street?(i.openBlock(),i.createElementBlock("span",US,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",KS,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",GS,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",ZS,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Na={clearable:!1,value:"",field:void 0,disabled:!1},JS={},eB=i.defineComponent({...JS,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Na,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=M.debounce(()=>u(),800),u=async()=>{!s.value||s.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(s.value,a):j.HttpRequester.getInstance(j.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Jh,{addr:y,selected:b},{default:M.constant("-")})},f=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};o("select",b)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(p,b)=>{const y=A.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),tB={class:"m-0.5 flex flex-col p-0.5"},nB={class:"font-medium"},iB={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},rB={key:0},oB={key:1},sB={},ef=i.defineComponent({...sB,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",tB,[i.createElementVNode("span",nB,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",iB,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",rB," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",oB," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),aB={},lB=i.defineComponent({...aB,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Na,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=M.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await j.HttpRequester.getInstance(j.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(ef,{bank:y,selected:b},{default:M.constant("-")})},f=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};o("select",b)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(p,b)=>{const y=A.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),cB={class:"font-medium"},dB={key:0,class:"flex flex-row gap-2"},uB={key:0,class:"text-xs font-light text-blue-800"},hB={key:1,class:"text-sc-dark-grey text-xs font-light"},fB={},tf=i.defineComponent({...fB,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",cB,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",dB,[t.org.inn?(i.openBlock(),i.createElementBlock("span",uB,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",hB,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),mB={},gB=i.defineComponent({...mB,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Na,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Tt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{s.value=b}),i.watch(s,()=>{o("update:value",s.value)});const u=M.debounce(()=>h(),800),h=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await j.HttpRequester.getInstance(j.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},f=(b,y)=>{const _=l.value.find(C=>C.id===b.value)||{};return i.h(tf,{org:_,selected:y},{default:M.constant("-")})},g=b=>{u.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&o("select",y)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(b,y)=>{const _=A.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[y[0]||(y[0]=C=>s.value=C),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),pB={},yB=i.defineComponent({...pB,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},a=()=>{n.disableConfirm?s():o.value=!0};return(l,c)=>{const d=A.NButton,u=A.NPopover,h=A.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(h,{show:o.value,"onUpdate:show":c[1]||(c[1]=f=>o.value=f),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=f=>o.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),bB={key:0,class:"whitespace-pre-line"},_B={key:1,class:"text-sc-dark-grey"},wB={},xB=i.defineComponent({...wB,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.comment);i.watch(()=>o.value,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=n.comment};return(l,c)=>{const d=A.NInput;return i.openBlock(),i.createBlock(tu,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",bB,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",_B," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:o.value,"onUpdate:value":c[0]||(c[0]=u=>o.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),kB={},vB=i.defineComponent({...kB,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),CB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function SB(t,e){return i.openBlock(),i.createElementBlock("svg",CB,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const BB=i.markRaw({name:"ion-warning",render:SB}),TB={},NB=i.defineComponent({...TB,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=BB,o=A.NPopover;return i.openBlock(),i.createBlock(o,{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"])}}}),$B=i.computed(()=>j.useReferencesStore().deliveryTypeReference??[]),RB=i.computed(()=>j.useReferencesStore().managersList??[]),EB=i.computed(()=>j.useReferencesStore().opfReference??[]),PB=i.computed(()=>j.useReferencesStore().partnerGroupsReference??[]),FB=i.computed(()=>j.useReferencesStore().priceCoefficientsReference??[]),VB=i.computed(()=>j.useReferencesStore().productFilesTypesReference??[]),MB=i.computed(()=>j.useReferencesStore().resourceTypesReference),AB=i.computed(()=>j.useReferencesStore().salesDirectionsReference??[]),IB=i.computed(()=>j.useReferencesStore().warehousesReference??[]),OB=i.computed(()=>j.useReferencesStore().paymentTypeReference??[]),zB=i.computed(()=>j.useReferencesStore().orderStatusReference??[]),DB=i.computed(()=>j.useReferencesStore().operatorReference??[]),LB=i.computed(()=>Tt.convertReferencesToSelectOptionsList(j.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),HB=i.computed(()=>Tt.convertReferencesToSelectOptionsList(j.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),WB=t=>j.HttpRequester.getInstance(j.ReferenceDataProvider).searchCity(t),jB=t=>Tt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(o=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:o.name}`},e=>e==null?void 0:e.isNewRec()),qB=t=>j.HttpRequester.getInstance(j.ClientDataProvider).searchClient(t),XB=t=>Tt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>e.isNewRec()?"-":[e.name,e.salesDirection.name?`(${e.salesDirection.name})`:void 0,e.city.name?`г. ${e.city.name}${e.city.region.name?`, ${e.city.region.name}`:""}`:void 0,e.isActive?void 0:"[ Деактивирован ]"].filter(Boolean).join(" "),e=>e==null?void 0:e.isNewRec());X.AddProductToCartDialog=Db,X.ConfiguratorSettingsKozyrek=kd,X.ConfiguratorSettingsMosquito=Y_,X.ContentHelper=ai,X.FileHelper=hf,X.KozyrekLine=_n,X.KozyrekTailTemplate=Ls,X.KozyrekTemplate=Ui,X.NumericValidators=ae,X.OrdersTableFields=Pe,X.Point=Ds,X.ScAddressSuggestion=eB,X.ScAddressSuggestionLabel=Jh,X.ScBankSuggestion=lB,X.ScBankSuggestionLabel=ef,X.ScBaseDialog=jd,X.ScButtonWithConfirmAction=yB,X.ScCategoryCollapse=Hd,X.ScClientNameWithShortInfo=br,X.ScCollapse=Ld,X.ScCollapseItem=el,X.ScCommentEditor=xB,X.ScConfiguratorsProductInfo=ur,X.ScContragentWithShortInfo=qd,X.ScCreatorUserTypeTag=Ba,X.ScCuratorSelect=AS,X.ScDateRange=R1,X.ScDateTimeLabel=yo,X.ScDebouncedInput=iw,X.ScDebouncedInputNumber=ow,X.ScDebt=vB,X.ScDialogHeader=O1,X.ScDynamicConfigurator=Od,X.ScEmail=n_,X.ScExternalLink=gw,X.ScImageGallery=ol,X.ScInlineEditableItem=tu,X.ScInlineView=Ws,X.ScKozyrekConfigurator=vd,X.ScKozyrekConfiguratorParamsForm=al,X.ScKozyrekConfiguratorPreview=xd,X.ScKozyrekConfiguratorTemplates=wd,X.ScLightGallery=rl,X.ScManagerOperatorSelect=OS,X.ScManagerSelect=DS,X.ScMetalForDoorsConfigurator=Pd,X.ScMetalForDoorsConfiguratorForm=Ed,X.ScMosquitoConfigurator=Bd,X.ScMosquitoConfiguratorForm=Cd,X.ScMosquitoConfiguratorMeasurementInstructions=Sd,X.ScMosquitoConfiguratorPreview=Hs,X.ScOrderCommonInfo=Xh,X.ScOrderDeliveryLabel=Oo,X.ScOrderDetails=Kh,X.ScOrderInfo=Gh,X.ScOrderItemParams=qh,X.ScOrderItemsList=Uh,X.ScOrderPayment=Sa,X.ScOrderProductInfo=Yh,X.ScOrdersList=mS,X.ScOrgSuggestion=gB,X.ScOrgSuggestionLabel=tf,X.ScPage=Zh,X.ScPageWithSlidingPanel=VS,X.ScPersonContactsBlock=X_,X.ScPhone=B_,X.ScPhoneInput=lw,X.ScProductName=dr,X.ScProductsList=W2,X.ScReferenceSelect=Wd,X.ScSandwichConfigurator=Md,X.ScSandwichConfiguratorForm=Vd,X.ScSandwichM2Configurator=Id,X.ScSandwichM2ConfiguratorForm=Ad,X.ScSearchableProductSelect=jh,X.ScSearchableReferenceSelect=Wh,X.ScSetClientPriceFormItem=Vb,X.ScShortTextOrderInfo=bS,X.ScSingleFileUploadSelector=W1,X.ScSlidingContentWithDrawer=Qh,X.ScStripConfigurator=Rd,X.ScStripConfiguratorForm=Nd,X.ScStripConfiguratorLineItem=Td,X.ScStripConfiguratorPreview=$d,X.ScUserShortInfo=Ta,X.ScWarningIcon=NB,X.SelectOptionHelper=Tt,X.UiNotificationProvider=sr,X.Validators=He,X.WindowResolutionEnum=Je,X.WindowResolutionProvider=ot,X.channelPrimaryInterestOptionsList=LB,X.componentSizeInjectionKey=lr,X.copyToClipboard=Ua,X.deliveryTypeReferenceList=$B,X.handleFloatInput=zr,X.handleIntegerInput=nt,X.isCanSandwichM2Show=U_,X.isCanSandwichShow=Dd,X.isConfiguratorType=zd,X.managersReferenceList=RB,X.naiveUiTheme=Qf,X.operatorReferenceList=DB,X.opfReferenceList=EB,X.orderStatusReferenceList=zB,X.parse=rt,X.partnerGroupReferenceList=PB,X.paymentTypeReferenceList=OB,X.priceCoefficientsReferenceList=FB,X.productFilesTypesReferenceList=VB,X.renderConfig=qe,X.resetInputValidation=tt,X.resourceReferencesList=MB,X.salesDirectionsReferenceList=AB,X.searchCityReferenceDataHandler=WB,X.searchCityReferenceLabelRenderer=jB,X.searchClientReferenceDataHandler=qB,X.searchClientReferenceLabelRenderer=XB,X.selectAllTextOnFocus=Le,X.sourcePrimaryInterestOptionsList=HB,X.vCopy=uf,X.vFocusNext=Ga,X.warehousesReferenceList=IB,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
822
+ `,[Oh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Io(t){return t.type==="group"}function Hh(t){return t.type==="ignored"}function Ca(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function NC(t,e){return{getIsGroup:Io,getIgnored:Hh,getKey(r){return Io(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function $C(t,e,n,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(Io(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Hh(l))continue;e(n,l)&&a.push(l)}return a}return o(t)}function RC(t,e,n){const r=new Map;return t.forEach(o=>{Io(o)?o[n].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var EC={};const PC=Object.assign(Object.assign({},kt.props),{to:Fn.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}),FC=i.defineComponent({name:"Select",props:PC,slots:Object,setup(t){EC.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ei("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ei("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:o}=vi(t),s=kt("Select","-select",TC,BC,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Qs(l,a),d=i.ref(!1),u=i.ref(""),h=gu(t,["items","options"]),f=i.ref([]),g=i.ref([]),m=i.computed(()=>g.value.concat(f.value).concat(h.value)),p=i.computed(()=>{const{filter:F}=t;if(F)return F;const{labelField:G,valueField:se}=t;return(fe,me)=>{if(!me)return!1;const _e=me[G];if(typeof _e=="string")return Ca(fe,_e);const ke=me[se];return typeof ke=="string"?Ca(fe,ke):typeof ke=="number"?Ca(fe,String(ke)):!1}}),b=i.computed(()=>{if(t.remote)return h.value;{const{value:F}=m,{value:G}=u;return!G.length||!t.filterable?F:$C(F,p.value,G,t.childrenField)}}),y=i.computed(()=>{const{valueField:F,childrenField:G}=t,se=NC(F,G);return ox(b.value,se)}),_=i.computed(()=>RC(m.value,t.valueField,t.childrenField)),C=i.ref(!1),x=Qs(i.toRef(t,"show"),C),N=i.ref(null),$=i.ref(null),w=i.ref(null),{localeRef:v}=vh("Select"),k=i.computed(()=>{var F;return(F=t.placeholder)!==null&&F!==void 0?F:v.value.placeholder}),B=[],R=i.ref(new Map),E=i.computed(()=>{const{fallbackOption:F}=t;if(F===void 0){const{labelField:G,valueField:se}=t;return fe=>({[G]:String(fe),[se]:fe})}return F===!1?!1:G=>Object.assign(F(G),{value:G})});function P(F){const G=t.remote,{value:se}=R,{value:fe}=_,{value:me}=E,_e=[];return F.forEach(ke=>{if(fe.has(ke))_e.push(fe.get(ke));else if(G&&se.has(ke))_e.push(se.get(ke));else if(me){const Se=me(ke);Se&&_e.push(Se)}}),_e}const W=i.computed(()=>{if(t.multiple){const{value:F}=c;return Array.isArray(F)?P(F):[]}return null}),I=i.computed(()=>{const{value:F}=c;return!t.multiple&&!Array.isArray(F)?F===null?null:P([F])[0]||null:null}),Z=Ok(t),{mergedSizeRef:te,mergedDisabledRef:D,mergedStatusRef:L}=Z;function H(F,G){const{onChange:se,"onUpdate:value":fe,onUpdateValue:me}=t,{nTriggerFormChange:_e,nTriggerFormInput:ke}=Z;se&&xt(se,F,G),me&&xt(me,F,G),fe&&xt(fe,F,G),a.value=F,_e(),ke()}function z(F){const{onBlur:G}=t,{nTriggerFormBlur:se}=Z;G&&xt(G,F),se()}function O(){const{onClear:F}=t;F&&xt(F)}function U(F){const{onFocus:G,showOnFocus:se}=t,{nTriggerFormFocus:fe}=Z;G&&xt(G,F),fe(),se&&ee()}function K(F){const{onSearch:G}=t;G&&xt(G,F)}function V(F){const{onScroll:G}=t;G&&xt(G,F)}function q(){var F;const{remote:G,multiple:se}=t;if(G){const{value:fe}=R;if(se){const{valueField:me}=t;(F=W.value)===null||F===void 0||F.forEach(_e=>{fe.set(_e[me],_e)})}else{const me=I.value;me&&fe.set(me[t.valueField],me)}}}function Y(F){const{onUpdateShow:G,"onUpdate:show":se}=t;G&&xt(G,F),se&&xt(se,F),C.value=F}function ee(){D.value||(Y(!0),C.value=!0,t.filterable&&ii())}function ue(){Y(!1)}function ve(){u.value="",g.value=B}const Te=i.ref(!1);function We(){t.filterable&&(Te.value=!0)}function ce(){t.filterable&&(Te.value=!1,x.value||ve())}function pt(){D.value||(x.value?t.filterable?ii():ue():ee())}function Ne(F){var G,se;!((se=(G=w.value)===null||G===void 0?void 0:G.selfRef)===null||se===void 0)&&se.contains(F.relatedTarget)||(d.value=!1,z(F),ue())}function Vt(F){U(F),d.value=!0}function jt(){d.value=!0}function ln(F){var G;!((G=N.value)===null||G===void 0)&&G.$el.contains(F.relatedTarget)||(d.value=!1,z(F),ue())}function Bt(){var F;(F=N.value)===null||F===void 0||F.focus(),ue()}function Hn(F){var G;x.value&&(!((G=N.value)===null||G===void 0)&&G.$el.contains(wr(F))||ue())}function cn(F){if(!Array.isArray(F))return[];if(E.value)return Array.from(F);{const{remote:G}=t,{value:se}=_;if(G){const{value:fe}=R;return F.filter(me=>se.has(me)||fe.has(me))}else return F.filter(fe=>se.has(fe))}}function en(F){Ve(F.rawNode)}function Ve(F){if(D.value)return;const{tag:G,remote:se,clearFilterAfterSelect:fe,valueField:me}=t;if(G&&!se){const{value:_e}=g,ke=_e[0]||null;if(ke){const Se=f.value;Se.length?Se.push(ke):f.value=[ke],g.value=B}}if(se&&R.value.set(F[me],F),t.multiple){const _e=cn(c.value),ke=_e.findIndex(Se=>Se===F[me]);if(~ke){if(_e.splice(ke,1),G&&!se){const Se=J(F[me]);~Se&&(f.value.splice(Se,1),fe&&(u.value=""))}}else _e.push(F[me]),fe&&(u.value="");H(_e,P(_e))}else{if(G&&!se){const _e=J(F[me]);~_e?f.value=[f.value[_e]]:f.value=B}tr(),ue(),H(F[me],F)}}function J(F){return f.value.findIndex(se=>se[t.valueField]===F)}function le(F){x.value||ee();const{value:G}=F.target;u.value=G;const{tag:se,remote:fe}=t;if(K(G),se&&!fe){if(!G){g.value=B;return}const{onCreate:me}=t,_e=me?me(G):{[t.labelField]:G,[t.valueField]:G},{valueField:ke,labelField:Se}=t;h.value.some(Qe=>Qe[ke]===_e[ke]||Qe[Se]===_e[Se])||f.value.some(Qe=>Qe[ke]===_e[ke]||Qe[Se]===_e[Se])?g.value=B:g.value=[_e]}}function De(F){F.stopPropagation();const{multiple:G}=t;!G&&t.filterable&&ue(),O(),G?H([],[]):H(null,null)}function ni(F){!_r(F,"action")&&!_r(F,"empty")&&!_r(F,"header")&&F.preventDefault()}function rt(F){V(F)}function qt(F){var G,se,fe,me,_e;if(!t.keyboard){F.preventDefault();return}switch(F.key){case" ":if(t.filterable)break;F.preventDefault();case"Enter":if(!(!((G=N.value)===null||G===void 0)&&G.isComposing)){if(x.value){const ke=(se=w.value)===null||se===void 0?void 0:se.getPendingTmNode();ke?en(ke):t.filterable||(ue(),tr())}else if(ee(),t.tag&&Te.value){const ke=g.value[0];if(ke){const Se=ke[t.valueField],{value:Qe}=c;t.multiple&&Array.isArray(Qe)&&Qe.includes(Se)||Ve(ke)}}}F.preventDefault();break;case"ArrowUp":if(F.preventDefault(),t.loading)return;x.value&&((fe=w.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(F.preventDefault(),t.loading)return;x.value?(me=w.value)===null||me===void 0||me.next():ee();break;case"Escape":x.value&&(Vk(F),ue()),(_e=N.value)===null||_e===void 0||_e.focus();break}}function tr(){var F;(F=N.value)===null||F===void 0||F.focus()}function ii(){var F;(F=N.value)===null||F===void 0||F.focusInput()}function $i(){var F;x.value&&((F=$.value)===null||F===void 0||F.syncPosition())}q(),i.watch(i.toRef(t,"options"),q);const nr={focus:()=>{var F;(F=N.value)===null||F===void 0||F.focus()},focusInput:()=>{var F;(F=N.value)===null||F===void 0||F.focusInput()},blur:()=>{var F;(F=N.value)===null||F===void 0||F.blur()},blurInput:()=>{var F;(F=N.value)===null||F===void 0||F.blurInput()}},dn=i.computed(()=>{const{self:{menuBoxShadow:F}}=s.value;return{"--n-menu-box-shadow":F}}),Wn=o?Ci("select",void 0,dn,t):void 0;return Object.assign(Object.assign({},nr),{mergedStatus:L,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:y,isMounted:Co(),triggerRef:N,menuRef:w,pattern:u,uncontrolledShow:C,mergedShow:x,adjustedTo:Fn(t),uncontrolledValue:a,mergedValue:c,followerRef:$,localizedPlaceholder:k,selectedOption:I,selectedOptions:W,mergedSize:te,mergedDisabled:D,focused:d,activeWithoutMenuOpen:Te,inlineThemeDisabled:o,onTriggerInputFocus:We,onTriggerInputBlur:ce,handleTriggerOrMenuResize:$i,handleMenuFocus:jt,handleMenuBlur:ln,handleMenuTabOut:Bt,handleTriggerClick:pt,handleToggle:en,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:Ne,handleTriggerFocus:Vt,handleKeydown:qt,handleMenuAfterLeave:ve,handleMenuClickOutside:Hn,handleMenuScroll:rt,handleMenuKeydown:qt,handleMenuMousedown:ni,mergedTheme:s,cssVars:o?void 0:dn,themeClass:Wn==null?void 0:Wn.themeClass,onRender:Wn==null?void 0:Wn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(_u,null,{default:()=>[i.h(wu,null,{default:()=>i.h(CC,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(Mu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Fn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(Jv,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,o;return[(o=(r=this.$slots).empty)===null||o===void 0?void 0:o.call(r)]},header:()=>{var r,o;return[(o=(r=this.$slots).header)===null||o===void 0?void 0:o.call(r)]},action:()=>{var r,o;return[(o=(r=this.$slots).action)===null||o===void 0?void 0:o.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[vo,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[vo,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),VC={},Wh=i.defineComponent({...VC,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(C=>{if(M.isEmpty(C))return;const x=s.value?r.value:r.value?[r.value]:[],N=C.filter($=>!x.some(w=>w.id===$.id));l.value=r.optionsListConverter([...x,...N])}).finally(()=>{d.value=!1}))};let f="";const g=M.debounce(()=>h(f),800),m=_=>{f=_,g()},p=_=>{var C;if(M.isArray(_)){const x=_.length>0?_.map(N=>{var $;return i.toRaw(($=l.value.find(w=>w.value===N))==null?void 0:$.item)}):[];o("update:value",x)}else if(_>0){const x=i.toRaw((C=l.value.find(N=>N.value===_))==null?void 0:C.item);o("update:value",x)}else o("update:value",null)};return e({focus:()=>{var _;return(_=u.value)==null?void 0:_.focusInput()},blur:()=>{var _;return(_=u.value)==null?void 0:_.blurInput()}}),(_,C)=>(i.openBlock(),i.createBlock(i.unref(FC),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:s.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:m,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),MC={},jh=i.defineComponent({...MC,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useTemplateRef("select-component"),a=async h=>r.searchType==="categories"?j.HttpRequester.getInstance(j.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?j.HttpRequester.getInstance(j.ProductDataProvider).publicSimpleSearch(h):new Promise(f=>{f([])}),l=h=>r.searchType==="categories"?Tt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?Tt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":`[${f.code}] ${f.name}`):[],c=(h,f)=>{if(r.renderLabel)return r.renderLabel(h,f);if(r.searchType==="products"){const g=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=s.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=s.value)==null?void 0:h.blur()}}),(h,f)=>(i.openBlock(),i.createBlock(Wh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":f[0]||(f[0]=g=>o("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),AC={class:"col-span-2 flex flex-row gap-2.5"},IC={class:"flex-1"},OC={class:"text-sc-grey"},zC={class:"ml-2.5"},DC={key:0,class:"flex-none"},LC={},HC=i.defineComponent({...LC,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(null),s=()=>structuredClone(i.toRaw(n.value)),a=i.ref(s()),l=()=>{r("update:value",a.value.map(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(f=>i.toRaw(f)),...(M.isArray(h)?h:[h]).filter(f=>!a.value.some(g=>g.id===f.id))],i.nextTick(()=>{o.value=null}),l())},d=h=>{h&&(a.value=a.value.map(f=>f.id===h.id?h:i.toRaw(f)),l())},u=h=>{a.value=a.value.filter(f=>f.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=s()}),(h,f)=>{const g=A.NListItem,m=yw,p=A.NButton,b=A.NList;return i.openBlock(),i.createBlock(b,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(jh,{value:o.value,"onUpdate:value":[f[0]||(f[0]=y=>o.value=y),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...f[1]||(f[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,y=>(i.openBlock(),i.createBlock(g,{key:y.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(y)},{default:i.withCtx(()=>[i.createVNode(m)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",AC,[i.createElementVNode("span",IC,[i.createElementVNode("span",OC,i.toDisplayString(y.code),1),i.createElementVNode("span",zC,i.toDisplayString(y.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",DC,[i.renderSlot(h.$slots,"item-extra",{item:y,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),WC={class:"flex flex-col"},jC={class:"flex flex-col gap-1.5 text-base text-nowrap"},qC={class:"font-medium"},XC={class:"flex flex-col text-sc-dark-grey"},YC={key:0},UC={class:"font-medium"},KC={class:"font-medium"},GC={class:"font-medium"},ZC={class:"font-medium"},QC={class:"font-medium"},JC={class:"font-medium"},e2={class:"font-medium"},t2={class:"font-medium"},n2={class:"font-medium"},i2={class:"font-medium"},r2={class:"flex flex-col gap-1.5 text-base text-nowrap"},o2={class:"font-medium"},s2={class:"flex flex-col text-sc-dark-grey"},a2={class:"font-medium"},l2={class:"font-medium"},c2={class:"flex flex-col gap-1.5 text-base text-nowrap"},d2={class:"font-medium"},u2={class:"text-sc-dark-grey"},h2={class:"font-medium"},f2={key:1,class:"text-base text-nowrap"},m2={class:"font-medium"},g2={},qh=i.defineComponent({...g2,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[j.ConfiguratorsEnum.Kozyrek,j.ConfiguratorsEnum.Mosquitto,j.ConfiguratorsEnum.Strip,j.ConfiguratorsEnum.MetalForDoors,j.ConfiguratorsEnum.Sandwich,j.ConfiguratorsEnum.SandwichM2],n=t,r=i.ref(!1),o=i.computed(()=>{var f,g;return((f=n.item.product.unit)==null?void 0:f.isLinear)&&((g=n.item.product.properties)==null?void 0:g.isLengthConfigurator)}),s=i.computed(()=>j.UnitsHelper.getProductLengthMultiplicity(n.item.product)),a=i.computed(()=>j.UnitsHelper.getProductMultiplicity(n.item.product)),l=i.computed(()=>a.value>1),c=i.ref({quantity:n.item.quantity});i.watch(()=>n.item,f=>{c.value={quantity:f.quantity}});const d=f=>{var g;f!==null&&(c.value.quantity=f,(g=n.eventEmitter)==null||g.emit("order-item:edit-quantity",{item:n.item,quantity:f,loaderRef:r}))},u=()=>{var f;(f=n.eventEmitter)==null||f.emit("order-item:open-configurator",{item:n.item})},h=()=>{var f;(f=n.eventEmitter)==null||f.emit("order-item:edit",{item:n.item})};return(f,g)=>{const m=A.NInputNumber;return i.openBlock(),i.createElementBlock("div",WC,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",jC,[i.createElementVNode("span",null,[g[1]||(g[1]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",qC,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",XC,[t.item.configurator===i.unref(j.ConfiguratorsEnum).Kozyrek?(i.openBlock(),i.createElementBlock("span",YC,[g[2]||(g[2]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",UC,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Mosquitto?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("span",null,[g[3]||(g[3]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",KC,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[g[4]||(g[4]=i.createTextVNode(" Высота: ",-1)),i.createElementVNode("span",GC,i.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Strip?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.item.configuratorParams.linesWidths,(p,b)=>(i.openBlock(),i.createElementBlock("span",{key:b},[i.createTextVNode(" Полоса №"+i.toDisplayString(Number(b)+1)+": ",1),i.createElementVNode("span",ZC,i.toDisplayString(p)+" мм.",1)]))),128)),i.createElementVNode("span",null,[g[5]||(g[5]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",QC,i.toDisplayString(t.item.length)+" м.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).MetalForDoors?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("span",null,[g[6]||(g[6]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",JC,i.toDisplayString(t.item.width)+" мм.",1)]),i.createElementVNode("span",null,[g[7]||(g[7]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",e2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Sandwich?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:4},i.renderList(t.item.configuratorParams.items??[],(p,b)=>(i.openBlock(),i.createElementBlock("span",{key:b},[i.createTextVNode(" Изделие №"+i.toDisplayString(Number(b)+1)+": ",1),i.createElementVNode("span",t2,i.toDisplayString(p.width)+"×"+i.toDisplayString(p.length)+" мм",1)]))),128)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).SandwichM2?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[i.createElementVNode("span",null,[g[8]||(g[8]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",n2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[g[9]||(g[9]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",i2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(u,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):o.value&&s.value>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("div",r2,[i.createElementVNode("span",null,[g[10]||(g[10]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",o2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",s2,[i.createElementVNode("span",null,[g[11]||(g[11]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",a2,i.toDisplayString(s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)]),i.createElementVNode("span",null,[g[12]||(g[12]=i.createTextVNode(" Всего: ",-1)),i.createElementVNode("span",l2,i.toDisplayString(t.item.quantity*s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)])])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(h,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",c2,[i.createElementVNode("span",null,[g[13]||(g[13]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",d2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("span",u2,[g[14]||(g[14]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",h2,i.toDisplayString(t.item.length??t.item.width)+" "+i.toDisplayString(t.item.product.unit.name),1)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(h,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[t.allowEdit?(i.openBlock(),i.createBlock(m,{key:0,value:c.value.quantity,parse:i.unref(ot),min:a.value,step:a.value,"show-button":l.value,"button-placement":"both",disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:g[0]||(g[0]=p=>i.unref(zr)(p,".",!1)),onFocus:i.unref(Le),"onUpdate:value":d},{suffix:i.withCtx(()=>[...g[15]||(g[15]=[i.createTextVNode(" шт. ",-1)])]),_:1},8,["value","parse","min","step","show-button","disabled","loading","onFocus"])):(i.openBlock(),i.createElementBlock("span",f2,[g[16]||(g[16]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",m2,i.toDisplayString(t.item.quantity)+" шт.",1)]))],64))])}}}),p2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function y2(t,e){return i.openBlock(),i.createElementBlock("svg",p2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const b2=i.markRaw({name:"tabler-truck-filled",render:y2}),_2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function w2(t,e){return i.openBlock(),i.createElementBlock("svg",_2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const x2=i.markRaw({name:"tabler-truck-delivery",render:w2}),k2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v2(t,e){return i.openBlock(),i.createElementBlock("svg",k2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const C2=i.markRaw({name:"tabler-truck-loading",render:v2}),S2={class:"flex flex-col gap-1"},B2={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},T2={key:1,class:"text-base"},N2={class:"text-sc-dark-grey mr-1.5"},$2={key:0},R2={key:1},E2={},Oo=i.defineComponent({...E2,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var o;return(o=j.useReferencesStore().deliveryTypeReference)==null?void 0:o.find(s=>s.id===r.delivery.type)}),n=i.computed(()=>je.format(r.delivery.date,"dd.MM.yyyy")),r=t;return(o,s)=>{var d,u,h,f,g,m,p,b;const a=C2,l=x2,c=b2;return i.openBlock(),i.createElementBlock("div",S2,[t.showType?(i.openBlock(),i.createElementBlock("span",B2,[((d=e.value)==null?void 0:d.slug)==="self_delivery"?(i.openBlock(),i.createBlock(a,{key:0})):i.createCommentVNode("",!0),((u=e.value)==null?void 0:u.slug)==="delivery"?(i.openBlock(),i.createBlock(l,{key:1})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(c,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((f=e.value)==null?void 0:f.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",T2,[i.createElementVNode("span",N2,i.toDisplayString(n.value),1),(m=(g=t.delivery)==null?void 0:g.address)!=null&&m.address?(i.openBlock(),i.createElementBlock("span",$2,i.toDisplayString(t.delivery.address.address),1)):i.createCommentVNode("",!0),(b=(p=t.delivery)==null?void 0:p.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",R2," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),P2={class:"flex flex-col gap-2.5"},F2={class:"text-base"},V2=["href"],M2={class:"text-sc-grey"},A2={},Xh=i.defineComponent({...A2,__name:"order-common-info",props:{order:{},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Pe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Pe.Status)?(c=(l=j.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>d.id===(e.order.status??-1)))==null?void 0:c.name:void 0}),o=i.computed(()=>e.fields.includes(Pe.CreatedAt)),s=i.computed(()=>e.fields.includes(Pe.ClientInfo)||e.fields.includes(Pe.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Pe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",P2,[i.createElementVNode("span",F2,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,V2)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(yo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",M2,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0)]),s.value?(i.openBlock(),i.createBlock(br,{key:0,client:s.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Oo,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),I2={},Sa=i.defineComponent({...I2,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=j.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((s=n.value)==null?void 0:s.name)??"-"),1)}}}),O2={class:"inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white bg-[#17a2b8]"},z2={},Ba=i.defineComponent({...z2,__name:"creator-user-type-tag",props:{userType:{},prefixText:{default:"Добавлено"}},setup(t){const e=(n,r)=>{const o={[j.UserTypeEnum.Manager]:"менеджером",[j.UserTypeEnum.Operator]:"оператором",[j.UserTypeEnum.Client]:"клиентом",[j.UserTypeEnum.Admin]:"администратором"};return`${r} ${o[n]}`};return(n,r)=>(i.openBlock(),i.createElementBlock("small",O2,i.toDisplayString(e(t.userType,t.prefixText)),1))}}),D2={class:"flex flex-row gap-1.5"},L2={class:"flex-none text-nowrap"},H2={class:"flex flex-1 flex-col"},W2={class:"mt-2.5 grid grid-flow-col grid-rows-2 gap-1 text-base"},j2={key:0},q2={key:1},X2={},Yh=i.defineComponent({...X2,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>{const r=Ba;return i.openBlock(),i.createElementBlock("div",D2,[i.createElementVNode("span",L2,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",H2,[i.createVNode(dr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.creatorUser&&t.product.creatorUser.type?(i.openBlock(),i.createBlock(r,{key:0,"user-type":t.product.creatorUser.type,class:"mt-1 self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",W2,[n[0]||(n[0]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",q2,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[1]||(n[1]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[2]||(n[2]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(jn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])])}}}),Y2={},U2=i.defineComponent({...Y2,__name:"order-items-list",props:{products:{},maxHeight:{default:void 0}},setup(t){const e=()=>{const o=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(s,a)=>i.h("span",{class:"text-base"},[a+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,minWidth:120,render:s=>i.h("span",{class:"text-base"},[s.product.code])},{title:"Наименование",key:"name",resizable:!0,width:"45%",render:s=>i.h("div",{},[i.h(dr,{product:s.product,showCode:!1,showPlanningDates:!1}),..."creatorUser"in s&&s.creatorUser&&s.creatorUser.type?[i.h(Ba,{class:"mt-1",userType:s.creatorUser.type,prefixText:"Добавлено"})]:[]])},{title:"Кол-во",key:"quantity",resizable:!1,width:215,render:s=>i.h(qh,{item:s})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,minWidth:100,render:s=>i.h(jn,{product:s,costFieldName:"costOne",showQuantityUnit:!0})},{title:"Сумма",key:"cost",resizable:!0,minWidth:100,render:s=>i.h(jn,{product:s,costFieldName:"cost",showQuantityUnit:!0})}];switch(it.getDeviceTypeByResolution()){case Je.phone:case Je.tablet:return[{title:"",key:"items",resizable:!0,render:(s,a)=>i.h(Yh,{product:s,index:a})}];case Je.laptop:return o;default:return o}},n=i.ref(e()),r=()=>{n.value=e()};return i.onMounted(()=>{r(),window.addEventListener("resize",r)}),i.onUnmounted(()=>{window.removeEventListener("resize",r)}),(o,s)=>{const a=A.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[s[0]||(s[0]=i.createElementVNode("h3",null,"Список позиций",-1)),i.createVNode(a,{columns:n.value,data:t.products,"row-key":l=>l.id,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Uh=Nn(U2,[["__scopeId","data-v-80c3e01a"]]),K2={class:"text-base"},G2={},Ta=i.defineComponent({...G2,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",K2,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))}}),Z2={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},Q2={class:"col-span-2"},J2={class:"col-span-2"},eS=["href"],tS={},Kh=i.defineComponent({...tS,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,o)=>(i.openBlock(),i.createElementBlock("div",null,[o[12]||(o[12]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",Z2,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[o[1]||(o[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Ta,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),o[11]||(o[11]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(br,{client:t.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=s=>n("click:client-name",t.order.client,s))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o[2]||(o[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(qd,{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},[o[3]||(o[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=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},[o[5]||(o[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",Q2,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[o[6]||(o[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode(Sa,{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},[o[7]||(o[7]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Oo,{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},[o[8]||(o[8]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",J2,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[o[9]||(o[9]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Ta,{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},[o[10]||(o[10]=i.createElementVNode("span",null,"Прикрепленные счета",-1)),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices,(s,a)=>(i.openBlock(),i.createElementBlock("div",{key:a,class:"col-span-2"},[i.createElementVNode("a",{class:"btn btn-primary",href:s}," Скачать счет №"+i.toDisplayString(a+1),9,eS)]))),128))],64)):i.createCommentVNode("",!0)])]))}}),nS={key:0},iS={class:"text-sc-dark-grey my-2 text-center"},rS={key:1,class:"text-sc-dark-grey my-2 text-center"},oS={key:2},sS={class:"text-sc-dark-grey mt-4 text-right font-bold"},aS={class:"text-sc-primary"},lS={},Gh=i.defineComponent({...lS,__name:"order-info",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(new j.Order(n.order)),a=(c=!0)=>{c&&(o.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrder(n.order.id).then(d=>{s.value=d}).finally(()=>{c&&(o.value=!1)})},l=i.computed(()=>(s.value.products??[]).reduce((c,d)=>c+d.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(c,d)=>{const u=A.NSpin;return o.value?(i.openBlock(),i.createElementBlock("div",nS,[i.createElementVNode("div",iS,[i.createVNode(u,{size:"small",class:"mb-2.5 align-middle"}),d[1]||(d[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):s.value.products.length===0?(i.openBlock(),i.createElementBlock("div",rS," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",oS,[i.createVNode(Uh,{products:s.value.products},null,8,["products"]),i.createElementVNode("div",sS,[d[2]||(d[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",aS,i.toDisplayString(l.value)+" ₽",1)]),i.createVNode(Kh,{order:s.value,"onClick:clientName":d[0]||(d[0]=h=>r("click:client-name",s.value.client,h))},null,8,["order"])]))}}}),cS={},dS=i.defineComponent({...cS,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(lr,"small"),r=i.computed(()=>M.isNil(e.orderContextButtonsConfig)?[]:M.isFunction(e.orderContextButtonsConfig)?e.orderContextButtonsConfig(e.order):e.orderContextButtonsConfig),o=s=>{var a;(a=e.onOrderContextSelect)==null||a.call(e,e.order,s)};return(s,a)=>{var u;const l=jo,c=A.NButton,d=A.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:o},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),uS={},hS=i.defineComponent({...uS,__name:"orders-list",props:{fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0}},emits:["click:client-name","dblclick:row","update:pagination","update:sort"],setup(t,{emit:e}){const n=t,r=e,o=()=>M.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),s=i.ref(o()),a=i.ref([]),l=i.ref(!1),c=i.computed(()=>j.useReferencesStore().orderStatusReference),d=i.ref(700),u=B=>{var W,I;const R={onDblclick:()=>r("dblclick:row",B)};if(!n.useCellIndication)return R;const E=[];B.isOnOrder&&E.push("on-order"),B.isLargeOrder&&E.push("large-order"),B.isNotInStock&&E.push("not-in-stock");const P=(I=(W=c.value)==null?void 0:W.find(Z=>Z.id===(B.status??-1)))==null?void 0:I.slug;return P&&E.push("order-status",P),B.delivery.date&&je.isTomorrow(new Date(B.delivery.date))&&E.push("next-day-order"),E.length>0&&(R.class=E.join(" ")),R},h=()=>{const B=[Pe.CreatedAt,Pe.Id,Pe.ClientInfo,Pe.ClientCity,Pe.DeliveryDate,Pe.PaymentType,Pe.SalesDirections,Pe.Status,...n.showAttachedUserColumn?[Pe.AttachedUser]:[],Pe.actions],R=n.fields.length>0?n.fields:B,E={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},P={type:"expand",expandable:M.constant(!0),renderExpand:I=>i.h(Gh,{order:I,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",I.client,null)}}),width:"30"};let W=[{title:"Дата заказа",key:Pe.CreatedAt,resizable:!0,width:100,render:I=>i.h(yo,{date:I.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Pe.Id,resizable:!0,width:75,className:"order-id",render:I=>i.h("a",{href:n.orderUrl.replace(":id",I.id.toString()),class:"text-base"},I.id)},{title:"Дата доставки / самовывоза",key:Pe.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:I=>i.h(yo,{date:I.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Pe.ClientInfo,resizable:!0,minWidth:320,render:I=>i.h(br,{client:I.client,"onClick:client-name":()=>{r("click:client-name",I.client,null)}})},{title:"Тип доставки",key:Pe.DeliveryInfo,resizable:!0,minWidth:320,render:I=>i.h(Oo,{delivery:I.delivery})},{title:"Клиент",key:Pe.ClientInfoShort,resizable:!0,minWidth:320,render:I=>i.h(br,{client:I.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",I.client,null)}})},{title:"Город клиента",key:Pe.ClientCity,resizable:!0,minWidth:90,width:120,render:I=>{var Z;return i.h("span",{class:"text-base"},((Z=I.client)==null?void 0:Z.city.name)??"—")}},{title:"Статус",key:Pe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:I=>{var Z,te;return i.h("span",{class:"text-base"},[((te=(Z=c.value)==null?void 0:Z.find(D=>D.id===(I.status??-1)))==null?void 0:te.name)??""])}},{title:"Тип оплаты",key:Pe.PaymentType,resizable:!0,width:115,minWidth:95,render:I=>I.payment?i.h(Sa,{payment:I.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Pe.SalesDirections,resizable:!0,width:70,render:I=>{var Z;return i.h("span",{class:"text-base"},[((Z=I.salesDirection)==null?void 0:Z.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Pe.AttachedUser,resizable:!0,minWidth:120,render:I=>{var Z;return i.h("span",{class:"text-base"},[((Z=I==null?void 0:I.attachedUser)==null?void 0:Z.name)??""])}}]:[]];switch(n.orderContextButtonsConfig&&W.push({key:"actions",title:"",className:"align-top",width:50,render:I=>i.h(dS,{order:I,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(W=W.map(I=>[Pe.Id,Pe.CreatedAt,Pe.DeliveryDate].includes(I.key)?{...I,sorter:!0,sortOrder:!1,...I.width===void 0?{}:{width:I.width+16}}:I)),it.getDeviceTypeByResolution()){case Je.phone:case Je.tablet:return[P,{key:"order",title:"Заказ",resizable:!0,render:I=>i.h(Xh,{order:I,fields:R,orderUrl:n.orderUrl})}];case Je.laptop:{const I=n.showAttachedUserColumn?R:R.filter(Z=>Z!==Pe.AttachedUser);return[P,...I.map(Z=>W.find(te=>te.key===Z)??E)]}default:return[E]}},f=i.ref(h()),g=i.ref(new j.TableDataPagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),m=i.computed(()=>({...g.value,prefix({itemCount:B}){return`Всего заказов: ${B}`}})),p=i.ref(null),b=i.ref(null),y=i.ref(null),_=()=>{y.value!==null&&(clearInterval(y.value),y.value=null)},C=()=>{_(),n.refreshInterval&&(y.value=setInterval(()=>{N()},n.refreshInterval))},x=()=>{var B,R;n.filters&&((B=b.value)==null||B.abort(),b.value=null,(R=p.value)==null||R.abort(),p.value=new AbortController,l.value=!0,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,s.value,{page:g.value.page,pageSize:g.value.pageSize},p.value.signal).then(E=>{g.value.itemCount!==E.meta.total&&(g.value.itemCount=E.meta.total),g.value.page!==E.meta.currentPage&&(g.value.page=E.meta.currentPage),g.value.pageCount!==E.meta.lastPage&&(g.value.pageCount=E.meta.lastPage),g.value.pageSize!==E.meta.perPage&&(g.value.pageSize=E.meta.perPage),a.value=E.data,l.value=!1}).catch(E=>{if((E==null?void 0:E.name)!=="CanceledError")throw l.value=!1,E}))},N=()=>{var B;!n.filters||l.value||((B=b.value)==null||B.abort(),b.value=new AbortController,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,s.value,{page:g.value.page,pageSize:g.value.pageSize},b.value.signal).then(R=>{a.value=a.value.map(E=>R.data.find(W=>W.id===E.id)??E),g.value.itemCount!==R.meta.total&&(g.value.itemCount=R.meta.total),g.value.pageCount!==R.meta.lastPage&&(g.value.pageCount=R.meta.lastPage)}).catch(R=>{if((R==null?void 0:R.name)!=="CanceledError")throw R}))},$=B=>{g.value.page=B,x(),r("update:pagination",g.value)},w=B=>{g.value.pageSize=B,g.value.page=1,x(),r("update:pagination",g.value)},v=B=>{if(M.isNull(B))s.value=o();else{const[R]=s.value;R.field=B.columnKey.toString(),R.direction=B.order==="ascend"?"asc":"desc",s.value=[R]}f.value.forEach(R=>{if(Object.hasOwn(R,"sortOrder")){const E=R;E.sortOrder=E.key===(B==null?void 0:B.columnKey)&&(B!=null&&B.sorter)&&B.order!==!1?B.order:!1}}),x(),r("update:sort",s.value)},k=()=>{f.value=h(),d.value=window.innerHeight};return i.watch(()=>n.filters,()=>{g.value.page=1,x(),C()}),i.watch(()=>n.sort,()=>{s.value=o(),g.value.page=1,x(),C()}),i.onMounted(()=>{k(),window.addEventListener("resize",k),i.nextTick(()=>{x(),C()})}),i.onUnmounted(()=>{var B,R;window.removeEventListener("resize",k),(B=p.value)==null||B.abort(),(R=b.value)==null||R.abort(),_()}),(B,R)=>{const E=A.NDataTable;return i.openBlock(),i.createBlock(E,{columns:f.value,data:a.value,"row-key":P=>P.id,"row-props":u,"scroll-x":t.tableMinWidth,pagination:m.value,loading:l.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":d.value*(i.unref(j.useBaseConfigStateStore)().config.tableDefaultHeightCoefficient??.6),"pagination-behavior-on-filter":"first","onUpdate:page":$,"onUpdate:pageSize":w,"onUpdate:sorter":v},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),fS=Nn(hS,[["__scopeId","data-v-25174a4c"]]),mS=["href"],gS={class:"text-sc-dark-grey"},pS={},yS=i.defineComponent({...pS,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>je.format(n.order.createdAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{M.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},i.toDisplayString(t.order.id),9,mS),i.createTextVNode(" от "+i.toDisplayString(o.value),1),t.order.isApproved1c?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" (подтверждён)")],64)):i.createCommentVNode("",!0)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",gS,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),bS={class:"sc-page flex flex-col bg-inherit"},_S={class:"my-2 flex flex-row items-end"},wS={class:"sc-title grow"},xS={key:0,class:"sc-title-buttons flex-1 grow-0"},kS={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},vS={key:0,class:"sc-title-extra mt-2 sm:mt-4"},CS={},Zh=i.defineComponent({...CS,__name:"page",props:{title:{},stickyHeader:{type:Boolean},stickyTopOffset:{}},setup(t){return(e,n)=>{const r=A.NH1;return i.openBlock(),i.createElementBlock("div",bS,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?"sticky z-10 bg-inherit":void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",_S,[i.createElementVNode("div",wS,[i.renderSlot(e.$slots,"title",{},()=>[i.createVNode(r,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),e.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",xS,[i.createElementVNode("div",kS,[i.renderSlot(e.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),e.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",vS,[i.renderSlot(e.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(e.$slots,"sticky-extra")],6),i.renderSlot(e.$slots,"default")])}}}),SS={class:"overflow-hidden transition-all duration-300"},BS={class:"text-lg font-medium leading-none"},TS={},Qh=i.defineComponent({...TS,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(0),s=i.ref(n.showDrawer),a=()=>{switch(it.getDeviceTypeByResolution()){case Je.phone:return window.innerWidth*.8;case Je.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?M.isUndefined(n.drawerWidth)?o.value=a():o.value=M.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:o.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),i.watch(()=>n.showDrawer,c=>{s.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=A.NDrawerContent,h=A.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",SS,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:s.value,"onUpdate:show":d[0]||(d[0]=f=>s.value=f),resizable:!0,width:o.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",BS,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),NS={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},$S={key:0},RS={class:"sc-page-preview-panel grow"},ES={key:1,class:"sc-page-preview-panel-extra flex-none"},PS={},FS=i.defineComponent({...PS,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},o=()=>{n.value=!1},s=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,u;window.scrollTo({top:(((u=(d=s.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:o}),(l,c)=>{const d=A.NButton;return i.openBlock(),i.createBlock(Zh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset},i.createSlots({default:i.withCtx(()=>[i.createVNode(Qh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",NS,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",$S,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",RS,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",ES,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset"])}}}),VS={},MS=i.defineComponent({...VS,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var m;return M.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>{const m=new j.Curator({id:-1,name:"",contacts:{},curatedDirection:new j.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[m]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{p.push(new j.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),p}),c=i.computed(()=>Tt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,m=>{const p=M.some(s.value?r.value:[r.value],["id",m.id])?` (${m.curatedDirection.name}) `:"";return m.curatedDirection.isNewRec()?m.name:`${m.name}${p}`})),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(M.isArray(m)){const p=m.length>0?m.map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];o("update:value",p)}else{const p=m>0?l.value.find(b=>b.id===m):null;o("update:value",p??null)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),AS={},IS=i.defineComponent({...AS,__name:"manager-operator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},operatorReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var m;return M.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=i.computed(()=>{var y;const m=[];r.operatorReferenceList.length>0&&m.push({type:"group",label:"Операторы",key:"operators",children:r.operatorReferenceList.map(_=>({label:_.name,value:_.id,item:_}))});let p=r.managerReferenceList;if(r.showActualOnly){const _=M.isArray(r.value)?r.value.map(C=>C.id):[(y=r.value)==null?void 0:y.id];p=p.filter(C=>C.isActive||_.includes(C.id))}const b=Tt.convertReferencesToSelectOptionsList(p,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,_=>`${_.name}${_.isActive?"":" [Не активен]"}`);return m.length>0&&b.length>0&&m.push({key:"manager-operator-divider",disabled:!0,render:()=>i.h("div",{class:"sc-manager-operator-select__divider"})}),m.push(...b),m}),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class??""} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(M.isArray(m)){const p=m.map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b));o("update:value",p)}else{const p=M.isNil(m)?null:l.value.find(b=>b.id===m)??null;o("update:value",p)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:d.value,placeholder:"",class:"w-full","onUpdate:value":h},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),OS={},zS=i.defineComponent({...OS,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>M.isArray(r.value)),a=i.computed(()=>{var m;return M.isArray(r.value)?r.value.map(p=>p.id):((m=r.value)==null?void 0:m.id)??null}),l=i.computed(()=>r.showEmptyValue?[j.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var b;let m=l.value,p=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=M.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];p=M.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),m=m.filter(_=>(r.showEmptyValue?j.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return Tt.convertReferencesToSelectOptionsList(m,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&M.some(s.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>p.includes(y.id)&&y.isActive)}),d=i.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=i.useTemplateRef("select-component"),h=m=>{if(M.isArray(m)){const p=m.length>0?m.filter(b=>!M.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!M.isNil(b)):[];o("update:value",p)}else{const p=m>0&&!M.some(r.disabledManagerReferenceList,["id",m])?l.value.find(b=>b.id===m):new j.Manager;o("update:value",p??new j.Manager)}};return i.watch(()=>r.value,()=>{var m,p;(p=(m=u.value)==null?void 0:m.$forceUpdate)==null||p.call(m)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,m=>{if(m.length>0&&r.value)if(s.value){const p=r.value;M.some(p,b=>M.some(m,["id",b.id]))&&o("update:value",p.filter(b=>!M.some(m,["id",b.id])))}else{const p=r.value;M.some(m,["id",p.id])&&o("update:value",new j.Manager)}}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(A.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),DS={class:"m-0.5 flex flex-col p-0.5"},LS={class:"flex flex-row gap-1"},HS={key:0},WS={key:1},jS={key:2},qS={key:3},XS={class:"flex flex-row gap-1"},YS={key:0},US={key:1},KS={key:2},GS={key:3},ZS={},Jh=i.defineComponent({...ZS,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",DS,[i.createElementVNode("span",LS,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",HS,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",WS,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",jS,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",qS,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",XS,[t.addr.street?(i.openBlock(),i.createElementBlock("span",YS,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",US,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",KS,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",GS,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Na={clearable:!1,value:"",field:void 0,disabled:!1},QS={},JS=i.defineComponent({...QS,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Na,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=M.debounce(()=>u(),800),u=async()=>{!s.value||s.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(s.value,a):j.HttpRequester.getInstance(j.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(Jh,{addr:y,selected:b},{default:M.constant("-")})},f=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};o("select",b)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(p,b)=>{const y=A.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),eB={class:"m-0.5 flex flex-col p-0.5"},tB={class:"font-medium"},nB={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},iB={key:0},rB={key:1},oB={},ef=i.defineComponent({...oB,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",eB,[i.createElementVNode("span",tB,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",nB,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",iB," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",rB," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),sB={},aB=i.defineComponent({...sB,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Na,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=M.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await j.HttpRequester.getInstance(j.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},h=(p,b)=>{const y=l.value.find(_=>_.id===p.value)||{};return i.h(ef,{bank:y,selected:b},{default:M.constant("-")})},f=p=>{d.cancel();const b=l.value.find(y=>y.id===p)||{};o("select",b)},g=i.ref(null);function m(){g.value.focus()}return e({focus:m}),(p,b)=>{const y=A.NAutoComplete;return i.openBlock(),i.createBlock(y,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:f},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),lB={class:"font-medium"},cB={key:0,class:"flex flex-row gap-2"},dB={key:0,class:"text-xs font-light text-blue-800"},uB={key:1,class:"text-sc-dark-grey text-xs font-light"},hB={},tf=i.defineComponent({...hB,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",lB,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",cB,[t.org.inn?(i.openBlock(),i.createElementBlock("span",dB,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",uB,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),fB={},mB=i.defineComponent({...fB,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Na,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Tt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));i.watch(()=>r.value,b=>{s.value=b}),i.watch(s,()=>{o("update:value",s.value)});const u=M.debounce(()=>h(),800),h=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await j.HttpRequester.getInstance(j.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},f=(b,y)=>{const _=l.value.find(C=>C.id===b.value)||{};return i.h(tf,{org:_,selected:y},{default:M.constant("-")})},g=b=>{u.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&o("select",y)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(b,y)=>{const _=A.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[y[0]||(y[0]=C=>s.value=C),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),gB={},pB=i.defineComponent({...gB,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},a=()=>{n.disableConfirm?s():o.value=!0};return(l,c)=>{const d=A.NButton,u=A.NPopover,h=A.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(h,{show:o.value,"onUpdate:show":c[1]||(c[1]=f=>o.value=f),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=f=>o.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),yB={key:0,class:"whitespace-pre-line"},bB={key:1,class:"text-sc-dark-grey"},_B={},wB=i.defineComponent({..._B,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.comment);i.watch(()=>o.value,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=n.comment};return(l,c)=>{const d=A.NInput;return i.openBlock(),i.createBlock(tu,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",yB,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",bB," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:o.value,"onUpdate:value":c[0]||(c[0]=u=>o.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),xB={},kB=i.defineComponent({...xB,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),vB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function CB(t,e){return i.openBlock(),i.createElementBlock("svg",vB,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const SB=i.markRaw({name:"ion-warning",render:CB}),BB={},TB=i.defineComponent({...BB,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=SB,o=A.NPopover;return i.openBlock(),i.createBlock(o,{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"])}}}),NB=i.computed(()=>j.useReferencesStore().deliveryTypeReference??[]),$B=i.computed(()=>j.useReferencesStore().managersList??[]),RB=i.computed(()=>j.useReferencesStore().opfReference??[]),EB=i.computed(()=>j.useReferencesStore().partnerGroupsReference??[]),PB=i.computed(()=>j.useReferencesStore().priceCoefficientsReference??[]),FB=i.computed(()=>j.useReferencesStore().productFilesTypesReference??[]),VB=i.computed(()=>j.useReferencesStore().resourceTypesReference),MB=i.computed(()=>j.useReferencesStore().salesDirectionsReference??[]),AB=i.computed(()=>j.useReferencesStore().warehousesReference??[]),IB=i.computed(()=>j.useReferencesStore().paymentTypeReference??[]),OB=i.computed(()=>j.useReferencesStore().orderStatusReference??[]),zB=i.computed(()=>j.useReferencesStore().operatorReference??[]),DB=i.computed(()=>Tt.convertReferencesToSelectOptionsList(j.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),LB=i.computed(()=>Tt.convertReferencesToSelectOptionsList(j.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),HB=t=>j.HttpRequester.getInstance(j.ReferenceDataProvider).searchCity(t),WB=t=>Tt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(o=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:o.name}`},e=>e==null?void 0:e.isNewRec()),jB=t=>j.HttpRequester.getInstance(j.ClientDataProvider).searchClient(t),qB=t=>Tt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>e.isNewRec()?"-":[e.name,e.salesDirection.name?`(${e.salesDirection.name})`:void 0,e.city.name?`г. ${e.city.name}${e.city.region.name?`, ${e.city.region.name}`:""}`:void 0,e.isActive?void 0:"[ Деактивирован ]"].filter(Boolean).join(" "),e=>e==null?void 0:e.isNewRec());X.AddProductToCartDialog=Db,X.ConfiguratorSettingsKozyrek=kd,X.ConfiguratorSettingsMosquito=Y_,X.ContentHelper=ai,X.FileHelper=hf,X.KozyrekLine=_n,X.KozyrekTailTemplate=Ls,X.KozyrekTemplate=Ui,X.NumericValidators=ae,X.OrdersTableFields=Pe,X.Point=Ds,X.ScAddressSuggestion=JS,X.ScAddressSuggestionLabel=Jh,X.ScBankSuggestion=aB,X.ScBankSuggestionLabel=ef,X.ScBaseDialog=jd,X.ScButtonWithConfirmAction=pB,X.ScCategoryCollapse=Hd,X.ScClientNameWithShortInfo=br,X.ScCollapse=Ld,X.ScCollapseItem=el,X.ScCommentEditor=wB,X.ScConfiguratorsProductInfo=ur,X.ScContragentWithShortInfo=qd,X.ScCreatorUserTypeTag=Ba,X.ScCuratorSelect=MS,X.ScDateRange=$1,X.ScDateTimeLabel=yo,X.ScDebouncedInput=nw,X.ScDebouncedInputNumber=rw,X.ScDebt=kB,X.ScDialogHeader=I1,X.ScDynamicConfigurator=Od,X.ScEmail=n_,X.ScExternalLink=mw,X.ScImageGallery=ol,X.ScInlineEditableItem=tu,X.ScInlineView=Ws,X.ScKozyrekConfigurator=vd,X.ScKozyrekConfiguratorParamsForm=al,X.ScKozyrekConfiguratorPreview=xd,X.ScKozyrekConfiguratorTemplates=wd,X.ScLightGallery=rl,X.ScManagerOperatorSelect=IS,X.ScManagerSelect=zS,X.ScMetalForDoorsConfigurator=Pd,X.ScMetalForDoorsConfiguratorForm=Ed,X.ScMosquitoConfigurator=Bd,X.ScMosquitoConfiguratorForm=Cd,X.ScMosquitoConfiguratorMeasurementInstructions=Sd,X.ScMosquitoConfiguratorPreview=Hs,X.ScOrderCommonInfo=Xh,X.ScOrderDeliveryLabel=Oo,X.ScOrderDetails=Kh,X.ScOrderInfo=Gh,X.ScOrderItemParams=qh,X.ScOrderItemsList=Uh,X.ScOrderPayment=Sa,X.ScOrderProductInfo=Yh,X.ScOrdersList=fS,X.ScOrgSuggestion=mB,X.ScOrgSuggestionLabel=tf,X.ScPage=Zh,X.ScPageWithSlidingPanel=FS,X.ScPersonContactsBlock=X_,X.ScPhone=B_,X.ScPhoneInput=aw,X.ScProductName=dr,X.ScProductsList=HC,X.ScReferenceSelect=Wd,X.ScSandwichConfigurator=Md,X.ScSandwichConfiguratorForm=Vd,X.ScSandwichM2Configurator=Id,X.ScSandwichM2ConfiguratorForm=Ad,X.ScSearchableProductSelect=jh,X.ScSearchableReferenceSelect=Wh,X.ScSetClientPriceFormItem=Vb,X.ScShortTextOrderInfo=yS,X.ScSingleFileUploadSelector=H1,X.ScSlidingContentWithDrawer=Qh,X.ScStripConfigurator=Rd,X.ScStripConfiguratorForm=Nd,X.ScStripConfiguratorLineItem=Td,X.ScStripConfiguratorPreview=$d,X.ScUserShortInfo=Ta,X.ScWarningIcon=TB,X.SelectOptionHelper=Tt,X.UiNotificationProvider=sr,X.Validators=He,X.WindowResolutionEnum=Je,X.WindowResolutionProvider=it,X.channelPrimaryInterestOptionsList=DB,X.componentSizeInjectionKey=lr,X.copyToClipboard=Ua,X.deliveryTypeReferenceList=NB,X.handleFloatInput=zr,X.handleIntegerInput=nt,X.isCanSandwichM2Show=U_,X.isCanSandwichShow=Dd,X.isConfiguratorType=zd,X.managersReferenceList=$B,X.naiveUiTheme=Qf,X.operatorReferenceList=zB,X.opfReferenceList=RB,X.orderStatusReferenceList=OB,X.parse=ot,X.partnerGroupReferenceList=EB,X.paymentTypeReferenceList=IB,X.priceCoefficientsReferenceList=PB,X.productFilesTypesReferenceList=FB,X.renderConfig=qe,X.resetInputValidation=tt,X.resourceReferencesList=VB,X.salesDirectionsReferenceList=MB,X.searchCityReferenceDataHandler=HB,X.searchCityReferenceLabelRenderer=WB,X.searchClientReferenceDataHandler=jB,X.searchClientReferenceLabelRenderer=qB,X.selectAllTextOnFocus=Le,X.sourcePrimaryInterestOptionsList=LB,X.vCopy=uf,X.vFocusNext=Ga,X.warehousesReferenceList=AB,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));