@snabcentr/vue-ui-lib 4.19.2 → 4.19.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/manifest.json +2 -2
- package/dist/release_notes.tmp +4 -3
- package/dist/sc-vue-ui-lib.css +1 -1
- package/dist/sc-vue-ui-lib.js +1983 -1980
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +24 -24
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/package.json +2 -2
|
@@ -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("date-fns"),require("naive-ui"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","@snabcentr/common-lib","lodash-es","vue","date-fns","naive-ui","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["date-fns"],X["naive-ui"],X["libphonenumber-js"],X["ts-case-convert"],X["vue-tel-input"]))})(this,(function(X,j,D,i,He,z,br,hs,Lh){"use strict";var q5=Object.defineProperty;var Ih=X=>{throw TypeError(X)};var X5=(X,j,D)=>j in X?q5(X,j,{enumerable:!0,configurable:!0,writable:!0,value:D}):X[j]=D;var T=(X,j,D)=>X5(X,typeof j!="symbol"?j+"":j,D),Oh=(X,j,D)=>j.has(X)||Ih("Cannot "+D);var Ot=(X,j,D)=>(Oh(X,j,"read from private field"),D?D.call(X):j.get(X)),yl=(X,j,D)=>j.has(X)?Ih("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(X):j.set(X,D),zh=(X,j,D,i)=>(Oh(X,j,"write to private field"),i?i.call(X,D):j.set(X,D),D);var Ai,_t,cs;const Nt=class Nt{static init(e,n){Nt.messagesService&&Nt.notificationsService||(Nt.messagesService=e,Nt.notificationsService=n)}static getMessagesService(){if(!Nt.messagesService)throw new Error("UI provider is not initialized.");return Nt.messagesService}static getNotificationsService(){if(!Nt.notificationsService)throw new Error("UI provider is not initialized.");return Nt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,o;if(D.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";Nt.notificationsService?Nt.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"):Nt.messagesService?Nt.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};T(Nt,"messagesService"),T(Nt,"notificationsService");let _r=Nt;const wr=new WeakMap,Hh=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.")},_l=async t=>{const e=D.isNil(t)?"":String(t);if(e)try{await Hh(e),_r.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{_r.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},Wh=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),jh=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":Wh(t)?"click":"dblclick",wl={mounted(t,e){t.style.setProperty("cursor","pointer");const n=jh(t,e),r=o=>{var a;n==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=wr.get(t);_l(s==null?void 0:s.value).catch(D.noop)};wr.set(t,{value:e.value,eventName:n,handler:r}),t.addEventListener(n,r)},updated(t,e){const n=wr.get(t);n&&(n.value=e.value)},beforeUnmount(t){const e=wr.get(t);e&&(t.removeEventListener(e.eventName,e.handler),wr.delete(t))}},qh=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),Xh=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",Jr=new WeakMap,xl=t=>!qh.has(t.type)&&!t.disabled&&!t.readOnly&&t.closest(Xh)===null&&t.getClientRects().length>0,kl=t=>{var a;if(t.key!=="Enter"&&t.code!=="Enter"||t.shiftKey||t.isComposing)return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||!xl(e))return;t.preventDefault();const n=t.currentTarget,r=[...n.querySelectorAll("input")].filter(l=>xl(l)),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);if(s){s.focus(),s.select();return}(a=Jr.get(n))==null||a()},ei={mounted(t,e){Jr.set(t,e.value),t.addEventListener("keydown",kl)},updated(t,e){Jr.set(t,e.value)},unmounted(t){t.removeEventListener("keydown",kl),Jr.delete(t)}};var Fe=(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))(Fe||{}),Xe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Xe||{});class yi{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&D.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&yi.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!yi.isVnodeEmpty(e()):!1}}const Yh={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)})}};class ti{static isDeleted(e){return!!(e.deletedAt&&!He.isFuture(e.deletedAt))}static getFormatEntityName(e){return ti.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const st=(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()}},eo=(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()},lt=t=>t?Number.parseFloat(t.replace(",",".")):null,nt=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class yt{static convertReferencesToOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):ti.getFormatEntityName(c),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(D.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=D.isString(r.key)?D.get(d,r.key):r.key(c),h=D.isString(r.label)?D.get(d,r.label):r.label(c);return{type:"group",label:D.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return yt.convertReferencesToOptionsList(e,n,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return yt.convertReferencesToOptionsList(e,n,r,o,s,a)}}const Uh={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},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}`)}}},Kh={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},We={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Gh={},Zh=i.defineComponent({...Gh,__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=z.NButton,u=z.NPopover,h=z.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"])])}}}),Qh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jh(t,e){return i.openBlock(),i.createElementBlock("svg",Qh,[...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 ms=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Jh}),em={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tm(t,e){return i.openBlock(),i.createElementBlock("svg",em,[...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 vl=i.markRaw({name:"tabler-edit",render:tm}),nm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function im(t,e){return i.openBlock(),i.createElementBlock("svg",nm,[...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 Cl=i.markRaw({name:"ion-checkmark-done-circle",render:im}),rm={viewBox:"0 0 512 512",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:"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 Sl=i.markRaw({name:"ion-checkmark-done-circle-outline",render:om}),sm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function am(t,e){return i.openBlock(),i.createElementBlock("svg",sm,[...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 lm=i.markRaw({name:"fluent-pin32-regular",render:am}),cm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function dm(t,e){return i.openBlock(),i.createElementBlock("svg",cm,[...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 um=i.markRaw({name:"ion-eye-outline",render:dm}),fm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function hm(t,e){return i.openBlock(),i.createElementBlock("svg",fm,[...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 mm=i.markRaw({name:"fluent-pin32-filled",render:hm}),pm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gm(t,e){return i.openBlock(),i.createElementBlock("svg",pm,[...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 ym=i.markRaw({name:"ion-bookmark-outline",render:gm}),bm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _m(t,e){return i.openBlock(),i.createElementBlock("svg",bm,[...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 wm=i.markRaw({name:"ion-eye-off-sharp",render:_m}),xm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function km(t,e){return i.openBlock(),i.createElementBlock("svg",xm,[...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 vm=i.markRaw({name:"ion-chevron-forward-outline",render:km}),Cm=["data-name"],Sm={class:"sc-collapse-item-header flex flex-row gap-2.5"},Bm={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Tm={key:0},Nm={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},$m={class:"flex flex-1 flex-col"},Rm={key:0,class:"sc-collapse-item-sub-title flex-1"},Em={key:1,class:"sc-collapse-item-title-extra flex-none"},Pm={key:0,class:"sc-collapse-item-content"},Fm={},Vm=i.defineComponent({...Fm,__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",D.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=D.some(a,g=>g===r.name),d=i.computed(()=>D.some(l,g=>g===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)}),(g,y)=>{const b=vm;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",Sm,[i.createElementVNode("div",Bm,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(g.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(yi).hasSlotContent(g.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Tm,[i.createElementVNode("div",Nm,[i.renderSlot(g.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",$m,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(g.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(yi).hasSlotContent(g.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Rm,[i.renderSlot(g.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(yi).hasSlotContent(g.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Em,[i.renderSlot(g.$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",Pm,[i.renderSlot(g.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,Cm)}}}),An=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},Bl=An(Vm,[["__scopeId","data-v-f1311d1c"]]),Mm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Am(t,e){return i.openBlock(),i.createElementBlock("svg",Mm,[...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:Am}),xr=Symbol(),Im={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"}},Om={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},zm={},Nl=i.defineComponent({...zm,__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(xr,"medium"),r=i.computed(()=>D.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=i.computed(()=>D.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=i.computed(()=>D.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>D.isNil(e.productContextButtonsConfig)?[]:D.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 C;const m=Sl,p=Cl,g=z.NButton,y=z.NTooltip,b=vl,_=Tl,k=ms,x=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Om,[s.value?(i.openBlock(),i.createBlock(y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{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(p,{key:1})):(i.openBlock(),i.createBlock(m,{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(y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{ghost:!0,size:i.unref(n),type:"primary",disabled:o.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{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),((C=a.value)==null?void 0:C.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(g,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(k)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Dm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Lm(t,e){return i.openBlock(),i.createElementBlock("svg",Dm,[...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 Hm=i.markRaw({name:"tabler-history",render:Lm}),Wm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jm(t,e){return i.openBlock(),i.createElementBlock("svg",Wm,[...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 qm=i.markRaw({name:"mdi-percent-outline",render:jm}),Xm={class:"flex flex-row gap-1"},Ym={key:0,class:"flex gap-1"},Um={key:0,class:"flex text-nowrap text-sm line-through"},Km={key:1,class:"flex flex-row text-nowrap text-sm"},Gm={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Zm={},ni=i.defineComponent({...Zm,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCurrency:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var k;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"discount"in e.product&&e.product.discount?ti.getFormatEntityName(e.product.discount):""),o=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>e.showQuantityUnit?`${o.value.currency.symbol}/${o.value.unit.name}`:e.showCurrency?o.value.currency.symbol:""),a=i.computed(()=>e.showQuantityUnit?`₽/${o.value.unit.name}`:e.showCurrency?"₽":""),l=i.computed(()=>D.find(o.value.priceCoefficients,["coefficient.slug",e.costFieldName])),c=i.computed(()=>{const x=D.find(o.value.priceCoefficients,["coefficient.slug","k0"]);return l.value||!x||D.isNil(u.value)||D.isNil(x.cost)?!1:u.value<x.cost}),d=((k=j.useBaseConfigStateStore().getConfig())==null?void 0:k.defaultCurrency)??"RUB",u=i.computed(()=>l.value?l.value.cost:D.get(e.product,e.costFieldName)),h=i.computed(()=>e.additionalThroughFieldName?D.get(e.product,e.additionalThroughFieldName):void 0),f=i.computed(()=>o.value.costDate?He.format(o.value.costDate,j.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),m=i.computed(()=>e.currencyRates||o.value.currency.signature===d?e.currencyRates:{[o.value.currency.signature]:o.value.costRub/o.value.cost}),p=i.computed(()=>(D.isFunction(e.allowPriceClick)?e.allowPriceClick(o.value):e.allowPriceClick)&&!D.isNil(u.value)),g=i.computed(()=>D.isNil(u.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value))),y=i.computed(()=>{if(o.value.currency.signature===d||!m.value||!m.value[o.value.currency.signature])return null;const x=m.value[o.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value)*x)}),b=i.computed(()=>D.isNil(h.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(h.value)),_=i.computed(()=>{if(!h.value||!u.value||h.value===u.value||u.value===0)return null;const x=(u.value-h.value)/h.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(x)});return(x,C)=>{var $;const N=z.NTag,w=z.NTooltip,S=qm,v=Hm;return i.openBlock(),i.createElementBlock("div",Xm,[t.showTag?(i.openBlock(),i.createBlock(w,{key:0},{trigger:i.withCtx(()=>[i.createVNode(N,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!l.value}])},{default:i.withCtx(()=>{var E;return[i.createTextVNode(i.toDisplayString(((E=l.value)==null?void 0:E.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var E;return[i.createTextVNode(" "+i.toDisplayString(((E=l.value)==null?void 0:E.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":c.value})},[h.value&&h.value!==u.value||_.value?(i.openBlock(),i.createElementBlock("div",Ym,[h.value&&h.value!==u.value?(i.openBlock(),i.createElementBlock("span",Um,i.toDisplayString(b.value)+" "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":c.value}])}," ("+i.toDisplayString(_.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":($=l.value)==null?void 0:$.readOnly,"font-bold":!l.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":p.value&&t.eventEmitter}),onClick:C[0]||(C[0]=()=>{var E;p.value&&((E=t.eventEmitter)==null||E.emit("cost:click",{product:o.value,cost:u.value}))})},i.toDisplayString(g.value),3),i.createTextVNode(" "+i.toDisplayString(s.value)+" ",1),u.value&&!l.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(w,{key:0},{trigger:i.withCtx(()=>[i.createVNode(S,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(r.value)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),y.value?(i.openBlock(),i.createElementBlock("span",Km," ~ "+i.toDisplayString(y.value)+" "+i.toDisplayString(a.value),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(D.isNil)(f.value)?(i.openBlock(),i.createElementBlock("span",Gm,[i.createTextVNode(i.toDisplayString(f.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(w,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(v,{class:"cursor-pointer",onClick:C[1]||(C[1]=E=>{var A;return(A=t.eventEmitter)==null?void 0:A.emit("cost:show-price-history",{product:o.value})})})]),default:i.withCtx(()=>[C[2]||(C[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),Qm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jm(t,e){return i.openBlock(),i.createElementBlock("svg",Qm,[...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 ps=i.markRaw({name:"ion-information-circle-outline",render:Jm}),ep={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tp(t,e){return i.openBlock(),i.createElementBlock("svg",ep,[...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 $l=i.markRaw({name:"ion-images",render:tp}),np={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ip(t,e){return i.openBlock(),i.createElementBlock("svg",np,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56m0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26m48 226h-88a16 16 0 0 1 0-32h28v-88h-16a16 16 0 0 1 0-32h32a16 16 0 0 1 16 16v104h28a16 16 0 0 1 0 32"},null,-1)])])}const rp=i.markRaw({name:"ion-information-circle",render:ip}),op={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sp(t,e){return i.openBlock(),i.createElementBlock("svg",op,[...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 ap=i.markRaw({name:"ion-bookmark",render:sp});/*!
|
|
1
|
+
(function(X,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("vue"),require("date-fns"),require("naive-ui"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","@snabcentr/common-lib","lodash-es","vue","date-fns","naive-ui","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["date-fns"],X["naive-ui"],X["libphonenumber-js"],X["ts-case-convert"],X["vue-tel-input"]))})(this,(function(X,j,D,i,He,z,br,hs,Lh){"use strict";var j5=Object.defineProperty;var Ih=X=>{throw TypeError(X)};var q5=(X,j,D)=>j in X?j5(X,j,{enumerable:!0,configurable:!0,writable:!0,value:D}):X[j]=D;var T=(X,j,D)=>q5(X,typeof j!="symbol"?j+"":j,D),Oh=(X,j,D)=>j.has(X)||Ih("Cannot "+D);var Ot=(X,j,D)=>(Oh(X,j,"read from private field"),D?D.call(X):j.get(X)),yl=(X,j,D)=>j.has(X)?Ih("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(X):j.set(X,D),zh=(X,j,D,i)=>(Oh(X,j,"write to private field"),i?i.call(X,D):j.set(X,D),D);var Ai,_t,cs;const Nt=class Nt{static init(e,n){Nt.messagesService&&Nt.notificationsService||(Nt.messagesService=e,Nt.notificationsService=n)}static getMessagesService(){if(!Nt.messagesService)throw new Error("UI provider is not initialized.");return Nt.messagesService}static getNotificationsService(){if(!Nt.notificationsService)throw new Error("UI provider is not initialized.");return Nt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,o;if(D.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";Nt.notificationsService?Nt.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"):Nt.messagesService?Nt.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};T(Nt,"messagesService"),T(Nt,"notificationsService");let _r=Nt;const wr=new WeakMap,Hh=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.")},_l=async t=>{const e=D.isNil(t)?"":String(t);if(e)try{await Hh(e),_r.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{_r.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},Wh=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),jh=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":Wh(t)?"click":"dblclick",wl={mounted(t,e){t.style.setProperty("cursor","pointer");const n=jh(t,e),r=o=>{var a;n==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=wr.get(t);_l(s==null?void 0:s.value).catch(D.noop)};wr.set(t,{value:e.value,eventName:n,handler:r}),t.addEventListener(n,r)},updated(t,e){const n=wr.get(t);n&&(n.value=e.value)},beforeUnmount(t){const e=wr.get(t);e&&(t.removeEventListener(e.eventName,e.handler),wr.delete(t))}},qh=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),Xh=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",Jr=new WeakMap,xl=t=>!qh.has(t.type)&&!t.disabled&&!t.readOnly&&t.closest(Xh)===null&&t.getClientRects().length>0,kl=t=>{var a;if(t.key!=="Enter"&&t.code!=="Enter"||t.shiftKey||t.isComposing)return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||!xl(e))return;t.preventDefault();const n=t.currentTarget,r=[...n.querySelectorAll("input")].filter(l=>xl(l)),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);if(s){s.focus(),s.select();return}(a=Jr.get(n))==null||a()},ei={mounted(t,e){Jr.set(t,e.value),t.addEventListener("keydown",kl)},updated(t,e){Jr.set(t,e.value)},unmounted(t){t.removeEventListener("keydown",kl),Jr.delete(t)}};var Fe=(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))(Fe||{}),Xe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(Xe||{});class yi{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&D.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&yi.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!yi.isVnodeEmpty(e()):!1}}const Yh={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)})}};class ti{static isDeleted(e){return!!(e.deletedAt&&!He.isFuture(e.deletedAt))}static getFormatEntityName(e){return ti.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const st=(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()}},eo=(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()},lt=t=>t?Number.parseFloat(t.replace(",",".")):null,it=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class yt{static convertReferencesToOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):ti.getFormatEntityName(c),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(D.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=D.isString(r.key)?D.get(d,r.key):r.key(c),h=D.isString(r.label)?D.get(d,r.label):r.label(c);return{type:"group",label:D.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return yt.convertReferencesToOptionsList(e,n,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return yt.convertReferencesToOptionsList(e,n,r,o,s,a)}}const Uh={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},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}`)}}},Kh={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},We={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},Gh={},Zh=i.defineComponent({...Gh,__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=z.NButton,u=z.NPopover,h=z.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"])])}}}),Qh={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jh(t,e){return i.openBlock(),i.createElementBlock("svg",Qh,[...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 ms=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:Jh}),em={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tm(t,e){return i.openBlock(),i.createElementBlock("svg",em,[...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 vl=i.markRaw({name:"tabler-edit",render:tm}),nm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function im(t,e){return i.openBlock(),i.createElementBlock("svg",nm,[...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 Cl=i.markRaw({name:"ion-checkmark-done-circle",render:im}),rm={viewBox:"0 0 512 512",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:"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 Sl=i.markRaw({name:"ion-checkmark-done-circle-outline",render:om}),sm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function am(t,e){return i.openBlock(),i.createElementBlock("svg",sm,[...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 lm=i.markRaw({name:"fluent-pin32-regular",render:am}),cm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function dm(t,e){return i.openBlock(),i.createElementBlock("svg",cm,[...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 um=i.markRaw({name:"ion-eye-outline",render:dm}),fm={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function hm(t,e){return i.openBlock(),i.createElementBlock("svg",fm,[...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 mm=i.markRaw({name:"fluent-pin32-filled",render:hm}),pm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gm(t,e){return i.openBlock(),i.createElementBlock("svg",pm,[...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 ym=i.markRaw({name:"ion-bookmark-outline",render:gm}),bm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _m(t,e){return i.openBlock(),i.createElementBlock("svg",bm,[...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 wm=i.markRaw({name:"ion-eye-off-sharp",render:_m}),xm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function km(t,e){return i.openBlock(),i.createElementBlock("svg",xm,[...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 vm=i.markRaw({name:"ion-chevron-forward-outline",render:km}),Cm=["data-name"],Sm={class:"sc-collapse-item-header flex flex-row gap-2.5"},Bm={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Tm={key:0},Nm={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},$m={class:"flex flex-1 flex-col"},Rm={key:0,class:"sc-collapse-item-sub-title flex-1"},Em={key:1,class:"sc-collapse-item-title-extra flex-none"},Pm={key:0,class:"sc-collapse-item-content"},Fm={},Vm=i.defineComponent({...Fm,__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",D.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=D.some(a,g=>g===r.name),d=i.computed(()=>D.some(l,g=>g===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)}),(g,y)=>{const b=vm;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",Sm,[i.createElementVNode("div",Bm,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(g.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(yi).hasSlotContent(g.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",Tm,[i.createElementVNode("div",Nm,[i.renderSlot(g.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",$m,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(g.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(yi).hasSlotContent(g.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Rm,[i.renderSlot(g.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(yi).hasSlotContent(g.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Em,[i.renderSlot(g.$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",Pm,[i.renderSlot(g.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,Cm)}}}),An=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},Bl=An(Vm,[["__scopeId","data-v-f1311d1c"]]),Mm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Am(t,e){return i.openBlock(),i.createElementBlock("svg",Mm,[...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:Am}),xr=Symbol(),Im={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"}},Om={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},zm={},Nl=i.defineComponent({...zm,__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(xr,"medium"),r=i.computed(()=>D.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=i.computed(()=>D.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=i.computed(()=>D.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>D.isNil(e.productContextButtonsConfig)?[]:D.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 C;const m=Sl,p=Cl,g=z.NButton,y=z.NTooltip,b=vl,_=Tl,k=ms,x=z.NDropdown;return i.openBlock(),i.createElementBlock("div",Om,[s.value?(i.openBlock(),i.createBlock(y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{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(p,{key:1})):(i.openBlock(),i.createBlock(m,{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(y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{ghost:!0,size:i.unref(n),type:"primary",disabled:o.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{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),((C=a.value)==null?void 0:C.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(g,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(k)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),Dm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Lm(t,e){return i.openBlock(),i.createElementBlock("svg",Dm,[...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 Hm=i.markRaw({name:"tabler-history",render:Lm}),Wm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jm(t,e){return i.openBlock(),i.createElementBlock("svg",Wm,[...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 qm=i.markRaw({name:"mdi-percent-outline",render:jm}),Xm={class:"flex flex-row gap-1"},Ym={key:0,class:"flex gap-1"},Um={key:0,class:"flex text-nowrap text-sm line-through"},Km={key:1,class:"flex flex-row text-nowrap text-sm"},Gm={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Zm={},ni=i.defineComponent({...Zm,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCurrency:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var k;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"discount"in e.product&&e.product.discount?ti.getFormatEntityName(e.product.discount):""),o=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>e.showQuantityUnit?`${o.value.currency.symbol}/${o.value.unit.name}`:e.showCurrency?o.value.currency.symbol:""),a=i.computed(()=>e.showQuantityUnit?`₽/${o.value.unit.name}`:e.showCurrency?"₽":""),l=i.computed(()=>D.find(o.value.priceCoefficients,["coefficient.slug",e.costFieldName])),c=i.computed(()=>{const x=D.find(o.value.priceCoefficients,["coefficient.slug","k0"]);return l.value||!x||D.isNil(u.value)||D.isNil(x.cost)?!1:u.value<x.cost}),d=((k=j.useBaseConfigStateStore().getConfig())==null?void 0:k.defaultCurrency)??"RUB",u=i.computed(()=>l.value?l.value.cost:D.get(e.product,e.costFieldName)),h=i.computed(()=>e.additionalThroughFieldName?D.get(e.product,e.additionalThroughFieldName):void 0),f=i.computed(()=>o.value.costDate?He.format(o.value.costDate,j.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),m=i.computed(()=>e.currencyRates||o.value.currency.signature===d?e.currencyRates:{[o.value.currency.signature]:o.value.costRub/o.value.cost}),p=i.computed(()=>(D.isFunction(e.allowPriceClick)?e.allowPriceClick(o.value):e.allowPriceClick)&&!D.isNil(u.value)),g=i.computed(()=>D.isNil(u.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value))),y=i.computed(()=>{if(o.value.currency.signature===d||!m.value||!m.value[o.value.currency.signature])return null;const x=m.value[o.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value)*x)}),b=i.computed(()=>D.isNil(h.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(h.value)),_=i.computed(()=>{if(!h.value||!u.value||h.value===u.value||u.value===0)return null;const x=(u.value-h.value)/h.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(x)});return(x,C)=>{var $;const N=z.NTag,w=z.NTooltip,S=qm,v=Hm;return i.openBlock(),i.createElementBlock("div",Xm,[t.showTag?(i.openBlock(),i.createBlock(w,{key:0},{trigger:i.withCtx(()=>[i.createVNode(N,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!l.value}])},{default:i.withCtx(()=>{var E;return[i.createTextVNode(i.toDisplayString(((E=l.value)==null?void 0:E.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var E;return[i.createTextVNode(" "+i.toDisplayString(((E=l.value)==null?void 0:E.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":c.value})},[h.value&&h.value!==u.value||_.value?(i.openBlock(),i.createElementBlock("div",Ym,[h.value&&h.value!==u.value?(i.openBlock(),i.createElementBlock("span",Um,i.toDisplayString(b.value)+" "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":c.value}])}," ("+i.toDisplayString(_.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":($=l.value)==null?void 0:$.readOnly,"font-bold":!l.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":p.value&&t.eventEmitter}),onClick:C[0]||(C[0]=()=>{var E;p.value&&((E=t.eventEmitter)==null||E.emit("cost:click",{product:o.value,cost:u.value}))})},i.toDisplayString(g.value),3),i.createTextVNode(" "+i.toDisplayString(s.value)+" ",1),u.value&&!l.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(w,{key:0},{trigger:i.withCtx(()=>[i.createVNode(S,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(r.value)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),y.value?(i.openBlock(),i.createElementBlock("span",Km," ~ "+i.toDisplayString(y.value)+" "+i.toDisplayString(a.value),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(D.isNil)(f.value)?(i.openBlock(),i.createElementBlock("span",Gm,[i.createTextVNode(i.toDisplayString(f.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(w,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(v,{class:"cursor-pointer",onClick:C[1]||(C[1]=E=>{var A;return(A=t.eventEmitter)==null?void 0:A.emit("cost:show-price-history",{product:o.value})})})]),default:i.withCtx(()=>[C[2]||(C[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),Qm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jm(t,e){return i.openBlock(),i.createElementBlock("svg",Qm,[...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 ps=i.markRaw({name:"ion-information-circle-outline",render:Jm}),ep={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tp(t,e){return i.openBlock(),i.createElementBlock("svg",ep,[...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 $l=i.markRaw({name:"ion-images",render:tp}),np={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ip(t,e){return i.openBlock(),i.createElementBlock("svg",np,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56m0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26m48 226h-88a16 16 0 0 1 0-32h28v-88h-16a16 16 0 0 1 0-32h32a16 16 0 0 1 16 16v104h28a16 16 0 0 1 0 32"},null,-1)])])}const rp=i.markRaw({name:"ion-information-circle",render:ip}),op={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function sp(t,e){return i.openBlock(),i.createElementBlock("svg",op,[...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 ap=i.markRaw({name:"ion-bookmark",render:sp});/*!
|
|
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 no=function(){return no=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},no.apply(this,arguments)},dp={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"}},In={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},gs=500,up=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=no(no({},dp),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(In.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),m,p,g=s-this.pageX,y=a-this.pageY;if(e-n>1){var b=(e-n)/Math.abs(n);g=(n<0?-g:g)+this.left*(b+(n<0?-1:1)),y=(n<0?-y:y)+this.top*(b+(n<0?-1:1)),m=g/b,p=y/b}else{var b=(e-n)*n;m=g*b,p=y*b}r&&(h?this.isBeyondPossibleLeft(m,f.minX)?m=f.minX:this.isBeyondPossibleRight(m,f.maxX)&&(m=f.maxX):e>1&&(m<f.minX?m=f.minX:m>f.maxX&&(m=f.maxX)),u?this.isBeyondPossibleTop(p,f.minY)?p=f.minY:this.isBeyondPossibleBottom(p,f.maxY)&&(p=f.maxY):e>1&&(p<f.minY?p=f.minY:p>f.maxY&&(p=f.maxY))),this.setZoomStyles({x:m,y:p,scale:e}),this.left=m,this.top=p,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)},gs),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")}},gs+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},gs+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(In.containerResize+".zoom "+In.rotateRight+".zoom "+In.rotateLeft+".zoom "+In.flipHorizontal+".zoom "+In.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(In.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(In.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(In.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 m=e.getDragAllowedAxises(0);a=m.allowY,s=m.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 m=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,m))}}),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 m=c.valueOf()-l.valueOf();e.touchendZoom(n,r,s,a,m)}})},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 m=e.core.getSlideItem(e.core.index);if(e.$LG(f.target).hasClass("lg-item")||m.get().contains(f.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var p=e.getDragAllowedAxises(0);l=p.allowY,a=p.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 m=e.getZoomSwipeCords(n,r,a,l,u);e.setZoomSwipeStyles(h,m)}}),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 m=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,m)}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 fp={ref:"gallery-container",class:"lightgallery-wrapper"},hp={},Rl=i.defineComponent({...hp,__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}),D.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",fp,[i.renderSlot(s.$slots,"default")],512))}}),gt=class gt{static init(){gt.isInitialized||(gt.isInitialized=!0,gt.windowResizeHandler(),window.addEventListener("resize",gt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",gt.windowResizeHandler),gt.isInitialized=!1}static getDeviceTypeByResolution(){const e=j.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Xe.phone:window.innerWidth<e.laptop?Xe.tablet:Xe.laptop}static initRefDependingOnDeviceResolution(e,n,r){const o=i.ref(r);return gt.setRefValueDependingOnDeviceResolution(o,e,n,r),gt.refsDependingOnDeviceResolution.push({r:o,phoneValue:e,tabletValue:n,defaultValue:r}),o}static isPhoneDevice(){return gt.getDeviceTypeByResolution()===Xe.phone}static isTabletDevice(){return gt.getDeviceTypeByResolution()===Xe.tablet}static isLaptopDevice(){return gt.getDeviceTypeByResolution()===Xe.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,o){switch(gt.getDeviceTypeByResolution()){case Xe.phone:e.value=n;break;case Xe.tablet:e.value=r;break;default:e.value=o;break}}static windowResizeHandler(){D.forEach(gt.refsDependingOnDeviceResolution,e=>{gt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};T(gt,"isInitialized",!1),T(gt,"refsDependingOnDeviceResolution",[]);let it=gt;const mp=["href"],pp=["src","alt"],gp={},El=i.defineComponent({...gp,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),o=i.ref({plugins:[cp,up],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),s=()=>window.innerWidth*(it.getDeviceTypeByResolution()===Xe.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=$l,f=z.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]=m=>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,(m,p)=>(i.openBlock(),i.createElementBlock("a",{key:p,href:m.image},[i.createElementVNode("img",{src:m.preview,alt:`Изображение #${p+1}`},null,8,pp)],8,mp))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),yp={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},bp={class:"pr-3"},_p={class:"text-right"},wp={},xp=i.defineComponent({...wp,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=ps,o=z.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",yp,[(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",bp,i.toDisplayString(s.warehouse.name),1),i.createElementVNode("span",_p,[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})}}}),kp={class:"flex flex-row justify-between"},vp={key:0,class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},Cp={key:1},Sp={class:"ml-2 align-sub"},Bp={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},Tp={class:"@container"},Np={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},$p={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Rp={class:"text-sc-dark-grey"},Ep={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},Pp={class:"text-gray-600"},Fp={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Vp={key:3,class:"underline decoration-dashed"},Mp={key:4,class:"sc-product-pack whitespace-nowrap"},Ap={class:"text-gray-600"},Ip={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Op={class:"text-gray-600"},zp={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},Dp={key:0},Lp={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Hp={},vr=i.defineComponent({...Hp,__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},showAdditionalSaleIcon:{type:Boolean,default:!1},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(()=>D.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),o=i.computed(()=>D.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(()=>D.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,S,v;const m=ap,p=z.NTooltip,g=Tl,y=rp,b=$l,_=z.NText,k=Nl,x=ps,C=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",kp,[i.createVNode(_,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var $,E,A,R;return[($=t.product)!=null&&$.isFavorite||(E=t.product)!=null&&E.isPreviouslyOrdered||t.showAdditionalSaleIcon?(i.openBlock(),i.createElementBlock("div",vp,[((A=t.product)==null?void 0:A.isFavorite)??!1?(i.openBlock(),i.createBlock(p,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(m,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),((R=t.product)==null?void 0:R.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(p,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-green-700"})]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0),t.showAdditionalSaleIcon?(i.openBlock(),i.createBlock(p,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(y,{class:"!text-green-500"})]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" Дополнительная продажа ",-1))]),_:1})):i.createCommentVNode("",!0)])):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",Cp," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Sp,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(El,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Bp,[i.createVNode(b)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),d.value?(i.openBlock(),i.createBlock(k,{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",Tp,[i.createElementVNode("div",Np,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",$p,[f[3]||(f[3]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",Rp,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",Ep,[f[4]||(f[4]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",Pp,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(xp,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",Fp,[f[5]||(f[5]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(x,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",Vp," Нет в наличии ")),t.product.pack??((w=(N=t.product)==null?void 0:N.properties)==null?void 0:w.pack)?(i.openBlock(),i.createElementBlock("span",Mp,[f[6]||(f[6]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",Ap,i.toDisplayString(t.product.pack??((v=(S=t.product)==null?void 0:S.properties)==null?void 0:v.pack)),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&s.value?(i.openBlock(),i.createElementBlock("span",Ip,[f[7]||(f[7]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",Op,i.toDisplayString(s.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(C,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",zp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,$=>(i.openBlock(),i.createBlock(ni,{key:$.coefficient.slug,product:t.product,"cost-field-name":$.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(ni,{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",Dp,[i.createElementVNode("ul",Lp,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},($,E)=>(i.openBlock(),i.createElementBlock("li",{key:E}," ("+i.toDisplayString(E)+"): "+i.toDisplayString($),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,($,E)=>(i.openBlock(),i.createElementBlock("li",{key:E}," ("+i.toDisplayString(E)+"): "+i.toDisplayString($),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Wp=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(ni,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),jp=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(D.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:o=>{var s,a;return i.h(z.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 Xe.phone:case Xe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:o=>i.h(vr,{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(vr,{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&&(D.forEach(t,o=>{D.forEach(o.priceCoefficients,s=>{r[s.coefficient.slug??""]||(r[s.coefficient.slug??""]=s.coefficient)})}),D.forEach(D.sortBy(r,["slug"]),o=>{n.push(Wp(o.slug??"",o.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:o=>i.h(ni,{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||!D.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},qp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xp(t,e){return i.openBlock(),i.createElementBlock("svg",qp,[...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 io=i.markRaw({name:"ion-trash",render:Xp}),Yp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Up(t,e){return i.openBlock(),i.createElementBlock("svg",Yp,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Pl=i.markRaw({name:"ion-plus",render:Up}),Kp={key:0,class:"flex w-fit items-center gap-2"},Gp={key:1,class:"flex flex-wrap gap-1"},Zp={key:0},Qp={key:2},Jp={},Cr=i.defineComponent({...Jp,__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=z.NSpin,a=z.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Kp,[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",Gp,[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",Zp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",Qp,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),eg={class:"flex flex-col gap-4"},tg={class:"flex flex-col gap-2"},ng={class:"mt-8 font-bold"},ig={class:"grid grow grid-cols-2 items-start gap-2"},rg={key:2,class:"text-red-500 text-sm"},og={key:3,class:"text-red-500 text-sm mb-2"},sg={class:"flex flex-col gap-4"},ag={key:1},lg={class:"text-lg font-semibold"},cg={class:"flex gap-3"},dg={},ug=i.defineComponent({...dg,__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 y;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(D.cloneDeep(r.value)),c=i.computed(()=>{var _,k,x;const b={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),We.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation((k=r.validation.quantity)==null?void 0:k.feedback)],marker:[We.serverValidation((x=r.validation.marker)==null?void 0:x.feedback)]};return D.forEach(l.value.configuratorParams.linesWidths,(C,N)=>{var v;const S=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;b[`configuratorParams.linesWidths.${N}`]=[ae.required,ae.min(S),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((v=r.validation[`lines_widths[${N+1}]`])==null?void 0:v.feedback)]}),D.forEach(l.value.configuratorParams.linesAngles,(C,N)=>{var w;b[`configuratorParams.linesAngles.${N}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),We.serverValidation((w=r.validation[`lines_angles[${N+1}]`])==null?void 0:w.feedback)]}),b}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>{var C;const{length:b}=l.value.configuratorParams,{quantity:_}=l.value,k=((C=l.value.product)==null?void 0:C.costRub)||0;if(!b||!_||k===0)return null;const x=b/1e3;return(k*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=i.computed(()=>D.reduce(l.value.configuratorParams.linesWidths,(b,_)=>b+(_||0),0)),f=i.computed(()=>{const b=h.value;return b>=r.settings.stripMinWidth&&b<=r.settings.stripMaxWidth}),m=i.computed(()=>{const{configuratorParams:b}=l.value,_=D.every(b.linesWidths,N=>!!(N&&N>0)),k=D.every(b.linesAngles,N=>!D.isNil(N)),x=!!(l.value.quantity&&l.value.quantity>0),C=b.length>0&&b.length>0;return _&&k&&x&&C&&f.value}),p=()=>{i.nextTick(()=>{var b;(b=s.value)==null||b.validate(_=>{_||(o("update:params",l.value.configuratorParams),g("configuratorParams",l.value.configuratorParams))}).catch(D.noop)})},g=(b,_)=>{const k=new j.OrderItemBase(l.value);k[b]=_,b==="configuratorParams"&&(k.product=new j.ClientProduct),o("update:value",k)};return i.watch(()=>r.previewParams,b=>{l.value.configuratorParams.linesWidths=b.linesWidths,l.value.configuratorParams.linesAngles=b.linesAngles},{deep:!0}),i.watch(()=>r.value,b=>{l.value=D.cloneDeep(b)},{deep:!0}),e({validate:(y=s.value)==null?void 0:y.validate,formReference:s}),(b,_)=>{const k=Pl,x=io,C=z.NCheckbox;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var N;return[i.createElementVNode("div",eg,[_[21]||(_[21]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),p],options:t.settings.startTailConfigs.map(({label:w},S)=>({label:w,value:S})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",tg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,S)=>(i.openBlock(),i.createElementBlock("div",{key:S,class:"flex items-start gap-2"},[i.createElementVNode("div",ng,i.toDisplayString(S+1),1),i.createElementVNode("div",ig,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesWidths.${S}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesWidths[S],"onUpdate:value":[v=>l.value.configuratorParams.linesWidths[S]=v,_[2]||(_[2]=v=>p())],parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=v=>i.unref(st)(v)),onInput:v=>i.unref(nt)(t.validation,`lines_widths[${S+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesAngles.${S}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesAngles[S],"onUpdate:value":[v=>l.value.configuratorParams.linesAngles[S]=v,_[4]||(_[4]=v=>p())],parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=v=>i.unref(st)(v,!0)),onInput:v=>i.unref(nt)(t.validation,`lines_angles[${S+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"medium",onClick:v=>o("click:add-line",S)},{default:i.withCtx(()=>[i.createVNode(k)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:v=>o("click:remove-line",S)},{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(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),p],options:t.settings.endTailConfigs.map(({label:w},S)=>({label:w,value:S})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Cr,{"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",rg," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(h.value)+" мм. ",1)),m.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",og," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((N=t.settings.allTemplates)==null?void 0:N.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=w=>o("click:save-template"))},{default:i.withCtx(()=>[..._[20]||(_[20]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",sg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),p],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.value.configuratorParams.length=w),_[11]||(_[11]=w=>p())],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>i.unref(st)(w)),onInput:_[10]||(_[10]=w=>i.unref(nt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>g("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>i.unref(st)(w,!1)),onInput:_[14]||(_[14]=w=>i.unref(nt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>i.unref(nt)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,g("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(C,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.value.isAdditionalSale=w??!1,g("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[..._[22]||(_[22]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",ag,[_[23]||(_[23]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",lg,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",cg,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!m.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"])),[[i.unref(ei),()=>o("submit",l.value)]])}}}),Fl=An(ug,[["__scopeId","data-v-ac7f1192"]]);var Vl=Object.defineProperty,fg=Object.defineProperties,hg=Object.getOwnPropertyDescriptors,Ml=Object.getOwnPropertySymbols,mg=Object.prototype.hasOwnProperty,pg=Object.prototype.propertyIsEnumerable,Al=t=>{throw TypeError(t)},ys=(t,e,n)=>e in t?Vl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Sr=(t,e)=>{for(var n in e||(e={}))mg.call(e,n)&&ys(t,n,e[n]);if(Ml)for(var n of Ml(e))pg.call(e,n)&&ys(t,n,e[n]);return t},bs=(t,e)=>fg(t,hg(e)),Il=(t,e)=>{for(var n in e)Vl(t,n,{get:e[n],enumerable:!0})},B=(t,e,n)=>ys(t,typeof e!="symbol"?e+"":e,n),Ol=(t,e,n)=>e.has(t)||Al("Cannot "+n),zt=(t,e,n)=>(Ol(t,e,"read from private field"),n?n.call(t):e.get(t)),zl=(t,e,n)=>e.has(t)?Al("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),gg=(t,e,n,r)=>(Ol(t,e,"write to private field"),e.set(t,n),n),Et={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 Et.shim(t),typeof e<"u"&&(Et.Image=e),Et.isHeadless=!0,t}},Dl={};Il(Dl,{Curve:()=>Ui,getAnchorsFromArcData:()=>_g,getComponentOnCubicBezier:()=>Br,getControlPoints:()=>Zl,getCurveBoundingBox:()=>Ul,getCurveFromPoints:()=>Gl,getCurveLength:()=>Yl,getReflection:()=>ks,integrate:()=>Kl,subdivide:()=>xs});var Ll={};Il(Ll,{HALF_PI:()=>ct,NumArray:()=>_n,TWO_PI:()=>et,decomposeMatrix:()=>bi,getComputedMatrix:()=>_s,getEffectiveStrokeWidth:()=>wn,getPoT:()=>jl,lerp:()=>Pt,mod:()=>rt,setMatrix:()=>Wl,toFixed:()=>Ie});var Ue;typeof window<"u"?Ue=window:typeof global<"u"?Ue=global:typeof self<"u"&&(Ue=self);var Hl,et=Math.PI*2,ct=Math.PI*.5;function bi(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 Wl(t){Hl=t}function _s(t,e){e=e&&e.identity()||new Hl;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 Pt(t,e,n){return n*(e-t)+t}var ws=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function jl(t){let e=0;for(;ws[e]&&ws[e]<t;)e++;return ws[e]}function rt(t,e){for(;t<0;)t+=e;return t%e}var _n=Ue.Float32Array||Array,yg=Math.floor;function Ie(t){return yg(t*1e6)/1e6}function wn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||_s(t));const r=bi(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 ie={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},ee=class{constructor(){B(this,"_events",{}),B(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}};B(ee,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),B(ee,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var ql={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ee.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ee.Types.change))}}},ln=class gr extends ee{constructor(e=0,n=0){super(),B(this,"_x",0),B(this,"_y",0);for(let r in ql)Object.defineProperty(this,r,ql[r]);this.x=e,this.y=n}static add(e,n){return new gr(e.x+n.x,e.y+n.y)}static sub(e,n){return new gr(e.x-n.x,e.y-n.y)}static subtract(e,n){return gr.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(gr.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 gr(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}};B(ln,"zero",new ln),B(ln,"left",new ln(-1,0)),B(ln,"right",new ln(1,0)),B(ln,"up",new ln(0,-1)),B(ln,"down",new ln(0,1));var re=ln,Ne=class fs extends re{constructor(e=0,n=0,r=0,o=0,s=0,a=0,l=ie.move){super(e,n),B(this,"controls",{left:new re,right:new re}),B(this,"_command",ie.move),B(this,"_relative",!0),B(this,"_rx",0),B(this,"_ry",0),B(this,"_xAxisRotation",0),B(this,"_largeArcFlag",0),B(this,"_sweepFlag",1);for(let d in Xl)Object.defineProperty(this,d,Xl[d]);this.command=l,this.relative=!0;const c=fs.makeBroadcast(this);this.controls.left.set(r,o).addEventListener(ee.Types.change,c),this.controls.right.set(s,a).addEventListener(ee.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(ee.Types.change)}}static fromObject(e){return new fs().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 fs().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())}},Xl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ee.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ee.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ee.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ee.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ee.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ee.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ee.Types.change))}}},bg=0,xt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.23",PublishDate:"2025-12-22T19:59:24.486Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return bg++}},Ui={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 Br(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 xs(t,e,n,r,o,s,a,l,c){c=c||Ui.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Ne(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,m=Br(f,t,n,o,a),p=Br(f,e,r,s,l);u.push(new Ne(m,p))}return u}function Yl(t,e,n,r,o,s,a,l,c){if(t===n&&e===r&&o===a&&s===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}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),m=6*(e+s)-12*r,p=3*(r-e);function g(y){const b=(d*y+u)*y+h,_=(f*y+m)*y+p;return Math.sqrt(b*b+_*_)}return Kl(g,0,1,c||Ui.RecursionLimit)}function Ul(t,e,n,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,m,p,g,y,b;for(let C=0;C<2;++C){if(C===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;m=-f/h,0<m&&m<1&&c.push(m);continue}y=h*h-4*f*u,b=Math.sqrt(y),!(y<0)&&(p=(-h+b)/(2*u),0<p&&p<1&&c.push(p),g=(-h-b)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,k=_,x;for(;_--;)m=c[_],x=1-m,d[0][_]=x*x*x*t+3*x*x*m*n+3*x*m*m*o+m*m*m*a,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*l;return d[0][k]=t,d[1][k]=e,d[0][k+1]=a,d[1][k+1]=l,d[0].length=d[1].length=k+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 Kl(t,e,n,r){let o=Ui.abscissas[r-2],s=Ui.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 Gl(t,e){const n=t.length,r=n-1;for(let o=0;o<n;o++){const s=t[o],a=e?rt(o-1,n):Math.max(o-1,0),l=e?rt(o+1,n):Math.min(o+1,r),c=t[a],d=s,u=t[l];Zl(c,d,u),d.command=o===0?ie.move:ie.curve}}function Zl(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+=ct:l-=ct,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 ks(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 _g(t,e,n,r,o,s,a){const l=xt.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),m=new Ne(h,f);m.command=ie.line}}var Ql=Array.prototype.slice;function wg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var oe={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=Ql.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=Ql.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=!wg(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:Ue.performance&&Ue.performance.now?Ue.performance:Date},Yt={hasEventListeners:typeof Ue.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Yt},unbind:function(t,e,n,r){return Yt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Yt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=Ue.requestAnimationFrame;if(!n){for(let o=0;o<t.length;o++)n=Ue[t[o]+"RequestAnimationFrame"]||n;n=n||r}function r(o,s){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=Ue.setTimeout(d,l);e=a+l;function d(){o(a+l)}return c}return n}},Ki=Ue.document?Ue.document.createElement("div"):{};Ki.id="help-two-load",Object.defineProperty(Yt,"temp",{enumerable:!0,get:function(){return oe.isElement(Ki)&&!Ue.document.head.contains(Ki)&&(Ki.style.display="none",Ue.document.head.appendChild(Ki)),Ki}});var Dt=class extends Error{constructor(e){super(),B(this,"name","Two.js"),B(this,"message"),this.message=e}},xg=Ue.devicePixelRatio||1;function kg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function vs(t){return xg/kg(t)}var ro=class{constructor(){B(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}},kt,ii=class extends Array{constructor(){super(),zl(this,kt,new ee),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 zt(this,kt)}set _events(e){gg(this,kt,e)}get _bound(){return zt(this,kt)._bound}set _bound(e){zt(this,kt)._bound=e}addEventListener(){var e;return(e=zt(this,kt).addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=zt(this,kt).on)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=zt(this,kt).bind)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=zt(this,kt).removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=zt(this,kt).off)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=zt(this,kt).unbind)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=zt(this,kt).dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=zt(this,kt).trigger)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=zt(this,kt).listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=zt(this,kt).ignore)==null?void 0:e.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(ee.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(ee.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(ee.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(ee.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(ee.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ee.Types.insert,n),this.trigger(ee.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(ee.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ee.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}};kt=new WeakMap;var Jl=class Dh extends ee{constructor(){super(),B(this,"_flagId",!1),B(this,"_flagClassName",!1),B(this,"_renderer",{}),B(this,"_id",xt.Identifier+xt.uniqueId()),B(this,"_className",""),B(this,"classList",[]);for(let e in ec)Object.defineProperty(this,e,ec[e])}static fromObject(e){const n=new Dh().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(){if(typeof this.unbind=="function"&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const n=this.renderer.ctx;this._renderer.texture&&(n.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(n.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type==="CanvasRenderer"&&this._renderer.context&&delete this._renderer.context}const e=this._renderer.type;return this._renderer={type:e},this}};B(Jl,"Properties",["renderer","id","className"]);var Gi=Jl,ec={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)}}},oo,tc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ue.document&&(oo=document.createElement("a"));var cn=class Qt extends Gi{constructor(e,n){super(),B(this,"_flagSrc",!1),B(this,"_flagImage",!1),B(this,"_flagVideo",!1),B(this,"_flagLoaded",!1),B(this,"_flagRepeat",!1),B(this,"_flagOffset",!1),B(this,"_flagScale",!1),B(this,"_src",""),B(this,"_image",null),B(this,"_loaded",!1),B(this,"_repeat","no-repeat"),B(this,"_scale",1),B(this,"_offset",null);for(let r in nc)Object.defineProperty(this,r,nc[r]);if(this._renderer.type="texture",this._renderer.flagOffset=vg.bind(this),this._renderer.flagScale=Cg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new re,typeof n=="function"){const r=(function(){this.unbind(ee.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(ee.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 Qt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return oo?(oo.href=e,oo.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=Qt.getAbsoluteURL(e);if(Qt.ImageRegistry.contains(n))return Qt.ImageRegistry.get(n);let r;return Et.Image?(r=new Et.Image,Et.shim(r,"img")):Ue.document?tc.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=Qt.getTag(r);e._flagImage&&(/canvas/i.test(o)?Qt.Register.canvas(e,n):(e._src=!Et.isHeadless&&r.getAttribute("two-src")||r.src,Qt.Register[o](e,n))),e._flagSrc&&(r||(r=Qt.getImage(e.src),e.image=r),o=Qt.getTag(r),Qt.Register[o](e,n))}clone(){const e=new Qt(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(ee.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Qt.load(this,(function(){this.loaded=!0,this.trigger(ee.Types.change).trigger(ee.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}};B(cn,"Properties",["src","loaded","repeat","scale","offset","image"]),B(cn,"RegularExpressions",tc),B(cn,"ImageRegistry",new ro),B(cn,"Register",{canvas:function(t,e){t._src="#"+t.id,cn.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(s){!Et.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!Et.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",o,!1)),new Dt("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!Et.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",o,!1)),t._src=cn.getAbsoluteURL(t._src),!(!Et.isHeadless&&n&&n.getAttribute("two-src"))&&(Et.isHeadless||n.setAttribute("two-src",t.src),cn.ImageRegistry.add(t.src,n),Et.isHeadless?cn.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(Et.isHeadless)throw new Dt("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 Dt("unable to load "+t.src)};t._src=cn.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),cn.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=cn,nc={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(ee.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ee.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(ee.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof re&&this._scale.bind(ee.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function vg(){this._flagOffset=!0}function Cg(){this._flagScale=!0}var Cs=class bn extends Gi{constructor(e,n,r){super(),B(this,"_flagOffset",!0),B(this,"_flagOpacity",!0),B(this,"_flagColor",!0),B(this,"_offset",0),B(this,"_opacity",1),B(this,"_color","#fff");for(let o in ic)Object.defineProperty(this,o,ic[o]);this._renderer.type="stop",this.offset=typeof e=="number"?e:bn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:bn.Index<=0?"#fff":"#000",bn.Index=(bn.Index+1)%2}static fromObject(e){const n=new bn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<bn.Properties.length;n++){const r=bn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new bn;return oe.each(bn.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",oe.each(bn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};B(Cs,"Index",0),B(Cs,"Properties",["offset","opacity","color"]);var ri=Cs,ic={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)}}},Ss=class Di extends Gi{constructor(e){super(),B(this,"_flagStops",!1),B(this,"_flagSpread",!1),B(this,"_flagUnits",!1),B(this,"_spread",""),B(this,"_units","");for(let n in rc)Object.defineProperty(this,n,rc[n]);this._renderer.type="gradient",this._renderer.flagStops=Sg.bind(this),this._renderer.bindStops=Bg.bind(this),this._renderer.unbindStops=Tg.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 ri?o:new ri().copy(o)));const r=new Di(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(o=>o.clone()),r=new Di(n);return oe.each(Di.Properties,o=>{r[o]=this[o]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Di.Properties.length;n++){const r=Di.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return oe.each(Di.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ee.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}};B(Ss,"Stop",ri),B(Ss,"Properties",["spread","stops","units"]);var dt=Ss,rc={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(ee.Types.insert,e).unbind(ee.Types.remove,n),this._stops=new ii((t||[]).slice(0)),this._stops.bind(ee.Types.insert,e).bind(ee.Types.remove,n),e(this._stops)}}};function Sg(){this._flagStops=!0}function Bg(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Tg(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var Bs=class Kr extends dt{constructor(e,n,r,o,s){super(s),B(this,"_flagEndPoints",!1),B(this,"_left",null),B(this,"_right",null);for(let a in oc)Object.defineProperty(this,a,oc[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Ng.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 Kr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Kr.Properties.length;n++){const r=Kr.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 Kr(this.left._x,this.left._y,this.right._x,this.right._y,n);return oe.each(dt.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(ee.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};B(Bs,"Stop",ri),B(Bs,"Properties",["left","right"]);var Ke=Bs,oc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof re&&this._left.unbind(ee.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ee.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(ee.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ee.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Ng(){this._flagEndPoints=!0}var Ts=class Li extends dt{constructor(e,n,r,o,s,a){super(o),B(this,"_flagRadius",!1),B(this,"_flagCenter",!1),B(this,"_flagFocal",!1),B(this,"_radius",0),B(this,"_center",null),B(this,"_focal",null);for(let l in sc)Object.defineProperty(this,l,sc[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=$g.bind(this),this._renderer.flagFocal=Rg.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 Li().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Li.Properties.length;n++){const r=Li.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 Li(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return oe.each(dt.Properties.concat(Li.Properties),function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return oe.each(Li.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(ee.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};B(Ts,"Stop",ri),B(Ts,"Properties",["center","radius","focal"]);var Ge=Ts,sc={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(ee.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ee.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ee.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ee.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function $g(){this._flagCenter=!0}function Rg(){this._flagFocal=!0}function ac(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 so(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 lc(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),Yl(r,l,o,c,s,d,a,u,n)}function Ns(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),xs(r,l,o,c,s,d,a,u,n)}function _i(t){switch(t.renderer.type){case"texture":return Oe.fromObject(t);case"gradient":return dt.fromObject(t);case"linear-gradient":return Ke.fromObject(t);case"radial-gradient":return Ge.fromObject(t)}return t}var Eg=Math.cos,Pg=Math.sin,cc=Math.tan,$s=[],dc=class Jt extends ee{constructor(e,n,r,o,s,a){super(),B(this,"elements",new _n(9)),B(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 N=e;let w,S,v;const $=n[0]||0,E=n[1]||0,A=n[2]||0;return w=N[0]*$+N[1]*E+N[2]*A,S=N[3]*$+N[4]*E+N[5]*A,v=N[6]*$+N[7]*E+N[8]*A,[w,S,v]}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],m=n[0],p=n[1],g=n[2],y=n[3],b=n[4],_=n[5],k=n[6],x=n[7],C=n[8];return r=r||new _n(9),r[0]=o*m+s*y+a*k,r[1]=o*p+s*b+a*x,r[2]=o*g+s*_+a*C,r[3]=l*m+c*y+d*k,r[4]=l*p+c*b+d*x,r[5]=l*g+c*_+d*C,r[6]=u*m+h*y+f*k,r[7]=u*p+h*b+f*x,r[8]=u*g+h*_+f*C,r}static fromObject(e){return new Jt().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(ee.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(ee.Types.change)}identity(){return this.elements[0]=Jt.Identity[0],this.elements[1]=Jt.Identity[1],this.elements[2]=Jt.Identity[2],this.elements[3]=Jt.Identity[3],this.elements[4]=Jt.Identity[4],this.elements[5]=Jt.Identity[5],this.elements[6]=Jt.Identity[6],this.elements[7]=Jt.Identity[7],this.elements[8]=Jt.Identity[8],this.trigger(ee.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(ee.Types.change);if(typeof r>"u"&&(r=1),typeof o>"u"){e=e||0,n=n||0,r=r||0,s=this.elements;const F=s[0]*e+s[1]*n+s[2]*r,H=s[3]*e+s[4]*n+s[5]*r,Q=s[6]*e+s[7]*n+s[8]*r;return[F,H,Q]}const u=this.elements,h=[e,n,r,o,s,a,l,c,d],f=u[0],m=u[1],p=u[2],g=u[3],y=u[4],b=u[5],_=u[6],k=u[7],x=u[8],C=h[0],N=h[1],w=h[2],S=h[3],v=h[4],$=h[5],E=h[6],A=h[7],R=h[8];return this.elements[0]=f*C+m*S+p*E,this.elements[1]=f*N+m*v+p*A,this.elements[2]=f*w+m*$+p*R,this.elements[3]=g*C+y*S+b*E,this.elements[4]=g*N+y*v+b*A,this.elements[5]=g*w+y*$+b*R,this.elements[6]=_*C+k*S+x*E,this.elements[7]=_*N+k*v+x*A,this.elements[8]=_*w+k*$+x*R,this.trigger(ee.Types.change)}inverse(e){const n=this.elements;e=e||new Jt;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,m=-h*a+c*d,p=u*a-l*d;let g=r*f+o*m+s*p;return g?(g=1/g,e.elements[0]=f*g,e.elements[1]=(-h*o+s*u)*g,e.elements[2]=(c*o-s*l)*g,e.elements[3]=m*g,e.elements[4]=(h*r-s*d)*g,e.elements[5]=(-c*r+s*a)*g,e.elements[6]=p*g,e.elements[7]=(-u*r+o*d)*g,e.elements[8]=(l*r-o*a)*g,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=Eg(e),r=Pg(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=cc(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=cc(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return $s.length=0,this.toTransformArray(e,$s),$s.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],m=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]=m;return}return[s,c,h,a,d,f,l,u,m]}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],m=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]=m;return}return[s,a,l,c,d,u,h,f,m]}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 Jt().copy(this)}};B(dc,"Identity",[1,0,0,0,1,0,0,0,1]);var wi=dc;Wl(wi);var uc=class bl extends Gi{constructor(){super(),B(this,"_flagMatrix",!0),B(this,"_flagScale",!1),B(this,"_matrix",null),B(this,"_worldMatrix",null),B(this,"_position",null),B(this,"_rotation",0),B(this,"_scale",1),B(this,"_skewX",0),B(this,"_skewY",0);for(let e in ao)Object.defineProperty(this,e,ao[e]);this._renderer.flagMatrix=fc.bind(this),this.isShape=!0,this.matrix=new wi,this.worldMatrix=new wi,this.position=new re,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new bl().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 ao.position.get.apply(this,arguments)}set translation(e){ao.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(e,n,r){const o=r||{},s=o.ignoreVisibility===!0;if(!s&&"visible"in this&&this.visible===!1||!s&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const a=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const l=this.getBoundingClientRect();return l?e>=l.left-a&&e<=l.right+a&&n>=l.top-a&&n<=l.bottom+a:!1}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 bl;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}dispose(){super.dispose(),typeof this.translation=="object"&&typeof this.translation.unbind=="function"&&this.translation.unbind(),typeof this.scale=="object"&&typeof this.scale.unbind=="function"&&this.scale.unbind()}_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}};B(uc,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var On=uc,ao={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ee.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ee.Types.change,this._renderer.flagMatrix),fc.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(ee.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof re&&this._scale.bind(ee.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 _s(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function fc(){this._flagMatrix=!0}var hc=/^(?:none|transparent)$/i,Fg=8,Rs=Number.EPSILON;function zn(t,e){return{x:t,y:e}}function lo(t,e,n=Rs){return Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n}function mc(t,e,n,r){const o=t*n+e*r,s=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+r*r)||1e-12;let a=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*n<0&&(a=-a),a}function Vg(t,e,n){if(!t)return[zn(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[zn(e.x,e.y)];const s=(e.xAxisRotation||0)*Math.PI/180,a=e.largeArcFlag?1:0,l=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,h=e.y,f=(c-u)/2,m=(d-h)/2,p=Math.cos(s),g=Math.sin(s);let y=p*f+g*m,b=-g*f+p*m,_=r*r,k=o*o;const x=y*y/_+b*b/k;if(x>1){const P=Math.sqrt(x);r*=P,o*=P,_=r*r,k=o*o}const C=_*b*b+k*y*y,N=C===0?0:(_*k-C)/C;let w=Math.sqrt(Math.max(0,N));a===l&&(w=-w);const S=w*r*b/o,v=-w*o*y/r,$=p*S-g*v+(c+u)/2,E=g*S+p*v+(d+h)/2,A=mc(1,0,(y-S)/r,(b-v)/o),R=mc((y-S)/r,(b-v)/o,(-y-S)/r,(-b-v)/o)%et,F=A+R,H=l===0,Q=(()=>{const P=F-A,V=Math.abs(P)<Number.EPSILON;let M=rt(P,et);return M<Number.EPSILON&&(M=V?0:et),H&&!V&&(M=M===et?-et:M-et),M})(),Z=Math.max(xt.Resolution,Math.max(n*2,1)),O=[];for(let P=1;P<=Z;P++){const V=P/Z,M=A+V*Q;let L=$+r*Math.cos(M),Y=E+o*Math.sin(M);if(s!==0){const U=L-$,G=Y-E,q=Math.cos(s),W=Math.sin(s);L=U*q-G*W+$,Y=U*W+G*q+E}O.push(zn(L,Y))}return O}function Mg(t,e=Fg){const n=[],r=[],o=t._renderer&&t._renderer.vertices&&t._renderer.vertices.length>0?t._renderer.vertices:t.vertices;if(!o||o.length===0)return{polygons:n,segments:r};const s=Math.max(1,Math.floor(e));let a=null,l=null,c=null,d=null;const u=(f=!1)=>{if(a){if(f&&l&&c&&!lo(l,c)){const m=zn(l.x,l.y);r.push({a:c,b:m}),a.push(m),c=m}a.length>=3&&l&&c&&lo(l,c)&&n.push(a),a=null,l=null,c=null}},h=f=>{if(!c){c=f,a&&a.push(f);return}lo(c,f)||(r.push({a:c,b:f}),a&&a.push(f),c=f)};for(let f=0;f<o.length;f++){const m=o[f],p=m.command||(f===0?ie.move:ie.line);if(p===ie.move){u(!1);const g=zn(m.x,m.y);a=[g],l=g,c=g,d=m;continue}if(d||(d=o[Math.max(f-1,0)]),p===ie.line)h(zn(m.x,m.y));else if(p===ie.curve){const g=Ns(m,d,s);for(let y=1;y<g.length;y++){const b=g[y];h(zn(b.x,b.y))}h(zn(m.x,m.y))}else if(p===ie.arc){const g=Vg(d,m,s);for(let y=0;y<g.length;y++)h(g[y])}else if(p===ie.close){u(!0),d=m;continue}else h(zn(m.x,m.y));d=m}if(a){const f=!!t._closed||!!t.closed||l&&c&&!lo(l,c);u(f)}return{polygons:n,segments:r}}function Ag(t,e,n){let r=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.length<3)continue;let a=s.length-1;for(let l=0;l<s.length;l++){const c=s[a],d=s[l];d.y>n!=c.y>n&&e<(c.x-d.x)*(n-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function Ig(t,e,n,r){const o=r.x-n.x,s=r.y-n.y;if(Math.abs(o)<Rs&&Math.abs(s)<Rs){const f=t-n.x,m=e-n.y;return f*f+m*m}const a=((t-n.x)*o+(e-n.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=n.x+l*o,d=n.y+l*s,u=t-c,h=e-d;return u*u+h*h}function Og(t,e,n){if(!t||t.length===0)return 1/0;let r=1/0;for(let o=0;o<t.length;o++){const s=t[o],a=Ig(e,n,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function zg(t,e){if(typeof e=="boolean")return e;const n=t.fill;return!n&&n!==0?!1:typeof n=="string"?!hc.test(n):!0}function Dg(t,e){const n=typeof t.linewidth=="number"?t.linewidth:t._linewidth||0;if(typeof e=="boolean")return e&&n>0;if(!(n>0))return!1;const r=t.stroke;return!r&&r!==0?!1:typeof r=="string"?!hc.test(r):!0}function Lg(t,e,n,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,a=t.top-r,l=t.bottom+r;return e>=o&&e<=s&&n>=a&&n<=l}var co=Number.EPSILON;function uo(t){return typeof t.relative!="boolean"||!!t.relative}function dn(t,e,n,r){const o=t.controls;if(!(!o||!o[e])){if(Math.abs(n)<co&&Math.abs(r)<co){uo(t)?o[e].clear():o[e].set(t.x,t.y);return}uo(t)?o[e].set(n,r):o[e].set(t.x+n,t.y+r)}}function Lt(t,e){dn(t,e,0,0)}function Hg(t,e){const n=t.controls;return!n||!n[e]?{x:0,y:0}:uo(t)?{x:n[e].x,y:n[e].y}:{x:n[e].x-t.x,y:n[e].y-t.y}}function Zi(t,e){const n=Hg(t,e);return Math.abs(n.x)>co||Math.abs(n.y)>co}function fo(t){t.command===ie.move||t.command===ie.close||(t.command=Zi(t,"left")||Zi(t,"right")?ie.curve:ie.line)}function pc(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function Wg(t,e){return Zi(e,"right")||Zi(t,"left")||Zi(t,"right")||Zi(e,"left")||t.command===ie.curve||e.command===ie.curve}function Qi(t,e,n){return{x:Pt(t.x,e.x,n),y:Pt(t.y,e.y,n)}}function gc(t,e){const n=t.controls&&t.controls[e];return n?uo(t)?{x:t.x+n.x,y:t.y+n.y}:{x:n.x,y:n.y}:{x:t.x,y:t.y}}function jg(t,e,n){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},a=r?gc(t,"right"):Sr({},s),l={x:e.x,y:e.y},c=o?gc(e,"left"):Sr({},l),d=Qi(s,a,n),u=Qi(a,c,n),h=Qi(c,l,n),f=Qi(d,u,n),m=Qi(u,h,n),p=Qi(f,m,n),g=new Ne(p.x,p.y);return pc(g,t),dn(g,"left",f.x-p.x,f.y-p.y),dn(g,"right",m.x-p.x,m.y-p.y),g.command=ie.curve,{anchor:g,startOut:d,endIn:h}}function qg(t,e,n,r,o,s){const a=t.length,l=n-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,h=d;if(r||(u=Math.min(1,e),h=Math.min(1,a-n-1)),c+=u+h,c<=1)return;const f=new Array(c+1);for(let w=0,S=e-u;w<=c;w+=1,S+=1){const v=rt(S,a);f[w]=t[v]}let m=f[0].x+2*f[1].x,p=f[0].y+2*f[1].y,g=2;const y=c-1,b=[m],_=[p],k=[g],x=new Array(c+1),C=new Array(c+1);for(let w=1;w<c;w+=1){const S=w<y,v=S||s?1:2,$=S?4:s?2:7,E=S?4:s?3:8,A=S?2:s?0:1,R=v/g;g=k[w]=$-R,m=b[w]=E*f[w].x+A*f[w+1].x-R*m,p=_[w]=E*f[w].y+A*f[w+1].y-R*p}x[y]=b[y]/k[y],C[y]=_[y]/k[y];for(let w=c-2;w>=0;w-=1)x[w]=(b[w]-x[w+1])/k[w],C[w]=(_[w]-C[w+1])/k[w];x[c]=(3*f[c].x-x[y])/2,C[c]=(3*f[c].y-C[y])/2;const N=c-h;for(let w=u,S=e;w<=N;w+=1,S+=1){const v=rt(S,a),$=t[v],E=x[w]-$.x,A=C[w]-$.y;o||w<N?dn($,"right",E,A):Lt($,"right"),o||w>u?dn($,"left",-E,-A):Lt($,"left"),fo($)}}function Xg(t,e,n,r,o,s){const a=e||t,l=t,c=n||t,d=re.distanceBetween(a,l),u=re.distanceBetween(l,c),h=r===void 0?.5:r,f=Math.pow(d,h),m=Math.pow(u,h),p=f*f,g=m*m;if(!o&&e){const y=2*g+3*m*f+p,b=3*m*(m+f);if(b!==0){const _=(g*a.x+y*l.x-p*c.x)/b-l.x,k=(g*a.y+y*l.y-p*c.y)/b-l.y;dn(t,"left",_,k)}else Lt(t,"left")}else Lt(t,"left");if(!s&&n){const y=2*p+3*f*m+g,b=3*f*(f+m);if(b!==0){const _=(p*c.x+y*l.x-g*a.x)/b-l.x,k=(p*c.y+y*l.y-g*a.y)/b-l.y;dn(t,"right",_,k)}else Lt(t,"right")}else Lt(t,"right");fo(t)}function Yg(t,e,n,r,o,s){if(!(e&&n)){e||Lt(t,"left"),n||Lt(t,"right"),fo(t);return}const a=e,l=t,c=n,d=re.distanceBetween(a,l),u=re.distanceBetween(l,c),h=d+u,f=r===void 0?.4:r,m={x:a.x-c.x,y:a.y-c.y};if(!o&&h!==0){const p=f*d/h;dn(t,"left",m.x*p,m.y*p)}else Lt(t,"left");if(!s&&h!==0){const p=f*d/h-f;dn(t,"right",m.x*p,m.y*p)}else Lt(t,"right");fo(t)}function Ug(t,e,n,r,o,s){const a=s.type,l=s.factor,c=t.length;for(let d=e;d<=n;d+=1){const u=rt(d,c),h=t[u];if(h.command===ie.move){Lt(h,"left"),Lt(h,"right");continue}const f=d===e&&!o?null:d-1,m=d===n&&!o?null:d+1,p=f===null?null:t[rt(f,c)],g=m===null?null:t[rt(m,c)],y=f===null,b=m===null;a==="geometric"?Yg(h,p,g,l,y,b):Xg(h,p,g,l,y,b)}}var Ji=Math.min,er=Math.max,Kg=Math.ceil,Gg=Math.floor,Zg=new re,Qg=new wi,Es=class pi extends On{constructor(e,n,r,o){super(),B(this,"_flagVertices",!0),B(this,"_flagLength",!0),B(this,"_flagFill",!0),B(this,"_flagStroke",!0),B(this,"_flagLinewidth",!0),B(this,"_flagOpacity",!0),B(this,"_flagVisible",!0),B(this,"_flagCap",!0),B(this,"_flagJoin",!0),B(this,"_flagMiter",!0),B(this,"_flagStrokeAttenuation",!0),B(this,"_flagMask",!1),B(this,"_flagClip",!1),B(this,"_length",0),B(this,"_fill","#fff"),B(this,"_stroke","#000"),B(this,"_linewidth",1),B(this,"_opacity",1),B(this,"_visible",!0),B(this,"_cap","round"),B(this,"_join","round"),B(this,"_miter",4),B(this,"_closed",!0),B(this,"_curved",!1),B(this,"_automatic",!0),B(this,"_beginning",0),B(this,"_ending",1),B(this,"_mask",null),B(this,"_clip",!1),B(this,"_dashes",null),B(this,"_strokeAttenuation",!0);for(let s in yc)Object.defineProperty(this,s,yc[s]);this._renderer.type="path",this._renderer.flagVertices=bc.bind(this),this._renderer.bindVertices=_c.bind(this),this._renderer.unbindVertices=wc.bind(this),this._renderer.flagFill=xc.bind(this),this._renderer.flagStroke=kc.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:_i(e.fill),r=typeof e.stroke=="string"?e.stroke:_i(e.stroke),o=new pi().copy(bs(Sr({},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 Ne?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Ne().copy(r))}}for(let n=0;n<pi.Properties.length;n++){const r=pi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new pi;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<pi.Properties.length;r++){const o=pi.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()),oe.each(pi.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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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:m}=bi(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof f=="number"&&typeof m=="number"&&(r=Math.max(f,m)*(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,m]=n.multiply(a.x,a.y),[p,g]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let y=a.controls.right.x,b=a.controls.right.y;a.relative&&(y+=a.x,b+=a.y);let[_,k]=n.multiply(y,b),x=l.controls.left.x,C=l.controls.left.y;l.relative&&(x+=l.x,C+=l.y);let[N,w]=n.multiply(x,C);const S=Ul(f,m,_,k,N,w,p,g);u=Ji(S.min.y-r,u),c=Ji(S.min.x-r,c),d=er(S.max.x+r,d),h=er(S.max.y+r,h)}else s<=1&&(u=Ji(m-r,u),c=Ji(f-r,c),d=er(f+r,d),h=er(m+r,h)),u=Ji(g-r,u),c=Ji(p-r,c),d=er(p+r,d),h=er(g+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}contains(e,n,r){const o=r||{},s=o.ignoreVisibility===!0;if(!s&&this.visible===!1||!s&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const a=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const l=this.getBoundingClientRect();if(!l||e<l.left-a||e>l.right+a||n<l.top-a||n>l.bottom+a)return!1;const c=this.worldMatrix,d=c&&c.inverse(Qg);if(!d)return super.contains(e,n,o);const[u,h]=d.multiply(e,n,1),f=typeof o.precision=="number"&&!Number.isNaN(o.precision)?Math.max(1,Math.floor(o.precision)):8,m=zg(this,o.fill),p=Dg(this,o.stroke),{polygons:g,segments:y}=Mg(this,f);if(m&&g.length>0&&Ag(g,u,h))return!0;if(p&&y.length>0){const b=typeof this.linewidth=="number"?this.linewidth:0;if(b>0&&Og(y,u,h)<=b/2+a)return!0}return!m&&!p?super.contains(e,n,o):m&&g.length===0?super.contains(e,n,o):!1}getPointAt(e,n){let r,o,s,a,l,c,d,u,h,f,m,p,g,y,b,_=this.length*Math.min(Math.max(e,0),1);const k=this.vertices.length,x=k-1;let C=null,N=null;for(let Z=0,O=this._lengths.length,P=0;Z<O;Z++){if(P+this._lengths[Z]>=_){this._closed?(r=rt(Z,k),o=rt(Z-1,k),Z===0&&(r=o,o=Z)):(r=Z,o=Math.min(Math.max(Z-1,0),x)),C=this.vertices[r],N=this.vertices[o],_-=P,this._lengths[Z]!==0?e=_/this._lengths[Z]:e=0;break}P+=this._lengths[Z]}if(C===null||N===null)return null;if(C){if(!N)return C}else return N;b=N.controls&&N.controls.right,y=C.controls&&C.controls.left,l=N.x,f=N.y,c=(b||N).x,m=(b||N).y,d=(y||C).x,p=(y||C).y,u=C.x,g=C.y,b&&N.relative&&(c+=N.x,m+=N.y),y&&C.relative&&(d+=C.x,p+=C.y),a=Br(e,l,c,d,u),h=Br(e,f,m,p,g);const w=Pt(l,c,e),S=Pt(f,m,e),v=Pt(c,d,e),$=Pt(m,p,e),E=Pt(d,u,e),A=Pt(p,g,e),R=Pt(w,v,e),F=Pt(S,$,e),H=Pt(v,E,e),Q=Pt($,A,e);return oe.isObject(n)?(n.x=a,n.y=h,n instanceof Ne&&(n.controls.left.x=R,n.controls.left.y=F,n.controls.right.x=H,n.controls.right.y=Q,(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 Ne(a,h,R-a,F-h,H-a,Q-h,this._curved?ie.curve:ie.line),s.t=e,s)}plot(){if(this.curved)return Gl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ie.move:ie.line;return this}smooth(e){const n=e||{},r=n.type||"continuous",o=this._collection,s=o.length;if(s<2)return this;const a=this._closed||s>0&&o[s-1]&&o[s-1].command===ie.close,l=(f,m)=>{if(f==null)return m;if(typeof f=="number"){if(a)return rt(f,s);let g=f;return g<0&&(g+=s),Math.min(Math.max(g,0),s-1)}const p=o.indexOf(f);return p!==-1?p:m},c=a&&n.from===void 0&&n.to===void 0;let d=l(n.from,0),u=l(n.to,s-1);if(d>u)if(a)d-=s;else{const f=d;d=u,u=f}const h=u-d+1;for(let f=0;f<h;f+=1){const m=rt(d+f,s),p=o[m],g=!a&&m===0;p.command===ie.move&&!g&&(p.command=ie.line)}if(r==="continuous"||r==="asymmetric")qg(o,d,u,a,c,r==="asymmetric");else if(r==="catmull-rom"||r==="geometric"){const f={type:r,factor:n.factor};Ug(o,d,u,a,c,f)}else throw new Error(`Path.smooth does not support type "${r}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(e){this._update();const n=this.vertices,r=n.length;if(r<2)return this;const o=[];let s=null,a=null;for(let l=0;l<r;l+=1){const c=n[l];if(!s||c.command===ie.move){const u=c.clone();o.push(u),s=c,a=c;continue}if(Wg(c,s)){const h=Ns(c,s,e).length,f=o[o.length-1];let m=f.clone(),p=c.clone(),g=f,y=0;if(h<=1){const b=c.clone();o.push(b)}else{for(let _=1;_<h;_+=1){const k=_/h,x=1-y,C=x<=Number.EPSILON?k:(k-y)/x,N=jg(m,p,C);dn(g,"right",N.startOut.x-g.x,N.startOut.y-g.y);const w=N.anchor;o.push(w),g=w,m=w.clone(),y=k,dn(p,"left",N.endIn.x-p.x,N.endIn.y-p.y)}const b=c.clone();b.controls.left.copy(p.controls.left),o.push(b)}}else{const u=Ns(c,s,e);for(let f=1;f<u.length;f+=1){const m=u[f];pc(m,s),Lt(m,"left"),Lt(m,"right"),m.command=ie.line,o.push(m)}const h=c.clone();o.push(h)}s=c,c.command===ie.close&&(s=a)}return this._automatic=!1,this._curved=!1,this.vertices=o,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=[]),oe.each(this.vertices,function(l,c){if(c<=0||l.command===ie.move){s=l,this._lengths[c]=0;return}this._lengths[c]=lc(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=so(this,r*this._length),a=so(this,o*this._length),l=Kg(s),c=Gg(a);let d,u,h,f,m,p;for(this._renderer.vertices.length=0,p=0;p<e;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Ne),p>c&&!u?(m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,m),m.command=this._renderer.collection[p].command,this._renderer.vertices.push(m),u=m,h=this._collection[p-1],h&&h.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),h.relative?this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(re.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(h,1-m.t))):p>=l&&p<=c&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===c&&ac(this,o)?(u=m,!n&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===l&&ac(this,r)&&(d=m,d.command=ie.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(p=l-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(r,m),m.command=ie.move,this._renderer.vertices.unshift(m),f=this._collection[p+1],f&&f.controls&&(m.controls.left.clear(),f.relative?this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(re.zero,m.t):(Zg.copy(f),this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(f,m.t))))}return On.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,On.prototype.flagReset.call(this),this}};B(Es,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),B(Es,"Utils",{getCurveLength:lc});var Re=Es,yc={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 dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.bind(ee.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";oe.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(ee.Types.insert,e).unbind(ee.Types.remove,n),t instanceof ii?this._collection=t:this._collection=new ii(t||[]),this._collection.bind(ee.Types.insert,e).bind(ee.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,oe.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 bc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function _c(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function wc(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function xc(){this._flagFill=!0}function kc(){this._flagStroke=!0}var vc=class Gr extends Re{constructor(e,n,r,o){const s=[new Ne,new Ne,new Ne,new Ne];super(s,!0,!1,!0),B(this,"_flagWidth",!1),B(this,"_flagHeight",!1),B(this,"_width",0),B(this,"_height",0),B(this,"_origin",null),this._renderer.type="rectangle";for(let a in Cc)Object.defineProperty(this,a,Cc[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 Gr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Gr.Properties.length;n++){const r=Gr.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 Ne),this.vertices[0].set(-e,-n).sub(this._origin).command=ie.move,this.vertices[1].set(e,-n).sub(this._origin).command=ie.line,this.vertices[2].set(e,n).sub(this._origin).command=ie.line,this.vertices[3].set(-e,n).sub(this._origin).command=ie.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=ie.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Gr(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<Re.Properties.length;r++){const o=Re.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}};B(vc,"Properties",["width","height","origin"]);var oi=vc,Cc={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(ee.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ee.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Sc=class Zr extends oi{constructor(e,n,r,o,s,a){super(n,r,0,0),B(this,"_flagTexture",!1),B(this,"_flagColumns",!1),B(this,"_flagRows",!1),B(this,"_flagFrameRate",!1),B(this,"_flagIndex",!1),B(this,"_amount",1),B(this,"_duration",0),B(this,"_startTime",0),B(this,"_playing",!1),B(this,"_firstFrame",0),B(this,"_lastFrame",0),B(this,"_loop",!0),B(this,"_texture",null),B(this,"_columns",1),B(this,"_rows",1),B(this,"_frameRate",0),B(this,"_index",0),B(this,"_origin",null),this._renderer.type="sprite";for(let l in Bc)Object.defineProperty(this,l,Bc[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 Zr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Zr.Properties.length;n++){const r=Zr.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=oe.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 Zr(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&&(oe.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=oe.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=Pt(this._firstFrame,f,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%n,p=Math.floor(this._index/n),g=-o*m+(u-o)/2,y=-s*p+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),y!==e.offset.y&&(e.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};B(Sc,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var ho=Sc,Bc={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}}},Ps,Tc=class extends ii{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),zl(this,Ps,{}),this.attach(e),this.on(ee.Types.insert,this.attach),this.on(ee.Types.remove,this.detach)}get ids(){return zt(this,Ps)}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}};Ps=new WeakMap;var Nc=class Hi extends Re{constructor(e,n,r,o,s,a,l){const c=l||xt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new Ne);super(d,!0,!1,!0),B(this,"_flagStartAngle",!1),B(this,"_flagEndAngle",!1),B(this,"_flagInnerRadius",!1),B(this,"_flagOuterRadius",!1),B(this,"_startAngle",0),B(this,"_endAngle",et),B(this,"_innerRadius",0),B(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in $c)Object.defineProperty(this,u,$c[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 Hi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Hi.Properties.length;n++){const r=Hi.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=rt(e,et)===rt(n,et),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,f,m,p,g,y,b,_,k;for(s?c--:a||(c-=2),h=0,f=c-1;h<c;h++){switch(m=h/f,p=l[u],g=m*(n-e)+e,y=(n-e)/c,b=o*Math.cos(g),_=o*Math.sin(g),h){case 0:d=ie.move;break;default:d=ie.curve}p.command=d,p.x=b,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===ie.curve&&(k=o*y/Math.PI,p.controls.left.x=k*Math.cos(g-ct),p.controls.left.y=k*Math.sin(g-ct),p.controls.right.x=k*Math.cos(g+ct),p.controls.right.y=k*Math.sin(g+ct),h===1&&p.controls.left.multiplyScalar(2),h===f&&p.controls.right.multiplyScalar(2)),u++}if(a){for(s?(l[u].command=ie.close,u++):(c--,f=c-1),h=0;h<c;h++)m=h/f,p=l[u],g=(1-m)*(n-e)+e,y=(n-e)/c,b=r*Math.cos(g),_=r*Math.sin(g),d=ie.curve,h<=0&&(d=s?ie.move:ie.line),p.command=d,p.x=b,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===ie.curve&&(k=r*y/Math.PI,p.controls.left.x=k*Math.cos(g+ct),p.controls.left.y=k*Math.sin(g+ct),p.controls.right.x=k*Math.cos(g-ct),p.controls.right.y=k*Math.sin(g-ct),h===1&&p.controls.left.multiplyScalar(2),h===f&&p.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=ie.line}else s||(l[u].command=ie.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[u].command=ie.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 Hi(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<Re.Properties.length;c++){const d=Re.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<Hi.Properties.length;n++){const r=Hi.Properties[n];e[r]=this[r]}return e}};B(Nc,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Fs=Nc,$c={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}}},Vs=Math.cos,Ms=Math.sin,Rc=class Wi extends Re{constructor(e,n,r,o){const s=o?Math.max(o,2):4,a=[];for(let l=0;l<s;l++)a.push(new Ne(0,0,0,0,0,0));super(a,!0,!0,!0),B(this,"_flagRadius",!1),B(this,"_radius",0),this._renderer.type="circle";for(let l in Ec)Object.defineProperty(this,l,Ec[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 Wi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Wi.Properties.length;n++){const r=Wi.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*et,c=r*Vs(l),d=r*Ms(l),u=o*Vs(l-ct),h=o*Ms(l-ct),f=o*Vs(l+ct),m=o*Ms(l+ct),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,h),p.controls.right.set(f,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Wi(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<Re.Properties.length;r++){const o=Re.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<Wi.Properties.length;n++){const r=Wi.Properties[n];e[r]=this[r]}return e}};B(Rc,"Properties",["radius"]);var mo=Rc,Ec={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},As=Math.cos,Is=Math.sin,Pc=class ji extends Re{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 Ne);super(l,!0,!0,!0),B(this,"_flagWidth",!1),B(this,"_flagHeight",!1),B(this,"_width",0),B(this,"_height",0),this._renderer.type="ellipse";for(let c in Fc)Object.defineProperty(this,c,Fc[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 ji().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<ji.Properties.length;n++){const r=ji.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*et,c=r*As(l),d=o*Is(l),u=r*n*As(l-ct),h=o*n*Is(l-ct),f=r*n*As(l+ct),m=o*n*Is(l+ct),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,h),p.controls.right.set(f,m)}}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 ji(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<Re.Properties.length;a++){const l=Re.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<ji.Properties.length;n++){const r=ji.Properties[n];e[r]=this[r]}return e}};B(Pc,"Properties",["width","height"]);var po=Pc,Fc={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}}},Jg=Math.ceil,ey=Math.floor,Vc=class gi extends On{constructor(e){super(),B(this,"_flagVertices",!0),B(this,"_flagLength",!0),B(this,"_flagFill",!0),B(this,"_flagStroke",!0),B(this,"_flagLinewidth",!0),B(this,"_flagOpacity",!0),B(this,"_flagVisible",!0),B(this,"_flagSize",!0),B(this,"_flagSizeAttenuation",!0),B(this,"_flagStrokeAttenuation",!0),B(this,"_length",0),B(this,"_fill","#fff"),B(this,"_stroke","#000"),B(this,"_linewidth",1),B(this,"_opacity",1),B(this,"_visible",!0),B(this,"_size",1),B(this,"_sizeAttenuation",!1),B(this,"_beginning",0),B(this,"_ending",1),B(this,"_dashes",null),B(this,"_strokeAttenuation",!0),B(this,"noFill",Re.prototype.noFill),B(this,"noStroke",Re.prototype.noStroke),B(this,"corner",Re.prototype.corner),B(this,"center",Re.prototype.center),B(this,"getBoundingClientRect",Re.prototype.getBoundingClientRect),B(this,"_updateLength",Re.prototype._updateLength);for(let n in Mc)Object.defineProperty(this,n,Mc[n]);this._renderer.type="points",this._renderer.flagVertices=bc.bind(this),this._renderer.bindVertices=_c.bind(this),this._renderer.unbindVertices=wc.bind(this),this._renderer.flagFill=xc.bind(this),this._renderer.flagStroke=kc.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:_i(e.fill),r=typeof e.stroke=="string"?e.stroke:_i(e.stroke),o=new gi().copy(bs(Sr({},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 Ne?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Ne().copy(r))}for(let n=0;n<gi.Properties.length;n++){const r=gi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new gi;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<gi.Properties.length;r++){const o=gi.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()),oe.each(gi.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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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=xs(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=so(this,e*this._length),o=so(this,n*this._length),s=Jg(r),a=ey(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}};B(Vc,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var Os=Vc,Mc={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 dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.bind(ee.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(ee.Types.insert,e).unbind(ee.Types.remove,n),t instanceof ii?this._collection=t:this._collection=new ii(t||[]),this._collection.bind(ee.Types.insert,e).bind(ee.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}}},ty=Math.cos,ny=Math.sin,Ac=class qi extends Re{constructor(e,n,r,o){o=Math.max(o||0,3),super(),B(this,"_flagWidth",!1),B(this,"_flagHeight",!1),B(this,"_flagSides",!1),B(this,"_radius",0),B(this,"_width",0),B(this,"_height",0),B(this,"_sides",0),this._renderer.type="polygon";for(let s in Ic)Object.defineProperty(this,s,Ic[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 qi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<qi.Properties.length;n++){const r=qi.Properties[n];r in e&&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=et*s+Math.PI/2,l=this._width*ty(a)/2,c=this._height*ny(a)/2;o>=r?this.vertices.push(new Ne(l,c)):this.vertices[o].set(l,c),this.vertices[o].command=o===0?ie.move:ie.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 qi(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<Re.Properties.length;r++){const o=Re.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<qi.Properties.length;n++){const r=qi.Properties[n];e[r]=this[r]}return e}};B(Ac,"Properties",["width","height","sides"]);var zs=Ac,Ic={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}}},Oc=class Xi extends Re{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 Ne(0,0,0,0,0,0,l===0?ie.move:ie.curve));super(a),B(this,"_flagWidth",!1),B(this,"_flagHeight",!1),B(this,"_flagRadius",!1),B(this,"_width",0),B(this,"_height",0),B(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in zc)Object.defineProperty(this,l,zc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=iy.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 Xi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Xi.Properties.length;n++){const r=Xi.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 Xi(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<Re.Properties.length;a++){const l=Re.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<Xi.Properties.length;n++){const r=Xi.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};B(Oc,"Properties",["width","height","radius"]);var go=Oc,zc={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(ee.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof re&&this._radius.bind(ee.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function iy(){this._flagRadius=!0}var ry=Math.cos,oy=Math.sin,Dc=class Yi extends Re{constructor(e,n,r,o,s){arguments.length<=3&&(o=r,r=o/2),(typeof s!="number"||s<=0)&&(s=5),super(),B(this,"_flagInnerRadius",!1),B(this,"_flagOuterRadius",!1),B(this,"_flagSides",!1),B(this,"_innerRadius",0),B(this,"_outerRadius",0),B(this,"_sides",0),this._renderer.type="star";for(let a in Lc)Object.defineProperty(this,a,Lc[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 Yi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Yi.Properties.length;n++){const r=Yi.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=et*s,l=(o%2?this._outerRadius:this._innerRadius)/2,c=l*ry(a),d=l*oy(a);o>=r?this.vertices.push(new Ne(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?ie.move:ie.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 Yi(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<Re.Properties.length;a++){const l=Re.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<Yi.Properties.length;n++){const r=Yi.Properties[n];e[r]=this[r]}return e}};B(Dc,"Properties",["innerRadius","outerRadius","sides"]);var Ds=Dc,Lc={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}}},Ls,Hc=Math.min,Wc=Math.max;Ue.document&&(Ls=document.createElement("canvas"));var Hs=class en extends On{constructor(e,n,r,o){super(),B(this,"_flagValue",!0),B(this,"_flagFamily",!0),B(this,"_flagSize",!0),B(this,"_flagLeading",!0),B(this,"_flagAlignment",!0),B(this,"_flagBaseline",!0),B(this,"_flagStyle",!0),B(this,"_flagWeight",!0),B(this,"_flagDecoration",!0),B(this,"_flagFill",!0),B(this,"_flagStroke",!0),B(this,"_flagLinewidth",!0),B(this,"_flagOpacity",!0),B(this,"_flagVisible",!0),B(this,"_flagMask",!1),B(this,"_flagClip",!1),B(this,"_flagDirection",!0),B(this,"_flagStrokeAttenuation",!0),B(this,"_value",""),B(this,"_family","sans-serif"),B(this,"_size",13),B(this,"_leading",17),B(this,"_alignment","center"),B(this,"_baseline","middle"),B(this,"_style","normal"),B(this,"_weight",500),B(this,"_decoration","none"),B(this,"_direction","ltr"),B(this,"_fill","#000"),B(this,"_stroke","none"),B(this,"_linewidth",1),B(this,"_opacity",1),B(this,"_visible",!0),B(this,"_mask",null),B(this,"_clip",!1),B(this,"_dashes",null),B(this,"_strokeAttenuation",!0);for(let s in jc)Object.defineProperty(this,s,jc[s]);if(this._renderer.type="text",this._renderer.flagFill=sy.bind(this),this._renderer.flagStroke=ay.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,!oe.isObject(o))return this;for(let s=0;s<en.Properties.length;s++){const a=en.Properties[s];a in o&&(this[a]=o[a])}}static Measure(e){if(Ls){const n=Ls.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*en.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:_i(e.fill),r=typeof e.stroke=="string"?e.stroke:_i(e.stroke),o=new en().copy(bs(Sr({},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<en.Properties.length;n++){const r=en.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new en(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<en.Properties.length;r++){const o=en.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<en.Properties.length;n++){const r=en.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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}=en.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,m]=n.multiply(r,a),[p,g]=n.multiply(o,s),[y,b]=n.multiply(o,a);return s=Hc(h,m,g,b),r=Hc(u,f,p,y),o=Wc(u,f,p,y),a=Wc(h,m,g,b),{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}};B(Hs,"Ratio",.6),B(Hs,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var xn=Hs,jc={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 dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.bind(ee.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,oe.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 sy(){this._flagFill=!0}function ay(){this._flagStroke=!0}var Ws=class yr extends oi{constructor(e,n,r,o){super(n,r,0,0),B(this,"_flagTextures",!1),B(this,"_flagFrameRate",!1),B(this,"_flagIndex",!1),B(this,"_amount",1),B(this,"_duration",0),B(this,"_index",0),B(this,"_startTime",0),B(this,"_playing",!1),B(this,"_firstFrame",0),B(this,"_lastFrame",0),B(this,"_loop",!0),B(this,"_textures",null),B(this,"_frameRate",0),B(this,"_origin",null),this._renderer.type="image-sequence";for(let s in qc)Object.defineProperty(this,s,qc[s]);this._renderer.flagTextures=ly.bind(this),this._renderer.bindTextures=cy.bind(this),this._renderer.unbindTextures=dy.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(Xc.bind(this)):typeof e=="string"&&(this.textures=[Xc(e)]),this.origin=new re,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=yr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new yr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<yr.Properties.length;n++){const r=yr.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=oe.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 yr(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,oe.isNaN(this._lastFrame)&&(this._lastFrame=s-1),o=oe.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=Pt(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}};B(Ws,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),B(Ws,"DefaultFrameRate",30);var js=Ws,qc={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(ee.Types.insert,e).unbind(ee.Types.remove,n),this._textures=new ii((t||[]).slice(0)),this._textures.bind(ee.Types.insert,e).bind(ee.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 ly(){this._flagTextures=!0}function cy(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function dy(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Xc(t){if(t instanceof Oe)return t;if(typeof t=="string")return new Oe(t)}var yo=Math.min,bo=Math.max,uy={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},qs=class an extends On{constructor(e){super(),B(this,"_flagAdditions",!1),B(this,"_flagSubtractions",!1),B(this,"_flagOrder",!1),B(this,"_flagOpacity",!0),B(this,"_flagBeginning",!1),B(this,"_flagEnding",!1),B(this,"_flagLength",!1),B(this,"_flagMask",!1),B(this,"_fill","#fff"),B(this,"_stroke","#000"),B(this,"_linewidth",1),B(this,"_opacity",1),B(this,"_visible",!0),B(this,"_cap","round"),B(this,"_join","round"),B(this,"_miter",4),B(this,"_closed",!0),B(this,"_curved",!1),B(this,"_automatic",!0),B(this,"_beginning",0),B(this,"_ending",1),B(this,"_length",0),B(this,"_mask",null),B(this,"_strokeAttenuation",!0);for(let n in Yc)Object.defineProperty(this,n,Yc[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++)Uc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)Uc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new an;for(let o=0;o<an.Properties.length;o++){const s=an.Properties[o];s in e&&(/(fill|stroke)/i.test(s)?n[s]=typeof e[s]=="string"?e[s]:_i(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 Fs.fromObject(o);case"circle":return mo.fromObject(o);case"element":return Gi.fromObject(o);case"ellipse":return po.fromObject(o);case"group":return an.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return js.fromObject(o);case"path":return Re.fromObject(o);case"points":return Os.fromObject(o);case"polygon":return zs.fromObject(o);case"rectangle":return oi.fromObject(o);case"rounded-rectangle":return go.fromObject(o);case"shape":return On.fromObject(o);case"sprite":return ho.fromObject(o);case"star":return Ds.fromObject(o);case"text":return xn.fromObject(o)}return o}}static IsVisible(e,n){if(!n)return!0;let r=e;for(;r;){if(typeof r.visible=="boolean"&&!r.visible||typeof r.opacity=="number"&&r.opacity<=0)return!1;r=r.parent}return!0}static VisitForHitTest(e,n,r,o,s,a,l){const c=e&&e.children;if(!c)return!1;const d=n.results;for(let u=c.length-1;u>=0;u--){const h=c[u];if(!h||!an.IsVisible(h,n.visibleOnly))continue;const f=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null;if(!(f&&!Lg(f,n.x,n.y,a))){if(h instanceof an){if(r&&(!o||o(h))&&typeof h.contains=="function"&&h.contains(n.x,n.y,s)&&(d.push(h),l)||an.VisitForHitTest(h,n,r,o,s,a,l))return!0;continue}if(h instanceof On&&!(o&&!o(h))&&typeof h.contains=="function"&&h.contains(n.x,n.y,s)&&(d.push(h),l))return!0}}return!1}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<an.Properties.length;n++){const r=an.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new an,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,oe.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}getShapesAtPoint(e,n,r){const o=r||{},{results:s,hitOptions:a,context:l,single:c,empty:d}=uy.getShapesAtPoint;s.length=0;const u=o.mode==="deepest"||o.deepest?"deepest":"all",h=o.visibleOnly!==!1,f=!!o.includeGroups,m=typeof o.filter=="function"?o.filter:null,p=typeof o.tolerance=="number"?o.tolerance:0;typeof o.precision=="number"?a.precision=o.precision:delete a.precision,typeof o.fill<"u"?a.fill=o.fill:delete a.fill,typeof o.stroke<"u"?a.stroke=o.stroke:delete a.stroke,a.tolerance=p,a.ignoreVisibility=!h;const g=u==="deepest";if(l.x=e,l.y=n,l.visibleOnly=h,l.results=s,an.VisitForHitTest(this,l,f,m,a,p,g),g){if(s.length>0){const b=s[0];return s.length=0,c[0]=b,c.length=1,c}return d.length=0,d}const y=s.slice();return s.length=0,y}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 m=0;m<this.children.length;m++){const p=this.children[m];if(!(!p.visible||f.test(p._renderer.type))&&(n=p.getBoundingClientRect(e),o=typeof n.top!="number"||oe.isNaN(n.top)||!isFinite(n.top),s=typeof n.left!="number"||oe.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||oe.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||oe.isNaN(n.bottom)||!isFinite(n.bottom),!(o||s||a||l)))if(e){const[g,y]=r.multiply(n.left,n.top),[b,_]=r.multiply(n.right,n.top),[k,x]=r.multiply(n.left,n.bottom),[C,N]=r.multiply(n.right,n.bottom);u=yo(y,_,x,N,u),c=yo(g,b,k,C,c),d=bo(g,b,k,C,d),h=bo(y,_,x,N,h)}else u=yo(n.top,u),c=yo(n.left,c),d=bo(n.right,d),h=bo(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}};B(qs,"Children",Tc),B(qs,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var mt=qs,Yc={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=mt.InsertChildren.bind(this),n=mt.RemoveChildren.bind(this),r=mt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Tc(t),this._children.bind(ee.Types.insert,e),this._children.bind(ee.Types.remove,n),this._children.bind(ee.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,oe.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 Uc(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 _o=class extends Re{constructor(e,n,r,o){const s=[new Ne(e,n),new Ne(r,o)];super(s);for(let a in Kc)Object.defineProperty(this,a,Kc[a]);this.vertices[0].command=ie.move,this.vertices[1].command=ie.line,this.automatic=!1}};B(_o,"Properties",["left","right"]);var Kc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(oe.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ie.move;else{const e=new Dt("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(oe.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ie.line;else{const e=new Dt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},kn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},fy={start:"left",middle:"center",end:"right"},Gc=["id","class","transform","xmlns","viewBox"],hy=["x","y","width","height","href","xlink:href"];function my(t){return fy[t]}function py(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function Tr(t){return t.replace(/svg:/gi,"").toLowerCase()}function Zc(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 gy(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 yy(t){const e={},n=by(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 by(t){const e=t.getAttributeNames();for(let n=0;n<Gc.length;n++){const r=Gc[n],o=Array.prototype.indexOf.call(e,r);o>=0&&e.splice(o,1)}return e}function _y(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 oi(0,0,s,a),t.mask.origin.set(-s/2,-a/2),t}function tn(t,e,n){const r={},o={},s={};let a,l,c,d,u,h,f,m,p,g,y,b,_,k,x,C,N;if(t===null)return r;if(Ue.getComputedStyle){const w=Ue.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)?gy(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&&oe.defaults(r,n),oe.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=bi(l),e._renderer.type){case"linear-gradient":Zc(f,e.left),Zc(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=bi(l),e.translation.set(f.translateX,f.translateY),e.rotation=Math.PI*(f.rotation/180),e.scale=new re(f.scaleX,f.scaleY),m=parseFloat((r.x+"").replace("px")),p=parseFloat((r.y+"").replace("px")),m&&(e.translation.x=m),p&&(e.translation.y=p);break;case"visible":if(e instanceof mt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof mt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof mt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof mt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof mt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof mt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(kn.cssBackgroundImage.test(d)&&(g=d.replace(kn.cssBackgroundImage,"$1"),Ye.defs.current&&Ye.defs.current.contains(g)&&(b=Ye.defs.current.get(g),b&&b.childNodes.length>0)))switch(b=b.childNodes[0],_=Tr(b.nodeName),e.mask=Ye[_].call(this,b,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":u=(e instanceof mt?"_":"")+c,kn.cssBackgroundImage.test(d)?(g=d.replace(kn.cssBackgroundImage,"$1"),Ye.defs.current&&Ye.defs.current.contains(g)?(b=Ye.defs.current.get(g),b.object||(_=Tr(b.nodeName),b.object=Ye[_].call(this,b,{})),b=b.object):(y=xy(this),b=y.getById(g)),e[u]=b):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(k=e instanceof dt,x=e instanceof Ke,C=e instanceof Ge,k||x||C)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(N=new Dt("only pixel values are supported with the "+c+" attribute."),console.warn(N.name,N.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof xn&&(e.family=d);break;case"font-size":e instanceof xn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(N=new Dt("only pixel values are supported with the "+c+" attribute."),console.warn(N.name,N.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof xn&&(e.weight=d);break;case"font-style":e instanceof xn&&(e.style=d);break;case"text-decoration":e instanceof xn&&(e.decoration=d);break;case"line-height":e instanceof xn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function wy(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const o=t.childNodes[n];!o.id||Tr(t.nodeName)==="#text"||e.add(o.id,o)}}function xy(t){for(;t.parent;)t=t.parent;return t.scene}var Ye={svg:function(t){const e=Ye.defs.current=new ro,n=t.getElementsByTagName("defs");for(let p=0;p<n.length;p++)wy(n[p],e);const r=Ye.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,m=c!==null;return u&&(r.x=parseFloat(s.replace(kn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(kn.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(kn.unitSuffix,""))),m&&(r.height=parseFloat(c.replace(kn.unitSuffix,""))),d&&_y(r,o),delete Ye.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 Dt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const o=r.slice(1);if(!Ye.defs.current.contains(o))return n=new Dt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=Ye.defs.current.get(o).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=hy.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=Tr(a.nodeName);return Ye[l].call(this,a,e)},g:function(t,e){const n=new mt;tn.call(this,t,n,e),this.add(n);const r=yy.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=Tr(l);if(c in Ye){const d=Ye[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 Ne(parseFloat(a),parseFloat(l)))});const o=new Re(r,!0);return o.stroke="none",o.fill="black",tn.call(this,t,o,e),o},polyline:function(t,e){const n=Ye.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 Ne,c,d,u=n.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;oe.each(u.slice(0),function(f,m){const p=f.slice(1).trim().match(kn.path),g=f[0],y=g.toLowerCase();let b,_,k,x,C;const N=[];switch(m===0&&(u=[]),y){case"h":case"v":p.length>1&&(b=1);break;case"m":case"l":case"t":p.length>2&&(b=2);break;case"s":case"q":p.length>4&&(b=4);break;case"c":p.length>6&&(b=6);break;case"a":p.length>7&&(b=7);break}if(b){for(_=0,k=p.length,C=0;_<k;_+=b){if(x=g,C>0)switch(g){case"m":x="l";break;case"M":x="L";break}N.push(x+p.slice(_,_+b).join(" ")),C++}u=Array.prototype.concat.apply(u,N)}else u.push(f)}),oe.each(u,function(f,m){let p,g,y;const b=f[0],_=b.toLowerCase();d=f.slice(1).trim().match(kn.path),s=b===_;let k,x,C,N,w,S,v,$,E,A,R,F,H,Q,Z,O,P;switch(_){case"z":if(m>=h)o=!0;else{g=l.x,y=l.y,p=new Ne(g,y,void 0,void 0,void 0,void 0,ie.close);for(let V=r.length-1;V>=0;V--){const M=r[V];if(/m/i.test(M.command)){l=M;break}}}break;case"m":case"l":c=void 0,g=parseFloat(d[0]),y=parseFloat(d[1]),p=new Ne(g,y,void 0,void 0,void 0,void 0,/m/i.test(_)?ie.move:ie.line),s&&p.addSelf(l),l=p;break;case"h":case"v":A=/h/i.test(_)?"x":"y",R=/x/i.test(A)?"y":"x",p=new Ne(void 0,void 0,void 0,void 0,void 0,void 0,ie.line),p[A]=parseFloat(d[0]),p[R]=l[R],s&&(p[A]+=l[A]),l=p;break;case"c":case"s":k=l.x,x=l.y,c||(c=new re),/c/i.test(_)?(C=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[2]),S=parseFloat(d[3]),v=parseFloat(d[4]),$=parseFloat(d[5])):(E=ks(l,c,s),C=E.x,N=E.y,w=parseFloat(d[0]),S=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3])),s&&(C+=k,N+=x,w+=k,S+=x,v+=k,$+=x),l.controls.right.set(C-l.x,N-l.y),p=new Ne(v,$,w-v,S-$,void 0,void 0,ie.curve),l=p,c=p.controls.left;break;case"t":case"q":k=l.x,x=l.y,c||(c=new re),/q/i.test(_)?(C=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[0]),S=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3])):(E=ks(l,c,s),C=E.x,N=E.y,w=E.x,S=E.y,v=parseFloat(d[0]),$=parseFloat(d[1])),s&&(C+=k,N+=x,w+=k,S+=x,v+=k,$+=x),l.controls.right.set((C-l.x)*.33,(N-l.y)*.33),p=new Ne(v,$,w-v,S-$,void 0,void 0,ie.curve),l=p,c=p.controls.left;break;case"a":k=l.x,x=l.y,H=parseFloat(d[0]),Q=parseFloat(d[1]),Z=parseFloat(d[2]),O=parseFloat(d[3]),P=parseFloat(d[4]),v=parseFloat(d[5]),$=parseFloat(d[6]),s&&(v+=k,$+=x),F=new Ne(v,$),F.command=ie.arc,F.rx=H,F.ry=Q,F.xAxisRotation=Z,F.largeArcFlag=O,F.sweepFlag=P,p=F,l=F,c=void 0;break}p&&(Array.isArray(p)?r=r.concat(p):r.push(p))})}n=new Re(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},oe.each(n.vertices,function(l){l.subSelf(a.centroid)}),tn.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 mo(0,0,o);return s.stroke="none",s.fill="black",tn.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 po(0,0,o,s);return a.stroke="none",a.fill="black",tn.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(!oe.isNaN(n)||!oe.isNaN(r))return Ye["rounded-rect"](t);const o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=o/2,l=s/2,c=new oi(0,0,o,s);return c.stroke="none",c.fill="black",tn.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 go(0,0,o,s,c);return d.stroke="none",d.fill="black",tn.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 _o(n,r,o,s).noFill();return tn.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 m=t.children[f];let p=m.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let g=m.getAttribute("stop-color"),y=m.getAttribute("stop-opacity"),b=m.getAttribute("style"),_;g===null&&(_=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,g=_&&_.length>1?_[1]:void 0),y===null?(_=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=_&&_.length>1?parseFloat(_[1]):1):y=parseFloat(y),u.push(new ri(p,g,y))}const h=new Ke(o,s,a,l,u);return h.spread=r,h.units=n,tn.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"));oe.isNaN(l)&&(l=o),oe.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 m=0;m<t.children.length;m++){const p=t.children[m];let g=p.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let y=p.getAttribute("stop-color"),b=p.getAttribute("stop-opacity"),_=p.getAttribute("style"),k;y===null&&(k=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=k&&k.length>1?k[1]:void 0),b===null?(k=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=k&&k.length>1?parseFloat(k[1]):1):b=parseFloat(b),h.push(new ri(g,y,b))}const f=new Ge(o,s,a,h,l,c);return f.spread=r,f.units=n,tn.call(this,t,f,e),f},text:function(t,e){const n=my(t.getAttribute("text-anchor"))||"left",r=py(t)||"baseline";let o="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?o=t.childNodes[0].textContent:o=t.textContent;const s=new xn(o);return tn.call(this,t,s,e),s.alignment=n,s.baseline=r,s},clippath:function(t,e){return Ye.defs.current&&!Ye.defs.current.contains(t.id)&&Ye.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 Dt("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 ho(r,o,s);return oe.isNaN(a)||(c.width=a),oe.isNaN(l)||(c.height=l),tn.call(this,t,c,e),c}};function Qc(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 Mn extends oi{constructor(e,n,r,o,s,a){super(n,r,o||1,s||1),B(this,"_flagTexture",!1),B(this,"_flagMode",!1),B(this,"_texture",null),B(this,"_mode","fill"),this._renderer.type="image";for(let l in ed)Object.defineProperty(this,l,ed[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 Mn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mn.Properties.length;n++){const r=Mn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Mn(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 Mn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Mn.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 Mn.Modes.crop:break;case Mn.Modes.tile:{e.offset.x=(n-o)/2,e.offset.y=(r-s)/2,e.repeat="repeat";break}case Mn.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}};B(Xs,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),B(Xs,"Properties",["texture","mode"]);var Jc=Xs,ed={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}}},Ys=[],Us=Math.max,ky=Math.min,td=Math.abs,wo=Math.sin,xo=Math.cos,vy=Math.acos,ko=Math.sqrt,Pe={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 Pe?t:"path"},group:{renderChild:function(t){const e=Pe.getRendererType(t._renderer.type);Pe[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;oe.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=vo(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=Pe.getRendererType(r._renderer.type);Pe[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=Pe.getRendererType(l._renderer.type);Pe[c].render.call(l,t)}return s&&t.restore(),oe.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,m,p,g,y,b,_,k,x,C,N,w,S,v,$,E,A,R,F,H,Q,Z,O,P,V;if(V=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,H=this._mask,Q=this._clip,l=this._opacity*(V||1),c=this._visible,!e&&(!c||Q||l===0))return this;if(oe.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,m=this._renderer.vertices,p=m.length,g=p-1,Z=vo(r),P=this.dashes,Z||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),H){const K=Pe.getRendererType(H._renderer.type);Pe[K].render.call(H,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const K=Pe.getRendererType(a._renderer.type);Pe[K].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const K=Pe.getRendererType(o._renderer.type);Pe[K].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=wn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!f&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),P&&P.length>0&&(t.lineDashOffset=P.offset||0,t.setLineDash(P)),t.beginPath();let M,L,Y,U,G,q,W;for(let K=0;K<p;K++)switch(_=m[K],R=_.x,F=_.y,_.command){case ie.close:t.closePath();break;case ie.arc:M=_.rx,L=_.ry,Y=_.xAxisRotation,U=_.largeArcFlag,G=_.sweepFlag,y=f?rt(K-1,p):Us(K-1,0),b=m[y],q=b.x,W=b.y,Pe.renderSvgArcCommand(t,q,W,M,L,U,G,Y,R,F);break;case ie.curve:y=f?rt(K-1,p):Math.max(K-1,0),b=m[y],v=b.controls&&b.controls.right||re.zero,$=_.controls&&_.controls.left||re.zero,b._relative?(w=v.x+b.x,S=v.y+b.y):(w=v.x,S=v.y),_._relative?(C=$.x+_.x,N=$.y+_.y):(C=$.x,N=$.y),t.bezierCurveTo(w,S,C,N,R,F),K>=g&&f&&(k=x,E=_.controls&&_.controls.right||re.zero,A=k.controls&&k.controls.left||re.zero,_._relative?(w=E.x+_.x,S=E.y+_.y):(w=E.x,S=E.y),k._relative?(C=A.x+k.x,N=A.y+k.y):(C=A.x,N=A.y),R=k.x,F=k.y,t.bezierCurveTo(w,S,C,N,R,F));break;case ie.line:t.lineTo(R,F);break;case ie.move:x=_,t.moveTo(R,F);break}return f&&t.closePath(),!Q&&!n&&(Pe.isHidden.test(a)||(O=a._renderer&&a._renderer.offset,O&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),O&&t.restore()),Pe.isHidden.test(o)||(O=o._renderer&&o._renderer.offset,O&&(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(),O&&t.restore())),Z||t.restore(),Q&&!n&&t.clip(),P&&P.length>0&&t.setLineDash(Ys),oe.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,m,p,g,y,b,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(oe.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,g=vo(r),b=this.dashes,d=this._size,g||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const C=Pe.getRendererType(a._renderer.type);Pe[C].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const C=Pe.getRendererType(o._renderer.type);Pe[C].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=wn(this))}typeof l=="number"&&(t.globalAlpha=l),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),t.beginPath();let k=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=bi(x[0],x[3],x[1],x[4],x[2],x[5]),k/=Math.max(x.scaleX,x.scaleY));for(let C=0;C<h;C++)f=u[C],m=f.x,p=f.y,t.moveTo(m+k,p),t.arc(m,p,k,0,et);return n||(Pe.isHidden.test(a)||(y=a._renderer&&a._renderer.offset,y&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),y&&t.restore()),Pe.isHidden.test(o)||(y=o._renderer&&o._renderer.offset,y&&(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(),y&&t.restore())),g||t.restore(),b&&b.length>0&&t.setLineDash(Ys),oe.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;oe.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,m=this._direction,p=vo(c),g=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,b=Pe.alignments[this._alignment]||this._alignment,_=Pe.baselines[this._baseline]||this._baseline;let k,x,C,N,w,S,v,$,E,A,R;if(p||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const F=Pe.getRendererType(a._renderer.type);Pe[F].render.call(a,t,!0)}if(g||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=b,t.textBaseline=_,t.direction=m,h)if(typeof h=="string")t.fillStyle=h;else{const F=Pe.getRendererType(h._renderer.type);Pe[F].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const F=Pe.getRendererType(d._renderer.type);Pe[F].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=wn(this))}if(typeof o=="number"&&(t.globalAlpha=o),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),!l&&!n&&(Pe.isHidden.test(h)||(h._renderer&&h._renderer.offset?(S=h._renderer.scale.x,v=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(S,v),k=this._size/h._renderer.scale.y,x=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),C=h._renderer.offset.x/h._renderer.scale.x,N=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,C,N),t.restore()):t.fillText(this.value,0,0)),Pe.isHidden.test(d)||(d._renderer&&d._renderer.offset?(S=d._renderer.scale.x,v=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(S,v),k=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),C=d._renderer.offset.x/d._renderer.scale.x,N=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,C,N),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const F=t.measureText(this.value);let H=1;switch(f){case"underline":E=F.actualBoundingBoxDescent,R=F.actualBoundingBoxDescent;break;case"strikethrough":E=0,R=0,H=.5;break}switch(_){case"top":E+=this._size*H,R+=this._size*H;break;case"baseline":case"bottom":E-=this._size*H,R-=this._size*H;break}switch(b){case"left":case"start":$=0,A=F.width;break;case"right":case"end":$=-F.width,A=0;break;default:$=-F.width/2,A=F.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,E),t.lineTo(A,R),t.stroke()}return p||t.restore(),l&&!n&&t.clip(),y&&y.length>0&&t.setLineDash(Ys),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){oe.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)),oe.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=td(r),o=td(o);const u=(e-c)/2,h=(n-d)/2,f=xo(l)*u+wo(l)*h,m=-wo(l)*u+xo(l)*h,p=f*f,g=m*m;let y=r*r,b=o*o;const _=p/y+g/b;if(_>1){const F=ko(_);r=F*r,o=F*o,y=r*r,b=o*o}const k=y*g+b*p,x=(y*b-k)/k;let C=ko(Us(0,x));s===a&&(C=-C);const N=C*r*m/o,w=-C*o*f/r,S=xo(l)*N-wo(l)*w+(e+c)/2,v=wo(l)*N+xo(l)*w+(n+d)/2,$=nd(1,0,(f-N)/r,(m-w)/o),E=nd((f-N)/r,(m-w)/o,(-f-N)/r,(-m-w)/o)%et,A=$+E;Cy(t,S,v,r,o,$,A,a===0,l)}},vt=class extends ee{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 mt,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?vs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&oe.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(ee.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),Pe.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};B(vt,"Utils",Pe);function Cy(t,e,n,r,o,s,a,l,c){const d=a-s,u=Ui.Tolerance.epsilon,h=Math.abs(d)<u;let f=rt(d,et);f<u&&(h?f=0:f=et),l===!0&&!h&&(f===et?f=-et:f=f-et);for(let m=0;m<xt.Resolution;m++){const p=m/(xt.Resolution-1),g=s+p*f;let y=e+r*Math.cos(g),b=n+o*Math.sin(g);if(c!==0){const _=Math.cos(c),k=Math.sin(c),x=y-e,C=b-n;y=x*_-C*k+e,b=x*k+C*_+n}t.lineTo(y,b)}}function nd(t,e,n,r){const o=t*n+e*r,s=ko(t*t+e*e)*ko(n*n+r*r);let a=vy(Us(-1,ky(1,o/s)));return t*r-e*n<0&&(a=-a),a}function vo(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var ce={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(ce.ns,n);return n==="svg"&&(e=oe.defaults(e||{},{version:ce.version})),e&&Object.keys(e).length>0&&ce.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(ce.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?rt(a-1,n):Math.max(a-1,0),d=t[c];let u,h,f,m,p,g,y,b,_,k,x,C,N,w,S,v=Ie(l.x),$=Ie(l.y);switch(l.command){case ie.close:u=ie.close;break;case ie.arc:x=l.rx,C=l.ry,N=l.xAxisRotation,w=l.largeArcFlag,S=l.sweepFlag,u=ie.arc+" "+x+" "+C+" "+N+" "+w+" "+S+" "+v+" "+$;break;case ie.curve:y=d.controls&&d.controls.right||re.zero,b=l.controls&&l.controls.left||re.zero,d.relative?(f=Ie(y.x+d.x),m=Ie(y.y+d.y)):(f=Ie(y.x),m=Ie(y.y)),l.relative?(p=Ie(b.x+l.x),g=Ie(b.y+l.y)):(p=Ie(b.x),g=Ie(b.y)),u=(a===0?ie.move:ie.curve)+" "+f+" "+m+" "+p+" "+g+" "+v+" "+$;break;case ie.move:o=l,u=ie.move+" "+v+" "+$;break;default:u=l.command+" "+v+" "+$}a>=r&&e&&(l.command===ie.curve&&(h=o,_=l.controls&&l.controls.right||l,k=h.controls&&h.controls.left||h,l.relative?(f=Ie(_.x+l.x),m=Ie(_.y+l.y)):(f=Ie(_.x),m=Ie(_.y)),h.relative?(p=Ie(k.x+h.x),g=Ie(k.y+h.y)):(p=Ie(k.x),g=Ie(k.y)),v=Ie(h.x),$=Ie(h.y),u+=" C "+f+" "+m+" "+p+" "+g+" "+v+" "+$),l.command!==ie.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+=ie.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=ce.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in ce?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=ce.getRendererType(t._renderer.type);ce[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=ce.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=ce.getRendererType(o._renderer.type);ce[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(ce.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(ce.group.removeChild,n),this._flagOrder&&this.children.forEach(ce.group.orderChild,n),this._flagMask)if(this._mask){const r=ce.getRendererType(this._mask._renderer.type);ce[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),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;oe.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=ce.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ce.getRendererType(this._fill._renderer.type);ce[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=ce.getRendererType(this._stroke._renderer.type);ce[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"]=wn(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?ce.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ce.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ce.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=ce.getRendererType(this._mask._renderer.type);ce[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;oe.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=bi(s[0],s[3],s[1],s[4],s[2],s[5]);r/=Math.max(a.scaleX,a.scaleY)}const o=ce.pointsToString(this._renderer.collection,r);e.d=o}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ce.getRendererType(this._fill._renderer.type);ce[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=ce.getRendererType(this._stroke._renderer.type);ce[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"]=wn(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?ce.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ce.createElement("path",e),t.appendChild(this._renderer.elem)),oe.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"]=ce.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=ce.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=ce.getRendererType(this._fill._renderer.type);ce[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=ce.getRendererType(this._stroke._renderer.type);ce[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"]=wn(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?ce.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ce.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ce.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=ce.getRendererType(this._mask._renderer.type);ce[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){oe.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?ce.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ce.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?ce.setAttributes(s._renderer.elem,a):s._renderer.elem=ce.createElement("stop",a),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){oe.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?ce.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ce.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?ce.setAttributes(s._renderer.elem,a):s._renderer.elem=ce.createElement("stop",a),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){oe.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?ce.setAttributes(this._renderer.image,r):this._renderer.image=ce.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&ce.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=ce.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),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},id=class extends ee{constructor(t){super(),this.domElement=t.domElement||ce.createElement("svg"),this.scene=new mt,this.scene.parent=this,this.defs=ce.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,ce.setAttributes(this.domElement,{width:t,height:e}),this.trigger(ee.Types.resize,t,e)}render(){return ce.group.render.call(this.scene,this.domElement),ce.defs.update(this.domElement),this}};B(id,"Utils",ce);var nn={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 Dt("unable to compile shader "+r+": "+s)}return r},types:{vertex:"VERTEX_SHADER",fragment:"FRAGMENT_SHADER"},path:{vertex:`
|
|
40
|
+
***************************************************************************** */var no=function(){return no=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},no.apply(this,arguments)},dp={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"}},In={containerResize:"lgContainerResize",beforeOpen:"lgBeforeOpen",afterOpen:"lgAfterOpen",slideItemLoad:"lgSlideItemLoad",afterSlide:"lgAfterSlide",rotateLeft:"lgRotateLeft",rotateRight:"lgRotateRight",flipHorizontal:"lgFlipHorizontal",flipVertical:"lgFlipVertical"},gs=500,up=(function(){function t(e,n){return this.core=e,this.$LG=n,this.settings=no(no({},dp),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(In.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),m,p,g=s-this.pageX,y=a-this.pageY;if(e-n>1){var b=(e-n)/Math.abs(n);g=(n<0?-g:g)+this.left*(b+(n<0?-1:1)),y=(n<0?-y:y)+this.top*(b+(n<0?-1:1)),m=g/b,p=y/b}else{var b=(e-n)*n;m=g*b,p=y*b}r&&(h?this.isBeyondPossibleLeft(m,f.minX)?m=f.minX:this.isBeyondPossibleRight(m,f.maxX)&&(m=f.maxX):e>1&&(m<f.minX?m=f.minX:m>f.maxX&&(m=f.maxX)),u?this.isBeyondPossibleTop(p,f.minY)?p=f.minY:this.isBeyondPossibleBottom(p,f.maxY)&&(p=f.maxY):e>1&&(p<f.minY?p=f.minY:p>f.maxY&&(p=f.maxY))),this.setZoomStyles({x:m,y:p,scale:e}),this.left=m,this.top=p,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)},gs),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")}},gs+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},gs+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(In.containerResize+".zoom "+In.rotateRight+".zoom "+In.rotateLeft+".zoom "+In.flipHorizontal+".zoom "+In.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(In.beforeOpen+".zoom",function(){e.core.outer.find(".lg-item").removeClass("lg-zoomable")}),this.core.LGel.on(In.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(In.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 m=e.getDragAllowedAxises(0);a=m.allowY,s=m.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 m=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,m))}}),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 m=c.valueOf()-l.valueOf();e.touchendZoom(n,r,s,a,m)}})},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 m=e.core.getSlideItem(e.core.index);if(e.$LG(f.target).hasClass("lg-item")||m.get().contains(f.target)){c=new Date,h=e.core.getSlideItem(e.core.index).find(".lg-img-wrap").first();var p=e.getDragAllowedAxises(0);l=p.allowY,a=p.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 m=e.getZoomSwipeCords(n,r,a,l,u);e.setZoomSwipeStyles(h,m)}}),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 m=d.valueOf()-c.valueOf();e.touchendZoom(n,r,a,l,m)}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 fp={ref:"gallery-container",class:"lightgallery-wrapper"},hp={},Rl=i.defineComponent({...hp,__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}),D.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",fp,[i.renderSlot(s.$slots,"default")],512))}}),gt=class gt{static init(){gt.isInitialized||(gt.isInitialized=!0,gt.windowResizeHandler(),window.addEventListener("resize",gt.windowResizeHandler))}static destroy(){window.removeEventListener("resize",gt.windowResizeHandler),gt.isInitialized=!1}static getDeviceTypeByResolution(){const e=j.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Xe.phone:window.innerWidth<e.laptop?Xe.tablet:Xe.laptop}static initRefDependingOnDeviceResolution(e,n,r){const o=i.ref(r);return gt.setRefValueDependingOnDeviceResolution(o,e,n,r),gt.refsDependingOnDeviceResolution.push({r:o,phoneValue:e,tabletValue:n,defaultValue:r}),o}static isPhoneDevice(){return gt.getDeviceTypeByResolution()===Xe.phone}static isTabletDevice(){return gt.getDeviceTypeByResolution()===Xe.tablet}static isLaptopDevice(){return gt.getDeviceTypeByResolution()===Xe.laptop}static setRefValueDependingOnDeviceResolution(e,n,r,o){switch(gt.getDeviceTypeByResolution()){case Xe.phone:e.value=n;break;case Xe.tablet:e.value=r;break;default:e.value=o;break}}static windowResizeHandler(){D.forEach(gt.refsDependingOnDeviceResolution,e=>{gt.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};T(gt,"isInitialized",!1),T(gt,"refsDependingOnDeviceResolution",[]);let et=gt;const mp=["href"],pp=["src","alt"],gp={},El=i.defineComponent({...gp,__name:"image-gallery",props:{images:{}},setup(t,{expose:e}){const n=i.ref(!1),r=i.ref(!1),o=i.ref({plugins:[cp,up],addClass:"sc-lg-container",licenseKey:"0000-0000-000-0000",strings:{closeGallery:"Закрыть",download:"Скачать",mediaLoadingFailed:"Ошибка загрузки контента...",nextSlide:"Следующее изображение",playVideo:"Воспроизвести видео",previousSlide:"Предыдущее изображение",toggleMaximize:"Расширить"}}),s=()=>window.innerWidth*(et.getDeviceTypeByResolution()===Xe.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=$l,f=z.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]=m=>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,(m,p)=>(i.openBlock(),i.createElementBlock("a",{key:p,href:m.image},[i.createElementVNode("img",{src:m.preview,alt:`Изображение #${p+1}`},null,8,pp)],8,mp))),128))]),_:1},8,["settings","style"])]),_:3},8,["show"])}}}),yp={class:"text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline"},bp={class:"pr-3"},_p={class:"text-right"},wp={},xp=i.defineComponent({...wp,__name:"product-stock-count",props:{product:{}},setup(t){return(e,n)=>{const r=ps,o=z.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",yp,[(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",bp,i.toDisplayString(s.warehouse.name),1),i.createElementVNode("span",_p,[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})}}}),kp={class:"flex flex-row justify-between"},vp={key:0,class:"inline-flex flex-row gap-0.5 mr-2 align-sub"},Cp={key:1},Sp={class:"ml-2 align-sub"},Bp={class:"flex cursor-pointer flex-row gap-2 whitespace-nowrap"},Tp={class:"@container"},Np={class:"text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm"},$p={key:0,class:"sc-supplier-sku col-span-2 whitespace-nowrap text-wrap sm:col-span-3"},Rp={class:"text-sc-dark-grey"},Ep={key:1,class:"sc-product-code col-start-1 whitespace-nowrap"},Pp={class:"text-gray-600"},Fp={class:"flex cursor-pointer flex-row gap-1 whitespace-nowrap"},Vp={key:3,class:"underline decoration-dashed"},Mp={key:4,class:"sc-product-pack whitespace-nowrap"},Ap={class:"text-gray-600"},Ip={key:5,class:"sc-product-planning-incoming-date col-span-2 col-start-1 mt-1.5 text-wrap"},Op={class:"text-gray-600"},zp={key:0,class:"mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg"},Dp={key:0},Lp={class:"sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Hp={},vr=i.defineComponent({...Hp,__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},showAdditionalSaleIcon:{type:Boolean,default:!1},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(()=>D.isFunction(n.showProductCosts)?n.showProductCosts(n.product):n.showProductCosts),o=i.computed(()=>D.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(()=>D.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,S,v;const m=ap,p=z.NTooltip,g=Tl,y=rp,b=$l,_=z.NText,k=Nl,x=ps,C=z.NScrollbar;return i.openBlock(),i.createElementBlock("div",null,[i.createElementVNode("div",kp,[i.createVNode(_,{type:"info",class:"sc-product-name text-balance text-base font-medium"},{default:i.withCtx(()=>{var $,E,A,R;return[($=t.product)!=null&&$.isFavorite||(E=t.product)!=null&&E.isPreviouslyOrdered||t.showAdditionalSaleIcon?(i.openBlock(),i.createElementBlock("div",vp,[((A=t.product)==null?void 0:A.isFavorite)??!1?(i.openBlock(),i.createBlock(p,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(m,{class:"!text-yellow-300"})]),default:i.withCtx(()=>[f[0]||(f[0]=i.createTextVNode(" Избранный товар ",-1))]),_:1})):i.createCommentVNode("",!0),((R=t.product)==null?void 0:R.isPreviouslyOrdered)??!1?(i.openBlock(),i.createBlock(p,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(g,{class:"!text-green-700"})]),default:i.withCtx(()=>[f[1]||(f[1]=i.createTextVNode(" Ранее заказанный товар ",-1))]),_:1})):i.createCommentVNode("",!0),t.showAdditionalSaleIcon?(i.openBlock(),i.createBlock(p,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(y,{class:"!text-green-500"})]),default:i.withCtx(()=>[f[2]||(f[2]=i.createTextVNode(" Дополнительная продажа ",-1))]),_:1})):i.createCommentVNode("",!0)])):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",Cp," [Под заказ] ")):i.createCommentVNode("",!0),i.createElementVNode("span",Sp,[t.product.images&&t.product.images.length>0?(i.openBlock(),i.createBlock(El,{key:0,ref:"image-gallery",images:t.product.images},{default:i.withCtx(()=>[i.createElementVNode("div",Bp,[i.createVNode(b)])]),_:1},8,["images"])):i.createCommentVNode("",!0)])]}),_:1}),d.value?(i.openBlock(),i.createBlock(k,{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",Tp,[i.createElementVNode("div",Np,[t.product.supplierSku?(i.openBlock(),i.createElementBlock("div",$p,[f[3]||(f[3]=i.createTextVNode(" Артикул производителя/поставщика: ",-1)),i.createElementVNode("span",Rp,i.toDisplayString(t.product.supplierSku),1)])):i.createCommentVNode("",!0),t.showCode?(i.openBlock(),i.createElementBlock("span",Ep,[f[4]||(f[4]=i.createTextVNode(" Артикул: ",-1)),i.createElementVNode("span",Pp,i.toDisplayString(t.product.code),1)])):i.createCommentVNode("",!0),t.product.stockCount&&t.product.stockCount.length>0?(i.openBlock(),i.createBlock(xp,{key:2,product:t.product},{default:i.withCtx(()=>[i.createElementVNode("span",Fp,[f[5]||(f[5]=i.createElementVNode("span",{class:"underline decoration-dashed"},"В наличии",-1)),i.createVNode(x,{class:"mt-0.5"})])]),_:1},8,["product"])):(i.openBlock(),i.createElementBlock("span",Vp," Нет в наличии ")),t.product.pack??((w=(N=t.product)==null?void 0:N.properties)==null?void 0:w.pack)?(i.openBlock(),i.createElementBlock("span",Mp,[f[6]||(f[6]=i.createTextVNode(" Норма упаковки: ",-1)),i.createElementVNode("span",Ap,i.toDisplayString(t.product.pack??((v=(S=t.product)==null?void 0:S.properties)==null?void 0:v.pack)),1)])):i.createCommentVNode("",!0),t.showPlanningDates&&s.value?(i.openBlock(),i.createElementBlock("span",Ip,[f[7]||(f[7]=i.createTextVNode(" Планируемая дата поступления на основной склад: ",-1)),i.createElementVNode("span",Op,i.toDisplayString(s.value),1)])):i.createCommentVNode("",!0)])]),i.createVNode(C,{"x-scrollable":""},{default:i.withCtx(()=>[r.value?(i.openBlock(),i.createElementBlock("div",zp,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(o.value,$=>(i.openBlock(),i.createBlock(ni,{key:$.coefficient.slug,product:t.product,"cost-field-name":$.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(ni,{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",Dp,[i.createElementVNode("ul",Lp,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.product.id,slug:t.product.slug},($,E)=>(i.openBlock(),i.createElementBlock("li",{key:E}," ("+i.toDisplayString(E)+"): "+i.toDisplayString($),1))),128)):i.createCommentVNode("",!0),t.showProperties?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:1},i.renderList(t.product.properties,($,E)=>(i.openBlock(),i.createElementBlock("li",{key:E}," ("+i.toDisplayString(E)+"): "+i.toDisplayString($),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)])}}}),Wp=(t,e,n)=>({key:t,title:e,className:"align-top",resizable:!0,render:r=>i.h(ni,{product:r,costFieldName:t,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),jp=(t,e)=>{if(t.length===0)return[];const n=[],r={};switch(D.isNil(e.isProductItemSelected)||n.push({key:"checkbox",title:"",className:"align-top",width:"32",render:o=>{var s,a;return i.h(z.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})}})}}),et.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:n.push({key:"name",title:"Наименование",className:"align-top",render:o=>i.h(vr,{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(vr,{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&&(D.forEach(t,o=>{D.forEach(o.priceCoefficients,s=>{r[s.coefficient.slug??""]||(r[s.coefficient.slug??""]=s.coefficient)})}),D.forEach(D.sortBy(r,["slug"]),o=>{n.push(Wp(o.slug??"",o.name,e))}),n.push({key:"cost",title:"Цена",className:"align-top",resizable:!0,render:o=>i.h(ni,{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||!D.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},qp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Xp(t,e){return i.openBlock(),i.createElementBlock("svg",qp,[...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 io=i.markRaw({name:"ion-trash",render:Xp}),Yp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Up(t,e){return i.openBlock(),i.createElementBlock("svg",Yp,[...e[0]||(e[0]=[i.createElementVNode("path",{d:"M448 224H288V64h-64v160H64v64h160v160h64V288h160z",fill:"currentColor"},null,-1)])])}const Pl=i.markRaw({name:"ion-plus",render:Up}),Kp={key:0,class:"flex w-fit items-center gap-2"},Gp={key:1,class:"flex flex-wrap gap-1"},Zp={key:0},Qp={key:2},Jp={},Cr=i.defineComponent({...Jp,__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=z.NSpin,a=z.NText;return t.isProductSearching?(i.openBlock(),i.createElementBlock("div",Kp,[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",Gp,[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",Zp,"(Планируемая дата производства: "+i.toDisplayString(n.value)+")",1)):i.createCommentVNode("",!0)])):t.validation?(i.openBlock(),i.createElementBlock("div",Qp,[i.createVNode(a,{type:t.validation.validationStatus},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.validation.feedback),1)]),_:1},8,["type"])])):i.createCommentVNode("",!0)}}}),eg={class:"flex flex-col gap-4"},tg={class:"flex flex-col gap-2"},ng={class:"mt-8 font-bold"},ig={class:"grid grow grid-cols-2 items-start gap-2"},rg={key:2,class:"text-red-500 text-sm"},og={key:3,class:"text-red-500 text-sm mb-2"},sg={class:"flex flex-col gap-4"},ag={key:1},lg={class:"text-lg font-semibold"},cg={class:"flex gap-3"},dg={},ug=i.defineComponent({...dg,__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 y;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.ref(!1),l=i.ref(D.cloneDeep(r.value)),c=i.computed(()=>{var _,k,x;const b={"configuratorParams.length":[ae.required,ae.min(r.settings.stripMinLength),ae.max(r.settings.stripMaxLength||Number.MAX_VALUE),ae.step(r.settings.lengthStep),We.serverValidation((_=r.validation.length)==null?void 0:_.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation((k=r.validation.quantity)==null?void 0:k.feedback)],marker:[We.serverValidation((x=r.validation.marker)==null?void 0:x.feedback)]};return D.forEach(l.value.configuratorParams.linesWidths,(C,N)=>{var v;const S=l.value.configuratorParams.linesWidths.length>1?r.settings.minLineWidth:r.settings.stripMinWidth;b[`configuratorParams.linesWidths.${N}`]=[ae.required,ae.min(S),ae.max(r.settings.maxLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((v=r.validation[`lines_widths[${N+1}]`])==null?void 0:v.feedback)]}),D.forEach(l.value.configuratorParams.linesAngles,(C,N)=>{var w;b[`configuratorParams.linesAngles.${N}`]=[ae.required,ae.min(r.settings.minLineAngle),ae.max(r.settings.maxLineAngle),ae.step(r.settings.lineAngleStep),We.serverValidation((w=r.validation[`lines_angles[${N+1}]`])==null?void 0:w.feedback)]}),b}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>{var C;const{length:b}=l.value.configuratorParams,{quantity:_}=l.value,k=((C=l.value.product)==null?void 0:C.costRub)||0;if(!b||!_||k===0)return null;const x=b/1e3;return(k*_*x).toLocaleString("ru-ru",{maximumFractionDigits:2,minimumFractionDigits:2})}),h=i.computed(()=>D.reduce(l.value.configuratorParams.linesWidths,(b,_)=>b+(_||0),0)),f=i.computed(()=>{const b=h.value;return b>=r.settings.stripMinWidth&&b<=r.settings.stripMaxWidth}),m=i.computed(()=>{const{configuratorParams:b}=l.value,_=D.every(b.linesWidths,N=>!!(N&&N>0)),k=D.every(b.linesAngles,N=>!D.isNil(N)),x=!!(l.value.quantity&&l.value.quantity>0),C=b.length>0&&b.length>0;return _&&k&&x&&C&&f.value}),p=()=>{i.nextTick(()=>{var b;(b=s.value)==null||b.validate(_=>{_||(o("update:params",l.value.configuratorParams),g("configuratorParams",l.value.configuratorParams))}).catch(D.noop)})},g=(b,_)=>{const k=new j.OrderItemBase(l.value);k[b]=_,b==="configuratorParams"&&(k.product=new j.ClientProduct),o("update:value",k)};return i.watch(()=>r.previewParams,b=>{l.value.configuratorParams.linesWidths=b.linesWidths,l.value.configuratorParams.linesAngles=b.linesAngles},{deep:!0}),i.watch(()=>r.value,b=>{l.value=D.cloneDeep(b)},{deep:!0}),e({validate:(y=s.value)==null?void 0:y.validate,formReference:s}),(b,_)=>{const k=Pl,x=io,C=z.NCheckbox;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,class:"flex flex-col gap-4 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var N;return[i.createElementVNode("div",eg,[_[21]||(_[21]=i.createElementVNode("span",{class:"w-full font-bold"},"Ширина участка, мм / Угол сгиба, ° (А)",-1)),t.settings.startTailConfigs&&t.settings.startTailConfigs.length>0?(i.openBlock(),i.createBlock(i.unref(z.NFormItem),{key:0,required:!0,"show-feedback":!1,label:"Тип стартового капельника"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.startTailType,"onUpdate:value":[_[0]||(_[0]=w=>l.value.configuratorParams.startTailType=w),p],options:t.settings.startTailConfigs.map(({label:w},S)=>({label:w,value:S})),placeholder:"Тип стартового капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",tg,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value.configuratorParams.linesAngles,(w,S)=>(i.openBlock(),i.createElementBlock("div",{key:S,class:"flex items-start gap-2"},[i.createElementVNode("div",ng,i.toDisplayString(S+1),1),i.createElementVNode("div",ig,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesWidths.${S}`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesWidths[S],"onUpdate:value":[v=>l.value.configuratorParams.linesWidths[S]=v,_[2]||(_[2]=v=>p())],parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:_[1]||(_[1]=v=>i.unref(st)(v)),onInput:v=>i.unref(it)(t.validation,`lines_widths[${S+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.linesAngles.${S}`,label:"Угол сгиба, °"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.linesAngles[S],"onUpdate:value":[v=>l.value.configuratorParams.linesAngles[S]=v,_[4]||(_[4]=v=>p())],parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:_[3]||(_[3]=v=>i.unref(st)(v,!0)),onInput:v=>i.unref(it)(t.validation,`lines_angles[${S+1}]`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:"shrink-0"},{default:i.withCtx(()=>[t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,size:"medium",onClick:v=>o("click:add-line",S)},{default:i.withCtx(()=>[i.createVNode(k)]),_:1},8,["onClick"])),t.settings.showOnlyTemplates?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:l.value.configuratorParams.linesWidths.length===1,size:"medium",class:"ml-2",onClick:v=>o("click:remove-line",S)},{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(z.NFormItem),{key:1,label:"Тип конечного капельника","show-feedback":!1,required:!0},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.endTailType,"onUpdate:value":[_[5]||(_[5]=w=>l.value.configuratorParams.endTailType=w),p],options:t.settings.endTailConfigs.map(({label:w},S)=>({label:w,value:S})),placeholder:"Тип конечного капельника"},null,8,["value","options"])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Cr,{"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",rg," Суммарная ширина участков гиба должна быть от "+i.toDisplayString(t.settings.stripMinWidth)+" до "+i.toDisplayString(t.settings.stripMaxWidth)+" мм., текущая ширина: "+i.toDisplayString(h.value)+" мм. ",1)),m.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",og," Пожалуйста, заполните все обязательные поля корректно. ")),t.settings.allowSaveTemplates&&t.selectTemplateIndex===((N=t.settings.allTemplates)==null?void 0:N.length)-1?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:4,type:"tertiary",class:"self-start",loading:a.value,onClick:_[6]||(_[6]=w=>o("click:save-template"))},{default:i.withCtx(()=>[..._[20]||(_[20]=[i.createTextVNode(" Сохранить шаблон ",-1)])]),_:1},8,["loading"])):i.createCommentVNode("",!0)]),i.createElementVNode("div",sg,[i.createVNode(i.unref(z.NFormItem),{label:"С какой стороны изделие будет иметь цвет","show-feedback":!1},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:l.value.configuratorParams.colorSide,"onUpdate:value":[_[7]||(_[7]=w=>l.value.configuratorParams.colorSide=w),p],options:[{label:"Цвет сверху",value:"top"},{label:" Цвет снизу",value:"bottom"}],placeholder:"С какой стороны изделие будет иметь цвет"},null,8,["value"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Метраж${t.settings.stripMinLength?" от "+t.settings.stripMinLength:""}${t.settings.stripMaxLength?" до "+t.settings.stripMaxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[_[8]||(_[8]=w=>l.value.configuratorParams.length=w),_[11]||(_[11]=w=>p())],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:_[9]||(_[9]=w=>i.unref(st)(w)),onInput:_[10]||(_[10]=w=>i.unref(it)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.quantity,"onUpdate:value":[_[12]||(_[12]=w=>l.value.quantity=w),_[15]||(_[15]=w=>g("quantity",w??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:_[13]||(_[13]=w=>i.unref(st)(w,!1)),onInput:_[14]||(_[14]=w=>i.unref(it)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value.marker??null,placeholder:"Введите маркировку",onInput:_[16]||(_[16]=w=>i.unref(it)(t.validation,"marker")),"onUpdate:value":_[17]||(_[17]=w=>{l.value.marker=w??null,g("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(C,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":_[18]||(_[18]=w=>{l.value.isAdditionalSale=w??!1,g("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[..._[22]||(_[22]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),u.value?(i.openBlock(),i.createElementBlock("div",ag,[_[23]||(_[23]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",lg,i.toDisplayString(u.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",cg,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!m.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"])),[[i.unref(ei),()=>o("submit",l.value)]])}}}),Fl=An(ug,[["__scopeId","data-v-ac7f1192"]]);var Vl=Object.defineProperty,fg=Object.defineProperties,hg=Object.getOwnPropertyDescriptors,Ml=Object.getOwnPropertySymbols,mg=Object.prototype.hasOwnProperty,pg=Object.prototype.propertyIsEnumerable,Al=t=>{throw TypeError(t)},ys=(t,e,n)=>e in t?Vl(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Sr=(t,e)=>{for(var n in e||(e={}))mg.call(e,n)&&ys(t,n,e[n]);if(Ml)for(var n of Ml(e))pg.call(e,n)&&ys(t,n,e[n]);return t},bs=(t,e)=>fg(t,hg(e)),Il=(t,e)=>{for(var n in e)Vl(t,n,{get:e[n],enumerable:!0})},B=(t,e,n)=>ys(t,typeof e!="symbol"?e+"":e,n),Ol=(t,e,n)=>e.has(t)||Al("Cannot "+n),zt=(t,e,n)=>(Ol(t,e,"read from private field"),n?n.call(t):e.get(t)),zl=(t,e,n)=>e.has(t)?Al("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),gg=(t,e,n,r)=>(Ol(t,e,"write to private field"),e.set(t,n),n),Et={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 Et.shim(t),typeof e<"u"&&(Et.Image=e),Et.isHeadless=!0,t}},Dl={};Il(Dl,{Curve:()=>Ui,getAnchorsFromArcData:()=>_g,getComponentOnCubicBezier:()=>Br,getControlPoints:()=>Zl,getCurveBoundingBox:()=>Ul,getCurveFromPoints:()=>Gl,getCurveLength:()=>Yl,getReflection:()=>ks,integrate:()=>Kl,subdivide:()=>xs});var Ll={};Il(Ll,{HALF_PI:()=>ct,NumArray:()=>_n,TWO_PI:()=>tt,decomposeMatrix:()=>bi,getComputedMatrix:()=>_s,getEffectiveStrokeWidth:()=>wn,getPoT:()=>jl,lerp:()=>Pt,mod:()=>rt,setMatrix:()=>Wl,toFixed:()=>Ie});var Ue;typeof window<"u"?Ue=window:typeof global<"u"?Ue=global:typeof self<"u"&&(Ue=self);var Hl,tt=Math.PI*2,ct=Math.PI*.5;function bi(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 Wl(t){Hl=t}function _s(t,e){e=e&&e.identity()||new Hl;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 Pt(t,e,n){return n*(e-t)+t}var ws=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function jl(t){let e=0;for(;ws[e]&&ws[e]<t;)e++;return ws[e]}function rt(t,e){for(;t<0;)t+=e;return t%e}var _n=Ue.Float32Array||Array,yg=Math.floor;function Ie(t){return yg(t*1e6)/1e6}function wn(t,e){const n=t._linewidth;if(t.strokeAttenuation)return n;e||(e=t.worldMatrix||_s(t));const r=bi(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 ie={move:"M",line:"L",curve:"C",arc:"A",close:"Z"},ee=class{constructor(){B(this,"_events",{}),B(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}};B(ee,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),B(ee,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);var ql={x:{enumerable:!0,get:function(){return this._x},set:function(t){this._x!==t&&(this._x=t,this._bound&&this.dispatchEvent(ee.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(t){this._y!==t&&(this._y=t,this._bound&&this.dispatchEvent(ee.Types.change))}}},ln=class gr extends ee{constructor(e=0,n=0){super(),B(this,"_x",0),B(this,"_y",0);for(let r in ql)Object.defineProperty(this,r,ql[r]);this.x=e,this.y=n}static add(e,n){return new gr(e.x+n.x,e.y+n.y)}static sub(e,n){return new gr(e.x-n.x,e.y-n.y)}static subtract(e,n){return gr.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(gr.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 gr(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}};B(ln,"zero",new ln),B(ln,"left",new ln(-1,0)),B(ln,"right",new ln(1,0)),B(ln,"up",new ln(0,-1)),B(ln,"down",new ln(0,1));var re=ln,Ne=class fs extends re{constructor(e=0,n=0,r=0,o=0,s=0,a=0,l=ie.move){super(e,n),B(this,"controls",{left:new re,right:new re}),B(this,"_command",ie.move),B(this,"_relative",!0),B(this,"_rx",0),B(this,"_ry",0),B(this,"_xAxisRotation",0),B(this,"_largeArcFlag",0),B(this,"_sweepFlag",1);for(let d in Xl)Object.defineProperty(this,d,Xl[d]);this.command=l,this.relative=!0;const c=fs.makeBroadcast(this);this.controls.left.set(r,o).addEventListener(ee.Types.change,c),this.controls.right.set(s,a).addEventListener(ee.Types.change,c)}static makeBroadcast(e){return n;function n(){e._bound&&e.dispatchEvent(ee.Types.change)}}static fromObject(e){return new fs().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 fs().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())}},Xl={command:{enumerable:!0,get:function(){return this._command},set:function(t){this._command!==t&&(this._command=t,this._bound&&this.dispatchEvent(ee.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(t){this._relative!==!!t&&(this._relative=!!t,this._bound&&this.dispatchEvent(ee.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(t){this._rx!==t&&(this._rx=t,this._bound&&this.dispatchEvent(ee.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(t){this._ry!==t&&(this._ry=t,this._bound&&this.dispatchEvent(ee.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(t){this._xAxisRotation!==t&&(this._xAxisRotation=t,this._bound&&this.dispatchEvent(ee.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(t){this._largeArcFlag!==t&&(this._largeArcFlag=t,this._bound&&this.dispatchEvent(ee.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(t){this._sweepFlag!==t&&(this._sweepFlag=t,this._bound&&this.dispatchEvent(ee.Types.change))}}},bg=0,xt={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"v0.8.23",PublishDate:"2025-12-22T19:59:24.486Z",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return bg++}},Ui={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 Br(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 xs(t,e,n,r,o,s,a,l,c){c=c||Ui.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Ne(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,m=Br(f,t,n,o,a),p=Br(f,e,r,s,l);u.push(new Ne(m,p))}return u}function Yl(t,e,n,r,o,s,a,l,c){if(t===n&&e===r&&o===a&&s===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}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),m=6*(e+s)-12*r,p=3*(r-e);function g(y){const b=(d*y+u)*y+h,_=(f*y+m)*y+p;return Math.sqrt(b*b+_*_)}return Kl(g,0,1,c||Ui.RecursionLimit)}function Ul(t,e,n,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,m,p,g,y,b;for(let C=0;C<2;++C){if(C===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;m=-f/h,0<m&&m<1&&c.push(m);continue}y=h*h-4*f*u,b=Math.sqrt(y),!(y<0)&&(p=(-h+b)/(2*u),0<p&&p<1&&c.push(p),g=(-h-b)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,k=_,x;for(;_--;)m=c[_],x=1-m,d[0][_]=x*x*x*t+3*x*x*m*n+3*x*m*m*o+m*m*m*a,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*l;return d[0][k]=t,d[1][k]=e,d[0][k+1]=a,d[1][k+1]=l,d[0].length=d[1].length=k+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 Kl(t,e,n,r){let o=Ui.abscissas[r-2],s=Ui.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 Gl(t,e){const n=t.length,r=n-1;for(let o=0;o<n;o++){const s=t[o],a=e?rt(o-1,n):Math.max(o-1,0),l=e?rt(o+1,n):Math.min(o+1,r),c=t[a],d=s,u=t[l];Zl(c,d,u),d.command=o===0?ie.move:ie.curve}}function Zl(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+=ct:l-=ct,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 ks(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 _g(t,e,n,r,o,s,a){const l=xt.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),m=new Ne(h,f);m.command=ie.line}}var Ql=Array.prototype.slice;function wg(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}var oe={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=Ql.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=Ql.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=!wg(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:Ue.performance&&Ue.performance.now?Ue.performance:Date},Yt={hasEventListeners:typeof Ue.addEventListener=="function",bind:function(t,e,n,r){return this.hasEventListeners?t.addEventListener(e,n,!!r):t.attachEvent("on"+e,n),Yt},unbind:function(t,e,n,r){return Yt.hasEventListeners?t.removeEventListeners(e,n,!!r):t.detachEvent("on"+e,n),Yt},getRequestAnimationFrame:function(){const t=["ms","moz","webkit","o"];let e=0,n=Ue.requestAnimationFrame;if(!n){for(let o=0;o<t.length;o++)n=Ue[t[o]+"RequestAnimationFrame"]||n;n=n||r}function r(o,s){const a=new Date().getTime(),l=Math.max(0,16-(a-e)),c=Ue.setTimeout(d,l);e=a+l;function d(){o(a+l)}return c}return n}},Ki=Ue.document?Ue.document.createElement("div"):{};Ki.id="help-two-load",Object.defineProperty(Yt,"temp",{enumerable:!0,get:function(){return oe.isElement(Ki)&&!Ue.document.head.contains(Ki)&&(Ki.style.display="none",Ue.document.head.appendChild(Ki)),Ki}});var Dt=class extends Error{constructor(e){super(),B(this,"name","Two.js"),B(this,"message"),this.message=e}},xg=Ue.devicePixelRatio||1;function kg(t){return t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1}function vs(t){return xg/kg(t)}var ro=class{constructor(){B(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}},kt,ii=class extends Array{constructor(){super(),zl(this,kt,new ee),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 zt(this,kt)}set _events(e){gg(this,kt,e)}get _bound(){return zt(this,kt)._bound}set _bound(e){zt(this,kt)._bound=e}addEventListener(){var e;return(e=zt(this,kt).addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=zt(this,kt).on)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=zt(this,kt).bind)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=zt(this,kt).removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=zt(this,kt).off)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=zt(this,kt).unbind)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=zt(this,kt).dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=zt(this,kt).trigger)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=zt(this,kt).listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=zt(this,kt).ignore)==null?void 0:e.apply(this,arguments)}pop(){const e=super.pop.apply(this,arguments);return this.trigger(ee.Types.remove,[e]),e}shift(){const e=super.shift.apply(this,arguments);return this.trigger(ee.Types.remove,[e]),e}push(){const e=super.push.apply(this,arguments);return this.trigger(ee.Types.insert,arguments),e}unshift(){const e=super.unshift.apply(this,arguments);return this.trigger(ee.Types.insert,arguments),e}splice(){const e=super.splice.apply(this,arguments);if(this.trigger(ee.Types.remove,e),arguments.length>2){const n=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(ee.Types.insert,n),this.trigger(ee.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(ee.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(ee.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}};kt=new WeakMap;var Jl=class Dh extends ee{constructor(){super(),B(this,"_flagId",!1),B(this,"_flagClassName",!1),B(this,"_renderer",{}),B(this,"_id",xt.Identifier+xt.uniqueId()),B(this,"_className",""),B(this,"classList",[]);for(let e in ec)Object.defineProperty(this,e,ec[e])}static fromObject(e){const n=new Dh().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(){if(typeof this.unbind=="function"&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const n=this.renderer.ctx;this._renderer.texture&&(n.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(n.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type==="CanvasRenderer"&&this._renderer.context&&delete this._renderer.context}const e=this._renderer.type;return this._renderer={type:e},this}};B(Jl,"Properties",["renderer","id","className"]);var Gi=Jl,ec={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)}}},oo,tc={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ue.document&&(oo=document.createElement("a"));var cn=class Qt extends Gi{constructor(e,n){super(),B(this,"_flagSrc",!1),B(this,"_flagImage",!1),B(this,"_flagVideo",!1),B(this,"_flagLoaded",!1),B(this,"_flagRepeat",!1),B(this,"_flagOffset",!1),B(this,"_flagScale",!1),B(this,"_src",""),B(this,"_image",null),B(this,"_loaded",!1),B(this,"_repeat","no-repeat"),B(this,"_scale",1),B(this,"_offset",null);for(let r in nc)Object.defineProperty(this,r,nc[r]);if(this._renderer.type="texture",this._renderer.flagOffset=vg.bind(this),this._renderer.flagScale=Cg.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new re,typeof n=="function"){const r=(function(){this.unbind(ee.Types.load,r),typeof n=="function"&&n()}).bind(this);this.bind(ee.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 Qt().copy(e);return"id"in e&&(n.id=e.id),n}static getAbsoluteURL(e){return oo?(oo.href=e,oo.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=Qt.getAbsoluteURL(e);if(Qt.ImageRegistry.contains(n))return Qt.ImageRegistry.get(n);let r;return Et.Image?(r=new Et.Image,Et.shim(r,"img")):Ue.document?tc.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=Qt.getTag(r);e._flagImage&&(/canvas/i.test(o)?Qt.Register.canvas(e,n):(e._src=!Et.isHeadless&&r.getAttribute("two-src")||r.src,Qt.Register[o](e,n))),e._flagSrc&&(r||(r=Qt.getImage(e.src),e.image=r),o=Qt.getTag(r),Qt.Register[o](e,n))}clone(){const e=new Qt(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(ee.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,Qt.load(this,(function(){this.loaded=!0,this.trigger(ee.Types.change).trigger(ee.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}};B(cn,"Properties",["src","loaded","repeat","scale","offset","image"]),B(cn,"RegularExpressions",tc),B(cn,"ImageRegistry",new ro),B(cn,"Register",{canvas:function(t,e){t._src="#"+t.id,cn.ImageRegistry.add(t.src,t.image),typeof e=="function"&&e()},img:function(t,e){const n=t.image,r=function(s){!Et.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!Et.isHeadless&&typeof n.removeEventListener=="function"&&(n.removeEventListener("load",r,!1),n.removeEventListener("error",o,!1)),new Dt("unable to load "+t.src)};typeof n.width=="number"&&n.width>0&&typeof n.height=="number"&&n.height>0?r():!Et.isHeadless&&typeof n.addEventListener=="function"&&(n.addEventListener("load",r,!1),n.addEventListener("error",o,!1)),t._src=cn.getAbsoluteURL(t._src),!(!Et.isHeadless&&n&&n.getAttribute("two-src"))&&(Et.isHeadless||n.setAttribute("two-src",t.src),cn.ImageRegistry.add(t.src,n),Et.isHeadless?cn.loadHeadlessBuffer(t,r):t.image.src=t.src)},video:function(t,e){if(Et.isHeadless)throw new Dt("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 Dt("unable to load "+t.src)};t._src=cn.getAbsoluteURL(t._src),t.image.getAttribute("two-src")||(t.image.setAttribute("two-src",t.src),cn.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=cn,nc={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(ee.Types.change,this._renderer.flagOffset),this._offset=t,this._offset.bind(ee.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(ee.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof re&&this._scale.bind(ee.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function vg(){this._flagOffset=!0}function Cg(){this._flagScale=!0}var Cs=class bn extends Gi{constructor(e,n,r){super(),B(this,"_flagOffset",!0),B(this,"_flagOpacity",!0),B(this,"_flagColor",!0),B(this,"_offset",0),B(this,"_opacity",1),B(this,"_color","#fff");for(let o in ic)Object.defineProperty(this,o,ic[o]);this._renderer.type="stop",this.offset=typeof e=="number"?e:bn.Index<=0?0:1,this.opacity=typeof r=="number"?r:1,this.color=typeof n=="string"?n:bn.Index<=0?"#fff":"#000",bn.Index=(bn.Index+1)%2}static fromObject(e){const n=new bn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<bn.Properties.length;n++){const r=bn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new bn;return oe.each(bn.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",oe.each(bn.Properties,n=>{e[n]=this[n]},this),e}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};B(Cs,"Index",0),B(Cs,"Properties",["offset","opacity","color"]);var ri=Cs,ic={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)}}},Ss=class Di extends Gi{constructor(e){super(),B(this,"_flagStops",!1),B(this,"_flagSpread",!1),B(this,"_flagUnits",!1),B(this,"_spread",""),B(this,"_units","");for(let n in rc)Object.defineProperty(this,n,rc[n]);this._renderer.type="gradient",this._renderer.flagStops=Sg.bind(this),this._renderer.bindStops=Bg.bind(this),this._renderer.unbindStops=Tg.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 ri?o:new ri().copy(o)));const r=new Di(n).copy(e);return"id"in e&&(r.id=e.id),r}clone(e){const n=this.stops.map(o=>o.clone()),r=new Di(n);return oe.each(Di.Properties,o=>{r[o]=this[o]},this),e&&e.add(r),r}copy(e){super.copy.call(this,e);for(let n=0;n<Di.Properties.length;n++){const r=Di.Properties[n];r in e&&(this[r]=e[r])}return this}toObject(){const e={stops:this.stops.map(n=>n.toObject())};return oe.each(Di.Properties,n=>{e[n]=this[n]},this),e}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(ee.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}};B(Ss,"Stop",ri),B(Ss,"Properties",["spread","stops","units"]);var dt=Ss,rc={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(ee.Types.insert,e).unbind(ee.Types.remove,n),this._stops=new ii((t||[]).slice(0)),this._stops.bind(ee.Types.insert,e).bind(ee.Types.remove,n),e(this._stops)}}};function Sg(){this._flagStops=!0}function Bg(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Tg(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}var Bs=class Kr extends dt{constructor(e,n,r,o,s){super(s),B(this,"_flagEndPoints",!1),B(this,"_left",null),B(this,"_right",null);for(let a in oc)Object.defineProperty(this,a,oc[a]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Ng.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 Kr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Kr.Properties.length;n++){const r=Kr.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 Kr(this.left._x,this.left._y,this.right._x,this.right._y,n);return oe.each(dt.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(ee.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};B(Bs,"Stop",ri),B(Bs,"Properties",["left","right"]);var Ke=Bs,oc={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof re&&this._left.unbind(ee.Types.change,this._renderer.flagEndPoints),this._left=t,this._left.bind(ee.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(ee.Types.change,this._renderer.flagEndPoints),this._right=t,this._right.bind(ee.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Ng(){this._flagEndPoints=!0}var Ts=class Li extends dt{constructor(e,n,r,o,s,a){super(o),B(this,"_flagRadius",!1),B(this,"_flagCenter",!1),B(this,"_flagFocal",!1),B(this,"_radius",0),B(this,"_center",null),B(this,"_focal",null);for(let l in sc)Object.defineProperty(this,l,sc[l]);this._renderer.type="radial-gradient",this._renderer.flagCenter=$g.bind(this),this._renderer.flagFocal=Rg.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 Li().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Li.Properties.length;n++){const r=Li.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 Li(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return oe.each(dt.Properties.concat(Li.Properties),function(o){r[o]=this[o]},this),e&&e.add(r),r}toObject(){const e=super.toObject.call(this);return oe.each(Li.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(ee.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};B(Ts,"Stop",ri),B(Ts,"Properties",["center","radius","focal"]);var Ge=Ts,sc={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(ee.Types.change,this._renderer.flagCenter),this._center=t,this._center.bind(ee.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(t){this._focal&&this._focal.unbind(ee.Types.change,this._renderer.flagFocal),this._focal=t,this._focal.bind(ee.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function $g(){this._flagCenter=!0}function Rg(){this._flagFocal=!0}function ac(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 so(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 lc(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),Yl(r,l,o,c,s,d,a,u,n)}function Ns(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),xs(r,l,o,c,s,d,a,u,n)}function _i(t){switch(t.renderer.type){case"texture":return Oe.fromObject(t);case"gradient":return dt.fromObject(t);case"linear-gradient":return Ke.fromObject(t);case"radial-gradient":return Ge.fromObject(t)}return t}var Eg=Math.cos,Pg=Math.sin,cc=Math.tan,$s=[],dc=class Jt extends ee{constructor(e,n,r,o,s,a){super(),B(this,"elements",new _n(9)),B(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 N=e;let w,S,v;const $=n[0]||0,E=n[1]||0,A=n[2]||0;return w=N[0]*$+N[1]*E+N[2]*A,S=N[3]*$+N[4]*E+N[5]*A,v=N[6]*$+N[7]*E+N[8]*A,[w,S,v]}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],m=n[0],p=n[1],g=n[2],y=n[3],b=n[4],_=n[5],k=n[6],x=n[7],C=n[8];return r=r||new _n(9),r[0]=o*m+s*y+a*k,r[1]=o*p+s*b+a*x,r[2]=o*g+s*_+a*C,r[3]=l*m+c*y+d*k,r[4]=l*p+c*b+d*x,r[5]=l*g+c*_+d*C,r[6]=u*m+h*y+f*k,r[7]=u*p+h*b+f*x,r[8]=u*g+h*_+f*C,r}static fromObject(e){return new Jt().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(ee.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(ee.Types.change)}identity(){return this.elements[0]=Jt.Identity[0],this.elements[1]=Jt.Identity[1],this.elements[2]=Jt.Identity[2],this.elements[3]=Jt.Identity[3],this.elements[4]=Jt.Identity[4],this.elements[5]=Jt.Identity[5],this.elements[6]=Jt.Identity[6],this.elements[7]=Jt.Identity[7],this.elements[8]=Jt.Identity[8],this.trigger(ee.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(ee.Types.change);if(typeof r>"u"&&(r=1),typeof o>"u"){e=e||0,n=n||0,r=r||0,s=this.elements;const F=s[0]*e+s[1]*n+s[2]*r,H=s[3]*e+s[4]*n+s[5]*r,Q=s[6]*e+s[7]*n+s[8]*r;return[F,H,Q]}const u=this.elements,h=[e,n,r,o,s,a,l,c,d],f=u[0],m=u[1],p=u[2],g=u[3],y=u[4],b=u[5],_=u[6],k=u[7],x=u[8],C=h[0],N=h[1],w=h[2],S=h[3],v=h[4],$=h[5],E=h[6],A=h[7],R=h[8];return this.elements[0]=f*C+m*S+p*E,this.elements[1]=f*N+m*v+p*A,this.elements[2]=f*w+m*$+p*R,this.elements[3]=g*C+y*S+b*E,this.elements[4]=g*N+y*v+b*A,this.elements[5]=g*w+y*$+b*R,this.elements[6]=_*C+k*S+x*E,this.elements[7]=_*N+k*v+x*A,this.elements[8]=_*w+k*$+x*R,this.trigger(ee.Types.change)}inverse(e){const n=this.elements;e=e||new Jt;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,m=-h*a+c*d,p=u*a-l*d;let g=r*f+o*m+s*p;return g?(g=1/g,e.elements[0]=f*g,e.elements[1]=(-h*o+s*u)*g,e.elements[2]=(c*o-s*l)*g,e.elements[3]=m*g,e.elements[4]=(h*r-s*d)*g,e.elements[5]=(-c*r+s*a)*g,e.elements[6]=p*g,e.elements[7]=(-u*r+o*d)*g,e.elements[8]=(l*r-o*a)*g,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=Eg(e),r=Pg(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=cc(e);return this.multiply(1,n,0,0,1,0,0,0,1)}skewY(e){const n=cc(e);return this.multiply(1,0,0,n,1,0,0,0,1)}toString(e){return $s.length=0,this.toTransformArray(e,$s),$s.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],m=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]=m;return}return[s,c,h,a,d,f,l,u,m]}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],m=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]=m;return}return[s,a,l,c,d,u,h,f,m]}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 Jt().copy(this)}};B(dc,"Identity",[1,0,0,0,1,0,0,0,1]);var wi=dc;Wl(wi);var uc=class bl extends Gi{constructor(){super(),B(this,"_flagMatrix",!0),B(this,"_flagScale",!1),B(this,"_matrix",null),B(this,"_worldMatrix",null),B(this,"_position",null),B(this,"_rotation",0),B(this,"_scale",1),B(this,"_skewX",0),B(this,"_skewY",0);for(let e in ao)Object.defineProperty(this,e,ao[e]);this._renderer.flagMatrix=fc.bind(this),this.isShape=!0,this.matrix=new wi,this.worldMatrix=new wi,this.position=new re,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(e){const n=new bl().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 ao.position.get.apply(this,arguments)}set translation(e){ao.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(e,n,r){const o=r||{},s=o.ignoreVisibility===!0;if(!s&&"visible"in this&&this.visible===!1||!s&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const a=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const l=this.getBoundingClientRect();return l?e>=l.left-a&&e<=l.right+a&&n>=l.top-a&&n<=l.bottom+a:!1}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 bl;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}dispose(){super.dispose(),typeof this.translation=="object"&&typeof this.translation.unbind=="function"&&this.translation.unbind(),typeof this.scale=="object"&&typeof this.scale.unbind=="function"&&this.scale.unbind()}_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}};B(uc,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);var On=uc,ao={position:{enumerable:!0,get:function(){return this._position},set:function(t){this._position&&this._position.unbind(ee.Types.change,this._renderer.flagMatrix),this._position=t,this._position.bind(ee.Types.change,this._renderer.flagMatrix),fc.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(ee.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof re&&this._scale.bind(ee.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 _s(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function fc(){this._flagMatrix=!0}var hc=/^(?:none|transparent)$/i,Fg=8,Rs=Number.EPSILON;function zn(t,e){return{x:t,y:e}}function lo(t,e,n=Rs){return Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n}function mc(t,e,n,r){const o=t*n+e*r,s=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+r*r)||1e-12;let a=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*n<0&&(a=-a),a}function Vg(t,e,n){if(!t)return[zn(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[zn(e.x,e.y)];const s=(e.xAxisRotation||0)*Math.PI/180,a=e.largeArcFlag?1:0,l=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,h=e.y,f=(c-u)/2,m=(d-h)/2,p=Math.cos(s),g=Math.sin(s);let y=p*f+g*m,b=-g*f+p*m,_=r*r,k=o*o;const x=y*y/_+b*b/k;if(x>1){const P=Math.sqrt(x);r*=P,o*=P,_=r*r,k=o*o}const C=_*b*b+k*y*y,N=C===0?0:(_*k-C)/C;let w=Math.sqrt(Math.max(0,N));a===l&&(w=-w);const S=w*r*b/o,v=-w*o*y/r,$=p*S-g*v+(c+u)/2,E=g*S+p*v+(d+h)/2,A=mc(1,0,(y-S)/r,(b-v)/o),R=mc((y-S)/r,(b-v)/o,(-y-S)/r,(-b-v)/o)%tt,F=A+R,H=l===0,Q=(()=>{const P=F-A,V=Math.abs(P)<Number.EPSILON;let M=rt(P,tt);return M<Number.EPSILON&&(M=V?0:tt),H&&!V&&(M=M===tt?-tt:M-tt),M})(),Z=Math.max(xt.Resolution,Math.max(n*2,1)),O=[];for(let P=1;P<=Z;P++){const V=P/Z,M=A+V*Q;let L=$+r*Math.cos(M),Y=E+o*Math.sin(M);if(s!==0){const U=L-$,G=Y-E,q=Math.cos(s),W=Math.sin(s);L=U*q-G*W+$,Y=U*W+G*q+E}O.push(zn(L,Y))}return O}function Mg(t,e=Fg){const n=[],r=[],o=t._renderer&&t._renderer.vertices&&t._renderer.vertices.length>0?t._renderer.vertices:t.vertices;if(!o||o.length===0)return{polygons:n,segments:r};const s=Math.max(1,Math.floor(e));let a=null,l=null,c=null,d=null;const u=(f=!1)=>{if(a){if(f&&l&&c&&!lo(l,c)){const m=zn(l.x,l.y);r.push({a:c,b:m}),a.push(m),c=m}a.length>=3&&l&&c&&lo(l,c)&&n.push(a),a=null,l=null,c=null}},h=f=>{if(!c){c=f,a&&a.push(f);return}lo(c,f)||(r.push({a:c,b:f}),a&&a.push(f),c=f)};for(let f=0;f<o.length;f++){const m=o[f],p=m.command||(f===0?ie.move:ie.line);if(p===ie.move){u(!1);const g=zn(m.x,m.y);a=[g],l=g,c=g,d=m;continue}if(d||(d=o[Math.max(f-1,0)]),p===ie.line)h(zn(m.x,m.y));else if(p===ie.curve){const g=Ns(m,d,s);for(let y=1;y<g.length;y++){const b=g[y];h(zn(b.x,b.y))}h(zn(m.x,m.y))}else if(p===ie.arc){const g=Vg(d,m,s);for(let y=0;y<g.length;y++)h(g[y])}else if(p===ie.close){u(!0),d=m;continue}else h(zn(m.x,m.y));d=m}if(a){const f=!!t._closed||!!t.closed||l&&c&&!lo(l,c);u(f)}return{polygons:n,segments:r}}function Ag(t,e,n){let r=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.length<3)continue;let a=s.length-1;for(let l=0;l<s.length;l++){const c=s[a],d=s[l];d.y>n!=c.y>n&&e<(c.x-d.x)*(n-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function Ig(t,e,n,r){const o=r.x-n.x,s=r.y-n.y;if(Math.abs(o)<Rs&&Math.abs(s)<Rs){const f=t-n.x,m=e-n.y;return f*f+m*m}const a=((t-n.x)*o+(e-n.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=n.x+l*o,d=n.y+l*s,u=t-c,h=e-d;return u*u+h*h}function Og(t,e,n){if(!t||t.length===0)return 1/0;let r=1/0;for(let o=0;o<t.length;o++){const s=t[o],a=Ig(e,n,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function zg(t,e){if(typeof e=="boolean")return e;const n=t.fill;return!n&&n!==0?!1:typeof n=="string"?!hc.test(n):!0}function Dg(t,e){const n=typeof t.linewidth=="number"?t.linewidth:t._linewidth||0;if(typeof e=="boolean")return e&&n>0;if(!(n>0))return!1;const r=t.stroke;return!r&&r!==0?!1:typeof r=="string"?!hc.test(r):!0}function Lg(t,e,n,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,a=t.top-r,l=t.bottom+r;return e>=o&&e<=s&&n>=a&&n<=l}var co=Number.EPSILON;function uo(t){return typeof t.relative!="boolean"||!!t.relative}function dn(t,e,n,r){const o=t.controls;if(!(!o||!o[e])){if(Math.abs(n)<co&&Math.abs(r)<co){uo(t)?o[e].clear():o[e].set(t.x,t.y);return}uo(t)?o[e].set(n,r):o[e].set(t.x+n,t.y+r)}}function Lt(t,e){dn(t,e,0,0)}function Hg(t,e){const n=t.controls;return!n||!n[e]?{x:0,y:0}:uo(t)?{x:n[e].x,y:n[e].y}:{x:n[e].x-t.x,y:n[e].y-t.y}}function Zi(t,e){const n=Hg(t,e);return Math.abs(n.x)>co||Math.abs(n.y)>co}function fo(t){t.command===ie.move||t.command===ie.close||(t.command=Zi(t,"left")||Zi(t,"right")?ie.curve:ie.line)}function pc(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function Wg(t,e){return Zi(e,"right")||Zi(t,"left")||Zi(t,"right")||Zi(e,"left")||t.command===ie.curve||e.command===ie.curve}function Qi(t,e,n){return{x:Pt(t.x,e.x,n),y:Pt(t.y,e.y,n)}}function gc(t,e){const n=t.controls&&t.controls[e];return n?uo(t)?{x:t.x+n.x,y:t.y+n.y}:{x:n.x,y:n.y}:{x:t.x,y:t.y}}function jg(t,e,n){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},a=r?gc(t,"right"):Sr({},s),l={x:e.x,y:e.y},c=o?gc(e,"left"):Sr({},l),d=Qi(s,a,n),u=Qi(a,c,n),h=Qi(c,l,n),f=Qi(d,u,n),m=Qi(u,h,n),p=Qi(f,m,n),g=new Ne(p.x,p.y);return pc(g,t),dn(g,"left",f.x-p.x,f.y-p.y),dn(g,"right",m.x-p.x,m.y-p.y),g.command=ie.curve,{anchor:g,startOut:d,endIn:h}}function qg(t,e,n,r,o,s){const a=t.length,l=n-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,h=d;if(r||(u=Math.min(1,e),h=Math.min(1,a-n-1)),c+=u+h,c<=1)return;const f=new Array(c+1);for(let w=0,S=e-u;w<=c;w+=1,S+=1){const v=rt(S,a);f[w]=t[v]}let m=f[0].x+2*f[1].x,p=f[0].y+2*f[1].y,g=2;const y=c-1,b=[m],_=[p],k=[g],x=new Array(c+1),C=new Array(c+1);for(let w=1;w<c;w+=1){const S=w<y,v=S||s?1:2,$=S?4:s?2:7,E=S?4:s?3:8,A=S?2:s?0:1,R=v/g;g=k[w]=$-R,m=b[w]=E*f[w].x+A*f[w+1].x-R*m,p=_[w]=E*f[w].y+A*f[w+1].y-R*p}x[y]=b[y]/k[y],C[y]=_[y]/k[y];for(let w=c-2;w>=0;w-=1)x[w]=(b[w]-x[w+1])/k[w],C[w]=(_[w]-C[w+1])/k[w];x[c]=(3*f[c].x-x[y])/2,C[c]=(3*f[c].y-C[y])/2;const N=c-h;for(let w=u,S=e;w<=N;w+=1,S+=1){const v=rt(S,a),$=t[v],E=x[w]-$.x,A=C[w]-$.y;o||w<N?dn($,"right",E,A):Lt($,"right"),o||w>u?dn($,"left",-E,-A):Lt($,"left"),fo($)}}function Xg(t,e,n,r,o,s){const a=e||t,l=t,c=n||t,d=re.distanceBetween(a,l),u=re.distanceBetween(l,c),h=r===void 0?.5:r,f=Math.pow(d,h),m=Math.pow(u,h),p=f*f,g=m*m;if(!o&&e){const y=2*g+3*m*f+p,b=3*m*(m+f);if(b!==0){const _=(g*a.x+y*l.x-p*c.x)/b-l.x,k=(g*a.y+y*l.y-p*c.y)/b-l.y;dn(t,"left",_,k)}else Lt(t,"left")}else Lt(t,"left");if(!s&&n){const y=2*p+3*f*m+g,b=3*f*(f+m);if(b!==0){const _=(p*c.x+y*l.x-g*a.x)/b-l.x,k=(p*c.y+y*l.y-g*a.y)/b-l.y;dn(t,"right",_,k)}else Lt(t,"right")}else Lt(t,"right");fo(t)}function Yg(t,e,n,r,o,s){if(!(e&&n)){e||Lt(t,"left"),n||Lt(t,"right"),fo(t);return}const a=e,l=t,c=n,d=re.distanceBetween(a,l),u=re.distanceBetween(l,c),h=d+u,f=r===void 0?.4:r,m={x:a.x-c.x,y:a.y-c.y};if(!o&&h!==0){const p=f*d/h;dn(t,"left",m.x*p,m.y*p)}else Lt(t,"left");if(!s&&h!==0){const p=f*d/h-f;dn(t,"right",m.x*p,m.y*p)}else Lt(t,"right");fo(t)}function Ug(t,e,n,r,o,s){const a=s.type,l=s.factor,c=t.length;for(let d=e;d<=n;d+=1){const u=rt(d,c),h=t[u];if(h.command===ie.move){Lt(h,"left"),Lt(h,"right");continue}const f=d===e&&!o?null:d-1,m=d===n&&!o?null:d+1,p=f===null?null:t[rt(f,c)],g=m===null?null:t[rt(m,c)],y=f===null,b=m===null;a==="geometric"?Yg(h,p,g,l,y,b):Xg(h,p,g,l,y,b)}}var Ji=Math.min,er=Math.max,Kg=Math.ceil,Gg=Math.floor,Zg=new re,Qg=new wi,Es=class pi extends On{constructor(e,n,r,o){super(),B(this,"_flagVertices",!0),B(this,"_flagLength",!0),B(this,"_flagFill",!0),B(this,"_flagStroke",!0),B(this,"_flagLinewidth",!0),B(this,"_flagOpacity",!0),B(this,"_flagVisible",!0),B(this,"_flagCap",!0),B(this,"_flagJoin",!0),B(this,"_flagMiter",!0),B(this,"_flagStrokeAttenuation",!0),B(this,"_flagMask",!1),B(this,"_flagClip",!1),B(this,"_length",0),B(this,"_fill","#fff"),B(this,"_stroke","#000"),B(this,"_linewidth",1),B(this,"_opacity",1),B(this,"_visible",!0),B(this,"_cap","round"),B(this,"_join","round"),B(this,"_miter",4),B(this,"_closed",!0),B(this,"_curved",!1),B(this,"_automatic",!0),B(this,"_beginning",0),B(this,"_ending",1),B(this,"_mask",null),B(this,"_clip",!1),B(this,"_dashes",null),B(this,"_strokeAttenuation",!0);for(let s in yc)Object.defineProperty(this,s,yc[s]);this._renderer.type="path",this._renderer.flagVertices=bc.bind(this),this._renderer.bindVertices=_c.bind(this),this._renderer.unbindVertices=wc.bind(this),this._renderer.flagFill=xc.bind(this),this._renderer.flagStroke=kc.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:_i(e.fill),r=typeof e.stroke=="string"?e.stroke:_i(e.stroke),o=new pi().copy(bs(Sr({},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 Ne?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Ne().copy(r))}}for(let n=0;n<pi.Properties.length;n++){const r=pi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new pi;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<pi.Properties.length;r++){const o=pi.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()),oe.each(pi.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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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:m}=bi(n.elements[0],n.elements[3],n.elements[1],n.elements[4],n.elements[2],n.elements[5]);typeof f=="number"&&typeof m=="number"&&(r=Math.max(f,m)*(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,m]=n.multiply(a.x,a.y),[p,g]=n.multiply(l.x,l.y);if(a.controls&&l.controls){let y=a.controls.right.x,b=a.controls.right.y;a.relative&&(y+=a.x,b+=a.y);let[_,k]=n.multiply(y,b),x=l.controls.left.x,C=l.controls.left.y;l.relative&&(x+=l.x,C+=l.y);let[N,w]=n.multiply(x,C);const S=Ul(f,m,_,k,N,w,p,g);u=Ji(S.min.y-r,u),c=Ji(S.min.x-r,c),d=er(S.max.x+r,d),h=er(S.max.y+r,h)}else s<=1&&(u=Ji(m-r,u),c=Ji(f-r,c),d=er(f+r,d),h=er(m+r,h)),u=Ji(g-r,u),c=Ji(p-r,c),d=er(p+r,d),h=er(g+r,h)}return{top:u,left:c,right:d,bottom:h,width:d-c,height:h-u}}contains(e,n,r){const o=r||{},s=o.ignoreVisibility===!0;if(!s&&this.visible===!1||!s&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const a=typeof o.tolerance=="number"?o.tolerance:0;this._update(!0);const l=this.getBoundingClientRect();if(!l||e<l.left-a||e>l.right+a||n<l.top-a||n>l.bottom+a)return!1;const c=this.worldMatrix,d=c&&c.inverse(Qg);if(!d)return super.contains(e,n,o);const[u,h]=d.multiply(e,n,1),f=typeof o.precision=="number"&&!Number.isNaN(o.precision)?Math.max(1,Math.floor(o.precision)):8,m=zg(this,o.fill),p=Dg(this,o.stroke),{polygons:g,segments:y}=Mg(this,f);if(m&&g.length>0&&Ag(g,u,h))return!0;if(p&&y.length>0){const b=typeof this.linewidth=="number"?this.linewidth:0;if(b>0&&Og(y,u,h)<=b/2+a)return!0}return!m&&!p?super.contains(e,n,o):m&&g.length===0?super.contains(e,n,o):!1}getPointAt(e,n){let r,o,s,a,l,c,d,u,h,f,m,p,g,y,b,_=this.length*Math.min(Math.max(e,0),1);const k=this.vertices.length,x=k-1;let C=null,N=null;for(let Z=0,O=this._lengths.length,P=0;Z<O;Z++){if(P+this._lengths[Z]>=_){this._closed?(r=rt(Z,k),o=rt(Z-1,k),Z===0&&(r=o,o=Z)):(r=Z,o=Math.min(Math.max(Z-1,0),x)),C=this.vertices[r],N=this.vertices[o],_-=P,this._lengths[Z]!==0?e=_/this._lengths[Z]:e=0;break}P+=this._lengths[Z]}if(C===null||N===null)return null;if(C){if(!N)return C}else return N;b=N.controls&&N.controls.right,y=C.controls&&C.controls.left,l=N.x,f=N.y,c=(b||N).x,m=(b||N).y,d=(y||C).x,p=(y||C).y,u=C.x,g=C.y,b&&N.relative&&(c+=N.x,m+=N.y),y&&C.relative&&(d+=C.x,p+=C.y),a=Br(e,l,c,d,u),h=Br(e,f,m,p,g);const w=Pt(l,c,e),S=Pt(f,m,e),v=Pt(c,d,e),$=Pt(m,p,e),E=Pt(d,u,e),A=Pt(p,g,e),R=Pt(w,v,e),F=Pt(S,$,e),H=Pt(v,E,e),Q=Pt($,A,e);return oe.isObject(n)?(n.x=a,n.y=h,n instanceof Ne&&(n.controls.left.x=R,n.controls.left.y=F,n.controls.right.x=H,n.controls.right.y=Q,(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 Ne(a,h,R-a,F-h,H-a,Q-h,this._curved?ie.curve:ie.line),s.t=e,s)}plot(){if(this.curved)return Gl(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?ie.move:ie.line;return this}smooth(e){const n=e||{},r=n.type||"continuous",o=this._collection,s=o.length;if(s<2)return this;const a=this._closed||s>0&&o[s-1]&&o[s-1].command===ie.close,l=(f,m)=>{if(f==null)return m;if(typeof f=="number"){if(a)return rt(f,s);let g=f;return g<0&&(g+=s),Math.min(Math.max(g,0),s-1)}const p=o.indexOf(f);return p!==-1?p:m},c=a&&n.from===void 0&&n.to===void 0;let d=l(n.from,0),u=l(n.to,s-1);if(d>u)if(a)d-=s;else{const f=d;d=u,u=f}const h=u-d+1;for(let f=0;f<h;f+=1){const m=rt(d+f,s),p=o[m],g=!a&&m===0;p.command===ie.move&&!g&&(p.command=ie.line)}if(r==="continuous"||r==="asymmetric")qg(o,d,u,a,c,r==="asymmetric");else if(r==="catmull-rom"||r==="geometric"){const f={type:r,factor:n.factor};Ug(o,d,u,a,c,f)}else throw new Error(`Path.smooth does not support type "${r}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(e){this._update();const n=this.vertices,r=n.length;if(r<2)return this;const o=[];let s=null,a=null;for(let l=0;l<r;l+=1){const c=n[l];if(!s||c.command===ie.move){const u=c.clone();o.push(u),s=c,a=c;continue}if(Wg(c,s)){const h=Ns(c,s,e).length,f=o[o.length-1];let m=f.clone(),p=c.clone(),g=f,y=0;if(h<=1){const b=c.clone();o.push(b)}else{for(let _=1;_<h;_+=1){const k=_/h,x=1-y,C=x<=Number.EPSILON?k:(k-y)/x,N=jg(m,p,C);dn(g,"right",N.startOut.x-g.x,N.startOut.y-g.y);const w=N.anchor;o.push(w),g=w,m=w.clone(),y=k,dn(p,"left",N.endIn.x-p.x,N.endIn.y-p.y)}const b=c.clone();b.controls.left.copy(p.controls.left),o.push(b)}}else{const u=Ns(c,s,e);for(let f=1;f<u.length;f+=1){const m=u[f];pc(m,s),Lt(m,"left"),Lt(m,"right"),m.command=ie.line,o.push(m)}const h=c.clone();o.push(h)}s=c,c.command===ie.close&&(s=a)}return this._automatic=!1,this._curved=!1,this.vertices=o,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=[]),oe.each(this.vertices,function(l,c){if(c<=0||l.command===ie.move){s=l,this._lengths[c]=0;return}this._lengths[c]=lc(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=so(this,r*this._length),a=so(this,o*this._length),l=Kg(s),c=Gg(a);let d,u,h,f,m,p;for(this._renderer.vertices.length=0,p=0;p<e;p++)this._renderer.collection.length<=p&&this._renderer.collection.push(new Ne),p>c&&!u?(m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(o,m),m.command=this._renderer.collection[p].command,this._renderer.vertices.push(m),u=m,h=this._collection[p-1],h&&h.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),h.relative?this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(re.zero,1-m.t):this._renderer.collection[p-1].controls.right.copy(h.controls.right).lerp(h,1-m.t))):p>=l&&p<=c&&(m=this._renderer.collection[p].copy(this._collection[p]),this._renderer.vertices.push(m),p===c&&ac(this,o)?(u=m,!n&&u.controls&&(u.relative?u.controls.right.clear():u.controls.right.copy(u))):p===l&&ac(this,r)&&(d=m,d.command=ie.move,!n&&d.controls&&(d.relative?d.controls.left.clear():d.controls.left.copy(d))));l>0&&!d&&(p=l-1,m=this._renderer.collection[p].copy(this._collection[p]),this.getPointAt(r,m),m.command=ie.move,this._renderer.vertices.unshift(m),f=this._collection[p+1],f&&f.controls&&(m.controls.left.clear(),f.relative?this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(re.zero,m.t):(Zg.copy(f),this._renderer.collection[p+1].controls.left.copy(f.controls.left).lerp(f,m.t))))}return On.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,On.prototype.flagReset.call(this),this}};B(Es,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),B(Es,"Utils",{getCurveLength:lc});var Re=Es,yc={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 dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.bind(ee.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";oe.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(ee.Types.insert,e).unbind(ee.Types.remove,n),t instanceof ii?this._collection=t:this._collection=new ii(t||[]),this._collection.bind(ee.Types.insert,e).bind(ee.Types.remove,n),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,oe.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 bc(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function _c(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function wc(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function xc(){this._flagFill=!0}function kc(){this._flagStroke=!0}var vc=class Gr extends Re{constructor(e,n,r,o){const s=[new Ne,new Ne,new Ne,new Ne];super(s,!0,!1,!0),B(this,"_flagWidth",!1),B(this,"_flagHeight",!1),B(this,"_width",0),B(this,"_height",0),B(this,"_origin",null),this._renderer.type="rectangle";for(let a in Cc)Object.defineProperty(this,a,Cc[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 Gr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Gr.Properties.length;n++){const r=Gr.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 Ne),this.vertices[0].set(-e,-n).sub(this._origin).command=ie.move,this.vertices[1].set(e,-n).sub(this._origin).command=ie.line,this.vertices[2].set(e,n).sub(this._origin).command=ie.line,this.vertices[3].set(-e,n).sub(this._origin).command=ie.line,this.vertices[4]&&(this.vertices[4].set(-e,-n).sub(this._origin).command=ie.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(e){const n=new Gr(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<Re.Properties.length;r++){const o=Re.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}};B(vc,"Properties",["width","height","origin"]);var oi=vc,Cc={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(ee.Types.change,this._renderer.flagVertices),this._origin=t,this._origin.bind(ee.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},Sc=class Zr extends oi{constructor(e,n,r,o,s,a){super(n,r,0,0),B(this,"_flagTexture",!1),B(this,"_flagColumns",!1),B(this,"_flagRows",!1),B(this,"_flagFrameRate",!1),B(this,"_flagIndex",!1),B(this,"_amount",1),B(this,"_duration",0),B(this,"_startTime",0),B(this,"_playing",!1),B(this,"_firstFrame",0),B(this,"_lastFrame",0),B(this,"_loop",!0),B(this,"_texture",null),B(this,"_columns",1),B(this,"_rows",1),B(this,"_frameRate",0),B(this,"_index",0),B(this,"_origin",null),this._renderer.type="sprite";for(let l in Bc)Object.defineProperty(this,l,Bc[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 Zr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Zr.Properties.length;n++){const r=Zr.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=oe.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 Zr(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&&(oe.isNaN(this._lastFrame)&&(this._lastFrame=l-1),a=oe.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=Pt(this._firstFrame,f,a/c),d=Math.floor(d),d!==this._index&&(this._index=d,d>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%n,p=Math.floor(this._index/n),g=-o*m+(u-o)/2,y=-s*p+(h-s)/2;g!==e.offset.x&&(e.offset.x=g),y!==e.offset.y&&(e.offset.y=y)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};B(Sc,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);var ho=Sc,Bc={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}}},Ps,Tc=class extends ii{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),zl(this,Ps,{}),this.attach(e),this.on(ee.Types.insert,this.attach),this.on(ee.Types.remove,this.detach)}get ids(){return zt(this,Ps)}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}};Ps=new WeakMap;var Nc=class Hi extends Re{constructor(e,n,r,o,s,a,l){const c=l||xt.Resolution*3,d=[];for(let u=0;u<c;u++)d.push(new Ne);super(d,!0,!1,!0),B(this,"_flagStartAngle",!1),B(this,"_flagEndAngle",!1),B(this,"_flagInnerRadius",!1),B(this,"_flagOuterRadius",!1),B(this,"_startAngle",0),B(this,"_endAngle",tt),B(this,"_innerRadius",0),B(this,"_outerRadius",0),this._renderer.type="arc-segment";for(let u in $c)Object.defineProperty(this,u,$c[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 Hi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Hi.Properties.length;n++){const r=Hi.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=rt(e,tt)===rt(n,tt),a=r>0,l=this.vertices;let c=a?l.length/2:l.length,d,u=0,h,f,m,p,g,y,b,_,k;for(s?c--:a||(c-=2),h=0,f=c-1;h<c;h++){switch(m=h/f,p=l[u],g=m*(n-e)+e,y=(n-e)/c,b=o*Math.cos(g),_=o*Math.sin(g),h){case 0:d=ie.move;break;default:d=ie.curve}p.command=d,p.x=b,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===ie.curve&&(k=o*y/Math.PI,p.controls.left.x=k*Math.cos(g-ct),p.controls.left.y=k*Math.sin(g-ct),p.controls.right.x=k*Math.cos(g+ct),p.controls.right.y=k*Math.sin(g+ct),h===1&&p.controls.left.multiplyScalar(2),h===f&&p.controls.right.multiplyScalar(2)),u++}if(a){for(s?(l[u].command=ie.close,u++):(c--,f=c-1),h=0;h<c;h++)m=h/f,p=l[u],g=(1-m)*(n-e)+e,y=(n-e)/c,b=r*Math.cos(g),_=r*Math.sin(g),d=ie.curve,h<=0&&(d=s?ie.move:ie.line),p.command=d,p.x=b,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===ie.curve&&(k=r*y/Math.PI,p.controls.left.x=k*Math.cos(g+ct),p.controls.left.y=k*Math.sin(g+ct),p.controls.right.x=k*Math.cos(g-ct),p.controls.right.y=k*Math.sin(g-ct),h===1&&p.controls.left.multiplyScalar(2),h===f&&p.controls.right.multiplyScalar(2)),u++;l[u].copy(l[0]),l[u].command=ie.line}else s||(l[u].command=ie.line,l[u].x=0,l[u].y=0,u++,l[u].copy(l[0]),l[u].command=ie.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 Hi(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<Re.Properties.length;c++){const d=Re.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<Hi.Properties.length;n++){const r=Hi.Properties[n];e[r]=this[r]}return e}};B(Nc,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);var Fs=Nc,$c={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}}},Vs=Math.cos,Ms=Math.sin,Rc=class Wi extends Re{constructor(e,n,r,o){const s=o?Math.max(o,2):4,a=[];for(let l=0;l<s;l++)a.push(new Ne(0,0,0,0,0,0));super(a,!0,!0,!0),B(this,"_flagRadius",!1),B(this,"_radius",0),this._renderer.type="circle";for(let l in Ec)Object.defineProperty(this,l,Ec[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 Wi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Wi.Properties.length;n++){const r=Wi.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*tt,c=r*Vs(l),d=r*Ms(l),u=o*Vs(l-ct),h=o*Ms(l-ct),f=o*Vs(l+ct),m=o*Ms(l+ct),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,h),p.controls.right.set(f,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(e){const n=new Wi(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<Re.Properties.length;r++){const o=Re.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<Wi.Properties.length;n++){const r=Wi.Properties[n];e[r]=this[r]}return e}};B(Rc,"Properties",["radius"]);var mo=Rc,Ec={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},As=Math.cos,Is=Math.sin,Pc=class ji extends Re{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 Ne);super(l,!0,!0,!0),B(this,"_flagWidth",!1),B(this,"_flagHeight",!1),B(this,"_width",0),B(this,"_height",0),this._renderer.type="ellipse";for(let c in Fc)Object.defineProperty(this,c,Fc[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 ji().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<ji.Properties.length;n++){const r=ji.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*tt,c=r*As(l),d=o*Is(l),u=r*n*As(l-ct),h=o*n*Is(l-ct),f=r*n*As(l+ct),m=o*n*Is(l+ct),p=this.vertices[s];p.command=s===0?ie.move:ie.curve,p.set(c,d),p.controls.left.set(u,h),p.controls.right.set(f,m)}}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 ji(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<Re.Properties.length;a++){const l=Re.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<ji.Properties.length;n++){const r=ji.Properties[n];e[r]=this[r]}return e}};B(Pc,"Properties",["width","height"]);var po=Pc,Fc={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}}},Jg=Math.ceil,ey=Math.floor,Vc=class gi extends On{constructor(e){super(),B(this,"_flagVertices",!0),B(this,"_flagLength",!0),B(this,"_flagFill",!0),B(this,"_flagStroke",!0),B(this,"_flagLinewidth",!0),B(this,"_flagOpacity",!0),B(this,"_flagVisible",!0),B(this,"_flagSize",!0),B(this,"_flagSizeAttenuation",!0),B(this,"_flagStrokeAttenuation",!0),B(this,"_length",0),B(this,"_fill","#fff"),B(this,"_stroke","#000"),B(this,"_linewidth",1),B(this,"_opacity",1),B(this,"_visible",!0),B(this,"_size",1),B(this,"_sizeAttenuation",!1),B(this,"_beginning",0),B(this,"_ending",1),B(this,"_dashes",null),B(this,"_strokeAttenuation",!0),B(this,"noFill",Re.prototype.noFill),B(this,"noStroke",Re.prototype.noStroke),B(this,"corner",Re.prototype.corner),B(this,"center",Re.prototype.center),B(this,"getBoundingClientRect",Re.prototype.getBoundingClientRect),B(this,"_updateLength",Re.prototype._updateLength);for(let n in Mc)Object.defineProperty(this,n,Mc[n]);this._renderer.type="points",this._renderer.flagVertices=bc.bind(this),this._renderer.bindVertices=_c.bind(this),this._renderer.unbindVertices=wc.bind(this),this._renderer.flagFill=xc.bind(this),this._renderer.flagStroke=kc.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:_i(e.fill),r=typeof e.stroke=="string"?e.stroke:_i(e.stroke),o=new gi().copy(bs(Sr({},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 Ne?this.vertices.push(e.vertices[n].clone()):this.vertices.push(new Ne().copy(r))}for(let n=0;n<gi.Properties.length;n++){const r=gi.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new gi;for(let r=0;r<this.vertices.length;r++)n.vertices.push(this.vertices[r].clone());for(let r=0;r<gi.Properties.length;r++){const o=gi.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()),oe.each(gi.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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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=xs(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=so(this,e*this._length),o=so(this,n*this._length),s=Jg(r),a=ey(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}};B(Vc,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);var Os=Vc,Mc={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 dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.bind(ee.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(ee.Types.insert,e).unbind(ee.Types.remove,n),t instanceof ii?this._collection=t:this._collection=new ii(t||[]),this._collection.bind(ee.Types.insert,e).bind(ee.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}}},ty=Math.cos,ny=Math.sin,Ac=class qi extends Re{constructor(e,n,r,o){o=Math.max(o||0,3),super(),B(this,"_flagWidth",!1),B(this,"_flagHeight",!1),B(this,"_flagSides",!1),B(this,"_radius",0),B(this,"_width",0),B(this,"_height",0),B(this,"_sides",0),this._renderer.type="polygon";for(let s in Ic)Object.defineProperty(this,s,Ic[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 qi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<qi.Properties.length;n++){const r=qi.Properties[n];r in e&&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=tt*s+Math.PI/2,l=this._width*ty(a)/2,c=this._height*ny(a)/2;o>=r?this.vertices.push(new Ne(l,c)):this.vertices[o].set(l,c),this.vertices[o].command=o===0?ie.move:ie.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 qi(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<Re.Properties.length;r++){const o=Re.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<qi.Properties.length;n++){const r=qi.Properties[n];e[r]=this[r]}return e}};B(Ac,"Properties",["width","height","sides"]);var zs=Ac,Ic={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}}},Oc=class Xi extends Re{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 Ne(0,0,0,0,0,0,l===0?ie.move:ie.curve));super(a),B(this,"_flagWidth",!1),B(this,"_flagHeight",!1),B(this,"_flagRadius",!1),B(this,"_width",0),B(this,"_height",0),B(this,"_radius",12),this._renderer.type="rounded-rectangle";for(let l in zc)Object.defineProperty(this,l,zc[l]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=iy.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 Xi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Xi.Properties.length;n++){const r=Xi.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 Xi(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<Re.Properties.length;a++){const l=Re.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<Xi.Properties.length;n++){const r=Xi.Properties[n];e[r]=this[r]}return e.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),e}};B(Oc,"Properties",["width","height","radius"]);var go=Oc,zc={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(ee.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof re&&this._radius.bind(ee.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function iy(){this._flagRadius=!0}var ry=Math.cos,oy=Math.sin,Dc=class Yi extends Re{constructor(e,n,r,o,s){arguments.length<=3&&(o=r,r=o/2),(typeof s!="number"||s<=0)&&(s=5),super(),B(this,"_flagInnerRadius",!1),B(this,"_flagOuterRadius",!1),B(this,"_flagSides",!1),B(this,"_innerRadius",0),B(this,"_outerRadius",0),B(this,"_sides",0),this._renderer.type="star";for(let a in Lc)Object.defineProperty(this,a,Lc[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 Yi().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Yi.Properties.length;n++){const r=Yi.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=tt*s,l=(o%2?this._outerRadius:this._innerRadius)/2,c=l*ry(a),d=l*oy(a);o>=r?this.vertices.push(new Ne(c,d)):this.vertices[o].set(c,d),this.vertices[o].command=o===0?ie.move:ie.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 Yi(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<Re.Properties.length;a++){const l=Re.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<Yi.Properties.length;n++){const r=Yi.Properties[n];e[r]=this[r]}return e}};B(Dc,"Properties",["innerRadius","outerRadius","sides"]);var Ds=Dc,Lc={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}}},Ls,Hc=Math.min,Wc=Math.max;Ue.document&&(Ls=document.createElement("canvas"));var Hs=class en extends On{constructor(e,n,r,o){super(),B(this,"_flagValue",!0),B(this,"_flagFamily",!0),B(this,"_flagSize",!0),B(this,"_flagLeading",!0),B(this,"_flagAlignment",!0),B(this,"_flagBaseline",!0),B(this,"_flagStyle",!0),B(this,"_flagWeight",!0),B(this,"_flagDecoration",!0),B(this,"_flagFill",!0),B(this,"_flagStroke",!0),B(this,"_flagLinewidth",!0),B(this,"_flagOpacity",!0),B(this,"_flagVisible",!0),B(this,"_flagMask",!1),B(this,"_flagClip",!1),B(this,"_flagDirection",!0),B(this,"_flagStrokeAttenuation",!0),B(this,"_value",""),B(this,"_family","sans-serif"),B(this,"_size",13),B(this,"_leading",17),B(this,"_alignment","center"),B(this,"_baseline","middle"),B(this,"_style","normal"),B(this,"_weight",500),B(this,"_decoration","none"),B(this,"_direction","ltr"),B(this,"_fill","#000"),B(this,"_stroke","none"),B(this,"_linewidth",1),B(this,"_opacity",1),B(this,"_visible",!0),B(this,"_mask",null),B(this,"_clip",!1),B(this,"_dashes",null),B(this,"_strokeAttenuation",!0);for(let s in jc)Object.defineProperty(this,s,jc[s]);if(this._renderer.type="text",this._renderer.flagFill=sy.bind(this),this._renderer.flagStroke=ay.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,!oe.isObject(o))return this;for(let s=0;s<en.Properties.length;s++){const a=en.Properties[s];a in o&&(this[a]=o[a])}}static Measure(e){if(Ls){const n=Ls.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*en.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:_i(e.fill),r=typeof e.stroke=="string"?e.stroke:_i(e.stroke),o=new en().copy(bs(Sr({},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<en.Properties.length;n++){const r=en.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new en(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let r=0;r<en.Properties.length;r++){const o=en.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<en.Properties.length;n++){const r=en.Properties[n];e[r]=this[r]}return e}dispose(){return super.dispose(),typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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}=en.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,m]=n.multiply(r,a),[p,g]=n.multiply(o,s),[y,b]=n.multiply(o,a);return s=Hc(h,m,g,b),r=Hc(u,f,p,y),o=Wc(u,f,p,y),a=Wc(h,m,g,b),{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}};B(Hs,"Ratio",.6),B(Hs,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);var xn=Hs,jc={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 dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.unbind(ee.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof dt||this._fill instanceof Ke||this._fill instanceof Ge||this._fill instanceof Oe)&&this._fill.bind(ee.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.unbind(ee.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof dt||this._stroke instanceof Ke||this._stroke instanceof Ge||this._stroke instanceof Oe)&&this._stroke.bind(ee.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(t){this._mask=t,this._flagMask=!0,oe.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 sy(){this._flagFill=!0}function ay(){this._flagStroke=!0}var Ws=class yr extends oi{constructor(e,n,r,o){super(n,r,0,0),B(this,"_flagTextures",!1),B(this,"_flagFrameRate",!1),B(this,"_flagIndex",!1),B(this,"_amount",1),B(this,"_duration",0),B(this,"_index",0),B(this,"_startTime",0),B(this,"_playing",!1),B(this,"_firstFrame",0),B(this,"_lastFrame",0),B(this,"_loop",!0),B(this,"_textures",null),B(this,"_frameRate",0),B(this,"_origin",null),this._renderer.type="image-sequence";for(let s in qc)Object.defineProperty(this,s,qc[s]);this._renderer.flagTextures=ly.bind(this),this._renderer.bindTextures=cy.bind(this),this._renderer.unbindTextures=dy.bind(this),this.noStroke(),this.noFill(),Array.isArray(e)?this.textures=e.map(Xc.bind(this)):typeof e=="string"&&(this.textures=[Xc(e)]),this.origin=new re,this._update(),typeof o=="number"?this.frameRate=o:this.frameRate=yr.DefaultFrameRate,this.index=0}static fromObject(e){const n=new yr().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<yr.Properties.length;n++){const r=yr.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=oe.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 yr(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,oe.isNaN(this._lastFrame)&&(this._lastFrame=s-1),o=oe.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=Pt(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}};B(Ws,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),B(Ws,"DefaultFrameRate",30);var js=Ws,qc={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(ee.Types.insert,e).unbind(ee.Types.remove,n),this._textures=new ii((t||[]).slice(0)),this._textures.bind(ee.Types.insert,e).bind(ee.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 ly(){this._flagTextures=!0}function cy(t){let e=t.length;for(;e--;)t[e].bind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function dy(t){let e=t.length;for(;e--;)t[e].unbind(ee.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Xc(t){if(t instanceof Oe)return t;if(typeof t=="string")return new Oe(t)}var yo=Math.min,bo=Math.max,uy={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},qs=class an extends On{constructor(e){super(),B(this,"_flagAdditions",!1),B(this,"_flagSubtractions",!1),B(this,"_flagOrder",!1),B(this,"_flagOpacity",!0),B(this,"_flagBeginning",!1),B(this,"_flagEnding",!1),B(this,"_flagLength",!1),B(this,"_flagMask",!1),B(this,"_fill","#fff"),B(this,"_stroke","#000"),B(this,"_linewidth",1),B(this,"_opacity",1),B(this,"_visible",!0),B(this,"_cap","round"),B(this,"_join","round"),B(this,"_miter",4),B(this,"_closed",!0),B(this,"_curved",!1),B(this,"_automatic",!0),B(this,"_beginning",0),B(this,"_ending",1),B(this,"_length",0),B(this,"_mask",null),B(this,"_strokeAttenuation",!0);for(let n in Yc)Object.defineProperty(this,n,Yc[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++)Uc.call(this,e[n],this)}static RemoveChildren(e){for(let n=0;n<e.length;n++)Uc.call(this,e[n])}static OrderChildren(e){this._flagOrder=!0}static fromObject(e){const n=new an;for(let o=0;o<an.Properties.length;o++){const s=an.Properties[o];s in e&&(/(fill|stroke)/i.test(s)?n[s]=typeof e[s]=="string"?e[s]:_i(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 Fs.fromObject(o);case"circle":return mo.fromObject(o);case"element":return Gi.fromObject(o);case"ellipse":return po.fromObject(o);case"group":return an.fromObject(o);case"image":return Image.fromObject(o);case"image-sequence":return js.fromObject(o);case"path":return Re.fromObject(o);case"points":return Os.fromObject(o);case"polygon":return zs.fromObject(o);case"rectangle":return oi.fromObject(o);case"rounded-rectangle":return go.fromObject(o);case"shape":return On.fromObject(o);case"sprite":return ho.fromObject(o);case"star":return Ds.fromObject(o);case"text":return xn.fromObject(o)}return o}}static IsVisible(e,n){if(!n)return!0;let r=e;for(;r;){if(typeof r.visible=="boolean"&&!r.visible||typeof r.opacity=="number"&&r.opacity<=0)return!1;r=r.parent}return!0}static VisitForHitTest(e,n,r,o,s,a,l){const c=e&&e.children;if(!c)return!1;const d=n.results;for(let u=c.length-1;u>=0;u--){const h=c[u];if(!h||!an.IsVisible(h,n.visibleOnly))continue;const f=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null;if(!(f&&!Lg(f,n.x,n.y,a))){if(h instanceof an){if(r&&(!o||o(h))&&typeof h.contains=="function"&&h.contains(n.x,n.y,s)&&(d.push(h),l)||an.VisitForHitTest(h,n,r,o,s,a,l))return!0;continue}if(h instanceof On&&!(o&&!o(h))&&typeof h.contains=="function"&&h.contains(n.x,n.y,s)&&(d.push(h),l))return!0}}return!1}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<an.Properties.length;n++){const r=an.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new an,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,oe.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}getShapesAtPoint(e,n,r){const o=r||{},{results:s,hitOptions:a,context:l,single:c,empty:d}=uy.getShapesAtPoint;s.length=0;const u=o.mode==="deepest"||o.deepest?"deepest":"all",h=o.visibleOnly!==!1,f=!!o.includeGroups,m=typeof o.filter=="function"?o.filter:null,p=typeof o.tolerance=="number"?o.tolerance:0;typeof o.precision=="number"?a.precision=o.precision:delete a.precision,typeof o.fill<"u"?a.fill=o.fill:delete a.fill,typeof o.stroke<"u"?a.stroke=o.stroke:delete a.stroke,a.tolerance=p,a.ignoreVisibility=!h;const g=u==="deepest";if(l.x=e,l.y=n,l.visibleOnly=h,l.results=s,an.VisitForHitTest(this,l,f,m,a,p,g),g){if(s.length>0){const b=s[0];return s.length=0,c[0]=b,c.length=1,c}return d.length=0,d}const y=s.slice();return s.length=0,y}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 m=0;m<this.children.length;m++){const p=this.children[m];if(!(!p.visible||f.test(p._renderer.type))&&(n=p.getBoundingClientRect(e),o=typeof n.top!="number"||oe.isNaN(n.top)||!isFinite(n.top),s=typeof n.left!="number"||oe.isNaN(n.left)||!isFinite(n.left),a=typeof n.right!="number"||oe.isNaN(n.right)||!isFinite(n.right),l=typeof n.bottom!="number"||oe.isNaN(n.bottom)||!isFinite(n.bottom),!(o||s||a||l)))if(e){const[g,y]=r.multiply(n.left,n.top),[b,_]=r.multiply(n.right,n.top),[k,x]=r.multiply(n.left,n.bottom),[C,N]=r.multiply(n.right,n.bottom);u=yo(y,_,x,N,u),c=yo(g,b,k,C,c),d=bo(g,b,k,C,d),h=bo(y,_,x,N,h)}else u=yo(n.top,u),c=yo(n.left,c),d=bo(n.right,d),h=bo(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}};B(qs,"Children",Tc),B(qs,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);var mt=qs,Yc={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=mt.InsertChildren.bind(this),n=mt.RemoveChildren.bind(this),r=mt.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Tc(t),this._children.bind(ee.Types.insert,e),this._children.bind(ee.Types.remove,n),this._children.bind(ee.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,oe.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 Uc(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 _o=class extends Re{constructor(e,n,r,o){const s=[new Ne(e,n),new Ne(r,o)];super(s);for(let a in Kc)Object.defineProperty(this,a,Kc[a]);this.vertices[0].command=ie.move,this.vertices[1].command=ie.line,this.automatic=!1}};B(_o,"Properties",["left","right"]);var Kc={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(oe.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=ie.move;else{const e=new Dt("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(oe.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=ie.line;else{const e=new Dt("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}},kn={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},fy={start:"left",middle:"center",end:"right"},Gc=["id","class","transform","xmlns","viewBox"],hy=["x","y","width","height","href","xlink:href"];function my(t){return fy[t]}function py(t){const e=t.getAttribute("dominant-baseline"),n=t.getAttribute("alignment-baseline");return e||n}function Tr(t){return t.replace(/svg:/gi,"").toLowerCase()}function Zc(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 gy(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 yy(t){const e={},n=by(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 by(t){const e=t.getAttributeNames();for(let n=0;n<Gc.length;n++){const r=Gc[n],o=Array.prototype.indexOf.call(e,r);o>=0&&e.splice(o,1)}return e}function _y(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 oi(0,0,s,a),t.mask.origin.set(-s/2,-a/2),t}function tn(t,e,n){const r={},o={},s={};let a,l,c,d,u,h,f,m,p,g,y,b,_,k,x,C,N;if(t===null)return r;if(Ue.getComputedStyle){const w=Ue.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)?gy(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&&oe.defaults(r,n),oe.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=bi(l),e._renderer.type){case"linear-gradient":Zc(f,e.left),Zc(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=bi(l),e.translation.set(f.translateX,f.translateY),e.rotation=Math.PI*(f.rotation/180),e.scale=new re(f.scaleX,f.scaleY),m=parseFloat((r.x+"").replace("px")),p=parseFloat((r.y+"").replace("px")),m&&(e.translation.x=m),p&&(e.translation.y=p);break;case"visible":if(e instanceof mt){e._visible=d;break}e.visible=d;break;case"stroke-linecap":if(e instanceof mt){e._cap=d;break}e.cap=d;break;case"stroke-linejoin":if(e instanceof mt){e._join=d;break}e.join=d;break;case"stroke-miterlimit":if(e instanceof mt){e._miter=d;break}e.miter=d;break;case"stroke-width":if(e instanceof mt){e._linewidth=parseFloat(d);break}e.linewidth=parseFloat(d);break;case"opacity":case"stroke-opacity":case"fill-opacity":if(e instanceof mt){e._opacity=parseFloat(d);break}e.opacity=parseFloat(d);break;case"clip-path":if(kn.cssBackgroundImage.test(d)&&(g=d.replace(kn.cssBackgroundImage,"$1"),Ye.defs.current&&Ye.defs.current.contains(g)&&(b=Ye.defs.current.get(g),b&&b.childNodes.length>0)))switch(b=b.childNodes[0],_=Tr(b.nodeName),e.mask=Ye[_].call(this,b,{}),e._renderer.type){case"text":case"path":e.position.add(e.mask.position),e.mask.position.clear();break}break;case"fill":case"stroke":u=(e instanceof mt?"_":"")+c,kn.cssBackgroundImage.test(d)?(g=d.replace(kn.cssBackgroundImage,"$1"),Ye.defs.current&&Ye.defs.current.contains(g)?(b=Ye.defs.current.get(g),b.object||(_=Tr(b.nodeName),b.object=Ye[_].call(this,b,{})),b=b.object):(y=xy(this),b=y.getById(g)),e[u]=b):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(k=e instanceof dt,x=e instanceof Ke,C=e instanceof Ge,k||x||C)break;d.match("[a-z%]$")&&!d.endsWith("px")&&(N=new Dt("only pixel values are supported with the "+c+" attribute."),console.warn(N.name,N.message)),e.translation[c]=parseFloat(d);break;case"font-family":e instanceof xn&&(e.family=d);break;case"font-size":e instanceof xn&&(d.match("[a-z%]$")&&!d.endsWith("px")&&(N=new Dt("only pixel values are supported with the "+c+" attribute."),console.warn(N.name,N.message)),e.size=parseFloat(d));break;case"font-weight":e instanceof xn&&(e.weight=d);break;case"font-style":e instanceof xn&&(e.style=d);break;case"text-decoration":e instanceof xn&&(e.decoration=d);break;case"line-height":e instanceof xn&&(e.leading=d);break}return Object.keys(t.dataset).length&&(e.dataset=t.dataset),r}function wy(t,e){for(let n=0,r=t.childNodes.length;n<r;n++){const o=t.childNodes[n];!o.id||Tr(t.nodeName)==="#text"||e.add(o.id,o)}}function xy(t){for(;t.parent;)t=t.parent;return t.scene}var Ye={svg:function(t){const e=Ye.defs.current=new ro,n=t.getElementsByTagName("defs");for(let p=0;p<n.length;p++)wy(n[p],e);const r=Ye.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,m=c!==null;return u&&(r.x=parseFloat(s.replace(kn.unitSuffix,""))),h&&(r.y=parseFloat(a.replace(kn.unitSuffix,""))),f&&(r.width=parseFloat(l.replace(kn.unitSuffix,""))),m&&(r.height=parseFloat(c.replace(kn.unitSuffix,""))),d&&_y(r,o),delete Ye.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 Dt("encountered <use /> with no href."),console.warn(n.name,n.message),null;const o=r.slice(1);if(!Ye.defs.current.contains(o))return n=new Dt("unable to find element for reference "+r+"."),console.warn(n.name,n.message),null;const a=Ye.defs.current.get(o).cloneNode(!0);for(let c=0;c<t.attributes.length;c++){const d=t.attributes[c],u=hy.includes(d.nodeName),h=!a.hasAttribute(d.nodeName);(u||h)&&a.setAttribute(d.nodeName,d.value)}const l=Tr(a.nodeName);return Ye[l].call(this,a,e)},g:function(t,e){const n=new mt;tn.call(this,t,n,e),this.add(n);const r=yy.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=Tr(l);if(c in Ye){const d=Ye[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 Ne(parseFloat(a),parseFloat(l)))});const o=new Re(r,!0);return o.stroke="none",o.fill="black",tn.call(this,t,o,e),o},polyline:function(t,e){const n=Ye.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 Ne,c,d,u=n.match(/[a-df-z][^a-df-z]*/gi);const h=u.length-1;oe.each(u.slice(0),function(f,m){const p=f.slice(1).trim().match(kn.path),g=f[0],y=g.toLowerCase();let b,_,k,x,C;const N=[];switch(m===0&&(u=[]),y){case"h":case"v":p.length>1&&(b=1);break;case"m":case"l":case"t":p.length>2&&(b=2);break;case"s":case"q":p.length>4&&(b=4);break;case"c":p.length>6&&(b=6);break;case"a":p.length>7&&(b=7);break}if(b){for(_=0,k=p.length,C=0;_<k;_+=b){if(x=g,C>0)switch(g){case"m":x="l";break;case"M":x="L";break}N.push(x+p.slice(_,_+b).join(" ")),C++}u=Array.prototype.concat.apply(u,N)}else u.push(f)}),oe.each(u,function(f,m){let p,g,y;const b=f[0],_=b.toLowerCase();d=f.slice(1).trim().match(kn.path),s=b===_;let k,x,C,N,w,S,v,$,E,A,R,F,H,Q,Z,O,P;switch(_){case"z":if(m>=h)o=!0;else{g=l.x,y=l.y,p=new Ne(g,y,void 0,void 0,void 0,void 0,ie.close);for(let V=r.length-1;V>=0;V--){const M=r[V];if(/m/i.test(M.command)){l=M;break}}}break;case"m":case"l":c=void 0,g=parseFloat(d[0]),y=parseFloat(d[1]),p=new Ne(g,y,void 0,void 0,void 0,void 0,/m/i.test(_)?ie.move:ie.line),s&&p.addSelf(l),l=p;break;case"h":case"v":A=/h/i.test(_)?"x":"y",R=/x/i.test(A)?"y":"x",p=new Ne(void 0,void 0,void 0,void 0,void 0,void 0,ie.line),p[A]=parseFloat(d[0]),p[R]=l[R],s&&(p[A]+=l[A]),l=p;break;case"c":case"s":k=l.x,x=l.y,c||(c=new re),/c/i.test(_)?(C=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[2]),S=parseFloat(d[3]),v=parseFloat(d[4]),$=parseFloat(d[5])):(E=ks(l,c,s),C=E.x,N=E.y,w=parseFloat(d[0]),S=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3])),s&&(C+=k,N+=x,w+=k,S+=x,v+=k,$+=x),l.controls.right.set(C-l.x,N-l.y),p=new Ne(v,$,w-v,S-$,void 0,void 0,ie.curve),l=p,c=p.controls.left;break;case"t":case"q":k=l.x,x=l.y,c||(c=new re),/q/i.test(_)?(C=parseFloat(d[0]),N=parseFloat(d[1]),w=parseFloat(d[0]),S=parseFloat(d[1]),v=parseFloat(d[2]),$=parseFloat(d[3])):(E=ks(l,c,s),C=E.x,N=E.y,w=E.x,S=E.y,v=parseFloat(d[0]),$=parseFloat(d[1])),s&&(C+=k,N+=x,w+=k,S+=x,v+=k,$+=x),l.controls.right.set((C-l.x)*.33,(N-l.y)*.33),p=new Ne(v,$,w-v,S-$,void 0,void 0,ie.curve),l=p,c=p.controls.left;break;case"a":k=l.x,x=l.y,H=parseFloat(d[0]),Q=parseFloat(d[1]),Z=parseFloat(d[2]),O=parseFloat(d[3]),P=parseFloat(d[4]),v=parseFloat(d[5]),$=parseFloat(d[6]),s&&(v+=k,$+=x),F=new Ne(v,$),F.command=ie.arc,F.rx=H,F.ry=Q,F.xAxisRotation=Z,F.largeArcFlag=O,F.sweepFlag=P,p=F,l=F,c=void 0;break}p&&(Array.isArray(p)?r=r.concat(p):r.push(p))})}n=new Re(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},oe.each(n.vertices,function(l){l.subSelf(a.centroid)}),tn.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 mo(0,0,o);return s.stroke="none",s.fill="black",tn.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 po(0,0,o,s);return a.stroke="none",a.fill="black",tn.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(!oe.isNaN(n)||!oe.isNaN(r))return Ye["rounded-rect"](t);const o=parseFloat(t.getAttribute("width")),s=parseFloat(t.getAttribute("height")),a=o/2,l=s/2,c=new oi(0,0,o,s);return c.stroke="none",c.fill="black",tn.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 go(0,0,o,s,c);return d.stroke="none",d.fill="black",tn.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 _o(n,r,o,s).noFill();return tn.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 m=t.children[f];let p=m.getAttribute("offset");/%/gi.test(p)&&(p=parseFloat(p.replace(/%/gi,""))/100),p=parseFloat(p);let g=m.getAttribute("stop-color"),y=m.getAttribute("stop-opacity"),b=m.getAttribute("style"),_;g===null&&(_=b?b.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,g=_&&_.length>1?_[1]:void 0),y===null?(_=b?b.match(/stop-opacity:\s?([0-9.-]*)/):!1,y=_&&_.length>1?parseFloat(_[1]):1):y=parseFloat(y),u.push(new ri(p,g,y))}const h=new Ke(o,s,a,l,u);return h.spread=r,h.units=n,tn.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"));oe.isNaN(l)&&(l=o),oe.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 m=0;m<t.children.length;m++){const p=t.children[m];let g=p.getAttribute("offset");/%/gi.test(g)&&(g=parseFloat(g.replace(/%/gi,""))/100),g=parseFloat(g);let y=p.getAttribute("stop-color"),b=p.getAttribute("stop-opacity"),_=p.getAttribute("style"),k;y===null&&(k=_?_.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,y=k&&k.length>1?k[1]:void 0),b===null?(k=_?_.match(/stop-opacity:\s?([0-9.-]*)/):!1,b=k&&k.length>1?parseFloat(k[1]):1):b=parseFloat(b),h.push(new ri(g,y,b))}const f=new Ge(o,s,a,h,l,c);return f.spread=r,f.units=n,tn.call(this,t,f,e),f},text:function(t,e){const n=my(t.getAttribute("text-anchor"))||"left",r=py(t)||"baseline";let o="";t.childNodes.length>0&&t.childNodes[0].tagName==="TSPAN"?o=t.childNodes[0].textContent:o=t.textContent;const s=new xn(o);return tn.call(this,t,s,e),s.alignment=n,s.baseline=r,s},clippath:function(t,e){return Ye.defs.current&&!Ye.defs.current.contains(t.id)&&Ye.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 Dt("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 ho(r,o,s);return oe.isNaN(a)||(c.width=a),oe.isNaN(l)||(c.height=l),tn.call(this,t,c,e),c}};function Qc(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 Mn extends oi{constructor(e,n,r,o,s,a){super(n,r,o||1,s||1),B(this,"_flagTexture",!1),B(this,"_flagMode",!1),B(this,"_texture",null),B(this,"_mode","fill"),this._renderer.type="image";for(let l in ed)Object.defineProperty(this,l,ed[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 Mn().copy(e);return"id"in e&&(n.id=e.id),n}copy(e){super.copy.call(this,e);for(let n=0;n<Mn.Properties.length;n++){const r=Mn.Properties[n];r in e&&(this[r]=e[r])}return this}clone(e){const n=new Mn(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 Mn.Modes.fill:{const c=Math.max(a,l);e.scale=c,e.offset.x=0,e.offset.y=0,e.repeat="repeat";break}case Mn.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 Mn.Modes.crop:break;case Mn.Modes.tile:{e.offset.x=(n-o)/2,e.offset.y=(r-s)/2,e.repeat="repeat";break}case Mn.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}};B(Xs,"Modes",{fill:"fill",fit:"fit",crop:"crop",tile:"tile",stretch:"stretch"}),B(Xs,"Properties",["texture","mode"]);var Jc=Xs,ed={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}}},Ys=[],Us=Math.max,ky=Math.min,td=Math.abs,wo=Math.sin,xo=Math.cos,vy=Math.acos,ko=Math.sqrt,Pe={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 Pe?t:"path"},group:{renderChild:function(t){const e=Pe.getRendererType(t._renderer.type);Pe[e].render.call(t,this.ctx,!0,this.clip)},render:function(t){if(!this._visible)return this;oe.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=vo(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=Pe.getRendererType(r._renderer.type);Pe[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=Pe.getRendererType(l._renderer.type);Pe[c].render.call(l,t)}return s&&t.restore(),oe.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,m,p,g,y,b,_,k,x,C,N,w,S,v,$,E,A,R,F,H,Q,Z,O,P,V;if(V=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,H=this._mask,Q=this._clip,l=this._opacity*(V||1),c=this._visible,!e&&(!c||Q||l===0))return this;if(oe.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,m=this._renderer.vertices,p=m.length,g=p-1,Z=vo(r),P=this.dashes,Z||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),H){const K=Pe.getRendererType(H._renderer.type);Pe[K].render.call(H,t,!0)}if(a)if(typeof a=="string")t.fillStyle=a;else{const K=Pe.getRendererType(a._renderer.type);Pe[K].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const K=Pe.getRendererType(o._renderer.type);Pe[K].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=wn(this)),h&&(t.miterLimit=h),u&&(t.lineJoin=u),!f&&d&&(t.lineCap=d)}typeof l=="number"&&(t.globalAlpha=l),P&&P.length>0&&(t.lineDashOffset=P.offset||0,t.setLineDash(P)),t.beginPath();let M,L,Y,U,G,q,W;for(let K=0;K<p;K++)switch(_=m[K],R=_.x,F=_.y,_.command){case ie.close:t.closePath();break;case ie.arc:M=_.rx,L=_.ry,Y=_.xAxisRotation,U=_.largeArcFlag,G=_.sweepFlag,y=f?rt(K-1,p):Us(K-1,0),b=m[y],q=b.x,W=b.y,Pe.renderSvgArcCommand(t,q,W,M,L,U,G,Y,R,F);break;case ie.curve:y=f?rt(K-1,p):Math.max(K-1,0),b=m[y],v=b.controls&&b.controls.right||re.zero,$=_.controls&&_.controls.left||re.zero,b._relative?(w=v.x+b.x,S=v.y+b.y):(w=v.x,S=v.y),_._relative?(C=$.x+_.x,N=$.y+_.y):(C=$.x,N=$.y),t.bezierCurveTo(w,S,C,N,R,F),K>=g&&f&&(k=x,E=_.controls&&_.controls.right||re.zero,A=k.controls&&k.controls.left||re.zero,_._relative?(w=E.x+_.x,S=E.y+_.y):(w=E.x,S=E.y),k._relative?(C=A.x+k.x,N=A.y+k.y):(C=A.x,N=A.y),R=k.x,F=k.y,t.bezierCurveTo(w,S,C,N,R,F));break;case ie.line:t.lineTo(R,F);break;case ie.move:x=_,t.moveTo(R,F);break}return f&&t.closePath(),!Q&&!n&&(Pe.isHidden.test(a)||(O=a._renderer&&a._renderer.offset,O&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),O&&t.restore()),Pe.isHidden.test(o)||(O=o._renderer&&o._renderer.offset,O&&(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(),O&&t.restore())),Z||t.restore(),Q&&!n&&t.clip(),P&&P.length>0&&t.setLineDash(Ys),oe.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,m,p,g,y,b,_;if(_=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,l=this._opacity*(_||1),c=this._visible,!e&&(!c||l===0))return this;if(oe.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,g=vo(r),b=this.dashes,d=this._size,g||(t.save(),t.transform(r[0],r[3],r[1],r[4],r[2],r[5])),a)if(typeof a=="string")t.fillStyle=a;else{const C=Pe.getRendererType(a._renderer.type);Pe[C].render.call(a,t,this),t.fillStyle=a._renderer.effect}if(o){if(typeof o=="string")t.strokeStyle=o;else{const C=Pe.getRendererType(o._renderer.type);Pe[C].render.call(o,t,this),t.strokeStyle=o._renderer.effect}s&&(t.lineWidth=wn(this))}typeof l=="number"&&(t.globalAlpha=l),b&&b.length>0&&(t.lineDashOffset=b.offset||0,t.setLineDash(b)),t.beginPath();let k=d*.5,x;this._sizeAttenuation||(x=this.worldMatrix.elements,x=bi(x[0],x[3],x[1],x[4],x[2],x[5]),k/=Math.max(x.scaleX,x.scaleY));for(let C=0;C<h;C++)f=u[C],m=f.x,p=f.y,t.moveTo(m+k,p),t.arc(m,p,k,0,tt);return n||(Pe.isHidden.test(a)||(y=a._renderer&&a._renderer.offset,y&&(t.save(),t.translate(-a._renderer.offset.x,-a._renderer.offset.y),t.scale(a._renderer.scale.x,a._renderer.scale.y)),t.fill(),y&&t.restore()),Pe.isHidden.test(o)||(y=o._renderer&&o._renderer.offset,y&&(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(),y&&t.restore())),g||t.restore(),b&&b.length>0&&t.setLineDash(Ys),oe.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;oe.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,m=this._direction,p=vo(c),g=h._renderer&&h._renderer.offset&&d._renderer&&d._renderer.offset,y=this.dashes,b=Pe.alignments[this._alignment]||this._alignment,_=Pe.baselines[this._baseline]||this._baseline;let k,x,C,N,w,S,v,$,E,A,R;if(p||(t.save(),t.transform(c[0],c[3],c[1],c[4],c[2],c[5])),a){const F=Pe.getRendererType(a._renderer.type);Pe[F].render.call(a,t,!0)}if(g||(t.font=[this._style,this._weight,this._size+"px/"+this._leading+"px",this._family].join(" ")),t.textAlign=b,t.textBaseline=_,t.direction=m,h)if(typeof h=="string")t.fillStyle=h;else{const F=Pe.getRendererType(h._renderer.type);Pe[F].render.call(h,t,this),t.fillStyle=h._renderer.effect}if(d){if(typeof d=="string")t.strokeStyle=d;else{const F=Pe.getRendererType(d._renderer.type);Pe[F].render.call(d,t,this),t.strokeStyle=d._renderer.effect}u&&(t.lineWidth=wn(this))}if(typeof o=="number"&&(t.globalAlpha=o),y&&y.length>0&&(t.lineDashOffset=y.offset||0,t.setLineDash(y)),!l&&!n&&(Pe.isHidden.test(h)||(h._renderer&&h._renderer.offset?(S=h._renderer.scale.x,v=h._renderer.scale.y,t.save(),t.translate(-h._renderer.offset.x,-h._renderer.offset.y),t.scale(S,v),k=this._size/h._renderer.scale.y,x=this._leading/h._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),C=h._renderer.offset.x/h._renderer.scale.x,N=h._renderer.offset.y/h._renderer.scale.y,t.fillText(this.value,C,N),t.restore()):t.fillText(this.value,0,0)),Pe.isHidden.test(d)||(d._renderer&&d._renderer.offset?(S=d._renderer.scale.x,v=d._renderer.scale.y,t.save(),t.translate(-d._renderer.offset.x,-d._renderer.offset.y),t.scale(S,v),k=this._size/d._renderer.scale.y,x=this._leading/d._renderer.scale.y,t.font=[this._style,this._weight,k+"px/",x+"px",this._family].join(" "),C=d._renderer.offset.x/d._renderer.scale.x,N=d._renderer.offset.y/d._renderer.scale.y,w=u/d._renderer.scale.x,t.lineWidth=w,t.strokeText(this.value,C,N),t.restore()):t.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){const F=t.measureText(this.value);let H=1;switch(f){case"underline":E=F.actualBoundingBoxDescent,R=F.actualBoundingBoxDescent;break;case"strikethrough":E=0,R=0,H=.5;break}switch(_){case"top":E+=this._size*H,R+=this._size*H;break;case"baseline":case"bottom":E-=this._size*H,R-=this._size*H;break}switch(b){case"left":case"start":$=0,A=F.width;break;case"right":case"end":$=-F.width,A=0;break;default:$=-F.width/2,A=F.width/2}t.lineWidth=Math.max(Math.floor(this._size/15),1),t.strokeStyle=t.fillStyle,t.beginPath(),t.moveTo($,E),t.lineTo(A,R),t.stroke()}return p||t.restore(),l&&!n&&t.clip(),y&&y.length>0&&t.setLineDash(Ys),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(e){if(oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(e){if(oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t){oe.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)),oe.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=td(r),o=td(o);const u=(e-c)/2,h=(n-d)/2,f=xo(l)*u+wo(l)*h,m=-wo(l)*u+xo(l)*h,p=f*f,g=m*m;let y=r*r,b=o*o;const _=p/y+g/b;if(_>1){const F=ko(_);r=F*r,o=F*o,y=r*r,b=o*o}const k=y*g+b*p,x=(y*b-k)/k;let C=ko(Us(0,x));s===a&&(C=-C);const N=C*r*m/o,w=-C*o*f/r,S=xo(l)*N-wo(l)*w+(e+c)/2,v=wo(l)*N+xo(l)*w+(n+d)/2,$=nd(1,0,(f-N)/r,(m-w)/o),E=nd((f-N)/r,(m-w)/o,(-f-N)/r,(-m-w)/o)%tt,A=$+E;Cy(t,S,v,r,o,$,A,a===0,l)}},vt=class extends ee{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 mt,this.scene.parent=this}setSize(t,e,n){return this.width=t,this.height=e,this.ratio=typeof n>"u"?vs(this.ctx):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,this.domElement.style&&oe.extend(this.domElement.style,{width:t+"px",height:e+"px"}),this.trigger(ee.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),Pe.group.render.call(this.scene,this.ctx),t||this.ctx.restore(),this}};B(vt,"Utils",Pe);function Cy(t,e,n,r,o,s,a,l,c){const d=a-s,u=Ui.Tolerance.epsilon,h=Math.abs(d)<u;let f=rt(d,tt);f<u&&(h?f=0:f=tt),l===!0&&!h&&(f===tt?f=-tt:f=f-tt);for(let m=0;m<xt.Resolution;m++){const p=m/(xt.Resolution-1),g=s+p*f;let y=e+r*Math.cos(g),b=n+o*Math.sin(g);if(c!==0){const _=Math.cos(c),k=Math.sin(c),x=y-e,C=b-n;y=x*_-C*k+e,b=x*k+C*_+n}t.lineTo(y,b)}}function nd(t,e,n,r){const o=t*n+e*r,s=ko(t*t+e*e)*ko(n*n+r*r);let a=vy(Us(-1,ky(1,o/s)));return t*r-e*n<0&&(a=-a),a}function vo(t){return t[0]===1&&t[3]===0&&t[1]===0&&t[4]===1&&t[2]===0&&t[5]===0}var ce={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(ce.ns,n);return n==="svg"&&(e=oe.defaults(e||{},{version:ce.version})),e&&Object.keys(e).length>0&&ce.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(ce.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?rt(a-1,n):Math.max(a-1,0),d=t[c];let u,h,f,m,p,g,y,b,_,k,x,C,N,w,S,v=Ie(l.x),$=Ie(l.y);switch(l.command){case ie.close:u=ie.close;break;case ie.arc:x=l.rx,C=l.ry,N=l.xAxisRotation,w=l.largeArcFlag,S=l.sweepFlag,u=ie.arc+" "+x+" "+C+" "+N+" "+w+" "+S+" "+v+" "+$;break;case ie.curve:y=d.controls&&d.controls.right||re.zero,b=l.controls&&l.controls.left||re.zero,d.relative?(f=Ie(y.x+d.x),m=Ie(y.y+d.y)):(f=Ie(y.x),m=Ie(y.y)),l.relative?(p=Ie(b.x+l.x),g=Ie(b.y+l.y)):(p=Ie(b.x),g=Ie(b.y)),u=(a===0?ie.move:ie.curve)+" "+f+" "+m+" "+p+" "+g+" "+v+" "+$;break;case ie.move:o=l,u=ie.move+" "+v+" "+$;break;default:u=l.command+" "+v+" "+$}a>=r&&e&&(l.command===ie.curve&&(h=o,_=l.controls&&l.controls.right||l,k=h.controls&&h.controls.left||h,l.relative?(f=Ie(_.x+l.x),m=Ie(_.y+l.y)):(f=Ie(_.x),m=Ie(_.y)),h.relative?(p=Ie(k.x+h.x),g=Ie(k.y+h.y)):(p=Ie(k.x),g=Ie(k.y)),v=Ie(h.x),$=Ie(h.y),u+=" C "+f+" "+m+" "+p+" "+g+" "+v+" "+$),l.command!==ie.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+=ie.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=ce.createElement("clipPath",{"clip-rule":"nonzero"})),n.parentNode===null&&e.defs.appendChild(n),n},getRendererType:function(t){return t in ce?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=ce.getRendererType(t._renderer.type);ce[e].render.call(t,this)},render:function(t){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=ce.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=ce.getRendererType(o._renderer.type);ce[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(ce.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(ce.group.removeChild,n),this._flagOrder&&this.children.forEach(ce.group.orderChild,n),this._flagMask)if(this._mask){const r=ce.getRendererType(this._mask._renderer.type);ce[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),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;oe.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=ce.toString(this._renderer.vertices,this._closed);e.d=r}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ce.getRendererType(this._fill._renderer.type);ce[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=ce.getRendererType(this._stroke._renderer.type);ce[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"]=wn(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?ce.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ce.createElement("path",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ce.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=ce.getRendererType(this._mask._renderer.type);ce[r].render.call(this._mask,t),this._renderer.elem.setAttribute("clip-path","url(#"+this._mask.id+")")}else this._renderer.elem.removeAttribute("clip-path");return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(t){if(this._opacity===0&&!this._flagOpacity)return this;oe.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=bi(s[0],s[3],s[1],s[4],s[2],s[5]);r/=Math.max(a.scaleX,a.scaleY)}const o=ce.pointsToString(this._renderer.collection,r);e.d=o}if(this._fill&&this._fill._renderer){this._renderer.hasFillEffect=!0,this._fill._update();const r=ce.getRendererType(this._fill._renderer.type);ce[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=ce.getRendererType(this._stroke._renderer.type);ce[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"]=wn(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?ce.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ce.createElement("path",e),t.appendChild(this._renderer.elem)),oe.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"]=ce.alignments[this._alignment]||this._alignment),this._flagBaseline&&(e["dominant-baseline"]=ce.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=ce.getRendererType(this._fill._renderer.type);ce[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=ce.getRendererType(this._stroke._renderer.type);ce[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"]=wn(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?ce.setAttributes(this._renderer.elem,e):(e.id=this._id,this._renderer.elem=ce.createElement("text",e),t.appendChild(this._renderer.elem)),this._flagClip){const r=ce.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=ce.getRendererType(this._mask._renderer.type);ce[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){oe.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?ce.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ce.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?ce.setAttributes(s._renderer.elem,a):s._renderer.elem=ce.createElement("stop",a),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(t,e){oe.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?ce.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=ce.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?ce.setAttributes(s._renderer.elem,a):s._renderer.elem=ce.createElement("stop",a),r&&this._renderer.elem.appendChild(s._renderer.elem),s.flagReset()}}return oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(t,e){oe.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?ce.setAttributes(this._renderer.image,r):this._renderer.image=ce.createElement("image",r)),this._renderer.elem?Object.keys(n).length!==0&&ce.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits="userSpaceOnUse",this._renderer.elem=ce.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),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},id=class extends ee{constructor(t){super(),this.domElement=t.domElement||ce.createElement("svg"),this.scene=new mt,this.scene.parent=this,this.defs=ce.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,ce.setAttributes(this.domElement,{width:t,height:e}),this.trigger(ee.Types.resize,t,e)}render(){return ce.group.render.call(this.scene,this.domElement),ce.defs.update(this.domElement),this}};B(id,"Utils",ce);var nn={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 Dt("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
|
-
`}},Co=wi.Multiply,Sy=[1,0,0,0,1,0,0,0,1],si=new _n(9),By=vt.Utils,rd=new re,Ks=new _n([0,0,1,0,0,1,0,1,1,0,1,1]),Ce={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Ue.document?Ue.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new wi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)Ce.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;oe.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 _n(9)),this._matrix.toTransformArray(!0,si),Co(si,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=vt.Utils.getRendererType(this._mask._renderer.type);Ce[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++)Ce.group.removeChild(this.subtractions[s],t);for(s=0;s<this.children.length;s++){const a=this.children[s],l=vt.Utils.getRendererType(a._renderer.type);Ce[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),oe.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,m,p,g;const y=e._renderer.vertices,b=this.canvas,_=this.ctx,k=t.renderer.ratio,x=rd.copy(e._renderer.scale).multiply(k),C=e._stroke,N=e._linewidth,w=e._fill,S=e._renderer.opacity||e._opacity,v=e._cap,$=e._join,E=e._miter,A=e._closed,R=e.dashes,F=y.length,H=F-1;b.width=Math.max(Math.ceil(e._renderer.rect.width*x.x),1),b.height=Math.max(Math.ceil(e._renderer.rect.height*x.y),1);const Q=e._renderer.rect.centroid,Z=Q.x,O=Q.y;if(_.clearRect(0,0,b.width,b.height),w)if(typeof w=="string")_.fillStyle=w;else{const W=vt.Utils.getRendererType(w._renderer.type);Ce[W].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(C){if(typeof C=="string")_.strokeStyle=C;else{const W=vt.Utils.getRendererType(C._renderer.type);Ce[W].render.call(C,_,e),_.strokeStyle=C._renderer.effect}N&&(_.lineWidth=wn(e)),E&&(_.miterLimit=E),$&&(_.lineJoin=$),!A&&v&&(_.lineCap=v)}typeof S=="number"&&(_.globalAlpha=S),R&&R.length>0&&(_.lineDashOffset=R.offset||0,_.setLineDash(R));let P,V,M,L,Y,U,G,q;_.save(),_.scale(x.x,x.y),_.translate(Z,O),_.beginPath();for(let W=0;W<y.length;W++){const K=y[W];switch(m=K.x,p=K.y,K.command){case ie.close:_.closePath();break;case ie.arc:V=K.rx,M=K.ry,L=K.xAxisRotation,Y=K.largeArcFlag,U=K.sweepFlag,n=A?rt(W-1,F):Math.max(W-1,0),r=y[n],G=r.x,q=r.y,By.renderSvgArcCommand(_,G,q,V,M,Y,U,L,m,p);break;case ie.curve:n=A?rt(W-1,F):Math.max(W-1,0),r=y[n],d=r.controls&&r.controls.right||re.zero,u=K.controls&&K.controls.left||re.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),K._relative?(s=u.x+K.x,a=u.y+K.y):(s=u.x,a=u.y),_.bezierCurveTo(l,c,s,a,m,p),W>=H&&A&&(o=P,h=K.controls&&K.controls.right||re.zero,f=o.controls&&o.controls.left||re.zero,K._relative?(l=h.x+K.x,c=h.y+K.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),m=o.x,p=o.y,_.bezierCurveTo(l,c,s,a,m,p));break;case ie.line:_.lineTo(m,p);break;case ie.move:P=K,_.moveTo(m,p);break}}A&&_.closePath(),Ce.isHidden.test(w)||(g=w._renderer&&w._renderer.offset,g&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),g&&_.restore()),Ce.isHidden.test(C)||(g=C._renderer&&C._renderer.offset,g&&(_.save(),_.translate(-C._renderer.offset.x,-C._renderer.offset.y),_.scale(C._renderer.scale.x,C._renderer.scale.y),_.lineWidth=N/C._renderer.scale.x),_.stroke(),g&&_.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 m,p,g,y,b,_;s=Math.min(h,s),r=Math.min(u,r),o=Math.max(u,o),a=Math.max(h,a),d.controls&&(b=f.left,_=f.right,!(!b||!_)&&(m=d._relative?b.x+u:b.x,p=d._relative?b.y+h:b.y,g=d._relative?_.x+u:_.x,y=d._relative?_.y+h:_.y,!(!m||!p||!g||!y)&&(s=Math.min(p,y,s),r=Math.min(m,g,r),o=Math.max(m,g,o),a=Math.max(p,y,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;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,o=vt.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 Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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 _n(9)),this._matrix.toTransformArray(!0,si),Co(si,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=vt.Utils.getRendererType(this._mask._renderer.type);Ce[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,Ce.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),Ce.updateTexture.call(Ce,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,Ks,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),oe.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;Ce.isHidden.test(a)||(f+=l),r.width=jl(f),r.height=r.width;const m=f/r.width,p=r.width/2,g=r.height/2;if(o.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")o.fillStyle=c;else{const y=vt.Utils.getRendererType(c._renderer.type);Ce[y].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")o.strokeStyle=a;else{const y=vt.Utils.getRendererType(a._renderer.type);Ce[y].render.call(a,o,e),o.strokeStyle=a._renderer.effect}l&&(o.lineWidth=wn(e)/m)}typeof d=="number"&&(o.globalAlpha=d),u&&u.length>0&&(o.lineDashOffset=u.offset||0,o.setLineDash(u)),o.save(),o.translate(p,g),o.scale(Ce.precision,Ce.precision),o.beginPath(),o.arc(0,0,h/m*.5,0,et),o.restore(),closed&&o.closePath(),Ce.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()),Ce.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;oe.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,m=this._renderer.collection.length,p=this._flagVertices,g=this._flagFill||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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 _n(9)),this._matrix.toTransformArray(!0,si),Co(si,o._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let y,b;this._scale instanceof re?(y=this._scale.x*o._renderer.scale.x,b=this._scale.y*o._renderer.scale.y):(y=this._scale*o._renderer.scale.x,b=this._scale*o._renderer.scale.y),this._renderer.scale.x=y<0?-y:y,this._renderer.scale.y=b<0?-b:b,h&&(this._renderer.parent=o)}if(p){const y=this._renderer.positionBuffer;y&&t.deleteBuffer(y),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 g?(this._renderer.opacity=this._opacity*o._renderer.opacity,Ce.updateTexture.call(Ce,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:(Ce.isHidden.test(l)||(r+=c),r/=Ce.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,m),oe.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=rd.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 m=e._renderer.rect.centroid,p=m.x,g=m.y;let y,b,_,k,x,C,N,w,S,v,$;const E=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),E||(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 A=vt.Utils.getRendererType(c._renderer.type);Ce[A].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const A=vt.Utils.getRendererType(a._renderer.type);Ce[A].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=wn(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(p,g),Ce.isHidden.test(c)||(c._renderer&&c._renderer.offset?(C=c._renderer.scale.x,N=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,N),y=e._size/c._renderer.scale.y,b=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,k=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,k),r.restore()):r.fillText(e.value,0,0)),Ce.isHidden.test(a)||(a._renderer&&a._renderer.offset?(C=a._renderer.scale.x,N=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,N),y=e._size/a._renderer.scale.y,b=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,k=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,k),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const A=r.measureText(e.value);switch(h){case"underline":S=A.actualBoundingBoxDescent,$=A.actualBoundingBoxDescent;break;case"strikethrough":S=0,$=0;break}w=-A.width/2,v=A.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,S),r.lineTo(v,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=Ce.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=vt.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&&!Ce.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const a=o/2,l=s/2;switch(Ce.alignments[t._alignment]||t._alignment){case Ce.alignments.left:t.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case Ce.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;oe.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 Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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 _n(9)),this._matrix.toTransformArray(!0,si),Co(si,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=vt.Utils.getRendererType(this._mask._renderer.type);Ce[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,Ce.text.getBoundingClientRect(this,this._renderer.rect),Ce.updateTexture.call(Ce,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,Ks,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),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=vt.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(Ce,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(),oe.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 Dt("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]=Ce.extensions.get(t,o)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new ro};Ce.ctx=Ce.canvas.getContext("2d");var od=class extends ee{constructor(t){super();let e,n,r,o;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(Ce.canvas=t.offscreenElement,Ce.ctx=Ce.canvas.getContext("2d")),this.scene=new mt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new _n(Sy),scale:1,opacity:1},this._flagMatrix=!0,t=oe.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 Dt("unable to create a webgl context. Try using another renderer.");r=nn.create(e,nn.path.vertex,nn.types.vertex),o=nn.create(e,nn.path.fragment,nn.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=Ce.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=Ce.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,Ks,e.STATIC_DRAW),r=nn.create(e,nn.points.vertex,nn.types.vertex),o=nn.create(e,nn.points.fragment,nn.types.fragment),n=this.programs.points=Ce.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"?vs(s):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,oe.isObject(this.domElement.style)&&oe.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(ee.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),Ce.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};B(od,"Utils",Ce);var Ty=oe.extend({Error:Dt,getRatio:vs,read:Ye,xhr:Qc},oe,Et,Dl,Ll),Be=class Qr{constructor(e){B(this,"_events",new ee),B(this,"type",""),B(this,"renderer",null),B(this,"scene",null),B(this,"width",0),B(this,"height",0),B(this,"frameCount",0),B(this,"timeDelta",0),B(this,"playing",!1);const n=oe.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Qr.Types.svg,autostart:!1});if(oe.each(n,function(r,o){/fullscreen/i.test(o)||/autostart/i.test(o)||(this[o]=r)},this),oe.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Qr.Types[r])}this.renderer=new Qr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Ny.bind(this),this.fit.domElement=window,this.fit.attached=!0,oe.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),oe.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Yt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=$y.bind(this),oe.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(ee.Types.resize,Ry.bind(this)),this.scene=this.renderer.scene,Qr.Instances.push(this),n.autostart&&Nr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=this._events.dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=this._events.dispatchEvent)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=this._events.listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=this._events.ignore)==null?void 0:e.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,Nr.init(),this.trigger(ee.Types.play)}pause(){return this.playing=!1,this.trigger(ee.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"&&typeof e.fill.unbind=="function"&&e.fill.unbind(),typeof e.stroke=="object"&&typeof e.stroke.unbind=="function"&&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}getShapesAtPoint(e,n,r){return this.scene&&typeof this.scene.getShapesAtPoint=="function"?this.scene.getShapesAtPoint(e,n,r):[]}update(){const e=!!this._lastFrame,n=oe.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Yt.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(ee.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(ee.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 _o(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 Ne(e,n,void 0,void 0,void 0,void 0,ie.move),new Ne(r,o,void 0,void 0,void 0,void 0,ie.line),new Ne(r-a*Math.cos(l-Math.PI/4),o-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ie.line),new Ne(r,o,void 0,void 0,void 0,void 0,ie.move),new Ne(r-a*Math.cos(l+Math.PI/4),o-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ie.line)],d=new Re(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 oi(e,n,r,o);return this.scene.add(s),s}makeRoundedRectangle(e,n,r,o,s){const a=new go(e,n,r,o,s);return this.scene.add(a),a}makeCircle(e,n,r,o){const s=new mo(e,n,r,o);return this.scene.add(s),s}makeEllipse(e,n,r,o,s){const a=new po(e,n,r,o,s);return this.scene.add(a),a}makeStar(e,n,r,o,s){const a=new Ds(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 Ne(l,c))}}const r=arguments[n-1],o=new Re(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 zs(e,n,r,o);return this.scene.add(s),s}makeArcSegment(e,n,r,o,s,a,l){const c=new Fs(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 Os(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 Ne(c,d))}}const o=arguments[n-1],s=new Re(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 xn(e,n,r,o);return this.add(s),s}makeLinearGradient(e,n,r,o){const s=Array.prototype.slice.call(arguments,4),a=new Ke(e,n,r,o,s);return this.add(a),a}makeRadialGradient(e,n,r){const o=Array.prototype.slice.call(arguments,3),s=new Ge(e,n,r,o);return this.add(s),s}makeSprite(e,n,r,o,s,a,l){const c=new ho(e,n,r,o,s,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,o,s,a){const l=new Jc(e,n,r,o,s,a);return this.add(l),l}makeImageSequence(e,n,r,o,s){const a=new js(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 mt;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 Ye))return null;const s=Ye[o].call(this,e);return r?this.add(n&&s instanceof mt?s.children:s):s.parent&&s.remove(),s}load(e,n){const r=new mt;let o,s,a;const l=(function(c){for(Yt.temp.innerHTML=c,s=0;s<Yt.temp.children.length;s++)o=Yt.temp.children[s],a=this.interpret(o,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Yt.temp.children.length<=1?Yt.temp.children[0]:Yt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(Qc(e,l),r):(l(e),r)}};B(Be,"NextFrameId",xt.NextFrameId),B(Be,"Types",xt.Types),B(Be,"Version",xt.Version),B(Be,"PublishDate",xt.PublishDate),B(Be,"Identifier",xt.Identifier),B(Be,"Resolution",xt.Resolution),B(Be,"AutoCalculateImportedMatrices",xt.AutoCalculateImportedMatrices),B(Be,"Instances",xt.Instances),B(Be,"uniqueId",xt.uniqueId),B(Be,"Anchor",Ne),B(Be,"Collection",ii),B(Be,"Events",ee),B(Be,"Group",mt),B(Be,"Matrix",wi),B(Be,"Path",Re),B(Be,"Registry",ro),B(Be,"Element",Gi),B(Be,"Shape",On),B(Be,"Text",xn),B(Be,"Vector",re),B(Be,"Gradient",dt),B(Be,"Image",Jc),B(Be,"ImageSequence",js),B(Be,"LinearGradient",Ke),B(Be,"RadialGradient",Ge),B(Be,"Sprite",ho),B(Be,"Stop",ri),B(Be,"Texture",Oe),B(Be,"ArcSegment",Fs),B(Be,"Circle",mo),B(Be,"Ellipse",po),B(Be,"Line",_o),B(Be,"Points",Os),B(Be,"Polygon",zs),B(Be,"Rectangle",oi),B(Be,"RoundedRectangle",go),B(Be,"Star",Ds),B(Be,"CanvasRenderer",vt),B(Be,"SVGRenderer",id),B(Be,"WebGLRenderer",od),B(Be,"Commands",ie),B(Be,"Utils",Ty);var vn=Be;function Ny(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function $y(){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 Ry(t,e){this.width=t,this.height=e,this.trigger(ee.Types.resize,t,e)}var Nr=Yt.getRequestAnimationFrame();function sd(){for(let t=0;t<vn.Instances.length;t++){const e=vn.Instances[t];e.playing&&e.update()}vn.NextFrameId=Nr(sd)}Nr.init=function(){sd(),Nr.init=function(){}};let Cn;typeof window<"u"?Cn=window:typeof global<"u"?Cn=global:typeof self<"u"&&(Cn=self);let ad;const Ut=Math.PI*2,pt=Math.PI*.5;function Ey(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 Py(t){ad=t}function Fy(t,e){e=e&&e.identity()||new ad;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 Ht(t,e,n){return n*(e-t)+t}function Wt(t,e){for(;t<0;)t+=e;return t%e}const ld=Cn.Float32Array||Array,Vy=Math.floor;function Sn(t){return Vy(t*1e6)/1e6}const de={move:"M",line:"L",curve:"C",arc:"A",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 cd={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))}}},bt=class bt extends ne{constructor(n=0,r=0){super();T(this,"_x",0);T(this,"_y",0);for(let o in cd)Object.defineProperty(this,o,cd[o]);this.x=n,this.y=r}static add(n,r){return new bt(n.x+r.x,n.y+r.y)}static sub(n,r){return new bt(n.x-r.x,n.y-r.y)}static subtract(n,r){return bt.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(bt.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 bt(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:Sn(this.x),y:Sn(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(bt,"zero",new bt),T(bt,"left",new bt(-1,0)),T(bt,"right",new bt(1,0)),T(bt,"up",new bt(0,-1)),T(bt,"down",new bt(0,1));let me=bt;class Me extends me{constructor(n=0,r=0,o=0,s=0,a=0,l=0,c=de.move){super(n,r);T(this,"controls",{left:new me,right:new me});T(this,"_command",de.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 dd)Object.defineProperty(this,u,dd[u]);this.command=c,this.relative=!0;const d=Me.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 Me().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 Me().copy(this)}toObject(){return{x:Sn(this.x),y:Sn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Sn(this.rx),ry:Sn(this.ry),xAxisRotation:Sn(this.xAxisRotation),largeArcFlag:Sn(this.largeArcFlag),sweepFlag:Sn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const dd={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 My=0;const So={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return My++}},Bo={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 To(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 ud(t,e,n,r,o,s,a,l,c){c=c||Bo.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Me(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,m=To(f,t,n,o,a),p=To(f,e,r,s,l);u.push(new Me(m,p))}return u}function Ay(t,e,n,r,o,s,a,l,c){if(t===n&&e===r&&o===a&&s===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}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),m=6*(e+s)-12*r,p=3*(r-e);function g(y){const b=(d*y+u)*y+h,_=(f*y+m)*y+p;return Math.sqrt(b*b+_*_)}return Oy(g,0,1,c||Bo.RecursionLimit)}function Iy(t,e,n,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,m,p,g,y,b;for(let C=0;C<2;++C){if(C===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;m=-f/h,0<m&&m<1&&c.push(m);continue}y=h*h-4*f*u,b=Math.sqrt(y),!(y<0)&&(p=(-h+b)/(2*u),0<p&&p<1&&c.push(p),g=(-h-b)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,k=_,x;for(;_--;)m=c[_],x=1-m,d[0][_]=x*x*x*t+3*x*x*m*n+3*x*m*m*o+m*m*m*a,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*l;return d[0][k]=t,d[1][k]=e,d[0][k+1]=a,d[1][k+1]=l,d[0].length=d[1].length=k+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 Oy(t,e,n,r){let o=Bo.abscissas[r-2],s=Bo.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 zy(t,e){const n=t.length,r=n-1;for(let o=0;o<n;o++){const s=t[o],a=e?Wt(o-1,n):Math.max(o-1,0),l=e?Wt(o+1,n):Math.min(o+1,r),c=t[a],d=s,u=t[l];Dy(c,d,u),d.command=o===0?de.move:de.curve}}function Dy(t,e,n){const r=me.angleBetween(t,e),o=me.angleBetween(n,e);let s=me.distanceBetween(t,e),a=me.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+=pt:l-=pt,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 $r=(Ai=class extends ne{constructor(){super();T(this,"_flagId",!1);T(this,"_flagClassName",!1);T(this,"_renderer",{});T(this,"_id",So.Identifier+So.uniqueId());T(this,"_className","");T(this,"classList",[]);for(let n in fd)Object.defineProperty(this,n,fd[n])}static fromObject(n){const r=new Ai().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(){if(typeof this.unbind=="function"&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const r=this.renderer.ctx;this._renderer.texture&&(r.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(r.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type==="CanvasRenderer"&&this._renderer.context&&delete this._renderer.context}const n=this._renderer.type;return this._renderer={type:n},this}},T(Ai,"Properties",["renderer","id","className"]),Ai);const fd={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 No extends Error{constructor(n){super();T(this,"name","Two.js");T(this,"message");this.message=n}}class Ly{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 $o;const hd={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Cn.document&&($o=document.createElement("a"));const Qe=class Qe extends $r{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 md)Object.defineProperty(this,o,md[o]);if(this._renderer.type="texture",this._renderer.flagOffset=Hy.bind(this),this._renderer.flagScale=Wy.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new me,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 Qe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return $o?($o.href=n,$o.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=Qe.getAbsoluteURL(n);if(Qe.ImageRegistry.contains(r))return Qe.ImageRegistry.get(r);let o;return Cn.document?hd.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=Qe.getTag(o);n._flagImage&&(/canvas/i.test(s)?Qe.Register.canvas(n,r):(n._src=o.getAttribute("two-src")||o.src,Qe.Register[s](n,r))),n._flagSrc&&(o||(o=Qe.getImage(n.src),n.image=o),s=Qe.getTag(o),Qe.Register[s](n,r))}clone(){const n=new Qe(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 me?n.offset:new me().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof me?n.scale:new me().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,Qe.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(Qe,"Properties",["src","loaded","repeat","scale","offset","image"]),T(Qe,"RegularExpressions",hd),T(Qe,"ImageRegistry",new Ly),T(Qe,"Register",{canvas:function(n,r){n._src="#"+n.id,Qe.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 No("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=Qe.getAbsoluteURL(n._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",n.src),Qe.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 No("unable to load "+n.src)};n._src=Qe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Qe.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 Ze=Qe;const md={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=Ze.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ze.ImageRegistry.contains(n)?this._image=Ze.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 me&&this._scale.unbind(ne.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof me&&this._scale.bind(ne.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Hy(){this._flagOffset=!0}function Wy(){this._flagScale=!0}class xi extends Array{constructor(){super();yl(this,_t,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 Ot(this,_t)}set _events(n){zh(this,_t,n)}get _bound(){return Ot(this,_t)._bound}set _bound(n){Ot(this,_t)._bound=n}addEventListener(){var n;return(n=Ot(this,_t).addEventListener)==null?void 0:n.apply(this,arguments)}on(){var n;return(n=Ot(this,_t).on)==null?void 0:n.apply(this,arguments)}bind(){var n;return(n=Ot(this,_t).bind)==null?void 0:n.apply(this,arguments)}removeEventListener(){var n;return(n=Ot(this,_t).removeEventListener)==null?void 0:n.apply(this,arguments)}off(){var n;return(n=Ot(this,_t).off)==null?void 0:n.apply(this,arguments)}unbind(){var n;return(n=Ot(this,_t).unbind)==null?void 0:n.apply(this,arguments)}dispatchEvent(){var n;return(n=Ot(this,_t).dispatchEvent)==null?void 0:n.apply(this,arguments)}trigger(){var n;return(n=Ot(this,_t).trigger)==null?void 0:n.apply(this,arguments)}listen(){var n;return(n=Ot(this,_t).listen)==null?void 0:n.apply(this,arguments)}ignore(){var n;return(n=Ot(this,_t).ignore)==null?void 0:n.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}}_t=new WeakMap;const pd=Array.prototype.slice;function jy(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const je={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=pd.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=pd.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=!jy(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:Cn.performance&&Cn.performance.now?Cn.performance:Date},Xt=class Xt extends $r{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 gd)Object.defineProperty(this,s,gd[s]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Xt.Index<=0?0:1,this.opacity=typeof o=="number"?o:1,this.color=typeof r=="string"?r:Xt.Index<=0?"#fff":"#000",Xt.Index=(Xt.Index+1)%2}static fromObject(n){const r=new Xt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Xt.Properties.length;r++){const o=Xt.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new Xt;return je.each(Xt.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",je.each(Xt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};T(Xt,"Index",0),T(Xt,"Properties",["offset","opacity","color"]);let ki=Xt;const gd={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)}}},En=class En extends $r{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 yd)Object.defineProperty(this,r,yd[r]);this._renderer.type="gradient",this._renderer.flagStops=qy.bind(this),this._renderer.bindStops=Xy.bind(this),this._renderer.unbindStops=Yy.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 ki?s:new ki().copy(s)));const o=new En(r).copy(n);return"id"in n&&(o.id=n.id),o}clone(n){const r=this.stops.map(s=>s.clone()),o=new En(r);return je.each(En.Properties,s=>{o[s]=this[s]},this),n&&n.add(o),o}copy(n){super.copy.call(this,n);for(let r=0;r<En.Properties.length;r++){const o=En.Properties[r];o in n&&(this[o]=n[o])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return je.each(En.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(En,"Stop",ki),T(En,"Properties",["spread","stops","units"]);let ut=En;const yd={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 xi((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._stops)}}};function qy(){this._flagStops=!0}function Xy(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Yy(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const fi=class fi extends ut{constructor(n,r,o,s,a){super(a);T(this,"_flagEndPoints",!1);T(this,"_left",null);T(this,"_right",null);for(let l in bd)Object.defineProperty(this,l,bd[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Uy.bind(this),this.left=new me,this.right=new me,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 fi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<fi.Properties.length;r++){const o=fi.Properties[r];o in n&&(this[o]=n[o]instanceof me?n[o]:new me().copy(n[o]))}return this}clone(n){const r=this.stops.map(function(s){return s.clone()}),o=new fi(this.left._x,this.left._y,this.right._x,this.right._y,r);return je.each(ut.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(fi,"Stop",ki),T(fi,"Properties",["left","right"]);let Ft=fi;const bd={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof me&&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 me&&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 Uy(){this._flagEndPoints=!0}const Pn=class Pn extends ut{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 _d)Object.defineProperty(this,c,_d[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Ky.bind(this),this._renderer.flagFocal=Gy.bind(this),this.center=new me,this.radius=typeof o=="number"?o:1,this.focal=new me,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 Pn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Pn.Properties.length;r++){const o=Pn.Properties[r];o in n&&(/(center|focal)i/.test(o)?this[o]=n[o]instanceof me?n[o]:new me().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 Pn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return je.each(ut.Properties.concat(Pn.Properties),function(s){o[s]=this[s]},this),n&&n.add(o),o}toObject(){const n=super.toObject.call(this);return je.each(Pn.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(Pn,"Stop",ki),T(Pn,"Properties",["center","radius","focal"]);let Vt=Pn;const _d={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 Ky(){this._flagCenter=!0}function Gy(){this._flagFocal=!0}function wd(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 Ro(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 xd(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),Ay(r,l,o,c,s,d,a,u,n)}function Gs(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),ud(r,l,o,c,s,d,a,u,n)}function vi(t){switch(t.renderer.type){case"texture":return Ze.fromObject(t);case"gradient":return ut.fromObject(t);case"linear-gradient":return Ft.fromObject(t);case"radial-gradient":return Vt.fromObject(t)}return t}const Zy=Math.cos,Qy=Math.sin,kd=Math.tan,Zs=[],At=class At extends ne{constructor(n,r,o,s,a,l){super();T(this,"elements",new ld(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 S,v,$;const E=r[0]||0,A=r[1]||0,R=r[2]||0;return S=w[0]*E+w[1]*A+w[2]*R,v=w[3]*E+w[4]*A+w[5]*R,$=w[6]*E+w[7]*A+w[8]*R,[S,v,$]}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],m=n[8],p=r[0],g=r[1],y=r[2],b=r[3],_=r[4],k=r[5],x=r[6],C=r[7],N=r[8];return o=o||new ld(9),o[0]=s*p+a*b+l*x,o[1]=s*g+a*_+l*C,o[2]=s*y+a*k+l*N,o[3]=c*p+d*b+u*x,o[4]=c*g+d*_+u*C,o[5]=c*y+d*k+u*N,o[6]=h*p+f*b+m*x,o[7]=h*g+f*_+m*C,o[8]=h*y+f*k+m*N,o}static fromObject(n){return new At().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]=At.Identity[0],this.elements[1]=At.Identity[1],this.elements[2]=At.Identity[2],this.elements[3]=At.Identity[3],this.elements[4]=At.Identity[4],this.elements[5]=At.Identity[5],this.elements[6]=At.Identity[6],this.elements[7]=At.Identity[7],this.elements[8]=At.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 H=a[0]*n+a[1]*r+a[2]*o,Q=a[3]*n+a[4]*r+a[5]*o,Z=a[6]*n+a[7]*r+a[8]*o;return[H,Q,Z]}const h=this.elements,f=[n,r,o,s,a,l,c,d,u],m=h[0],p=h[1],g=h[2],y=h[3],b=h[4],_=h[5],k=h[6],x=h[7],C=h[8],N=f[0],w=f[1],S=f[2],v=f[3],$=f[4],E=f[5],A=f[6],R=f[7],F=f[8];return this.elements[0]=m*N+p*v+g*A,this.elements[1]=m*w+p*$+g*R,this.elements[2]=m*S+p*E+g*F,this.elements[3]=y*N+b*v+_*A,this.elements[4]=y*w+b*$+_*R,this.elements[5]=y*S+b*E+_*F,this.elements[6]=k*N+x*v+C*A,this.elements[7]=k*w+x*$+C*R,this.elements[8]=k*S+x*E+C*F,this.trigger(ne.Types.change)}inverse(n){const r=this.elements;n=n||new At;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],m=f*c-d*h,p=-f*l+d*u,g=h*l-c*u;let y=o*m+s*p+a*g;return y?(y=1/y,n.elements[0]=m*y,n.elements[1]=(-f*s+a*h)*y,n.elements[2]=(d*s-a*c)*y,n.elements[3]=p*y,n.elements[4]=(f*o-a*u)*y,n.elements[5]=(-d*o+a*l)*y,n.elements[6]=g*y,n.elements[7]=(-h*o+s*u)*y,n.elements[8]=(c*o-s*l)*y,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=Zy(n),o=Qy(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=kd(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=kd(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Zs.length=0,this.toTransformArray(n,Zs),Zs.map(Sn).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],m=o[7],p=o[8];if(s){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=u,r[5]=m,r[6]=c,r[7]=h,r[8]=p;return}return[a,d,f,l,u,m,c,h,p]}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],m=o[7],p=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]=m,r[8]=p;return}return[a,l,c,d,u,h,f,m,p]}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 At().copy(this)}};T(At,"Identity",[1,0,0,0,1,0,0,0,1]);let tr=At;Py(tr);const Ur=class Ur extends $r{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 Eo)Object.defineProperty(this,n,Eo[n]);this._renderer.flagMatrix=vd.bind(this),this.isShape=!0,this.matrix=new tr,this.worldMatrix=new tr,this.position=new me,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Ur().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 Eo.position.get.apply(this,arguments)}set translation(n){Eo.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(n,r,o){const s=o||{},a=s.ignoreVisibility===!0;if(!a&&"visible"in this&&this.visible===!1||!a&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const l=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();return c?n>=c.left-l&&n<=c.right+l&&r>=c.top-l&&r<=c.bottom+l:!1}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof me?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 me?n.scale:new me(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 Ur;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 me?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}dispose(){super.dispose(),typeof this.translation=="object"&&typeof this.translation.unbind=="function"&&this.translation.unbind(),typeof this.scale=="object"&&typeof this.scale.unbind=="function"&&this.scale.unbind()}_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 me?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(Ur,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Bn=Ur;const Eo={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),vd.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 me&&this._scale.unbind(ne.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof me&&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 Fy(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function vd(){this._flagMatrix=!0}const Cd=/^(?:none|transparent)$/i,Jy=8,Qs=Number.EPSILON;function Dn(t,e){return{x:t,y:e}}function Po(t,e,n=Qs){return Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n}function Sd(t,e,n,r){const o=t*n+e*r,s=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+r*r)||1e-12;let a=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*n<0&&(a=-a),a}function e0(t,e,n){if(!t)return[Dn(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[Dn(e.x,e.y)];const s=(e.xAxisRotation||0)*Math.PI/180,a=e.largeArcFlag?1:0,l=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,h=e.y,f=(c-u)/2,m=(d-h)/2,p=Math.cos(s),g=Math.sin(s);let y=p*f+g*m,b=-g*f+p*m,_=r*r,k=o*o;const x=y*y/_+b*b/k;if(x>1){const P=Math.sqrt(x);r*=P,o*=P,_=r*r,k=o*o}const C=_*b*b+k*y*y,N=C===0?0:(_*k-C)/C;let w=Math.sqrt(Math.max(0,N));a===l&&(w=-w);const S=w*r*b/o,v=-w*o*y/r,$=p*S-g*v+(c+u)/2,E=g*S+p*v+(d+h)/2,A=Sd(1,0,(y-S)/r,(b-v)/o),R=Sd((y-S)/r,(b-v)/o,(-y-S)/r,(-b-v)/o)%Ut,F=A+R,H=l===0,Q=(()=>{const P=F-A,V=Math.abs(P)<Number.EPSILON;let M=Wt(P,Ut);return M<Number.EPSILON&&(M=V?0:Ut),H&&!V&&(M=M===Ut?-Ut:M-Ut),M})(),Z=Math.max(So.Resolution,Math.max(n*2,1)),O=[];for(let P=1;P<=Z;P++){const V=P/Z,M=A+V*Q;let L=$+r*Math.cos(M),Y=E+o*Math.sin(M);if(s!==0){const U=L-$,G=Y-E,q=Math.cos(s),W=Math.sin(s);L=U*q-G*W+$,Y=U*W+G*q+E}O.push(Dn(L,Y))}return O}function t0(t,e=Jy){const n=[],r=[],o=t._renderer&&t._renderer.vertices&&t._renderer.vertices.length>0?t._renderer.vertices:t.vertices;if(!o||o.length===0)return{polygons:n,segments:r};const s=Math.max(1,Math.floor(e));let a=null,l=null,c=null,d=null;const u=(f=!1)=>{if(a){if(f&&l&&c&&!Po(l,c)){const m=Dn(l.x,l.y);r.push({a:c,b:m}),a.push(m),c=m}a.length>=3&&l&&c&&Po(l,c)&&n.push(a),a=null,l=null,c=null}},h=f=>{if(!c){c=f,a&&a.push(f);return}Po(c,f)||(r.push({a:c,b:f}),a&&a.push(f),c=f)};for(let f=0;f<o.length;f++){const m=o[f],p=m.command||(f===0?de.move:de.line);if(p===de.move){u(!1);const g=Dn(m.x,m.y);a=[g],l=g,c=g,d=m;continue}if(d||(d=o[Math.max(f-1,0)]),p===de.line)h(Dn(m.x,m.y));else if(p===de.curve){const g=Gs(m,d,s);for(let y=1;y<g.length;y++){const b=g[y];h(Dn(b.x,b.y))}h(Dn(m.x,m.y))}else if(p===de.arc){const g=e0(d,m,s);for(let y=0;y<g.length;y++)h(g[y])}else if(p===de.close){u(!0),d=m;continue}else h(Dn(m.x,m.y));d=m}if(a){const f=!!t._closed||!!t.closed||l&&c&&!Po(l,c);u(f)}return{polygons:n,segments:r}}function n0(t,e,n){let r=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.length<3)continue;let a=s.length-1;for(let l=0;l<s.length;l++){const c=s[a],d=s[l];d.y>n!=c.y>n&&e<(c.x-d.x)*(n-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function i0(t,e,n,r){const o=r.x-n.x,s=r.y-n.y;if(Math.abs(o)<Qs&&Math.abs(s)<Qs){const f=t-n.x,m=e-n.y;return f*f+m*m}const a=((t-n.x)*o+(e-n.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=n.x+l*o,d=n.y+l*s,u=t-c,h=e-d;return u*u+h*h}function r0(t,e,n){if(!t||t.length===0)return 1/0;let r=1/0;for(let o=0;o<t.length;o++){const s=t[o],a=i0(e,n,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function o0(t,e){if(typeof e=="boolean")return e;const n=t.fill;return!n&&n!==0?!1:typeof n=="string"?!Cd.test(n):!0}function s0(t,e){const n=typeof t.linewidth=="number"?t.linewidth:t._linewidth||0;if(typeof e=="boolean")return e&&n>0;if(!(n>0))return!1;const r=t.stroke;return!r&&r!==0?!1:typeof r=="string"?!Cd.test(r):!0}function a0(t,e,n,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,a=t.top-r,l=t.bottom+r;return e>=o&&e<=s&&n>=a&&n<=l}const Fo=Number.EPSILON;function Vo(t){return typeof t.relative!="boolean"||!!t.relative}function un(t,e,n,r){const o=t.controls;if(!(!o||!o[e])){if(Math.abs(n)<Fo&&Math.abs(r)<Fo){Vo(t)?o[e].clear():o[e].set(t.x,t.y);return}Vo(t)?o[e].set(n,r):o[e].set(t.x+n,t.y+r)}}function jt(t,e){un(t,e,0,0)}function l0(t,e){const n=t.controls;return!n||!n[e]?{x:0,y:0}:Vo(t)?{x:n[e].x,y:n[e].y}:{x:n[e].x-t.x,y:n[e].y-t.y}}function nr(t,e){const n=l0(t,e);return Math.abs(n.x)>Fo||Math.abs(n.y)>Fo}function Mo(t){t.command===de.move||t.command===de.close||(t.command=nr(t,"left")||nr(t,"right")?de.curve:de.line)}function Bd(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function c0(t,e){return nr(e,"right")||nr(t,"left")||nr(t,"right")||nr(e,"left")||t.command===de.curve||e.command===de.curve}function ir(t,e,n){return{x:Ht(t.x,e.x,n),y:Ht(t.y,e.y,n)}}function Td(t,e){const n=t.controls&&t.controls[e];return n?Vo(t)?{x:t.x+n.x,y:t.y+n.y}:{x:n.x,y:n.y}:{x:t.x,y:t.y}}function d0(t,e,n){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},a=r?Td(t,"right"):{...s},l={x:e.x,y:e.y},c=o?Td(e,"left"):{...l},d=ir(s,a,n),u=ir(a,c,n),h=ir(c,l,n),f=ir(d,u,n),m=ir(u,h,n),p=ir(f,m,n),g=new Me(p.x,p.y);return Bd(g,t),un(g,"left",f.x-p.x,f.y-p.y),un(g,"right",m.x-p.x,m.y-p.y),g.command=de.curve,{anchor:g,startOut:d,endIn:h}}function u0(t,e,n,r,o,s){const a=t.length,l=n-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,h=d;if(r||(u=Math.min(1,e),h=Math.min(1,a-n-1)),c+=u+h,c<=1)return;const f=new Array(c+1);for(let w=0,S=e-u;w<=c;w+=1,S+=1){const v=Wt(S,a);f[w]=t[v]}let m=f[0].x+2*f[1].x,p=f[0].y+2*f[1].y,g=2;const y=c-1,b=[m],_=[p],k=[g],x=new Array(c+1),C=new Array(c+1);for(let w=1;w<c;w+=1){const S=w<y,v=S||s?1:2,$=S?4:s?2:7,E=S?4:s?3:8,A=S?2:s?0:1,R=v/g;g=k[w]=$-R,m=b[w]=E*f[w].x+A*f[w+1].x-R*m,p=_[w]=E*f[w].y+A*f[w+1].y-R*p}x[y]=b[y]/k[y],C[y]=_[y]/k[y];for(let w=c-2;w>=0;w-=1)x[w]=(b[w]-x[w+1])/k[w],C[w]=(_[w]-C[w+1])/k[w];x[c]=(3*f[c].x-x[y])/2,C[c]=(3*f[c].y-C[y])/2;const N=c-h;for(let w=u,S=e;w<=N;w+=1,S+=1){const v=Wt(S,a),$=t[v],E=x[w]-$.x,A=C[w]-$.y;o||w<N?un($,"right",E,A):jt($,"right"),o||w>u?un($,"left",-E,-A):jt($,"left"),Mo($)}}function f0(t,e,n,r,o,s){const a=e||t,l=t,c=n||t,d=me.distanceBetween(a,l),u=me.distanceBetween(l,c),h=r===void 0?.5:r,f=Math.pow(d,h),m=Math.pow(u,h),p=f*f,g=m*m;if(!o&&e){const y=2*g+3*m*f+p,b=3*m*(m+f);if(b!==0){const _=(g*a.x+y*l.x-p*c.x)/b-l.x,k=(g*a.y+y*l.y-p*c.y)/b-l.y;un(t,"left",_,k)}else jt(t,"left")}else jt(t,"left");if(!s&&n){const y=2*p+3*f*m+g,b=3*f*(f+m);if(b!==0){const _=(p*c.x+y*l.x-g*a.x)/b-l.x,k=(p*c.y+y*l.y-g*a.y)/b-l.y;un(t,"right",_,k)}else jt(t,"right")}else jt(t,"right");Mo(t)}function h0(t,e,n,r,o,s){if(!(e&&n)){e||jt(t,"left"),n||jt(t,"right"),Mo(t);return}const a=e,l=t,c=n,d=me.distanceBetween(a,l),u=me.distanceBetween(l,c),h=d+u,f=r===void 0?.4:r,m={x:a.x-c.x,y:a.y-c.y};if(!o&&h!==0){const p=f*d/h;un(t,"left",m.x*p,m.y*p)}else jt(t,"left");if(!s&&h!==0){const p=f*d/h-f;un(t,"right",m.x*p,m.y*p)}else jt(t,"right");Mo(t)}function m0(t,e,n,r,o,s){const a=s.type,l=s.factor,c=t.length;for(let d=e;d<=n;d+=1){const u=Wt(d,c),h=t[u];if(h.command===de.move){jt(h,"left"),jt(h,"right");continue}const f=d===e&&!o?null:d-1,m=d===n&&!o?null:d+1,p=f===null?null:t[Wt(f,c)],g=m===null?null:t[Wt(m,c)],y=f===null,b=m===null;a==="geometric"?h0(h,p,g,l,y,b):f0(h,p,g,l,y,b)}}const rr=Math.min,or=Math.max,p0=Math.ceil,g0=Math.floor,y0=new me,b0=new tr,mn=class mn extends Bn{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 Nd)Object.defineProperty(this,a,Nd[a]);this._renderer.type="path",this._renderer.flagVertices=$d.bind(this),this._renderer.bindVertices=Rd.bind(this),this._renderer.unbindVertices=Ed.bind(this),this._renderer.flagFill=Pd.bind(this),this._renderer.flagStroke=Fd.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:vi(n.fill),o=typeof n.stroke=="string"?n.stroke:vi(n.stroke),s=new mn().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 Me?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Me().copy(o))}}for(let r=0;r<mn.Properties.length;r++){const o=mn.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new mn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<mn.Properties.length;o++){const s=mn.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()),je.each(mn.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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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:m,scaleY:p}=Ey(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof m=="number"&&typeof p=="number"&&(o=Math.max(m,p)*(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[m,p]=r.multiply(l.x,l.y),[g,y]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let b=l.controls.right.x,_=l.controls.right.y;l.relative&&(b+=l.x,_+=l.y);let[k,x]=r.multiply(b,_),C=c.controls.left.x,N=c.controls.left.y;c.relative&&(C+=c.x,N+=c.y);let[w,S]=r.multiply(C,N);const v=Iy(m,p,k,x,w,S,g,y);h=rr(v.min.y-o,h),d=rr(v.min.x-o,d),u=or(v.max.x+o,u),f=or(v.max.y+o,f)}else a<=1&&(h=rr(p-o,h),d=rr(m-o,d),u=or(m+o,u),f=or(p+o,f)),h=rr(y-o,h),d=rr(g-o,d),u=or(g+o,u),f=or(y+o,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}contains(n,r,o){const s=o||{},a=s.ignoreVisibility===!0;if(!a&&this.visible===!1||!a&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const l=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();if(!c||n<c.left-l||n>c.right+l||r<c.top-l||r>c.bottom+l)return!1;const d=this.worldMatrix,u=d&&d.inverse(b0);if(!u)return super.contains(n,r,s);const[h,f]=u.multiply(n,r,1),m=typeof s.precision=="number"&&!Number.isNaN(s.precision)?Math.max(1,Math.floor(s.precision)):8,p=o0(this,s.fill),g=s0(this,s.stroke),{polygons:y,segments:b}=t0(this,m);if(p&&y.length>0&&n0(y,h,f))return!0;if(g&&b.length>0){const _=typeof this.linewidth=="number"?this.linewidth:0;if(_>0&&r0(b,h,f)<=_/2+l)return!0}return!p&&!g?super.contains(n,r,s):p&&y.length===0?super.contains(n,r,s):!1}getPointAt(n,r){let o,s,a,l,c,d,u,h,f,m,p,g,y,b,_,k=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,C=x-1;let N=null,w=null;for(let O=0,P=this._lengths.length,V=0;O<P;O++){if(V+this._lengths[O]>=k){this._closed?(o=Wt(O,x),s=Wt(O-1,x),O===0&&(o=s,s=O)):(o=O,s=Math.min(Math.max(O-1,0),C)),N=this.vertices[o],w=this.vertices[s],k-=V,this._lengths[O]!==0?n=k/this._lengths[O]:n=0;break}V+=this._lengths[O]}if(N===null||w===null)return null;if(N){if(!w)return N}else return w;_=w.controls&&w.controls.right,b=N.controls&&N.controls.left,c=w.x,m=w.y,d=(_||w).x,p=(_||w).y,u=(b||N).x,g=(b||N).y,h=N.x,y=N.y,_&&w.relative&&(d+=w.x,p+=w.y),b&&N.relative&&(u+=N.x,g+=N.y),l=To(n,c,d,u,h),f=To(n,m,p,g,y);const S=Ht(c,d,n),v=Ht(m,p,n),$=Ht(d,u,n),E=Ht(p,g,n),A=Ht(u,h,n),R=Ht(g,y,n),F=Ht(S,$,n),H=Ht(v,E,n),Q=Ht($,A,n),Z=Ht(E,R,n);return je.isObject(r)?(r.x=l,r.y=f,r instanceof Me&&(r.controls.left.x=F,r.controls.left.y=H,r.controls.right.x=Q,r.controls.right.y=Z,(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 Me(l,f,F-l,H-f,Q-l,Z-f,this._curved?de.curve:de.line),a.t=n,a)}plot(){if(this.curved)return zy(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?de.move:de.line;return this}smooth(n){const r=n||{},o=r.type||"continuous",s=this._collection,a=s.length;if(a<2)return this;const l=this._closed||a>0&&s[a-1]&&s[a-1].command===de.close,c=(m,p)=>{if(m==null)return p;if(typeof m=="number"){if(l)return Wt(m,a);let y=m;return y<0&&(y+=a),Math.min(Math.max(y,0),a-1)}const g=s.indexOf(m);return g!==-1?g:p},d=l&&r.from===void 0&&r.to===void 0;let u=c(r.from,0),h=c(r.to,a-1);if(u>h)if(l)u-=a;else{const m=u;u=h,h=m}const f=h-u+1;for(let m=0;m<f;m+=1){const p=Wt(u+m,a),g=s[p],y=!l&&p===0;g.command===de.move&&!y&&(g.command=de.line)}if(o==="continuous"||o==="asymmetric")u0(s,u,h,l,d,o==="asymmetric");else if(o==="catmull-rom"||o==="geometric"){const m={type:o,factor:r.factor};m0(s,u,h,l,d,m)}else throw new Error(`Path.smooth does not support type "${o}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(n){this._update();const r=this.vertices,o=r.length;if(o<2)return this;const s=[];let a=null,l=null;for(let c=0;c<o;c+=1){const d=r[c];if(!a||d.command===de.move){const h=d.clone();s.push(h),a=d,l=d;continue}if(c0(d,a)){const f=Gs(d,a,n).length,m=s[s.length-1];let p=m.clone(),g=d.clone(),y=m,b=0;if(f<=1){const _=d.clone();s.push(_)}else{for(let k=1;k<f;k+=1){const x=k/f,C=1-b,N=C<=Number.EPSILON?x:(x-b)/C,w=d0(p,g,N);un(y,"right",w.startOut.x-y.x,w.startOut.y-y.y);const S=w.anchor;s.push(S),y=S,p=S.clone(),b=x,un(g,"left",w.endIn.x-g.x,w.endIn.y-g.y)}const _=d.clone();_.controls.left.copy(g.controls.left),s.push(_)}}else{const h=Gs(d,a,n);for(let m=1;m<h.length;m+=1){const p=h[m];Bd(p,a),jt(p,"left"),jt(p,"right"),p.command=de.line,s.push(p)}const f=d.clone();s.push(f)}a=d,d.command===de.close&&(a=l)}return this._automatic=!1,this._curved=!1,this.vertices=s,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=[]),je.each(this.vertices,function(c,d){if(d<=0||c.command===de.move){a=c,this._lengths[d]=0;return}this._lengths[d]=xd(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=Ro(this,o*this._length),l=Ro(this,s*this._length),c=p0(a),d=g0(l);let u,h,f,m,p,g;for(this._renderer.vertices.length=0,g=0;g<n;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new Me),g>d&&!h?(p=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,p),p.command=this._renderer.collection[g].command,this._renderer.vertices.push(p),h=p,f=this._collection[g-1],f&&f.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),f.relative?this._renderer.collection[g-1].controls.right.copy(f.controls.right).lerp(me.zero,1-p.t):this._renderer.collection[g-1].controls.right.copy(f.controls.right).lerp(f,1-p.t))):g>=c&&g<=d&&(p=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(p),g===d&&wd(this,s)?(h=p,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):g===c&&wd(this,o)&&(u=p,u.command=de.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(g=c-1,p=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(o,p),p.command=de.move,this._renderer.vertices.unshift(p),m=this._collection[g+1],m&&m.controls&&(p.controls.left.clear(),m.relative?this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(me.zero,p.t):(y0.copy(m),this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(m,p.t))))}return Bn.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,Bn.prototype.flagReset.call(this),this}};T(mn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),T(mn,"Utils",{getCurveLength:xd});let Ae=mn;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}},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 ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&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";je.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 xi?this._collection=t:this._collection=new xi(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,je.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 $d(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Rd(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Ed(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Pd(){this._flagFill=!0}function Fd(){this._flagStroke=!0}const _0=Math.ceil,w0=Math.floor,Fn=class Fn extends Bn{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 Vd)Object.defineProperty(this,r,Vd[r]);this._renderer.type="points",this._renderer.flagVertices=$d.bind(this),this._renderer.bindVertices=Rd.bind(this),this._renderer.unbindVertices=Ed.bind(this),this._renderer.flagFill=Pd.bind(this),this._renderer.flagStroke=Fd.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:vi(n.fill),o=typeof n.stroke=="string"?n.stroke:vi(n.stroke),s=new Fn().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 Me?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Me().copy(o))}for(let r=0;r<Fn.Properties.length;r++){const o=Fn.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new Fn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Fn.Properties.length;o++){const s=Fn.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()),je.each(Fn.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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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=ud(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=Ro(this,n*this._length),s=Ro(this,r*this._length),a=_0(o),l=w0(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(Fn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let Ao=Fn;const Vd={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 ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&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 xi?this._collection=t:this._collection=new xi(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 Md extends xi{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);yl(this,cs,{});this.attach(n),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return Ot(this,cs)}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}}cs=new WeakMap;const qn=class qn extends Ae{constructor(n,r,o,s,a,l,c){const d=c||So.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Me);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",Ut);T(this,"_innerRadius",0);T(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in Ad)Object.defineProperty(this,h,Ad[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 qn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<qn.Properties.length;r++){const o=qn.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=Wt(n,Ut)===Wt(r,Ut),l=o>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,f,m,p,g,y,b,_,k,x;for(a?d--:l||(d-=2),f=0,m=d-1;f<d;f++){switch(p=f/m,g=c[h],y=p*(r-n)+n,b=(r-n)/d,_=s*Math.cos(y),k=s*Math.sin(y),f){case 0:u=de.move;break;default:u=de.curve}g.command=u,g.x=_,g.y=k,g.controls.left.clear(),g.controls.right.clear(),g.command===de.curve&&(x=s*b/Math.PI,g.controls.left.x=x*Math.cos(y-pt),g.controls.left.y=x*Math.sin(y-pt),g.controls.right.x=x*Math.cos(y+pt),g.controls.right.y=x*Math.sin(y+pt),f===1&&g.controls.left.multiplyScalar(2),f===m&&g.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=de.close,h++):(d--,m=d-1),f=0;f<d;f++)p=f/m,g=c[h],y=(1-p)*(r-n)+n,b=(r-n)/d,_=o*Math.cos(y),k=o*Math.sin(y),u=de.curve,f<=0&&(u=a?de.move:de.line),g.command=u,g.x=_,g.y=k,g.controls.left.clear(),g.controls.right.clear(),g.command===de.curve&&(x=o*b/Math.PI,g.controls.left.x=x*Math.cos(y+pt),g.controls.left.y=x*Math.sin(y+pt),g.controls.right.x=x*Math.cos(y-pt),g.controls.right.y=x*Math.sin(y-pt),f===1&&g.controls.left.multiplyScalar(2),f===m&&g.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=de.line}else a||(c[h].command=de.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].command=de.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 qn(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<qn.Properties.length;r++){const o=qn.Properties[r];n[o]=this[o]}return n}};T(qn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Js=qn;const Ad={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}}},ea=Math.cos,ta=Math.sin,Xn=class Xn 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 Me(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 Id)Object.defineProperty(this,c,Id[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 Xn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Xn.Properties.length;r++){const o=Xn.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*Ut,d=o*ea(c),u=o*ta(c),h=s*ea(c-pt),f=s*ta(c-pt),m=s*ea(c+pt),p=s*ta(c+pt),g=this.vertices[a];g.command=a===0?de.move:de.curve,g.set(d,u),g.controls.left.set(h,f),g.controls.right.set(m,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Xn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let 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<Xn.Properties.length;r++){const o=Xn.Properties[r];n[o]=this[o]}return n}};T(Xn,"Properties",["radius"]);let na=Xn;const Id={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},ia=Math.cos,ra=Math.sin,Yn=class Yn 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 Me);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 Od)Object.defineProperty(this,d,Od[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 Yn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Yn.Properties.length;r++){const o=Yn.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*Ut,d=o*ia(c),u=s*ra(c),h=o*r*ia(c-pt),f=s*r*ra(c-pt),m=o*r*ia(c+pt),p=s*r*ra(c+pt),g=this.vertices[a];g.command=a===0?de.move:de.curve,g.set(d,u),g.controls.left.set(h,f),g.controls.right.set(m,p)}}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 Yn(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<Yn.Properties.length;r++){const o=Yn.Properties[r];n[o]=this[o]}return n}};T(Yn,"Properties",["width","height"]);let oa=Yn;const Od={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}}},x0=Math.cos,k0=Math.sin,Un=class Un 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 zd)Object.defineProperty(this,a,zd[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 Un().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Un.Properties.length;r++){const o=Un.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=Ut*a+Math.PI/2,c=this._width*x0(l)/2,d=this._height*k0(l)/2;s>=o?this.vertices.push(new Me(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?de.move:de.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 Un(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<Un.Properties.length;r++){const o=Un.Properties[r];n[o]=this[o]}return n}};T(Un,"Properties",["width","height","sides"]);let sa=Un;const zd={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}}},Ii=class Ii extends Ae{constructor(n,r,o,s){const a=[new Me,new Me,new Me,new Me];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 Dd)Object.defineProperty(this,l,Dd[l]);this.width=typeof o=="number"?o:1,this.height=typeof s=="number"?s:1,this.origin=new me,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ii().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ii.Properties.length;r++){const o=Ii.Properties[r];o in n&&(typeof n[o]=="number"?this[o]=n[o]:this[o]instanceof me&&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 Me),this.vertices[0].set(-n,-r).sub(this._origin).command=de.move,this.vertices[1].set(n,-r).sub(this._origin).command=de.line,this.vertices[2].set(n,r).sub(this._origin).command=de.line,this.vertices[3].set(-n,r).sub(this._origin).command=de.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=de.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ii(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 me?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(Ii,"Properties",["width","height","origin"]);let Rr=Ii;const Dd={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()}}},Kn=class Kn 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 Me(0,0,0,0,0,0,c===0?de.move:de.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 Ld)Object.defineProperty(this,c,Ld[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=v0.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof a=="number"||a instanceof me)&&(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 Kn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Kn.Properties.length;r++){const o=Kn.Properties[r];if(o in n){const s=n[o];/radius/i.test(o)?this[o]=typeof s=="number"||s instanceof me?s:new me().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 me?(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 Kn(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<Kn.Properties.length;r++){const o=Kn.Properties[r];n[o]=this[o]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};T(Kn,"Properties",["width","height","radius"]);let aa=Kn;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}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof me&&this._radius.unbind(ne.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof me&&this._radius.bind(ne.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function v0(){this._flagRadius=!0}const C0=Math.cos,S0=Math.sin,Gn=class Gn 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 Hd)Object.defineProperty(this,l,Hd[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 Gn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Gn.Properties.length;r++){const o=Gn.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=Ut*a,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*C0(l),u=c*S0(l);s>=o?this.vertices.push(new Me(d,u)):this.vertices[s].set(d,u),this.vertices[s].command=s===0?de.move:de.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 Gn(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<Gn.Properties.length;r++){const o=Gn.Properties[r];n[o]=this[o]}return n}};T(Gn,"Properties",["innerRadius","outerRadius","sides"]);let la=Gn;const Hd={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 ca;const Wd=Math.min,jd=Math.max;Cn.document&&(ca=document.createElement("canvas"));const $t=class $t extends Bn{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 qd)Object.defineProperty(this,a,qd[a]);if(this._renderer.type="text",this._renderer.flagFill=B0.bind(this),this._renderer.flagStroke=T0.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,!je.isObject(s))return this;for(let a=0;a<$t.Properties.length;a++){const l=$t.Properties[a];l in s&&(this[l]=s[l])}}static Measure(n){if(ca){const r=ca.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*$t.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:vi(n.fill),o=typeof n.stroke=="string"?n.stroke:vi(n.stroke),s=new $t().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<$t.Properties.length;r++){const o=$t.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new $t(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let o=0;o<$t.Properties.length;o++){const s=$t.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<$t.Properties.length;r++){const o=$t.Properties[r];n[o]=this[o]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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}=$t.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),[m,p]=r.multiply(o,l),[g,y]=r.multiply(s,a),[b,_]=r.multiply(s,l);return a=Wd(f,p,y,_),o=Wd(h,m,g,b),s=jd(h,m,g,b),l=jd(f,p,y,_),{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($t,"Ratio",.6),T($t,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let sr=$t;const qd={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 ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&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,je.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 B0(){this._flagFill=!0}function T0(){this._flagStroke=!0}const Zn=class Zn extends Rr{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 Xd)Object.defineProperty(this,a,Xd[a]);this._renderer.flagTextures=N0.bind(this),this._renderer.bindTextures=$0.bind(this),this._renderer.unbindTextures=R0.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(Yd.bind(this)):typeof n=="string"&&(this.textures=[Yd(n)]),this.origin=new me,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Zn.DefaultFrameRate,this.index=0}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];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=je.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 Zn(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,je.isNaN(this._lastFrame)&&(this._lastFrame=a-1),s=je.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=Ht(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 Ze))&&(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(Zn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),T(Zn,"DefaultFrameRate",30);let da=Zn;const Xd={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 xi((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 N0(){this._flagTextures=!0}function $0(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function R0(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Yd(t){if(t instanceof Ze)return t;if(typeof t=="string")return new Ze(t)}const Oi=class Oi extends Rr{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 Ud)Object.defineProperty(this,c,Ud[c]);this.noStroke(),this.noFill(),n instanceof Ze?this.texture=n:typeof n=="string"&&(this.texture=new Ze(n)),this.origin=new me,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 Oi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Oi.Properties.length;r++){const o=Oi.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=je.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 Oi(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,m;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&&(je.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=je.performance.now()-this._startTime,m=this._lastFrame+1,d=1e3*(m-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Ht(this._firstFrame,m,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%r,g=Math.floor(this._index/r),y=-s*p+(h-s)/2,b=-a*g+(f-a)/2;y!==n.offset.x&&(n.offset.x=y),b!==n.offset.y&&(n.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};T(Oi,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let ua=Oi;const Ud={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}}},Io=Math.min,Oo=Math.max,E0={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},It=class It extends Bn{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 Kd)Object.defineProperty(this,r,Kd[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++)Gd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Gd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new It;for(let s=0;s<It.Properties.length;s++){const a=It.Properties[s];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:vi(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 Js.fromObject(s);case"circle":return na.fromObject(s);case"element":return $r.fromObject(s);case"ellipse":return oa.fromObject(s);case"group":return It.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return da.fromObject(s);case"path":return Ae.fromObject(s);case"points":return Ao.fromObject(s);case"polygon":return sa.fromObject(s);case"rectangle":return Rr.fromObject(s);case"rounded-rectangle":return aa.fromObject(s);case"shape":return Bn.fromObject(s);case"sprite":return ua.fromObject(s);case"star":return la.fromObject(s);case"text":return sr.fromObject(s)}return s}}static IsVisible(n,r){if(!r)return!0;let o=n;for(;o;){if(typeof o.visible=="boolean"&&!o.visible||typeof o.opacity=="number"&&o.opacity<=0)return!1;o=o.parent}return!0}static VisitForHitTest(n,r,o,s,a,l,c){const d=n&&n.children;if(!d)return!1;const u=r.results;for(let h=d.length-1;h>=0;h--){const f=d[h];if(!f||!It.IsVisible(f,r.visibleOnly))continue;const m=typeof f.getBoundingClientRect=="function"?f.getBoundingClientRect():null;if(!(m&&!a0(m,r.x,r.y,l))){if(f instanceof It){if(o&&(!s||s(f))&&typeof f.contains=="function"&&f.contains(r.x,r.y,a)&&(u.push(f),c)||It.VisitForHitTest(f,r,o,s,a,l,c))return!0;continue}if(f instanceof Bn&&!(s&&!s(f))&&typeof f.contains=="function"&&f.contains(r.x,r.y,a)&&(u.push(f),c))return!0}}return!1}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<It.Properties.length;r++){const o=It.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new It,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,je.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}getShapesAtPoint(n,r,o){const s=o||{},{results:a,hitOptions:l,context:c,single:d,empty:u}=E0.getShapesAtPoint;a.length=0;const h=s.mode==="deepest"||s.deepest?"deepest":"all",f=s.visibleOnly!==!1,m=!!s.includeGroups,p=typeof s.filter=="function"?s.filter:null,g=typeof s.tolerance=="number"?s.tolerance:0;typeof s.precision=="number"?l.precision=s.precision:delete l.precision,typeof s.fill<"u"?l.fill=s.fill:delete l.fill,typeof s.stroke<"u"?l.stroke=s.stroke:delete l.stroke,l.tolerance=g,l.ignoreVisibility=!f;const y=h==="deepest";if(c.x=n,c.y=r,c.visibleOnly=f,c.results=a,It.VisitForHitTest(this,c,m,p,l,g,y),y){if(a.length>0){const _=a[0];return a.length=0,d[0]=_,d.length=1,d}return u.length=0,u}const b=a.slice();return a.length=0,b}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 m=/texture|gradient/i;o=n?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const g=this.children[p];if(!(!g.visible||m.test(g._renderer.type))&&(r=g.getBoundingClientRect(n),s=typeof r.top!="number"||je.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||je.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||je.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||je.isNaN(r.bottom)||!isFinite(r.bottom),!(s||a||l||c)))if(n){const[y,b]=o.multiply(r.left,r.top),[_,k]=o.multiply(r.right,r.top),[x,C]=o.multiply(r.left,r.bottom),[N,w]=o.multiply(r.right,r.bottom);h=Io(b,k,C,w,h),d=Io(y,_,x,N,d),u=Oo(y,_,x,N,u),f=Oo(b,k,C,w,f)}else h=Io(r.top,h),d=Io(r.left,d),u=Oo(r.right,u),f=Oo(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(It,"Children",Md),T(It,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Ln=It;const Kd={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=Ln.InsertChildren.bind(this),n=Ln.RemoveChildren.bind(this),r=Ln.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Md(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,je.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 Gd(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 zo extends Ae{constructor(e,n,r,o){const s=[new Me(e,n),new Me(r,o)];super(s);for(let a in Zd)Object.defineProperty(this,a,Zd[a]);this.vertices[0].command=de.move,this.vertices[1].command=de.line,this.automatic=!1}}T(zo,"Properties",["left","right"]);const Zd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(je.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=de.move;else{const e=new No("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(je.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=de.line;else{const e=new No("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class fa{constructor(e=0,n=0){this.x=e,this.y=n}}class Tn{constructor(e=10,n=0,r="A"){T(this,"start",new fa);T(this,"end",new fa);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"}},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:"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 Do=i.markRaw({name:"ion-close",render:F0}),V0={class:"mr-3 flex flex-col gap-2"},M0=["onClick"],A0={class:"h-full p-2"},I0={},O0=i.defineComponent({...I0,__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 m;const f=(m=o.value)==null?void 0:m.at(h);f&&a("init-draw-template",f,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var m;const f=(m=s.value)==null?void 0:m.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 m=(f=s.value)==null?void 0:f.at(h);m&&a("init-draw-template",m,u)}}),d.length>c.length&&d.forEach((u,h)=>{var m;const f=(m=s.value)==null?void 0:m.at(h);f&&(f.innerHTML="",a("init-draw-template",f,u))})})},{deep:!0}),(c,d)=>{const u=Do;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",V0,[(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(z.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":f===t.selectTemplateIndex}]),onClick:m=>a("template:select",f)},[i.createElementVNode("div",A0,[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,M0)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.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:m=>l(f)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Qd=An(O0,[["__scopeId","data-v-afccb364"]]),z0={class:"flex gap-3 min-w-[20rem] relative"},D0={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},L0={ref:"drawing-container",class:"size-full"},H0={},Jd=i.defineComponent({...H0,__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((O,P)=>new Tn(n.value.configuratorParams.linesWidths[P],O,`A-${P+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var O,P;return n.value.configuratorParams.startTailType&&((O=n.settings.startTailConfigs)!=null&&O[n.value.configuratorParams.startTailType])?(P=n.settings.startTailConfigs)==null?void 0:P[n.value.configuratorParams.startTailType].points:[]}),m=i.computed(()=>{var P;const O=n.value.configuratorParams.endTailType!==void 0&&((P=n.settings.endTailConfigs)==null?void 0:P[n.value.configuratorParams.endTailType]);return!O||!O.points?[]:O.points.map((V,M)=>Array.isArray(V)?new Tn(V[0],V[1],`A-${M+1}`):new Tn(V.width,V.angle,`A-${M+1}`))}),p=(O,P=!1)=>{O[0].start.x=0,O[0].start.y=0;let V=0;for(let M=0;M<O.length;M++){const L=O[M],Y=O[M-1]??new Tn(0,V);V+=!P||M>1?Y.angle:0;const U=(!P||M>0?L.angle:0)+V;if(O[M].end.x=L.width*Math.cos(U*Math.PI/180)+O[M].start.x,O[M].end.y=L.width*Math.sin(U*Math.PI/180)+O[M].start.y,M<O.length-1){const G=M+1;O[G].start.x=O[M].end.x,O[G].start.y=O[M].end.y}}return O},g=(O,P,V,M,L=!1)=>{let Y=p([...V,...M]);P.length>0&&(Y=[...p(P),...Y]);let U=0,G=0,q=0,W=0;Y.forEach(ve=>{U=Math.min(U,ve.start.x,ve.end.x),G=Math.min(G,ve.start.y,ve.end.y),q=Math.max(q,ve.start.x,ve.end.x),W=Math.max(W,ve.start.y,ve.end.y)});let K,ue;U===0&&G===0&&q===0&&W===0?(K=1,ue=1):(K=O.width/Math.abs(q-U),ue=(L?O.height:O.height-qe.colorSideLabel.size)/Math.abs(W-G));const ye=Math.min(K,ue);return U=U<0?-U*ye:0,G=G<0?-G*ye:0,[ye,U,G]},y=O=>{const P=new Ao([O]);return P._size=qe.anchorPoint.size,P.fill=qe.anchorPoint.color,P.stroke="transparent",P._linewidth=qe.anchorPoint.strokeSize,l.push(P),P},b=(O,P)=>{if(l=[],n.settings.allowChangeFirstPoint){const V=O[0],M=new me(V.vertices[0].x,V.vertices[0].y);M.bind(ne.Types.change,()=>{V.vertices[0].copy(M)});const L=y(M);P.add(L)}O.forEach((V,M)=>{const L=O[M+1],Y=new me(V.vertices[1].x,V.vertices[1].y);Y.bind(ne.Types.change,()=>{V.vertices[1].copy(Y),L!==void 0&&L.vertices[0].copy(Y)});const U=y(Y);P.add(U)})},_=O=>O*(Math.PI/180),k=(O,P,V)=>{const M=P.vertices.length-1;O.position.x=P.vertices[M].x,O.position.y=P.vertices[M].y;const L=Math.atan2(P.vertices[M].y-P.vertices[0].y,P.vertices[M].x-P.vertices[0].x);O.rotation=_(V)+L},x=(O,P,V)=>{if(P.vertices[0]===void 0)return;O.position.x=P.vertices[0].x,O.position.y=P.vertices[0].y;const M=P.vertices.length-1,L=Math.atan2(P.vertices[M].y-P.vertices[0].y,P.vertices[M].x-P.vertices[0].x);O.rotation=_(V)+L},C=(O,P,V)=>{const M=new Ln;if(O.length===0)return M;const L=[];return[...O].reverse().forEach((Y,U)=>{U!==0&&Y.angle>0&&(Y.angle*=-1),L.push(Y)}),O=p(L,!0),x(M,P,O[0].angle),[P.vertices[0],P.vertices[1]].forEach(Y=>{Y.bind(ne.Types.change,()=>{x(M,P,O[0].angle)})}),O.forEach(Y=>{const U=Y.start.x*V,G=Y.end.x*V,q=Y.start.y*V,W=Y.end.y*V,K=new zo(U,q,G,W);K.linewidth=qe.line.size,K.stroke=qe.line.color,M.add(K)}),M},N=(O,P,V)=>{const M=new Ln;return O.length===0||(O=p(O,!0),k(M,P,O[0].angle),[P.vertices[0],P.vertices[1]].forEach(L=>{L.bind(ne.Types.change,()=>{k(M,P,O[0].angle)})}),O.forEach(L=>{const Y=L.start.x*V,U=L.end.x*V,G=L.start.y*V,q=L.end.y*V,W=new zo(Y,G,U,q);W.linewidth=qe.line.size,W.stroke=qe.line.color,M.add(W)})),M},w=(O,P,V,M)=>{const L=P.vertices[0].x+(P.vertices[1].x-P.vertices[0].x)/2-8*Math.sin(O.angle*Math.PI/180),Y=P.vertices[0].y+(P.vertices[1].y-P.vertices[0].y)/2-8*Math.cos(O.angle*Math.PI/180),U=new sr(O.label,L+10,Y-10);let G;U.size=qe.lineLabel.size,U.weight=600,U.fill=qe.lineLabel.color,U.id+=1,U.rotation=qe.lineLabel.rotation,M>0&&(G=new sr(`${O.angle}°`,P.vertices[0].x+25,P.vertices[0].y-25),G.size=qe.angleLabel.size,G.weight=600,G.fill=qe.angleLabel.color,G.rotation=qe.angleLabel.rotation,G.id+=M,s.push(G),V.add(G)),V.add(U),v(U,P,0,G),v(U,P,1)},S=()=>{const{size:O}=qe.colorSideLabel,P=0,V=0,M=h.value?O/2:O/2-O,L=h.value?O/2-O:O/2,Y=new Ln;if(!c)return Y;const U=5,G=Math.atan2(L-M,V-P),q=[new Me(P,M,0,0,0,0,vn.Commands.move),new Me(V,L,0,0,0,0,vn.Commands.line),new Me(V-U*Math.cos(G-Math.PI/4),L-U*Math.sin(G-Math.PI/4),0,0,0,0,vn.Commands.line),new Me(V,L,0,0,0,0,vn.Commands.move),new Me(V-U*Math.cos(G+Math.PI/4),L-U*Math.sin(G+Math.PI/4),0,0,0,0,vn.Commands.line)],W=new Ae(q,!1,!1,!0);W.noFill(),W.cap="round",W.join="round",W.linewidth=O/7,W.stroke=qe.colorSideLabel.color,Y.add(W);const K=new sr(h.value?"Цвет снизу":"Цвет сверху",10,0);K.size=O,K.weight=600,K.fill=qe.colorSideLabel.color,K.alignment="left",Y.add(K);const ue=Y.getBoundingClientRect();return Y.position.x=(c.width-ue.width)*d+10,Y.position.y=h.value?c.height+ue.height*2:ue.height/2,Y},v=(O,P,V,M)=>{P.vertices[V].bind(ne.Types.change,()=>{const L=P.vertices.length-1,Y=Math.atan2(P.vertices[0].y-P.vertices[L].y,P.vertices[0].x-P.vertices[L].x)*180/Math.PI,U=P.vertices[0].x+(P.vertices[L].x-P.vertices[0].x)/2-8*Math.sin(Y*Math.PI/180),G=P.vertices[0].y+(P.vertices[L].y-P.vertices[0].y)/2-8*Math.cos(Y*Math.PI/180);O.position.x=U+10,O.position.y=G-10,O.rotation=-.5,M&&(M.position.x=P.vertices[0].x+25,M.position.y=P.vertices[0].y-25)})},$=(O,P,V,M,L=!1)=>{var ot;if(O.clear(),V.length===0){O.update();return}const Y=p(V),[U,G,q]=g(O,P,Y,M,L),W=new Ln,K=new Array,ue=new Array;L||(s=[],a=[]),Y.forEach((_e,we)=>{const wt=_e.start.x*U+G,$e=_e.end.x*U+G,Gt=_e.start.y*U+q,pn=_e.end.y*U+q,Rt=new zo(wt,Gt,$e,pn);Rt.linewidth=L?qe.previewLine.size:qe.line.size,Rt.stroke=L?qe.previewLine.color:qe.line.color,a.push(Rt),K.push(Rt),W.add(Rt),!L&&_e.label!==""&&w(_e,Rt,W,we)});const ye=K.at(-1);let ve=W.getBoundingClientRect();if(!L){const _e=S();ue.push(_e)}if(P.length>0){const _e=C(P,K[0],U);W.add(_e)}if(M.length>0&&ye){const _e=N(M,ye,U);W.add(_e)}if(ue.push(W),O.makeGroup(ue),ve=W.getBoundingClientRect(),W.position.x=0-ve.left+(O.width-ve.width)/(2*(L?1:d)),W.position.y=0-ve.top+(O.height-ve.height)/(2*(L?1:d)),O.update(),!L){const _e=((ot=n.value.configuratorParams)==null?void 0:ot.colorSide)==="top";W.position.y=W.position.y+qe.colorSideLabel.size*Number(_e),b(K,W),O.update()}},E=(O,P)=>{if(O&&!P.isNewRec()){const V=new vn({width:O.scrollWidth,height:O.scrollHeight});V.appendTo(O),$(V,[],P.points,[],!0)}},A=()=>{c&&$(c,f.value,u.value,m.value,!1)},R=O=>O*(180/Math.PI),F=(O,P)=>{const V=O[1].x-O[0].x,M=O[1].y-O[0].y,L=P[1].x-P[0].x,Y=P[1].y-P[0].y;let U=Math.atan2(V*Y-M*L,V*L+M*Y);return U=R(U),Math.round(U)*-1},H=O=>{const P=a.map((V,M,L)=>{const Y=L[M-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let U=Math.ceil(V._length/O/n.settings.lineWidthStep)*n.settings.lineWidthStep;const G=s[M-1];U<(L.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(U=L.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),U>n.settings.maxLineWidth&&(U=n.settings.maxLineWidth);const q=F(V.vertices,Y.vertices);return G&&(G.value=`${q}°`),new Tn(U,q,`A-${M+1}`)});r("pointer:move",P)},Q=O=>{let P=null,V;const M=G=>{P=l.find(q=>{const W=q.renderer;return(W==null?void 0:W.elem)===G.target}),[V]=g(O,f.value,u.value.map(q=>q),m.value)},L=G=>{if(P){const q=P.renderer,W=q==null?void 0:q.elem;if(!W)return;const K=W.getBoundingClientRect();P.vertices[0].x-=K.x-(G instanceof MouseEvent?G.clientX:G.targetTouches[0].clientX)+qe.anchorPoint.size/2,P.vertices[0].y-=K.y-(G instanceof MouseEvent?G.clientY:G.targetTouches[0].clientY)+qe.anchorPoint.size/2,H(V),O.update()}},Y=()=>{P&&r("pointer:up",u.value),P=null},U=o.value;U&&(U.addEventListener("touchstart",M,{passive:!0}),U.addEventListener("touchend",Y,{passive:!0}),U.addEventListener("mousedown",M),U.addEventListener("mouseup",Y),U.addEventListener("mousemove",L),U.addEventListener("touchmove",L,{passive:!0}))},Z=(O,P)=>{r("remove-custom-template",O,P)};return i.onMounted(()=>{o.value&&(c=new vn({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{A()},{deep:!0,immediate:!0}),Q(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(O,P)=>(i.openBlock(),i.createElementBlock("div",z0,[i.createVNode(Qd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":P[0]||(P[0]=V=>r("template:select",V)),onInitDrawTemplate:E,onRemoveCustomTemplate:Z},null,8,["select-template-index","settings"]),i.createElementVNode("div",D0,[i.createElementVNode("div",L0,null,512)])]))}});class ar 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)=>D.isArray(o)?new Tn(o[0],o[1],`A-${s+1}`):new Tn(o.width,o.angle,`A-${s+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new Tn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class ha extends ar{constructor(n){super(n);T(this,"isDefault");this.isDefault=n.isDefault??!1}}class eu{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 ar(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(o=>new ha(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new ha(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 ar(s);return a.isCustom=!0,a.id=+o,a}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new ar({label:"-- Новая конфигурация --",points:[new Tn(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 ar(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 W0={class:"flex flex-col gap-3"},j0={class:"grid gap-5 md:grid-cols-5"},q0={},tu=i.defineComponent({...q0,__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 eu(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"),m=(v=0)=>{var E;const $=(E=c.value.allTemplates)==null?void 0:E.at(v);$!==void 0&&(h.value=v,l.value.configuratorParams.linesWidths=$.points.map(A=>D.isArray(A)?A[0]:A.width),l.value.configuratorParams.linesAngles=$.points.map(A=>D.isArray(A)?A[1]:A.angle),k()),b(l.value.configuratorParams)},p=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const $={label:v,points:l.value.configuratorParams.linesWidths.map((A,R)=>[A,l.value.configuratorParams.linesAngles[R]])},E=A=>{A&&(c.value.addCustomTemplate($),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:$,callback:E})},g=async(v,$)=>{var R;const E=(R=c.value.allTemplates)==null?void 0:R.at(v);if(!E||!E.isCustom)return;const A=F=>{F&&(c.value.removeCustomTemplate(E.id),m()),$==null||$()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:E.id,callback:A})},y=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},b=async v=>{var $,E;l.value.product=new j.ClientProduct,(E=($=f.value)==null?void 0:$.formReference)==null||E.validate(A=>{A||(k(),o.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:v,validationFieldResultData:u.value,callback:R=>{R?l.value.product=R:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},o.value=!1}}))}).catch(D.noop)},_=async()=>{var v,$;($=(v=f.value)==null?void 0:v.formReference)==null||$.validate(E=>{var A,R;if(!E){s.value=!0;const F=new j.OrderItemBase(l.value);(A=c.value.startTailConfigs)!=null&&A.length||delete F.configuratorParams.startTailType,(R=c.value.endTailConfigs)!=null&&R.length||delete F.configuratorParams.endTailType,r("submit",F,u.value,()=>{s.value=!1,i.nextTick(()=>{var H,Q;(Q=(H=f.value)==null?void 0:H.formReference)==null||Q.restoreValidation()})})}}).catch(D.noop)},k=()=>{const v={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach(($,E)=>{v[`lines_widths[${E+1}]`]={},v[`lines_angles[${E+1}]`]={}}),u.value=v},x=v=>{d.value.linesWidths=v.map($=>$.width),d.value.linesAngles=v.map($=>$.angle)},C=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,k(),y(),b(l.value.configuratorParams)},N=(v,$)=>{d.value.linesWidths=v,d.value.linesAngles=$},w=v=>{const $=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,E=0;l.value.configuratorParams.linesWidths.splice(v+1,0,$),l.value.configuratorParams.linesAngles.splice(v+1,0,E),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],k(),y(),b(l.value.configuratorParams)},S=v=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(v,1),l.value.configuratorParams.linesAngles.splice(v,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],k(),y(),b(l.value.configuratorParams))};return i.onMounted(()=>{n.cartItem.isNewRec()?m():(k(),h.value=-1,b(l.value.configuratorParams))}),i.watch(()=>n.cartItem,v=>{l.value=new j.OrderItemBase(v),v.isNewRec()?m():(k(),h.value=-1,b(l.value.configuratorParams))}),(v,$)=>{const E=z.NButton;return i.openBlock(),i.createElementBlock("div",W0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(E,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=A=>r("click:view-switch"))},{default:i.withCtx(()=>[...$[3]||($[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",j0,[i.createVNode(Jd,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":C,"onPointer:move":x,"onTemplate:select":m,onRemoveCustomTemplate:g},null,8,["value","select-template-index","settings"]),i.createVNode(Fl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":$[1]||($[1]=A=>l.value=A),"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":$[2]||($[2]=A=>b(A)),"onUpdate:preview":N,onSubmit:_,"onClick:saveTemplate":p,"onClick:addLine":w,"onClick:removeLine":S},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),X0={class:"flex flex-col items-center justify-between rounded-xl"},Y0={class:"img-preview relative flex justify-center"},U0={},K0=i.defineComponent({...U0,__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;return D.keys(n.settings.crossbarCount).reverse().find(a=>s>=n.settings.crossbarCount[Number(a)])}),o=e;return(s,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",X0,[i.createElementVNode("div",Y0,[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})])}}}),ma=An(K0,[["__scopeId","data-v-2a790a20"]]),G0={key:0,class:"flex items-baseline gap-1"},Z0={key:0,class:"flex items-baseline gap-1"},Q0={key:1},J0={class:"text-lg font-semibold"},eb={key:2,class:"text-red-500 text-sm mb-2"},tb={class:"flex gap-3"},nb={},nu=i.defineComponent({...nb,__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(D.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),m=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),p=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),g=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),y=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+f.value:0),b=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(m.value-h.value),ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-f.value),ae.max(p.value-f.value),ae.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),k=i.computed(()=>{var R;const S=g.value,v=y.value,{quantity:$}=r.value,E=((R=r.value.product)==null?void 0:R.costRub)||0;if(!S||!v||!$||E===0)return null;const A=S*v/1e6;return(E*$*A).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=i.computed(()=>{const S=g.value,v=y.value,$=!!(S&&S>=r.settings.minWidth&&S<=r.settings.maxWidths[u.value.configuratorParams.netType]),E=!!(v&&v>=r.settings.minHeight&&v<=r.settings.maxHeights[u.value.configuratorParams.netType]),A=!!(r.value.quantity&&r.value.quantity>0);return $&&E&&A}),C=(S,v)=>{var A,R;const $=u.value.configuratorParams;S&&S in $&&($[S]=v);const E={...$,width:g.value??0,height:y.value??0};S==="width"&&((A=l.value)==null||A.validate().catch(D.noop)),S==="height"&&((R=c.value)==null||R.validate().catch(D.noop)),i.nextTick(()=>{var H,Q;!((H=l.value)!=null&&H.validationErrored)&&!((Q=c.value)!=null&&Q.validationErrored)&&E.height&&E.width&&o("update:params",E),N("configuratorParams",E)})},N=(S,v)=>{const $=new j.OrderItemBase(r.value);$[S]=v,S==="configuratorParams"&&($.product=new j.ClientProduct),o("update:value",$)};return i.watch(()=>r.value,S=>{const v=D.cloneDeep(i.toRaw(S)),$=v.configuratorParams.mountType,E=r.settings.widthOverlaps[$]??0,A=r.settings.heightOverlaps[$]??0;v.configuratorParams.width&&v.configuratorParams.width>0&&(v.configuratorParams.width-=E),v.configuratorParams.height&&v.configuratorParams.height>0&&(v.configuratorParams.height-=A),u.value=v},{deep:!0,immediate:!0}),i.onMounted(()=>{var S;(S=d.value)==null||S.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(S,v)=>{const $=z.NCheckbox;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.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"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[v[0]||(v[0]=E=>u.value.configuratorParams.netType=E),v[1]||(v[1]=E=>C("netType",E))],options:t.settings.netType.map(E=>({label:t.settings.descriptions.net_type[E],value:E}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[v[2]||(v[2]=E=>u.value.configuratorParams.color=E),v[3]||(v[3]=E=>C("color",E))],options:t.settings.color.map(E=>({label:t.settings.descriptions.color[E],value:E}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[v[4]||(v[4]=E=>u.value.configuratorParams.mountType=E),v[5]||(v[5]=E=>C("mountType",E))],options:t.settings.mountType.map(E=>({label:t.settings.descriptions.mount_type[E],value:E}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${m.value?" до "+(m.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&g.value>=t.settings.minWidth&&g.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",G0,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(g.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[10]||(v[10]=E=>o("click:instructions-toggle"))},{default:i.withCtx(()=>[...v[25]||(v[25]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[v[6]||(v[6]=E=>u.value.configuratorParams.width=E),v[9]||(v[9]=E=>C("width",E))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[7]||(v[7]=E=>i.unref(st)(E)),onInput:v[8]||(v[8]=E=>i.unref(nt)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-f.value} ${p.value?" до "+(p.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&y.value>=t.settings.minHeight&&y.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Z0,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(y.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[15]||(v[15]=E=>o("click:instructions-toggle"))},{default:i.withCtx(()=>[...v[26]||(v[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[v[11]||(v[11]=E=>u.value.configuratorParams.height=E),v[14]||(v[14]=E=>C("height",E))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[12]||(v[12]=E=>i.unref(st)(E)),onInput:v[13]||(v[13]=E=>i.unref(nt)(t.validation,"height")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[16]||(v[16]=E=>u.value.quantity=E),v[19]||(v[19]=E=>N("quantity",E??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[17]||(v[17]=E=>i.unref(st)(E,!1)),onInput:v[18]||(v[18]=E=>i.unref(nt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[20]||(v[20]=E=>i.unref(nt)(t.validation,"marker")),"onUpdate:value":v[21]||(v[21]=E=>{u.value.marker=E??null,N("marker",E??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),b.value?(i.openBlock(),i.createBlock($,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":v[22]||(v[22]=E=>{u.value.isAdditionalSale=E??!1,N("isAdditionalSale",E??!1)})},{default:i.withCtx(()=>[...v[27]||(v[27]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(Cr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),k.value?(i.openBlock(),i.createElementBlock("div",Q0,[v[28]||(v[28]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",J0,i.toDisplayString(k.value)+" ₽",1)])):i.createCommentVNode("",!0),x.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",eb," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",tb,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:v[23]||(v[23]=E=>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(z.NButton),{key:0,type:"default",onClick:v[24]||(v[24]=E=>o("click:show-preview-drawer"))},{default:i.withCtx(()=>[...v[29]||(v[29]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])),[[i.unref(ei),()=>o("submit",u.value)]])}}}),ib="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",rb="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",ob="/img/configurators/mosquitto/measurement-instructions/mount.png",sb="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",ab="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",lb={class:"flex flex-col gap-6"},cb={class:"flex gap-4"},db={class:"flex flex-col gap-2"},ub={class:"flex gap-4"},fb={class:"flex flex-col gap-2"},hb={class:"flex gap-4"},mb={class:"flex flex-col gap-2"},pb={},iu=i.defineComponent({...pb,__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=z.NText;return i.openBlock(),i.createBlock(i.unref(z.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${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",lb,[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:ib,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:rb,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",cb,[l[9]||(l[9]=i.createElementVNode("img",{src:ob,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",db,[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",ub,[l[15]||(l[15]=i.createElementVNode("img",{src:sb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",fb,[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",hb,[l[21]||(l[21]=i.createElementVNode("img",{src:ab,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",mb,[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"])}}}),gb={class:"grid md:grid-cols-2"},yb={},ru=i.defineComponent({...yb,__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)),m=D.debounce(async g=>{var y,b;l.value.product=new j.ClientProduct,(b=(y=c.value)==null?void 0:y.formReference)==null||b.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:g,validationFieldResultData:d.value,callback:k=>{k?l.value.product=k:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(D.noop)},f.value),p=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,g=>{l.value=g},{deep:!0}),(g,y)=>{const b=Do;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(iu,{show:a.value,"onUpdate:show":y[0]||(y[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",gb,[o.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:s.value,"onUpdate:show":y[4]||(y[4]=_=>s.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:y[2]||(y[2]=_=>s.value=!1)},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})]),default:i.withCtx(()=>[i.createVNode(ma,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:y[3]||(y[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(ma,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:y[1]||(y[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(nu,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":y[5]||(y[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":y[6]||(y[6]=_=>i.unref(m)(_)),onSubmit:y[7]||(y[7]=_=>p()),"onClick:instructionsToggle":y[8]||(y[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":y[9]||(y[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),bb={},ou=i.defineComponent({...bb,__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},isLastLine:{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 m;return!((m=c.value)!=null&&m.validationErrored)}),u=m=>{l.value=m,o("update:value",m,r.index,a)},h=m=>{st(m),(m.key==="Enter"||m.code==="Enter")&&!r.isLastLine&&(m.preventDefault(),m.stopPropagation())},f=()=>{var m;(m=s.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=m}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{f()})}),e({isValid:d,formItemReference:c}),(m,p)=>{const g=Pl,y=io;return i.openBlock(),i.createBlock(i.unref(z.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(Cr,{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(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(lt),placeholder:"Введите ширину",onKeydown:h,onInput:p[0]||(p[0]=b=>i.unref(nt)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(Le),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:p[1]||(p[1]=b=>o("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:p[2]||(p[2]=b=>o("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),_b={class:"my-2 flex w-full flex-col"},wb={key:1},xb={class:"text-lg font-semibold"},kb={class:"flex gap-3"},vb={},su=i.defineComponent({...vb,__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(D.cloneDeep(r.value)),c=i.computed(()=>{const k={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return D.forEach(l.value,(x,C)=>{var N;k[`configuratorParams.linesWidths.${C}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((N=r.validation[`linesWidths.${C}`])==null?void 0:N.feedback)]}),k}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((k,x)=>(k??0)+(x??0),0)),h=i.computed(()=>r.settings.width-u.value),f=i.computed(()=>!r.value.some(({product:k})=>!k||k.isNewRec())),m=i.computed(()=>r.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(k=>k.product.isNewRec())),p=i.computed(()=>k=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+k}]),g=i.computed(()=>{const{length:k}=r.value[0];return!k||u.value!==r.settings.width?null:(D.reduce(r.value,(C,N)=>{var S;const w=((S=N.product)==null?void 0:S.costRub)||0;return C+w},0)*r.value[0].quantity*k).toLocaleString("ru-ru",{minimumFractionDigits:2})}),y=(k,x,C)=>{var w,S,v;l.value[x].product.id=-1;const{configuratorParams:N}=l.value[x];N.linesWidths[x]=k,b("configuratorParams",N),(v=(S=(w=a.value)==null?void 0:w.at(x))==null?void 0:S.formItemReference)==null||v.validate().catch(D.noop),i.nextTick(()=>{var $,E;(E=($=a.value)==null?void 0:$.at(x))!=null&&E.isValid&&o("update:params",N,x,C)})},b=(k,x)=>{l.value.forEach(C=>{C[k]=x}),o("update:value",l.value)};return i.watch(()=>r.value,k=>{l.value=D.cloneDeep(k)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(k,x)=>{const C=z.NCheckbox;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var N;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(w,S)=>{var v,$,E;return i.openBlock(),i.createBlock(ou,{key:S,ref_for:!0,ref:"line-items-reference",value:((v=w.configuratorParams)==null?void 0:v.linesWidths.at(S))??null,"auto-focus":((($=w.configuratorParams)==null?void 0:$.linesWidths.at(S))??0)===0,index:S,path:`configuratorParams.linesWidths.${S}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":p.value(((E=w.configuratorParams)==null?void 0:E.linesWidths.at(S))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(A=>A.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"is-last-line":S===l.value.length-1&&h.value===0,"onUpdate:value":y,"onClick:addLine":x[0]||(x[0]=A=>o("click:add-line",A)),"onClick:removeLine":x[1]||(x[1]=A=>o("click:remove-line",A))},null,8,["value","auto-focus","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled","is-last-line"])}),128)),i.createElementVNode("div",_b,[h.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...x[15]||(x[15]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[x[16]||(x[16]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.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(z.NButton),{disabled:m.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>o("click:add-line",l.value.length))},{default:i.withCtx(()=>[...x[17]||(x[17]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>l.value[0].length=w),x[6]||(x[6]=w=>b("length",w))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:x[4]||(x[4]=w=>i.unref(st)(w,!1)),onInput:x[5]||(x[5]=w=>i.unref(nt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>l.value[0].quantity=w),x[10]||(x[10]=w=>b("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[8]||(x[8]=w=>i.unref(st)(w,!1)),onInput:x[9]||(x[9]=w=>i.unref(nt)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>i.unref(nt)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{l.value[0].marker=w??null,b("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(C,{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,b("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[...x[18]||(x[18]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createElementBlock("div",wb,[x[19]||(x[19]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",xb,i.toDisplayString(g.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",kb,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!((N=l.value[0])!=null&&N.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"])),[[i.unref(ei),()=>o("submit",l.value)]])}}}),Cb={class:"flex grow flex-col"},Sb=["src"],Bb={class:"w-full"},Tb={},au=i.defineComponent({...Tb,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Cb,[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,Sb),i.createElementVNode("div",Bb,[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)])]))}}),Nb={class:"flex flex-col gap-2"},$b={class:"w-104 flex grow flex-col px-5"},Rb={},lu=i.defineComponent({...Rb,__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 p;return(p=s.value[0].configuratorParams)==null?void 0:p.linesWidths.reduce((g,y)=>(g??0)+(y??0),0)}),u=p=>{p===void 0&&(p=s.value.length-1);const g=s.value.at(0);if(!g)return;g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(p+1,0,null),s.value.forEach(b=>{b.configuratorParams.linesWidths=g.configuratorParams.linesWidths});const y=new j.OrderItemBase({quantity:(g==null?void 0:g.quantity)??1,category:g==null?void 0:g.category,length:(g==null?void 0:g.length)??n.settings.minLength,marker:g==null?void 0:g.marker,configuratorParams:{linesWidths:g==null?void 0:g.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,y)},h=p=>{const g=s.value.at(0);g&&(g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(y=>{y.configuratorParams.linesWidths=g.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete a[`linesWidths.${p}`],delete a[`linesWidths.${p}`])},f=D.debounce(async(p,g,y)=>{const b={linesWidths:p.linesWidths.at(g)};y.value=!0,a.value[`linesWidths.${g}`]={},s.value[g].product=new j.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:s.value[g].category,params:b,validationFieldResultData:a.value,callback:_=>{_?(s.value[g].product=_,g===s.value.length-1&&s.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(s.value[g].product=new j.ClientProduct,a.value[`linesWidths.${g}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},y.value=!1),y.value=!1}})},c.value),m=async()=>{var p,g;(g=(p=o.value)==null?void 0:p.formReference)==null||g.validate(y=>{if(!y){l.value=!0;const b=s.value.at(0);if(!b)return;r("submit",b,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,k;(k=(_=o.value)==null?void 0:_.formReference)==null||k.restoreValidation()})})}}).catch(D.noop)};return i.watch(()=>n.cartItems,p=>{s.value=p.map(g=>new j.OrderItemBase(g))}),(p,g)=>{const y=z.NButton;return i.openBlock(),i.createElementBlock("div",Nb,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(y,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=b=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[3]||(g[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",$b,[i.createVNode(au,{value:s.value,"onUpdate:value":g[1]||(g[1]=b=>s.value=b),settings:t.settings},null,8,["value","settings"]),i.createVNode(su,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":g[2]||(g[2]=b=>s.value=b),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(f),onSubmit:m,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Eb={class:"flex flex-col gap-3"},Pb={},cu=i.defineComponent({...Pb,__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 m;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(D.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),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.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=(p,g)=>{const y=new j.OrderItemBase(r.value);y[p]=g,p==="configuratorParams"&&(y.product=new j.ClientProduct),o("update:value",y)},f=()=>{var p;(p=a.value)==null||p.select()};return i.watch(()=>r.value,p=>{l.value=D.cloneDeep(p)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{f()})}),e({validate:(m=s.value)==null?void 0:m.validate,formReference:s}),(p,g)=>{const y=z.NCheckbox;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[g[0]||(g[0]=b=>l.value.configuratorParams.width=b),u],class:"w-full",parse:i.unref(lt),"show-button":!1,placeholder:"Введите ширину",onKeydown:g[1]||(g[1]=b=>i.unref(st)(b)),onInput:g[2]||(g[2]=b=>i.unref(nt)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[g[3]||(g[3]=b=>l.value.configuratorParams.length=b),u],placeholder:"Введите длину",parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:g[4]||(g[4]=b=>i.unref(st)(b)),onInput:g[5]||(g[5]=b=>i.unref(nt)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:g[6]||(g[6]=b=>i.unref(st)(b,!1)),onInput:g[7]||(g[7]=b=>i.unref(nt)(t.validation,"quantity")),"onUpdate:value":g[8]||(g[8]=b=>h("quantity",b??0)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:g[9]||(g[9]=b=>i.unref(nt)(t.validation,"marker")),"onUpdate:value":g[10]||(g[10]=b=>h("marker",b??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(y,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":g[11]||(g[11]=b=>{l.value.isAdditionalSale=b??!1,h("isAdditionalSale",b??!1)})},{default:i.withCtx(()=>[...g[13]||(g[13]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(Cr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Eb,[i.createVNode(i.unref(z.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:g[12]||(g[12]=b=>o("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])),[[i.unref(ei),()=>o("submit",l.value)]])}}}),Fb={class:"flex flex-col gap-2 w-72"},Vb={},du=i.defineComponent({...Vb,__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=D.debounce(async f=>{var m,p;s.value.product=new j.ClientProduct,(p=(m=o.value)==null?void 0:m.formReference)==null||p.validate(g=>{g||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:y=>{y?s.value.product=y:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(D.noop)},d.value),h=async()=>{var f,m;(m=(f=o.value)==null?void 0:f.formReference)==null||m.validate(p=>{p||(c.value=!0,r("submit",s.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var g,y;(y=(g=o.value)==null?void 0:g.formReference)==null||y.restoreValidation()})}))}).catch(D.noop)};return i.watch(()=>n.cartItem,f=>{s.value=new j.OrderItemBase(f)},{deep:!0}),(f,m)=>{const p=z.NButton;return i.openBlock(),i.createElementBlock("div",Fb,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=g=>r("click:view-switch"))},{default:i.withCtx(()=>[...m[4]||(m[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(cu,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":m[1]||(m[1]=g=>s.value=g),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":m[2]||(m[2]=g=>i.unref(u)(g)),onSubmit:m[3]||(m[3]=g=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Mb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ab(t,e){return i.openBlock(),i.createElementBlock("svg",Mb,[...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 uu=i.markRaw({name:"ion-add",render:Ab}),Ib={key:0,class:"-mt-1 text-sm text-gray-500"},Ob={class:"font-bold"},zb={class:"flex flex-col gap-3"},Db={key:0,class:"mt-4 flex flex-col gap-1.5"},Lb={class:"flex flex-col gap-1 text-sm text-gray-700"},Hb={key:0},Wb={key:1},jb={"form-array-name":"items",class:"flex flex-col gap-3"},qb={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},Xb={key:0,class:"flex flex-wrap items-end gap-2"},Yb={class:"whitespace-nowrap text-xl font-bold"},Ub={key:0,class:"whitespace-nowrap text-lg text-gray-500"},Kb={class:"font-bold"},Gb={class:"font-bold"},Zb={class:"flex gap-3"},Qb={},fu=i.defineComponent({...Qb,__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 P;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.ref(D.cloneDeep(r.value)),l=i.ref({...r.validation}),c=V=>{var M;delete l.value[V],(M=s.value)==null||M.restoreValidation()};i.watch(()=>r.validation,V=>{l.value={...V},Object.values(V).some(L=>L==null?void 0:L.feedback)&&i.nextTick(()=>{var L;return(L=s.value)==null?void 0:L.validate(D.noop).catch(D.noop)})},{deep:!0});const d=i.computed(()=>r.value.category),u=i.ref(null),h=i.ref(null),f=i.computed(()=>d.value.products??[]),m=i.computed(()=>f.value.map(V=>({label:V.name,value:V.id}))),p=(V,M,L)=>{const Y=V!=null&&V>0,U=M!=null&&M>0;return!Y&&!U?null:Y&&U?`от ${V} ${L} до ${M} ${L}`:Y?`от ${V} ${L}`:`до ${M} ${L}`},g=i.computed(()=>{var V,M;return p(r.settings.minWidth,(M=(V=u.value)==null?void 0:V.properties)==null?void 0:M.width,"мм")}),y=i.computed(()=>{var V,M;return p(r.settings.minLength,(M=(V=u.value)==null?void 0:V.properties)==null?void 0:M.length,"мм")}),b=i.ref(null),_=i.ref(!1),k=i.computed(()=>{var M;const V={marker:[We.serverValidation((M=l.value.marker)==null?void 0:M.feedback)]};return a.value.configuratorParams.items.forEach((L,Y)=>{var U,G,q,W,K,ue,ye;V[`configuratorParams.items.${Y}.width`]=[ae.required,ae.min(r.settings.minWidth),...(G=(U=u.value)==null?void 0:U.properties)!=null&&G.width?[ae.max(u.value.properties.width)]:[],ae.step(1),We.serverValidation((q=l.value[`items.${Y}.width`])==null?void 0:q.feedback)],V[`configuratorParams.items.${Y}.length`]=[ae.required,ae.min(r.settings.minLength),...(K=(W=u.value)==null?void 0:W.properties)!=null&&K.length?[ae.max(u.value.properties.length)]:[],ae.step(1),We.serverValidation((ue=l.value[`items.${Y}.length`])==null?void 0:ue.feedback)],V[`configuratorParams.items.${Y}.count`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((ye=l.value[`items.${Y}.count`])==null?void 0:ye.feedback)]}),V}),x=i.ref(r.settings.canSetDopProdaga??!1),C=i.computed(()=>a.value.configuratorParams.items.some(V=>{var M,L;return!u.value||!V.width||V.width<r.settings.minWidth||V.width>(((M=u.value.properties)==null?void 0:M.width)??0)||V.length===0||V.length<r.settings.minLength||V.length>(((L=u.value.properties)==null?void 0:L.length)??0)||!V.count||V.count<1})),N=i.computed(()=>!u.value||C.value||a.value.configuratorParams.items.length===0),w=i.ref(null),S=V=>{if(!V){u.value=null,h.value=null,a.value.product=new j.ClientProduct,b.value=null;return}const M=f.value.find(L=>L.id===V);M&&(u.value=M,h.value=V,a.value.product=M,Z("product",a.value.product),a.value.configuratorParams.items.forEach(L=>{var Y,U;(Y=M.properties)!=null&&Y.width&&L.width>M.properties.width&&(L.width=M.properties.width),(U=M.properties)!=null&&U.length&&L.length>M.properties.length&&(L.length=M.properties.length)}),$())};let v=!1;const $=()=>{v=!0,b.value=null,w.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},E=async()=>{var V;if(!u.value||a.value.configuratorParams.items.length===0||C.value){$();return}(V=s.value)==null||V.validate(M=>{if(M){$();return}if(_.value=!0,!u.value||!d.value){$(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:a.value.configuratorParams.items},callback:L=>{L?(b.value=L,a.value.configuratorParams.calculationId=L.id,a.value.quantity=L.quantity,i.nextTick(()=>{Z("quantity",L.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,$()),Z("configuratorParams",a.value.configuratorParams),A(),_.value=!1}})}).catch(()=>{$(),_.value=!1})},A=()=>{var M;if(!((M=u.value)!=null&&M.costRub)||!b.value){w.value=null;return}const V=b.value.quantity*u.value.costRub;w.value=Math.round(V*100)/100},R=V=>{var L,Y;const M=a.value.configuratorParams.items[V];u.value&&((L=u.value.properties)!=null&&L.width&&M.width>u.value.properties.width&&(M.width=u.value.properties.width),(Y=u.value.properties)!=null&&Y.length&&M.length>u.value.properties.length&&(M.length=u.value.properties.length)),Z("configuratorParams",a.value.configuratorParams),$()},F=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),Z("configuratorParams",a.value.configuratorParams),$(),o("add-item",a.value.configuratorParams.items.length)},H=V=>{a.value.configuratorParams.items.splice(V,1),Z("configuratorParams",a.value.configuratorParams),$(),o("remove-item",V)},Q=()=>{if(!(N.value||_.value||r.isSubmitProcessing)){if(!b.value){E();return}o("submit",a.value)}},Z=(V,M)=>{const L=new j.OrderItemBase(r.value);L[V]=M,o("update:value",L)};i.watch(()=>r.value,V=>{const M=D.cloneDeep(i.toRaw(V));(!M.configuratorParams.items||M.configuratorParams.items.length===0)&&(M.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=M,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),v?v=!1:O()},{deep:!0});const O=()=>{const{calculationId:V}=a.value.configuratorParams,M=a.value.quantity??0;V&&M>0&&a.value.product&&!a.value.product.isNewRec()&&(b.value={id:V,quantity:M,sheets:[]},A())};return i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),O()}),e({validate:(P=s.value)==null?void 0:P.validate,formReference:s}),(V,M)=>{const L=io,Y=uu;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:a.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var U;return[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value,"onUpdate:value":[M[0]||(M[0]=G=>h.value=G),S],options:m.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((U=u.value)==null?void 0:U.costRub)!=null?(i.openBlock(),i.createElementBlock("div",Ib,[i.createElementVNode("span",Ob,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",zb,[u.value?(i.openBlock(),i.createElementBlock("div",Db,[M[7]||(M[7]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",Lb,[g.value?(i.openBlock(),i.createElementBlock("div",Hb,"Ширина "+i.toDisplayString(g.value)+".",1)):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createElementBlock("div",Wb,"Длина "+i.toDisplayString(y.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",jb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(G,q)=>(i.openBlock(),i.createElementBlock("div",{key:q,class:"flex grow gap-2"},[i.createElementVNode("div",qb,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${q}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[q].width,"onUpdate:value":[W=>a.value.configuratorParams.items[q].width=W,W=>R(q)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:M[1]||(M[1]=W=>i.unref(st)(W)),onInput:W=>c(`items.${q}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${q}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[q].length,"onUpdate:value":[W=>a.value.configuratorParams.items[q].length=W,W=>R(q)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:M[2]||(M[2]=W=>i.unref(st)(W)),onInput:W=>c(`items.${q}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${q}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[q].count,"onUpdate:value":[W=>a.value.configuratorParams.items[q].count=W,W=>R(q)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:M[3]||(M[3]=W=>i.unref(st)(W,!1)),onInput:W=>c(`items.${q}.count`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:W=>H(q)},{default:i.withCtx(()=>[i.createVNode(L)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:C.value,type:"default",class:"self-center",onClick:F},{default:i.withCtx(()=>[i.createVNode(Y),M[8]||(M[8]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:M[4]||(M[4]=G=>c("marker")),"onUpdate:value":M[5]||(M[5]=G=>Z("marker",G??null)),onFocus:i.unref(Le)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(i.openBlock(),i.createBlock(i.unref(z.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":M[6]||(M[6]=G=>{a.value.isAdditionalSale=G??!1,Z("isAdditionalSale",G??!1)})},{default:i.withCtx(()=>[...M[9]||(M[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NSpin),{show:_.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var G;return[b.value&&u.value&&w.value?(i.openBlock(),i.createElementBlock("div",Xb,[i.createElementVNode("div",null,[M[10]||(M[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",Yb,i.toDisplayString(w.value.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol),1)]),b.value.quantity&&u.value?(i.openBlock(),i.createElementBlock("div",Ub,[i.createElementVNode("span",Kb,"("+i.toDisplayString(b.value.quantity)+" шт.",1),M[11]||(M[11]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",Gb,i.toDisplayString((G=u.value.costRub)==null?void 0:G.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",Zb,[b.value&&!_.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,loading:t.isSubmitProcessing,disabled:N.value||_.value,type:"primary",class:"self-start",onClick:Q},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,loading:_.value,disabled:N.value||_.value,type:"info",class:"self-start",onClick:E},{default:i.withCtx(()=>[...M[12]||(M[12]=[i.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])),[[i.unref(ei),Q]])}}}),Jb={class:"flex flex-col gap-2"},e1={class:"w-104 flex grow flex-col px-5"},t1={},hu=i.defineComponent({...t1,__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(m=>{if(!m){l.value=!0;const p=D.cloneDeep(s.value);"items"in p.configuratorParams&&delete p.configuratorParams.items,r("submit",p,a.value,()=>{l.value=!1,i.nextTick(()=>{var g,y;(y=(g=o.value)==null?void 0:g.formReference)==null||y.restoreValidation()})})}}).catch(D.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 m=z.NButton;return i.openBlock(),i.createElementBlock("div",Jb,[t.settings.allowShowTable&&s.value.isNewRec()?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[2]||(f[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",e1,[i.createVNode(fu,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":f[1]||(f[1]=p=>s.value=p),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"])])])}}}),n1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i1(t,e){return i.openBlock(),i.createElementBlock("svg",n1,[...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 r1=i.markRaw({name:"ion-checkmark",render:i1}),o1={key:0,class:"-mt-1 text-sm text-gray-500"},s1={class:"font-bold"},a1={class:"flex flex-col gap-3"},l1={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},c1={class:"flex flex-col gap-1 text-sm text-gray-700"},d1={key:0},u1={key:1},f1={"form-array-name":"items",class:"flex flex-col gap-3"},h1={class:"min-w-0 flex-1"},m1={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},p1={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},g1={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},y1={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},b1={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},_1={key:0,class:"lg:!flex-[2]"},w1={class:"font-bold"},x1={key:1,class:"lg:!flex-[3]"},k1={class:"font-bold"},v1={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"},C1={key:0},S1={class:"font-bold"},B1={key:1},T1={class:"font-bold"},N1={class:"flex flex-wrap items-center gap-3"},$1={},mu=i.defineComponent({...$1,__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 G;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("widthInputs"),l=r.value==null?[]:D.cloneDeep(i.toRaw(r.value)),c=i.ref(l.map(q=>new j.OrderItemBase(q))),d=i.computed(()=>({items:c.value})),u=i.ref({...r.validation}),h=q=>{var W;delete u.value[q],(W=s.value)==null||W.restoreValidation()},f=i.ref(null),m=i.ref(null),p=i.computed(()=>{var q,W;return((W=(q=c.value[0])==null?void 0:q.category)==null?void 0:W.products)??[]}),g=i.computed(()=>p.value.map(q=>({label:q.name,value:q.id}))),y=(q,W,K)=>{const ue=q!=null&&q>0,ye=W!=null&&W>0;return!ue&&!ye?null:ue&&ye?`от ${q} ${K} до ${W} ${K}`:ue?`от ${q} ${K}`:`до ${W} ${K}`},b=i.computed(()=>{var q,W;return y(r.settings.minWidth,(W=(q=f.value)==null?void 0:q.properties)==null?void 0:W.width,"мм")}),_=i.computed(()=>{var q,W;return y(r.settings.minLength,(W=(q=f.value)==null?void 0:q.properties)==null?void 0:W.length,"мм")}),k=i.computed(()=>{const q={};return c.value.forEach((W,K)=>{var ue,ye,ve,ot,_e,we,wt,$e;q[`items.${K}.configuratorParams.width`]=[ae.required,ae.min(r.settings.minWidth),...(ye=(ue=f.value)==null?void 0:ue.properties)!=null&&ye.width?[ae.max(f.value.properties.width)]:[],ae.step(1),We.serverValidation((ve=u.value[`items.${K}.width`])==null?void 0:ve.feedback)],q[`items.${K}.configuratorParams.length`]=[ae.required,ae.min(r.settings.minLength),...(_e=(ot=f.value)==null?void 0:ot.properties)!=null&&_e.length?[ae.max(f.value.properties.length)]:[],ae.step(1),We.serverValidation((we=u.value[`items.${K}.length`])==null?void 0:we.feedback)],q[`items.${K}.quantity`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((wt=u.value[`items.${K}.quantity`])==null?void 0:wt.feedback)],q[`items.${K}.marker`]=[We.serverValidation(($e=u.value[`items.${K}.marker`])==null?void 0:$e.feedback)]}),q});i.watch(()=>r.validation,q=>{u.value={...q},Object.values(q).some(K=>K==null?void 0:K.feedback)&&i.nextTick(()=>{var K;return(K=s.value)==null?void 0:K.validate(D.noop).catch(D.noop)})},{deep:!0});const x=i.ref(r.settings.canSetDopProdaga??!1),C=i.computed(()=>{const q=f.value;return q?c.value.some(W=>{var ve,ot;const K=W.configuratorParams,ue=(ve=q.properties)==null?void 0:ve.width,ye=(ot=q.properties)==null?void 0:ot.length;return K.width===0||K.width<r.settings.minWidth||ue!=null&&K.width>ue||K.length===0||K.length<r.settings.minLength||ye!=null&&K.length>ye||W.quantity===0||W.quantity<1}):!0}),N=i.computed(()=>!f.value||C.value||c.value.length===0),w=i.computed(()=>{const q=c.value[0];return q!=null&&!q.isNewRec()}),S=q=>r.itemStates[q]??"idle",v=q=>S(q)==="success",$=q=>S(q)==="loading",E=i.computed(()=>c.value.length===0?!0:c.value.every((q,W)=>{const K=S(W);return K==="success"||K==="loading"})),A=q=>q.width===0||q.length===0?0:q.width*q.length/1e6,R=q=>A(q).toLocaleString(void 0,{maximumFractionDigits:4}),F=q=>{var ve;const W=q.configuratorParams,K=A(W),ue=((ve=f.value)==null?void 0:ve.costRub)??0,ye=q.quantity??0;return!K||!ye?0:Math.round(K*ue*ye*100)/100},H=i.computed(()=>D.sum(c.value.map(q=>{const W=q.configuratorParams;return!W.width||W.length===0||!q.quantity?0:W.width*W.length*q.quantity/1e6}))),Q=i.computed(()=>Math.round(D.sum(c.value.map(q=>F(q)))*100)/100),Z=()=>{var q,W,K;return new j.OrderItemBase({category:(q=c.value[0])==null?void 0:q.category,configurator:(W=c.value[0])==null?void 0:W.configurator,product:f.value??new j.ClientProduct,quantity:1,isAdditionalSale:(K=c.value[0])==null?void 0:K.isAdditionalSale,configuratorParams:{width:0,length:0}})},O=q=>{if(!q){f.value=null,m.value=null,c.value.forEach(K=>{K.product=new j.ClientProduct}),o("update:value",c.value);return}const W=p.value.find(K=>K.id===q);W&&(f.value=W,m.value=q,c.value.forEach((K,ue)=>{var ye,ve;K.product=W,(ye=W.properties)!=null&&ye.width&&K.configuratorParams.width>W.properties.width&&(K.configuratorParams.width=W.properties.width),(ve=W.properties)!=null&&ve.length&&K.configuratorParams.length>W.properties.length&&(K.configuratorParams.length=W.properties.length),o("item-reset",ue)}),o("update:value",c.value))},P=q=>{var ue,ye;const W=c.value[q],K=f.value;K&&((ue=K.properties)!=null&&ue.width&&W.configuratorParams.width>K.properties.width&&(W.configuratorParams.width=K.properties.width),(ye=K.properties)!=null&&ye.length&&W.configuratorParams.length>K.properties.length&&(W.configuratorParams.length=K.properties.length)),o("item-reset",q),o("update:value",c.value)},V=(q,W)=>{c.value[q].marker=W===null||W===""?void 0:W,o("item-reset",q),o("update:value",c.value)},M=q=>{c.value.forEach(W=>{W.isAdditionalSale=q}),o("update:value",c.value)},L=()=>{c.value.push(Z()),o("update:value",c.value),o("add-item",c.value.length),i.nextTick(()=>{var W,K,ue,ye;const q=c.value.length-1;(K=(W=a.value)==null?void 0:W[q])==null||K.focus(),(ye=(ue=a.value)==null?void 0:ue[q])==null||ye.select()})},Y=q=>{c.value.splice(q,1),o("update:value",c.value),o("remove-item",q)};i.watch(()=>r.value,q=>{var ye;const K=(q==null?[]:D.cloneDeep(i.toRaw(q))).map(ve=>new j.OrderItemBase(ve));c.value=K.length>0?K:[Z()];const ue=(ye=c.value[0])==null?void 0:ye.product;ue&&!ue.isNewRec()?(f.value=ue,m.value=ue.id):(f.value=null,m.value=null)},{deep:!0});const U=()=>{var W;if(f.value!==null)return;const q=(W=p.value[0])==null?void 0:W.id;q!=null&&O(q)};return i.watch(p,()=>{U()}),i.onMounted(()=>{var W;c.value.length===0&&(c.value=[Z()]);const q=(W=c.value[0])==null?void 0:W.product;q&&!q.isNewRec()&&(f.value=q,m.value=q.id),U()}),e({validate:(G=s.value)==null?void 0:G.validate,formReference:s}),(q,W)=>{const K=r1,ue=io,ye=uu;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:d.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var ve,ot;return[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:m.value,"onUpdate:value":[W[0]||(W[0]=_e=>m.value=_e),O],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=f.value)==null?void 0:ve.costRub)!=null?(i.openBlock(),i.createElementBlock("div",o1,[i.createElementVNode("span",s1,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",a1,[f.value?(i.openBlock(),i.createElementBlock("div",l1,[W[6]||(W[6]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",c1,[b.value?(i.openBlock(),i.createElementBlock("div",d1,"Ширина "+i.toDisplayString(b.value)+".",1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("div",u1,"Длина "+i.toDisplayString(_.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",f1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value.items,(_e,we)=>{var wt;return i.openBlock(),i.createElementBlock("div",{key:we,class:i.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",v(we)?"opacity-70":""])},[i.createElementVNode("div",h1,[i.createElementVNode("div",m1,[i.createElementVNode("div",p1,[i.createVNode(i.unref(z.NFormItem),{path:`items.${we}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[we].configuratorParams.width,"onUpdate:value":[$e=>d.value.items[we].configuratorParams.width=$e,$e=>P(we)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Ширина",class:"w-full",onKeydown:W[1]||(W[1]=$e=>i.unref(st)($e)),onInput:$e=>h(`items.${we}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`items.${we}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:d.value.items[we].configuratorParams.length,"onUpdate:value":[$e=>d.value.items[we].configuratorParams.length=$e,$e=>P(we)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Длина",class:"w-full",onKeydown:W[2]||(W[2]=$e=>i.unref(st)($e)),onInput:$e=>h(`items.${we}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createElementVNode("div",g1,[i.createVNode(i.unref(z.NFormItem),{path:`items.${we}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:d.value.items[we].quantity,"onUpdate:value":[$e=>d.value.items[we].quantity=$e,$e=>P(we)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Кол-во",class:"w-full",onKeydown:W[3]||(W[3]=$e=>i.unref(st)($e,!1)),onInput:$e=>h(`items.${we}.quantity`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`items.${we}.marker`,label:"Маркировка",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:d.value.items[we].marker??null,disabled:!f.value||v(we)||$(we),placeholder:"Маркировка",class:"w-full",onInput:$e=>h(`items.${we}.marker`),"onUpdate:value":$e=>V(we,$e??null),onFocus:i.unref(Le)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),$(we)||v(we)?(i.openBlock(),i.createElementBlock("div",y1,[$(we)?(i.openBlock(),i.createBlock(i.unref(z.NSpin),{key:0,size:14})):v(we)?(i.openBlock(),i.createBlock(K,{key:1,class:"text-green-600 text-xl"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",b1,[_e.configuratorParams.width>0&&_e.configuratorParams.length>0?(i.openBlock(),i.createElementBlock("div",_1,[W[7]||(W[7]=i.createTextVNode(" Площадь (S) = ",-1)),i.createElementVNode("span",w1,i.toDisplayString(R(_e.configuratorParams))+" м²",1)])):i.createCommentVNode("",!0),F(_e)>0?(i.openBlock(),i.createElementBlock("div",x1,[W[8]||(W[8]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",k1,i.toDisplayString(F(_e).toLocaleString())+" "+i.toDisplayString((wt=f.value)==null?void 0:wt.currency.symbol),1)])):i.createCommentVNode("",!0)])]),w.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,disabled:$(we)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:$e=>Y(we)},{default:i.withCtx(()=>[i.createVNode(ue)]),_:1},8,["disabled","onClick"]))],2)}),128))]),f.value?(i.openBlock(),i.createElementBlock("div",v1,[H.value>0?(i.openBlock(),i.createElementBlock("div",C1,[W[9]||(W[9]=i.createTextVNode(" Общая площадь: ",-1)),i.createElementVNode("span",S1,i.toDisplayString(H.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),Q.value>0?(i.openBlock(),i.createElementBlock("div",B1,[W[10]||(W[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",T1,i.toDisplayString(Q.value.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),x.value?(i.openBlock(),i.createBlock(i.unref(z.NCheckbox),{key:1,checked:((ot=c.value[0])==null?void 0:ot.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":W[4]||(W[4]=_e=>M(_e??!1))},{default:i.withCtx(()=>[...W[11]||(W[11]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createElementVNode("div",N1,[f.value&&!w.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,disabled:C.value,type:"default",onClick:L},{default:i.withCtx(()=>[i.createVNode(ye),W[12]||(W[12]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:N.value||E.value,type:"primary",class:"ml-auto",onClick:W[5]||(W[5]=_e=>o("submit",c.value))},{default:i.withCtx(()=>{var _e;return[i.createTextVNode(i.toDisplayString((_e=c.value[0])!=null&&_e.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[i.unref(ei),()=>o("submit",c.value)]])}}}),R1={class:"flex flex-col gap-2"},E1={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},P1={},pu=i.defineComponent({...P1,__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(k=>new j.OrderItemBase(k))),a=i.ref([]),l=i.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=k=>{c.forEach(x=>{l.value[`items.${k}.${x}`]={}})},u=k=>{c.forEach(x=>{delete l.value[`items.${k}.${x}`]})},h=i.computed(()=>a.value.includes("loading")),f=()=>({width:{},length:{},quantity:{},marker:{}}),m=(k,x)=>{let C=!1;return c.forEach(N=>{var A,R;const w=`items.0.${N}`,S=(A=k[N])==null?void 0:A.feedback,$=((R=k[w])==null?void 0:R.feedback)??S,E=`items.${x}.${N}`;$?(l.value[E]=k[w]??k[N],C=!0):l.value[E]={}}),C},p=(k,x,C)=>new Promise(N=>{const w=f();let S=!1;const v=$=>{if(S)return;S=!0;const E=m(w,x),A=($===void 0?!E:$)&&!E;a.value[x]=A?"success":"error",i.nextTick(()=>{var R,F;(F=(R=o.value)==null?void 0:R.formReference)==null||F.restoreValidation()}),N(A)};a.value[x]="loading",r("submit",[D.cloneDeep(k)],w,v,{isFinalSuccessfulCompletion:C})}),g=async()=>{var C,N;try{await((N=(C=o.value)==null?void 0:C.formReference)==null?void 0:N.validate())}catch{return}const k=s.value.map((w,S)=>S).filter(w=>{const S=a.value[w]??"idle";return S!=="success"&&S!=="loading"});let x=!0;for(let w=0;w<k.length;w+=1){const S=k[w],v=s.value[S];if(!v)break;const E=w===k.length-1&&x;await p(v,S,E)||(x=!1)}},y=k=>{const x=k-1;a.value[x]="idle",d(x)},b=k=>{a.value.splice(k,1),u(k);for(let x=k;x<s.value.length;x+=1)d(x)},_=k=>{const x=a.value[k];(x==="success"||x==="error")&&(a.value[k]="idle")};return i.onMounted(()=>{(n.cartItems??[]).forEach((k,x)=>{a.value[x]="idle",d(x)})}),i.watch(()=>n.cartItems,k=>{const x=(k??[]).map(C=>new j.OrderItemBase(C));s.value=x,a.value=x.map(()=>"idle"),x.forEach((C,N)=>{d(N)})},{deep:!0}),(k,x)=>{var N;const C=z.NButton;return i.openBlock(),i.createElementBlock("div",R1,[t.settings.allowShowTable&&((N=s.value[0])!=null&&N.isNewRec())?(i.openBlock(),i.createBlock(C,{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",E1,[i.createVNode(mu,{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:g,onAddItem:y,onRemoveItem:b,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),F1={key:0,class:"flex justify-center p-4"},V1={key:1,class:"p-4 text-center text-red-500"},M1={key:2,class:"flex justify-center"},A1={class:"!bg-white p-4 m-2 rounded-md w-max"},I1={key:3,class:"p-4 text-center text-gray-500"},O1={},gu=i.defineComponent({...O1,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},cartItems:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),o=i.ref(e.cartItem??null),s=i.ref(e.cartItems??null),a=f=>{const m=f.configuratorParams;return[new j.OrderItemBase({...f,quantity:f.quantity??1,marker:f.marker,configuratorParams:{width:(m==null?void 0:m.width)??f.width??0,length:(m==null?void 0:m.length)??f.length??0}})]},l=i.ref(e.editor===j.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var m,p,g;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:((m=e.cartItem)==null?void 0:m.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const y=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{length:y.stripMinLength,linesAngles:[],linesWidths:[],startTailType:D.some(y.startTailConfigs,b=>b.isDefault)?(p=y.startTailConfigs)==null?void 0:p.findIndex(b=>b.isDefault):void 0,endTailType:D.some(y.endTailConfigs,b=>b.isDefault)?(g=y.endTailConfigs)==null?void 0:g.findIndex(b=>b.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const y=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{width:0,height:0,netType:y.netType[0]||"",color:y.color[0]||"",mountType:y.mountType[0]||""}});break}case"strip":{const y=e.settings;s.value=[new j.OrderItemBase({...f,length:y.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const y=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{width:y.minWidth,length:y.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,m,p)=>{const g=y=>{p==null||p(),y&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:g,validation:m})},u=(f,m,p,g)=>{const y=f[0];if(!y){p==null||p();return}const b=(g==null?void 0:g.isFinalSuccessfulCompletion)===!0,_=k=>{p==null||p(k),b&&k&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:y,callback:_,validation:m,additionalParams:g})},h=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{!e.cartItem&&!e.cartItems&&c()}),(f,m)=>{const p=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",F1,[i.createVNode(p,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",V1,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",M1,[i.createElementVNode("div",A1,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(tu,{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(ru,{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(lu,{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(du,{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(hu,{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(pu,{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",I1,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function yu(t){return Object.values(j.ConfiguratorsEnum).includes(t)}function bu(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==j.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&D.isArray(t.products)&&t.products.length>0}const z1={key:0,class:"pt-0.5"},D1={key:0},L1={class:"line-through"},H1={key:0},W1={key:1},j1={class:"flex flex-row gap-1"},q1={key:0},X1={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Y1={class:"flex flex-col gap-2.5 sm:flex-row"},U1={class:"mt-2"},K1={key:1,class:"flex flex-col"},G1={},Z1=i.defineComponent({...G1,__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(xr,"medium"),r=i.computed(()=>{var U;return(U=e==null?void 0:e.filteredItems)==null?void 0:U[e.categoryItem.id]}),o=i.computed(()=>{var U,G;return D.isArray((U=e.categoryItem)==null?void 0:U.categories)&&((G=e.categoryItem.categories)==null?void 0:G.length)>0}),s=i.computed(()=>{var U;return D.isArray((U=e.categoryItem)==null?void 0:U.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([U,G])=>`${G} руб./${E(U)}`).join(", ")),l=i.computed(()=>D.isUndefined(e.filteredItems)||r.value==="*"?s.value:s.value.filter(U=>{var q;const G=(q=r.value)==null?void 0:q.products;return D.isArray(G)&&G.includes(U.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>D.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>D.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>D.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),f=i.computed(()=>D.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),m=i.computed(()=>{var U,G,q;return((U=e.categoryItem.properties)==null?void 0:U.configurator)!==void 0&&yu((G=e.categoryItem.properties)==null?void 0:G.configurator)&&bu(e.categoryItem)&&((q=e.categoryItem.properties)==null?void 0:q.configuratorSettings)!==void 0&&(D.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),p=i.computed(()=>m.value&&(D.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),g=i.computed(()=>D.isNil(e.categoryContextButtonsConfig)?[]:D.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),y=i.computed(()=>new j.ClientCategory(e.categoryItem)),b=i.ref(!1),_=i.ref(!1),k=i.computed(()=>!D.isUndefined(e.isCategoryItemSelected)),x=i.computed(()=>D.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),C=i.computed(()=>D.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),N=i.computed(()=>D.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=i.computed(()=>M.value&&it.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),S=i.useTemplateRef("collapse-item-reference"),v=i.computed(()=>{var U,G;return(G=(U=e.categoryItem.properties)==null?void 0:U.templateCost)==null?void 0:G.priceCoefficient}),$=i.computed(()=>{var U,G;return(G=(U=e.categoryItem.properties)==null?void 0:U.templateCost)==null?void 0:G.increasePercent}),E=(U,G="ru-RU")=>0 .toLocaleString(G,{style:"currency",currency:U,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),A=U=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:U,target:S.value})},R=(U,G)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:G,isLoadingState:b,target:S.value})},F=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:S.value})},H=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:S.value})},Q=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:S.value})},Z=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:S.value})},O=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:S.value})},P=U=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:U,target:S.value})},V=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},M=i.ref(0),L=i.computed(()=>M.value&&s.value.length>0?jp(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}):[]),Y=D.debounce(()=>{M.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",Y)}),window.addEventListener("resize",Y),Y(),(U,G)=>{const q=z.NCheckbox,W=wm,K=z.NTooltip,ue=ym,ye=z.NTag,ve=mm,ot=um,_e=z.NButton,we=lm,wt=Sl,$e=Cl,Gt=vl,pn=ms,Rt=z.NDropdown,Qn=z.NDataTable,gn=z.NAlert,sn=z.NSpin;return i.openBlock(),i.createBlock(Bl,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":R},{"pre-arrow":i.withCtx(()=>{var Ve,te;return[k.value?(i.openBlock(),i.createElementBlock("div",z1,[i.createVNode(q,{checked:x.value,indeterminate:N.value,disabled:C.value,"onUpdate:checked":A},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Ve=y.value)!=null&&Ve.isDisabled)?(i.openBlock(),i.createBlock(K,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(W,{class:"pt-1.5"})]),default:i.withCtx(()=>[G[1]||(G[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((te=y.value)==null?void 0:te.isFavorite)??!1?(i.openBlock(),i.createBlock(K,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ue,{class:"pt-1.5"})]),default:i.withCtx(()=>[G[2]||(G[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Ve,te,le,De,hi;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=y.value)==null?void 0:Ve.isDisabled})},[i.createVNode(K,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[G[3]||(G[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:G[0]||(G[0]=i.withModifiers((...at)=>i.unref(D.noop)&&i.unref(D.noop)(...at),["prevent","stop"]))},[(te=t.categoryItem.properties)!=null&&te.m2Price?(i.openBlock(),i.createBlock(ye,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((le=t.categoryItem.properties)==null?void 0:le.templateCost)&&t.categoryItem.properties.m2PriceRetail&&$.value}),round:""},{default:i.withCtx(()=>{var at;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(at=t.categoryItem.properties)!=null&&at.templateCost&&t.categoryItem.properties.m2PriceRetail&&$.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[$.value?(i.openBlock(),i.createBlock(ye,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[$.value?(i.openBlock(),i.createElementBlock("span",D1,i.toDisplayString($.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(ye,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",L1,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},[v.value||$.value?(i.openBlock(),i.createBlock(ye,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var at;return[v.value?(i.openBlock(),i.createElementBlock("span",H1,i.toDisplayString((at=v.value)==null?void 0:at.name),1)):i.createCommentVNode("",!0),$.value?(i.openBlock(),i.createElementBlock("span",W1,i.toDisplayString($.value>0?"+":"")+i.toDisplayString($.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ye,{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&&((hi=y.value)!=null&&hi.manager)?(i.openBlock(),i.createBlock(ye,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:Z},{default:i.withCtx(()=>[i.createVNode(K,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var at,Zt;return[i.createElementVNode("span",j1,[i.createVNode(ve),i.createTextVNode(" "+i.toDisplayString((Zt=(at=y.value)==null?void 0:at.manager)==null?void 0:Zt.name),1)])]}),default:i.withCtx(()=>{var at,Zt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Zt=(at=y.value)==null?void 0:at.manager)==null?void 0:Zt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",q1,[i.createElementVNode("ul",X1,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ve,te)=>(i.openBlock(),i.createElementBlock("li",{key:te}," ("+i.toDisplayString(te)+"): "+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,te)=>(i.openBlock(),i.createElementBlock("li",{key:te}," ("+i.toDisplayString(te)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Ve;return[i.createElementVNode("div",Y1,[d.value?(i.openBlock(),i.createBlock(K,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,size:i.unref(n),onClick:F},{default:i.withCtx(()=>{var te;return[(te=y.value)!=null&&te.isDisabled?(i.openBlock(),i.createBlock(W,{key:1})):(i.openBlock(),i.createBlock(ot,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var te;return[(te=y.value)!=null&&te.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(y.value.hidingComment?`. Причина: '${y.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),u.value&&!((Ve=y.value)!=null&&Ve.manager)?(i.openBlock(),i.createBlock(K,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,size:i.unref(n),onClick:Q},{default:i.withCtx(()=>[i.createVNode(we)]),_:1},8,["size"])]),default:i.withCtx(()=>{var te,le,De;return[(te=y.value)!=null&&te.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(le=y.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(K,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:H},{default:i.withCtx(()=>{var te;return[(te=y.value)!=null&&te.isRequired?(i.openBlock(),i.createBlock($e,{key:1})):(i.openBlock(),i.createBlock(wt,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[G[4]||(G[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(K,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,size:i.unref(n),type:"primary",onClick:O},{default:i.withCtx(()=>[i.createVNode(Gt)]),_:1},8,["size"])]),default:i.withCtx(()=>[G[5]||(G[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),g.value.length>0?(i.openBlock(),i.createBlock(Rt,{key:4,options:g.value,size:i.unref(n),trigger:"click",onSelect:P},{default:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(pn)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(U.$slots,"default",{},()=>{var Ve,te,le;return[i.createElementVNode("div",U1,[o.value?(i.openBlock(),i.createBlock(wu,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||b.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)]),m.value&&p.value?(i.openBlock(),i.createBlock(gu,{key:0,"event-emitter":t.eventEmitter,settings:(te=t.categoryItem.properties)==null?void 0:te.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",K1,[m.value?(i.openBlock(),i.createBlock(_e,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:V},{default:i.withCtx(()=>[...G[6]||(G[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Qn,{columns:L.value,data:l.value,bordered:!0,loading:b.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),!b.value&&!_.value&&!o.value&&!c.value?(i.openBlock(),i.createBlock(gn,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(gn,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(sn,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...G[7]||(G[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Q1=An(Z1,[["__scopeId","data-v-607a5aad"]]),J1={class:"sc-collapse flex w-full flex-col"},e_={},_u=i.defineComponent({...e_,__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",J1,[i.renderSlot(s.$slots,"default")]))}}),t_={},wu=i.defineComponent({...t_,__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(xr,"medium"),r=i.computed(()=>D.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var a;return!!((a=e.filteredItems)!=null&&a[s.id])})),o=(s,a)=>{if(D.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=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(_u,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Q1,{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)}}}),n_={},xu=i.defineComponent({...n_,__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(()=>D.isArray(r.value)),a=new j.Reference,l=i.computed(()=>D.isNil(r.value)?s.value?[]:null:D.isArray(r.value)?r.value.filter(m=>!D.isNil(m)).map(m=>m.id):r.value.id),c=i.computed(()=>yt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue,void 0,r.disabledItem)),d=m=>{var p;if(D.isArray(m)){const g=m.length>0?m.map(y=>{var b;return(b=c.value.find(_=>_.value===y))==null?void 0:b.item}).filter(y=>!D.isNil(y)):[];o("update:value",g)}else{const g=m===a.id||D.isNil(m)||(p=c.value.find(y=>y.value===m))==null?void 0:p.item;o("update:value",g)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blur()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple: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"]))}}),i_={},r_=i.defineComponent({...i_,__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,C;const n=t,r=e,o=()=>{const N=j.PriceCoefficient.getRetailPriceCoefficient();return D.unset(N,"isNewRec"),N},s=N=>!N||N.id===o().id,a=i.computed(()=>{var N;return((N=n.catalogItem)==null?void 0:N.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=N=>{var w,S,v,$;return N.id===o().id?(w=l.value)==null?void 0:w.getRetailCost():($=(v=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:v.find(E=>E.coefficient.id===N.id))==null?void 0:$.cost},d=i.computed(()=>{var S;const w=[...((S=j.useReferencesStore().priceCoefficientsReference)==null?void 0:S.map(v=>structuredClone(i.toRaw(v))))??[],o()].filter(v=>{var $;return(($=n.visibleCoefficient)==null?void 0:$.call(n,v))??!0});return a.value&&w.forEach(v=>{var E;const $=c(v);$?v.name+=` (${$} ${(E=l.value)==null?void 0:E.currency.symbol})`:v.name=""}),w.filter(v=>v.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((C=(x=n.value)==null?void 0:x.value)==null?void 0:C.toString())??null),f=i.ref(null),m=i.computed(()=>{var N,w;return(w=(N=l.value)==null?void 0:N.priceCoefficients)==null?void 0:w.find(S=>S.coefficient.slug===j.PriceCoefficientEnum.K0)}),p=i.ref(void 0),g=N=>Number.parseFloat((N??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),y=()=>{var w,S;p.value=void 0;let N=g(h.value);if(N=Number.isNaN(N)?void 0:N,a.value)if(u.value||h.value){const v=o(),$=c(u.value??v)??0,E=$+$*((N??0)/100);f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(E),E>(((w=l.value)==null?void 0:w.getRetailCost())??E)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),m.value&&E<(((S=m.value)==null?void 0:S.cost)??0)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else f.value=null;r("update:value",{value:Number.isNaN(N)?void 0:N,coefficient:s(u.value)?void 0:structuredClone(i.toRaw(u.value))})},b=N=>{D.isArray(N)||D.isNull(N)||(u.value=N,h.value=null,!u.value&&h.value&&(u.value=o()),y())},_=()=>{u.value||(u.value=o()),y()},k=N=>{var S,v,$,E,A;const w=g(N);if(a.value){if(Number.isNaN(w)){u.value=void 0,h.value=null,r("update:value",{value:void 0,coefficient:void 0});return}let R=0;if(w<=0)u.value=void 0,h.value=null;else if(m.value&&w<(((S=m.value)==null?void 0:S.cost)??0))u.value=(v=m.value)==null?void 0:v.coefficient,R=(w-m.value.cost)*100/m.value.cost,p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>((($=l.value)==null?void 0:$.getRetailCost())??w)){u.value=o();const F=((E=l.value)==null?void 0:E.getRetailCost())??0;R=(w-F)*100/F,p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const F=((A=l.value)==null?void 0:A.priceCoefficients)??[],H=D.sortBy(F,[O=>O.cost]),Z=H.filter(O=>O.cost<=w).at(-1)??H.at(0);Z&&(u.value=Z.coefficient,R=(w-Z.cost)*100/Z.cost),p.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(R),r("update:value",{value:Number.isNaN(R)?void 0:R,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 N,w,S,v;n.calculationType===j.CalculationTypeEnum.m2Cost?f.value=((w=(N=n.value)==null?void 0:N.value)==null?void 0:w.toString())??null:!((S=n.value)!=null&&S.coefficient)&&((v=n.value)!=null&&v.value)&&(u.value=o()),y()}),(N,w)=>{var $,E,A;const S=z.NInput,v=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(D.isNil)(t.label),label:t.label,"show-feedback":!i.unref(D.isNil)((($=p.value)==null?void 0:$.feedback)??t.feedback),feedback:((E=p.value)==null?void 0:E.feedback)??t.feedback,"validation-status":((A=p.value)==null?void 0:A.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(v,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(xu,{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":b},null,8,["value","reference-list","clearable","disabled","disabled-item"]),i.createVNode(S,{value:h.value,"onUpdate:value":[w[0]||(w[0]=R=>h.value=R),_],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(S,{key:1,value:f.value,"onUpdate:value":[w[1]||(w[1]=R=>f.value=R),k],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var R;return[i.createTextVNode(i.toDisplayString((R=l.value)==null?void 0:R.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"])}}}),o_={key:0,class:"flex flex-row gap-2.5"},s_={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},a_={},ku=i.defineComponent({...a_,__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=(m="other",p=!1)=>{if(a.value&&!p){o("processing:cancel",_=>{a.value=_});return}let g=!1;o("closing",m,()=>{g=!0}),g||(s.value=!1,o("update:show",s.value))},f=()=>{o("accept",p=>{a.value=p})};return i.watch(()=>r.show,m=>{m?u():h("other",!0)}),i.watch(()=>r.processing,m=>{a.value=m}),e({open:u,close:h,acceptHandler:f}),(m,p)=>{const g=z.NButton,y=z.NModal;return i.openBlock(),i.createBlock(y,{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":m.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:p[1]||(p[1]=b=>h("header")),onEsc:p[2]||(p[2]=b=>h("esc")),onMaskClick:p[3]||(p[3]=b=>h("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(m.$slots,"default")]),_:2},[m.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(m.$slots,"header")]),key:"0"}:void 0,m.$slots.action||m.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[m.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",o_,[i.renderSlot(m.$slots,"extra-action")])):i.createCommentVNode("",!0),m.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",s_,[i.renderSlot(m.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(g,{key:0,disabled:a.value||!t.valid,loading:a.value,size:i.unref(l),type:"primary",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","loading","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(g,{key:1,disabled:a.value,size:i.unref(l),type:"default",onClick:p[0]||(p[0]=b=>h("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),l_={class:"text-sm"},c_={class:"text-sm"},d_={},u_=i.defineComponent({...d_,__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(!1),a=i.ref(null),l=i.computed(()=>{var R,F,H;return((R=a.value)==null?void 0:R.unit.isLinear)&&((H=(F=a.value)==null?void 0:F.properties)==null?void 0:H.isLengthConfigurator)}),c=i.computed(()=>a.value?j.UnitsHelper.productIsMeasurable(a.value)||l.value?"шт.":a.value.unit.name:"шт."),d=i.ref(void 0),u=i.ref(void 0),h=i.ref(!0),f=i.ref(null),m=i.computed({get:()=>{var R;return((R=f.value)==null?void 0:R.quantity)??null},set:R=>{f.value&&(f.value.quantity=R??0)}}),p=i.computed({get:()=>{var R;return((R=f.value)==null?void 0:R.length)??null},set:R=>{f.value&&(f.value.length=R??void 0)}}),g=R=>{f.value&&(f.value.marker=R??null)},y=n,b=()=>({length:{},quantity:{},marker:{}}),_=i.ref(b()),k=i.ref(!1),x=i.computed(()=>{var Z,O,P,V;if(!a.value)return{};const R=j.UnitsHelper.getProductLengthMultiplicity(a.value),F=j.UnitsHelper.getProductMultiplicity(a.value),H=((O=(Z=a.value)==null?void 0:Z.properties)==null?void 0:O.minLength)||R,Q=(V=(P=a.value)==null?void 0:P.properties)==null?void 0:V.maxLength;return{length:[ae.required,ae.min(H??.1),ae.max(Q),ae.step(R),We.serverValidation(_.value.length.feedback)],quantity:[ae.required,ae.min(F),ae.step(F),We.serverValidation(_.value.quantity.feedback)],marker:[We.serverValidation(_.value.marker.feedback)]}}),C=i.computed(()=>{var R,F,H;return a.value?((R=a.value.properties)==null?void 0:R.lengthStep)??((F=a.value.properties)!=null&&F.ignoreMinCountCheck?0:((H=a.value.properties)==null?void 0:H.minCount)??0):0}),N=i.computed(()=>{var H,Q,Z,O,P,V,M,L,Y;if(!a.value)return"";const R=((Q=(H=a.value)==null?void 0:H.properties)==null?void 0:Q.minLength)??((O=(Z=a.value)==null?void 0:Z.properties)!=null&&O.ignoreMinCountCheck?0:(V=(P=a.value)==null?void 0:P.properties)==null?void 0:V.minCount),F=(L=(M=a.value)==null?void 0:M.properties)==null?void 0:L.maxLength;return R||F?`(${R?`от ${R}`:""}${R&&F?" ":""}${F?`до ${F}`:""} ${(Y=a.value)==null?void 0:Y.unit.name})`:""}),w=R=>{var O,P;if(!((P=(O=a.value)==null?void 0:O.properties)!=null&&P.isLengthConfigurator)||!f.value||D.isNil(R)||C.value===0)return;const F=R/C.value,H=Math.round(F),Q=j.UnitsHelper.getProductMultiplicity(a.value),Z=Math.max(H,Q);f.value.quantity=Z},S=R=>{var Z,O,P,V;if(!((O=(Z=a.value)==null?void 0:Z.properties)!=null&&O.isLengthConfigurator)||!f.value||D.isNil(R)||C.value===0)return;const F=R*C.value,H=((P=a.value.properties)==null?void 0:P.minLength)||j.UnitsHelper.getProductLengthMultiplicity(a.value),Q=(V=a.value.properties)==null?void 0:V.maxLength;H!==void 0&&F<H?f.value.length=H:Q!==void 0&&F>Q?f.value.length=Q:f.value.length=F},v=async R=>{var H;const F=D.cloneDeep(f.value);try{await((H=r.value)==null?void 0:H.validate(Q=>{if(!Q){if(!a.value||!F)return;j.UnitsHelper.productIsMeasurable(a.value)||delete F.length,l.value&&C.value&&(F.length=C.value),k.value=!0,y("submit",F,_.value,()=>{k.value=!1,R(!1),i.nextTick(()=>{var Z;(Z=r.value)==null||Z.validate(D.noop).catch(D.noop)})})}}))}catch{}},$=()=>{a.value=null,d.value=void 0,f.value=null,_.value=b()},E=()=>{s.value=!1};return e({show:(R,F)=>{var H,Q,Z,O,P;if($(),s.value=!0,a.value=R,d.value=F==null?void 0:F.cartItemData,u.value=F==null?void 0:F.orderId,h.value=(F==null?void 0:F.canSetDopProdaga)??!1,f.value=new j.OrderItemBase((F==null?void 0:F.cartItemData)??new j.OrderItemBase({product:R,quantity:j.UnitsHelper.productIsMeasurable(a.value)?1:((H=R==null?void 0:R.properties)==null?void 0:H.minCount)??1,length:((Q=R==null?void 0:R.properties)==null?void 0:Q.minLength)||((Z=R==null?void 0:R.properties)!=null&&Z.ignoreMinCountCheck?0:(O=R==null?void 0:R.properties)==null?void 0:O.minCount)||0})),(P=R==null?void 0:R.properties)!=null&&P.isLengthConfigurator&&f.value&&C.value>0){const V=C.value,M=f.value.quantity||1;f.value.length=M*V}},closeDialog:E}),(R,F)=>{var P;const H=z.NFormItem,Q=z.NInputGroupLabel,Z=z.NInputGroup,O=z.NCheckbox;return i.openBlock(),i.createBlock(ku,{ref:"base-dialog-reference",show:s.value,title:`${d.value?"Изменение":"Добавление"} товара ${(P=a.value)==null?void 0:P.name} в ${u.value?` заказ №${u.value}`:"корзину"}`,"accept-button":{show:!0,text:d.value?"Изменить":"Добавить"},processing:k.value,"modal-width":500,onAccept:v,onClosing:E},{default:i.withCtx(()=>[a.value&&f.value?i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,ref:"form-reference",model:f.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>[i.unref(j.UnitsHelper).productIsMeasurable(a.value)?(i.openBlock(),i.createBlock(H,{key:0,path:"length",label:`Метраж, ${N.value+a.value.unit.name}`},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:p.value,"onUpdate:value":[F[0]||(F[0]=V=>p.value=V),w],parse:i.unref(lt),step:i.unref(j.UnitsHelper).getProductLengthMultiplicity(a.value),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:F[1]||(F[1]=V=>i.unref(eo)(V,".",!1)),onInput:F[2]||(F[2]=V=>i.unref(nt)(_.value,"length")),onFocus:i.unref(Le)},null,8,["value","parse","step","onFocus"])]),_:2},[!_.value.length.feedback&&i.unref(j.UnitsHelper).getProductLengthMultiplicity(a.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",l_,"Метраж должно быть кратно "+i.toDisplayString(i.unref(j.UnitsHelper).getProductLengthMultiplicity(a.value)),1)]),key:"0"}:void 0]),1032,["label"])):i.createCommentVNode("",!0),i.createVNode(H,{path:"quantity",label:`Количество, ${c.value}`},{default:i.withCtx(()=>[i.createVNode(Z,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:m.value,"onUpdate:value":[F[3]||(F[3]=V=>m.value=V),S],parse:i.unref(lt),step:i.unref(j.UnitsHelper).getProductMultiplicity(a.value),"show-button":i.unref(j.UnitsHelper).getProductMultiplicity(a.value)>1,"button-placement":"both",placeholder:"Введите количество",class:"w-full",onKeydown:F[4]||(F[4]=V=>i.unref(eo)(V,".",!1)),onInput:F[5]||(F[5]=V=>i.unref(nt)(_.value,"quantity")),onFocus:i.unref(Le)},null,8,["value","parse","step","show-button","onFocus"]),l.value?(i.openBlock(),i.createBlock(Q,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(C.value)+" "+i.toDisplayString(a.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!_.value.quantity.feedback&&i.unref(j.UnitsHelper).getProductMultiplicity(a.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",c_,"Количество должно быть кратно "+i.toDisplayString(i.unref(j.UnitsHelper).getProductMultiplicity(a.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),i.unref(j.UnitsHelper).productIsMeasurable(a.value)?(i.openBlock(),i.createBlock(H,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:f.value.marker??null,placeholder:"Введите маркировку",onInput:F[6]||(F[6]=V=>i.unref(nt)(_.value,"marker")),"onUpdate:value":F[7]||(F[7]=V=>g(V)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(O,{key:2,checked:f.value.isAdditionalSale,"onUpdate:checked":F[8]||(F[8]=V=>f.value.isAdditionalSale=V),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...F[9]||(F[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules"])),[[i.unref(ei),()=>{var V,M;return(M=(V=o.value)==null?void 0:V.acceptHandler)==null?void 0:M.call(V)}]]):i.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),f_={class:"flex flex-row gap-1"},h_={class:"sc-client-name flex flex-col gap-1 text-base"},m_=["href"],p_={key:1,class:"text-sc-grey"},g_={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},y_={key:0},b_={key:1,class:"text-sm"},__={},Er=i.defineComponent({...__,__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?He.format(n.client.lastLoginAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=a=>{D.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=ps,d=z.NButton,u=z.NPopover;return i.openBlock(),i.createElementBlock("div",f_,[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(D.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",h_,[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",p_," [ Деактивирован ] "))],8,m_),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",g_," г. "+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",y_,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("span",b_," Последний вход: "+i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),w_={class:"text-base"},x_={},vu=i.defineComponent({...x_,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){const e=t,n=i.computed(()=>ti.getFormatEntityName(e.contragent));return(r,o)=>(i.openBlock(),i.createElementBlock("span",w_,i.toDisplayString(n.value),1))}}),k_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v_(t,e){return i.openBlock(),i.createElementBlock("svg",k_,[...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 C_=i.markRaw({name:"tabler-mail",render:v_}),S_=["href"],B_={},T_=i.defineComponent({...B_,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=C_;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,S_)],2)}}}),N_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $_(t,e){return i.openBlock(),i.createElementBlock("svg",N_,[...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 Cu=i.markRaw({name:"fa6-brands-viber",render:$_}),R_={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},E_=["id"],P_=["id"],F_=["fill"],V_=["fill"];function M_(t,e){return i.openBlock(),i.createElementBlock("svg",R_,[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,E_),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,P_)]),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,F_),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,V_),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 Su=i.markRaw({name:"logos-whatsapp-icon",render:M_,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),A_={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},I_=["id"],O_=["fill"];function z_(t,e){return i.openBlock(),i.createElementBlock("svg",A_,[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,I_)]),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,O_),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 Bu=i.markRaw({name:"logos-telegram",render:z_,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),D_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function L_(t,e){return i.openBlock(),i.createElementBlock("svg",D_,[...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 Tu=i.markRaw({name:"ion-call",render:L_}),H_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W_(t,e){return i.openBlock(),i.createElementBlock("svg",H_,[...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 j_=i.markRaw({name:"tabler-phone-call",render:W_}),q_={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},X_=["href"],Y_=["href"],U_=["href"],K_=["href"],G_={},Z_=i.defineComponent({...G_,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?br.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return D.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),o=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),s=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=j_,u=Tu,h=Bu,f=Su,m=Cu;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]=p=>a.value=!a.value),onFocusout:c[1]||(c[1]=p=>a.value=!1),onMouseleave:c[2]||(c[2]=p=>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",q_,[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,Y_)):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,U_)):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(m)],8,K_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Q_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J_(t,e){return i.openBlock(),i.createElementBlock("svg",Q_,[...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 ew=i.markRaw({name:"mdi-envelope",render:J_}),tw={class:"flex flex-col gap-1"},nw={key:0,class:"mb-2 flex flex-col text-base"},iw={key:0,class:"text-sc-dark-grey text-sm"},rw={key:1,class:"whitespace-nowrap text-sm"},ow={key:2,class:"whitespace-nowrap text-sm"},sw={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},aw=["href"],lw=["href"],cw=["href"],dw=["href"],uw=["href"],fw={key:0,class:"flex flex-col text-base"},hw={key:0,class:"text-sc-dark-grey text-sm"},mw={key:1,class:"mt-2 text-sm"},pw={key:0,class:"-mt-1"},gw={},yw=i.defineComponent({...gw,__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(()=>ti.getFormatEntityName(e.contact)),r=i.computed(()=>{try{return e.contact.phone?br.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),o=i.computed(()=>{var d;return D.isString(r.value)?!1:((d=r.value)==null?void 0:d.isValid())??!1}),s=i.computed(()=>{var d;return D.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("INTERNATIONAL"))??""}),a=i.computed(()=>{var d;return D.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("E.164"))??""}),l=i.computed(()=>o.value||e.contact.email),c=i.ref(!1);return(d,u)=>{var b,_;const h=Tu,f=Bu,m=Su,p=Cu,g=ew,y=z.NPopover;return i.openBlock(),i.createElementBlock("div",tw,[i.createVNode(y,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var k,x,C,N;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(k=t.contact)!=null&&k.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:u[0]||(u[0]=w=>c.value=!0),onFocusin:u[1]||(u[1]=w=>c.value=!0),onMouseleave:u[2]||(u[2]=w=>c.value=!1),onFocusout:u[3]||(u[3]=w=>c.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(x=t.contact)!=null&&x.position)?(i.openBlock(),i.createElementBlock("div",nw,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),(C=t.contact)!=null&&C.position?(i.openBlock(),i.createElementBlock("span",iw,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",rw,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",ow,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),l.value&&c.value?(i.openBlock(),i.createElementBlock("div",sw,[o.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${a.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(h)],8,aw)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${a.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(f)],8,lw)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${a.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(m)],8,cw)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${a.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(p)],8,dw)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,uw)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var k,x,C,N;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",fw,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),(k=t.contact)!=null&&k.position?(i.openBlock(),i.createElementBlock("span",hw,i.toDisplayString((x=t.contact)==null?void 0:x.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(C=t.contact)!=null&&C.comment?(i.openBlock(),i.createElementBlock("div",mw,[u[4]||(u[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",pw,[u[5]||(u[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((_=t.contact)==null?void 0:_.comment),1)])):i.createCommentVNode("",!0)])}}});class bw{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=hs.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=hs.objectToSnake(e.heightOverlaps),this.widthOverlaps=hs.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function _w(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==j.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&D.isArray(t.products)&&t.products.length>0}const ww={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xw(t,e){return i.openBlock(),i.createElementBlock("svg",ww,[...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 kw=i.markRaw({name:"mdi-dots-horizontal",render:xw}),Nu="date-range.dialog.mode",$u=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Ru=(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?He.startOfDay(r):void 0,to:o?He.endOfDay(o):void 0}},vw={class:"text-center font-semibold"},Cw={class:"grid grid-cols-3 gap-1"},Sw=["onPointerdown","onPointerenter","onKeydown"],Bw={},Tw=i.defineComponent({...Bw,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=z.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 S=new Date().getFullYear();return w&&He.isValid(w)?w.getFullYear():S},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),m=i.ref(null),p=i.computed(()=>{const{from:w,to:S}=n;return!w||!S||!He.isSameDay(w,He.startOfMonth(w))||!He.isSameDay(S,He.endOfMonth(S))?null:[w.getFullYear()*12+w.getMonth(),S.getFullYear()*12+S.getMonth()]}),g=i.computed(()=>f.value&&h.value!==null&&m.value!==null?y(h.value,m.value):u.value!==null?m.value===null?[u.value,u.value]:y(u.value,m.value):p.value),y=(w,S)=>w<=S?[w,S]:[S,w],b=(w,S)=>{const v=w*12+S,$=g.value;return $&&v>=$[0]&&v<=$[1]?[v===$[0]||v===$[1]?"sc-month--bound":"sc-month--in-range"]:[]},_=(w,S)=>{const[v,$]=y(w,S);u.value=null,r("select",{from:new Date(Math.floor(v/12),v%12,1),to:He.endOfMonth(new Date(Math.floor($/12),$%12,1))})},k=w=>{u.value===null?(u.value=w,r("select",{from:new Date(Math.floor(w/12),w%12,1),to:He.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,m.value!==null&&_(w,m.value);return}k(w)}},C=(w,S)=>{h.value=w*12+S,f.value=!1,globalThis.addEventListener("pointerup",x)},N=(w,S)=>{const v=w*12+S;m.value=v,h.value!==null&&v!==h.value&&(f.value=!0)};return i.watch(()=>[n.from,n.to],()=>{const w=n.from??n.to;if(!w||!He.isValid(w))return;const S=w.getFullYear();(S<l.value-1||S>l.value+1)&&(l.value=S)}),i.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",x)}),(w,S)=>{const v=z.NButton;return i.openBlock(),i.createElementBlock("div",{class:"flex select-none items-start gap-2",style:i.normalizeStyle(s.value),onPointerleave:S[2]||(S[2]=$=>m.value=null)},[i.createVNode(v,{size:"small",quaternary:"",class:"mt-5",onClick:S[0]||(S[0]=$=>l.value-=1)},{default:i.withCtx(()=>[...S[3]||(S[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,$=>(i.openBlock(),i.createElementBlock("div",{key:$,class:"flex flex-col gap-1"},[i.createElementVNode("div",vw,i.toDisplayString($),1),i.createElementVNode("div",Cw,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref($u),(E,A)=>(i.openBlock(),i.createElementBlock("button",{key:E,type:"button",class:i.normalizeClass(["sc-month cursor-pointer rounded border-0 px-1 py-1 text-sm",b($,A)]),onPointerdown:i.withModifiers(R=>C($,A),["prevent"]),onPointerenter:R=>N($,A),onKeydown:[i.withKeys(i.withModifiers(R=>k($*12+A),["prevent"]),["enter"]),i.withKeys(i.withModifiers(R=>k($*12+A),["prevent"]),["space"])]},i.toDisplayString(E),43,Sw))),128))])]))),128))],2),i.createVNode(v,{size:"small",quaternary:"",class:"mt-5",onClick:S[1]||(S[1]=$=>l.value+=1)},{default:i.withCtx(()=>[...S[4]||(S[4]=[i.createTextVNode(" › ",-1)])]),_:1})],36)}}}),Nw=An(Tw,[["__scopeId","data-v-7dd4941e"]]),$w={class:"sc-date-range-sidebar flex flex-col gap-1"},Rw={class:"flex items-center justify-center gap-1"},Ew={class:"min-w-12 text-center font-semibold"},Pw={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},Fw={},Vw=i.defineComponent({...Fw,__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=z.NButton;return i.openBlock(),i.createElementBlock("div",$w,[i.createElementVNode("div",Rw,[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",Ew,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",Pw,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref($u),(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})])}}}),Mw={},Eu=i.defineComponent({...Mw,__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(n.value&&He.isValid(n.value)?n.value:new Date),d=i.computed(()=>{const k=n.value&&He.isValid(n.value)?n.value:c.value;return k.getFullYear()===c.value.getFullYear()?k.getMonth():null});let u=0;const h=k=>{var x,C;(C=(x=k.target)==null?void 0:x.closest)!=null&&C.call(x,".n-base-clear")&&(u=performance.now())},f=k=>{k&&performance.now()-u<300||(a.value=k,k&&(c.value=n.value&&He.isValid(n.value)?n.value:new Date))},m=k=>{r("update:value",k===null?null:new Date(k))},p=(k,x)=>{const C=new Date(k,x,1);if(c.value=C,n.value&&He.isValid(n.value)){const N=Math.min(He.getDate(n.value),He.getDaysInMonth(C));r("update:value",new Date(k,x,N));return}l.value+=1,i.nextTick().then(()=>{var N;return(N=s.value)==null?void 0:N.focus()})},g=(k,x)=>{c.value=He.addYears(He.addMonths(c.value,k),x)},y=k=>{p(k,c.value.getMonth())},b=k=>{p(c.value.getFullYear(),k)},_=()=>{a.value=!1,r("update:value",new Date)};return(k,x)=>{const C=z.NButton,N=z.NDatePicker;return i.openBlock(),i.createBlock(N,{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":m,onNextMonth:x[0]||(x[0]=w=>g(1,0)),onPrevMonth:x[1]||(x[1]=w=>g(-1,0)),onNextYear:x[2]||(x[2]=w=>g(0,1)),onPrevYear:x[3]||(x[3]=w=>g(0,-1))},{footer:i.withCtx(()=>[i.unref(o)?(i.openBlock(),i.createBlock(C,{key:1,size:"small",text:"",type:"info",onClick:_},{default:i.withCtx(()=>[...x[4]||(x[4]=[i.createTextVNode(" Сегодня ",-1)])]),_:1})):(i.openBlock(),i.createBlock(Vw,{key:0,year:c.value.getFullYear(),month:d.value,"onUpdate:year":y,onSelectMonth:b,onToday:_},null,8,["year","month"]))]),_:1},8,["value","show","clearable","disabled","placeholder","format","default-calendar-start-time"])}}}),Aw={class:"@container"},Iw={class:"flex flex-col gap-1 @xs:flex-row @xs:items-center"},Ow={},Pu=i.defineComponent({...Ow,__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",Aw,[i.createElementVNode("div",Iw,[i.createVNode(Eu,{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(Eu,{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"])])])}}}),zw={class:"flex flex-col items-stretch gap-3 sm:flex-row"},Dw={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},Lw={class:"flex flex-col items-stretch pr-3"},Hw={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},Ww={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},jw={},qw=i.defineComponent({...jw,__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 D.isEmpty(n.customPeriods)||h.push({key:o,value:o,label:"Пользовательские"}),h}),d=h=>Object.entries(h).map(([f,m])=>({value:f,label:m.label,item:m})),u=i.computed(()=>{if(l.value===o)return[{type:"group",key:o,children:d(n.customPeriods??{})}];const h=Object.entries(a).filter(([,m])=>m.group===l.value),f=Object.fromEntries(h);return l.value!=="other"?[{type:"group",key:l.value,children:d(f)}]:j.STANDARD_PERIOD_SECTIONS.map(m=>{const p=h.filter(([,g])=>g.section===m.key);return{type:"group",key:m.key,label:m.label,children:d(Object.fromEntries(p))}}).filter(m=>{var p;return(((p=m.children)==null?void 0:p.length)??0)>0})});return(h,f)=>{const m=z.NButton,p=z.NScrollbar,g=z.NSelect,y=z.NMenu;return i.openBlock(),i.createElementBlock("div",zw,[i.createElementVNode("div",Dw,[i.createVNode(p,{class:"max-h-96"},{default:i.withCtx(()=>[i.createElementVNode("div",Lw,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,b=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:b.key},[b.label?(i.openBlock(),i.createElementBlock("div",Hw,i.toDisplayString(b.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.children,_=>(i.openBlock(),i.createBlock(m,{key:_.value,size:"small",quaternary:"",type:_.value===t.activeKey?"primary":"default",class:"justify-start",onClick:k=>r("apply",_),onMouseenter:k=>r("preview",_),onMouseleave:f[0]||(f[0]=k=>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(g,{key:0,value:l.value,options:c.value,class:"order-1","onUpdate:value":f[1]||(f[1]=b=>l.value=b)},null,8,["value","options"])):(i.openBlock(),i.createElementBlock("div",Ww,[i.createVNode(y,{value:l.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=b=>l.value=b)},null,8,["value","options"])]))])}}}),Xw={class:"flex flex-col gap-3"},Yw={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},Uw={key:0,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},Kw={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},Gw={class:"flex gap-2"},Zw={},Qw=i.defineComponent({...Zw,__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(Nu)==="standard"?"standard":"custom",l=i.ref({}),c=i.ref(null),d=i.ref(null),u=i.computed(()=>c.value??l.value),h=(x,C)=>{var S,v;const N=(S=n.disabled)!=null&&S.from?l.value.from:x,w=(v=n.disabled)!=null&&v.to?l.value.to:C;c.value=null,l.value=Ru(N,w,n.disabled)},f=x=>{d.value=null,h(x,l.value.to)},m=x=>{d.value=null,h(l.value.from,x)},p=()=>{d.value=null,h(null,null)},g=x=>{d.value=null,h(x.from,x.to)},y=x=>{const C=x.item;h(C.from,C.to),d.value=String(x.value)},b=x=>{const C=x==null?void 0:x.item;c.value=C?{from:C.from,to:C.to}:null},_=()=>{c.value=null,s.value=s.value==="custom"?"standard":"custom";const x=Nu;j.PreferencesStorageProvider.saveActualDataToStorage(x,s.value,He.addYears(He.startOfToday(),1))},k=()=>{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,C)=>{const N=z.NButton,w=z.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":C[1]||(C[1]=S=>r("update:show",S))},{footer:i.withCtx(()=>[i.createElementVNode("div",Kw,[i.createVNode(N,{text:"",type:"info",onClick:_},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),i.createElementVNode("div",Gw,[i.createVNode(N,{type:"primary",onClick:k},{default:i.withCtx(()=>[...C[3]||(C[3]=[i.createTextVNode(" Выбрать ",-1)])]),_:1}),i.createVNode(N,{onClick:C[0]||(C[0]=S=>r("update:show",!1))},{default:i.withCtx(()=>[...C[4]||(C[4]=[i.createTextVNode("Отмена",-1)])]),_:1})])])]),default:i.withCtx(()=>[i.createElementVNode("div",Xw,[i.createElementVNode("div",Yw,[i.createVNode(Pu,{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":m},null,8,["from","to","clearable","disabled","date-format"]),t.clearable?(i.openBlock(),i.createBlock(N,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:p},{default:i.withCtx(()=>[...C[2]||(C[2]=[i.createTextVNode(" Очистить период ",-1)])]),_:1})):i.createCommentVNode("",!0)]),s.value==="custom"?(i.openBlock(),i.createElementBlock("div",Uw,[i.createVNode(Nw,{from:l.value.from,to:l.value.to,onSelect:g},null,8,["from","to"])])):(i.openBlock(),i.createBlock(qw,{key:1,"active-key":d.value,"custom-periods":t.customPeriods,onApply:y,onPreview:b},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),Jw={class:"flex w-full min-w-28 items-center gap-1"},ex={},tx=i.defineComponent({...ex,__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 D.isEmpty(u)?void 0:u}),a=(u,h)=>{r("update:date-range",Ru(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 p,g,y,b;const f=kw,m=z.NButton;return i.openBlock(),i.createElementBlock("div",Jw,[i.createVNode(Pu,{from:(p=t.dateRange)==null?void 0:p.from,to:(g=t.dateRange)==null?void 0:g.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(m,{disabled:!!((y=t.disabled)!=null&&y.from&&((b=t.disabled)!=null&&b.to)),title:"Выбрать период","aria-label":"Выбрать период",onClick:h[0]||(h[0]=_=>o.value=!0)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(Qw,{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"])])}}}),nx={class:"sc-lbl-date text-nowrap"},ix={},Lo=i.defineComponent({...ix,__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(()=>He.format(e.date,j.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>He.format(e.date,"HH:mm"));return(o,s)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",nx,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))}}),rx={},ox=i.defineComponent({...rx,__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)}}),sx={class:"flex flex-row gap-2.5"},ax={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},lx={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},cx={class:"mb-0.5 sm:mb-0 sm:ml-3"},dx={},ux=i.defineComponent({...dx,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=Do,o=z.NButton,s=z.NPopover;return i.openBlock(),i.createElementBlock("div",sx,[i.createElementVNode("div",ax,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",lx,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",cx,[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)])])])])}}}),fx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function hx(t,e){return i.openBlock(),i.createElementBlock("svg",fx,[...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 mx=i.markRaw({name:"ion-checkmark-done-sharp",render:hx}),px={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function gx(t,e){return i.openBlock(),i.createElementBlock("svg",px,[...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 yx=i.markRaw({name:"ion-options-outline",render:gx}),bx={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},_x={class:"flex-auto"},wx={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"},xx={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"},kx={},pa=i.defineComponent({...kx,__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=yx,h=z.NButton,f=z.NPopover,m=mx,p=Do;return i.openBlock(),i.createElementBlock("div",bx,[i.createElementVNode("div",_x,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",wx,[i.createElementVNode("div",xx,[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(m)]),_: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(p)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),vx={},Fu=i.defineComponent({...vx,__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(pa,{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(pa,{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"]))]))}}),Cx={key:0,class:"whitespace-pre-line"},Sx={key:1,class:"text-sc-dark-grey"},Bx={},Tx=i.defineComponent({...Bx,__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=z.NInput;return i.openBlock(),i.createBlock(Fu,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",Cx,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",Sx," - Комментарий отсутствует - "))])]),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"])}}}),Nx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $x(t,e){return i.openBlock(),i.createElementBlock("svg",Nx,[...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 Rx=i.markRaw({name:"ion-download-outline",render:$x}),Ex={},Px=i.defineComponent({...Ex,__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=Rx;return i.openBlock(),i.createBlock(i.unref(z.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(z.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),Fx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vx(t,e){return i.openBlock(),i.createElementBlock("svg",Fx,[...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 Mx=i.markRaw({name:"ion-warning",render:Vx}),Ax={},Ix=i.defineComponent({...Ax,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=Mx,o=z.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"])}}}),Ox={},zx=i.defineComponent({...Ox,__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=D.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(z.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"]))}}),Dx={},Lx=i.defineComponent({...Dx,__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=D.debounce(()=>o("update:value",s.value),a.value),c=m=>{s.value=m,l()};i.watch(()=>r.value,m=>{s.value=m});const d=i.ref(null);return e({focus:()=>{var m;return(m=d.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=d.value)==null?void 0:m.blur()},select:()=>{var m;return(m=d.value)==null?void 0:m.select()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.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:p[0]||(p[0]=g=>o("keydown",g)),onInput:p[1]||(p[1]=g=>o("input",g)),onFocus:p[2]||(p[2]=g=>o("focus",g))},{prefix:i.withCtx(()=>[i.renderSlot(m.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),Hx={},Wx=i.defineComponent({...Hx,__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=D.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(D.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(D.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof br.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=br.parsePhoneNumberWithError(`+${d}`);u.isValid()?o.value=u.format("E.164"):u.getPossibleCountries().length>0&&(o.value=`+${d}`)}catch(u){if(u instanceof br.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(Lh.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"]))}}),jx=An(Wx,[["__scopeId","data-v-751dbb0e"]]),qx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xx(t,e){return i.openBlock(),i.createElementBlock("svg",qx,[...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 Yx=i.markRaw({name:"tabler-external-link",render:Xx}),Ux={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Kx=["href"],Gx={},Zx=i.defineComponent({...Gx,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=Yx,o=z.NTooltip;return i.openBlock(),i.createBlock(o,{disabled:i.unref(D.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Ux,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Kx),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),Qx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Jx(t,e){return i.openBlock(),i.createElementBlock("svg",Qx,[...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 ek=i.markRaw({name:"ion-remove-circle-outline",render:Jx});let Ho=[];const Vu=new WeakMap;function tk(){Ho.forEach(t=>t(...Vu.get(t))),Ho=[]}function Mu(t,...e){Vu.set(t,e),!Ho.includes(t)&&Ho.push(t)===1&&requestAnimationFrame(tk)}function Pr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function Fr(t){return t.composedPath()[0]||null}function Vr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function Mr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function fn(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 Au={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 nk(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 ik(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 Nn="^\\s*",$n="\\s*$",ai="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Kt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Ci="([0-9A-Fa-f])",Si="([0-9A-Fa-f]{2})",Iu=new RegExp(`${Nn}hsl\\s*\\(${Kt},${ai},${ai}\\)${$n}`),Ou=new RegExp(`${Nn}hsv\\s*\\(${Kt},${ai},${ai}\\)${$n}`),zu=new RegExp(`${Nn}hsla\\s*\\(${Kt},${ai},${ai},${Kt}\\)${$n}`),Du=new RegExp(`${Nn}hsva\\s*\\(${Kt},${ai},${ai},${Kt}\\)${$n}`),rk=new RegExp(`${Nn}rgb\\s*\\(${Kt},${Kt},${Kt}\\)${$n}`),ok=new RegExp(`${Nn}rgba\\s*\\(${Kt},${Kt},${Kt},${Kt}\\)${$n}`),sk=new RegExp(`${Nn}#${Ci}${Ci}${Ci}${$n}`),ak=new RegExp(`${Nn}#${Si}${Si}${Si}${$n}`),lk=new RegExp(`${Nn}#${Ci}${Ci}${Ci}${Ci}${$n}`),ck=new RegExp(`${Nn}#${Si}${Si}${Si}${Si}${$n}`);function qt(t){return parseInt(t,16)}function dk(t){try{let e;if(e=zu.exec(t))return[jo(e[1]),li(e[5]),li(e[9]),Ti(e[13])];if(e=Iu.exec(t))return[jo(e[1]),li(e[5]),li(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function uk(t){try{let e;if(e=Du.exec(t))return[jo(e[1]),li(e[5]),li(e[9]),Ti(e[13])];if(e=Ou.exec(t))return[jo(e[1]),li(e[5]),li(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function Bi(t){try{let e;if(e=ak.exec(t))return[qt(e[1]),qt(e[2]),qt(e[3]),1];if(e=rk.exec(t))return[Ct(e[1]),Ct(e[5]),Ct(e[9]),1];if(e=ok.exec(t))return[Ct(e[1]),Ct(e[5]),Ct(e[9]),Ti(e[13])];if(e=sk.exec(t))return[qt(e[1]+e[1]),qt(e[2]+e[2]),qt(e[3]+e[3]),1];if(e=ck.exec(t))return[qt(e[1]),qt(e[2]),qt(e[3]),Ti(qt(e[4])/255)];if(e=lk.exec(t))return[qt(e[1]+e[1]),qt(e[2]+e[2]),qt(e[3]+e[3]),Ti(qt(e[4]+e[4])/255)];if(t in Au)return Bi(Au[t]);if(Iu.test(t)||zu.test(t)){const[n,r,o,s]=dk(t);return[...ik(n,r,o),s]}else if(Ou.test(t)||Du.test(t)){const[n,r,o,s]=uk(t);return[...nk(n,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function fk(t){return t>1?1:t<0?0:t}function ga(t,e,n,r){return`rgba(${Ct(t)}, ${Ct(e)}, ${Ct(n)}, ${fk(r)})`}function ya(t,e,n,r,o){return Ct((t*e*(1-r)+n*r)/o)}function hk(t,e){Array.isArray(t)||(t=Bi(t)),Array.isArray(e)||(e=Bi(e));const n=t[3],r=e[3],o=Ti(n+r-n*r);return ga(ya(t[0],n,e[0],r,o),ya(t[1],n,e[1],r,o),ya(t[2],n,e[2],r,o),o)}function ze(t,e){const[n,r,o,s=1]=Array.isArray(t)?t:Bi(t);return typeof e.alpha=="number"?ga(n,r,o,e.alpha):ga(n,r,o,s)}function Wo(t,e){const[n,r,o,s=1]=Array.isArray(t)?t:Bi(t),{lightness:a=1,alpha:l=1}=e;return mk([n*a,r*a,o*a,s*l])}function Ti(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function jo(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function Ct(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function li(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function mk(t){const[e,n,r]=t;return 3 in t?`rgba(${Ct(e)}, ${Ct(n)}, ${Ct(r)}, ${Ti(t[3])})`:`rgba(${Ct(e)}, ${Ct(n)}, ${Ct(r)}, 1)`}function pk(t=8){return Math.random().toString(16).slice(2,2+t)}function Lu(t){return Array.isArray(t)?t:[t]}const ba={STOP:"STOP"};function Hu(t,e){const n=e(t);t.children!==void 0&&n!==ba.STOP&&t.children.forEach(r=>Hu(r,e))}function gk(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 yk(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function bk(t){return t.children}function _k(t){return t.key}function wk(){return!1}function xk(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function kk(t){return t.disabled===!0}function vk(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function Ck(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function _a(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function wa(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function Sk(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function Bk(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function Tk(t){return(t==null?void 0:t.type)==="group"}function Nk(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 $k extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function Rk(t,e,n,r){return qo(e.concat(t),n,r,!1)}function Ek(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 Pk(t,e,n,r){const o=qo(e,n,r,!1),s=qo(t,n,r,!0),a=Ek(t,n),l=[];return o.forEach(c=>{(s.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>o.delete(c)),o}function xa(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:Sk(n,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:Bk(n,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let h;o!==void 0?h=Pk(o,n,e,d):r!==void 0?h=Rk(r,n,e,d):h=qo(n,e,d,!1);const f=c==="parent",m=c==="child"||l,p=h,g=new Set,y=Math.max.apply(null,Array.from(u.keys()));for(let b=y;b>=0;b-=1){const _=b===0,k=u.get(b);for(const x of k){if(x.isLeaf)continue;const{key:C,shallowLoaded:N}=x;if(m&&N&&x.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&p.has($.key)&&p.delete($.key)}),x.disabled||!N)continue;let w=!0,S=!1,v=!0;for(const $ of x.children){const E=$.key;if(!$.disabled){if(v&&(v=!1),p.has(E))S=!0;else if(g.has(E)){S=!0,w=!1;break}else if(w=!1,S)break}}w&&!v?(f&&x.children.forEach($=>{!$.disabled&&p.has($.key)&&p.delete($.key)}),p.add(C)):S&&g.add(C),_&&m&&p.has(C)&&p.delete(C)}}return{checkedKeys:Array.from(p),indeterminateKeys:Array.from(g)}}function qo(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&&Hu(d,u=>{if(u.disabled)return ba.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),vk(u.rawNode,s))){if(r)return ba.STOP;if(!n)throw new $k}})}),l}function Fk(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 Vk(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function Mk(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 Wu(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const o=e==="prev"?Ak:Mk,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=ka(d,s);u!==null?l=u:c(o(d,n))}else{const u=o(d,!1);if(u!==null)c(u);else{const h=Ik(d);h!=null&&h.isGroup?c(o(h,n)):n&&c(o(d,!0))}}}}return c(t),l}function Ak(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 Ik(t){return t.parent}function ka(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=ka(d,e);if(u!==null)return u}else return d}}return null}const Ok={getChild(){return this.ignored?null:ka(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Wu(this,"next",t)},getPrev(t={}){return Wu(this,"prev",t)}};function zk(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 Dk(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var Lk={};function ju(t,e,n,r,o,s=null,a=0){const l=[];return t.forEach((c,d)=>{var u;Lk.NODE_ENV!=="production"&&Ck(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=ju(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 Hk(t,e={}){var n;const r=new Map,o=new Map,{getDisabled:s=kk,getIgnored:a=wk,getIsGroup:l=Tk,getKey:c=_k}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:bk,u=e.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}: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 yk(this.rawNode,u)},get shallowLoaded(){return xk(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(x){return Dk(this,x)}},Ok),f=ju(t,r,o,h,u);function m(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function p(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function g(x,C){const N=p(x);return N?N.getPrev(C):null}function y(x,C){const N=p(x);return N?N.getNext(C):null}function b(x){const C=p(x);return C?C.getParent():null}function _(x){const C=p(x);return C?C.getChild():null}const k={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(x){return zk(f,x)},getNode:m,getPrev:g,getNext:y,getParent:b,getChild:_,getFirstAvailableNode(){return Vk(f)},getPath(x,C={}){return Fk(x,C,k)},getCheckedKeys(x,C={}){const{cascade:N=!0,leafOnly:w=!1,checkStrategy:S="all",allowNotLoaded:v=!1}=C;return xa({checkedKeys:_a(x),indeterminateKeys:wa(x),cascade:N,leafOnly:w,checkStrategy:S,allowNotLoaded:v},k)},check(x,C,N={}){const{cascade:w=!0,leafOnly:S=!1,checkStrategy:v="all",allowNotLoaded:$=!1}=N;return xa({checkedKeys:_a(C),indeterminateKeys:wa(C),keysToCheck:x==null?[]:Lu(x),cascade:w,leafOnly:S,checkStrategy:v,allowNotLoaded:$},k)},uncheck(x,C,N={}){const{cascade:w=!0,leafOnly:S=!1,checkStrategy:v="all",allowNotLoaded:$=!1}=N;return xa({checkedKeys:_a(C),indeterminateKeys:wa(C),keysToUncheck:x==null?[]:Lu(x),cascade:w,leafOnly:S,checkStrategy:v,allowNotLoaded:$},k)},getNonLeafKeys(x={}){return gk(f,x)}};return k}function Xo(t){return t.composedPath()[0]}const Wk={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function jk(t,e,n){if(t==="mousemoveoutside"){const r=o=>{e.contains(Xo(o))||n(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=a=>{r=!e.contains(Xo(a))},s=a=>{r&&(e.contains(Xo(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 qu(t,e,n){const r=Wk[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=jk(t,e,n)),s}function qk(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=qu(t,e,n);return Object.keys(o).forEach(s=>{Mt(s,document,o[s],r)}),!0}return!1}function Xk(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=qu(t,e,n);return Object.keys(o).forEach(s=>{ft(s,document,o[s],r)}),!0}return!1}function Yk(){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,S,v){const $=w[S];return w[S]=function(){return v.apply(w,arguments),$.apply(w,arguments)},w}function s(w,S){w[S]=Event.prototype[S]}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,S){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:S??l.get})}const u={bubble:{},capture:{}},h={};function f(){const w=function(S){const{type:v,eventPhase:$,bubbles:E}=S,A=Xo(S);if($===2)return;const R=$===1?"capture":"bubble";let F=A;const H=[];for(;F===null&&(F=window),H.push(F),F!==window;)F=F.parentNode||null;const Q=u.capture[v],Z=u.bubble[v];if(o(S,"stopPropagation",n),o(S,"stopImmediatePropagation",r),d(S,c),R==="capture"){if(Q===void 0)return;for(let O=H.length-1;O>=0&&!t.has(S);--O){const P=H[O],V=Q.get(P);if(V!==void 0){a.set(S,P);for(const M of V){if(e.has(S))break;M(S)}}if(O===0&&!E&&Z!==void 0){const M=Z.get(P);if(M!==void 0)for(const L of M){if(e.has(S))break;L(S)}}}}else if(R==="bubble"){if(Z===void 0)return;for(let O=0;O<H.length&&!t.has(S);++O){const P=H[O],V=Z.get(P);if(V!==void 0){a.set(S,P);for(const M of V){if(e.has(S))break;M(S)}}}}s(S,"stopPropagation"),s(S,"stopImmediatePropagation"),d(S)};return w.displayName="evtdUnifiedHandler",w}function m(){const w=function(S){const{type:v,eventPhase:$}=S;if($!==2)return;const E=h[v];E!==void 0&&E.forEach(A=>A(S))};return w.displayName="evtdUnifiedWindowEventHandler",w}const p=f(),g=m();function y(w,S){const v=u[w];return v[S]===void 0&&(v[S]=new Map,window.addEventListener(S,p,w==="capture")),v[S]}function b(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,g)),h[w]}function _(w,S){let v=w.get(S);return v===void 0&&w.set(S,v=new Set),v}function k(w,S,v,$){const E=u[S][v];if(E!==void 0){const A=E.get(w);if(A!==void 0&&A.has($))return!0}return!1}function x(w,S){const v=h[w];return!!(v!==void 0&&v.has(S))}function C(w,S,v,$){let E;if(typeof $=="object"&&$.once===!0?E=Q=>{N(w,S,E,$),v(Q)}:E=v,qk(w,S,E,$))return;const R=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",F=y(R,w),H=_(F,S);if(H.has(E)||H.add(E),S===window){const Q=b(w);Q.has(E)||Q.add(E)}}function N(w,S,v,$){if(Xk(w,S,v,$))return;const A=$===!0||typeof $=="object"&&$.capture===!0,R=A?"capture":"bubble",F=y(R,w),H=_(F,S);if(S===window&&!k(S,A?"bubble":"capture",w,v)&&x(w,v)){const Z=h[w];Z.delete(v),Z.size===0&&(window.removeEventListener(w,g),h[w]=void 0)}H.has(v)&&H.delete(v),H.size===0&&F.delete(S),F.size===0&&(window.removeEventListener(w,p,R==="capture"),u[R][w]=void 0)}return{on:C,off:N}}const{on:Mt,off:ft}=Yk(),lr="@@mmoContext",Uk={mounted(t,{value:e}){t[lr]={handler:void 0},typeof e=="function"&&(t[lr].handler=e,Mt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[lr];typeof e=="function"?n.handler?n.handler!==e&&(ft("mousemoveoutside",t,n.handler),n.handler=e,Mt("mousemoveoutside",t,e)):(t[lr].handler=e,Mt("mousemoveoutside",t,e)):n.handler&&(ft("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[lr];e&&ft("mousemoveoutside",t,e),t[lr].handler=void 0}},cr="@@coContext",Yo={mounted(t,{value:e,modifiers:n}){t[cr]={handler:void 0},typeof e=="function"&&(t[cr].handler=e,Mt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[cr];typeof e=="function"?r.handler?r.handler!==e&&(ft("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Mt("clickoutside",t,e,{capture:n.capture})):(t[cr].handler=e,Mt("clickoutside",t,e,{capture:n.capture})):r.handler&&(ft("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[cr];n&&ft("clickoutside",t,n,{capture:e.capture}),t[cr].handler=void 0}};function Kk(t,e){console.error(`[vdirs/${t}]: ${e}`)}class Gk{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&&Kk("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 va=new Gk,dr="@@ziContext",Xu={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n;t[dr]={enabled:!!o,initialized:!1},o&&(va.ensureZIndex(t,r),t[dr].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n,s=t[dr].enabled;o&&!s&&(va.ensureZIndex(t,r),t[dr].initialized=!0),t[dr].enabled=!!o},unmounted(t,e){if(!t[dr].initialized)return;const{value:n={}}=e,{zIndex:r}=n;va.unregister(t,r)}};function Zk(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 rn(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 Qk=typeof window<"u";let ur,Ar;(()=>{var t,e;ur=Qk?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,Ar=!1,ur!==void 0?ur.then(()=>{Ar=!0}):Ar=!0})();function Jk(t){if(Ar)return;let e=!1;i.onMounted(()=>{Ar||ur==null||ur.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Ca(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function Uo(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function Yu(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 ev=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function tv(){return ev}function Sa(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Ba(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)){Ba(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Ba(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Uu(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const o=Ba(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let ci=null;function Ku(){if(ci===null&&(ci=document.getElementById("v-binder-view-measurer"),ci===null)){ci=document.createElement("div"),ci.id="v-binder-view-measurer";const{style:t}=ci;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(ci)}return ci.getBoundingClientRect()}function nv(t,e){const n=Ku();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=Ku();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 iv(t){return t.nodeType===9?null:t.parentNode}function Gu(t){if(t===null)return null;const e=iv(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 Gu(e)}const Zu=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=b=>{r.value=b,n&&t.syncTargetWithParent&&n.setTargetRef(b)};let s=[];const a=()=>{let b=r.value;for(;b=Gu(b),b!==null;)s.push(b);for(const _ of s)Mt("scroll",_,h,!0)},l=()=>{for(const b of s)ft("scroll",b,h,!0);s=[]},c=new Set,d=b=>{c.size===0&&a(),c.has(b)||c.add(b)},u=b=>{c.has(b)&&c.delete(b),c.size===0&&l()},h=()=>{Mu(f)},f=()=>{c.forEach(b=>b())},m=new Set,p=b=>{m.size===0&&Mt("resize",window,y),m.has(b)||m.add(b)},g=b=>{m.has(b)&&m.delete(b),m.size===0&&ft("resize",window,y)},y=()=>{m.forEach(b=>b())};return i.onBeforeUnmount(()=>{ft("resize",window,y),l()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:p,removeResizeListener:g}},render(){return Sa("binder",this.$slots)}}),Qu=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(Uu("follower",this.$slots),[[e]]):Uu("follower",this.$slots)}}),rv="@css-render/vue3-ssr";function ov(t,e){return`<style cssr-id="${t}">
|
|
103
|
+
`}},Co=wi.Multiply,Sy=[1,0,0,0,1,0,0,0,1],si=new _n(9),By=vt.Utils,rd=new re,Ks=new _n([0,0,1,0,0,1,0,1,1,0,1,1]),Ce={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Ue.document?Ue.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new wi,group:{removeChild:function(t,e){if(t.children)for(let n=0;n<t.children.length;n++)Ce.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;oe.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 _n(9)),this._matrix.toTransformArray(!0,si),Co(si,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=vt.Utils.getRendererType(this._mask._renderer.type);Ce[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++)Ce.group.removeChild(this.subtractions[s],t);for(s=0;s<this.children.length;s++){const a=this.children[s],l=vt.Utils.getRendererType(a._renderer.type);Ce[l].render.call(a,t,e)}return this._mask&&t.disable(t.STENCIL_TEST),oe.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,m,p,g;const y=e._renderer.vertices,b=this.canvas,_=this.ctx,k=t.renderer.ratio,x=rd.copy(e._renderer.scale).multiply(k),C=e._stroke,N=e._linewidth,w=e._fill,S=e._renderer.opacity||e._opacity,v=e._cap,$=e._join,E=e._miter,A=e._closed,R=e.dashes,F=y.length,H=F-1;b.width=Math.max(Math.ceil(e._renderer.rect.width*x.x),1),b.height=Math.max(Math.ceil(e._renderer.rect.height*x.y),1);const Q=e._renderer.rect.centroid,Z=Q.x,O=Q.y;if(_.clearRect(0,0,b.width,b.height),w)if(typeof w=="string")_.fillStyle=w;else{const W=vt.Utils.getRendererType(w._renderer.type);Ce[W].render.call(w,_,e),_.fillStyle=w._renderer.effect}if(C){if(typeof C=="string")_.strokeStyle=C;else{const W=vt.Utils.getRendererType(C._renderer.type);Ce[W].render.call(C,_,e),_.strokeStyle=C._renderer.effect}N&&(_.lineWidth=wn(e)),E&&(_.miterLimit=E),$&&(_.lineJoin=$),!A&&v&&(_.lineCap=v)}typeof S=="number"&&(_.globalAlpha=S),R&&R.length>0&&(_.lineDashOffset=R.offset||0,_.setLineDash(R));let P,V,M,L,Y,U,G,q;_.save(),_.scale(x.x,x.y),_.translate(Z,O),_.beginPath();for(let W=0;W<y.length;W++){const K=y[W];switch(m=K.x,p=K.y,K.command){case ie.close:_.closePath();break;case ie.arc:V=K.rx,M=K.ry,L=K.xAxisRotation,Y=K.largeArcFlag,U=K.sweepFlag,n=A?rt(W-1,F):Math.max(W-1,0),r=y[n],G=r.x,q=r.y,By.renderSvgArcCommand(_,G,q,V,M,Y,U,L,m,p);break;case ie.curve:n=A?rt(W-1,F):Math.max(W-1,0),r=y[n],d=r.controls&&r.controls.right||re.zero,u=K.controls&&K.controls.left||re.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),K._relative?(s=u.x+K.x,a=u.y+K.y):(s=u.x,a=u.y),_.bezierCurveTo(l,c,s,a,m,p),W>=H&&A&&(o=P,h=K.controls&&K.controls.right||re.zero,f=o.controls&&o.controls.left||re.zero,K._relative?(l=h.x+K.x,c=h.y+K.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),m=o.x,p=o.y,_.bezierCurveTo(l,c,s,a,m,p));break;case ie.line:_.lineTo(m,p);break;case ie.move:P=K,_.moveTo(m,p);break}}A&&_.closePath(),Ce.isHidden.test(w)||(g=w._renderer&&w._renderer.offset,g&&(_.save(),_.translate(-w._renderer.offset.x,-w._renderer.offset.y),_.scale(w._renderer.scale.x,w._renderer.scale.y)),_.fill(),g&&_.restore()),Ce.isHidden.test(C)||(g=C._renderer&&C._renderer.offset,g&&(_.save(),_.translate(-C._renderer.offset.x,-C._renderer.offset.y),_.scale(C._renderer.scale.x,C._renderer.scale.y),_.lineWidth=N/C._renderer.scale.x),_.stroke(),g&&_.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 m,p,g,y,b,_;s=Math.min(h,s),r=Math.min(u,r),o=Math.max(u,o),a=Math.max(h,a),d.controls&&(b=f.left,_=f.right,!(!b||!_)&&(m=d._relative?b.x+u:b.x,p=d._relative?b.y+h:b.y,g=d._relative?_.x+u:_.x,y=d._relative?_.y+h:_.y,!(!m||!p||!g||!y)&&(s=Math.min(p,y,s),r=Math.min(m,g,r),o=Math.max(m,g,o),a=Math.max(p,y,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;oe.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=n||this.parent,o=vt.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 Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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 _n(9)),this._matrix.toTransformArray(!0,si),Co(si,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=vt.Utils.getRendererType(this._mask._renderer.type);Ce[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,Ce.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),Ce.updateTexture.call(Ce,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,Ks,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),oe.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;Ce.isHidden.test(a)||(f+=l),r.width=jl(f),r.height=r.width;const m=f/r.width,p=r.width/2,g=r.height/2;if(o.clearRect(0,0,r.width,r.height),c)if(typeof c=="string")o.fillStyle=c;else{const y=vt.Utils.getRendererType(c._renderer.type);Ce[y].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")o.strokeStyle=a;else{const y=vt.Utils.getRendererType(a._renderer.type);Ce[y].render.call(a,o,e),o.strokeStyle=a._renderer.effect}l&&(o.lineWidth=wn(e)/m)}typeof d=="number"&&(o.globalAlpha=d),u&&u.length>0&&(o.lineDashOffset=u.offset||0,o.setLineDash(u)),o.save(),o.translate(p,g),o.scale(Ce.precision,Ce.precision),o.beginPath(),o.arc(0,0,h/m*.5,0,tt),o.restore(),closed&&o.closePath(),Ce.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()),Ce.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;oe.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,m=this._renderer.collection.length,p=this._flagVertices,g=this._flagFill||this._fill instanceof Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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 _n(9)),this._matrix.toTransformArray(!0,si),Co(si,o._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof re||(this._renderer.scale=new re);let y,b;this._scale instanceof re?(y=this._scale.x*o._renderer.scale.x,b=this._scale.y*o._renderer.scale.y):(y=this._scale*o._renderer.scale.x,b=this._scale*o._renderer.scale.y),this._renderer.scale.x=y<0?-y:y,this._renderer.scale.y=b<0?-b:b,h&&(this._renderer.parent=o)}if(p){const y=this._renderer.positionBuffer;y&&t.deleteBuffer(y),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 g?(this._renderer.opacity=this._opacity*o._renderer.opacity,Ce.updateTexture.call(Ce,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:(Ce.isHidden.test(l)||(r+=c),r/=Ce.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,m),oe.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=rd.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 m=e._renderer.rect.centroid,p=m.x,g=m.y;let y,b,_,k,x,C,N,w,S,v,$;const E=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,n.width,n.height),E||(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 A=vt.Utils.getRendererType(c._renderer.type);Ce[A].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const A=vt.Utils.getRendererType(a._renderer.type);Ce[A].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=wn(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(p,g),Ce.isHidden.test(c)||(c._renderer&&c._renderer.offset?(C=c._renderer.scale.x,N=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(C,N),y=e._size/c._renderer.scale.y,b=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,k=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,k),r.restore()):r.fillText(e.value,0,0)),Ce.isHidden.test(a)||(a._renderer&&a._renderer.offset?(C=a._renderer.scale.x,N=a._renderer.scale.y,r.save(),r.translate(-a._renderer.offset.x,-a._renderer.offset.y),r.scale(C,N),y=e._size/a._renderer.scale.y,b=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,y+"px/",b+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,k=a._renderer.offset.y/a._renderer.scale.y,x=l/a._renderer.scale.x,r.lineWidth=x,r.strokeText(e.value,_,k),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(h)){const A=r.measureText(e.value);switch(h){case"underline":S=A.actualBoundingBoxDescent,$=A.actualBoundingBoxDescent;break;case"strikethrough":S=0,$=0;break}w=-A.width/2,v=A.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(w,S),r.lineTo(v,$),r.stroke()}r.restore()},getBoundingClientRect:function(t,e){const n=Ce.ctx;n.font=[t._style,t._weight,t._size+"px/"+t._leading+"px",t._family].join(" "),n.textAlign="center",n.textBaseline=vt.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&&!Ce.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const a=o/2,l=s/2;switch(Ce.alignments[t._alignment]||t._alignment){case Ce.alignments.left:t.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case Ce.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;oe.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 Ke&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof Ge&&(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 Ke&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof Ge&&(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 _n(9)),this._matrix.toTransformArray(!0,si),Co(si,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=vt.Utils.getRendererType(this._mask._renderer.type);Ce[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,Ce.text.getBoundingClientRect(this,this._renderer.rect),Ce.updateTexture.call(Ce,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,Ks,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),oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(t,e){if(!(!t.canvas.getContext("2d")||!e)){if(oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(t,e){if(!t.canvas.getContext("2d"))return;oe.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 oe.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(t,e){const n=vt.Utils.getRendererType(e._renderer.type);if(this[n].updateCanvas.call(Ce,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(),oe.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 Dt("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]=Ce.extensions.get(t,o)}return e},get:function(t,e){return t.getExtension(e)||t.getExtension(`MOZ_${e}`)||t.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new ro};Ce.ctx=Ce.canvas.getContext("2d");var od=class extends ee{constructor(t){super();let e,n,r,o;if(this.domElement=t.domElement||document.createElement("canvas"),typeof t.offscreenElement<"u"&&(Ce.canvas=t.offscreenElement,Ce.ctx=Ce.canvas.getContext("2d")),this.scene=new mt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new _n(Sy),scale:1,opacity:1},this._flagMatrix=!0,t=oe.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 Dt("unable to create a webgl context. Try using another renderer.");r=nn.create(e,nn.path.vertex,nn.types.vertex),o=nn.create(e,nn.path.fragment,nn.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=Ce.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=Ce.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,Ks,e.STATIC_DRAW),r=nn.create(e,nn.points.vertex,nn.types.vertex),o=nn.create(e,nn.points.fragment,nn.types.fragment),n=this.programs.points=Ce.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"?vs(s):n,this.domElement.width=t*this.ratio,this.domElement.height=e*this.ratio,oe.isObject(this.domElement.style)&&oe.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(ee.Types.resize,t,e,n)}render(){const t=this.ctx;return this.overdraw||t.clear(t.COLOR_BUFFER_BIT),Ce.group.render.call(this.scene,t,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};B(od,"Utils",Ce);var Ty=oe.extend({Error:Dt,getRatio:vs,read:Ye,xhr:Qc},oe,Et,Dl,Ll),Be=class Qr{constructor(e){B(this,"_events",new ee),B(this,"type",""),B(this,"renderer",null),B(this,"scene",null),B(this,"width",0),B(this,"height",0),B(this,"frameCount",0),B(this,"timeDelta",0),B(this,"playing",!1);const n=oe.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:Qr.Types.svg,autostart:!1});if(oe.each(n,function(r,o){/fullscreen/i.test(o)||/autostart/i.test(o)||(this[o]=r)},this),oe.isElement(n.domElement)){const r=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=Qr.Types[r])}this.renderer=new Qr[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=Ny.bind(this),this.fit.domElement=window,this.fit.attached=!0,oe.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),oe.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),Yt.bind(this.fit.domElement,"resize",this.fit),this.fit()):n.fitted?(this.fit=$y.bind(this),oe.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(ee.Types.resize,Ry.bind(this)),this.scene=this.renderer.scene,Qr.Instances.push(this),n.autostart&&Nr.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}on(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}bind(){var e;return(e=this._events.addEventListener)==null?void 0:e.apply(this,arguments)}removeEventListener(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}off(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}unbind(){var e;return(e=this._events.removeEventListener)==null?void 0:e.apply(this,arguments)}dispatchEvent(){var e;return(e=this._events.dispatchEvent)==null?void 0:e.apply(this,arguments)}trigger(){var e;return(e=this._events.dispatchEvent)==null?void 0:e.apply(this,arguments)}listen(){var e;return(e=this._events.listen)==null?void 0:e.apply(this,arguments)}ignore(){var e;return(e=this._events.ignore)==null?void 0:e.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,Nr.init(),this.trigger(ee.Types.play)}pause(){return this.playing=!1,this.trigger(ee.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"&&typeof e.fill.unbind=="function"&&e.fill.unbind(),typeof e.stroke=="object"&&typeof e.stroke.unbind=="function"&&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}getShapesAtPoint(e,n,r){return this.scene&&typeof this.scene.getShapesAtPoint=="function"?this.scene.getShapesAtPoint(e,n,r):[]}update(){const e=!!this._lastFrame,n=oe.performance.now();e&&(this.timeDelta=parseFloat((n-this._lastFrame).toFixed(3))),this._lastFrame=n,this.fit&&this.fit.domElement&&!this.fit.attached&&(Yt.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(ee.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(ee.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 _o(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 Ne(e,n,void 0,void 0,void 0,void 0,ie.move),new Ne(r,o,void 0,void 0,void 0,void 0,ie.line),new Ne(r-a*Math.cos(l-Math.PI/4),o-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ie.line),new Ne(r,o,void 0,void 0,void 0,void 0,ie.move),new Ne(r-a*Math.cos(l+Math.PI/4),o-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ie.line)],d=new Re(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 oi(e,n,r,o);return this.scene.add(s),s}makeRoundedRectangle(e,n,r,o,s){const a=new go(e,n,r,o,s);return this.scene.add(a),a}makeCircle(e,n,r,o){const s=new mo(e,n,r,o);return this.scene.add(s),s}makeEllipse(e,n,r,o,s){const a=new po(e,n,r,o,s);return this.scene.add(a),a}makeStar(e,n,r,o,s){const a=new Ds(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 Ne(l,c))}}const r=arguments[n-1],o=new Re(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 zs(e,n,r,o);return this.scene.add(s),s}makeArcSegment(e,n,r,o,s,a,l){const c=new Fs(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 Os(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 Ne(c,d))}}const o=arguments[n-1],s=new Re(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 xn(e,n,r,o);return this.add(s),s}makeLinearGradient(e,n,r,o){const s=Array.prototype.slice.call(arguments,4),a=new Ke(e,n,r,o,s);return this.add(a),a}makeRadialGradient(e,n,r){const o=Array.prototype.slice.call(arguments,3),s=new Ge(e,n,r,o);return this.add(s),s}makeSprite(e,n,r,o,s,a,l){const c=new ho(e,n,r,o,s,a);return l&&c.play(),this.add(c),c}makeImage(e,n,r,o,s,a){const l=new Jc(e,n,r,o,s,a);return this.add(l),l}makeImageSequence(e,n,r,o,s){const a=new js(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 mt;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 Ye))return null;const s=Ye[o].call(this,e);return r?this.add(n&&s instanceof mt?s.children:s):s.parent&&s.remove(),s}load(e,n){const r=new mt;let o,s,a;const l=(function(c){for(Yt.temp.innerHTML=c,s=0;s<Yt.temp.children.length;s++)o=Yt.temp.children[s],a=this.interpret(o,!1,!1),a!==null&&r.add(a);if(typeof n=="function"){const d=Yt.temp.children.length<=1?Yt.temp.children[0]:Yt.temp.children;n(r,d)}}).bind(this);return/\.svg$/i.test(e)?(Qc(e,l),r):(l(e),r)}};B(Be,"NextFrameId",xt.NextFrameId),B(Be,"Types",xt.Types),B(Be,"Version",xt.Version),B(Be,"PublishDate",xt.PublishDate),B(Be,"Identifier",xt.Identifier),B(Be,"Resolution",xt.Resolution),B(Be,"AutoCalculateImportedMatrices",xt.AutoCalculateImportedMatrices),B(Be,"Instances",xt.Instances),B(Be,"uniqueId",xt.uniqueId),B(Be,"Anchor",Ne),B(Be,"Collection",ii),B(Be,"Events",ee),B(Be,"Group",mt),B(Be,"Matrix",wi),B(Be,"Path",Re),B(Be,"Registry",ro),B(Be,"Element",Gi),B(Be,"Shape",On),B(Be,"Text",xn),B(Be,"Vector",re),B(Be,"Gradient",dt),B(Be,"Image",Jc),B(Be,"ImageSequence",js),B(Be,"LinearGradient",Ke),B(Be,"RadialGradient",Ge),B(Be,"Sprite",ho),B(Be,"Stop",ri),B(Be,"Texture",Oe),B(Be,"ArcSegment",Fs),B(Be,"Circle",mo),B(Be,"Ellipse",po),B(Be,"Line",_o),B(Be,"Points",Os),B(Be,"Polygon",zs),B(Be,"Rectangle",oi),B(Be,"RoundedRectangle",go),B(Be,"Star",Ds),B(Be,"CanvasRenderer",vt),B(Be,"SVGRenderer",id),B(Be,"WebGLRenderer",od),B(Be,"Commands",ie),B(Be,"Utils",Ty);var vn=Be;function Ny(){const t=document.body.getBoundingClientRect(),e=this.width=t.width,n=this.height=t.height;this.renderer.setSize(e,n,this.ratio)}function $y(){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 Ry(t,e){this.width=t,this.height=e,this.trigger(ee.Types.resize,t,e)}var Nr=Yt.getRequestAnimationFrame();function sd(){for(let t=0;t<vn.Instances.length;t++){const e=vn.Instances[t];e.playing&&e.update()}vn.NextFrameId=Nr(sd)}Nr.init=function(){sd(),Nr.init=function(){}};let Cn;typeof window<"u"?Cn=window:typeof global<"u"?Cn=global:typeof self<"u"&&(Cn=self);let ad;const Ut=Math.PI*2,pt=Math.PI*.5;function Ey(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 Py(t){ad=t}function Fy(t,e){e=e&&e.identity()||new ad;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 Ht(t,e,n){return n*(e-t)+t}function Wt(t,e){for(;t<0;)t+=e;return t%e}const ld=Cn.Float32Array||Array,Vy=Math.floor;function Sn(t){return Vy(t*1e6)/1e6}const de={move:"M",line:"L",curve:"C",arc:"A",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 cd={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))}}},bt=class bt extends ne{constructor(n=0,r=0){super();T(this,"_x",0);T(this,"_y",0);for(let o in cd)Object.defineProperty(this,o,cd[o]);this.x=n,this.y=r}static add(n,r){return new bt(n.x+r.x,n.y+r.y)}static sub(n,r){return new bt(n.x-r.x,n.y-r.y)}static subtract(n,r){return bt.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(bt.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 bt(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:Sn(this.x),y:Sn(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(bt,"zero",new bt),T(bt,"left",new bt(-1,0)),T(bt,"right",new bt(1,0)),T(bt,"up",new bt(0,-1)),T(bt,"down",new bt(0,1));let me=bt;class Me extends me{constructor(n=0,r=0,o=0,s=0,a=0,l=0,c=de.move){super(n,r);T(this,"controls",{left:new me,right:new me});T(this,"_command",de.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 dd)Object.defineProperty(this,u,dd[u]);this.command=c,this.relative=!0;const d=Me.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 Me().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 Me().copy(this)}toObject(){return{x:Sn(this.x),y:Sn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Sn(this.rx),ry:Sn(this.ry),xAxisRotation:Sn(this.xAxisRotation),largeArcFlag:Sn(this.largeArcFlag),sweepFlag:Sn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const dd={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 My=0;const So={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return My++}},Bo={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 To(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 ud(t,e,n,r,o,s,a,l,c){c=c||Bo.RecursionLimit;const d=c+1;if(Math.abs(t-a)<.001&&Math.abs(e-l)<.001)return[new Me(a,l)];const u=[];for(let h=0;h<d;h++){const f=h/d,m=To(f,t,n,o,a),p=To(f,e,r,s,l);u.push(new Me(m,p))}return u}function Ay(t,e,n,r,o,s,a,l,c){if(t===n&&e===r&&o===a&&s===l){const y=a-t,b=l-e;return Math.sqrt(y*y+b*b)}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),m=6*(e+s)-12*r,p=3*(r-e);function g(y){const b=(d*y+u)*y+h,_=(f*y+m)*y+p;return Math.sqrt(b*b+_*_)}return Oy(g,0,1,c||Bo.RecursionLimit)}function Iy(t,e,n,r,o,s,a,l){const c=[],d=[[],[]];let u,h,f,m,p,g,y,b;for(let C=0;C<2;++C){if(C===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;m=-f/h,0<m&&m<1&&c.push(m);continue}y=h*h-4*f*u,b=Math.sqrt(y),!(y<0)&&(p=(-h+b)/(2*u),0<p&&p<1&&c.push(p),g=(-h-b)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,k=_,x;for(;_--;)m=c[_],x=1-m,d[0][_]=x*x*x*t+3*x*x*m*n+3*x*m*m*o+m*m*m*a,d[1][_]=x*x*x*e+3*x*x*m*r+3*x*m*m*s+m*m*m*l;return d[0][k]=t,d[1][k]=e,d[0][k+1]=a,d[1][k+1]=l,d[0].length=d[1].length=k+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 Oy(t,e,n,r){let o=Bo.abscissas[r-2],s=Bo.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 zy(t,e){const n=t.length,r=n-1;for(let o=0;o<n;o++){const s=t[o],a=e?Wt(o-1,n):Math.max(o-1,0),l=e?Wt(o+1,n):Math.min(o+1,r),c=t[a],d=s,u=t[l];Dy(c,d,u),d.command=o===0?de.move:de.curve}}function Dy(t,e,n){const r=me.angleBetween(t,e),o=me.angleBetween(n,e);let s=me.distanceBetween(t,e),a=me.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+=pt:l-=pt,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 $r=(Ai=class extends ne{constructor(){super();T(this,"_flagId",!1);T(this,"_flagClassName",!1);T(this,"_renderer",{});T(this,"_id",So.Identifier+So.uniqueId());T(this,"_className","");T(this,"classList",[]);for(let n in fd)Object.defineProperty(this,n,fd[n])}static fromObject(n){const r=new Ai().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(){if(typeof this.unbind=="function"&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type==="WebGLRenderer"&&this.renderer.ctx){const r=this.renderer.ctx;this._renderer.texture&&(r.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(r.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type==="CanvasRenderer"&&this._renderer.context&&delete this._renderer.context}const n=this._renderer.type;return this._renderer={type:n},this}},T(Ai,"Properties",["renderer","id","className"]),Ai);const fd={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 No extends Error{constructor(n){super();T(this,"name","Two.js");T(this,"message");this.message=n}}class Ly{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 $o;const hd={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Cn.document&&($o=document.createElement("a"));const Qe=class Qe extends $r{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 md)Object.defineProperty(this,o,md[o]);if(this._renderer.type="texture",this._renderer.flagOffset=Hy.bind(this),this._renderer.flagScale=Wy.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new me,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 Qe().copy(n);return"id"in n&&(r.id=n.id),r}static getAbsoluteURL(n){return $o?($o.href=n,$o.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=Qe.getAbsoluteURL(n);if(Qe.ImageRegistry.contains(r))return Qe.ImageRegistry.get(r);let o;return Cn.document?hd.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=Qe.getTag(o);n._flagImage&&(/canvas/i.test(s)?Qe.Register.canvas(n,r):(n._src=o.getAttribute("two-src")||o.src,Qe.Register[s](n,r))),n._flagSrc&&(o||(o=Qe.getImage(n.src),n.image=o),s=Qe.getTag(o),Qe.Register[s](n,r))}clone(){const n=new Qe(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 me?n.offset:new me().copy(n.offset),this.scale=typeof n.scale=="number"||n.scale instanceof me?n.scale:new me().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,Qe.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(Qe,"Properties",["src","loaded","repeat","scale","offset","image"]),T(Qe,"RegularExpressions",hd),T(Qe,"ImageRegistry",new Ly),T(Qe,"Register",{canvas:function(n,r){n._src="#"+n.id,Qe.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 No("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=Qe.getAbsoluteURL(n._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",n.src),Qe.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 No("unable to load "+n.src)};n._src=Qe.getAbsoluteURL(n._src),n.image.getAttribute("two-src")||(n.image.setAttribute("two-src",n.src),Qe.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 Ze=Qe;const md={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=Ze.getTag(t);let n;switch(e){case"canvas":n="#"+t.id;break;default:n=t.src}Ze.ImageRegistry.contains(n)?this._image=Ze.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 me&&this._scale.unbind(ne.Types.change,this._renderer.flagScale),this._scale=t,this._scale instanceof me&&this._scale.bind(ne.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Hy(){this._flagOffset=!0}function Wy(){this._flagScale=!0}class xi extends Array{constructor(){super();yl(this,_t,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 Ot(this,_t)}set _events(n){zh(this,_t,n)}get _bound(){return Ot(this,_t)._bound}set _bound(n){Ot(this,_t)._bound=n}addEventListener(){var n;return(n=Ot(this,_t).addEventListener)==null?void 0:n.apply(this,arguments)}on(){var n;return(n=Ot(this,_t).on)==null?void 0:n.apply(this,arguments)}bind(){var n;return(n=Ot(this,_t).bind)==null?void 0:n.apply(this,arguments)}removeEventListener(){var n;return(n=Ot(this,_t).removeEventListener)==null?void 0:n.apply(this,arguments)}off(){var n;return(n=Ot(this,_t).off)==null?void 0:n.apply(this,arguments)}unbind(){var n;return(n=Ot(this,_t).unbind)==null?void 0:n.apply(this,arguments)}dispatchEvent(){var n;return(n=Ot(this,_t).dispatchEvent)==null?void 0:n.apply(this,arguments)}trigger(){var n;return(n=Ot(this,_t).trigger)==null?void 0:n.apply(this,arguments)}listen(){var n;return(n=Ot(this,_t).listen)==null?void 0:n.apply(this,arguments)}ignore(){var n;return(n=Ot(this,_t).ignore)==null?void 0:n.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}}_t=new WeakMap;const pd=Array.prototype.slice;function jy(t){if(t==null)return!1;const e=t.length;return typeof e=="number"&&e>=0&&e<4294967296}const je={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=pd.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=pd.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=!jy(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:Cn.performance&&Cn.performance.now?Cn.performance:Date},Xt=class Xt extends $r{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 gd)Object.defineProperty(this,s,gd[s]);this._renderer.type="stop",this.offset=typeof n=="number"?n:Xt.Index<=0?0:1,this.opacity=typeof o=="number"?o:1,this.color=typeof r=="string"?r:Xt.Index<=0?"#fff":"#000",Xt.Index=(Xt.Index+1)%2}static fromObject(n){const r=new Xt().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Xt.Properties.length;r++){const o=Xt.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new Xt;return je.each(Xt.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",je.each(Xt.Properties,r=>{n[r]=this[r]},this),n}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};T(Xt,"Index",0),T(Xt,"Properties",["offset","opacity","color"]);let ki=Xt;const gd={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)}}},En=class En extends $r{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 yd)Object.defineProperty(this,r,yd[r]);this._renderer.type="gradient",this._renderer.flagStops=qy.bind(this),this._renderer.bindStops=Xy.bind(this),this._renderer.unbindStops=Yy.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 ki?s:new ki().copy(s)));const o=new En(r).copy(n);return"id"in n&&(o.id=n.id),o}clone(n){const r=this.stops.map(s=>s.clone()),o=new En(r);return je.each(En.Properties,s=>{o[s]=this[s]},this),n&&n.add(o),o}copy(n){super.copy.call(this,n);for(let r=0;r<En.Properties.length;r++){const o=En.Properties[r];o in n&&(this[o]=n[o])}return this}toObject(){const n={stops:this.stops.map(r=>r.toObject())};return je.each(En.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(En,"Stop",ki),T(En,"Properties",["spread","stops","units"]);let ut=En;const yd={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 xi((t||[]).slice(0)),this._stops.bind(ne.Types.insert,e).bind(ne.Types.remove,n),e(this._stops)}}};function qy(){this._flagStops=!0}function Xy(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagStops),t[e].parent=this;this._renderer.flagStops()}function Yy(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagStops),delete t[e].parent;this._renderer.flagStops()}const fi=class fi extends ut{constructor(n,r,o,s,a){super(a);T(this,"_flagEndPoints",!1);T(this,"_left",null);T(this,"_right",null);for(let l in bd)Object.defineProperty(this,l,bd[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=Uy.bind(this),this.left=new me,this.right=new me,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 fi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<fi.Properties.length;r++){const o=fi.Properties[r];o in n&&(this[o]=n[o]instanceof me?n[o]:new me().copy(n[o]))}return this}clone(n){const r=this.stops.map(function(s){return s.clone()}),o=new fi(this.left._x,this.left._y,this.right._x,this.right._y,r);return je.each(ut.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(fi,"Stop",ki),T(fi,"Properties",["left","right"]);let Ft=fi;const bd={left:{enumerable:!0,get:function(){return this._left},set:function(t){this._left instanceof me&&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 me&&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 Uy(){this._flagEndPoints=!0}const Pn=class Pn extends ut{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 _d)Object.defineProperty(this,c,_d[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=Ky.bind(this),this._renderer.flagFocal=Gy.bind(this),this.center=new me,this.radius=typeof o=="number"?o:1,this.focal=new me,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 Pn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Pn.Properties.length;r++){const o=Pn.Properties[r];o in n&&(/(center|focal)i/.test(o)?this[o]=n[o]instanceof me?n[o]:new me().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 Pn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return je.each(ut.Properties.concat(Pn.Properties),function(s){o[s]=this[s]},this),n&&n.add(o),o}toObject(){const n=super.toObject.call(this);return je.each(Pn.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(Pn,"Stop",ki),T(Pn,"Properties",["center","radius","focal"]);let Vt=Pn;const _d={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 Ky(){this._flagCenter=!0}function Gy(){this._flagFocal=!0}function wd(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 Ro(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 xd(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),Ay(r,l,o,c,s,d,a,u,n)}function Gs(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),ud(r,l,o,c,s,d,a,u,n)}function vi(t){switch(t.renderer.type){case"texture":return Ze.fromObject(t);case"gradient":return ut.fromObject(t);case"linear-gradient":return Ft.fromObject(t);case"radial-gradient":return Vt.fromObject(t)}return t}const Zy=Math.cos,Qy=Math.sin,kd=Math.tan,Zs=[],At=class At extends ne{constructor(n,r,o,s,a,l){super();T(this,"elements",new ld(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 S,v,$;const E=r[0]||0,A=r[1]||0,R=r[2]||0;return S=w[0]*E+w[1]*A+w[2]*R,v=w[3]*E+w[4]*A+w[5]*R,$=w[6]*E+w[7]*A+w[8]*R,[S,v,$]}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],m=n[8],p=r[0],g=r[1],y=r[2],b=r[3],_=r[4],k=r[5],x=r[6],C=r[7],N=r[8];return o=o||new ld(9),o[0]=s*p+a*b+l*x,o[1]=s*g+a*_+l*C,o[2]=s*y+a*k+l*N,o[3]=c*p+d*b+u*x,o[4]=c*g+d*_+u*C,o[5]=c*y+d*k+u*N,o[6]=h*p+f*b+m*x,o[7]=h*g+f*_+m*C,o[8]=h*y+f*k+m*N,o}static fromObject(n){return new At().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]=At.Identity[0],this.elements[1]=At.Identity[1],this.elements[2]=At.Identity[2],this.elements[3]=At.Identity[3],this.elements[4]=At.Identity[4],this.elements[5]=At.Identity[5],this.elements[6]=At.Identity[6],this.elements[7]=At.Identity[7],this.elements[8]=At.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 H=a[0]*n+a[1]*r+a[2]*o,Q=a[3]*n+a[4]*r+a[5]*o,Z=a[6]*n+a[7]*r+a[8]*o;return[H,Q,Z]}const h=this.elements,f=[n,r,o,s,a,l,c,d,u],m=h[0],p=h[1],g=h[2],y=h[3],b=h[4],_=h[5],k=h[6],x=h[7],C=h[8],N=f[0],w=f[1],S=f[2],v=f[3],$=f[4],E=f[5],A=f[6],R=f[7],F=f[8];return this.elements[0]=m*N+p*v+g*A,this.elements[1]=m*w+p*$+g*R,this.elements[2]=m*S+p*E+g*F,this.elements[3]=y*N+b*v+_*A,this.elements[4]=y*w+b*$+_*R,this.elements[5]=y*S+b*E+_*F,this.elements[6]=k*N+x*v+C*A,this.elements[7]=k*w+x*$+C*R,this.elements[8]=k*S+x*E+C*F,this.trigger(ne.Types.change)}inverse(n){const r=this.elements;n=n||new At;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],m=f*c-d*h,p=-f*l+d*u,g=h*l-c*u;let y=o*m+s*p+a*g;return y?(y=1/y,n.elements[0]=m*y,n.elements[1]=(-f*s+a*h)*y,n.elements[2]=(d*s-a*c)*y,n.elements[3]=p*y,n.elements[4]=(f*o-a*u)*y,n.elements[5]=(-d*o+a*l)*y,n.elements[6]=g*y,n.elements[7]=(-h*o+s*u)*y,n.elements[8]=(c*o-s*l)*y,n):null}scale(n,r){return arguments.length<=1&&(r=n),this.multiply(n,0,0,0,r,0,0,0,1)}rotate(n){const r=Zy(n),o=Qy(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=kd(n);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(n){const r=kd(n);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(n){return Zs.length=0,this.toTransformArray(n,Zs),Zs.map(Sn).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],m=o[7],p=o[8];if(s){r[0]=a,r[1]=d,r[2]=f,r[3]=l,r[4]=u,r[5]=m,r[6]=c,r[7]=h,r[8]=p;return}return[a,d,f,l,u,m,c,h,p]}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],m=o[7],p=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]=m,r[8]=p;return}return[a,l,c,d,u,h,f,m,p]}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 At().copy(this)}};T(At,"Identity",[1,0,0,0,1,0,0,0,1]);let tr=At;Py(tr);const Ur=class Ur extends $r{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 Eo)Object.defineProperty(this,n,Eo[n]);this._renderer.flagMatrix=vd.bind(this),this.isShape=!0,this.matrix=new tr,this.worldMatrix=new tr,this.position=new me,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(n){const r=new Ur().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 Eo.position.get.apply(this,arguments)}set translation(n){Eo.position.set.apply(this,arguments)}addTo(n){return n.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(n,r,o){const s=o||{},a=s.ignoreVisibility===!0;if(!a&&"visible"in this&&this.visible===!1||!a&&"opacity"in this&&typeof this.opacity=="number"&&this.opacity<=0||typeof this.getBoundingClientRect!="function")return!1;const l=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();return c?n>=c.left-l&&n<=c.right+l&&r>=c.top-l&&r<=c.bottom+l:!1}copy(n){return super.copy.call(this,n),"position"in n&&(n.position instanceof me?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 me?n.scale:new me(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 Ur;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 me?this.scale.toObject():this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.matrix=this.matrix.toObject(),n}dispose(){super.dispose(),typeof this.translation=="object"&&typeof this.translation.unbind=="function"&&this.translation.unbind(),typeof this.scale=="object"&&typeof this.scale.unbind=="function"&&this.scale.unbind()}_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 me?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(Ur,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Bn=Ur;const Eo={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),vd.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 me&&this._scale.unbind(ne.Types.change,this._renderer.flagMatrix),this._scale=t,this._scale instanceof me&&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 Fy(this,this._worldMatrix),this._worldMatrix},set:function(t){this._worldMatrix=t}}};function vd(){this._flagMatrix=!0}const Cd=/^(?:none|transparent)$/i,Jy=8,Qs=Number.EPSILON;function Dn(t,e){return{x:t,y:e}}function Po(t,e,n=Qs){return Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n}function Sd(t,e,n,r){const o=t*n+e*r,s=Math.sqrt(t*t+e*e)*Math.sqrt(n*n+r*r)||1e-12;let a=Math.acos(Math.max(-1,Math.min(1,o/s)));return t*r-e*n<0&&(a=-a),a}function e0(t,e,n){if(!t)return[Dn(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[Dn(e.x,e.y)];const s=(e.xAxisRotation||0)*Math.PI/180,a=e.largeArcFlag?1:0,l=e.sweepFlag?1:0;r=Math.abs(r),o=Math.abs(o);const c=t.x,d=t.y,u=e.x,h=e.y,f=(c-u)/2,m=(d-h)/2,p=Math.cos(s),g=Math.sin(s);let y=p*f+g*m,b=-g*f+p*m,_=r*r,k=o*o;const x=y*y/_+b*b/k;if(x>1){const P=Math.sqrt(x);r*=P,o*=P,_=r*r,k=o*o}const C=_*b*b+k*y*y,N=C===0?0:(_*k-C)/C;let w=Math.sqrt(Math.max(0,N));a===l&&(w=-w);const S=w*r*b/o,v=-w*o*y/r,$=p*S-g*v+(c+u)/2,E=g*S+p*v+(d+h)/2,A=Sd(1,0,(y-S)/r,(b-v)/o),R=Sd((y-S)/r,(b-v)/o,(-y-S)/r,(-b-v)/o)%Ut,F=A+R,H=l===0,Q=(()=>{const P=F-A,V=Math.abs(P)<Number.EPSILON;let M=Wt(P,Ut);return M<Number.EPSILON&&(M=V?0:Ut),H&&!V&&(M=M===Ut?-Ut:M-Ut),M})(),Z=Math.max(So.Resolution,Math.max(n*2,1)),O=[];for(let P=1;P<=Z;P++){const V=P/Z,M=A+V*Q;let L=$+r*Math.cos(M),Y=E+o*Math.sin(M);if(s!==0){const U=L-$,G=Y-E,q=Math.cos(s),W=Math.sin(s);L=U*q-G*W+$,Y=U*W+G*q+E}O.push(Dn(L,Y))}return O}function t0(t,e=Jy){const n=[],r=[],o=t._renderer&&t._renderer.vertices&&t._renderer.vertices.length>0?t._renderer.vertices:t.vertices;if(!o||o.length===0)return{polygons:n,segments:r};const s=Math.max(1,Math.floor(e));let a=null,l=null,c=null,d=null;const u=(f=!1)=>{if(a){if(f&&l&&c&&!Po(l,c)){const m=Dn(l.x,l.y);r.push({a:c,b:m}),a.push(m),c=m}a.length>=3&&l&&c&&Po(l,c)&&n.push(a),a=null,l=null,c=null}},h=f=>{if(!c){c=f,a&&a.push(f);return}Po(c,f)||(r.push({a:c,b:f}),a&&a.push(f),c=f)};for(let f=0;f<o.length;f++){const m=o[f],p=m.command||(f===0?de.move:de.line);if(p===de.move){u(!1);const g=Dn(m.x,m.y);a=[g],l=g,c=g,d=m;continue}if(d||(d=o[Math.max(f-1,0)]),p===de.line)h(Dn(m.x,m.y));else if(p===de.curve){const g=Gs(m,d,s);for(let y=1;y<g.length;y++){const b=g[y];h(Dn(b.x,b.y))}h(Dn(m.x,m.y))}else if(p===de.arc){const g=e0(d,m,s);for(let y=0;y<g.length;y++)h(g[y])}else if(p===de.close){u(!0),d=m;continue}else h(Dn(m.x,m.y));d=m}if(a){const f=!!t._closed||!!t.closed||l&&c&&!Po(l,c);u(f)}return{polygons:n,segments:r}}function n0(t,e,n){let r=!1;for(let o=0;o<t.length;o++){const s=t[o];if(!s||s.length<3)continue;let a=s.length-1;for(let l=0;l<s.length;l++){const c=s[a],d=s[l];d.y>n!=c.y>n&&e<(c.x-d.x)*(n-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function i0(t,e,n,r){const o=r.x-n.x,s=r.y-n.y;if(Math.abs(o)<Qs&&Math.abs(s)<Qs){const f=t-n.x,m=e-n.y;return f*f+m*m}const a=((t-n.x)*o+(e-n.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=n.x+l*o,d=n.y+l*s,u=t-c,h=e-d;return u*u+h*h}function r0(t,e,n){if(!t||t.length===0)return 1/0;let r=1/0;for(let o=0;o<t.length;o++){const s=t[o],a=i0(e,n,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function o0(t,e){if(typeof e=="boolean")return e;const n=t.fill;return!n&&n!==0?!1:typeof n=="string"?!Cd.test(n):!0}function s0(t,e){const n=typeof t.linewidth=="number"?t.linewidth:t._linewidth||0;if(typeof e=="boolean")return e&&n>0;if(!(n>0))return!1;const r=t.stroke;return!r&&r!==0?!1:typeof r=="string"?!Cd.test(r):!0}function a0(t,e,n,r=0){if(!t)return!1;const o=t.left-r,s=t.right+r,a=t.top-r,l=t.bottom+r;return e>=o&&e<=s&&n>=a&&n<=l}const Fo=Number.EPSILON;function Vo(t){return typeof t.relative!="boolean"||!!t.relative}function un(t,e,n,r){const o=t.controls;if(!(!o||!o[e])){if(Math.abs(n)<Fo&&Math.abs(r)<Fo){Vo(t)?o[e].clear():o[e].set(t.x,t.y);return}Vo(t)?o[e].set(n,r):o[e].set(t.x+n,t.y+r)}}function jt(t,e){un(t,e,0,0)}function l0(t,e){const n=t.controls;return!n||!n[e]?{x:0,y:0}:Vo(t)?{x:n[e].x,y:n[e].y}:{x:n[e].x-t.x,y:n[e].y-t.y}}function nr(t,e){const n=l0(t,e);return Math.abs(n.x)>Fo||Math.abs(n.y)>Fo}function Mo(t){t.command===de.move||t.command===de.close||(t.command=nr(t,"left")||nr(t,"right")?de.curve:de.line)}function Bd(t,e){typeof e.relative=="boolean"&&(t.relative=e.relative)}function c0(t,e){return nr(e,"right")||nr(t,"left")||nr(t,"right")||nr(e,"left")||t.command===de.curve||e.command===de.curve}function ir(t,e,n){return{x:Ht(t.x,e.x,n),y:Ht(t.y,e.y,n)}}function Td(t,e){const n=t.controls&&t.controls[e];return n?Vo(t)?{x:t.x+n.x,y:t.y+n.y}:{x:n.x,y:n.y}:{x:t.x,y:t.y}}function d0(t,e,n){const r=t.controls&&t.controls.right,o=e.controls&&e.controls.left,s={x:t.x,y:t.y},a=r?Td(t,"right"):{...s},l={x:e.x,y:e.y},c=o?Td(e,"left"):{...l},d=ir(s,a,n),u=ir(a,c,n),h=ir(c,l,n),f=ir(d,u,n),m=ir(u,h,n),p=ir(f,m,n),g=new Me(p.x,p.y);return Bd(g,t),un(g,"left",f.x-p.x,f.y-p.y),un(g,"right",m.x-p.x,m.y-p.y),g.command=de.curve,{anchor:g,startOut:d,endIn:h}}function u0(t,e,n,r,o,s){const a=t.length,l=n-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,h=d;if(r||(u=Math.min(1,e),h=Math.min(1,a-n-1)),c+=u+h,c<=1)return;const f=new Array(c+1);for(let w=0,S=e-u;w<=c;w+=1,S+=1){const v=Wt(S,a);f[w]=t[v]}let m=f[0].x+2*f[1].x,p=f[0].y+2*f[1].y,g=2;const y=c-1,b=[m],_=[p],k=[g],x=new Array(c+1),C=new Array(c+1);for(let w=1;w<c;w+=1){const S=w<y,v=S||s?1:2,$=S?4:s?2:7,E=S?4:s?3:8,A=S?2:s?0:1,R=v/g;g=k[w]=$-R,m=b[w]=E*f[w].x+A*f[w+1].x-R*m,p=_[w]=E*f[w].y+A*f[w+1].y-R*p}x[y]=b[y]/k[y],C[y]=_[y]/k[y];for(let w=c-2;w>=0;w-=1)x[w]=(b[w]-x[w+1])/k[w],C[w]=(_[w]-C[w+1])/k[w];x[c]=(3*f[c].x-x[y])/2,C[c]=(3*f[c].y-C[y])/2;const N=c-h;for(let w=u,S=e;w<=N;w+=1,S+=1){const v=Wt(S,a),$=t[v],E=x[w]-$.x,A=C[w]-$.y;o||w<N?un($,"right",E,A):jt($,"right"),o||w>u?un($,"left",-E,-A):jt($,"left"),Mo($)}}function f0(t,e,n,r,o,s){const a=e||t,l=t,c=n||t,d=me.distanceBetween(a,l),u=me.distanceBetween(l,c),h=r===void 0?.5:r,f=Math.pow(d,h),m=Math.pow(u,h),p=f*f,g=m*m;if(!o&&e){const y=2*g+3*m*f+p,b=3*m*(m+f);if(b!==0){const _=(g*a.x+y*l.x-p*c.x)/b-l.x,k=(g*a.y+y*l.y-p*c.y)/b-l.y;un(t,"left",_,k)}else jt(t,"left")}else jt(t,"left");if(!s&&n){const y=2*p+3*f*m+g,b=3*f*(f+m);if(b!==0){const _=(p*c.x+y*l.x-g*a.x)/b-l.x,k=(p*c.y+y*l.y-g*a.y)/b-l.y;un(t,"right",_,k)}else jt(t,"right")}else jt(t,"right");Mo(t)}function h0(t,e,n,r,o,s){if(!(e&&n)){e||jt(t,"left"),n||jt(t,"right"),Mo(t);return}const a=e,l=t,c=n,d=me.distanceBetween(a,l),u=me.distanceBetween(l,c),h=d+u,f=r===void 0?.4:r,m={x:a.x-c.x,y:a.y-c.y};if(!o&&h!==0){const p=f*d/h;un(t,"left",m.x*p,m.y*p)}else jt(t,"left");if(!s&&h!==0){const p=f*d/h-f;un(t,"right",m.x*p,m.y*p)}else jt(t,"right");Mo(t)}function m0(t,e,n,r,o,s){const a=s.type,l=s.factor,c=t.length;for(let d=e;d<=n;d+=1){const u=Wt(d,c),h=t[u];if(h.command===de.move){jt(h,"left"),jt(h,"right");continue}const f=d===e&&!o?null:d-1,m=d===n&&!o?null:d+1,p=f===null?null:t[Wt(f,c)],g=m===null?null:t[Wt(m,c)],y=f===null,b=m===null;a==="geometric"?h0(h,p,g,l,y,b):f0(h,p,g,l,y,b)}}const rr=Math.min,or=Math.max,p0=Math.ceil,g0=Math.floor,y0=new me,b0=new tr,mn=class mn extends Bn{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 Nd)Object.defineProperty(this,a,Nd[a]);this._renderer.type="path",this._renderer.flagVertices=$d.bind(this),this._renderer.bindVertices=Rd.bind(this),this._renderer.unbindVertices=Ed.bind(this),this._renderer.flagFill=Pd.bind(this),this._renderer.flagStroke=Fd.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:vi(n.fill),o=typeof n.stroke=="string"?n.stroke:vi(n.stroke),s=new mn().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 Me?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Me().copy(o))}}for(let r=0;r<mn.Properties.length;r++){const o=mn.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new mn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<mn.Properties.length;o++){const s=mn.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()),je.each(mn.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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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:m,scaleY:p}=Ey(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof m=="number"&&typeof p=="number"&&(o=Math.max(m,p)*(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[m,p]=r.multiply(l.x,l.y),[g,y]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let b=l.controls.right.x,_=l.controls.right.y;l.relative&&(b+=l.x,_+=l.y);let[k,x]=r.multiply(b,_),C=c.controls.left.x,N=c.controls.left.y;c.relative&&(C+=c.x,N+=c.y);let[w,S]=r.multiply(C,N);const v=Iy(m,p,k,x,w,S,g,y);h=rr(v.min.y-o,h),d=rr(v.min.x-o,d),u=or(v.max.x+o,u),f=or(v.max.y+o,f)}else a<=1&&(h=rr(p-o,h),d=rr(m-o,d),u=or(m+o,u),f=or(p+o,f)),h=rr(y-o,h),d=rr(g-o,d),u=or(g+o,u),f=or(y+o,f)}return{top:h,left:d,right:u,bottom:f,width:u-d,height:f-h}}contains(n,r,o){const s=o||{},a=s.ignoreVisibility===!0;if(!a&&this.visible===!1||!a&&typeof this.opacity=="number"&&this.opacity<=0)return!1;const l=typeof s.tolerance=="number"?s.tolerance:0;this._update(!0);const c=this.getBoundingClientRect();if(!c||n<c.left-l||n>c.right+l||r<c.top-l||r>c.bottom+l)return!1;const d=this.worldMatrix,u=d&&d.inverse(b0);if(!u)return super.contains(n,r,s);const[h,f]=u.multiply(n,r,1),m=typeof s.precision=="number"&&!Number.isNaN(s.precision)?Math.max(1,Math.floor(s.precision)):8,p=o0(this,s.fill),g=s0(this,s.stroke),{polygons:y,segments:b}=t0(this,m);if(p&&y.length>0&&n0(y,h,f))return!0;if(g&&b.length>0){const _=typeof this.linewidth=="number"?this.linewidth:0;if(_>0&&r0(b,h,f)<=_/2+l)return!0}return!p&&!g?super.contains(n,r,s):p&&y.length===0?super.contains(n,r,s):!1}getPointAt(n,r){let o,s,a,l,c,d,u,h,f,m,p,g,y,b,_,k=this.length*Math.min(Math.max(n,0),1);const x=this.vertices.length,C=x-1;let N=null,w=null;for(let O=0,P=this._lengths.length,V=0;O<P;O++){if(V+this._lengths[O]>=k){this._closed?(o=Wt(O,x),s=Wt(O-1,x),O===0&&(o=s,s=O)):(o=O,s=Math.min(Math.max(O-1,0),C)),N=this.vertices[o],w=this.vertices[s],k-=V,this._lengths[O]!==0?n=k/this._lengths[O]:n=0;break}V+=this._lengths[O]}if(N===null||w===null)return null;if(N){if(!w)return N}else return w;_=w.controls&&w.controls.right,b=N.controls&&N.controls.left,c=w.x,m=w.y,d=(_||w).x,p=(_||w).y,u=(b||N).x,g=(b||N).y,h=N.x,y=N.y,_&&w.relative&&(d+=w.x,p+=w.y),b&&N.relative&&(u+=N.x,g+=N.y),l=To(n,c,d,u,h),f=To(n,m,p,g,y);const S=Ht(c,d,n),v=Ht(m,p,n),$=Ht(d,u,n),E=Ht(p,g,n),A=Ht(u,h,n),R=Ht(g,y,n),F=Ht(S,$,n),H=Ht(v,E,n),Q=Ht($,A,n),Z=Ht(E,R,n);return je.isObject(r)?(r.x=l,r.y=f,r instanceof Me&&(r.controls.left.x=F,r.controls.left.y=H,r.controls.right.x=Q,r.controls.right.y=Z,(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 Me(l,f,F-l,H-f,Q-l,Z-f,this._curved?de.curve:de.line),a.t=n,a)}plot(){if(this.curved)return zy(this._collection,this.closed),this;for(let n=0;n<this._collection.length;n++)this._collection[n].command=n===0?de.move:de.line;return this}smooth(n){const r=n||{},o=r.type||"continuous",s=this._collection,a=s.length;if(a<2)return this;const l=this._closed||a>0&&s[a-1]&&s[a-1].command===de.close,c=(m,p)=>{if(m==null)return p;if(typeof m=="number"){if(l)return Wt(m,a);let y=m;return y<0&&(y+=a),Math.min(Math.max(y,0),a-1)}const g=s.indexOf(m);return g!==-1?g:p},d=l&&r.from===void 0&&r.to===void 0;let u=c(r.from,0),h=c(r.to,a-1);if(u>h)if(l)u-=a;else{const m=u;u=h,h=m}const f=h-u+1;for(let m=0;m<f;m+=1){const p=Wt(u+m,a),g=s[p],y=!l&&p===0;g.command===de.move&&!y&&(g.command=de.line)}if(o==="continuous"||o==="asymmetric")u0(s,u,h,l,d,o==="asymmetric");else if(o==="catmull-rom"||o==="geometric"){const m={type:o,factor:r.factor};m0(s,u,h,l,d,m)}else throw new Error(`Path.smooth does not support type "${o}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(n){this._update();const r=this.vertices,o=r.length;if(o<2)return this;const s=[];let a=null,l=null;for(let c=0;c<o;c+=1){const d=r[c];if(!a||d.command===de.move){const h=d.clone();s.push(h),a=d,l=d;continue}if(c0(d,a)){const f=Gs(d,a,n).length,m=s[s.length-1];let p=m.clone(),g=d.clone(),y=m,b=0;if(f<=1){const _=d.clone();s.push(_)}else{for(let k=1;k<f;k+=1){const x=k/f,C=1-b,N=C<=Number.EPSILON?x:(x-b)/C,w=d0(p,g,N);un(y,"right",w.startOut.x-y.x,w.startOut.y-y.y);const S=w.anchor;s.push(S),y=S,p=S.clone(),b=x,un(g,"left",w.endIn.x-g.x,w.endIn.y-g.y)}const _=d.clone();_.controls.left.copy(g.controls.left),s.push(_)}}else{const h=Gs(d,a,n);for(let m=1;m<h.length;m+=1){const p=h[m];Bd(p,a),jt(p,"left"),jt(p,"right"),p.command=de.line,s.push(p)}const f=d.clone();s.push(f)}a=d,d.command===de.close&&(a=l)}return this._automatic=!1,this._curved=!1,this.vertices=s,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=[]),je.each(this.vertices,function(c,d){if(d<=0||c.command===de.move){a=c,this._lengths[d]=0;return}this._lengths[d]=xd(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=Ro(this,o*this._length),l=Ro(this,s*this._length),c=p0(a),d=g0(l);let u,h,f,m,p,g;for(this._renderer.vertices.length=0,g=0;g<n;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new Me),g>d&&!h?(p=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,p),p.command=this._renderer.collection[g].command,this._renderer.vertices.push(p),h=p,f=this._collection[g-1],f&&f.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p),f.relative?this._renderer.collection[g-1].controls.right.copy(f.controls.right).lerp(me.zero,1-p.t):this._renderer.collection[g-1].controls.right.copy(f.controls.right).lerp(f,1-p.t))):g>=c&&g<=d&&(p=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(p),g===d&&wd(this,s)?(h=p,!r&&h.controls&&(h.relative?h.controls.right.clear():h.controls.right.copy(h))):g===c&&wd(this,o)&&(u=p,u.command=de.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(g=c-1,p=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(o,p),p.command=de.move,this._renderer.vertices.unshift(p),m=this._collection[g+1],m&&m.controls&&(p.controls.left.clear(),m.relative?this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(me.zero,p.t):(y0.copy(m),this._renderer.collection[g+1].controls.left.copy(m.controls.left).lerp(m,p.t))))}return Bn.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,Bn.prototype.flagReset.call(this),this}};T(mn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),T(mn,"Utils",{getCurveLength:xd});let Ae=mn;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}},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 ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&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";je.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 xi?this._collection=t:this._collection=new xi(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,je.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 $d(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function Rd(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Ed(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function Pd(){this._flagFill=!0}function Fd(){this._flagStroke=!0}const _0=Math.ceil,w0=Math.floor,Fn=class Fn extends Bn{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 Vd)Object.defineProperty(this,r,Vd[r]);this._renderer.type="points",this._renderer.flagVertices=$d.bind(this),this._renderer.bindVertices=Rd.bind(this),this._renderer.unbindVertices=Ed.bind(this),this._renderer.flagFill=Pd.bind(this),this._renderer.flagStroke=Fd.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:vi(n.fill),o=typeof n.stroke=="string"?n.stroke:vi(n.stroke),s=new Fn().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 Me?this.vertices.push(n.vertices[r].clone()):this.vertices.push(new Me().copy(o))}for(let r=0;r<Fn.Properties.length;r++){const o=Fn.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new Fn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Fn.Properties.length;o++){const s=Fn.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()),je.each(Fn.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"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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=ud(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=Ro(this,n*this._length),s=Ro(this,r*this._length),a=_0(o),l=w0(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(Fn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let Ao=Fn;const Vd={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 ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&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 xi?this._collection=t:this._collection=new xi(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 Md extends xi{constructor(n){n=Array.isArray(n)?n:Array.prototype.slice.call(arguments);super(n);yl(this,cs,{});this.attach(n),this.on(ne.Types.insert,this.attach),this.on(ne.Types.remove,this.detach)}get ids(){return Ot(this,cs)}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}}cs=new WeakMap;const qn=class qn extends Ae{constructor(n,r,o,s,a,l,c){const d=c||So.Resolution*3,u=[];for(let h=0;h<d;h++)u.push(new Me);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",Ut);T(this,"_innerRadius",0);T(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let h in Ad)Object.defineProperty(this,h,Ad[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 qn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<qn.Properties.length;r++){const o=qn.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=Wt(n,Ut)===Wt(r,Ut),l=o>0,c=this.vertices;let d=l?c.length/2:c.length,u,h=0,f,m,p,g,y,b,_,k,x;for(a?d--:l||(d-=2),f=0,m=d-1;f<d;f++){switch(p=f/m,g=c[h],y=p*(r-n)+n,b=(r-n)/d,_=s*Math.cos(y),k=s*Math.sin(y),f){case 0:u=de.move;break;default:u=de.curve}g.command=u,g.x=_,g.y=k,g.controls.left.clear(),g.controls.right.clear(),g.command===de.curve&&(x=s*b/Math.PI,g.controls.left.x=x*Math.cos(y-pt),g.controls.left.y=x*Math.sin(y-pt),g.controls.right.x=x*Math.cos(y+pt),g.controls.right.y=x*Math.sin(y+pt),f===1&&g.controls.left.multiplyScalar(2),f===m&&g.controls.right.multiplyScalar(2)),h++}if(l){for(a?(c[h].command=de.close,h++):(d--,m=d-1),f=0;f<d;f++)p=f/m,g=c[h],y=(1-p)*(r-n)+n,b=(r-n)/d,_=o*Math.cos(y),k=o*Math.sin(y),u=de.curve,f<=0&&(u=a?de.move:de.line),g.command=u,g.x=_,g.y=k,g.controls.left.clear(),g.controls.right.clear(),g.command===de.curve&&(x=o*b/Math.PI,g.controls.left.x=x*Math.cos(y+pt),g.controls.left.y=x*Math.sin(y+pt),g.controls.right.x=x*Math.cos(y-pt),g.controls.right.y=x*Math.sin(y-pt),f===1&&g.controls.left.multiplyScalar(2),f===m&&g.controls.right.multiplyScalar(2)),h++;c[h].copy(c[0]),c[h].command=de.line}else a||(c[h].command=de.line,c[h].x=0,c[h].y=0,h++,c[h].copy(c[0]),c[h].command=de.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 qn(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<qn.Properties.length;r++){const o=qn.Properties[r];n[o]=this[o]}return n}};T(qn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let Js=qn;const Ad={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}}},ea=Math.cos,ta=Math.sin,Xn=class Xn 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 Me(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 Id)Object.defineProperty(this,c,Id[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 Xn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Xn.Properties.length;r++){const o=Xn.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*Ut,d=o*ea(c),u=o*ta(c),h=s*ea(c-pt),f=s*ta(c-pt),m=s*ea(c+pt),p=s*ta(c+pt),g=this.vertices[a];g.command=a===0?de.move:de.curve,g.set(d,u),g.controls.left.set(h,f),g.controls.right.set(m,p)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(n){const r=new Xn(0,0,this.radius,this.vertices.length);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale,r.skewX=this.skewX,r.skewY=this.skewY,this.matrix.manual&&r.matrix.copy(this.matrix);for(let 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<Xn.Properties.length;r++){const o=Xn.Properties[r];n[o]=this[o]}return n}};T(Xn,"Properties",["radius"]);let na=Xn;const Id={radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius=t,this._flagRadius=!0}}},ia=Math.cos,ra=Math.sin,Yn=class Yn 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 Me);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 Od)Object.defineProperty(this,d,Od[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 Yn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Yn.Properties.length;r++){const o=Yn.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*Ut,d=o*ia(c),u=s*ra(c),h=o*r*ia(c-pt),f=s*r*ra(c-pt),m=o*r*ia(c+pt),p=s*r*ra(c+pt),g=this.vertices[a];g.command=a===0?de.move:de.curve,g.set(d,u),g.controls.left.set(h,f),g.controls.right.set(m,p)}}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 Yn(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<Yn.Properties.length;r++){const o=Yn.Properties[r];n[o]=this[o]}return n}};T(Yn,"Properties",["width","height"]);let oa=Yn;const Od={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}}},x0=Math.cos,k0=Math.sin,Un=class Un 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 zd)Object.defineProperty(this,a,zd[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 Un().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Un.Properties.length;r++){const o=Un.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=Ut*a+Math.PI/2,c=this._width*x0(l)/2,d=this._height*k0(l)/2;s>=o?this.vertices.push(new Me(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?de.move:de.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 Un(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<Un.Properties.length;r++){const o=Un.Properties[r];n[o]=this[o]}return n}};T(Un,"Properties",["width","height","sides"]);let sa=Un;const zd={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}}},Ii=class Ii extends Ae{constructor(n,r,o,s){const a=[new Me,new Me,new Me,new Me];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 Dd)Object.defineProperty(this,l,Dd[l]);this.width=typeof o=="number"?o:1,this.height=typeof s=="number"?s:1,this.origin=new me,typeof n=="number"&&(this.translation.x=n),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(n){const r=new Ii().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Ii.Properties.length;r++){const o=Ii.Properties[r];o in n&&(typeof n[o]=="number"?this[o]=n[o]:this[o]instanceof me&&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 Me),this.vertices[0].set(-n,-r).sub(this._origin).command=de.move,this.vertices[1].set(n,-r).sub(this._origin).command=de.line,this.vertices[2].set(n,r).sub(this._origin).command=de.line,this.vertices[3].set(-n,r).sub(this._origin).command=de.line,this.vertices[4]&&(this.vertices[4].set(-n,-r).sub(this._origin).command=de.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(n){const r=new Ii(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 me?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(Ii,"Properties",["width","height","origin"]);let Rr=Ii;const Dd={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()}}},Kn=class Kn 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 Me(0,0,0,0,0,0,c===0?de.move:de.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 Ld)Object.defineProperty(this,c,Ld[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=v0.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof a=="number"||a instanceof me)&&(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 Kn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Kn.Properties.length;r++){const o=Kn.Properties[r];if(o in n){const s=n[o];/radius/i.test(o)?this[o]=typeof s=="number"||s instanceof me?s:new me().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 me?(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 Kn(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<Kn.Properties.length;r++){const o=Kn.Properties[r];n[o]=this[o]}return n.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),n}};T(Kn,"Properties",["width","height","radius"]);let aa=Kn;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}},radius:{enumerable:!0,get:function(){return this._radius},set:function(t){this._radius instanceof me&&this._radius.unbind(ne.Types.change,this._renderer.flagRadius),this._radius=t,this._radius instanceof me&&this._radius.bind(ne.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function v0(){this._flagRadius=!0}const C0=Math.cos,S0=Math.sin,Gn=class Gn 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 Hd)Object.defineProperty(this,l,Hd[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 Gn().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Gn.Properties.length;r++){const o=Gn.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=Ut*a,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*C0(l),u=c*S0(l);s>=o?this.vertices.push(new Me(d,u)):this.vertices[s].set(d,u),this.vertices[s].command=s===0?de.move:de.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 Gn(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<Gn.Properties.length;r++){const o=Gn.Properties[r];n[o]=this[o]}return n}};T(Gn,"Properties",["innerRadius","outerRadius","sides"]);let la=Gn;const Hd={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 ca;const Wd=Math.min,jd=Math.max;Cn.document&&(ca=document.createElement("canvas"));const $t=class $t extends Bn{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 qd)Object.defineProperty(this,a,qd[a]);if(this._renderer.type="text",this._renderer.flagFill=B0.bind(this),this._renderer.flagStroke=T0.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,!je.isObject(s))return this;for(let a=0;a<$t.Properties.length;a++){const l=$t.Properties[a];l in s&&(this[l]=s[l])}}static Measure(n){if(ca){const r=ca.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*$t.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:vi(n.fill),o=typeof n.stroke=="string"?n.stroke:vi(n.stroke),s=new $t().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<$t.Properties.length;r++){const o=$t.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new $t(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let o=0;o<$t.Properties.length;o++){const s=$t.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<$t.Properties.length;r++){const o=$t.Properties[r];n[o]=this[o]}return n}dispose(){return super.dispose(),typeof this.fill=="object"&&typeof this.fill.dispose=="function"?this.fill.dispose():typeof this.fill=="object"&&typeof this.fill.unbind=="function"&&this.fill.unbind(),typeof this.stroke=="object"&&typeof this.stroke.dispose=="function"?this.stroke.dispose():typeof this.stroke=="object"&&typeof this.stroke.unbind=="function"&&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}=$t.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),[m,p]=r.multiply(o,l),[g,y]=r.multiply(s,a),[b,_]=r.multiply(s,l);return a=Wd(f,p,y,_),o=Wd(h,m,g,b),s=jd(h,m,g,b),l=jd(f,p,y,_),{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($t,"Ratio",.6),T($t,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let sr=$t;const qd={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 ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.unbind(ne.Types.change,this._renderer.flagFill),this._fill=t,this._flagFill=!0,(this._fill instanceof ut||this._fill instanceof Ft||this._fill instanceof Vt||this._fill instanceof Ze)&&this._fill.bind(ne.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(t){(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&this._stroke.unbind(ne.Types.change,this._renderer.flagStroke),this._stroke=t,this._flagStroke=!0,(this._stroke instanceof ut||this._stroke instanceof Ft||this._stroke instanceof Vt||this._stroke instanceof Ze)&&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,je.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 B0(){this._flagFill=!0}function T0(){this._flagStroke=!0}const Zn=class Zn extends Rr{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 Xd)Object.defineProperty(this,a,Xd[a]);this._renderer.flagTextures=N0.bind(this),this._renderer.bindTextures=$0.bind(this),this._renderer.unbindTextures=R0.bind(this),this.noStroke(),this.noFill(),Array.isArray(n)?this.textures=n.map(Yd.bind(this)):typeof n=="string"&&(this.textures=[Yd(n)]),this.origin=new me,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=Zn.DefaultFrameRate,this.index=0}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];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=je.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 Zn(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,je.isNaN(this._lastFrame)&&(this._lastFrame=a-1),s=je.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=Ht(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 Ze))&&(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(Zn,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),T(Zn,"DefaultFrameRate",30);let da=Zn;const Xd={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 xi((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 N0(){this._flagTextures=!0}function $0(t){let e=t.length;for(;e--;)t[e].bind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function R0(t){let e=t.length;for(;e--;)t[e].unbind(ne.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Yd(t){if(t instanceof Ze)return t;if(typeof t=="string")return new Ze(t)}const Oi=class Oi extends Rr{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 Ud)Object.defineProperty(this,c,Ud[c]);this.noStroke(),this.noFill(),n instanceof Ze?this.texture=n:typeof n=="string"&&(this.texture=new Ze(n)),this.origin=new me,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 Oi().copy(n);return"id"in n&&(r.id=n.id),r}copy(n){super.copy.call(this,n);for(let r=0;r<Oi.Properties.length;r++){const o=Oi.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=je.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 Oi(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,m;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&&(je.isNaN(this._lastFrame)&&(this._lastFrame=c-1),l=je.performance.now()-this._startTime,m=this._lastFrame+1,d=1e3*(m-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Ht(this._firstFrame,m,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const p=this._index%r,g=Math.floor(this._index/r),y=-s*p+(h-s)/2,b=-a*g+(f-a)/2;y!==n.offset.x&&(n.offset.x=y),b!==n.offset.y&&(n.offset.y=b)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};T(Oi,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let ua=Oi;const Ud={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}}},Io=Math.min,Oo=Math.max,E0={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},It=class It extends Bn{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 Kd)Object.defineProperty(this,r,Kd[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++)Gd.call(this,n[r],this)}static RemoveChildren(n){for(let r=0;r<n.length;r++)Gd.call(this,n[r])}static OrderChildren(n){this._flagOrder=!0}static fromObject(n){const r=new It;for(let s=0;s<It.Properties.length;s++){const a=It.Properties[s];a in n&&(/(fill|stroke)/i.test(a)?r[a]=typeof n[a]=="string"?n[a]:vi(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 Js.fromObject(s);case"circle":return na.fromObject(s);case"element":return $r.fromObject(s);case"ellipse":return oa.fromObject(s);case"group":return It.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return da.fromObject(s);case"path":return Ae.fromObject(s);case"points":return Ao.fromObject(s);case"polygon":return sa.fromObject(s);case"rectangle":return Rr.fromObject(s);case"rounded-rectangle":return aa.fromObject(s);case"shape":return Bn.fromObject(s);case"sprite":return ua.fromObject(s);case"star":return la.fromObject(s);case"text":return sr.fromObject(s)}return s}}static IsVisible(n,r){if(!r)return!0;let o=n;for(;o;){if(typeof o.visible=="boolean"&&!o.visible||typeof o.opacity=="number"&&o.opacity<=0)return!1;o=o.parent}return!0}static VisitForHitTest(n,r,o,s,a,l,c){const d=n&&n.children;if(!d)return!1;const u=r.results;for(let h=d.length-1;h>=0;h--){const f=d[h];if(!f||!It.IsVisible(f,r.visibleOnly))continue;const m=typeof f.getBoundingClientRect=="function"?f.getBoundingClientRect():null;if(!(m&&!a0(m,r.x,r.y,l))){if(f instanceof It){if(o&&(!s||s(f))&&typeof f.contains=="function"&&f.contains(r.x,r.y,a)&&(u.push(f),c)||It.VisitForHitTest(f,r,o,s,a,l,c))return!0;continue}if(f instanceof Bn&&!(s&&!s(f))&&typeof f.contains=="function"&&f.contains(r.x,r.y,a)&&(u.push(f),c))return!0}}return!1}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<It.Properties.length;r++){const o=It.Properties[r];o in n&&(this[o]=n[o])}return this}clone(n){const r=new It,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,je.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}getShapesAtPoint(n,r,o){const s=o||{},{results:a,hitOptions:l,context:c,single:d,empty:u}=E0.getShapesAtPoint;a.length=0;const h=s.mode==="deepest"||s.deepest?"deepest":"all",f=s.visibleOnly!==!1,m=!!s.includeGroups,p=typeof s.filter=="function"?s.filter:null,g=typeof s.tolerance=="number"?s.tolerance:0;typeof s.precision=="number"?l.precision=s.precision:delete l.precision,typeof s.fill<"u"?l.fill=s.fill:delete l.fill,typeof s.stroke<"u"?l.stroke=s.stroke:delete l.stroke,l.tolerance=g,l.ignoreVisibility=!f;const y=h==="deepest";if(c.x=n,c.y=r,c.visibleOnly=f,c.results=a,It.VisitForHitTest(this,c,m,p,l,g,y),y){if(a.length>0){const _=a[0];return a.length=0,d[0]=_,d.length=1,d}return u.length=0,u}const b=a.slice();return a.length=0,b}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 m=/texture|gradient/i;o=n?this.matrix:this.worldMatrix;for(let p=0;p<this.children.length;p++){const g=this.children[p];if(!(!g.visible||m.test(g._renderer.type))&&(r=g.getBoundingClientRect(n),s=typeof r.top!="number"||je.isNaN(r.top)||!isFinite(r.top),a=typeof r.left!="number"||je.isNaN(r.left)||!isFinite(r.left),l=typeof r.right!="number"||je.isNaN(r.right)||!isFinite(r.right),c=typeof r.bottom!="number"||je.isNaN(r.bottom)||!isFinite(r.bottom),!(s||a||l||c)))if(n){const[y,b]=o.multiply(r.left,r.top),[_,k]=o.multiply(r.right,r.top),[x,C]=o.multiply(r.left,r.bottom),[N,w]=o.multiply(r.right,r.bottom);h=Io(b,k,C,w,h),d=Io(y,_,x,N,d),u=Oo(y,_,x,N,u),f=Oo(b,k,C,w,f)}else h=Io(r.top,h),d=Io(r.left,d),u=Oo(r.right,u),f=Oo(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(It,"Children",Md),T(It,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Ln=It;const Kd={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=Ln.InsertChildren.bind(this),n=Ln.RemoveChildren.bind(this),r=Ln.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new Md(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,je.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 Gd(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 zo extends Ae{constructor(e,n,r,o){const s=[new Me(e,n),new Me(r,o)];super(s);for(let a in Zd)Object.defineProperty(this,a,Zd[a]);this.vertices[0].command=de.move,this.vertices[1].command=de.line,this.automatic=!1}}T(zo,"Properties",["left","right"]);const Zd={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(t){if(je.isObject(t))this.vertices.splice(0,1,t),this.vertices[0].command=de.move;else{const e=new No("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(je.isObject(t))this.vertices.splice(1,1,t),this.vertices[1].command=de.line;else{const e=new No("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class fa{constructor(e=0,n=0){this.x=e,this.y=n}}class Tn{constructor(e=10,n=0,r="A"){T(this,"start",new fa);T(this,"end",new fa);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"}},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:"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 Do=i.markRaw({name:"ion-close",render:F0}),V0={class:"mr-3 flex flex-col gap-2"},M0=["onClick"],A0={class:"h-full p-2"},I0={},O0=i.defineComponent({...I0,__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 m;const f=(m=o.value)==null?void 0:m.at(h);f&&a("init-draw-template",f,u)}),(d=n.settings.customTemplates)==null||d.forEach((u,h)=>{var m;const f=(m=s.value)==null?void 0:m.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 m=(f=s.value)==null?void 0:f.at(h);m&&a("init-draw-template",m,u)}}),d.length>c.length&&d.forEach((u,h)=>{var m;const f=(m=s.value)==null?void 0:m.at(h);f&&(f.innerHTML="",a("init-draw-template",f,u))})})},{deep:!0}),(c,d)=>{const u=Do;return i.openBlock(),i.createBlock(i.unref(z.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:i.withCtx(()=>[i.createElementVNode("div",V0,[(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(z.NPopover),{trigger:"hover",placement:"right"},{trigger:i.withCtx(()=>[i.createElementVNode("div",{class:i.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":f===t.selectTemplateIndex}]),onClick:m=>a("template:select",f)},[i.createElementVNode("div",A0,[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,M0)]),default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(h.label),1)]),_:2},1024),h.isCustom&&!h.isNewRec()?(i.openBlock(),i.createBlock(i.unref(z.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:m=>l(f)},{default:i.withCtx(()=>[i.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):i.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Qd=An(O0,[["__scopeId","data-v-afccb364"]]),z0={class:"flex gap-3 min-w-[20rem] relative"},D0={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},L0={ref:"drawing-container",class:"size-full"},H0={},Jd=i.defineComponent({...H0,__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((O,P)=>new Tn(n.value.configuratorParams.linesWidths[P],O,`A-${P+1}`))),h=i.computed(()=>n.value.configuratorParams.colorSide==="bottom"),f=i.computed(()=>{var O,P;return n.value.configuratorParams.startTailType&&((O=n.settings.startTailConfigs)!=null&&O[n.value.configuratorParams.startTailType])?(P=n.settings.startTailConfigs)==null?void 0:P[n.value.configuratorParams.startTailType].points:[]}),m=i.computed(()=>{var P;const O=n.value.configuratorParams.endTailType!==void 0&&((P=n.settings.endTailConfigs)==null?void 0:P[n.value.configuratorParams.endTailType]);return!O||!O.points?[]:O.points.map((V,M)=>Array.isArray(V)?new Tn(V[0],V[1],`A-${M+1}`):new Tn(V.width,V.angle,`A-${M+1}`))}),p=(O,P=!1)=>{O[0].start.x=0,O[0].start.y=0;let V=0;for(let M=0;M<O.length;M++){const L=O[M],Y=O[M-1]??new Tn(0,V);V+=!P||M>1?Y.angle:0;const U=(!P||M>0?L.angle:0)+V;if(O[M].end.x=L.width*Math.cos(U*Math.PI/180)+O[M].start.x,O[M].end.y=L.width*Math.sin(U*Math.PI/180)+O[M].start.y,M<O.length-1){const G=M+1;O[G].start.x=O[M].end.x,O[G].start.y=O[M].end.y}}return O},g=(O,P,V,M,L=!1)=>{let Y=p([...V,...M]);P.length>0&&(Y=[...p(P),...Y]);let U=0,G=0,q=0,W=0;Y.forEach(ve=>{U=Math.min(U,ve.start.x,ve.end.x),G=Math.min(G,ve.start.y,ve.end.y),q=Math.max(q,ve.start.x,ve.end.x),W=Math.max(W,ve.start.y,ve.end.y)});let K,ue;U===0&&G===0&&q===0&&W===0?(K=1,ue=1):(K=O.width/Math.abs(q-U),ue=(L?O.height:O.height-qe.colorSideLabel.size)/Math.abs(W-G));const ye=Math.min(K,ue);return U=U<0?-U*ye:0,G=G<0?-G*ye:0,[ye,U,G]},y=O=>{const P=new Ao([O]);return P._size=qe.anchorPoint.size,P.fill=qe.anchorPoint.color,P.stroke="transparent",P._linewidth=qe.anchorPoint.strokeSize,l.push(P),P},b=(O,P)=>{if(l=[],n.settings.allowChangeFirstPoint){const V=O[0],M=new me(V.vertices[0].x,V.vertices[0].y);M.bind(ne.Types.change,()=>{V.vertices[0].copy(M)});const L=y(M);P.add(L)}O.forEach((V,M)=>{const L=O[M+1],Y=new me(V.vertices[1].x,V.vertices[1].y);Y.bind(ne.Types.change,()=>{V.vertices[1].copy(Y),L!==void 0&&L.vertices[0].copy(Y)});const U=y(Y);P.add(U)})},_=O=>O*(Math.PI/180),k=(O,P,V)=>{const M=P.vertices.length-1;O.position.x=P.vertices[M].x,O.position.y=P.vertices[M].y;const L=Math.atan2(P.vertices[M].y-P.vertices[0].y,P.vertices[M].x-P.vertices[0].x);O.rotation=_(V)+L},x=(O,P,V)=>{if(P.vertices[0]===void 0)return;O.position.x=P.vertices[0].x,O.position.y=P.vertices[0].y;const M=P.vertices.length-1,L=Math.atan2(P.vertices[M].y-P.vertices[0].y,P.vertices[M].x-P.vertices[0].x);O.rotation=_(V)+L},C=(O,P,V)=>{const M=new Ln;if(O.length===0)return M;const L=[];return[...O].reverse().forEach((Y,U)=>{U!==0&&Y.angle>0&&(Y.angle*=-1),L.push(Y)}),O=p(L,!0),x(M,P,O[0].angle),[P.vertices[0],P.vertices[1]].forEach(Y=>{Y.bind(ne.Types.change,()=>{x(M,P,O[0].angle)})}),O.forEach(Y=>{const U=Y.start.x*V,G=Y.end.x*V,q=Y.start.y*V,W=Y.end.y*V,K=new zo(U,q,G,W);K.linewidth=qe.line.size,K.stroke=qe.line.color,M.add(K)}),M},N=(O,P,V)=>{const M=new Ln;return O.length===0||(O=p(O,!0),k(M,P,O[0].angle),[P.vertices[0],P.vertices[1]].forEach(L=>{L.bind(ne.Types.change,()=>{k(M,P,O[0].angle)})}),O.forEach(L=>{const Y=L.start.x*V,U=L.end.x*V,G=L.start.y*V,q=L.end.y*V,W=new zo(Y,G,U,q);W.linewidth=qe.line.size,W.stroke=qe.line.color,M.add(W)})),M},w=(O,P,V,M)=>{const L=P.vertices[0].x+(P.vertices[1].x-P.vertices[0].x)/2-8*Math.sin(O.angle*Math.PI/180),Y=P.vertices[0].y+(P.vertices[1].y-P.vertices[0].y)/2-8*Math.cos(O.angle*Math.PI/180),U=new sr(O.label,L+10,Y-10);let G;U.size=qe.lineLabel.size,U.weight=600,U.fill=qe.lineLabel.color,U.id+=1,U.rotation=qe.lineLabel.rotation,M>0&&(G=new sr(`${O.angle}°`,P.vertices[0].x+25,P.vertices[0].y-25),G.size=qe.angleLabel.size,G.weight=600,G.fill=qe.angleLabel.color,G.rotation=qe.angleLabel.rotation,G.id+=M,s.push(G),V.add(G)),V.add(U),v(U,P,0,G),v(U,P,1)},S=()=>{const{size:O}=qe.colorSideLabel,P=0,V=0,M=h.value?O/2:O/2-O,L=h.value?O/2-O:O/2,Y=new Ln;if(!c)return Y;const U=5,G=Math.atan2(L-M,V-P),q=[new Me(P,M,0,0,0,0,vn.Commands.move),new Me(V,L,0,0,0,0,vn.Commands.line),new Me(V-U*Math.cos(G-Math.PI/4),L-U*Math.sin(G-Math.PI/4),0,0,0,0,vn.Commands.line),new Me(V,L,0,0,0,0,vn.Commands.move),new Me(V-U*Math.cos(G+Math.PI/4),L-U*Math.sin(G+Math.PI/4),0,0,0,0,vn.Commands.line)],W=new Ae(q,!1,!1,!0);W.noFill(),W.cap="round",W.join="round",W.linewidth=O/7,W.stroke=qe.colorSideLabel.color,Y.add(W);const K=new sr(h.value?"Цвет снизу":"Цвет сверху",10,0);K.size=O,K.weight=600,K.fill=qe.colorSideLabel.color,K.alignment="left",Y.add(K);const ue=Y.getBoundingClientRect();return Y.position.x=(c.width-ue.width)*d+10,Y.position.y=h.value?c.height+ue.height*2:ue.height/2,Y},v=(O,P,V,M)=>{P.vertices[V].bind(ne.Types.change,()=>{const L=P.vertices.length-1,Y=Math.atan2(P.vertices[0].y-P.vertices[L].y,P.vertices[0].x-P.vertices[L].x)*180/Math.PI,U=P.vertices[0].x+(P.vertices[L].x-P.vertices[0].x)/2-8*Math.sin(Y*Math.PI/180),G=P.vertices[0].y+(P.vertices[L].y-P.vertices[0].y)/2-8*Math.cos(Y*Math.PI/180);O.position.x=U+10,O.position.y=G-10,O.rotation=-.5,M&&(M.position.x=P.vertices[0].x+25,M.position.y=P.vertices[0].y-25)})},$=(O,P,V,M,L=!1)=>{var ot;if(O.clear(),V.length===0){O.update();return}const Y=p(V),[U,G,q]=g(O,P,Y,M,L),W=new Ln,K=new Array,ue=new Array;L||(s=[],a=[]),Y.forEach((_e,we)=>{const wt=_e.start.x*U+G,$e=_e.end.x*U+G,Gt=_e.start.y*U+q,pn=_e.end.y*U+q,Rt=new zo(wt,Gt,$e,pn);Rt.linewidth=L?qe.previewLine.size:qe.line.size,Rt.stroke=L?qe.previewLine.color:qe.line.color,a.push(Rt),K.push(Rt),W.add(Rt),!L&&_e.label!==""&&w(_e,Rt,W,we)});const ye=K.at(-1);let ve=W.getBoundingClientRect();if(!L){const _e=S();ue.push(_e)}if(P.length>0){const _e=C(P,K[0],U);W.add(_e)}if(M.length>0&&ye){const _e=N(M,ye,U);W.add(_e)}if(ue.push(W),O.makeGroup(ue),ve=W.getBoundingClientRect(),W.position.x=0-ve.left+(O.width-ve.width)/(2*(L?1:d)),W.position.y=0-ve.top+(O.height-ve.height)/(2*(L?1:d)),O.update(),!L){const _e=((ot=n.value.configuratorParams)==null?void 0:ot.colorSide)==="top";W.position.y=W.position.y+qe.colorSideLabel.size*Number(_e),b(K,W),O.update()}},E=(O,P)=>{if(O&&!P.isNewRec()){const V=new vn({width:O.scrollWidth,height:O.scrollHeight});V.appendTo(O),$(V,[],P.points,[],!0)}},A=()=>{c&&$(c,f.value,u.value,m.value,!1)},R=O=>O*(180/Math.PI),F=(O,P)=>{const V=O[1].x-O[0].x,M=O[1].y-O[0].y,L=P[1].x-P[0].x,Y=P[1].y-P[0].y;let U=Math.atan2(V*Y-M*L,V*L+M*Y);return U=R(U),Math.round(U)*-1},H=O=>{const P=a.map((V,M,L)=>{const Y=L[M-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let U=Math.ceil(V._length/O/n.settings.lineWidthStep)*n.settings.lineWidthStep;const G=s[M-1];U<(L.length>1?n.settings.minLineWidth:n.settings.stripMinWidth)&&(U=L.length>1?n.settings.minLineWidth:n.settings.stripMinWidth),U>n.settings.maxLineWidth&&(U=n.settings.maxLineWidth);const q=F(V.vertices,Y.vertices);return G&&(G.value=`${q}°`),new Tn(U,q,`A-${M+1}`)});r("pointer:move",P)},Q=O=>{let P=null,V;const M=G=>{P=l.find(q=>{const W=q.renderer;return(W==null?void 0:W.elem)===G.target}),[V]=g(O,f.value,u.value.map(q=>q),m.value)},L=G=>{if(P){const q=P.renderer,W=q==null?void 0:q.elem;if(!W)return;const K=W.getBoundingClientRect();P.vertices[0].x-=K.x-(G instanceof MouseEvent?G.clientX:G.targetTouches[0].clientX)+qe.anchorPoint.size/2,P.vertices[0].y-=K.y-(G instanceof MouseEvent?G.clientY:G.targetTouches[0].clientY)+qe.anchorPoint.size/2,H(V),O.update()}},Y=()=>{P&&r("pointer:up",u.value),P=null},U=o.value;U&&(U.addEventListener("touchstart",M,{passive:!0}),U.addEventListener("touchend",Y,{passive:!0}),U.addEventListener("mousedown",M),U.addEventListener("mouseup",Y),U.addEventListener("mousemove",L),U.addEventListener("touchmove",L,{passive:!0}))},Z=(O,P)=>{r("remove-custom-template",O,P)};return i.onMounted(()=>{o.value&&(c=new vn({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),i.watch(()=>n.value,()=>{A()},{deep:!0,immediate:!0}),Q(c))}),i.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(O,P)=>(i.openBlock(),i.createElementBlock("div",z0,[i.createVNode(Qd,{"select-template-index":t.selectTemplateIndex,settings:t.settings,"onTemplate:select":P[0]||(P[0]=V=>r("template:select",V)),onInitDrawTemplate:E,onRemoveCustomTemplate:Z},null,8,["select-template-index","settings"]),i.createElementVNode("div",D0,[i.createElementVNode("div",L0,null,512)])]))}});class ar 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)=>D.isArray(o)?new Tn(o[0],o[1],`A-${s+1}`):new Tn(o.width,o.angle,`A-${s+1}`)),this.isCustom=n.isCustom):(this.label="-- Новая конфигурация --",this.points=[new Tn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class ha extends ar{constructor(n){super(n);T(this,"isDefault");this.isDefault=n.isDefault??!1}}class eu{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 ar(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((n=e.startTailConfigs)==null?void 0:n.map(o=>new ha(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new ha(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 ar(s);return a.isCustom=!0,a.id=+o,a}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new ar({label:"-- Новая конфигурация --",points:[new Tn(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 ar(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 W0={class:"flex flex-col gap-3"},j0={class:"grid gap-5 md:grid-cols-5"},q0={},tu=i.defineComponent({...q0,__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 eu(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"),m=(v=0)=>{var E;const $=(E=c.value.allTemplates)==null?void 0:E.at(v);$!==void 0&&(h.value=v,l.value.configuratorParams.linesWidths=$.points.map(A=>D.isArray(A)?A[0]:A.width),l.value.configuratorParams.linesAngles=$.points.map(A=>D.isArray(A)?A[1]:A.angle),k()),b(l.value.configuratorParams)},p=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const $={label:v,points:l.value.configuratorParams.linesWidths.map((A,R)=>[A,l.value.configuratorParams.linesAngles[R]])},E=A=>{A&&(c.value.addCustomTemplate($),h.value=c.value.allTemplates.length-2),a.value=!1};n.eventEmitter.emit("configurator:create-template",{category:n.cartItem.category,template:$,callback:E})},g=async(v,$)=>{var R;const E=(R=c.value.allTemplates)==null?void 0:R.at(v);if(!E||!E.isCustom)return;const A=F=>{F&&(c.value.removeCustomTemplate(E.id),m()),$==null||$()};n.eventEmitter.emit("configurator:remove-template",{category:n.cartItem.category,templateId:E.id,callback:A})},y=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(h.value=c.value.allTemplates.length-1)},b=async v=>{var $,E;l.value.product=new j.ClientProduct,(E=($=f.value)==null?void 0:$.formReference)==null||E.validate(A=>{A||(k(),o.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:v,validationFieldResultData:u.value,callback:R=>{R?l.value.product=R:u.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},o.value=!1}}))}).catch(D.noop)},_=async()=>{var v,$;($=(v=f.value)==null?void 0:v.formReference)==null||$.validate(E=>{var A,R;if(!E){s.value=!0;const F=new j.OrderItemBase(l.value);(A=c.value.startTailConfigs)!=null&&A.length||delete F.configuratorParams.startTailType,(R=c.value.endTailConfigs)!=null&&R.length||delete F.configuratorParams.endTailType,r("submit",F,u.value,()=>{s.value=!1,i.nextTick(()=>{var H,Q;(Q=(H=f.value)==null?void 0:H.formReference)==null||Q.restoreValidation()})})}}).catch(D.noop)},k=()=>{const v={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach(($,E)=>{v[`lines_widths[${E+1}]`]={},v[`lines_angles[${E+1}]`]={}}),u.value=v},x=v=>{d.value.linesWidths=v.map($=>$.width),d.value.linesAngles=v.map($=>$.angle)},C=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,k(),y(),b(l.value.configuratorParams)},N=(v,$)=>{d.value.linesWidths=v,d.value.linesAngles=$},w=v=>{const $=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,E=0;l.value.configuratorParams.linesWidths.splice(v+1,0,$),l.value.configuratorParams.linesAngles.splice(v+1,0,E),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],k(),y(),b(l.value.configuratorParams)},S=v=>{l.value.configuratorParams.linesWidths.length<=1||(l.value.configuratorParams.linesWidths.splice(v,1),l.value.configuratorParams.linesAngles.splice(v,1),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],k(),y(),b(l.value.configuratorParams))};return i.onMounted(()=>{n.cartItem.isNewRec()?m():(k(),h.value=-1,b(l.value.configuratorParams))}),i.watch(()=>n.cartItem,v=>{l.value=new j.OrderItemBase(v),v.isNewRec()?m():(k(),h.value=-1,b(l.value.configuratorParams))}),(v,$)=>{const E=z.NButton;return i.openBlock(),i.createElementBlock("div",W0,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(E,{key:0,type:"tertiary",class:"self-end",onClick:$[0]||($[0]=A=>r("click:view-switch"))},{default:i.withCtx(()=>[...$[3]||($[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",j0,[i.createVNode(Jd,{value:l.value,"select-template-index":h.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":C,"onPointer:move":x,"onTemplate:select":m,onRemoveCustomTemplate:g},null,8,["value","select-template-index","settings"]),i.createVNode(Fl,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":$[1]||($[1]=A=>l.value=A),"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":$[2]||($[2]=A=>b(A)),"onUpdate:preview":N,onSubmit:_,"onClick:saveTemplate":p,"onClick:addLine":w,"onClick:removeLine":S},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),X0={class:"flex flex-col items-center justify-between rounded-xl"},Y0={class:"img-preview relative flex justify-center"},U0={},K0=i.defineComponent({...U0,__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;return D.keys(n.settings.crossbarCount).reverse().find(a=>s>=n.settings.crossbarCount[Number(a)])}),o=e;return(s,a)=>{const l=z.NButton;return i.openBlock(),i.createElementBlock("div",X0,[i.createElementVNode("div",Y0,[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})])}}}),ma=An(K0,[["__scopeId","data-v-2a790a20"]]),G0={key:0,class:"flex items-baseline gap-1"},Z0={key:0,class:"flex items-baseline gap-1"},Q0={key:1},J0={class:"text-lg font-semibold"},eb={key:2,class:"text-red-500 text-sm mb-2"},tb={class:"flex gap-3"},nb={},nu=i.defineComponent({...nb,__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(()=>et.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(D.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),m=i.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),p=i.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),g=i.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+h.value:0),y=i.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+f.value:0),b=i.ref(r.settings.canSetDopProdaga??!1),_=i.computed(()=>({"configuratorParams.width":[ae.required,ae.min(r.settings.minWidth-h.value),ae.max(m.value-h.value),ae.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ae.required,ae.min(r.settings.minHeight-f.value),ae.max(p.value-f.value),ae.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),k=i.computed(()=>{var R;const S=g.value,v=y.value,{quantity:$}=r.value,E=((R=r.value.product)==null?void 0:R.costRub)||0;if(!S||!v||!$||E===0)return null;const A=S*v/1e6;return(E*$*A).toLocaleString("ru-ru",{minimumFractionDigits:2})}),x=i.computed(()=>{const S=g.value,v=y.value,$=!!(S&&S>=r.settings.minWidth&&S<=r.settings.maxWidths[u.value.configuratorParams.netType]),E=!!(v&&v>=r.settings.minHeight&&v<=r.settings.maxHeights[u.value.configuratorParams.netType]),A=!!(r.value.quantity&&r.value.quantity>0);return $&&E&&A}),C=(S,v)=>{var A,R;const $=u.value.configuratorParams;S&&S in $&&($[S]=v);const E={...$,width:g.value??0,height:y.value??0};S==="width"&&((A=l.value)==null||A.validate().catch(D.noop)),S==="height"&&((R=c.value)==null||R.validate().catch(D.noop)),i.nextTick(()=>{var H,Q;!((H=l.value)!=null&&H.validationErrored)&&!((Q=c.value)!=null&&Q.validationErrored)&&E.height&&E.width&&o("update:params",E),N("configuratorParams",E)})},N=(S,v)=>{const $=new j.OrderItemBase(r.value);$[S]=v,S==="configuratorParams"&&($.product=new j.ClientProduct),o("update:value",$)};return i.watch(()=>r.value,S=>{const v=D.cloneDeep(i.toRaw(S)),$=v.configuratorParams.mountType,E=r.settings.widthOverlaps[$]??0,A=r.settings.heightOverlaps[$]??0;v.configuratorParams.width&&v.configuratorParams.width>0&&(v.configuratorParams.width-=E),v.configuratorParams.height&&v.configuratorParams.height>0&&(v.configuratorParams.height-=A),u.value=v},{deep:!0,immediate:!0}),i.onMounted(()=>{var S;(S=d.value)==null||S.select()}),e({validate:(w=a.value)==null?void 0:w.validate,formReference:a}),(S,v)=>{const $=z.NCheckbox;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.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"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[v[0]||(v[0]=E=>u.value.configuratorParams.netType=E),v[1]||(v[1]=E=>C("netType",E))],options:t.settings.netType.map(E=>({label:t.settings.descriptions.net_type[E],value:E}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[v[2]||(v[2]=E=>u.value.configuratorParams.color=E),v[3]||(v[3]=E=>C("color",E))],options:t.settings.color.map(E=>({label:t.settings.descriptions.color[E],value:E}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[v[4]||(v[4]=E=>u.value.configuratorParams.mountType=E),v[5]||(v[5]=E=>C("mountType",E))],options:t.settings.mountType.map(E=>({label:t.settings.descriptions.mount_type[E],value:E}))},null,8,["value","options"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${t.settings.minWidth-h.value} ${m.value?" до "+(m.value-h.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.width.showFeedback&&g.value>=t.settings.minWidth&&g.value<=t.settings.maxWidths[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",G0,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Ширина готового изделия "+i.toDisplayString(g.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[10]||(v[10]=E=>o("click:instructions-toggle"))},{default:i.withCtx(()=>[...v[25]||(v[25]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[v[6]||(v[6]=E=>u.value.configuratorParams.width=E),v[9]||(v[9]=E=>C("width",E))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[7]||(v[7]=E=>i.unref(st)(E)),onInput:v[8]||(v[8]=E=>i.unref(it)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${t.settings.minHeight-f.value} ${p.value?" до "+(p.value-f.value):""} мм.`},{feedback:i.withCtx(()=>[!t.validation.height.showFeedback&&y.value>=t.settings.minHeight&&y.value<=t.settings.maxHeights[u.value.configuratorParams.netType]?(i.openBlock(),i.createElementBlock("div",Z0,[i.createVNode(i.unref(z.NText),{type:"success"},{default:i.withCtx(()=>[i.createTextVNode("Высота готового изделия "+i.toDisplayString(y.value),1)]),_:1}),i.createVNode(i.unref(z.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[15]||(v[15]=E=>o("click:instructions-toggle"))},{default:i.withCtx(()=>[...v[26]||(v[26]=[i.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):i.createCommentVNode("",!0)]),default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[v[11]||(v[11]=E=>u.value.configuratorParams.height=E),v[14]||(v[14]=E=>C("height",E))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[12]||(v[12]=E=>i.unref(st)(E)),onInput:v[13]||(v[13]=E=>i.unref(it)(t.validation,"height")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[16]||(v[16]=E=>u.value.quantity=E),v[19]||(v[19]=E=>N("quantity",E??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[17]||(v[17]=E=>i.unref(st)(E,!1)),onInput:v[18]||(v[18]=E=>i.unref(it)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[20]||(v[20]=E=>i.unref(it)(t.validation,"marker")),"onUpdate:value":v[21]||(v[21]=E=>{u.value.marker=E??null,N("marker",E??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),b.value?(i.openBlock(),i.createBlock($,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":v[22]||(v[22]=E=>{u.value.isAdditionalSale=E??!1,N("isAdditionalSale",E??!1)})},{default:i.withCtx(()=>[...v[27]||(v[27]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(Cr,{"is-product-searching":t.isProductSearching,product:u.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),k.value?(i.openBlock(),i.createElementBlock("div",Q0,[v[28]||(v[28]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",J0,i.toDisplayString(k.value)+" ₽",1)])):i.createCommentVNode("",!0),x.value?i.createCommentVNode("",!0):(i.openBlock(),i.createElementBlock("div",eb," Пожалуйста, заполните все обязательные поля корректно. ")),i.createElementVNode("div",tb,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!x.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:v[23]||(v[23]=E=>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(z.NButton),{key:0,type:"default",onClick:v[24]||(v[24]=E=>o("click:show-preview-drawer"))},{default:i.withCtx(()=>[...v[29]||(v[29]=[i.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):i.createCommentVNode("",!0)])]),_:1},8,["model","rules"])),[[i.unref(ei),()=>o("submit",u.value)]])}}}),ib="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",rb="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",ob="/img/configurators/mosquitto/measurement-instructions/mount.png",sb="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",ab="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",lb={class:"flex flex-col gap-6"},cb={class:"flex gap-4"},db={class:"flex flex-col gap-2"},ub={class:"flex gap-4"},fb={class:"flex flex-col gap-2"},hb={class:"flex gap-4"},mb={class:"flex flex-col gap-2"},pb={},iu=i.defineComponent({...pb,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(t,{emit:e}){const n=et.initRefDependingOnDeviceResolution("small","small","medium"),r=et.initRefDependingOnDeviceResolution(.98,.95,.8),o=i.computed(()=>window.innerWidth*r.value),s=e;return(a,l)=>{const c=z.NText;return i.openBlock(),i.createBlock(i.unref(z.NModal),{show:t.show,"show-icon":!1,size:i.unref(n),style:i.normalizeStyle(`width: ${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",lb,[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:ib,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:rb,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",cb,[l[9]||(l[9]=i.createElementVNode("img",{src:ob,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",db,[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",ub,[l[15]||(l[15]=i.createElementVNode("img",{src:sb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",fb,[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",hb,[l[21]||(l[21]=i.createElementVNode("img",{src:ab,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),i.createElementVNode("div",mb,[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"])}}}),gb={class:"grid md:grid-cols-2"},yb={},ru=i.defineComponent({...yb,__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(()=>et.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)),m=D.debounce(async g=>{var y,b;l.value.product=new j.ClientProduct,(b=(y=c.value)==null?void 0:y.formReference)==null||b.validate(_=>{_||(u.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:g,validationFieldResultData:d.value,callback:k=>{k?l.value.product=k:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(D.noop)},f.value),p=()=>{h.value=!0,r("submit",l.value,d.value,()=>{h.value=!1})};return i.watch(()=>n.cartItem,g=>{l.value=g},{deep:!0}),(g,y)=>{const b=Do;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createVNode(iu,{show:a.value,"onUpdate:show":y[0]||(y[0]=_=>a.value=_),"height-overlaps":t.settings.heightOverlaps,"width-overlaps":t.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),i.createElementVNode("div",gb,[o.value?(i.openBlock(),i.createBlock(i.unref(z.NDrawer),{key:1,show:s.value,"onUpdate:show":y[4]||(y[4]=_=>s.value=_),"default-width":375,resizable:""},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NDrawerContent),null,{header:i.withCtx(()=>[i.createVNode(i.unref(z.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:y[2]||(y[2]=_=>s.value=!1)},{default:i.withCtx(()=>[i.createVNode(b)]),_:1})]),default:i.withCtx(()=>[i.createVNode(ma,{"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:y[3]||(y[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(i.openBlock(),i.createBlock(ma,{key:0,"configurator-params":l.value.configuratorParams,settings:t.settings,onOpenInstructions:y[1]||(y[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),i.createVNode(nu,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":y[5]||(y[5]=_=>l.value=_),validation:d.value,settings:t.settings,"is-product-searching":u.value,"is-submit-processing":h.value,"onUpdate:params":y[6]||(y[6]=_=>i.unref(m)(_)),onSubmit:y[7]||(y[7]=_=>p()),"onClick:instructionsToggle":y[8]||(y[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":y[9]||(y[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),bb={},ou=i.defineComponent({...bb,__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},isLastLine:{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 m;return!((m=c.value)!=null&&m.validationErrored)}),u=m=>{l.value=m,o("update:value",m,r.index,a)},h=m=>{st(m),(m.key==="Enter"||m.code==="Enter")&&!r.isLastLine&&(m.preventDefault(),m.stopPropagation())},f=()=>{var m;(m=s.value)==null||m.select()};return i.watch(()=>r.value,m=>{l.value=m}),i.onMounted(()=>{r.autoFocus&&i.nextTick(()=>{f()})}),e({isValid:d,formItemReference:c}),(m,p)=>{const g=Pl,y=io;return i.openBlock(),i.createBlock(i.unref(z.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(Cr,{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(z.NDropdown),{trigger:"click",options:t.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:i.unref(lt),placeholder:"Введите ширину",onKeydown:h,onInput:p[0]||(p[0]=b=>i.unref(it)(t.validation,`linesWidths.${t.index}`)),onFocus:i.unref(Le),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),i.createVNode(i.unref(z.NButton),{disabled:t.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:p[1]||(p[1]=b=>o("click:add-line",t.index))},{default:i.withCtx(()=>[i.createVNode(g)]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NButton),{disabled:t.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:p[2]||(p[2]=b=>o("click:remove-line",t.index))},{default:i.withCtx(()=>[i.createVNode(y)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),_b={class:"my-2 flex w-full flex-col"},wb={key:1},xb={class:"text-lg font-semibold"},kb={class:"flex gap-3"},vb={},su=i.defineComponent({...vb,__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(D.cloneDeep(r.value)),c=i.computed(()=>{const k={length:[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return D.forEach(l.value,(x,C)=>{var N;k[`configuratorParams.linesWidths.${C}`]=[ae.required,ae.min(r.settings.minLineWidth),ae.step(r.settings.lineWidthStep),We.serverValidation((N=r.validation[`linesWidths.${C}`])==null?void 0:N.feedback)]}),k}),d=i.ref(r.settings.canSetDopProdaga??!1),u=i.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((k,x)=>(k??0)+(x??0),0)),h=i.computed(()=>r.settings.width-u.value),f=i.computed(()=>!r.value.some(({product:k})=>!k||k.isNewRec())),m=i.computed(()=>r.isSubmitProcessing||!f.value||h.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(k=>k.product.isNewRec())),p=i.computed(()=>k=>h.value===0?void 0:[{label:`${(h.value>0?"Остаток +":"Излишек ")+h.value} мм.`,key:h.value+k}]),g=i.computed(()=>{const{length:k}=r.value[0];return!k||u.value!==r.settings.width?null:(D.reduce(r.value,(C,N)=>{var S;const w=((S=N.product)==null?void 0:S.costRub)||0;return C+w},0)*r.value[0].quantity*k).toLocaleString("ru-ru",{minimumFractionDigits:2})}),y=(k,x,C)=>{var w,S,v;l.value[x].product.id=-1;const{configuratorParams:N}=l.value[x];N.linesWidths[x]=k,b("configuratorParams",N),(v=(S=(w=a.value)==null?void 0:w.at(x))==null?void 0:S.formItemReference)==null||v.validate().catch(D.noop),i.nextTick(()=>{var $,E;(E=($=a.value)==null?void 0:$.at(x))!=null&&E.isValid&&o("update:params",N,x,C)})},b=(k,x)=>{l.value.forEach(C=>{C[k]=x}),o("update:value",l.value)};return i.watch(()=>r.value,k=>{l.value=D.cloneDeep(k)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(k,x)=>{const C=z.NCheckbox;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var N;return[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(l.value,(w,S)=>{var v,$,E;return i.openBlock(),i.createBlock(ou,{key:S,ref_for:!0,ref:"line-items-reference",value:((v=w.configuratorParams)==null?void 0:v.linesWidths.at(S))??null,"auto-focus":((($=w.configuratorParams)==null?void 0:$.linesWidths.at(S))??0)===0,index:S,path:`configuratorParams.linesWidths.${S}`,product:w.product,settings:t.settings,validation:t.validation,"suggestion-option":p.value(((E=w.configuratorParams)==null?void 0:E.linesWidths.at(S))??0),"add-line-button-disabled":h.value<=0||t.value.length>=t.settings.maxLinesCount||t.value.some(A=>A.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"is-last-line":S===l.value.length-1&&h.value===0,"onUpdate:value":y,"onClick:addLine":x[0]||(x[0]=A=>o("click:add-line",A)),"onClick:removeLine":x[1]||(x[1]=A=>o("click:remove-line",A))},null,8,["value","auto-focus","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled","is-last-line"])}),128)),i.createElementVNode("div",_b,[h.value<0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:0,type:"error"},{default:i.withCtx(()=>[i.createTextVNode(" Сумма ширин всех полос должна быть равна "+i.toDisplayString(t.settings.width),1)]),_:1})):i.createCommentVNode("",!0),f.value&&l.value.length===t.settings.maxLinesCount&&h.value>0?(i.openBlock(),i.createBlock(i.unref(z.NText),{key:1,type:"error"},{default:i.withCtx(()=>[...x[15]||(x[15]=[i.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",null,[x[16]||(x[16]=i.createTextVNode(" Остаток для резки: ",-1)),i.createVNode(i.unref(z.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(z.NButton),{disabled:m.value,type:"primary",class:"self-center",onClick:x[2]||(x[2]=w=>o("click:add-line",l.value.length))},{default:i.withCtx(()=>[...x[17]||(x[17]=[i.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),i.createVNode(i.unref(z.NFormItem),{path:"length",label:`Метраж ${t.settings.minLength?" от "+t.settings.minLength:""} ${t.settings.maxLength?" до "+t.settings.maxLength:""} м.`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].length,"onUpdate:value":[x[3]||(x[3]=w=>l.value[0].length=w),x[6]||(x[6]=w=>b("length",w))],parse:i.unref(lt),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:x[4]||(x[4]=w=>i.unref(st)(w,!1)),onInput:x[5]||(x[5]=w=>i.unref(it)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[x[7]||(x[7]=w=>l.value[0].quantity=w),x[10]||(x[10]=w=>b("quantity",w))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:x[8]||(x[8]=w=>i.unref(st)(w,!1)),onInput:x[9]||(x[9]=w=>i.unref(it)(t.validation,"quantity")),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:x[11]||(x[11]=w=>i.unref(it)(t.validation,"marker")),"onUpdate:value":x[12]||(x[12]=w=>{l.value[0].marker=w??null,b("marker",w??null)}),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(C,{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,b("isAdditionalSale",w??!1)})},{default:i.withCtx(()=>[...x[18]||(x[18]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),g.value?(i.openBlock(),i.createElementBlock("div",wb,[x[19]||(x[19]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",xb,i.toDisplayString(g.value)+" ₽",1)])):i.createCommentVNode("",!0),i.createElementVNode("div",kb,[i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:!f.value||h.value!=0||!((N=l.value[0])!=null&&N.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"])),[[i.unref(ei),()=>o("submit",l.value)]])}}}),Cb={class:"flex grow flex-col"},Sb=["src"],Bb={class:"w-full"},Tb={},au=i.defineComponent({...Tb,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",Cb,[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,Sb),i.createElementVNode("div",Bb,[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)])]))}}),Nb={class:"flex flex-col gap-2"},$b={class:"w-104 flex grow flex-col px-5"},Rb={},lu=i.defineComponent({...Rb,__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 p;return(p=s.value[0].configuratorParams)==null?void 0:p.linesWidths.reduce((g,y)=>(g??0)+(y??0),0)}),u=p=>{p===void 0&&(p=s.value.length-1);const g=s.value.at(0);if(!g)return;g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(p+1,0,null),s.value.forEach(b=>{b.configuratorParams.linesWidths=g.configuratorParams.linesWidths});const y=new j.OrderItemBase({quantity:(g==null?void 0:g.quantity)??1,category:g==null?void 0:g.category,length:(g==null?void 0:g.length)??n.settings.minLength,marker:g==null?void 0:g.marker,configuratorParams:{linesWidths:g==null?void 0:g.configuratorParams.linesWidths}});s.value=s.value.toSpliced(p+1,0,y)},h=p=>{const g=s.value.at(0);g&&(g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(p,1),s.value.forEach(y=>{y.configuratorParams.linesWidths=g.configuratorParams.linesWidths}),s.value=s.value.toSpliced(p,1),delete a[`linesWidths.${p}`],delete a[`linesWidths.${p}`])},f=D.debounce(async(p,g,y)=>{const b={linesWidths:p.linesWidths.at(g)};y.value=!0,a.value[`linesWidths.${g}`]={},s.value[g].product=new j.ClientProduct,n.eventEmitter.emit("configurator:search-product",{category:s.value[g].category,params:b,validationFieldResultData:a.value,callback:_=>{_?(s.value[g].product=_,g===s.value.length-1&&s.value.length<n.settings.maxLinesCount&&d.value&&d.value<n.settings.width&&u()):(s.value[g].product=new j.ClientProduct,a.value[`linesWidths.${g}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},y.value=!1),y.value=!1}})},c.value),m=async()=>{var p,g;(g=(p=o.value)==null?void 0:p.formReference)==null||g.validate(y=>{if(!y){l.value=!0;const b=s.value.at(0);if(!b)return;r("submit",b,a.value,()=>{l.value=!1,i.nextTick(()=>{var _,k;(k=(_=o.value)==null?void 0:_.formReference)==null||k.restoreValidation()})})}}).catch(D.noop)};return i.watch(()=>n.cartItems,p=>{s.value=p.map(g=>new j.OrderItemBase(g))}),(p,g)=>{const y=z.NButton;return i.openBlock(),i.createElementBlock("div",Nb,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(y,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=b=>r("click:view-switch"))},{default:i.withCtx(()=>[...g[3]||(g[3]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",$b,[i.createVNode(au,{value:s.value,"onUpdate:value":g[1]||(g[1]=b=>s.value=b),settings:t.settings},null,8,["value","settings"]),i.createVNode(su,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":g[2]||(g[2]=b=>s.value=b),validation:a.value,settings:t.settings,"is-submit-processing":l.value,"onUpdate:params":i.unref(f),onSubmit:m,"onClick:addLine":u,"onClick:removeLine":h},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Eb={class:"flex flex-col gap-3"},Pb={},cu=i.defineComponent({...Pb,__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 m;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("first-input-element"),l=i.ref(D.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),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ae.required,ae.min(r.settings.minLength),ae.max(r.settings.maxLength),ae.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[ae.required,ae.min(1),ae.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.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=(p,g)=>{const y=new j.OrderItemBase(r.value);y[p]=g,p==="configuratorParams"&&(y.product=new j.ClientProduct),o("update:value",y)},f=()=>{var p;(p=a.value)==null||p.select()};return i.watch(()=>r.value,p=>{l.value=D.cloneDeep(p)},{deep:!0}),i.onMounted(()=>{r.value.isNewRec()&&i.nextTick(()=>{f()})}),e({validate:(m=s.value)==null?void 0:m.validate,formReference:s}),(p,g)=>{const y=z.NCheckbox;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:t.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${t.settings.minWidth?" от "+t.settings.minWidth:""}${t.settings.maxWidth?" до "+t.settings.maxWidth:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[g[0]||(g[0]=b=>l.value.configuratorParams.width=b),u],class:"w-full",parse:i.unref(lt),"show-button":!1,placeholder:"Введите ширину",onKeydown:g[1]||(g[1]=b=>i.unref(st)(b)),onInput:g[2]||(g[2]=b=>i.unref(it)(t.validation,"width")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"configuratorParams.length",label:`Длина, ${t.settings.minLength?" от "+t.settings.minLength:""}${t.settings.maxLength?" до "+t.settings.maxLength:""} мм`},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[g[3]||(g[3]=b=>l.value.configuratorParams.length=b),u],placeholder:"Введите длину",parse:i.unref(lt),"show-button":!1,class:"w-full",onKeydown:g[4]||(g[4]=b=>i.unref(st)(b)),onInput:g[5]||(g[5]=b=>i.unref(it)(t.validation,"length")),onFocus:i.unref(Le)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),i.createVNode(i.unref(z.NFormItem),{path:"quantity",label:"Количество"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:t.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:g[6]||(g[6]=b=>i.unref(st)(b,!1)),onInput:g[7]||(g[7]=b=>i.unref(it)(t.validation,"quantity")),"onUpdate:value":g[8]||(g[8]=b=>h("quantity",b??0)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:t.value.marker??null,placeholder:"Введите маркировку",onInput:g[9]||(g[9]=b=>i.unref(it)(t.validation,"marker")),"onUpdate:value":g[10]||(g[10]=b=>h("marker",b??null)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1}),d.value?(i.openBlock(),i.createBlock(y,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":g[11]||(g[11]=b=>{l.value.isAdditionalSale=b??!1,h("isAdditionalSale",b??!1)})},{default:i.withCtx(()=>[...g[13]||(g[13]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(Cr,{"is-product-searching":t.isProductSearching,product:t.value.product,validation:t.validation.product},null,8,["is-product-searching","product","validation"]),i.createElementVNode("div",Eb,[i.createVNode(i.unref(z.NButton),{disabled:t.value.product.isNewRec()||t.isProductSearching||t.isSubmitProcessing||t.value.length===0||t.value.width===0||t.value.quantity===0,type:"primary",class:"self-start",onClick:g[12]||(g[12]=b=>o("submit",t.value))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])),[[i.unref(ei),()=>o("submit",l.value)]])}}}),Fb={class:"flex flex-col gap-2 w-72"},Vb={},du=i.defineComponent({...Vb,__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=D.debounce(async f=>{var m,p;s.value.product=new j.ClientProduct,(p=(m=o.value)==null?void 0:m.formReference)==null||p.validate(g=>{g||(l.value=!0,n.eventEmitter.emit("configurator:search-product",{category:n.cartItem.category,params:f,validationFieldResultData:a.value,callback:y=>{y?s.value.product=y:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(D.noop)},d.value),h=async()=>{var f,m;(m=(f=o.value)==null?void 0:f.formReference)==null||m.validate(p=>{p||(c.value=!0,r("submit",s.value,a.value,()=>{c.value=!1,i.nextTick(()=>{var g,y;(y=(g=o.value)==null?void 0:g.formReference)==null||y.restoreValidation()})}))}).catch(D.noop)};return i.watch(()=>n.cartItem,f=>{s.value=new j.OrderItemBase(f)},{deep:!0}),(f,m)=>{const p=z.NButton;return i.openBlock(),i.createElementBlock("div",Fb,[t.settings.allowShowTable?(i.openBlock(),i.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:m[0]||(m[0]=g=>r("click:view-switch"))},{default:i.withCtx(()=>[...m[4]||(m[4]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(cu,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":m[1]||(m[1]=g=>s.value=g),validation:a.value,settings:t.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":m[2]||(m[2]=g=>i.unref(u)(g)),onSubmit:m[3]||(m[3]=g=>h())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Mb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ab(t,e){return i.openBlock(),i.createElementBlock("svg",Mb,[...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 uu=i.markRaw({name:"ion-add",render:Ab}),Ib={key:0,class:"-mt-1 text-sm text-gray-500"},Ob={class:"font-bold"},zb={class:"flex flex-col gap-3"},Db={key:0,class:"mt-4 flex flex-col gap-1.5"},Lb={class:"flex flex-col gap-1 text-sm text-gray-700"},Hb={key:0},Wb={key:1},jb={"form-array-name":"items",class:"flex flex-col gap-3"},qb={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},Xb={key:0,class:"flex flex-wrap items-end gap-2"},Yb={class:"whitespace-nowrap text-xl font-bold"},Ub={key:0,class:"whitespace-nowrap text-lg text-gray-500"},Kb={class:"font-bold"},Gb={class:"font-bold"},Zb={class:"flex gap-3"},Qb={},fu=i.defineComponent({...Qb,__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 P;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.ref(D.cloneDeep(r.value)),l=i.ref({...r.validation}),c=V=>{var M;delete l.value[V],(M=s.value)==null||M.restoreValidation()};i.watch(()=>r.validation,V=>{l.value={...V},Object.values(V).some(L=>L==null?void 0:L.feedback)&&i.nextTick(()=>{var L;return(L=s.value)==null?void 0:L.validate(D.noop).catch(D.noop)})},{deep:!0});const d=i.computed(()=>r.value.category),u=i.ref(null),h=i.ref(null),f=i.computed(()=>d.value.products??[]),m=i.computed(()=>f.value.map(V=>({label:V.name,value:V.id}))),p=(V,M,L)=>{const Y=V!=null&&V>0,U=M!=null&&M>0;return!Y&&!U?null:Y&&U?`от ${V} ${L} до ${M} ${L}`:Y?`от ${V} ${L}`:`до ${M} ${L}`},g=i.computed(()=>{var V,M;return p(r.settings.minWidth,(M=(V=u.value)==null?void 0:V.properties)==null?void 0:M.width,"мм")}),y=i.computed(()=>{var V,M;return p(r.settings.minLength,(M=(V=u.value)==null?void 0:V.properties)==null?void 0:M.length,"мм")}),b=i.ref(null),_=i.ref(!1),k=i.computed(()=>{var M;const V={marker:[We.serverValidation((M=l.value.marker)==null?void 0:M.feedback)]};return a.value.configuratorParams.items.forEach((L,Y)=>{var U,G,q,W,K,ue,ye;V[`configuratorParams.items.${Y}.width`]=[ae.required,ae.min(r.settings.minWidth),...(G=(U=u.value)==null?void 0:U.properties)!=null&&G.width?[ae.max(u.value.properties.width)]:[],ae.step(1),We.serverValidation((q=l.value[`items.${Y}.width`])==null?void 0:q.feedback)],V[`configuratorParams.items.${Y}.length`]=[ae.required,ae.min(r.settings.minLength),...(K=(W=u.value)==null?void 0:W.properties)!=null&&K.length?[ae.max(u.value.properties.length)]:[],ae.step(1),We.serverValidation((ue=l.value[`items.${Y}.length`])==null?void 0:ue.feedback)],V[`configuratorParams.items.${Y}.count`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((ye=l.value[`items.${Y}.count`])==null?void 0:ye.feedback)]}),V}),x=i.ref(r.settings.canSetDopProdaga??!1),C=i.computed(()=>a.value.configuratorParams.items.some(V=>{var M,L;return!u.value||!V.width||V.width<r.settings.minWidth||V.width>(((M=u.value.properties)==null?void 0:M.width)??0)||V.length===0||V.length<r.settings.minLength||V.length>(((L=u.value.properties)==null?void 0:L.length)??0)||!V.count||V.count<1})),N=i.computed(()=>!u.value||C.value||a.value.configuratorParams.items.length===0),w=i.ref(null),S=V=>{if(!V){u.value=null,h.value=null,a.value.product=new j.ClientProduct,b.value=null;return}const M=f.value.find(L=>L.id===V);M&&(u.value=M,h.value=V,a.value.product=M,Z("product",a.value.product),a.value.configuratorParams.items.forEach(L=>{var Y,U;(Y=M.properties)!=null&&Y.width&&L.width>M.properties.width&&(L.width=M.properties.width),(U=M.properties)!=null&&U.length&&L.length>M.properties.length&&(L.length=M.properties.length)}),$())};let v=!1;const $=()=>{v=!0,b.value=null,w.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},E=async()=>{var V;if(!u.value||a.value.configuratorParams.items.length===0||C.value){$();return}(V=s.value)==null||V.validate(M=>{if(M){$();return}if(_.value=!0,!u.value||!d.value){$(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:a.value.configuratorParams.items},callback:L=>{L?(b.value=L,a.value.configuratorParams.calculationId=L.id,a.value.quantity=L.quantity,i.nextTick(()=>{Z("quantity",L.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,$()),Z("configuratorParams",a.value.configuratorParams),A(),_.value=!1}})}).catch(()=>{$(),_.value=!1})},A=()=>{var M;if(!((M=u.value)!=null&&M.costRub)||!b.value){w.value=null;return}const V=b.value.quantity*u.value.costRub;w.value=Math.round(V*100)/100},R=V=>{var L,Y;const M=a.value.configuratorParams.items[V];u.value&&((L=u.value.properties)!=null&&L.width&&M.width>u.value.properties.width&&(M.width=u.value.properties.width),(Y=u.value.properties)!=null&&Y.length&&M.length>u.value.properties.length&&(M.length=u.value.properties.length)),Z("configuratorParams",a.value.configuratorParams),$()},F=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),Z("configuratorParams",a.value.configuratorParams),$(),o("add-item",a.value.configuratorParams.items.length)},H=V=>{a.value.configuratorParams.items.splice(V,1),Z("configuratorParams",a.value.configuratorParams),$(),o("remove-item",V)},Q=()=>{if(!(N.value||_.value||r.isSubmitProcessing)){if(!b.value){E();return}o("submit",a.value)}},Z=(V,M)=>{const L=new j.OrderItemBase(r.value);L[V]=M,o("update:value",L)};i.watch(()=>r.value,V=>{const M=D.cloneDeep(i.toRaw(V));(!M.configuratorParams.items||M.configuratorParams.items.length===0)&&(M.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=M,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),v?v=!1:O()},{deep:!0});const O=()=>{const{calculationId:V}=a.value.configuratorParams,M=a.value.quantity??0;V&&M>0&&a.value.product&&!a.value.product.isNewRec()&&(b.value={id:V,quantity:M,sheets:[]},A())};return i.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,h.value=r.value.product.id),O()}),e({validate:(P=s.value)==null?void 0:P.validate,formReference:s}),(V,M)=>{const L=io,Y=uu;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:a.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var U;return[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:h.value,"onUpdate:value":[M[0]||(M[0]=G=>h.value=G),S],options:m.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((U=u.value)==null?void 0:U.costRub)!=null?(i.openBlock(),i.createElementBlock("div",Ib,[i.createElementVNode("span",Ob,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",zb,[u.value?(i.openBlock(),i.createElementBlock("div",Db,[M[7]||(M[7]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",Lb,[g.value?(i.openBlock(),i.createElementBlock("div",Hb,"Ширина "+i.toDisplayString(g.value)+".",1)):i.createCommentVNode("",!0),y.value?(i.openBlock(),i.createElementBlock("div",Wb,"Длина "+i.toDisplayString(y.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",jb,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value.configuratorParams.items,(G,q)=>(i.openBlock(),i.createElementBlock("div",{key:q,class:"flex grow gap-2"},[i.createElementVNode("div",qb,[i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${q}.width`,label:"Ширина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[q].width,"onUpdate:value":[W=>a.value.configuratorParams.items[q].width=W,W=>R(q)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:M[1]||(M[1]=W=>i.unref(st)(W)),onInput:W=>c(`items.${q}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${q}.length`,label:"Длина, мм"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[q].length,"onUpdate:value":[W=>a.value.configuratorParams.items[q].length=W,W=>R(q)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:M[2]||(M[2]=W=>i.unref(st)(W)),onInput:W=>c(`items.${q}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`configuratorParams.items.${q}.count`,label:"Количество, шт"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:a.value.configuratorParams.items[q].count,"onUpdate:value":[W=>a.value.configuratorParams.items[q].count=W,W=>R(q)],parse:i.unref(lt),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:M[3]||(M[3]=W=>i.unref(st)(W,!1)),onInput:W=>c(`items.${q}.count`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createVNode(i.unref(z.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:W=>H(q)},{default:i.withCtx(()=>[i.createVNode(L)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,disabled:C.value,type:"default",class:"self-center",onClick:F},{default:i.withCtx(()=>[i.createVNode(Y),M[8]||(M[8]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0)]),i.createVNode(i.unref(z.NFormItem),{path:"marker",label:"Маркировка распила"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:M[4]||(M[4]=G=>c("marker")),"onUpdate:value":M[5]||(M[5]=G=>Z("marker",G??null)),onFocus:i.unref(Le)},null,8,["value","disabled","onFocus"])]),_:1}),x.value?(i.openBlock(),i.createBlock(i.unref(z.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":M[6]||(M[6]=G=>{a.value.isAdditionalSale=G??!1,Z("isAdditionalSale",G??!1)})},{default:i.withCtx(()=>[...M[9]||(M[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NSpin),{show:_.value,size:"small",class:"grow"},{default:i.withCtx(()=>{var G;return[b.value&&u.value&&w.value?(i.openBlock(),i.createElementBlock("div",Xb,[i.createElementVNode("div",null,[M[10]||(M[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",Yb,i.toDisplayString(w.value.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol),1)]),b.value.quantity&&u.value?(i.openBlock(),i.createElementBlock("div",Ub,[i.createElementVNode("span",Kb,"("+i.toDisplayString(b.value.quantity)+" шт.",1),M[11]||(M[11]=i.createTextVNode(" x ",-1)),i.createElementVNode("span",Gb,i.toDisplayString((G=u.value.costRub)==null?void 0:G.toLocaleString())+" "+i.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]}),_:1},8,["show"]),i.createElementVNode("div",Zb,[b.value&&!_.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,loading:t.isSubmitProcessing,disabled:N.value||_.value,type:"primary",class:"self-start",onClick:Q},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:1,loading:_.value,disabled:N.value||_.value,type:"info",class:"self-start",onClick:E},{default:i.withCtx(()=>[...M[12]||(M[12]=[i.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])),[[i.unref(ei),Q]])}}}),Jb={class:"flex flex-col gap-2"},e1={class:"w-104 flex grow flex-col px-5"},t1={},hu=i.defineComponent({...t1,__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(m=>{if(!m){l.value=!0;const p=D.cloneDeep(s.value);"items"in p.configuratorParams&&delete p.configuratorParams.items,r("submit",p,a.value,()=>{l.value=!1,i.nextTick(()=>{var g,y;(y=(g=o.value)==null?void 0:g.formReference)==null||y.restoreValidation()})})}}).catch(D.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 m=z.NButton;return i.openBlock(),i.createElementBlock("div",Jb,[t.settings.allowShowTable&&s.value.isNewRec()?(i.openBlock(),i.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:f[0]||(f[0]=p=>r("click:view-switch"))},{default:i.withCtx(()=>[...f[2]||(f[2]=[i.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",e1,[i.createVNode(fu,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":f[1]||(f[1]=p=>s.value=p),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"])])])}}}),n1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function i1(t,e){return i.openBlock(),i.createElementBlock("svg",n1,[...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 r1=i.markRaw({name:"ion-checkmark",render:i1}),o1={key:0,class:"-mt-1 text-sm text-gray-500"},s1={class:"font-bold"},a1={class:"flex flex-col gap-3"},l1={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},c1={class:"flex flex-col gap-1 text-sm text-gray-700"},d1={key:0},u1={key:1},f1={"form-array-name":"items",class:"flex flex-col gap-3"},h1={class:"min-w-0 flex-1"},m1={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},p1={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},g1={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},y1={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},b1={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},_1={key:0,class:"lg:!flex-[2]"},w1={class:"font-bold"},x1={key:1,class:"lg:!flex-[3]"},k1={class:"font-bold"},v1={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"},C1={key:0},S1={class:"font-bold"},B1={key:1},T1={class:"font-bold"},N1={class:"flex flex-wrap items-center gap-3"},$1={},mu=i.defineComponent({...$1,__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 G;const r=t,o=n,s=i.useTemplateRef("form-reference"),a=i.useTemplateRef("widthInputs"),l=r.value==null?[]:D.cloneDeep(i.toRaw(r.value)),c=i.ref(l.map(q=>new j.OrderItemBase(q))),d=i.computed(()=>({items:c.value})),u=i.ref({...r.validation}),h=q=>{var W;delete u.value[q],(W=s.value)==null||W.restoreValidation()},f=i.ref(null),m=i.ref(null),p=i.computed(()=>{var q,W;return((W=(q=c.value[0])==null?void 0:q.category)==null?void 0:W.products)??[]}),g=i.computed(()=>p.value.map(q=>({label:q.name,value:q.id}))),y=(q,W,K)=>{const ue=q!=null&&q>0,ye=W!=null&&W>0;return!ue&&!ye?null:ue&&ye?`от ${q} ${K} до ${W} ${K}`:ue?`от ${q} ${K}`:`до ${W} ${K}`},b=i.computed(()=>{var q,W;return y(r.settings.minWidth,(W=(q=f.value)==null?void 0:q.properties)==null?void 0:W.width,"мм")}),_=i.computed(()=>{var q,W;return y(r.settings.minLength,(W=(q=f.value)==null?void 0:q.properties)==null?void 0:W.length,"мм")}),k=i.computed(()=>{const q={};return c.value.forEach((W,K)=>{var ue,ye,ve,ot,_e,we,wt,$e;q[`items.${K}.configuratorParams.width`]=[ae.required,ae.min(r.settings.minWidth),...(ye=(ue=f.value)==null?void 0:ue.properties)!=null&&ye.width?[ae.max(f.value.properties.width)]:[],ae.step(1),We.serverValidation((ve=u.value[`items.${K}.width`])==null?void 0:ve.feedback)],q[`items.${K}.configuratorParams.length`]=[ae.required,ae.min(r.settings.minLength),...(_e=(ot=f.value)==null?void 0:ot.properties)!=null&&_e.length?[ae.max(f.value.properties.length)]:[],ae.step(1),We.serverValidation((we=u.value[`items.${K}.length`])==null?void 0:we.feedback)],q[`items.${K}.quantity`]=[ae.required,ae.min(1),ae.step(1),We.serverValidation((wt=u.value[`items.${K}.quantity`])==null?void 0:wt.feedback)],q[`items.${K}.marker`]=[We.serverValidation(($e=u.value[`items.${K}.marker`])==null?void 0:$e.feedback)]}),q});i.watch(()=>r.validation,q=>{u.value={...q},Object.values(q).some(K=>K==null?void 0:K.feedback)&&i.nextTick(()=>{var K;return(K=s.value)==null?void 0:K.validate(D.noop).catch(D.noop)})},{deep:!0});const x=i.ref(r.settings.canSetDopProdaga??!1),C=i.computed(()=>{const q=f.value;return q?c.value.some(W=>{var ve,ot;const K=W.configuratorParams,ue=(ve=q.properties)==null?void 0:ve.width,ye=(ot=q.properties)==null?void 0:ot.length;return K.width===0||K.width<r.settings.minWidth||ue!=null&&K.width>ue||K.length===0||K.length<r.settings.minLength||ye!=null&&K.length>ye||W.quantity===0||W.quantity<1}):!0}),N=i.computed(()=>!f.value||C.value||c.value.length===0),w=i.computed(()=>{const q=c.value[0];return q!=null&&!q.isNewRec()}),S=q=>r.itemStates[q]??"idle",v=q=>S(q)==="success",$=q=>S(q)==="loading",E=i.computed(()=>c.value.length===0?!0:c.value.every((q,W)=>{const K=S(W);return K==="success"||K==="loading"})),A=q=>q.width===0||q.length===0?0:q.width*q.length/1e6,R=q=>A(q).toLocaleString(void 0,{maximumFractionDigits:4}),F=q=>{var ve;const W=q.configuratorParams,K=A(W),ue=((ve=f.value)==null?void 0:ve.costRub)??0,ye=q.quantity??0;return!K||!ye?0:Math.round(K*ue*ye*100)/100},H=i.computed(()=>D.sum(c.value.map(q=>{const W=q.configuratorParams;return!W.width||W.length===0||!q.quantity?0:W.width*W.length*q.quantity/1e6}))),Q=i.computed(()=>Math.round(D.sum(c.value.map(q=>F(q)))*100)/100),Z=()=>{var q,W,K;return new j.OrderItemBase({category:(q=c.value[0])==null?void 0:q.category,configurator:(W=c.value[0])==null?void 0:W.configurator,product:f.value??new j.ClientProduct,quantity:1,isAdditionalSale:(K=c.value[0])==null?void 0:K.isAdditionalSale,configuratorParams:{width:0,length:0}})},O=q=>{if(!q){f.value=null,m.value=null,c.value.forEach(K=>{K.product=new j.ClientProduct}),o("update:value",c.value);return}const W=p.value.find(K=>K.id===q);W&&(f.value=W,m.value=q,c.value.forEach((K,ue)=>{var ye,ve;K.product=W,(ye=W.properties)!=null&&ye.width&&K.configuratorParams.width>W.properties.width&&(K.configuratorParams.width=W.properties.width),(ve=W.properties)!=null&&ve.length&&K.configuratorParams.length>W.properties.length&&(K.configuratorParams.length=W.properties.length),o("item-reset",ue)}),o("update:value",c.value))},P=q=>{var ue,ye;const W=c.value[q],K=f.value;K&&((ue=K.properties)!=null&&ue.width&&W.configuratorParams.width>K.properties.width&&(W.configuratorParams.width=K.properties.width),(ye=K.properties)!=null&&ye.length&&W.configuratorParams.length>K.properties.length&&(W.configuratorParams.length=K.properties.length)),o("item-reset",q),o("update:value",c.value)},V=(q,W)=>{c.value[q].marker=W===null||W===""?void 0:W,o("item-reset",q),o("update:value",c.value)},M=q=>{c.value.forEach(W=>{W.isAdditionalSale=q}),o("update:value",c.value)},L=()=>{c.value.push(Z()),o("update:value",c.value),o("add-item",c.value.length),i.nextTick(()=>{var W,K,ue,ye;const q=c.value.length-1;(K=(W=a.value)==null?void 0:W[q])==null||K.focus(),(ye=(ue=a.value)==null?void 0:ue[q])==null||ye.select()})},Y=q=>{c.value.splice(q,1),o("update:value",c.value),o("remove-item",q)};i.watch(()=>r.value,q=>{var ye;const K=(q==null?[]:D.cloneDeep(i.toRaw(q))).map(ve=>new j.OrderItemBase(ve));c.value=K.length>0?K:[Z()];const ue=(ye=c.value[0])==null?void 0:ye.product;ue&&!ue.isNewRec()?(f.value=ue,m.value=ue.id):(f.value=null,m.value=null)},{deep:!0});const U=()=>{var W;if(f.value!==null)return;const q=(W=p.value[0])==null?void 0:W.id;q!=null&&O(q)};return i.watch(p,()=>{U()}),i.onMounted(()=>{var W;c.value.length===0&&(c.value=[Z()]);const q=(W=c.value[0])==null?void 0:W.product;q&&!q.isNewRec()&&(f.value=q,m.value=q.id),U()}),e({validate:(G=s.value)==null?void 0:G.validate,formReference:s}),(q,W)=>{const K=r1,ue=io,ye=uu;return i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{ref:"form-reference",model:d.value,rules:k.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>{var ve,ot;return[i.createVNode(i.unref(z.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NSelect),{value:m.value,"onUpdate:value":[W[0]||(W[0]=_e=>m.value=_e),O],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((ve=f.value)==null?void 0:ve.costRub)!=null?(i.openBlock(),i.createElementBlock("div",o1,[i.createElementVNode("span",s1,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",a1,[f.value?(i.openBlock(),i.createElementBlock("div",l1,[W[6]||(W[6]=i.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),i.createElementVNode("div",c1,[b.value?(i.openBlock(),i.createElementBlock("div",d1,"Ширина "+i.toDisplayString(b.value)+".",1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("div",u1,"Длина "+i.toDisplayString(_.value)+".",1)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",f1,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(d.value.items,(_e,we)=>{var wt;return i.openBlock(),i.createElementBlock("div",{key:we,class:i.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",v(we)?"opacity-70":""])},[i.createElementVNode("div",h1,[i.createElementVNode("div",m1,[i.createElementVNode("div",p1,[i.createVNode(i.unref(z.NFormItem),{path:`items.${we}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[we].configuratorParams.width,"onUpdate:value":[$e=>d.value.items[we].configuratorParams.width=$e,$e=>P(we)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Ширина",class:"w-full",onKeydown:W[1]||(W[1]=$e=>i.unref(st)($e)),onInput:$e=>h(`items.${we}.width`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`items.${we}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:d.value.items[we].configuratorParams.length,"onUpdate:value":[$e=>d.value.items[we].configuratorParams.length=$e,$e=>P(we)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Длина",class:"w-full",onKeydown:W[2]||(W[2]=$e=>i.unref(st)($e)),onInput:$e=>h(`items.${we}.length`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),i.createElementVNode("div",g1,[i.createVNode(i.unref(z.NFormItem),{path:`items.${we}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:d.value.items[we].quantity,"onUpdate:value":[$e=>d.value.items[we].quantity=$e,$e=>P(we)],parse:i.unref(lt),"show-button":!1,disabled:!f.value||v(we)||$(we),placeholder:"Кол-во",class:"w-full",onKeydown:W[3]||(W[3]=$e=>i.unref(st)($e,!1)),onInput:$e=>h(`items.${we}.quantity`),onFocus:i.unref(Le)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),i.createVNode(i.unref(z.NFormItem),{path:`items.${we}.marker`,label:"Маркировка",class:"min-w-0"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:d.value.items[we].marker??null,disabled:!f.value||v(we)||$(we),placeholder:"Маркировка",class:"w-full",onInput:$e=>h(`items.${we}.marker`),"onUpdate:value":$e=>V(we,$e??null),onFocus:i.unref(Le)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),$(we)||v(we)?(i.openBlock(),i.createElementBlock("div",y1,[$(we)?(i.openBlock(),i.createBlock(i.unref(z.NSpin),{key:0,size:14})):v(we)?(i.openBlock(),i.createBlock(K,{key:1,class:"text-green-600 text-xl"})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),i.createElementVNode("div",b1,[_e.configuratorParams.width>0&&_e.configuratorParams.length>0?(i.openBlock(),i.createElementBlock("div",_1,[W[7]||(W[7]=i.createTextVNode(" Площадь (S) = ",-1)),i.createElementVNode("span",w1,i.toDisplayString(R(_e.configuratorParams))+" м²",1)])):i.createCommentVNode("",!0),F(_e)>0?(i.openBlock(),i.createElementBlock("div",x1,[W[8]||(W[8]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",k1,i.toDisplayString(F(_e).toLocaleString())+" "+i.toDisplayString((wt=f.value)==null?void 0:wt.currency.symbol),1)])):i.createCommentVNode("",!0)])]),w.value?i.createCommentVNode("",!0):(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,disabled:$(we)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:$e=>Y(we)},{default:i.withCtx(()=>[i.createVNode(ue)]),_:1},8,["disabled","onClick"]))],2)}),128))]),f.value?(i.openBlock(),i.createElementBlock("div",v1,[H.value>0?(i.openBlock(),i.createElementBlock("div",C1,[W[9]||(W[9]=i.createTextVNode(" Общая площадь: ",-1)),i.createElementVNode("span",S1,i.toDisplayString(H.value.toLocaleString(void 0,{maximumFractionDigits:4}))+" м²",1)])):i.createCommentVNode("",!0),Q.value>0?(i.openBlock(),i.createElementBlock("div",B1,[W[10]||(W[10]=i.createTextVNode(" Итого: ",-1)),i.createElementVNode("span",T1,i.toDisplayString(Q.value.toLocaleString())+" "+i.toDisplayString(f.value.currency.symbol),1)])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),x.value?(i.openBlock(),i.createBlock(i.unref(z.NCheckbox),{key:1,checked:((ot=c.value[0])==null?void 0:ot.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":W[4]||(W[4]=_e=>M(_e??!1))},{default:i.withCtx(()=>[...W[11]||(W[11]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0),i.createElementVNode("div",N1,[f.value&&!w.value?(i.openBlock(),i.createBlock(i.unref(z.NButton),{key:0,disabled:C.value,type:"default",onClick:L},{default:i.withCtx(()=>[i.createVNode(ye),W[12]||(W[12]=i.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):i.createCommentVNode("",!0),i.createVNode(i.unref(z.NButton),{loading:t.isSubmitProcessing,disabled:N.value||E.value,type:"primary",class:"ml-auto",onClick:W[5]||(W[5]=_e=>o("submit",c.value))},{default:i.withCtx(()=>{var _e;return[i.createTextVNode(i.toDisplayString((_e=c.value[0])!=null&&_e.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[i.unref(ei),()=>o("submit",c.value)]])}}}),R1={class:"flex flex-col gap-2"},E1={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},P1={},pu=i.defineComponent({...P1,__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(k=>new j.OrderItemBase(k))),a=i.ref([]),l=i.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=k=>{c.forEach(x=>{l.value[`items.${k}.${x}`]={}})},u=k=>{c.forEach(x=>{delete l.value[`items.${k}.${x}`]})},h=i.computed(()=>a.value.includes("loading")),f=()=>({width:{},length:{},quantity:{},marker:{}}),m=(k,x)=>{let C=!1;return c.forEach(N=>{var A,R;const w=`items.0.${N}`,S=(A=k[N])==null?void 0:A.feedback,$=((R=k[w])==null?void 0:R.feedback)??S,E=`items.${x}.${N}`;$?(l.value[E]=k[w]??k[N],C=!0):l.value[E]={}}),C},p=(k,x,C)=>new Promise(N=>{const w=f();let S=!1;const v=$=>{if(S)return;S=!0;const E=m(w,x),A=($===void 0?!E:$)&&!E;a.value[x]=A?"success":"error",i.nextTick(()=>{var R,F;(F=(R=o.value)==null?void 0:R.formReference)==null||F.restoreValidation()}),N(A)};a.value[x]="loading",r("submit",[D.cloneDeep(k)],w,v,{isFinalSuccessfulCompletion:C})}),g=async()=>{var C,N;try{await((N=(C=o.value)==null?void 0:C.formReference)==null?void 0:N.validate())}catch{return}const k=s.value.map((w,S)=>S).filter(w=>{const S=a.value[w]??"idle";return S!=="success"&&S!=="loading"});let x=!0;for(let w=0;w<k.length;w+=1){const S=k[w],v=s.value[S];if(!v)break;const E=w===k.length-1&&x;await p(v,S,E)||(x=!1)}},y=k=>{const x=k-1;a.value[x]="idle",d(x)},b=k=>{a.value.splice(k,1),u(k);for(let x=k;x<s.value.length;x+=1)d(x)},_=k=>{const x=a.value[k];(x==="success"||x==="error")&&(a.value[k]="idle")};return i.onMounted(()=>{(n.cartItems??[]).forEach((k,x)=>{a.value[x]="idle",d(x)})}),i.watch(()=>n.cartItems,k=>{const x=(k??[]).map(C=>new j.OrderItemBase(C));s.value=x,a.value=x.map(()=>"idle"),x.forEach((C,N)=>{d(N)})},{deep:!0}),(k,x)=>{var N;const C=z.NButton;return i.openBlock(),i.createElementBlock("div",R1,[t.settings.allowShowTable&&((N=s.value[0])!=null&&N.isNewRec())?(i.openBlock(),i.createBlock(C,{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",E1,[i.createVNode(mu,{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:g,onAddItem:y,onRemoveItem:b,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),F1={key:0,class:"flex justify-center p-4"},V1={key:1,class:"p-4 text-center text-red-500"},M1={key:2,class:"flex justify-center"},A1={class:"!bg-white p-4 m-2 rounded-md w-max"},I1={key:3,class:"p-4 text-center text-gray-500"},O1={},gu=i.defineComponent({...O1,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},cartItems:{},category:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref(null),o=i.ref(e.cartItem??null),s=i.ref(e.cartItems??null),a=f=>{const m=f.configuratorParams;return[new j.OrderItemBase({...f,quantity:f.quantity??1,marker:f.marker,configuratorParams:{width:(m==null?void 0:m.width)??f.width??0,length:(m==null?void 0:m.length)??f.length??0}})]},l=i.ref(e.editor===j.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var m,p,g;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const f={category:((m=e.cartItem)==null?void 0:m.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const y=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{length:y.stripMinLength,linesAngles:[],linesWidths:[],startTailType:D.some(y.startTailConfigs,b=>b.isDefault)?(p=y.startTailConfigs)==null?void 0:p.findIndex(b=>b.isDefault):void 0,endTailType:D.some(y.endTailConfigs,b=>b.isDefault)?(g=y.endTailConfigs)==null?void 0:g.findIndex(b=>b.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const y=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{width:0,height:0,netType:y.netType[0]||"",color:y.color[0]||"",mountType:y.mountType[0]||""}});break}case"strip":{const y=e.settings;s.value=[new j.OrderItemBase({...f,length:y.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const y=e.settings;o.value=new j.OrderItemBase({...f,configuratorParams:{width:y.minWidth,length:y.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,m,p)=>{const g=y=>{p==null||p(),y&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:f,callback:g,validation:m})},u=(f,m,p,g)=>{const y=f[0];if(!y){p==null||p();return}const b=(g==null?void 0:g.isFinalSuccessfulCompletion)===!0,_=k=>{p==null||p(k),b&&k&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:y,callback:_,validation:m,additionalParams:g})},h=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return i.onMounted(()=>{!e.cartItem&&!e.cartItems&&c()}),(f,m)=>{const p=z.NSpin;return i.openBlock(),i.createElementBlock(i.Fragment,null,[n.value?(i.openBlock(),i.createElementBlock("div",F1,[i.createVNode(p,{size:"large"})])):r.value?(i.openBlock(),i.createElementBlock("div",V1,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",M1,[i.createElementVNode("div",A1,[t.editor==="kozyrek"?(i.openBlock(),i.createBlock(tu,{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(ru,{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(lu,{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(du,{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(hu,{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(pu,{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",I1,' Конфигуратор "'+i.toDisplayString(t.editor)+'" не поддерживается. ',1))],64)}}});function yu(t){return Object.values(j.ConfiguratorsEnum).includes(t)}function bu(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==j.ConfiguratorsEnum.Sandwich?!0:t.properties.configuratorSettings!==void 0&&D.isArray(t.products)&&t.products.length>0}const z1={key:0,class:"pt-0.5"},D1={key:0},L1={class:"line-through"},H1={key:0},W1={key:1},j1={class:"flex flex-row gap-1"},q1={key:0},X1={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},Y1={class:"flex flex-col gap-2.5 sm:flex-row"},U1={class:"mt-2"},K1={key:1,class:"flex flex-col"},G1={},Z1=i.defineComponent({...G1,__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(xr,"medium"),r=i.computed(()=>{var U;return(U=e==null?void 0:e.filteredItems)==null?void 0:U[e.categoryItem.id]}),o=i.computed(()=>{var U,G;return D.isArray((U=e.categoryItem)==null?void 0:U.categories)&&((G=e.categoryItem.categories)==null?void 0:G.length)>0}),s=i.computed(()=>{var U;return D.isArray((U=e.categoryItem)==null?void 0:U.products)?e.categoryItem.products:[]}),a=i.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([U,G])=>`${G} руб./${E(U)}`).join(", ")),l=i.computed(()=>D.isUndefined(e.filteredItems)||r.value==="*"?s.value:s.value.filter(U=>{var q;const G=(q=r.value)==null?void 0:q.products;return D.isArray(G)&&G.includes(U.id)})),c=i.computed(()=>l.value.length>0),d=i.computed(()=>D.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),u=i.computed(()=>D.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=i.computed(()=>D.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),f=i.computed(()=>D.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),m=i.computed(()=>{var U,G,q;return((U=e.categoryItem.properties)==null?void 0:U.configurator)!==void 0&&yu((G=e.categoryItem.properties)==null?void 0:G.configurator)&&bu(e.categoryItem)&&((q=e.categoryItem.properties)==null?void 0:q.configuratorSettings)!==void 0&&(D.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),p=i.computed(()=>m.value&&(D.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),g=i.computed(()=>D.isNil(e.categoryContextButtonsConfig)?[]:D.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),y=i.computed(()=>new j.ClientCategory(e.categoryItem)),b=i.ref(!1),_=i.ref(!1),k=i.computed(()=>!D.isUndefined(e.isCategoryItemSelected)),x=i.computed(()=>D.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),C=i.computed(()=>D.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),N=i.computed(()=>D.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),w=i.computed(()=>M.value&&et.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),S=i.useTemplateRef("collapse-item-reference"),v=i.computed(()=>{var U,G;return(G=(U=e.categoryItem.properties)==null?void 0:U.templateCost)==null?void 0:G.priceCoefficient}),$=i.computed(()=>{var U,G;return(G=(U=e.categoryItem.properties)==null?void 0:U.templateCost)==null?void 0:G.increasePercent}),E=(U,G="ru-RU")=>0 .toLocaleString(G,{style:"currency",currency:U,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),A=U=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:U,target:S.value})},R=(U,G)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:G,isLoadingState:b,target:S.value})},F=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:S.value})},H=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:S.value})},Q=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:S.value})},Z=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:S.value})},O=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:S.value})},P=U=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:U,target:S.value})},V=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},M=i.ref(0),L=i.computed(()=>M.value&&s.value.length>0?jp(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}):[]),Y=D.debounce(()=>{M.value=window.innerWidth},20);return i.onUnmounted(()=>{window.removeEventListener("resize",Y)}),window.addEventListener("resize",Y),Y(),(U,G)=>{const q=z.NCheckbox,W=wm,K=z.NTooltip,ue=ym,ye=z.NTag,ve=mm,ot=um,_e=z.NButton,we=lm,wt=Sl,$e=Cl,Gt=vl,pn=ms,Rt=z.NDropdown,Qn=z.NDataTable,gn=z.NAlert,sn=z.NSpin;return i.openBlock(),i.createBlock(Bl,{ref:"collapse-item-reference",name:t.categoryItem.id,"data-id":t.categoryItem.id,"onHeader:click":R},{"pre-arrow":i.withCtx(()=>{var Ve,te;return[k.value?(i.openBlock(),i.createElementBlock("div",z1,[i.createVNode(q,{checked:x.value,indeterminate:N.value,disabled:C.value,"onUpdate:checked":A},null,8,["checked","indeterminate","disabled"])])):i.createCommentVNode("",!0),!d.value&&((Ve=y.value)!=null&&Ve.isDisabled)?(i.openBlock(),i.createBlock(K,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(W,{class:"pt-1.5"})]),default:i.withCtx(()=>[G[1]||(G[1]=i.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):i.createCommentVNode("",!0),((te=y.value)==null?void 0:te.isFavorite)??!1?(i.openBlock(),i.createBlock(K,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(ue,{class:"pt-1.5"})]),default:i.withCtx(()=>[G[2]||(G[2]=i.createTextVNode(" Избранная категория ",-1))]),_:1})):i.createCommentVNode("",!0)]}),header:i.withCtx(()=>{var Ve,te,le,De,hi;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=y.value)==null?void 0:Ve.isDisabled})},[i.createVNode(K,{disabled:!t.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createElementVNode("span",null,i.toDisplayString(t.categoryItem.name),1)]),default:i.withCtx(()=>[G[3]||(G[3]=i.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),i.createElementVNode("div",{class:"w-fit",onClick:G[0]||(G[0]=i.withModifiers((...at)=>i.unref(D.noop)&&i.unref(D.noop)(...at),["prevent","stop"]))},[(te=t.categoryItem.properties)!=null&&te.m2Price?(i.openBlock(),i.createBlock(ye,{key:0,size:i.unref(n),class:i.normalizeClass({"!pr-0":((le=t.categoryItem.properties)==null?void 0:le.templateCost)&&t.categoryItem.properties.m2PriceRetail&&$.value}),round:""},{default:i.withCtx(()=>{var at;return[i.createTextVNode(" Установленная стоимость: "+i.toDisplayString(t.categoryItem.properties.m2Price)+" руб./м2 ",1),(at=t.categoryItem.properties)!=null&&at.templateCost&&t.categoryItem.properties.m2PriceRetail&&$.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[$.value?(i.openBlock(),i.createBlock(ye,{key:0,type:"success",bordered:!1,size:i.unref(n),class:"ml-2 !pr-0",round:""},{default:i.withCtx(()=>[$.value?(i.openBlock(),i.createElementBlock("span",D1,i.toDisplayString($.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0),i.createVNode(ye,{size:i.unref(n),round:""},{default:i.withCtx(()=>[i.createElementVNode("span",L1,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},[v.value||$.value?(i.openBlock(),i.createBlock(ye,{key:0,size:i.unref(n),round:""},{default:i.withCtx(()=>{var at;return[v.value?(i.openBlock(),i.createElementBlock("span",H1,i.toDisplayString((at=v.value)==null?void 0:at.name),1)):i.createCommentVNode("",!0),$.value?(i.openBlock(),i.createElementBlock("span",W1,i.toDisplayString($.value>0?"+":"")+i.toDisplayString($.value.toFixed(2))+"%",1)):i.createCommentVNode("",!0)]}),_:1},8,["size"])):i.createCommentVNode("",!0)],64)):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ye,{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&&((hi=y.value)!=null&&hi.manager)?(i.openBlock(),i.createBlock(ye,{key:3,size:i.unref(n),closable:!0,round:"",class:"align-bottom",onClose:Z},{default:i.withCtx(()=>[i.createVNode(K,{placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>{var at,Zt;return[i.createElementVNode("span",j1,[i.createVNode(ve),i.createTextVNode(" "+i.toDisplayString((Zt=(at=y.value)==null?void 0:at.manager)==null?void 0:Zt.name),1)])]}),default:i.withCtx(()=>{var at,Zt;return[i.createTextVNode(' Категория закреплена за "'+i.toDisplayString((Zt=(at=y.value)==null?void 0:at.manager)==null?void 0:Zt.name)+'" ',1)]}),_:1})]),_:1},8,["size"])):i.createCommentVNode("",!0)])]}),"sub-header":i.withCtx(()=>[t.showSlugs||t.showProperties?(i.openBlock(),i.createElementBlock("div",q1,[i.createElementVNode("ul",X1,[t.showSlugs?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:0},i.renderList({id:t.categoryItem.id,slug:t.categoryItem.slug},(Ve,te)=>(i.openBlock(),i.createElementBlock("li",{key:te}," ("+i.toDisplayString(te)+"): "+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,te)=>(i.openBlock(),i.createElementBlock("li",{key:te}," ("+i.toDisplayString(te)+"): "+i.toDisplayString(Ve),1))),128)):i.createCommentVNode("",!0)])])):i.createCommentVNode("",!0)]),"header-extra":i.withCtx(()=>{var Ve;return[i.createElementVNode("div",Y1,[d.value?(i.openBlock(),i.createBlock(K,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,size:i.unref(n),onClick:F},{default:i.withCtx(()=>{var te;return[(te=y.value)!=null&&te.isDisabled?(i.openBlock(),i.createBlock(W,{key:1})):(i.openBlock(),i.createBlock(ot,{key:0}))]}),_:1},8,["size"])]),default:i.withCtx(()=>{var te;return[(te=y.value)!=null&&te.isDisabled?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createTextVNode(" Скрыто для клиента"+i.toDisplayString(y.value.hidingComment?`. Причина: '${y.value.hidingComment}'`:""),1)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode("Видимо клиенту")],64))]}),_:1})):i.createCommentVNode("",!0),u.value&&!((Ve=y.value)!=null&&Ve.manager)?(i.openBlock(),i.createBlock(K,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,size:i.unref(n),onClick:Q},{default:i.withCtx(()=>[i.createVNode(we)]),_:1},8,["size"])]),default:i.withCtx(()=>{var te,le,De;return[(te=y.value)!=null&&te.manager?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createTextVNode('Категория закреплена за "'+i.toDisplayString(((De=(le=y.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(K,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,disabled:h.value==="disabled",size:i.unref(n),onClick:H},{default:i.withCtx(()=>{var te;return[(te=y.value)!=null&&te.isRequired?(i.openBlock(),i.createBlock($e,{key:1})):(i.openBlock(),i.createBlock(wt,{key:0}))]}),_:1},8,["disabled","size"])]),default:i.withCtx(()=>[G[4]||(G[4]=i.createTextVNode(" Категория, которую нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),f.value?(i.openBlock(),i.createBlock(K,{key:3,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,size:i.unref(n),type:"primary",onClick:O},{default:i.withCtx(()=>[i.createVNode(Gt)]),_:1},8,["size"])]),default:i.withCtx(()=>[G[5]||(G[5]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),g.value.length>0?(i.openBlock(),i.createBlock(Rt,{key:4,options:g.value,size:i.unref(n),trigger:"click",onSelect:P},{default:i.withCtx(()=>[i.createVNode(_e,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(pn)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])]}),default:i.withCtx(()=>[i.renderSlot(U.$slots,"default",{},()=>{var Ve,te,le;return[i.createElementVNode("div",U1,[o.value?(i.openBlock(),i.createBlock(wu,{key:0,"categories-items":t.categoryItem.categories??[],"has-products":c.value||b.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)]),m.value&&p.value?(i.openBlock(),i.createBlock(gu,{key:0,"event-emitter":t.eventEmitter,settings:(te=t.categoryItem.properties)==null?void 0:te.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",K1,[m.value?(i.openBlock(),i.createBlock(_e,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:V},{default:i.withCtx(()=>[...G[6]||(G[6]=[i.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):i.createCommentVNode("",!0),i.createVNode(Qn,{columns:L.value,data:l.value,bordered:!0,loading:b.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),!b.value&&!_.value&&!o.value&&!c.value?(i.openBlock(),i.createBlock(gn,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createBlock(gn,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):i.createCommentVNode("",!0),b.value?(i.openBlock(),i.createBlock(sn,{key:4,size:i.unref(n),class:"w-full"},{description:i.withCtx(()=>[...G[7]||(G[7]=[i.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):i.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),Q1=An(Z1,[["__scopeId","data-v-607a5aad"]]),J1={class:"sc-collapse flex w-full flex-col"},e_={},_u=i.defineComponent({...e_,__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",J1,[i.renderSlot(s.$slots,"default")]))}}),t_={},wu=i.defineComponent({...t_,__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(xr,"medium"),r=i.computed(()=>D.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var a;return!!((a=e.filteredItems)!=null&&a[s.id])})),o=(s,a)=>{if(D.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=z.NSpin,c=z.NAlert;return i.openBlock(),i.createElementBlock(i.Fragment,null,[r.value.length>0?(i.openBlock(),i.createBlock(_u,{key:0},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,d=>(i.openBlock(),i.createBlock(Q1,{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)}}}),n_={},xu=i.defineComponent({...n_,__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(()=>D.isArray(r.value)),a=new j.Reference,l=i.computed(()=>D.isNil(r.value)?s.value?[]:null:D.isArray(r.value)?r.value.filter(m=>!D.isNil(m)).map(m=>m.id):r.value.id),c=i.computed(()=>yt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue,void 0,r.disabledItem)),d=m=>{var p;if(D.isArray(m)){const g=m.length>0?m.map(y=>{var b;return(b=c.value.find(_=>_.value===y))==null?void 0:b.item}).filter(y=>!D.isNil(y)):[];o("update:value",g)}else{const g=m===a.id||D.isNil(m)||(p=c.value.find(y=>y.value===m))==null?void 0:p.item;o("update:value",g)}},u=i.useTemplateRef("select-component");return e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blur()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple: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"]))}}),i_={},r_=i.defineComponent({...i_,__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,C;const n=t,r=e,o=()=>{const N=j.PriceCoefficient.getRetailPriceCoefficient();return D.unset(N,"isNewRec"),N},s=N=>!N||N.id===o().id,a=i.computed(()=>{var N;return((N=n.catalogItem)==null?void 0:N.type)==="product"}),l=i.computed(()=>a.value?n.catalogItem:void 0),c=N=>{var w,S,v,$;return N.id===o().id?(w=l.value)==null?void 0:w.getRetailCost():($=(v=(S=l.value)==null?void 0:S.priceCoefficients)==null?void 0:v.find(E=>E.coefficient.id===N.id))==null?void 0:$.cost},d=i.computed(()=>{var S;const w=[...((S=j.useReferencesStore().priceCoefficientsReference)==null?void 0:S.map(v=>structuredClone(i.toRaw(v))))??[],o()].filter(v=>{var $;return(($=n.visibleCoefficient)==null?void 0:$.call(n,v))??!0});return a.value&&w.forEach(v=>{var E;const $=c(v);$?v.name+=` (${$} ${(E=l.value)==null?void 0:E.currency.symbol})`:v.name=""}),w.filter(v=>v.name!=="")}),u=i.ref(n.value.coefficient),h=i.ref(((C=(x=n.value)==null?void 0:x.value)==null?void 0:C.toString())??null),f=i.ref(null),m=i.computed(()=>{var N,w;return(w=(N=l.value)==null?void 0:N.priceCoefficients)==null?void 0:w.find(S=>S.coefficient.slug===j.PriceCoefficientEnum.K0)}),p=i.ref(void 0),g=N=>Number.parseFloat((N??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),y=()=>{var w,S;p.value=void 0;let N=g(h.value);if(N=Number.isNaN(N)?void 0:N,a.value)if(u.value||h.value){const v=o(),$=c(u.value??v)??0,E=$+$*((N??0)/100);f.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(E),E>(((w=l.value)==null?void 0:w.getRetailCost())??E)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),m.value&&E<(((S=m.value)==null?void 0:S.cost)??0)&&(p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else f.value=null;r("update:value",{value:Number.isNaN(N)?void 0:N,coefficient:s(u.value)?void 0:structuredClone(i.toRaw(u.value))})},b=N=>{D.isArray(N)||D.isNull(N)||(u.value=N,h.value=null,!u.value&&h.value&&(u.value=o()),y())},_=()=>{u.value||(u.value=o()),y()},k=N=>{var S,v,$,E,A;const w=g(N);if(a.value){if(Number.isNaN(w)){u.value=void 0,h.value=null,r("update:value",{value:void 0,coefficient:void 0});return}let R=0;if(w<=0)u.value=void 0,h.value=null;else if(m.value&&w<(((S=m.value)==null?void 0:S.cost)??0))u.value=(v=m.value)==null?void 0:v.coefficient,R=(w-m.value.cost)*100/m.value.cost,p.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(w>((($=l.value)==null?void 0:$.getRetailCost())??w)){u.value=o();const F=((E=l.value)==null?void 0:E.getRetailCost())??0;R=(w-F)*100/F,p.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const F=((A=l.value)==null?void 0:A.priceCoefficients)??[],H=D.sortBy(F,[O=>O.cost]),Z=H.filter(O=>O.cost<=w).at(-1)??H.at(0);Z&&(u.value=Z.coefficient,R=(w-Z.cost)*100/Z.cost),p.value={validationStatus:void 0,feedback:void 0}}h.value=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:5}).format(R),r("update:value",{value:Number.isNaN(R)?void 0:R,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 N,w,S,v;n.calculationType===j.CalculationTypeEnum.m2Cost?f.value=((w=(N=n.value)==null?void 0:N.value)==null?void 0:w.toString())??null:!((S=n.value)!=null&&S.coefficient)&&((v=n.value)!=null&&v.value)&&(u.value=o()),y()}),(N,w)=>{var $,E,A;const S=z.NInput,v=z.NInputGroup;return i.openBlock(),i.createBlock(i.unref(z.NFormItem),{"show-label":!i.unref(D.isNil)(t.label),label:t.label,"show-feedback":!i.unref(D.isNil)((($=p.value)==null?void 0:$.feedback)??t.feedback),feedback:((E=p.value)==null?void 0:E.feedback)??t.feedback,"validation-status":((A=p.value)==null?void 0:A.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(v,{key:0,class:i.normalizeClass(["w-full flex-row",{"sm:col-span-2":a.value}])},{default:i.withCtx(()=>[i.createVNode(xu,{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":b},null,8,["value","reference-list","clearable","disabled","disabled-item"]),i.createVNode(S,{value:h.value,"onUpdate:value":[w[0]||(w[0]=R=>h.value=R),_],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(S,{key:1,value:f.value,"onUpdate:value":[w[1]||(w[1]=R=>f.value=R),k],clearable:t.clearable,disabled:t.disabled,placeholder:"Стоимость",class:"w-full"},i.createSlots({_:2},[a.value?{name:"suffix",fn:i.withCtx(()=>{var R;return[i.createTextVNode(i.toDisplayString((R=l.value)==null?void 0:R.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"])}}}),o_={key:0,class:"flex flex-row gap-2.5"},s_={key:1,class:"flex flex-row flex-wrap justify-end gap-2.5"},a_={},ku=i.defineComponent({...a_,__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=et.initRefDependingOnDeviceResolution(r.sizes.phone.size,r.sizes.tablet.size,r.sizes.default.size),c=et.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=(m="other",p=!1)=>{if(a.value&&!p){o("processing:cancel",_=>{a.value=_});return}let g=!1;o("closing",m,()=>{g=!0}),g||(s.value=!1,o("update:show",s.value))},f=()=>{o("accept",p=>{a.value=p})};return i.watch(()=>r.show,m=>{m?u():h("other",!0)}),i.watch(()=>r.processing,m=>{a.value=m}),e({open:u,close:h,acceptHandler:f}),(m,p)=>{const g=z.NButton,y=z.NModal;return i.openBlock(),i.createBlock(y,{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":m.$slots["extra-action"]?"grid grid-cols-2 !justify-between":void 0,preset:"dialog",onClose:p[1]||(p[1]=b=>h("header")),onEsc:p[2]||(p[2]=b=>h("esc")),onMaskClick:p[3]||(p[3]=b=>h("mask"))},i.createSlots({default:i.withCtx(()=>[i.renderSlot(m.$slots,"default")]),_:2},[m.$slots.header?{name:"header",fn:i.withCtx(()=>[i.renderSlot(m.$slots,"header")]),key:"0"}:void 0,m.$slots.action||m.$slots["extra-action"]||t.acceptButton.show||t.cancelButton.show?{name:"action",fn:i.withCtx(()=>[m.$slots["extra-action"]?(i.openBlock(),i.createElementBlock("div",o_,[i.renderSlot(m.$slots,"extra-action")])):i.createCommentVNode("",!0),m.$slots.action||t.acceptButton.show||t.cancelButton.show?(i.openBlock(),i.createElementBlock("div",s_,[i.renderSlot(m.$slots,"action",{disabled:a.value}),t.acceptButton.show??!0?(i.openBlock(),i.createBlock(g,{key:0,disabled:a.value||!t.valid,loading:a.value,size:i.unref(l),type:"primary",onClick:f},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.acceptButton.text??"ОК"),1)]),_:1},8,["disabled","loading","size"])):i.createCommentVNode("",!0),t.cancelButton.show??!0?(i.openBlock(),i.createBlock(g,{key:1,disabled:a.value,size:i.unref(l),type:"default",onClick:p[0]||(p[0]=b=>h("footer"))},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.cancelButton.text??"Отмена"),1)]),_:1},8,["disabled","size"])):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["loading","show","size","style","title","trap-focus","action-class"])}}}),l_={class:"text-sm"},c_={class:"text-sm"},d_={},u_=i.defineComponent({...d_,__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(!1),a=i.ref(null),l=i.computed(()=>{var R,F,H;return((R=a.value)==null?void 0:R.unit.isLinear)&&((H=(F=a.value)==null?void 0:F.properties)==null?void 0:H.isLengthConfigurator)}),c=i.computed(()=>a.value?j.UnitsHelper.productIsMeasurable(a.value)||l.value?"шт.":a.value.unit.name:"шт."),d=i.ref(void 0),u=i.ref(void 0),h=i.ref(!0),f=i.ref(null),m=i.computed({get:()=>{var R;return((R=f.value)==null?void 0:R.quantity)??null},set:R=>{f.value&&(f.value.quantity=R??0)}}),p=i.computed({get:()=>{var R;return((R=f.value)==null?void 0:R.length)??null},set:R=>{f.value&&(f.value.length=R??void 0)}}),g=R=>{f.value&&(f.value.marker=R??null)},y=n,b=()=>({length:{},quantity:{},marker:{}}),_=i.ref(b()),k=i.ref(!1),x=i.computed(()=>{var Z,O,P,V;if(!a.value)return{};const R=j.UnitsHelper.getProductLengthMultiplicity(a.value),F=j.UnitsHelper.getProductMultiplicity(a.value),H=((O=(Z=a.value)==null?void 0:Z.properties)==null?void 0:O.minLength)||R,Q=(V=(P=a.value)==null?void 0:P.properties)==null?void 0:V.maxLength;return{length:[ae.required,ae.min(H??.1),ae.max(Q),ae.step(R),We.serverValidation(_.value.length.feedback)],quantity:[ae.required,ae.min(F),ae.step(F),We.serverValidation(_.value.quantity.feedback)],marker:[We.serverValidation(_.value.marker.feedback)]}}),C=i.computed(()=>{var R,F,H;return a.value?((R=a.value.properties)==null?void 0:R.lengthStep)??((F=a.value.properties)!=null&&F.ignoreMinCountCheck?0:((H=a.value.properties)==null?void 0:H.minCount)??0):0}),N=i.computed(()=>{var H,Q,Z,O,P,V,M,L,Y;if(!a.value)return"";const R=((Q=(H=a.value)==null?void 0:H.properties)==null?void 0:Q.minLength)??((O=(Z=a.value)==null?void 0:Z.properties)!=null&&O.ignoreMinCountCheck?0:(V=(P=a.value)==null?void 0:P.properties)==null?void 0:V.minCount),F=(L=(M=a.value)==null?void 0:M.properties)==null?void 0:L.maxLength;return R||F?`(${R?`от ${R}`:""}${R&&F?" ":""}${F?`до ${F}`:""} ${(Y=a.value)==null?void 0:Y.unit.name})`:""}),w=R=>{var O,P;if(!((P=(O=a.value)==null?void 0:O.properties)!=null&&P.isLengthConfigurator)||!f.value||D.isNil(R)||C.value===0)return;const F=R/C.value,H=Math.round(F),Q=j.UnitsHelper.getProductMultiplicity(a.value),Z=Math.max(H,Q);f.value.quantity=Z},S=R=>{var Z,O,P,V;if(!((O=(Z=a.value)==null?void 0:Z.properties)!=null&&O.isLengthConfigurator)||!f.value||D.isNil(R)||C.value===0)return;const F=R*C.value,H=((P=a.value.properties)==null?void 0:P.minLength)||j.UnitsHelper.getProductLengthMultiplicity(a.value),Q=(V=a.value.properties)==null?void 0:V.maxLength;H!==void 0&&F<H?f.value.length=H:Q!==void 0&&F>Q?f.value.length=Q:f.value.length=F},v=async R=>{var H;const F=D.cloneDeep(f.value);try{await((H=r.value)==null?void 0:H.validate(Q=>{if(!Q){if(!a.value||!F)return;j.UnitsHelper.productIsMeasurable(a.value)||delete F.length,l.value&&C.value&&(F.length=C.value),k.value=!0,y("submit",F,_.value,()=>{k.value=!1,R(!1),i.nextTick(()=>{var Z;(Z=r.value)==null||Z.validate(D.noop).catch(D.noop)})})}}))}catch{}},$=()=>{a.value=null,d.value=void 0,f.value=null,_.value=b()},E=()=>{s.value=!1};return e({show:(R,F)=>{var H,Q,Z,O,P;if($(),s.value=!0,a.value=R,d.value=F==null?void 0:F.cartItemData,u.value=F==null?void 0:F.orderId,h.value=(F==null?void 0:F.canSetDopProdaga)??!1,f.value=new j.OrderItemBase((F==null?void 0:F.cartItemData)??new j.OrderItemBase({product:R,quantity:j.UnitsHelper.productIsMeasurable(a.value)?1:((H=R==null?void 0:R.properties)==null?void 0:H.minCount)??1,length:((Q=R==null?void 0:R.properties)==null?void 0:Q.minLength)||((Z=R==null?void 0:R.properties)!=null&&Z.ignoreMinCountCheck?0:(O=R==null?void 0:R.properties)==null?void 0:O.minCount)||0})),(P=R==null?void 0:R.properties)!=null&&P.isLengthConfigurator&&f.value&&C.value>0){const V=C.value,M=f.value.quantity||1;f.value.length=M*V}},closeDialog:E}),(R,F)=>{var P;const H=z.NFormItem,Q=z.NInputGroupLabel,Z=z.NInputGroup,O=z.NCheckbox;return i.openBlock(),i.createBlock(ku,{ref:"base-dialog-reference",show:s.value,title:`${d.value?"Изменение":"Добавление"} товара ${(P=a.value)==null?void 0:P.name} в ${u.value?` заказ №${u.value}`:"корзину"}`,"accept-button":{show:!0,text:d.value?"Изменить":"Добавить"},processing:k.value,"modal-width":500,onAccept:v,onClosing:E},{default:i.withCtx(()=>[a.value&&f.value?i.withDirectives((i.openBlock(),i.createBlock(i.unref(z.NForm),{key:0,ref:"form-reference",model:f.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:i.withCtx(()=>[i.unref(j.UnitsHelper).productIsMeasurable(a.value)?(i.openBlock(),i.createBlock(H,{key:0,path:"length",label:`Метраж, ${N.value+a.value.unit.name}`},i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:p.value,"onUpdate:value":[F[0]||(F[0]=V=>p.value=V),w],parse:i.unref(lt),step:i.unref(j.UnitsHelper).getProductLengthMultiplicity(a.value),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:F[1]||(F[1]=V=>i.unref(eo)(V,".",!1)),onInput:F[2]||(F[2]=V=>i.unref(it)(_.value,"length")),onFocus:i.unref(Le)},null,8,["value","parse","step","onFocus"])]),_:2},[!_.value.length.feedback&&i.unref(j.UnitsHelper).getProductLengthMultiplicity(a.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",l_,"Метраж должно быть кратно "+i.toDisplayString(i.unref(j.UnitsHelper).getProductLengthMultiplicity(a.value)),1)]),key:"0"}:void 0]),1032,["label"])):i.createCommentVNode("",!0),i.createVNode(H,{path:"quantity",label:`Количество, ${c.value}`},{default:i.withCtx(()=>[i.createVNode(Z,null,i.createSlots({default:i.withCtx(()=>[i.createVNode(i.unref(z.NInputNumber),{value:m.value,"onUpdate:value":[F[3]||(F[3]=V=>m.value=V),S],parse:i.unref(lt),step:i.unref(j.UnitsHelper).getProductMultiplicity(a.value),"show-button":i.unref(j.UnitsHelper).getProductMultiplicity(a.value)>1,"button-placement":"both",placeholder:"Введите количество",class:"w-full",onKeydown:F[4]||(F[4]=V=>i.unref(eo)(V,".",!1)),onInput:F[5]||(F[5]=V=>i.unref(it)(_.value,"quantity")),onFocus:i.unref(Le)},null,8,["value","parse","step","show-button","onFocus"]),l.value?(i.openBlock(),i.createBlock(Q,{key:0,class:"bg-orange-100 font-bold"},{default:i.withCtx(()=>[i.createTextVNode(" x "+i.toDisplayString(C.value)+" "+i.toDisplayString(a.value.unit.name),1)]),_:1})):i.createCommentVNode("",!0)]),_:2},[!_.value.quantity.feedback&&i.unref(j.UnitsHelper).getProductMultiplicity(a.value)!==1?{name:"feedback",fn:i.withCtx(()=>[i.createElementVNode("span",c_,"Количество должно быть кратно "+i.toDisplayString(i.unref(j.UnitsHelper).getProductMultiplicity(a.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),i.unref(j.UnitsHelper).productIsMeasurable(a.value)?(i.openBlock(),i.createBlock(H,{key:1,path:"marker",label:"Маркировка"},{default:i.withCtx(()=>[i.createVNode(i.unref(z.NInput),{value:f.value.marker??null,placeholder:"Введите маркировку",onInput:F[6]||(F[6]=V=>i.unref(it)(_.value,"marker")),"onUpdate:value":F[7]||(F[7]=V=>g(V)),onFocus:i.unref(Le)},null,8,["value","onFocus"])]),_:1})):i.createCommentVNode("",!0),h.value?(i.openBlock(),i.createBlock(O,{key:2,checked:f.value.isAdditionalSale,"onUpdate:checked":F[8]||(F[8]=V=>f.value.isAdditionalSale=V),"true-value":!0,"false-value":!1},{default:i.withCtx(()=>[...F[9]||(F[9]=[i.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):i.createCommentVNode("",!0)]),_:1},8,["model","rules"])),[[i.unref(ei),()=>{var V,M;return(M=(V=o.value)==null?void 0:V.acceptHandler)==null?void 0:M.call(V)}]]):i.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),f_={class:"flex flex-row gap-1"},h_={class:"sc-client-name flex flex-col gap-1 text-base"},m_=["href"],p_={key:1,class:"text-sc-grey"},g_={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},y_={key:0},b_={key:1,class:"text-sm"},__={},Er=i.defineComponent({...__,__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?He.format(n.client.lastLoginAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=a=>{D.isNil(n.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",n.client,a)};return(a,l)=>{const c=ps,d=z.NButton,u=z.NPopover;return i.openBlock(),i.createElementBlock("div",f_,[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(D.isNil)(t.popoverPosition),placement:t.popoverPosition},{trigger:i.withCtx(()=>[i.createElementVNode("div",h_,[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",p_," [ Деактивирован ] "))],8,m_),t.showCityAndRegion&&t.client.city?(i.openBlock(),i.createElementBlock("span",g_," г. "+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",y_,i.toDisplayString(t.client.alternativeName),1)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("span",b_," Последний вход: "+i.toDisplayString(o.value),1)):i.createCommentVNode("",!0),i.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),w_={class:"text-base"},x_={},vu=i.defineComponent({...x_,__name:"contragent-with-short-info",props:{contragent:{}},setup(t){const e=t,n=i.computed(()=>ti.getFormatEntityName(e.contragent));return(r,o)=>(i.openBlock(),i.createElementBlock("span",w_,i.toDisplayString(n.value),1))}}),k_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function v_(t,e){return i.openBlock(),i.createElementBlock("svg",k_,[...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 C_=i.markRaw({name:"tabler-mail",render:v_}),S_=["href"],B_={},T_=i.defineComponent({...B_,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(t){return(e,n)=>{const r=C_;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,S_)],2)}}}),N_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $_(t,e){return i.openBlock(),i.createElementBlock("svg",N_,[...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 Cu=i.markRaw({name:"fa6-brands-viber",render:$_}),R_={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},E_=["id"],P_=["id"],F_=["fill"],V_=["fill"];function M_(t,e){return i.openBlock(),i.createElementBlock("svg",R_,[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,E_),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,P_)]),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,F_),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,V_),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 Su=i.markRaw({name:"logos-whatsapp-icon",render:M_,setup(){const t=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+t(),SVGHW6lecxh:"uicons-"+t()}}}}),A_={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},I_=["id"],O_=["fill"];function z_(t,e){return i.openBlock(),i.createElementBlock("svg",A_,[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,I_)]),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,O_),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 Bu=i.markRaw({name:"logos-telegram",render:z_,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),D_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function L_(t,e){return i.openBlock(),i.createElementBlock("svg",D_,[...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 Tu=i.markRaw({name:"ion-call",render:L_}),H_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function W_(t,e){return i.openBlock(),i.createElementBlock("svg",H_,[...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 j_=i.markRaw({name:"tabler-phone-call",render:W_}),q_={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},X_=["href"],Y_=["href"],U_=["href"],K_=["href"],G_={},Z_=i.defineComponent({...G_,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{try{return e.phone?br.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=i.computed(()=>{var l;return D.isString(n.value)?!1:((l=n.value)==null?void 0:l.isValid())??!1}),o=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("INTERNATIONAL"))??""}),s=i.computed(()=>{var l;return D.isString(n.value)?n.value:((l=n.value)==null?void 0:l.format("E.164"))??""}),a=i.ref(!1);return(l,c)=>{const d=j_,u=Tu,h=Bu,f=Su,m=Cu;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]=p=>a.value=!a.value),onFocusout:c[1]||(c[1]=p=>a.value=!1),onMouseleave:c[2]||(c[2]=p=>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",q_,[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,Y_)):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,U_)):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(m)],8,K_)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],34)])}}}),Q_={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J_(t,e){return i.openBlock(),i.createElementBlock("svg",Q_,[...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 ew=i.markRaw({name:"mdi-envelope",render:J_}),tw={class:"flex flex-col gap-1"},nw={key:0,class:"mb-2 flex flex-col text-base"},iw={key:0,class:"text-sc-dark-grey text-sm"},rw={key:1,class:"whitespace-nowrap text-sm"},ow={key:2,class:"whitespace-nowrap text-sm"},sw={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},aw=["href"],lw=["href"],cw=["href"],dw=["href"],uw=["href"],fw={key:0,class:"flex flex-col text-base"},hw={key:0,class:"text-sc-dark-grey text-sm"},mw={key:1,class:"mt-2 text-sm"},pw={key:0,class:"-mt-1"},gw={},yw=i.defineComponent({...gw,__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(()=>ti.getFormatEntityName(e.contact)),r=i.computed(()=>{try{return e.contact.phone?br.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),o=i.computed(()=>{var d;return D.isString(r.value)?!1:((d=r.value)==null?void 0:d.isValid())??!1}),s=i.computed(()=>{var d;return D.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("INTERNATIONAL"))??""}),a=i.computed(()=>{var d;return D.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("E.164"))??""}),l=i.computed(()=>o.value||e.contact.email),c=i.ref(!1);return(d,u)=>{var b,_;const h=Tu,f=Bu,m=Su,p=Cu,g=ew,y=z.NPopover;return i.openBlock(),i.createElementBlock("div",tw,[i.createVNode(y,{disabled:t.fullView,placement:"bottom"},{trigger:i.withCtx(()=>{var k,x,C,N;return[i.createElementVNode("div",{class:i.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(k=t.contact)!=null&&k.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${t.classes}`),style:i.normalizeStyle(t.styles),onMouseenter:u[0]||(u[0]=w=>c.value=!0),onFocusin:u[1]||(u[1]=w=>c.value=!0),onMouseleave:u[2]||(u[2]=w=>c.value=!1),onFocusout:u[3]||(u[3]=w=>c.value=!1)},[i.createElementVNode("div",null,[t.fullView&&(t.contact.name||(x=t.contact)!=null&&x.position)?(i.openBlock(),i.createElementBlock("div",nw,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),(C=t.contact)!=null&&C.position?(i.openBlock(),i.createElementBlock("span",iw,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",rw,i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("div",ow,i.toDisplayString(t.contact.email),1)):i.createCommentVNode("",!0),l.value&&c.value?(i.openBlock(),i.createElementBlock("div",sw,[o.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:`tel:${a.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[i.createVNode(h)],8,aw)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("a",{key:1,href:`https://t.me/${a.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(f)],8,lw)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("a",{key:2,href:`https://wa.me/${a.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[i.createVNode(m)],8,cw)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("a",{key:3,href:`viber://chat?number=${a.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[i.createVNode(p)],8,dw)):i.createCommentVNode("",!0),t.contact.email?(i.openBlock(),i.createElementBlock("a",{key:4,href:`mailto:${t.contact.email}`,class:"hover:text-3xl"},[i.createVNode(g)],8,uw)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])],38)]}),default:i.withCtx(()=>{var k,x,C,N;return[t.contact.name?(i.openBlock(),i.createElementBlock("div",fw,[i.createTextVNode(i.toDisplayString(n.value)+" ",1),(k=t.contact)!=null&&k.position?(i.openBlock(),i.createElementBlock("span",hw,i.toDisplayString((x=t.contact)==null?void 0:x.position),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),(C=t.contact)!=null&&C.comment?(i.openBlock(),i.createElementBlock("div",mw,[u[4]||(u[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",pw,[u[5]||(u[5]=i.createElementVNode("sup",null,"**",-1)),i.createTextVNode(" "+i.toDisplayString((_=t.contact)==null?void 0:_.comment),1)])):i.createCommentVNode("",!0)])}}});class bw{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=hs.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=hs.objectToSnake(e.heightOverlaps),this.widthOverlaps=hs.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function _w(t){var e;return((e=t.properties)==null?void 0:e.configurator)!==j.ConfiguratorsEnum.SandwichM2?!0:t.properties.configuratorSettings!==void 0&&D.isArray(t.products)&&t.products.length>0}const ww={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function xw(t,e){return i.openBlock(),i.createElementBlock("svg",ww,[...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 kw=i.markRaw({name:"mdi-dots-horizontal",render:xw}),Nu="date-range.dialog.mode",$u=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Ru=(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?He.startOfDay(r):void 0,to:o?He.endOfDay(o):void 0}},vw={class:"text-center font-semibold"},Cw={class:"grid grid-cols-3 gap-1"},Sw=["onPointerdown","onPointerenter","onKeydown"],Bw={},Tw=i.defineComponent({...Bw,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(t,{emit:e}){const n=t,r=e,o=z.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 S=new Date().getFullYear();return w&&He.isValid(w)?w.getFullYear():S},l=i.ref(a(n.from??n.to)),c=et.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),m=i.ref(null),p=i.computed(()=>{const{from:w,to:S}=n;return!w||!S||!He.isSameDay(w,He.startOfMonth(w))||!He.isSameDay(S,He.endOfMonth(S))?null:[w.getFullYear()*12+w.getMonth(),S.getFullYear()*12+S.getMonth()]}),g=i.computed(()=>f.value&&h.value!==null&&m.value!==null?y(h.value,m.value):u.value!==null?m.value===null?[u.value,u.value]:y(u.value,m.value):p.value),y=(w,S)=>w<=S?[w,S]:[S,w],b=(w,S)=>{const v=w*12+S,$=g.value;return $&&v>=$[0]&&v<=$[1]?[v===$[0]||v===$[1]?"sc-month--bound":"sc-month--in-range"]:[]},_=(w,S)=>{const[v,$]=y(w,S);u.value=null,r("select",{from:new Date(Math.floor(v/12),v%12,1),to:He.endOfMonth(new Date(Math.floor($/12),$%12,1))})},k=w=>{u.value===null?(u.value=w,r("select",{from:new Date(Math.floor(w/12),w%12,1),to:He.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,m.value!==null&&_(w,m.value);return}k(w)}},C=(w,S)=>{h.value=w*12+S,f.value=!1,globalThis.addEventListener("pointerup",x)},N=(w,S)=>{const v=w*12+S;m.value=v,h.value!==null&&v!==h.value&&(f.value=!0)};return i.watch(()=>[n.from,n.to],()=>{const w=n.from??n.to;if(!w||!He.isValid(w))return;const S=w.getFullYear();(S<l.value-1||S>l.value+1)&&(l.value=S)}),i.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",x)}),(w,S)=>{const v=z.NButton;return i.openBlock(),i.createElementBlock("div",{class:"flex select-none items-start gap-2",style:i.normalizeStyle(s.value),onPointerleave:S[2]||(S[2]=$=>m.value=null)},[i.createVNode(v,{size:"small",quaternary:"",class:"mt-5",onClick:S[0]||(S[0]=$=>l.value-=1)},{default:i.withCtx(()=>[...S[3]||(S[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,$=>(i.openBlock(),i.createElementBlock("div",{key:$,class:"flex flex-col gap-1"},[i.createElementVNode("div",vw,i.toDisplayString($),1),i.createElementVNode("div",Cw,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref($u),(E,A)=>(i.openBlock(),i.createElementBlock("button",{key:E,type:"button",class:i.normalizeClass(["sc-month cursor-pointer rounded border-0 px-1 py-1 text-sm",b($,A)]),onPointerdown:i.withModifiers(R=>C($,A),["prevent"]),onPointerenter:R=>N($,A),onKeydown:[i.withKeys(i.withModifiers(R=>k($*12+A),["prevent"]),["enter"]),i.withKeys(i.withModifiers(R=>k($*12+A),["prevent"]),["space"])]},i.toDisplayString(E),43,Sw))),128))])]))),128))],2),i.createVNode(v,{size:"small",quaternary:"",class:"mt-5",onClick:S[1]||(S[1]=$=>l.value+=1)},{default:i.withCtx(()=>[...S[4]||(S[4]=[i.createTextVNode(" › ",-1)])]),_:1})],36)}}}),Nw=An(Tw,[["__scopeId","data-v-7dd4941e"]]),$w={class:"sc-date-range-sidebar flex flex-col gap-1"},Rw={class:"flex items-center justify-center gap-1"},Ew={class:"min-w-12 text-center font-semibold"},Pw={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},Fw={},Vw=i.defineComponent({...Fw,__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=z.NButton;return i.openBlock(),i.createElementBlock("div",$w,[i.createElementVNode("div",Rw,[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",Ew,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",Pw,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(i.unref($u),(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})])}}}),Mw={},Eu=i.defineComponent({...Mw,__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=et.initRefDependingOnDeviceResolution(!0,!1,!1),s=i.ref(null),a=i.ref(!1),l=i.ref(0),c=i.ref(n.value&&He.isValid(n.value)?n.value:new Date),d=i.computed(()=>{const k=n.value&&He.isValid(n.value)?n.value:c.value;return k.getFullYear()===c.value.getFullYear()?k.getMonth():null});let u=0;const h=k=>{var x,C;(C=(x=k.target)==null?void 0:x.closest)!=null&&C.call(x,".n-base-clear")&&(u=performance.now())},f=k=>{k&&performance.now()-u<300||(a.value=k,k&&(c.value=n.value&&He.isValid(n.value)?n.value:new Date))},m=k=>{r("update:value",k===null?null:new Date(k))},p=(k,x)=>{const C=new Date(k,x,1);if(c.value=C,n.value&&He.isValid(n.value)){const N=Math.min(He.getDate(n.value),He.getDaysInMonth(C));r("update:value",new Date(k,x,N));return}l.value+=1,i.nextTick().then(()=>{var N;return(N=s.value)==null?void 0:N.focus()})},g=(k,x)=>{c.value=He.addYears(He.addMonths(c.value,k),x)},y=k=>{p(k,c.value.getMonth())},b=k=>{p(c.value.getFullYear(),k)},_=()=>{a.value=!1,r("update:value",new Date)};return(k,x)=>{const C=z.NButton,N=z.NDatePicker;return i.openBlock(),i.createBlock(N,{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":m,onNextMonth:x[0]||(x[0]=w=>g(1,0)),onPrevMonth:x[1]||(x[1]=w=>g(-1,0)),onNextYear:x[2]||(x[2]=w=>g(0,1)),onPrevYear:x[3]||(x[3]=w=>g(0,-1))},{footer:i.withCtx(()=>[i.unref(o)?(i.openBlock(),i.createBlock(C,{key:1,size:"small",text:"",type:"info",onClick:_},{default:i.withCtx(()=>[...x[4]||(x[4]=[i.createTextVNode(" Сегодня ",-1)])]),_:1})):(i.openBlock(),i.createBlock(Vw,{key:0,year:c.value.getFullYear(),month:d.value,"onUpdate:year":y,onSelectMonth:b,onToday:_},null,8,["year","month"]))]),_:1},8,["value","show","clearable","disabled","placeholder","format","default-calendar-start-time"])}}}),Aw={key:0,class:"text-gray-400"},Iw={},Pu=i.defineComponent({...Iw,__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=et.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(Eu,{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",Aw," – ")),i.createVNode(Eu,{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)}}}),Ow={class:"flex flex-col items-stretch gap-3 sm:flex-row"},zw={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},Dw={class:"flex flex-col items-stretch pr-3"},Lw={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},Hw={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},Ww={},jw=i.defineComponent({...Ww,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(t,{emit:e}){const n=t,r=e,o="custom",s=et.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 D.isEmpty(n.customPeriods)||h.push({key:o,value:o,label:"Пользовательские"}),h}),d=h=>Object.entries(h).map(([f,m])=>({value:f,label:m.label,item:m})),u=i.computed(()=>{if(l.value===o)return[{type:"group",key:o,children:d(n.customPeriods??{})}];const h=Object.entries(a).filter(([,m])=>m.group===l.value),f=Object.fromEntries(h);return l.value!=="other"?[{type:"group",key:l.value,children:d(f)}]:j.STANDARD_PERIOD_SECTIONS.map(m=>{const p=h.filter(([,g])=>g.section===m.key);return{type:"group",key:m.key,label:m.label,children:d(Object.fromEntries(p))}}).filter(m=>{var p;return(((p=m.children)==null?void 0:p.length)??0)>0})});return(h,f)=>{const m=z.NButton,p=z.NScrollbar,g=z.NSelect,y=z.NMenu;return i.openBlock(),i.createElementBlock("div",Ow,[i.createElementVNode("div",zw,[i.createVNode(p,{class:"max-h-96"},{default:i.withCtx(()=>[i.createElementVNode("div",Dw,[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(u.value,b=>(i.openBlock(),i.createElementBlock(i.Fragment,{key:b.key},[b.label?(i.openBlock(),i.createElementBlock("div",Lw,i.toDisplayString(b.label),1)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(b.children,_=>(i.openBlock(),i.createBlock(m,{key:_.value,size:"small",quaternary:"",type:_.value===t.activeKey?"primary":"default",class:"justify-start",onClick:k=>r("apply",_),onMouseenter:k=>r("preview",_),onMouseleave:f[0]||(f[0]=k=>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(g,{key:0,value:l.value,options:c.value,class:"order-1","onUpdate:value":f[1]||(f[1]=b=>l.value=b)},null,8,["value","options"])):(i.openBlock(),i.createElementBlock("div",Hw,[i.createVNode(y,{value:l.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=b=>l.value=b)},null,8,["value","options"])]))])}}}),qw={class:"flex flex-col gap-3"},Xw={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},Yw={key:0,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},Uw={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},Kw={class:"flex gap-2"},Gw={},Zw=i.defineComponent({...Gw,__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=et.initRefDependingOnDeviceResolution("100%","90%","44rem"),s=i.ref("custom"),a=()=>j.PreferencesStorageProvider.getActualDataFromStorage(Nu)==="standard"?"standard":"custom",l=i.ref({}),c=i.ref(null),d=i.ref(null),u=i.computed(()=>c.value??l.value),h=(x,C)=>{var S,v;const N=(S=n.disabled)!=null&&S.from?l.value.from:x,w=(v=n.disabled)!=null&&v.to?l.value.to:C;c.value=null,l.value=Ru(N,w,n.disabled)},f=x=>{d.value=null,h(x,l.value.to)},m=x=>{d.value=null,h(l.value.from,x)},p=()=>{d.value=null,h(null,null)},g=x=>{d.value=null,h(x.from,x.to)},y=x=>{const C=x.item;h(C.from,C.to),d.value=String(x.value)},b=x=>{const C=x==null?void 0:x.item;c.value=C?{from:C.from,to:C.to}:null},_=()=>{c.value=null,s.value=s.value==="custom"?"standard":"custom";const x=Nu;j.PreferencesStorageProvider.saveActualDataToStorage(x,s.value,He.addYears(He.startOfToday(),1))},k=()=>{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,C)=>{const N=z.NButton,w=z.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":C[1]||(C[1]=S=>r("update:show",S))},{footer:i.withCtx(()=>[i.createElementVNode("div",Uw,[i.createVNode(N,{text:"",type:"info",onClick:_},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),i.createElementVNode("div",Kw,[i.createVNode(N,{type:"primary",onClick:k},{default:i.withCtx(()=>[...C[3]||(C[3]=[i.createTextVNode(" Выбрать ",-1)])]),_:1}),i.createVNode(N,{onClick:C[0]||(C[0]=S=>r("update:show",!1))},{default:i.withCtx(()=>[...C[4]||(C[4]=[i.createTextVNode("Отмена",-1)])]),_:1})])])]),default:i.withCtx(()=>[i.createElementVNode("div",qw,[i.createElementVNode("div",Xw,[i.createVNode(Pu,{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":m},null,8,["from","to","clearable","disabled","date-format"]),t.clearable?(i.openBlock(),i.createBlock(N,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:p},{default:i.withCtx(()=>[...C[2]||(C[2]=[i.createTextVNode(" Очистить период ",-1)])]),_:1})):i.createCommentVNode("",!0)]),s.value==="custom"?(i.openBlock(),i.createElementBlock("div",Yw,[i.createVNode(Nw,{from:l.value.from,to:l.value.to,onSelect:g},null,8,["from","to"])])):(i.openBlock(),i.createBlock(jw,{key:1,"active-key":d.value,"custom-periods":t.customPeriods,onApply:y,onPreview:b},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),Qw={class:"flex w-full min-w-0 items-center gap-1"},Jw={},ex=i.defineComponent({...Jw,__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 D.isEmpty(u)?void 0:u}),a=(u,h)=>{r("update:date-range",Ru(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 p,g,y,b;const f=kw,m=z.NButton;return i.openBlock(),i.createElementBlock("div",Qw,[i.createVNode(Pu,{from:(p=t.dateRange)==null?void 0:p.from,to:(g=t.dateRange)==null?void 0:g.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(m,{disabled:!!((y=t.disabled)!=null&&y.from&&((b=t.disabled)!=null&&b.to)),title:"Выбрать период","aria-label":"Выбрать период",onClick:h[0]||(h[0]=_=>o.value=!0)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled"]),i.createVNode(Zw,{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"])])}}}),tx={class:"sc-lbl-date text-nowrap"},nx={},Lo=i.defineComponent({...nx,__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(()=>He.format(e.date,j.useBaseConfigStateStore().config.dateFormats.uiDate)),r=i.computed(()=>He.format(e.date,"HH:mm"));return(o,s)=>(i.openBlock(),i.createElementBlock("span",{class:i.normalizeClass({"flex flex-col":t.isTimeOnSecondLine})},[i.createElementVNode("span",tx,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))}}),ix={},rx=i.defineComponent({...ix,__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)}}),ox={class:"flex flex-row gap-2.5"},sx={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},ax={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},lx={class:"mb-0.5 sm:mb-0 sm:ml-3"},cx={},dx=i.defineComponent({...cx,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(t){return(e,n)=>{const r=Do,o=z.NButton,s=z.NPopover;return i.openBlock(),i.createElementBlock("div",ox,[i.createElementVNode("div",sx,[i.renderSlot(e.$slots,"main")]),i.createElementVNode("div",null,[i.createElementVNode("div",ax,[i.renderSlot(e.$slots,"extra-buttons"),i.createElementVNode("div",lx,[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)])])])])}}}),ux={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function fx(t,e){return i.openBlock(),i.createElementBlock("svg",ux,[...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 hx=i.markRaw({name:"ion-checkmark-done-sharp",render:fx}),mx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function px(t,e){return i.openBlock(),i.createElementBlock("svg",mx,[...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 gx=i.markRaw({name:"ion-options-outline",render:px}),yx={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},bx={class:"flex-auto"},_x={class:"sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0"},wx={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"},xx={},pa=i.defineComponent({...xx,__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=gx,h=z.NButton,f=z.NPopover,m=hx,p=Do;return i.openBlock(),i.createElementBlock("div",yx,[i.createElementVNode("div",bx,[i.renderSlot(c.$slots,"default")]),i.createElementVNode("div",null,[i.createElementVNode("div",_x,[i.createElementVNode("div",wx,[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(m)]),_: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(p)]),_:1},8,["disabled"])]),default:i.withCtx(()=>[d[2]||(d[2]=i.createTextVNode(" Отменить изменения ",-1))]),_:1})):i.createCommentVNode("",!0)]),i.renderSlot(c.$slots,"extra-buttons")])])])}}}),kx={},Fu=i.defineComponent({...kx,__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(pa,{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(pa,{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"]))]))}}),vx={key:0,class:"whitespace-pre-line"},Cx={key:1,class:"text-sc-dark-grey"},Sx={},Bx=i.defineComponent({...Sx,__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=z.NInput;return i.openBlock(),i.createBlock(Fu,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",vx,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",Cx," - Комментарий отсутствует - "))])]),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"])}}}),Tx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Nx(t,e){return i.openBlock(),i.createElementBlock("svg",Tx,[...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 $x=i.markRaw({name:"ion-download-outline",render:Nx}),Rx={},Ex=i.defineComponent({...Rx,__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=$x;return i.openBlock(),i.createBlock(i.unref(z.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(z.NUploadDragger),null,{default:i.withCtx(()=>[i.renderSlot(l.$slots,"dragged-area",{},()=>[i.createElementVNode("div",null,[i.createVNode(d,{class:"text-2xl"}),i.createElementVNode("div",null,i.toDisplayString(t.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),Px={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Fx(t,e){return i.openBlock(),i.createElementBlock("svg",Px,[...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 Vx=i.markRaw({name:"ion-warning",render:Fx}),Mx={},Ax=i.defineComponent({...Mx,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=Vx,o=z.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"])}}}),Ix={},Ox=i.defineComponent({...Ix,__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=D.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(z.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"]))}}),zx={},Dx=i.defineComponent({...zx,__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=D.debounce(()=>o("update:value",s.value),a.value),c=m=>{s.value=m,l()};i.watch(()=>r.value,m=>{s.value=m});const d=i.ref(null);return e({focus:()=>{var m;return(m=d.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=d.value)==null?void 0:m.blur()},select:()=>{var m;return(m=d.value)==null?void 0:m.select()}}),(m,p)=>(i.openBlock(),i.createBlock(i.unref(z.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:p[0]||(p[0]=g=>o("keydown",g)),onInput:p[1]||(p[1]=g=>o("input",g)),onFocus:p[2]||(p[2]=g=>o("focus",g))},{prefix:i.withCtx(()=>[i.renderSlot(m.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),Lx={},Hx=i.defineComponent({...Lx,__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=D.debounce(c=>r("update:value",c),n.debounceTime??0),a=c=>{let d="";if(D.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(D.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof br.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=br.parsePhoneNumberWithError(`+${d}`);u.isValid()?o.value=u.format("E.164"):u.getPossibleCountries().length>0&&(o.value=`+${d}`)}catch(u){if(u instanceof br.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(Lh.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"]))}}),Wx=An(Hx,[["__scopeId","data-v-751dbb0e"]]),jx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function qx(t,e){return i.openBlock(),i.createElementBlock("svg",jx,[...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 Xx=i.markRaw({name:"tabler-external-link",render:qx}),Yx={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},Ux=["href"],Kx={},Gx=i.defineComponent({...Kx,__name:"external-link",props:{text:{},url:{},description:{}},setup(t){return(e,n)=>{const r=Xx,o=z.NTooltip;return i.openBlock(),i.createBlock(o,{disabled:i.unref(D.isUndefined)(t.description),placement:"top-start"},{trigger:i.withCtx(()=>[i.createElementVNode("span",Yx,[i.createElementVNode("a",{href:t.url,target:"_blank",class:"no-underline"},i.toDisplayString(t.text),9,Ux),i.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.description),1)]),_:1},8,["disabled"])}}}),Zx={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Qx(t,e){return i.openBlock(),i.createElementBlock("svg",Zx,[...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 Jx=i.markRaw({name:"ion-remove-circle-outline",render:Qx});let Ho=[];const Vu=new WeakMap;function ek(){Ho.forEach(t=>t(...Vu.get(t))),Ho=[]}function Mu(t,...e){Vu.set(t,e),!Ho.includes(t)&&Ho.push(t)===1&&requestAnimationFrame(ek)}function Pr(t,e){let{target:n}=t;for(;n;){if(n.dataset&&n.dataset[e]!==void 0)return!0;n=n.parentElement}return!1}function Fr(t){return t.composedPath()[0]||null}function Vr(t){return typeof t=="string"?t.endsWith("px")?Number(t.slice(0,t.length-2)):Number(t):t}function Mr(t){if(t!=null)return typeof t=="number"?`${t}px`:t.endsWith("px")?t:`${t}px`}function fn(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 Au={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 tk(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 nk(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 Nn="^\\s*",$n="\\s*$",ai="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Kt="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Ci="([0-9A-Fa-f])",Si="([0-9A-Fa-f]{2})",Iu=new RegExp(`${Nn}hsl\\s*\\(${Kt},${ai},${ai}\\)${$n}`),Ou=new RegExp(`${Nn}hsv\\s*\\(${Kt},${ai},${ai}\\)${$n}`),zu=new RegExp(`${Nn}hsla\\s*\\(${Kt},${ai},${ai},${Kt}\\)${$n}`),Du=new RegExp(`${Nn}hsva\\s*\\(${Kt},${ai},${ai},${Kt}\\)${$n}`),ik=new RegExp(`${Nn}rgb\\s*\\(${Kt},${Kt},${Kt}\\)${$n}`),rk=new RegExp(`${Nn}rgba\\s*\\(${Kt},${Kt},${Kt},${Kt}\\)${$n}`),ok=new RegExp(`${Nn}#${Ci}${Ci}${Ci}${$n}`),sk=new RegExp(`${Nn}#${Si}${Si}${Si}${$n}`),ak=new RegExp(`${Nn}#${Ci}${Ci}${Ci}${Ci}${$n}`),lk=new RegExp(`${Nn}#${Si}${Si}${Si}${Si}${$n}`);function qt(t){return parseInt(t,16)}function ck(t){try{let e;if(e=zu.exec(t))return[jo(e[1]),li(e[5]),li(e[9]),Ti(e[13])];if(e=Iu.exec(t))return[jo(e[1]),li(e[5]),li(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${t}.`)}catch(e){throw e}}function dk(t){try{let e;if(e=Du.exec(t))return[jo(e[1]),li(e[5]),li(e[9]),Ti(e[13])];if(e=Ou.exec(t))return[jo(e[1]),li(e[5]),li(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${t}.`)}catch(e){throw e}}function Bi(t){try{let e;if(e=sk.exec(t))return[qt(e[1]),qt(e[2]),qt(e[3]),1];if(e=ik.exec(t))return[Ct(e[1]),Ct(e[5]),Ct(e[9]),1];if(e=rk.exec(t))return[Ct(e[1]),Ct(e[5]),Ct(e[9]),Ti(e[13])];if(e=ok.exec(t))return[qt(e[1]+e[1]),qt(e[2]+e[2]),qt(e[3]+e[3]),1];if(e=lk.exec(t))return[qt(e[1]),qt(e[2]),qt(e[3]),Ti(qt(e[4])/255)];if(e=ak.exec(t))return[qt(e[1]+e[1]),qt(e[2]+e[2]),qt(e[3]+e[3]),Ti(qt(e[4]+e[4])/255)];if(t in Au)return Bi(Au[t]);if(Iu.test(t)||zu.test(t)){const[n,r,o,s]=ck(t);return[...nk(n,r,o),s]}else if(Ou.test(t)||Du.test(t)){const[n,r,o,s]=dk(t);return[...tk(n,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${t}.`)}catch(e){throw e}}function uk(t){return t>1?1:t<0?0:t}function ga(t,e,n,r){return`rgba(${Ct(t)}, ${Ct(e)}, ${Ct(n)}, ${uk(r)})`}function ya(t,e,n,r,o){return Ct((t*e*(1-r)+n*r)/o)}function fk(t,e){Array.isArray(t)||(t=Bi(t)),Array.isArray(e)||(e=Bi(e));const n=t[3],r=e[3],o=Ti(n+r-n*r);return ga(ya(t[0],n,e[0],r,o),ya(t[1],n,e[1],r,o),ya(t[2],n,e[2],r,o),o)}function ze(t,e){const[n,r,o,s=1]=Array.isArray(t)?t:Bi(t);return typeof e.alpha=="number"?ga(n,r,o,e.alpha):ga(n,r,o,s)}function Wo(t,e){const[n,r,o,s=1]=Array.isArray(t)?t:Bi(t),{lightness:a=1,alpha:l=1}=e;return hk([n*a,r*a,o*a,s*l])}function Ti(t){const e=Math.round(Number(t)*100)/100;return e>1?1:e<0?0:e}function jo(t){const e=Math.round(Number(t));return e>=360||e<0?0:e}function Ct(t){const e=Math.round(Number(t));return e>255?255:e<0?0:e}function li(t){const e=Math.round(Number(t));return e>100?100:e<0?0:e}function hk(t){const[e,n,r]=t;return 3 in t?`rgba(${Ct(e)}, ${Ct(n)}, ${Ct(r)}, ${Ti(t[3])})`:`rgba(${Ct(e)}, ${Ct(n)}, ${Ct(r)}, 1)`}function mk(t=8){return Math.random().toString(16).slice(2,2+t)}function Lu(t){return Array.isArray(t)?t:[t]}const ba={STOP:"STOP"};function Hu(t,e){const n=e(t);t.children!==void 0&&n!==ba.STOP&&t.children.forEach(r=>Hu(r,e))}function pk(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 gk(t,e){const{isLeaf:n}=t;return n!==void 0?n:!e(t)}function yk(t){return t.children}function bk(t){return t.key}function _k(){return!1}function wk(t,e){const{isLeaf:n}=t;return!(n===!1&&!Array.isArray(e(t)))}function xk(t){return t.disabled===!0}function kk(t,e){return t.isLeaf===!1&&!Array.isArray(e(t))}function vk(t,e){if(t.isLeaf===!0){const n=e(t);if(Array.isArray(n)&&n.length>0)return!0}return!1}function _a(t){var e;return t==null?[]:Array.isArray(t)?t:(e=t.checkedKeys)!==null&&e!==void 0?e:[]}function wa(t){var e;return t==null||Array.isArray(t)?[]:(e=t.indeterminateKeys)!==null&&e!==void 0?e:[]}function Ck(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)||n.add(r)}),Array.from(n)}function Sk(t,e){const n=new Set(t);return e.forEach(r=>{n.has(r)&&n.delete(r)}),Array.from(n)}function Bk(t){return(t==null?void 0:t.type)==="group"}function Tk(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 Nk extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function $k(t,e,n,r){return qo(e.concat(t),n,r,!1)}function Rk(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 Ek(t,e,n,r){const o=qo(e,n,r,!1),s=qo(t,n,r,!0),a=Rk(t,n),l=[];return o.forEach(c=>{(s.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>o.delete(c)),o}function xa(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:Ck(n,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:Sk(n,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let h;o!==void 0?h=Ek(o,n,e,d):r!==void 0?h=$k(r,n,e,d):h=qo(n,e,d,!1);const f=c==="parent",m=c==="child"||l,p=h,g=new Set,y=Math.max.apply(null,Array.from(u.keys()));for(let b=y;b>=0;b-=1){const _=b===0,k=u.get(b);for(const x of k){if(x.isLeaf)continue;const{key:C,shallowLoaded:N}=x;if(m&&N&&x.children.forEach($=>{!$.disabled&&!$.isLeaf&&$.shallowLoaded&&p.has($.key)&&p.delete($.key)}),x.disabled||!N)continue;let w=!0,S=!1,v=!0;for(const $ of x.children){const E=$.key;if(!$.disabled){if(v&&(v=!1),p.has(E))S=!0;else if(g.has(E)){S=!0,w=!1;break}else if(w=!1,S)break}}w&&!v?(f&&x.children.forEach($=>{!$.disabled&&p.has($.key)&&p.delete($.key)}),p.add(C)):S&&g.add(C),_&&m&&p.has(C)&&p.delete(C)}}return{checkedKeys:Array.from(p),indeterminateKeys:Array.from(g)}}function qo(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&&Hu(d,u=>{if(u.disabled)return ba.STOP;const{key:h}=u;if(!a.has(h)&&(a.add(h),l.add(h),kk(u.rawNode,s))){if(r)return ba.STOP;if(!n)throw new Nk}})}),l}function Pk(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 Fk(t){if(t.length===0)return null;const e=t[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function Vk(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 Wu(t,e,{loop:n=!1,includeDisabled:r=!1}={}){const o=e==="prev"?Mk:Vk,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=ka(d,s);u!==null?l=u:c(o(d,n))}else{const u=o(d,!1);if(u!==null)c(u);else{const h=Ak(d);h!=null&&h.isGroup?c(o(h,n)):n&&c(o(d,!0))}}}}return c(t),l}function Mk(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 Ak(t){return t.parent}function ka(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=ka(d,e);if(u!==null)return u}else return d}}return null}const Ik={getChild(){return this.ignored?null:ka(this)},getParent(){const{parent:t}=this;return t!=null&&t.isGroup?t.getParent():t},getNext(t={}){return Wu(this,"next",t)},getPrev(t={}){return Wu(this,"prev",t)}};function Ok(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 zk(t,e){const n=t.key;for(;e;){if(e.key===n)return!0;e=e.parent}return!1}var Dk={};function ju(t,e,n,r,o,s=null,a=0){const l=[];return t.forEach((c,d)=>{var u;Dk.NODE_ENV!=="production"&&vk(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=ju(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 Lk(t,e={}){var n;const r=new Map,o=new Map,{getDisabled:s=xk,getIgnored:a=_k,getIsGroup:l=Bk,getKey:c=bk}=e,d=(n=e.getChildren)!==null&&n!==void 0?n:yk,u=e.ignoreEmptyChildren?x=>{const C=d(x);return Array.isArray(C)?C.length?C:null:C}: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 gk(this.rawNode,u)},get shallowLoaded(){return wk(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(x){return zk(this,x)}},Ik),f=ju(t,r,o,h,u);function m(x){if(x==null)return null;const C=r.get(x);return C&&!C.isGroup&&!C.ignored?C:null}function p(x){if(x==null)return null;const C=r.get(x);return C&&!C.ignored?C:null}function g(x,C){const N=p(x);return N?N.getPrev(C):null}function y(x,C){const N=p(x);return N?N.getNext(C):null}function b(x){const C=p(x);return C?C.getParent():null}function _(x){const C=p(x);return C?C.getChild():null}const k={treeNodes:f,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(x){return Ok(f,x)},getNode:m,getPrev:g,getNext:y,getParent:b,getChild:_,getFirstAvailableNode(){return Fk(f)},getPath(x,C={}){return Pk(x,C,k)},getCheckedKeys(x,C={}){const{cascade:N=!0,leafOnly:w=!1,checkStrategy:S="all",allowNotLoaded:v=!1}=C;return xa({checkedKeys:_a(x),indeterminateKeys:wa(x),cascade:N,leafOnly:w,checkStrategy:S,allowNotLoaded:v},k)},check(x,C,N={}){const{cascade:w=!0,leafOnly:S=!1,checkStrategy:v="all",allowNotLoaded:$=!1}=N;return xa({checkedKeys:_a(C),indeterminateKeys:wa(C),keysToCheck:x==null?[]:Lu(x),cascade:w,leafOnly:S,checkStrategy:v,allowNotLoaded:$},k)},uncheck(x,C,N={}){const{cascade:w=!0,leafOnly:S=!1,checkStrategy:v="all",allowNotLoaded:$=!1}=N;return xa({checkedKeys:_a(C),indeterminateKeys:wa(C),keysToUncheck:x==null?[]:Lu(x),cascade:w,leafOnly:S,checkStrategy:v,allowNotLoaded:$},k)},getNonLeafKeys(x={}){return pk(f,x)}};return k}function Xo(t){return t.composedPath()[0]}const Hk={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Wk(t,e,n){if(t==="mousemoveoutside"){const r=o=>{e.contains(Xo(o))||n(o)};return{mousemove:r,touchstart:r}}else if(t==="clickoutside"){let r=!1;const o=a=>{r=!e.contains(Xo(a))},s=a=>{r&&(e.contains(Xo(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 qu(t,e,n){const r=Hk[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=Wk(t,e,n)),s}function jk(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=qu(t,e,n);return Object.keys(o).forEach(s=>{Mt(s,document,o[s],r)}),!0}return!1}function qk(t,e,n,r){if(t==="mousemoveoutside"||t==="clickoutside"){const o=qu(t,e,n);return Object.keys(o).forEach(s=>{ft(s,document,o[s],r)}),!0}return!1}function Xk(){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,S,v){const $=w[S];return w[S]=function(){return v.apply(w,arguments),$.apply(w,arguments)},w}function s(w,S){w[S]=Event.prototype[S]}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,S){l!==void 0&&Object.defineProperty(w,"currentTarget",{configurable:!0,enumerable:!0,get:S??l.get})}const u={bubble:{},capture:{}},h={};function f(){const w=function(S){const{type:v,eventPhase:$,bubbles:E}=S,A=Xo(S);if($===2)return;const R=$===1?"capture":"bubble";let F=A;const H=[];for(;F===null&&(F=window),H.push(F),F!==window;)F=F.parentNode||null;const Q=u.capture[v],Z=u.bubble[v];if(o(S,"stopPropagation",n),o(S,"stopImmediatePropagation",r),d(S,c),R==="capture"){if(Q===void 0)return;for(let O=H.length-1;O>=0&&!t.has(S);--O){const P=H[O],V=Q.get(P);if(V!==void 0){a.set(S,P);for(const M of V){if(e.has(S))break;M(S)}}if(O===0&&!E&&Z!==void 0){const M=Z.get(P);if(M!==void 0)for(const L of M){if(e.has(S))break;L(S)}}}}else if(R==="bubble"){if(Z===void 0)return;for(let O=0;O<H.length&&!t.has(S);++O){const P=H[O],V=Z.get(P);if(V!==void 0){a.set(S,P);for(const M of V){if(e.has(S))break;M(S)}}}}s(S,"stopPropagation"),s(S,"stopImmediatePropagation"),d(S)};return w.displayName="evtdUnifiedHandler",w}function m(){const w=function(S){const{type:v,eventPhase:$}=S;if($!==2)return;const E=h[v];E!==void 0&&E.forEach(A=>A(S))};return w.displayName="evtdUnifiedWindowEventHandler",w}const p=f(),g=m();function y(w,S){const v=u[w];return v[S]===void 0&&(v[S]=new Map,window.addEventListener(S,p,w==="capture")),v[S]}function b(w){return h[w]===void 0&&(h[w]=new Set,window.addEventListener(w,g)),h[w]}function _(w,S){let v=w.get(S);return v===void 0&&w.set(S,v=new Set),v}function k(w,S,v,$){const E=u[S][v];if(E!==void 0){const A=E.get(w);if(A!==void 0&&A.has($))return!0}return!1}function x(w,S){const v=h[w];return!!(v!==void 0&&v.has(S))}function C(w,S,v,$){let E;if(typeof $=="object"&&$.once===!0?E=Q=>{N(w,S,E,$),v(Q)}:E=v,jk(w,S,E,$))return;const R=$===!0||typeof $=="object"&&$.capture===!0?"capture":"bubble",F=y(R,w),H=_(F,S);if(H.has(E)||H.add(E),S===window){const Q=b(w);Q.has(E)||Q.add(E)}}function N(w,S,v,$){if(qk(w,S,v,$))return;const A=$===!0||typeof $=="object"&&$.capture===!0,R=A?"capture":"bubble",F=y(R,w),H=_(F,S);if(S===window&&!k(S,A?"bubble":"capture",w,v)&&x(w,v)){const Z=h[w];Z.delete(v),Z.size===0&&(window.removeEventListener(w,g),h[w]=void 0)}H.has(v)&&H.delete(v),H.size===0&&F.delete(S),F.size===0&&(window.removeEventListener(w,p,R==="capture"),u[R][w]=void 0)}return{on:C,off:N}}const{on:Mt,off:ft}=Xk(),lr="@@mmoContext",Yk={mounted(t,{value:e}){t[lr]={handler:void 0},typeof e=="function"&&(t[lr].handler=e,Mt("mousemoveoutside",t,e))},updated(t,{value:e}){const n=t[lr];typeof e=="function"?n.handler?n.handler!==e&&(ft("mousemoveoutside",t,n.handler),n.handler=e,Mt("mousemoveoutside",t,e)):(t[lr].handler=e,Mt("mousemoveoutside",t,e)):n.handler&&(ft("mousemoveoutside",t,n.handler),n.handler=void 0)},unmounted(t){const{handler:e}=t[lr];e&&ft("mousemoveoutside",t,e),t[lr].handler=void 0}},cr="@@coContext",Yo={mounted(t,{value:e,modifiers:n}){t[cr]={handler:void 0},typeof e=="function"&&(t[cr].handler=e,Mt("clickoutside",t,e,{capture:n.capture}))},updated(t,{value:e,modifiers:n}){const r=t[cr];typeof e=="function"?r.handler?r.handler!==e&&(ft("clickoutside",t,r.handler,{capture:n.capture}),r.handler=e,Mt("clickoutside",t,e,{capture:n.capture})):(t[cr].handler=e,Mt("clickoutside",t,e,{capture:n.capture})):r.handler&&(ft("clickoutside",t,r.handler,{capture:n.capture}),r.handler=void 0)},unmounted(t,{modifiers:e}){const{handler:n}=t[cr];n&&ft("clickoutside",t,n,{capture:e.capture}),t[cr].handler=void 0}};function Uk(t,e){console.error(`[vdirs/${t}]: ${e}`)}class Kk{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&&Uk("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 va=new Kk,dr="@@ziContext",Xu={mounted(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n;t[dr]={enabled:!!o,initialized:!1},o&&(va.ensureZIndex(t,r),t[dr].initialized=!0)},updated(t,e){const{value:n={}}=e,{zIndex:r,enabled:o}=n,s=t[dr].enabled;o&&!s&&(va.ensureZIndex(t,r),t[dr].initialized=!0),t[dr].enabled=!!o},unmounted(t,e){if(!t[dr].initialized)return;const{value:n={}}=e,{zIndex:r}=n;va.unregister(t,r)}};function Gk(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 rn(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 Zk=typeof window<"u";let ur,Ar;(()=>{var t,e;ur=Zk?(e=(t=document)===null||t===void 0?void 0:t.fonts)===null||e===void 0?void 0:e.ready:void 0,Ar=!1,ur!==void 0?ur.then(()=>{Ar=!0}):Ar=!0})();function Qk(t){if(Ar)return;let e=!1;i.onMounted(()=>{Ar||ur==null||ur.then(()=>{e||t()})}),i.onBeforeUnmount(()=>{e=!0})}function Ca(t,e){return i.watch(t,n=>{n!==void 0&&(e.value=n)}),i.computed(()=>t.value===void 0?e.value:t.value)}function Uo(){const t=i.ref(!1);return i.onMounted(()=>{t.value=!0}),i.readonly(t)}function Yu(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 Jk=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function ev(){return Jk}function Sa(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);return r()}function Ba(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)){Ba(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Ba(r.children,e,n)}else r.type!==i.Comment&&n.push(r)}}),n}function Uu(t,e,n="default"){const r=e[n];if(r===void 0)throw new Error(`[vueuc/${t}]: slot[${n}] is empty.`);const o=Ba(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${t}]: slot[${n}] should have exactly one child.`)}let ci=null;function Ku(){if(ci===null&&(ci=document.getElementById("v-binder-view-measurer"),ci===null)){ci=document.createElement("div"),ci.id="v-binder-view-measurer";const{style:t}=ci;t.position="fixed",t.left="0",t.right="0",t.top="0",t.bottom="0",t.pointerEvents="none",t.visibility="hidden",document.body.appendChild(ci)}return ci.getBoundingClientRect()}function tv(t,e){const n=Ku();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=Ku();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 nv(t){return t.nodeType===9?null:t.parentNode}function Gu(t){if(t===null)return null;const e=nv(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 Gu(e)}const Zu=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=b=>{r.value=b,n&&t.syncTargetWithParent&&n.setTargetRef(b)};let s=[];const a=()=>{let b=r.value;for(;b=Gu(b),b!==null;)s.push(b);for(const _ of s)Mt("scroll",_,h,!0)},l=()=>{for(const b of s)ft("scroll",b,h,!0);s=[]},c=new Set,d=b=>{c.size===0&&a(),c.has(b)||c.add(b)},u=b=>{c.has(b)&&c.delete(b),c.size===0&&l()},h=()=>{Mu(f)},f=()=>{c.forEach(b=>b())},m=new Set,p=b=>{m.size===0&&Mt("resize",window,y),m.has(b)||m.add(b)},g=b=>{m.has(b)&&m.delete(b),m.size===0&&ft("resize",window,y)},y=()=>{m.forEach(b=>b())};return i.onBeforeUnmount(()=>{ft("resize",window,y),l()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:p,removeResizeListener:g}},render(){return Sa("binder",this.$slots)}}),Qu=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(Uu("follower",this.$slots),[[e]]):Uu("follower",this.$slots)}}),iv="@css-render/vue3-ssr";function rv(t,e){return`<style cssr-id="${t}">
|
|
104
104
|
${e}
|
|
105
|
-
</style>`}function
|
|
105
|
+
</style>`}function ov(t,e,n){const{styles:r,ids:o}=n;o.has(t)||r!==null&&(o.add(t),r.push(rv(t,e)))}const sv=typeof document<"u";function Ni(){if(sv)return;const t=i.inject(iv,null);if(t!==null)return{adapter:(e,n)=>ov(e,n,t),context:t}}function Ju(t,e){console.error(`[vueuc/${t}]: ${e}`)}function av(t){let e=0;for(let n=0;n<t.length;++n)t[n]==="&"&&++e;return e}const ef=/\s*,(?![^(]*\))\s*/g,lv=/\s+/g;function cv(t,e){const n=[];return e.split(ef).forEach(r=>{let o=av(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 dv(t,e){const n=[];return e.split(ef).forEach(r=>{t.forEach(o=>{n.push((o&&o+" ")+r)})}),n}function uv(t){let e=[""];return t.forEach(n=>{n=n&&n.trim(),n&&(n.includes("&")?e=cv(e,n):e=dv(e,n))}),e.join(", ").replace(lv," ")}function tf(t){if(!t)return;const e=t.parentElement;e&&e.removeChild(t)}function Ko(t,e){return(e??document.head).querySelector(`style[cssr-id="${t}"]`)}function fv(t){const e=document.createElement("style");return e.setAttribute("cssr-id",t),e}function Go(t){return t?/^\s*@(s|m)/.test(t):!1}const hv=/[A-Z]/g;function nf(t){return t.replace(hv,e=>"-"+e.toLowerCase())}function mv(t,e=" "){return typeof t=="object"&&t!==null?` {
|
|
106
106
|
`+Object.entries(t).map(n=>e+` ${nf(n[0])}: ${n[1]};`).join(`
|
|
107
107
|
`)+`
|
|
108
|
-
`+e+"}":`: ${t};`}function
|
|
108
|
+
`+e+"}":`: ${t};`}function pv(t,e,n){return typeof t=="function"?t({context:e.context,props:n}):t}function rf(t,e,n,r){if(!e)return"";const o=pv(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=nf(l),c!=null&&a.push(` ${l}${
|
|
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 of(t,e,n,r,o){const s=t.$;let a="";if(!s||typeof s=="string")Go(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});Go(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")Go(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});Go(d)?a=d:e.push(d)}const l=
|
|
113
|
+
`);return}l=nf(l),c!=null&&a.push(` ${l}${mv(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 of(t,e,n,r,o){const s=t.$;let a="";if(!s||typeof s=="string")Go(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});Go(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")Go(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});Go(d)?a=d:e.push(d)}const l=uv(e),c=rf(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=rf(l,{raw:d},r,o);n.push(u)}else of(d,e,n,r,o)}),e.pop(),a&&n.push("}"),s&&s.after&&s.after(r.context)}function gv(t,e,n){const r=[];return of(t,[],r,e,n),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function $a(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 bv(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(tf),e.els=[];else{const s=Ko(n,r);s&&o.includes(s)&&(tf(s),e.els=o.filter(a=>a!==s))}}function sf(t,e){t.push(e)}function _v(t,e,n,r,o,s,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=$a(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=Ko(n,l);if(u!==null&&!s)return u;const h=u??hv(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),sf(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),sf(e.els,h),h}function wv(t){return yv(this,this.instance,t)}function xv(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return _v(this.instance,this,e,r,o,s,a,l,n)}function kv(t={}){const{id:e,parent:n}=t;bv(this.instance,this,e,n)}const Zo=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:wv,mount:xv,unmount:kv}},vv=function(t,e,n,r){return Array.isArray(e)?Zo(t,{$:null},null,e):Array.isArray(n)?Zo(t,e,null,n):Array.isArray(r)?Zo(t,e,n,r):Zo(t,e,n,null)};function af(t={}){const e={c:((...n)=>vv(e,...n)),use:(n,...r)=>n.install(e,...r),find:Ko,context:{},config:t};return e}function Cv(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return Ko(t)!==null}const{c:di}=af(),Ra="vueuc-style";function lf(t){return t&-t}class cf{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+=lf(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-=lf(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 df(t){return typeof t=="string"?document.querySelector(t):t()||null}const Sv=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Zk(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Sa("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Sa("lazy-teleport",this.$slots)):null}}),Qo={top:"bottom",bottom:"top",left:"right",right:"left"},uf={start:"end",center:"center",end:"start"},Ea={top:"height",bottom:"height",left:"width",right:"width"},Bv={"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"},Tv={"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"},Nv={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},ff={top:!0,bottom:!1,left:!0,right:!1},hf={top:"end",bottom:"start",left:"end",right:"start"};function $v(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=(m,p,g)=>{let y=0,b=0;const _=n[m]-e[p]-e[m];return _>0&&r&&(g?b=ff[p]?_:-_:y=ff[p]?_:-_),{left:y,top:b}},h=a==="left"||a==="right";if(c!=="center"){const m=Nv[t],p=Qo[m],g=Ea[m];if(n[g]>e[g]){if(e[m]+e[g]<n[g]){const y=(n[g]-e[g])/2;e[m]<y||e[p]<y?e[m]<e[p]?(c=uf[l],d=u(g,p,h)):d=u(g,m,h):c="center"}}else n[g]<e[g]&&e[p]<0&&e[m]>e[p]&&(c=uf[l])}else{const m=a==="bottom"||a==="top"?"left":"top",p=Qo[m],g=Ea[m],y=(n[g]-e[g])/2;(e[m]<y||e[p]<y)&&(e[m]>e[p]?(c=hf[m],d=u(g,m,h)):(c=hf[p],d=u(g,p,h)))}let f=a;return e[a]<n[Ea[a]]&&e[a]<e[Qo[a]]&&(f=Qo[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function Rv(t,e){return e?Tv[t]:Bv[t]}function Ev(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 Pv=di([di(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),di(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[di("> *",{pointerEvents:"all"})])]),mf=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=rn(()=>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=Ni();Pv.mount({id:"vueuc/binder",head:!0,anchorMetaName:Ra,ssr:l}),i.onBeforeUnmount(()=>{a()}),Jk(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const m=e.targetRef,{x:p,y:g,overlap:y}=t,b=p!==void 0&&g!==void 0?nv(p,g):Ta(m);f.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:k,placement:x,internalShift:C,flip:N}=t;f.setAttribute("v-placement",x),y?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:w}=f;_==="target"?w.width=`${b.width}px`:_!==void 0?w.width=_:w.width="",k==="target"?w.minWidth=`${b.width}px`:k!==void 0?w.minWidth=k:w.minWidth="";const S=Ta(f),v=Ta(o.value),{left:$,top:E,placement:A}=$v(x,b,S,C,N,y),R=Rv(A,y),{left:F,top:H,transform:Q}=Ev(A,v,b,E,$,y);f.setAttribute("v-placement",A),f.style.setProperty("--v-offset-left",`${Math.round($)}px`),f.style.setProperty("--v-offset-top",`${Math.round(E)}px`),f.style.transform=`translateX(${F}) translateY(${H}) ${Q}`,f.style.setProperty("--v-transform-origin",R),f.style.transformOrigin=R};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=Uo(),h=rn(()=>{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(Sv,{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,[[Xu,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var $i=[],Fv=function(){return $i.some(function(t){return t.activeTargets.length>0})},Vv=function(){return $i.some(function(t){return t.skippedTargets.length>0})},pf="ResizeObserver loop completed with undelivered notifications.",Mv=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:pf}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=pf),window.dispatchEvent(t)},Ir;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Ir||(Ir={}));var Ri=function(t){return Object.freeze(t)},Av=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Ri(this)}return t})(),gf=(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,Ri(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})(),Pa=function(t){return t instanceof SVGElement&&"getBBox"in t},yf=function(t){if(Pa(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)},bf=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)},Iv=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},Or=typeof window<"u"?window:{},Jo=new WeakMap,_f=/auto|scroll/,Ov=/^tb|vertical/,zv=/msie|trident/i.test(Or.navigator&&Or.navigator.userAgent),Rn=function(t){return parseFloat(t||"0")},fr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Av((n?e:t)||0,(n?t:e)||0)},wf=Ri({devicePixelContentBoxSize:fr(),borderBoxSize:fr(),contentBoxSize:fr(),contentRect:new gf(0,0,0,0)}),xf=function(t,e){if(e===void 0&&(e=!1),Jo.has(t)&&!e)return Jo.get(t);if(yf(t))return Jo.set(t,wf),wf;var n=getComputedStyle(t),r=Pa(t)&&t.ownerSVGElement&&t.getBBox(),o=!zv&&n.boxSizing==="border-box",s=Ov.test(n.writingMode||""),a=!r&&_f.test(n.overflowY||""),l=!r&&_f.test(n.overflowX||""),c=r?0:Rn(n.paddingTop),d=r?0:Rn(n.paddingRight),u=r?0:Rn(n.paddingBottom),h=r?0:Rn(n.paddingLeft),f=r?0:Rn(n.borderTopWidth),m=r?0:Rn(n.borderRightWidth),p=r?0:Rn(n.borderBottomWidth),g=r?0:Rn(n.borderLeftWidth),y=h+d,b=c+u,_=g+m,k=f+p,x=l?t.offsetHeight-k-t.clientHeight:0,C=a?t.offsetWidth-_-t.clientWidth:0,N=o?y+_:0,w=o?b+k:0,S=r?r.width:Rn(n.width)-N-C,v=r?r.height:Rn(n.height)-w-x,$=S+y+C+_,E=v+b+x+k,A=Ri({devicePixelContentBoxSize:fr(Math.round(S*devicePixelRatio),Math.round(v*devicePixelRatio),s),borderBoxSize:fr($,E,s),contentBoxSize:fr(S,v,s),contentRect:new gf(h,c,S,v)});return Jo.set(t,A),A},kf=function(t,e,n){var r=xf(t,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Ir.DEVICE_PIXEL_CONTENT_BOX:return a;case Ir.BORDER_BOX:return o;default:return s}},Dv=(function(){function t(e){var n=xf(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Ri([n.borderBoxSize]),this.contentBoxSize=Ri([n.contentBoxSize]),this.devicePixelContentBoxSize=Ri([n.devicePixelContentBoxSize])}return t})(),vf=function(t){if(yf(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Lv=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 Dv(d.target),h=vf(d.target);l.push(u),d.lastReportedSize=kf(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},Cf=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()&&(vf(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Hv=function(){var t=0;for(Cf(t);Fv();)t=Lv(),Cf(t);return Vv()&&Mv(),t>0},Fa,Sf=[],Wv=function(){return Sf.splice(0).forEach(function(t){return t()})},jv=function(t){if(!Fa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Wv()}).observe(n,r),Fa=function(){n.textContent="".concat(e?e--:e++)}}Sf.push(t),Fa()},qv=function(t){jv(function(){requestAnimationFrame(t)})},es=0,Xv=function(){return!!es},Yv=250,Uv={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bf=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Tf=function(t){return t===void 0&&(t=0),Date.now()+t},Va=!1,Kv=(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=Yv),!Va){Va=!0;var r=Tf(e);qv(function(){var o=!1;try{o=Hv()}finally{if(Va=!1,e=r-Tf(),!Xv())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,Uv)};document.body?n():Or.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bf.forEach(function(n){return Or.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Bf.forEach(function(n){return Or.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),Ma=new Kv,Nf=function(t){!es&&t>0&&Ma.start(),es+=t,!es&&Ma.stop()},Gv=function(t){return!Pa(t)&&!Iv(t)&&getComputedStyle(t).display==="inline"},Zv=(function(){function t(e,n){this.target=e,this.observedBox=n||Ir.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=kf(this.target,this.observedBox,!0);return Gv(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Qv=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),ts=new WeakMap,$f=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},ns=(function(){function t(){}return t.connect=function(e,n){var r=new Qv(e,n);ts.set(e,r)},t.observe=function(e,n,r){var o=ts.get(e),s=o.observationTargets.length===0;$f(o.observationTargets,n)<0&&(s&&$i.push(o),o.observationTargets.push(new Zv(n,r&&r.box)),Nf(1),Ma.schedule())},t.unobserve=function(e,n){var r=ts.get(e),o=$f(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&$i.splice($i.indexOf(r),1),r.observationTargets.splice(o,1),Nf(-1))},t.disconnect=function(e){var n=this,r=ts.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Jv=(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.");ns.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(!bf(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ns.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(!bf(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ns.unobserve(this,e)},t.prototype.disconnect=function(){ns.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class e2{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Jv)(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 zr=new e2,is=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){Ju("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){Ju("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(zr.registerHandler(o.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&zr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let rs;function t2(){return typeof document>"u"?!1:(rs===void 0&&("matchMedia"in window?rs=window.matchMedia("(pointer:coarse)").matches:rs=!1),rs)}let Aa;function Rf(){return typeof document>"u"?1:(Aa===void 0&&(Aa="chrome"in window?window.devicePixelRatio:1),Aa)}const Ef="VVirtualListXScroll";function n2({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 cf(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=rn(()=>{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=rn(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return i.provide(Ef,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Pf=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(Ef);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}}),i2=di(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[di("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[di("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),r2=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=Ni();i2.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Ra,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:R,defaultScrollKey:F}=t;R!=null?y({index:R}):F!=null&&y({key:F})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:m.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const o=rn(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let R=0;return t.columns.forEach(F=>{R+=F.width}),R}),s=i.computed(()=>{const R=new Map,{keyField:F}=t;return t.items.forEach((H,Q)=>{R.set(H[F],Q)}),R}),{scrollLeftRef:a,listWidthRef:l}=n2({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:R,itemSize:F,keyField:H}=t,Q=new cf(R.length,F);return R.forEach((Z,O)=>{const P=Z[H],V=u.get(P);V!==void 0&&Q.add(O,V)}),Q}),f=i.ref(0),m=i.ref(0),p=rn(()=>Math.max(h.value.getBound(m.value-Vr(t.paddingTop))-1,0)),g=i.computed(()=>{const{value:R}=d;if(R===void 0)return[];const{items:F,itemSize:H}=t,Q=p.value,Z=Math.min(Q+Math.ceil(R/H+1),F.length-1),O=[];for(let P=Q;P<=Z;++P)O.push(F[P]);return O}),y=(R,F)=>{if(typeof R=="number"){x(R,F,"auto");return}const{left:H,top:Q,index:Z,key:O,position:P,behavior:V,debounce:M=!0}=R;if(H!==void 0||Q!==void 0)x(H,Q,V);else if(Z!==void 0)k(Z,V,M);else if(O!==void 0){const L=s.value.get(O);L!==void 0&&k(L,V,M)}else P==="bottom"?x(0,Number.MAX_SAFE_INTEGER,V):P==="top"&&x(0,0,V)};let b,_=null;function k(R,F,H){const{value:Q}=h,Z=Q.sum(R)+Vr(t.paddingTop);if(!H)c.value.scrollTo({left:0,top:Z,behavior:F});else{b=R,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:O,offsetHeight:P}=c.value;if(Z>O){const V=Q.get(R);Z+V<=O+P||c.value.scrollTo({left:0,top:Z+V-P,behavior:F})}else c.value.scrollTo({left:0,top:Z,behavior:F})}}function x(R,F,H){c.value.scrollTo({left:R,top:F,behavior:H})}function C(R,F){var H,Q,Z;if(n||t.ignoreItemResize||A(F.target))return;const{value:O}=h,P=s.value.get(R),V=O.get(P),M=(Z=(Q=(H=F.borderBoxSize)===null||H===void 0?void 0:H[0])===null||Q===void 0?void 0:Q.blockSize)!==null&&Z!==void 0?Z:F.contentRect.height;if(M===V)return;M-t.itemSize===0?u.delete(R):u.set(R,M-t.itemSize);const Y=M-V;if(Y===0)return;O.add(P,Y);const U=c.value;if(U!=null){if(b===void 0){const G=O.sum(P);U.scrollTop>G&&U.scrollBy(0,Y)}else if(P<b)U.scrollBy(0,Y);else if(P===b){const G=O.sum(P);M+G>U.scrollTop+U.offsetHeight&&U.scrollBy(0,Y)}E()}f.value++}const N=!t2();let w=!1;function S(R){var F;(F=t.onScroll)===null||F===void 0||F.call(t,R),(!N||!w)&&E()}function v(R){var F;if((F=t.onWheel)===null||F===void 0||F.call(t,R),N){const H=c.value;if(H!=null){if(R.deltaX===0&&(H.scrollTop===0&&R.deltaY<=0||H.scrollTop+H.offsetHeight>=H.scrollHeight&&R.deltaY>=0))return;R.preventDefault(),H.scrollTop+=R.deltaY/Rf(),H.scrollLeft+=R.deltaX/Rf(),E(),w=!0,Mu(()=>{w=!1})}}}function $(R){if(n||A(R.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(R.contentRect.height===d.value)return}else if(R.contentRect.height===d.value&&R.contentRect.width===l.value)return;d.value=R.contentRect.height,l.value=R.contentRect.width;const{onResize:F}=t;F!==void 0&&F(R)}function E(){const{value:R}=c;R!=null&&(m.value=R.scrollTop,a.value=R.scrollLeft)}function A(R){let F=R;for(;F!==null;){if(F.style.display==="none")return!0;F=F.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:i.computed(()=>{const{itemResizable:R}=t,F=Mr(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:Mr(o.value),height:R?"":F,minHeight:R?F:"",paddingTop:Mr(t.paddingTop),paddingBottom:Mr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${Mr(h.value.sum(p.value))})`})),viewportItems:g,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:$,handleListScroll:S,handleListWheel:v,handleItemResize:C}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(is,{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(Pf,{index:u,item:c}):void 0,f=l!=null?i.h(Pf,{index:u,item:c}):void 0,m=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?i.h(is,{key:d,onResize:p=>this.handleItemResize(d,p)},{default:()=>m}):(m.key=d,m)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Hn="v-hidden",o2=di("[v-hidden]",{display:"none!important"}),Ff=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(Hn)&&u.removeAttribute(Hn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const k of h)k.hasAttribute(Hn)&&k.removeAttribute(Hn);const f=l.offsetWidth,m=[],p=e.tail?d==null?void 0:d():null;let g=p?p.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let k=0;k<b-1;++k){if(k<0)continue;const x=h[k];if(y){x.hasAttribute(Hn)||x.setAttribute(Hn,"");continue}else x.hasAttribute(Hn)&&x.removeAttribute(Hn);const C=x.offsetWidth;if(g+=C,m[k]=C,g>f){const{updateCounter:N}=t;for(let w=k;w>=0;--w){const S=b-1-w;N!==void 0?N(S):u.textContent=`${S}`;const v=u.offsetWidth;if(g-=m[w],g+v<=f||w===0){y=!0,k=w-1,p&&(k===-1?(p.style.maxWidth=`${f-v}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(S);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Hn,""))}const s=Ni();return o2.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 Vf(t){return t instanceof HTMLElement}function Mf(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Vf(n)&&(If(n)||Mf(n)))return!0}return!1}function Af(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Vf(n)&&(If(n)||Af(n)))return!0}return!1}function If(t){if(!s2(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function s2(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 Dr=[];const a2=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=pk(),n=i.ref(null),r=i.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Dr[Dr.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(h(),Mt("keydown",document,c)):(ft("keydown",document,c),o&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{ft("keydown",document,c),o&&f()});function d(y){if(!s&&l()){const b=u();if(b===null||b.contains(Fr(y)))return;m("first")}}function u(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function h(){var y;if(!t.disabled){if(Dr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?m("first"):(y=df(b))===null||y===void 0||y.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function f(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),Dr=Dr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=df(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function m(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const k=u();if(k==null||k===_){s=!0,b.focus({preventScroll:!0}),s=!1;return}s=!0;const x=y==="first"?Mf(k):Af(k);s=!1,x||(s=!0,b.focus({preventScroll:!0}),s=!1)}}}function p(y){if(s)return;const b=u();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?m("last"):m("first"))}function g(y){s||(y.relatedTarget!==null&&y.relatedTarget===n.value?m("last"):m("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:p,handleEndFocus:g}},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 U5(t){return t}const Ia="n-internal-select-menu",Of="n-internal-select-menu-body",zf="n-drawer-body",Df="n-modal-body",Lf="n-popover-body",Hf="__disabled__";function Wn(t){const e=i.inject(Df,null),n=i.inject(zf,null),r=i.inject(Lf,null),o=i.inject(Of,null),s=i.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};i.onMounted(()=>{Mt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{ft("fullscreenchange",document,a)})}return rn(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?Hf: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")})}Wn.tdkey=Hf,Wn.propTo={type:[String,Object,Boolean],default:void 0};function l2(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 Wf(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&zr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&zr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&zr.unregisterHandler(n)}))}function jf(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const c2=/^(\d|\.)+$/,qf=/(\d|\.)+/;function Oa(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(c2.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=qf.exec(t);return o?t.replace(qf,String((Number(o[0])+n)*e)):t}return t}function Xf(t){const{left:e,right:n,top:r,bottom:o}=fn(t);return`${r} ${e} ${o} ${n}`}var Yf={};function d2(t){let e=".",n="__",r="--",o;if(t){let p=t.blockPrefix;p&&(e=p),p=t.elementPrefix,p&&(n=p),p=t.modifierPrefix,p&&(r=p)}const s={install(p){o=p.c;const g=p.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(p){let g,y;return{before(b){g=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=g,b.bem.els=y},$({context:b,props:_}){return p=typeof p=="string"?p:p({context:b,props:_}),b.bem.b=p,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(p){let g;return{before(y){g=y.bem.els},after(y){y.bem.els=g},$({context:y,props:b}){return p=typeof p=="string"?p:p({context:y,props:b}),y.bem.els=p.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(p){return{$({context:g,props:y}){p=typeof p=="string"?p:p({context:g,props:y});const b=p.split(",").map(x=>x.trim());function _(x){return b.map(C=>`&${(y==null?void 0:y.bPrefix)||e}${g.bem.b}${x!==void 0?`${n}${x}`:""}${r}${C}`).join(", ")}const k=g.bem.els;if(k!==null){if(Yf.NODE_ENV!=="production"&&k.length>=2)throw Error(`[css-render/plugin-bem]: m(${p}) is invalid, using modifier inside multiple elements is not allowed`);return _(k[0])}else return _()}}}function d(p){return{$({context:g,props:y}){p=typeof p=="string"?p:p({context:g,props:y});const b=g.bem.els;if(Yf.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${p}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${g.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${p})`}}}return Object.assign(s,{cB:((...p)=>o(a(p[0]),p[1],p[2])),cE:((...p)=>o(l(p[0]),p[1],p[2])),cM:((...p)=>o(c(p[0]),p[1],p[2])),cNotM:((...p)=>o(d(p[0]),p[1],p[2]))}),s}const u2=".n-",f2="__",h2="--",Uf=af(),Kf=d2({blockPrefix:u2,elementPrefix:f2,modifierPrefix:h2});Uf.use(Kf);const{c:fe,find:G5}=Uf,{cB:be,cE:ke,cM:Ee,cNotM:hn}=Kf,m2=(...t)=>fe(">",[be(...t)]);function tt(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let za;function p2(){return za===void 0&&(za=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),za}const g2=new WeakSet;function y2(t){g2.add(t)}function Gf(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const Zf=new Set;function ui(t,e){const n=`[naive/${t}]: ${e}`;Zf.has(n)||(Zf.add(n),console.error(n))}function Qf(t,e){console.error(`[naive/${t}]: ${e}`)}function Jf(t,e){throw new Error(`[naive/${t}]: ${e}`)}function St(t,...e){if(Array.isArray(t))t.forEach(n=>St(n,...e));else return t(...e)}function Da(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)){Da(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Da(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function b2(t,e="default",n=void 0){const r=t[e];if(!r)return Qf("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=Da(r(n));return o.length===1?o[0]:(Qf("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function _2(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function La(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 hr(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function os(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!os(e.children)):!0)?t:null}function Ha(t,e){return t&&os(t())||e()}function Ei(t,e){const n=t&&os(t());return e(n||null)}function eh(t){return!(t&&os(t()))}const Wa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Pi="n-config-provider",w2="n";function Fi(t={},e={defaultBordered:!0}){const n=i.inject(Pi,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,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(w2),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Vi(t,e,n,r){n||Jf("useThemeClass","cssVarsRef is not passed");const o=i.inject(Pi,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=i.ref(""),c=Ni();let d;const u=`__${t}`,h=()=>{let f=u;const m=e?e.value:void 0,p=s==null?void 0:s.value;p&&(f+=`-${p}`),m&&(f+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:y}=r;g&&(f+=`-${$a(JSON.stringify(g))}`),y&&(f+=`-${$a(JSON.stringify(y))}`),l.value=f,d=()=>{const b=n.value;let _="";for(const k in b)_+=`${k}: ${b[k]};`;fe(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const th="n-form-item";function x2(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const o=i.inject(th,null);i.provide(th,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 k2={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 ja(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Lr(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 Hr(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)?C2(l,h=>h.test(a)):v2(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 v2(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function C2(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function S2(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 B2={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"}},T2=(t,e,n)=>{let r;const o=B2[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},N2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},$2=(t,e,n,r)=>N2[t],R2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},E2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},P2={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"]},F2={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"]},V2={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"}},M2={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"}},A2={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:Lr({values:R2,defaultWidth:"wide"}),quarter:Lr({values:E2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Lr({values:P2,defaultWidth:"wide"}),day:Lr({values:F2,defaultWidth:"wide"}),dayPeriod:Lr({values:V2,defaultWidth:"wide",formattingValues:M2,defaultFormattingWidth:"wide"})},I2=/^(\d+)(th|st|nd|rd)?/i,O2=/\d+/i,z2={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},D2={any:[/^b/i,/^(a|c)/i]},L2={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},H2={any:[/1/i,/2/i,/3/i,/4/i]},W2={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},j2={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]},q2={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},X2={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]},Y2={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},U2={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}},K2={ordinalNumber:S2({matchPattern:I2,parsePattern:O2,valueCallback:t=>parseInt(t,10)}),era:Hr({matchPatterns:z2,defaultMatchWidth:"wide",parsePatterns:D2,defaultParseWidth:"any"}),quarter:Hr({matchPatterns:L2,defaultMatchWidth:"wide",parsePatterns:H2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Hr({matchPatterns:W2,defaultMatchWidth:"wide",parsePatterns:j2,defaultParseWidth:"any"}),day:Hr({matchPatterns:q2,defaultMatchWidth:"wide",parsePatterns:X2,defaultParseWidth:"any"}),dayPeriod:Hr({matchPatterns:Y2,defaultMatchWidth:"any",parsePatterns:U2,defaultParseWidth:"any"})},G2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},Z2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Q2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},J2={date:ja({formats:G2,defaultWidth:"full"}),time:ja({formats:Z2,defaultWidth:"full"}),dateTime:ja({formats:Q2,defaultWidth:"full"})},eC={name:"en-US",locale:{code:"en-US",formatDistance:T2,formatLong:J2,formatRelative:$2,localize:A2,match:K2,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function nh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(Pi,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:k2[t]});return{dateLocaleRef:i.computed(()=>{var s;return(s=n==null?void 0:n.value)!==null&&s!==void 0?s:eC}),localeRef:r}}const Wr="naive-ui-style";function jr(t,e,n){if(!e)return;const r=Ni(),o=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=i.inject(Pi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(Cv(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Wr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():i.onBeforeMount(a),o}const qr={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:tC,fontFamily:nC,lineHeight:iC}=qr,ih=fe("body",`
|
|
116
|
+
`)}function $a(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 yv(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(tf),e.els=[];else{const s=Ko(n,r);s&&o.includes(s)&&(tf(s),e.els=o.filter(a=>a!==s))}}function sf(t,e){t.push(e)}function bv(t,e,n,r,o,s,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=$a(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=Ko(n,l);if(u!==null&&!s)return u;const h=u??fv(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),sf(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),sf(e.els,h),h}function _v(t){return gv(this,this.instance,t)}function wv(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return bv(this.instance,this,e,r,o,s,a,l,n)}function xv(t={}){const{id:e,parent:n}=t;yv(this.instance,this,e,n)}const Zo=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:_v,mount:wv,unmount:xv}},kv=function(t,e,n,r){return Array.isArray(e)?Zo(t,{$:null},null,e):Array.isArray(n)?Zo(t,e,null,n):Array.isArray(r)?Zo(t,e,n,r):Zo(t,e,n,null)};function af(t={}){const e={c:((...n)=>kv(e,...n)),use:(n,...r)=>n.install(e,...r),find:Ko,context:{},config:t};return e}function vv(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return Ko(t)!==null}const{c:di}=af(),Ra="vueuc-style";function lf(t){return t&-t}class cf{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+=lf(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-=lf(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 df(t){return typeof t=="string"?document.querySelector(t):t()||null}const Cv=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:Gk(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?Sa("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},Sa("lazy-teleport",this.$slots)):null}}),Qo={top:"bottom",bottom:"top",left:"right",right:"left"},uf={start:"end",center:"center",end:"start"},Ea={top:"height",bottom:"height",left:"width",right:"width"},Sv={"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"},Bv={"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"},Tv={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},ff={top:!0,bottom:!1,left:!0,right:!1},hf={top:"end",bottom:"start",left:"end",right:"start"};function Nv(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=(m,p,g)=>{let y=0,b=0;const _=n[m]-e[p]-e[m];return _>0&&r&&(g?b=ff[p]?_:-_:y=ff[p]?_:-_),{left:y,top:b}},h=a==="left"||a==="right";if(c!=="center"){const m=Tv[t],p=Qo[m],g=Ea[m];if(n[g]>e[g]){if(e[m]+e[g]<n[g]){const y=(n[g]-e[g])/2;e[m]<y||e[p]<y?e[m]<e[p]?(c=uf[l],d=u(g,p,h)):d=u(g,m,h):c="center"}}else n[g]<e[g]&&e[p]<0&&e[m]>e[p]&&(c=uf[l])}else{const m=a==="bottom"||a==="top"?"left":"top",p=Qo[m],g=Ea[m],y=(n[g]-e[g])/2;(e[m]<y||e[p]<y)&&(e[m]>e[p]?(c=hf[m],d=u(g,m,h)):(c=hf[p],d=u(g,p,h)))}let f=a;return e[a]<n[Ea[a]]&&e[a]<e[Qo[a]]&&(f=Qo[a]),{placement:c!=="center"?`${f}-${c}`:f,left:d.left,top:d.top}}function $v(t,e){return e?Bv[t]:Sv[t]}function Rv(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 Ev=di([di(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),di(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[di("> *",{pointerEvents:"all"})])]),mf=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=rn(()=>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=Ni();Ev.mount({id:"vueuc/binder",head:!0,anchorMetaName:Ra,ssr:l}),i.onBeforeUnmount(()=>{a()}),Qk(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const f=r.value;if(f===null)return;const m=e.targetRef,{x:p,y:g,overlap:y}=t,b=p!==void 0&&g!==void 0?tv(p,g):Ta(m);f.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),f.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:k,placement:x,internalShift:C,flip:N}=t;f.setAttribute("v-placement",x),y?f.setAttribute("v-overlap",""):f.removeAttribute("v-overlap");const{style:w}=f;_==="target"?w.width=`${b.width}px`:_!==void 0?w.width=_:w.width="",k==="target"?w.minWidth=`${b.width}px`:k!==void 0?w.minWidth=k:w.minWidth="";const S=Ta(f),v=Ta(o.value),{left:$,top:E,placement:A}=Nv(x,b,S,C,N,y),R=$v(A,y),{left:F,top:H,transform:Q}=Rv(A,v,b,E,$,y);f.setAttribute("v-placement",A),f.style.setProperty("--v-offset-left",`${Math.round($)}px`),f.style.setProperty("--v-offset-top",`${Math.round(E)}px`),f.style.transform=`translateX(${F}) translateY(${H}) ${Q}`,f.style.setProperty("--v-transform-origin",R),f.style.transformOrigin=R};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=Uo(),h=rn(()=>{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(Cv,{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,[[Xu,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var $i=[],Pv=function(){return $i.some(function(t){return t.activeTargets.length>0})},Fv=function(){return $i.some(function(t){return t.skippedTargets.length>0})},pf="ResizeObserver loop completed with undelivered notifications.",Vv=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:pf}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=pf),window.dispatchEvent(t)},Ir;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Ir||(Ir={}));var Ri=function(t){return Object.freeze(t)},Mv=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,Ri(this)}return t})(),gf=(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,Ri(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})(),Pa=function(t){return t instanceof SVGElement&&"getBBox"in t},yf=function(t){if(Pa(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)},bf=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)},Av=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},Or=typeof window<"u"?window:{},Jo=new WeakMap,_f=/auto|scroll/,Iv=/^tb|vertical/,Ov=/msie|trident/i.test(Or.navigator&&Or.navigator.userAgent),Rn=function(t){return parseFloat(t||"0")},fr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Mv((n?e:t)||0,(n?t:e)||0)},wf=Ri({devicePixelContentBoxSize:fr(),borderBoxSize:fr(),contentBoxSize:fr(),contentRect:new gf(0,0,0,0)}),xf=function(t,e){if(e===void 0&&(e=!1),Jo.has(t)&&!e)return Jo.get(t);if(yf(t))return Jo.set(t,wf),wf;var n=getComputedStyle(t),r=Pa(t)&&t.ownerSVGElement&&t.getBBox(),o=!Ov&&n.boxSizing==="border-box",s=Iv.test(n.writingMode||""),a=!r&&_f.test(n.overflowY||""),l=!r&&_f.test(n.overflowX||""),c=r?0:Rn(n.paddingTop),d=r?0:Rn(n.paddingRight),u=r?0:Rn(n.paddingBottom),h=r?0:Rn(n.paddingLeft),f=r?0:Rn(n.borderTopWidth),m=r?0:Rn(n.borderRightWidth),p=r?0:Rn(n.borderBottomWidth),g=r?0:Rn(n.borderLeftWidth),y=h+d,b=c+u,_=g+m,k=f+p,x=l?t.offsetHeight-k-t.clientHeight:0,C=a?t.offsetWidth-_-t.clientWidth:0,N=o?y+_:0,w=o?b+k:0,S=r?r.width:Rn(n.width)-N-C,v=r?r.height:Rn(n.height)-w-x,$=S+y+C+_,E=v+b+x+k,A=Ri({devicePixelContentBoxSize:fr(Math.round(S*devicePixelRatio),Math.round(v*devicePixelRatio),s),borderBoxSize:fr($,E,s),contentBoxSize:fr(S,v,s),contentRect:new gf(h,c,S,v)});return Jo.set(t,A),A},kf=function(t,e,n){var r=xf(t,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Ir.DEVICE_PIXEL_CONTENT_BOX:return a;case Ir.BORDER_BOX:return o;default:return s}},zv=(function(){function t(e){var n=xf(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=Ri([n.borderBoxSize]),this.contentBoxSize=Ri([n.contentBoxSize]),this.devicePixelContentBoxSize=Ri([n.devicePixelContentBoxSize])}return t})(),vf=function(t){if(yf(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Dv=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 zv(d.target),h=vf(d.target);l.push(u),d.lastReportedSize=kf(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},Cf=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()&&(vf(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Lv=function(){var t=0;for(Cf(t);Pv();)t=Dv(),Cf(t);return Fv()&&Vv(),t>0},Fa,Sf=[],Hv=function(){return Sf.splice(0).forEach(function(t){return t()})},Wv=function(t){if(!Fa){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Hv()}).observe(n,r),Fa=function(){n.textContent="".concat(e?e--:e++)}}Sf.push(t),Fa()},jv=function(t){Wv(function(){requestAnimationFrame(t)})},es=0,qv=function(){return!!es},Xv=250,Yv={attributes:!0,characterData:!0,childList:!0,subtree:!0},Bf=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Tf=function(t){return t===void 0&&(t=0),Date.now()+t},Va=!1,Uv=(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=Xv),!Va){Va=!0;var r=Tf(e);jv(function(){var o=!1;try{o=Lv()}finally{if(Va=!1,e=r-Tf(),!qv())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,Yv)};document.body?n():Or.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Bf.forEach(function(n){return Or.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Bf.forEach(function(n){return Or.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),Ma=new Uv,Nf=function(t){!es&&t>0&&Ma.start(),es+=t,!es&&Ma.stop()},Kv=function(t){return!Pa(t)&&!Av(t)&&getComputedStyle(t).display==="inline"},Gv=(function(){function t(e,n){this.target=e,this.observedBox=n||Ir.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=kf(this.target,this.observedBox,!0);return Kv(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Zv=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),ts=new WeakMap,$f=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},ns=(function(){function t(){}return t.connect=function(e,n){var r=new Zv(e,n);ts.set(e,r)},t.observe=function(e,n,r){var o=ts.get(e),s=o.observationTargets.length===0;$f(o.observationTargets,n)<0&&(s&&$i.push(o),o.observationTargets.push(new Gv(n,r&&r.box)),Nf(1),Ma.schedule())},t.unobserve=function(e,n){var r=ts.get(e),o=$f(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&$i.splice($i.indexOf(r),1),r.observationTargets.splice(o,1),Nf(-1))},t.disconnect=function(e){var n=this,r=ts.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Qv=(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.");ns.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(!bf(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ns.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(!bf(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ns.unobserve(this,e)},t.prototype.disconnect=function(){ns.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Jv{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Qv)(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 zr=new Jv,is=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){Ju("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){Ju("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(zr.registerHandler(o.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&zr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let rs;function e2(){return typeof document>"u"?!1:(rs===void 0&&("matchMedia"in window?rs=window.matchMedia("(pointer:coarse)").matches:rs=!1),rs)}let Aa;function Rf(){return typeof document>"u"?1:(Aa===void 0&&(Aa="chrome"in window?window.devicePixelRatio:1),Aa)}const Ef="VVirtualListXScroll";function t2({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 cf(d.length,0);return d.forEach((h,f)=>{u.add(f,h.width)}),u}),a=rn(()=>{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=rn(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return i.provide(Ef,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Pf=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(Ef);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}}),n2=di(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[di("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[di("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),i2=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=Ni();n2.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Ra,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:R,defaultScrollKey:F}=t;R!=null?y({index:R}):F!=null&&y({key:F})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:m.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const o=rn(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let R=0;return t.columns.forEach(F=>{R+=F.width}),R}),s=i.computed(()=>{const R=new Map,{keyField:F}=t;return t.items.forEach((H,Q)=>{R.set(H[F],Q)}),R}),{scrollLeftRef:a,listWidthRef:l}=t2({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:R,itemSize:F,keyField:H}=t,Q=new cf(R.length,F);return R.forEach((Z,O)=>{const P=Z[H],V=u.get(P);V!==void 0&&Q.add(O,V)}),Q}),f=i.ref(0),m=i.ref(0),p=rn(()=>Math.max(h.value.getBound(m.value-Vr(t.paddingTop))-1,0)),g=i.computed(()=>{const{value:R}=d;if(R===void 0)return[];const{items:F,itemSize:H}=t,Q=p.value,Z=Math.min(Q+Math.ceil(R/H+1),F.length-1),O=[];for(let P=Q;P<=Z;++P)O.push(F[P]);return O}),y=(R,F)=>{if(typeof R=="number"){x(R,F,"auto");return}const{left:H,top:Q,index:Z,key:O,position:P,behavior:V,debounce:M=!0}=R;if(H!==void 0||Q!==void 0)x(H,Q,V);else if(Z!==void 0)k(Z,V,M);else if(O!==void 0){const L=s.value.get(O);L!==void 0&&k(L,V,M)}else P==="bottom"?x(0,Number.MAX_SAFE_INTEGER,V):P==="top"&&x(0,0,V)};let b,_=null;function k(R,F,H){const{value:Q}=h,Z=Q.sum(R)+Vr(t.paddingTop);if(!H)c.value.scrollTo({left:0,top:Z,behavior:F});else{b=R,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:O,offsetHeight:P}=c.value;if(Z>O){const V=Q.get(R);Z+V<=O+P||c.value.scrollTo({left:0,top:Z+V-P,behavior:F})}else c.value.scrollTo({left:0,top:Z,behavior:F})}}function x(R,F,H){c.value.scrollTo({left:R,top:F,behavior:H})}function C(R,F){var H,Q,Z;if(n||t.ignoreItemResize||A(F.target))return;const{value:O}=h,P=s.value.get(R),V=O.get(P),M=(Z=(Q=(H=F.borderBoxSize)===null||H===void 0?void 0:H[0])===null||Q===void 0?void 0:Q.blockSize)!==null&&Z!==void 0?Z:F.contentRect.height;if(M===V)return;M-t.itemSize===0?u.delete(R):u.set(R,M-t.itemSize);const Y=M-V;if(Y===0)return;O.add(P,Y);const U=c.value;if(U!=null){if(b===void 0){const G=O.sum(P);U.scrollTop>G&&U.scrollBy(0,Y)}else if(P<b)U.scrollBy(0,Y);else if(P===b){const G=O.sum(P);M+G>U.scrollTop+U.offsetHeight&&U.scrollBy(0,Y)}E()}f.value++}const N=!e2();let w=!1;function S(R){var F;(F=t.onScroll)===null||F===void 0||F.call(t,R),(!N||!w)&&E()}function v(R){var F;if((F=t.onWheel)===null||F===void 0||F.call(t,R),N){const H=c.value;if(H!=null){if(R.deltaX===0&&(H.scrollTop===0&&R.deltaY<=0||H.scrollTop+H.offsetHeight>=H.scrollHeight&&R.deltaY>=0))return;R.preventDefault(),H.scrollTop+=R.deltaY/Rf(),H.scrollLeft+=R.deltaX/Rf(),E(),w=!0,Mu(()=>{w=!1})}}}function $(R){if(n||A(R.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(R.contentRect.height===d.value)return}else if(R.contentRect.height===d.value&&R.contentRect.width===l.value)return;d.value=R.contentRect.height,l.value=R.contentRect.width;const{onResize:F}=t;F!==void 0&&F(R)}function E(){const{value:R}=c;R!=null&&(m.value=R.scrollTop,a.value=R.scrollLeft)}function A(R){let F=R;for(;F!==null;){if(F.style.display==="none")return!0;F=F.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:i.computed(()=>{const{itemResizable:R}=t,F=Mr(h.value.sum());return f.value,[t.itemsStyle,{boxSizing:"content-box",width:Mr(o.value),height:R?"":F,minHeight:R?F:"",paddingTop:Mr(t.paddingTop),paddingBottom:Mr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(f.value,{transform:`translateY(${Mr(h.value.sum(p.value))})`})),viewportItems:g,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:$,handleListScroll:S,handleListWheel:v,handleItemResize:C}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(is,{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(Pf,{index:u,item:c}):void 0,f=l!=null?i.h(Pf,{index:u,item:c}):void 0,m=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:f,index:u})[0];return t?i.h(is,{key:d,onResize:p=>this.handleItemResize(d,p)},{default:()=>m}):(m.key=d,m)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Hn="v-hidden",r2=di("[v-hidden]",{display:"none!important"}),Ff=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(Hn)&&u.removeAttribute(Hn);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const k of h)k.hasAttribute(Hn)&&k.removeAttribute(Hn);const f=l.offsetWidth,m=[],p=e.tail?d==null?void 0:d():null;let g=p?p.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let k=0;k<b-1;++k){if(k<0)continue;const x=h[k];if(y){x.hasAttribute(Hn)||x.setAttribute(Hn,"");continue}else x.hasAttribute(Hn)&&x.removeAttribute(Hn);const C=x.offsetWidth;if(g+=C,m[k]=C,g>f){const{updateCounter:N}=t;for(let w=k;w>=0;--w){const S=b-1-w;N!==void 0?N(S):u.textContent=`${S}`;const v=u.offsetWidth;if(g-=m[w],g+v<=f||w===0){y=!0,k=w-1,p&&(k===-1?(p.style.maxWidth=`${f-v}px`,p.style.boxSizing="border-box"):p.style.maxWidth="");const{onUpdateCount:$}=t;$&&$(S);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Hn,""))}const s=Ni();return r2.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 Vf(t){return t instanceof HTMLElement}function Mf(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(Vf(n)&&(If(n)||Mf(n)))return!0}return!1}function Af(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(Vf(n)&&(If(n)||Af(n)))return!0}return!1}function If(t){if(!o2(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function o2(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 Dr=[];const s2=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=mk(),n=i.ref(null),r=i.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Dr[Dr.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(h(),Mt("keydown",document,c)):(ft("keydown",document,c),o&&f())},{immediate:!0})}),i.onBeforeUnmount(()=>{ft("keydown",document,c),o&&f()});function d(y){if(!s&&l()){const b=u();if(b===null||b.contains(Fr(y)))return;m("first")}}function u(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function h(){var y;if(!t.disabled){if(Dr.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?m("first"):(y=df(b))===null||y===void 0||y.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function f(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),Dr=Dr.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=df(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function m(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const k=u();if(k==null||k===_){s=!0,b.focus({preventScroll:!0}),s=!1;return}s=!0;const x=y==="first"?Mf(k):Af(k);s=!1,x||(s=!0,b.focus({preventScroll:!0}),s=!1)}}}function p(y){if(s)return;const b=u();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?m("last"):m("first"))}function g(y){s||(y.relatedTarget!==null&&y.relatedTarget===n.value?m("last"):m("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:p,handleEndFocus:g}},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 Y5(t){return t}const Ia="n-internal-select-menu",Of="n-internal-select-menu-body",zf="n-drawer-body",Df="n-modal-body",Lf="n-popover-body",Hf="__disabled__";function Wn(t){const e=i.inject(Df,null),n=i.inject(zf,null),r=i.inject(Lf,null),o=i.inject(Of,null),s=i.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};i.onMounted(()=>{Mt("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{ft("fullscreenchange",document,a)})}return rn(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?Hf: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")})}Wn.tdkey=Hf,Wn.propTo={type:[String,Object,Boolean],default:void 0};function a2(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 Wf(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&zr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&zr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&zr.unregisterHandler(n)}))}function jf(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const l2=/^(\d|\.)+$/,qf=/(\d|\.)+/;function Oa(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(l2.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=qf.exec(t);return o?t.replace(qf,String((Number(o[0])+n)*e)):t}return t}function Xf(t){const{left:e,right:n,top:r,bottom:o}=fn(t);return`${r} ${e} ${o} ${n}`}var Yf={};function c2(t){let e=".",n="__",r="--",o;if(t){let p=t.blockPrefix;p&&(e=p),p=t.elementPrefix,p&&(n=p),p=t.modifierPrefix,p&&(r=p)}const s={install(p){o=p.c;const g=p.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(p){let g,y;return{before(b){g=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=g,b.bem.els=y},$({context:b,props:_}){return p=typeof p=="string"?p:p({context:b,props:_}),b.bem.b=p,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(p){let g;return{before(y){g=y.bem.els},after(y){y.bem.els=g},$({context:y,props:b}){return p=typeof p=="string"?p:p({context:y,props:b}),y.bem.els=p.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(p){return{$({context:g,props:y}){p=typeof p=="string"?p:p({context:g,props:y});const b=p.split(",").map(x=>x.trim());function _(x){return b.map(C=>`&${(y==null?void 0:y.bPrefix)||e}${g.bem.b}${x!==void 0?`${n}${x}`:""}${r}${C}`).join(", ")}const k=g.bem.els;if(k!==null){if(Yf.NODE_ENV!=="production"&&k.length>=2)throw Error(`[css-render/plugin-bem]: m(${p}) is invalid, using modifier inside multiple elements is not allowed`);return _(k[0])}else return _()}}}function d(p){return{$({context:g,props:y}){p=typeof p=="string"?p:p({context:g,props:y});const b=g.bem.els;if(Yf.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${p}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${g.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${p})`}}}return Object.assign(s,{cB:((...p)=>o(a(p[0]),p[1],p[2])),cE:((...p)=>o(l(p[0]),p[1],p[2])),cM:((...p)=>o(c(p[0]),p[1],p[2])),cNotM:((...p)=>o(d(p[0]),p[1],p[2]))}),s}const d2=".n-",u2="__",f2="--",Uf=af(),Kf=c2({blockPrefix:d2,elementPrefix:u2,modifierPrefix:f2});Uf.use(Kf);const{c:fe,find:K5}=Uf,{cB:be,cE:ke,cM:Ee,cNotM:hn}=Kf,h2=(...t)=>fe(">",[be(...t)]);function nt(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let za;function m2(){return za===void 0&&(za=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),za}const p2=new WeakSet;function g2(t){p2.add(t)}function Gf(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const Zf=new Set;function ui(t,e){const n=`[naive/${t}]: ${e}`;Zf.has(n)||(Zf.add(n),console.error(n))}function Qf(t,e){console.error(`[naive/${t}]: ${e}`)}function Jf(t,e){throw new Error(`[naive/${t}]: ${e}`)}function St(t,...e){if(Array.isArray(t))t.forEach(n=>St(n,...e));else return t(...e)}function Da(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)){Da(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Da(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function y2(t,e="default",n=void 0){const r=t[e];if(!r)return Qf("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=Da(r(n));return o.length===1?o[0]:(Qf("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function b2(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function La(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 hr(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function os(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!os(e.children)):!0)?t:null}function Ha(t,e){return t&&os(t())||e()}function Ei(t,e){const n=t&&os(t());return e(n||null)}function eh(t){return!(t&&os(t()))}const Wa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Pi="n-config-provider",_2="n";function Fi(t={},e={defaultBordered:!0}){const n=i.inject(Pi,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,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(_2),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Vi(t,e,n,r){n||Jf("useThemeClass","cssVarsRef is not passed");const o=i.inject(Pi,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=i.ref(""),c=Ni();let d;const u=`__${t}`,h=()=>{let f=u;const m=e?e.value:void 0,p=s==null?void 0:s.value;p&&(f+=`-${p}`),m&&(f+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:y}=r;g&&(f+=`-${$a(JSON.stringify(g))}`),y&&(f+=`-${$a(JSON.stringify(y))}`),l.value=f,d=()=>{const b=n.value;let _="";for(const k in b)_+=`${k}: ${b[k]};`;fe(`.${f}`,_).mount({id:f,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const th="n-form-item";function w2(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const o=i.inject(th,null);i.provide(th,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 x2={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 ja(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Lr(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 Hr(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)?v2(l,h=>h.test(a)):k2(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 k2(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function v2(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function C2(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 S2={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"}},B2=(t,e,n)=>{let r;const o=S2[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},T2={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},N2=(t,e,n,r)=>T2[t],$2={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},R2={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},E2={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"]},P2={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"]},F2={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"}},V2={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"}},M2={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:Lr({values:$2,defaultWidth:"wide"}),quarter:Lr({values:R2,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Lr({values:E2,defaultWidth:"wide"}),day:Lr({values:P2,defaultWidth:"wide"}),dayPeriod:Lr({values:F2,defaultWidth:"wide",formattingValues:V2,defaultFormattingWidth:"wide"})},A2=/^(\d+)(th|st|nd|rd)?/i,I2=/\d+/i,O2={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},z2={any:[/^b/i,/^(a|c)/i]},D2={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},L2={any:[/1/i,/2/i,/3/i,/4/i]},H2={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},W2={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]},j2={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},q2={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]},X2={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},Y2={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}},U2={ordinalNumber:C2({matchPattern:A2,parsePattern:I2,valueCallback:t=>parseInt(t,10)}),era:Hr({matchPatterns:O2,defaultMatchWidth:"wide",parsePatterns:z2,defaultParseWidth:"any"}),quarter:Hr({matchPatterns:D2,defaultMatchWidth:"wide",parsePatterns:L2,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Hr({matchPatterns:H2,defaultMatchWidth:"wide",parsePatterns:W2,defaultParseWidth:"any"}),day:Hr({matchPatterns:j2,defaultMatchWidth:"wide",parsePatterns:q2,defaultParseWidth:"any"}),dayPeriod:Hr({matchPatterns:X2,defaultMatchWidth:"any",parsePatterns:Y2,defaultParseWidth:"any"})},K2={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},G2={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Z2={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Q2={date:ja({formats:K2,defaultWidth:"full"}),time:ja({formats:G2,defaultWidth:"full"}),dateTime:ja({formats:Z2,defaultWidth:"full"})},J2={name:"en-US",locale:{code:"en-US",formatDistance:B2,formatLong:Q2,formatRelative:N2,localize:M2,match:U2,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function nh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(Pi,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:x2[t]});return{dateLocaleRef:i.computed(()=>{var s;return(s=n==null?void 0:n.value)!==null&&s!==void 0?s:J2}),localeRef:r}}const Wr="naive-ui-style";function jr(t,e,n){if(!e)return;const r=Ni(),o=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=i.inject(Pi,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(vv(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Wr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():i.onBeforeMount(a),o}const qr={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:eC,fontFamily:tC,lineHeight:nC}=qr,ih=fe("body",`
|
|
117
117
|
margin: 0;
|
|
118
|
-
font-size: ${
|
|
119
|
-
font-family: ${
|
|
120
|
-
line-height: ${
|
|
118
|
+
font-size: ${eC};
|
|
119
|
+
font-family: ${tC};
|
|
120
|
+
line-height: ${nC};
|
|
121
121
|
-webkit-text-size-adjust: 100%;
|
|
122
122
|
-webkit-tap-highlight-color: transparent;
|
|
123
123
|
`,[fe("input",`
|
|
124
124
|
font-family: inherit;
|
|
125
125
|
font-size: inherit;
|
|
126
|
-
`)]);var
|
|
126
|
+
`)]);var iC={};function ss(t,e,n){if(!e){iC.NODE_ENV!=="production"&&Jf("use-style","No style is specified.");return}const r=Ni(),o=i.inject(Pi,null),s=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Wr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||ih.mount({id:"n-global",head:!0,anchorMetaName:Wr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():i.onBeforeMount(s)}function Q5(t){return t}function Bt(t,e,n,r,o,s){const a=Ni(),l=i.inject(Pi,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:Wr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||ih.mount({id:"n-global",head:!0,anchorMetaName:Wr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:u,self:h,peers:f={}}={},themeOverrides:m={},builtinThemeOverrides:p={}}=o,{common:g,peers:y}=m,{common:b=void 0,[t]:{common:_=void 0,self:k=void 0,peers:x={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:C=void 0,[t]:N={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:w,peers:S={}}=N,v=D.merge({},u||_||b||r.common,C,w,g),$=D.merge((d=h||k||r.self)===null||d===void 0?void 0:d(v),p,N,m);return{common:v,self:$,peers:D.merge({},r.peers,x,f),peerOverrides:D.merge({},p.peers,S,y)}})}Bt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const rC=be("base-icon",`
|
|
127
127
|
height: 1em;
|
|
128
128
|
width: 1em;
|
|
129
129
|
line-height: 1em;
|
|
@@ -134,7 +134,7 @@ ${o}
|
|
|
134
134
|
`,[fe("svg",`
|
|
135
135
|
height: 1em;
|
|
136
136
|
width: 1em;
|
|
137
|
-
`)]),Xr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){ss("-base-icon",
|
|
137
|
+
`)]),Xr=i.defineComponent({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(t){ss("-base-icon",rC,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)}}),rh=i.defineComponent({name:"BaseIconSwitchTransition",setup(t,{slots:e}){const n=Uo();return()=>i.h(i.Transition,{name:"icon-switch-transition",appear:n.value},e)}});function oh(t,e){const n=i.defineComponent({render(){return e()}});return i.defineComponent({name:D.upperFirst(t),setup(){var r;const o=(r=i.inject(Pi,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 oC=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"})))}}),sC=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"}))}}),aC=oh("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"}))))),lC=oh("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"}))))),cC=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:dC}=qr;function qa({originalTransform:t="",left:e=0,top:n=0,transition:r=`all .3s ${dC} !important`}={}){return[fe("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${t} scale(0.75)`,left:e,top:n,opacity:0}),fe("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${t}`,left:e,top:n,opacity:1}),fe("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:e,top:n,transition:r})]}const uC=be("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
|
-
`,[qa({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),
|
|
161
|
+
`,[qa({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),fC=i.defineComponent({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(t){return ss("-base-clear",uC,i.toRef(t,"clsPrefix")),{handleMouseDown(e){e.preventDefault()}}},render(){const{clsPrefix:t}=this;return i.h("div",{class:`${t}-base-clear`},i.h(rh,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},Ha(this.$slots.icon,()=>[i.h(Xr,{clsPrefix:t},{default:()=>i.h(aC,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))}}))}}),hC=be("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
|
`),Ee("round",[fe("&::before",`
|
|
204
204
|
border-radius: 50%;
|
|
205
|
-
`)])]),
|
|
205
|
+
`)])]),mC=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 ss("-base-close",hC,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(Xr,{clsPrefix:e},{default:()=>i.h(lC,null)}))}}}),pC=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})}}),gC=fe([fe("@keyframes rotator",`
|
|
206
206
|
0% {
|
|
207
207
|
-webkit-transform: rotate(0deg);
|
|
208
208
|
transform: rotate(0deg);
|
|
@@ -229,7 +229,7 @@ ${o}
|
|
|
229
229
|
`,[ke("icon",`
|
|
230
230
|
height: 1em;
|
|
231
231
|
width: 1em;
|
|
232
|
-
`)])])]),Xa="1.6s",
|
|
232
|
+
`)])])]),Xa="1.6s",yC={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},sh=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}},yC),setup(t){ss("-base-loading",gC,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(rh,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:Xa,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:Xa,fill:"freeze",repeatCount:"indefinite"}),i.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:Xa,fill:"freeze",repeatCount:"indefinite"})))))):i.h("div",{key:"placeholder",class:`${t}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:ah}=qr;function bC({name:t="fade-in",enterDuration:e="0.2s",leaveDuration:n="0.2s",enterCubicBezier:r=ah,leaveCubicBezier:o=ah}={}){return[fe(`&.${t}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),fe(`&.${t}-transition-leave-active`,{transition:`all ${n} ${o}!important`}),fe(`&.${t}-transition-enter-from, &.${t}-transition-leave-to`,{opacity:0}),fe(`&.${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"},_C=Bi(ge.neutralBase),lh=Bi(ge.neutralInvertBase),wC=`rgba(${lh.slice(0,3).join(", ")}, `;function ch(t){return`${wC+String(t)})`}function Tt(t){const e=Array.from(lh);return e[3]=Number(t),fk(_C,e)}const Mi=Object.assign(Object.assign({name:"common"},qr),{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:Tt(ge.alpha4),placeholderColor:Tt(ge.alpha4),placeholderColorDisabled:Tt(ge.alpha5),iconColor:Tt(ge.alpha4),iconColorHover:Wo(Tt(ge.alpha4),{lightness:.75}),iconColorPressed:Wo(Tt(ge.alpha4),{lightness:.9}),iconColorDisabled:Tt(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:Tt(Number(ge.alphaClose)),closeIconColorHover:Tt(Number(ge.alphaClose)),closeIconColorPressed:Tt(Number(ge.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:Tt(ge.alpha4),clearColorHover:Wo(Tt(ge.alpha4),{lightness:.75}),clearColorPressed:Wo(Tt(ge.alpha4),{lightness:.9}),scrollbarColor:ch(ge.alphaScrollbar),scrollbarColorHover:ch(ge.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Tt(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:Tt(ge.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:Tt(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)"}),xC={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function kC(t){const{scrollbarColor:e,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:o,scrollbarBorderRadius:s}=t;return Object.assign(Object.assign({},xC),{height:r,width:o,borderRadius:s,color:e,colorHover:n})}const Ya={name:"Scrollbar",common:Mi,self:kC},vC=be("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
|
-
`,[_C(),fe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),SC=Object.assign(Object.assign({},Bt.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"}}),dh=i.defineComponent({name:"Scrollbar",props:SC,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=Fi(t),o=jr("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),m=i.ref(null),p=i.ref(null),g=i.ref(null),y=i.ref(0),b=i.ref(0),_=i.ref(!1),k=i.ref(!1);let x=!1,C=!1,N,w,S=0,v=0,$=0,E=0;const A=tv(),R=Bt("Scrollbar","-scrollbar",CC,Ya,t,e),F=i.computed(()=>{const{value:I}=f,{value:J}=u,{value:se}=p;return I===null||J===null||se===null?0:Math.min(I,se*I/J+Vr(R.value.self.width)*1.5)}),H=i.computed(()=>`${F.value}px`),Q=i.computed(()=>{const{value:I}=m,{value:J}=h,{value:se}=g;return I===null||J===null||se===null?0:se*I/J+Vr(R.value.self.height)*1.5}),Z=i.computed(()=>`${Q.value}px`),O=i.computed(()=>{const{value:I}=f,{value:J}=y,{value:se}=u,{value:he}=p;if(I===null||se===null||he===null)return 0;{const pe=se-I;return pe?J/pe*(he-F.value):0}}),P=i.computed(()=>`${O.value}px`),V=i.computed(()=>{const{value:I}=m,{value:J}=b,{value:se}=h,{value:he}=g;if(I===null||se===null||he===null)return 0;{const pe=se-I;return pe?J/pe*(he-Q.value):0}}),M=i.computed(()=>`${V.value}px`),L=i.computed(()=>{const{value:I}=f,{value:J}=u;return I!==null&&J!==null&&J>I}),Y=i.computed(()=>{const{value:I}=m,{value:J}=h;return I!==null&&J!==null&&J>I}),U=i.computed(()=>{const{trigger:I}=t;return I==="none"||_.value}),G=i.computed(()=>{const{trigger:I}=t;return I==="none"||k.value}),q=i.computed(()=>{const{container:I}=t;return I?I():a.value}),W=i.computed(()=>{const{content:I}=t;return I?I():l.value}),K=(I,J)=>{if(!t.scrollable)return;if(typeof I=="number"){_e(I,J??0,0,!1,"auto");return}const{left:se,top:he,index:pe,elSize:xe,position:Se,behavior:Te,el:Je,debounce:Vn=!0}=I;(se!==void 0||he!==void 0)&&_e(se??0,he??0,0,!1,Te),Je!==void 0?_e(0,Je.offsetTop,Je.offsetHeight,Vn,Te):pe!==void 0&&xe!==void 0?_e(0,pe*xe,xe,Vn,Te):Se==="bottom"?_e(0,Number.MAX_SAFE_INTEGER,0,!1,Te):Se==="top"&&_e(0,0,0,!1,Te)},ue=l2(()=>{t.container||K({top:y.value,left:b.value})}),ye=()=>{ue.isDeactivated||le()},ve=I=>{if(ue.isDeactivated)return;const{onResize:J}=t;J&&J(I),le()},ot=(I,J)=>{if(!t.scrollable)return;const{value:se}=q;se&&(typeof I=="object"?se.scrollBy(I):se.scrollBy(I,J||0))};function _e(I,J,se,he,pe){const{value:xe}=q;if(xe){if(he){const{scrollTop:Se,offsetHeight:Te}=xe;if(J>Se){J+se<=Se+Te||xe.scrollTo({left:I,top:J+se-Te,behavior:pe});return}}xe.scrollTo({left:I,top:J,behavior:pe})}}function we(){Rt(),Qn(),le()}function wt(){$e()}function $e(){Gt(),pn()}function Gt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{k.value=!1},t.duration)}function pn(){N!==void 0&&window.clearTimeout(N),N=window.setTimeout(()=>{_.value=!1},t.duration)}function Rt(){N!==void 0&&window.clearTimeout(N),_.value=!0}function Qn(){w!==void 0&&window.clearTimeout(w),k.value=!0}function gn(I){const{onScroll:J}=t;J&&J(I),sn()}function sn(){const{value:I}=q;I&&(y.value=I.scrollTop,b.value=I.scrollLeft*(o!=null&&o.value?-1:1))}function Ve(){const{value:I}=W;I&&(u.value=I.offsetHeight,h.value=I.offsetWidth);const{value:J}=q;J&&(f.value=J.offsetHeight,m.value=J.offsetWidth);const{value:se}=d,{value:he}=c;se&&(g.value=se.offsetWidth),he&&(p.value=he.offsetHeight)}function te(){const{value:I}=q;I&&(y.value=I.scrollTop,b.value=I.scrollLeft*(o!=null&&o.value?-1:1),f.value=I.offsetHeight,m.value=I.offsetWidth,u.value=I.scrollHeight,h.value=I.scrollWidth);const{value:J}=d,{value:se}=c;J&&(g.value=J.offsetWidth),se&&(p.value=se.offsetHeight)}function le(){t.scrollable&&(t.useUnifiedContainer?te():(Ve(),sn()))}function De(I){var J;return!(!((J=s.value)===null||J===void 0)&&J.contains(Fr(I)))}function hi(I){I.preventDefault(),I.stopPropagation(),C=!0,Mt("mousemove",window,at,!0),Mt("mouseup",window,Zt,!0),v=b.value,$=o!=null&&o.value?window.innerWidth-I.clientX:I.clientX}function at(I){if(!C)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:J}=m,{value:se}=h,{value:he}=Q;if(J===null||se===null)return;const xe=(o!=null&&o.value?window.innerWidth-I.clientX-$:I.clientX-$)*(se-J)/(J-he),Se=se-J;let Te=v+xe;Te=Math.min(Se,Te),Te=Math.max(Te,0);const{value:Je}=q;if(Je){Je.scrollLeft=Te*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:Vn}=t;Vn&&Vn(Te)}}function Zt(I){I.preventDefault(),I.stopPropagation(),ft("mousemove",window,at,!0),ft("mouseup",window,Zt,!0),C=!1,le(),De(I)&&$e()}function mr(I){I.preventDefault(),I.stopPropagation(),x=!0,Mt("mousemove",window,mi,!0),Mt("mouseup",window,zi,!0),S=y.value,E=I.clientY}function mi(I){if(!x)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:J}=f,{value:se}=u,{value:he}=F;if(J===null||se===null)return;const xe=(I.clientY-E)*(se-J)/(J-he),Se=se-J;let Te=S+xe;Te=Math.min(Se,Te),Te=Math.max(Te,0);const{value:Je}=q;Je&&(Je.scrollTop=Te)}function zi(I){I.preventDefault(),I.stopPropagation(),ft("mousemove",window,mi,!0),ft("mouseup",window,zi,!0),x=!1,le(),De(I)&&$e()}i.watchEffect(()=>{const{value:I}=Y,{value:J}=L,{value:se}=e,{value:he}=d,{value:pe}=c;he&&(I?he.classList.remove(`${se}-scrollbar-rail--disabled`):he.classList.add(`${se}-scrollbar-rail--disabled`)),pe&&(J?pe.classList.remove(`${se}-scrollbar-rail--disabled`):pe.classList.add(`${se}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||le()}),i.onBeforeUnmount(()=>{N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w),ft("mousemove",window,mi,!0),ft("mouseup",window,zi,!0)});const pr=i.computed(()=>{const{common:{cubicBezierEaseInOut:I},self:{color:J,colorHover:se,height:he,width:pe,borderRadius:xe,railInsetHorizontalTop:Se,railInsetHorizontalBottom:Te,railInsetVerticalRight:Je,railInsetVerticalLeft:Vn,railColor:el}}=R.value,{top:tl,right:nl,bottom:il,left:rl}=fn(Se),{top:ol,right:sl,bottom:al,left:ll}=fn(Te),{top:cl,right:dl,bottom:ul,left:fl}=fn(o!=null&&o.value?Xf(Je):Je),{top:hl,right:ml,bottom:pl,left:gl}=fn(o!=null&&o.value?Xf(Vn):Vn);return{"--n-scrollbar-bezier":I,"--n-scrollbar-color":J,"--n-scrollbar-color-hover":se,"--n-scrollbar-border-radius":xe,"--n-scrollbar-width":pe,"--n-scrollbar-height":he,"--n-scrollbar-rail-top-horizontal-top":tl,"--n-scrollbar-rail-right-horizontal-top":nl,"--n-scrollbar-rail-bottom-horizontal-top":il,"--n-scrollbar-rail-left-horizontal-top":rl,"--n-scrollbar-rail-top-horizontal-bottom":ol,"--n-scrollbar-rail-right-horizontal-bottom":sl,"--n-scrollbar-rail-bottom-horizontal-bottom":al,"--n-scrollbar-rail-left-horizontal-bottom":ll,"--n-scrollbar-rail-top-vertical-right":cl,"--n-scrollbar-rail-right-vertical-right":dl,"--n-scrollbar-rail-bottom-vertical-right":ul,"--n-scrollbar-rail-left-vertical-right":fl,"--n-scrollbar-rail-top-vertical-left":hl,"--n-scrollbar-rail-right-vertical-left":ml,"--n-scrollbar-rail-bottom-vertical-left":pl,"--n-scrollbar-rail-left-vertical-left":gl,"--n-scrollbar-rail-color":el}}),yn=n?Vi("scrollbar",void 0,pr,t):void 0;return Object.assign(Object.assign({},{scrollTo:K,scrollBy:ot,sync:le,syncUnifiedContainer:te,handleMouseEnterWrapper:we,handleMouseLeaveWrapper:wt}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:y,wrapperRef:s,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:L,needXBar:Y,yBarSizePx:H,xBarSizePx:Z,yBarTopPx:P,xBarLeftPx:M,isShowXBar:U,isShowYBar:G,isIos:A,handleScroll:gn,handleContentResize:ye,handleContainerResize:ve,handleYScrollMouseDown:mr,handleXScrollMouseDown:hi,cssVars:n?void 0:pr,themeClass:yn==null?void 0:yn.themeClass,onRender:yn==null?void 0:yn.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=(m,p)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[p||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?Wa: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 m,p;return(m=this.onRender)===null||m===void 0||m.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?(p=e.default)===null||p===void 0?void 0:p.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(is,{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?Wa: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(is,{onResize:this.handleContainerResize},{default:h});return s?i.h(i.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),BC=dh,TC={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function NC(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},TC),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const uh={name:"Empty",common:Mi,self:NC},$C=be("empty",`
|
|
297
|
+
`,[bC(),fe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),CC=Object.assign(Object.assign({},Bt.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"}}),dh=i.defineComponent({name:"Scrollbar",props:CC,inheritAttrs:!1,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedRtlRef:r}=Fi(t),o=jr("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),m=i.ref(null),p=i.ref(null),g=i.ref(null),y=i.ref(0),b=i.ref(0),_=i.ref(!1),k=i.ref(!1);let x=!1,C=!1,N,w,S=0,v=0,$=0,E=0;const A=ev(),R=Bt("Scrollbar","-scrollbar",vC,Ya,t,e),F=i.computed(()=>{const{value:I}=f,{value:J}=u,{value:se}=p;return I===null||J===null||se===null?0:Math.min(I,se*I/J+Vr(R.value.self.width)*1.5)}),H=i.computed(()=>`${F.value}px`),Q=i.computed(()=>{const{value:I}=m,{value:J}=h,{value:se}=g;return I===null||J===null||se===null?0:se*I/J+Vr(R.value.self.height)*1.5}),Z=i.computed(()=>`${Q.value}px`),O=i.computed(()=>{const{value:I}=f,{value:J}=y,{value:se}=u,{value:he}=p;if(I===null||se===null||he===null)return 0;{const pe=se-I;return pe?J/pe*(he-F.value):0}}),P=i.computed(()=>`${O.value}px`),V=i.computed(()=>{const{value:I}=m,{value:J}=b,{value:se}=h,{value:he}=g;if(I===null||se===null||he===null)return 0;{const pe=se-I;return pe?J/pe*(he-Q.value):0}}),M=i.computed(()=>`${V.value}px`),L=i.computed(()=>{const{value:I}=f,{value:J}=u;return I!==null&&J!==null&&J>I}),Y=i.computed(()=>{const{value:I}=m,{value:J}=h;return I!==null&&J!==null&&J>I}),U=i.computed(()=>{const{trigger:I}=t;return I==="none"||_.value}),G=i.computed(()=>{const{trigger:I}=t;return I==="none"||k.value}),q=i.computed(()=>{const{container:I}=t;return I?I():a.value}),W=i.computed(()=>{const{content:I}=t;return I?I():l.value}),K=(I,J)=>{if(!t.scrollable)return;if(typeof I=="number"){_e(I,J??0,0,!1,"auto");return}const{left:se,top:he,index:pe,elSize:xe,position:Se,behavior:Te,el:Je,debounce:Vn=!0}=I;(se!==void 0||he!==void 0)&&_e(se??0,he??0,0,!1,Te),Je!==void 0?_e(0,Je.offsetTop,Je.offsetHeight,Vn,Te):pe!==void 0&&xe!==void 0?_e(0,pe*xe,xe,Vn,Te):Se==="bottom"?_e(0,Number.MAX_SAFE_INTEGER,0,!1,Te):Se==="top"&&_e(0,0,0,!1,Te)},ue=a2(()=>{t.container||K({top:y.value,left:b.value})}),ye=()=>{ue.isDeactivated||le()},ve=I=>{if(ue.isDeactivated)return;const{onResize:J}=t;J&&J(I),le()},ot=(I,J)=>{if(!t.scrollable)return;const{value:se}=q;se&&(typeof I=="object"?se.scrollBy(I):se.scrollBy(I,J||0))};function _e(I,J,se,he,pe){const{value:xe}=q;if(xe){if(he){const{scrollTop:Se,offsetHeight:Te}=xe;if(J>Se){J+se<=Se+Te||xe.scrollTo({left:I,top:J+se-Te,behavior:pe});return}}xe.scrollTo({left:I,top:J,behavior:pe})}}function we(){Rt(),Qn(),le()}function wt(){$e()}function $e(){Gt(),pn()}function Gt(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{k.value=!1},t.duration)}function pn(){N!==void 0&&window.clearTimeout(N),N=window.setTimeout(()=>{_.value=!1},t.duration)}function Rt(){N!==void 0&&window.clearTimeout(N),_.value=!0}function Qn(){w!==void 0&&window.clearTimeout(w),k.value=!0}function gn(I){const{onScroll:J}=t;J&&J(I),sn()}function sn(){const{value:I}=q;I&&(y.value=I.scrollTop,b.value=I.scrollLeft*(o!=null&&o.value?-1:1))}function Ve(){const{value:I}=W;I&&(u.value=I.offsetHeight,h.value=I.offsetWidth);const{value:J}=q;J&&(f.value=J.offsetHeight,m.value=J.offsetWidth);const{value:se}=d,{value:he}=c;se&&(g.value=se.offsetWidth),he&&(p.value=he.offsetHeight)}function te(){const{value:I}=q;I&&(y.value=I.scrollTop,b.value=I.scrollLeft*(o!=null&&o.value?-1:1),f.value=I.offsetHeight,m.value=I.offsetWidth,u.value=I.scrollHeight,h.value=I.scrollWidth);const{value:J}=d,{value:se}=c;J&&(g.value=J.offsetWidth),se&&(p.value=se.offsetHeight)}function le(){t.scrollable&&(t.useUnifiedContainer?te():(Ve(),sn()))}function De(I){var J;return!(!((J=s.value)===null||J===void 0)&&J.contains(Fr(I)))}function hi(I){I.preventDefault(),I.stopPropagation(),C=!0,Mt("mousemove",window,at,!0),Mt("mouseup",window,Zt,!0),v=b.value,$=o!=null&&o.value?window.innerWidth-I.clientX:I.clientX}function at(I){if(!C)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:J}=m,{value:se}=h,{value:he}=Q;if(J===null||se===null)return;const xe=(o!=null&&o.value?window.innerWidth-I.clientX-$:I.clientX-$)*(se-J)/(J-he),Se=se-J;let Te=v+xe;Te=Math.min(Se,Te),Te=Math.max(Te,0);const{value:Je}=q;if(Je){Je.scrollLeft=Te*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:Vn}=t;Vn&&Vn(Te)}}function Zt(I){I.preventDefault(),I.stopPropagation(),ft("mousemove",window,at,!0),ft("mouseup",window,Zt,!0),C=!1,le(),De(I)&&$e()}function mr(I){I.preventDefault(),I.stopPropagation(),x=!0,Mt("mousemove",window,mi,!0),Mt("mouseup",window,zi,!0),S=y.value,E=I.clientY}function mi(I){if(!x)return;N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w);const{value:J}=f,{value:se}=u,{value:he}=F;if(J===null||se===null)return;const xe=(I.clientY-E)*(se-J)/(J-he),Se=se-J;let Te=S+xe;Te=Math.min(Se,Te),Te=Math.max(Te,0);const{value:Je}=q;Je&&(Je.scrollTop=Te)}function zi(I){I.preventDefault(),I.stopPropagation(),ft("mousemove",window,mi,!0),ft("mouseup",window,zi,!0),x=!1,le(),De(I)&&$e()}i.watchEffect(()=>{const{value:I}=Y,{value:J}=L,{value:se}=e,{value:he}=d,{value:pe}=c;he&&(I?he.classList.remove(`${se}-scrollbar-rail--disabled`):he.classList.add(`${se}-scrollbar-rail--disabled`)),pe&&(J?pe.classList.remove(`${se}-scrollbar-rail--disabled`):pe.classList.add(`${se}-scrollbar-rail--disabled`))}),i.onMounted(()=>{t.container||le()}),i.onBeforeUnmount(()=>{N!==void 0&&window.clearTimeout(N),w!==void 0&&window.clearTimeout(w),ft("mousemove",window,mi,!0),ft("mouseup",window,zi,!0)});const pr=i.computed(()=>{const{common:{cubicBezierEaseInOut:I},self:{color:J,colorHover:se,height:he,width:pe,borderRadius:xe,railInsetHorizontalTop:Se,railInsetHorizontalBottom:Te,railInsetVerticalRight:Je,railInsetVerticalLeft:Vn,railColor:el}}=R.value,{top:tl,right:nl,bottom:il,left:rl}=fn(Se),{top:ol,right:sl,bottom:al,left:ll}=fn(Te),{top:cl,right:dl,bottom:ul,left:fl}=fn(o!=null&&o.value?Xf(Je):Je),{top:hl,right:ml,bottom:pl,left:gl}=fn(o!=null&&o.value?Xf(Vn):Vn);return{"--n-scrollbar-bezier":I,"--n-scrollbar-color":J,"--n-scrollbar-color-hover":se,"--n-scrollbar-border-radius":xe,"--n-scrollbar-width":pe,"--n-scrollbar-height":he,"--n-scrollbar-rail-top-horizontal-top":tl,"--n-scrollbar-rail-right-horizontal-top":nl,"--n-scrollbar-rail-bottom-horizontal-top":il,"--n-scrollbar-rail-left-horizontal-top":rl,"--n-scrollbar-rail-top-horizontal-bottom":ol,"--n-scrollbar-rail-right-horizontal-bottom":sl,"--n-scrollbar-rail-bottom-horizontal-bottom":al,"--n-scrollbar-rail-left-horizontal-bottom":ll,"--n-scrollbar-rail-top-vertical-right":cl,"--n-scrollbar-rail-right-vertical-right":dl,"--n-scrollbar-rail-bottom-vertical-right":ul,"--n-scrollbar-rail-left-vertical-right":fl,"--n-scrollbar-rail-top-vertical-left":hl,"--n-scrollbar-rail-right-vertical-left":ml,"--n-scrollbar-rail-bottom-vertical-left":pl,"--n-scrollbar-rail-left-vertical-left":gl,"--n-scrollbar-rail-color":el}}),yn=n?Vi("scrollbar",void 0,pr,t):void 0;return Object.assign(Object.assign({},{scrollTo:K,scrollBy:ot,sync:le,syncUnifiedContainer:te,handleMouseEnterWrapper:we,handleMouseLeaveWrapper:wt}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:y,wrapperRef:s,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:L,needXBar:Y,yBarSizePx:H,xBarSizePx:Z,yBarTopPx:P,xBarLeftPx:M,isShowXBar:U,isShowYBar:G,isIos:A,handleScroll:gn,handleContentResize:ye,handleContainerResize:ve,handleYScrollMouseDown:mr,handleXScrollMouseDown:hi,cssVars:n?void 0:pr,themeClass:yn==null?void 0:yn.themeClass,onRender:yn==null?void 0:yn.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=(m,p)=>i.h("div",{ref:"yRailRef",class:[`${n}-scrollbar-rail`,`${n}-scrollbar-rail--vertical`,`${n}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[p||"",this.verticalRailStyle],"aria-hidden":!0},i.h(d?Wa: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 m,p;return(m=this.onRender)===null||m===void 0||m.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?(p=e.default)===null||p===void 0?void 0:p.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(is,{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?Wa: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(is,{onResize:this.handleContainerResize},{default:h});return s?i.h(i.Fragment,null,f,u(this.themeClass,this.cssVars)):f}}),SC=dh,BC={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function TC(t){const{textColorDisabled:e,iconColor:n,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=t;return Object.assign(Object.assign({},BC),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:n,extraTextColor:r})}const uh={name:"Empty",common:Mi,self:TC},NC=be("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
|
-
`)])
|
|
320
|
+
`)]),$C=Object.assign(Object.assign({},Bt.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),RC=i.defineComponent({name:"Empty",props:$C,slots:Object,setup(t){const{mergedClsPrefixRef:e,inlineThemeDisabled:n,mergedComponentPropsRef:r}=Fi(t),o=Bt("Empty","-empty",NC,uh,t,e),{localeRef:s}=nh("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(cC,null))}),c=i.computed(()=>{const{size:u}=t,{common:{cubicBezierEaseInOut:h},self:{[nt("iconSize",u)]:f,[nt("fontSize",u)]:m,textColor:p,iconColor:g,extraTextColor:y}}=o.value;return{"--n-icon-size":f,"--n-font-size":m,"--n-bezier":h,"--n-text-color":p,"--n-icon-color":g,"--n-extra-text-color":y}}),d=n?Vi("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(Xr,{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)}}),EC={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 PC(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:m,fontSizeLarge:p,fontSizeHuge:g,heightTiny:y,heightSmall:b,heightMedium:_,heightLarge:k,heightHuge:x}=t;return Object.assign(Object.assign({},EC),{optionFontSizeTiny:h,optionFontSizeSmall:f,optionFontSizeMedium:m,optionFontSizeLarge:p,optionFontSizeHuge:g,optionHeightTiny:y,optionHeightSmall:b,optionHeightMedium:_,optionHeightLarge:k,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:Mi,peers:{Scrollbar:Ya,Empty:uh},self:PC},hh=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(Ia);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):hr(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 FC(t,e){return i.h(i.Transition,{name:"fade-in-scale-up-transition"},{default:()=>t?i.h(Xr,{clsPrefix:e,class:`${e}-base-select-option__check`},{default:()=>i.h(oC)}):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(Ia),m=rn(()=>{const{value:b}=n;return b?t.tmNode.key===b.key:!1});function p(b){const{tmNode:_}=t;_.disabled||h(b,_)}function g(b){const{tmNode:_}=t;_.disabled||f(b,_)}function y(b){const{tmNode:_}=t,{value:k}=m;_.disabled||k||f(b,_)}return{multiple:r,isGrouped:rn(()=>{const{tmNode:b}=t,{parent:_}=b;return _&&_.rawNode.type==="group"}),showCheckmark:d,nodeProps:u,isPending:m,isSelected:rn(()=>{const{value:b}=e,{value:_}=r;if(b===null)return!1;const k=t.tmNode.rawNode[c.value];if(_){const{value:x}=o;return x.has(k)}else return b===k}),labelField:l,renderLabel:s,renderOption:a,handleMouseMove:y,handleMouseEnter:g,handleClick:p}},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=FC(n,t),m=c?[c(e,n),s&&f]:[hr(e[this.labelField],e,n),s&&f],p=a==null?void 0:a(e),g=i.h("div",Object.assign({},p,{class:[`${t}-base-select-option`,e.class,p==null?void 0:p.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:[(p==null?void 0:p.style)||"",e.style||""],onClick:La([d,p==null?void 0:p.onClick]),onMouseenter:La([u,p==null?void 0:p.onMouseenter]),onMousemove:La([h,p==null?void 0:p.onMousemove])}),i.h("div",{class:`${t}-base-select-option__content`},m));return e.render?e.render({node:g,option:e,selected:n}):l?l({node:g,option:e,selected:n}):g}}),{cubicBezierEaseIn:ph,cubicBezierEaseOut:gh}=qr;function yh({transformOrigin:t="inherit",duration:e=".2s",enterScale:n=".9",originalTransform:r="",originalTransition:o=""}={}){return[fe("&.fade-in-scale-up-transition-leave-active",{transformOrigin:t,transition:`opacity ${e} ${ph}, transform ${e} ${ph} ${o&&`,${o}`}`}),fe("&.fade-in-scale-up-transition-enter-active",{transformOrigin:t,transition:`opacity ${e} ${gh}, transform ${e} ${gh} ${o&&`,${o}`}`}),fe("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${r} scale(${n})`}),fe("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${r} scale(1)`})]}const VC=be("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
|
-
`,[yh({enterScale:"0.5"})])])]),
|
|
427
|
+
`,[yh({enterScale:"0.5"})])])]),MC=i.defineComponent({name:"InternalSelectMenu",props:Object.assign(Object.assign({},Bt.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}=Fi(t),r=jr("InternalSelectMenu",n,e),o=Bt("InternalSelectMenu","-internal-select-menu",VC,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(()=>Tk(c.value)),u=i.ref(null);function h(){const{treeMate:L}=t;let Y=null;const{value:U}=t;U===null?Y=L.getFirstAvailableNode():(t.multiple?Y=L.getNode((U||[])[(U||[]).length-1]):Y=L.getNode(U),(!Y||Y.disabled)&&(Y=L.getFirstAvailableNode())),F(Y||null)}function f(){const{value:L}=u;L&&!t.treeMate.getNode(L.key)&&(u.value=null)}let m;i.watch(()=>t.show,L=>{L?m=i.watch(()=>t.treeMate,()=>{t.resetMenuOnOptionsChange?(t.autoPending?h():f(),i.nextTick(H)):f()},{immediate:!0}):m==null||m()},{immediate:!0}),i.onBeforeUnmount(()=>{m==null||m()});const p=i.computed(()=>Vr(o.value.self[nt("optionHeight",t.size)])),g=i.computed(()=>fn(o.value.self[nt("padding",t.size)])),y=i.computed(()=>t.multiple&&Array.isArray(t.value)?new Set(t.value):new Set),b=i.computed(()=>{const L=c.value;return L&&L.length===0});function _(L){const{onToggle:Y}=t;Y&&Y(L)}function k(L){const{onScroll:Y}=t;Y&&Y(L)}function x(L){var Y;(Y=l.value)===null||Y===void 0||Y.sync(),k(L)}function C(){var L;(L=l.value)===null||L===void 0||L.sync()}function N(){const{value:L}=u;return L||null}function w(L,Y){Y.disabled||F(Y,!1)}function S(L,Y){Y.disabled||_(Y)}function v(L){var Y;Pr(L,"action")||(Y=t.onKeyup)===null||Y===void 0||Y.call(t,L)}function $(L){var Y;Pr(L,"action")||(Y=t.onKeydown)===null||Y===void 0||Y.call(t,L)}function E(L){var Y;(Y=t.onMousedown)===null||Y===void 0||Y.call(t,L),!t.focusable&&L.preventDefault()}function A(){const{value:L}=u;L&&F(L.getNext({loop:!0}),!0)}function R(){const{value:L}=u;L&&F(L.getPrev({loop:!0}),!0)}function F(L,Y=!1){u.value=L,Y&&H()}function H(){var L,Y;const U=u.value;if(!U)return;const G=d.value(U.key);G!==null&&(t.virtualScroll?(L=a.value)===null||L===void 0||L.scrollTo({index:G}):(Y=l.value)===null||Y===void 0||Y.scrollTo({index:G,elSize:p.value}))}function Q(L){var Y,U;!((Y=s.value)===null||Y===void 0)&&Y.contains(L.target)&&((U=t.onFocus)===null||U===void 0||U.call(t,L))}function Z(L){var Y,U;!((Y=s.value)===null||Y===void 0)&&Y.contains(L.relatedTarget)||(U=t.onBlur)===null||U===void 0||U.call(t,L)}i.provide(Ia,{handleOptionMouseEnter:w,handleOptionClick:S,valueSetRef:y,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(Of,s),i.onMounted(()=>{const{value:L}=l;L&&L.sync()});const O=i.computed(()=>{const{size:L}=t,{common:{cubicBezierEaseInOut:Y},self:{height:U,borderRadius:G,color:q,groupHeaderTextColor:W,actionDividerColor:K,optionTextColorPressed:ue,optionTextColor:ye,optionTextColorDisabled:ve,optionTextColorActive:ot,optionOpacityDisabled:_e,optionCheckColor:we,actionTextColor:wt,optionColorPending:$e,optionColorActive:Gt,loadingColor:pn,loadingSize:Rt,optionColorActivePending:Qn,[nt("optionFontSize",L)]:gn,[nt("optionHeight",L)]:sn,[nt("optionPadding",L)]:Ve}}=o.value;return{"--n-height":U,"--n-action-divider-color":K,"--n-action-text-color":wt,"--n-bezier":Y,"--n-border-radius":G,"--n-color":q,"--n-option-font-size":gn,"--n-group-header-text-color":W,"--n-option-check-color":we,"--n-option-color-pending":$e,"--n-option-color-active":Gt,"--n-option-color-active-pending":Qn,"--n-option-height":sn,"--n-option-opacity-disabled":_e,"--n-option-text-color":ye,"--n-option-text-color-active":ot,"--n-option-text-color-disabled":ve,"--n-option-text-color-pressed":ue,"--n-option-padding":Ve,"--n-option-padding-left":fn(Ve,"left"),"--n-option-padding-right":fn(Ve,"right"),"--n-loading-color":pn,"--n-loading-size":Rt}}),{inlineThemeDisabled:P}=t,V=P?Vi("internal-select-menu",i.computed(()=>t.size[0]),O,t):void 0,M={selfRef:s,next:A,prev:R,getPendingTmNode:N};return Wf(s,t.onResize),Object.assign({mergedTheme:o,mergedClsPrefix:e,rtlEnabled:r,virtualListRef:a,scrollbarRef:l,itemSize:p,padding:g,flattenedNodes:c,empty:b,virtualListContainer(){const{value:L}=a;return L==null?void 0:L.listElRef},virtualListContent(){const{value:L}=a;return L==null?void 0:L.itemsElRef},doScroll:k,handleFocusin:Q,handleFocusout:Z,handleKeyUp:v,handleKeyDown:$,handleMouseDown:E,handleVirtualListResize:C,handleVirtualListScroll:x,cssVars:P?void 0:O,themeClass:V==null?void 0:V.themeClass,onRender:V==null?void 0:V.onRender},M)},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},Ei(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(sh,{clsPrefix:n,strokeWidth:20})):this.empty?i.h("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Ha(t.empty,()=>[i.h(RC,{theme:r.peers.Empty,themeOverrides:r.peerOverrides.Empty,size:this.size})])):i.h(dh,{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(i2,{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(hh,{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(hh,{key:a.key,clsPrefix:n,tmNode:a}):i.h(mh,{clsPrefix:n,key:a.key,tmNode:a})))}),Ei(t.action,a=>a&&[i.h("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},a),i.h(pC,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),AC={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function IC(t){const{boxShadow2:e,popoverColor:n,textColor2:r,borderRadius:o,fontSize:s,dividerColor:a}=t;return Object.assign(Object.assign({},AC),{fontSize:s,borderRadius:o,color:n,dividerColor:a,textColor:r,boxShadow:e})}const bh={name:"Popover",common:Mi,peers:{Scrollbar:Ya},self:IC},Ua={top:"bottom",bottom:"top",left:"right",right:"left"},ht="var(--n-arrow-height) * 1.414",OC=fe([be("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-${Ua[n]}: var(--n-space-arrow);
|
|
533
533
|
`),Ee("overlap",`
|
|
534
534
|
margin: 0;
|
|
535
|
-
`),
|
|
535
|
+
`),h2("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
|
${Ua[n]}: auto;
|
|
542
542
|
${r}
|
|
543
|
-
`,[be("popover-arrow",e)])])])}const _h=Object.assign(Object.assign({},Bt.props),{to:Wn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function DC({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 LC=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:_h,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:s,mergedRtlRef:a}=Fi(t),l=Bt("Popover","-popover",zC,bh,t,o),c=jr("Popover",a,o),d=i.ref(null),u=i.inject("NPopover"),h=i.ref(null),f=i.ref(t.show),m=i.ref(!1);i.watchEffect(()=>{const{show:v}=t;v&&!p2()&&!t.internalDeactivateImmediately&&(m.value=!0)});const p=i.computed(()=>{const{trigger:v,onClickoutside:$}=t,E=[],{positionManuallyRef:{value:A}}=u;return A||(v==="click"&&!$&&E.push([Yo,N,void 0,{capture:!0}]),v==="hover"&&E.push([Uk,C])),$&&E.push([Yo,N,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&m.value)&&E.push([i.vShow,t.show]),E}),g=i.computed(()=>{const{common:{cubicBezierEaseInOut:v,cubicBezierEaseIn:$,cubicBezierEaseOut:E},self:{space:A,spaceArrow:R,padding:F,fontSize:H,textColor:Q,dividerColor:Z,color:O,boxShadow:P,borderRadius:V,arrowHeight:M,arrowOffset:L,arrowOffsetVertical:Y}}=l.value;return{"--n-box-shadow":P,"--n-bezier":v,"--n-bezier-ease-in":$,"--n-bezier-ease-out":E,"--n-font-size":H,"--n-text-color":Q,"--n-color":O,"--n-divider-color":Z,"--n-border-radius":V,"--n-arrow-height":M,"--n-arrow-offset":L,"--n-arrow-offset-vertical":Y,"--n-padding":F,"--n-space":A,"--n-space-arrow":R}}),y=i.computed(()=>{const v=t.width==="trigger"?void 0:Oa(t.width),$=[];v&&$.push({width:v});const{maxWidth:E,minWidth:A}=t;return E&&$.push({maxWidth:Oa(E)}),A&&$.push({maxWidth:Oa(A)}),s||$.push(g.value),$}),b=s?Vi("popover",void 0,g,t):void 0;u.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{u.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),v=>{t.animated||(v?f.value=!0:f.value=!1)});function _(){var v;(v=d.value)===null||v===void 0||v.syncPosition()}function k(v){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(v)}function x(v){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(v)}function C(v){t.trigger==="hover"&&!w().contains(Fr(v))&&u.handleMouseMoveOutside(v)}function N(v){(t.trigger==="click"&&!w().contains(Fr(v))||t.onClickoutside)&&u.handleClickOutside(v)}function w(){return u.getTriggerElement()}i.provide(Lf,h),i.provide(zf,null),i.provide(Df,null);function S(){if(b==null||b.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&m.value))return null;let $;const E=u.internalRenderBodyRef.value,{value:A}=o;if(E)$=E([`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,b==null?void 0:b.themeClass.value,t.overlap&&`${A}-popover-shared--overlap`,t.showArrow&&`${A}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],h,y.value,k,x);else{const{value:R}=u.extraClassRef,{internalTrapFocus:F}=t,H=!eh(e.header)||!eh(e.footer),Q=()=>{var Z,O;const P=H?i.h(i.Fragment,null,Ei(e.header,L=>L?i.h("div",{class:[`${A}-popover__header`,t.headerClass],style:t.headerStyle},L):null),Ei(e.default,L=>L?i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e):null),Ei(e.footer,L=>L?i.h("div",{class:[`${A}-popover__footer`,t.footerClass],style:t.footerStyle},L):null)):t.scrollable?(Z=e.default)===null||Z===void 0?void 0:Z.call(e):i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e),V=t.scrollable?i.h(BC,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:H?void 0:`${A}-popover__content ${(O=t.contentClass)!==null&&O!==void 0?O:""}`,contentStyle:H?void 0:t.contentStyle},{default:()=>P}):P,M=t.showArrow?DC({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:A}):null;return[V,M]};$=i.h("div",i.mergeProps({class:[`${A}-popover`,`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,b==null?void 0:b.themeClass.value,R.map(Z=>`${A}-${Z}`),{[`${A}-popover--scrollable`]:t.scrollable,[`${A}-popover--show-header-or-footer`]:H,[`${A}-popover--raw`]:t.raw,[`${A}-popover-shared--overlap`]:t.overlap,[`${A}-popover-shared--show-arrow`]:t.showArrow,[`${A}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:y.value,onKeydown:u.handleKeydown,onMouseenter:k,onMouseleave:x},n),F?i.h(a2,{active:t.show,autoFocus:!0},{default:Q}):Q())}return i.withDirectives($,p.value)}return{displayed:m,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:Wn(t),followerEnabled:f,renderContentNode:S}},render(){return i.h(mf,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Wn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var HC={};const WC=Object.keys(_h),jC={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function qC(t,e,n){jC[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 XC={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Wn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},YC=Object.assign(Object.assign(Object.assign({},Bt.props),XC),{internalOnAfterLeave:Function,internalRenderBody:Function}),UC=i.defineComponent({name:"Popover",inheritAttrs:!1,props:YC,slots:Object,__popover__:!0,setup(t){HC.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&ui("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&ui("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&ui("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&ui("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&ui("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=Uo(),n=i.ref(null),r=i.computed(()=>t.show),o=i.ref(t.defaultShow),s=Ca(r,o),a=rn(()=>t.disabled?!1:s.value),l=()=>{if(t.disabled)return!0;const{getDisabled:H}=t;return!!(H!=null&&H())},c=()=>l()?!1:s.value,d=Yu(t,["arrow","showArrow"]),u=i.computed(()=>t.overlap?!1:d.value);let h=null;const f=i.ref(null),m=i.ref(null),p=rn(()=>t.x!==void 0&&t.y!==void 0);function g(H){const{"onUpdate:show":Q,onUpdateShow:Z,onShow:O,onHide:P}=t;o.value=H,Q&&St(Q,H),Z&&St(Z,H),H&&O&&St(O,!0),H&&P&&St(P,!1)}function y(){h&&h.syncPosition()}function b(){const{value:H}=f;H&&(window.clearTimeout(H),f.value=null)}function _(){const{value:H}=m;H&&(window.clearTimeout(H),m.value=null)}function k(){const H=l();if(t.trigger==="focus"&&!H){if(c())return;g(!0)}}function x(){const H=l();if(t.trigger==="focus"&&!H){if(!c())return;g(!1)}}function C(){const H=l();if(t.trigger==="hover"&&!H){if(_(),f.value!==null||c())return;const Q=()=>{g(!0),f.value=null},{delay:Z}=t;Z===0?Q():f.value=window.setTimeout(Q,Z)}}function N(){const H=l();if(t.trigger==="hover"&&!H){if(b(),m.value!==null||!c())return;const Q=()=>{g(!1),m.value=null},{duration:Z}=t;Z===0?Q():m.value=window.setTimeout(Q,Z)}}function w(){N()}function S(H){var Q;c()&&(t.trigger==="click"&&(b(),_(),g(!1)),(Q=t.onClickoutside)===null||Q===void 0||Q.call(t,H))}function v(){if(t.trigger==="click"&&!l()){b(),_();const H=!c();g(H)}}function $(H){t.internalTrapFocus&&H.key==="Escape"&&(b(),_(),g(!1))}function E(H){o.value=H}function A(){var H;return(H=n.value)===null||H===void 0?void 0:H.targetRef}function R(H){h=H}return i.provide("NPopover",{getTriggerElement:A,handleKeydown:$,handleMouseEnter:C,handleMouseLeave:N,handleClickOutside:S,handleMouseMoveOutside:w,setBodyInstance:R,positionManuallyRef:p,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{s.value&&l()&&g(!1)}),{binderInstRef:n,positionManually:p,mergedShowConsideringDisabledProp:a,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:c,setShow:E,handleClick:v,handleMouseEnter:C,handleMouseLeave:N,handleFocus:k,handleBlur:x,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,o=!1;if(!e&&(r=b2(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)})}};qC(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(Zu,{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}}),[[Xu,{enabled:s,zIndex:this.zIndex}]]):null,e?null:i.h(Qu,null,{default:()=>r}),i.h(LC,_2(this.$props,WC,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)}})]}})}}),KC={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 GC(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:m,closeIconColorHover:p,closeIconColorPressed:g,borderRadiusSmall:y,fontSizeMini:b,fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:x,heightMini:C,heightTiny:N,heightSmall:w,heightMedium:S,closeColorHover:v,closeColorPressed:$,buttonColor2Hover:E,buttonColor2Pressed:A,fontWeightStrong:R}=t;return Object.assign(Object.assign({},KC),{closeBorderRadius:y,heightTiny:C,heightSmall:N,heightMedium:w,heightLarge:S,borderRadius:y,opacityDisabled:h,fontSizeTiny:b,fontSizeSmall:_,fontSizeMedium:k,fontSizeLarge:x,fontWeightStrong:R,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:E,colorPressedCheckable:A,colorChecked:o,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,closeColorHover:v,closeColorPressed:$,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 ZC={common:Mi,self:GC},QC={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},JC=be("tag",`
|
|
543
|
+
`,[be("popover-arrow",e)])])])}const _h=Object.assign(Object.assign({},Bt.props),{to:Wn.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function zC({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 DC=i.defineComponent({name:"PopoverBody",inheritAttrs:!1,props:_h,setup(t,{slots:e,attrs:n}){const{namespaceRef:r,mergedClsPrefixRef:o,inlineThemeDisabled:s,mergedRtlRef:a}=Fi(t),l=Bt("Popover","-popover",OC,bh,t,o),c=jr("Popover",a,o),d=i.ref(null),u=i.inject("NPopover"),h=i.ref(null),f=i.ref(t.show),m=i.ref(!1);i.watchEffect(()=>{const{show:v}=t;v&&!m2()&&!t.internalDeactivateImmediately&&(m.value=!0)});const p=i.computed(()=>{const{trigger:v,onClickoutside:$}=t,E=[],{positionManuallyRef:{value:A}}=u;return A||(v==="click"&&!$&&E.push([Yo,N,void 0,{capture:!0}]),v==="hover"&&E.push([Yk,C])),$&&E.push([Yo,N,void 0,{capture:!0}]),(t.displayDirective==="show"||t.animated&&m.value)&&E.push([i.vShow,t.show]),E}),g=i.computed(()=>{const{common:{cubicBezierEaseInOut:v,cubicBezierEaseIn:$,cubicBezierEaseOut:E},self:{space:A,spaceArrow:R,padding:F,fontSize:H,textColor:Q,dividerColor:Z,color:O,boxShadow:P,borderRadius:V,arrowHeight:M,arrowOffset:L,arrowOffsetVertical:Y}}=l.value;return{"--n-box-shadow":P,"--n-bezier":v,"--n-bezier-ease-in":$,"--n-bezier-ease-out":E,"--n-font-size":H,"--n-text-color":Q,"--n-color":O,"--n-divider-color":Z,"--n-border-radius":V,"--n-arrow-height":M,"--n-arrow-offset":L,"--n-arrow-offset-vertical":Y,"--n-padding":F,"--n-space":A,"--n-space-arrow":R}}),y=i.computed(()=>{const v=t.width==="trigger"?void 0:Oa(t.width),$=[];v&&$.push({width:v});const{maxWidth:E,minWidth:A}=t;return E&&$.push({maxWidth:Oa(E)}),A&&$.push({maxWidth:Oa(A)}),s||$.push(g.value),$}),b=s?Vi("popover",void 0,g,t):void 0;u.setBodyInstance({syncPosition:_}),i.onBeforeUnmount(()=>{u.setBodyInstance(null)}),i.watch(i.toRef(t,"show"),v=>{t.animated||(v?f.value=!0:f.value=!1)});function _(){var v;(v=d.value)===null||v===void 0||v.syncPosition()}function k(v){t.trigger==="hover"&&t.keepAliveOnHover&&t.show&&u.handleMouseEnter(v)}function x(v){t.trigger==="hover"&&t.keepAliveOnHover&&u.handleMouseLeave(v)}function C(v){t.trigger==="hover"&&!w().contains(Fr(v))&&u.handleMouseMoveOutside(v)}function N(v){(t.trigger==="click"&&!w().contains(Fr(v))||t.onClickoutside)&&u.handleClickOutside(v)}function w(){return u.getTriggerElement()}i.provide(Lf,h),i.provide(zf,null),i.provide(Df,null);function S(){if(b==null||b.onRender(),!(t.displayDirective==="show"||t.show||t.animated&&m.value))return null;let $;const E=u.internalRenderBodyRef.value,{value:A}=o;if(E)$=E([`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,b==null?void 0:b.themeClass.value,t.overlap&&`${A}-popover-shared--overlap`,t.showArrow&&`${A}-popover-shared--show-arrow`,t.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],h,y.value,k,x);else{const{value:R}=u.extraClassRef,{internalTrapFocus:F}=t,H=!eh(e.header)||!eh(e.footer),Q=()=>{var Z,O;const P=H?i.h(i.Fragment,null,Ei(e.header,L=>L?i.h("div",{class:[`${A}-popover__header`,t.headerClass],style:t.headerStyle},L):null),Ei(e.default,L=>L?i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e):null),Ei(e.footer,L=>L?i.h("div",{class:[`${A}-popover__footer`,t.footerClass],style:t.footerStyle},L):null)):t.scrollable?(Z=e.default)===null||Z===void 0?void 0:Z.call(e):i.h("div",{class:[`${A}-popover__content`,t.contentClass],style:t.contentStyle},e),V=t.scrollable?i.h(SC,{themeOverrides:l.value.peerOverrides.Scrollbar,theme:l.value.peers.Scrollbar,contentClass:H?void 0:`${A}-popover__content ${(O=t.contentClass)!==null&&O!==void 0?O:""}`,contentStyle:H?void 0:t.contentStyle},{default:()=>P}):P,M=t.showArrow?zC({arrowClass:t.arrowClass,arrowStyle:t.arrowStyle,arrowWrapperClass:t.arrowWrapperClass,arrowWrapperStyle:t.arrowWrapperStyle,clsPrefix:A}):null;return[V,M]};$=i.h("div",i.mergeProps({class:[`${A}-popover`,`${A}-popover-shared`,(c==null?void 0:c.value)&&`${A}-popover--rtl`,b==null?void 0:b.themeClass.value,R.map(Z=>`${A}-${Z}`),{[`${A}-popover--scrollable`]:t.scrollable,[`${A}-popover--show-header-or-footer`]:H,[`${A}-popover--raw`]:t.raw,[`${A}-popover-shared--overlap`]:t.overlap,[`${A}-popover-shared--show-arrow`]:t.showArrow,[`${A}-popover-shared--center-arrow`]:t.arrowPointToCenter}],ref:h,style:y.value,onKeydown:u.handleKeydown,onMouseenter:k,onMouseleave:x},n),F?i.h(s2,{active:t.show,autoFocus:!0},{default:Q}):Q())}return i.withDirectives($,p.value)}return{displayed:m,namespace:r,isMounted:u.isMountedRef,zIndex:u.zIndexRef,followerRef:d,adjustedTo:Wn(t),followerEnabled:f,renderContentNode:S}},render(){return i.h(mf,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===Wn.tdkey},{default:()=>this.animated?i.h(i.Transition,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var t;(t=this.internalOnAfterLeave)===null||t===void 0||t.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}});var LC={};const HC=Object.keys(_h),WC={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function jC(t,e,n){WC[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 qC={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:Wn.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},XC=Object.assign(Object.assign(Object.assign({},Bt.props),qC),{internalOnAfterLeave:Function,internalRenderBody:Function}),YC=i.defineComponent({name:"Popover",inheritAttrs:!1,props:XC,slots:Object,__popover__:!0,setup(t){LC.NODE_ENV!=="production"&&i.watchEffect(()=>{t.maxWidth!==void 0&&ui("popover","`max-width` is deprecated, please use `style` instead."),t.minWidth!==void 0&&ui("popover","`min-width` is deprecated, please use `style` instead."),t.arrow!==void 0&&ui("popover","`arrow` is deprecated, please use `showArrow` instead."),t.onHide!==void 0&&ui("popover","`on-hide` is deprecated, please use `on-update:show` instead."),t.onShow!==void 0&&ui("popover","`on-show` is deprecated, please use `on-update:show` instead.")});const e=Uo(),n=i.ref(null),r=i.computed(()=>t.show),o=i.ref(t.defaultShow),s=Ca(r,o),a=rn(()=>t.disabled?!1:s.value),l=()=>{if(t.disabled)return!0;const{getDisabled:H}=t;return!!(H!=null&&H())},c=()=>l()?!1:s.value,d=Yu(t,["arrow","showArrow"]),u=i.computed(()=>t.overlap?!1:d.value);let h=null;const f=i.ref(null),m=i.ref(null),p=rn(()=>t.x!==void 0&&t.y!==void 0);function g(H){const{"onUpdate:show":Q,onUpdateShow:Z,onShow:O,onHide:P}=t;o.value=H,Q&&St(Q,H),Z&&St(Z,H),H&&O&&St(O,!0),H&&P&&St(P,!1)}function y(){h&&h.syncPosition()}function b(){const{value:H}=f;H&&(window.clearTimeout(H),f.value=null)}function _(){const{value:H}=m;H&&(window.clearTimeout(H),m.value=null)}function k(){const H=l();if(t.trigger==="focus"&&!H){if(c())return;g(!0)}}function x(){const H=l();if(t.trigger==="focus"&&!H){if(!c())return;g(!1)}}function C(){const H=l();if(t.trigger==="hover"&&!H){if(_(),f.value!==null||c())return;const Q=()=>{g(!0),f.value=null},{delay:Z}=t;Z===0?Q():f.value=window.setTimeout(Q,Z)}}function N(){const H=l();if(t.trigger==="hover"&&!H){if(b(),m.value!==null||!c())return;const Q=()=>{g(!1),m.value=null},{duration:Z}=t;Z===0?Q():m.value=window.setTimeout(Q,Z)}}function w(){N()}function S(H){var Q;c()&&(t.trigger==="click"&&(b(),_(),g(!1)),(Q=t.onClickoutside)===null||Q===void 0||Q.call(t,H))}function v(){if(t.trigger==="click"&&!l()){b(),_();const H=!c();g(H)}}function $(H){t.internalTrapFocus&&H.key==="Escape"&&(b(),_(),g(!1))}function E(H){o.value=H}function A(){var H;return(H=n.value)===null||H===void 0?void 0:H.targetRef}function R(H){h=H}return i.provide("NPopover",{getTriggerElement:A,handleKeydown:$,handleMouseEnter:C,handleMouseLeave:N,handleClickOutside:S,handleMouseMoveOutside:w,setBodyInstance:R,positionManuallyRef:p,isMountedRef:e,zIndexRef:i.toRef(t,"zIndex"),extraClassRef:i.toRef(t,"internalExtraClass"),internalRenderBodyRef:i.toRef(t,"internalRenderBody")}),i.watchEffect(()=>{s.value&&l()&&g(!1)}),{binderInstRef:n,positionManually:p,mergedShowConsideringDisabledProp:a,uncontrolledShow:o,mergedShowArrow:u,getMergedShow:c,setShow:E,handleClick:v,handleMouseEnter:C,handleMouseLeave:N,handleFocus:k,handleBlur:x,syncPosition:y}},render(){var t;const{positionManually:e,$slots:n}=this;let r,o=!1;if(!e&&(r=y2(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)})}};jC(r,a?"nested":e?"manual":this.trigger,c)}}return i.h(Zu,{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}}),[[Xu,{enabled:s,zIndex:this.zIndex}]]):null,e?null:i.h(Qu,null,{default:()=>r}),i.h(DC,b2(this.$props,HC,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)}})]}})}}),UC={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 KC(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:m,closeIconColorHover:p,closeIconColorPressed:g,borderRadiusSmall:y,fontSizeMini:b,fontSizeTiny:_,fontSizeSmall:k,fontSizeMedium:x,heightMini:C,heightTiny:N,heightSmall:w,heightMedium:S,closeColorHover:v,closeColorPressed:$,buttonColor2Hover:E,buttonColor2Pressed:A,fontWeightStrong:R}=t;return Object.assign(Object.assign({},UC),{closeBorderRadius:y,heightTiny:C,heightSmall:N,heightMedium:w,heightLarge:S,borderRadius:y,opacityDisabled:h,fontSizeTiny:b,fontSizeSmall:_,fontSizeMedium:k,fontSizeLarge:x,fontWeightStrong:R,textColorCheckable:e,textColorHoverCheckable:e,textColorPressedCheckable:e,textColorChecked:d,colorCheckable:"#0000",colorHoverCheckable:E,colorPressedCheckable:A,colorChecked:o,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:e,color:f,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:p,closeIconColorPressed:g,closeColorHover:v,closeColorPressed:$,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 GC={common:Mi,self:KC},ZC={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},QC=be("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
|
`,[hn("disabled",[fe("&:hover","background-color: var(--n-color-hover-checkable);",[hn("checked","color: var(--n-text-color-hover-checkable);")]),fe("&:active","background-color: var(--n-color-pressed-checkable);",[hn("checked","color: var(--n-text-color-pressed-checkable);")])]),Ee("checked",`
|
|
611
611
|
color: var(--n-text-color-checked);
|
|
612
612
|
background-color: var(--n-color-checked);
|
|
613
|
-
`,[hn("disabled",[fe("&:hover","background-color: var(--n-color-checked-hover);"),fe("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var
|
|
613
|
+
`,[hn("disabled",[fe("&:hover","background-color: var(--n-color-checked-hover);"),fe("&:active","background-color: var(--n-color-checked-pressed);")])])])]);var JC={};const eS=Object.assign(Object.assign(Object.assign({},Bt.props),ZC),{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}),tS="n-tag",Ka=i.defineComponent({name:"Tag",props:eS,slots:Object,setup(t){JC.NODE_ENV!=="production"&&i.watchEffect(()=>{t.onCheckedChange!==void 0&&ui("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}=Fi(t),a=Bt("Tag","-tag",QC,GC,t,r);i.provide(tS,{roundRef:i.toRef(t,"round")});function l(){if(!t.disabled&&t.checkable){const{checked:m,onCheckedChange:p,onUpdateChecked:g,"onUpdate:checked":y}=t;g&&g(!m),y&&y(!m),p&&p(!m)}}function c(m){if(t.triggerClickOnClose||m.stopPropagation(),!t.disabled){const{onClose:p}=t;p&&St(p,m)}}const d={setTextContent(m){const{value:p}=e;p&&(p.textContent=m)}},u=jr("Tag",s,r),h=i.computed(()=>{const{type:m,size:p,color:{color:g,textColor:y}={}}=t,{common:{cubicBezierEaseInOut:b},self:{padding:_,closeMargin:k,borderRadius:x,opacityDisabled:C,textColorCheckable:N,textColorHoverCheckable:w,textColorPressedCheckable:S,textColorChecked:v,colorCheckable:$,colorHoverCheckable:E,colorPressedCheckable:A,colorChecked:R,colorCheckedHover:F,colorCheckedPressed:H,closeBorderRadius:Q,fontWeightStrong:Z,[nt("colorBordered",m)]:O,[nt("closeSize",p)]:P,[nt("closeIconSize",p)]:V,[nt("fontSize",p)]:M,[nt("height",p)]:L,[nt("color",m)]:Y,[nt("textColor",m)]:U,[nt("border",m)]:G,[nt("closeIconColor",m)]:q,[nt("closeIconColorHover",m)]:W,[nt("closeIconColorPressed",m)]:K,[nt("closeColorHover",m)]:ue,[nt("closeColorPressed",m)]:ye}}=a.value,ve=fn(k);return{"--n-font-weight-strong":Z,"--n-avatar-size-override":`calc(${L} - 8px)`,"--n-bezier":b,"--n-border-radius":x,"--n-border":G,"--n-close-icon-size":V,"--n-close-color-pressed":ye,"--n-close-color-hover":ue,"--n-close-border-radius":Q,"--n-close-icon-color":q,"--n-close-icon-color-hover":W,"--n-close-icon-color-pressed":K,"--n-close-icon-color-disabled":q,"--n-close-margin-top":ve.top,"--n-close-margin-right":ve.right,"--n-close-margin-bottom":ve.bottom,"--n-close-margin-left":ve.left,"--n-close-size":P,"--n-color":g||(n.value?O:Y),"--n-color-checkable":$,"--n-color-checked":R,"--n-color-checked-hover":F,"--n-color-checked-pressed":H,"--n-color-hover-checkable":E,"--n-color-pressed-checkable":A,"--n-font-size":M,"--n-height":L,"--n-opacity-disabled":C,"--n-padding":_,"--n-text-color":y||U,"--n-text-color-checkable":N,"--n-text-color-checked":v,"--n-text-color-hover-checkable":w,"--n-text-color-pressed-checkable":S}}),f=o?Vi("tag",i.computed(()=>{let m="";const{type:p,size:g,color:{color:y,textColor:b}={}}=t;return m+=p[0],m+=g[0],y&&(m+=`a${jf(y)}`),b&&(m+=`b${jf(b)}`),n.value&&(m+="c"),m}),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=Ei(c.avatar,h=>h&&i.h("div",{class:`${n}-tag__avatar`},h)),u=Ei(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(mC,{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)}}),nS=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(sh,{clsPrefix:n,class:`${n}-base-suffix`,strokeWidth:24,scale:.85,show:t.loading},{default:()=>t.showArrow?i.h(fC,{clsPrefix:n,show:t.showClear,onClear:t.onClear},{placeholder:()=>i.h(Xr,{clsPrefix:n,class:`${n}-base-suffix__arrow`},{default:()=>Ha(e.default,()=>[i.h(sC,null)])})}):null})}}}),iS={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"};function rS(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:m,iconColorDisabled:p,clearColor:g,clearColorHover:y,clearColorPressed:b,placeholderColor:_,placeholderColorDisabled:k,fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:N,fontSizeLarge:w,heightTiny:S,heightSmall:v,heightMedium:$,heightLarge:E,fontWeight:A}=t;return Object.assign(Object.assign({},iS),{fontSizeTiny:x,fontSizeSmall:C,fontSizeMedium:N,fontSizeLarge:w,heightTiny:S,heightSmall:v,heightMedium:$,heightLarge:E,borderRadius:e,fontWeight:A,textColor:n,textColorDisabled:r,placeholderColor:_,placeholderColorDisabled:k,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:m,arrowColorDisabled:p,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:g,clearColorHover:y,clearColorPressed:b})}const wh={name:"InternalSelection",common:Mi,peers:{Popover:bh},self:rS},oS=fe([be("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
|
-
`)])])]),aS=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},Bt.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}=Fi(t),r=jr("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),m=i.ref(null),p=i.ref(!1),g=i.ref(!1),y=i.ref(!1),b=Bt("InternalSelection","-internal-selection",sS,wh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),k=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):hr(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=i.computed(()=>{const te=t.selectedOption;if(te)return te[t.labelField]}),C=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function N(){var te;const{value:le}=o;if(le){const{value:De}=s;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((te=f.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:te}=m;te&&(te.style.display="none")}function S(){const{value:te}=m;te&&(te.style.display="inline-block")}i.watch(i.toRef(t,"active"),te=>{te||w()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(N)});function v(te){const{onFocus:le}=t;le&&le(te)}function $(te){const{onBlur:le}=t;le&&le(te)}function E(te){const{onDeleteOption:le}=t;le&&le(te)}function A(te){const{onClear:le}=t;le&&le(te)}function R(te){const{onPatternInput:le}=t;le&&le(te)}function F(te){var le;(!te.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(te.relatedTarget)))&&v(te)}function H(te){var le;!((le=a.value)===null||le===void 0)&&le.contains(te.relatedTarget)||$(te)}function Q(te){A(te)}function Z(){y.value=!0}function O(){y.value=!1}function P(te){!t.active||!t.filterable||te.target!==s.value&&te.preventDefault()}function V(te){E(te)}const M=i.ref(!1);function L(te){if(te.key==="Backspace"&&!M.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&V(le[le.length-1])}}let Y=null;function U(te){const{value:le}=o;if(le){const De=te.target.value;le.textContent=De,N()}t.ignoreComposition&&M.value?Y=te:R(te)}function G(){M.value=!0}function q(){M.value=!1,t.ignoreComposition&&R(Y),Y=null}function W(te){var le;g.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,te)}function K(te){var le;g.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,te)}function ue(){var te,le;if(t.filterable)g.value=!1,(te=d.value)===null||te===void 0||te.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 ye(){var te,le,De;t.filterable?(g.value=!1,(te=d.value)===null||te===void 0||te.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function ve(){const{value:te}=s;te&&(S(),te.focus())}function ot(){const{value:te}=s;te&&te.blur()}function _e(te){const{value:le}=u;le&&le.setTextContent(`+${te}`)}function we(){const{value:te}=h;return te}function wt(){return s.value}let $e=null;function Gt(){$e!==null&&window.clearTimeout($e)}function pn(){t.active||(Gt(),$e=window.setTimeout(()=>{C.value&&(p.value=!0)},100))}function Rt(){Gt()}function Qn(te){te||(Gt(),p.value=!1)}i.watch(C,te=>{te||(p.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const te=d.value;te&&(t.disabled?te.removeAttribute("tabindex"):te.tabIndex=g.value?-1:0)})}),Wf(a,t.onResize);const{inlineThemeDisabled:gn}=t,sn=i.computed(()=>{const{size:te}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:hi,color:at,placeholderColor:Zt,textColor:mr,paddingSingle:mi,paddingMultiple:zi,caretColor:pr,colorDisabled:yn,textColorDisabled:Jn,placeholderColorDisabled:I,colorActive:J,boxShadowFocus:se,boxShadowActive:he,boxShadowHover:pe,border:xe,borderFocus:Se,borderHover:Te,borderActive:Je,arrowColor:Vn,arrowColorDisabled:el,loadingColor:tl,colorActiveWarning:nl,boxShadowFocusWarning:il,boxShadowActiveWarning:rl,boxShadowHoverWarning:ol,borderWarning:sl,borderFocusWarning:al,borderHoverWarning:ll,borderActiveWarning:cl,colorActiveError:dl,boxShadowFocusError:ul,boxShadowActiveError:fl,boxShadowHoverError:hl,borderError:ml,borderFocusError:pl,borderHoverError:gl,borderActiveError:I5,clearColor:O5,clearColorHover:z5,clearColorPressed:D5,clearSize:L5,arrowSize:H5,[tt("height",te)]:W5,[tt("fontSize",te)]:j5}}=b.value,ds=fn(mi),us=fn(zi);return{"--n-bezier":le,"--n-border":xe,"--n-border-active":Je,"--n-border-focus":Se,"--n-border-hover":Te,"--n-border-radius":hi,"--n-box-shadow-active":he,"--n-box-shadow-focus":se,"--n-box-shadow-hover":pe,"--n-caret-color":pr,"--n-color":at,"--n-color-active":J,"--n-color-disabled":yn,"--n-font-size":j5,"--n-height":W5,"--n-padding-single-top":ds.top,"--n-padding-multiple-top":us.top,"--n-padding-single-right":ds.right,"--n-padding-multiple-right":us.right,"--n-padding-single-left":ds.left,"--n-padding-multiple-left":us.left,"--n-padding-single-bottom":ds.bottom,"--n-padding-multiple-bottom":us.bottom,"--n-placeholder-color":Zt,"--n-placeholder-color-disabled":I,"--n-text-color":mr,"--n-text-color-disabled":Jn,"--n-arrow-color":Vn,"--n-arrow-color-disabled":el,"--n-loading-color":tl,"--n-color-active-warning":nl,"--n-box-shadow-focus-warning":il,"--n-box-shadow-active-warning":rl,"--n-box-shadow-hover-warning":ol,"--n-border-warning":sl,"--n-border-focus-warning":al,"--n-border-hover-warning":ll,"--n-border-active-warning":cl,"--n-color-active-error":dl,"--n-box-shadow-focus-error":ul,"--n-box-shadow-active-error":fl,"--n-box-shadow-hover-error":hl,"--n-border-error":ml,"--n-border-focus-error":pl,"--n-border-hover-error":gl,"--n-border-active-error":I5,"--n-clear-size":L5,"--n-clear-color":O5,"--n-clear-color-hover":z5,"--n-clear-color-pressed":D5,"--n-arrow-size":H5,"--n-font-weight":De}}),Ve=gn?Vi("internal-selection",i.computed(()=>t.size[0]),sn,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:g,filterablePlaceholder:k,label:x,selected:C,showTagsPanel:p,isComposing:M,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:m,handleMouseDown:P,handleFocusin:F,handleClear:Q,handleMouseEnter:Z,handleMouseLeave:O,handleDeleteOption:V,handlePatternKeyDown:L,handlePatternInputInput:U,handlePatternInputBlur:K,handlePatternInputFocus:W,handleMouseEnterCounter:pn,handleMouseLeaveCounter:Rt,handleFocusout:H,handleCompositionEnd:q,handleCompositionStart:G,onPopoverUpdateShow:Qn,focus:ye,focusInput:ve,blur:ue,blurInput:ot,updateCounter:_e,getCounter:we,getTail:wt,renderLabel:t.renderLabel,cssVars:gn?void 0:sn,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",m=typeof s=="number",p=f||m,g=i.h(Wa,null,{default:()=>i.h(iS,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=R=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:R.value},u?u({option:R,handleClose:()=>{this.handleDeleteOption(R)}}):i.h(Ka,{size:n,closable:!R.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(R)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(R,!0):hr(R[b],R,!0)})),k=()=>(m?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,C=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(Ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let N;if(m){const R=this.selectedOptions.length-s;R>0&&(N=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(Ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${R}`})))}const w=f?o?i.h(Ff,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:C,tail:()=>x}):i.h(Ff,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:C}):m&&N?k().concat(N):k(),S=p?()=>i.h("div",{class:`${l}-base-selection-popover`},f?k():this.selectedOptions.map(_)):void 0,v=p?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,E=(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,A=o?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,f?null:x,g):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,g);y=i.h(i.Fragment,null,p?i.h(UC,Object.assign({},v,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>A,default:S}):A,E)}else if(o){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,k=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Gf(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})),k?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):hr(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,g)}else y=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:Gf(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):hr(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)),g);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function lS(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const cS={name:"Select",common:Mi,peers:{InternalSelection:wh,InternalSelectMenu:fh},self:lS},dS=fe([be("select",`
|
|
813
|
+
`)])])]),sS=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},Bt.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}=Fi(t),r=jr("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),m=i.ref(null),p=i.ref(!1),g=i.ref(!1),y=i.ref(!1),b=Bt("InternalSelection","-internal-selection",oS,wh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),k=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):hr(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),x=i.computed(()=>{const te=t.selectedOption;if(te)return te[t.labelField]}),C=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function N(){var te;const{value:le}=o;if(le){const{value:De}=s;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((te=f.value)===null||te===void 0||te.sync({showAllItemsBeforeCalculate:!1})))}}function w(){const{value:te}=m;te&&(te.style.display="none")}function S(){const{value:te}=m;te&&(te.style.display="inline-block")}i.watch(i.toRef(t,"active"),te=>{te||w()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick(N)});function v(te){const{onFocus:le}=t;le&&le(te)}function $(te){const{onBlur:le}=t;le&&le(te)}function E(te){const{onDeleteOption:le}=t;le&&le(te)}function A(te){const{onClear:le}=t;le&&le(te)}function R(te){const{onPatternInput:le}=t;le&&le(te)}function F(te){var le;(!te.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(te.relatedTarget)))&&v(te)}function H(te){var le;!((le=a.value)===null||le===void 0)&&le.contains(te.relatedTarget)||$(te)}function Q(te){A(te)}function Z(){y.value=!0}function O(){y.value=!1}function P(te){!t.active||!t.filterable||te.target!==s.value&&te.preventDefault()}function V(te){E(te)}const M=i.ref(!1);function L(te){if(te.key==="Backspace"&&!M.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&V(le[le.length-1])}}let Y=null;function U(te){const{value:le}=o;if(le){const De=te.target.value;le.textContent=De,N()}t.ignoreComposition&&M.value?Y=te:R(te)}function G(){M.value=!0}function q(){M.value=!1,t.ignoreComposition&&R(Y),Y=null}function W(te){var le;g.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,te)}function K(te){var le;g.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,te)}function ue(){var te,le;if(t.filterable)g.value=!1,(te=d.value)===null||te===void 0||te.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 ye(){var te,le,De;t.filterable?(g.value=!1,(te=d.value)===null||te===void 0||te.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function ve(){const{value:te}=s;te&&(S(),te.focus())}function ot(){const{value:te}=s;te&&te.blur()}function _e(te){const{value:le}=u;le&&le.setTextContent(`+${te}`)}function we(){const{value:te}=h;return te}function wt(){return s.value}let $e=null;function Gt(){$e!==null&&window.clearTimeout($e)}function pn(){t.active||(Gt(),$e=window.setTimeout(()=>{C.value&&(p.value=!0)},100))}function Rt(){Gt()}function Qn(te){te||(Gt(),p.value=!1)}i.watch(C,te=>{te||(p.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const te=d.value;te&&(t.disabled?te.removeAttribute("tabindex"):te.tabIndex=g.value?-1:0)})}),Wf(a,t.onResize);const{inlineThemeDisabled:gn}=t,sn=i.computed(()=>{const{size:te}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:hi,color:at,placeholderColor:Zt,textColor:mr,paddingSingle:mi,paddingMultiple:zi,caretColor:pr,colorDisabled:yn,textColorDisabled:Jn,placeholderColorDisabled:I,colorActive:J,boxShadowFocus:se,boxShadowActive:he,boxShadowHover:pe,border:xe,borderFocus:Se,borderHover:Te,borderActive:Je,arrowColor:Vn,arrowColorDisabled:el,loadingColor:tl,colorActiveWarning:nl,boxShadowFocusWarning:il,boxShadowActiveWarning:rl,boxShadowHoverWarning:ol,borderWarning:sl,borderFocusWarning:al,borderHoverWarning:ll,borderActiveWarning:cl,colorActiveError:dl,boxShadowFocusError:ul,boxShadowActiveError:fl,boxShadowHoverError:hl,borderError:ml,borderFocusError:pl,borderHoverError:gl,borderActiveError:A5,clearColor:I5,clearColorHover:O5,clearColorPressed:z5,clearSize:D5,arrowSize:L5,[nt("height",te)]:H5,[nt("fontSize",te)]:W5}}=b.value,ds=fn(mi),us=fn(zi);return{"--n-bezier":le,"--n-border":xe,"--n-border-active":Je,"--n-border-focus":Se,"--n-border-hover":Te,"--n-border-radius":hi,"--n-box-shadow-active":he,"--n-box-shadow-focus":se,"--n-box-shadow-hover":pe,"--n-caret-color":pr,"--n-color":at,"--n-color-active":J,"--n-color-disabled":yn,"--n-font-size":W5,"--n-height":H5,"--n-padding-single-top":ds.top,"--n-padding-multiple-top":us.top,"--n-padding-single-right":ds.right,"--n-padding-multiple-right":us.right,"--n-padding-single-left":ds.left,"--n-padding-multiple-left":us.left,"--n-padding-single-bottom":ds.bottom,"--n-padding-multiple-bottom":us.bottom,"--n-placeholder-color":Zt,"--n-placeholder-color-disabled":I,"--n-text-color":mr,"--n-text-color-disabled":Jn,"--n-arrow-color":Vn,"--n-arrow-color-disabled":el,"--n-loading-color":tl,"--n-color-active-warning":nl,"--n-box-shadow-focus-warning":il,"--n-box-shadow-active-warning":rl,"--n-box-shadow-hover-warning":ol,"--n-border-warning":sl,"--n-border-focus-warning":al,"--n-border-hover-warning":ll,"--n-border-active-warning":cl,"--n-color-active-error":dl,"--n-box-shadow-focus-error":ul,"--n-box-shadow-active-error":fl,"--n-box-shadow-hover-error":hl,"--n-border-error":ml,"--n-border-focus-error":pl,"--n-border-hover-error":gl,"--n-border-active-error":A5,"--n-clear-size":D5,"--n-clear-color":I5,"--n-clear-color-hover":O5,"--n-clear-color-pressed":z5,"--n-arrow-size":L5,"--n-font-weight":De}}),Ve=gn?Vi("internal-selection",i.computed(()=>t.size[0]),sn,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:g,filterablePlaceholder:k,label:x,selected:C,showTagsPanel:p,isComposing:M,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:f,inputTagElRef:m,handleMouseDown:P,handleFocusin:F,handleClear:Q,handleMouseEnter:Z,handleMouseLeave:O,handleDeleteOption:V,handlePatternKeyDown:L,handlePatternInputInput:U,handlePatternInputBlur:K,handlePatternInputFocus:W,handleMouseEnterCounter:pn,handleMouseLeaveCounter:Rt,handleFocusout:H,handleCompositionEnd:q,handleCompositionStart:G,onPopoverUpdateShow:Qn,focus:ye,focusInput:ve,blur:ue,blurInput:ot,updateCounter:_e,getCounter:we,getTail:wt,renderLabel:t.renderLabel,cssVars:gn?void 0:sn,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",m=typeof s=="number",p=f||m,g=i.h(Wa,null,{default:()=>i.h(nS,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=R=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:R.value},u?u({option:R,handleClose:()=>{this.handleDeleteOption(R)}}):i.h(Ka,{size:n,closable:!R.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(R)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(R,!0):hr(R[b],R,!0)})),k=()=>(m?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,C=f?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(Ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let N;if(m){const R=this.selectedOptions.length-s;R>0&&(N=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(Ka,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${R}`})))}const w=f?o?i.h(Ff,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:C,tail:()=>x}):i.h(Ff,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:k,counter:C}):m&&N?k().concat(N):k(),S=p?()=>i.h("div",{class:`${l}-base-selection-popover`},f?k():this.selectedOptions.map(_)):void 0,v=p?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,E=(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,A=o?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},w,f?null:x,g):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},w,g);y=i.h(i.Fragment,null,p?i.h(YC,Object.assign({},v,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>A,default:S}):A,E)}else if(o){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,k=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Gf(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})),k?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):hr(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,g)}else y=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:Gf(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):hr(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)),g);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function aS(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const lS={name:"Select",common:Mi,peers:{InternalSelection:wh,InternalSelectMenu:fh},self:aS},cS=fe([be("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
@@ -819,4 +819,4 @@ ${o}
|
|
|
819
819
|
`),be("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[yh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function as(t){return t.type==="group"}function xh(t){return t.type==="ignored"}function Ga(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function uS(t,e){return{getIsGroup:as,getIgnored:xh,getKey(r){return as(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function fS(t,e,n,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(as(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(xh(l))continue;e(n,l)&&a.push(l)}return a}return o(t)}function hS(t,e,n){const r=new Map;return t.forEach(o=>{as(o)?o[n].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var mS={};const pS=Object.assign(Object.assign({},Bt.props),{to:Wn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),gS=i.defineComponent({name:"Select",props:pS,slots:Object,setup(t){mS.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ui("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ui("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:o}=Fi(t),s=Bt("Select","-select",dS,cS,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Ca(l,a),d=i.ref(!1),u=i.ref(""),h=Yu(t,["items","options"]),f=i.ref([]),m=i.ref([]),p=i.computed(()=>m.value.concat(f.value).concat(h.value)),g=i.computed(()=>{const{filter:I}=t;if(I)return I;const{labelField:J,valueField:se}=t;return(he,pe)=>{if(!pe)return!1;const xe=pe[J];if(typeof xe=="string")return Ga(he,xe);const Se=pe[se];return typeof Se=="string"?Ga(he,Se):typeof Se=="number"?Ga(he,String(Se)):!1}}),y=i.computed(()=>{if(t.remote)return h.value;{const{value:I}=p,{value:J}=u;return!J.length||!t.filterable?I:fS(I,g.value,J,t.childrenField)}}),b=i.computed(()=>{const{valueField:I,childrenField:J}=t,se=uS(I,J);return Hk(y.value,se)}),_=i.computed(()=>hS(p.value,t.valueField,t.childrenField)),k=i.ref(!1),x=Ca(i.toRef(t,"show"),k),C=i.ref(null),N=i.ref(null),w=i.ref(null),{localeRef:S}=nh("Select"),v=i.computed(()=>{var I;return(I=t.placeholder)!==null&&I!==void 0?I:S.value.placeholder}),$=[],E=i.ref(new Map),A=i.computed(()=>{const{fallbackOption:I}=t;if(I===void 0){const{labelField:J,valueField:se}=t;return he=>({[J]:String(he),[se]:he})}return I===!1?!1:J=>Object.assign(I(J),{value:J})});function R(I){const J=t.remote,{value:se}=E,{value:he}=_,{value:pe}=A,xe=[];return I.forEach(Se=>{if(he.has(Se))xe.push(he.get(Se));else if(J&&se.has(Se))xe.push(se.get(Se));else if(pe){const Te=pe(Se);Te&&xe.push(Te)}}),xe}const F=i.computed(()=>{if(t.multiple){const{value:I}=c;return Array.isArray(I)?R(I):[]}return null}),H=i.computed(()=>{const{value:I}=c;return!t.multiple&&!Array.isArray(I)?I===null?null:R([I])[0]||null:null}),Q=x2(t),{mergedSizeRef:Z,mergedDisabledRef:O,mergedStatusRef:P}=Q;function V(I,J){const{onChange:se,"onUpdate:value":he,onUpdateValue:pe}=t,{nTriggerFormChange:xe,nTriggerFormInput:Se}=Q;se&&St(se,I,J),pe&&St(pe,I,J),he&&St(he,I,J),a.value=I,xe(),Se()}function M(I){const{onBlur:J}=t,{nTriggerFormBlur:se}=Q;J&&St(J,I),se()}function L(){const{onClear:I}=t;I&&St(I)}function Y(I){const{onFocus:J,showOnFocus:se}=t,{nTriggerFormFocus:he}=Q;J&&St(J,I),he(),se&&K()}function U(I){const{onSearch:J}=t;J&&St(J,I)}function G(I){const{onScroll:J}=t;J&&St(J,I)}function q(){var I;const{remote:J,multiple:se}=t;if(J){const{value:he}=E;if(se){const{valueField:pe}=t;(I=F.value)===null||I===void 0||I.forEach(xe=>{he.set(xe[pe],xe)})}else{const pe=H.value;pe&&he.set(pe[t.valueField],pe)}}}function W(I){const{onUpdateShow:J,"onUpdate:show":se}=t;J&&St(J,I),se&&St(se,I),k.value=I}function K(){O.value||(W(!0),k.value=!0,t.filterable&&mi())}function ue(){W(!1)}function ye(){u.value="",m.value=$}const ve=i.ref(!1);function ot(){t.filterable&&(ve.value=!0)}function _e(){t.filterable&&(ve.value=!1,x.value||ye())}function we(){O.value||(x.value?t.filterable?mi():ue():K())}function wt(I){var J,se;!((se=(J=w.value)===null||J===void 0?void 0:J.selfRef)===null||se===void 0)&&se.contains(I.relatedTarget)||(d.value=!1,M(I),ue())}function $e(I){Y(I),d.value=!0}function Gt(){d.value=!0}function pn(I){var J;!((J=C.value)===null||J===void 0)&&J.$el.contains(I.relatedTarget)||(d.value=!1,M(I),ue())}function Rt(){var I;(I=C.value)===null||I===void 0||I.focus(),ue()}function Qn(I){var J;x.value&&(!((J=C.value)===null||J===void 0)&&J.$el.contains(Fr(I))||ue())}function gn(I){if(!Array.isArray(I))return[];if(A.value)return Array.from(I);{const{remote:J}=t,{value:se}=_;if(J){const{value:he}=E;return I.filter(pe=>se.has(pe)||he.has(pe))}else return I.filter(he=>se.has(he))}}function sn(I){Ve(I.rawNode)}function Ve(I){if(O.value)return;const{tag:J,remote:se,clearFilterAfterSelect:he,valueField:pe}=t;if(J&&!se){const{value:xe}=m,Se=xe[0]||null;if(Se){const Te=f.value;Te.length?Te.push(Se):f.value=[Se],m.value=$}}if(se&&E.value.set(I[pe],I),t.multiple){const xe=gn(c.value),Se=xe.findIndex(Te=>Te===I[pe]);if(~Se){if(xe.splice(Se,1),J&&!se){const Te=te(I[pe]);~Te&&(f.value.splice(Te,1),he&&(u.value=""))}}else xe.push(I[pe]),he&&(u.value="");V(xe,R(xe))}else{if(J&&!se){const xe=te(I[pe]);~xe?f.value=[f.value[xe]]:f.value=$}mr(),ue(),V(I[pe],I)}}function te(I){return f.value.findIndex(se=>se[t.valueField]===I)}function le(I){x.value||K();const{value:J}=I.target;u.value=J;const{tag:se,remote:he}=t;if(U(J),se&&!he){if(!J){m.value=$;return}const{onCreate:pe}=t,xe=pe?pe(J):{[t.labelField]:J,[t.valueField]:J},{valueField:Se,labelField:Te}=t;h.value.some(Je=>Je[Se]===xe[Se]||Je[Te]===xe[Te])||f.value.some(Je=>Je[Se]===xe[Se]||Je[Te]===xe[Te])?m.value=$:m.value=[xe]}}function De(I){I.stopPropagation();const{multiple:J}=t;!J&&t.filterable&&ue(),L(),J?V([],[]):V(null,null)}function hi(I){!Pr(I,"action")&&!Pr(I,"empty")&&!Pr(I,"header")&&I.preventDefault()}function at(I){G(I)}function Zt(I){var J,se,he,pe,xe;if(!t.keyboard){I.preventDefault();return}switch(I.key){case" ":if(t.filterable)break;I.preventDefault();case"Enter":if(!(!((J=C.value)===null||J===void 0)&&J.isComposing)){if(x.value){const Se=(se=w.value)===null||se===void 0?void 0:se.getPendingTmNode();Se?sn(Se):t.filterable||(ue(),mr())}else if(K(),t.tag&&ve.value){const Se=m.value[0];if(Se){const Te=Se[t.valueField],{value:Je}=c;t.multiple&&Array.isArray(Je)&&Je.includes(Te)||Ve(Se)}}}I.preventDefault();break;case"ArrowUp":if(I.preventDefault(),t.loading)return;x.value&&((he=w.value)===null||he===void 0||he.prev());break;case"ArrowDown":if(I.preventDefault(),t.loading)return;x.value?(pe=w.value)===null||pe===void 0||pe.next():K();break;case"Escape":x.value&&(y2(I),ue()),(xe=C.value)===null||xe===void 0||xe.focus();break}}function mr(){var I;(I=C.value)===null||I===void 0||I.focus()}function mi(){var I;(I=C.value)===null||I===void 0||I.focusInput()}function zi(){var I;x.value&&((I=N.value)===null||I===void 0||I.syncPosition())}q(),i.watch(i.toRef(t,"options"),q);const pr={focus:()=>{var I;(I=C.value)===null||I===void 0||I.focus()},focusInput:()=>{var I;(I=C.value)===null||I===void 0||I.focusInput()},blur:()=>{var I;(I=C.value)===null||I===void 0||I.blur()},blurInput:()=>{var I;(I=C.value)===null||I===void 0||I.blurInput()}},yn=i.computed(()=>{const{self:{menuBoxShadow:I}}=s.value;return{"--n-menu-box-shadow":I}}),Jn=o?Vi("select",void 0,yn,t):void 0;return Object.assign(Object.assign({},pr),{mergedStatus:P,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:Uo(),triggerRef:C,menuRef:w,pattern:u,uncontrolledShow:k,mergedShow:x,adjustedTo:Wn(t),uncontrolledValue:a,mergedValue:c,followerRef:N,localizedPlaceholder:v,selectedOption:H,selectedOptions:F,mergedSize:Z,mergedDisabled:O,focused:d,activeWithoutMenuOpen:ve,inlineThemeDisabled:o,onTriggerInputFocus:ot,onTriggerInputBlur:_e,handleTriggerOrMenuResize:zi,handleMenuFocus:Gt,handleMenuBlur:pn,handleMenuTabOut:Rt,handleTriggerClick:we,handleToggle:sn,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:wt,handleTriggerFocus:$e,handleKeydown:Zt,handleMenuAfterLeave:ye,handleMenuClickOutside:Qn,handleMenuScroll:at,handleMenuKeydown:Zt,handleMenuMousedown:hi,mergedTheme:s,cssVars:o?void 0:yn,themeClass:Jn==null?void 0:Jn.themeClass,onRender:Jn==null?void 0:Jn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Zu,null,{default:()=>[i.h(Qu,null,{default:()=>i.h(aS,{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(mf,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Wn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(AC,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],[Yo,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Yo,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),yS={},kh=i.defineComponent({...yS,__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(()=>D.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(k=>{if(D.isEmpty(k))return;const x=s.value?r.value:r.value?[r.value]:[],C=k.filter(N=>!x.some(w=>w.id===N.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let f="";const m=D.debounce(()=>h(f),800),p=_=>{f=_,m()},g=_=>{var k;if(D.isArray(_)){const x=_.length>0?_.map(C=>{var N;return i.toRaw((N=l.value.find(w=>w.value===C))==null?void 0:N.item)}):[];o("update:value",x)}else if(_>0){const x=i.toRaw((k=l.value.find(C=>C.value===_))==null?void 0:k.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()}}),(_,k)=>(i.openBlock(),i.createBlock(i.unref(gS),{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:p,"onUpdate:value":g},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),bS={},vh=i.defineComponent({...bS,__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"?yt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?yt.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 m=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},m.code),i.h("span",{},[m.name])])}if(r.searchType==="categories"){const m=h.item;return i.h("div",{},[m.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(kh,{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]=m=>o("update:value",m))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),_S={class:"col-span-2 flex flex-row gap-2.5"},wS={class:"flex-1"},xS={class:"text-sc-grey"},kS={class:"ml-2.5"},vS={key:0,class:"flex-none"},CS={},SS=i.defineComponent({...CS,__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)),...(D.isArray(h)?h:[h]).filter(f=>!a.value.some(m=>m.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 m=z.NListItem,p=ek,g=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(vh,{value:o.value,"onUpdate:value":[f[0]||(f[0]=b=>o.value=b),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(m,{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,b=>(i.openBlock(),i.createBlock(m,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(g,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(b)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",_S,[i.createElementVNode("span",wS,[i.createElementVNode("span",xS,i.toDisplayString(b.code),1),i.createElementVNode("span",kS,i.toDisplayString(b.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",vS,[i.renderSlot(h.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),BS={class:"flex flex-col"},TS={class:"flex flex-col gap-1.5 text-base text-nowrap"},NS={class:"font-medium"},$S={class:"flex flex-col text-sc-dark-grey"},RS={key:0},ES={class:"font-medium"},PS={class:"font-medium"},FS={class:"font-medium"},VS={class:"font-medium"},MS={class:"font-medium"},AS={class:"font-medium"},IS={class:"font-medium"},OS={class:"font-medium"},zS={class:"font-medium"},DS={class:"font-medium"},LS={class:"flex flex-col gap-1.5 text-base text-nowrap"},HS={class:"font-medium"},WS={class:"flex flex-col text-sc-dark-grey"},jS={class:"font-medium"},qS={class:"font-medium"},XS={class:"flex flex-col gap-1.5 text-base text-nowrap"},YS={class:"font-medium"},US={class:"text-sc-dark-grey"},KS={class:"font-medium"},GS={key:1,class:"text-base font-medium text-nowrap"},ZS={},Ch=i.defineComponent({...ZS,__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,m;return((f=n.item.product.unit)==null?void 0:f.isLinear)&&((m=n.item.product.properties)==null?void 0:m.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 m;f!==null&&(c.value.quantity=f,(m=n.eventEmitter)==null||m.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,m)=>{const p=z.NInputNumber;return i.openBlock(),i.createElementBlock("div",BS,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",TS,[i.createElementVNode("span",null,[m[1]||(m[1]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",NS,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",$S,[t.item.configurator===i.unref(j.ConfiguratorsEnum).Kozyrek?(i.openBlock(),i.createElementBlock("span",RS,[m[2]||(m[2]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",ES,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,[m[3]||(m[3]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",PS,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[m[4]||(m[4]=i.createTextVNode(" Высота: ",-1)),i.createElementVNode("span",FS,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,(g,y)=>(i.openBlock(),i.createElementBlock("span",{key:y},[i.createTextVNode(" Полоса №"+i.toDisplayString(Number(y)+1)+": ",1),i.createElementVNode("span",VS,i.toDisplayString(g)+" мм.",1)]))),128)),i.createElementVNode("span",null,[m[5]||(m[5]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",MS,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,[m[6]||(m[6]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",AS,i.toDisplayString(t.item.width)+" мм.",1)]),i.createElementVNode("span",null,[m[7]||(m[7]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",IS,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??[],(g,y)=>(i.openBlock(),i.createElementBlock("span",{key:y},[i.createTextVNode(" Изделие №"+i.toDisplayString(Number(y)+1)+": ",1),i.createElementVNode("span",OS,i.toDisplayString(g.width)+"×"+i.toDisplayString(g.length)+" мм, "+i.toDisplayString(g.count)+" шт.",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,[m[8]||(m[8]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",zS,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[m[9]||(m[9]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",DS,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",LS,[i.createElementVNode("span",null,[m[10]||(m[10]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",HS,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",WS,[i.createElementVNode("span",null,[m[11]||(m[11]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",jS,i.toDisplayString(s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)]),i.createElementVNode("span",null,[m[12]||(m[12]=i.createTextVNode(" Всего: ",-1)),i.createElementVNode("span",qS,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",XS,[i.createElementVNode("span",null,[m[13]||(m[13]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",YS,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("span",US,[m[14]||(m[14]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",KS,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(p,{key:0,value:c.value.quantity,parse:i.unref(lt),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:m[0]||(m[0]=g=>i.unref(eo)(g,".",!1)),onFocus:i.unref(Le),"onUpdate:value":d},{suffix:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.item.product.unit.name),1)]),_:1},8,["value","parse","min","step","show-button","disabled","loading","onFocus"])):(i.openBlock(),i.createElementBlock("span",GS,i.toDisplayString(t.item.quantity)+" "+i.toDisplayString(t.item.product.unit.name),1))],64))])}}}),QS={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function JS(t,e){return i.openBlock(),i.createElementBlock("svg",QS,[...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 eB=i.markRaw({name:"tabler-truck-filled",render:JS}),tB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function nB(t,e){return i.openBlock(),i.createElementBlock("svg",tB,[...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 iB=i.markRaw({name:"tabler-truck-delivery",render:nB}),rB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function oB(t,e){return i.openBlock(),i.createElementBlock("svg",rB,[...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 sB=i.markRaw({name:"tabler-truck-loading",render:oB}),aB={class:"flex flex-col gap-1"},lB={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},cB={key:1,class:"text-base"},dB={class:"text-sc-dark-grey mr-1.5"},uB={key:0},fB={key:1},hB={},ls=i.defineComponent({...hB,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=j.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(a=>a.id===o.delivery.type)}),n=i.computed(()=>He.format(o.delivery.date,"dd.MM.yyyy")),r=i.computed(()=>{var s;return(s=o.delivery.address)!=null&&s.address?ti.getFormatEntityName({name:o.delivery.address.address,deletedAt:o.delivery.address.deletedAt}):""}),o=t;return(s,a)=>{var u,h,f,m,p,g,y,b;const l=sB,c=iB,d=eB;return i.openBlock(),i.createElementBlock("div",aB,[t.showType?(i.openBlock(),i.createElementBlock("span",lB,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(i.openBlock(),i.createBlock(l,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(c,{key:1})):i.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(d,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((m=e.value)==null?void 0:m.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",cB,[i.createElementVNode("span",dB,i.toDisplayString(n.value),1),(g=(p=t.delivery)==null?void 0:p.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",uB,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),(b=(y=t.delivery)==null?void 0:y.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",fB," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),mB={class:"flex flex-col gap-2.5"},pB={class:"text-base"},gB=["href"],yB={class:"text-sc-grey"},bB={},Sh=i.defineComponent({...bB,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Fe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Fe.Status)?(c=(l=j.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>{var u;return d.id===(((u=e.order.status)==null?void 0:u.id)??-1)}))==null?void 0:c.name:void 0}),o=i.computed(()=>e.fields.includes(Fe.CreatedAt)),s=i.computed(()=>e.fields.includes(Fe.ClientInfo)||e.fields.includes(Fe.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Fe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",mB,[i.createElementVNode("span",pB,[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,gB)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Lo,{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",yB,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0),t.order.isOnOrder?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[c[2]||(c[2]=i.createTextVNode(" - ",-1)),c[3]||(c[3]=i.createElementVNode("span",{class:"text-yellow-400"},"Под заказ",-1))],64)):i.createCommentVNode("",!0),t.order.isNotInStock?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[c[4]||(c[4]=i.createTextVNode(" - ",-1)),c[5]||(c[5]=i.createElementVNode("span",{class:"text-red-500"},"Нет в наличии",-1))],64)):i.createCommentVNode("",!0)]),s.value?(i.openBlock(),i.createBlock(Er,{key:0,client:s.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ls,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),_B={},Za=i.defineComponent({..._B,__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)}}}),wB={},Yr=i.defineComponent({...wB,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(t){const e=t,n={quantity:"количество",length:"длина"},r=i.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=i.computed(()=>{const s={[j.UserTypeEnum.Manager]:"менеджером",[j.UserTypeEnum.Operator]:"оператором",[j.UserTypeEnum.Client]:"клиентом",[j.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>n[d]??d).join(", ");return`Было изменено${e.userType?` ${s[e.userType]??""}`:""}: ${l}`}const a=e.userType?` ${s[e.userType]??""}`:"";return`${e.prefixText}${a}`.trim()});return(s,a)=>(i.openBlock(),i.createElementBlock("small",{class:i.normalizeClass(`inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white no-underline opacity-100 ${r.value}`)},i.toDisplayString(o.value),3))}}),xB={class:"flex flex-row gap-1.5"},kB={class:"flex-none text-nowrap"},vB={class:"flex flex-1 flex-col gap-2.5"},CB={key:0,class:"text-sm"},SB={class:"text-gray-600"},BB={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},TB={key:0},NB={key:1},$B={},Bh=i.defineComponent({...$B,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",xB,[i.createElementVNode("span",kB,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",vB,[i.createVNode(vr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.marker?(i.openBlock(),i.createElementBlock("span",CB,[n[0]||(n[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",SB,i.toDisplayString(t.product.marker),1)])):i.createCommentVNode("",!0),t.product.creator&&t.product.creator.type?(i.openBlock(),i.createBlock(Yr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",BB,[n[1]||(n[1]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",TB,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",NB,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[2]||(n[2]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(ni,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[3]||(n[3]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(ni,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])]))}}),RB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function EB(t,e){return i.openBlock(),i.createElementBlock("svg",RB,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"},null,-1),i.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 112V72h0a23.93 23.93 0 0 1 24-24h80a23.93 23.93 0 0 1 24 24h0v40m-64 64v224m-72-224l8 224m136-224l-8 224"},null,-1)])])}const PB=i.markRaw({name:"ion-trash-outline",render:EB}),FB={},VB=i.defineComponent({...FB,__name:"order-item-specification",props:{src:{}},setup(t){const e=i.useTemplateRef("image-reference");return(n,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("a",{class:"text-blue-500 hover:underline text-sm mt-1 block cursor-pointer",onClick:r[0]||(r[0]=o=>{var s;return(s=e.value)==null?void 0:s.showPreview()})}," Спецификация "),i.withDirectives(i.createVNode(i.unref(z.NImage),{ref:"image-reference",src:t.src,"previewed-img-props":{style:"max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;"}},null,8,["src"]),[[i.vShow,!1]])],64))}}),MB={class:"flex flex-col gap-0.5"},AB={class:"text-gray-600"},IB={},OB=i.defineComponent({...IB,__name:"order-item-name",props:{item:{}},setup(t){const e=t,n=i.computed(()=>!!e.item.isRemoved||!!e.item.replacementId),r=i.computed(()=>{var l;return"creator"in e.item&&!!((l=e.item.creator)!=null&&l.type)}),o=i.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),s=i.computed(()=>"changedFields"in e.item?e.item.changedFields:[]),a=i.computed(()=>{var l,c;return"replacement"in e.item?(c=(l=e.item.replacement)==null?void 0:l.creator)==null?void 0:c.type:void 0});return(l,c)=>(i.openBlock(),i.createElementBlock("div",MB,[i.createElementVNode("div",{class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(vr,{product:t.item.product,"show-additional-sale-icon":t.item.isAdditionalSale??!1,"show-code":!1,"show-planning-dates":!1},null,8,["product","show-additional-sale-icon"])],2),t.item.marker?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[c[0]||(c[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",AB,i.toDisplayString(t.item.marker),1)],2)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(VB,{src:o.value},null,8,["src"])],2)):i.createCommentVNode("",!0),r.value&&!n.value?(i.openBlock(),i.createBlock(Yr,{key:2,"user-type":t.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):i.createCommentVNode("",!0),t.item.isRemoved&&!t.item.replacementId&&s.value.length===0?(i.openBlock(),i.createBlock(Yr,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):i.createCommentVNode("",!0),t.item.replacementId&&s.value.length>0?(i.openBlock(),i.createBlock(Yr,{key:4,"user-type":a.value,"changed-fields":s.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):i.createCommentVNode("",!0)]))}}),zB={},DB=i.defineComponent({...zB,__name:"order-items-list",props:i.mergeModels({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:["update:selectedRowKeys"],setup(t){const e=t,n=i.useModel(t,"selectedRowKeys"),r=i.computed(()=>D.sortBy(e.products,"ord")),o=m=>!!m.isRemoved||!!m.replacementId,s=(m,p)=>{p?n.value.includes(m)||(n.value=[...n.value,m]):n.value=n.value.filter(g=>g!==m)},a=m=>e.selectable?{class:n.value.includes(m.id)?void 0:"opacity-60"}:{},l=(m,p)=>{const g=r.value,y=m.logicGroupId;if(!y)return 1;const b=g.at(p-1);if(p&&b&&b.logicGroupId===y)return 0;const _=g.slice(p),k=_.findIndex(x=>x.logicGroupId!==y);return k===-1?_.length:k},c=i.ref(it.getDeviceTypeByResolution()),d=i.ref(window.innerWidth),u=()=>{const m=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(g,y)=>i.h("span",{class:`text-base${o(g)?" line-through opacity-50":""}`},[y+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,width:d.value>=1536?156:120,render:g=>i.h("span",{class:`text-base${o(g)?" line-through opacity-50":""}`},[g.product.code])},{title:"Наименование",key:"name",resizable:!0,render:g=>i.h(OB,{item:g})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:l,render:g=>i.h(Ch,{class:o(g)?"line-through opacity-50":"",item:g,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!o(g)})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,width:120,render:g=>i.h("div",{class:o(g)?"line-through opacity-50":""},[i.h(ni,{product:g,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,width:120,render:g=>i.h("div",{class:o(g)?"line-through opacity-50":""},[i.h(ni,{product:g,costFieldName:"cost",showCurrency:!0})])},...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:l,render:g=>o(g)?null:i.h(z.NButton,{quaternary:!0,type:"error",onClick:()=>{var y;(y=e.eventEmitter)==null||y.emit("order-item:delete",{item:g})}},()=>i.h(PB))}]:[]],p=e.selectable?[{key:"checkbox",title:"",className:"align-top",width:"32",cellProps:g=>({class:o(g)?void 0:"cursor-pointer",onClick:()=>{o(g)||s(g.id,!n.value.includes(g.id))}}),render:g=>i.h(z.NCheckbox,{checked:n.value.includes(g.id),disabled:o(g)})}]:[];switch(c.value){case Xe.phone:case Xe.tablet:return[...p,{title:"",key:"items",resizable:!0,render:(g,y)=>i.h(Bh,{product:g,index:y})}];case Xe.laptop:return[...p,...m];default:return[...p,...m]}},h=i.computed(()=>u()),f=()=>{c.value=it.getDeviceTypeByResolution(),d.value=window.innerWidth};return i.onMounted(()=>{f(),window.addEventListener("resize",f)}),i.onUnmounted(()=>{window.removeEventListener("resize",f)}),(m,p)=>{const g=z.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[p[0]||(p[0]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Список позиций",-1)),i.createVNode(g,{columns:h.value,data:r.value,"row-key":y=>y.id,"row-props":a,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Th=An(DB,[["__scopeId","data-v-e1fad754"]]),LB={key:0,class:"text-sc-dark-grey my-2 text-center"},HB={key:1,class:"text-sc-dark-grey my-2"},WB={},Nh=i.defineComponent({...WB,__name:"order-status-history",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref([]),o=l=>{const{uiDateWithTime:c}=j.useBaseConfigStateStore().config.dateFormats;return He.format(l,c)},s=l=>l.statusDetail?`${l.status.name} (${l.statusDetail.name})`:l.status.name,a=(l=!0)=>{l&&(n.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(c=>{r.value=c}).finally(()=>{l&&(n.value=!1)})};return i.watch(()=>e.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(l,c)=>{const d=z.NSpin,u=z.NTimelineItem,h=z.NTimeline;return i.openBlock(),i.createElementBlock("div",null,[c[1]||(c[1]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),n.value?(i.openBlock(),i.createElementBlock("div",LB,[i.createVNode(d,{size:"small",class:"mb-1 align-middle"}),c[0]||(c[0]=i.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(i.openBlock(),i.createElementBlock("div",HB," История статусов отсутствует. ")):(i.openBlock(),i.createBlock(h,{key:2},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(f,m)=>(i.openBlock(),i.createBlock(u,{key:m,type:m===0?"info":"default",title:s(f),time:o(f.createdAt),content:f.user.name},null,8,["type","title","time","content"]))),128))]),_:1}))])}}}),jB={class:"text-base"},qB={},Qa=i.defineComponent({...qB,__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",jB,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))}}),XB={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},YB={class:"col-span-2"},UB={class:"col-span-2"},KB={},$h=i.defineComponent({...KB,__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[11]||(o[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",XB,[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(Qa,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),o[10]||(o[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(Er,{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(vu,{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",YB,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(Za,{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(ls,{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",UB,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(Qa,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0)])]))}}),GB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ZB(t,e){return i.openBlock(),i.createElementBlock("svg",GB,[...e[0]||(e[0]=[i.createElementVNode("rect",{width:"336",height:"336",x:"128",y:"128",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32",rx:"57",ry:"57"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m383.5 128l.5-24a56.16 56.16 0 0 0-56-56H112a64.19 64.19 0 0 0-64 64v216a56.16 56.16 0 0 0 56 56h24"},null,-1)])])}const QB=i.markRaw({name:"ion-copy-outline",render:ZB}),JB={class:"flex flex-col items-start gap-1.5 text-base"},e3=["href"],t3=["href"],n3={key:1,class:"flex items-center gap-2"},i3=["href"],r3={},Rh=i.defineComponent({...r3,__name:"order-external-links",props:{order:{}},setup(t){const e=i.computed(()=>{var r,o;const n=(((r=t.order.invoices)==null?void 0:r.length)??0)>0;return!!t.order.erpOrderUrl||n||!!((o=t.order.payment)!=null&&o.onlinePaymentLink)});return(n,r)=>{var a;const o=QB,s=z.NButton;return e.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[r[0]||(r[0]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Внешние ссылки",-1)),i.createElementVNode("div",JB,[t.order.erpOrderUrl?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.order.erpOrderUrl,target:"_blank"}," Открыть заявку в ERP ",8,e3)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices??[],(l,c)=>(i.openBlock(),i.createElementBlock("a",{key:c,class:"btn btn-primary",href:l}," Скачать счет №"+i.toDisplayString(c+1),9,t3))),128)),(a=t.order.payment)!=null&&a.onlinePaymentLink?(i.openBlock(),i.createElementBlock("div",n3,[i.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank"}," Оплатить заказ ",8,i3),i.withDirectives((i.openBlock(),i.createBlock(s,{text:"",title:"Скопировать ссылку на оплату"},{default:i.withCtx(()=>[i.createVNode(o)]),_:1})),[[i.unref(wl),t.order.payment.onlinePaymentLink]])])):i.createCommentVNode("",!0)])],64)):i.createCommentVNode("",!0)}}}),o3={key:0},s3={class:"text-sc-dark-grey my-2 text-center"},a3={key:1,class:"text-sc-dark-grey my-2 text-center"},l3={key:2},c3={class:"text-sc-dark-grey mt-4 text-right font-bold"},d3={class:"text-sc-primary"},u3={},Eh=i.defineComponent({...u3,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(),a=(d=!0)=>{if("products"in n.order){s.value=new j.Order(n.order);return}d&&(o.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrder(n.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=i.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=i.computed(()=>l.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(d,u)=>{const h=z.NSpin;return o.value?(i.openBlock(),i.createElementBlock("div",o3,[i.createElementVNode("div",s3,[i.createVNode(h,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(i.openBlock(),i.createElementBlock("div",a3," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",l3,[i.createVNode(Th,{products:l.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),i.createElementVNode("div",c3,[u[2]||(u[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",d3,i.toDisplayString(c.value)+" ₽",1)]),i.createVNode($h,{order:s.value,"onClick:clientName":u[0]||(u[0]=f=>r("click:client-name",s.value.client,f))},null,8,["order"]),i.createVNode(Rh,{order:s.value},null,8,["order"]),i.createVNode(Nh,{order:s.value},null,8,["order"])]))}}}),f3={},h3=i.defineComponent({...f3,__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(xr,"small"),r=i.computed(()=>D.isNil(e.orderContextButtonsConfig)?[]:D.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=ms,c=z.NButton,d=z.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)}}}),m3={},p3=i.defineComponent({...m3,__name:"orders-list",props:i.mergeModels({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},stickyHeaderOnMobile:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},isRowSelectable:{type:Function,default:void 0}},{checkedRowKeys:{default:()=>[]},checkedRowKeysModifiers:{}}),emits:i.mergeModels(["click:client-name","dblclick:row","update:pagination","update:sort"],["update:checkedRowKeys"]),setup(t,{emit:e}){const n=t,r=e,o=i.useModel(t,"checkedRowKeys"),s=(R,F)=>{F?o.value.includes(R)||(o.value=[...o.value,R]):o.value=o.value.filter(H=>H!==R)},a=()=>D.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),l=i.ref(a()),c=i.ref([]),d=i.ref(!1),u=i.ref(700),h=()=>{const R=it.getDeviceTypeByResolution(),F=R===Xe.phone||R===Xe.tablet;if(!(!n.stickyHeaderOnMobile&&F))return u.value*(j.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},f=i.ref(h()),m=R=>{const F={onDblclick:()=>r("dblclick:row",R)},H=[];return n.selectable&&o.value.length>0&&!o.value.includes(R.id)&&H.push("opacity-60"),n.useCellIndication&&(R.isOnOrder&&H.push("on-order"),R.isLargeOrder&&H.push("large-order"),R.isNotInStock&&H.push("not-in-stock"),H.push("order-status",R.status.slug),R.delivery.date&&He.isTomorrow(new Date(R.delivery.date))&&H.push("next-day-order")),H.length>0&&(F.class=H.join(" ")),F},p=()=>{const R=[Fe.CreatedAt,Fe.Id,Fe.ClientInfo,Fe.ClientCity,Fe.DeliveryDate,Fe.PaymentType,Fe.SalesDirections,Fe.Status,...n.showAttachedUserColumn?[Fe.AttachedUser]:[],Fe.actions],F=n.fields.length>0?n.fields:R,H={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},Q={type:"expand",expandable:D.constant(!0),renderExpand:P=>i.h(Eh,{order:P,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",P.client,null)}}),width:"30"};let Z=[{title:"Дата заказа",key:Fe.CreatedAt,resizable:!0,width:100,render:P=>i.h(Lo,{date:P.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Fe.Id,resizable:!0,width:75,className:"order-id",render:P=>i.h("a",{href:n.orderUrl.replace(":id",P.id.toString()),class:"text-base"},P.id)},{title:"Дата доставки / самовывоза",key:Fe.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:P=>i.h(Lo,{date:P.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Fe.ClientInfo,resizable:!0,minWidth:320,render:P=>i.h(Er,{client:P.client,"onClick:client-name":()=>{r("click:client-name",P.client,null)}})},{title:"Тип доставки",key:Fe.DeliveryInfo,resizable:!0,minWidth:320,render:P=>i.h(ls,{delivery:P.delivery})},{title:"Клиент",key:Fe.ClientInfoShort,resizable:!0,minWidth:320,render:P=>i.h(Er,{client:P.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",P.client,null)}})},{title:"Город клиента",key:Fe.ClientCity,resizable:!0,minWidth:90,width:120,render:P=>{var V;return i.h("span",{class:"text-base"},((V=P.client)==null?void 0:V.city.name)??"—")}},{title:"Статус",key:Fe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:P=>i.h("span",{class:"text-base"},[P.status.name])},{title:"Тип оплаты",key:Fe.PaymentType,resizable:!0,width:115,minWidth:95,render:P=>P.payment?i.h(Za,{payment:P.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Fe.SalesDirections,resizable:!0,width:70,render:P=>{var V;return i.h("span",{class:"text-base"},[((V=P.salesDirection)==null?void 0:V.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Fe.AttachedUser,resizable:!0,minWidth:120,render:P=>{var V;return i.h("span",{class:"text-base"},[((V=P==null?void 0:P.attachedUser)==null?void 0:V.name)??""])}}]:[]];n.orderContextButtonsConfig&&Z.push({key:"actions",title:"",className:"align-top",width:50,render:P=>i.h(h3,{order:P,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(Z=Z.map(P=>[Fe.Id,Fe.CreatedAt,Fe.DeliveryDate].includes(P.key)?{...P,sorter:!0,sortOrder:!1,...P.width===void 0?{}:{width:P.width+16}}:P));const O=n.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:P=>{var M;const V=((M=n.isRowSelectable)==null?void 0:M.call(n,P))??!0;return{class:V?"cursor-pointer":void 0,onClick:()=>{V&&s(P.id,!o.value.includes(P.id))}}},render:P=>{var V;return((V=n.isRowSelectable)==null?void 0:V.call(n,P))??!0?i.h(z.NCheckbox,{checked:o.value.includes(P.id)}):null}}]:[];switch(it.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[...O,Q,{key:"order",title:"Заказ",resizable:!0,render:P=>i.h(Sh,{order:P,fields:F,orderUrl:n.orderUrl})}];case Xe.laptop:{const P=n.showAttachedUserColumn?F:F.filter(V=>V!==Fe.AttachedUser);return[...O,Q,...P.map(V=>Z.find(M=>M.key===V)??H)]}default:return[H]}},g=i.ref(p()),y=i.ref(new j.TableDataPagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),b=i.computed(()=>({...y.value,prefix({itemCount:R}){return`Всего заказов: ${R}`}})),_=i.ref(null),k=i.ref(null),x=i.ref(null),C=()=>{x.value!==null&&(clearInterval(x.value),x.value=null)},N=()=>{C(),n.refreshInterval&&(x.value=setInterval(()=>{S()},n.refreshInterval))},w=()=>{var R,F;n.filters&&((R=k.value)==null||R.abort(),k.value=null,(F=_.value)==null||F.abort(),_.value=new AbortController,d.value=!0,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,l.value,{page:y.value.page,pageSize:y.value.pageSize},_.value.signal).then(H=>{y.value.itemCount!==H.meta.total&&(y.value.itemCount=H.meta.total),y.value.page!==H.meta.currentPage&&(y.value.page=H.meta.currentPage),y.value.pageCount!==H.meta.lastPage&&(y.value.pageCount=H.meta.lastPage),y.value.pageSize!==H.meta.perPage&&(y.value.pageSize=H.meta.perPage),c.value=H.data,d.value=!1}).catch(H=>{if((H==null?void 0:H.name)!=="CanceledError")throw d.value=!1,H}))},S=()=>{var R;!n.filters||d.value||((R=k.value)==null||R.abort(),k.value=new AbortController,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,l.value,{page:y.value.page,pageSize:y.value.pageSize},k.value.signal).then(F=>{c.value=c.value.map(H=>F.data.find(Z=>Z.id===H.id)??H),y.value.itemCount!==F.meta.total&&(y.value.itemCount=F.meta.total),y.value.pageCount!==F.meta.lastPage&&(y.value.pageCount=F.meta.lastPage)}).catch(F=>{if((F==null?void 0:F.name)!=="CanceledError")throw F}))},v=R=>{y.value.page=R,w(),r("update:pagination",y.value)},$=R=>{y.value.pageSize=R,y.value.page=1,w(),r("update:pagination",y.value)},E=R=>{if(D.isNull(R))l.value=a();else{const[F]=l.value;F.field=R.columnKey.toString(),F.direction=R.order==="ascend"?"asc":"desc",l.value=[F]}g.value.forEach(F=>{if(Object.hasOwn(F,"sortOrder")){const H=F;H.sortOrder=H.key===(R==null?void 0:R.columnKey)&&(R!=null&&R.sorter)&&R.order!==!1?R.order:!1}}),w(),r("update:sort",l.value)},A=()=>{g.value=p(),u.value=window.innerHeight,f.value=h()};return i.watch(()=>n.filters,()=>{y.value.page=1,w(),N()}),i.watch(()=>n.sort,()=>{l.value=a(),y.value.page=1,w(),N()}),i.onMounted(()=>{A(),window.addEventListener("resize",A),i.nextTick(()=>{w(),N()})}),i.onUnmounted(()=>{var R,F;window.removeEventListener("resize",A),(R=_.value)==null||R.abort(),(F=k.value)==null||F.abort(),C()}),(R,F)=>{const H=z.NDataTable;return i.openBlock(),i.createBlock(H,{columns:g.value,data:c.value,"row-key":Q=>Q.id,"row-props":m,"scroll-x":t.tableMinWidth,pagination:b.value,loading:d.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":f.value,"pagination-behavior-on-filter":"first","onUpdate:page":v,"onUpdate:pageSize":$,"onUpdate:sorter":E},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),g3=An(p3,[["__scopeId","data-v-14035b7c"]]),y3=["href"],b3={class:"text-sc-dark-grey"},_3={},w3=i.defineComponent({..._3,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>He.format(n.order.createdAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{D.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},i.toDisplayString(t.order.id),9,y3),i.createTextVNode(" от "+i.toDisplayString(o.value),1)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",b3,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),x3={class:"sc-page flex flex-col bg-inherit"},k3={class:"my-2 flex flex-row items-end"},v3={class:"sc-title grow"},C3={key:0,class:"sc-title-buttons flex-1 grow-0"},S3={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},B3={key:0,class:"sc-title-extra mt-2 sm:mt-4"},T3={},Ph=i.defineComponent({...T3,__name:"page",props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>e.stickyHeaderOnMobile?"sticky z-10 bg-inherit":"lg:sticky z-10 bg-inherit");return(r,o)=>{const s=z.NH1;return i.openBlock(),i.createElementBlock("div",x3,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?n.value:void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",k3,[i.createElementVNode("div",v3,[i.renderSlot(r.$slots,"title",{},()=>[i.createVNode(s,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),r.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",C3,[i.createElementVNode("div",S3,[i.renderSlot(r.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),r.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",B3,[i.renderSlot(r.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(r.$slots,"sticky-extra")],6),i.renderSlot(r.$slots,"default")])}}}),N3={class:"overflow-hidden transition-all duration-300"},$3={class:"text-lg font-medium leading-none"},R3={},Fh=i.defineComponent({...R3,__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 Xe.phone:return window.innerWidth*.8;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?D.isUndefined(n.drawerWidth)?o.value=a():o.value=D.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=z.NDrawerContent,h=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",N3,[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",$3,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)}}}),E3={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},P3={key:0},F3={class:"sc-page-preview-panel grow"},V3={key:1,class:"sc-page-preview-panel-extra flex-none"},M3={},A3=i.defineComponent({...M3,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,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=z.NButton;return i.openBlock(),i.createBlock(Ph,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset,"sticky-header-on-mobile":t.stickyHeaderOnMobile},i.createSlots({default:i.withCtx(()=>[i.createVNode(Fh,{"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",E3,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",P3,[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",F3,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",V3,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),I3={},O3=i.defineComponent({...I3,__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(()=>D.isArray(r.value)),a=i.computed(()=>{var p;return D.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),l=i.computed(()=>{const p=new j.Curator({id:-1,name:"",contacts:{},curatedDirection:new j.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),g=r.showEmptyValue?[p]:[];return r.managerReferenceList.filter(y=>{var b;return(((b=y==null?void 0:y.curatedDirections)==null?void 0:b.length)??0)>0}).forEach(y=>{((y==null?void 0:y.curatedDirections)??[]).forEach(b=>{g.push(new j.Curator({id:y.id,guid:y.guid,name:y.name,photo:y.photo,contacts:y.contacts??{},curatedDirection:b}))})}),g}),c=i.computed(()=>yt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,p=>{const g=D.some(s.value?r.value:[r.value],["id",p.id])?` (${p.curatedDirection.name}) `:"";return p.curatedDirection.isNewRec()?p.name:`${p.name}${g}`})),d=i.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=i.useTemplateRef("select-component"),h=p=>{if(D.isArray(p)){const g=p.length>0?p.map(y=>l.value.find(b=>b.id===y)).filter(y=>!D.isNil(y)):[];o("update:value",g)}else{const g=p>0?l.value.find(y=>y.id===p):null;o("update:value",g??null)}};return i.watch(()=>r.value,()=>{var p,g;(g=(p=u.value)==null?void 0:p.$forceUpdate)==null||g.call(p)},{deep:!0}),e({focus:()=>{var p;return(p=u.value)==null?void 0:p.focusInput()},blur:()=>{var p;return(p=u.value)==null?void 0:p.blurInput()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(z.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"]))}}),z3={},D3=i.defineComponent({...z3,__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},groupByEmployeeType:{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(()=>D.isArray(r.value)),a=i.computed(()=>{var b;return D.isArray(r.value)?r.value.filter(_=>!D.isNil(_)).map(_=>_.id):((b=r.value)==null?void 0:b.id)??null}),l=i.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=i.computed(()=>{var x;const b=[];r.operatorReferenceList.length>0&&b.push({type:"group",label:"Операторы",key:"operators",children:r.operatorReferenceList.map(C=>({label:C.name,value:C.id,item:C}))});let _=r.managerReferenceList;if(r.showActualOnly){const C=D.isArray(r.value)?r.value.map(N=>N.id):[(x=r.value)==null?void 0:x.id];_=_.filter(N=>N.isActive||C.includes(N.id))}const k=yt.convertReferencesToSelectOptionsList(_,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,C=>`${C.name}${C.isActive?"":" [Не активен]"}`);return b.length>0&&k.length>0&&b.push({key:"manager-operator-divider",disabled:!0,render:()=>i.h("div",{class:"sc-manager-operator-select__divider"})}),b.push(...k),b}),d=b=>`${b.name}${"isActive"in b&&!b.isActive?" [Не активен]":""}`,u=i.computed(()=>{var N;const b=D.isArray(r.value)?r.value.map(w=>w.id):[(N=r.value)==null?void 0:N.id],_=w=>r.showActualOnly?w.filter(S=>!("isActive"in S)||S.isActive||b.includes(S.id)):w,k=[],x=_(r.managerReferenceList);x.length>0&&k.push({type:"group",label:"Менеджеры",key:"managers",children:yt.convertReferencesToSelectOptionsList(x,!0,!1,!1,d)});const C=_(r.operatorReferenceList);return C.length>0&&k.push({type:"group",label:"Операторы",key:"operators",children:yt.convertReferencesToSelectOptionsList(C,!0,!1,!1,d)}),k}),h=i.computed(()=>r.groupByEmployeeType?u.value:c.value),f=i.computed(()=>h.value.map(b=>({...b,class:r.wrapContent?`${b.class??""} consistent-menu-width`:b.class}))),m=i.useTemplateRef("select-component"),p=b=>{if(D.isArray(b)){const _=b.map(k=>l.value.find(x=>x.id===k)).filter(k=>!D.isNil(k));o("update:value",_)}else{const _=D.isNil(b)?null:l.value.find(k=>k.id===b)??null;o("update:value",_)}};return i.watch(()=>r.value,()=>{var b,_;(_=(b=m.value)==null?void 0:b.$forceUpdate)==null||_.call(b)},{deep:!0}),e({focus:()=>{var b;return(b=m.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=m.value)==null?void 0:b.blurInput()}}),(b,_)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||h.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:f.value,placeholder:"",class:"w-full","onUpdate:value":p},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),L3={},H3=i.defineComponent({...L3,__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(()=>D.isArray(r.value)),a=i.computed(()=>{var p;return D.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),l=i.computed(()=>r.showEmptyValue?[j.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var y;let p=l.value,g=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=D.isArray(r.value)?r.value.map(_=>_.id):[(y=r.value)==null?void 0:y.id];g=D.union(g,l.value.filter(_=>!_.isActive).map(_=>_.id)),p=p.filter(_=>(r.showEmptyValue?j.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||b.includes(_.id))}return yt.convertReferencesToSelectOptionsList(p,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&D.some(s.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${_}${b.isActive?"":" [Не активен]"}`},b=>g.includes(b.id)&&b.isActive)}),d=i.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=i.useTemplateRef("select-component"),h=p=>{if(D.isArray(p)){const g=p.length>0?p.filter(y=>!D.some(r.disabledManagerReferenceList,["id",y])).map(y=>l.value.find(b=>b.id===y)).filter(y=>!D.isNil(y)):[];o("update:value",g)}else{const g=p>0&&!D.some(r.disabledManagerReferenceList,["id",p])?l.value.find(y=>y.id===p):new j.Manager;o("update:value",g??new j.Manager)}};return i.watch(()=>r.value,()=>{var p,g;(g=(p=u.value)==null?void 0:p.$forceUpdate)==null||g.call(p)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,p=>{if(p.length>0&&r.value)if(s.value){const g=r.value;D.some(g,y=>D.some(p,["id",y.id]))&&o("update:value",g.filter(y=>!D.some(p,["id",y.id])))}else{const g=r.value;D.some(p,["id",g.id])&&o("update:value",new j.Manager)}}),e({focus:()=>{var p;return(p=u.value)==null?void 0:p.focusInput()},blur:()=>{var p;return(p=u.value)==null?void 0:p.blurInput()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(z.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"]))}}),W3={class:"m-0.5 flex flex-col p-0.5"},j3={class:"flex flex-row gap-1"},q3={key:0},X3={key:1},Y3={key:2},U3={key:3},K3={class:"flex flex-row gap-1"},G3={key:0},Z3={key:1},Q3={key:2},J3={key:3},e5={},Vh=i.defineComponent({...e5,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",W3,[i.createElementVNode("span",j3,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",q3,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",X3,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",Y3,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",U3,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",K3,[t.addr.street?(i.openBlock(),i.createElementBlock("span",G3,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",Z3,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",Q3,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",J3,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ja={clearable:!1,value:"",field:void 0,disabled:!1},t5={},n5=i.defineComponent({...t5,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ja,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(g=>({label:g[r.field??"addressString"]??"-",value:g.id})));i.watch(()=>r.value,g=>{s.value=g}),i.watch(s,()=>{o("update:value",s.value)});const d=D.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=(g,y)=>{const b=l.value.find(_=>_.id===g.value)||{};return i.h(Vh,{addr:b,selected:y},{default:D.constant("-")})},f=g=>{d.cancel();const y=l.value.find(b=>b.id===g)||{};o("select",y)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(g,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[y[0]||(y[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"])}}}),i5={class:"m-0.5 flex flex-col p-0.5"},r5={class:"font-medium"},o5={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},s5={key:0},a5={key:1},l5={},Mh=i.defineComponent({...l5,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",i5,[i.createElementVNode("span",r5,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",o5,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",s5," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",a5," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),c5={},d5=i.defineComponent({...c5,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ja,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(g=>({label:g[r.field??"_"]??"-",value:g.id})));i.watch(()=>r.value,g=>{s.value=g}),i.watch(s,()=>{o("update:value",s.value)});const d=D.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=(g,y)=>{const b=l.value.find(_=>_.id===g.value)||{};return i.h(Mh,{bank:b,selected:y},{default:D.constant("-")})},f=g=>{d.cancel();const y=l.value.find(b=>b.id===g)||{};o("select",y)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(g,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[y[0]||(y[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"])}}}),u5={class:"font-medium"},f5={key:0,class:"flex flex-row gap-2"},h5={key:0,class:"text-xs font-light text-blue-800"},m5={key:1,class:"text-sc-dark-grey text-xs font-light"},p5={},Ah=i.defineComponent({...p5,__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",u5,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",f5,[t.org.inn?(i.openBlock(),i.createElementBlock("span",h5,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",m5,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),g5={},y5=i.defineComponent({...g5,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ja,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=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>yt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{s.value=y}),i.watch(s,()=>{o("update:value",s.value)});const u=D.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=(y,b)=>{const _=l.value.find(k=>k.id===y.value)||{};return i.h(Ah,{org:_,selected:b},{default:D.constant("-")})},m=y=>{u.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&o("select",b)},p=i.ref(null);function g(){p.value.focus()}return e({focus:g}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:p,value:s.value,"onUpdate:value":[b[0]||(b[0]=k=>s.value=k),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),b5=i.computed(()=>j.useReferencesStore().deliveryTypeReference??[]),_5=i.computed(()=>j.useReferencesStore().managersList??[]),w5=i.computed(()=>j.useReferencesStore().opfReference??[]),x5=i.computed(()=>j.useReferencesStore().partnerGroupsReference??[]),k5=i.computed(()=>j.useReferencesStore().priceCoefficientsReference??[]),v5=i.computed(()=>j.useReferencesStore().productFilesTypesReference??[]),C5=i.computed(()=>j.useReferencesStore().resourceTypesReference),S5=i.computed(()=>j.useReferencesStore().salesDirectionsReference??[]),B5=i.computed(()=>j.useReferencesStore().warehousesReference??[]),T5=i.computed(()=>j.useReferencesStore().paymentTypeReference??[]),N5=i.computed(()=>j.useReferencesStore().orderStatusReference??[]),$5=i.computed(()=>j.useReferencesStore().orderStatusDetailReference??[]),R5=i.computed(()=>j.useReferencesStore().operatorReference??[]),E5=i.computed(()=>yt.convertReferencesToSelectOptionsList(j.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),P5=i.computed(()=>yt.convertReferencesToSelectOptionsList(j.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),F5=t=>j.HttpRequester.getInstance(j.ReferenceDataProvider).searchCity(t),V5=t=>yt.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()),M5=t=>j.HttpRequester.getInstance(j.ClientDataProvider).searchClient(t),A5=t=>yt.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.CommonValidators=Uh,X.ConfiguratorSettingsKozyrek=eu,X.ConfiguratorSettingsMosquito=bw,X.ContentHelper=yi,X.DateValidators=Kh,X.EntityNameHelper=ti,X.FileHelper=Yh,X.KozyrekLine=Tn,X.KozyrekTailTemplate=ha,X.KozyrekTemplate=ar,X.NumericValidators=ae,X.OrdersTableFields=Fe,X.Point=fa,X.ScAddProductToCartDialog=u_,X.ScAddressSuggestion=n5,X.ScAddressSuggestionLabel=Vh,X.ScBankSuggestion=d5,X.ScBankSuggestionLabel=Mh,X.ScBaseDialog=ku,X.ScButtonWithConfirmAction=Zh,X.ScCategoryCollapse=wu,X.ScClientNameWithShortInfo=Er,X.ScCollapse=_u,X.ScCollapseItem=Bl,X.ScCommentEditor=Tx,X.ScConfiguratorsProductInfo=Cr,X.ScContragentWithShortInfo=vu,X.ScCreatorUserTypeTag=Yr,X.ScCuratorSelect=O3,X.ScDateRange=tx,X.ScDateTimeLabel=Lo,X.ScDebouncedInput=zx,X.ScDebouncedInputNumber=Lx,X.ScDebt=ox,X.ScDialogHeader=ux,X.ScDynamicConfigurator=gu,X.ScEmail=T_,X.ScExternalLink=Zx,X.ScImageGallery=El,X.ScInlineEditableItem=Fu,X.ScInlineView=pa,X.ScKozyrekConfigurator=tu,X.ScKozyrekConfiguratorParamsForm=Fl,X.ScKozyrekConfiguratorPreview=Jd,X.ScKozyrekConfiguratorTemplates=Qd,X.ScLightGallery=Rl,X.ScManagerOperatorSelect=D3,X.ScManagerSelect=H3,X.ScMetalForDoorsConfigurator=du,X.ScMetalForDoorsConfiguratorForm=cu,X.ScMosquitoConfigurator=ru,X.ScMosquitoConfiguratorForm=nu,X.ScMosquitoConfiguratorMeasurementInstructions=iu,X.ScMosquitoConfiguratorPreview=ma,X.ScOrderCommonInfo=Sh,X.ScOrderDeliveryLabel=ls,X.ScOrderDetails=$h,X.ScOrderExternalLinks=Rh,X.ScOrderInfo=Eh,X.ScOrderItemParams=Ch,X.ScOrderItemsList=Th,X.ScOrderPayment=Za,X.ScOrderProductInfo=Bh,X.ScOrderStatusHistory=Nh,X.ScOrdersList=g3,X.ScOrgSuggestion=y5,X.ScOrgSuggestionLabel=Ah,X.ScPage=Ph,X.ScPageWithSlidingPanel=A3,X.ScPersonContactsBlock=yw,X.ScPhone=Z_,X.ScPhoneInput=jx,X.ScProductName=vr,X.ScProductsList=SS,X.ScReferenceSelect=xu,X.ScSandwichConfigurator=hu,X.ScSandwichConfiguratorForm=fu,X.ScSandwichM2Configurator=pu,X.ScSandwichM2ConfiguratorForm=mu,X.ScSearchableProductSelect=vh,X.ScSearchableReferenceSelect=kh,X.ScSetClientPriceFormItem=r_,X.ScShortTextOrderInfo=w3,X.ScSingleFileUploadSelector=Px,X.ScSlidingContentWithDrawer=Fh,X.ScStripConfigurator=lu,X.ScStripConfiguratorForm=su,X.ScStripConfiguratorLineItem=ou,X.ScStripConfiguratorPreview=au,X.ScUserShortInfo=Qa,X.ScWarningIcon=Ix,X.SelectOptionHelper=yt,X.UiNotificationProvider=_r,X.Validators=We,X.WindowResolutionEnum=Xe,X.WindowResolutionProvider=it,X.channelPrimaryInterestOptionsList=E5,X.componentSizeInjectionKey=xr,X.copyToClipboard=_l,X.deliveryTypeReferenceList=b5,X.handleFloatInput=eo,X.handleIntegerInput=st,X.isCanSandwichM2Show=_w,X.isCanSandwichShow=bu,X.isConfiguratorType=yu,X.managersReferenceList=_5,X.naiveUiTheme=Im,X.operatorReferenceList=R5,X.opfReferenceList=w5,X.orderStatusDetailReferenceList=$5,X.orderStatusReferenceList=N5,X.parse=lt,X.partnerGroupReferenceList=x5,X.paymentTypeReferenceList=T5,X.priceCoefficientsReferenceList=k5,X.productFilesTypesReferenceList=v5,X.renderConfig=qe,X.resetInputValidation=nt,X.resourceReferencesList=C5,X.salesDirectionsReferenceList=S5,X.searchCityReferenceDataHandler=F5,X.searchCityReferenceLabelRenderer=V5,X.searchClientReferenceDataHandler=M5,X.searchClientReferenceLabelRenderer=A5,X.selectAllTextOnFocus=Le,X.sourcePrimaryInterestOptionsList=P5,X.vCopy=wl,X.vFocusNext=ei,X.warehousesReferenceList=B5,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[yh({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function as(t){return t.type==="group"}function xh(t){return t.type==="ignored"}function Ga(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function dS(t,e){return{getIsGroup:as,getIgnored:xh,getKey(r){return as(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function uS(t,e,n,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(as(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(xh(l))continue;e(n,l)&&a.push(l)}return a}return o(t)}function fS(t,e,n){const r=new Map;return t.forEach(o=>{as(o)?o[n].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var hS={};const mS=Object.assign(Object.assign({},Bt.props),{to:Wn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),pS=i.defineComponent({name:"Select",props:mS,slots:Object,setup(t){hS.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ui("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ui("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:o}=Fi(t),s=Bt("Select","-select",cS,lS,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=Ca(l,a),d=i.ref(!1),u=i.ref(""),h=Yu(t,["items","options"]),f=i.ref([]),m=i.ref([]),p=i.computed(()=>m.value.concat(f.value).concat(h.value)),g=i.computed(()=>{const{filter:I}=t;if(I)return I;const{labelField:J,valueField:se}=t;return(he,pe)=>{if(!pe)return!1;const xe=pe[J];if(typeof xe=="string")return Ga(he,xe);const Se=pe[se];return typeof Se=="string"?Ga(he,Se):typeof Se=="number"?Ga(he,String(Se)):!1}}),y=i.computed(()=>{if(t.remote)return h.value;{const{value:I}=p,{value:J}=u;return!J.length||!t.filterable?I:uS(I,g.value,J,t.childrenField)}}),b=i.computed(()=>{const{valueField:I,childrenField:J}=t,se=dS(I,J);return Lk(y.value,se)}),_=i.computed(()=>fS(p.value,t.valueField,t.childrenField)),k=i.ref(!1),x=Ca(i.toRef(t,"show"),k),C=i.ref(null),N=i.ref(null),w=i.ref(null),{localeRef:S}=nh("Select"),v=i.computed(()=>{var I;return(I=t.placeholder)!==null&&I!==void 0?I:S.value.placeholder}),$=[],E=i.ref(new Map),A=i.computed(()=>{const{fallbackOption:I}=t;if(I===void 0){const{labelField:J,valueField:se}=t;return he=>({[J]:String(he),[se]:he})}return I===!1?!1:J=>Object.assign(I(J),{value:J})});function R(I){const J=t.remote,{value:se}=E,{value:he}=_,{value:pe}=A,xe=[];return I.forEach(Se=>{if(he.has(Se))xe.push(he.get(Se));else if(J&&se.has(Se))xe.push(se.get(Se));else if(pe){const Te=pe(Se);Te&&xe.push(Te)}}),xe}const F=i.computed(()=>{if(t.multiple){const{value:I}=c;return Array.isArray(I)?R(I):[]}return null}),H=i.computed(()=>{const{value:I}=c;return!t.multiple&&!Array.isArray(I)?I===null?null:R([I])[0]||null:null}),Q=w2(t),{mergedSizeRef:Z,mergedDisabledRef:O,mergedStatusRef:P}=Q;function V(I,J){const{onChange:se,"onUpdate:value":he,onUpdateValue:pe}=t,{nTriggerFormChange:xe,nTriggerFormInput:Se}=Q;se&&St(se,I,J),pe&&St(pe,I,J),he&&St(he,I,J),a.value=I,xe(),Se()}function M(I){const{onBlur:J}=t,{nTriggerFormBlur:se}=Q;J&&St(J,I),se()}function L(){const{onClear:I}=t;I&&St(I)}function Y(I){const{onFocus:J,showOnFocus:se}=t,{nTriggerFormFocus:he}=Q;J&&St(J,I),he(),se&&K()}function U(I){const{onSearch:J}=t;J&&St(J,I)}function G(I){const{onScroll:J}=t;J&&St(J,I)}function q(){var I;const{remote:J,multiple:se}=t;if(J){const{value:he}=E;if(se){const{valueField:pe}=t;(I=F.value)===null||I===void 0||I.forEach(xe=>{he.set(xe[pe],xe)})}else{const pe=H.value;pe&&he.set(pe[t.valueField],pe)}}}function W(I){const{onUpdateShow:J,"onUpdate:show":se}=t;J&&St(J,I),se&&St(se,I),k.value=I}function K(){O.value||(W(!0),k.value=!0,t.filterable&&mi())}function ue(){W(!1)}function ye(){u.value="",m.value=$}const ve=i.ref(!1);function ot(){t.filterable&&(ve.value=!0)}function _e(){t.filterable&&(ve.value=!1,x.value||ye())}function we(){O.value||(x.value?t.filterable?mi():ue():K())}function wt(I){var J,se;!((se=(J=w.value)===null||J===void 0?void 0:J.selfRef)===null||se===void 0)&&se.contains(I.relatedTarget)||(d.value=!1,M(I),ue())}function $e(I){Y(I),d.value=!0}function Gt(){d.value=!0}function pn(I){var J;!((J=C.value)===null||J===void 0)&&J.$el.contains(I.relatedTarget)||(d.value=!1,M(I),ue())}function Rt(){var I;(I=C.value)===null||I===void 0||I.focus(),ue()}function Qn(I){var J;x.value&&(!((J=C.value)===null||J===void 0)&&J.$el.contains(Fr(I))||ue())}function gn(I){if(!Array.isArray(I))return[];if(A.value)return Array.from(I);{const{remote:J}=t,{value:se}=_;if(J){const{value:he}=E;return I.filter(pe=>se.has(pe)||he.has(pe))}else return I.filter(he=>se.has(he))}}function sn(I){Ve(I.rawNode)}function Ve(I){if(O.value)return;const{tag:J,remote:se,clearFilterAfterSelect:he,valueField:pe}=t;if(J&&!se){const{value:xe}=m,Se=xe[0]||null;if(Se){const Te=f.value;Te.length?Te.push(Se):f.value=[Se],m.value=$}}if(se&&E.value.set(I[pe],I),t.multiple){const xe=gn(c.value),Se=xe.findIndex(Te=>Te===I[pe]);if(~Se){if(xe.splice(Se,1),J&&!se){const Te=te(I[pe]);~Te&&(f.value.splice(Te,1),he&&(u.value=""))}}else xe.push(I[pe]),he&&(u.value="");V(xe,R(xe))}else{if(J&&!se){const xe=te(I[pe]);~xe?f.value=[f.value[xe]]:f.value=$}mr(),ue(),V(I[pe],I)}}function te(I){return f.value.findIndex(se=>se[t.valueField]===I)}function le(I){x.value||K();const{value:J}=I.target;u.value=J;const{tag:se,remote:he}=t;if(U(J),se&&!he){if(!J){m.value=$;return}const{onCreate:pe}=t,xe=pe?pe(J):{[t.labelField]:J,[t.valueField]:J},{valueField:Se,labelField:Te}=t;h.value.some(Je=>Je[Se]===xe[Se]||Je[Te]===xe[Te])||f.value.some(Je=>Je[Se]===xe[Se]||Je[Te]===xe[Te])?m.value=$:m.value=[xe]}}function De(I){I.stopPropagation();const{multiple:J}=t;!J&&t.filterable&&ue(),L(),J?V([],[]):V(null,null)}function hi(I){!Pr(I,"action")&&!Pr(I,"empty")&&!Pr(I,"header")&&I.preventDefault()}function at(I){G(I)}function Zt(I){var J,se,he,pe,xe;if(!t.keyboard){I.preventDefault();return}switch(I.key){case" ":if(t.filterable)break;I.preventDefault();case"Enter":if(!(!((J=C.value)===null||J===void 0)&&J.isComposing)){if(x.value){const Se=(se=w.value)===null||se===void 0?void 0:se.getPendingTmNode();Se?sn(Se):t.filterable||(ue(),mr())}else if(K(),t.tag&&ve.value){const Se=m.value[0];if(Se){const Te=Se[t.valueField],{value:Je}=c;t.multiple&&Array.isArray(Je)&&Je.includes(Te)||Ve(Se)}}}I.preventDefault();break;case"ArrowUp":if(I.preventDefault(),t.loading)return;x.value&&((he=w.value)===null||he===void 0||he.prev());break;case"ArrowDown":if(I.preventDefault(),t.loading)return;x.value?(pe=w.value)===null||pe===void 0||pe.next():K();break;case"Escape":x.value&&(g2(I),ue()),(xe=C.value)===null||xe===void 0||xe.focus();break}}function mr(){var I;(I=C.value)===null||I===void 0||I.focus()}function mi(){var I;(I=C.value)===null||I===void 0||I.focusInput()}function zi(){var I;x.value&&((I=N.value)===null||I===void 0||I.syncPosition())}q(),i.watch(i.toRef(t,"options"),q);const pr={focus:()=>{var I;(I=C.value)===null||I===void 0||I.focus()},focusInput:()=>{var I;(I=C.value)===null||I===void 0||I.focusInput()},blur:()=>{var I;(I=C.value)===null||I===void 0||I.blur()},blurInput:()=>{var I;(I=C.value)===null||I===void 0||I.blurInput()}},yn=i.computed(()=>{const{self:{menuBoxShadow:I}}=s.value;return{"--n-menu-box-shadow":I}}),Jn=o?Vi("select",void 0,yn,t):void 0;return Object.assign(Object.assign({},pr),{mergedStatus:P,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:Uo(),triggerRef:C,menuRef:w,pattern:u,uncontrolledShow:k,mergedShow:x,adjustedTo:Wn(t),uncontrolledValue:a,mergedValue:c,followerRef:N,localizedPlaceholder:v,selectedOption:H,selectedOptions:F,mergedSize:Z,mergedDisabled:O,focused:d,activeWithoutMenuOpen:ve,inlineThemeDisabled:o,onTriggerInputFocus:ot,onTriggerInputBlur:_e,handleTriggerOrMenuResize:zi,handleMenuFocus:Gt,handleMenuBlur:pn,handleMenuTabOut:Rt,handleTriggerClick:we,handleToggle:sn,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:wt,handleTriggerFocus:$e,handleKeydown:Zt,handleMenuAfterLeave:ye,handleMenuClickOutside:Qn,handleMenuScroll:at,handleMenuKeydown:Zt,handleMenuMousedown:hi,mergedTheme:s,cssVars:o?void 0:yn,themeClass:Jn==null?void 0:Jn.themeClass,onRender:Jn==null?void 0:Jn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(Zu,null,{default:()=>[i.h(Qu,null,{default:()=>i.h(sS,{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(mf,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Wn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(MC,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],[Yo,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Yo,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),gS={},kh=i.defineComponent({...gS,__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(()=>D.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(k=>{if(D.isEmpty(k))return;const x=s.value?r.value:r.value?[r.value]:[],C=k.filter(N=>!x.some(w=>w.id===N.id));l.value=r.optionsListConverter([...x,...C])}).finally(()=>{d.value=!1}))};let f="";const m=D.debounce(()=>h(f),800),p=_=>{f=_,m()},g=_=>{var k;if(D.isArray(_)){const x=_.length>0?_.map(C=>{var N;return i.toRaw((N=l.value.find(w=>w.value===C))==null?void 0:N.item)}):[];o("update:value",x)}else if(_>0){const x=i.toRaw((k=l.value.find(C=>C.value===_))==null?void 0:k.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()}}),(_,k)=>(i.openBlock(),i.createBlock(i.unref(pS),{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:p,"onUpdate:value":g},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),yS={},vh=i.defineComponent({...yS,__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"?yt.convertReferencesToSelectOptionsList(h,!0,!1,!1,f=>f!=null&&f.isNewRec()?"-":f.name):r.searchType==="products"?yt.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 m=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},m.code),i.h("span",{},[m.name])])}if(r.searchType==="categories"){const m=h.item;return i.h("div",{},[m.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(kh,{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]=m=>o("update:value",m))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),bS={class:"col-span-2 flex flex-row gap-2.5"},_S={class:"flex-1"},wS={class:"text-sc-grey"},xS={class:"ml-2.5"},kS={key:0,class:"flex-none"},vS={},CS=i.defineComponent({...vS,__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)),...(D.isArray(h)?h:[h]).filter(f=>!a.value.some(m=>m.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 m=z.NListItem,p=Jx,g=z.NButton,y=z.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(vh,{value:o.value,"onUpdate:value":[f[0]||(f[0]=b=>o.value=b),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(m,{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,b=>(i.openBlock(),i.createBlock(m,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(g,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(b)},{default:i.withCtx(()=>[i.createVNode(p)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",bS,[i.createElementVNode("span",_S,[i.createElementVNode("span",wS,i.toDisplayString(b.code),1),i.createElementVNode("span",xS,i.toDisplayString(b.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",kS,[i.renderSlot(h.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),SS={class:"flex flex-col"},BS={class:"flex flex-col gap-1.5 text-base text-nowrap"},TS={class:"font-medium"},NS={class:"flex flex-col text-sc-dark-grey"},$S={key:0},RS={class:"font-medium"},ES={class:"font-medium"},PS={class:"font-medium"},FS={class:"font-medium"},VS={class:"font-medium"},MS={class:"font-medium"},AS={class:"font-medium"},IS={class:"font-medium"},OS={class:"font-medium"},zS={class:"font-medium"},DS={class:"flex flex-col gap-1.5 text-base text-nowrap"},LS={class:"font-medium"},HS={class:"flex flex-col text-sc-dark-grey"},WS={class:"font-medium"},jS={class:"font-medium"},qS={class:"flex flex-col gap-1.5 text-base text-nowrap"},XS={class:"font-medium"},YS={class:"text-sc-dark-grey"},US={class:"font-medium"},KS={key:1,class:"text-base font-medium text-nowrap"},GS={},Ch=i.defineComponent({...GS,__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,m;return((f=n.item.product.unit)==null?void 0:f.isLinear)&&((m=n.item.product.properties)==null?void 0:m.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 m;f!==null&&(c.value.quantity=f,(m=n.eventEmitter)==null||m.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,m)=>{const p=z.NInputNumber;return i.openBlock(),i.createElementBlock("div",SS,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",BS,[i.createElementVNode("span",null,[m[1]||(m[1]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",TS,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",NS,[t.item.configurator===i.unref(j.ConfiguratorsEnum).Kozyrek?(i.openBlock(),i.createElementBlock("span",$S,[m[2]||(m[2]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",RS,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,[m[3]||(m[3]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",ES,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[m[4]||(m[4]=i.createTextVNode(" Высота: ",-1)),i.createElementVNode("span",PS,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,(g,y)=>(i.openBlock(),i.createElementBlock("span",{key:y},[i.createTextVNode(" Полоса №"+i.toDisplayString(Number(y)+1)+": ",1),i.createElementVNode("span",FS,i.toDisplayString(g)+" мм.",1)]))),128)),i.createElementVNode("span",null,[m[5]||(m[5]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",VS,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,[m[6]||(m[6]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",MS,i.toDisplayString(t.item.width)+" мм.",1)]),i.createElementVNode("span",null,[m[7]||(m[7]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",AS,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??[],(g,y)=>(i.openBlock(),i.createElementBlock("span",{key:y},[i.createTextVNode(" Изделие №"+i.toDisplayString(Number(y)+1)+": ",1),i.createElementVNode("span",IS,i.toDisplayString(g.width)+"×"+i.toDisplayString(g.length)+" мм, "+i.toDisplayString(g.count)+" шт.",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,[m[8]||(m[8]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",OS,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[m[9]||(m[9]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",zS,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",DS,[i.createElementVNode("span",null,[m[10]||(m[10]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",LS,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",HS,[i.createElementVNode("span",null,[m[11]||(m[11]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",WS,i.toDisplayString(s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)]),i.createElementVNode("span",null,[m[12]||(m[12]=i.createTextVNode(" Всего: ",-1)),i.createElementVNode("span",jS,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",qS,[i.createElementVNode("span",null,[m[13]||(m[13]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",XS,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("span",YS,[m[14]||(m[14]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",US,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(p,{key:0,value:c.value.quantity,parse:i.unref(lt),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:m[0]||(m[0]=g=>i.unref(eo)(g,".",!1)),onFocus:i.unref(Le),"onUpdate:value":d},{suffix:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.item.product.unit.name),1)]),_:1},8,["value","parse","min","step","show-button","disabled","loading","onFocus"])):(i.openBlock(),i.createElementBlock("span",KS,i.toDisplayString(t.item.quantity)+" "+i.toDisplayString(t.item.product.unit.name),1))],64))])}}}),ZS={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function QS(t,e){return i.openBlock(),i.createElementBlock("svg",ZS,[...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 JS=i.markRaw({name:"tabler-truck-filled",render:QS}),eB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function tB(t,e){return i.openBlock(),i.createElementBlock("svg",eB,[...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 nB=i.markRaw({name:"tabler-truck-delivery",render:tB}),iB={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function rB(t,e){return i.openBlock(),i.createElementBlock("svg",iB,[...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 oB=i.markRaw({name:"tabler-truck-loading",render:rB}),sB={class:"flex flex-col gap-1"},aB={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},lB={key:1,class:"text-base"},cB={class:"text-sc-dark-grey mr-1.5"},dB={key:0},uB={key:1},fB={},ls=i.defineComponent({...fB,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=j.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(a=>a.id===o.delivery.type)}),n=i.computed(()=>He.format(o.delivery.date,"dd.MM.yyyy")),r=i.computed(()=>{var s;return(s=o.delivery.address)!=null&&s.address?ti.getFormatEntityName({name:o.delivery.address.address,deletedAt:o.delivery.address.deletedAt}):""}),o=t;return(s,a)=>{var u,h,f,m,p,g,y,b;const l=oB,c=nB,d=JS;return i.openBlock(),i.createElementBlock("div",sB,[t.showType?(i.openBlock(),i.createElementBlock("span",aB,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(i.openBlock(),i.createBlock(l,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(c,{key:1})):i.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(d,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((m=e.value)==null?void 0:m.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",lB,[i.createElementVNode("span",cB,i.toDisplayString(n.value),1),(g=(p=t.delivery)==null?void 0:p.address)!=null&&g.address?(i.openBlock(),i.createElementBlock("span",dB,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),(b=(y=t.delivery)==null?void 0:y.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",uB," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),hB={class:"flex flex-col gap-2.5"},mB={class:"text-base"},pB=["href"],gB={class:"text-sc-grey"},yB={},Sh=i.defineComponent({...yB,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Fe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Fe.Status)?(c=(l=j.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>{var u;return d.id===(((u=e.order.status)==null?void 0:u.id)??-1)}))==null?void 0:c.name:void 0}),o=i.computed(()=>e.fields.includes(Fe.CreatedAt)),s=i.computed(()=>e.fields.includes(Fe.ClientInfo)||e.fields.includes(Fe.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Fe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",hB,[i.createElementVNode("span",mB,[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,pB)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(Lo,{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",gB,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0),t.order.isOnOrder?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[c[2]||(c[2]=i.createTextVNode(" - ",-1)),c[3]||(c[3]=i.createElementVNode("span",{class:"text-yellow-400"},"Под заказ",-1))],64)):i.createCommentVNode("",!0),t.order.isNotInStock?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[c[4]||(c[4]=i.createTextVNode(" - ",-1)),c[5]||(c[5]=i.createElementVNode("span",{class:"text-red-500"},"Нет в наличии",-1))],64)):i.createCommentVNode("",!0)]),s.value?(i.openBlock(),i.createBlock(Er,{key:0,client:s.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(ls,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),bB={},Za=i.defineComponent({...bB,__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)}}}),_B={},Yr=i.defineComponent({..._B,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(t){const e=t,n={quantity:"количество",length:"длина"},r=i.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=i.computed(()=>{const s={[j.UserTypeEnum.Manager]:"менеджером",[j.UserTypeEnum.Operator]:"оператором",[j.UserTypeEnum.Client]:"клиентом",[j.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>n[d]??d).join(", ");return`Было изменено${e.userType?` ${s[e.userType]??""}`:""}: ${l}`}const a=e.userType?` ${s[e.userType]??""}`:"";return`${e.prefixText}${a}`.trim()});return(s,a)=>(i.openBlock(),i.createElementBlock("small",{class:i.normalizeClass(`inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white no-underline opacity-100 ${r.value}`)},i.toDisplayString(o.value),3))}}),wB={class:"flex flex-row gap-1.5"},xB={class:"flex-none text-nowrap"},kB={class:"flex flex-1 flex-col gap-2.5"},vB={key:0,class:"text-sm"},CB={class:"text-gray-600"},SB={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},BB={key:0},TB={key:1},NB={},Bh=i.defineComponent({...NB,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",wB,[i.createElementVNode("span",xB,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",kB,[i.createVNode(vr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.marker?(i.openBlock(),i.createElementBlock("span",vB,[n[0]||(n[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",CB,i.toDisplayString(t.product.marker),1)])):i.createCommentVNode("",!0),t.product.creator&&t.product.creator.type?(i.openBlock(),i.createBlock(Yr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",SB,[n[1]||(n[1]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",BB,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",TB,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[2]||(n[2]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(ni,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[3]||(n[3]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(ni,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])]))}}),$B={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function RB(t,e){return i.openBlock(),i.createElementBlock("svg",$B,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"},null,-1),i.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 112V72h0a23.93 23.93 0 0 1 24-24h80a23.93 23.93 0 0 1 24 24h0v40m-64 64v224m-72-224l8 224m136-224l-8 224"},null,-1)])])}const EB=i.markRaw({name:"ion-trash-outline",render:RB}),PB={},FB=i.defineComponent({...PB,__name:"order-item-specification",props:{src:{}},setup(t){const e=i.useTemplateRef("image-reference");return(n,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("a",{class:"text-blue-500 hover:underline text-sm mt-1 block cursor-pointer",onClick:r[0]||(r[0]=o=>{var s;return(s=e.value)==null?void 0:s.showPreview()})}," Спецификация "),i.withDirectives(i.createVNode(i.unref(z.NImage),{ref:"image-reference",src:t.src,"previewed-img-props":{style:"max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;"}},null,8,["src"]),[[i.vShow,!1]])],64))}}),VB={class:"flex flex-col gap-0.5"},MB={class:"text-gray-600"},AB={},IB=i.defineComponent({...AB,__name:"order-item-name",props:{item:{}},setup(t){const e=t,n=i.computed(()=>!!e.item.isRemoved||!!e.item.replacementId),r=i.computed(()=>{var l;return"creator"in e.item&&!!((l=e.item.creator)!=null&&l.type)}),o=i.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),s=i.computed(()=>"changedFields"in e.item?e.item.changedFields:[]),a=i.computed(()=>{var l,c;return"replacement"in e.item?(c=(l=e.item.replacement)==null?void 0:l.creator)==null?void 0:c.type:void 0});return(l,c)=>(i.openBlock(),i.createElementBlock("div",VB,[i.createElementVNode("div",{class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(vr,{product:t.item.product,"show-additional-sale-icon":t.item.isAdditionalSale??!1,"show-code":!1,"show-planning-dates":!1},null,8,["product","show-additional-sale-icon"])],2),t.item.marker?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[c[0]||(c[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",MB,i.toDisplayString(t.item.marker),1)],2)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(FB,{src:o.value},null,8,["src"])],2)):i.createCommentVNode("",!0),r.value&&!n.value?(i.openBlock(),i.createBlock(Yr,{key:2,"user-type":t.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):i.createCommentVNode("",!0),t.item.isRemoved&&!t.item.replacementId&&s.value.length===0?(i.openBlock(),i.createBlock(Yr,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):i.createCommentVNode("",!0),t.item.replacementId&&s.value.length>0?(i.openBlock(),i.createBlock(Yr,{key:4,"user-type":a.value,"changed-fields":s.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):i.createCommentVNode("",!0)]))}}),OB={},zB=i.defineComponent({...OB,__name:"order-items-list",props:i.mergeModels({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:["update:selectedRowKeys"],setup(t){const e=t,n=i.useModel(t,"selectedRowKeys"),r=i.computed(()=>D.sortBy(e.products,"ord")),o=m=>!!m.isRemoved||!!m.replacementId,s=(m,p)=>{p?n.value.includes(m)||(n.value=[...n.value,m]):n.value=n.value.filter(g=>g!==m)},a=m=>e.selectable?{class:n.value.includes(m.id)?void 0:"opacity-60"}:{},l=(m,p)=>{const g=r.value,y=m.logicGroupId;if(!y)return 1;const b=g.at(p-1);if(p&&b&&b.logicGroupId===y)return 0;const _=g.slice(p),k=_.findIndex(x=>x.logicGroupId!==y);return k===-1?_.length:k},c=i.ref(et.getDeviceTypeByResolution()),d=i.ref(window.innerWidth),u=()=>{const m=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(g,y)=>i.h("span",{class:`text-base${o(g)?" line-through opacity-50":""}`},[y+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,width:d.value>=1536?156:120,render:g=>i.h("span",{class:`text-base${o(g)?" line-through opacity-50":""}`},[g.product.code])},{title:"Наименование",key:"name",resizable:!0,render:g=>i.h(IB,{item:g})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:l,render:g=>i.h(Ch,{class:o(g)?"line-through opacity-50":"",item:g,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!o(g)})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,width:120,render:g=>i.h("div",{class:o(g)?"line-through opacity-50":""},[i.h(ni,{product:g,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,width:120,render:g=>i.h("div",{class:o(g)?"line-through opacity-50":""},[i.h(ni,{product:g,costFieldName:"cost",showCurrency:!0})])},...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:l,render:g=>o(g)?null:i.h(z.NButton,{quaternary:!0,type:"error",onClick:()=>{var y;(y=e.eventEmitter)==null||y.emit("order-item:delete",{item:g})}},()=>i.h(EB))}]:[]],p=e.selectable?[{key:"checkbox",title:"",className:"align-top",width:"32",cellProps:g=>({class:o(g)?void 0:"cursor-pointer",onClick:()=>{o(g)||s(g.id,!n.value.includes(g.id))}}),render:g=>i.h(z.NCheckbox,{checked:n.value.includes(g.id),disabled:o(g)})}]:[];switch(c.value){case Xe.phone:case Xe.tablet:return[...p,{title:"",key:"items",resizable:!0,render:(g,y)=>i.h(Bh,{product:g,index:y})}];case Xe.laptop:return[...p,...m];default:return[...p,...m]}},h=i.computed(()=>u()),f=()=>{c.value=et.getDeviceTypeByResolution(),d.value=window.innerWidth};return i.onMounted(()=>{f(),window.addEventListener("resize",f)}),i.onUnmounted(()=>{window.removeEventListener("resize",f)}),(m,p)=>{const g=z.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[p[0]||(p[0]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Список позиций",-1)),i.createVNode(g,{columns:h.value,data:r.value,"row-key":y=>y.id,"row-props":a,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Th=An(zB,[["__scopeId","data-v-e1fad754"]]),DB={key:0,class:"text-sc-dark-grey my-2 text-center"},LB={key:1,class:"text-sc-dark-grey my-2"},HB={},Nh=i.defineComponent({...HB,__name:"order-status-history",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref([]),o=l=>{const{uiDateWithTime:c}=j.useBaseConfigStateStore().config.dateFormats;return He.format(l,c)},s=l=>l.statusDetail?`${l.status.name} (${l.statusDetail.name})`:l.status.name,a=(l=!0)=>{l&&(n.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(c=>{r.value=c}).finally(()=>{l&&(n.value=!1)})};return i.watch(()=>e.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(l,c)=>{const d=z.NSpin,u=z.NTimelineItem,h=z.NTimeline;return i.openBlock(),i.createElementBlock("div",null,[c[1]||(c[1]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),n.value?(i.openBlock(),i.createElementBlock("div",DB,[i.createVNode(d,{size:"small",class:"mb-1 align-middle"}),c[0]||(c[0]=i.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(i.openBlock(),i.createElementBlock("div",LB," История статусов отсутствует. ")):(i.openBlock(),i.createBlock(h,{key:2},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(f,m)=>(i.openBlock(),i.createBlock(u,{key:m,type:m===0?"info":"default",title:s(f),time:o(f.createdAt),content:f.user.name},null,8,["type","title","time","content"]))),128))]),_:1}))])}}}),WB={class:"text-base"},jB={},Qa=i.defineComponent({...jB,__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",WB,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))}}),qB={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},XB={class:"col-span-2"},YB={class:"col-span-2"},UB={},$h=i.defineComponent({...UB,__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[11]||(o[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",qB,[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(Qa,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),o[10]||(o[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(Er,{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(vu,{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",XB,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(Za,{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(ls,{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",YB,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(Qa,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0)])]))}}),KB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function GB(t,e){return i.openBlock(),i.createElementBlock("svg",KB,[...e[0]||(e[0]=[i.createElementVNode("rect",{width:"336",height:"336",x:"128",y:"128",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32",rx:"57",ry:"57"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m383.5 128l.5-24a56.16 56.16 0 0 0-56-56H112a64.19 64.19 0 0 0-64 64v216a56.16 56.16 0 0 0 56 56h24"},null,-1)])])}const ZB=i.markRaw({name:"ion-copy-outline",render:GB}),QB={class:"flex flex-col items-start gap-1.5 text-base"},JB=["href"],e3=["href"],t3={key:1,class:"flex items-center gap-2"},n3=["href"],i3={},Rh=i.defineComponent({...i3,__name:"order-external-links",props:{order:{}},setup(t){const e=i.computed(()=>{var r,o;const n=(((r=t.order.invoices)==null?void 0:r.length)??0)>0;return!!t.order.erpOrderUrl||n||!!((o=t.order.payment)!=null&&o.onlinePaymentLink)});return(n,r)=>{var a;const o=ZB,s=z.NButton;return e.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[r[0]||(r[0]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Внешние ссылки",-1)),i.createElementVNode("div",QB,[t.order.erpOrderUrl?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.order.erpOrderUrl,target:"_blank"}," Открыть заявку в ERP ",8,JB)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices??[],(l,c)=>(i.openBlock(),i.createElementBlock("a",{key:c,class:"btn btn-primary",href:l}," Скачать счет №"+i.toDisplayString(c+1),9,e3))),128)),(a=t.order.payment)!=null&&a.onlinePaymentLink?(i.openBlock(),i.createElementBlock("div",t3,[i.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank"}," Оплатить заказ ",8,n3),i.withDirectives((i.openBlock(),i.createBlock(s,{text:"",title:"Скопировать ссылку на оплату"},{default:i.withCtx(()=>[i.createVNode(o)]),_:1})),[[i.unref(wl),t.order.payment.onlinePaymentLink]])])):i.createCommentVNode("",!0)])],64)):i.createCommentVNode("",!0)}}}),r3={key:0},o3={class:"text-sc-dark-grey my-2 text-center"},s3={key:1,class:"text-sc-dark-grey my-2 text-center"},a3={key:2},l3={class:"text-sc-dark-grey mt-4 text-right font-bold"},c3={class:"text-sc-primary"},d3={},Eh=i.defineComponent({...d3,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(),a=(d=!0)=>{if("products"in n.order){s.value=new j.Order(n.order);return}d&&(o.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrder(n.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=i.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=i.computed(()=>l.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(d,u)=>{const h=z.NSpin;return o.value?(i.openBlock(),i.createElementBlock("div",r3,[i.createElementVNode("div",o3,[i.createVNode(h,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(i.openBlock(),i.createElementBlock("div",s3," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",a3,[i.createVNode(Th,{products:l.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),i.createElementVNode("div",l3,[u[2]||(u[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",c3,i.toDisplayString(c.value)+" ₽",1)]),i.createVNode($h,{order:s.value,"onClick:clientName":u[0]||(u[0]=f=>r("click:client-name",s.value.client,f))},null,8,["order"]),i.createVNode(Rh,{order:s.value},null,8,["order"]),i.createVNode(Nh,{order:s.value},null,8,["order"])]))}}}),u3={},f3=i.defineComponent({...u3,__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(xr,"small"),r=i.computed(()=>D.isNil(e.orderContextButtonsConfig)?[]:D.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=ms,c=z.NButton,d=z.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)}}}),h3={},m3=i.defineComponent({...h3,__name:"orders-list",props:i.mergeModels({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},stickyHeaderOnMobile:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},isRowSelectable:{type:Function,default:void 0}},{checkedRowKeys:{default:()=>[]},checkedRowKeysModifiers:{}}),emits:i.mergeModels(["click:client-name","dblclick:row","update:pagination","update:sort"],["update:checkedRowKeys"]),setup(t,{emit:e}){const n=t,r=e,o=i.useModel(t,"checkedRowKeys"),s=(R,F)=>{F?o.value.includes(R)||(o.value=[...o.value,R]):o.value=o.value.filter(H=>H!==R)},a=()=>D.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),l=i.ref(a()),c=i.ref([]),d=i.ref(!1),u=i.ref(700),h=()=>{const R=et.getDeviceTypeByResolution(),F=R===Xe.phone||R===Xe.tablet;if(!(!n.stickyHeaderOnMobile&&F))return u.value*(j.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},f=i.ref(h()),m=R=>{const F={onDblclick:()=>r("dblclick:row",R)},H=[];return n.selectable&&o.value.length>0&&!o.value.includes(R.id)&&H.push("opacity-60"),n.useCellIndication&&(R.isOnOrder&&H.push("on-order"),R.isLargeOrder&&H.push("large-order"),R.isNotInStock&&H.push("not-in-stock"),H.push("order-status",R.status.slug),R.delivery.date&&He.isTomorrow(new Date(R.delivery.date))&&H.push("next-day-order")),H.length>0&&(F.class=H.join(" ")),F},p=()=>{const R=[Fe.CreatedAt,Fe.Id,Fe.ClientInfo,Fe.ClientCity,Fe.DeliveryDate,Fe.PaymentType,Fe.SalesDirections,Fe.Status,...n.showAttachedUserColumn?[Fe.AttachedUser]:[],Fe.actions],F=n.fields.length>0?n.fields:R,H={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},Q={type:"expand",expandable:D.constant(!0),renderExpand:P=>i.h(Eh,{order:P,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",P.client,null)}}),width:"30"};let Z=[{title:"Дата заказа",key:Fe.CreatedAt,resizable:!0,width:100,render:P=>i.h(Lo,{date:P.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Fe.Id,resizable:!0,width:75,className:"order-id",render:P=>i.h("a",{href:n.orderUrl.replace(":id",P.id.toString()),class:"text-base"},P.id)},{title:"Дата доставки / самовывоза",key:Fe.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:P=>i.h(Lo,{date:P.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Fe.ClientInfo,resizable:!0,minWidth:320,render:P=>i.h(Er,{client:P.client,"onClick:client-name":()=>{r("click:client-name",P.client,null)}})},{title:"Тип доставки",key:Fe.DeliveryInfo,resizable:!0,minWidth:320,render:P=>i.h(ls,{delivery:P.delivery})},{title:"Клиент",key:Fe.ClientInfoShort,resizable:!0,minWidth:320,render:P=>i.h(Er,{client:P.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",P.client,null)}})},{title:"Город клиента",key:Fe.ClientCity,resizable:!0,minWidth:90,width:120,render:P=>{var V;return i.h("span",{class:"text-base"},((V=P.client)==null?void 0:V.city.name)??"—")}},{title:"Статус",key:Fe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:P=>i.h("span",{class:"text-base"},[P.status.name])},{title:"Тип оплаты",key:Fe.PaymentType,resizable:!0,width:115,minWidth:95,render:P=>P.payment?i.h(Za,{payment:P.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Fe.SalesDirections,resizable:!0,width:70,render:P=>{var V;return i.h("span",{class:"text-base"},[((V=P.salesDirection)==null?void 0:V.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Fe.AttachedUser,resizable:!0,minWidth:120,render:P=>{var V;return i.h("span",{class:"text-base"},[((V=P==null?void 0:P.attachedUser)==null?void 0:V.name)??""])}}]:[]];n.orderContextButtonsConfig&&Z.push({key:"actions",title:"",className:"align-top",width:50,render:P=>i.h(f3,{order:P,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(Z=Z.map(P=>[Fe.Id,Fe.CreatedAt,Fe.DeliveryDate].includes(P.key)?{...P,sorter:!0,sortOrder:!1,...P.width===void 0?{}:{width:P.width+16}}:P));const O=n.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:P=>{var M;const V=((M=n.isRowSelectable)==null?void 0:M.call(n,P))??!0;return{class:V?"cursor-pointer":void 0,onClick:()=>{V&&s(P.id,!o.value.includes(P.id))}}},render:P=>{var V;return((V=n.isRowSelectable)==null?void 0:V.call(n,P))??!0?i.h(z.NCheckbox,{checked:o.value.includes(P.id)}):null}}]:[];switch(et.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[...O,Q,{key:"order",title:"Заказ",resizable:!0,render:P=>i.h(Sh,{order:P,fields:F,orderUrl:n.orderUrl})}];case Xe.laptop:{const P=n.showAttachedUserColumn?F:F.filter(V=>V!==Fe.AttachedUser);return[...O,Q,...P.map(V=>Z.find(M=>M.key===V)??H)]}default:return[H]}},g=i.ref(p()),y=i.ref(new j.TableDataPagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),b=i.computed(()=>({...y.value,prefix({itemCount:R}){return`Всего заказов: ${R}`}})),_=i.ref(null),k=i.ref(null),x=i.ref(null),C=()=>{x.value!==null&&(clearInterval(x.value),x.value=null)},N=()=>{C(),n.refreshInterval&&(x.value=setInterval(()=>{S()},n.refreshInterval))},w=()=>{var R,F;n.filters&&((R=k.value)==null||R.abort(),k.value=null,(F=_.value)==null||F.abort(),_.value=new AbortController,d.value=!0,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,l.value,{page:y.value.page,pageSize:y.value.pageSize},_.value.signal).then(H=>{y.value.itemCount!==H.meta.total&&(y.value.itemCount=H.meta.total),y.value.page!==H.meta.currentPage&&(y.value.page=H.meta.currentPage),y.value.pageCount!==H.meta.lastPage&&(y.value.pageCount=H.meta.lastPage),y.value.pageSize!==H.meta.perPage&&(y.value.pageSize=H.meta.perPage),c.value=H.data,d.value=!1}).catch(H=>{if((H==null?void 0:H.name)!=="CanceledError")throw d.value=!1,H}))},S=()=>{var R;!n.filters||d.value||((R=k.value)==null||R.abort(),k.value=new AbortController,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,l.value,{page:y.value.page,pageSize:y.value.pageSize},k.value.signal).then(F=>{c.value=c.value.map(H=>F.data.find(Z=>Z.id===H.id)??H),y.value.itemCount!==F.meta.total&&(y.value.itemCount=F.meta.total),y.value.pageCount!==F.meta.lastPage&&(y.value.pageCount=F.meta.lastPage)}).catch(F=>{if((F==null?void 0:F.name)!=="CanceledError")throw F}))},v=R=>{y.value.page=R,w(),r("update:pagination",y.value)},$=R=>{y.value.pageSize=R,y.value.page=1,w(),r("update:pagination",y.value)},E=R=>{if(D.isNull(R))l.value=a();else{const[F]=l.value;F.field=R.columnKey.toString(),F.direction=R.order==="ascend"?"asc":"desc",l.value=[F]}g.value.forEach(F=>{if(Object.hasOwn(F,"sortOrder")){const H=F;H.sortOrder=H.key===(R==null?void 0:R.columnKey)&&(R!=null&&R.sorter)&&R.order!==!1?R.order:!1}}),w(),r("update:sort",l.value)},A=()=>{g.value=p(),u.value=window.innerHeight,f.value=h()};return i.watch(()=>n.filters,()=>{y.value.page=1,w(),N()}),i.watch(()=>n.sort,()=>{l.value=a(),y.value.page=1,w(),N()}),i.onMounted(()=>{A(),window.addEventListener("resize",A),i.nextTick(()=>{w(),N()})}),i.onUnmounted(()=>{var R,F;window.removeEventListener("resize",A),(R=_.value)==null||R.abort(),(F=k.value)==null||F.abort(),C()}),(R,F)=>{const H=z.NDataTable;return i.openBlock(),i.createBlock(H,{columns:g.value,data:c.value,"row-key":Q=>Q.id,"row-props":m,"scroll-x":t.tableMinWidth,pagination:b.value,loading:d.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":f.value,"pagination-behavior-on-filter":"first","onUpdate:page":v,"onUpdate:pageSize":$,"onUpdate:sorter":E},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),p3=An(m3,[["__scopeId","data-v-14035b7c"]]),g3=["href"],y3={class:"text-sc-dark-grey"},b3={},_3=i.defineComponent({...b3,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>He.format(n.order.createdAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{D.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},i.toDisplayString(t.order.id),9,g3),i.createTextVNode(" от "+i.toDisplayString(o.value),1)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",y3,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),w3={class:"sc-page flex flex-col bg-inherit"},x3={class:"my-2 flex flex-row items-end"},k3={class:"sc-title grow"},v3={key:0,class:"sc-title-buttons flex-1 grow-0"},C3={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},S3={key:0,class:"sc-title-extra mt-2 sm:mt-4"},B3={},Ph=i.defineComponent({...B3,__name:"page",props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>e.stickyHeaderOnMobile?"sticky z-10 bg-inherit":"lg:sticky z-10 bg-inherit");return(r,o)=>{const s=z.NH1;return i.openBlock(),i.createElementBlock("div",w3,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?n.value:void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",x3,[i.createElementVNode("div",k3,[i.renderSlot(r.$slots,"title",{},()=>[i.createVNode(s,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),r.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",v3,[i.createElementVNode("div",C3,[i.renderSlot(r.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),r.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",S3,[i.renderSlot(r.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(r.$slots,"sticky-extra")],6),i.renderSlot(r.$slots,"default")])}}}),T3={class:"overflow-hidden transition-all duration-300"},N3={class:"text-lg font-medium leading-none"},$3={},Fh=i.defineComponent({...$3,__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(et.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.8;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?D.isUndefined(n.drawerWidth)?o.value=a():o.value=D.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=z.NDrawerContent,h=z.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",T3,[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",N3,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)}}}),R3={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},E3={key:0},P3={class:"sc-page-preview-panel grow"},F3={key:1,class:"sc-page-preview-panel-extra flex-none"},V3={},M3=i.defineComponent({...V3,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,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=z.NButton;return i.openBlock(),i.createBlock(Ph,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset,"sticky-header-on-mobile":t.stickyHeaderOnMobile},i.createSlots({default:i.withCtx(()=>[i.createVNode(Fh,{"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",R3,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",E3,[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",P3,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",F3,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),A3={},I3=i.defineComponent({...A3,__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(()=>D.isArray(r.value)),a=i.computed(()=>{var p;return D.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),l=i.computed(()=>{const p=new j.Curator({id:-1,name:"",contacts:{},curatedDirection:new j.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),g=r.showEmptyValue?[p]:[];return r.managerReferenceList.filter(y=>{var b;return(((b=y==null?void 0:y.curatedDirections)==null?void 0:b.length)??0)>0}).forEach(y=>{((y==null?void 0:y.curatedDirections)??[]).forEach(b=>{g.push(new j.Curator({id:y.id,guid:y.guid,name:y.name,photo:y.photo,contacts:y.contacts??{},curatedDirection:b}))})}),g}),c=i.computed(()=>yt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,p=>{const g=D.some(s.value?r.value:[r.value],["id",p.id])?` (${p.curatedDirection.name}) `:"";return p.curatedDirection.isNewRec()?p.name:`${p.name}${g}`})),d=i.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=i.useTemplateRef("select-component"),h=p=>{if(D.isArray(p)){const g=p.length>0?p.map(y=>l.value.find(b=>b.id===y)).filter(y=>!D.isNil(y)):[];o("update:value",g)}else{const g=p>0?l.value.find(y=>y.id===p):null;o("update:value",g??null)}};return i.watch(()=>r.value,()=>{var p,g;(g=(p=u.value)==null?void 0:p.$forceUpdate)==null||g.call(p)},{deep:!0}),e({focus:()=>{var p;return(p=u.value)==null?void 0:p.focusInput()},blur:()=>{var p;return(p=u.value)==null?void 0:p.blurInput()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(z.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"]))}}),O3={},z3=i.defineComponent({...O3,__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},groupByEmployeeType:{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(()=>D.isArray(r.value)),a=i.computed(()=>{var b;return D.isArray(r.value)?r.value.filter(_=>!D.isNil(_)).map(_=>_.id):((b=r.value)==null?void 0:b.id)??null}),l=i.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=i.computed(()=>{var x;const b=[];r.operatorReferenceList.length>0&&b.push({type:"group",label:"Операторы",key:"operators",children:r.operatorReferenceList.map(C=>({label:C.name,value:C.id,item:C}))});let _=r.managerReferenceList;if(r.showActualOnly){const C=D.isArray(r.value)?r.value.map(N=>N.id):[(x=r.value)==null?void 0:x.id];_=_.filter(N=>N.isActive||C.includes(N.id))}const k=yt.convertReferencesToSelectOptionsList(_,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,C=>`${C.name}${C.isActive?"":" [Не активен]"}`);return b.length>0&&k.length>0&&b.push({key:"manager-operator-divider",disabled:!0,render:()=>i.h("div",{class:"sc-manager-operator-select__divider"})}),b.push(...k),b}),d=b=>`${b.name}${"isActive"in b&&!b.isActive?" [Не активен]":""}`,u=i.computed(()=>{var N;const b=D.isArray(r.value)?r.value.map(w=>w.id):[(N=r.value)==null?void 0:N.id],_=w=>r.showActualOnly?w.filter(S=>!("isActive"in S)||S.isActive||b.includes(S.id)):w,k=[],x=_(r.managerReferenceList);x.length>0&&k.push({type:"group",label:"Менеджеры",key:"managers",children:yt.convertReferencesToSelectOptionsList(x,!0,!1,!1,d)});const C=_(r.operatorReferenceList);return C.length>0&&k.push({type:"group",label:"Операторы",key:"operators",children:yt.convertReferencesToSelectOptionsList(C,!0,!1,!1,d)}),k}),h=i.computed(()=>r.groupByEmployeeType?u.value:c.value),f=i.computed(()=>h.value.map(b=>({...b,class:r.wrapContent?`${b.class??""} consistent-menu-width`:b.class}))),m=i.useTemplateRef("select-component"),p=b=>{if(D.isArray(b)){const _=b.map(k=>l.value.find(x=>x.id===k)).filter(k=>!D.isNil(k));o("update:value",_)}else{const _=D.isNil(b)?null:l.value.find(k=>k.id===b)??null;o("update:value",_)}};return i.watch(()=>r.value,()=>{var b,_;(_=(b=m.value)==null?void 0:b.$forceUpdate)==null||_.call(b)},{deep:!0}),e({focus:()=>{var b;return(b=m.value)==null?void 0:b.focusInput()},blur:()=>{var b;return(b=m.value)==null?void 0:b.blurInput()}}),(b,_)=>(i.openBlock(),i.createBlock(i.unref(z.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||h.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:f.value,placeholder:"",class:"w-full","onUpdate:value":p},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),D3={},L3=i.defineComponent({...D3,__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(()=>D.isArray(r.value)),a=i.computed(()=>{var p;return D.isArray(r.value)?r.value.map(g=>g.id):((p=r.value)==null?void 0:p.id)??null}),l=i.computed(()=>r.showEmptyValue?[j.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var y;let p=l.value,g=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=D.isArray(r.value)?r.value.map(_=>_.id):[(y=r.value)==null?void 0:y.id];g=D.union(g,l.value.filter(_=>!_.isActive).map(_=>_.id)),p=p.filter(_=>(r.showEmptyValue?j.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||b.includes(_.id))}return yt.convertReferencesToSelectOptionsList(p,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&D.some(s.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${_}${b.isActive?"":" [Не активен]"}`},b=>g.includes(b.id)&&b.isActive)}),d=i.computed(()=>c.value.map(p=>({...p,class:r.wrapContent?`${p.class} consistent-menu-width`:p.class}))),u=i.useTemplateRef("select-component"),h=p=>{if(D.isArray(p)){const g=p.length>0?p.filter(y=>!D.some(r.disabledManagerReferenceList,["id",y])).map(y=>l.value.find(b=>b.id===y)).filter(y=>!D.isNil(y)):[];o("update:value",g)}else{const g=p>0&&!D.some(r.disabledManagerReferenceList,["id",p])?l.value.find(y=>y.id===p):new j.Manager;o("update:value",g??new j.Manager)}};return i.watch(()=>r.value,()=>{var p,g;(g=(p=u.value)==null?void 0:p.$forceUpdate)==null||g.call(p)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,p=>{if(p.length>0&&r.value)if(s.value){const g=r.value;D.some(g,y=>D.some(p,["id",y.id]))&&o("update:value",g.filter(y=>!D.some(p,["id",y.id])))}else{const g=r.value;D.some(p,["id",g.id])&&o("update:value",new j.Manager)}}),e({focus:()=>{var p;return(p=u.value)==null?void 0:p.focusInput()},blur:()=>{var p;return(p=u.value)==null?void 0:p.blurInput()}}),(p,g)=>(i.openBlock(),i.createBlock(i.unref(z.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"]))}}),H3={class:"m-0.5 flex flex-col p-0.5"},W3={class:"flex flex-row gap-1"},j3={key:0},q3={key:1},X3={key:2},Y3={key:3},U3={class:"flex flex-row gap-1"},K3={key:0},G3={key:1},Z3={key:2},Q3={key:3},J3={},Vh=i.defineComponent({...J3,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",H3,[i.createElementVNode("span",W3,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",j3,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",q3,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",X3,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",Y3,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",U3,[t.addr.street?(i.openBlock(),i.createElementBlock("span",K3,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",G3,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",Z3,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",Q3,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ja={clearable:!1,value:"",field:void 0,disabled:!1},e5={},t5=i.defineComponent({...e5,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ja,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(g=>({label:g[r.field??"addressString"]??"-",value:g.id})));i.watch(()=>r.value,g=>{s.value=g}),i.watch(s,()=>{o("update:value",s.value)});const d=D.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=(g,y)=>{const b=l.value.find(_=>_.id===g.value)||{};return i.h(Vh,{addr:b,selected:y},{default:D.constant("-")})},f=g=>{d.cancel();const y=l.value.find(b=>b.id===g)||{};o("select",y)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(g,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[y[0]||(y[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"])}}}),n5={class:"m-0.5 flex flex-col p-0.5"},i5={class:"font-medium"},r5={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},o5={key:0},s5={key:1},a5={},Mh=i.defineComponent({...a5,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",n5,[i.createElementVNode("span",i5,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",r5,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",o5," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",s5," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),l5={},c5=i.defineComponent({...l5,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ja,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(g=>({label:g[r.field??"_"]??"-",value:g.id})));i.watch(()=>r.value,g=>{s.value=g}),i.watch(s,()=>{o("update:value",s.value)});const d=D.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=(g,y)=>{const b=l.value.find(_=>_.id===g.value)||{};return i.h(Mh,{bank:b,selected:y},{default:D.constant("-")})},f=g=>{d.cancel();const y=l.value.find(b=>b.id===g)||{};o("select",y)},m=i.ref(null);function p(){m.value.focus()}return e({focus:p}),(g,y)=>{const b=z.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[y[0]||(y[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"])}}}),d5={class:"font-medium"},u5={key:0,class:"flex flex-row gap-2"},f5={key:0,class:"text-xs font-light text-blue-800"},h5={key:1,class:"text-sc-dark-grey text-xs font-light"},m5={},Ah=i.defineComponent({...m5,__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",d5,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",u5,[t.org.inn?(i.openBlock(),i.createElementBlock("span",f5,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",h5,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),p5={},g5=i.defineComponent({...p5,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ja,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=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>yt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{s.value=y}),i.watch(s,()=>{o("update:value",s.value)});const u=D.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=(y,b)=>{const _=l.value.find(k=>k.id===y.value)||{};return i.h(Ah,{org:_,selected:b},{default:D.constant("-")})},m=y=>{u.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&o("select",b)},p=i.ref(null);function g(){p.value.focus()}return e({focus:g}),(y,b)=>{const _=z.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:p,value:s.value,"onUpdate:value":[b[0]||(b[0]=k=>s.value=k),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":f,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),y5=i.computed(()=>j.useReferencesStore().deliveryTypeReference??[]),b5=i.computed(()=>j.useReferencesStore().managersList??[]),_5=i.computed(()=>j.useReferencesStore().opfReference??[]),w5=i.computed(()=>j.useReferencesStore().partnerGroupsReference??[]),x5=i.computed(()=>j.useReferencesStore().priceCoefficientsReference??[]),k5=i.computed(()=>j.useReferencesStore().productFilesTypesReference??[]),v5=i.computed(()=>j.useReferencesStore().resourceTypesReference),C5=i.computed(()=>j.useReferencesStore().salesDirectionsReference??[]),S5=i.computed(()=>j.useReferencesStore().warehousesReference??[]),B5=i.computed(()=>j.useReferencesStore().paymentTypeReference??[]),T5=i.computed(()=>j.useReferencesStore().orderStatusReference??[]),N5=i.computed(()=>j.useReferencesStore().orderStatusDetailReference??[]),$5=i.computed(()=>j.useReferencesStore().operatorReference??[]),R5=i.computed(()=>yt.convertReferencesToSelectOptionsList(j.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),E5=i.computed(()=>yt.convertReferencesToSelectOptionsList(j.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),P5=t=>j.HttpRequester.getInstance(j.ReferenceDataProvider).searchCity(t),F5=t=>yt.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()),V5=t=>j.HttpRequester.getInstance(j.ClientDataProvider).searchClient(t),M5=t=>yt.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.CommonValidators=Uh,X.ConfiguratorSettingsKozyrek=eu,X.ConfiguratorSettingsMosquito=bw,X.ContentHelper=yi,X.DateValidators=Kh,X.EntityNameHelper=ti,X.FileHelper=Yh,X.KozyrekLine=Tn,X.KozyrekTailTemplate=ha,X.KozyrekTemplate=ar,X.NumericValidators=ae,X.OrdersTableFields=Fe,X.Point=fa,X.ScAddProductToCartDialog=u_,X.ScAddressSuggestion=t5,X.ScAddressSuggestionLabel=Vh,X.ScBankSuggestion=c5,X.ScBankSuggestionLabel=Mh,X.ScBaseDialog=ku,X.ScButtonWithConfirmAction=Zh,X.ScCategoryCollapse=wu,X.ScClientNameWithShortInfo=Er,X.ScCollapse=_u,X.ScCollapseItem=Bl,X.ScCommentEditor=Bx,X.ScConfiguratorsProductInfo=Cr,X.ScContragentWithShortInfo=vu,X.ScCreatorUserTypeTag=Yr,X.ScCuratorSelect=I3,X.ScDateRange=ex,X.ScDateTimeLabel=Lo,X.ScDebouncedInput=Ox,X.ScDebouncedInputNumber=Dx,X.ScDebt=rx,X.ScDialogHeader=dx,X.ScDynamicConfigurator=gu,X.ScEmail=T_,X.ScExternalLink=Gx,X.ScImageGallery=El,X.ScInlineEditableItem=Fu,X.ScInlineView=pa,X.ScKozyrekConfigurator=tu,X.ScKozyrekConfiguratorParamsForm=Fl,X.ScKozyrekConfiguratorPreview=Jd,X.ScKozyrekConfiguratorTemplates=Qd,X.ScLightGallery=Rl,X.ScManagerOperatorSelect=z3,X.ScManagerSelect=L3,X.ScMetalForDoorsConfigurator=du,X.ScMetalForDoorsConfiguratorForm=cu,X.ScMosquitoConfigurator=ru,X.ScMosquitoConfiguratorForm=nu,X.ScMosquitoConfiguratorMeasurementInstructions=iu,X.ScMosquitoConfiguratorPreview=ma,X.ScOrderCommonInfo=Sh,X.ScOrderDeliveryLabel=ls,X.ScOrderDetails=$h,X.ScOrderExternalLinks=Rh,X.ScOrderInfo=Eh,X.ScOrderItemParams=Ch,X.ScOrderItemsList=Th,X.ScOrderPayment=Za,X.ScOrderProductInfo=Bh,X.ScOrderStatusHistory=Nh,X.ScOrdersList=p3,X.ScOrgSuggestion=g5,X.ScOrgSuggestionLabel=Ah,X.ScPage=Ph,X.ScPageWithSlidingPanel=M3,X.ScPersonContactsBlock=yw,X.ScPhone=Z_,X.ScPhoneInput=Wx,X.ScProductName=vr,X.ScProductsList=CS,X.ScReferenceSelect=xu,X.ScSandwichConfigurator=hu,X.ScSandwichConfiguratorForm=fu,X.ScSandwichM2Configurator=pu,X.ScSandwichM2ConfiguratorForm=mu,X.ScSearchableProductSelect=vh,X.ScSearchableReferenceSelect=kh,X.ScSetClientPriceFormItem=r_,X.ScShortTextOrderInfo=_3,X.ScSingleFileUploadSelector=Ex,X.ScSlidingContentWithDrawer=Fh,X.ScStripConfigurator=lu,X.ScStripConfiguratorForm=su,X.ScStripConfiguratorLineItem=ou,X.ScStripConfiguratorPreview=au,X.ScUserShortInfo=Qa,X.ScWarningIcon=Ax,X.SelectOptionHelper=yt,X.UiNotificationProvider=_r,X.Validators=We,X.WindowResolutionEnum=Xe,X.WindowResolutionProvider=et,X.channelPrimaryInterestOptionsList=R5,X.componentSizeInjectionKey=xr,X.copyToClipboard=_l,X.deliveryTypeReferenceList=y5,X.handleFloatInput=eo,X.handleIntegerInput=st,X.isCanSandwichM2Show=_w,X.isCanSandwichShow=bu,X.isConfiguratorType=yu,X.managersReferenceList=b5,X.naiveUiTheme=Im,X.operatorReferenceList=$5,X.opfReferenceList=_5,X.orderStatusDetailReferenceList=N5,X.orderStatusReferenceList=T5,X.parse=lt,X.partnerGroupReferenceList=w5,X.paymentTypeReferenceList=B5,X.priceCoefficientsReferenceList=x5,X.productFilesTypesReferenceList=k5,X.renderConfig=qe,X.resetInputValidation=it,X.resourceReferencesList=v5,X.salesDirectionsReferenceList=C5,X.searchCityReferenceDataHandler=P5,X.searchCityReferenceLabelRenderer=F5,X.searchClientReferenceDataHandler=V5,X.searchClientReferenceLabelRenderer=M5,X.selectAllTextOnFocus=Le,X.sourcePrimaryInterestOptionsList=E5,X.vCopy=wl,X.vFocusNext=ei,X.warehousesReferenceList=S5,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
|