@snabcentr/vue-ui-lib 5.7.4 → 5.7.6
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 +1 -1
- package/dist/release_notes.tmp +3 -10
- package/dist/sc-vue-ui-lib.js +747 -728
- package/dist/sc-vue-ui-lib.js.map +1 -1
- package/dist/sc-vue-ui-lib.umd.cjs +53 -53
- package/dist/sc-vue-ui-lib.umd.cjs.map +1 -1
- package/dist/src/providers/ui-notification-provider.d.ts +8 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(j,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("date-fns"),require("vue"),require("pinia"),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","date-fns","vue","pinia","naive-ui","libphonenumber-js","ts-case-convert","vue-tel-input"],W):(j=typeof globalThis<"u"?globalThis:j||self,W(j.SC_VueUiLib={},j["@snabcentr/common-lib"],j["lodash-es"],j["date-fns"],j.Vue,j.pinia,j["naive-ui"],j["libphonenumber-js"],j["ts-case-convert"],j["vue-tel-input"]))})(this,(function(j,W,V,Ce,t,Rm,I,Br,Ns,Pm){"use strict";var NT=Object.defineProperty;var Nm=j=>{throw TypeError(j)};var TT=(j,W,V)=>W in j?NT(j,W,{enumerable:!0,configurable:!0,writable:!0,value:V}):j[W]=V;var B=(j,W,V)=>TT(j,typeof W!="symbol"?W+"":W,V),Tm=(j,W,V)=>W.has(j)||Nm("Cannot "+V);var qt=(j,W,V)=>(Tm(j,W,"read from private field"),V?V.call(j):W.get(j)),Hl=(j,W,V)=>W.has(j)?Nm("Cannot add the same private member more than once"):W instanceof WeakSet?W.add(j):W.set(j,V),$m=(j,W,V,Ce)=>(Tm(j,W,"write to private field"),Ce?Ce.call(j,V):W.set(j,V),V);var qi,St,Cs;const Nr="Чтобы изменить, включите режим управления",Ts="Товар, который нужно предлагать клиенту",$s="Категория, которую нужно предлагать клиенту",Ft=class Ft{static init(e,i){Ft.messagesService&&Ft.notificationsService||(Ft.messagesService=e,Ft.notificationsService=i)}static getMessagesService(){if(!Ft.messagesService)throw new Error("UI provider is not initialized.");return Ft.messagesService}static getNotificationsService(){if(!Ft.notificationsService)throw new Error("UI provider is not initialized.");return Ft.notificationsService}static showNotificationsForErrorResponseData(e,i={}){var r,o;if(V.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";Ft.notificationsService?Ft.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(i,s)?i[s]=new W.FieldValidationResultData(e.errors[s].toString(),"error"):Ft.messagesService?Ft.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};B(Ft,"messagesService"),B(Ft,"notificationsService");let Tr=Ft;const $r=new WeakMap,Fm=async n=>{const e=navigator.clipboard;if(e!=null&&e.writeText){await e.writeText(n);return}const i=document.createElement("textarea");i.value=n,i.style.position="fixed",i.style.opacity="0",document.body.append(i),i.select();const r=document.execCommand("copy");if(i.remove(),!r)throw new Error("Не удалось скопировать через execCommand.")},jl=async n=>{const e=V.isNil(n)?"":String(n);if(e)try{await Fm(e),Tr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{Tr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},Vm=n=>n.tagName==="BUTTON"||n.getAttribute("role")==="button"||!!n.closest("button"),Mm=(n,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":Vm(n)?"click":"dblclick",ql={mounted(n,e){n.style.setProperty("cursor","pointer");const i=Mm(n,e),r=o=>{var a;i==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=$r.get(n);jl(s==null?void 0:s.value).catch(V.noop)};$r.set(n,{value:e.value,eventName:i,handler:r}),n.addEventListener(i,r)},updated(n,e){const i=$r.get(n);i&&(i.value=e.value)},beforeUnmount(n){const e=$r.get(n);e&&(n.removeEventListener(e.eventName,e.handler),$r.delete(n))}},Im=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),Am=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",lo=new WeakMap,Xl=n=>!Im.has(n.type)&&!n.disabled&&!n.readOnly&&n.closest(Am)===null&&n.getClientRects().length>0,Yl=n=>{var a;if(n.key!=="Enter"&&n.code!=="Enter"||n.shiftKey||n.isComposing)return;const{target:e}=n;if(!(e instanceof HTMLInputElement)||!Xl(e))return;n.preventDefault();const i=n.currentTarget,r=[...i.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=lo.get(i))==null||a()},ai={mounted(n,e){lo.set(n,e.value),n.addEventListener("keydown",Yl)},updated(n,e){lo.set(n,e.value)},unmounted(n){n.removeEventListener("keydown",Yl),lo.delete(n)}};var ct=(n=>(n.NotInStock="not_in_stock",n.OnOrder="on_order",n.LargeOrder="large_order",n.NextDayDelivery="next_day_delivery",n))(ct||{});const Es={color:"#4b5563",backgroundColor:"#e5e7eb",textOnBackgroundColor:"#1f2937"},Ul=new Map([[W.OrderStatusEnum.New,{color:"#15803d",backgroundColor:"#bbf7d0",textOnBackgroundColor:"#166534"}],[W.OrderStatusEnum.Processing,{color:"#ea580c",backgroundColor:"#fed7aa",textOnBackgroundColor:"#9a3412"}],[W.OrderStatusEnum.AwaitingSupplyProducts,{color:"#ca8a04",backgroundColor:"#fef08a",textOnBackgroundColor:"#854d0e"}],[W.OrderStatusEnum.InvoiceIssued,{color:"#1d4ed8",backgroundColor:"#bfdbfe",textOnBackgroundColor:"#1e40af"}],[W.OrderStatusEnum.ProcessingOnStock,{color:"#0e7490",backgroundColor:"#a5f3fc",textOnBackgroundColor:"#155e75"}],[W.OrderStatusEnum.OrderUpdated,{color:"#6d28d9",backgroundColor:"#ddd6fe",textOnBackgroundColor:"#5b21b6"}],[W.OrderStatusEnum.Finished,{color:"#475569",backgroundColor:"#e2e8f0",textOnBackgroundColor:"#1e293b"}],[W.OrderStatusEnum.Canceled,{color:"#b91c1c",backgroundColor:"#fecaca",textOnBackgroundColor:"#991b1b"}],[W.OrderStatusEnum.Error,{color:"#991b1b",backgroundColor:"#fca5a5",textOnBackgroundColor:"#7f1d1d"}]]),ki=n=>Ul.get(n)??Es,Kl=n=>{const e=ki(n);return{color:e.backgroundColor,textColor:e.textOnBackgroundColor,borderColor:e.color}},Gl=n=>{const e=ki(n);return{"--sc-order-status-color":e.color,"--sc-order-status-bg":e.backgroundColor,"--sc-order-status-text":e.textOnBackgroundColor}},Rs=new Map([[ct.NotInStock,{color:"#ef4444",backgroundColor:"#f7ff00",textOnBackgroundColor:"#ff0000"}],[ct.OnOrder,{color:"#ca8a04",backgroundColor:"#f7ff00",textOnBackgroundColor:"#ff0000"}],[ct.LargeOrder,{color:"#ef2929",backgroundColor:"#ef2929",textOnBackgroundColor:"#ffffff"}],[ct.NextDayDelivery,{color:"#ef2929",backgroundColor:"#ef2929",textOnBackgroundColor:"#ffffff"}]]),Zl=new Map([[ct.NotInStock,"Нет в наличии"],[ct.OnOrder,"Под заказ"],[ct.LargeOrder,"Крупный заказ"],[ct.NextDayDelivery,"Доставка на завтра"]]),co=[...Rs.keys()],Er=n=>Rs.get(n)??Es,Ps=n=>Zl.get(n)??n,Fs=n=>{const e=[];return n.isNotInStock&&e.push(ct.NotInStock),n.isOnOrder&&e.push(ct.OnOrder),n.isLargeOrder&&e.push(ct.LargeOrder),!V.isNil(n.delivery.date)&&Ce.isTomorrow(new Date(n.delivery.date))&&e.push(ct.NextDayDelivery),e};var Ie=(n=>(n.AttachedUser="attached_user",n.ClientInfo="client_info",n.ClientInfoShort="client_info_short",n.CreatedAt="created_at",n.ClientCity="client_city",n.DeliveryInfo="delivery_info",n.DeliveryDate="delivery_date",n.Id="id",n.PaymentType="payment_type",n.SalesDirections="sales_directions",n.Status="status",n.actions="actions",n))(Ie||{}),Xe=(n=>(n.phone="phone",n.tablet="tablet",n.laptop="laptop",n))(Xe||{});const Ct=class Ct{static init(){Ct.isInitialized||(Ct.isInitialized=!0,Ct.windowResizeHandler(),window.addEventListener("resize",Ct.windowResizeHandler))}static destroy(){window.removeEventListener("resize",Ct.windowResizeHandler),Ct.isInitialized=!1}static getDeviceTypeByResolution(){const e=W.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Xe.phone:window.innerWidth<e.laptop?Xe.tablet:Xe.laptop}static initRefDependingOnDeviceResolution(e,i,r){const o=t.ref(r);return Ct.setRefValueDependingOnDeviceResolution(o,e,i,r),Ct.refsDependingOnDeviceResolution.push({r:o,phoneValue:e,tabletValue:i,defaultValue:r}),o}static isPhoneDevice(){return Ct.getDeviceTypeByResolution()===Xe.phone}static isTabletDevice(){return Ct.getDeviceTypeByResolution()===Xe.tablet}static isLaptopDevice(){return Ct.getDeviceTypeByResolution()===Xe.laptop}static setRefValueDependingOnDeviceResolution(e,i,r,o){switch(Ct.getDeviceTypeByResolution()){case Xe.phone:e.value=i;break;case Xe.tablet:e.value=r;break;default:e.value=o;break}}static windowResizeHandler(){V.forEach(Ct.refsDependingOnDeviceResolution,e=>{Ct.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};B(Ct,"isInitialized",!1),B(Ct,"refsDependingOnDeviceResolution",[]);let Ue=Ct;function Ql(){try{return Ue.getDeviceTypeByResolution()}catch(n){return console.error(n),Xe.laptop}}function Om(){const n=t.ref(Ql()),e=t.computed(()=>n.value===Xe.phone||n.value===Xe.tablet),i=()=>{n.value=Ql()};return t.onMounted(()=>{window.addEventListener("resize",i)}),t.onUnmounted(()=>{window.removeEventListener("resize",i)}),{isCompactLayout:e}}const zm="(hover: hover) and (pointer: fine)",uo=()=>{const n=V.isFunction(globalThis.matchMedia)?globalThis.matchMedia(zm):void 0,e=t.ref(n?n.matches:!0),i=r=>{e.value=r.matches};return n==null||n.addEventListener("change",i),t.onScopeDispose(()=>{n==null||n.removeEventListener("change",i)},!0),t.readonly(e)},Dm=".sc-versions-list";function Lm(n,e,i){const r=document.querySelectorAll(Dm);if(r.length===0)return;const o=r[0],s=`${n}:`;if(V.some(o.querySelectorAll("li"),l=>V.startsWith(V.trim(l.textContent||""),s)))return;const a=document.createElement("li");a.append(document.createTextNode(`${s} ${e} от ${Ce.format(i,"dd.MM.yyyy")}`)),o.append(a)}class Ci{static isVnodeEmpty(e){return e.every(i=>i.type===t.Comment||i.type===t.Text&&V.isString(i.children)&&!i.children.trim()?!0:i.type===t.Fragment&&Ci.isVnodeEmpty(i.children))}static hasSlotContent(e){return e?!Ci.isVnodeEmpty(e()):!1}}class ir{static getDefaultCurrency(){var i;if(!Rm.getActivePinia())return;const e=W.useBaseConfigStateStore().getConfig().defaultCurrency;return(i=W.useReferencesStore().currencyReference)==null?void 0:i.find(r=>r.signature===e)}static getPrecision(e){var i;return(e==null?void 0:e.precision)??((i=ir.getDefaultCurrency())==null?void 0:i.precision)}}const Hm={readAsFileData(n){return new Promise((e,i)=>{const r=new FileReader;r.addEventListener("load",()=>{e({name:n.name,content:r.result})}),r.addEventListener("error",()=>{i(new Error(`Не удалось прочитать файл «${n.name}».`))}),r.readAsDataURL(n)})}};class li{static isDeleted(e){return!!(e.deletedAt&&!Ce.isFuture(e.deletedAt))}static getFormatEntityName(e){return li.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const ft=(n,e=!1)=>{const{key:i}=n;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(i)&&!((n.ctrlKey||n.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(i.toLowerCase()))){if(e&&i==="-"){const r=n.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(i)||n.preventDefault()}},fo=(n,e=".",i=!1)=>{const{key:r}=n,o=n.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(n.ctrlKey||n.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||i&&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)||n.preventDefault()},ht=n=>n?Number.parseFloat(n.replace(",",".")):null,dt=(n,e)=>{n[e]={}},He=n=>{const e=n.target;setTimeout(()=>{e.select()},100)},Ye=class Ye{static getDecimalsCount(e){if(!Number.isFinite(e)||Number.isInteger(e))return 0;const[i,r]=V.split(e.toString(),"e"),o=V.split(i,"."),s=o.length>1?o[1].length:0;return Math.max(s-(Number(r)||0),0)}static normalize(e){return Number.isFinite(e)?Number(e.toPrecision(Ye.significantDigits)):e}static multiplyByStep(e,i){return V.round(e*i,Ye.getDecimalsCount(i)+Ye.getDecimalsCount(e))}static divideByStep(e,i){return Ye.normalize(e/i)}static isMultipleOf(e,i){const r=e/i;return Math.abs(r-Math.round(r))<Ye.epsilon}static isLessOrEqual(e,i){return e<=i+Ye.epsilon}static roundCoordinate(e){return V.round(e,Ye.coordinateFractionDigits)}static roundMoney(e,i=ir.getPrecision()){return i===void 0?Ye.normalize(e):V.round(e,i)}static floorMoney(e,i=ir.getPrecision()){return i===void 0?Ye.normalize(e):V.floor(e,i)}static roundPercent(e,i=Ye.percentFractionDigits){return V.round(e,i)}static formatMoney(e,i=ir.getPrecision()){let r=Ye.moneyFormatters.get(i);return r||(r=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:i,maximumFractionDigits:i}),Ye.moneyFormatters.set(i,r)),r.format(Ye.normalize(e))}static formatPercent(e,i=Ye.percentDisplayFractionDigits){return new Intl.NumberFormat("ru-RU",{style:"decimal",maximumFractionDigits:i}).format(e)}static formatArea(e){return Ye.areaFormatter.format(e)}};B(Ye,"percentFractionDigits",5),B(Ye,"percentDisplayFractionDigits",2),B(Ye,"areaFractionDigits",4),B(Ye,"coordinateFractionDigits",6),B(Ye,"significantDigits",12),B(Ye,"epsilon",1e-6),B(Ye,"moneyFormatters",new Map),B(Ye,"areaFormatter",new Intl.NumberFormat("ru-RU",{style:"decimal",maximumFractionDigits:Ye.areaFractionDigits}));let Ve=Ye;function Jl(n){return n.itemCount&&n.itemCount>0?`Всего ${n.itemCount} записей`:""}class wt{static convertReferencesToOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):li.getFormatEntityName(c),value:c.id,item:c,disabled:a?a(c):!1}));return i&&(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(V.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=V.isString(r.key)?V.get(d,r.key):r.key(c),f=V.isString(r.label)?V.get(d,r.label):r.label(c);return{type:"group",label:V.isEmpty(f)?"- Не определено -":f,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){return wt.convertReferencesToOptionsList(e,i,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){return wt.convertReferencesToOptionsList(e,i,r,o,s,a)}}const Wm={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},ce={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(n){return{type:"number",min:n,trigger:["blur","input"],message:`Минимальное значение: ${n}`}},max(n){return{type:"number",max:n,trigger:["blur","input"],message:`Максимальное значение: ${n}`}},step(n){return{type:"number",trigger:["blur","input"],validator:(e,i)=>i===null||Ve.isMultipleOf(i,n)?!0:new Error(`Значение должно быть кратно ${n}`)}}},jm={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},We={serverValidation(n){return{validator:(e,i)=>i===null?!0:n?new Error(n):!0}}},Vs=n=>{var e;return((e=n.properties)==null?void 0:e.files)??[]},ec=n=>{var e,i;return!!((e=n.properties)!=null&&e.description)||!!((i=n.properties)!=null&&i.specification)||Vs(n).length>0},ji=class ji{static isM2Category(e){var i;return((i=e.properties)==null?void 0:i.allowSetM2ClientPrice)??!1}static findReferenceProduct(e){var i;return(i=e.products)==null?void 0:i.find(r=>{var o,s,a;return((o=r.category)==null?void 0:o.id)===e.id&&(!!((s=r.properties)!=null&&s.length)||!!((a=r.properties)!=null&&a.width))})}static getSquare(e){var i,r;return(((i=e.properties)==null?void 0:i.width)??ji.defaultLinearSizeMm)*(((r=e.properties)==null?void 0:r.length)??ji.defaultLinearSizeMm)/1e6}static toM2Cost(e,i){return e/ji.getSquare(i)}static calculateM2Cost(e,i,r){var s,a;const o=V.isNil(i)?e.retailCost??e.cost:(a=(s=e.priceCoefficients)==null?void 0:s.find(l=>l.coefficient.id===i.id))==null?void 0:a.cost;return V.isNil(o)?void 0:ji.toM2Cost(o*(1+(r??0)/100),e)}};B(ji,"defaultLinearSizeMm",1e3);let vi=ji;const qm={},Xm=t.defineComponent({...qm,__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(n,{emit:e}){const i=n,r=e,o=t.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},a=()=>{i.disableConfirm?s():o.value=!0};return(l,c)=>{const d=I.NButton,u=I.NPopover,f=I.NModal;return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(u,{disabled:n.popoverText.length===0,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(d,{disabled:n.disabled,ghost:n.ghost,loading:n.loading,size:n.size,type:n.type,quaternary:n.quaternary,circle:n.circle,onClick:a},{default:t.withCtx(()=>[t.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(n.popoverText),1)]),_:3},8,["disabled"]),t.createVNode(f,{show:o.value,"onUpdate:show":c[1]||(c[1]=h=>o.value=h),content:n.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:n.dialogTitle,"action-class":"",preset:"dialog"},{action:t.withCtx(()=>[t.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:t.withCtx(()=>[...c[2]||(c[2]=[t.createTextVNode(" Да ",-1)])]),_:1}),t.createVNode(d,{type:"default",onClick:c[0]||(c[0]=h=>o.value=!1)},{default:t.withCtx(()=>[...c[3]||(c[3]=[t.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),Ym={class:"flex gap-2 overflow-x-auto max-sm:flex-nowrap sm:flex-wrap sm:overflow-visible"},Um={},Km=t.defineComponent({...Um,__name:"chip-group",props:{items:{},modelValue:{}},emits:["update:modelValue"],setup(n,{emit:e}){const i=e;return(r,o)=>(t.openBlock(),t.createElementBlock("div",Ym,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.items,s=>(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:s.key,class:"shrink-0",round:"",size:"small",type:n.modelValue===s.key?"primary":"default",onClick:a=>i("update:modelValue",s.key)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.label),1)]),_:2},1032,["type","onClick"]))),128))]))}}),Gm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zm(n,e){return t.openBlock(),t.createElementBlock("svg",Gm,[...e[0]||(e[0]=[t.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),t.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),t.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Ms=t.markRaw({name:"ion-ellipsis-vertical-sharp",render:Zm}),Qm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jm(n,e){return t.openBlock(),t.createElementBlock("svg",Qm,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),t.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const tc=t.markRaw({name:"tabler-edit",render:Jm}),ep={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tp(n,e){return t.openBlock(),t.createElementBlock("svg",ep,[...e[0]||(e[0]=[t.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 nc=t.markRaw({name:"ion-checkmark-done-circle",render:tp}),np={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ip(n,e){return t.openBlock(),t.createElementBlock("svg",np,[...e[0]||(e[0]=[t.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),t.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 ic=t.markRaw({name:"ion-checkmark-done-circle-outline",render:ip}),rp={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function op(n,e){return t.openBlock(),t.createElementBlock("svg",rp,[...e[0]||(e[0]=[t.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 sp=t.markRaw({name:"fluent-pin32-regular",render:op}),ap={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lp(n,e){return t.openBlock(),t.createElementBlock("svg",ap,[...e[0]||(e[0]=[t.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),t.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const cp=t.markRaw({name:"ion-eye-outline",render:lp}),dp={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function up(n,e){return t.openBlock(),t.createElementBlock("svg",dp,[...e[0]||(e[0]=[t.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 fp=t.markRaw({name:"fluent-pin32-filled",render:up}),hp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mp(n,e){return t.openBlock(),t.createElementBlock("svg",hp,[...e[0]||(e[0]=[t.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 pp=t.markRaw({name:"ion-bookmark-outline",render:mp}),gp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yp(n,e){return t.openBlock(),t.createElementBlock("svg",gp,[...e[0]||(e[0]=[t.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),t.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 bp=t.markRaw({name:"ion-eye-off-sharp",render:yp}),_p={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wp(n,e){return t.openBlock(),t.createElementBlock("svg",_p,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const xp=t.markRaw({name:"ion-chevron-forward-outline",render:wp}),kp=["data-name"],Cp={class:"sc-collapse-item-header flex flex-row gap-2.5"},vp={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Sp={key:0},Bp={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Np={class:"flex flex-1 flex-col"},Tp={key:0,class:"sc-collapse-item-sub-title flex-1"},$p={key:1,class:"sc-collapse-item-title-extra flex-none"},Ep={key:0,class:"sc-collapse-item-content"},Rp={},Pp=t.defineComponent({...Rp,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.inject("itemHeaderClickHandler",V.noop),a=t.inject("defaultExpandedNames",[]),l=t.inject("expandedNames",[]),c=V.some(a,g=>g===r.name),d=t.computed(()=>V.some(l,g=>g===r.name)),u=t.ref(c),f=()=>{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||f()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,o("header:click",r.name,u.value),s(r.name,u.value))},expanded:t.readonly(u)}),(g,b)=>{const y=xp;return t.openBlock(),t.createElementBlock("div",{"data-name":n.name,class:t.normalizeClass([{"cursor-not-allowed text-gray-400":n.disabled},"sc-collapse-item flex flex-col p-2"])},[t.createElementVNode("div",Cp,[t.createElementVNode("div",vp,[t.createElementVNode("div",{class:t.normalizeClass({"rotate-90":u.value}),onClick:f},[t.renderSlot(g.$slots,"arrow",{},()=>[t.createVNode(y)],!0)],2)]),t.unref(Ci).hasSlotContent(g.$slots["pre-arrow"])?(t.openBlock(),t.createElementBlock("div",Sp,[t.createElementVNode("div",Bp,[t.renderSlot(g.$slots,"pre-arrow",{},void 0,!0)])])):t.createCommentVNode("",!0),t.createElementVNode("div",Np,[t.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[t.renderSlot(g.$slots,"header",{},()=>[t.createTextVNode(t.toDisplayString(n.title),1)],!0)]),t.unref(Ci).hasSlotContent(g.$slots["sub-header"])?(t.openBlock(),t.createElementBlock("div",Tp,[t.renderSlot(g.$slots,"sub-header",{},void 0,!0)])):t.createCommentVNode("",!0)]),t.unref(Ci).hasSlotContent(g.$slots["header-extra"])?(t.openBlock(),t.createElementBlock("div",$p,[t.renderSlot(g.$slots,"header-extra",{},void 0,!0)])):t.createCommentVNode("",!0)]),t.createVNode(t.Transition,{name:"fade"},{default:t.withCtx(()=>[d.value||u.value?(t.openBlock(),t.createElementBlock("div",Ep,[t.renderSlot(g.$slots,"default",{},void 0,!0)])):t.createCommentVNode("",!0)]),_:3})],10,kp)}}}),gn=(n,e)=>{const i=n.__vccOpts||n;for(const[r,o]of e)i[r]=o;return i},rc=gn(Pp,[["__scopeId","data-v-22a74c45"]]),Fp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vp(n,e){return t.openBlock(),t.createElementBlock("svg",Fp,[...e[0]||(e[0]=[t.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),t.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),t.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 oc=t.markRaw({name:"ion-cart-outline",render:Vp}),Rr=Symbol(),Mp={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"}},Ip={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Ap={class:"inline-flex"},Op={},sc=t.defineComponent({...Op,__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(n){const e=n,i=t.inject(Rr,"medium"),r=uo(),o=t.computed(()=>V.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=t.computed(()=>V.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),a=t.computed(()=>V.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),l=t.computed(()=>a.value==="disabled"?`${Ts}. ${Nr}`:Ts),c=t.computed(()=>V.isNil(e.productContextButtonsConfig)?[]:V.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),d=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},u=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},f=()=>{e.eventEmitter.emit("product:required",{product:e.product})},h=p=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:p})};return(p,m)=>{var k;const g=ic,b=nc,y=I.NButton,_=I.NTooltip,x=tc,w=oc,C=Ms,N=I.NDropdown;return t.openBlock(),t.createElementBlock("div",Ip,[a.value?(t.openBlock(),t.createBlock(_,{key:0,placement:"bottom",trigger:"hover",disabled:!t.unref(r)},{trigger:t.withCtx(()=>[t.createElementVNode("span",Ap,[t.createVNode(y,{ghost:!0,size:t.unref(i),disabled:a.value==="disabled",type:n.product.isRequired?"primary":"default",onClick:f},{default:t.withCtx(()=>[n.product.isRequired?(t.openBlock(),t.createBlock(b,{key:1})):(t.openBlock(),t.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(l.value),1)]),_:1},8,["disabled"])):t.createCommentVNode("",!0),s.value?(t.openBlock(),t.createBlock(_,{key:1,placement:"bottom",trigger:"hover",disabled:!t.unref(r)},{trigger:t.withCtx(()=>[t.createVNode(y,{ghost:!0,size:t.unref(i),type:"primary",disabled:s.value==="disabled",onClick:u},{default:t.withCtx(()=>[t.createVNode(x)]),_:1},8,["size","disabled"])]),default:t.withCtx(()=>[m[0]||(m[0]=t.createTextVNode(" Редактировать ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createBlock(_,{key:2,placement:"bottom",trigger:"hover",disabled:!t.unref(r)},{trigger:t.withCtx(()=>[t.createVNode(y,{ghost:!0,size:t.unref(i),disabled:o.value==="disabled",type:"primary",onClick:d},{default:t.withCtx(()=>[t.createVNode(w)]),_:1},8,["size","disabled"])]),default:t.withCtx(()=>[m[1]||(m[1]=t.createTextVNode(" Добавить в корзину ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),((k=c.value)==null?void 0:k.length)>0?(t.openBlock(),t.createBlock(N,{key:3,options:c.value,size:t.unref(i),trigger:"click",onSelect:h},{default:t.withCtx(()=>[t.createVNode(y,{ghost:!0,size:t.unref(i),type:"primary"},{default:t.withCtx(()=>[t.createVNode(C)]),_:1},8,["size"])]),_:1},8,["options","size"])):t.createCommentVNode("",!0)])}}}),zp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Dp(n,e){return t.openBlock(),t.createElementBlock("svg",zp,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.createElementVNode("path",{d:"M12 8v4l2 2"}),t.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Lp=t.markRaw({name:"tabler-history",render:Dp}),Hp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Wp(n,e){return t.openBlock(),t.createElementBlock("svg",Hp,[...e[0]||(e[0]=[t.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 jp=t.markRaw({name:"mdi-percent-outline",render:Wp}),qp={class:"flex flex-row gap-1"},Xp={key:0,class:"flex gap-1"},Yp={key:0,class:"flex text-nowrap text-sm line-through"},Up={key:1,class:"flex flex-row text-nowrap text-sm"},Kp={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Gp={},ci=t.defineComponent({...Gp,__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(n){var w;const e=n,i=uo(),r=t.computed(()=>"product"in e.product),o=t.computed(()=>"discount"in e.product&&e.product.discount?li.getFormatEntityName(e.product.discount):""),s=t.computed(()=>"product"in e.product?e.product.product:e.product),a=t.computed(()=>V.isNil(f.value)?"":e.showQuantityUnit?V.compact([s.value.currency.symbol,s.value.unit.name]).join("/"):e.showCurrency?s.value.currency.symbol:""),l=t.computed(()=>e.showQuantityUnit?V.compact(["₽",s.value.unit.name]).join("/"):e.showCurrency?"₽":""),c=t.computed(()=>V.find(s.value.priceCoefficients,["coefficient.slug",e.costFieldName])),d=t.computed(()=>{const C=V.find(s.value.priceCoefficients,["coefficient.slug","k0"]);return c.value||!C||V.isNil(f.value)||V.isNil(C.cost)?!1:f.value<C.cost}),u=((w=W.useBaseConfigStateStore().getConfig())==null?void 0:w.defaultCurrency)??"RUB",f=t.computed(()=>c.value?c.value.cost:V.get(e.product,e.costFieldName)),h=t.computed(()=>e.additionalThroughFieldName?V.get(e.product,e.additionalThroughFieldName):void 0),p=t.computed(()=>s.value.costDate?Ce.format(s.value.costDate,W.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),m=t.computed(()=>e.currencyRates||s.value.currency.signature===u?e.currencyRates:{[s.value.currency.signature]:s.value.costRub/s.value.cost}),g=t.computed(()=>(V.isFunction(e.allowPriceClick)?e.allowPriceClick(s.value):e.allowPriceClick)&&!V.isNil(f.value)),b=t.computed(()=>V.isNil(f.value)?"-":Ve.formatMoney(Number.parseFloat(f.value),s.value.currency.precision)),y=t.computed(()=>{if(s.value.currency.signature===u||!m.value||!m.value[s.value.currency.signature])return null;const C=m.value[s.value.currency.signature];return Ve.formatMoney(Number.parseFloat(f.value)*C)}),_=t.computed(()=>V.isNil(h.value)?null:Ve.formatMoney(h.value,s.value.currency.precision)),x=t.computed(()=>{if(!h.value||!f.value||h.value===f.value||f.value===0)return null;const C=(f.value-h.value)/h.value*100;return Ve.formatPercent(C)});return(C,N)=>{var P;const k=I.NTag,$=I.NTooltip,v=jp,E=Lp;return t.openBlock(),t.createElementBlock("div",qp,[n.showTag?(t.openBlock(),t.createBlock($,{key:0},{trigger:t.withCtx(()=>[t.createVNode(k,{round:"",bordered:!1,size:"small",class:t.normalizeClass(["text-slate-600",{"font-bold":!c.value}])},{default:t.withCtx(()=>{var F;return[t.createTextVNode(t.toDisplayString(((F=c.value)==null?void 0:F.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:t.withCtx(()=>{var F;return[t.createTextVNode(" "+t.toDisplayString(((F=c.value)==null?void 0:F.coefficient.name)??"Розничная цена"),1)]}),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass({"!text-red-600":d.value})},[h.value&&h.value!==f.value||x.value?(t.openBlock(),t.createElementBlock("div",Xp,[h.value&&h.value!==f.value?(t.openBlock(),t.createElementBlock("span",Yp,t.toDisplayString(_.value)+" "+t.toDisplayString(a.value),1)):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":d.value}])}," ("+t.toDisplayString(x.value)+"%) ",3)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(P=c.value)==null?void 0:P.readOnly,"font-bold":!c.value&&!r.value}])},[t.createElementVNode("span",{class:t.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":g.value&&n.eventEmitter}),onClick:N[0]||(N[0]=()=>{var F;g.value&&((F=n.eventEmitter)==null||F.emit("cost:click",{product:s.value,cost:f.value}))})},t.toDisplayString(b.value),3),t.createTextVNode(" "+t.toDisplayString(a.value)+" ",1),f.value&&!c.value&&"discount"in n.product&&n.product.discount?(t.openBlock(),t.createBlock($,{key:0},{trigger:t.withCtx(()=>[t.createVNode(v,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:t.withCtx(()=>[t.createElementVNode("span",null,' На продукт действует скидка "'+t.toDisplayString(o.value)+'"; ',1)]),_:1})):t.createCommentVNode("",!0)],2),y.value?(t.openBlock(),t.createElementBlock("span",Up," ~ "+t.toDisplayString(y.value)+" "+t.toDisplayString(l.value),1)):t.createCommentVNode("",!0),n.showCostDate&&!t.unref(V.isNil)(p.value)?(t.openBlock(),t.createElementBlock("span",Kp,[t.createTextVNode(t.toDisplayString(p.value)+" ",1),n.showPriceHistory&&n.eventEmitter?(t.openBlock(),t.createBlock($,{key:0,placement:"top-end",disabled:!t.unref(i)},{trigger:t.withCtx(()=>[t.createVNode(E,{class:"cursor-pointer",onClick:N[1]||(N[1]=F=>{var R;return(R=n.eventEmitter)==null?void 0:R.emit("cost:show-price-history",{product:s.value})})})]),default:t.withCtx(()=>[N[2]||(N[2]=t.createTextVNode(" История цен ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2)])}}}),Zp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Qp(n,e){return t.openBlock(),t.createElementBlock("svg",Zp,[...e[0]||(e[0]=[t.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),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),t.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const ho=t.markRaw({name:"ion-information-circle-outline",render:Qp}),Jp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function eg(n,e){return t.openBlock(),t.createElementBlock("svg",Jp,[...e[0]||(e[0]=[t.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),t.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 ac=t.markRaw({name:"ion-images",render:eg}),tg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ng(n,e){return t.openBlock(),t.createElementBlock("svg",tg,[...e[0]||(e[0]=[t.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 ig=t.markRaw({name:"ion-information-circle",render:ng}),rg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function og(n,e){return t.openBlock(),t.createElementBlock("svg",rg,[...e[0]||(e[0]=[t.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 sg=t.markRaw({name:"ion-bookmark",render:og});/*!
|
|
1
|
+
(function(j,W){typeof exports=="object"&&typeof module<"u"?W(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("vue"),require("date-fns"),require("pinia"),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","pinia","naive-ui","libphonenumber-js","ts-case-convert","vue-tel-input"],W):(j=typeof globalThis<"u"?globalThis:j||self,W(j.SC_VueUiLib={},j["@snabcentr/common-lib"],j["lodash-es"],j.Vue,j["date-fns"],j.pinia,j["naive-ui"],j["libphonenumber-js"],j["ts-case-convert"],j["vue-tel-input"]))})(this,(function(j,W,V,t,Be,Rm,I,Br,Ns,Pm){"use strict";var NT=Object.defineProperty;var Nm=j=>{throw TypeError(j)};var TT=(j,W,V)=>W in j?NT(j,W,{enumerable:!0,configurable:!0,writable:!0,value:V}):j[W]=V;var B=(j,W,V)=>TT(j,typeof W!="symbol"?W+"":W,V),Tm=(j,W,V)=>W.has(j)||Nm("Cannot "+V);var qt=(j,W,V)=>(Tm(j,W,"read from private field"),V?V.call(j):W.get(j)),Hl=(j,W,V)=>W.has(j)?Nm("Cannot add the same private member more than once"):W instanceof WeakSet?W.add(j):W.set(j,V),$m=(j,W,V,t)=>(Tm(j,W,"write to private field"),t?t.call(j,V):W.set(j,V),V);var qi,St,Cs;const Nr="Чтобы изменить, включите режим управления",Ts="Товар, который нужно предлагать клиенту",$s="Категория, которую нужно предлагать клиенту",Ft=class Ft{static init(e,i){Ft.messagesService&&Ft.notificationsService||(Ft.messagesService=e,Ft.notificationsService=i)}static getMessagesService(){if(!Ft.messagesService)throw new Error("UI provider is not initialized.");return Ft.messagesService}static getNotificationsService(){if(!Ft.notificationsService)throw new Error("UI provider is not initialized.");return Ft.notificationsService}static showNotificationsForErrorResponseData(e,i={}){var r,o;if(V.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";Ft.notificationsService?Ft.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{const s=[];for(const a in e.errors)Object.prototype.hasOwnProperty.call(i,a)?i[a]=new W.FieldValidationResultData(e.errors[a].toString(),"error"):s.push(e.errors[a].toString());Ft.showErrorMessages(s)}}static showErrorMessages(e){const{messagesService:i,notificationsService:r}=Ft;e.length===1&&i?i.error(e[0]):e.length>1&&r?r.error({title:"Ошибки выполнения запроса",meta:`Всего ошибок: ${e.length}`,content:()=>t.h("ul",{style:{maxHeight:"240px",overflowY:"auto",margin:0,paddingLeft:"1.25em",listStyleType:"disc"}},e.map(o=>t.h("li",o)))}):e.length>0&&console.log("Show notification error response data: UI provider is not initialized.",e)}};B(Ft,"messagesService"),B(Ft,"notificationsService");let Tr=Ft;const $r=new WeakMap,Fm=async n=>{const e=navigator.clipboard;if(e!=null&&e.writeText){await e.writeText(n);return}const i=document.createElement("textarea");i.value=n,i.style.position="fixed",i.style.opacity="0",document.body.append(i),i.select();const r=document.execCommand("copy");if(i.remove(),!r)throw new Error("Не удалось скопировать через execCommand.")},jl=async n=>{const e=V.isNil(n)?"":String(n);if(e)try{await Fm(e),Tr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{Tr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},Vm=n=>n.tagName==="BUTTON"||n.getAttribute("role")==="button"||!!n.closest("button"),Mm=(n,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":Vm(n)?"click":"dblclick",ql={mounted(n,e){n.style.setProperty("cursor","pointer");const i=Mm(n,e),r=o=>{var a;i==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=$r.get(n);jl(s==null?void 0:s.value).catch(V.noop)};$r.set(n,{value:e.value,eventName:i,handler:r}),n.addEventListener(i,r)},updated(n,e){const i=$r.get(n);i&&(i.value=e.value)},beforeUnmount(n){const e=$r.get(n);e&&(n.removeEventListener(e.eventName,e.handler),$r.delete(n))}},Im=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),Am=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",lo=new WeakMap,Xl=n=>!Im.has(n.type)&&!n.disabled&&!n.readOnly&&n.closest(Am)===null&&n.getClientRects().length>0,Yl=n=>{var a;if(n.key!=="Enter"&&n.code!=="Enter"||n.shiftKey||n.isComposing)return;const{target:e}=n;if(!(e instanceof HTMLInputElement)||!Xl(e))return;n.preventDefault();const i=n.currentTarget,r=[...i.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=lo.get(i))==null||a()},ai={mounted(n,e){lo.set(n,e.value),n.addEventListener("keydown",Yl)},updated(n,e){lo.set(n,e.value)},unmounted(n){n.removeEventListener("keydown",Yl),lo.delete(n)}};var ct=(n=>(n.NotInStock="not_in_stock",n.OnOrder="on_order",n.LargeOrder="large_order",n.NextDayDelivery="next_day_delivery",n))(ct||{});const Es={color:"#4b5563",backgroundColor:"#e5e7eb",textOnBackgroundColor:"#1f2937"},Ul=new Map([[W.OrderStatusEnum.New,{color:"#15803d",backgroundColor:"#bbf7d0",textOnBackgroundColor:"#166534"}],[W.OrderStatusEnum.Processing,{color:"#ea580c",backgroundColor:"#fed7aa",textOnBackgroundColor:"#9a3412"}],[W.OrderStatusEnum.AwaitingSupplyProducts,{color:"#ca8a04",backgroundColor:"#fef08a",textOnBackgroundColor:"#854d0e"}],[W.OrderStatusEnum.InvoiceIssued,{color:"#1d4ed8",backgroundColor:"#bfdbfe",textOnBackgroundColor:"#1e40af"}],[W.OrderStatusEnum.ProcessingOnStock,{color:"#0e7490",backgroundColor:"#a5f3fc",textOnBackgroundColor:"#155e75"}],[W.OrderStatusEnum.OrderUpdated,{color:"#6d28d9",backgroundColor:"#ddd6fe",textOnBackgroundColor:"#5b21b6"}],[W.OrderStatusEnum.Finished,{color:"#475569",backgroundColor:"#e2e8f0",textOnBackgroundColor:"#1e293b"}],[W.OrderStatusEnum.Canceled,{color:"#b91c1c",backgroundColor:"#fecaca",textOnBackgroundColor:"#991b1b"}],[W.OrderStatusEnum.Error,{color:"#991b1b",backgroundColor:"#fca5a5",textOnBackgroundColor:"#7f1d1d"}]]),ki=n=>Ul.get(n)??Es,Kl=n=>{const e=ki(n);return{color:e.backgroundColor,textColor:e.textOnBackgroundColor,borderColor:e.color}},Gl=n=>{const e=ki(n);return{"--sc-order-status-color":e.color,"--sc-order-status-bg":e.backgroundColor,"--sc-order-status-text":e.textOnBackgroundColor}},Rs=new Map([[ct.NotInStock,{color:"#ef4444",backgroundColor:"#f7ff00",textOnBackgroundColor:"#ff0000"}],[ct.OnOrder,{color:"#ca8a04",backgroundColor:"#f7ff00",textOnBackgroundColor:"#ff0000"}],[ct.LargeOrder,{color:"#ef2929",backgroundColor:"#ef2929",textOnBackgroundColor:"#ffffff"}],[ct.NextDayDelivery,{color:"#ef2929",backgroundColor:"#ef2929",textOnBackgroundColor:"#ffffff"}]]),Zl=new Map([[ct.NotInStock,"Нет в наличии"],[ct.OnOrder,"Под заказ"],[ct.LargeOrder,"Крупный заказ"],[ct.NextDayDelivery,"Доставка на завтра"]]),co=[...Rs.keys()],Er=n=>Rs.get(n)??Es,Ps=n=>Zl.get(n)??n,Fs=n=>{const e=[];return n.isNotInStock&&e.push(ct.NotInStock),n.isOnOrder&&e.push(ct.OnOrder),n.isLargeOrder&&e.push(ct.LargeOrder),!V.isNil(n.delivery.date)&&Be.isTomorrow(new Date(n.delivery.date))&&e.push(ct.NextDayDelivery),e};var Ie=(n=>(n.AttachedUser="attached_user",n.ClientInfo="client_info",n.ClientInfoShort="client_info_short",n.CreatedAt="created_at",n.ClientCity="client_city",n.DeliveryInfo="delivery_info",n.DeliveryDate="delivery_date",n.Id="id",n.PaymentType="payment_type",n.SalesDirections="sales_directions",n.Status="status",n.actions="actions",n))(Ie||{}),Xe=(n=>(n.phone="phone",n.tablet="tablet",n.laptop="laptop",n))(Xe||{});const Ct=class Ct{static init(){Ct.isInitialized||(Ct.isInitialized=!0,Ct.windowResizeHandler(),window.addEventListener("resize",Ct.windowResizeHandler))}static destroy(){window.removeEventListener("resize",Ct.windowResizeHandler),Ct.isInitialized=!1}static getDeviceTypeByResolution(){const e=W.useBaseConfigStateStore().config.deviceTypeByResolution;return window.innerWidth<e.tablet?Xe.phone:window.innerWidth<e.laptop?Xe.tablet:Xe.laptop}static initRefDependingOnDeviceResolution(e,i,r){const o=t.ref(r);return Ct.setRefValueDependingOnDeviceResolution(o,e,i,r),Ct.refsDependingOnDeviceResolution.push({r:o,phoneValue:e,tabletValue:i,defaultValue:r}),o}static isPhoneDevice(){return Ct.getDeviceTypeByResolution()===Xe.phone}static isTabletDevice(){return Ct.getDeviceTypeByResolution()===Xe.tablet}static isLaptopDevice(){return Ct.getDeviceTypeByResolution()===Xe.laptop}static setRefValueDependingOnDeviceResolution(e,i,r,o){switch(Ct.getDeviceTypeByResolution()){case Xe.phone:e.value=i;break;case Xe.tablet:e.value=r;break;default:e.value=o;break}}static windowResizeHandler(){V.forEach(Ct.refsDependingOnDeviceResolution,e=>{Ct.setRefValueDependingOnDeviceResolution(e.r,e.phoneValue,e.tabletValue,e.defaultValue)})}};B(Ct,"isInitialized",!1),B(Ct,"refsDependingOnDeviceResolution",[]);let Ue=Ct;function Ql(){try{return Ue.getDeviceTypeByResolution()}catch(n){return console.error(n),Xe.laptop}}function Om(){const n=t.ref(Ql()),e=t.computed(()=>n.value===Xe.phone||n.value===Xe.tablet),i=()=>{n.value=Ql()};return t.onMounted(()=>{window.addEventListener("resize",i)}),t.onUnmounted(()=>{window.removeEventListener("resize",i)}),{isCompactLayout:e}}const zm="(hover: hover) and (pointer: fine)",uo=()=>{const n=V.isFunction(globalThis.matchMedia)?globalThis.matchMedia(zm):void 0,e=t.ref(n?n.matches:!0),i=r=>{e.value=r.matches};return n==null||n.addEventListener("change",i),t.onScopeDispose(()=>{n==null||n.removeEventListener("change",i)},!0),t.readonly(e)},Dm=".sc-versions-list";function Lm(n,e,i){const r=document.querySelectorAll(Dm);if(r.length===0)return;const o=r[0],s=`${n}:`;if(V.some(o.querySelectorAll("li"),l=>V.startsWith(V.trim(l.textContent||""),s)))return;const a=document.createElement("li");a.append(document.createTextNode(`${s} ${e} от ${Be.format(i,"dd.MM.yyyy")}`)),o.append(a)}class Ci{static isVnodeEmpty(e){return e.every(i=>i.type===t.Comment||i.type===t.Text&&V.isString(i.children)&&!i.children.trim()?!0:i.type===t.Fragment&&Ci.isVnodeEmpty(i.children))}static hasSlotContent(e){return e?!Ci.isVnodeEmpty(e()):!1}}class ir{static getDefaultCurrency(){var i;if(!Rm.getActivePinia())return;const e=W.useBaseConfigStateStore().getConfig().defaultCurrency;return(i=W.useReferencesStore().currencyReference)==null?void 0:i.find(r=>r.signature===e)}static getPrecision(e){var i;return(e==null?void 0:e.precision)??((i=ir.getDefaultCurrency())==null?void 0:i.precision)}}const Hm={readAsFileData(n){return new Promise((e,i)=>{const r=new FileReader;r.addEventListener("load",()=>{e({name:n.name,content:r.result})}),r.addEventListener("error",()=>{i(new Error(`Не удалось прочитать файл «${n.name}».`))}),r.readAsDataURL(n)})}};class li{static isDeleted(e){return!!(e.deletedAt&&!Be.isFuture(e.deletedAt))}static getFormatEntityName(e){return li.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const ft=(n,e=!1)=>{const{key:i}=n;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(i)&&!((n.ctrlKey||n.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(i.toLowerCase()))){if(e&&i==="-"){const r=n.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(i)||n.preventDefault()}},fo=(n,e=".",i=!1)=>{const{key:r}=n,o=n.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(n.ctrlKey||n.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||i&&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)||n.preventDefault()},ht=n=>n?Number.parseFloat(n.replace(",",".")):null,dt=(n,e)=>{n[e]={}},He=n=>{const e=n.target;setTimeout(()=>{e.select()},100)},Ye=class Ye{static getDecimalsCount(e){if(!Number.isFinite(e)||Number.isInteger(e))return 0;const[i,r]=V.split(e.toString(),"e"),o=V.split(i,"."),s=o.length>1?o[1].length:0;return Math.max(s-(Number(r)||0),0)}static normalize(e){return Number.isFinite(e)?Number(e.toPrecision(Ye.significantDigits)):e}static multiplyByStep(e,i){return V.round(e*i,Ye.getDecimalsCount(i)+Ye.getDecimalsCount(e))}static divideByStep(e,i){return Ye.normalize(e/i)}static isMultipleOf(e,i){const r=e/i;return Math.abs(r-Math.round(r))<Ye.epsilon}static isLessOrEqual(e,i){return e<=i+Ye.epsilon}static roundCoordinate(e){return V.round(e,Ye.coordinateFractionDigits)}static roundMoney(e,i=ir.getPrecision()){return i===void 0?Ye.normalize(e):V.round(e,i)}static floorMoney(e,i=ir.getPrecision()){return i===void 0?Ye.normalize(e):V.floor(e,i)}static roundPercent(e,i=Ye.percentFractionDigits){return V.round(e,i)}static formatMoney(e,i=ir.getPrecision()){let r=Ye.moneyFormatters.get(i);return r||(r=new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:i,maximumFractionDigits:i}),Ye.moneyFormatters.set(i,r)),r.format(Ye.normalize(e))}static formatPercent(e,i=Ye.percentDisplayFractionDigits){return new Intl.NumberFormat("ru-RU",{style:"decimal",maximumFractionDigits:i}).format(e)}static formatArea(e){return Ye.areaFormatter.format(e)}};B(Ye,"percentFractionDigits",5),B(Ye,"percentDisplayFractionDigits",2),B(Ye,"areaFractionDigits",4),B(Ye,"coordinateFractionDigits",6),B(Ye,"significantDigits",12),B(Ye,"epsilon",1e-6),B(Ye,"moneyFormatters",new Map),B(Ye,"areaFormatter",new Intl.NumberFormat("ru-RU",{style:"decimal",maximumFractionDigits:Ye.areaFractionDigits}));let Ve=Ye;function Jl(n){return n.itemCount&&n.itemCount>0?`Всего ${n.itemCount} записей`:""}class wt{static convertReferencesToOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):li.getFormatEntityName(c),value:c.id,item:c,disabled:a?a(c):!1}));return i&&(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(V.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=V.isString(r.key)?V.get(d,r.key):r.key(c),f=V.isString(r.label)?V.get(d,r.label):r.label(c);return{type:"group",label:V.isEmpty(f)?"- Не определено -":f,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){return wt.convertReferencesToOptionsList(e,i,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,i=!1,r=!1,o=!1,s=void 0,a=void 0){return wt.convertReferencesToOptionsList(e,i,r,o,s,a)}}const Wm={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},ce={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(n){return{type:"number",min:n,trigger:["blur","input"],message:`Минимальное значение: ${n}`}},max(n){return{type:"number",max:n,trigger:["blur","input"],message:`Максимальное значение: ${n}`}},step(n){return{type:"number",trigger:["blur","input"],validator:(e,i)=>i===null||Ve.isMultipleOf(i,n)?!0:new Error(`Значение должно быть кратно ${n}`)}}},jm={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},We={serverValidation(n){return{validator:(e,i)=>i===null?!0:n?new Error(n):!0}}},Vs=n=>{var e;return((e=n.properties)==null?void 0:e.files)??[]},ec=n=>{var e,i;return!!((e=n.properties)!=null&&e.description)||!!((i=n.properties)!=null&&i.specification)||Vs(n).length>0},ji=class ji{static isM2Category(e){var i;return((i=e.properties)==null?void 0:i.allowSetM2ClientPrice)??!1}static findReferenceProduct(e){var i;return(i=e.products)==null?void 0:i.find(r=>{var o,s,a;return((o=r.category)==null?void 0:o.id)===e.id&&(!!((s=r.properties)!=null&&s.length)||!!((a=r.properties)!=null&&a.width))})}static getSquare(e){var i,r;return(((i=e.properties)==null?void 0:i.width)??ji.defaultLinearSizeMm)*(((r=e.properties)==null?void 0:r.length)??ji.defaultLinearSizeMm)/1e6}static toM2Cost(e,i){return e/ji.getSquare(i)}static calculateM2Cost(e,i,r){var s,a;const o=V.isNil(i)?e.retailCost??e.cost:(a=(s=e.priceCoefficients)==null?void 0:s.find(l=>l.coefficient.id===i.id))==null?void 0:a.cost;return V.isNil(o)?void 0:ji.toM2Cost(o*(1+(r??0)/100),e)}};B(ji,"defaultLinearSizeMm",1e3);let vi=ji;const qm={},Xm=t.defineComponent({...qm,__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(n,{emit:e}){const i=n,r=e,o=t.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},a=()=>{i.disableConfirm?s():o.value=!0};return(l,c)=>{const d=I.NButton,u=I.NPopover,f=I.NModal;return t.openBlock(),t.createElementBlock("div",null,[t.createVNode(u,{disabled:n.popoverText.length===0,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(d,{disabled:n.disabled,ghost:n.ghost,loading:n.loading,size:n.size,type:n.type,quaternary:n.quaternary,circle:n.circle,onClick:a},{default:t.withCtx(()=>[t.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(n.popoverText),1)]),_:3},8,["disabled"]),t.createVNode(f,{show:o.value,"onUpdate:show":c[1]||(c[1]=h=>o.value=h),content:n.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:n.dialogTitle,"action-class":"",preset:"dialog"},{action:t.withCtx(()=>[t.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:t.withCtx(()=>[...c[2]||(c[2]=[t.createTextVNode(" Да ",-1)])]),_:1}),t.createVNode(d,{type:"default",onClick:c[0]||(c[0]=h=>o.value=!1)},{default:t.withCtx(()=>[...c[3]||(c[3]=[t.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),Ym={class:"flex gap-2 overflow-x-auto max-sm:flex-nowrap sm:flex-wrap sm:overflow-visible"},Um={},Km=t.defineComponent({...Um,__name:"chip-group",props:{items:{},modelValue:{}},emits:["update:modelValue"],setup(n,{emit:e}){const i=e;return(r,o)=>(t.openBlock(),t.createElementBlock("div",Ym,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.items,s=>(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:s.key,class:"shrink-0",round:"",size:"small",type:n.modelValue===s.key?"primary":"default",onClick:a=>i("update:modelValue",s.key)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.label),1)]),_:2},1032,["type","onClick"]))),128))]))}}),Gm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zm(n,e){return t.openBlock(),t.createElementBlock("svg",Gm,[...e[0]||(e[0]=[t.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),t.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),t.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Ms=t.markRaw({name:"ion-ellipsis-vertical-sharp",render:Zm}),Qm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Jm(n,e){return t.openBlock(),t.createElementBlock("svg",Qm,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),t.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const tc=t.markRaw({name:"tabler-edit",render:Jm}),ep={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tp(n,e){return t.openBlock(),t.createElementBlock("svg",ep,[...e[0]||(e[0]=[t.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 nc=t.markRaw({name:"ion-checkmark-done-circle",render:tp}),np={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ip(n,e){return t.openBlock(),t.createElementBlock("svg",np,[...e[0]||(e[0]=[t.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),t.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 ic=t.markRaw({name:"ion-checkmark-done-circle-outline",render:ip}),rp={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function op(n,e){return t.openBlock(),t.createElementBlock("svg",rp,[...e[0]||(e[0]=[t.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 sp=t.markRaw({name:"fluent-pin32-regular",render:op}),ap={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function lp(n,e){return t.openBlock(),t.createElementBlock("svg",ap,[...e[0]||(e[0]=[t.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),t.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const cp=t.markRaw({name:"ion-eye-outline",render:lp}),dp={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function up(n,e){return t.openBlock(),t.createElementBlock("svg",dp,[...e[0]||(e[0]=[t.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 fp=t.markRaw({name:"fluent-pin32-filled",render:up}),hp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function mp(n,e){return t.openBlock(),t.createElementBlock("svg",hp,[...e[0]||(e[0]=[t.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 pp=t.markRaw({name:"ion-bookmark-outline",render:mp}),gp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yp(n,e){return t.openBlock(),t.createElementBlock("svg",gp,[...e[0]||(e[0]=[t.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),t.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 bp=t.markRaw({name:"ion-eye-off-sharp",render:yp}),_p={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function wp(n,e){return t.openBlock(),t.createElementBlock("svg",_p,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const xp=t.markRaw({name:"ion-chevron-forward-outline",render:wp}),kp=["data-name"],Cp={class:"sc-collapse-item-header flex flex-row gap-2.5"},vp={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},Sp={key:0},Bp={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Np={class:"flex flex-1 flex-col"},Tp={key:0,class:"sc-collapse-item-sub-title flex-1"},$p={key:1,class:"sc-collapse-item-title-extra flex-none"},Ep={key:0,class:"sc-collapse-item-content"},Rp={},Pp=t.defineComponent({...Rp,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.inject("itemHeaderClickHandler",V.noop),a=t.inject("defaultExpandedNames",[]),l=t.inject("expandedNames",[]),c=V.some(a,g=>g===r.name),d=t.computed(()=>V.some(l,g=>g===r.name)),u=t.ref(c),f=()=>{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||f()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,o("header:click",r.name,u.value),s(r.name,u.value))},expanded:t.readonly(u)}),(g,b)=>{const y=xp;return t.openBlock(),t.createElementBlock("div",{"data-name":n.name,class:t.normalizeClass([{"cursor-not-allowed text-gray-400":n.disabled},"sc-collapse-item flex flex-col p-2"])},[t.createElementVNode("div",Cp,[t.createElementVNode("div",vp,[t.createElementVNode("div",{class:t.normalizeClass({"rotate-90":u.value}),onClick:f},[t.renderSlot(g.$slots,"arrow",{},()=>[t.createVNode(y)],!0)],2)]),t.unref(Ci).hasSlotContent(g.$slots["pre-arrow"])?(t.openBlock(),t.createElementBlock("div",Sp,[t.createElementVNode("div",Bp,[t.renderSlot(g.$slots,"pre-arrow",{},void 0,!0)])])):t.createCommentVNode("",!0),t.createElementVNode("div",Np,[t.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:f},[t.renderSlot(g.$slots,"header",{},()=>[t.createTextVNode(t.toDisplayString(n.title),1)],!0)]),t.unref(Ci).hasSlotContent(g.$slots["sub-header"])?(t.openBlock(),t.createElementBlock("div",Tp,[t.renderSlot(g.$slots,"sub-header",{},void 0,!0)])):t.createCommentVNode("",!0)]),t.unref(Ci).hasSlotContent(g.$slots["header-extra"])?(t.openBlock(),t.createElementBlock("div",$p,[t.renderSlot(g.$slots,"header-extra",{},void 0,!0)])):t.createCommentVNode("",!0)]),t.createVNode(t.Transition,{name:"fade"},{default:t.withCtx(()=>[d.value||u.value?(t.openBlock(),t.createElementBlock("div",Ep,[t.renderSlot(g.$slots,"default",{},void 0,!0)])):t.createCommentVNode("",!0)]),_:3})],10,kp)}}}),gn=(n,e)=>{const i=n.__vccOpts||n;for(const[r,o]of e)i[r]=o;return i},rc=gn(Pp,[["__scopeId","data-v-22a74c45"]]),Fp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vp(n,e){return t.openBlock(),t.createElementBlock("svg",Fp,[...e[0]||(e[0]=[t.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),t.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),t.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 oc=t.markRaw({name:"ion-cart-outline",render:Vp}),Rr=Symbol(),Mp={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"}},Ip={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},Ap={class:"inline-flex"},Op={},sc=t.defineComponent({...Op,__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(n){const e=n,i=t.inject(Rr,"medium"),r=uo(),o=t.computed(()=>V.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),s=t.computed(()=>V.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),a=t.computed(()=>V.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),l=t.computed(()=>a.value==="disabled"?`${Ts}. ${Nr}`:Ts),c=t.computed(()=>V.isNil(e.productContextButtonsConfig)?[]:V.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),d=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},u=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},f=()=>{e.eventEmitter.emit("product:required",{product:e.product})},h=p=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:p})};return(p,m)=>{var k;const g=ic,b=nc,y=I.NButton,_=I.NTooltip,x=tc,w=oc,C=Ms,N=I.NDropdown;return t.openBlock(),t.createElementBlock("div",Ip,[a.value?(t.openBlock(),t.createBlock(_,{key:0,placement:"bottom",trigger:"hover",disabled:!t.unref(r)},{trigger:t.withCtx(()=>[t.createElementVNode("span",Ap,[t.createVNode(y,{ghost:!0,size:t.unref(i),disabled:a.value==="disabled",type:n.product.isRequired?"primary":"default",onClick:f},{default:t.withCtx(()=>[n.product.isRequired?(t.openBlock(),t.createBlock(b,{key:1})):(t.openBlock(),t.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(l.value),1)]),_:1},8,["disabled"])):t.createCommentVNode("",!0),s.value?(t.openBlock(),t.createBlock(_,{key:1,placement:"bottom",trigger:"hover",disabled:!t.unref(r)},{trigger:t.withCtx(()=>[t.createVNode(y,{ghost:!0,size:t.unref(i),type:"primary",disabled:s.value==="disabled",onClick:u},{default:t.withCtx(()=>[t.createVNode(x)]),_:1},8,["size","disabled"])]),default:t.withCtx(()=>[m[0]||(m[0]=t.createTextVNode(" Редактировать ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createBlock(_,{key:2,placement:"bottom",trigger:"hover",disabled:!t.unref(r)},{trigger:t.withCtx(()=>[t.createVNode(y,{ghost:!0,size:t.unref(i),disabled:o.value==="disabled",type:"primary",onClick:d},{default:t.withCtx(()=>[t.createVNode(w)]),_:1},8,["size","disabled"])]),default:t.withCtx(()=>[m[1]||(m[1]=t.createTextVNode(" Добавить в корзину ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),((k=c.value)==null?void 0:k.length)>0?(t.openBlock(),t.createBlock(N,{key:3,options:c.value,size:t.unref(i),trigger:"click",onSelect:h},{default:t.withCtx(()=>[t.createVNode(y,{ghost:!0,size:t.unref(i),type:"primary"},{default:t.withCtx(()=>[t.createVNode(C)]),_:1},8,["size"])]),_:1},8,["options","size"])):t.createCommentVNode("",!0)])}}}),zp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Dp(n,e){return t.openBlock(),t.createElementBlock("svg",zp,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.createElementVNode("path",{d:"M12 8v4l2 2"}),t.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const Lp=t.markRaw({name:"tabler-history",render:Dp}),Hp={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Wp(n,e){return t.openBlock(),t.createElementBlock("svg",Hp,[...e[0]||(e[0]=[t.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 jp=t.markRaw({name:"mdi-percent-outline",render:Wp}),qp={class:"flex flex-row gap-1"},Xp={key:0,class:"flex gap-1"},Yp={key:0,class:"flex text-nowrap text-sm line-through"},Up={key:1,class:"flex flex-row text-nowrap text-sm"},Kp={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},Gp={},ci=t.defineComponent({...Gp,__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(n){var w;const e=n,i=uo(),r=t.computed(()=>"product"in e.product),o=t.computed(()=>"discount"in e.product&&e.product.discount?li.getFormatEntityName(e.product.discount):""),s=t.computed(()=>"product"in e.product?e.product.product:e.product),a=t.computed(()=>V.isNil(f.value)?"":e.showQuantityUnit?V.compact([s.value.currency.symbol,s.value.unit.name]).join("/"):e.showCurrency?s.value.currency.symbol:""),l=t.computed(()=>e.showQuantityUnit?V.compact(["₽",s.value.unit.name]).join("/"):e.showCurrency?"₽":""),c=t.computed(()=>V.find(s.value.priceCoefficients,["coefficient.slug",e.costFieldName])),d=t.computed(()=>{const C=V.find(s.value.priceCoefficients,["coefficient.slug","k0"]);return c.value||!C||V.isNil(f.value)||V.isNil(C.cost)?!1:f.value<C.cost}),u=((w=W.useBaseConfigStateStore().getConfig())==null?void 0:w.defaultCurrency)??"RUB",f=t.computed(()=>c.value?c.value.cost:V.get(e.product,e.costFieldName)),h=t.computed(()=>e.additionalThroughFieldName?V.get(e.product,e.additionalThroughFieldName):void 0),p=t.computed(()=>s.value.costDate?Be.format(s.value.costDate,W.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),m=t.computed(()=>e.currencyRates||s.value.currency.signature===u?e.currencyRates:{[s.value.currency.signature]:s.value.costRub/s.value.cost}),g=t.computed(()=>(V.isFunction(e.allowPriceClick)?e.allowPriceClick(s.value):e.allowPriceClick)&&!V.isNil(f.value)),b=t.computed(()=>V.isNil(f.value)?"-":Ve.formatMoney(Number.parseFloat(f.value),s.value.currency.precision)),y=t.computed(()=>{if(s.value.currency.signature===u||!m.value||!m.value[s.value.currency.signature])return null;const C=m.value[s.value.currency.signature];return Ve.formatMoney(Number.parseFloat(f.value)*C)}),_=t.computed(()=>V.isNil(h.value)?null:Ve.formatMoney(h.value,s.value.currency.precision)),x=t.computed(()=>{if(!h.value||!f.value||h.value===f.value||f.value===0)return null;const C=(f.value-h.value)/h.value*100;return Ve.formatPercent(C)});return(C,N)=>{var P;const k=I.NTag,$=I.NTooltip,v=jp,E=Lp;return t.openBlock(),t.createElementBlock("div",qp,[n.showTag?(t.openBlock(),t.createBlock($,{key:0},{trigger:t.withCtx(()=>[t.createVNode(k,{round:"",bordered:!1,size:"small",class:t.normalizeClass(["text-slate-600",{"font-bold":!c.value}])},{default:t.withCtx(()=>{var F;return[t.createTextVNode(t.toDisplayString(((F=c.value)==null?void 0:F.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:t.withCtx(()=>{var F;return[t.createTextVNode(" "+t.toDisplayString(((F=c.value)==null?void 0:F.coefficient.name)??"Розничная цена"),1)]}),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass({"!text-red-600":d.value})},[h.value&&h.value!==f.value||x.value?(t.openBlock(),t.createElementBlock("div",Xp,[h.value&&h.value!==f.value?(t.openBlock(),t.createElementBlock("span",Yp,t.toDisplayString(_.value)+" "+t.toDisplayString(a.value),1)):t.createCommentVNode("",!0),x.value?(t.openBlock(),t.createElementBlock("span",{key:1,class:t.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":d.value}])}," ("+t.toDisplayString(x.value)+"%) ",3)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),t.createElementVNode("span",{class:t.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(P=c.value)==null?void 0:P.readOnly,"font-bold":!c.value&&!r.value}])},[t.createElementVNode("span",{class:t.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":g.value&&n.eventEmitter}),onClick:N[0]||(N[0]=()=>{var F;g.value&&((F=n.eventEmitter)==null||F.emit("cost:click",{product:s.value,cost:f.value}))})},t.toDisplayString(b.value),3),t.createTextVNode(" "+t.toDisplayString(a.value)+" ",1),f.value&&!c.value&&"discount"in n.product&&n.product.discount?(t.openBlock(),t.createBlock($,{key:0},{trigger:t.withCtx(()=>[t.createVNode(v,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:t.withCtx(()=>[t.createElementVNode("span",null,' На продукт действует скидка "'+t.toDisplayString(o.value)+'"; ',1)]),_:1})):t.createCommentVNode("",!0)],2),y.value?(t.openBlock(),t.createElementBlock("span",Up," ~ "+t.toDisplayString(y.value)+" "+t.toDisplayString(l.value),1)):t.createCommentVNode("",!0),n.showCostDate&&!t.unref(V.isNil)(p.value)?(t.openBlock(),t.createElementBlock("span",Kp,[t.createTextVNode(t.toDisplayString(p.value)+" ",1),n.showPriceHistory&&n.eventEmitter?(t.openBlock(),t.createBlock($,{key:0,placement:"top-end",disabled:!t.unref(i)},{trigger:t.withCtx(()=>[t.createVNode(E,{class:"cursor-pointer",onClick:N[1]||(N[1]=F=>{var R;return(R=n.eventEmitter)==null?void 0:R.emit("cost:show-price-history",{product:s.value})})})]),default:t.withCtx(()=>[N[2]||(N[2]=t.createTextVNode(" История цен ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2)])}}}),Zp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Qp(n,e){return t.openBlock(),t.createElementBlock("svg",Zp,[...e[0]||(e[0]=[t.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),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),t.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const ho=t.markRaw({name:"ion-information-circle-outline",render:Qp}),Jp={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function eg(n,e){return t.openBlock(),t.createElementBlock("svg",Jp,[...e[0]||(e[0]=[t.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),t.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 ac=t.markRaw({name:"ion-images",render:eg}),tg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ng(n,e){return t.openBlock(),t.createElementBlock("svg",tg,[...e[0]||(e[0]=[t.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 ig=t.markRaw({name:"ion-information-circle",render:ng}),rg={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function og(n,e){return t.openBlock(),t.createElementBlock("svg",rg,[...e[0]||(e[0]=[t.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 sg=t.markRaw({name:"ion-bookmark",render:og});/*!
|
|
2
2
|
* lightgallery | 2.9.0 | October 1st 2025
|
|
3
3
|
* http://www.lightgalleryjs.com/
|
|
4
4
|
* Copyright (c) 2020 Sachin Neravath;
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
}
|
|
101
101
|
gl_FragColor = texel;
|
|
102
102
|
}
|
|
103
|
-
`}},Ao=Ni.Multiply,D0=[1,0,0,0,1,0,0,0,1],hi=new Bn(9),L0=Tt.Utils,Od=new ie,ya=new Bn([0,0,1,0,0,1,0,1,1,0,1,1]),Be={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Je.document?Je.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Ni,group:{removeChild:function(n,e){if(n.children)for(let i=0;i<n.children.length;i++)Be.group.removeChild(n.children[i],e);n._renderer.texture&&(e.deleteTexture(n._renderer.texture),delete n._renderer.texture),n._renderer.positionBuffer&&(e.deleteBuffer(n._renderer.positionBuffer),delete n._renderer.positionBuffer)},render:function(n,e){if(!this._visible)return;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const i=this.parent,r=i._matrix&&i._matrix.manual||i._flagMatrix,o=this._matrix.manual||this._flagMatrix;if((r||o)&&(this._renderer.matrix||(this._renderer.matrix=new Bn(9)),this._matrix.toTransformArray(!0,hi),Ao(hi,i._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ie||(this._renderer.scale=new ie),this._scale instanceof ie?(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(i._renderer.type)||(this._renderer.scale.x*=i._renderer.scale.x,this._renderer.scale.y*=i._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST),n.stencilFunc(n.ALWAYS,1,0),n.stencilOp(n.KEEP,n.KEEP,n.REPLACE),n.colorMask(!1,!1,!1,!1);const a=Tt.Utils.getRendererType(this._mask._renderer.type);Be[a].render.call(this._mask,n,e,this),n.stencilFunc(n.EQUAL,1,255),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.colorMask(!0,!0,!0,!0)}this._flagOpacity=i._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(i&&i._renderer?i._renderer.opacity:1);let s;if(this._flagSubtractions)for(s=0;s<this.subtractions.length;s++)Be.group.removeChild(this.subtractions[s],n);for(s=0;s<this.children.length;s++){const a=this.children[s],l=Tt.Utils.getRendererType(a._renderer.type);Be[l].render.call(a,n,e)}return this._mask&&n.disable(n.STENCIL_TEST),re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(n,e){let i,r,o,s,a,l,c,d,u,f,h,p,m,g;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,x=n.renderer.ratio,w=Od.copy(e._renderer.scale).multiply(x),C=e._stroke,N=e._linewidth,k=e._fill,$=e._renderer.opacity||e._opacity,v=e._cap,E=e._join,P=e._miter,F=e._closed,R=e.dashes,M=b.length,X=M-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*w.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*w.y),1);const G=e._renderer.rect.centroid,Z=G.x,O=G.y;if(_.clearRect(0,0,y.width,y.height),k)if(typeof k=="string")_.fillStyle=k;else{const q=Tt.Utils.getRendererType(k._renderer.type);Be[q].render.call(k,_,e),_.fillStyle=k._renderer.effect}if(C){if(typeof C=="string")_.strokeStyle=C;else{const q=Tt.Utils.getRendererType(C._renderer.type);Be[q].render.call(C,_,e),_.strokeStyle=C._renderer.effect}N&&(_.lineWidth=Nn(e)),P&&(_.miterLimit=P),E&&(_.lineJoin=E),!F&&v&&(_.lineCap=v)}typeof $=="number"&&(_.globalAlpha=$),R&&R.length>0&&(_.lineDashOffset=R.offset||0,_.setLineDash(R));let A,Y,H,T,D,K,J,U;_.save(),_.scale(w.x,w.y),_.translate(Z,O),_.beginPath();for(let q=0;q<b.length;q++){const L=b[q];switch(p=L.x,m=L.y,L.command){case ne.close:_.closePath();break;case ne.arc:Y=L.rx,H=L.ry,T=L.xAxisRotation,D=L.largeArcFlag,K=L.sweepFlag,i=F?ut(q-1,M):Math.max(q-1,0),r=b[i],J=r.x,U=r.y,L0.renderSvgArcCommand(_,J,U,Y,H,D,K,T,p,m);break;case ne.curve:i=F?ut(q-1,M):Math.max(q-1,0),r=b[i],d=r.controls&&r.controls.right||ie.zero,u=L.controls&&L.controls.left||ie.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),L._relative?(s=u.x+L.x,a=u.y+L.y):(s=u.x,a=u.y),_.bezierCurveTo(l,c,s,a,p,m),q>=X&&F&&(o=A,f=L.controls&&L.controls.right||ie.zero,h=o.controls&&o.controls.left||ie.zero,L._relative?(l=f.x+L.x,c=f.y+L.y):(l=f.x,c=f.y),o._relative?(s=h.x+o.x,a=h.y+o.y):(s=h.x,a=h.y),p=o.x,m=o.y,_.bezierCurveTo(l,c,s,a,p,m));break;case ne.line:_.lineTo(p,m);break;case ne.move:A=L,_.moveTo(p,m);break}}F&&_.closePath(),Be.isHidden.test(k)||(g=k._renderer&&k._renderer.offset,g&&(_.save(),_.translate(-k._renderer.offset.x,-k._renderer.offset.y),_.scale(k._renderer.scale.x,k._renderer.scale.y)),_.fill(),g&&_.restore()),Be.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(n,e,i){let r=1/0,o=-1/0,s=1/0,a=-1/0,l,c;n.forEach(function(d){const u=d.x,f=d.y,h=d.controls;let p,m,g,b,y,_;s=Math.min(f,s),r=Math.min(u,r),o=Math.max(u,o),a=Math.max(f,a),d.controls&&(y=h.left,_=h.right,!(!y||!_)&&(p=d._relative?y.x+u:y.x,m=d._relative?y.y+f:y.y,g=d._relative?_.x+u:_.x,b=d._relative?_.y+f:_.y,!(!p||!m||!g||!b)&&(s=Math.min(m,b,s),r=Math.min(p,g,r),o=Math.max(p,g,o),a=Math.max(m,b,a))))}),typeof e=="number"&&(s-=e,r-=e,o+=e,a+=e),l=o-r,c=a-s,i.top=s,i.left=r,i.right=o,i.bottom=a,i.width=l,i.height=c,i.centroid||(i.centroid={}),i.centroid.x=-r,i.centroid.y=-s},render:function(n,e,i){if(!this._visible||!this._opacity)return this;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=i||this.parent,o=Tt.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 et&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof tt&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof et&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof tt&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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 Bn(9)),this._matrix.toTransformArray(!0,hi),Ao(hi,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ie||(this._renderer.scale=new ie);let f,h;this._scale instanceof ie?(f=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=h<0?-h:h,c&&(this._renderer.parent=r)}if(this._mask){n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST),n.stencilFunc(n.ALWAYS,1,0),n.stencilOp(n.KEEP,n.KEEP,n.REPLACE),n.colorMask(!1,!1,!1,!1);const f=Tt.Utils.getRendererType(this._mask._renderer.type);Be[f].render.call(this._mask,n,e,this),n.stencilFunc(n.EQUAL,1,255),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,Be.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),Be.updateTexture.call(Be,n,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!this._renderer.texture)return this;e.current!==s&&(n.useProgram(s),n.bindBuffer(n.ARRAY_BUFFER,e.buffers.position),n.vertexAttribPointer(s.position,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(s.position),n.bufferData(n.ARRAY_BUFFER,ya,n.STATIC_DRAW),e.resolution.flagged||n.uniform2f(n.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&n.uniform2f(n.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),n.bindTexture(n.TEXTURE_2D,this._renderer.texture);const u=this._renderer.rect;return n.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),n.uniform4f(s.rect,u.left,u.top,u.right,u.bottom),n.drawArrays(n.TRIANGLES,0,6),this._mask&&n.disable(n.STENCIL_TEST),re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(n,e){let i;const r=this.canvas,o=this.ctx,s=n.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,f=e._size*s;let h=f;Be.isHidden.test(a)||(h+=l),r.width=vc(h),r.height=r.width;const p=h/r.width,m=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 b=Tt.Utils.getRendererType(c._renderer.type);Be[b].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")o.strokeStyle=a;else{const b=Tt.Utils.getRendererType(a._renderer.type);Be[b].render.call(a,o,e),o.strokeStyle=a._renderer.effect}l&&(o.lineWidth=Nn(e)/p)}typeof d=="number"&&(o.globalAlpha=d),u&&u.length>0&&(o.lineDashOffset=u.offset||0,o.setLineDash(u)),o.save(),o.translate(m,g),o.scale(Be.precision,Be.precision),o.beginPath(),o.arc(0,0,f/p*.5,0,ot),o.restore(),closed&&o.closePath(),Be.isHidden.test(c)||(i=c._renderer&&c._renderer.offset,i&&(o.save(),o.translate(-c._renderer.offset.x,-c._renderer.offset.y),o.scale(c._renderer.scale.x,c._renderer.scale.y)),o.fill(),i&&o.restore()),Be.isHidden.test(a)||(i=a._renderer&&a._renderer.offset,i&&(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(),i&&o.restore())},render:function(n,e,i){if(!this._visible||!this._opacity)return this;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const o=i||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,f=this._renderer.parent!==o,h=this._renderer.vertices,p=this._renderer.collection.length,m=this._flagVertices,g=this._flagFill||this._fill instanceof et&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof tt&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof et&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof tt&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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||f){this._renderer.matrix||(this._renderer.matrix=new Bn(9)),this._matrix.toTransformArray(!0,hi),Ao(hi,o._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ie||(this._renderer.scale=new ie);let b,y;this._scale instanceof ie?(b=this._scale.x*o._renderer.scale.x,y=this._scale.y*o._renderer.scale.y):(b=this._scale*o._renderer.scale.x,y=this._scale*o._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=o)}if(m){const b=this._renderer.positionBuffer;b&&n.deleteBuffer(b),this._renderer.positionBuffer=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,this._renderer.positionBuffer),n.vertexAttribPointer(s.position,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(s.position),n.bufferData(n.ARRAY_BUFFER,h,n.STATIC_DRAW)}return g?(this._renderer.opacity=this._opacity*o._renderer.opacity,Be.updateTexture.call(Be,n,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!this._renderer.texture?this:(Be.isHidden.test(l)||(r+=c),r/=Be.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==s&&(n.useProgram(s),e.resolution.flagged||n.uniform2f(n.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&n.uniform2f(n.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),n.bindTexture(n.TEXTURE_2D,this._renderer.texture),n.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),n.uniform1f(s.size,r*e.resolution.ratio),n.drawArrays(n.POINTS,0,p),re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(n,e){const i=this.canvas,r=this.ctx,o=n.renderer.ratio,s=Od.copy(e._renderer.scale).multiply(o),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,f=e._decoration,h=e._direction;i.width=Math.max(Math.ceil(e._renderer.rect.width*s.x),1),i.height=Math.max(Math.ceil(e._renderer.rect.height*s.y),1);const p=e._renderer.rect.centroid,m=p.x,g=p.y;let b,y,_,x,w,C,N,k,$,v,E;const P=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,i.width,i.height),P||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=h,c)if(typeof c=="string")r.fillStyle=c;else{const F=Tt.Utils.getRendererType(c._renderer.type);Be[F].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const F=Tt.Utils.getRendererType(a._renderer.type);Be[F].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=Nn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(s.x,s.y),r.translate(m,g),Be.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),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,x=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,x),r.restore()):r.fillText(e.value,0,0)),Be.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),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,x=a._renderer.offset.y/a._renderer.scale.y,w=l/a._renderer.scale.x,r.lineWidth=w,r.strokeText(e.value,_,x),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(f)){const F=r.measureText(e.value);switch(f){case"underline":$=F.actualBoundingBoxDescent,E=F.actualBoundingBoxDescent;break;case"strikethrough":$=0,E=0;break}k=-F.width/2,v=F.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,$),r.lineTo(v,E),r.stroke()}r.restore()},getBoundingClientRect:function(n,e){const i=Be.ctx;i.font=[n._style,n._weight,n._size+"px/"+n._leading+"px",n._family].join(" "),i.textAlign="center",i.textBaseline=Tt.Utils.baselines[n._baseline]||n._baseline;const r=i.measureText(n._value);let o=r.width,s=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!Be.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const a=o/2,l=s/2;switch(Be.alignments[n._alignment]||n._alignment){case Be.alignments.left:n.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case Be.alignments.right:n.direction==="ltr"?(e.left=-o,e.right=0):(e.left=0,e.right=o);break;default:e.left=-a,e.right=a}switch(n._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(n,e,i){if(!this._visible||!this._opacity)return this;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=i||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 et&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof tt&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof et&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof tt&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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 Bn(9)),this._matrix.toTransformArray(!0,hi),Ao(hi,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ie||(this._renderer.scale=new ie);let u,f;this._scale instanceof ie?(u=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST),n.stencilFunc(n.ALWAYS,1,0),n.stencilOp(n.KEEP,n.KEEP,n.REPLACE),n.colorMask(!1,!1,!1,!1);const u=Tt.Utils.getRendererType(this._mask._renderer.type);Be[u].render.call(this._mask,n,e,this),n.stencilFunc(n.EQUAL,1,255),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,Be.text.getBoundingClientRect(this,this._renderer.rect),Be.updateTexture.call(Be,n,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!this._renderer.texture)return this;e.current!==o&&(n.useProgram(o),n.bindBuffer(n.ARRAY_BUFFER,e.buffers.position),n.vertexAttribPointer(o.position,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(o.position),n.bufferData(n.ARRAY_BUFFER,ya,n.STATIC_DRAW),e.resolution.flagged||n.uniform2f(n.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&n.uniform2f(n.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),n.bindTexture(n.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return n.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),n.uniform4f(o.rect,d.left,d.top,d.right,d.bottom),n.drawArrays(n.TRIANGLES,0,6),this._mask&&n.disable(n.STENCIL_TEST),re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(n,e){if(!(!n.canvas.getContext("2d")||!e)){if(re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let i,r=this.left._x,o=this.left._y,s=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width,o=(o-.5)*i.height,s=(s-.5)*i.width,a=(a-.5)*i.height),this._renderer.effect=n.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 re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(n,e){if(!(!n.canvas.getContext("2d")||!e)){if(re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let i,r=this.center._x,o=this.center._y,s=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width*.5,o=(o-.5)*i.height*.5,s=(s-.5)*i.width*.5,a=(a-.5)*i.height*.5,l*=Math.min(i.width,i.height)),this._renderer.effect=n.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 re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(n,e){if(!n.canvas.getContext("2d"))return;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const i=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=n.createPattern(i,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof ie||(this._renderer.offset=new ie),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,i&&(this._renderer.offset.x+=i.width/2,this._renderer.offset.y+=i.height/2,this._scale instanceof ie?(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 ie||(this._renderer.scale=new ie);let r,o;this._scale instanceof ie?(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 re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(n,e){const i=Tt.Utils.getRendererType(e._renderer.type);if(this[i].updateCanvas.call(Be,n,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&n.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=n.createTexture()),n.bindTexture(n.TEXTURE_2D,e._renderer.texture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,this.canvas),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR)},program:{create:function(n,e){let i,r,o;if(i=n.createProgram(),re.each(e,function(s){n.attachShader(i,s)}),n.linkProgram(i),r=n.getProgramParameter(i,n.LINK_STATUS),!r)throw o=n.getProgramInfoLog(i),n.deleteProgram(i),new Yt("unable to link program: "+o);return i}},extensions:{init:function(n){const e={},i=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<i.length;r++){const o=i[r];e[o]=Be.extensions.get(n,o)}return e},get:function(n,e){return n.getExtension(e)||n.getExtension(`MOZ_${e}`)||n.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new bo};Be.ctx=Be.canvas.getContext("2d");var zd=class extends ee{constructor(n){super();let e,i,r,o;if(this.domElement=n.domElement||document.createElement("canvas"),typeof n.offscreenElement<"u"&&(Be.canvas=n.offscreenElement,Be.ctx=Be.canvas.getContext("2d")),this.scene=new xt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Bn(D0),scale:1,opacity:1},this._flagMatrix=!0,n=re.defaults(n||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=n.overdraw,e=this.ctx=this.domElement.getContext("webgl",n)||this.domElement.getContext("experimental-webgl",n),!this.ctx)throw new Yt("unable to create a webgl context. Try using another renderer.");r=un.create(e,un.path.vertex,un.types.vertex),o=un.create(e,un.path.fragment,un.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},i=this.programs.path=Be.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=Be.extensions.init(e),e.renderer=this,i.position=e.getAttribLocation(i,"a_position"),i.matrix=e.getUniformLocation(i,"u_matrix"),i.rect=e.getUniformLocation(i,"u_rect");const s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(i.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(i.position),e.bufferData(e.ARRAY_BUFFER,ya,e.STATIC_DRAW),r=un.create(e,un.points.vertex,un.types.vertex),o=un.create(e,un.points.fragment,un.types.fragment),i=this.programs.points=Be.program.create(e,[r,o]),i.position=e.getAttribLocation(i,"a_position"),i.matrix=e.getUniformLocation(i,"u_matrix"),i.size=e.getUniformLocation(i,"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(n,e,i){let r,o;const s=this.ctx;return this.width=n,this.height=e,this.ratio=typeof i>"u"?qs(s):i,this.domElement.width=n*this.ratio,this.domElement.height=e*this.ratio,re.isObject(this.domElement.style)&&re.extend(this.domElement.style,{width:n+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=n*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,n,e,i)}render(){const n=this.ctx;return this.overdraw||n.clear(n.COLOR_BUFFER_BIT),Be.group.render.call(this.scene,n,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};S(zd,"Utils",Be);var H0=re.extend({Error:Yt,getRatio:qs,read:Ze,xhr:Pd},re,At,wc,xc),Te=class ao{constructor(e){S(this,"_events",new ee),S(this,"type",""),S(this,"renderer",null),S(this,"scene",null),S(this,"width",0),S(this,"height",0),S(this,"frameCount",0),S(this,"timeDelta",0),S(this,"playing",!1);const i=re.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:ao.Types.svg,autostart:!1});if(re.each(i,function(r,o){/fullscreen/i.test(o)||/autostart/i.test(o)||(this[o]=r)},this),re.isElement(i.domElement)){const r=i.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=ao.Types[r])}this.renderer=new ao[this.type](this),this.setPlaying(i.autostart),this.frameCount=0,i.fullscreen?(this.fit=W0.bind(this),this.fit.domElement=window,this.fit.attached=!0,re.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),re.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),tn.bind(this.fit.domElement,"resize",this.fit),this.fit()):i.fitted?(this.fit=j0.bind(this),re.extend(this.renderer.domElement.style,{display:"block"})):typeof i.width=="number"&&typeof i.height=="number"&&(this.renderer.setSize(i.width,i.height,this.ratio),this.width=i.width,this.height=i.height),this.renderer.bind(ee.Types.resize,q0.bind(this)),this.scene=this.renderer.scene,ao.Instances.push(this),i.autostart&&Ar.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,Ar.init(),this.trigger(ee.Types.play)}pause(){return this.playing=!1,this.trigger(ee.Types.pause)}setPlaying(e){this.playing=e}release(e){let i,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(i=0;i<e.vertices.length;i++)r=e.vertices[i],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(i=0;i<e.children.length;i++)o=e.children[i],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,i,r){return this.scene&&typeof this.scene.getShapesAtPoint=="function"?this.scene.getShapesAtPoint(e,i,r):[]}update(){const e=!!this._lastFrame,i=re.performance.now();e&&(this.timeDelta=parseFloat((i-this._lastFrame).toFixed(3))),this._lastFrame=i,this.fit&&this.fit.domElement&&!this.fit.attached&&(tn.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,i,r,o){const s=new Po(e,i,r,o);return this.scene.add(s),s}makeArrow(e,i,r,o,s){const a=typeof s=="number"?s:10,l=Math.atan2(o-i,r-e),c=[new Ee(e,i,void 0,void 0,void 0,void 0,ne.move),new Ee(r,o,void 0,void 0,void 0,void 0,ne.line),new Ee(r-a*Math.cos(l-Math.PI/4),o-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ne.line),new Ee(r,o,void 0,void 0,void 0,void 0,ne.move),new Ee(r-a*Math.cos(l+Math.PI/4),o-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ne.line)],d=new Pe(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,i,r,o){const s=new fi(e,i,r,o);return this.scene.add(s),s}makeRoundedRectangle(e,i,r,o,s){const a=new $o(e,i,r,o,s);return this.scene.add(a),a}makeCircle(e,i,r,o){const s=new No(e,i,r,o);return this.scene.add(s),s}makeEllipse(e,i,r,o,s){const a=new To(e,i,r,o,s);return this.scene.add(a),a}makeStar(e,i,r,o,s){const a=new la(e,i,r,o,s);return this.scene.add(a),a}makeCurve(e){const i=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<i;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new Ee(l,c))}}const r=arguments[i-1],o=new Pe(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,i,r,o){const s=new aa(e,i,r,o);return this.scene.add(s),s}makeArcSegment(e,i,r,o,s,a,l){const c=new ta(e,i,r,o,s,a,l);return this.scene.add(c),c}makePoints(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let s=0;s<i;s+=2){const a=arguments[s];if(typeof a!="number")break;const l=arguments[s+1];r.push(new ie(a,l))}}const o=new sa(r);return this.scene.add(o),o}makePath(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<i;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new Ee(c,d))}}const o=arguments[i-1],s=new Pe(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,i,r,o){const s=new Tn(e,i,r,o);return this.add(s),s}makeLinearGradient(e,i,r,o){const s=Array.prototype.slice.call(arguments,4),a=new et(e,i,r,o,s);return this.add(a),a}makeRadialGradient(e,i,r){const o=Array.prototype.slice.call(arguments,3),s=new tt(e,i,r,o);return this.add(s),s}makeSprite(e,i,r,o,s,a,l){const c=new Bo(e,i,r,o,s,a);return l&&c.play(),this.add(c),c}makeImage(e,i,r,o,s,a){const l=new Fd(e,i,r,o,s,a);return this.add(l),l}makeImageSequence(e,i,r,o,s){const a=new fa(e,i,r,o);return s&&a.play(),this.add(a),a}makeTexture(e,i){return new De(e,i)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const i=new xt;return this.scene.add(i),i.add(e),i}interpret(e,i,r){const o=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(o in Ze))return null;const s=Ze[o].call(this,e);return r?this.add(i&&s instanceof xt?s.children:s):s.parent&&s.remove(),s}load(e,i){const r=new xt;let o,s,a;const l=(function(c){for(tn.temp.innerHTML=c,s=0;s<tn.temp.children.length;s++)o=tn.temp.children[s],a=this.interpret(o,!1,!1),a!==null&&r.add(a);if(typeof i=="function"){const d=tn.temp.children.length<=1?tn.temp.children[0]:tn.temp.children;i(r,d)}}).bind(this);return/\.svg$/i.test(e)?(Pd(e,l),r):(l(e),r)}};S(Te,"NextFrameId",Bt.NextFrameId),S(Te,"Types",Bt.Types),S(Te,"Version",Bt.Version),S(Te,"PublishDate",Bt.PublishDate),S(Te,"Identifier",Bt.Identifier),S(Te,"Resolution",Bt.Resolution),S(Te,"AutoCalculateImportedMatrices",Bt.AutoCalculateImportedMatrices),S(Te,"Instances",Bt.Instances),S(Te,"uniqueId",Bt.uniqueId),S(Te,"Anchor",Ee),S(Te,"Collection",di),S(Te,"Events",ee),S(Te,"Group",xt),S(Te,"Matrix",Ni),S(Te,"Path",Pe),S(Te,"Registry",bo),S(Te,"Element",sr),S(Te,"Shape",qn),S(Te,"Text",Tn),S(Te,"Vector",ie),S(Te,"Gradient",pt),S(Te,"Image",Fd),S(Te,"ImageSequence",fa),S(Te,"LinearGradient",et),S(Te,"RadialGradient",tt),S(Te,"Sprite",Bo),S(Te,"Stop",ui),S(Te,"Texture",De),S(Te,"ArcSegment",ta),S(Te,"Circle",No),S(Te,"Ellipse",To),S(Te,"Line",Po),S(Te,"Points",sa),S(Te,"Polygon",aa),S(Te,"Rectangle",fi),S(Te,"RoundedRectangle",$o),S(Te,"Star",la),S(Te,"CanvasRenderer",Tt),S(Te,"SVGRenderer",Ad),S(Te,"WebGLRenderer",zd),S(Te,"Commands",ne),S(Te,"Utils",H0);var En=Te;function W0(){const n=document.body.getBoundingClientRect(),e=this.width=n.width,i=this.height=n.height;this.renderer.setSize(e,i,this.ratio)}function j0(){const n=this.renderer.domElement.parentElement;if(!n){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=n.getBoundingClientRect(),i=this.width=e.width,r=this.height=e.height;this.renderer.setSize(i,r,this.ratio)}function q0(n,e){this.width=n,this.height=e,this.trigger(ee.Types.resize,n,e)}var Ar=tn.getRequestAnimationFrame();function Dd(){for(let n=0;n<En.Instances.length;n++){const e=En.Instances[n];e.playing&&e.update()}En.NextFrameId=Ar(Dd)}Ar.init=function(){Dd(),Ar.init=function(){}};let Rn;typeof window<"u"?Rn=window:typeof global<"u"?Rn=global:typeof self<"u"&&(Rn=self);let Ld;const nn=Math.PI*2,kt=Math.PI*.5;function X0(n,e,i,r,o,s){let a;return arguments.length<=1?(a=n.a,e=n.b,i=n.c,r=n.d,o=n.e,s=n.f):a=n,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Y0(n){Ld=n}function U0(n,e){e=e&&e.identity()||new Ld;let i=n;const r=[];for(;i&&i._matrix;)r.push(i._matrix),i=i.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 Kt(n,e,i){return i*(e-n)+n}function Gt(n,e){for(;n<0;)n+=e;return n%e}const Hd=Rn.Float32Array||Array,K0=Math.floor;function Pn(n){return K0(n*1e6)/1e6}const me={move:"M",line:"L",curve:"C",arc:"A",close:"Z"};class te{constructor(){B(this,"_events",{});B(this,"_bound",!1)}addEventListener(e,i){return(this._events[e]||(this._events[e]=[])).push(i),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,i){if(!this._events)return this;if(!e&&!i)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(i)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,i!==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 i=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...i);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,i,r){const o=this;e&&(s.obj=e,s.name=i,s.handler=r,e.on(i,s));function s(){r.apply(o,arguments)}return o}ignore(e,i,r){return e.off(i,r),this}}B(te,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),B(te,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Wd={x:{enumerable:!0,get:function(){return this._x},set:function(n){this._x!==n&&(this._x=n,this._bound&&this.dispatchEvent(te.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(n){this._y!==n&&(this._y=n,this._bound&&this.dispatchEvent(te.Types.change))}}},vt=class vt extends te{constructor(i=0,r=0){super();B(this,"_x",0);B(this,"_y",0);for(let o in Wd)Object.defineProperty(this,o,Wd[o]);this.x=i,this.y=r}static add(i,r){return new vt(i.x+r.x,i.y+r.y)}static sub(i,r){return new vt(i.x-r.x,i.y-r.y)}static subtract(i,r){return vt.sub(i,r)}static ratioBetween(i,r){return(i.x*r.x+i.y*r.y)/(i.length()*r.length())}static angleBetween(i,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const o=i.x-r.x,s=i.y-r.y;return Math.atan2(s,o)}static distanceBetween(i,r){return Math.sqrt(vt.distanceBetweenSquared(i,r))}static distanceBetweenSquared(i,r){const o=i.x-r.x,s=i.y-r.y;return o*o+s*s}set(i,r){return this.x=i,this.y=r,this}copy(i){return this.x=i.x,this.y=i.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new vt(this.x,this.y)}add(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x+=i,this.y+=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x+=i.x,this.y+=i.y):(this.x+=i,this.y+=r),this)}addSelf(i){return this.add.apply(this,arguments)}sub(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x-=i,this.y-=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x-=i.x,this.y-=i.y):(this.x-=i,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(i){return this.sub.apply(this,arguments)}subtractSelf(i){return this.sub.apply(this,arguments)}multiply(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x*=i,this.y*=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x*=i.x,this.y*=i.y):(this.x*=i,this.y*=r),this)}multiplySelf(i){return this.multiply.apply(this,arguments)}multiplyScalar(i){return this.multiply(i)}divide(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x/=i,this.y/=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x/=i.x,this.y/=i.y):(this.x/=i,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(i){return this.divide.apply(this,arguments)}divideScalar(i){return this.divide(i)}negate(){return this.multiply(-1)}dot(i){return this.x*i.x+this.y*i.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(i){return Math.sqrt(this.distanceToSquared(i))}distanceToSquared(i){const r=this.x-i.x,o=this.y-i.y;return r*r+o*o}setLength(i){return this.normalize().multiplyScalar(i)}equals(i,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(i)<r}lerp(i,r){const o=(i.x-this.x)*r+this.x,s=(i.y-this.y)*r+this.y;return this.set(o,s)}isZero(i){return i=typeof i>"u"?1e-4:i,this.length()<i}toString(){return this.x+", "+this.y}toObject(){return{x:Pn(this.x),y:Pn(this.y)}}rotate(i){const r=this.x,o=this.y,s=Math.cos(i),a=Math.sin(i);return this.x=r*s-o*a,this.y=r*a+o*s,this}};B(vt,"zero",new vt),B(vt,"left",new vt(-1,0)),B(vt,"right",new vt(1,0)),B(vt,"up",new vt(0,-1)),B(vt,"down",new vt(0,1));let be=vt;class Ae extends be{constructor(i=0,r=0,o=0,s=0,a=0,l=0,c=me.move){super(i,r);B(this,"controls",{left:new be,right:new be});B(this,"_command",me.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 u in jd)Object.defineProperty(this,u,jd[u]);this.command=c,this.relative=!0;const d=Ae.makeBroadcast(this);this.controls.left.set(o,s).addEventListener(te.Types.change,d),this.controls.right.set(a,l).addEventListener(te.Types.change,d)}static makeBroadcast(i){return r;function r(){i._bound&&i.dispatchEvent(te.Types.change)}}static fromObject(i){return new Ae().copy(i)}copy(i){return this.x=i.x,this.y=i.y,typeof i.command=="string"&&(this.command=i.command),i.controls&&(i.controls.left&&this.controls.left.copy(i.controls.left),i.controls.right&&this.controls.right.copy(i.controls.right)),typeof i.relative=="boolean"&&(this.relative=i.relative),typeof i.rx=="number"&&(this.rx=i.rx),typeof i.ry=="number"&&(this.ry=i.ry),typeof i.xAxisRotation=="number"&&(this.xAxisRotation=i.xAxisRotation),typeof i.largeArcFlag=="number"&&(this.largeArcFlag=i.largeArcFlag),typeof i.sweepFlag=="number"&&(this.sweepFlag=i.sweepFlag),this}clone(){return new Ae().copy(this)}toObject(){return{x:Pn(this.x),y:Pn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Pn(this.rx),ry:Pn(this.ry),xAxisRotation:Pn(this.xAxisRotation),largeArcFlag:Pn(this.largeArcFlag),sweepFlag:Pn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const jd={command:{enumerable:!0,get:function(){return this._command},set:function(n){this._command!==n&&(this._command=n,this._bound&&this.dispatchEvent(te.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(n){this._relative!==!!n&&(this._relative=!!n,this._bound&&this.dispatchEvent(te.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(n){this._rx!==n&&(this._rx=n,this._bound&&this.dispatchEvent(te.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(n){this._ry!==n&&(this._ry=n,this._bound&&this.dispatchEvent(te.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(n){this._xAxisRotation!==n&&(this._xAxisRotation=n,this._bound&&this.dispatchEvent(te.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(n){this._largeArcFlag!==n&&(this._largeArcFlag=n,this._bound&&this.dispatchEvent(te.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(n){this._sweepFlag!==n&&(this._sweepFlag=n,this._bound&&this.dispatchEvent(te.Types.change))}}};let G0=0;const Oo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return G0++}},zo={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 Do(n,e,i,r,o){const s=1-n;return s*s*s*e+3*s*s*n*i+3*s*n*n*r+n*n*n*o}function qd(n,e,i,r,o,s,a,l,c){c=c||zo.RecursionLimit;const d=c+1;if(Math.abs(n-a)<.001&&Math.abs(e-l)<.001)return[new Ae(a,l)];const u=[];for(let f=0;f<d;f++){const h=f/d,p=Do(h,n,i,o,a),m=Do(h,e,r,s,l);u.push(new Ae(p,m))}return u}function Z0(n,e,i,r,o,s,a,l,c){if(n===i&&e===r&&o===a&&s===l){const b=a-n,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(a-n),u=6*(n+o)-12*i,f=3*(i-n),h=9*(r-s)+3*(l-e),p=6*(e+s)-12*r,m=3*(r-e);function g(b){const y=(d*b+u)*b+f,_=(h*b+p)*b+m;return Math.sqrt(y*y+_*_)}return J0(g,0,1,c||zo.RecursionLimit)}function Q0(n,e,i,r,o,s,a,l){const c=[],d=[[],[]];let u,f,h,p,m,g,b,y;for(let C=0;C<2;++C){if(C===0?(f=6*n-12*i+6*o,u=-3*n+9*i-9*o+3*a,h=3*i-3*n):(f=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,h=3*r-3*e),Math.abs(u)<.001){if(Math.abs(f)<.001)continue;p=-h/f,0<p&&p<1&&c.push(p);continue}b=f*f-4*h*u,y=Math.sqrt(b),!(b<0)&&(m=(-f+y)/(2*u),0<m&&m<1&&c.push(m),g=(-f-y)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,x=_,w;for(;_--;)p=c[_],w=1-p,d[0][_]=w*w*w*n+3*w*w*p*i+3*w*p*p*o+p*p*p*a,d[1][_]=w*w*w*e+3*w*w*p*r+3*w*p*p*s+p*p*p*l;return d[0][x]=n,d[1][x]=e,d[0][x+1]=a,d[1][x+1]=l,d[0].length=d[1].length=x+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 J0(n,e,i,r){let o=zo.abscissas[r-2],s=zo.weights[r-2],a=.5*(i-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*n(l):0;for(;c<d;){const f=a*o[c];u+=s[c++]*(n(l+f)+n(l-f))}return a*u}function e1(n,e){const i=n.length,r=i-1;for(let o=0;o<i;o++){const s=n[o],a=e?Gt(o-1,i):Math.max(o-1,0),l=e?Gt(o+1,i):Math.min(o+1,r),c=n[a],d=s,u=n[l];t1(c,d,u),d.command=o===0?me.move:me.curve}}function t1(n,e,i){const r=be.angleBetween(n,e),o=be.angleBetween(i,e);let s=be.distanceBetween(n,e),a=be.distanceBetween(i,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+=kt:l-=kt,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 Or=(qi=class extends te{constructor(){super();B(this,"_flagId",!1);B(this,"_flagClassName",!1);B(this,"_renderer",{});B(this,"_id",Oo.Identifier+Oo.uniqueId());B(this,"_className","");B(this,"classList",[]);for(let i in Xd)Object.defineProperty(this,i,Xd[i])}static fromObject(i){const r=new qi().copy(i);return"id"in i&&(r.id=i.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(i){return i.renderer&&typeof i.renderer.type=="string"&&(this.renderer.type=i.renderer.type),typeof i.className=="string"&&(this.className=i.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 i=this._renderer.type;return this._renderer={type:i},this}},B(qi,"Properties",["renderer","id","className"]),qi);const Xd={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(n){const e=this._id;n!==this._id&&(this._id=n,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(n){this._className!==n&&(this._flagClassName=!0,this.classList=n.split(/\s+?/),this._className=n)}}};class Lo extends Error{constructor(i){super();B(this,"name","Two.js");B(this,"message");this.message=i}}class n1{constructor(){B(this,"map",{})}add(e,i){return this.map[e]=i,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let Ho;const Yd={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Rn.document&&(Ho=document.createElement("a"));const it=class it extends Or{constructor(i,r){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 o in Ud)Object.defineProperty(this,o,Ud[o]);if(this._renderer.type="texture",this._renderer.flagOffset=i1.bind(this),this._renderer.flagScale=r1.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new be,typeof r=="function"){const o=(function(){this.unbind(te.Types.load,o),typeof r=="function"&&r()}).bind(this);this.bind(te.Types.load,o)}if(typeof i=="string")this.src=i;else if(typeof i=="object"){const o=Object.prototype.toString.call(i);(o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]"||o==="[object HTMLVideoElement]"||o==="[object Image]")&&(this.image=i)}this._update()}fromObject(i){const r=new it().copy(i);return"id"in i&&(r.id=i.id),r}static getAbsoluteURL(i){return Ho?(Ho.href=i,Ho.href):i}static loadHeadlessBuffer(i,r){i.image.onload=r,i.image.src=i.src}static getTag(i){return i&&i.nodeName&&i.nodeName.toLowerCase()||"img"}static getImage(i){const r=it.getAbsoluteURL(i);if(it.ImageRegistry.contains(r))return it.ImageRegistry.get(r);let o;return Rn.document?Yd.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(i,r){let o=i.image,s=it.getTag(o);i._flagImage&&(/canvas/i.test(s)?it.Register.canvas(i,r):(i._src=o.getAttribute("two-src")||o.src,it.Register[s](i,r))),i._flagSrc&&(o||(o=it.getImage(i.src),i.image=o),s=it.getTag(o),it.Register[s](i,r))}clone(){const i=new it(this.src);return i.repeat=this.repeat,i.offset.copy(this.offset),i.scale=this.scale,i}copy(i){return this.src=i.src,this.repeat=i.repeat,this.offset=typeof i.offset=="number"||i.offset instanceof be?i.offset:new be().copy(i.offset),this.scale=typeof i.scale=="number"||i.scale instanceof be?i.scale:new be().copy(i.scale),this}toObject(){const i=super.toObject.call(this);return i.renderer.type="texture",i.src=this.src,i.repeat=this.repeat,i.offset=this.offset.toObject(),i.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),i}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(te.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,it.load(this,(function(){this.loaded=!0,this.trigger(te.Types.change).trigger(te.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 i=this._renderer.elem;i.parentNode.removeChild(i)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};B(it,"Properties",["src","loaded","repeat","scale","offset","image"]),B(it,"RegularExpressions",Yd),B(it,"ImageRegistry",new n1),B(it,"Register",{canvas:function(i,r){i._src="#"+i.id,it.ImageRegistry.add(i.src,i.image),typeof r=="function"&&r()},img:function(i,r){const o=i.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 Lo("unable to load "+i.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)),i._src=it.getAbsoluteURL(i._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",i.src),it.ImageRegistry.add(i.src,o),i.image.src=i.src)},video:function(i,r){const o=function(a){i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),i.image.width=i.image.videoWidth,i.image.height=i.image.videoHeight,typeof r=="function"&&r()},s=function(a){throw i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),new Lo("unable to load "+i.src)};i._src=it.getAbsoluteURL(i._src),i.image.getAttribute("two-src")||(i.image.setAttribute("two-src",i.src),it.ImageRegistry.add(i.src,i.image)),i.image.readyState>=4?o():(i.image.addEventListener("canplaythrough",o,!1),i.image.addEventListener("error",s,!1),i.image.src=i.src,i.image.load())}});let nt=it;const Ud={src:{enumerable:!0,get:function(){return this._src},set:function(n){this._src=n,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(n){this._loaded=n,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(n){this._repeat=n,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(n){const e=nt.getTag(n);let i;switch(e){case"canvas":i="#"+n.id;break;default:i=n.src}nt.ImageRegistry.contains(i)?this._image=nt.ImageRegistry.get(n.src):this._image=n,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(n){this._offset&&this._offset.unbind(te.Types.change,this._renderer.flagOffset),this._offset=n,this._offset.bind(te.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(n){this._scale instanceof be&&this._scale.unbind(te.Types.change,this._renderer.flagScale),this._scale=n,this._scale instanceof be&&this._scale.bind(te.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function i1(){this._flagOffset=!0}function r1(){this._flagScale=!0}class Ti extends Array{constructor(){super();Hl(this,St,new te);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 qt(this,St)}set _events(i){$m(this,St,i)}get _bound(){return qt(this,St)._bound}set _bound(i){qt(this,St)._bound=i}addEventListener(){var i;return(i=qt(this,St).addEventListener)==null?void 0:i.apply(this,arguments)}on(){var i;return(i=qt(this,St).on)==null?void 0:i.apply(this,arguments)}bind(){var i;return(i=qt(this,St).bind)==null?void 0:i.apply(this,arguments)}removeEventListener(){var i;return(i=qt(this,St).removeEventListener)==null?void 0:i.apply(this,arguments)}off(){var i;return(i=qt(this,St).off)==null?void 0:i.apply(this,arguments)}unbind(){var i;return(i=qt(this,St).unbind)==null?void 0:i.apply(this,arguments)}dispatchEvent(){var i;return(i=qt(this,St).dispatchEvent)==null?void 0:i.apply(this,arguments)}trigger(){var i;return(i=qt(this,St).trigger)==null?void 0:i.apply(this,arguments)}listen(){var i;return(i=qt(this,St).listen)==null?void 0:i.apply(this,arguments)}ignore(){var i;return(i=qt(this,St).ignore)==null?void 0:i.apply(this,arguments)}pop(){const i=super.pop.apply(this,arguments);return this.trigger(te.Types.remove,[i]),i}shift(){const i=super.shift.apply(this,arguments);return this.trigger(te.Types.remove,[i]),i}push(){const i=super.push.apply(this,arguments);return this.trigger(te.Types.insert,arguments),i}unshift(){const i=super.unshift.apply(this,arguments);return this.trigger(te.Types.insert,arguments),i}splice(){const i=super.splice.apply(this,arguments);if(this.trigger(te.Types.remove,i),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(te.Types.insert,r),this.trigger(te.Types.order)}return i}sort(){return super.sort.apply(this,arguments),this.trigger(te.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(te.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(i,r){const o=[];for(let s=0;s<this.length;s++){const a=this[s];let l;r?l=i.call(r,a,s):l=i(a,s),o.push(l)}return o}}St=new WeakMap;const Kd=Array.prototype.slice;function o1(n){if(n==null)return!1;const e=n.length;return typeof e=="number"&&e>=0&&e<4294967296}const je={isNaN:function(n){return typeof n=="number"&&n!==+n},isElement:function(n){return!!(n&&n.nodeType===1)},isObject:function(n){const e=typeof n;return e==="function"||e==="object"&&!!n},isFunction:function(n){return typeof n=="function"},extend:function(n){const e=Kd.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)n[o]=r[o]}return n},defaults:function(n){const e=Kd.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)n[o]===void 0&&(n[o]=r[o])}return n},each:function(n,e,i){const r=i||this,o=!o1(n)&&Object.keys(n),s=(o||n).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,n[l],l,n)}return n},performance:Rn.performance&&Rn.performance.now?Rn.performance:Date},Jt=class Jt extends Or{constructor(i,r,o){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 s in Gd)Object.defineProperty(this,s,Gd[s]);this._renderer.type="stop",this.offset=typeof i=="number"?i:Jt.Index<=0?0:1,this.opacity=typeof o=="number"?o:1,this.color=typeof r=="string"?r:Jt.Index<=0?"#fff":"#000",Jt.Index=(Jt.Index+1)%2}static fromObject(i){const r=new Jt().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Jt.Properties.length;r++){const o=Jt.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Jt;return je.each(Jt.Properties,function(o){r[o]=this[o]},this),i&&i.stops&&i.stops.push(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="stop",je.each(Jt.Properties,r=>{i[r]=this[r]},this),i}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};B(Jt,"Index",0),B(Jt,"Properties",["offset","opacity","color"]);let $i=Jt;const Gd={offset:{enumerable:!0,get:function(){return this._offset},set:function(n){this._offset=n,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._opacity=n,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(n){this._color=n,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},On=class On extends Or{constructor(i){super();B(this,"_flagStops",!1);B(this,"_flagSpread",!1);B(this,"_flagUnits",!1);B(this,"_spread","");B(this,"_units","");for(let r in Zd)Object.defineProperty(this,r,Zd[r]);this._renderer.type="gradient",this._renderer.flagStops=s1.bind(this),this._renderer.bindStops=a1.bind(this),this._renderer.unbindStops=l1.bind(this),this.spread="pad",this.units="objectBoundingBox",i&&(this.stops=i)}static fromObject(i){let r=i.stops;r&&r.length>0&&(r=r.map(s=>s instanceof $i?s:new $i().copy(s)));const o=new On(r).copy(i);return"id"in i&&(o.id=i.id),o}clone(i){const r=this.stops.map(s=>s.clone()),o=new On(r);return je.each(On.Properties,s=>{o[s]=this[s]},this),i&&i.add(o),o}copy(i){super.copy.call(this,i);for(let r=0;r<On.Properties.length;r++){const o=On.Properties[r];o in i&&(this[o]=i[o])}return this}toObject(){const i={stops:this.stops.map(r=>r.toObject())};return je.each(On.Properties,r=>{i[r]=this[r]},this),i}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(te.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const i=this._renderer.elem;i.parentNode.removeChild(i)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};B(On,"Stop",$i),B(On,"Properties",["spread","stops","units"]);let gt=On;const Zd={spread:{enumerable:!0,get:function(){return this._spread},set:function(n){this._spread=n,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(n){this._units=n,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(n){const e=this._renderer.bindStops,i=this._renderer.unbindStops;this._stops&&this._stops.unbind(te.Types.insert,e).unbind(te.Types.remove,i),this._stops=new Ti((n||[]).slice(0)),this._stops.bind(te.Types.insert,e).bind(te.Types.remove,i),e(this._stops)}}};function s1(){this._flagStops=!0}function a1(n){let e=n.length;for(;e--;)n[e].bind(te.Types.change,this._renderer.flagStops),n[e].parent=this;this._renderer.flagStops()}function l1(n){let e=n.length;for(;e--;)n[e].unbind(te.Types.change,this._renderer.flagStops),delete n[e].parent;this._renderer.flagStops()}const _i=class _i extends gt{constructor(i,r,o,s,a){super(a);B(this,"_flagEndPoints",!1);B(this,"_left",null);B(this,"_right",null);for(let l in Qd)Object.defineProperty(this,l,Qd[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=c1.bind(this),this.left=new be,this.right=new be,typeof i=="number"&&(this.left.x=i),typeof r=="number"&&(this.left.y=r),typeof o=="number"&&(this.right.x=o),typeof s=="number"&&(this.right.y=s)}static fromObject(i){const r=new _i().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<_i.Properties.length;r++){const o=_i.Properties[r];o in i&&(this[o]=i[o]instanceof be?i[o]:new be().copy(i[o]))}return this}clone(i){const r=this.stops.map(function(s){return s.clone()}),o=new _i(this.left._x,this.left._y,this.right._x,this.right._y,r);return je.each(gt.Properties,function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return i.left=this.left.toObject(),i.right=this.right.toObject(),i}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(te.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};B(_i,"Stop",$i),B(_i,"Properties",["left","right"]);let zt=_i;const Qd={left:{enumerable:!0,get:function(){return this._left},set:function(n){this._left instanceof be&&this._left.unbind(te.Types.change,this._renderer.flagEndPoints),this._left=n,this._left.bind(te.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(n){this._right instanceof be&&this._right.unbind(te.Types.change,this._renderer.flagEndPoints),this._right=n,this._right.bind(te.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function c1(){this._flagEndPoints=!0}const zn=class zn extends gt{constructor(i,r,o,s,a,l){super(s);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 c in Jd)Object.defineProperty(this,c,Jd[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=d1.bind(this),this._renderer.flagFocal=u1.bind(this),this.center=new be,this.radius=typeof o=="number"?o:1,this.focal=new be,typeof i=="number"&&(this.center.x=i),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(i){const r=new zn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<zn.Properties.length;r++){const o=zn.Properties[r];o in i&&(/(center|focal)i/.test(o)?this[o]=i[o]instanceof be?i[o]:new be().copy(i[o]):typeof i[o]=="number"&&(this[o]=i[MediaKeySystemAccess]))}return this}clone(i){const r=this.stops.map(function(s){return s.clone()}),o=new zn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return je.each(gt.Properties.concat(zn.Properties),function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return je.each(zn.Properties,function(r){i[r]=this[r]},this),i.center=this.center.toObject(),i.focal=this.focal.toObject(),i}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(te.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};B(zn,"Stop",$i),B(zn,"Properties",["center","radius","focal"]);let Dt=zn;const Jd={radius:{enumerable:!0,get:function(){return this._radius},set:function(n){this._radius=n,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(n){this._center&&this._center.unbind(te.Types.change,this._renderer.flagCenter),this._center=n,this._center.bind(te.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(n){this._focal&&this._focal.unbind(te.Types.change,this._renderer.flagFocal),this._focal=n,this._focal.bind(te.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function d1(){this._flagCenter=!0}function u1(){this._flagFocal=!0}function eu(n,e){if(e===0||e===1)return!0;const r=n._length*e;let o=0;for(let s=0;s<n._lengths.length;s++){const a=n._lengths[s];if(o>=r)return r-o>=0;o+=a}return!1}function Wo(n,e){const i=n._length;if(e<=0)return 0;if(e>=i)return n._lengths.length-1;for(let r=0,o=0;r<n._lengths.length;r++){if(o+n._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/n._lengths[r];o+=n._lengths[r]}return-1}function tu(n,e,i){let r,o,s,a,l,c,d,u;const f=e.controls&&e.controls.right,h=n.controls&&n.controls.left;return r=e.x,l=e.y,o=(f||e).x,c=(f||e).y,s=(h||n).x,d=(h||n).y,a=n.x,u=n.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&n._relative&&(s+=n.x,d+=n.y),Z0(r,l,o,c,s,d,a,u,i)}function ba(n,e,i){let r,o,s,a,l,c,d,u;const f=e.controls&&e.controls.right,h=n.controls&&n.controls.left;return r=e.x,l=e.y,o=(f||e).x,c=(f||e).y,s=(h||n).x,d=(h||n).y,a=n.x,u=n.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&n._relative&&(s+=n.x,d+=n.y),qd(r,l,o,c,s,d,a,u,i)}function Ei(n){switch(n.renderer.type){case"texture":return nt.fromObject(n);case"gradient":return gt.fromObject(n);case"linear-gradient":return zt.fromObject(n);case"radial-gradient":return Dt.fromObject(n)}return n}const f1=Math.cos,h1=Math.sin,nu=Math.tan,_a=[],Ht=class Ht extends te{constructor(i,r,o,s,a,l){super();B(this,"elements",new Hd(9));B(this,"manual",!1);let c=i;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(i,r,o){if(r.length<=3){const k=i;let $,v,E;const P=r[0]||0,F=r[1]||0,R=r[2]||0;return $=k[0]*P+k[1]*F+k[2]*R,v=k[3]*P+k[4]*F+k[5]*R,E=k[6]*P+k[7]*F+k[8]*R,[$,v,E]}const s=i[0],a=i[1],l=i[2],c=i[3],d=i[4],u=i[5],f=i[6],h=i[7],p=i[8],m=r[0],g=r[1],b=r[2],y=r[3],_=r[4],x=r[5],w=r[6],C=r[7],N=r[8];return o=o||new Hd(9),o[0]=s*m+a*y+l*w,o[1]=s*g+a*_+l*C,o[2]=s*b+a*x+l*N,o[3]=c*m+d*y+u*w,o[4]=c*g+d*_+u*C,o[5]=c*b+d*x+u*N,o[6]=f*m+h*y+p*w,o[7]=f*g+h*_+p*C,o[8]=f*b+h*x+p*N,o}static fromObject(i){return new Ht().copy(i)}set(i,r,o,s,a,l,c,d,u){if(typeof r>"u"){const f=i;i=f[0],r=f[1],o=f[2],s=f[3],a=f[4],l=f[5],c=f[6],d=f[7],u=f[8]}return this.elements[0]=i,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(te.Types.change)}copy(i){return this.elements[0]=i.elements[0],this.elements[1]=i.elements[1],this.elements[2]=i.elements[2],this.elements[3]=i.elements[3],this.elements[4]=i.elements[4],this.elements[5]=i.elements[5],this.elements[6]=i.elements[6],this.elements[7]=i.elements[7],this.elements[8]=i.elements[8],this.manual=i.manual,this.trigger(te.Types.change)}identity(){return this.elements[0]=Ht.Identity[0],this.elements[1]=Ht.Identity[1],this.elements[2]=Ht.Identity[2],this.elements[3]=Ht.Identity[3],this.elements[4]=Ht.Identity[4],this.elements[5]=Ht.Identity[5],this.elements[6]=Ht.Identity[6],this.elements[7]=Ht.Identity[7],this.elements[8]=Ht.Identity[8],this.trigger(te.Types.change)}multiply(i,r,o,s,a,l,c,d,u){if(typeof r>"u")return this.elements[0]*=i,this.elements[1]*=i,this.elements[2]*=i,this.elements[3]*=i,this.elements[4]*=i,this.elements[5]*=i,this.elements[6]*=i,this.elements[7]*=i,this.elements[8]*=i,this.trigger(te.Types.change);if(typeof o>"u"&&(o=1),typeof s>"u"){i=i||0,r=r||0,o=o||0,a=this.elements;const X=a[0]*i+a[1]*r+a[2]*o,G=a[3]*i+a[4]*r+a[5]*o,Z=a[6]*i+a[7]*r+a[8]*o;return[X,G,Z]}const f=this.elements,h=[i,r,o,s,a,l,c,d,u],p=f[0],m=f[1],g=f[2],b=f[3],y=f[4],_=f[5],x=f[6],w=f[7],C=f[8],N=h[0],k=h[1],$=h[2],v=h[3],E=h[4],P=h[5],F=h[6],R=h[7],M=h[8];return this.elements[0]=p*N+m*v+g*F,this.elements[1]=p*k+m*E+g*R,this.elements[2]=p*$+m*P+g*M,this.elements[3]=b*N+y*v+_*F,this.elements[4]=b*k+y*E+_*R,this.elements[5]=b*$+y*P+_*M,this.elements[6]=x*N+w*v+C*F,this.elements[7]=x*k+w*E+C*R,this.elements[8]=x*$+w*P+C*M,this.trigger(te.Types.change)}inverse(i){const r=this.elements;i=i||new Ht;const o=r[0],s=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],f=r[7],h=r[8],p=h*c-d*f,m=-h*l+d*u,g=f*l-c*u;let b=o*p+s*m+a*g;return b?(b=1/b,i.elements[0]=p*b,i.elements[1]=(-h*s+a*f)*b,i.elements[2]=(d*s-a*c)*b,i.elements[3]=m*b,i.elements[4]=(h*o-a*u)*b,i.elements[5]=(-d*o+a*l)*b,i.elements[6]=g*b,i.elements[7]=(-f*o+s*u)*b,i.elements[8]=(c*o-s*l)*b,i):null}scale(i,r){return arguments.length<=1&&(r=i),this.multiply(i,0,0,0,r,0,0,0,1)}rotate(i){const r=f1(i),o=h1(i);return this.multiply(r,-o,0,o,r,0,0,0,1)}translate(i,r){return this.multiply(1,0,i,0,1,r,0,0,1)}skewX(i){const r=nu(i);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(i){const r=nu(i);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(i){return _a.length=0,this.toTransformArray(i,_a),_a.map(Pn).join(" ")}toTransformArray(i,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],f=o[5];if(i){const h=o[6],p=o[7],m=o[8];if(s){r[0]=a,r[1]=d,r[2]=h,r[3]=l,r[4]=u,r[5]=p,r[6]=c,r[7]=f,r[8]=m;return}return[a,d,h,l,u,p,c,f,m]}if(s){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=f;return}return[a,d,l,u,c,f]}toArray(i,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],f=o[5];if(i){const h=o[6],p=o[7],m=o[8];if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=f,r[6]=h,r[7]=p,r[8]=m;return}return[a,l,c,d,u,f,h,p,m]}if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=f;return}return[a,l,c,d,u,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ht().copy(this)}};B(Ht,"Identity",[1,0,0,0,1,0,0,0,1]);let ur=Ht;Y0(ur);const io=class io extends Or{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 i in jo)Object.defineProperty(this,i,jo[i]);this._renderer.flagMatrix=iu.bind(this),this.isShape=!0,this.matrix=new ur,this.worldMatrix=new ur,this.position=new be,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(i){const r=new io().copy(i);return"id"in i&&(r.id=i.id),r}get renderer(){return this._renderer}set renderer(i){this._renderer=i}get translation(){return jo.position.get.apply(this,arguments)}set translation(i){jo.position.set.apply(this,arguments)}addTo(i){return i.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(i,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?i>=c.left-l&&i<=c.right+l&&r>=c.top-l&&r<=c.bottom+l:!1}copy(i){return super.copy.call(this,i),"position"in i&&(i.position instanceof be?this.position=i.position:this.position.copy(i.position)),"rotation"in i&&(this.rotation=i.rotation),"scale"in i&&(this.scale=typeof i.scale=="number"||i.scale instanceof be?i.scale:new be(i.scale.x,i.scale.y)),"skewX"in i&&(this.skewX=i.skewX),"skewY"in i&&(this.skewY=i.skewY),"matrix"in i&&i.matrix.manual&&(this.matrix.copy(i.matrix),this.matrix.manual=!0),this}clone(i){const r=new io;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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer={type:"shape"},i.isShape=!0,i.translation=this.translation.toObject(),i.rotation=this.translation.rotation,i.scale=this.scale instanceof be?this.scale.toObject():this.scale,i.skewX=this.skewX,i.skewY=this.skewY,i.matrix=this.matrix.toObject(),i}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(i){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof be?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),i&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};B(io,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Fn=io;const jo={position:{enumerable:!0,get:function(){return this._position},set:function(n){this._position&&this._position.unbind(te.Types.change,this._renderer.flagMatrix),this._position=n,this._position.bind(te.Types.change,this._renderer.flagMatrix),iu.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(n){this._rotation=n,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(n){this._scale instanceof be&&this._scale.unbind(te.Types.change,this._renderer.flagMatrix),this._scale=n,this._scale instanceof be&&this._scale.bind(te.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(n){this._skewX=n,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(n){this._skewY=n,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(n){this._matrix=n,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return U0(this,this._worldMatrix),this._worldMatrix},set:function(n){this._worldMatrix=n}}};function iu(){this._flagMatrix=!0}const ru=/^(?:none|transparent)$/i,m1=8,wa=Number.EPSILON;function Yn(n,e){return{x:n,y:e}}function qo(n,e,i=wa){return Math.abs(n.x-e.x)<=i&&Math.abs(n.y-e.y)<=i}function ou(n,e,i,r){const o=n*i+e*r,s=Math.sqrt(n*n+e*e)*Math.sqrt(i*i+r*r)||1e-12;let a=Math.acos(Math.max(-1,Math.min(1,o/s)));return n*r-e*i<0&&(a=-a),a}function p1(n,e,i){if(!n)return[Yn(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[Yn(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=n.x,d=n.y,u=e.x,f=e.y,h=(c-u)/2,p=(d-f)/2,m=Math.cos(s),g=Math.sin(s);let b=m*h+g*p,y=-g*h+m*p,_=r*r,x=o*o;const w=b*b/_+y*y/x;if(w>1){const A=Math.sqrt(w);r*=A,o*=A,_=r*r,x=o*o}const C=_*y*y+x*b*b,N=C===0?0:(_*x-C)/C;let k=Math.sqrt(Math.max(0,N));a===l&&(k=-k);const $=k*r*y/o,v=-k*o*b/r,E=m*$-g*v+(c+u)/2,P=g*$+m*v+(d+f)/2,F=ou(1,0,(b-$)/r,(y-v)/o),R=ou((b-$)/r,(y-v)/o,(-b-$)/r,(-y-v)/o)%nn,M=F+R,X=l===0,G=(()=>{const A=M-F,Y=Math.abs(A)<Number.EPSILON;let H=Gt(A,nn);return H<Number.EPSILON&&(H=Y?0:nn),X&&!Y&&(H=H===nn?-nn:H-nn),H})(),Z=Math.max(Oo.Resolution,Math.max(i*2,1)),O=[];for(let A=1;A<=Z;A++){const Y=A/Z,H=F+Y*G;let T=E+r*Math.cos(H),D=P+o*Math.sin(H);if(s!==0){const K=T-E,J=D-P,U=Math.cos(s),q=Math.sin(s);T=K*U-J*q+E,D=K*q+J*U+P}O.push(Yn(T,D))}return O}function g1(n,e=m1){const i=[],r=[],o=n._renderer&&n._renderer.vertices&&n._renderer.vertices.length>0?n._renderer.vertices:n.vertices;if(!o||o.length===0)return{polygons:i,segments:r};const s=Math.max(1,Math.floor(e));let a=null,l=null,c=null,d=null;const u=(h=!1)=>{if(a){if(h&&l&&c&&!qo(l,c)){const p=Yn(l.x,l.y);r.push({a:c,b:p}),a.push(p),c=p}a.length>=3&&l&&c&&qo(l,c)&&i.push(a),a=null,l=null,c=null}},f=h=>{if(!c){c=h,a&&a.push(h);return}qo(c,h)||(r.push({a:c,b:h}),a&&a.push(h),c=h)};for(let h=0;h<o.length;h++){const p=o[h],m=p.command||(h===0?me.move:me.line);if(m===me.move){u(!1);const g=Yn(p.x,p.y);a=[g],l=g,c=g,d=p;continue}if(d||(d=o[Math.max(h-1,0)]),m===me.line)f(Yn(p.x,p.y));else if(m===me.curve){const g=ba(p,d,s);for(let b=1;b<g.length;b++){const y=g[b];f(Yn(y.x,y.y))}f(Yn(p.x,p.y))}else if(m===me.arc){const g=p1(d,p,s);for(let b=0;b<g.length;b++)f(g[b])}else if(m===me.close){u(!0),d=p;continue}else f(Yn(p.x,p.y));d=p}if(a){const h=!!n._closed||!!n.closed||l&&c&&!qo(l,c);u(h)}return{polygons:i,segments:r}}function y1(n,e,i){let r=!1;for(let o=0;o<n.length;o++){const s=n[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>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function b1(n,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<wa&&Math.abs(s)<wa){const h=n-i.x,p=e-i.y;return h*h+p*p}const a=((n-i.x)*o+(e-i.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=i.x+l*o,d=i.y+l*s,u=n-c,f=e-d;return u*u+f*f}function _1(n,e,i){if(!n||n.length===0)return 1/0;let r=1/0;for(let o=0;o<n.length;o++){const s=n[o],a=b1(e,i,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function w1(n,e){if(typeof e=="boolean")return e;const i=n.fill;return!i&&i!==0?!1:typeof i=="string"?!ru.test(i):!0}function x1(n,e){const i=typeof n.linewidth=="number"?n.linewidth:n._linewidth||0;if(typeof e=="boolean")return e&&i>0;if(!(i>0))return!1;const r=n.stroke;return!r&&r!==0?!1:typeof r=="string"?!ru.test(r):!0}function k1(n,e,i,r=0){if(!n)return!1;const o=n.left-r,s=n.right+r,a=n.top-r,l=n.bottom+r;return e>=o&&e<=s&&i>=a&&i<=l}const Xo=Number.EPSILON;function Yo(n){return typeof n.relative!="boolean"||!!n.relative}function wn(n,e,i,r){const o=n.controls;if(!(!o||!o[e])){if(Math.abs(i)<Xo&&Math.abs(r)<Xo){Yo(n)?o[e].clear():o[e].set(n.x,n.y);return}Yo(n)?o[e].set(i,r):o[e].set(n.x+i,n.y+r)}}function Zt(n,e){wn(n,e,0,0)}function C1(n,e){const i=n.controls;return!i||!i[e]?{x:0,y:0}:Yo(n)?{x:i[e].x,y:i[e].y}:{x:i[e].x-n.x,y:i[e].y-n.y}}function fr(n,e){const i=C1(n,e);return Math.abs(i.x)>Xo||Math.abs(i.y)>Xo}function Uo(n){n.command===me.move||n.command===me.close||(n.command=fr(n,"left")||fr(n,"right")?me.curve:me.line)}function su(n,e){typeof e.relative=="boolean"&&(n.relative=e.relative)}function v1(n,e){return fr(e,"right")||fr(n,"left")||fr(n,"right")||fr(e,"left")||n.command===me.curve||e.command===me.curve}function hr(n,e,i){return{x:Kt(n.x,e.x,i),y:Kt(n.y,e.y,i)}}function au(n,e){const i=n.controls&&n.controls[e];return i?Yo(n)?{x:n.x+i.x,y:n.y+i.y}:{x:i.x,y:i.y}:{x:n.x,y:n.y}}function S1(n,e,i){const r=n.controls&&n.controls.right,o=e.controls&&e.controls.left,s={x:n.x,y:n.y},a=r?au(n,"right"):{...s},l={x:e.x,y:e.y},c=o?au(e,"left"):{...l},d=hr(s,a,i),u=hr(a,c,i),f=hr(c,l,i),h=hr(d,u,i),p=hr(u,f,i),m=hr(h,p,i),g=new Ae(m.x,m.y);return su(g,n),wn(g,"left",h.x-m.x,h.y-m.y),wn(g,"right",p.x-m.x,p.y-m.y),g.command=me.curve,{anchor:g,startOut:d,endIn:f}}function B1(n,e,i,r,o,s){const a=n.length,l=i-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,f=d;if(r||(u=Math.min(1,e),f=Math.min(1,a-i-1)),c+=u+f,c<=1)return;const h=new Array(c+1);for(let k=0,$=e-u;k<=c;k+=1,$+=1){const v=Gt($,a);h[k]=n[v]}let p=h[0].x+2*h[1].x,m=h[0].y+2*h[1].y,g=2;const b=c-1,y=[p],_=[m],x=[g],w=new Array(c+1),C=new Array(c+1);for(let k=1;k<c;k+=1){const $=k<b,v=$||s?1:2,E=$?4:s?2:7,P=$?4:s?3:8,F=$?2:s?0:1,R=v/g;g=x[k]=E-R,p=y[k]=P*h[k].x+F*h[k+1].x-R*p,m=_[k]=P*h[k].y+F*h[k+1].y-R*m}w[b]=y[b]/x[b],C[b]=_[b]/x[b];for(let k=c-2;k>=0;k-=1)w[k]=(y[k]-w[k+1])/x[k],C[k]=(_[k]-C[k+1])/x[k];w[c]=(3*h[c].x-w[b])/2,C[c]=(3*h[c].y-C[b])/2;const N=c-f;for(let k=u,$=e;k<=N;k+=1,$+=1){const v=Gt($,a),E=n[v],P=w[k]-E.x,F=C[k]-E.y;o||k<N?wn(E,"right",P,F):Zt(E,"right"),o||k>u?wn(E,"left",-P,-F):Zt(E,"left"),Uo(E)}}function N1(n,e,i,r,o,s){const a=e||n,l=n,c=i||n,d=be.distanceBetween(a,l),u=be.distanceBetween(l,c),f=r===void 0?.5:r,h=Math.pow(d,f),p=Math.pow(u,f),m=h*h,g=p*p;if(!o&&e){const b=2*g+3*p*h+m,y=3*p*(p+h);if(y!==0){const _=(g*a.x+b*l.x-m*c.x)/y-l.x,x=(g*a.y+b*l.y-m*c.y)/y-l.y;wn(n,"left",_,x)}else Zt(n,"left")}else Zt(n,"left");if(!s&&i){const b=2*m+3*h*p+g,y=3*h*(h+p);if(y!==0){const _=(m*c.x+b*l.x-g*a.x)/y-l.x,x=(m*c.y+b*l.y-g*a.y)/y-l.y;wn(n,"right",_,x)}else Zt(n,"right")}else Zt(n,"right");Uo(n)}function T1(n,e,i,r,o,s){if(!(e&&i)){e||Zt(n,"left"),i||Zt(n,"right"),Uo(n);return}const a=e,l=n,c=i,d=be.distanceBetween(a,l),u=be.distanceBetween(l,c),f=d+u,h=r===void 0?.4:r,p={x:a.x-c.x,y:a.y-c.y};if(!o&&f!==0){const m=h*d/f;wn(n,"left",p.x*m,p.y*m)}else Zt(n,"left");if(!s&&f!==0){const m=h*d/f-h;wn(n,"right",p.x*m,p.y*m)}else Zt(n,"right");Uo(n)}function $1(n,e,i,r,o,s){const a=s.type,l=s.factor,c=n.length;for(let d=e;d<=i;d+=1){const u=Gt(d,c),f=n[u];if(f.command===me.move){Zt(f,"left"),Zt(f,"right");continue}const h=d===e&&!o?null:d-1,p=d===i&&!o?null:d+1,m=h===null?null:n[Gt(h,c)],g=p===null?null:n[Gt(p,c)],b=h===null,y=p===null;a==="geometric"?T1(f,m,g,l,b,y):N1(f,m,g,l,b,y)}}const mr=Math.min,pr=Math.max,E1=Math.ceil,R1=Math.floor,P1=new be,F1=new ur,Cn=class Cn extends Fn{constructor(i,r,o,s){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 a in lu)Object.defineProperty(this,a,lu[a]);this._renderer.type="path",this._renderer.flagVertices=cu.bind(this),this._renderer.bindVertices=du.bind(this),this._renderer.unbindVertices=uu.bind(this),this._renderer.flagFill=fu.bind(this),this._renderer.flagStroke=hu.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=i,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Ei(i.fill),o=typeof i.stroke=="string"?i.stroke:Ei(i.stroke),s=new Cn().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){if(super.copy.call(this,i),i.vertices){this.vertices=[];for(let r=0;r<i.vertices.length;r++){const o=i.vertices[r];o instanceof Ae?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ae().copy(o))}}for(let r=0;r<Cn.Properties.length;r++){const o=Cn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Cn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Cn.Properties.length;o++){const s=Cn.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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="path",i.vertices=this.vertices.map(r=>r.toObject()),je.each(Cn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?i[r]=this[r].toObject():i[r]=this[r])},this),i}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let i=0;i<this.vertices.length;i++){const r=this.vertices[i];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 i=this.getBoundingClientRect(!0),r=i.width/2,o=i.height/2,s=i.left+i.width/2,a=i.top+i.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 i=this.getBoundingClientRect(!0),r=i.left+i.width/2-this.translation.x,o=i.top+i.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(i){let r,o,s,a,l,c,d=1/0,u=-1/0,f=1/0,h=-1/0;if(this._update(!0),r=i?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:p,scaleY:m}=X0(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof p=="number"&&typeof m=="number"&&(o=Math.max(p,m)*(this.linewidth||0)/2)}else o*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(a=0;a<s;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+s-1)%s];const[p,m]=r.multiply(l.x,l.y),[g,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[x,w]=r.multiply(y,_),C=c.controls.left.x,N=c.controls.left.y;c.relative&&(C+=c.x,N+=c.y);let[k,$]=r.multiply(C,N);const v=Q0(p,m,x,w,k,$,g,b);f=mr(v.min.y-o,f),d=mr(v.min.x-o,d),u=pr(v.max.x+o,u),h=pr(v.max.y+o,h)}else a<=1&&(f=mr(m-o,f),d=mr(p-o,d),u=pr(p+o,u),h=pr(m+o,h)),f=mr(b-o,f),d=mr(g-o,d),u=pr(g+o,u),h=pr(b+o,h)}return{top:f,left:d,right:u,bottom:h,width:u-d,height:h-f}}contains(i,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||i<c.left-l||i>c.right+l||r<c.top-l||r>c.bottom+l)return!1;const d=this.worldMatrix,u=d&&d.inverse(F1);if(!u)return super.contains(i,r,s);const[f,h]=u.multiply(i,r,1),p=typeof s.precision=="number"&&!Number.isNaN(s.precision)?Math.max(1,Math.floor(s.precision)):8,m=w1(this,s.fill),g=x1(this,s.stroke),{polygons:b,segments:y}=g1(this,p);if(m&&b.length>0&&y1(b,f,h))return!0;if(g&&y.length>0){const _=typeof this.linewidth=="number"?this.linewidth:0;if(_>0&&_1(y,f,h)<=_/2+l)return!0}return!m&&!g?super.contains(i,r,s):m&&b.length===0?super.contains(i,r,s):!1}getPointAt(i,r){let o,s,a,l,c,d,u,f,h,p,m,g,b,y,_,x=this.length*Math.min(Math.max(i,0),1);const w=this.vertices.length,C=w-1;let N=null,k=null;for(let O=0,A=this._lengths.length,Y=0;O<A;O++){if(Y+this._lengths[O]>=x){this._closed?(o=Gt(O,w),s=Gt(O-1,w),O===0&&(o=s,s=O)):(o=O,s=Math.min(Math.max(O-1,0),C)),N=this.vertices[o],k=this.vertices[s],x-=Y,this._lengths[O]!==0?i=x/this._lengths[O]:i=0;break}Y+=this._lengths[O]}if(N===null||k===null)return null;if(N){if(!k)return N}else return k;_=k.controls&&k.controls.right,y=N.controls&&N.controls.left,c=k.x,p=k.y,d=(_||k).x,m=(_||k).y,u=(y||N).x,g=(y||N).y,f=N.x,b=N.y,_&&k.relative&&(d+=k.x,m+=k.y),y&&N.relative&&(u+=N.x,g+=N.y),l=Do(i,c,d,u,f),h=Do(i,p,m,g,b);const $=Kt(c,d,i),v=Kt(p,m,i),E=Kt(d,u,i),P=Kt(m,g,i),F=Kt(u,f,i),R=Kt(g,b,i),M=Kt($,E,i),X=Kt(v,P,i),G=Kt(E,F,i),Z=Kt(P,R,i);return je.isObject(r)?(r.x=l,r.y=h,r instanceof Ae&&(r.controls.left.x=M,r.controls.left.y=X,r.controls.right.x=G,r.controls.right.y=Z,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=h,r.controls.right.x-=l,r.controls.right.y-=h)),r.t=i,r):(a=new Ae(l,h,M-l,X-h,G-l,Z-h,this._curved?me.curve:me.line),a.t=i,a)}plot(){if(this.curved)return e1(this._collection,this.closed),this;for(let i=0;i<this._collection.length;i++)this._collection[i].command=i===0?me.move:me.line;return this}smooth(i){const r=i||{},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===me.close,c=(p,m)=>{if(p==null)return m;if(typeof p=="number"){if(l)return Gt(p,a);let b=p;return b<0&&(b+=a),Math.min(Math.max(b,0),a-1)}const g=s.indexOf(p);return g!==-1?g:m},d=l&&r.from===void 0&&r.to===void 0;let u=c(r.from,0),f=c(r.to,a-1);if(u>f)if(l)u-=a;else{const p=u;u=f,f=p}const h=f-u+1;for(let p=0;p<h;p+=1){const m=Gt(u+p,a),g=s[m],b=!l&&m===0;g.command===me.move&&!b&&(g.command=me.line)}if(o==="continuous"||o==="asymmetric")B1(s,u,f,l,d,o==="asymmetric");else if(o==="catmull-rom"||o==="geometric"){const p={type:o,factor:r.factor};$1(s,u,f,l,d,p)}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(i){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===me.move){const f=d.clone();s.push(f),a=d,l=d;continue}if(v1(d,a)){const h=ba(d,a,i).length,p=s[s.length-1];let m=p.clone(),g=d.clone(),b=p,y=0;if(h<=1){const _=d.clone();s.push(_)}else{for(let x=1;x<h;x+=1){const w=x/h,C=1-y,N=C<=Number.EPSILON?w:(w-y)/C,k=S1(m,g,N);wn(b,"right",k.startOut.x-b.x,k.startOut.y-b.y);const $=k.anchor;s.push($),b=$,m=$.clone(),y=w,wn(g,"left",k.endIn.x-g.x,k.endIn.y-g.y)}const _=d.clone();_.controls.left.copy(g.controls.left),s.push(_)}}else{const f=ba(d,a,i);for(let p=1;p<f.length;p+=1){const m=f[p];su(m,a),Zt(m,"left"),Zt(m,"right"),m.command=me.line,s.push(m)}const h=d.clone();s.push(h)}a=d,d.command===me.close&&(a=l)}return this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(i,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===me.move){a=c,this._lengths[d]=0;return}this._lengths[d]=tu(c,a,i),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 i=this._collection.length,r=this._closed,o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),a=Wo(this,o*this._length),l=Wo(this,s*this._length),c=E1(a),d=R1(l);let u,f,h,p,m,g;for(this._renderer.vertices.length=0,g=0;g<i;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new Ae),g>d&&!f?(m=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,m),m.command=this._renderer.collection[g].command,this._renderer.vertices.push(m),f=m,h=this._collection[g-1],h&&h.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),h.relative?this._renderer.collection[g-1].controls.right.copy(h.controls.right).lerp(be.zero,1-m.t):this._renderer.collection[g-1].controls.right.copy(h.controls.right).lerp(h,1-m.t))):g>=c&&g<=d&&(m=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(m),g===d&&eu(this,s)?(f=m,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):g===c&&eu(this,o)&&(u=m,u.command=me.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(g=c-1,m=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(o,m),m.command=me.move,this._renderer.vertices.unshift(m),p=this._collection[g+1],p&&p.controls&&(m.controls.left.clear(),p.relative?this._renderer.collection[g+1].controls.left.copy(p.controls.left).lerp(be.zero,m.t):(P1.copy(p),this._renderer.collection[g+1].controls.left.copy(p.controls.left).lerp(p,m.t))))}return Fn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Fn.prototype.flagReset.call(this),this}};B(Cn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),B(Cn,"Utils",{getCurveLength:tu});let Oe=Cn;const lu={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(n){this._linewidth=n,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._opacity=n,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(n){this._visible=n,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(n){this._cap=n,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(n){this._join=n,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(n){this._miter=n,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(n){(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=n,this._flagFill=!0,(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(n){(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=n,this._flagStroke=!0,(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.bind(te.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(n){this._closed=!!n,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(n){this._curved=!!n,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(n){if(n===this._automatic)return;this._automatic=!!n;const e=this._automatic?"ignore":"listen";je.each(this.vertices,function(i){i[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(n){this._beginning=n,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(n){this._ending=n,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(n){const e=this._renderer.bindVertices,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(te.Types.insert,e).unbind(te.Types.remove,i),n instanceof Ti?this._collection=n:this._collection=new Ti(n||[]),this._collection.bind(te.Types.insert,e).bind(te.Types.remove,i),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(n){this._mask=n,this._flagMask=!0,je.isObject(n)&&!n.clip&&(n.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(n){this._clip=n,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(n){typeof n.offset!="number"&&(n.offset=this.dashes&&this._dashes.offset||0),this._dashes=n}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(n){this._strokeAttenuation=!!n,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function cu(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function du(n){let e=n.length;for(;e--;)n[e].bind(te.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function uu(n){let e=n.length;for(;e--;)n[e].unbind(te.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fu(){this._flagFill=!0}function hu(){this._flagStroke=!0}const V1=Math.ceil,M1=Math.floor,Dn=class Dn extends Fn{constructor(i){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",Oe.prototype.noFill);B(this,"noStroke",Oe.prototype.noStroke);B(this,"corner",Oe.prototype.corner);B(this,"center",Oe.prototype.center);B(this,"getBoundingClientRect",Oe.prototype.getBoundingClientRect);B(this,"_updateLength",Oe.prototype._updateLength);for(let r in mu)Object.defineProperty(this,r,mu[r]);this._renderer.type="points",this._renderer.flagVertices=cu.bind(this),this._renderer.bindVertices=du.bind(this),this._renderer.unbindVertices=uu.bind(this),this._renderer.flagFill=fu.bind(this),this._renderer.flagStroke=hu.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=i,this.dashes=[],this.dashes.offset=0}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Ei(i.fill),o=typeof i.stroke=="string"?i.stroke:Ei(i.stroke),s=new Dn().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){super.copy.call(this,i);for(let r=0;r<i.vertices.length;r++){const o=i.vertices[r];o instanceof Ae?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ae().copy(o))}for(let r=0;r<Dn.Properties.length;r++){const o=Dn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Dn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Dn.Properties.length;o++){const s=Dn.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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="points",i.vertices=this.vertices.map(r=>r.toObject()),je.each(Dn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?i[r]=this[r].toObject():i[r]=this[r])},this),i}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let i=0;i<this.vertices.length;i++){const r=this.vertices[i];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(i){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,f=qd(l,c,l,c,d,u,d,u,i);r=r.concat(f)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const i=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),o=Wo(this,i*this._length),s=Wo(this,r*this._length),a=V1(o),l=M1(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}};B(Dn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let Ko=Dn;const mu={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(n){this._linewidth=n,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._opacity=n,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(n){this._visible=n,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(n){this._size=n,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(n){this._sizeAttenuation=n,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(n){(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=n,this._flagFill=!0,(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(n){(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=n,this._flagStroke=!0,(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.bind(te.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(n){this._beginning=n,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(n){this._ending=n,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(n){const e=this._renderer.bindVertices,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(te.Types.insert,e).unbind(te.Types.remove,i),n instanceof Ti?this._collection=n:this._collection=new Ti(n||[]),this._collection.bind(te.Types.insert,e).bind(te.Types.remove,i),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(n){typeof n.offset!="number"&&(n.offset=this.dashes&&this._dashes.offset||0),this._dashes=n}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(n){this._strokeAttenuation=!!n,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class pu extends Ti{constructor(i){i=Array.isArray(i)?i:Array.prototype.slice.call(arguments);super(i);Hl(this,Cs,{});this.attach(i),this.on(te.Types.insert,this.attach),this.on(te.Types.remove,this.detach)}get ids(){return qt(this,Cs)}attach(i){for(let r=0;r<i.length;r++){const o=i[r];o&&o.id&&(this.ids[o.id]=o)}return this}detach(i){for(let r=0;r<i.length;r++)delete this.ids[i[r].id];return this}}Cs=new WeakMap;const Qn=class Qn extends Oe{constructor(i,r,o,s,a,l,c){const d=c||Oo.Resolution*3,u=[];for(let f=0;f<d;f++)u.push(new Ae);super(u,!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",nn);B(this,"_innerRadius",0);B(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in gu)Object.defineProperty(this,f,gu[f]);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 i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Qn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Qn.Properties.length;r++){const o=Qn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const i=this._startAngle,r=this._endAngle,o=this._innerRadius,s=this._outerRadius,a=Gt(i,nn)===Gt(r,nn),l=o>0,c=this.vertices;let d=l?c.length/2:c.length,u,f=0,h,p,m,g,b,y,_,x,w;for(a?d--:l||(d-=2),h=0,p=d-1;h<d;h++){switch(m=h/p,g=c[f],b=m*(r-i)+i,y=(r-i)/d,_=s*Math.cos(b),x=s*Math.sin(b),h){case 0:u=me.move;break;default:u=me.curve}g.command=u,g.x=_,g.y=x,g.controls.left.clear(),g.controls.right.clear(),g.command===me.curve&&(w=s*y/Math.PI,g.controls.left.x=w*Math.cos(b-kt),g.controls.left.y=w*Math.sin(b-kt),g.controls.right.x=w*Math.cos(b+kt),g.controls.right.y=w*Math.sin(b+kt),h===1&&g.controls.left.multiplyScalar(2),h===p&&g.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=me.close,f++):(d--,p=d-1),h=0;h<d;h++)m=h/p,g=c[f],b=(1-m)*(r-i)+i,y=(r-i)/d,_=o*Math.cos(b),x=o*Math.sin(b),u=me.curve,h<=0&&(u=a?me.move:me.line),g.command=u,g.x=_,g.y=x,g.controls.left.clear(),g.controls.right.clear(),g.command===me.curve&&(w=o*y/Math.PI,g.controls.left.x=w*Math.cos(b+kt),g.controls.left.y=w*Math.sin(b+kt),g.controls.right.x=w*Math.cos(b-kt),g.controls.right.y=w*Math.sin(b-kt),h===1&&g.controls.left.multiplyScalar(2),h===p&&g.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=me.line}else a||(c[f].command=me.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=me.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(i){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<Oe.Properties.length;d++){const u=Oe.Properties[d];c[u]=this[u]}return i&&i.add(c),c}toObject(){const i=super.toObject.call(this);i.renderer.type="arc-segment";for(let r=0;r<Qn.Properties.length;r++){const o=Qn.Properties[r];i[o]=this[o]}return i}};B(Qn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let xa=Qn;const gu={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(n){this._startAngle=n,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(n){this._endAngle=n,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(n){this._innerRadius=n,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(n){this._outerRadius=n,this._flagOuterRadius=!0}}},ka=Math.cos,Ca=Math.sin,Jn=class Jn extends Oe{constructor(i,r,o,s){const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Ae(0,0,0,0,0,0));super(l,!0,!0,!0);B(this,"_flagRadius",!1);B(this,"_radius",0);this._renderer.type="circle";for(let c in yu)Object.defineProperty(this,c,yu[c]);typeof o=="number"&&(this.radius=o),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Jn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Jn.Properties.length;r++){const o=Jn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagRadius){let i=this.vertices.length;!this._closed&&i>2&&(i-=1);const r=4/3*Math.tan(Math.PI/(i*2)),o=this._radius,s=o*r;for(let a=0;a<this.vertices.length;a++){const c=a/i*nn,d=o*ka(c),u=o*Ca(c),f=s*ka(c-kt),h=s*Ca(c-kt),p=s*ka(c+kt),m=s*Ca(c+kt),g=this.vertices[a];g.command=a===0?me.move:me.curve,g.set(d,u),g.controls.left.set(f,h),g.controls.right.set(p,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(i){const r=new Jn(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<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);i.renderer.type="circle";for(let r=0;r<Jn.Properties.length;r++){const o=Jn.Properties[r];i[o]=this[o]}return i}};B(Jn,"Properties",["radius"]);let va=Jn;const yu={radius:{enumerable:!0,get:function(){return this._radius},set:function(n){this._radius=n,this._flagRadius=!0}}},Sa=Math.cos,Ba=Math.sin,ei=class ei extends Oe{constructor(i,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 Ae);super(c,!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 d in bu)Object.defineProperty(this,d,bu[d]);typeof o=="number"&&(this.width=o*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new ei().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ei.Properties.length;r++){const o=ei.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let i=this.vertices.length;!this._closed&&i>2&&(i-=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/i*nn,d=o*Sa(c),u=s*Ba(c),f=o*r*Sa(c-kt),h=s*r*Ba(c-kt),p=o*r*Sa(c+kt),m=s*r*Ba(c+kt),g=this.vertices[a];g.command=a===0?me.move:me.curve,g.set(d,u),g.controls.left.set(f,h),g.controls.right.set(p,m)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(i){const r=this.width/2,o=this.height/2,s=this.vertices.length,a=new ei(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<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}toObject(){const i=super.toObject.call(this);i.renderer.type="ellipse";for(let r=0;r<ei.Properties.length;r++){const o=ei.Properties[r];i[o]=this[o]}return i}};B(ei,"Properties",["width","height"]);let Na=ei;const bu={width:{enumerable:!0,get:function(){return this._width},set:function(n){this._width=n,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(n){this._height=n,this._flagHeight=!0}}},I1=Math.cos,A1=Math.sin,ti=class ti extends Oe{constructor(i,r,o,s){s=Math.max(s||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 a in _u)Object.defineProperty(this,a,_u[a]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.radius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new ti().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ti.Properties.length;r++){const o=ti.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const i=this._sides,r=i+1;let o=this.vertices.length;o>i&&(this.vertices.splice(i-1,o-i),o=i);for(let s=0;s<r;s++){const a=(s+.5)/i,l=nn*a+Math.PI/2,c=this._width*I1(l)/2,d=this._height*A1(l)/2;s>=o?this.vertices.push(new Ae(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?me.move:me.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(i){const r=new ti(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<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);i.renderer.type="polygon";for(let r=0;r<ti.Properties.length;r++){const o=ti.Properties[r];i[o]=this[o]}return i}};B(ti,"Properties",["width","height","sides"]);let Ta=ti;const _u={radius:{enumerable:!0,get:function(){return this._radius},set:function(n){this._radius=n,this.width=n*2,this.height=n*2}},width:{enumerable:!0,get:function(){return this._width},set:function(n){this._width=n,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(n){this._height=n,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(n){this._sides=n,this._flagSides=!0}}},Xi=class Xi extends Oe{constructor(i,r,o,s){const a=[new Ae,new Ae,new Ae,new Ae];super(a,!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 l in wu)Object.defineProperty(this,l,wu[l]);this.width=typeof o=="number"?o:1,this.height=typeof s=="number"?s:1,this.origin=new be,typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(i){const r=new Xi().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Xi.Properties.length;r++){const o=Xi.Properties[r];o in i&&(typeof i[o]=="number"?this[o]=i[o]:this[o]instanceof be&&this[o].copy(i[o]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const i=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Ae),this.vertices[0].set(-i,-r).sub(this._origin).command=me.move,this.vertices[1].set(i,-r).sub(this._origin).command=me.line,this.vertices[2].set(i,r).sub(this._origin).command=me.line,this.vertices[3].set(-i,r).sub(this._origin).command=me.line,this.vertices[4]&&(this.vertices[4].set(-i,-r).sub(this._origin).command=me.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(i){const r=new Xi(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<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]instanceof be?r[s].copy(this[s]):r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="rectangle",i.width=this.width,i.height=this.height,i.origin=this.origin.toObject(),i}};B(Xi,"Properties",["width","height","origin"]);let zr=Xi;const wu={width:{enumerable:!0,get:function(){return this._width},set:function(n){this._width=n,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(n){this._height=n,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(n){this._origin&&this._origin.unbind(te.Types.change,this._renderer.flagVertices),this._origin=n,this._origin.bind(te.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},ni=class ni extends Oe{constructor(i,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 Ae(0,0,0,0,0,0,c===0?me.move:me.curve));super(l);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 c in xu)Object.defineProperty(this,c,xu[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=O1.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof a=="number"||a instanceof be)&&(this.radius=a),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new ni().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ni.Properties.length;r++){const o=ni.Properties[r];if(o in i){const s=i[o];/radius/i.test(o)?this[o]=typeof s=="number"||s instanceof be?s:new be().copy(s):typeof s=="number"&&(this[o]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const i=this._width,r=this._height;let o,s;this._radius instanceof be?(o=this._radius.x,s=this._radius.y):(o=this._radius,s=this._radius);let a,l=i/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(i){const r=this.width,o=this.height,s=this.radius,a=new ni(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<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}toObject(){const i=super.toObject.call(this);i.renderer.type="rounded-rectangle";for(let r=0;r<ni.Properties.length;r++){const o=ni.Properties[r];i[o]=this[o]}return i.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),i}};B(ni,"Properties",["width","height","radius"]);let $a=ni;const xu={width:{enumerable:!0,get:function(){return this._width},set:function(n){this._width=n,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(n){this._height=n,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(n){this._radius instanceof be&&this._radius.unbind(te.Types.change,this._renderer.flagRadius),this._radius=n,this._radius instanceof be&&this._radius.bind(te.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function O1(){this._flagRadius=!0}const z1=Math.cos,D1=Math.sin,ii=class ii extends Oe{constructor(i,r,o,s,a){arguments.length<=3&&(s=o,o=s/2),(typeof a!="number"||a<=0)&&(a=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 l in ku)Object.defineProperty(this,l,ku[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 i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new ii().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ii.Properties.length;r++){const o=ii.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const i=this._sides*2,r=i+1;let o=this.vertices.length;o>i&&(this.vertices.splice(i-1,o-i),o=i);for(let s=0;s<r;s++){const a=(s+.5)/i,l=nn*a,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*z1(l),u=c*D1(l);s>=o?this.vertices.push(new Ae(d,u)):this.vertices[s].set(d,u),this.vertices[s].command=s===0?me.move:me.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(i){const r=this.innerRadius,o=this.outerRadius,s=this.sides,a=new ii(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<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}toObject(){const i=super.toObject.call(this);i.renderer.type="star";for(let r=0;r<ii.Properties.length;r++){const o=ii.Properties[r];i[o]=this[o]}return i}};B(ii,"Properties",["innerRadius","outerRadius","sides"]);let Ea=ii;const ku={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(n){this._innerRadius=n,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(n){this._outerRadius=n,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(n){this._sides=n,this._flagSides=!0}}};let Ra;const Cu=Math.min,vu=Math.max;Rn.document&&(Ra=document.createElement("canvas"));const Vt=class Vt extends Fn{constructor(i,r,o,s){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 a in Su)Object.defineProperty(this,a,Su[a]);if(this._renderer.type="text",this._renderer.flagFill=L1.bind(this),this._renderer.flagStroke=H1.bind(this),this.value=i,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<Vt.Properties.length;a++){const l=Vt.Properties[a];l in s&&(this[l]=s[l])}}static Measure(i){if(Ra){const r=Ra.getContext("2d");r.font=[i._style,i._weight,`${i._size}px/${i._leading}px`,i._family].join(" ");const o=r.measureText(i.value,0,0),s=o.actualBoundingBoxDescent+o.actualBoundingBoxAscent;return{width:o.width,height:s}}else{const r=this.value.length*this.size*Vt.Ratio,o=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:o}}}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Ei(i.fill),o=typeof i.stroke=="string"?i.stroke:Ei(i.stroke),s=new Vt().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){super.copy.call(this,i);for(let r=0;r<Vt.Properties.length;r++){const o=Vt.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Vt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let o=0;o<Vt.Properties.length;o++){const s=Vt.Properties[o];r[s]=this[s]}return this.matrix.manual&&r.matrix.copy(this.matrix),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);i.renderer.type="text";for(let r=0;r<Vt.Properties.length;r++){const o=Vt.Properties[r];i[o]=this[o]}return i}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(i){let r,o,s,a,l;this._update(!0),r=i?this.matrix:this.worldMatrix;const{width:c,height:d}=Vt.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[f,h]=r.multiply(o,a),[p,m]=r.multiply(o,l),[g,b]=r.multiply(s,a),[y,_]=r.multiply(s,l);return a=Cu(h,m,b,_),o=Cu(f,p,g,y),s=vu(f,p,g,y),l=vu(h,m,b,_),{top:a,left:o,right:s,bottom:l,width:s-o,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};B(Vt,"Ratio",.6),B(Vt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let gr=Vt;const Su={value:{enumerable:!0,get:function(){return this._value},set:function(n){this._value=n,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(n){this._family=n,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(n){this._size=n,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(n){this._leading=n,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(n){this._alignment=n,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(n){this._linewidth=n,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(n){this._style=n,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(n){this._weight=n,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(n){this._decoration=n,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(n){this._direction=n,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(n){this._baseline=n,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._opacity=n,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(n){this._visible=n,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(n){(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=n,this._flagFill=!0,(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(n){(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=n,this._flagStroke=!0,(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.bind(te.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(n){this._mask=n,this._flagMask=!0,je.isObject(n)&&!n.clip&&(n.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(n){this._clip=n,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(n){typeof n.offset!="number"&&(n.offset=this.dashes&&this._dashes.offset||0),this._dashes=n}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(n){this._strokeAttenuation=!!n,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function L1(){this._flagFill=!0}function H1(){this._flagStroke=!0}const ri=class ri extends zr{constructor(i,r,o,s){super(r,o,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 a in Bu)Object.defineProperty(this,a,Bu[a]);this._renderer.flagTextures=W1.bind(this),this._renderer.bindTextures=j1.bind(this),this._renderer.unbindTextures=q1.bind(this),this.noStroke(),this.noFill(),Array.isArray(i)?this.textures=i.map(Nu.bind(this)):typeof i=="string"&&(this.textures=[Nu(i)]),this.origin=new be,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=ri.DefaultFrameRate,this.index=0}static fromObject(i){const r=new ri().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ri.Properties.length;r++){const o=ri.Properties[r];o in i&&(this[o]=i[o])}return this}play(i,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=je.performance.now(),typeof i=="number"&&(this._firstFrame=i),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(i){const r=new ri(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="image-sequence",i.textures=this.textures.map(function(r){return r.toObject()}),i.frameRate=this.frameRate,i.index=this.index,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,i.loop=this.loop,i}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 i=0;i<this.textures.length;i++){const r=this.textures[i];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const i=this._textures;let r,o,s,a,l,c,d,u;return i&&(this._flagTextures&&(this._amount=i.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=Kt(this._firstFrame,u,s/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=i[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 nt))&&(c=i[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}};B(ri,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),B(ri,"DefaultFrameRate",30);let Pa=ri;const Bu={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(n){this._frameRate=n,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(n){this._index=n,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(n){const e=this._renderer.bindTextures,i=this._renderer.unbindTextures;this._textures&&this._textures.unbind(te.Types.insert,e).unbind(te.Types.remove,i),this._textures=new Ti((n||[]).slice(0)),this._textures.bind(te.Types.insert,e).bind(te.Types.remove,i),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(n){this._firstFrame=n}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(n){this._lastFrame=n}},loop:{enumerable:!0,get:function(){return this._loop},set:function(n){this._loop=!!n}}};function W1(){this._flagTextures=!0}function j1(n){let e=n.length;for(;e--;)n[e].bind(te.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function q1(n){let e=n.length;for(;e--;)n[e].unbind(te.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Nu(n){if(n instanceof nt)return n;if(typeof n=="string")return new nt(n)}const Yi=class Yi extends zr{constructor(i,r,o,s,a,l){super(r,o,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 c in Tu)Object.defineProperty(this,c,Tu[c]);this.noStroke(),this.noFill(),i instanceof nt?this.texture=i:typeof i=="string"&&(this.texture=new nt(i)),this.origin=new be,this._update(),typeof s=="number"&&(this.columns=s),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(i){const r=new Yi().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Yi.Properties.length;r++){const o=Yi.Properties[r];o in i&&(this[o]=i[o])}return this}play(i,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=je.performance.now(),typeof i=="number"&&(this._firstFrame=i),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(i){const r=new Yi(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,i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="sprite",i.texture=this.texture.toObject(),i.columns=this.columns,i.rows=this.rows,i.frameRate=this.frameRate,i.index=this.index,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,i.loop=this.loop,i}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 i=this._texture,r=this._columns,o=this._rows;let s,a,l,c,d,u,f,h,p;if(i&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=i),i.loaded)){f=i.image.width,h=i.image.height,s=f/r,a=h/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,p=this._lastFrame+1,d=1e3*(p-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Kt(this._firstFrame,p,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%r,g=Math.floor(this._index/r),b=-s*m+(f-s)/2,y=-a*g+(h-a)/2;b!==i.offset.x&&(i.offset.x=b),y!==i.offset.y&&(i.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(Yi,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Fa=Yi;const Tu={texture:{enumerable:!0,get:function(){return this._texture},set:function(n){this._texture=n,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(n){this._columns=n,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(n){this._rows=n,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(n){this._frameRate=n,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(n){this._index=n,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(n){this._firstFrame=n}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(n){this._lastFrame=n}},loop:{enumerable:!0,get:function(){return this._loop},set:function(n){this._loop=!!n}}},Go=Math.min,Zo=Math.max,X1={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},Wt=class Wt extends Fn{constructor(i){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 r in $u)Object.defineProperty(this,r,$u[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(i)?i:Array.prototype.slice.call(arguments)}static InsertChildren(i){for(let r=0;r<i.length;r++)Eu.call(this,i[r],this)}static RemoveChildren(i){for(let r=0;r<i.length;r++)Eu.call(this,i[r])}static OrderChildren(i){this._flagOrder=!0}static fromObject(i){const r=new Wt;for(let s=0;s<Wt.Properties.length;s++){const a=Wt.Properties[s];a in i&&(/(fill|stroke)/i.test(a)?r[a]=typeof i[a]=="string"?i[a]:Ei(i[a]):r[a]=i[a])}return"mask"in i&&(r.mask=o(i.mask)),"id"in i&&(r.id=i.id),r.children=i.children.map(o),r;function o(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return xa.fromObject(s);case"circle":return va.fromObject(s);case"element":return Or.fromObject(s);case"ellipse":return Na.fromObject(s);case"group":return Wt.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return Pa.fromObject(s);case"path":return Oe.fromObject(s);case"points":return Ko.fromObject(s);case"polygon":return Ta.fromObject(s);case"rectangle":return zr.fromObject(s);case"rounded-rectangle":return $a.fromObject(s);case"shape":return Fn.fromObject(s);case"sprite":return Fa.fromObject(s);case"star":return Ea.fromObject(s);case"text":return gr.fromObject(s)}return s}}static IsVisible(i,r){if(!r)return!0;let o=i;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(i,r,o,s,a,l,c){const d=i&&i.children;if(!d)return!1;const u=r.results;for(let f=d.length-1;f>=0;f--){const h=d[f];if(!h||!Wt.IsVisible(h,r.visibleOnly))continue;const p=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null;if(!(p&&!k1(p,r.x,r.y,l))){if(h instanceof Wt){if(o&&(!s||s(h))&&typeof h.contains=="function"&&h.contains(r.x,r.y,a)&&(u.push(h),c)||Wt.VisitForHitTest(h,r,o,s,a,l,c))return!0;continue}if(h instanceof Fn&&!(s&&!s(h))&&typeof h.contains=="function"&&h.contains(r.x,r.y,a)&&(u.push(h),c))return!0}}return!1}copy(i){super.copy.call(this,i),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<Wt.Properties.length;r++){const o=Wt.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Wt,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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="group",i.children=[],i.opacity=this.opacity,i.className=this.className,i.mask=this.mask?this.mask.toObject():null,je.each(this.children,(r,o)=>{i.children[o]=r.toObject()},this),i}dispose(){if(super.dispose(),this.children)for(let i=0;i<this.children.length;i++){const r=this.children[i];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}getShapesAtPoint(i,r,o){const s=o||{},{results:a,hitOptions:l,context:c,single:d,empty:u}=X1.getShapesAtPoint;a.length=0;const f=s.mode==="deepest"||s.deepest?"deepest":"all",h=s.visibleOnly!==!1,p=!!s.includeGroups,m=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=!h;const b=f==="deepest";if(c.x=i,c.y=r,c.visibleOnly=h,c.results=a,Wt.VisitForHitTest(this,c,p,m,l,g,b),b){if(a.length>0){const _=a[0];return a.length=0,d[0]=_,d.length=1,d}return u.length=0,u}const y=a.slice();return a.length=0,y}corner(){const i=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const o=this.children[r];o.translation.x-=i.left,o.translation.y-=i.top}return this.mask&&(this.mask.translation.x-=i.left,this.mask.translation.y-=i.top),this}center(){const i=this.getBoundingClientRect(!0),r=i.left+i.width/2-this.translation.x,o=i.top+i.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(i){let r=null;function o(s){if(s.id===i)return s;if(s.children){if(s.children.ids[i])return s.children.ids[i];for(let a=0;a<s.children.length;a++)if(r=o(s.children[a]),r)return r}return null}return o(this)}getByClassName(i){const r=[];function o(s){if(Array.prototype.indexOf.call(s.classList,i)>=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(i){const r=[];function o(s){if(s instanceof i&&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(i){i instanceof Array?i=i.slice():i=Array.prototype.slice.call(arguments);for(let r=0;r<i.length;r++){const o=i[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(i){const r=arguments.length,o=this.parent;if(r<=0&&o)return o.remove(this),this;i instanceof Array?i=i.slice():i=Array.prototype.slice.call(arguments);for(let s=0;s<i.length;s++){const a=i[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(i){let r,o,s,a,l,c;this._update(!0);let d=1/0,u=-1/0,f=1/0,h=-1/0;const p=/texture|gradient/i;o=i?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const g=this.children[m];if(!(!g.visible||p.test(g._renderer.type))&&(r=g.getBoundingClientRect(i),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(i){const[b,y]=o.multiply(r.left,r.top),[_,x]=o.multiply(r.right,r.top),[w,C]=o.multiply(r.left,r.bottom),[N,k]=o.multiply(r.right,r.bottom);f=Go(y,x,C,k,f),d=Go(b,_,w,N,d),u=Zo(b,_,w,N,u),h=Zo(y,x,C,k,h)}else f=Go(r.top,f),d=Go(r.left,d),u=Zo(r.right,u),h=Zo(r.bottom,h)}return{top:f,left:d,right:u,bottom:h,width:u-d,height:h-f}}noFill(){return this.children.forEach(function(i){i.noFill()}),this}noStroke(){return this.children.forEach(function(i){i.noStroke()}),this}subdivide(){const i=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,i)}),this}_update(){let i,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(i=0;i<this.children.length;i++)o=this.children[i],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}};B(Wt,"Children",pu),B(Wt,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Un=Wt;const $u={visible:{enumerable:!0,get:function(){return this._visible},set:function(n){this._flagVisible=this._visible!==n||this._flagVisible,this._visible=n}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._flagOpacity=this._opacity!==n||this._flagOpacity,this._opacity=n}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(n){this._flagBeginning=this._beginning!==n||this._flagBeginning,this._beginning=n}},ending:{enumerable:!0,get:function(){return this._ending},set:function(n){this._flagEnding=this._ending!==n||this._flagEnding,this._ending=n}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let n=0;n<this.children.length;n++){const e=this.children[n];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(n){this._fill=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.fill=n}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(n){this._stroke=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.stroke=n}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(n){this._linewidth=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.linewidth=n}}},join:{enumerable:!0,get:function(){return this._join},set:function(n){this._join=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.join=n}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(n){this._miter=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.miter=n}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(n){this._cap=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.cap=n}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(n){this._closed=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.closed=n}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(n){this._curved=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.curved=n}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(n){this._automatic=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.automatic=n}}},children:{enumerable:!0,get:function(){return this._children},set:function(n){const e=Un.InsertChildren.bind(this),i=Un.RemoveChildren.bind(this),r=Un.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&i(this._children)),this._children=new pu(n),this._children.bind(te.Types.insert,e),this._children.bind(te.Types.remove,i),this._children.bind(te.Types.order,r),n.length>0&&e(n)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(n){this._mask=n,this._flagMask=!0,je.isObject(n)&&!n.clip&&(n.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(n){this._strokeAttenuation=!!n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.strokeAttenuation!==void 0&&(i.strokeAttenuation=n)}}}};function Eu(n,e){const i=n.parent;let r;if(i===e){o();return}if(i&&i.children.ids[n.id]&&(r=Array.prototype.indexOf.call(i.children,n),i.children.splice(r,1),s()),e){o();return}s(),i._flagAdditions&&i.additions.length===0&&(i._flagAdditions=!1),i._flagSubtractions&&i.subtractions.length===0&&(i._flagSubtractions=!1),delete n.parent;function o(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,n),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,n),r>=0&&e.additions.splice(r,1)),n.parent=e,e.additions.push(n),e._flagAdditions=!0}function s(){r=Array.prototype.indexOf.call(i.additions,n),r>=0&&i.additions.splice(r,1),r=Array.prototype.indexOf.call(i.subtractions,n),r<0&&(i.subtractions.push(n),i._flagSubtractions=!0)}}class Qo extends Oe{constructor(e,i,r,o){const s=[new Ae(e,i),new Ae(r,o)];super(s);for(let a in Ru)Object.defineProperty(this,a,Ru[a]);this.vertices[0].command=me.move,this.vertices[1].command=me.line,this.automatic=!1}}B(Qo,"Properties",["left","right"]);const Ru={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(n){if(je.isObject(n))this.vertices.splice(0,1,n),this.vertices[0].command=me.move;else{const e=new Lo("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(n){if(je.isObject(n))this.vertices.splice(1,1,n),this.vertices[1].command=me.line;else{const e=new Lo("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Va{constructor(e=0,i=0){this.x=e,this.y=i}}class Vn{constructor(e=10,i=0,r="A"){B(this,"start",new Va);B(this,"end",new Va);this.width=e,this.angle=i,this.label=r}}const Ke={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"}},Y1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function U1(n,e){return t.openBlock(),t.createElementBlock("svg",Y1,[...e[0]||(e[0]=[t.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 Jo=t.markRaw({name:"ion-close",render:U1}),K1={class:"mr-3 flex flex-col gap-2"},G1=["onClick"],Z1={class:"h-full p-2"},Q1={},J1=t.defineComponent({...Q1,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(n,{emit:e}){const i=n,r=t.ref(!1),o=t.useTemplateRef("drawing-template-containers"),s=t.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return t.onMounted(()=>{var c,d;(c=i.settings.templates)==null||c.forEach((u,f)=>{var p;const h=(p=o.value)==null?void 0:p.at(f);h&&a("init-draw-template",h,u)}),(d=i.settings.customTemplates)==null||d.forEach((u,f)=>{var p;const h=(p=s.value)==null?void 0:p.at(f);h&&a("init-draw-template",h,u)})}),t.watch(()=>[...i.settings.customTemplates],(c,d)=>{t.nextTick(()=>{c.forEach((u,f)=>{var h;if(!(d!=null&&d.includes(u))){const p=(h=s.value)==null?void 0:h.at(f);p&&a("init-draw-template",p,u)}}),d.length>c.length&&d.forEach((u,f)=>{var p;const h=(p=s.value)==null?void 0:p.at(f);h&&(h.innerHTML="",a("init-draw-template",h,u))})})},{deep:!0}),(c,d)=>{const u=Jo;return t.openBlock(),t.createBlock(t.unref(I.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:t.withCtx(()=>[t.createElementVNode("div",K1,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.settings.allTemplates,(f,h)=>(t.openBlock(),t.createElementBlock("div",{key:`${f.id}-${h}`,class:"group relative"},[t.createVNode(t.unref(I.NPopover),{trigger:"hover",placement:"right"},{trigger:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":h===n.selectTemplateIndex}]),onClick:p=>a("template:select",h)},[t.createElementVNode("div",Z1,[t.createElementVNode("div",{ref_for:!0,ref:f.isCustom&&f.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,G1)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(f.label),1)]),_:2},1024),f.isCustom&&!f.isNewRec()?(t.openBlock(),t.createBlock(t.unref(I.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:p=>l(h)},{default:t.withCtx(()=>[t.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):t.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Pu=gn(J1,[["__scopeId","data-v-afccb364"]]),eb={class:"flex gap-3 min-w-[20rem] relative"},tb={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},nb={ref:"drawing-container",class:"size-full"},ib={},Fu=t.defineComponent({...ib,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("drawing-container");let s=[],a=[],l=[],c=null;const d=.75,u=t.computed(()=>i.value.configuratorParams.linesAngles.map((O,A)=>new Vn(i.value.configuratorParams.linesWidths[A],O,`A-${A+1}`))),f=t.computed(()=>i.value.configuratorParams.colorSide==="bottom"),h=t.computed(()=>{var O,A;return i.value.configuratorParams.startTailType&&((O=i.settings.startTailConfigs)!=null&&O[i.value.configuratorParams.startTailType])?(A=i.settings.startTailConfigs)==null?void 0:A[i.value.configuratorParams.startTailType].points:[]}),p=t.computed(()=>{var A;const O=i.value.configuratorParams.endTailType!==void 0&&((A=i.settings.endTailConfigs)==null?void 0:A[i.value.configuratorParams.endTailType]);return!O||!O.points?[]:O.points.map((Y,H)=>Array.isArray(Y)?new Vn(Y[0],Y[1],`A-${H+1}`):new Vn(Y.width,Y.angle,`A-${H+1}`))}),m=(O,A=!1)=>{O[0].start.x=0,O[0].start.y=0;let Y=0;for(let H=0;H<O.length;H++){const T=O[H],D=O[H-1]??new Vn(0,Y);Y+=!A||H>1?D.angle:0;const K=(!A||H>0?T.angle:0)+Y;if(O[H].end.x=T.width*Math.cos(K*Math.PI/180)+O[H].start.x,O[H].end.y=T.width*Math.sin(K*Math.PI/180)+O[H].start.y,H<O.length-1){const J=H+1;O[J].start.x=O[H].end.x,O[J].start.y=O[H].end.y}}return O},g=(O,A,Y,H,T=!1)=>{let D=m([...Y,...H]);A.length>0&&(D=[...m(A),...D]);let K=0,J=0,U=0,q=0;D.forEach(oe=>{K=Math.min(K,oe.start.x,oe.end.x),J=Math.min(J,oe.start.y,oe.end.y),U=Math.max(U,oe.start.x,oe.end.x),q=Math.max(q,oe.start.y,oe.end.y)});let L,le;K===0&&J===0&&U===0&&q===0?(L=1,le=1):(L=O.width/Math.abs(U-K),le=(T?O.height:O.height-Ke.colorSideLabel.size)/Math.abs(q-J));const ue=Math.min(L,le);return K=K<0?-K*ue:0,J=J<0?-J*ue:0,[ue,K,J]},b=O=>{const A=new Ko([O]);return A._size=Ke.anchorPoint.size,A.fill=Ke.anchorPoint.color,A.stroke="transparent",A._linewidth=Ke.anchorPoint.strokeSize,l.push(A),A},y=(O,A)=>{if(l=[],i.settings.allowChangeFirstPoint){const Y=O[0],H=new be(Y.vertices[0].x,Y.vertices[0].y);H.bind(te.Types.change,()=>{Y.vertices[0].copy(H)});const T=b(H);A.add(T)}O.forEach((Y,H)=>{const T=O[H+1],D=new be(Y.vertices[1].x,Y.vertices[1].y);D.bind(te.Types.change,()=>{Y.vertices[1].copy(D),T!==void 0&&T.vertices[0].copy(D)});const K=b(D);A.add(K)})},_=O=>O*(Math.PI/180),x=(O,A,Y)=>{const H=A.vertices.length-1;O.position.x=A.vertices[H].x,O.position.y=A.vertices[H].y;const T=Math.atan2(A.vertices[H].y-A.vertices[0].y,A.vertices[H].x-A.vertices[0].x);O.rotation=_(Y)+T},w=(O,A,Y)=>{if(A.vertices[0]===void 0)return;O.position.x=A.vertices[0].x,O.position.y=A.vertices[0].y;const H=A.vertices.length-1,T=Math.atan2(A.vertices[H].y-A.vertices[0].y,A.vertices[H].x-A.vertices[0].x);O.rotation=_(Y)+T},C=(O,A,Y)=>{const H=new Un;if(O.length===0)return H;const T=[];return[...O].reverse().forEach((D,K)=>{K!==0&&D.angle>0&&(D.angle*=-1),T.push(D)}),O=m(T,!0),w(H,A,O[0].angle),[A.vertices[0],A.vertices[1]].forEach(D=>{D.bind(te.Types.change,()=>{w(H,A,O[0].angle)})}),O.forEach(D=>{const K=D.start.x*Y,J=D.end.x*Y,U=D.start.y*Y,q=D.end.y*Y,L=new Qo(K,U,J,q);L.linewidth=Ke.line.size,L.stroke=Ke.line.color,H.add(L)}),H},N=(O,A,Y)=>{const H=new Un;return O.length===0||(O=m(O,!0),x(H,A,O[0].angle),[A.vertices[0],A.vertices[1]].forEach(T=>{T.bind(te.Types.change,()=>{x(H,A,O[0].angle)})}),O.forEach(T=>{const D=T.start.x*Y,K=T.end.x*Y,J=T.start.y*Y,U=T.end.y*Y,q=new Qo(D,J,K,U);q.linewidth=Ke.line.size,q.stroke=Ke.line.color,H.add(q)})),H},k=(O,A,Y,H)=>{const T=A.vertices[0].x+(A.vertices[1].x-A.vertices[0].x)/2-8*Math.sin(O.angle*Math.PI/180),D=A.vertices[0].y+(A.vertices[1].y-A.vertices[0].y)/2-8*Math.cos(O.angle*Math.PI/180),K=new gr(O.label,T+10,D-10);let J;K.size=Ke.lineLabel.size,K.weight=600,K.fill=Ke.lineLabel.color,K.id+=1,K.rotation=Ke.lineLabel.rotation,H>0&&(J=new gr(`${O.angle}°`,A.vertices[0].x+25,A.vertices[0].y-25),J.size=Ke.angleLabel.size,J.weight=600,J.fill=Ke.angleLabel.color,J.rotation=Ke.angleLabel.rotation,J.id+=H,s.push(J),Y.add(J)),Y.add(K),v(K,A,0,J),v(K,A,1)},$=()=>{const{size:O}=Ke.colorSideLabel,A=0,Y=0,H=f.value?O/2:O/2-O,T=f.value?O/2-O:O/2,D=new Un;if(!c)return D;const K=5,J=Math.atan2(T-H,Y-A),U=[new Ae(A,H,0,0,0,0,En.Commands.move),new Ae(Y,T,0,0,0,0,En.Commands.line),new Ae(Y-K*Math.cos(J-Math.PI/4),T-K*Math.sin(J-Math.PI/4),0,0,0,0,En.Commands.line),new Ae(Y,T,0,0,0,0,En.Commands.move),new Ae(Y-K*Math.cos(J+Math.PI/4),T-K*Math.sin(J+Math.PI/4),0,0,0,0,En.Commands.line)],q=new Oe(U,!1,!1,!0);q.noFill(),q.cap="round",q.join="round",q.linewidth=O/7,q.stroke=Ke.colorSideLabel.color,D.add(q);const L=new gr(f.value?"Цвет снизу":"Цвет сверху",10,0);L.size=O,L.weight=600,L.fill=Ke.colorSideLabel.color,L.alignment="left",D.add(L);const le=D.getBoundingClientRect();return D.position.x=(c.width-le.width)*d+10,D.position.y=f.value?c.height+le.height*2:le.height/2,D},v=(O,A,Y,H)=>{A.vertices[Y].bind(te.Types.change,()=>{const T=A.vertices.length-1,D=Math.atan2(A.vertices[0].y-A.vertices[T].y,A.vertices[0].x-A.vertices[T].x)*180/Math.PI,K=A.vertices[0].x+(A.vertices[T].x-A.vertices[0].x)/2-8*Math.sin(D*Math.PI/180),J=A.vertices[0].y+(A.vertices[T].y-A.vertices[0].y)/2-8*Math.cos(D*Math.PI/180);O.position.x=K+10,O.position.y=J-10,O.rotation=-.5,H&&(H.position.x=A.vertices[0].x+25,H.position.y=A.vertices[0].y-25)})},E=(O,A,Y,H,T=!1)=>{var fe;if(O.clear(),Y.length===0){O.update();return}const D=m(Y),[K,J,U]=g(O,A,D,H,T),q=new Un,L=new Array,le=new Array;T||(s=[],a=[]),D.forEach((ge,_e)=>{const Qe=ge.start.x*K+J,Re=ge.end.x*K+J,Mt=ge.start.y*K+U,vn=ge.end.y*K+U,It=new Qo(Qe,Mt,Re,vn);It.linewidth=T?Ke.previewLine.size:Ke.line.size,It.stroke=T?Ke.previewLine.color:Ke.line.color,a.push(It),L.push(It),q.add(It),!T&&ge.label!==""&&k(ge,It,q,_e)});const ue=L.at(-1);let oe=q.getBoundingClientRect();if(!T){const ge=$();le.push(ge)}if(A.length>0){const ge=C(A,L[0],K);q.add(ge)}if(H.length>0&&ue){const ge=N(H,ue,K);q.add(ge)}if(le.push(q),O.makeGroup(le),oe=q.getBoundingClientRect(),q.position.x=0-oe.left+(O.width-oe.width)/(2*(T?1:d)),q.position.y=0-oe.top+(O.height-oe.height)/(2*(T?1:d)),O.update(),!T){const ge=((fe=i.value.configuratorParams)==null?void 0:fe.colorSide)==="top";q.position.y=q.position.y+Ke.colorSideLabel.size*Number(ge),y(L,q),O.update()}},P=(O,A)=>{if(O&&!A.isNewRec()){const Y=new En({width:O.scrollWidth,height:O.scrollHeight});Y.appendTo(O),E(Y,[],A.points,[],!0)}},F=()=>{c&&E(c,h.value,u.value,p.value,!1)},R=O=>O*(180/Math.PI),M=(O,A)=>{const Y=O[1].x-O[0].x,H=O[1].y-O[0].y,T=A[1].x-A[0].x,D=A[1].y-A[0].y;let K=Math.atan2(Y*D-H*T,Y*T+H*D);return K=R(K),Math.round(K)*-1},X=O=>{const A=a.map((Y,H,T)=>{const D=T[H-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let K=Ve.multiplyByStep(Math.ceil(Ve.divideByStep(Y._length/O,i.settings.lineWidthStep)),i.settings.lineWidthStep);const J=s[H-1];K<(T.length>1?i.settings.minLineWidth:i.settings.stripMinWidth)&&(K=T.length>1?i.settings.minLineWidth:i.settings.stripMinWidth),K>i.settings.maxLineWidth&&(K=i.settings.maxLineWidth);const U=M(Y.vertices,D.vertices);return J&&(J.value=`${U}°`),new Vn(K,U,`A-${H+1}`)});r("pointer:move",A)},G=O=>{let A=null,Y;const H=J=>{A=l.find(U=>{const q=U.renderer;return(q==null?void 0:q.elem)===J.target}),[Y]=g(O,h.value,u.value.map(U=>U),p.value)},T=J=>{if(A){const U=A.renderer,q=U==null?void 0:U.elem;if(!q)return;const L=q.getBoundingClientRect();A.vertices[0].x-=L.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+Ke.anchorPoint.size/2,A.vertices[0].y-=L.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+Ke.anchorPoint.size/2,X(Y),O.update()}},D=()=>{A&&r("pointer:up",u.value),A=null},K=o.value;K&&(K.addEventListener("touchstart",H,{passive:!0}),K.addEventListener("touchend",D,{passive:!0}),K.addEventListener("mousedown",H),K.addEventListener("mouseup",D),K.addEventListener("mousemove",T),K.addEventListener("touchmove",T,{passive:!0}))},Z=(O,A)=>{r("remove-custom-template",O,A)};return t.onMounted(()=>{o.value&&(c=new En({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),t.watch(()=>i.value,()=>{F()},{deep:!0,immediate:!0}),G(c))}),t.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(O,A)=>(t.openBlock(),t.createElementBlock("div",eb,[t.createVNode(Pu,{"select-template-index":n.selectTemplateIndex,settings:n.settings,"onTemplate:select":A[0]||(A[0]=Y=>r("template:select",Y)),onInitDrawTemplate:P,onRemoveCustomTemplate:Z},null,8,["select-template-index","settings"]),t.createElementVNode("div",tb,[t.createElementVNode("div",nb,null,512)])]))}});class yr extends W.Identity{constructor(i,r){super();B(this,"label","");B(this,"points",[]);B(this,"isCustom",!1);B(this,"id",-1);B(this,"guid","");i?(this.label=i.label,this.points=i.points.map((o,s)=>V.isArray(o)?new Vn(o[0],o[1],`A-${s+1}`):new Vn(o.width,o.angle,`A-${s+1}`)),this.isCustom=i.isCustom):(this.label="-- Новая конфигурация --",this.points=[new Vn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Ma extends yr{constructor(i){super(i);B(this,"isDefault");this.isDefault=i.isDefault??!1}}class Vu{constructor(e){B(this,"minLineWidth");B(this,"maxLineWidth");B(this,"lineWidthStep");B(this,"minLineAngle");B(this,"maxLineAngle");B(this,"lineAngleStep");B(this,"stripMinWidth");B(this,"stripMaxWidth");B(this,"stripMinLength");B(this,"stripMaxLength");B(this,"allowShowTable");B(this,"showOnlyTemplates");B(this,"templates");B(this,"customTemplates",[]);B(this,"startTailConfigs");B(this,"endTailConfigs");B(this,"bendCountForExtended");B(this,"extendedProductCatalog");B(this,"allowChangeFirstPoint");B(this,"allowSaveTemplates");B(this,"userTemplatesPrefix");B(this,"lengthStep");B(this,"canSetDopProdaga");var i,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 yr(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((i=e.startTailConfigs)==null?void 0:i.map(o=>new Ma(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new Ma(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 yr(s);return a.isCustom=!0,a.id=+o,a}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new yr({label:"-- Новая конфигурация --",points:[new Vn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const i=this.customTemplates.findLast(o=>!o.isNewRec()),r=new yr(e);r.isCustom=!0,r.id=i?i.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const i=this.customTemplates.findIndex(r=>r.id===e);i!==-1&&this.customTemplates.splice(i,1)}}const rb={class:"flex flex-col gap-3"},ob={class:"grid gap-5 md:grid-cols-5"},sb={},Mu=t.defineComponent({...sb,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.ref(!1),s=t.ref(!1),a=t.ref(!1),l=t.ref(i.cartItem),c=t.ref(new Vu(i.settings)),d=t.ref({linesWidths:[...i.cartItem.configuratorParams.linesWidths],linesAngles:[...i.cartItem.configuratorParams.linesAngles]}),u=t.ref({quantity:{},marker:{},length:{}}),f=t.ref(0),h=t.useTemplateRef("kozyrek-configurator-params-form"),p=(v=0)=>{var P;const E=(P=c.value.allTemplates)==null?void 0:P.at(v);E!==void 0&&(f.value=v,l.value.configuratorParams.linesWidths=E.points.map(F=>V.isArray(F)?F[0]:F.width),l.value.configuratorParams.linesAngles=E.points.map(F=>V.isArray(F)?F[1]:F.angle),x()),y(l.value.configuratorParams)},m=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const E={label:v,points:l.value.configuratorParams.linesWidths.map((F,R)=>[F,l.value.configuratorParams.linesAngles[R]])},P=F=>{F&&(c.value.addCustomTemplate(E),f.value=c.value.allTemplates.length-2),a.value=!1};i.eventEmitter.emit("configurator:create-template",{category:i.cartItem.category,template:E,callback:P})},g=async(v,E)=>{var R;const P=(R=c.value.allTemplates)==null?void 0:R.at(v);if(!P||!P.isCustom)return;const F=M=>{M&&(c.value.removeCustomTemplate(P.id),p()),E==null||E()};i.eventEmitter.emit("configurator:remove-template",{category:i.cartItem.category,templateId:P.id,callback:F})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},y=async v=>{var E,P;l.value.product=new W.ClientProduct,(P=(E=h.value)==null?void 0:E.formReference)==null||P.validate(F=>{F||(x(),o.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.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(V.noop)},_=async()=>{var v,E;(E=(v=h.value)==null?void 0:v.formReference)==null||E.validate(P=>{var F,R;if(!P){s.value=!0;const M=new W.OrderItemBase(l.value);(F=c.value.startTailConfigs)!=null&&F.length||delete M.configuratorParams.startTailType,(R=c.value.endTailConfigs)!=null&&R.length||delete M.configuratorParams.endTailType,r("submit",M,u.value,()=>{s.value=!1,t.nextTick(()=>{var X,G;(G=(X=h.value)==null?void 0:X.formReference)==null||G.restoreValidation()})})}}).catch(V.noop)},x=()=>{const v={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach((E,P)=>{v[`lines_widths[${P+1}]`]={},v[`lines_angles[${P+1}]`]={}}),u.value=v},w=v=>{d.value.linesWidths=v.map(E=>E.width),d.value.linesAngles=v.map(E=>E.angle)},C=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,x(),b(),y(l.value.configuratorParams)},N=(v,E)=>{d.value.linesWidths=v,d.value.linesAngles=E},k=v=>{const E=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,P=0;l.value.configuratorParams.linesWidths.splice(v+1,0,E),l.value.configuratorParams.linesAngles.splice(v+1,0,P),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],x(),b(),y(l.value.configuratorParams)},$=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],x(),b(),y(l.value.configuratorParams))};return t.onMounted(()=>{i.cartItem.isNewRec()?p():(x(),f.value=-1,y(l.value.configuratorParams))}),t.watch(()=>i.cartItem,v=>{l.value=new W.OrderItemBase(v),v.isNewRec()?p():(x(),f.value=-1,y(l.value.configuratorParams))}),(v,E)=>{const P=I.NButton;return t.openBlock(),t.createElementBlock("div",rb,[n.settings.allowShowTable?(t.openBlock(),t.createBlock(P,{key:0,type:"tertiary",class:"self-end",onClick:E[0]||(E[0]=F=>r("click:view-switch"))},{default:t.withCtx(()=>[...E[3]||(E[3]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",ob,[t.createVNode(Fu,{value:l.value,"select-template-index":f.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":C,"onPointer:move":w,"onTemplate:select":p,onRemoveCustomTemplate:g},null,8,["value","select-template-index","settings"]),t.createVNode(hc,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":E[1]||(E[1]=F=>l.value=F),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":s.value,"is-product-searching":o.value,"select-template-index":f.value,class:"col-span-2","onUpdate:params":E[2]||(E[2]=F=>y(F)),"onUpdate:preview":N,onSubmit:_,"onClick:saveTemplate":m,"onClick:addLine":k,"onClick:removeLine":$},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),ab={class:"flex flex-col items-center justify-between rounded-xl"},lb={class:"img-preview relative flex justify-center"},cb={},db=t.defineComponent({...cb,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(n,{emit:e}){const i=n,r=t.computed(()=>{const{height:s}=i.configuratorParams;return V.keys(i.settings.crossbarCount).reverse().find(a=>s>=i.settings.crossbarCount[Number(a)])}),o=e;return(s,a)=>{const l=I.NButton;return t.openBlock(),t.createElementBlock("div",ab,[t.createElementVNode("div",lb,[a[1]||(a[1]=t.createElementVNode("div",{class:"window"},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(["net",`net-${n.configuratorParams.netType}`])},null,2),t.createElementVNode("div",{class:t.normalizeClass(["frame",`frame-${n.configuratorParams.color}`])},null,2),r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${n.configuratorParams.color}`])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["mount",`mount-${n.configuratorParams.mountType}-${n.configuratorParams.color}`])},null,2),t.createElementVNode("div",{class:t.normalizeClass(["cut-preview",`cut-preview-${n.configuratorParams.mountType}-${n.configuratorParams.color}`])},null,2)]),t.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>o("open-instructions"))},{default:t.withCtx(()=>[...a[2]||(a[2]=[t.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Ia=gn(db,[["__scopeId","data-v-2a790a20"]]),ub={key:0,class:"flex items-baseline gap-1"},fb={key:0,class:"flex items-baseline gap-1"},hb={key:1},mb={class:"text-lg font-semibold"},pb={key:2,class:"text-red-500 text-sm mb-2"},gb={class:"flex gap-3"},yb={},Iu=t.defineComponent({...yb,__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(n,{expose:e,emit:i}){var k;const r=n,o=i,s=t.computed(()=>Ue.isPhoneDevice()),a=t.useTemplateRef("form-reference"),l=t.useTemplateRef("width-form-item-reference"),c=t.useTemplateRef("height-form-item-reference"),d=t.useTemplateRef("width-input-reference"),u=t.ref(V.cloneDeep(r.value)),f=t.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),h=t.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),p=t.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),m=t.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),g=t.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+f.value:0),b=t.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+h.value:0),y=t.ref(r.settings.canSetDopProdaga??!1),_=t.computed(()=>({"configuratorParams.width":[ce.required,ce.min(r.settings.minWidth-f.value),ce.max(p.value-f.value),ce.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ce.required,ce.min(r.settings.minHeight-h.value),ce.max(m.value-h.value),ce.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[ce.required,ce.min(1),ce.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),x=t.computed(()=>{var R;const $=g.value,v=b.value,{quantity:E}=r.value,P=((R=r.value.product)==null?void 0:R.costRub)||0;if(!$||!v||!E||P===0)return null;const F=$*v/1e6;return Ve.formatMoney(P*E*F)}),w=t.computed(()=>{const $=g.value,v=b.value,E=!!($&&$>=r.settings.minWidth&&$<=r.settings.maxWidths[u.value.configuratorParams.netType]),P=!!(v&&v>=r.settings.minHeight&&v<=r.settings.maxHeights[u.value.configuratorParams.netType]),F=!!(r.value.quantity&&r.value.quantity>0);return E&&P&&F}),C=($,v)=>{var F,R;const E=u.value.configuratorParams;$&&$ in E&&(E[$]=v);const P={...E,width:g.value??0,height:b.value??0};$==="width"&&((F=l.value)==null||F.validate().catch(V.noop)),$==="height"&&((R=c.value)==null||R.validate().catch(V.noop)),t.nextTick(()=>{var X,G;!((X=l.value)!=null&&X.validationErrored)&&!((G=c.value)!=null&&G.validationErrored)&&P.height&&P.width&&o("update:params",P),N("configuratorParams",P)})},N=($,v)=>{const E=new W.OrderItemBase(r.value);E[$]=v,$==="configuratorParams"&&(E.product=new W.ClientProduct),o("update:value",E)};return t.watch(()=>r.value,$=>{const v=V.cloneDeep(t.toRaw($)),E=v.configuratorParams.mountType,P=r.settings.widthOverlaps[E]??0,F=r.settings.heightOverlaps[E]??0;v.configuratorParams.width&&v.configuratorParams.width>0&&(v.configuratorParams.width-=P),v.configuratorParams.height&&v.configuratorParams.height>0&&(v.configuratorParams.height-=F),u.value=v},{deep:!0,immediate:!0}),t.onMounted(()=>{var $;($=d.value)==null||$.select()}),e({validate:(k=a.value)==null?void 0:k.validate,formReference:a}),($,v)=>{const E=I.NCheckbox;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.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:t.withCtx(()=>[t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[v[0]||(v[0]=P=>u.value.configuratorParams.netType=P),v[1]||(v[1]=P=>C("netType",P))],options:n.settings.netType.map(P=>({label:n.settings.descriptions.net_type[P],value:P}))},null,8,["value","options"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[v[2]||(v[2]=P=>u.value.configuratorParams.color=P),v[3]||(v[3]=P=>C("color",P))],options:n.settings.color.map(P=>({label:n.settings.descriptions.color[P],value:P}))},null,8,["value","options"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[v[4]||(v[4]=P=>u.value.configuratorParams.mountType=P),v[5]||(v[5]=P=>C("mountType",P))],options:n.settings.mountType.map(P=>({label:n.settings.descriptions.mount_type[P],value:P}))},null,8,["value","options"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${n.settings.minWidth-f.value} ${p.value?" до "+(p.value-f.value):""} мм.`},{feedback:t.withCtx(()=>[!n.validation.width.showFeedback&&g.value>=n.settings.minWidth&&g.value<=n.settings.maxWidths[u.value.configuratorParams.netType]?(t.openBlock(),t.createElementBlock("div",ub,[t.createVNode(t.unref(I.NText),{type:"success"},{default:t.withCtx(()=>[t.createTextVNode("Ширина готового изделия "+t.toDisplayString(g.value),1)]),_:1}),t.createVNode(t.unref(I.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[10]||(v[10]=P=>o("click:instructions-toggle"))},{default:t.withCtx(()=>[...v[25]||(v[25]=[t.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):t.createCommentVNode("",!0)]),default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[v[6]||(v[6]=P=>u.value.configuratorParams.width=P),v[9]||(v[9]=P=>C("width",P))],parse:t.unref(ht),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[7]||(v[7]=P=>t.unref(ft)(P)),onInput:v[8]||(v[8]=P=>t.unref(dt)(n.validation,"width")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${n.settings.minHeight-h.value} ${m.value?" до "+(m.value-h.value):""} мм.`},{feedback:t.withCtx(()=>[!n.validation.height.showFeedback&&b.value>=n.settings.minHeight&&b.value<=n.settings.maxHeights[u.value.configuratorParams.netType]?(t.openBlock(),t.createElementBlock("div",fb,[t.createVNode(t.unref(I.NText),{type:"success"},{default:t.withCtx(()=>[t.createTextVNode("Высота готового изделия "+t.toDisplayString(b.value),1)]),_:1}),t.createVNode(t.unref(I.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[15]||(v[15]=P=>o("click:instructions-toggle"))},{default:t.withCtx(()=>[...v[26]||(v[26]=[t.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):t.createCommentVNode("",!0)]),default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[v[11]||(v[11]=P=>u.value.configuratorParams.height=P),v[14]||(v[14]=P=>C("height",P))],parse:t.unref(ht),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[12]||(v[12]=P=>t.unref(ft)(P)),onInput:v[13]||(v[13]=P=>t.unref(dt)(n.validation,"height")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{path:"quantity",label:"Количество"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[16]||(v[16]=P=>u.value.quantity=P),v[19]||(v[19]=P=>N("quantity",P??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[17]||(v[17]=P=>t.unref(ft)(P,!1)),onInput:v[18]||(v[18]=P=>t.unref(dt)(n.validation,"quantity")),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{path:"marker",label:"Маркировка"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[20]||(v[20]=P=>t.unref(dt)(n.validation,"marker")),"onUpdate:value":v[21]||(v[21]=P=>{u.value.marker=P??null,N("marker",P??null)}),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),y.value?(t.openBlock(),t.createBlock(E,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":v[22]||(v[22]=P=>{u.value.isAdditionalSale=P??!1,N("isAdditionalSale",P??!1)})},{default:t.withCtx(()=>[...v[27]||(v[27]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),t.createVNode(Fr,{"is-product-searching":n.isProductSearching,product:u.value.product,validation:n.validation.product},null,8,["is-product-searching","product","validation"]),x.value?(t.openBlock(),t.createElementBlock("div",hb,[v[28]||(v[28]=t.createTextVNode(" ИТОГО: ",-1)),t.createElementVNode("span",mb,t.toDisplayString(x.value)+" ₽",1)])):t.createCommentVNode("",!0),w.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",pb," Пожалуйста, заполните все обязательные поля корректно. ")),t.createElementVNode("div",gb,[t.createVNode(t.unref(I.NButton),{loading:n.isSubmitProcessing,disabled:!w.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:v[23]||(v[23]=P=>o("submit",n.value))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:0,type:"default",onClick:v[24]||(v[24]=P=>o("click:show-preview-drawer"))},{default:t.withCtx(()=>[...v[29]||(v[29]=[t.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):t.createCommentVNode("",!0)])]),_:1},8,["model","rules"])),[[t.unref(ai),()=>o("submit",u.value)]])}}}),bb="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",_b="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",wb="/img/configurators/mosquitto/measurement-instructions/mount.png",xb="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",kb="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Cb={class:"flex flex-col gap-6"},vb={class:"flex gap-4"},Sb={class:"flex flex-col gap-2"},Bb={class:"flex gap-4"},Nb={class:"flex flex-col gap-2"},Tb={class:"flex gap-4"},$b={class:"flex flex-col gap-2"},Eb={},Au=t.defineComponent({...Eb,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(n,{emit:e}){const i=Ue.initRefDependingOnDeviceResolution("small","small","medium"),r=Ue.initRefDependingOnDeviceResolution(.98,.95,.8),o=t.computed(()=>window.innerWidth*r.value),s=e;return(a,l)=>{const c=I.NText;return t.openBlock(),t.createBlock(t.unref(I.NModal),{show:n.show,"show-icon":!1,size:t.unref(i),style:t.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:t.withCtx(()=>[t.createElementVNode("div",Cb,[t.createVNode(c,{type:"error",class:"text-base font-medium"},{default:t.withCtx(()=>[...l[3]||(l[3]=[t.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=t.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[t.createElementVNode("div",{class:"flex items-start gap-4"},[t.createElementVNode("img",{src:bb,alt:"measurement-height",class:"w-[7.5rem]"}),t.createElementVNode("div",{class:"flex flex-col gap-2"},[t.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),t.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),t.createElementVNode("div",{class:"flex items-start gap-4"},[t.createElementVNode("img",{src:_b,alt:"measurement-height",class:"w-[7.5rem]"}),t.createElementVNode("div",{class:"flex flex-col gap-2"},[t.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),t.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),t.createElementVNode("div",vb,[l[9]||(l[9]=t.createElementVNode("img",{src:wb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),t.createElementVNode("div",Sb,[l[8]||(l[8]=t.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),t.createElementVNode("span",null,[l[4]||(l[4]=t.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Ширина светового проема +"+t.toDisplayString(n.widthOverlaps.frame)+" мм. Высота светового проема +"+t.toDisplayString(n.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=t.createElementVNode("br",null,null,-1)),l[7]||(l[7]=t.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),t.createElementVNode("div",Bb,[l[15]||(l[15]=t.createElementVNode("img",{src:xb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),t.createElementVNode("div",Nb,[l[14]||(l[14]=t.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),t.createElementVNode("span",null,[l[10]||(l[10]=t.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Ширина светового проема +"+t.toDisplayString(n.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+t.toDisplayString(n.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=t.createElementVNode("br",null,null,-1)),l[13]||(l[13]=t.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),t.createElementVNode("div",Tb,[l[21]||(l[21]=t.createElementVNode("img",{src:kb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),t.createElementVNode("div",$b,[l[20]||(l[20]=t.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),t.createElementVNode("span",null,[l[16]||(l[16]=t.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Ширина светового проема +"+t.toDisplayString(n.widthOverlaps.external_metal)+" мм. Высота светового проема +"+t.toDisplayString(n.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=t.createElementVNode("br",null,null,-1)),l[19]||(l[19]=t.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Rb={class:"grid md:grid-cols-2"},Pb={},Ou=t.defineComponent({...Pb,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.computed(()=>Ue.isPhoneDevice()),s=t.ref(!1),a=t.ref(!1),l=t.ref(i.cartItem),c=t.useTemplateRef("mosquito-configurator-form"),d=t.ref({width:{},height:{},quantity:{},marker:{}}),u=t.ref(!1),f=t.ref(!1),h=t.computed(()=>t.inject("debounce-input-time",300)),p=V.debounce(async g=>{var b,y;l.value.product=new W.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:g,validationFieldResultData:d.value,callback:x=>{x?l.value.product=x:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(V.noop)},h.value),m=()=>{f.value=!0,r("submit",l.value,d.value,()=>{f.value=!1})};return t.watch(()=>i.cartItem,g=>{l.value=g},{deep:!0}),(g,b)=>{const y=Jo;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Au,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":n.settings.heightOverlaps,"width-overlaps":n.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),t.createElementVNode("div",Rb,[o.value?(t.openBlock(),t.createBlock(t.unref(I.NDrawer),{key:1,show:s.value,"onUpdate:show":b[4]||(b[4]=_=>s.value=_),"default-width":375,resizable:""},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NDrawerContent),null,{header:t.withCtx(()=>[t.createVNode(t.unref(I.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:b[2]||(b[2]=_=>s.value=!1)},{default:t.withCtx(()=>[t.createVNode(y)]),_:1})]),default:t.withCtx(()=>[t.createVNode(Ia,{"configurator-params":l.value.configuratorParams,settings:n.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(t.openBlock(),t.createBlock(Ia,{key:0,"configurator-params":l.value.configuratorParams,settings:n.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),t.createVNode(Iu,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:n.settings,"is-product-searching":u.value,"is-submit-processing":f.value,"onUpdate:params":b[6]||(b[6]=_=>t.unref(p)(_)),onSubmit:b[7]||(b[7]=_=>m()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),Fb={},zu=t.defineComponent({...Fb,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.useTemplateRef("width-input-element"),a=t.ref(!1),l=t.ref(r.value),c=t.useTemplateRef("form-item-reference"),d=t.computed(()=>{var p;return!((p=c.value)!=null&&p.validationErrored)}),u=p=>{l.value=p,o("update:value",p,r.index,a)},f=p=>{ft(p),(p.key==="Enter"||p.code==="Enter")&&!r.isLastLine&&(p.preventDefault(),p.stopPropagation())},h=()=>{var p;(p=s.value)==null||p.select()};return t.watch(()=>r.value,p=>{l.value=p}),t.onMounted(()=>{r.autoFocus&&t.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(p,m)=>{const g=fc,b=yo;return t.openBlock(),t.createBlock(t.unref(I.NFormItem),{ref:"form-item-reference",path:n.path,label:`Полоса №${n.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:t.withCtx(()=>[d.value?(t.openBlock(),t.createBlock(Fr,{key:0,"is-product-searching":a.value,product:n.product,validation:n.validation.product},null,8,["is-product-searching","product","validation"])):t.createCommentVNode("",!0)]),default:t.withCtx(()=>[t.createVNode(t.unref(I.NDropdown),{trigger:"click",options:n.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:t.unref(ht),placeholder:"Введите ширину",onKeydown:f,onInput:m[0]||(m[0]=y=>t.unref(dt)(n.validation,`linesWidths.${n.index}`)),onFocus:t.unref(He),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),t.createVNode(t.unref(I.NButton),{disabled:n.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:m[1]||(m[1]=y=>o("click:add-line",n.index))},{default:t.withCtx(()=>[t.createVNode(g)]),_:1},8,["disabled"]),t.createVNode(t.unref(I.NButton),{disabled:n.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:m[2]||(m[2]=y=>o("click:remove-line",n.index))},{default:t.withCtx(()=>[t.createVNode(b)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),Vb={class:"my-2 flex w-full flex-col"},Mb={key:1},Ib={class:"text-lg font-semibold"},Ab={class:"flex gap-3"},Ob={},Du=t.defineComponent({...Ob,__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(n,{expose:e,emit:i}){var _;const r=n,o=i,s=t.useTemplateRef("form-reference"),a=t.useTemplateRef("line-items-reference"),l=t.ref(V.cloneDeep(r.value)),c=t.computed(()=>{const x={length:[ce.required,ce.min(r.settings.minLength),ce.max(r.settings.maxLength),ce.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[ce.required,ce.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return V.forEach(l.value,(w,C)=>{var N;x[`configuratorParams.linesWidths.${C}`]=[ce.required,ce.min(r.settings.minLineWidth),ce.step(r.settings.lineWidthStep),We.serverValidation((N=r.validation[`linesWidths.${C}`])==null?void 0:N.feedback)]}),x}),d=t.ref(r.settings.canSetDopProdaga??!1),u=t.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((x,w)=>(x??0)+(w??0),0)),f=t.computed(()=>r.settings.width-u.value),h=t.computed(()=>!r.value.some(({product:x})=>!x||x.isNewRec())),p=t.computed(()=>r.isSubmitProcessing||!h.value||f.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(x=>x.product.isNewRec())),m=t.computed(()=>x=>f.value===0?void 0:[{label:`${(f.value>0?"Остаток +":"Излишек ")+f.value} мм.`,key:f.value+x}]),g=t.computed(()=>{const{length:x}=r.value[0];if(!x||u.value!==r.settings.width)return null;const w=V.reduce(r.value,(C,N)=>{var $;const k=(($=N.product)==null?void 0:$.costRub)||0;return C+k},0);return Ve.formatMoney(w*r.value[0].quantity*x)}),b=(x,w,C)=>{var k,$,v;l.value[w].product.id=-1;const{configuratorParams:N}=l.value[w];N.linesWidths[w]=x,y("configuratorParams",N),(v=($=(k=a.value)==null?void 0:k.at(w))==null?void 0:$.formItemReference)==null||v.validate().catch(V.noop),t.nextTick(()=>{var E,P;(P=(E=a.value)==null?void 0:E.at(w))!=null&&P.isValid&&o("update:params",N,w,C)})},y=(x,w)=>{l.value.forEach(C=>{C[x]=w}),o("update:value",l.value)};return t.watch(()=>r.value,x=>{l.value=V.cloneDeep(x)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(x,w)=>{const C=I.NCheckbox;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>{var N;return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(k,$)=>{var v,E,P;return t.openBlock(),t.createBlock(zu,{key:$,ref_for:!0,ref:"line-items-reference",value:((v=k.configuratorParams)==null?void 0:v.linesWidths.at($))??null,"auto-focus":(((E=k.configuratorParams)==null?void 0:E.linesWidths.at($))??0)===0,index:$,path:`configuratorParams.linesWidths.${$}`,product:k.product,settings:n.settings,validation:n.validation,"suggestion-option":m.value(((P=k.configuratorParams)==null?void 0:P.linesWidths.at($))??0),"add-line-button-disabled":f.value<=0||n.value.length>=n.settings.maxLinesCount||n.value.some(F=>F.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"is-last-line":$===l.value.length-1&&f.value===0,"onUpdate:value":b,"onClick:addLine":w[0]||(w[0]=F=>o("click:add-line",F)),"onClick:removeLine":w[1]||(w[1]=F=>o("click:remove-line",F))},null,8,["value","auto-focus","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled","is-last-line"])}),128)),t.createElementVNode("div",Vb,[f.value<0?(t.openBlock(),t.createBlock(t.unref(I.NText),{key:0,type:"error"},{default:t.withCtx(()=>[t.createTextVNode(" Сумма ширин всех полос должна быть равна "+t.toDisplayString(n.settings.width),1)]),_:1})):t.createCommentVNode("",!0),h.value&&l.value.length===n.settings.maxLinesCount&&f.value>0?(t.openBlock(),t.createBlock(t.unref(I.NText),{key:1,type:"error"},{default:t.withCtx(()=>[...w[15]||(w[15]=[t.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",null,[w[16]||(w[16]=t.createTextVNode(" Остаток для резки: ",-1)),t.createVNode(t.unref(I.NText),{type:f.value>=0?"Success":"error"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(f.value),1)]),_:1},8,["type"]),t.createTextVNode(" из "+t.toDisplayString(n.settings.width)+" мм ",1)])]),t.createVNode(t.unref(I.NButton),{disabled:p.value,type:"primary",class:"self-center",onClick:w[2]||(w[2]=k=>o("click:add-line",l.value.length))},{default:t.withCtx(()=>[...w[17]||(w[17]=[t.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),t.createVNode(t.unref(I.NFormItem),{path:"length",label:`Метраж ${n.settings.minLength?" от "+n.settings.minLength:""} ${n.settings.maxLength?" до "+n.settings.maxLength:""} м.`},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:l.value[0].length,"onUpdate:value":[w[3]||(w[3]=k=>l.value[0].length=k),w[6]||(w[6]=k=>y("length",k))],parse:t.unref(ht),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:w[4]||(w[4]=k=>t.unref(ft)(k,!1)),onInput:w[5]||(w[5]=k=>t.unref(dt)(n.validation,"length")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{path:"quantity",label:"Количество"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[w[7]||(w[7]=k=>l.value[0].quantity=k),w[10]||(w[10]=k=>y("quantity",k))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:w[8]||(w[8]=k=>t.unref(ft)(k,!1)),onInput:w[9]||(w[9]=k=>t.unref(dt)(n.validation,"quantity")),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{path:"marker",label:"Маркировка"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:w[11]||(w[11]=k=>t.unref(dt)(n.validation,"marker")),"onUpdate:value":w[12]||(w[12]=k=>{l.value[0].marker=k??null,y("marker",k??null)}),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(t.openBlock(),t.createBlock(C,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":w[13]||(w[13]=k=>{l.value[0].isAdditionalSale=k??!1,y("isAdditionalSale",k??!1)})},{default:t.withCtx(()=>[...w[18]||(w[18]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),g.value?(t.openBlock(),t.createElementBlock("div",Mb,[w[19]||(w[19]=t.createTextVNode(" ИТОГО: ",-1)),t.createElementVNode("span",Ib,t.toDisplayString(g.value)+" ₽",1)])):t.createCommentVNode("",!0),t.createElementVNode("div",Ab,[t.createVNode(t.unref(I.NButton),{loading:n.isSubmitProcessing,disabled:!h.value||f.value!=0||!((N=l.value[0])!=null&&N.length)||l.value[0].length>n.settings.maxLength||l.value[0].length<n.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:w[14]||(w[14]=k=>o("submit",l.value))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[t.unref(ai),()=>o("submit",l.value)]])}}}),zb={class:"flex grow flex-col"},Db=["src"],Lb={class:"w-full"},Hb={},Lu=t.defineComponent({...Hb,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",zb,[t.createElementVNode("img",{src:"/img/configurators/strip/strip-"+n.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,Db),t.createElementVNode("div",Lb,[t.createTextVNode(" Число полос можно указать от "+t.toDisplayString(n.settings.minLinesCount)+" до "+t.toDisplayString(n.settings.maxLinesCount)+". ",1),i[0]||(i[0]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Минимальная ширина полосы "+t.toDisplayString(n.settings.minLineWidth)+" мм. ",1),i[1]||(i[1]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Ширина всех полос "+t.toDisplayString(n.settings.width)+" мм. ",1),i[2]||(i[2]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Шаг ширины полосы - "+t.toDisplayString(n.settings.lineWidthStep)+" мм. ",1)])]))}}),Wb={class:"flex flex-col gap-2"},jb={class:"flex grow flex-col px-5 md:w-104"},qb={},Hu=t.defineComponent({...qb,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("strip-configurator-form"),s=t.ref(i.cartItems),a=t.ref({width:{},length:{},quantity:{},marker:{}}),l=t.ref(!1),c=t.computed(()=>t.inject("debounce-input-time",300)),d=t.computed(()=>{var m;return(m=s.value[0].configuratorParams)==null?void 0:m.linesWidths.reduce((g,b)=>(g??0)+(b??0),0)}),u=m=>{m===void 0&&(m=s.value.length-1);const g=s.value.at(0);if(!g)return;g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(m+1,0,null),s.value.forEach(y=>{y.configuratorParams.linesWidths=g.configuratorParams.linesWidths});const b=new W.OrderItemBase({quantity:(g==null?void 0:g.quantity)??1,category:g==null?void 0:g.category,length:(g==null?void 0:g.length)??i.settings.minLength,marker:g==null?void 0:g.marker,configuratorParams:{linesWidths:g==null?void 0:g.configuratorParams.linesWidths}});s.value=s.value.toSpliced(m+1,0,b)},f=m=>{const g=s.value.at(0);g&&(g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(m,1),s.value.forEach(b=>{b.configuratorParams.linesWidths=g.configuratorParams.linesWidths}),s.value=s.value.toSpliced(m,1),delete a[`linesWidths.${m}`],delete a[`linesWidths.${m}`])},h=V.debounce(async(m,g,b)=>{const y={linesWidths:m.linesWidths.at(g)};b.value=!0,a.value[`linesWidths.${g}`]={},s.value[g].product=new W.ClientProduct,i.eventEmitter.emit("configurator:search-product",{category:s.value[g].category,params:y,validationFieldResultData:a.value,callback:_=>{_?(s.value[g].product=_,g===s.value.length-1&&s.value.length<i.settings.maxLinesCount&&d.value&&d.value<i.settings.width&&u()):(s.value[g].product=new W.ClientProduct,a.value[`linesWidths.${g}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),p=async()=>{var m,g;(g=(m=o.value)==null?void 0:m.formReference)==null||g.validate(b=>{if(!b){l.value=!0;const y=s.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,t.nextTick(()=>{var _,x;(x=(_=o.value)==null?void 0:_.formReference)==null||x.restoreValidation()})})}}).catch(V.noop)};return t.watch(()=>i.cartItems,m=>{s.value=m.map(g=>new W.OrderItemBase(g))}),(m,g)=>{const b=I.NButton;return t.openBlock(),t.createElementBlock("div",Wb,[n.settings.allowShowTable?(t.openBlock(),t.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=y=>r("click:view-switch"))},{default:t.withCtx(()=>[...g[3]||(g[3]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",jb,[t.createVNode(Lu,{value:s.value,"onUpdate:value":g[1]||(g[1]=y=>s.value=y),settings:n.settings},null,8,["value","settings"]),t.createVNode(Du,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":g[2]||(g[2]=y=>s.value=y),validation:a.value,settings:n.settings,"is-submit-processing":l.value,"onUpdate:params":t.unref(h),onSubmit:p,"onClick:addLine":u,"onClick:removeLine":f},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Xb={class:"flex flex-col gap-3"},Yb={},Wu=t.defineComponent({...Yb,__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(n,{expose:e,emit:i}){var p;const r=n,o=i,s=t.useTemplateRef("form-reference"),a=t.useTemplateRef("first-input-element"),l=t.ref(V.cloneDeep(r.value)),c=t.computed(()=>({"configuratorParams.width":[ce.required,ce.min(r.settings.minWidth),...r.settings.maxWidth?[ce.max(r.settings.maxWidth)]:[],ce.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ce.required,ce.min(r.settings.minLength),ce.max(r.settings.maxLength),ce.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[ce.required,ce.min(1),ce.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),d=t.ref(r.settings.canSetDopProdaga??!1),u=()=>{o("update:params",l.value.configuratorParams),f("configuratorParams",l.value.configuratorParams)},f=(m,g)=>{const b=new W.OrderItemBase(r.value);b[m]=g,m==="configuratorParams"&&(b.product=new W.ClientProduct),o("update:value",b)},h=()=>{var m;(m=a.value)==null||m.select()};return t.watch(()=>r.value,m=>{l.value=V.cloneDeep(m)},{deep:!0}),t.onMounted(()=>{r.value.isNewRec()&&t.nextTick(()=>{h()})}),e({validate:(p=s.value)==null?void 0:p.validate,formReference:s}),(m,g)=>{const b=I.NCheckbox;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:n.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${n.settings.minWidth?" от "+n.settings.minWidth:""}${n.settings.maxWidth?" до "+n.settings.maxWidth:""} мм`},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[g[0]||(g[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:t.unref(ht),"show-button":!1,placeholder:"Введите ширину",onKeydown:g[1]||(g[1]=y=>t.unref(ft)(y)),onInput:g[2]||(g[2]=y=>t.unref(dt)(n.validation,"width")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{path:"configuratorParams.length",label:`Длина, ${n.settings.minLength?" от "+n.settings.minLength:""}${n.settings.maxLength?" до "+n.settings.maxLength:""} мм`},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[g[3]||(g[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:t.unref(ht),"show-button":!1,class:"w-full",onKeydown:g[4]||(g[4]=y=>t.unref(ft)(y)),onInput:g[5]||(g[5]=y=>t.unref(dt)(n.validation,"length")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{path:"quantity",label:"Количество"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:n.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:g[6]||(g[6]=y=>t.unref(ft)(y,!1)),onInput:g[7]||(g[7]=y=>t.unref(dt)(n.validation,"quantity")),"onUpdate:value":g[8]||(g[8]=y=>f("quantity",y??0)),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{path:"marker",label:"Маркировка"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:n.value.marker??null,placeholder:"Введите маркировку",onInput:g[9]||(g[9]=y=>t.unref(dt)(n.validation,"marker")),"onUpdate:value":g[10]||(g[10]=y=>f("marker",y??null)),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(t.openBlock(),t.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":g[11]||(g[11]=y=>{l.value.isAdditionalSale=y??!1,f("isAdditionalSale",y??!1)})},{default:t.withCtx(()=>[...g[13]||(g[13]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),t.createVNode(Fr,{"is-product-searching":n.isProductSearching,product:n.value.product,validation:n.validation.product},null,8,["is-product-searching","product","validation"]),t.createElementVNode("div",Xb,[t.createVNode(t.unref(I.NButton),{disabled:n.value.product.isNewRec()||n.isProductSearching||n.isSubmitProcessing||n.value.length===0||n.value.width===0||n.value.quantity===0,type:"primary",class:"self-start",onClick:g[12]||(g[12]=y=>o("submit",n.value))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])),[[t.unref(ai),()=>o("submit",l.value)]])}}}),Ub={class:"flex flex-col gap-2 w-72"},Kb={},ju=t.defineComponent({...Kb,__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]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("metal-for-doors-configurator-form"),s=t.ref(i.cartItem),a=t.ref({width:{},length:{},quantity:{},marker:{}}),l=t.ref(!1),c=t.ref(!1),d=t.computed(()=>t.inject("debounce-input-time",300)),u=V.debounce(async h=>{var p,m;s.value.product=new W.ClientProduct,(m=(p=o.value)==null?void 0:p.formReference)==null||m.validate(g=>{g||(l.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:h,validationFieldResultData:a.value,callback:b=>{b?s.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(V.noop)},d.value),f=async()=>{var h,p;(p=(h=o.value)==null?void 0:h.formReference)==null||p.validate(m=>{m||(c.value=!0,r("submit",s.value,a.value,()=>{c.value=!1,t.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})}))}).catch(V.noop)};return t.watch(()=>i.cartItem,h=>{s.value=new W.OrderItemBase(h)},{deep:!0}),(h,p)=>{const m=I.NButton;return t.openBlock(),t.createElementBlock("div",Ub,[n.settings.allowShowTable?(t.openBlock(),t.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=g=>r("click:view-switch"))},{default:t.withCtx(()=>[...p[4]||(p[4]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createVNode(Wu,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":p[1]||(p[1]=g=>s.value=g),validation:a.value,settings:n.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":p[2]||(p[2]=g=>t.unref(u)(g)),onSubmit:p[3]||(p[3]=g=>f())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Gb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zb(n,e){return t.openBlock(),t.createElementBlock("svg",Gb,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const qu=t.markRaw({name:"ion-add",render:Zb}),Qb={key:0,class:"-mt-1 text-sm text-gray-500"},Jb={class:"font-bold"},e_={class:"flex flex-col gap-3"},t_={key:0,class:"mt-4 flex flex-col gap-1.5"},n_={class:"flex flex-col gap-1 text-sm text-gray-700"},i_={key:0},r_={key:1},o_={"form-array-name":"items",class:"flex flex-col gap-3"},s_={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},a_={key:0,class:"flex flex-wrap items-end gap-2"},l_={class:"whitespace-nowrap text-xl font-bold"},c_={key:0,class:"whitespace-nowrap text-lg text-gray-500"},d_={class:"font-bold"},u_={class:"font-bold"},f_={class:"flex gap-3"},h_={},Xu=t.defineComponent({...h_,__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]},showProductInfoButton:{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(n,{expose:e,emit:i}){var Y;const r=n,o=i,s=t.useTemplateRef("form-reference"),a=t.ref(V.cloneDeep(r.value)),l=t.ref({...r.validation}),c=H=>{var T;delete l.value[H],(T=s.value)==null||T.restoreValidation()};t.watch(()=>r.validation,H=>{l.value={...H},Object.values(H).some(D=>D==null?void 0:D.feedback)&&t.nextTick(()=>{var D;return(D=s.value)==null?void 0:D.validate(V.noop).catch(V.noop)})},{deep:!0});const d=t.computed(()=>r.value.category),u=t.ref(null),f=t.ref(null),h=t.computed(()=>d.value.products??[]),p=t.computed(()=>h.value.map(H=>({label:H.name,value:H.id}))),m=(H,T,D)=>{const K=H!=null&&H>0,J=T!=null&&T>0;return!K&&!J?null:K&&J?`от ${H} ${D} до ${T} ${D}`:K?`от ${H} ${D}`:`до ${T} ${D}`},g=t.computed(()=>{var H,T;return m(r.settings.minWidth,(T=(H=u.value)==null?void 0:H.properties)==null?void 0:T.width,"мм")}),b=t.computed(()=>{var H,T;return m(r.settings.minLength,(T=(H=u.value)==null?void 0:H.properties)==null?void 0:T.length,"мм")}),y=t.ref(null),_=t.ref(!1),x=t.computed(()=>{var T;const H={marker:[We.serverValidation((T=l.value.marker)==null?void 0:T.feedback)]};return a.value.configuratorParams.items.forEach((D,K)=>{var J,U,q,L,le,ue,oe;H[`configuratorParams.items.${K}.width`]=[ce.required,ce.min(r.settings.minWidth),...(U=(J=u.value)==null?void 0:J.properties)!=null&&U.width?[ce.max(u.value.properties.width)]:[],ce.step(1),We.serverValidation((q=l.value[`items.${K}.width`])==null?void 0:q.feedback)],H[`configuratorParams.items.${K}.length`]=[ce.required,ce.min(r.settings.minLength),...(le=(L=u.value)==null?void 0:L.properties)!=null&&le.length?[ce.max(u.value.properties.length)]:[],ce.step(1),We.serverValidation((ue=l.value[`items.${K}.length`])==null?void 0:ue.feedback)],H[`configuratorParams.items.${K}.count`]=[ce.required,ce.min(1),ce.step(1),We.serverValidation((oe=l.value[`items.${K}.count`])==null?void 0:oe.feedback)]}),H}),w=t.ref(r.settings.canSetDopProdaga??!1),C=t.computed(()=>a.value.configuratorParams.items.some(H=>{var T,D;return!u.value||!H.width||H.width<r.settings.minWidth||H.width>(((T=u.value.properties)==null?void 0:T.width)??0)||H.length===0||H.length<r.settings.minLength||H.length>(((D=u.value.properties)==null?void 0:D.length)??0)||!H.count||H.count<1})),N=t.computed(()=>!u.value||C.value||a.value.configuratorParams.items.length===0),k=t.ref(null),$=t.computed(()=>k.value===null?"":Ve.formatMoney(k.value)),v=H=>{if(!H){u.value=null,f.value=null,a.value.product=new W.ClientProduct,y.value=null;return}const T=h.value.find(D=>D.id===H);T&&(u.value=T,f.value=H,a.value.product=T,O("product",a.value.product),a.value.configuratorParams.items.forEach(D=>{var K,J;(K=T.properties)!=null&&K.width&&D.width>T.properties.width&&(D.width=T.properties.width),(J=T.properties)!=null&&J.length&&D.length>T.properties.length&&(D.length=T.properties.length)}),P())};let E=!1;const P=()=>{E=!0,y.value=null,k.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},F=async()=>{var H;if(!u.value||a.value.configuratorParams.items.length===0||C.value){P();return}(H=s.value)==null||H.validate(T=>{if(T){P();return}if(_.value=!0,!u.value||!d.value){P(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:a.value.configuratorParams.items},callback:D=>{D?(y.value=D,a.value.configuratorParams.calculationId=D.id,a.value.quantity=D.quantity,t.nextTick(()=>{O("quantity",D.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,P()),O("configuratorParams",a.value.configuratorParams),R(),_.value=!1}})}).catch(()=>{P(),_.value=!1})},R=()=>{var T;if(!((T=u.value)!=null&&T.costRub)||!y.value){k.value=null;return}const H=y.value.quantity*u.value.costRub;k.value=Ve.roundMoney(H)},M=H=>{var D,K;const T=a.value.configuratorParams.items[H];u.value&&((D=u.value.properties)!=null&&D.width&&T.width>u.value.properties.width&&(T.width=u.value.properties.width),(K=u.value.properties)!=null&&K.length&&T.length>u.value.properties.length&&(T.length=u.value.properties.length)),O("configuratorParams",a.value.configuratorParams),P()},X=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),O("configuratorParams",a.value.configuratorParams),P(),o("add-item",a.value.configuratorParams.items.length)},G=H=>{a.value.configuratorParams.items.splice(H,1),O("configuratorParams",a.value.configuratorParams),P(),o("remove-item",H)},Z=()=>{if(!(N.value||_.value||r.isSubmitProcessing)){if(!y.value){F();return}o("submit",a.value)}},O=(H,T)=>{const D=new W.OrderItemBase(r.value);D[H]=T,o("update:value",D)};t.watch(()=>r.value,H=>{const T=V.cloneDeep(t.toRaw(H));(!T.configuratorParams.items||T.configuratorParams.items.length===0)&&(T.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=T,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,f.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,f.value=null),E?E=!1:A()},{deep:!0});const A=()=>{const{calculationId:H}=a.value.configuratorParams,T=a.value.quantity??0;H&&T>0&&a.value.product&&!a.value.product.isNewRec()&&(y.value={id:H,quantity:T,sheets:[]},R())};return t.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,f.value=r.value.product.id),A()}),e({validate:(Y=s.value)==null?void 0:Y.validate,formReference:s}),(H,T)=>{const D=yo,K=qu;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{ref:"form-reference",model:a.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>{var J;return[t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:f.value,"onUpdate:value":[T[0]||(T[0]=U=>f.value=U),v],options:p.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((J=u.value)==null?void 0:J.costRub)!=null?(t.openBlock(),t.createElementBlock("div",Qb,[t.createElementVNode("span",Jb,t.toDisplayString(u.value.code),1),t.createTextVNode(" — "+t.toDisplayString(t.unref(Ve).formatMoney(u.value.costRub))+" "+t.toDisplayString(u.value.currency.symbol)+"/шт. ",1)])):t.createCommentVNode("",!0),t.createElementVNode("div",e_,[u.value?(t.openBlock(),t.createElementBlock("div",t_,[T[7]||(T[7]=t.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),t.createElementVNode("div",n_,[g.value?(t.openBlock(),t.createElementBlock("div",i_,"Ширина "+t.toDisplayString(g.value)+".",1)):t.createCommentVNode("",!0),b.value?(t.openBlock(),t.createElementBlock("div",r_,"Длина "+t.toDisplayString(b.value)+".",1)):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0),t.createElementVNode("div",o_,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value.configuratorParams.items,(U,q)=>(t.openBlock(),t.createElementBlock("div",{key:q,class:"flex grow gap-2"},[t.createElementVNode("div",s_,[t.createVNode(t.unref(I.NFormItem),{path:`configuratorParams.items.${q}.width`,label:"Ширина, мм"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:a.value.configuratorParams.items[q].width,"onUpdate:value":[L=>a.value.configuratorParams.items[q].width=L,L=>M(q)],parse:t.unref(ht),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:T[1]||(T[1]=L=>t.unref(ft)(L)),onInput:L=>c(`items.${q}.width`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),t.createVNode(t.unref(I.NFormItem),{path:`configuratorParams.items.${q}.length`,label:"Длина, мм"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:a.value.configuratorParams.items[q].length,"onUpdate:value":[L=>a.value.configuratorParams.items[q].length=L,L=>M(q)],parse:t.unref(ht),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:T[2]||(T[2]=L=>t.unref(ft)(L)),onInput:L=>c(`items.${q}.length`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),t.createVNode(t.unref(I.NFormItem),{path:`configuratorParams.items.${q}.count`,label:"Количество, шт"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:a.value.configuratorParams.items[q].count,"onUpdate:value":[L=>a.value.configuratorParams.items[q].count=L,L=>M(q)],parse:t.unref(ht),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:T[3]||(T[3]=L=>t.unref(ft)(L,!1)),onInput:L=>c(`items.${q}.count`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),t.createVNode(t.unref(I.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:L=>G(q)},{default:t.withCtx(()=>[t.createVNode(D)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:1,disabled:C.value,type:"default",class:"self-center",onClick:X},{default:t.withCtx(()=>[t.createVNode(K),T[8]||(T[8]=t.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0)]),t.createVNode(t.unref(I.NFormItem),{path:"marker",label:"Маркировка распила"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:T[4]||(T[4]=U=>c("marker")),"onUpdate:value":T[5]||(T[5]=U=>O("marker",U??null)),onFocus:t.unref(He)},null,8,["value","disabled","onFocus"])]),_:1}),w.value?(t.openBlock(),t.createBlock(t.unref(I.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":T[6]||(T[6]=U=>{a.value.isAdditionalSale=U??!1,O("isAdditionalSale",U??!1)})},{default:t.withCtx(()=>[...T[9]||(T[9]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),t.createVNode(t.unref(I.NSpin),{show:_.value,size:"small",class:"grow"},{default:t.withCtx(()=>[y.value&&u.value&&k.value?(t.openBlock(),t.createElementBlock("div",a_,[t.createElementVNode("div",null,[T[10]||(T[10]=t.createTextVNode(" Итого: ",-1)),t.createElementVNode("span",l_,t.toDisplayString($.value)+" "+t.toDisplayString(u.value.currency.symbol),1)]),y.value.quantity&&u.value?(t.openBlock(),t.createElementBlock("div",c_,[t.createElementVNode("span",d_,"("+t.toDisplayString(y.value.quantity)+" шт.",1),T[11]||(T[11]=t.createTextVNode(" x ",-1)),t.createElementVNode("span",u_,t.toDisplayString(t.unref(Ve).formatMoney(u.value.costRub))+" "+t.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),_:1},8,["show"]),t.createElementVNode("div",f_,[y.value&&!_.value?(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:0,loading:n.isSubmitProcessing,disabled:N.value||_.value,type:"primary",class:"self-start",onClick:Z},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:1,loading:_.value,disabled:N.value||_.value,type:"info",class:"self-start",onClick:F},{default:t.withCtx(()=>[...T[12]||(T[12]=[t.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])),[[t.unref(ai),Z]])}}}),m_={class:"flex flex-col gap-2"},p_={class:"w-104 flex grow flex-col px-5"},g_={},Yu=t.defineComponent({...g_,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("sandwich-configurator-form"),s=t.ref(i.cartItem),a=t.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=t.ref(!1),c=async()=>{var f,h;(h=(f=o.value)==null?void 0:f.formReference)==null||h.validate(p=>{if(!p){l.value=!0;const m=V.cloneDeep(s.value);"items"in m.configuratorParams&&delete m.configuratorParams.items,r("submit",m,a.value,()=>{l.value=!1,t.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})})}}).catch(V.noop)},d=f=>{a.value[`items.${f}.width`]={},a.value[`items.${f}.length`]={},a.value[`items.${f}.count`]={}},u=f=>{delete a.value[`items.${f}.width`],delete a.value[`items.${f}.length`],delete a.value[`items.${f}.count`]};return t.onMounted(()=>{i.cartItem.configuratorParams.items.forEach((f,h)=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}})}),t.watch(()=>i.cartItem,f=>{s.value=new W.OrderItemBase(f)},{deep:!0}),(f,h)=>{const p=I.NButton;return t.openBlock(),t.createElementBlock("div",m_,[n.settings.allowShowTable&&s.value.isNewRec()?(t.openBlock(),t.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:h[0]||(h[0]=m=>r("click:view-switch"))},{default:t.withCtx(()=>[...h[2]||(h[2]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",p_,[t.createVNode(Xu,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":h[1]||(h[1]=m=>s.value=m),validation:a.value,settings:n.settings,"event-emitter":n.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),y_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function b_(n,e){return t.openBlock(),t.createElementBlock("svg",y_,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1)])])}const __=t.markRaw({name:"ion-checkmark",render:b_}),w_={key:0,class:"-mt-1 text-sm text-gray-500"},x_={class:"font-bold"},k_={class:"flex flex-col gap-3"},C_={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},v_={class:"flex flex-col gap-1 text-sm text-gray-700"},S_={key:0},B_={key:1},N_={"form-array-name":"items",class:"flex flex-col gap-3"},T_={class:"min-w-0 flex-1"},$_={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},E_={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},R_={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},P_={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},F_={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},V_={key:0,class:"lg:!flex-[2]"},M_={class:"font-bold"},I_={key:1,class:"lg:!flex-[3]"},A_={class:"font-bold"},O_={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"},z_={key:0},D_={class:"font-bold"},L_={key:1},H_={class:"font-bold"},W_={class:"flex flex-wrap items-center gap-3"},j_={},Uu=t.defineComponent({...j_,__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]},showProductInfoButton:{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(n,{expose:e,emit:i}){var J;const r=n,o=i,s=t.useTemplateRef("form-reference"),a=t.useTemplateRef("widthInputs"),l=r.value==null?[]:V.cloneDeep(t.toRaw(r.value)),c=t.ref(l.map(U=>new W.OrderItemBase(U))),d=t.computed(()=>({items:c.value})),u=t.ref({...r.validation}),f=U=>{var q;delete u.value[U],(q=s.value)==null||q.restoreValidation()},h=t.ref(null),p=t.ref(null),m=t.computed(()=>{var U,q;return((q=(U=c.value[0])==null?void 0:U.category)==null?void 0:q.products)??[]}),g=t.computed(()=>m.value.map(U=>({label:U.name,value:U.id}))),b=(U,q,L)=>{const le=U!=null&&U>0,ue=q!=null&&q>0;return!le&&!ue?null:le&&ue?`от ${U} ${L} до ${q} ${L}`:le?`от ${U} ${L}`:`до ${q} ${L}`},y=t.computed(()=>{var U,q;return b(r.settings.minWidth,(q=(U=h.value)==null?void 0:U.properties)==null?void 0:q.width,"мм")}),_=t.computed(()=>{var U,q;return b(r.settings.minLength,(q=(U=h.value)==null?void 0:U.properties)==null?void 0:q.length,"мм")}),x=t.computed(()=>{const U={};return c.value.forEach((q,L)=>{var le,ue,oe,fe,ge,_e,Qe,Re;U[`items.${L}.configuratorParams.width`]=[ce.required,ce.min(r.settings.minWidth),...(ue=(le=h.value)==null?void 0:le.properties)!=null&&ue.width?[ce.max(h.value.properties.width)]:[],ce.step(1),We.serverValidation((oe=u.value[`items.${L}.width`])==null?void 0:oe.feedback)],U[`items.${L}.configuratorParams.length`]=[ce.required,ce.min(r.settings.minLength),...(ge=(fe=h.value)==null?void 0:fe.properties)!=null&&ge.length?[ce.max(h.value.properties.length)]:[],ce.step(1),We.serverValidation((_e=u.value[`items.${L}.length`])==null?void 0:_e.feedback)],U[`items.${L}.quantity`]=[ce.required,ce.min(1),ce.step(1),We.serverValidation((Qe=u.value[`items.${L}.quantity`])==null?void 0:Qe.feedback)],U[`items.${L}.marker`]=[We.serverValidation((Re=u.value[`items.${L}.marker`])==null?void 0:Re.feedback)]}),U});t.watch(()=>r.validation,U=>{u.value={...U},Object.values(U).some(L=>L==null?void 0:L.feedback)&&t.nextTick(()=>{var L;return(L=s.value)==null?void 0:L.validate(V.noop).catch(V.noop)})},{deep:!0});const w=t.ref(r.settings.canSetDopProdaga??!1),C=t.computed(()=>{const U=h.value;return U?c.value.some(q=>{var oe,fe;const L=q.configuratorParams,le=(oe=U.properties)==null?void 0:oe.width,ue=(fe=U.properties)==null?void 0:fe.length;return L.width===0||L.width<r.settings.minWidth||le!=null&&L.width>le||L.length===0||L.length<r.settings.minLength||ue!=null&&L.length>ue||q.quantity===0||q.quantity<1}):!0}),N=t.computed(()=>!h.value||C.value||c.value.length===0),k=t.computed(()=>{const U=c.value[0];return U!=null&&!U.isNewRec()}),$=U=>r.itemStates[U]??"idle",v=U=>$(U)==="success",E=U=>$(U)==="loading",P=t.computed(()=>c.value.length===0?!0:c.value.every((U,q)=>{const L=$(q);return L==="success"||L==="loading"})),F=U=>U.width===0||U.length===0?0:U.width*U.length/1e6,R=U=>Ve.formatArea(F(U)),M=U=>{var oe;const q=U.configuratorParams,L=F(q),le=((oe=h.value)==null?void 0:oe.costRub)??0,ue=U.quantity??0;return!L||!ue?0:Ve.roundMoney(L*le*ue)},X=t.computed(()=>V.sum(c.value.map(U=>{const q=U.configuratorParams;return!q.width||q.length===0||!U.quantity?0:q.width*q.length*U.quantity/1e6}))),G=t.computed(()=>Ve.roundMoney(V.sum(c.value.map(U=>M(U))))),Z=()=>{var U,q,L;return new W.OrderItemBase({category:(U=c.value[0])==null?void 0:U.category,configurator:(q=c.value[0])==null?void 0:q.configurator,product:h.value??new W.ClientProduct,quantity:1,isAdditionalSale:(L=c.value[0])==null?void 0:L.isAdditionalSale,configuratorParams:{width:0,length:0}})},O=U=>{if(!U){h.value=null,p.value=null,c.value.forEach(L=>{L.product=new W.ClientProduct}),o("update:value",c.value);return}const q=m.value.find(L=>L.id===U);q&&(h.value=q,p.value=U,c.value.forEach((L,le)=>{var ue,oe;L.product=q,(ue=q.properties)!=null&&ue.width&&L.configuratorParams.width>q.properties.width&&(L.configuratorParams.width=q.properties.width),(oe=q.properties)!=null&&oe.length&&L.configuratorParams.length>q.properties.length&&(L.configuratorParams.length=q.properties.length),o("item-reset",le)}),o("update:value",c.value))},A=U=>{var le,ue;const q=c.value[U],L=h.value;L&&((le=L.properties)!=null&&le.width&&q.configuratorParams.width>L.properties.width&&(q.configuratorParams.width=L.properties.width),(ue=L.properties)!=null&&ue.length&&q.configuratorParams.length>L.properties.length&&(q.configuratorParams.length=L.properties.length)),o("item-reset",U),o("update:value",c.value)},Y=(U,q)=>{c.value[U].marker=q===null||q===""?void 0:q,o("item-reset",U),o("update:value",c.value)},H=U=>{c.value.forEach(q=>{q.isAdditionalSale=U}),o("update:value",c.value)},T=()=>{c.value.push(Z()),o("update:value",c.value),o("add-item",c.value.length),t.nextTick(()=>{var q,L,le,ue;const U=c.value.length-1;(L=(q=a.value)==null?void 0:q[U])==null||L.focus(),(ue=(le=a.value)==null?void 0:le[U])==null||ue.select()})},D=U=>{c.value.splice(U,1),o("update:value",c.value),o("remove-item",U)};t.watch(()=>r.value,U=>{var ue;const L=(U==null?[]:V.cloneDeep(t.toRaw(U))).map(oe=>new W.OrderItemBase(oe));c.value=L.length>0?L:[Z()];const le=(ue=c.value[0])==null?void 0:ue.product;le&&!le.isNewRec()?(h.value=le,p.value=le.id):(h.value=null,p.value=null)},{deep:!0});const K=()=>{var q;if(h.value!==null)return;const U=(q=m.value[0])==null?void 0:q.id;U!=null&&O(U)};return t.watch(m,()=>{K()}),t.onMounted(()=>{var q;c.value.length===0&&(c.value=[Z()]);const U=(q=c.value[0])==null?void 0:q.product;U&&!U.isNewRec()&&(h.value=U,p.value=U.id),K()}),e({validate:(J=s.value)==null?void 0:J.validate,formReference:s}),(U,q)=>{const L=__,le=yo,ue=qu;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{ref:"form-reference",model:d.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>{var oe,fe;return[t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:p.value,"onUpdate:value":[q[0]||(q[0]=ge=>p.value=ge),O],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((oe=h.value)==null?void 0:oe.costRub)!=null?(t.openBlock(),t.createElementBlock("div",w_,[t.createElementVNode("span",x_,t.toDisplayString(h.value.code),1),t.createTextVNode(" — "+t.toDisplayString(t.unref(Ve).formatMoney(h.value.costRub))+" "+t.toDisplayString(h.value.currency.symbol)+"/м² ",1)])):t.createCommentVNode("",!0),t.createElementVNode("div",k_,[h.value?(t.openBlock(),t.createElementBlock("div",C_,[q[6]||(q[6]=t.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),t.createElementVNode("div",v_,[y.value?(t.openBlock(),t.createElementBlock("div",S_,"Ширина "+t.toDisplayString(y.value)+".",1)):t.createCommentVNode("",!0),_.value?(t.openBlock(),t.createElementBlock("div",B_,"Длина "+t.toDisplayString(_.value)+".",1)):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0),t.createElementVNode("div",N_,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value.items,(ge,_e)=>{var Qe;return t.openBlock(),t.createElementBlock("div",{key:_e,class:t.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",v(_e)?"opacity-70":""])},[t.createElementVNode("div",T_,[t.createElementVNode("div",$_,[t.createElementVNode("div",E_,[t.createVNode(t.unref(I.NFormItem),{path:`items.${_e}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[_e].configuratorParams.width,"onUpdate:value":[Re=>d.value.items[_e].configuratorParams.width=Re,Re=>A(_e)],parse:t.unref(ht),"show-button":!1,disabled:!h.value||v(_e)||E(_e),placeholder:"Ширина",class:"w-full",onKeydown:q[1]||(q[1]=Re=>t.unref(ft)(Re)),onInput:Re=>f(`items.${_e}.width`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),t.createVNode(t.unref(I.NFormItem),{path:`items.${_e}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:d.value.items[_e].configuratorParams.length,"onUpdate:value":[Re=>d.value.items[_e].configuratorParams.length=Re,Re=>A(_e)],parse:t.unref(ht),"show-button":!1,disabled:!h.value||v(_e)||E(_e),placeholder:"Длина",class:"w-full",onKeydown:q[2]||(q[2]=Re=>t.unref(ft)(Re)),onInput:Re=>f(`items.${_e}.length`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),t.createElementVNode("div",R_,[t.createVNode(t.unref(I.NFormItem),{path:`items.${_e}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:d.value.items[_e].quantity,"onUpdate:value":[Re=>d.value.items[_e].quantity=Re,Re=>A(_e)],parse:t.unref(ht),"show-button":!1,disabled:!h.value||v(_e)||E(_e),placeholder:"Кол-во",class:"w-full",onKeydown:q[3]||(q[3]=Re=>t.unref(ft)(Re,!1)),onInput:Re=>f(`items.${_e}.quantity`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),t.createVNode(t.unref(I.NFormItem),{path:`items.${_e}.marker`,label:"Маркировка",class:"min-w-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:d.value.items[_e].marker??null,disabled:!h.value||v(_e)||E(_e),placeholder:"Маркировка",class:"w-full",onInput:Re=>f(`items.${_e}.marker`),"onUpdate:value":Re=>Y(_e,Re??null),onFocus:t.unref(He)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),E(_e)||v(_e)?(t.openBlock(),t.createElementBlock("div",P_,[E(_e)?(t.openBlock(),t.createBlock(t.unref(I.NSpin),{key:0,size:14})):v(_e)?(t.openBlock(),t.createBlock(L,{key:1,class:"text-green-600 text-xl"})):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",F_,[ge.configuratorParams.width>0&&ge.configuratorParams.length>0?(t.openBlock(),t.createElementBlock("div",V_,[q[7]||(q[7]=t.createTextVNode(" Площадь (S) = ",-1)),t.createElementVNode("span",M_,t.toDisplayString(R(ge.configuratorParams))+" м²",1)])):t.createCommentVNode("",!0),M(ge)>0?(t.openBlock(),t.createElementBlock("div",I_,[q[8]||(q[8]=t.createTextVNode(" Итого: ",-1)),t.createElementVNode("span",A_,t.toDisplayString(t.unref(Ve).formatMoney(M(ge)))+" "+t.toDisplayString((Qe=h.value)==null?void 0:Qe.currency.symbol),1)])):t.createCommentVNode("",!0)])]),k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:0,disabled:E(_e)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:Re=>D(_e)},{default:t.withCtx(()=>[t.createVNode(le)]),_:1},8,["disabled","onClick"]))],2)}),128))]),h.value?(t.openBlock(),t.createElementBlock("div",O_,[X.value>0?(t.openBlock(),t.createElementBlock("div",z_,[q[9]||(q[9]=t.createTextVNode(" Общая площадь: ",-1)),t.createElementVNode("span",D_,t.toDisplayString(t.unref(Ve).formatArea(X.value))+" м²",1)])):t.createCommentVNode("",!0),G.value>0?(t.openBlock(),t.createElementBlock("div",L_,[q[10]||(q[10]=t.createTextVNode(" Итого: ",-1)),t.createElementVNode("span",H_,t.toDisplayString(t.unref(Ve).formatMoney(G.value))+" "+t.toDisplayString(h.value.currency.symbol),1)])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),w.value?(t.openBlock(),t.createBlock(t.unref(I.NCheckbox),{key:1,checked:((fe=c.value[0])==null?void 0:fe.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":q[4]||(q[4]=ge=>H(ge??!1))},{default:t.withCtx(()=>[...q[11]||(q[11]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),t.createElementVNode("div",W_,[h.value&&!k.value?(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:0,disabled:C.value,type:"default",onClick:T},{default:t.withCtx(()=>[t.createVNode(ue),q[12]||(q[12]=t.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),t.createVNode(t.unref(I.NButton),{loading:n.isSubmitProcessing,disabled:N.value||P.value,type:"primary",class:"ml-auto",onClick:q[5]||(q[5]=ge=>o("submit",c.value))},{default:t.withCtx(()=>{var ge;return[t.createTextVNode(t.toDisplayString((ge=c.value[0])!=null&&ge.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[t.unref(ai),()=>o("submit",c.value)]])}}}),q_={class:"flex flex-col gap-2"},X_={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},Y_={},Ku=t.defineComponent({...Y_,__name:"sandwich-m2-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("sandwich-m2-configurator-form"),s=t.ref((i.cartItems??[]).map(x=>new W.OrderItemBase(x))),a=t.ref([]),l=t.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=x=>{c.forEach(w=>{l.value[`items.${x}.${w}`]={}})},u=x=>{c.forEach(w=>{delete l.value[`items.${x}.${w}`]})},f=t.computed(()=>a.value.includes("loading")),h=()=>({width:{},length:{},quantity:{},marker:{}}),p=(x,w)=>{let C=!1;return c.forEach(N=>{var F,R;const k=`items.0.${N}`,$=(F=x[N])==null?void 0:F.feedback,E=((R=x[k])==null?void 0:R.feedback)??$,P=`items.${w}.${N}`;E?(l.value[P]=x[k]??x[N],C=!0):l.value[P]={}}),C},m=(x,w,C)=>new Promise(N=>{const k=h();let $=!1;const v=E=>{if($)return;$=!0;const P=p(k,w),F=(E===void 0?!P:E)&&!P;a.value[w]=F?"success":"error",t.nextTick(()=>{var R,M;(M=(R=o.value)==null?void 0:R.formReference)==null||M.restoreValidation()}),N(F)};a.value[w]="loading",r("submit",[V.cloneDeep(x)],k,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 x=s.value.map((k,$)=>$).filter(k=>{const $=a.value[k]??"idle";return $!=="success"&&$!=="loading"});let w=!0;for(let k=0;k<x.length;k+=1){const $=x[k],v=s.value[$];if(!v)break;const P=k===x.length-1&&w;await m(v,$,P)||(w=!1)}},b=x=>{const w=x-1;a.value[w]="idle",d(w)},y=x=>{a.value.splice(x,1),u(x);for(let w=x;w<s.value.length;w+=1)d(w)},_=x=>{const w=a.value[x];(w==="success"||w==="error")&&(a.value[x]="idle")};return t.onMounted(()=>{(i.cartItems??[]).forEach((x,w)=>{a.value[w]="idle",d(w)})}),t.watch(()=>i.cartItems,x=>{const w=(x??[]).map(C=>new W.OrderItemBase(C));s.value=w,a.value=w.map(()=>"idle"),w.forEach((C,N)=>{d(N)})},{deep:!0}),(x,w)=>{var N;const C=I.NButton;return t.openBlock(),t.createElementBlock("div",q_,[n.settings.allowShowTable&&((N=s.value[0])!=null&&N.isNewRec())?(t.openBlock(),t.createBlock(C,{key:0,type:"tertiary",class:"self-center",onClick:w[0]||(w[0]=k=>r("click:view-switch"))},{default:t.withCtx(()=>[...w[2]||(w[2]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",X_,[t.createVNode(Uu,{ref:"sandwich-m2-configurator-form",value:s.value,"onUpdate:value":w[1]||(w[1]=k=>s.value=k),validation:l.value,settings:n.settings,"event-emitter":n.eventEmitter,"is-submit-processing":f.value,"item-states":a.value,onSubmit:g,onAddItem:b,onRemoveItem:y,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),U_={key:0,class:"flex justify-center p-4"},K_={key:1,class:"p-4 text-center text-red-500"},G_={key:2,class:"flex justify-center"},Z_={class:"!bg-white p-4 m-2 rounded-md w-max"},Q_={key:3,class:"p-4 text-center text-gray-500"},J_={},Gu=t.defineComponent({...J_,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},cartItems:{},category:{}},setup(n){const e=n,i=t.ref(!1),r=t.ref(null),o=t.ref(e.cartItem??null),s=t.ref(e.cartItems??null),a=h=>{const p=h.configuratorParams;return[new W.OrderItemBase({...h,quantity:h.quantity??1,marker:h.marker,configuratorParams:{width:(p==null?void 0:p.width)??h.width??0,length:(p==null?void 0:p.length)??h.length??0}})]},l=t.ref(e.editor===W.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var p,m,g;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const h={category:((p=e.cartItem)==null?void 0:p.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const b=e.settings;o.value=new W.OrderItemBase({...h,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:V.some(b.startTailConfigs,y=>y.isDefault)?(m=b.startTailConfigs)==null?void 0:m.findIndex(y=>y.isDefault):void 0,endTailType:V.some(b.endTailConfigs,y=>y.isDefault)?(g=b.endTailConfigs)==null?void 0:g.findIndex(y=>y.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=e.settings;o.value=new W.OrderItemBase({...h,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{const b=e.settings;s.value=[new W.OrderItemBase({...h,length:b.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=e.settings;o.value=new W.OrderItemBase({...h,configuratorParams:{width:b.minWidth,length:b.minLength}});break}case"sandwich":{o.value=new W.OrderItemBase({...h,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{l.value=[new W.OrderItemBase({...h,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}o.value&&(o.value.marker=void 0)},d=(h,p,m)=>{const g=b=>{m==null||m(),b&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:h,callback:g,validation:p})},u=(h,p,m,g)=>{const b=h[0];if(!b){m==null||m();return}const y=(g==null?void 0:g.isFinalSuccessfulCompletion)===!0,_=x=>{m==null||m(x),y&&x&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:b,callback:_,validation:p,additionalParams:g})},f=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return t.onMounted(()=>{!e.cartItem&&!e.cartItems&&c()}),(h,p)=>{const m=I.NSpin;return t.openBlock(),t.createElementBlock(t.Fragment,null,[i.value?(t.openBlock(),t.createElementBlock("div",U_,[t.createVNode(m,{size:"large"})])):r.value?(t.openBlock(),t.createElementBlock("div",K_,t.toDisplayString(r.value),1)):t.createCommentVNode("",!0),n.settings!==null&&(o.value!==null||s.value!==null||l.value!==null)?(t.openBlock(),t.createElementBlock("div",G_,[t.createElementVNode("div",Z_,[n.editor==="kozyrek"?(t.openBlock(),t.createBlock(Mu,{key:0,"event-emitter":n.eventEmitter,settings:n.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):n.editor==="mosquitto"?(t.openBlock(),t.createBlock(Ou,{key:1,"event-emitter":n.eventEmitter,settings:n.settings,"cart-item":o.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):n.editor==="strip"?(t.openBlock(),t.createBlock(Hu,{key:2,"event-emitter":n.eventEmitter,settings:n.settings,"cart-items":s.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):n.editor==="metal_for_doors"?(t.openBlock(),t.createBlock(ju,{key:3,"event-emitter":n.eventEmitter,settings:n.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):n.editor==="sandwich"?(t.openBlock(),t.createBlock(Yu,{key:4,"event-emitter":n.eventEmitter,settings:n.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):n.editor==="sandwich_m2"?(t.openBlock(),t.createBlock(Ku,{key:5,"event-emitter":n.eventEmitter,settings:n.settings,"cart-items":l.value,"onClick:viewSwitch":f,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):t.createCommentVNode("",!0)])])):(t.openBlock(),t.createElementBlock("div",Q_,' Конфигуратор "'+t.toDisplayString(n.editor)+'" не поддерживается. ',1))],64)}}});function Zu(n){return Object.values(W.ConfiguratorsEnum).includes(n)}function Qu(n){var e;return((e=n.properties)==null?void 0:e.configurator)!==W.ConfiguratorsEnum.Sandwich?!0:n.properties.configuratorSettings!==void 0&&V.isArray(n.products)&&n.products.length>0}const ew={key:0,class:"pt-0.5"},tw={key:0},nw={key:1},iw={class:"flex flex-row gap-1"},rw={key:0},ow={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},sw={class:"flex flex-col gap-2.5 sm:flex-row"},aw={key:0,class:"header-extra"},lw={class:"inline-flex"},cw={class:"inline-flex"},dw={class:"inline-flex"},uw={class:"mt-2"},fw={key:1,class:"flex flex-col"},hw={},mw=t.defineComponent({...hw,__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},showProductInfoButton:{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(n){const e=n,i=t.inject(Rr,"medium"),r=uo(),o=t.computed(()=>{var oe;return(oe=e==null?void 0:e.filteredItems)==null?void 0:oe[e.categoryItem.id]}),s=t.computed(()=>{var oe,fe;return V.isArray((oe=e.categoryItem)==null?void 0:oe.categories)&&((fe=e.categoryItem.categories)==null?void 0:fe.length)>0}),a=t.computed(()=>{var oe;return V.isArray((oe=e.categoryItem)==null?void 0:oe.products)?e.categoryItem.products:[]}),l=t.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([oe,fe])=>`${fe} руб./${O(oe)}`).join(", ")),c=t.computed(()=>V.isUndefined(e.filteredItems)||o.value==="*"?a.value:a.value.filter(oe=>{var ge;const fe=(ge=o.value)==null?void 0:ge.products;return V.isArray(fe)&&fe.includes(oe.id)})),d=t.computed(()=>c.value.length>0),u=t.computed(()=>V.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),f=t.computed(()=>V.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=t.computed(()=>V.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),p=t.computed(()=>{var ge,_e;const oe=(ge=w.value)==null?void 0:ge.hidingComment,fe=(_e=w.value)!=null&&_e.isDisabled?`Скрыто для клиента${oe?`. Причина: '${oe}'`:""}`:"Видимо клиенту";return u.value==="disabled"?`${fe}. ${Nr}`:fe}),m=t.computed(()=>{var ge;const oe=(ge=w.value)==null?void 0:ge.manager,fe=oe?`Категория закреплена за "${oe.name??"-"}"`:"Закрепить";return f.value==="disabled"?`${fe}. ${Nr}`:fe}),g=t.computed(()=>h.value==="disabled"?`${$s}. ${Nr}`:$s),b=t.computed(()=>V.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),y=t.computed(()=>{var oe,fe,ge;return((oe=e.categoryItem.properties)==null?void 0:oe.configurator)!==void 0&&Zu((fe=e.categoryItem.properties)==null?void 0:fe.configurator)&&Qu(e.categoryItem)&&((ge=e.categoryItem.properties)==null?void 0:ge.configuratorSettings)!==void 0&&(V.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),_=t.computed(()=>y.value&&(V.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),x=t.computed(()=>V.isNil(e.categoryContextButtonsConfig)?[]:V.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),w=t.computed(()=>new W.ClientCategory(e.categoryItem)),C=t.ref(!1),N=t.ref(!1),k=t.computed(()=>!V.isUndefined(e.isCategoryItemSelected)),$=t.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),v=t.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),E=t.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),P=t.computed(()=>L.value&&Ue.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),F=t.useTemplateRef("collapse-item-reference"),R=t.computed(()=>{var oe,fe;return(fe=(oe=e.categoryItem.properties)==null?void 0:oe.templateCost)==null?void 0:fe.priceCoefficient}),M=t.computed(()=>{var oe,fe;return(fe=(oe=e.categoryItem.properties)==null?void 0:oe.templateCost)==null?void 0:fe.increasePercent}),X=t.computed(()=>vi.isM2Category(e.categoryItem)?vi.findReferenceProduct(e.categoryItem):void 0),G=t.computed(()=>X.value?vi.calculateM2Cost(X.value,R.value,M.value):void 0),Z=t.computed(()=>{var oe,fe;return`${((fe=(oe=X.value)==null?void 0:oe.currency)==null?void 0:fe.symbol)??""}/м²`}),O=(oe,fe="ru-RU")=>0 .toLocaleString(fe,{style:"currency",currency:oe,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),A=oe=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:oe,target:F.value})},Y=(oe,fe)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:fe,isLoadingState:C,target:F.value})},H=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:F.value})},T=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:F.value})},D=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:F.value})},K=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:F.value})},J=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:F.value})},U=oe=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:oe,target:F.value})},q=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},L=t.ref(0),le=t.computed(()=>L.value&&a.value.length>0?oy(a.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,showProductInfoButton:e.showProductInfoButton,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),ue=V.debounce(()=>{L.value=window.innerWidth},20);return t.onUnmounted(()=>{window.removeEventListener("resize",ue),ue.cancel()}),window.addEventListener("resize",ue),ue(),(oe,fe)=>{const ge=I.NCheckbox,_e=bp,Qe=I.NTooltip,Re=pp,Mt=I.NTag,vn=fp,It=cp,en=I.NButton,Ln=sp,mn=ic,_t=nc,ae=tc,de=Ms,Ge=I.NDropdown,Ui=I.NDataTable,oi=I.NAlert,si=I.NSpin;return t.openBlock(),t.createBlock(rc,{ref:"collapse-item-reference",name:n.categoryItem.id,"data-id":n.categoryItem.id,"onHeader:click":Y},{"pre-arrow":t.withCtx(()=>{var at,qe;return[k.value?(t.openBlock(),t.createElementBlock("div",ew,[t.createVNode(ge,{checked:$.value,indeterminate:E.value,disabled:v.value,"onUpdate:checked":A},null,8,["checked","indeterminate","disabled"])])):t.createCommentVNode("",!0),!u.value&&((at=w.value)!=null&&at.isDisabled)?(t.openBlock(),t.createBlock(Qe,{key:1,placement:"bottom",trigger:"hover"},{trigger:t.withCtx(()=>[t.createVNode(_e,{class:"pt-1.5"})]),default:t.withCtx(()=>[fe[1]||(fe[1]=t.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):t.createCommentVNode("",!0),((qe=w.value)==null?void 0:qe.isFavorite)??!1?(t.openBlock(),t.createBlock(Qe,{key:2,placement:"bottom",trigger:"hover"},{trigger:t.withCtx(()=>[t.createVNode(Re,{class:"pt-1.5"})]),default:t.withCtx(()=>[fe[2]||(fe[2]=t.createTextVNode(" Избранная категория ",-1))]),_:1})):t.createCommentVNode("",!0)]}),header:t.withCtx(()=>{var at,qe,on,sn;return[t.createElementVNode("div",{class:t.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":n.categoryItem.isHidden,"text-gray-400":(at=w.value)==null?void 0:at.isDisabled})},[t.createVNode(Qe,{disabled:!n.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:t.withCtx(()=>[t.createElementVNode("span",null,t.toDisplayString(n.categoryItem.name),1)]),default:t.withCtx(()=>[fe[3]||(fe[3]=t.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),t.createElementVNode("div",{class:"w-fit",onClick:fe[0]||(fe[0]=t.withModifiers((...lt)=>t.unref(V.noop)&&t.unref(V.noop)(...lt),["prevent","stop"]))},[(qe=n.categoryItem.properties)!=null&&qe.templateCost?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[R.value||M.value||!t.unref(V.isNil)(G.value)?(t.openBlock(),t.createBlock(Mt,{key:0,size:t.unref(i),round:""},{default:t.withCtx(()=>{var lt;return[R.value?(t.openBlock(),t.createElementBlock("span",tw,t.toDisplayString((lt=R.value)==null?void 0:lt.name),1)):t.createCommentVNode("",!0),M.value?(t.openBlock(),t.createElementBlock("span",nw,t.toDisplayString(M.value>0?"+":"")+t.toDisplayString(t.unref(Ve).formatPercent(M.value))+"%",1)):t.createCommentVNode("",!0),t.unref(V.isNil)(G.value)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:2,class:t.normalizeClass({"ml-1":R.value||M.value})},t.toDisplayString(G.value.toFixed(2))+" "+t.toDisplayString(Z.value),3))]}),_:1},8,["size"])):t.createCommentVNode("",!0)],64)):(on=n.categoryItem.properties)!=null&&on.m2Price?(t.openBlock(),t.createBlock(Mt,{key:1,size:t.unref(i),round:""},{default:t.withCtx(()=>[t.createTextVNode(" Установленная стоимость: "+t.toDisplayString(n.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):t.createCommentVNode("",!0),l.value?(t.openBlock(),t.createBlock(Mt,{key:2,size:t.unref(i),round:""},{default:t.withCtx(()=>[t.createTextVNode(" Фиксированный курс: "+t.toDisplayString(l.value),1)]),_:1},8,["size"])):t.createCommentVNode("",!0),f.value&&((sn=w.value)!=null&&sn.manager)?(t.openBlock(),t.createBlock(Mt,{key:3,size:t.unref(i),closable:f.value!=="disabled",round:"",class:"align-bottom",onClose:K},{default:t.withCtx(()=>[t.createVNode(Qe,{placement:"bottom",trigger:"hover"},{trigger:t.withCtx(()=>{var lt,jt;return[t.createElementVNode("span",iw,[t.createVNode(vn),t.createTextVNode(" "+t.toDisplayString((jt=(lt=w.value)==null?void 0:lt.manager)==null?void 0:jt.name),1)])]}),default:t.withCtx(()=>{var lt,jt;return[t.createTextVNode(' Категория закреплена за "'+t.toDisplayString((jt=(lt=w.value)==null?void 0:lt.manager)==null?void 0:jt.name)+'" ',1)]}),_:1})]),_:1},8,["size","closable"])):t.createCommentVNode("",!0)])]}),"sub-header":t.withCtx(()=>[n.showSlugs||n.showProperties?(t.openBlock(),t.createElementBlock("div",rw,[t.createElementVNode("ul",ow,[n.showSlugs?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList({id:n.categoryItem.id,slug:n.categoryItem.slug},(at,qe)=>(t.openBlock(),t.createElementBlock("li",{key:qe}," ("+t.toDisplayString(qe)+"): "+t.toDisplayString(at),1))),128)):t.createCommentVNode("",!0),n.showProperties?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(n.categoryItem.properties,(at,qe)=>(t.openBlock(),t.createElementBlock("li",{key:qe}," ("+t.toDisplayString(qe)+"): "+t.toDisplayString(at),1))),128)):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0)]),"header-extra":t.withCtx(()=>{var at;return[t.createElementVNode("div",sw,[oe.$slots["header-extra"]?(t.openBlock(),t.createElementBlock("div",aw,[t.renderSlot(oe.$slots,"header-extra",{categoryItem:n.categoryItem},void 0,!0)])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createBlock(Qe,{key:1,placement:"bottom",trigger:"hover",disabled:!t.unref(r)&&u.value!=="disabled"},{trigger:t.withCtx(()=>[t.createElementVNode("span",lw,[t.createVNode(en,{ghost:!0,disabled:u.value==="disabled",size:t.unref(i),onClick:H},{default:t.withCtx(()=>{var qe;return[(qe=w.value)!=null&&qe.isDisabled?(t.openBlock(),t.createBlock(_e,{key:1})):(t.openBlock(),t.createBlock(It,{key:0}))]}),_:1},8,["disabled","size"])])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(p.value),1)]),_:1},8,["disabled"])):t.createCommentVNode("",!0),f.value&&!((at=w.value)!=null&&at.manager)?(t.openBlock(),t.createBlock(Qe,{key:2,placement:"bottom",trigger:"hover",disabled:!t.unref(r)&&f.value!=="disabled"},{trigger:t.withCtx(()=>[t.createElementVNode("span",cw,[t.createVNode(en,{ghost:!0,disabled:f.value==="disabled",size:t.unref(i),onClick:D},{default:t.withCtx(()=>[t.createVNode(Ln)]),_:1},8,["disabled","size"])])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(m.value),1)]),_:1},8,["disabled"])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createBlock(Qe,{key:3,placement:"bottom",trigger:"hover",disabled:!t.unref(r)&&h.value!=="disabled"},{trigger:t.withCtx(()=>[t.createElementVNode("span",dw,[t.createVNode(en,{ghost:!0,disabled:h.value==="disabled",size:t.unref(i),onClick:T},{default:t.withCtx(()=>{var qe;return[(qe=w.value)!=null&&qe.isRequired?(t.openBlock(),t.createBlock(_t,{key:1})):(t.openBlock(),t.createBlock(mn,{key:0}))]}),_:1},8,["disabled","size"])])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(g.value),1)]),_:1},8,["disabled"])):t.createCommentVNode("",!0),b.value?(t.openBlock(),t.createBlock(Qe,{key:4,placement:"bottom",trigger:"hover",disabled:!t.unref(r)},{trigger:t.withCtx(()=>[t.createVNode(en,{ghost:!0,size:t.unref(i),type:"primary",onClick:J},{default:t.withCtx(()=>[t.createVNode(ae)]),_:1},8,["size"])]),default:t.withCtx(()=>[fe[4]||(fe[4]=t.createTextVNode(" Редактировать ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),x.value.length>0?(t.openBlock(),t.createBlock(Ge,{key:5,options:x.value,size:t.unref(i),trigger:"click",onSelect:U},{default:t.withCtx(()=>[t.createVNode(en,{ghost:!0,size:t.unref(i),type:"primary"},{default:t.withCtx(()=>[t.createVNode(de)]),_:1},8,["size"])]),_:1},8,["options","size"])):t.createCommentVNode("",!0)])]}),default:t.withCtx(()=>[t.renderSlot(oe.$slots,"default",{},()=>{var at,qe,on;return[t.createElementVNode("div",uw,[s.value?(t.openBlock(),t.createBlock(ef,{key:0,"categories-items":n.categoryItem.categories??[],"has-products":d.value||C.value,"event-emitter":n.eventEmitter,"filtered-items":o.value?((at=o.value)==null?void 0:at.categories)??{}:void 0,"is-category-item-selected":n.isCategoryItemSelected,"show-slugs":n.showSlugs,"show-properties":n.showProperties,"allow-name-click":n.allowNameClick,"allow-price-click":n.allowPriceClick,"show-price-history":n.showPriceHistory,"show-cost-date":n.showCostDate,"show-product-info-button":n.showProductInfoButton,"show-category-required-button":n.showCategoryRequiredButton,"show-category-hide-for-client-button":n.showCategoryHideForClientButton,"show-category-pin-button":n.showCategoryPinButton,"show-category-edit-button":n.showCategoryEditButton,"category-context-buttons-config":n.categoryContextButtonsConfig,"is-product-item-selected":n.isProductItemSelected,"show-product-add-to-cart-button":n.showProductAddToCartButton,"show-product-costs":n.showProductCosts,"show-product-required-button":n.showProductRequiredButton,"show-product-edit-button":n.showProductEditButton,"product-context-buttons-config":n.productContextButtonsConfig,"show-configurator":n.showConfigurator,"can-show-configurator":n.canShowConfigurator},t.createSlots({_:2},[oe.$slots["header-extra"]?{name:"header-extra",fn:t.withCtx(({categoryItem:sn})=>[t.renderSlot(oe.$slots,"header-extra",{categoryItem:sn},void 0,!0)]),key:"0"}:void 0]),1032,["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-product-info-button","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"])):t.createCommentVNode("",!0)]),y.value&&_.value?(t.openBlock(),t.createBlock(Gu,{key:0,"event-emitter":n.eventEmitter,settings:(qe=n.categoryItem.properties)==null?void 0:qe.configuratorSettings,editor:(on=n.categoryItem.properties)==null?void 0:on.configurator,category:n.categoryItem},null,8,["event-emitter","settings","editor","category"])):d.value?(t.openBlock(),t.createElementBlock("div",fw,[y.value?(t.openBlock(),t.createBlock(en,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:q},{default:t.withCtx(()=>[...fe[5]||(fe[5]=[t.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createVNode(Ui,{columns:le.value,data:c.value,bordered:!0,loading:C.value,remote:!0,"row-key":sn=>sn.id,"table-layout":P.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):t.createCommentVNode("",!0),!C.value&&!N.value&&!s.value&&!d.value?(t.openBlock(),t.createBlock(oi,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):t.createCommentVNode("",!0),N.value?(t.openBlock(),t.createBlock(oi,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):t.createCommentVNode("",!0),C.value?(t.openBlock(),t.createBlock(si,{key:4,size:t.unref(i),class:"w-full"},{description:t.withCtx(()=>[...fe[6]||(fe[6]=[t.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):t.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),pw=gn(mw,[["__scopeId","data-v-9ed22ab1"]]),gw={class:"sc-collapse flex w-full flex-col"},yw={},Ju=t.defineComponent({...yw,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(n,{emit:e}){const i=n,r=e,o=(s,a)=>{r("on-item-header-click",s,a)};return t.provide("itemHeaderClickHandler",o),t.provide("defaultExpandedNames",i.defaultExpandedNames),t.provide("expandedNames",i.expandedNames),(s,a)=>(t.openBlock(),t.createElementBlock("div",gw,[t.renderSlot(s.$slots,"default")]))}}),bw={},ef=t.defineComponent({...bw,__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},showProductInfoButton:{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(n){const e=n,i=t.inject(Rr,"medium"),r=t.computed(()=>V.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var a;return!!((a=e.filteredItems)!=null&&a[s.id])})),o=(s,a)=>{if(V.isUndefined(a))return;const l=a[s.id];if(l==="*")return;const c={};return c[s.id]=structuredClone(t.toRaw(l)),c};return(s,a)=>{const l=I.NSpin,c=I.NAlert;return t.openBlock(),t.createElementBlock(t.Fragment,null,[r.value.length>0?(t.openBlock(),t.createBlock(Ju,{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,d=>(t.openBlock(),t.createBlock(pw,{key:d.id,"category-item":d,"event-emitter":n.eventEmitter,"filtered-items":o(d,n.filteredItems),"is-category-item-selected":n.isCategoryItemSelected,"show-slugs":n.showSlugs,"show-properties":n.showProperties,"allow-name-click":n.allowNameClick,"allow-price-click":n.allowPriceClick,"show-price-history":n.showPriceHistory,"show-cost-date":n.showCostDate,"show-product-info-button":n.showProductInfoButton,"show-category-required-button":n.showCategoryRequiredButton,"show-category-hide-for-client-button":n.showCategoryHideForClientButton,"show-category-pin-button":n.showCategoryPinButton,"show-category-edit-button":n.showCategoryEditButton,"category-context-buttons-config":n.categoryContextButtonsConfig,"is-product-item-selected":n.isProductItemSelected,"show-product-add-to-cart-button":n.showProductAddToCartButton,"show-product-costs":n.showProductCosts,"show-product-required-button":n.showProductRequiredButton,"show-product-edit-button":n.showProductEditButton,"product-context-buttons-config":n.productContextButtonsConfig,"show-configurator":n.showConfigurator,"can-show-configurator":n.canShowConfigurator},t.createSlots({_:2},[s.$slots["header-extra"]?{name:"header-extra",fn:t.withCtx(({categoryItem:u})=>[t.renderSlot(s.$slots,"header-extra",{categoryItem:u})]),key:"0"}:void 0]),1032,["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-product-info-button","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))]),_:3})):n.loading?(t.openBlock(),t.createBlock(l,{key:1,size:t.unref(i),class:"w-full"},{description:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):t.createCommentVNode("",!0),!n.hasProducts&&!n.loading&&n.categoriesItems.length>0&&r.value.length===0?(t.openBlock(),t.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):t.createCommentVNode("",!0)],64)}}}),_w={},tf=t.defineComponent({..._w,__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,default:!1},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(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=new W.Reference,l=t.computed(()=>V.isNil(r.value)?s.value?[]:null:V.isArray(r.value)?r.value.filter(m=>!V.isNil(m)).map(m=>m.id):r.value.id),c=t.computed(()=>wt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue,void 0,r.disabledItem)),d=t.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=m=>{var g;if(V.isArray(m)){const b=m.length>0?m.map(y=>{var _;return(_=c.value.find(x=>x.value===y))==null?void 0:_.item}).filter(y=>!V.isNil(y)):[];o("update:value",b)}else{const b=m===a.id||V.isNil(m)||(g=c.value.find(y=>y.value===m))==null?void 0:g.item;o("update:value",b)}},f=t.useTemplateRef("select-component");return e({focus:()=>{var m;return(m=f.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=f.value)==null?void 0:m.blur()}}),(m,g)=>(t.openBlock(),t.createBlock(t.unref(I.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":n.consistentMenuWidth,disabled:n.disabled||c.value.length===0,filterable:n.filterable,"max-tag-count":n.maxTagCount,multiple:s.value,options:d.value,placeholder:"",class:"w-full","onUpdate:value":u},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),ww={},xw=t.defineComponent({...ww,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{},m2ReferenceProduct:{},disabledCoefficient:{type:Function},visibleCoefficient:{type:Function}},emits:["update:value"],setup(n,{emit:e}){var E,P;const i=n,r=e,o=()=>{const F=W.PriceCoefficient.getRetailPriceCoefficient();return V.unset(F,"isNewRec"),F},s=F=>!F||F.id===o().id,a=t.computed(()=>{var F;return((F=i.catalogItem)==null?void 0:F.type)==="product"}),l=t.computed(()=>!a.value&&!V.isNil(i.m2ReferenceProduct)),c=t.computed(()=>a.value?i.catalogItem:i.m2ReferenceProduct),d=t.computed(()=>!V.isNil(c.value)),u=t.computed(()=>{var F;return`${((F=c.value)==null?void 0:F.currency.symbol)??""}${l.value?"/м²":""}`}),f=F=>l.value&&i.m2ReferenceProduct?vi.toM2Cost(F,i.m2ReferenceProduct):F,h=t.computed(()=>c.value?f(c.value.retailCost??c.value.cost):void 0),p=t.computed(()=>{var F;return(((F=c.value)==null?void 0:F.priceCoefficients)??[]).map(R=>({...R,cost:f(R.cost)}))}),m=F=>{var R;return F.id===o().id?h.value:(R=p.value.find(M=>M.coefficient.id===F.id))==null?void 0:R.cost},g=t.computed(()=>{var M;const R=[...((M=W.useReferencesStore().priceCoefficientsReference)==null?void 0:M.map(X=>structuredClone(t.toRaw(X))))??[],o()].filter(X=>{var G;return((G=i.visibleCoefficient)==null?void 0:G.call(i,X))??!0});return d.value&&R.forEach(X=>{const G=m(X);G?X.name+=` (${V.round(G,2)} ${u.value})`:X.name=""}),R.filter(X=>X.name!=="")}),b=t.ref(i.value.coefficient),y=t.ref(((P=(E=i.value)==null?void 0:E.value)==null?void 0:P.toString())??null),_=t.ref(null),x=t.computed(()=>p.value.find(F=>F.coefficient.slug===W.PriceCoefficientEnum.K0)),w=t.ref(void 0),C=F=>Number.parseFloat((F??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),N=()=>{var R,M;w.value=void 0;let F=C(y.value);if(F=Number.isNaN(F)?void 0:F,d.value)if(b.value||y.value){const X=o(),G=m(b.value??X)??0,Z=G+G*((F??0)/100);_.value=Ve.formatMoney(Z,(R=productData.value)==null?void 0:R.currency.precision),Z>(h.value??Z)&&(w.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),x.value&&Z<(((M=x.value)==null?void 0:M.cost)??0)&&(w.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else _.value=null;r("update:value",{value:Number.isNaN(F)?void 0:F,coefficient:s(b.value)?void 0:structuredClone(t.toRaw(b.value))})},k=F=>{V.isArray(F)||V.isNull(F)||(b.value=F,y.value=null,!b.value&&y.value&&(b.value=o()),N())},$=()=>{b.value||(b.value=o()),N()},v=F=>{var M,X;const R=C(F);if(d.value){if(Number.isNaN(R)){b.value=void 0,y.value=null,r("update:value",{value:void 0,coefficient:void 0});return}let G=0;if(R<=0)b.value=void 0,y.value=null;else if(x.value&&R<(((M=x.value)==null?void 0:M.cost)??0))b.value=(X=x.value)==null?void 0:X.coefficient,G=(R-x.value.cost)*100/x.value.cost,w.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(R>(h.value??R)){b.value=o();const Z=h.value??0;G=(R-Z)*100/Z,w.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const Z=p.value,O=V.sortBy(Z,[H=>H.cost]),Y=O.filter(H=>H.cost<=R).at(-1)??O.at(0);Y&&(b.value=Y.coefficient,G=(R-Y.cost)*100/Y.cost),w.value={validationStatus:void 0,feedback:void 0}}G=Ve.roundPercent(G),y.value=Ve.formatPercent(G,Ve.percentFractionDigits),r("update:value",{value:Number.isNaN(G)?void 0:G,coefficient:s(b.value)?void 0:structuredClone(t.toRaw(b.value))})}else r("update:value",{value:Number.isNaN(R)?void 0:R,coefficient:void 0})};return t.onMounted(()=>{var F,R,M,X;i.calculationType===W.CalculationTypeEnum.m2Cost?_.value=((R=(F=i.value)==null?void 0:F.value)==null?void 0:R.toString())??null:!((M=i.value)!=null&&M.coefficient)&&((X=i.value)!=null&&X.value)&&(b.value=o()),N()}),(F,R)=>{var G,Z,O;const M=I.NInput,X=I.NInputGroup;return t.openBlock(),t.createBlock(t.unref(I.NFormItem),{"show-label":!t.unref(V.isNil)(n.label),label:n.label,"show-feedback":!t.unref(V.isNil)(((G=w.value)==null?void 0:G.feedback)??n.feedback),feedback:((Z=w.value)==null?void 0:Z.feedback)??n.feedback,"validation-status":((O=w.value)==null?void 0:O.validationStatus)??n.validationStatus},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass([{"sm:grid-cols-3":d.value},"grid w-full grid-cols-1 gap-2"])},[n.calculationType!==t.unref(W.CalculationTypeEnum).m2Cost?(t.openBlock(),t.createBlock(X,{key:0,class:t.normalizeClass(["w-full flex-row",{"sm:col-span-2":d.value}])},{default:t.withCtx(()=>[t.createVNode(tf,{class:"w-full min-w-0 flex-1",value:b.value,"reference-list":g.value,clearable:n.clearable,disabled:n.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"disabled-item":n.disabledCoefficient,"onUpdate:value":k},null,8,["value","reference-list","clearable","disabled","disabled-item"]),t.createVNode(M,{value:y.value,"onUpdate:value":[R[0]||(R[0]=A=>y.value=A),$],clearable:n.clearable,disabled:n.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},t.createSlots({suffix:t.withCtx(()=>[R[3]||(R[3]=t.createTextVNode("%",-1))]),_:2},[y.value&&!y.value.startsWith("-")?{name:"prefix",fn:t.withCtx(()=>[R[2]||(R[2]=t.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):t.createCommentVNode("",!0),d.value||n.calculationType===t.unref(W.CalculationTypeEnum).m2Cost?(t.openBlock(),t.createBlock(M,{key:1,value:_.value,"onUpdate:value":[R[1]||(R[1]=A=>_.value=A),v],clearable:n.clearable,disabled:n.disabled,placeholder:l.value?"Стоимость за м²":"Стоимость",class:"w-full"},t.createSlots({_:2},[d.value?{name:"suffix",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(u.value),1)]),key:"0"}:void 0]),1032,["value","clearable","disabled","placeholder"])):t.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),kw={class:"text-sm"},Cw={class:"text-sm"},vw={},Sw=t.defineComponent({...vw,__name:"add-product-to-cart-dialog",emits:["submit"],setup(n,{expose:e,emit:i}){const r=t.useTemplateRef("form-reference"),o=t.useTemplateRef("base-dialog-reference"),s=t.ref(!1),a=t.ref(null),l=t.computed(()=>{var R,M,X;return((R=a.value)==null?void 0:R.unit.isLinear)&&((X=(M=a.value)==null?void 0:M.properties)==null?void 0:X.isLengthConfigurator)}),c=t.computed(()=>a.value?W.UnitsHelper.productIsMeasurable(a.value)||l.value?"шт.":a.value.unit.name:"шт."),d=t.ref(void 0),u=t.ref(void 0),f=t.ref(!0),h=t.ref(null),p=t.computed({get:()=>{var R;return((R=h.value)==null?void 0:R.quantity)??null},set:R=>{h.value&&(h.value.quantity=R??0)}}),m=t.computed({get:()=>{var R;return((R=h.value)==null?void 0:R.length)??null},set:R=>{h.value&&(h.value.length=R??void 0)}}),g=R=>{h.value&&(h.value.marker=R??void 0)},b=i,y=()=>({length:{},quantity:{},marker:{}}),_=t.ref(y()),x=t.ref(!1),w=t.computed(()=>{var Z,O,A,Y;if(!a.value)return{};const R=W.UnitsHelper.getProductLengthMultiplicity(a.value),M=W.UnitsHelper.getProductMultiplicity(a.value),X=((O=(Z=a.value)==null?void 0:Z.properties)==null?void 0:O.minLength)||R,G=(Y=(A=a.value)==null?void 0:A.properties)==null?void 0:Y.maxLength;return{length:[ce.required,ce.min(X??.1),ce.max(G),ce.step(R),We.serverValidation(_.value.length.feedback)],quantity:[ce.required,ce.min(M),ce.step(M),We.serverValidation(_.value.quantity.feedback)],marker:[We.serverValidation(_.value.marker.feedback)]}}),C=t.computed(()=>{var R,M,X;return a.value?((R=a.value.properties)==null?void 0:R.lengthStep)??((M=a.value.properties)!=null&&M.ignoreMinCountCheck?0:((X=a.value.properties)==null?void 0:X.minCount)??0):0}),N=t.computed(()=>{var X,G,Z,O,A,Y,H,T,D;if(!a.value)return"";const R=((G=(X=a.value)==null?void 0:X.properties)==null?void 0:G.minLength)??((O=(Z=a.value)==null?void 0:Z.properties)!=null&&O.ignoreMinCountCheck?0:(Y=(A=a.value)==null?void 0:A.properties)==null?void 0:Y.minCount),M=(T=(H=a.value)==null?void 0:H.properties)==null?void 0:T.maxLength;return R||M?`(${R?`от ${R}`:""}${R&&M?" ":""}${M?`до ${M}`:""} ${(D=a.value)==null?void 0:D.unit.name})`:""}),k=R=>{var O,A;if(!((A=(O=a.value)==null?void 0:O.properties)!=null&&A.isLengthConfigurator)||!h.value||V.isNil(R)||C.value===0)return;const M=R/C.value,X=Math.round(M),G=W.UnitsHelper.getProductMultiplicity(a.value),Z=Math.max(X,G);h.value.quantity=Z},$=R=>{var Z,O,A,Y;if(!((O=(Z=a.value)==null?void 0:Z.properties)!=null&&O.isLengthConfigurator)||!h.value||V.isNil(R)||C.value===0)return;const M=Ve.multiplyByStep(R,C.value),X=((A=a.value.properties)==null?void 0:A.minLength)||W.UnitsHelper.getProductLengthMultiplicity(a.value),G=(Y=a.value.properties)==null?void 0:Y.maxLength;X!==void 0&&M<X?h.value.length=X:G!==void 0&&M>G?h.value.length=G:h.value.length=M},v=async R=>{var X;const M=V.cloneDeep(h.value);try{await((X=r.value)==null?void 0:X.validate(G=>{if(!G){if(!a.value||!M)return;W.UnitsHelper.productIsMeasurable(a.value)||delete M.length,l.value&&C.value&&(M.length=C.value),x.value=!0,b("submit",M,_.value,()=>{x.value=!1,R(!1),t.nextTick(()=>{var Z;(Z=r.value)==null||Z.validate(V.noop).catch(V.noop)})})}}))}catch{}},E=()=>{a.value=null,d.value=void 0,h.value=null,_.value=y()},P=()=>{s.value=!1};return e({show:(R,M)=>{var X,G,Z,O,A;if(E(),s.value=!0,a.value=R,d.value=M==null?void 0:M.cartItemData,u.value=M==null?void 0:M.orderId,f.value=(M==null?void 0:M.canSetDopProdaga)??!1,h.value=new W.OrderItemBase((M==null?void 0:M.cartItemData)??new W.OrderItemBase({product:R,quantity:W.UnitsHelper.productIsMeasurable(a.value)?1:((X=R==null?void 0:R.properties)==null?void 0:X.minCount)??1,length:((G=R==null?void 0:R.properties)==null?void 0:G.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})),(A=R==null?void 0:R.properties)!=null&&A.isLengthConfigurator&&h.value&&C.value>0){const Y=C.value,H=h.value.quantity||1;h.value.length=Ve.multiplyByStep(H,Y)}},closeDialog:P}),(R,M)=>{var A;const X=I.NFormItem,G=I.NInputGroupLabel,Z=I.NInputGroup,O=I.NCheckbox;return t.openBlock(),t.createBlock(Os,{ref:"base-dialog-reference",show:s.value,title:`${d.value?"Изменение":"Добавление"} товара ${(A=a.value)==null?void 0:A.name} в ${u.value?` заказ №${u.value}`:"корзину"}`,"accept-button":{show:!0,text:d.value?"Изменить":"Добавить"},processing:x.value,"modal-width":500,onAccept:v,onClosing:P},{default:t.withCtx(()=>[a.value&&h.value?t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{key:0,ref:"form-reference",model:h.value,rules:w.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>[t.unref(W.UnitsHelper).productIsMeasurable(a.value)?(t.openBlock(),t.createBlock(X,{key:0,path:"length",label:`Метраж, ${N.value+a.value.unit.name}`},t.createSlots({default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:m.value,"onUpdate:value":[M[0]||(M[0]=Y=>m.value=Y),k],parse:t.unref(ht),step:t.unref(W.UnitsHelper).getProductLengthMultiplicity(a.value),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:M[1]||(M[1]=Y=>t.unref(fo)(Y,".",!1)),onInput:M[2]||(M[2]=Y=>t.unref(dt)(_.value,"length")),onFocus:t.unref(He)},null,8,["value","parse","step","onFocus"])]),_:2},[!_.value.length.feedback&&t.unref(W.UnitsHelper).getProductLengthMultiplicity(a.value)!==1?{name:"feedback",fn:t.withCtx(()=>[t.createElementVNode("span",kw,"Метраж должно быть кратно "+t.toDisplayString(t.unref(W.UnitsHelper).getProductLengthMultiplicity(a.value)),1)]),key:"0"}:void 0]),1032,["label"])):t.createCommentVNode("",!0),t.createVNode(X,{path:"quantity",label:`Количество, ${c.value}`},{default:t.withCtx(()=>[t.createVNode(Z,null,t.createSlots({default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:p.value,"onUpdate:value":[M[3]||(M[3]=Y=>p.value=Y),$],parse:t.unref(ht),step:t.unref(W.UnitsHelper).getProductMultiplicity(a.value),"show-button":t.unref(W.UnitsHelper).getProductMultiplicity(a.value)>1,"button-placement":"both",placeholder:"Введите количество",class:"w-full",onKeydown:M[4]||(M[4]=Y=>t.unref(fo)(Y,".",!1)),onInput:M[5]||(M[5]=Y=>t.unref(dt)(_.value,"quantity")),onFocus:t.unref(He)},null,8,["value","parse","step","show-button","onFocus"]),l.value?(t.openBlock(),t.createBlock(G,{key:0,class:"bg-orange-100 font-bold"},{default:t.withCtx(()=>[t.createTextVNode(" x "+t.toDisplayString(C.value)+" "+t.toDisplayString(a.value.unit.name),1)]),_:1})):t.createCommentVNode("",!0)]),_:2},[!_.value.quantity.feedback&&t.unref(W.UnitsHelper).getProductMultiplicity(a.value)!==1?{name:"feedback",fn:t.withCtx(()=>[t.createElementVNode("span",Cw,"Количество должно быть кратно "+t.toDisplayString(t.unref(W.UnitsHelper).getProductMultiplicity(a.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),t.unref(W.UnitsHelper).productIsMeasurable(a.value)?(t.openBlock(),t.createBlock(X,{key:1,path:"marker",label:"Маркировка"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:M[6]||(M[6]=Y=>t.unref(dt)(_.value,"marker")),"onUpdate:value":M[7]||(M[7]=Y=>g(Y)),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1})):t.createCommentVNode("",!0),f.value?(t.openBlock(),t.createBlock(O,{key:2,checked:h.value.isAdditionalSale,"onUpdate:checked":M[8]||(M[8]=Y=>h.value.isAdditionalSale=Y),"true-value":!0,"false-value":!1},{default:t.withCtx(()=>[...M[9]||(M[9]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0)]),_:1},8,["model","rules"])),[[t.unref(ai),()=>{var Y,H;return(H=(Y=o.value)==null?void 0:Y.acceptHandler)==null?void 0:H.call(Y)}]]):t.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),Bw={class:"flex flex-row gap-1"},Nw={class:"sc-client-name flex flex-col gap-1 text-base"},Tw=["href"],$w={key:1,class:"text-sc-grey"},Ew={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Rw={key:0},Pw={key:1,class:"text-sm"},Fw={},Dr=t.defineComponent({...Fw,__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(n,{emit:e}){const i=n,r=e,o=t.computed(()=>i.client.lastLoginAt?Ce.format(i.client.lastLoginAt,W.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=a=>{V.isNil(i.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",i.client,a)};return(a,l)=>{const c=ho,d=I.NButton,u=I.NPopover;return t.openBlock(),t.createElementBlock("div",Bw,[n.showClientInfoIcon?(t.openBlock(),t.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",n.client))},{default:t.withCtx(()=>[t.createVNode(c)]),_:1})):t.createCommentVNode("",!0),t.createVNode(u,{disabled:t.unref(V.isNil)(n.popoverPosition),placement:n.popoverPosition},{trigger:t.withCtx(()=>[t.createElementVNode("div",Nw,[t.createElementVNode("a",{href:n.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>s(f))},[t.createElementVNode("span",{class:t.normalizeClass({"line-through":!n.client.isActive})},t.toDisplayString(n.client.name),3),n.showSalesDirection&&n.client.salesDirection?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass({"line-through":!n.client.isActive})}," ("+t.toDisplayString(n.client.salesDirection.name)+") ",3)):t.createCommentVNode("",!0),n.client.isActive?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",$w," [ Деактивирован ] "))],8,Tw),n.showCityAndRegion&&n.client.city?(t.openBlock(),t.createElementBlock("span",Ew," г. "+t.toDisplayString(n.client.city.name)+", "+t.toDisplayString(n.client.city.region.name),1)):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[n.client.alternativeName?(t.openBlock(),t.createElementBlock("div",Rw,t.toDisplayString(n.client.alternativeName),1)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("span",Pw," Последний вход: "+t.toDisplayString(o.value),1)):t.createCommentVNode("",!0),t.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Vw={class:"text-base"},Mw={},nf=t.defineComponent({...Mw,__name:"contragent-with-short-info",props:{contragent:{}},setup(n){const e=n,i=t.computed(()=>li.getFormatEntityName(e.contragent));return(r,o)=>(t.openBlock(),t.createElementBlock("span",Vw,t.toDisplayString(i.value),1))}}),Iw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Aw(n,e){return t.openBlock(),t.createElementBlock("svg",Iw,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.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"}),t.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const Ow=t.markRaw({name:"tabler-mail",render:Aw}),zw=["href"],Dw={},Lw=t.defineComponent({...Dw,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(n){return(e,i)=>{const r=Ow;return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass({"flex flex-row items-center gap-1":n.showEmailIcon})},[n.showEmailIcon?(t.openBlock(),t.createBlock(r,{key:0})):t.createCommentVNode("",!0),t.createElementVNode("a",{href:`mailto:${n.email}`,class:"no-underline"},t.toDisplayString(n.email),9,zw)],2)}}}),Hw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ww(n,e){return t.openBlock(),t.createElementBlock("svg",Hw,[...e[0]||(e[0]=[t.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 rf=t.markRaw({name:"fa6-brands-viber",render:Ww}),jw={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},qw=["id"],Xw=["id"],Yw=["fill"],Uw=["fill"];function Kw(n,e){return t.openBlock(),t.createElementBlock("svg",jw,[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:n.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[t.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),t.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,qw),t.createElementVNode("linearGradient",{id:n.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[t.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),t.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,Xw)]),t.createElementVNode("path",{fill:"url(#"+n.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,Yw),t.createElementVNode("path",{fill:"url(#"+n.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,Uw),e[2]||(e[2]=t.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 of=t.markRaw({name:"logos-whatsapp-icon",render:Kw,setup(){const n=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+n(),SVGHW6lecxh:"uicons-"+n()}}}}),Gw={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},Zw=["id"],Qw=["fill"];function Jw(n,e){return t.openBlock(),t.createElementBlock("svg",Gw,[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:n.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[t.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),t.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,Zw)]),t.createElementVNode("path",{fill:"url(#"+n.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,Qw),e[1]||(e[1]=t.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 sf=t.markRaw({name:"logos-telegram",render:Jw,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),ex={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tx(n,e){return t.openBlock(),t.createElementBlock("svg",ex,[...e[0]||(e[0]=[t.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 af=t.markRaw({name:"ion-call",render:tx}),nx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ix(n,e){return t.openBlock(),t.createElementBlock("svg",nx,[...e[0]||(e[0]=[t.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 rx=t.markRaw({name:"tabler-phone-call",render:ix}),ox={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},sx=["href"],ax=["href"],lx=["href"],cx=["href"],dx={},ux=t.defineComponent({...dx,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(n){const e=n,i=t.computed(()=>{try{return e.phone?Br.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=t.computed(()=>{var l;return V.isString(i.value)?!1:((l=i.value)==null?void 0:l.isValid())??!1}),o=t.computed(()=>{var l;return V.isString(i.value)?i.value:((l=i.value)==null?void 0:l.format("INTERNATIONAL"))??""}),s=t.computed(()=>{var l;return V.isString(i.value)?i.value:((l=i.value)==null?void 0:l.format("E.164"))??""}),a=t.ref(!1);return(l,c)=>{const d=rx,u=af,f=sf,h=of,p=rf;return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{class:t.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=m=>a.value=!a.value),onFocusout:c[1]||(c[1]=m=>a.value=!1),onMouseleave:c[2]||(c[2]=m=>a.value=!1)},[t.createElementVNode("div",{class:t.normalizeClass({"flex flex-row items-center gap-1":n.showPhoneIcon})},[n.showPhoneIcon?(t.openBlock(),t.createBlock(d,{key:0})):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.value),1)],2),r.value&&a.value?(t.openBlock(),t.createElementBlock("div",ox,[r.value?(t.openBlock(),t.createElementBlock("a",{key:0,href:`tel:${s.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[t.createVNode(u)],8,sx)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock("a",{key:1,href:`https://t.me/${s.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[t.createVNode(f)],8,ax)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock("a",{key:2,href:`https://wa.me/${s.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[t.createVNode(h)],8,lx)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock("a",{key:3,href:`viber://chat?number=${s.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[t.createVNode(p)],8,cx)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],34)])}}}),fx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hx(n,e){return t.openBlock(),t.createElementBlock("svg",fx,[...e[0]||(e[0]=[t.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 mx=t.markRaw({name:"mdi-envelope",render:hx}),px={class:"flex flex-col gap-1"},gx={key:0,class:"mb-2 flex flex-col text-base"},yx={key:0,class:"text-sc-dark-grey text-sm"},bx={key:1,class:"whitespace-nowrap text-sm"},_x={key:2,class:"whitespace-nowrap text-sm"},wx={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},xx=["href"],kx=["href"],Cx=["href"],vx=["href"],Sx=["href"],Bx={key:0,class:"flex flex-col text-base"},Nx={key:0,class:"text-sc-dark-grey text-sm"},Tx={key:1,class:"mt-2 text-sm"},$x={key:0,class:"-mt-1"},Ex={},Rx=t.defineComponent({...Ex,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(n){const e=n,i=t.computed(()=>li.getFormatEntityName(e.contact)),r=t.computed(()=>{try{return e.contact.phone?Br.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),o=t.computed(()=>{var d;return V.isString(r.value)?!1:((d=r.value)==null?void 0:d.isValid())??!1}),s=t.computed(()=>{var d;return V.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("INTERNATIONAL"))??""}),a=t.computed(()=>{var d;return V.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("E.164"))??""}),l=t.computed(()=>o.value||e.contact.email),c=t.ref(!1);return(d,u)=>{var y,_;const f=af,h=sf,p=of,m=rf,g=mx,b=I.NPopover;return t.openBlock(),t.createElementBlock("div",px,[t.createVNode(b,{disabled:n.fullView,placement:"bottom"},{trigger:t.withCtx(()=>{var x,w,C,N;return[t.createElementVNode("div",{class:t.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(x=n.contact)!=null&&x.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${n.classes}`),style:t.normalizeStyle(n.styles),onMouseenter:u[0]||(u[0]=k=>c.value=!0),onFocusin:u[1]||(u[1]=k=>c.value=!0),onMouseleave:u[2]||(u[2]=k=>c.value=!1),onFocusout:u[3]||(u[3]=k=>c.value=!1)},[t.createElementVNode("div",null,[n.fullView&&(n.contact.name||(w=n.contact)!=null&&w.position)?(t.openBlock(),t.createElementBlock("div",gx,[t.createTextVNode(t.toDisplayString(i.value)+" ",1),(C=n.contact)!=null&&C.position?(t.openBlock(),t.createElementBlock("span",yx,t.toDisplayString((N=n.contact)==null?void 0:N.position),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),n.contact.phone?(t.openBlock(),t.createElementBlock("div",bx,t.toDisplayString(s.value),1)):t.createCommentVNode("",!0),n.contact.email?(t.openBlock(),t.createElementBlock("div",_x,t.toDisplayString(n.contact.email),1)):t.createCommentVNode("",!0),l.value&&c.value?(t.openBlock(),t.createElementBlock("div",wx,[o.value?(t.openBlock(),t.createElementBlock("a",{key:0,href:`tel:${a.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[t.createVNode(f)],8,xx)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("a",{key:1,href:`https://t.me/${a.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[t.createVNode(h)],8,kx)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("a",{key:2,href:`https://wa.me/${a.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[t.createVNode(p)],8,Cx)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("a",{key:3,href:`viber://chat?number=${a.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[t.createVNode(m)],8,vx)):t.createCommentVNode("",!0),n.contact.email?(t.openBlock(),t.createElementBlock("a",{key:4,href:`mailto:${n.contact.email}`,class:"hover:text-3xl"},[t.createVNode(g)],8,Sx)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])],38)]}),default:t.withCtx(()=>{var x,w,C,N;return[n.contact.name?(t.openBlock(),t.createElementBlock("div",Bx,[t.createTextVNode(t.toDisplayString(i.value)+" ",1),(x=n.contact)!=null&&x.position?(t.openBlock(),t.createElementBlock("span",Nx,t.toDisplayString((w=n.contact)==null?void 0:w.position),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),(C=n.contact)!=null&&C.comment?(t.openBlock(),t.createElementBlock("div",Tx,[u[4]||(u[4]=t.createElementVNode("sup",null,"**",-1)),t.createTextVNode(" "+t.toDisplayString((N=n.contact)==null?void 0:N.comment),1)])):t.createCommentVNode("",!0)]}),_:1},8,["disabled"]),n.fullView&&((y=n.contact)!=null&&y.comment)?(t.openBlock(),t.createElementBlock("div",$x,[u[5]||(u[5]=t.createElementVNode("sup",null,"**",-1)),t.createTextVNode(" "+t.toDisplayString((_=n.contact)==null?void 0:_.comment),1)])):t.createCommentVNode("",!0)])}}});class Px{constructor(e){B(this,"minHeight");B(this,"maxHeights");B(this,"minWidth");B(this,"maxWidths");B(this,"netType");B(this,"color");B(this,"mountType");B(this,"descriptions");B(this,"crossbarCount");B(this,"heightOverlaps");B(this,"widthOverlaps");B(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Ns.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=Ns.objectToSnake(e.heightOverlaps),this.widthOverlaps=Ns.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function Fx(n){var e;return((e=n.properties)==null?void 0:e.configurator)!==W.ConfiguratorsEnum.SandwichM2?!0:n.properties.configuratorSettings!==void 0&&V.isArray(n.products)&&n.products.length>0}const Vx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mx(n,e){return t.openBlock(),t.createElementBlock("svg",Vx,[...e[0]||(e[0]=[t.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 Ix=t.markRaw({name:"mdi-dots-horizontal",render:Mx}),Ax={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ox(n,e){return t.openBlock(),t.createElementBlock("svg",Ax,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5A6.5 6.5 0 0 0 9.5 3A6.5 6.5 0 0 0 3 9.5A6.5 6.5 0 0 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5l1.5-1.5zm-6 0C7 14 5 12 5 9.5S7 5 9.5 5S14 7 14 9.5S12 14 9.5 14M7 9h5v1H7z"},null,-1)])])}const zx=t.markRaw({name:"mdi-magnify-minus-outline",render:Ox}),Dx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Lx(n,e){return t.openBlock(),t.createElementBlock("svg",Dx,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"m15.5 14l5 5l-1.5 1.5l-5-5v-.79l-.27-.28A6.47 6.47 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27zm-6 0C12 14 14 12 14 9.5S12 5 9.5 5S5 7 5 9.5S7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z"},null,-1)])])}const Hx=t.markRaw({name:"mdi-magnify-plus-outline",render:Lx}),Wx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jx(n,e){return t.openBlock(),t.createElementBlock("svg",Wx,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z"},null,-1)])])}const lf=t.markRaw({name:"mdi-chevron-right",render:jx}),qx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xx(n,e){return t.openBlock(),t.createElementBlock("svg",qx,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z"},null,-1)])])}const cf=t.markRaw({name:"mdi-chevron-left",render:Xx}),Yx={heightMedium:"40px",paddingMedium:"0 16px",borderRadiusMedium:"10px",fontSizeMedium:"14px",iconSizeMedium:"18px",iconMarginMedium:"8px",border:"1px solid #d1d5db",borderHover:"1px solid #9ca3af",borderPressed:"1px solid #9ca3af",borderFocus:"1px solid #9ca3af"},Lr={heightSmall:"36px",paddingSmall:"0 10px",borderRadiusSmall:"8px",iconSizeSmall:"18px",border:"1px solid #d1d5db",borderHover:"1px solid #9ca3af",borderPressed:"1px solid #9ca3af",borderFocus:"1px solid #9ca3af"},df="date-range.dialog.mode",uf="date-range.dialog.scale",ff="date-range.quick-periods",hf=["thisMonth","lastMonth","thisQuarter","lastQuarter","thisYear","lastYear","fromBeginningOfThisYear"],mf=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Ux=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Kx=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],pf=new Date(2e3,0,1),Ri=n=>Ce.differenceInCalendarDays(n,pf),gf=n=>Ce.addDays(pf,n),yf=(n,e,i)=>{let r=n??void 0,o=e??void 0;return r&&o&&r>o&&(i!=null&&i.from?o=r:i!=null&&i.to?r=o:[r,o]=[o,r]),{from:r?Ce.startOfDay(r):void 0,to:o?Ce.endOfDay(o):void 0}},Aa=n=>Object.entries(n).map(([e,i])=>({value:e,label:i.label,item:i})),bf=(n,e)=>{const i=Object.entries(n).filter(([,r])=>r.group===e);return e!=="other"?[{type:"group",key:e,children:Aa(Object.fromEntries(i))}]:W.STANDARD_PERIOD_SECTIONS.map(r=>{const o=i.filter(([,s])=>s.section===r.key);return{type:"group",key:r.key,label:r.label,children:Aa(Object.fromEntries(o))}}).filter(r=>r.children.length>0)},_f=(n,e)=>{const i=t.ref(null),r=t.ref(null),o=t.ref(!1),s=t.ref(null),a=(g,b)=>g<=b?[g,b]:[b,g],l=t.computed(()=>o.value&&r.value!==null&&s.value!==null?a(r.value,s.value):i.value!==null?s.value===null?[i.value,i.value]:a(i.value,s.value):n.value),c=(g,b)=>{i.value=null,e(...a(g,b))},d=g=>{i.value===null?(i.value=g,e(g,g)):c(i.value,g)},u=()=>{globalThis.removeEventListener("pointerup",u);const g=r.value;if(g!==null){if(r.value=null,o.value){o.value=!1,s.value!==null&&c(g,s.value);return}d(g)}},f=g=>{r.value=g,o.value=!1,globalThis.addEventListener("pointerup",u)},h=g=>{s.value=g,r.value!==null&&g!==r.value&&(o.value=!0)},p=()=>{s.value=null},m=g=>{const b=l.value;return!b||g<b[0]||g>b[1]?null:g===b[0]||g===b[1]?"bound":"in-range"};return t.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",u)}),{activeRange:l,cellPosition:m,pointerDownHandler:f,pointerEnterHandler:h,pointerLeaveHandler:p,selectHandler:d}},Gx={class:"flex items-center justify-between gap-2"},Zx={class:"flex items-center gap-2"},Qx={class:"text-center font-semibold"},Jx={class:"grid grid-cols-7 gap-0.5 text-center text-xs text-gray-500"},ek={class:"grid grid-cols-7 gap-0.5"},tk=["disabled","onPointerdown","onPointerenter","onKeydown"],nk={},ik=t.defineComponent({...nk,__name:"day-range-grid",props:{from:{},to:{}},emits:["select"],setup(n,{emit:e}){const i=n,r=e,o=42,s=I.useThemeVars(),a=t.computed(()=>({"--sc-primary-color":s.value.primaryColor,"--sc-primary-color-hover":s.value.primaryColorHover,"--sc-primary-color-suppl":s.value.primaryColorSuppl,"--sc-hover-color":s.value.hoverColor})),l=Ue.initRefDependingOnDeviceResolution(1,2,3),c=t.computed(()=>["grid-cols-1","grid-cols-2","grid-cols-3"][l.value-1]),d=y=>Ce.subMonths(Ce.startOfMonth(y),l.value===3?1:0),u=y=>y&&Ce.isValid(y)?y:new Date,f=t.ref(d(u(i.from??i.to))),h=t.computed(()=>{const{from:y,to:_}=i;return!y||!_||!Ce.isValid(y)||!Ce.isValid(_)?null:[Ri(y),Ri(_)]}),p=_f(h,(y,_)=>{r("select",{from:Ce.startOfDay(gf(y)),to:Ce.endOfDay(gf(_))})}),m=y=>{const _=Ce.subDays(y,(Ce.getDay(y)+6)%7);return V.times(o,x=>{const w=Ce.addDays(_,x);return{index:Ri(w),day:w.getDate(),isCurrentMonth:Ce.isSameMonth(w,y),isToday:Ce.isToday(w)}})},g=t.computed(()=>V.times(l.value,y=>{const _=Ce.addMonths(f.value,y);return{key:`${_.getFullYear()}-${_.getMonth()}`,title:`${Ux[_.getMonth()]} ${_.getFullYear()}`,cells:m(_)}})),b=y=>{if(!y.isCurrentMonth)return["sc-day--outside"];const _=y.isToday?["sc-day--today"]:[],x=p.cellPosition(y.index);return x&&_.push(`sc-day--${x}`),_};return t.watch(()=>[i.from,i.to],()=>{const y=i.from??i.to;if(!y||!Ce.isValid(y))return;const _=`${y.getFullYear()}-${y.getMonth()}`;V.some(g.value,["key",_])||(f.value=d(y))}),(y,_)=>{const x=cf,w=I.NButton,C=lf;return t.openBlock(),t.createElementBlock("div",{class:"flex select-none flex-col gap-3",style:t.normalizeStyle(a.value),onPointerleave:_[2]||(_[2]=(...N)=>t.unref(p).pointerLeaveHandler&&t.unref(p).pointerLeaveHandler(...N))},[t.createElementVNode("div",Gx,[t.createVNode(w,{size:"small","aria-label":"Предыдущий месяц","theme-overrides":t.unref(Lr),onClick:_[0]||(_[0]=N=>f.value=t.unref(Ce.subMonths)(f.value,1))},{icon:t.withCtx(()=>[t.createVNode(x)]),_:1},8,["theme-overrides"]),_[3]||(_[3]=t.createElementVNode("span",{class:"text-sm text-gray-600"},"Выберите диапазон на календаре",-1)),t.createElementVNode("div",Zx,[t.renderSlot(y.$slots,"actions",{},void 0,!0),t.createVNode(w,{size:"small","aria-label":"Следующий месяц","theme-overrides":t.unref(Lr),onClick:_[1]||(_[1]=N=>f.value=t.unref(Ce.addMonths)(f.value,1))},{icon:t.withCtx(()=>[t.createVNode(C)]),_:1},8,["theme-overrides"])])]),t.createElementVNode("div",{class:t.normalizeClass(["grid gap-3",c.value])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.value,N=>(t.openBlock(),t.createElementBlock("div",{key:N.key,class:"flex flex-col gap-1"},[t.createElementVNode("div",Qx,t.toDisplayString(N.title),1),t.createElementVNode("div",Jx,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Kx),k=>(t.openBlock(),t.createElementBlock("span",{key:k},t.toDisplayString(k),1))),128))]),t.createElementVNode("div",ek,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(N.cells,k=>(t.openBlock(),t.createElementBlock("button",{key:k.index,type:"button",class:t.normalizeClass(["sc-day h-7 rounded border-0 p-0 text-xs",b(k)]),disabled:!k.isCurrentMonth,onPointerdown:t.withModifiers($=>t.unref(p).pointerDownHandler(k.index),["prevent"]),onPointerenter:$=>t.unref(p).pointerEnterHandler(k.index),onKeydown:[t.withKeys(t.withModifiers($=>t.unref(p).selectHandler(k.index),["prevent"]),["enter"]),t.withKeys(t.withModifiers($=>t.unref(p).selectHandler(k.index),["prevent"]),["space"])]},t.toDisplayString(k.day),43,tk))),128))])]))),128))],2),_[4]||(_[4]=t.createStaticVNode('<div class="flex flex-wrap items-center gap-x-6 gap-y-1 text-xs text-gray-700" data-v-a41e813d><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--bound" data-v-a41e813d></i>Дата начала</span><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--in-range" data-v-a41e813d></i>Выбранный период</span><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--bound" data-v-a41e813d></i>Дата окончания</span></div>',1))],36)}}}),rk=gn(ik,[["__scopeId","data-v-a41e813d"]]),ok={class:"flex items-center justify-between gap-2"},sk={class:"flex items-center gap-2"},ak={class:"text-center font-semibold"},lk={class:"grid grid-cols-3 gap-2"},ck=["onPointerdown","onPointerenter","onKeydown"],dk={},uk=t.defineComponent({...dk,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(n,{emit:e}){const i=n,r=e,o=I.useThemeVars(),s=t.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=p=>{const m=new Date().getFullYear();return p&&Ce.isValid(p)?p.getFullYear():m},l=t.ref(a(i.from??i.to)),c=Ue.initRefDependingOnDeviceResolution(1,3,3),d=t.computed(()=>c.value===1?[l.value]:[l.value-1,l.value,l.value+1]),u=t.computed(()=>{const{from:p,to:m}=i;return!p||!m||!Ce.isValid(p)||!Ce.isValid(m)?null:[p.getFullYear()*12+p.getMonth(),m.getFullYear()*12+m.getMonth()]}),f=_f(u,(p,m)=>{r("select",{from:new Date(Math.floor(p/12),p%12,1),to:Ce.endOfMonth(new Date(Math.floor(m/12),m%12,1))})}),h=(p,m)=>{const g=f.cellPosition(p*12+m);return g?[`sc-month--${g}`]:[]};return t.watch(()=>[i.from,i.to],()=>{const p=i.from??i.to;if(!p||!Ce.isValid(p))return;const m=p.getFullYear();(m<l.value-1||m>l.value+1)&&(l.value=m)}),(p,m)=>{const g=cf,b=I.NButton,y=lf;return t.openBlock(),t.createElementBlock("div",{class:"flex select-none flex-col gap-3",style:t.normalizeStyle(s.value),onPointerleave:m[2]||(m[2]=(..._)=>t.unref(f).pointerLeaveHandler&&t.unref(f).pointerLeaveHandler(..._))},[t.createElementVNode("div",ok,[t.createVNode(b,{size:"small","aria-label":"Предыдущий год","theme-overrides":t.unref(Lr),onClick:m[0]||(m[0]=_=>l.value-=1)},{icon:t.withCtx(()=>[t.createVNode(g)]),_:1},8,["theme-overrides"]),m[3]||(m[3]=t.createElementVNode("span",{class:"text-sm text-gray-600"},"Выберите диапазон месяцев",-1)),t.createElementVNode("div",sk,[t.renderSlot(p.$slots,"actions",{},void 0,!0),t.createVNode(b,{size:"small","aria-label":"Следующий год","theme-overrides":t.unref(Lr),onClick:m[1]||(m[1]=_=>l.value+=1)},{icon:t.withCtx(()=>[t.createVNode(y)]),_:1},8,["theme-overrides"])])]),t.createElementVNode("div",{class:t.normalizeClass(["grid gap-4 sm:gap-6",d.value.length===1?"grid-cols-1":"grid-cols-3"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,_=>(t.openBlock(),t.createElementBlock("div",{key:_,class:"flex flex-col gap-2"},[t.createElementVNode("div",ak,t.toDisplayString(_),1),t.createElementVNode("div",lk,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(mf),(x,w)=>(t.openBlock(),t.createElementBlock("button",{key:x,type:"button",class:t.normalizeClass(["sc-month cursor-pointer rounded-lg px-1 py-2.5 text-sm",h(_,w)]),onPointerdown:t.withModifiers(C=>t.unref(f).pointerDownHandler(_*12+w),["prevent"]),onPointerenter:C=>t.unref(f).pointerEnterHandler(_*12+w),onKeydown:[t.withKeys(t.withModifiers(C=>t.unref(f).selectHandler(_*12+w),["prevent"]),["enter"]),t.withKeys(t.withModifiers(C=>t.unref(f).selectHandler(_*12+w),["prevent"]),["space"])]},t.toDisplayString(x),43,ck))),128))])]))),128))],2)],36)}}}),fk=gn(uk,[["__scopeId","data-v-dd09a19d"]]),hk={class:"sc-date-range-sidebar flex flex-col gap-1"},mk={class:"flex items-center justify-center gap-1"},pk={class:"min-w-12 text-center font-semibold"},gk={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},yk={},bk=t.defineComponent({...yk,__name:"month-year-sidebar",props:{year:{},month:{}},emits:["update:year","select-month","today"],setup(n,{emit:e}){const i=e;return(r,o)=>{const s=I.NButton;return t.openBlock(),t.createElementBlock("div",hk,[t.createElementVNode("div",mk,[t.createVNode(s,{size:"small",quaternary:"",onClick:o[0]||(o[0]=a=>i("update:year",n.year-1))},{default:t.withCtx(()=>[...o[3]||(o[3]=[t.createTextVNode(" ‹ ",-1)])]),_:1}),t.createElementVNode("span",pk,t.toDisplayString(n.year),1),t.createVNode(s,{size:"small",quaternary:"",onClick:o[1]||(o[1]=a=>i("update:year",n.year+1))},{default:t.withCtx(()=>[...o[4]||(o[4]=[t.createTextVNode(" › ",-1)])]),_:1})]),t.createElementVNode("div",gk,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(mf),(a,l)=>(t.openBlock(),t.createBlock(s,{key:a,size:"small",quaternary:"",type:l===n.month?"primary":"default",onClick:c=>i("select-month",l)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a),1)]),_:2},1032,["type","onClick"]))),128))]),t.createVNode(s,{size:"small",text:"",type:"info",onClick:o[2]||(o[2]=a=>i("today"))},{default:t.withCtx(()=>[...o[5]||(o[5]=[t.createTextVNode(" Сегодня ",-1)])]),_:1})])}}}),_k={},wf=t.defineComponent({..._k,__name:"date-range-input",props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>W.useBaseConfigStateStore().config.dateFormats.uiDate}},emits:["update:value"],setup(n,{emit:e}){const i=n,r=e,o=Ue.initRefDependingOnDeviceResolution(!0,!1,!1),s=t.ref(null),a=t.ref(!1),l=t.ref(0),c=t.ref(i.value&&Ce.isValid(i.value)?i.value:new Date),d=t.computed(()=>{const x=i.value&&Ce.isValid(i.value)?i.value:c.value;return x.getFullYear()===c.value.getFullYear()?x.getMonth():null});let u=0;const f=x=>{var w,C;(C=(w=x.target)==null?void 0:w.closest)!=null&&C.call(w,".n-base-clear__clear")&&(u=performance.now())},h=x=>{x&&performance.now()-u<300||(a.value=x,x&&(c.value=i.value&&Ce.isValid(i.value)?i.value:new Date))},p=x=>{r("update:value",x===null?null:new Date(x))},m=(x,w)=>{const C=new Date(x,w,1);if(c.value=C,i.value&&Ce.isValid(i.value)){const N=Math.min(Ce.getDate(i.value),Ce.getDaysInMonth(C));r("update:value",new Date(x,w,N));return}l.value+=1,t.nextTick().then(()=>{var N;return(N=s.value)==null?void 0:N.focus()})},g=(x,w)=>{c.value=Ce.addYears(Ce.addMonths(c.value,x),w)},b=x=>{m(x,c.value.getMonth())},y=x=>{m(c.value.getFullYear(),x)},_=()=>{a.value=!1,r("update:value",new Date)};return(x,w)=>{const C=I.NButton,N=I.NDatePicker;return t.openBlock(),t.createBlock(N,{ref_key:"pickerReference",ref:s,key:l.value,value:i.value?i.value.getTime():null,show:a.value,clearable:n.clearable,disabled:n.disabled,placeholder:n.placeholder,format:n.dateFormat,actions:[],"default-calendar-start-time":c.value.getTime(),type:"date",class:"w-full min-w-0",onMousedownCapture:f,"onUpdate:show":h,"onUpdate:value":p,onNextMonth:w[0]||(w[0]=k=>g(1,0)),onPrevMonth:w[1]||(w[1]=k=>g(-1,0)),onNextYear:w[2]||(w[2]=k=>g(0,1)),onPrevYear:w[3]||(w[3]=k=>g(0,-1))},{footer:t.withCtx(()=>[t.unref(o)?(t.openBlock(),t.createBlock(C,{key:1,size:"small",text:"",type:"info",onClick:_},{default:t.withCtx(()=>[...w[4]||(w[4]=[t.createTextVNode(" Сегодня ",-1)])]),_:1})):(t.openBlock(),t.createBlock(bk,{key:0,year:c.value.getFullYear(),month:d.value,"onUpdate:year":b,onSelectMonth:y,onToday:_},null,8,["year","month"]))]),_:1},8,["value","show","clearable","disabled","placeholder","format","default-calendar-start-time"])}}}),wk={key:0,class:"text-gray-400"},xk={},xf=t.defineComponent({...xk,__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(n,{emit:e}){const i=Ue.initRefDependingOnDeviceResolution(!0,!1,!1),r=e;return(o,s)=>{var a,l;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex w-full min-w-0 gap-1",t.unref(i)?"flex-col":"flex-row items-center"])},[t.createVNode(wf,{value:n.from,clearable:n.clearable,disabled:(a=n.disabled)==null?void 0:a.from,placeholder:n.placeholderFrom,"date-format":n.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"]),t.unref(i)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",wk," – ")),t.createVNode(wf,{value:n.to,clearable:n.clearable,disabled:(l=n.disabled)==null?void 0:l.to,placeholder:n.placeholderTo,"date-format":n.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)}}}),kk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ck(n,e){return t.openBlock(),t.createElementBlock("svg",kk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M7 11h2v2H7zm14-6v14c0 1.11-.89 2-2 2H5a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2M5 7h14V5H5zm14 12V9H5v10zm-4-6v-2h2v2zm-4 0v-2h2v2zm-4 2h2v2H7zm8 2v-2h2v2zm-4 0v-2h2v2z"},null,-1)])])}const vk=t.markRaw({name:"mdi-calendar-month-outline",render:Ck}),Sk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bk(n,e){return t.openBlock(),t.createElementBlock("svg",Sk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"m16 11.78l4.24-7.33l1.73 1l-5.23 9.05l-6.51-3.75L5.46 19H22v2H2V3h2v14.54L9.5 8z"},null,-1)])])}const Nk=t.markRaw({name:"mdi-chart-line",render:Bk}),Tk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $k(n,e){return t.openBlock(),t.createElementBlock("svg",Tk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M22 21H2V3h2v16h2v-9h4v9h2V6h4v13h2v-5h4z"},null,-1)])])}const Ek=t.markRaw({name:"mdi-chart-bar",render:$k}),Rk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Pk(n,e){return t.openBlock(),t.createElementBlock("svg",Rk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M5 3h1V1h2v2h8V1h2v2h1c1.11 0 2 .89 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 16h14V9H5zM5 7h14V5H5zm12 4v2H7v-2z"},null,-1)])])}const Fk=t.markRaw({name:"mdi-calendar-week-outline",render:Pk}),Vk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mk(n,e){return t.openBlock(),t.createElementBlock("svg",Vk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2m0 16H5V9h14zm0-12H5V5h14M7 11h5v5H7"},null,-1)])])}const Ik=t.markRaw({name:"mdi-calendar-today-outline",render:Mk}),Ak={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ok(n,e){return t.openBlock(),t.createElementBlock("svg",Ak,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m-2 12c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1l-.07 1l2.11 1.63c.19.15.25.42.12.64l-2 3.46c-.12.22-.39.31-.61.22l-2.49-1c-.52.39-1.06.73-1.69.98l-.37 2.65c-.04.24-.25.42-.5.42zm1.25-18l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.52l.37-2.61c1.19-.25 2.24-.89 3.01-1.77l2.43 1.04l.75-1.3l-2.12-1.55c.4-1.17.4-2.44 0-3.61l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4z"},null,-1)])])}const zk=t.markRaw({name:"mdi-cog-outline",render:Ok}),Dk={class:"grid gap-x-6 gap-y-4 pr-3 sm:grid-cols-2"},Lk={class:"font-medium"},Hk={key:0,class:"pt-1 text-xs text-gray-500"},Wk={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},jk={class:"flex items-center gap-3"},qk={class:"text-sm text-gray-600"},Xk={class:"flex gap-2"},Yk={},Uk=t.defineComponent({...Yk,__name:"quick-periods-settings",props:{show:{type:Boolean},selectedKeys:{}},emits:["update:show","save"],setup(n,{emit:e}){const i=n,r=e,o=Ue.initRefDependingOnDeviceResolution("100%","90%","40rem"),s=W.DateTimeProvider.standardPeriods(),a=W.STANDARD_PERIOD_GROUPS.map(u=>({key:u.key,label:u.label,sections:bf(s,u.key)})),l=t.ref([]),c=t.computed(()=>{const u=l.value.length;return`Выбрано: ${u} ${W.pluralize(u,["период","периода","периодов"])}`}),d=()=>{r("save",[...l.value]),r("update:show",!1)};return t.watch(()=>i.show,u=>{u&&(l.value=[...i.selectedKeys])}),(u,f)=>{const h=I.NCheckbox,p=I.NCheckboxGroup,m=I.NScrollbar,g=I.NButton,b=I.NModal;return t.openBlock(),t.createBlock(b,{show:n.show,preset:"card",title:"Настройка быстрого выбора",closable:"",style:t.normalizeStyle({width:t.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":f[4]||(f[4]=y=>r("update:show",y))},{footer:t.withCtx(()=>[t.createElementVNode("div",Wk,[t.createElementVNode("div",jk,[t.createElementVNode("span",qk,t.toDisplayString(c.value),1),t.createVNode(g,{text:"",type:"info",onClick:f[1]||(f[1]=y=>l.value=[...t.unref(hf)])},{default:t.withCtx(()=>[...f[5]||(f[5]=[t.createTextVNode(" По умолчанию ",-1)])]),_:1}),t.createVNode(g,{text:"",type:"info",disabled:l.value.length===0,onClick:f[2]||(f[2]=y=>l.value=[])},{default:t.withCtx(()=>[...f[6]||(f[6]=[t.createTextVNode(" Снять все ",-1)])]),_:1},8,["disabled"])]),t.createElementVNode("div",Xk,[t.createVNode(g,{type:"primary",onClick:d},{default:t.withCtx(()=>[...f[7]||(f[7]=[t.createTextVNode(" Сохранить ",-1)])]),_:1}),t.createVNode(g,{onClick:f[3]||(f[3]=y=>r("update:show",!1))},{default:t.withCtx(()=>[...f[8]||(f[8]=[t.createTextVNode("Отмена",-1)])]),_:1})])])]),default:t.withCtx(()=>[t.createVNode(m,{class:"max-h-[60vh]"},{default:t.withCtx(()=>[t.createVNode(p,{value:l.value,"onUpdate:value":f[0]||(f[0]=y=>l.value=y)},{default:t.withCtx(()=>[t.createElementVNode("div",Dk,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a),y=>(t.openBlock(),t.createElementBlock("div",{key:y.key,class:"flex flex-col gap-1.5"},[t.createElementVNode("div",Lk,t.toDisplayString(y.label),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.sections,_=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:_.key},[_.label?(t.openBlock(),t.createElementBlock("div",Hk,t.toDisplayString(_.label),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.children,x=>(t.openBlock(),t.createBlock(h,{key:x.value,value:x.value,label:x.label},null,8,["value","label"]))),128))],64))),128))]))),128))])]),_:1},8,["value"])]),_:1})]),_:1},8,["show","style"])}}}),Kk={class:"flex flex-col gap-2"},Gk={class:"flex items-center gap-2"},Zk={class:"flex gap-2 px-px pb-4 pt-px"},Qk={key:0,class:"text-sm text-gray-500"},Jk={},e2=t.defineComponent({...Jk,__name:"quick-periods",props:{from:{},to:{}},emits:["apply","preview"],setup(n,{emit:e}){const i=n,r=e,o=W.DateTimeProvider.standardPeriods(),s=()=>{const f=ff,h=W.PreferencesStorageProvider.getActualDataFromStorage(f);return(V.isArray(h)?h:hf).filter(m=>V.isString(m)&&m in o)},a=t.ref(s()),l=t.ref(!1),c=t.computed(()=>Object.entries(o).filter(([f])=>a.value.includes(f)).map(([f,h])=>({value:f,label:h.label,item:h,group:h.group}))),d=t.computed(()=>{const f=i.from?Ri(i.from):null,h=i.to?Ri(i.to):null;if(f===null||h===null)return null;const p=c.value.find(m=>{const{from:g,to:b}=m.item;return!g||!b?!1:Ri(g)===f&&Ri(b)===h});return p?String(p.value):null}),u=f=>{a.value=f;const h=ff;W.PreferencesStorageProvider.saveActualDataToStorage(h,f,Ce.addYears(Ce.startOfToday(),1))};return(f,h)=>{const p=zk,m=I.NButton,g=Ik,b=Fk,y=Ek,_=Nk,x=vk,w=I.NScrollbar;return t.openBlock(),t.createElementBlock("div",Kk,[t.createElementVNode("div",Gk,[h[3]||(h[3]=t.createElementVNode("span",{class:"text-sm font-medium text-gray-700"},"Быстрый выбор",-1)),t.createVNode(m,{size:"tiny",quaternary:"",circle:"","aria-label":"Настроить быстрый выбор",onClick:h[0]||(h[0]=C=>l.value=!0)},{icon:t.withCtx(()=>[t.createVNode(p)]),_:1})]),t.createVNode(w,{"x-scrollable":""},{default:t.withCtx(()=>[t.createElementVNode("div",Zk,[c.value.length===0?(t.openBlock(),t.createElementBlock("span",Qk," Периоды не выбраны ")):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,C=>(t.openBlock(),t.createBlock(m,{key:C.value,type:C.value===d.value?"primary":"default",ghost:C.value===d.value,"theme-overrides":t.unref(Yx),class:"shrink-0",onClick:N=>r("apply",C),onMouseenter:N=>r("preview",C),onMouseleave:h[1]||(h[1]=N=>r("preview"))},{icon:t.withCtx(()=>[C.group==="day"?(t.openBlock(),t.createBlock(g,{key:0})):C.group==="week"||C.group==="decade"?(t.openBlock(),t.createBlock(b,{key:1})):C.group==="quarter"||C.group==="halfYear"?(t.openBlock(),t.createBlock(y,{key:2})):C.group==="other"?(t.openBlock(),t.createBlock(_,{key:3})):(t.openBlock(),t.createBlock(x,{key:4}))]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(C.label),1)]),_:2},1032,["type","ghost","theme-overrides","onClick","onMouseenter"]))),128))])]),_:1}),t.createVNode(Uk,{show:l.value,"onUpdate:show":h[2]||(h[2]=C=>l.value=C),"selected-keys":a.value,onSave:u},null,8,["show","selected-keys"])])}}}),t2={class:"flex flex-col items-stretch gap-3 sm:flex-row"},n2={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},i2={class:"flex flex-col items-stretch pr-3"},r2={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},o2={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},s2={},a2=t.defineComponent({...s2,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(n,{emit:e}){const i=n,r=e,o="custom",s=Ue.initRefDependingOnDeviceResolution(!0,!1,!1),a=W.DateTimeProvider.standardPeriods(),l=t.ref(W.STANDARD_PERIOD_GROUPS[0].key),c=t.computed(()=>{const u=W.STANDARD_PERIOD_GROUPS.map(f=>({key:f.key,value:f.key,label:f.label}));return V.isEmpty(i.customPeriods)||u.push({key:o,value:o,label:"Пользовательские"}),u}),d=t.computed(()=>l.value===o?[{type:"group",key:o,children:Aa(i.customPeriods??{})}]:bf(a,l.value));return(u,f)=>{const h=I.NButton,p=I.NScrollbar,m=I.NSelect,g=I.NMenu;return t.openBlock(),t.createElementBlock("div",t2,[t.createElementVNode("div",n2,[t.createVNode(p,{class:"max-h-96"},{default:t.withCtx(()=>[t.createElementVNode("div",i2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,b=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:b.key},[b.label?(t.openBlock(),t.createElementBlock("div",r2,t.toDisplayString(b.label),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.children,y=>(t.openBlock(),t.createBlock(h,{key:y.value,size:"small",quaternary:"",type:y.value===n.activeKey?"primary":"default",class:"justify-start",onClick:_=>r("apply",y),onMouseenter:_=>r("preview",y),onMouseleave:f[0]||(f[0]=_=>r("preview"))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.label),1)]),_:2},1032,["type","onClick","onMouseenter"]))),128))],64))),128))])]),_:1})]),t.unref(s)?(t.openBlock(),t.createBlock(m,{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"])):(t.openBlock(),t.createElementBlock("div",o2,[t.createVNode(g,{value:l.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=b=>l.value=b)},null,8,["value","options"])]))])}}}),l2={class:"flex flex-col gap-3"},c2={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},d2={key:1,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},u2={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},f2={class:"flex gap-2"},h2={},m2=t.defineComponent({...h2,__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(n,{emit:e}){const i=n,r=e,o=Ue.initRefDependingOnDeviceResolution("100%","90%","48rem"),s=t.ref("custom"),a=t.ref("months"),l=t.computed(()=>a.value==="months"?"Показать по дням":"Показать по месяцам"),c=()=>W.PreferencesStorageProvider.getActualDataFromStorage(df)==="standard"?"standard":"custom",d=()=>W.PreferencesStorageProvider.getActualDataFromStorage(uf)==="days"?"days":"months",u=(v,E)=>{W.PreferencesStorageProvider.saveActualDataToStorage(v,E,Ce.addYears(Ce.startOfToday(),1))},f=t.ref({}),h=t.ref(null),p=t.ref(null),m=t.computed(()=>h.value??f.value),g=(v,E)=>{var R,M;const P=(R=i.disabled)!=null&&R.from?f.value.from:v,F=(M=i.disabled)!=null&&M.to?f.value.to:E;h.value=null,f.value=yf(P,F,i.disabled)},b=v=>{p.value=null,g(v,f.value.to)},y=v=>{p.value=null,g(f.value.from,v)},_=()=>{p.value=null,g(null,null)},x=v=>{p.value=null,g(v.from,v.to)},w=v=>{const E=v.item;g(E.from,E.to),p.value=String(v.value)},C=v=>{const E=v==null?void 0:v.item;h.value=E?{from:E.from,to:E.to}:null},N=()=>{h.value=null,s.value=s.value==="custom"?"standard":"custom",u(df,s.value)},k=()=>{a.value=a.value==="months"?"days":"months",u(uf,a.value)},$=()=>{r("select",f.value),r("update:show",!1)};return t.watch(()=>i.show,v=>{v&&(s.value=c(),a.value=d(),p.value=null,h.value=null,f.value={...i.dateRange})}),(v,E)=>{const P=I.NButton,F=Hx,R=zx,M=I.NTooltip,X=I.NModal;return t.openBlock(),t.createBlock(X,{show:n.show,preset:"card",title:"Выберите период",closable:"",style:t.normalizeStyle({width:t.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":E[1]||(E[1]=G=>r("update:show",G))},{footer:t.withCtx(()=>[t.createElementVNode("div",u2,[t.createVNode(P,{text:"",type:"info",onClick:N},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),t.createElementVNode("div",f2,[t.createVNode(P,{type:"primary",onClick:$},{default:t.withCtx(()=>[...E[3]||(E[3]=[t.createTextVNode(" Выбрать ",-1)])]),_:1}),t.createVNode(P,{onClick:E[0]||(E[0]=G=>r("update:show",!1))},{default:t.withCtx(()=>[...E[4]||(E[4]=[t.createTextVNode("Отмена",-1)])]),_:1})])])]),default:t.withCtx(()=>[t.createElementVNode("div",l2,[s.value==="custom"?(t.openBlock(),t.createBlock(e2,{key:0,from:f.value.from,to:f.value.to,onApply:w,onPreview:C},null,8,["from","to"])):t.createCommentVNode("",!0),t.createElementVNode("div",c2,[t.createVNode(xf,{from:m.value.from,to:m.value.to,clearable:n.clearable,disabled:n.disabled,"date-format":n.dateFormat,class:"flex-1","onUpdate:from":b,"onUpdate:to":y},null,8,["from","to","clearable","disabled","date-format"]),n.clearable?(t.openBlock(),t.createBlock(P,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:_},{default:t.withCtx(()=>[...E[2]||(E[2]=[t.createTextVNode(" Очистить период ",-1)])]),_:1})):t.createCommentVNode("",!0)]),s.value==="custom"?(t.openBlock(),t.createElementBlock("div",d2,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.value==="months"?fk:rk),{from:f.value.from,to:f.value.to,onSelect:x},{actions:t.withCtx(()=>[t.createVNode(M,{placement:"top",trigger:"hover"},{trigger:t.withCtx(()=>[t.createVNode(P,{size:"small","aria-label":l.value,"theme-overrides":t.unref(Lr),onClick:k},{icon:t.withCtx(()=>[a.value==="months"?(t.openBlock(),t.createBlock(F,{key:0})):(t.openBlock(),t.createBlock(R,{key:1}))]),_:1},8,["aria-label","theme-overrides"])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(l.value),1)]),_:1})]),_:1},40,["from","to"]))])):(t.openBlock(),t.createBlock(a2,{key:2,"active-key":p.value,"custom-periods":n.customPeriods,onApply:w,onPreview:C},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),p2={class:"flex w-full min-w-0 items-center gap-1"},g2={},y2=t.defineComponent({...g2,__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(n,{emit:e}){const i=n,r=e,o=t.ref(!1),s=t.computed(()=>{const u={...i.useDefaultPredefinedDateRanges?W.DateTimeProvider.defaultDateRanges():{},...i.predefinedDateRanges};return V.isEmpty(u)?void 0:u}),a=(u,f)=>{r("update:date-range",yf(u,f,i.disabled))},l=u=>{var f;a(u,(f=i.dateRange)==null?void 0:f.to)},c=u=>{var f;a((f=i.dateRange)==null?void 0:f.from,u)},d=u=>{a(u.from,u.to)};return(u,f)=>{var m,g,b,y;const h=Ix,p=I.NButton;return t.openBlock(),t.createElementBlock("div",p2,[t.createVNode(xf,{from:(m=n.dateRange)==null?void 0:m.from,to:(g=n.dateRange)==null?void 0:g.to,clearable:n.clearable,disabled:n.disabled,"placeholder-from":n.placeholderFrom,"placeholder-to":n.placeholderTo,"date-format":n.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"]),t.createVNode(p,{disabled:!!((b=n.disabled)!=null&&b.from&&((y=n.disabled)!=null&&y.to)),title:"Выбрать период","aria-label":"Выбрать период",onClick:f[0]||(f[0]=_=>o.value=!0)},{default:t.withCtx(()=>[t.createVNode(h)]),_:1},8,["disabled"]),t.createVNode(m2,{show:o.value,"onUpdate:show":f[1]||(f[1]=_=>o.value=_),"date-range":n.dateRange,clearable:n.clearable,disabled:n.disabled,"custom-periods":s.value,"date-format":n.dateFormat,onSelect:d},null,8,["show","date-range","clearable","disabled","custom-periods","date-format"])])}}}),b2={class:"sc-lbl-date text-nowrap"},_2={},es=t.defineComponent({..._2,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(n){const e=n,i=t.computed(()=>Ce.format(e.date,W.useBaseConfigStateStore().config.dateFormats.uiDate)),r=t.computed(()=>Ce.format(e.date,"HH:mm"));return(o,s)=>(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass({"flex flex-col":n.isTimeOnSecondLine})},[t.createElementVNode("span",b2,t.toDisplayString(i.value),1),n.isShowTime?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([{"text-sc-grey":n.isTimeSecondary,"ml-1":!n.isTimeOnSecondLine},"sc-lbl-time"])},t.toDisplayString(r.value),3)):t.createCommentVNode("",!0)],2))}}),w2={},x2=t.defineComponent({...w2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(n){const e=n,i=t.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>n.debt!==0?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass({"text-sm":n.wrapAsSmall})},[t.createTextVNode(t.toDisplayString(i.value)+" ",1),t.createElementVNode("span",{class:t.normalizeClass({"text-green-700":n.debt>0,"text-red-700":n.debt<0})},t.toDisplayString(n.debt)+" ₽ ",3)],2)):t.createCommentVNode("",!0)}}),k2={class:"flex flex-row gap-2.5"},C2={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},v2={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},S2={class:"mb-0.5 sm:mb-0 sm:ml-3"},B2={},N2=t.defineComponent({...B2,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(n){return(e,i)=>{const r=Jo,o=I.NButton,s=I.NPopover;return t.openBlock(),t.createElementBlock("div",k2,[t.createElementVNode("div",C2,[t.renderSlot(e.$slots,"main")]),t.createElementVNode("div",null,[t.createElementVNode("div",v2,[t.renderSlot(e.$slots,"extra-buttons"),t.createElementVNode("div",S2,[n.showCloseButton?(t.openBlock(),t.createBlock(s,{key:0,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(o,{size:"small",type:"error",onClick:i[0]||(i[0]=a=>e.$emit("close"))},{default:t.withCtx(()=>[t.createVNode(r)]),_:1})]),default:t.withCtx(()=>[i[1]||(i[1]=t.createTextVNode(" Закрыть ",-1))]),_:1})):t.createCommentVNode("",!0)])])])])}}}),T2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $2(n,e){return t.openBlock(),t.createElementBlock("svg",T2,[...e[0]||(e[0]=[t.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 E2=t.markRaw({name:"ion-checkmark-done-sharp",render:$2}),R2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function P2(n,e){return t.openBlock(),t.createElementBlock("svg",R2,[...e[0]||(e[0]=[t.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),t.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),t.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),t.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const F2=t.markRaw({name:"ion-options-outline",render:P2}),V2={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},M2={class:"flex-auto"},I2={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"},A2={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"},O2={},Oa=t.defineComponent({...O2,__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(n,{emit:e}){const i=e,r=t.ref(!1),o=()=>{i("edit")},s=()=>{r.value=!1},a=()=>{r.value=!0,i("apply",s)},l=()=>{i("cancel",s)};return(c,d)=>{const u=F2,f=I.NButton,h=I.NPopover,p=E2,m=Jo;return t.openBlock(),t.createElementBlock("div",V2,[t.createElementVNode("div",M2,[t.renderSlot(c.$slots,"default")]),t.createElementVNode("div",null,[t.createElementVNode("div",I2,[t.createElementVNode("div",A2,[n.showEditButton?(t.openBlock(),t.createBlock(h,{key:0,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(f,{disabled:n.disabled||r.value,type:"info",ghost:"",size:"small",onClick:o},{default:t.withCtx(()=>[t.createVNode(u)]),_:1},8,["disabled"])]),default:t.withCtx(()=>[d[0]||(d[0]=t.createTextVNode(" Редактировать данные ",-1))]),_:1})):t.createCommentVNode("",!0),n.showApplyButton?(t.openBlock(),t.createBlock(h,{key:1,disabled:r.value,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(f,{disabled:n.disabled||r.value,type:"primary",size:"small",onClick:a},{default:t.withCtx(()=>[t.createVNode(p)]),_:1},8,["disabled"])]),default:t.withCtx(()=>[d[1]||(d[1]=t.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),n.showCancelButton?(t.openBlock(),t.createBlock(h,{key:2,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(f,{disabled:n.disabled||r.value,type:"error",size:"small",onClick:l},{default:t.withCtx(()=>[t.createVNode(m)]),_:1},8,["disabled"])]),default:t.withCtx(()=>[d[2]||(d[2]=t.createTextVNode(" Отменить изменения ",-1))]),_:1})):t.createCommentVNode("",!0)]),t.renderSlot(c.$slots,"extra-buttons")])])])}}}),z2={},kf=t.defineComponent({...z2,__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(n,{emit:e}){const i=n,r=e,o=t.ref(i.showEditor),s=l=>{r("editor:apply",d=>{o.value=!d,l()})},a=l=>{o.value=!1,l(),r("editor:cancel")};return t.onMounted(()=>{t.watch(()=>i.showEditor,l=>{o.value=l})}),(l,c)=>(t.openBlock(),t.createElementBlock("div",null,[o.value?(t.openBlock(),t.createBlock(Oa,{key:1,disabled:n.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:s,onCancel:a},{"extra-buttons":t.withCtx(()=>[t.renderSlot(l.$slots,"extra-editor-buttons")]),default:t.withCtx(()=>[t.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(t.openBlock(),t.createBlock(Oa,{key:0,disabled:n.disabled,"show-edit-button":n.showEditButton,onEdit:c[0]||(c[0]=d=>o.value=!0)},{"extra-buttons":t.withCtx(()=>[t.renderSlot(l.$slots,"extra-viewer-buttons")]),default:t.withCtx(()=>[t.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),D2={key:0,class:"whitespace-pre-line"},L2={key:1,class:"text-sc-dark-grey"},H2={},W2=t.defineComponent({...H2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(n,{emit:e}){const i=n,r=e,o=t.ref(i.comment);t.watch(()=>o.value,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=i.comment};return(l,c)=>{const d=I.NInput;return t.openBlock(),t.createBlock(kf,{disabled:n.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:t.withCtx(()=>[t.createElementVNode("div",null,[n.comment?(t.openBlock(),t.createElementBlock("span",D2,t.toDisplayString(n.comment),1)):(t.openBlock(),t.createElementBlock("span",L2," - Комментарий отсутствует - "))])]),editor:t.withCtx(()=>[t.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"])}}}),j2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function q2(n,e){return t.openBlock(),t.createElementBlock("svg",j2,[...e[0]||(e[0]=[t.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),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const X2=t.markRaw({name:"ion-download-outline",render:q2}),Y2={},U2=t.defineComponent({...Y2,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(n,{emit:e}){const i=n,r=e,o=t.ref([]),s=t.computed(()=>o.value.map(l=>(l.status=i.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=X2;return t.openBlock(),t.createBlock(t.unref(I.NUpload),{"file-list":s.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:n.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NUploadDragger),null,{default:t.withCtx(()=>[t.renderSlot(l.$slots,"dragged-area",{},()=>[t.createElementVNode("div",null,[t.createVNode(d,{class:"text-2xl"}),t.createElementVNode("div",null,t.toDisplayString(n.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),K2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function G2(n,e){return t.openBlock(),t.createElementBlock("svg",K2,[...e[0]||(e[0]=[t.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 Z2=t.markRaw({name:"ion-warning",render:G2}),Q2={},J2=t.defineComponent({...Q2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(n){return(e,i)=>{const r=Z2,o=I.NPopover;return t.openBlock(),t.createBlock(o,{disabled:n.popoverText.length===0,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(r,{class:t.normalizeClass(`ml-0.5 ${n.iconClass}`)},null,8,["class"])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(n.popoverText),1)]),_:1},8,["disabled"])}}}),eC={},tC=t.defineComponent({...eC,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(n,{emit:e}){const i=n,r=e,o=t.ref(i.value),s=t.computed(()=>t.inject("debounce-input-time",i.debounceTime)),a=V.debounce(()=>r("update:value",o.value),s.value),l=c=>{o.value=c,a()};return t.watch(()=>i.value,c=>{o.value=c}),(c,d)=>(t.openBlock(),t.createBlock(t.unref(I.NInput),{value:o.value,"onUpdate:value":[d[0]||(d[0]=u=>o.value=u),l],clearable:n.clearable,placeholder:n.placeholder},{prefix:t.withCtx(()=>[t.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),nC={},iC=t.defineComponent({...nC,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.ref(r.value),a=t.computed(()=>t.inject("debounce-input-time",r.debounceTime)),l=V.debounce(()=>o("update:value",s.value),a.value),c=p=>{s.value=p,l()};t.watch(()=>r.value,p=>{s.value=p});const d=t.ref(null);return e({focus:()=>{var p;return(p=d.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=d.value)==null?void 0:p.blur()},select:()=>{var p;return(p=d.value)==null?void 0:p.select()}}),(p,m)=>(t.openBlock(),t.createBlock(t.unref(I.NInputNumber),{ref_key:"inputReference",ref:d,value:s.value??null,clearable:n.clearable,parse:n.parse,"show-button":n.showButton,placeholder:n.placeholder,min:n.min,max:n.max,step:n.step,validator:n.validator,"onUpdate:value":c,onKeydown:m[0]||(m[0]=g=>o("keydown",g)),onInput:m[1]||(m[1]=g=>o("input",g)),onFocus:m[2]||(m[2]=g=>o("focus",g))},{prefix:t.withCtx(()=>[t.renderSlot(p.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),rC={},oC=t.defineComponent({...rC,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(n,{emit:e}){const i=n,r=e,o=t.ref((i.value??"").replaceAll(/\D*/g,"")),s=V.debounce(c=>r("update:value",c),i.debounceTime??0),a=c=>{let d="";if(V.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(V.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof Br.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}i.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 t.watch(()=>i.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}),t.onBeforeMount(()=>l(o.value??"")),(c,d)=>(t.openBlock(),t.createBlock(t.unref(Pm.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>o.value=u),a],"auto-default-country":!1,"auto-format":!0,"default-country":n.defaultCountry,disabled:n.disabled,"input-options":{placeholder:n.placeholder},"preferred-countries":n.preferredCountries,"only-countries":n.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),sC=gn(oC,[["__scopeId","data-v-751dbb0e"]]),aC={class:"mb-7 grid grid-cols-2 gap-3.5 lg:grid-cols-4"},lC={class:"mb-2 text-[11.5px] font-semibold uppercase text-gray-500"},cC={},dC=t.defineComponent({...cC,__name:"kpi-grid",props:{items:{},isLoading:{type:Boolean}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",aC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.items,r=>(t.openBlock(),t.createElementBlock("div",{key:r.label,class:"rounded-lg border border-solid border-gray-200 px-4 py-4"},[t.createElementVNode("div",lC,t.toDisplayString(r.label),1),t.createElementVNode("div",{class:t.normalizeClass(["text-[25px] font-bold",r.valueClass])},t.toDisplayString(n.isLoading?"…":r.value),3),t.createElementVNode("div",{class:t.normalizeClass(["mt-1.5 text-xs font-medium",r.noteClass])},t.toDisplayString(r.note),3)]))),128))]))}}),uC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fC(n,e){return t.openBlock(),t.createElementBlock("svg",uC,[...e[0]||(e[0]=[t.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 hC=t.markRaw({name:"tabler-external-link",render:fC}),mC={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},pC=["href"],gC={},yC=t.defineComponent({...gC,__name:"external-link",props:{text:{},url:{},description:{}},setup(n){return(e,i)=>{const r=hC,o=I.NTooltip;return t.openBlock(),t.createBlock(o,{disabled:t.unref(V.isUndefined)(n.description),placement:"top-start"},{trigger:t.withCtx(()=>[t.createElementVNode("span",mC,[t.createElementVNode("a",{href:n.url,target:"_blank",class:"no-underline"},t.toDisplayString(n.text),9,pC),t.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(n.description),1)]),_:1},8,["disabled"])}}}),bC={key:1,class:"h-24"},_C={key:2,class:"flex flex-col gap-3"},wC={},xC=t.defineComponent({...wC,__name:"compact-card-list",props:{isLoading:{type:Boolean},isEmpty:{type:Boolean},emptyDescription:{},pagination:{}},emits:["update:page","update:pageSize"],setup(n,{emit:e}){const i=e,r=[20,50,100];return(o,s)=>(t.openBlock(),t.createBlock(t.unref(I.NSpin),{show:n.isLoading},{default:t.withCtx(()=>[!n.isLoading&&n.isEmpty?(t.openBlock(),t.createBlock(t.unref(I.NEmpty),{key:0,description:n.emptyDescription},null,8,["description"])):n.isLoading&&n.isEmpty?(t.openBlock(),t.createElementBlock("div",bC)):(t.openBlock(),t.createElementBlock("div",_C,[t.renderSlot(o.$slots,"default")])),n.pagination&&n.pagination.itemCount>0?(t.openBlock(),t.createBlock(t.unref(I.NPagination),{key:3,class:"mt-4 flex-wrap justify-center gap-y-2",size:"small",page:n.pagination.page,"page-size":n.pagination.pageSize,"item-count":n.pagination.itemCount,"page-slot":n.pagination.pageSlot,"page-sizes":r,"show-size-picker":!0,prefix:t.unref(Jl),"onUpdate:page":s[0]||(s[0]=a=>i("update:page",a)),"onUpdate:pageSize":s[1]||(s[1]=a=>i("update:pageSize",a))},null,8,["page","page-size","item-count","page-slot","prefix"])):t.createCommentVNode("",!0)]),_:3},8,["show"]))}}),kC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function CC(n,e){return t.openBlock(),t.createElementBlock("svg",kC,[...e[0]||(e[0]=[t.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),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const vC=t.markRaw({name:"ion-remove-circle-outline",render:CC});let ts=[];const Cf=new WeakMap;function SC(){ts.forEach(n=>n(...Cf.get(n))),ts=[]}function vf(n,...e){Cf.set(n,e),!ts.includes(n)&&ts.push(n)===1&&requestAnimationFrame(SC)}function Hr(n,e){let{target:i}=n;for(;i;){if(i.dataset&&i.dataset[e]!==void 0)return!0;i=i.parentElement}return!1}function Wr(n){return n.composedPath()[0]||null}function jr(n){return typeof n=="string"?n.endsWith("px")?Number(n.slice(0,n.length-2)):Number(n):n}function qr(n){if(n!=null)return typeof n=="number"?`${n}px`:n.endsWith("px")?n:`${n}px`}function xn(n,e){const i=n.trim().split(/\s+/g),r={top:i[0]};switch(i.length){case 1:r.right=i[0],r.bottom=i[0],r.left=i[0];break;case 2:r.right=i[1],r.left=i[1],r.bottom=i[0];break;case 3:r.right=i[1],r.bottom=i[2],r.left=i[1];break;case 4:r.right=i[1],r.bottom=i[2],r.left=i[3];break;default:throw new Error("[seemly/getMargin]:"+n+" is not a valid value.")}return e===void 0?r:r[e]}const Sf={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 BC(n,e,i){e/=100,i/=100;let r=(o,s=(o+n/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function NC(n,e,i){e/=100,i/=100;let r=e*Math.min(i,1-i),o=(s,a=(s+n/30)%12)=>i-r*Math.max(Math.min(a-3,9-a,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const Mn="^\\s*",In="\\s*$",mi="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",rn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Pi="([0-9A-Fa-f])",Fi="([0-9A-Fa-f]{2})",Bf=new RegExp(`${Mn}hsl\\s*\\(${rn},${mi},${mi}\\)${In}`),Nf=new RegExp(`${Mn}hsv\\s*\\(${rn},${mi},${mi}\\)${In}`),Tf=new RegExp(`${Mn}hsla\\s*\\(${rn},${mi},${mi},${rn}\\)${In}`),$f=new RegExp(`${Mn}hsva\\s*\\(${rn},${mi},${mi},${rn}\\)${In}`),TC=new RegExp(`${Mn}rgb\\s*\\(${rn},${rn},${rn}\\)${In}`),$C=new RegExp(`${Mn}rgba\\s*\\(${rn},${rn},${rn},${rn}\\)${In}`),EC=new RegExp(`${Mn}#${Pi}${Pi}${Pi}${In}`),RC=new RegExp(`${Mn}#${Fi}${Fi}${Fi}${In}`),PC=new RegExp(`${Mn}#${Pi}${Pi}${Pi}${Pi}${In}`),FC=new RegExp(`${Mn}#${Fi}${Fi}${Fi}${Fi}${In}`);function Qt(n){return parseInt(n,16)}function VC(n){try{let e;if(e=Tf.exec(n))return[is(e[1]),pi(e[5]),pi(e[9]),Mi(e[13])];if(e=Bf.exec(n))return[is(e[1]),pi(e[5]),pi(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${n}.`)}catch(e){throw e}}function MC(n){try{let e;if(e=$f.exec(n))return[is(e[1]),pi(e[5]),pi(e[9]),Mi(e[13])];if(e=Nf.exec(n))return[is(e[1]),pi(e[5]),pi(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${n}.`)}catch(e){throw e}}function Vi(n){try{let e;if(e=RC.exec(n))return[Qt(e[1]),Qt(e[2]),Qt(e[3]),1];if(e=TC.exec(n))return[$t(e[1]),$t(e[5]),$t(e[9]),1];if(e=$C.exec(n))return[$t(e[1]),$t(e[5]),$t(e[9]),Mi(e[13])];if(e=EC.exec(n))return[Qt(e[1]+e[1]),Qt(e[2]+e[2]),Qt(e[3]+e[3]),1];if(e=FC.exec(n))return[Qt(e[1]),Qt(e[2]),Qt(e[3]),Mi(Qt(e[4])/255)];if(e=PC.exec(n))return[Qt(e[1]+e[1]),Qt(e[2]+e[2]),Qt(e[3]+e[3]),Mi(Qt(e[4]+e[4])/255)];if(n in Sf)return Vi(Sf[n]);if(Bf.test(n)||Tf.test(n)){const[i,r,o,s]=VC(n);return[...NC(i,r,o),s]}else if(Nf.test(n)||$f.test(n)){const[i,r,o,s]=MC(n);return[...BC(i,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${n}.`)}catch(e){throw e}}function IC(n){return n>1?1:n<0?0:n}function za(n,e,i,r){return`rgba(${$t(n)}, ${$t(e)}, ${$t(i)}, ${IC(r)})`}function Da(n,e,i,r,o){return $t((n*e*(1-r)+i*r)/o)}function AC(n,e){Array.isArray(n)||(n=Vi(n)),Array.isArray(e)||(e=Vi(e));const i=n[3],r=e[3],o=Mi(i+r-i*r);return za(Da(n[0],i,e[0],r,o),Da(n[1],i,e[1],r,o),Da(n[2],i,e[2],r,o),o)}function Le(n,e){const[i,r,o,s=1]=Array.isArray(n)?n:Vi(n);return typeof e.alpha=="number"?za(i,r,o,e.alpha):za(i,r,o,s)}function ns(n,e){const[i,r,o,s=1]=Array.isArray(n)?n:Vi(n),{lightness:a=1,alpha:l=1}=e;return OC([i*a,r*a,o*a,s*l])}function Mi(n){const e=Math.round(Number(n)*100)/100;return e>1?1:e<0?0:e}function is(n){const e=Math.round(Number(n));return e>=360||e<0?0:e}function $t(n){const e=Math.round(Number(n));return e>255?255:e<0?0:e}function pi(n){const e=Math.round(Number(n));return e>100?100:e<0?0:e}function OC(n){const[e,i,r]=n;return 3 in n?`rgba(${$t(e)}, ${$t(i)}, ${$t(r)}, ${Mi(n[3])})`:`rgba(${$t(e)}, ${$t(i)}, ${$t(r)}, 1)`}function zC(n=8){return Math.random().toString(16).slice(2,2+n)}function Ef(n){return Array.isArray(n)?n:[n]}const La={STOP:"STOP"};function Rf(n,e){const i=e(n);n.children!==void 0&&i!==La.STOP&&n.children.forEach(r=>Rf(r,e))}function DC(n,e={}){const{preserveGroup:i=!1}=e,r=[],o=i?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(n),r}function LC(n,e){const{isLeaf:i}=n;return i!==void 0?i:!e(n)}function HC(n){return n.children}function WC(n){return n.key}function jC(){return!1}function qC(n,e){const{isLeaf:i}=n;return!(i===!1&&!Array.isArray(e(n)))}function XC(n){return n.disabled===!0}function YC(n,e){return n.isLeaf===!1&&!Array.isArray(e(n))}function UC(n,e){if(n.isLeaf===!0){const i=e(n);if(Array.isArray(i)&&i.length>0)return!0}return!1}function Ha(n){var e;return n==null?[]:Array.isArray(n)?n:(e=n.checkedKeys)!==null&&e!==void 0?e:[]}function Wa(n){var e;return n==null||Array.isArray(n)?[]:(e=n.indeterminateKeys)!==null&&e!==void 0?e:[]}function KC(n,e){const i=new Set(n);return e.forEach(r=>{i.has(r)||i.add(r)}),Array.from(i)}function GC(n,e){const i=new Set(n);return e.forEach(r=>{i.has(r)&&i.delete(r)}),Array.from(i)}function ZC(n){return(n==null?void 0:n.type)==="group"}function QC(n){const e=new Map;return n.forEach((i,r)=>{e.set(i.key,r)}),i=>{var r;return(r=e.get(i))!==null&&r!==void 0?r:null}}class JC extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function ev(n,e,i,r){return rs(e.concat(n),i,r,!1)}function tv(n,e){const i=new Set;return n.forEach(r=>{const o=e.treeNodeMap.get(r);if(o!==void 0){let s=o.parent;for(;s!==null&&!(s.disabled||i.has(s.key));)i.add(s.key),s=s.parent}}),i}function nv(n,e,i,r){const o=rs(e,i,r,!1),s=rs(n,i,r,!0),a=tv(n,i),l=[];return o.forEach(c=>{(s.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>o.delete(c)),o}function ja(n,e){const{checkedKeys:i,keysToCheck:r,keysToUncheck:o,indeterminateKeys:s,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=n;if(!a)return r!==void 0?{checkedKeys:KC(i,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:GC(i,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(i),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let f;o!==void 0?f=nv(o,i,e,d):r!==void 0?f=ev(r,i,e,d):f=rs(i,e,d,!1);const h=c==="parent",p=c==="child"||l,m=f,g=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,x=u.get(y);for(const w of x){if(w.isLeaf)continue;const{key:C,shallowLoaded:N}=w;if(p&&N&&w.children.forEach(E=>{!E.disabled&&!E.isLeaf&&E.shallowLoaded&&m.has(E.key)&&m.delete(E.key)}),w.disabled||!N)continue;let k=!0,$=!1,v=!0;for(const E of w.children){const P=E.key;if(!E.disabled){if(v&&(v=!1),m.has(P))$=!0;else if(g.has(P)){$=!0,k=!1;break}else if(k=!1,$)break}}k&&!v?(h&&w.children.forEach(E=>{!E.disabled&&m.has(E.key)&&m.delete(E.key)}),m.add(C)):$&&g.add(C),_&&p&&m.has(C)&&m.delete(C)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(g)}}function rs(n,e,i,r){const{treeNodeMap:o,getChildren:s}=e,a=new Set,l=new Set(n);return n.forEach(c=>{const d=o.get(c);d!==void 0&&Rf(d,u=>{if(u.disabled)return La.STOP;const{key:f}=u;if(!a.has(f)&&(a.add(f),l.add(f),YC(u.rawNode,s))){if(r)return La.STOP;if(!i)throw new JC}})}),l}function iv(n,{includeGroup:e=!1,includeSelf:i=!0},r){var o;const s=r.treeNodeMap;let a=n==null?null:(o=s.get(n))!==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(),i||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function rv(n){if(n.length===0)return null;const e=n[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function ov(n,e){const i=n.siblings,r=i.length,{index:o}=n;return e?i[(o+1)%r]:o===i.length-1?null:i[o+1]}function Pf(n,e,{loop:i=!1,includeDisabled:r=!1}={}){const o=e==="prev"?sv:ov,s={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===n){if(!a)a=!0;else if(!n.disabled&&!n.isGroup){l=n;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const u=qa(d,s);u!==null?l=u:c(o(d,i))}else{const u=o(d,!1);if(u!==null)c(u);else{const f=av(d);f!=null&&f.isGroup?c(o(f,i)):i&&c(o(d,!0))}}}}return c(n),l}function sv(n,e){const i=n.siblings,r=i.length,{index:o}=n;return e?i[(o-1+r)%r]:o===0?null:i[o-1]}function av(n){return n.parent}function qa(n,e={}){const{reverse:i=!1}=e,{children:r}=n;if(r){const{length:o}=r,s=i?o-1:0,a=i?-1:o,l=i?-1:1;for(let c=s;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=qa(d,e);if(u!==null)return u}else return d}}return null}const lv={getChild(){return this.ignored?null:qa(this)},getParent(){const{parent:n}=this;return n!=null&&n.isGroup?n.getParent():n},getNext(n={}){return Pf(this,"next",n)},getPrev(n={}){return Pf(this,"prev",n)}};function cv(n,e){const i=e?new Set(e):void 0,r=[];function o(s){s.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||i===void 0||i.has(a.key))&&o(a.children)})}return o(n),r}function dv(n,e){const i=n.key;for(;e;){if(e.key===i)return!0;e=e.parent}return!1}var uv={};function Ff(n,e,i,r,o,s=null,a=0){const l=[];return n.forEach((c,d)=>{var u;uv.NODE_ENV!=="production"&&UC(c,o)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===n.length,f.parent=s,!f.ignored){const h=o(c);Array.isArray(h)&&(f.children=Ff(h,e,i,r,o,f,a+1))}l.push(f),e.set(f.key,f),i.has(a)||i.set(a,[]),(u=i.get(a))===null||u===void 0||u.push(f)}),l}function fv(n,e={}){var i;const r=new Map,o=new Map,{getDisabled:s=XC,getIgnored:a=jC,getIsGroup:l=ZC,getKey:c=WC}=e,d=(i=e.getChildren)!==null&&i!==void 0?i:HC,u=e.ignoreEmptyChildren?w=>{const C=d(w);return Array.isArray(C)?C.length?C:null:C}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return LC(this.rawNode,u)},get shallowLoaded(){return qC(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(w){return dv(this,w)}},lv),h=Ff(n,r,o,f,u);function p(w){if(w==null)return null;const C=r.get(w);return C&&!C.isGroup&&!C.ignored?C:null}function m(w){if(w==null)return null;const C=r.get(w);return C&&!C.ignored?C:null}function g(w,C){const N=m(w);return N?N.getPrev(C):null}function b(w,C){const N=m(w);return N?N.getNext(C):null}function y(w){const C=m(w);return C?C.getParent():null}function _(w){const C=m(w);return C?C.getChild():null}const x={treeNodes:h,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(w){return cv(h,w)},getNode:p,getPrev:g,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return rv(h)},getPath(w,C={}){return iv(w,C,x)},getCheckedKeys(w,C={}){const{cascade:N=!0,leafOnly:k=!1,checkStrategy:$="all",allowNotLoaded:v=!1}=C;return ja({checkedKeys:Ha(w),indeterminateKeys:Wa(w),cascade:N,leafOnly:k,checkStrategy:$,allowNotLoaded:v},x)},check(w,C,N={}){const{cascade:k=!0,leafOnly:$=!1,checkStrategy:v="all",allowNotLoaded:E=!1}=N;return ja({checkedKeys:Ha(C),indeterminateKeys:Wa(C),keysToCheck:w==null?[]:Ef(w),cascade:k,leafOnly:$,checkStrategy:v,allowNotLoaded:E},x)},uncheck(w,C,N={}){const{cascade:k=!0,leafOnly:$=!1,checkStrategy:v="all",allowNotLoaded:E=!1}=N;return ja({checkedKeys:Ha(C),indeterminateKeys:Wa(C),keysToUncheck:w==null?[]:Ef(w),cascade:k,leafOnly:$,checkStrategy:v,allowNotLoaded:E},x)},getNonLeafKeys(w={}){return DC(h,w)}};return x}function os(n){return n.composedPath()[0]}const hv={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function mv(n,e,i){if(n==="mousemoveoutside"){const r=o=>{e.contains(os(o))||i(o)};return{mousemove:r,touchstart:r}}else if(n==="clickoutside"){let r=!1;const o=a=>{r=!e.contains(os(a))},s=a=>{r&&(e.contains(os(a))||i(a))};return{mousedown:o,mouseup:s,touchstart:o,touchend:s}}return console.error(`[evtd/create-trap-handler]: name \`${n}\` is invalid. This could be a bug of evtd.`),{}}function Vf(n,e,i){const r=hv[n];let o=r.get(e);o===void 0&&r.set(e,o=new WeakMap);let s=o.get(i);return s===void 0&&o.set(i,s=mv(n,e,i)),s}function pv(n,e,i,r){if(n==="mousemoveoutside"||n==="clickoutside"){const o=Vf(n,e,i);return Object.keys(o).forEach(s=>{Lt(s,document,o[s],r)}),!0}return!1}function gv(n,e,i,r){if(n==="mousemoveoutside"||n==="clickoutside"){const o=Vf(n,e,i);return Object.keys(o).forEach(s=>{yt(s,document,o[s],r)}),!0}return!1}function yv(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const n=new WeakMap,e=new WeakMap;function i(){n.set(this,!0)}function r(){n.set(this,!0),e.set(this,!0)}function o(k,$,v){const E=k[$];return k[$]=function(){return v.apply(k,arguments),E.apply(k,arguments)},k}function s(k,$){k[$]=Event.prototype[$]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,$){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:$??l.get})}const u={bubble:{},capture:{}},f={};function h(){const k=function($){const{type:v,eventPhase:E,bubbles:P}=$,F=os($);if(E===2)return;const R=E===1?"capture":"bubble";let M=F;const X=[];for(;M===null&&(M=window),X.push(M),M!==window;)M=M.parentNode||null;const G=u.capture[v],Z=u.bubble[v];if(o($,"stopPropagation",i),o($,"stopImmediatePropagation",r),d($,c),R==="capture"){if(G===void 0)return;for(let O=X.length-1;O>=0&&!n.has($);--O){const A=X[O],Y=G.get(A);if(Y!==void 0){a.set($,A);for(const H of Y){if(e.has($))break;H($)}}if(O===0&&!P&&Z!==void 0){const H=Z.get(A);if(H!==void 0)for(const T of H){if(e.has($))break;T($)}}}}else if(R==="bubble"){if(Z===void 0)return;for(let O=0;O<X.length&&!n.has($);++O){const A=X[O],Y=Z.get(A);if(Y!==void 0){a.set($,A);for(const H of Y){if(e.has($))break;H($)}}}}s($,"stopPropagation"),s($,"stopImmediatePropagation"),d($)};return k.displayName="evtdUnifiedHandler",k}function p(){const k=function($){const{type:v,eventPhase:E}=$;if(E!==2)return;const P=f[v];P!==void 0&&P.forEach(F=>F($))};return k.displayName="evtdUnifiedWindowEventHandler",k}const m=h(),g=p();function b(k,$){const v=u[k];return v[$]===void 0&&(v[$]=new Map,window.addEventListener($,m,k==="capture")),v[$]}function y(k){return f[k]===void 0&&(f[k]=new Set,window.addEventListener(k,g)),f[k]}function _(k,$){let v=k.get($);return v===void 0&&k.set($,v=new Set),v}function x(k,$,v,E){const P=u[$][v];if(P!==void 0){const F=P.get(k);if(F!==void 0&&F.has(E))return!0}return!1}function w(k,$){const v=f[k];return!!(v!==void 0&&v.has($))}function C(k,$,v,E){let P;if(typeof E=="object"&&E.once===!0?P=G=>{N(k,$,P,E),v(G)}:P=v,pv(k,$,P,E))return;const R=E===!0||typeof E=="object"&&E.capture===!0?"capture":"bubble",M=b(R,k),X=_(M,$);if(X.has(P)||X.add(P),$===window){const G=y(k);G.has(P)||G.add(P)}}function N(k,$,v,E){if(gv(k,$,v,E))return;const F=E===!0||typeof E=="object"&&E.capture===!0,R=F?"capture":"bubble",M=b(R,k),X=_(M,$);if($===window&&!x($,F?"bubble":"capture",k,v)&&w(k,v)){const Z=f[k];Z.delete(v),Z.size===0&&(window.removeEventListener(k,g),f[k]=void 0)}X.has(v)&&X.delete(v),X.size===0&&M.delete($),M.size===0&&(window.removeEventListener(k,m,R==="capture"),u[R][k]=void 0)}return{on:C,off:N}}const{on:Lt,off:yt}=yv(),br="@@mmoContext",bv={mounted(n,{value:e}){n[br]={handler:void 0},typeof e=="function"&&(n[br].handler=e,Lt("mousemoveoutside",n,e))},updated(n,{value:e}){const i=n[br];typeof e=="function"?i.handler?i.handler!==e&&(yt("mousemoveoutside",n,i.handler),i.handler=e,Lt("mousemoveoutside",n,e)):(n[br].handler=e,Lt("mousemoveoutside",n,e)):i.handler&&(yt("mousemoveoutside",n,i.handler),i.handler=void 0)},unmounted(n){const{handler:e}=n[br];e&&yt("mousemoveoutside",n,e),n[br].handler=void 0}},_r="@@coContext",ss={mounted(n,{value:e,modifiers:i}){n[_r]={handler:void 0},typeof e=="function"&&(n[_r].handler=e,Lt("clickoutside",n,e,{capture:i.capture}))},updated(n,{value:e,modifiers:i}){const r=n[_r];typeof e=="function"?r.handler?r.handler!==e&&(yt("clickoutside",n,r.handler,{capture:i.capture}),r.handler=e,Lt("clickoutside",n,e,{capture:i.capture})):(n[_r].handler=e,Lt("clickoutside",n,e,{capture:i.capture})):r.handler&&(yt("clickoutside",n,r.handler,{capture:i.capture}),r.handler=void 0)},unmounted(n,{modifiers:e}){const{handler:i}=n[_r];i&&yt("clickoutside",n,i,{capture:e.capture}),n[_r].handler=void 0}};function _v(n,e){console.error(`[vdirs/${n}]: ${e}`)}class wv{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,i){const{elementZIndex:r}=this;if(i!==void 0){e.style.zIndex=`${i}`,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,i){const{elementZIndex:r}=this;r.has(e)?r.delete(e):i===void 0&&_v("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((i,r)=>i[1]-r[1]),this.nextZIndex=2e3,e.forEach(i=>{const r=i[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const Xa=new wv,wr="@@ziContext",Mf={mounted(n,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i;n[wr]={enabled:!!o,initialized:!1},o&&(Xa.ensureZIndex(n,r),n[wr].initialized=!0)},updated(n,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i,s=n[wr].enabled;o&&!s&&(Xa.ensureZIndex(n,r),n[wr].initialized=!0),n[wr].enabled=!!o},unmounted(n,e){if(!n[wr].initialized)return;const{value:i={}}=e,{zIndex:r}=i;Xa.unregister(n,r)}};function xv(n){const e=t.ref(!!n.value);if(e.value)return t.readonly(e);const i=t.watch(n,r=>{r&&(e.value=!0,i())});return t.readonly(e)}function fn(n){const e=t.computed(n),i=t.ref(e.value);return t.watch(e,r=>{i.value=r}),typeof n=="function"?i:{__v_isRef:!0,get value(){return i.value},set value(r){n.set(r)}}}const kv=typeof window<"u";let xr,Xr;(()=>{var n,e;xr=kv?(e=(n=document)===null||n===void 0?void 0:n.fonts)===null||e===void 0?void 0:e.ready:void 0,Xr=!1,xr!==void 0?xr.then(()=>{Xr=!0}):Xr=!0})();function Cv(n){if(Xr)return;let e=!1;t.onMounted(()=>{Xr||xr==null||xr.then(()=>{e||n()})}),t.onBeforeUnmount(()=>{e=!0})}function Ya(n,e){return t.watch(n,i=>{i!==void 0&&(e.value=i)}),t.computed(()=>n.value===void 0?e.value:n.value)}function as(){const n=t.ref(!1);return t.onMounted(()=>{n.value=!0}),t.readonly(n)}function If(n,e){return t.computed(()=>{for(const i of e)if(n[i]!==void 0)return n[i];return n[e[e.length-1]]})}const vv=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Sv(){return vv}function Ua(n,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${i}] is empty.`);return r()}function Ka(n,e=!0,i=[]){return n.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&i.push(t.createTextVNode(String(r)));return}if(Array.isArray(r)){Ka(r,e,i);return}if(r.type===t.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Ka(r.children,e,i)}else r.type!==t.Comment&&i.push(r)}}),i}function Af(n,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${i}] is empty.`);const o=Ka(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${n}]: slot[${i}] should have exactly one child.`)}let gi=null;function Of(){if(gi===null&&(gi=document.getElementById("v-binder-view-measurer"),gi===null)){gi=document.createElement("div"),gi.id="v-binder-view-measurer";const{style:n}=gi;n.position="fixed",n.left="0",n.right="0",n.top="0",n.bottom="0",n.pointerEvents="none",n.visibility="hidden",document.body.appendChild(gi)}return gi.getBoundingClientRect()}function Bv(n,e){const i=Of();return{top:e,left:n,height:0,width:0,right:i.width-n,bottom:i.height-e}}function Ga(n){const e=n.getBoundingClientRect(),i=Of();return{left:e.left-i.left,top:e.top-i.top,bottom:i.height+i.top-e.bottom,right:i.width+i.left-e.right,width:e.width,height:e.height}}function Nv(n){return n.nodeType===9?null:n.parentNode}function zf(n){if(n===null)return null;const e=Nv(n);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:i,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(i+o+r))return e}return zf(e)}const Df=t.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(n){var e;t.provide("VBinder",(e=t.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const i=t.inject("VBinder",null),r=t.ref(null),o=y=>{r.value=y,i&&n.syncTargetWithParent&&i.setTargetRef(y)};let s=[];const a=()=>{let y=r.value;for(;y=zf(y),y!==null;)s.push(y);for(const _ of s)Lt("scroll",_,f,!0)},l=()=>{for(const y of s)yt("scroll",y,f,!0);s=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},f=()=>{vf(h)},h=()=>{c.forEach(y=>y())},p=new Set,m=y=>{p.size===0&&Lt("resize",window,b),p.has(y)||p.add(y)},g=y=>{p.has(y)&&p.delete(y),p.size===0&&yt("resize",window,b)},b=()=>{p.forEach(y=>y())};return t.onBeforeUnmount(()=>{yt("resize",window,b),l()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:m,removeResizeListener:g}},render(){return Ua("binder",this.$slots)}}),Lf=t.defineComponent({name:"Target",setup(){const{setTargetRef:n,syncTarget:e}=t.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:n,updated:n}}},render(){const{syncTarget:n,setTargetDirective:e}=this;return n?t.withDirectives(Af("follower",this.$slots),[[e]]):Af("follower",this.$slots)}}),Tv="@css-render/vue3-ssr";function $v(n,e){return`<style cssr-id="${n}">
|
|
103
|
+
`}},Ao=Ni.Multiply,D0=[1,0,0,0,1,0,0,0,1],hi=new Bn(9),L0=Tt.Utils,Od=new ie,ya=new Bn([0,0,1,0,0,1,0,1,1,0,1,1]),Se={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Je.document?Je.document.createElement("canvas"):{getContext:function(){}},alignments:{left:"start",middle:"center",right:"end"},matrix:new Ni,group:{removeChild:function(n,e){if(n.children)for(let i=0;i<n.children.length;i++)Se.group.removeChild(n.children[i],e);n._renderer.texture&&(e.deleteTexture(n._renderer.texture),delete n._renderer.texture),n._renderer.positionBuffer&&(e.deleteBuffer(n._renderer.positionBuffer),delete n._renderer.positionBuffer)},render:function(n,e){if(!this._visible)return;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const i=this.parent,r=i._matrix&&i._matrix.manual||i._flagMatrix,o=this._matrix.manual||this._flagMatrix;if((r||o)&&(this._renderer.matrix||(this._renderer.matrix=new Bn(9)),this._matrix.toTransformArray(!0,hi),Ao(hi,i._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ie||(this._renderer.scale=new ie),this._scale instanceof ie?(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(i._renderer.type)||(this._renderer.scale.x*=i._renderer.scale.x,this._renderer.scale.y*=i._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask){n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST),n.stencilFunc(n.ALWAYS,1,0),n.stencilOp(n.KEEP,n.KEEP,n.REPLACE),n.colorMask(!1,!1,!1,!1);const a=Tt.Utils.getRendererType(this._mask._renderer.type);Se[a].render.call(this._mask,n,e,this),n.stencilFunc(n.EQUAL,1,255),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.colorMask(!0,!0,!0,!0)}this._flagOpacity=i._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(i&&i._renderer?i._renderer.opacity:1);let s;if(this._flagSubtractions)for(s=0;s<this.subtractions.length;s++)Se.group.removeChild(this.subtractions[s],n);for(s=0;s<this.children.length;s++){const a=this.children[s],l=Tt.Utils.getRendererType(a._renderer.type);Se[l].render.call(a,n,e)}return this._mask&&n.disable(n.STENCIL_TEST),re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(n,e){let i,r,o,s,a,l,c,d,u,f,h,p,m,g;const b=e._renderer.vertices,y=this.canvas,_=this.ctx,x=n.renderer.ratio,w=Od.copy(e._renderer.scale).multiply(x),C=e._stroke,N=e._linewidth,k=e._fill,$=e._renderer.opacity||e._opacity,v=e._cap,E=e._join,P=e._miter,F=e._closed,R=e.dashes,M=b.length,X=M-1;y.width=Math.max(Math.ceil(e._renderer.rect.width*w.x),1),y.height=Math.max(Math.ceil(e._renderer.rect.height*w.y),1);const G=e._renderer.rect.centroid,Z=G.x,O=G.y;if(_.clearRect(0,0,y.width,y.height),k)if(typeof k=="string")_.fillStyle=k;else{const q=Tt.Utils.getRendererType(k._renderer.type);Se[q].render.call(k,_,e),_.fillStyle=k._renderer.effect}if(C){if(typeof C=="string")_.strokeStyle=C;else{const q=Tt.Utils.getRendererType(C._renderer.type);Se[q].render.call(C,_,e),_.strokeStyle=C._renderer.effect}N&&(_.lineWidth=Nn(e)),P&&(_.miterLimit=P),E&&(_.lineJoin=E),!F&&v&&(_.lineCap=v)}typeof $=="number"&&(_.globalAlpha=$),R&&R.length>0&&(_.lineDashOffset=R.offset||0,_.setLineDash(R));let A,Y,H,T,D,K,J,U;_.save(),_.scale(w.x,w.y),_.translate(Z,O),_.beginPath();for(let q=0;q<b.length;q++){const L=b[q];switch(p=L.x,m=L.y,L.command){case ne.close:_.closePath();break;case ne.arc:Y=L.rx,H=L.ry,T=L.xAxisRotation,D=L.largeArcFlag,K=L.sweepFlag,i=F?ut(q-1,M):Math.max(q-1,0),r=b[i],J=r.x,U=r.y,L0.renderSvgArcCommand(_,J,U,Y,H,D,K,T,p,m);break;case ne.curve:i=F?ut(q-1,M):Math.max(q-1,0),r=b[i],d=r.controls&&r.controls.right||ie.zero,u=L.controls&&L.controls.left||ie.zero,r._relative?(l=d.x+r.x,c=d.y+r.y):(l=d.x,c=d.y),L._relative?(s=u.x+L.x,a=u.y+L.y):(s=u.x,a=u.y),_.bezierCurveTo(l,c,s,a,p,m),q>=X&&F&&(o=A,f=L.controls&&L.controls.right||ie.zero,h=o.controls&&o.controls.left||ie.zero,L._relative?(l=f.x+L.x,c=f.y+L.y):(l=f.x,c=f.y),o._relative?(s=h.x+o.x,a=h.y+o.y):(s=h.x,a=h.y),p=o.x,m=o.y,_.bezierCurveTo(l,c,s,a,p,m));break;case ne.line:_.lineTo(p,m);break;case ne.move:A=L,_.moveTo(p,m);break}}F&&_.closePath(),Se.isHidden.test(k)||(g=k._renderer&&k._renderer.offset,g&&(_.save(),_.translate(-k._renderer.offset.x,-k._renderer.offset.y),_.scale(k._renderer.scale.x,k._renderer.scale.y)),_.fill(),g&&_.restore()),Se.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(n,e,i){let r=1/0,o=-1/0,s=1/0,a=-1/0,l,c;n.forEach(function(d){const u=d.x,f=d.y,h=d.controls;let p,m,g,b,y,_;s=Math.min(f,s),r=Math.min(u,r),o=Math.max(u,o),a=Math.max(f,a),d.controls&&(y=h.left,_=h.right,!(!y||!_)&&(p=d._relative?y.x+u:y.x,m=d._relative?y.y+f:y.y,g=d._relative?_.x+u:_.x,b=d._relative?_.y+f:_.y,!(!p||!m||!g||!b)&&(s=Math.min(m,b,s),r=Math.min(p,g,r),o=Math.max(p,g,o),a=Math.max(m,b,a))))}),typeof e=="number"&&(s-=e,r-=e,o+=e,a+=e),l=o-r,c=a-s,i.top=s,i.left=r,i.right=o,i.bottom=a,i.width=l,i.height=c,i.centroid||(i.centroid={}),i.centroid.x=-r,i.centroid.y=-s},render:function(n,e,i){if(!this._visible||!this._opacity)return this;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=i||this.parent,o=Tt.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 et&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof tt&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof et&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof tt&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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 Bn(9)),this._matrix.toTransformArray(!0,hi),Ao(hi,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ie||(this._renderer.scale=new ie);let f,h;this._scale instanceof ie?(f=this._scale.x*r._renderer.scale.x,h=this._scale.y*r._renderer.scale.y):(f=this._scale*r._renderer.scale.x,h=this._scale*r._renderer.scale.y),this._renderer.scale.x=f<0?-f:f,this._renderer.scale.y=h<0?-h:h,c&&(this._renderer.parent=r)}if(this._mask){n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST),n.stencilFunc(n.ALWAYS,1,0),n.stencilOp(n.KEEP,n.KEEP,n.REPLACE),n.colorMask(!1,!1,!1,!1);const f=Tt.Utils.getRendererType(this._mask._renderer.type);Se[f].render.call(this._mask,n,e,this),n.stencilFunc(n.EQUAL,1,255),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.colorMask(!0,!0,!0,!0)}if(d?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,Se.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),Se.updateTexture.call(Se,n,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!this._renderer.texture)return this;e.current!==s&&(n.useProgram(s),n.bindBuffer(n.ARRAY_BUFFER,e.buffers.position),n.vertexAttribPointer(s.position,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(s.position),n.bufferData(n.ARRAY_BUFFER,ya,n.STATIC_DRAW),e.resolution.flagged||n.uniform2f(n.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&n.uniform2f(n.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),n.bindTexture(n.TEXTURE_2D,this._renderer.texture);const u=this._renderer.rect;return n.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),n.uniform4f(s.rect,u.left,u.top,u.right,u.bottom),n.drawArrays(n.TRIANGLES,0,6),this._mask&&n.disable(n.STENCIL_TEST),re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(n,e){let i;const r=this.canvas,o=this.ctx,s=n.renderer.ratio,a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,f=e._size*s;let h=f;Se.isHidden.test(a)||(h+=l),r.width=vc(h),r.height=r.width;const p=h/r.width,m=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 b=Tt.Utils.getRendererType(c._renderer.type);Se[b].render.call(c,o,e),o.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")o.strokeStyle=a;else{const b=Tt.Utils.getRendererType(a._renderer.type);Se[b].render.call(a,o,e),o.strokeStyle=a._renderer.effect}l&&(o.lineWidth=Nn(e)/p)}typeof d=="number"&&(o.globalAlpha=d),u&&u.length>0&&(o.lineDashOffset=u.offset||0,o.setLineDash(u)),o.save(),o.translate(m,g),o.scale(Se.precision,Se.precision),o.beginPath(),o.arc(0,0,f/p*.5,0,ot),o.restore(),closed&&o.closePath(),Se.isHidden.test(c)||(i=c._renderer&&c._renderer.offset,i&&(o.save(),o.translate(-c._renderer.offset.x,-c._renderer.offset.y),o.scale(c._renderer.scale.x,c._renderer.scale.y)),o.fill(),i&&o.restore()),Se.isHidden.test(a)||(i=a._renderer&&a._renderer.offset,i&&(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(),i&&o.restore())},render:function(n,e,i){if(!this._visible||!this._opacity)return this;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size;const o=i||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,f=this._renderer.parent!==o,h=this._renderer.vertices,p=this._renderer.collection.length,m=this._flagVertices,g=this._flagFill||this._fill instanceof et&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof tt&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof et&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof tt&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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||f){this._renderer.matrix||(this._renderer.matrix=new Bn(9)),this._matrix.toTransformArray(!0,hi),Ao(hi,o._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ie||(this._renderer.scale=new ie);let b,y;this._scale instanceof ie?(b=this._scale.x*o._renderer.scale.x,y=this._scale.y*o._renderer.scale.y):(b=this._scale*o._renderer.scale.x,y=this._scale*o._renderer.scale.y),this._renderer.scale.x=b<0?-b:b,this._renderer.scale.y=y<0?-y:y,f&&(this._renderer.parent=o)}if(m){const b=this._renderer.positionBuffer;b&&n.deleteBuffer(b),this._renderer.positionBuffer=n.createBuffer(),n.bindBuffer(n.ARRAY_BUFFER,this._renderer.positionBuffer),n.vertexAttribPointer(s.position,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(s.position),n.bufferData(n.ARRAY_BUFFER,h,n.STATIC_DRAW)}return g?(this._renderer.opacity=this._opacity*o._renderer.opacity,Se.updateTexture.call(Se,n,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!this._renderer.texture?this:(Se.isHidden.test(l)||(r+=c),r/=Se.precision,a&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),e.current!==s&&(n.useProgram(s),e.resolution.flagged||n.uniform2f(n.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),e.current=s),e.resolution.flagged&&n.uniform2f(n.getUniformLocation(s,"u_resolution"),e.resolution.width,e.resolution.height),n.bindTexture(n.TEXTURE_2D,this._renderer.texture),n.uniformMatrix3fv(s.matrix,!1,this._renderer.matrix),n.uniform1f(s.size,r*e.resolution.ratio),n.drawArrays(n.POINTS,0,p),re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(n,e){const i=this.canvas,r=this.ctx,o=n.renderer.ratio,s=Od.copy(e._renderer.scale).multiply(o),a=e._stroke,l=e._linewidth,c=e._fill,d=e._renderer.opacity||e._opacity,u=e.dashes,f=e._decoration,h=e._direction;i.width=Math.max(Math.ceil(e._renderer.rect.width*s.x),1),i.height=Math.max(Math.ceil(e._renderer.rect.height*s.y),1);const p=e._renderer.rect.centroid,m=p.x,g=p.y;let b,y,_,x,w,C,N,k,$,v,E;const P=c._renderer&&c._renderer.offset&&a._renderer&&a._renderer.offset;if(r.clearRect(0,0,i.width,i.height),P||(r.font=[e._style,e._weight,e._size+"px/"+e._leading+"px",e._family].join(" ")),r.textAlign="center",r.textBaseline="middle",r.textDirection=h,c)if(typeof c=="string")r.fillStyle=c;else{const F=Tt.Utils.getRendererType(c._renderer.type);Se[F].render.call(c,r,e),r.fillStyle=c._renderer.effect}if(a){if(typeof a=="string")r.strokeStyle=a;else{const F=Tt.Utils.getRendererType(a._renderer.type);Se[F].render.call(a,r,e),r.strokeStyle=a._renderer.effect}l&&(r.lineWidth=Nn(e))}if(typeof d=="number"&&(r.globalAlpha=d),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(s.x,s.y),r.translate(m,g),Se.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),b=e._size/c._renderer.scale.y,y=e._leading/c._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=c._renderer.offset.x/c._renderer.scale.x,x=c._renderer.offset.y/c._renderer.scale.y,r.fillText(e.value,_,x),r.restore()):r.fillText(e.value,0,0)),Se.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),b=e._size/a._renderer.scale.y,y=e._leading/a._renderer.scale.y,r.font=[e._style,e._weight,b+"px/",y+"px",e._family].join(" "),_=a._renderer.offset.x/a._renderer.scale.x,x=a._renderer.offset.y/a._renderer.scale.y,w=l/a._renderer.scale.x,r.lineWidth=w,r.strokeText(e.value,_,x),r.restore()):r.strokeText(e.value,0,0)),/(underline|strikethrough)/i.test(f)){const F=r.measureText(e.value);switch(f){case"underline":$=F.actualBoundingBoxDescent,E=F.actualBoundingBoxDescent;break;case"strikethrough":$=0,E=0;break}k=-F.width/2,v=F.width/2,r.lineWidth=Math.max(Math.floor(e._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(k,$),r.lineTo(v,E),r.stroke()}r.restore()},getBoundingClientRect:function(n,e){const i=Se.ctx;i.font=[n._style,n._weight,n._size+"px/"+n._leading+"px",n._family].join(" "),i.textAlign="center",i.textBaseline=Tt.Utils.baselines[n._baseline]||n._baseline;const r=i.measureText(n._value);let o=r.width,s=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!Se.isHidden.test(this._stroke)&&(o+=this._linewidth*2,s+=this._linewidth*2);const a=o/2,l=s/2;switch(Se.alignments[n._alignment]||n._alignment){case Se.alignments.left:n.direction==="ltr"?(e.left=0,e.right=o):(e.left=-o,e.right=0);break;case Se.alignments.right:n.direction==="ltr"?(e.left=-o,e.right=0):(e.left=0,e.right=o);break;default:e.left=-a,e.right=a}switch(n._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(n,e,i){if(!this._visible||!this._opacity)return this;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const r=i||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 et&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof tt&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof De&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof et&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof tt&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof De&&(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 Bn(9)),this._matrix.toTransformArray(!0,hi),Ao(hi,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof ie||(this._renderer.scale=new ie);let u,f;this._scale instanceof ie?(u=this._scale.x*r._renderer.scale.x,f=this._scale.y*r._renderer.scale.y):(u=this._scale*r._renderer.scale.x,f=this._scale*r._renderer.scale.y),this._renderer.scale.x=u<0?-u:u,this._renderer.scale.y=f<0?-f:f,l&&(this._renderer.parent=r)}if(this._mask){n.clear(n.STENCIL_BUFFER_BIT),n.enable(n.STENCIL_TEST),n.stencilFunc(n.ALWAYS,1,0),n.stencilOp(n.KEEP,n.KEEP,n.REPLACE),n.colorMask(!1,!1,!1,!1);const u=Tt.Utils.getRendererType(this._mask._renderer.type);Se[u].render.call(this._mask,n,e,this),n.stencilFunc(n.EQUAL,1,255),n.stencilOp(n.KEEP,n.KEEP,n.KEEP),n.colorMask(!0,!0,!0,!0)}if(c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,Se.text.getBoundingClientRect(this,this._renderer.rect),Se.updateTexture.call(Se,n,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!i||!this._renderer.texture)return this;e.current!==o&&(n.useProgram(o),n.bindBuffer(n.ARRAY_BUFFER,e.buffers.position),n.vertexAttribPointer(o.position,2,n.FLOAT,!1,0,0),n.enableVertexAttribArray(o.position),n.bufferData(n.ARRAY_BUFFER,ya,n.STATIC_DRAW),e.resolution.flagged||n.uniform2f(n.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),e.current=o),e.resolution.flagged&&n.uniform2f(n.getUniformLocation(o,"u_resolution"),e.resolution.width,e.resolution.height),n.bindTexture(n.TEXTURE_2D,this._renderer.texture);const d=this._renderer.rect;return n.uniformMatrix3fv(o.matrix,!1,this._renderer.matrix),n.uniform4f(o.rect,d.left,d.top,d.right,d.bottom),n.drawArrays(n.TRIANGLES,0,6),this._mask&&n.disable(n.STENCIL_TEST),re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(n,e){if(!(!n.canvas.getContext("2d")||!e)){if(re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let i,r=this.left._x,o=this.left._y,s=this.right._x,a=this.right._y;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width,o=(o-.5)*i.height,s=(s-.5)*i.width,a=(a-.5)*i.height),this._renderer.effect=n.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 re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(n,e){if(!(!n.canvas.getContext("2d")||!e)){if(re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let i,r=this.center._x,o=this.center._y,s=this.focal._x,a=this.focal._y,l=this._radius;/objectBoundingBox/i.test(this._units)&&(i=e.getBoundingClientRect(!0),r=(r-.5)*i.width*.5,o=(o-.5)*i.height*.5,s=(s-.5)*i.width*.5,a=(a-.5)*i.height*.5,l*=Math.min(i.width,i.height)),this._renderer.effect=n.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 re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(n,e){if(!n.canvas.getContext("2d"))return;re.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();const i=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=n.createPattern(i,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof ie||(this._renderer.offset=new ie),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,i&&(this._renderer.offset.x+=i.width/2,this._renderer.offset.y+=i.height/2,this._scale instanceof ie?(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 ie||(this._renderer.scale=new ie);let r,o;this._scale instanceof ie?(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 re.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(n,e){const i=Tt.Utils.getRendererType(e._renderer.type);if(this[i].updateCanvas.call(Se,n,e),this.canvas.width<=0||this.canvas.height<=0){e._renderer.texture&&n.deleteTexture(e._renderer.texture),delete e._renderer.texture;return}e._renderer.texture||(e._renderer.texture=n.createTexture()),n.bindTexture(n.TEXTURE_2D,e._renderer.texture),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,this.canvas),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR)},program:{create:function(n,e){let i,r,o;if(i=n.createProgram(),re.each(e,function(s){n.attachShader(i,s)}),n.linkProgram(i),r=n.getProgramParameter(i,n.LINK_STATUS),!r)throw o=n.getProgramInfoLog(i),n.deleteProgram(i),new Yt("unable to link program: "+o);return i}},extensions:{init:function(n){const e={},i=["EXT_texture_filter_anisotropic","WEBGL_compressed_texture_s3tc","OES_texture_float_linear","WEBGL_multisampled_render_to_texture"];for(let r=0;r<i.length;r++){const o=i[r];e[o]=Se.extensions.get(n,o)}return e},get:function(n,e){return n.getExtension(e)||n.getExtension(`MOZ_${e}`)||n.getExtension(`WEBKIT_${e}`)}},TextureRegistry:new bo};Se.ctx=Se.canvas.getContext("2d");var zd=class extends ee{constructor(n){super();let e,i,r,o;if(this.domElement=n.domElement||document.createElement("canvas"),typeof n.offscreenElement<"u"&&(Se.canvas=n.offscreenElement,Se.ctx=Se.canvas.getContext("2d")),this.scene=new xt,this.scene.parent=this,this._renderer={type:"renderer",matrix:new Bn(D0),scale:1,opacity:1},this._flagMatrix=!0,n=re.defaults(n||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=n.overdraw,e=this.ctx=this.domElement.getContext("webgl",n)||this.domElement.getContext("experimental-webgl",n),!this.ctx)throw new Yt("unable to create a webgl context. Try using another renderer.");r=un.create(e,un.path.vertex,un.types.vertex),o=un.create(e,un.path.fragment,un.types.fragment),this.programs={current:null,buffers:{position:e.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},i=this.programs.path=Se.program.create(e,[r,o]),this.programs.text=this.programs.path,e.extensions=Se.extensions.init(e),e.renderer=this,i.position=e.getAttribLocation(i,"a_position"),i.matrix=e.getUniformLocation(i,"u_matrix"),i.rect=e.getUniformLocation(i,"u_rect");const s=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,s),e.vertexAttribPointer(i.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(i.position),e.bufferData(e.ARRAY_BUFFER,ya,e.STATIC_DRAW),r=un.create(e,un.points.vertex,un.types.vertex),o=un.create(e,un.points.fragment,un.types.fragment),i=this.programs.points=Se.program.create(e,[r,o]),i.position=e.getAttribLocation(i,"a_position"),i.matrix=e.getUniformLocation(i,"u_matrix"),i.size=e.getUniformLocation(i,"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(n,e,i){let r,o;const s=this.ctx;return this.width=n,this.height=e,this.ratio=typeof i>"u"?qs(s):i,this.domElement.width=n*this.ratio,this.domElement.height=e*this.ratio,re.isObject(this.domElement.style)&&re.extend(this.domElement.style,{width:n+"px",height:e+"px"}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=n*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,n,e,i)}render(){const n=this.ctx;return this.overdraw||n.clear(n.COLOR_BUFFER_BIT),Se.group.render.call(this.scene,n,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};S(zd,"Utils",Se);var H0=re.extend({Error:Yt,getRatio:qs,read:Ze,xhr:Pd},re,At,wc,xc),Te=class ao{constructor(e){S(this,"_events",new ee),S(this,"type",""),S(this,"renderer",null),S(this,"scene",null),S(this,"width",0),S(this,"height",0),S(this,"frameCount",0),S(this,"timeDelta",0),S(this,"playing",!1);const i=re.defaults(e||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:ao.Types.svg,autostart:!1});if(re.each(i,function(r,o){/fullscreen/i.test(o)||/autostart/i.test(o)||(this[o]=r)},this),re.isElement(i.domElement)){const r=i.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+"-"+r)||(this.type=ao.Types[r])}this.renderer=new ao[this.type](this),this.setPlaying(i.autostart),this.frameCount=0,i.fullscreen?(this.fit=W0.bind(this),this.fit.domElement=window,this.fit.attached=!0,re.extend(document.body.style,{overflow:"hidden",margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:"fixed"}),re.extend(this.renderer.domElement.style,{display:"block",top:0,left:0,right:0,bottom:0,position:"fixed"}),tn.bind(this.fit.domElement,"resize",this.fit),this.fit()):i.fitted?(this.fit=j0.bind(this),re.extend(this.renderer.domElement.style,{display:"block"})):typeof i.width=="number"&&typeof i.height=="number"&&(this.renderer.setSize(i.width,i.height,this.ratio),this.width=i.width,this.height=i.height),this.renderer.bind(ee.Types.resize,q0.bind(this)),this.scene=this.renderer.scene,ao.Instances.push(this),i.autostart&&Ar.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,Ar.init(),this.trigger(ee.Types.play)}pause(){return this.playing=!1,this.trigger(ee.Types.pause)}setPlaying(e){this.playing=e}release(e){let i,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(i=0;i<e.vertices.length;i++)r=e.vertices[i],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(i=0;i<e.children.length;i++)o=e.children[i],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,i,r){return this.scene&&typeof this.scene.getShapesAtPoint=="function"?this.scene.getShapesAtPoint(e,i,r):[]}update(){const e=!!this._lastFrame,i=re.performance.now();e&&(this.timeDelta=parseFloat((i-this._lastFrame).toFixed(3))),this._lastFrame=i,this.fit&&this.fit.domElement&&!this.fit.attached&&(tn.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,i,r,o){const s=new Po(e,i,r,o);return this.scene.add(s),s}makeArrow(e,i,r,o,s){const a=typeof s=="number"?s:10,l=Math.atan2(o-i,r-e),c=[new Ee(e,i,void 0,void 0,void 0,void 0,ne.move),new Ee(r,o,void 0,void 0,void 0,void 0,ne.line),new Ee(r-a*Math.cos(l-Math.PI/4),o-a*Math.sin(l-Math.PI/4),void 0,void 0,void 0,void 0,ne.line),new Ee(r,o,void 0,void 0,void 0,void 0,ne.move),new Ee(r-a*Math.cos(l+Math.PI/4),o-a*Math.sin(l+Math.PI/4),void 0,void 0,void 0,void 0,ne.line)],d=new Pe(c,!1,!1,!0);return d.noFill(),d.cap="round",d.join="round",this.scene.add(d),d}makeRectangle(e,i,r,o){const s=new fi(e,i,r,o);return this.scene.add(s),s}makeRoundedRectangle(e,i,r,o,s){const a=new $o(e,i,r,o,s);return this.scene.add(a),a}makeCircle(e,i,r,o){const s=new No(e,i,r,o);return this.scene.add(s),s}makeEllipse(e,i,r,o,s){const a=new To(e,i,r,o,s);return this.scene.add(a),a}makeStar(e,i,r,o,s){const a=new la(e,i,r,o,s);return this.scene.add(a),a}makeCurve(e){const i=arguments.length;if(!Array.isArray(e)){e=[];for(let a=0;a<i;a+=2){const l=arguments[a];if(typeof l!="number")break;const c=arguments[a+1];e.push(new Ee(l,c))}}const r=arguments[i-1],o=new Pe(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,i,r,o){const s=new aa(e,i,r,o);return this.scene.add(s),s}makeArcSegment(e,i,r,o,s,a,l){const c=new ta(e,i,r,o,s,a,l);return this.scene.add(c),c}makePoints(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let s=0;s<i;s+=2){const a=arguments[s];if(typeof a!="number")break;const l=arguments[s+1];r.push(new ie(a,l))}}const o=new sa(r);return this.scene.add(o),o}makePath(e){const i=arguments.length;let r=e;if(!Array.isArray(e)){r=[];for(let l=0;l<i;l+=2){const c=arguments[l];if(typeof c!="number")break;const d=arguments[l+1];r.push(new Ee(c,d))}}const o=arguments[i-1],s=new Pe(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,i,r,o){const s=new Tn(e,i,r,o);return this.add(s),s}makeLinearGradient(e,i,r,o){const s=Array.prototype.slice.call(arguments,4),a=new et(e,i,r,o,s);return this.add(a),a}makeRadialGradient(e,i,r){const o=Array.prototype.slice.call(arguments,3),s=new tt(e,i,r,o);return this.add(s),s}makeSprite(e,i,r,o,s,a,l){const c=new Bo(e,i,r,o,s,a);return l&&c.play(),this.add(c),c}makeImage(e,i,r,o,s,a){const l=new Fd(e,i,r,o,s,a);return this.add(l),l}makeImageSequence(e,i,r,o,s){const a=new fa(e,i,r,o);return s&&a.play(),this.add(a),a}makeTexture(e,i){return new De(e,i)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));const i=new xt;return this.scene.add(i),i.add(e),i}interpret(e,i,r){const o=e.tagName.toLowerCase();if(r=typeof r<"u"?r:!0,!(o in Ze))return null;const s=Ze[o].call(this,e);return r?this.add(i&&s instanceof xt?s.children:s):s.parent&&s.remove(),s}load(e,i){const r=new xt;let o,s,a;const l=(function(c){for(tn.temp.innerHTML=c,s=0;s<tn.temp.children.length;s++)o=tn.temp.children[s],a=this.interpret(o,!1,!1),a!==null&&r.add(a);if(typeof i=="function"){const d=tn.temp.children.length<=1?tn.temp.children[0]:tn.temp.children;i(r,d)}}).bind(this);return/\.svg$/i.test(e)?(Pd(e,l),r):(l(e),r)}};S(Te,"NextFrameId",Bt.NextFrameId),S(Te,"Types",Bt.Types),S(Te,"Version",Bt.Version),S(Te,"PublishDate",Bt.PublishDate),S(Te,"Identifier",Bt.Identifier),S(Te,"Resolution",Bt.Resolution),S(Te,"AutoCalculateImportedMatrices",Bt.AutoCalculateImportedMatrices),S(Te,"Instances",Bt.Instances),S(Te,"uniqueId",Bt.uniqueId),S(Te,"Anchor",Ee),S(Te,"Collection",di),S(Te,"Events",ee),S(Te,"Group",xt),S(Te,"Matrix",Ni),S(Te,"Path",Pe),S(Te,"Registry",bo),S(Te,"Element",sr),S(Te,"Shape",qn),S(Te,"Text",Tn),S(Te,"Vector",ie),S(Te,"Gradient",pt),S(Te,"Image",Fd),S(Te,"ImageSequence",fa),S(Te,"LinearGradient",et),S(Te,"RadialGradient",tt),S(Te,"Sprite",Bo),S(Te,"Stop",ui),S(Te,"Texture",De),S(Te,"ArcSegment",ta),S(Te,"Circle",No),S(Te,"Ellipse",To),S(Te,"Line",Po),S(Te,"Points",sa),S(Te,"Polygon",aa),S(Te,"Rectangle",fi),S(Te,"RoundedRectangle",$o),S(Te,"Star",la),S(Te,"CanvasRenderer",Tt),S(Te,"SVGRenderer",Ad),S(Te,"WebGLRenderer",zd),S(Te,"Commands",ne),S(Te,"Utils",H0);var En=Te;function W0(){const n=document.body.getBoundingClientRect(),e=this.width=n.width,i=this.height=n.height;this.renderer.setSize(e,i,this.ratio)}function j0(){const n=this.renderer.domElement.parentElement;if(!n){console.warn("Two.js: Attempting to fit to parent, but no parent found.");return}const e=n.getBoundingClientRect(),i=this.width=e.width,r=this.height=e.height;this.renderer.setSize(i,r,this.ratio)}function q0(n,e){this.width=n,this.height=e,this.trigger(ee.Types.resize,n,e)}var Ar=tn.getRequestAnimationFrame();function Dd(){for(let n=0;n<En.Instances.length;n++){const e=En.Instances[n];e.playing&&e.update()}En.NextFrameId=Ar(Dd)}Ar.init=function(){Dd(),Ar.init=function(){}};let Rn;typeof window<"u"?Rn=window:typeof global<"u"?Rn=global:typeof self<"u"&&(Rn=self);let Ld;const nn=Math.PI*2,kt=Math.PI*.5;function X0(n,e,i,r,o,s){let a;return arguments.length<=1?(a=n.a,e=n.b,i=n.c,r=n.d,o=n.e,s=n.f):a=n,{translateX:o,translateY:s,scaleX:Math.sqrt(a*a+e*e),scaleY:Math.sqrt(i*i+r*r),rotation:180*Math.atan2(e,a)/Math.PI}}function Y0(n){Ld=n}function U0(n,e){e=e&&e.identity()||new Ld;let i=n;const r=[];for(;i&&i._matrix;)r.push(i._matrix),i=i.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 Kt(n,e,i){return i*(e-n)+n}function Gt(n,e){for(;n<0;)n+=e;return n%e}const Hd=Rn.Float32Array||Array,K0=Math.floor;function Pn(n){return K0(n*1e6)/1e6}const me={move:"M",line:"L",curve:"C",arc:"A",close:"Z"};class te{constructor(){B(this,"_events",{});B(this,"_bound",!1)}addEventListener(e,i){return(this._events[e]||(this._events[e]=[])).push(i),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,i){if(!this._events)return this;if(!e&&!i)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(i)for(let c=0,d=a.length;c<d;c++){let u=a[c];u=u.handler?u.handler:u,i!==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 i=Array.prototype.slice.call(arguments,1),r=this._events[e];if(r)for(let o=0;o<r.length;o++)r[o].call(this,...i);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,i,r){const o=this;e&&(s.obj=e,s.name=i,s.handler=r,e.on(i,s));function s(){r.apply(o,arguments)}return o}ignore(e,i,r){return e.off(i,r),this}}B(te,"Types",{play:"play",pause:"pause",update:"update",render:"render",resize:"resize",change:"change",remove:"remove",insert:"insert",order:"order",load:"load"}),B(te,"Methods",["addEventListener","on","removeEventListener","off","unbind","dispatchEvent","trigger","listen","ignore"]);const Wd={x:{enumerable:!0,get:function(){return this._x},set:function(n){this._x!==n&&(this._x=n,this._bound&&this.dispatchEvent(te.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(n){this._y!==n&&(this._y=n,this._bound&&this.dispatchEvent(te.Types.change))}}},vt=class vt extends te{constructor(i=0,r=0){super();B(this,"_x",0);B(this,"_y",0);for(let o in Wd)Object.defineProperty(this,o,Wd[o]);this.x=i,this.y=r}static add(i,r){return new vt(i.x+r.x,i.y+r.y)}static sub(i,r){return new vt(i.x-r.x,i.y-r.y)}static subtract(i,r){return vt.sub(i,r)}static ratioBetween(i,r){return(i.x*r.x+i.y*r.y)/(i.length()*r.length())}static angleBetween(i,r){if(arguments.length>=4){const a=arguments[0]-arguments[2],l=arguments[1]-arguments[3];return Math.atan2(l,a)}const o=i.x-r.x,s=i.y-r.y;return Math.atan2(s,o)}static distanceBetween(i,r){return Math.sqrt(vt.distanceBetweenSquared(i,r))}static distanceBetweenSquared(i,r){const o=i.x-r.x,s=i.y-r.y;return o*o+s*s}set(i,r){return this.x=i,this.y=r,this}copy(i){return this.x=i.x,this.y=i.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new vt(this.x,this.y)}add(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x+=i,this.y+=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x+=i.x,this.y+=i.y):(this.x+=i,this.y+=r),this)}addSelf(i){return this.add.apply(this,arguments)}sub(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x-=i,this.y-=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x-=i.x,this.y-=i.y):(this.x-=i,this.y-=r),this)}subtract(){return this.sub.apply(this,arguments)}subSelf(i){return this.sub.apply(this,arguments)}subtractSelf(i){return this.sub.apply(this,arguments)}multiply(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x*=i,this.y*=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x*=i.x,this.y*=i.y):(this.x*=i,this.y*=r),this)}multiplySelf(i){return this.multiply.apply(this,arguments)}multiplyScalar(i){return this.multiply(i)}divide(i,r){return arguments.length<=0?this:(arguments.length<=1?typeof i=="number"?(this.x/=i,this.y/=i):i&&typeof i.x=="number"&&typeof i.y=="number"&&(this.x/=i.x,this.y/=i.y):(this.x/=i,this.y/=r),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0),this)}divideSelf(i){return this.divide.apply(this,arguments)}divideScalar(i){return this.divide(i)}negate(){return this.multiply(-1)}dot(i){return this.x*i.x+this.y*i.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(i){return Math.sqrt(this.distanceToSquared(i))}distanceToSquared(i){const r=this.x-i.x,o=this.y-i.y;return r*r+o*o}setLength(i){return this.normalize().multiplyScalar(i)}equals(i,r){return r=typeof r>"u"?1e-4:r,this.distanceTo(i)<r}lerp(i,r){const o=(i.x-this.x)*r+this.x,s=(i.y-this.y)*r+this.y;return this.set(o,s)}isZero(i){return i=typeof i>"u"?1e-4:i,this.length()<i}toString(){return this.x+", "+this.y}toObject(){return{x:Pn(this.x),y:Pn(this.y)}}rotate(i){const r=this.x,o=this.y,s=Math.cos(i),a=Math.sin(i);return this.x=r*s-o*a,this.y=r*a+o*s,this}};B(vt,"zero",new vt),B(vt,"left",new vt(-1,0)),B(vt,"right",new vt(1,0)),B(vt,"up",new vt(0,-1)),B(vt,"down",new vt(0,1));let be=vt;class Ae extends be{constructor(i=0,r=0,o=0,s=0,a=0,l=0,c=me.move){super(i,r);B(this,"controls",{left:new be,right:new be});B(this,"_command",me.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 u in jd)Object.defineProperty(this,u,jd[u]);this.command=c,this.relative=!0;const d=Ae.makeBroadcast(this);this.controls.left.set(o,s).addEventListener(te.Types.change,d),this.controls.right.set(a,l).addEventListener(te.Types.change,d)}static makeBroadcast(i){return r;function r(){i._bound&&i.dispatchEvent(te.Types.change)}}static fromObject(i){return new Ae().copy(i)}copy(i){return this.x=i.x,this.y=i.y,typeof i.command=="string"&&(this.command=i.command),i.controls&&(i.controls.left&&this.controls.left.copy(i.controls.left),i.controls.right&&this.controls.right.copy(i.controls.right)),typeof i.relative=="boolean"&&(this.relative=i.relative),typeof i.rx=="number"&&(this.rx=i.rx),typeof i.ry=="number"&&(this.ry=i.ry),typeof i.xAxisRotation=="number"&&(this.xAxisRotation=i.xAxisRotation),typeof i.largeArcFlag=="number"&&(this.largeArcFlag=i.largeArcFlag),typeof i.sweepFlag=="number"&&(this.sweepFlag=i.sweepFlag),this}clone(){return new Ae().copy(this)}toObject(){return{x:Pn(this.x),y:Pn(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:Pn(this.rx),ry:Pn(this.ry),xAxisRotation:Pn(this.xAxisRotation),largeArcFlag:Pn(this.largeArcFlag),sweepFlag:Pn(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}}const jd={command:{enumerable:!0,get:function(){return this._command},set:function(n){this._command!==n&&(this._command=n,this._bound&&this.dispatchEvent(te.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(n){this._relative!==!!n&&(this._relative=!!n,this._bound&&this.dispatchEvent(te.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(n){this._rx!==n&&(this._rx=n,this._bound&&this.dispatchEvent(te.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(n){this._ry!==n&&(this._ry=n,this._bound&&this.dispatchEvent(te.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(n){this._xAxisRotation!==n&&(this._xAxisRotation=n,this._bound&&this.dispatchEvent(te.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(n){this._largeArcFlag!==n&&(this._largeArcFlag=n,this._bound&&this.dispatchEvent(te.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(n){this._sweepFlag!==n&&(this._sweepFlag=n,this._bound&&this.dispatchEvent(te.Types.change))}}};let G0=0;const Oo={NextFrameId:null,Types:{webgl:"WebGLRenderer",svg:"SVGRenderer",canvas:"CanvasRenderer"},Version:"<%= version %>",PublishDate:"<%= publishDate %>",Identifier:"two-",Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return G0++}},zo={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 Do(n,e,i,r,o){const s=1-n;return s*s*s*e+3*s*s*n*i+3*s*n*n*r+n*n*n*o}function qd(n,e,i,r,o,s,a,l,c){c=c||zo.RecursionLimit;const d=c+1;if(Math.abs(n-a)<.001&&Math.abs(e-l)<.001)return[new Ae(a,l)];const u=[];for(let f=0;f<d;f++){const h=f/d,p=Do(h,n,i,o,a),m=Do(h,e,r,s,l);u.push(new Ae(p,m))}return u}function Z0(n,e,i,r,o,s,a,l,c){if(n===i&&e===r&&o===a&&s===l){const b=a-n,y=l-e;return Math.sqrt(b*b+y*y)}const d=9*(i-o)+3*(a-n),u=6*(n+o)-12*i,f=3*(i-n),h=9*(r-s)+3*(l-e),p=6*(e+s)-12*r,m=3*(r-e);function g(b){const y=(d*b+u)*b+f,_=(h*b+p)*b+m;return Math.sqrt(y*y+_*_)}return J0(g,0,1,c||zo.RecursionLimit)}function Q0(n,e,i,r,o,s,a,l){const c=[],d=[[],[]];let u,f,h,p,m,g,b,y;for(let C=0;C<2;++C){if(C===0?(f=6*n-12*i+6*o,u=-3*n+9*i-9*o+3*a,h=3*i-3*n):(f=6*e-12*r+6*s,u=-3*e+9*r-9*s+3*l,h=3*r-3*e),Math.abs(u)<.001){if(Math.abs(f)<.001)continue;p=-h/f,0<p&&p<1&&c.push(p);continue}b=f*f-4*h*u,y=Math.sqrt(b),!(b<0)&&(m=(-f+y)/(2*u),0<m&&m<1&&c.push(m),g=(-f-y)/(2*u),0<g&&g<1&&c.push(g))}let _=c.length,x=_,w;for(;_--;)p=c[_],w=1-p,d[0][_]=w*w*w*n+3*w*w*p*i+3*w*p*p*o+p*p*p*a,d[1][_]=w*w*w*e+3*w*w*p*r+3*w*p*p*s+p*p*p*l;return d[0][x]=n,d[1][x]=e,d[0][x+1]=a,d[1][x+1]=l,d[0].length=d[1].length=x+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 J0(n,e,i,r){let o=zo.abscissas[r-2],s=zo.weights[r-2],a=.5*(i-e),l=a+e,c=0,d=r+1>>1,u=r&1?s[c++]*n(l):0;for(;c<d;){const f=a*o[c];u+=s[c++]*(n(l+f)+n(l-f))}return a*u}function e1(n,e){const i=n.length,r=i-1;for(let o=0;o<i;o++){const s=n[o],a=e?Gt(o-1,i):Math.max(o-1,0),l=e?Gt(o+1,i):Math.min(o+1,r),c=n[a],d=s,u=n[l];t1(c,d,u),d.command=o===0?me.move:me.curve}}function t1(n,e,i){const r=be.angleBetween(n,e),o=be.angleBetween(i,e);let s=be.distanceBetween(n,e),a=be.distanceBetween(i,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+=kt:l-=kt,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 Or=(qi=class extends te{constructor(){super();B(this,"_flagId",!1);B(this,"_flagClassName",!1);B(this,"_renderer",{});B(this,"_id",Oo.Identifier+Oo.uniqueId());B(this,"_className","");B(this,"classList",[]);for(let i in Xd)Object.defineProperty(this,i,Xd[i])}static fromObject(i){const r=new qi().copy(i);return"id"in i&&(r.id=i.id),r}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(i){return i.renderer&&typeof i.renderer.type=="string"&&(this.renderer.type=i.renderer.type),typeof i.className=="string"&&(this.className=i.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 i=this._renderer.type;return this._renderer={type:i},this}},B(qi,"Properties",["renderer","id","className"]),qi);const Xd={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(n){const e=this._id;n!==this._id&&(this._id=n,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(n){this._className!==n&&(this._flagClassName=!0,this.classList=n.split(/\s+?/),this._className=n)}}};class Lo extends Error{constructor(i){super();B(this,"name","Two.js");B(this,"message");this.message=i}}class n1{constructor(){B(this,"map",{})}add(e,i){return this.map[e]=i,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}}let Ho;const Yd={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Rn.document&&(Ho=document.createElement("a"));const it=class it extends Or{constructor(i,r){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 o in Ud)Object.defineProperty(this,o,Ud[o]);if(this._renderer.type="texture",this._renderer.flagOffset=i1.bind(this),this._renderer.flagScale=r1.bind(this),this.loaded=!1,this.repeat="no-repeat",this.offset=new be,typeof r=="function"){const o=(function(){this.unbind(te.Types.load,o),typeof r=="function"&&r()}).bind(this);this.bind(te.Types.load,o)}if(typeof i=="string")this.src=i;else if(typeof i=="object"){const o=Object.prototype.toString.call(i);(o==="[object HTMLImageElement]"||o==="[object HTMLCanvasElement]"||o==="[object HTMLVideoElement]"||o==="[object Image]")&&(this.image=i)}this._update()}fromObject(i){const r=new it().copy(i);return"id"in i&&(r.id=i.id),r}static getAbsoluteURL(i){return Ho?(Ho.href=i,Ho.href):i}static loadHeadlessBuffer(i,r){i.image.onload=r,i.image.src=i.src}static getTag(i){return i&&i.nodeName&&i.nodeName.toLowerCase()||"img"}static getImage(i){const r=it.getAbsoluteURL(i);if(it.ImageRegistry.contains(r))return it.ImageRegistry.get(r);let o;return Rn.document?Yd.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(i,r){let o=i.image,s=it.getTag(o);i._flagImage&&(/canvas/i.test(s)?it.Register.canvas(i,r):(i._src=o.getAttribute("two-src")||o.src,it.Register[s](i,r))),i._flagSrc&&(o||(o=it.getImage(i.src),i.image=o),s=it.getTag(o),it.Register[s](i,r))}clone(){const i=new it(this.src);return i.repeat=this.repeat,i.offset.copy(this.offset),i.scale=this.scale,i}copy(i){return this.src=i.src,this.repeat=i.repeat,this.offset=typeof i.offset=="number"||i.offset instanceof be?i.offset:new be().copy(i.offset),this.scale=typeof i.scale=="number"||i.scale instanceof be?i.scale:new be().copy(i.scale),this}toObject(){const i=super.toObject.call(this);return i.renderer.type="texture",i.src=this.src,i.repeat=this.repeat,i.offset=this.offset.toObject(),i.scale=typeof this.scale=="number"?this.scale:this.scale.toObject(),i}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(te.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,it.load(this,(function(){this.loaded=!0,this.trigger(te.Types.change).trigger(te.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 i=this._renderer.elem;i.parentNode.removeChild(i)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};B(it,"Properties",["src","loaded","repeat","scale","offset","image"]),B(it,"RegularExpressions",Yd),B(it,"ImageRegistry",new n1),B(it,"Register",{canvas:function(i,r){i._src="#"+i.id,it.ImageRegistry.add(i.src,i.image),typeof r=="function"&&r()},img:function(i,r){const o=i.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 Lo("unable to load "+i.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)),i._src=it.getAbsoluteURL(i._src),!(o&&o.getAttribute("two-src"))&&(o.setAttribute("two-src",i.src),it.ImageRegistry.add(i.src,o),i.image.src=i.src)},video:function(i,r){const o=function(a){i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),i.image.width=i.image.videoWidth,i.image.height=i.image.videoHeight,typeof r=="function"&&r()},s=function(a){throw i.image.removeEventListener("canplaythrough",o,!1),i.image.removeEventListener("error",s,!1),new Lo("unable to load "+i.src)};i._src=it.getAbsoluteURL(i._src),i.image.getAttribute("two-src")||(i.image.setAttribute("two-src",i.src),it.ImageRegistry.add(i.src,i.image)),i.image.readyState>=4?o():(i.image.addEventListener("canplaythrough",o,!1),i.image.addEventListener("error",s,!1),i.image.src=i.src,i.image.load())}});let nt=it;const Ud={src:{enumerable:!0,get:function(){return this._src},set:function(n){this._src=n,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(n){this._loaded=n,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(n){this._repeat=n,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(n){const e=nt.getTag(n);let i;switch(e){case"canvas":i="#"+n.id;break;default:i=n.src}nt.ImageRegistry.contains(i)?this._image=nt.ImageRegistry.get(n.src):this._image=n,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(n){this._offset&&this._offset.unbind(te.Types.change,this._renderer.flagOffset),this._offset=n,this._offset.bind(te.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(n){this._scale instanceof be&&this._scale.unbind(te.Types.change,this._renderer.flagScale),this._scale=n,this._scale instanceof be&&this._scale.bind(te.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function i1(){this._flagOffset=!0}function r1(){this._flagScale=!0}class Ti extends Array{constructor(){super();Hl(this,St,new te);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 qt(this,St)}set _events(i){$m(this,St,i)}get _bound(){return qt(this,St)._bound}set _bound(i){qt(this,St)._bound=i}addEventListener(){var i;return(i=qt(this,St).addEventListener)==null?void 0:i.apply(this,arguments)}on(){var i;return(i=qt(this,St).on)==null?void 0:i.apply(this,arguments)}bind(){var i;return(i=qt(this,St).bind)==null?void 0:i.apply(this,arguments)}removeEventListener(){var i;return(i=qt(this,St).removeEventListener)==null?void 0:i.apply(this,arguments)}off(){var i;return(i=qt(this,St).off)==null?void 0:i.apply(this,arguments)}unbind(){var i;return(i=qt(this,St).unbind)==null?void 0:i.apply(this,arguments)}dispatchEvent(){var i;return(i=qt(this,St).dispatchEvent)==null?void 0:i.apply(this,arguments)}trigger(){var i;return(i=qt(this,St).trigger)==null?void 0:i.apply(this,arguments)}listen(){var i;return(i=qt(this,St).listen)==null?void 0:i.apply(this,arguments)}ignore(){var i;return(i=qt(this,St).ignore)==null?void 0:i.apply(this,arguments)}pop(){const i=super.pop.apply(this,arguments);return this.trigger(te.Types.remove,[i]),i}shift(){const i=super.shift.apply(this,arguments);return this.trigger(te.Types.remove,[i]),i}push(){const i=super.push.apply(this,arguments);return this.trigger(te.Types.insert,arguments),i}unshift(){const i=super.unshift.apply(this,arguments);return this.trigger(te.Types.insert,arguments),i}splice(){const i=super.splice.apply(this,arguments);if(this.trigger(te.Types.remove,i),arguments.length>2){const r=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(te.Types.insert,r),this.trigger(te.Types.order)}return i}sort(){return super.sort.apply(this,arguments),this.trigger(te.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(te.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(i,r){const o=[];for(let s=0;s<this.length;s++){const a=this[s];let l;r?l=i.call(r,a,s):l=i(a,s),o.push(l)}return o}}St=new WeakMap;const Kd=Array.prototype.slice;function o1(n){if(n==null)return!1;const e=n.length;return typeof e=="number"&&e>=0&&e<4294967296}const je={isNaN:function(n){return typeof n=="number"&&n!==+n},isElement:function(n){return!!(n&&n.nodeType===1)},isObject:function(n){const e=typeof n;return e==="function"||e==="object"&&!!n},isFunction:function(n){return typeof n=="function"},extend:function(n){const e=Kd.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)n[o]=r[o]}return n},defaults:function(n){const e=Kd.call(arguments,1);for(let i=0;i<e.length;i++){const r=e[i];for(let o in r)n[o]===void 0&&(n[o]=r[o])}return n},each:function(n,e,i){const r=i||this,o=!o1(n)&&Object.keys(n),s=(o||n).length;for(let a=0;a<s;a++){const l=o?o[a]:a;e.call(r,n[l],l,n)}return n},performance:Rn.performance&&Rn.performance.now?Rn.performance:Date},Jt=class Jt extends Or{constructor(i,r,o){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 s in Gd)Object.defineProperty(this,s,Gd[s]);this._renderer.type="stop",this.offset=typeof i=="number"?i:Jt.Index<=0?0:1,this.opacity=typeof o=="number"?o:1,this.color=typeof r=="string"?r:Jt.Index<=0?"#fff":"#000",Jt.Index=(Jt.Index+1)%2}static fromObject(i){const r=new Jt().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Jt.Properties.length;r++){const o=Jt.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Jt;return je.each(Jt.Properties,function(o){r[o]=this[o]},this),i&&i.stops&&i.stops.push(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="stop",je.each(Jt.Properties,r=>{i[r]=this[r]},this),i}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};B(Jt,"Index",0),B(Jt,"Properties",["offset","opacity","color"]);let $i=Jt;const Gd={offset:{enumerable:!0,get:function(){return this._offset},set:function(n){this._offset=n,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._opacity=n,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(n){this._color=n,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},On=class On extends Or{constructor(i){super();B(this,"_flagStops",!1);B(this,"_flagSpread",!1);B(this,"_flagUnits",!1);B(this,"_spread","");B(this,"_units","");for(let r in Zd)Object.defineProperty(this,r,Zd[r]);this._renderer.type="gradient",this._renderer.flagStops=s1.bind(this),this._renderer.bindStops=a1.bind(this),this._renderer.unbindStops=l1.bind(this),this.spread="pad",this.units="objectBoundingBox",i&&(this.stops=i)}static fromObject(i){let r=i.stops;r&&r.length>0&&(r=r.map(s=>s instanceof $i?s:new $i().copy(s)));const o=new On(r).copy(i);return"id"in i&&(o.id=i.id),o}clone(i){const r=this.stops.map(s=>s.clone()),o=new On(r);return je.each(On.Properties,s=>{o[s]=this[s]},this),i&&i.add(o),o}copy(i){super.copy.call(this,i);for(let r=0;r<On.Properties.length;r++){const o=On.Properties[r];o in i&&(this[o]=i[o])}return this}toObject(){const i={stops:this.stops.map(r=>r.toObject())};return je.each(On.Properties,r=>{i[r]=this[r]},this),i}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(te.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if("elem"in this._renderer){const i=this._renderer.elem;i.parentNode.removeChild(i)}return"effect"in this._renderer&&(this._renderer.effect=null),this}};B(On,"Stop",$i),B(On,"Properties",["spread","stops","units"]);let gt=On;const Zd={spread:{enumerable:!0,get:function(){return this._spread},set:function(n){this._spread=n,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(n){this._units=n,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(n){const e=this._renderer.bindStops,i=this._renderer.unbindStops;this._stops&&this._stops.unbind(te.Types.insert,e).unbind(te.Types.remove,i),this._stops=new Ti((n||[]).slice(0)),this._stops.bind(te.Types.insert,e).bind(te.Types.remove,i),e(this._stops)}}};function s1(){this._flagStops=!0}function a1(n){let e=n.length;for(;e--;)n[e].bind(te.Types.change,this._renderer.flagStops),n[e].parent=this;this._renderer.flagStops()}function l1(n){let e=n.length;for(;e--;)n[e].unbind(te.Types.change,this._renderer.flagStops),delete n[e].parent;this._renderer.flagStops()}const _i=class _i extends gt{constructor(i,r,o,s,a){super(a);B(this,"_flagEndPoints",!1);B(this,"_left",null);B(this,"_right",null);for(let l in Qd)Object.defineProperty(this,l,Qd[l]);this._renderer.type="linear-gradient",this._renderer.flagEndPoints=c1.bind(this),this.left=new be,this.right=new be,typeof i=="number"&&(this.left.x=i),typeof r=="number"&&(this.left.y=r),typeof o=="number"&&(this.right.x=o),typeof s=="number"&&(this.right.y=s)}static fromObject(i){const r=new _i().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<_i.Properties.length;r++){const o=_i.Properties[r];o in i&&(this[o]=i[o]instanceof be?i[o]:new be().copy(i[o]))}return this}clone(i){const r=this.stops.map(function(s){return s.clone()}),o=new _i(this.left._x,this.left._y,this.right._x,this.right._y,r);return je.each(gt.Properties,function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return i.left=this.left.toObject(),i.right=this.right.toObject(),i}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(te.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};B(_i,"Stop",$i),B(_i,"Properties",["left","right"]);let zt=_i;const Qd={left:{enumerable:!0,get:function(){return this._left},set:function(n){this._left instanceof be&&this._left.unbind(te.Types.change,this._renderer.flagEndPoints),this._left=n,this._left.bind(te.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(n){this._right instanceof be&&this._right.unbind(te.Types.change,this._renderer.flagEndPoints),this._right=n,this._right.bind(te.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function c1(){this._flagEndPoints=!0}const zn=class zn extends gt{constructor(i,r,o,s,a,l){super(s);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 c in Jd)Object.defineProperty(this,c,Jd[c]);this._renderer.type="radial-gradient",this._renderer.flagCenter=d1.bind(this),this._renderer.flagFocal=u1.bind(this),this.center=new be,this.radius=typeof o=="number"?o:1,this.focal=new be,typeof i=="number"&&(this.center.x=i),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(i){const r=new zn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<zn.Properties.length;r++){const o=zn.Properties[r];o in i&&(/(center|focal)i/.test(o)?this[o]=i[o]instanceof be?i[o]:new be().copy(i[o]):typeof i[o]=="number"&&(this[o]=i[MediaKeySystemAccess]))}return this}clone(i){const r=this.stops.map(function(s){return s.clone()}),o=new zn(this.center._x,this.center._y,this._radius,r,this.focal._x,this.focal._y);return je.each(gt.Properties.concat(zn.Properties),function(s){o[s]=this[s]},this),i&&i.add(o),o}toObject(){const i=super.toObject.call(this);return je.each(zn.Properties,function(r){i[r]=this[r]},this),i.center=this.center.toObject(),i.focal=this.focal.toObject(),i}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(te.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};B(zn,"Stop",$i),B(zn,"Properties",["center","radius","focal"]);let Dt=zn;const Jd={radius:{enumerable:!0,get:function(){return this._radius},set:function(n){this._radius=n,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(n){this._center&&this._center.unbind(te.Types.change,this._renderer.flagCenter),this._center=n,this._center.bind(te.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(n){this._focal&&this._focal.unbind(te.Types.change,this._renderer.flagFocal),this._focal=n,this._focal.bind(te.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function d1(){this._flagCenter=!0}function u1(){this._flagFocal=!0}function eu(n,e){if(e===0||e===1)return!0;const r=n._length*e;let o=0;for(let s=0;s<n._lengths.length;s++){const a=n._lengths[s];if(o>=r)return r-o>=0;o+=a}return!1}function Wo(n,e){const i=n._length;if(e<=0)return 0;if(e>=i)return n._lengths.length-1;for(let r=0,o=0;r<n._lengths.length;r++){if(o+n._lengths[r]>=e)return e-=o,Math.max(r-1,0)+e/n._lengths[r];o+=n._lengths[r]}return-1}function tu(n,e,i){let r,o,s,a,l,c,d,u;const f=e.controls&&e.controls.right,h=n.controls&&n.controls.left;return r=e.x,l=e.y,o=(f||e).x,c=(f||e).y,s=(h||n).x,d=(h||n).y,a=n.x,u=n.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&n._relative&&(s+=n.x,d+=n.y),Z0(r,l,o,c,s,d,a,u,i)}function ba(n,e,i){let r,o,s,a,l,c,d,u;const f=e.controls&&e.controls.right,h=n.controls&&n.controls.left;return r=e.x,l=e.y,o=(f||e).x,c=(f||e).y,s=(h||n).x,d=(h||n).y,a=n.x,u=n.y,f&&e._relative&&(o+=e.x,c+=e.y),h&&n._relative&&(s+=n.x,d+=n.y),qd(r,l,o,c,s,d,a,u,i)}function Ei(n){switch(n.renderer.type){case"texture":return nt.fromObject(n);case"gradient":return gt.fromObject(n);case"linear-gradient":return zt.fromObject(n);case"radial-gradient":return Dt.fromObject(n)}return n}const f1=Math.cos,h1=Math.sin,nu=Math.tan,_a=[],Ht=class Ht extends te{constructor(i,r,o,s,a,l){super();B(this,"elements",new Hd(9));B(this,"manual",!1);let c=i;Array.isArray(c)||(c=Array.prototype.slice.call(arguments)),this.identity(),c.length>0&&this.set(c)}static Multiply(i,r,o){if(r.length<=3){const k=i;let $,v,E;const P=r[0]||0,F=r[1]||0,R=r[2]||0;return $=k[0]*P+k[1]*F+k[2]*R,v=k[3]*P+k[4]*F+k[5]*R,E=k[6]*P+k[7]*F+k[8]*R,[$,v,E]}const s=i[0],a=i[1],l=i[2],c=i[3],d=i[4],u=i[5],f=i[6],h=i[7],p=i[8],m=r[0],g=r[1],b=r[2],y=r[3],_=r[4],x=r[5],w=r[6],C=r[7],N=r[8];return o=o||new Hd(9),o[0]=s*m+a*y+l*w,o[1]=s*g+a*_+l*C,o[2]=s*b+a*x+l*N,o[3]=c*m+d*y+u*w,o[4]=c*g+d*_+u*C,o[5]=c*b+d*x+u*N,o[6]=f*m+h*y+p*w,o[7]=f*g+h*_+p*C,o[8]=f*b+h*x+p*N,o}static fromObject(i){return new Ht().copy(i)}set(i,r,o,s,a,l,c,d,u){if(typeof r>"u"){const f=i;i=f[0],r=f[1],o=f[2],s=f[3],a=f[4],l=f[5],c=f[6],d=f[7],u=f[8]}return this.elements[0]=i,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(te.Types.change)}copy(i){return this.elements[0]=i.elements[0],this.elements[1]=i.elements[1],this.elements[2]=i.elements[2],this.elements[3]=i.elements[3],this.elements[4]=i.elements[4],this.elements[5]=i.elements[5],this.elements[6]=i.elements[6],this.elements[7]=i.elements[7],this.elements[8]=i.elements[8],this.manual=i.manual,this.trigger(te.Types.change)}identity(){return this.elements[0]=Ht.Identity[0],this.elements[1]=Ht.Identity[1],this.elements[2]=Ht.Identity[2],this.elements[3]=Ht.Identity[3],this.elements[4]=Ht.Identity[4],this.elements[5]=Ht.Identity[5],this.elements[6]=Ht.Identity[6],this.elements[7]=Ht.Identity[7],this.elements[8]=Ht.Identity[8],this.trigger(te.Types.change)}multiply(i,r,o,s,a,l,c,d,u){if(typeof r>"u")return this.elements[0]*=i,this.elements[1]*=i,this.elements[2]*=i,this.elements[3]*=i,this.elements[4]*=i,this.elements[5]*=i,this.elements[6]*=i,this.elements[7]*=i,this.elements[8]*=i,this.trigger(te.Types.change);if(typeof o>"u"&&(o=1),typeof s>"u"){i=i||0,r=r||0,o=o||0,a=this.elements;const X=a[0]*i+a[1]*r+a[2]*o,G=a[3]*i+a[4]*r+a[5]*o,Z=a[6]*i+a[7]*r+a[8]*o;return[X,G,Z]}const f=this.elements,h=[i,r,o,s,a,l,c,d,u],p=f[0],m=f[1],g=f[2],b=f[3],y=f[4],_=f[5],x=f[6],w=f[7],C=f[8],N=h[0],k=h[1],$=h[2],v=h[3],E=h[4],P=h[5],F=h[6],R=h[7],M=h[8];return this.elements[0]=p*N+m*v+g*F,this.elements[1]=p*k+m*E+g*R,this.elements[2]=p*$+m*P+g*M,this.elements[3]=b*N+y*v+_*F,this.elements[4]=b*k+y*E+_*R,this.elements[5]=b*$+y*P+_*M,this.elements[6]=x*N+w*v+C*F,this.elements[7]=x*k+w*E+C*R,this.elements[8]=x*$+w*P+C*M,this.trigger(te.Types.change)}inverse(i){const r=this.elements;i=i||new Ht;const o=r[0],s=r[1],a=r[2],l=r[3],c=r[4],d=r[5],u=r[6],f=r[7],h=r[8],p=h*c-d*f,m=-h*l+d*u,g=f*l-c*u;let b=o*p+s*m+a*g;return b?(b=1/b,i.elements[0]=p*b,i.elements[1]=(-h*s+a*f)*b,i.elements[2]=(d*s-a*c)*b,i.elements[3]=m*b,i.elements[4]=(h*o-a*u)*b,i.elements[5]=(-d*o+a*l)*b,i.elements[6]=g*b,i.elements[7]=(-f*o+s*u)*b,i.elements[8]=(c*o-s*l)*b,i):null}scale(i,r){return arguments.length<=1&&(r=i),this.multiply(i,0,0,0,r,0,0,0,1)}rotate(i){const r=f1(i),o=h1(i);return this.multiply(r,-o,0,o,r,0,0,0,1)}translate(i,r){return this.multiply(1,0,i,0,1,r,0,0,1)}skewX(i){const r=nu(i);return this.multiply(1,r,0,0,1,0,0,0,1)}skewY(i){const r=nu(i);return this.multiply(1,0,0,r,1,0,0,0,1)}toString(i){return _a.length=0,this.toTransformArray(i,_a),_a.map(Pn).join(" ")}toTransformArray(i,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],f=o[5];if(i){const h=o[6],p=o[7],m=o[8];if(s){r[0]=a,r[1]=d,r[2]=h,r[3]=l,r[4]=u,r[5]=p,r[6]=c,r[7]=f,r[8]=m;return}return[a,d,h,l,u,p,c,f,m]}if(s){r[0]=a,r[1]=d,r[2]=l,r[3]=u,r[4]=c,r[5]=f;return}return[a,d,l,u,c,f]}toArray(i,r){const o=this.elements,s=!!r,a=o[0],l=o[1],c=o[2],d=o[3],u=o[4],f=o[5];if(i){const h=o[6],p=o[7],m=o[8];if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=f,r[6]=h,r[7]=p,r[8]=m;return}return[a,l,c,d,u,f,h,p,m]}if(s){r[0]=a,r[1]=l,r[2]=c,r[3]=d,r[4]=u,r[5]=f;return}return[a,l,c,d,u,f]}toObject(){return{renderer:{type:"matrix"},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new Ht().copy(this)}};B(Ht,"Identity",[1,0,0,0,1,0,0,0,1]);let ur=Ht;Y0(ur);const io=class io extends Or{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 i in jo)Object.defineProperty(this,i,jo[i]);this._renderer.flagMatrix=iu.bind(this),this.isShape=!0,this.matrix=new ur,this.worldMatrix=new ur,this.position=new be,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(i){const r=new io().copy(i);return"id"in i&&(r.id=i.id),r}get renderer(){return this._renderer}set renderer(i){this._renderer=i}get translation(){return jo.position.get.apply(this,arguments)}set translation(i){jo.position.set.apply(this,arguments)}addTo(i){return i.add(this),this}remove(){return this.parent?(this.parent.remove(this),this):this}contains(i,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?i>=c.left-l&&i<=c.right+l&&r>=c.top-l&&r<=c.bottom+l:!1}copy(i){return super.copy.call(this,i),"position"in i&&(i.position instanceof be?this.position=i.position:this.position.copy(i.position)),"rotation"in i&&(this.rotation=i.rotation),"scale"in i&&(this.scale=typeof i.scale=="number"||i.scale instanceof be?i.scale:new be(i.scale.x,i.scale.y)),"skewX"in i&&(this.skewX=i.skewX),"skewY"in i&&(this.skewY=i.skewY),"matrix"in i&&i.matrix.manual&&(this.matrix.copy(i.matrix),this.matrix.manual=!0),this}clone(i){const r=new io;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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer={type:"shape"},i.isShape=!0,i.translation=this.translation.toObject(),i.rotation=this.translation.rotation,i.scale=this.scale instanceof be?this.scale.toObject():this.scale,i.skewX=this.skewX,i.skewY=this.skewY,i.matrix=this.matrix.toObject(),i}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(i){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof be?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),i&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};B(io,"Properties",["position","rotation","scale","skewX","skewY","matrix","worldMatrix"]);let Fn=io;const jo={position:{enumerable:!0,get:function(){return this._position},set:function(n){this._position&&this._position.unbind(te.Types.change,this._renderer.flagMatrix),this._position=n,this._position.bind(te.Types.change,this._renderer.flagMatrix),iu.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(n){this._rotation=n,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(n){this._scale instanceof be&&this._scale.unbind(te.Types.change,this._renderer.flagMatrix),this._scale=n,this._scale instanceof be&&this._scale.bind(te.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(n){this._skewX=n,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(n){this._skewY=n,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(n){this._matrix=n,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return U0(this,this._worldMatrix),this._worldMatrix},set:function(n){this._worldMatrix=n}}};function iu(){this._flagMatrix=!0}const ru=/^(?:none|transparent)$/i,m1=8,wa=Number.EPSILON;function Yn(n,e){return{x:n,y:e}}function qo(n,e,i=wa){return Math.abs(n.x-e.x)<=i&&Math.abs(n.y-e.y)<=i}function ou(n,e,i,r){const o=n*i+e*r,s=Math.sqrt(n*n+e*e)*Math.sqrt(i*i+r*r)||1e-12;let a=Math.acos(Math.max(-1,Math.min(1,o/s)));return n*r-e*i<0&&(a=-a),a}function p1(n,e,i){if(!n)return[Yn(e.x,e.y)];let r=e.rx,o=e.ry;if(!(r&&o))return[Yn(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=n.x,d=n.y,u=e.x,f=e.y,h=(c-u)/2,p=(d-f)/2,m=Math.cos(s),g=Math.sin(s);let b=m*h+g*p,y=-g*h+m*p,_=r*r,x=o*o;const w=b*b/_+y*y/x;if(w>1){const A=Math.sqrt(w);r*=A,o*=A,_=r*r,x=o*o}const C=_*y*y+x*b*b,N=C===0?0:(_*x-C)/C;let k=Math.sqrt(Math.max(0,N));a===l&&(k=-k);const $=k*r*y/o,v=-k*o*b/r,E=m*$-g*v+(c+u)/2,P=g*$+m*v+(d+f)/2,F=ou(1,0,(b-$)/r,(y-v)/o),R=ou((b-$)/r,(y-v)/o,(-b-$)/r,(-y-v)/o)%nn,M=F+R,X=l===0,G=(()=>{const A=M-F,Y=Math.abs(A)<Number.EPSILON;let H=Gt(A,nn);return H<Number.EPSILON&&(H=Y?0:nn),X&&!Y&&(H=H===nn?-nn:H-nn),H})(),Z=Math.max(Oo.Resolution,Math.max(i*2,1)),O=[];for(let A=1;A<=Z;A++){const Y=A/Z,H=F+Y*G;let T=E+r*Math.cos(H),D=P+o*Math.sin(H);if(s!==0){const K=T-E,J=D-P,U=Math.cos(s),q=Math.sin(s);T=K*U-J*q+E,D=K*q+J*U+P}O.push(Yn(T,D))}return O}function g1(n,e=m1){const i=[],r=[],o=n._renderer&&n._renderer.vertices&&n._renderer.vertices.length>0?n._renderer.vertices:n.vertices;if(!o||o.length===0)return{polygons:i,segments:r};const s=Math.max(1,Math.floor(e));let a=null,l=null,c=null,d=null;const u=(h=!1)=>{if(a){if(h&&l&&c&&!qo(l,c)){const p=Yn(l.x,l.y);r.push({a:c,b:p}),a.push(p),c=p}a.length>=3&&l&&c&&qo(l,c)&&i.push(a),a=null,l=null,c=null}},f=h=>{if(!c){c=h,a&&a.push(h);return}qo(c,h)||(r.push({a:c,b:h}),a&&a.push(h),c=h)};for(let h=0;h<o.length;h++){const p=o[h],m=p.command||(h===0?me.move:me.line);if(m===me.move){u(!1);const g=Yn(p.x,p.y);a=[g],l=g,c=g,d=p;continue}if(d||(d=o[Math.max(h-1,0)]),m===me.line)f(Yn(p.x,p.y));else if(m===me.curve){const g=ba(p,d,s);for(let b=1;b<g.length;b++){const y=g[b];f(Yn(y.x,y.y))}f(Yn(p.x,p.y))}else if(m===me.arc){const g=p1(d,p,s);for(let b=0;b<g.length;b++)f(g[b])}else if(m===me.close){u(!0),d=p;continue}else f(Yn(p.x,p.y));d=p}if(a){const h=!!n._closed||!!n.closed||l&&c&&!qo(l,c);u(h)}return{polygons:i,segments:r}}function y1(n,e,i){let r=!1;for(let o=0;o<n.length;o++){const s=n[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>i!=c.y>i&&e<(c.x-d.x)*(i-d.y)/(c.y-d.y||1e-12)+d.x&&(r=!r),a=l}}return r}function b1(n,e,i,r){const o=r.x-i.x,s=r.y-i.y;if(Math.abs(o)<wa&&Math.abs(s)<wa){const h=n-i.x,p=e-i.y;return h*h+p*p}const a=((n-i.x)*o+(e-i.y)*s)/(o*o+s*s),l=Math.max(0,Math.min(1,a)),c=i.x+l*o,d=i.y+l*s,u=n-c,f=e-d;return u*u+f*f}function _1(n,e,i){if(!n||n.length===0)return 1/0;let r=1/0;for(let o=0;o<n.length;o++){const s=n[o],a=b1(e,i,s.a,s.b);a<r&&(r=a)}return Math.sqrt(r)}function w1(n,e){if(typeof e=="boolean")return e;const i=n.fill;return!i&&i!==0?!1:typeof i=="string"?!ru.test(i):!0}function x1(n,e){const i=typeof n.linewidth=="number"?n.linewidth:n._linewidth||0;if(typeof e=="boolean")return e&&i>0;if(!(i>0))return!1;const r=n.stroke;return!r&&r!==0?!1:typeof r=="string"?!ru.test(r):!0}function k1(n,e,i,r=0){if(!n)return!1;const o=n.left-r,s=n.right+r,a=n.top-r,l=n.bottom+r;return e>=o&&e<=s&&i>=a&&i<=l}const Xo=Number.EPSILON;function Yo(n){return typeof n.relative!="boolean"||!!n.relative}function wn(n,e,i,r){const o=n.controls;if(!(!o||!o[e])){if(Math.abs(i)<Xo&&Math.abs(r)<Xo){Yo(n)?o[e].clear():o[e].set(n.x,n.y);return}Yo(n)?o[e].set(i,r):o[e].set(n.x+i,n.y+r)}}function Zt(n,e){wn(n,e,0,0)}function C1(n,e){const i=n.controls;return!i||!i[e]?{x:0,y:0}:Yo(n)?{x:i[e].x,y:i[e].y}:{x:i[e].x-n.x,y:i[e].y-n.y}}function fr(n,e){const i=C1(n,e);return Math.abs(i.x)>Xo||Math.abs(i.y)>Xo}function Uo(n){n.command===me.move||n.command===me.close||(n.command=fr(n,"left")||fr(n,"right")?me.curve:me.line)}function su(n,e){typeof e.relative=="boolean"&&(n.relative=e.relative)}function v1(n,e){return fr(e,"right")||fr(n,"left")||fr(n,"right")||fr(e,"left")||n.command===me.curve||e.command===me.curve}function hr(n,e,i){return{x:Kt(n.x,e.x,i),y:Kt(n.y,e.y,i)}}function au(n,e){const i=n.controls&&n.controls[e];return i?Yo(n)?{x:n.x+i.x,y:n.y+i.y}:{x:i.x,y:i.y}:{x:n.x,y:n.y}}function S1(n,e,i){const r=n.controls&&n.controls.right,o=e.controls&&e.controls.left,s={x:n.x,y:n.y},a=r?au(n,"right"):{...s},l={x:e.x,y:e.y},c=o?au(e,"left"):{...l},d=hr(s,a,i),u=hr(a,c,i),f=hr(c,l,i),h=hr(d,u,i),p=hr(u,f,i),m=hr(h,p,i),g=new Ae(m.x,m.y);return su(g,n),wn(g,"left",h.x-m.x,h.y-m.y),wn(g,"right",p.x-m.x,p.y-m.y),g.command=me.curve,{anchor:g,startOut:d,endIn:f}}function B1(n,e,i,r,o,s){const a=n.length,l=i-e+1;let c=l-1,d=o?Math.min(l,4):1,u=d,f=d;if(r||(u=Math.min(1,e),f=Math.min(1,a-i-1)),c+=u+f,c<=1)return;const h=new Array(c+1);for(let k=0,$=e-u;k<=c;k+=1,$+=1){const v=Gt($,a);h[k]=n[v]}let p=h[0].x+2*h[1].x,m=h[0].y+2*h[1].y,g=2;const b=c-1,y=[p],_=[m],x=[g],w=new Array(c+1),C=new Array(c+1);for(let k=1;k<c;k+=1){const $=k<b,v=$||s?1:2,E=$?4:s?2:7,P=$?4:s?3:8,F=$?2:s?0:1,R=v/g;g=x[k]=E-R,p=y[k]=P*h[k].x+F*h[k+1].x-R*p,m=_[k]=P*h[k].y+F*h[k+1].y-R*m}w[b]=y[b]/x[b],C[b]=_[b]/x[b];for(let k=c-2;k>=0;k-=1)w[k]=(y[k]-w[k+1])/x[k],C[k]=(_[k]-C[k+1])/x[k];w[c]=(3*h[c].x-w[b])/2,C[c]=(3*h[c].y-C[b])/2;const N=c-f;for(let k=u,$=e;k<=N;k+=1,$+=1){const v=Gt($,a),E=n[v],P=w[k]-E.x,F=C[k]-E.y;o||k<N?wn(E,"right",P,F):Zt(E,"right"),o||k>u?wn(E,"left",-P,-F):Zt(E,"left"),Uo(E)}}function N1(n,e,i,r,o,s){const a=e||n,l=n,c=i||n,d=be.distanceBetween(a,l),u=be.distanceBetween(l,c),f=r===void 0?.5:r,h=Math.pow(d,f),p=Math.pow(u,f),m=h*h,g=p*p;if(!o&&e){const b=2*g+3*p*h+m,y=3*p*(p+h);if(y!==0){const _=(g*a.x+b*l.x-m*c.x)/y-l.x,x=(g*a.y+b*l.y-m*c.y)/y-l.y;wn(n,"left",_,x)}else Zt(n,"left")}else Zt(n,"left");if(!s&&i){const b=2*m+3*h*p+g,y=3*h*(h+p);if(y!==0){const _=(m*c.x+b*l.x-g*a.x)/y-l.x,x=(m*c.y+b*l.y-g*a.y)/y-l.y;wn(n,"right",_,x)}else Zt(n,"right")}else Zt(n,"right");Uo(n)}function T1(n,e,i,r,o,s){if(!(e&&i)){e||Zt(n,"left"),i||Zt(n,"right"),Uo(n);return}const a=e,l=n,c=i,d=be.distanceBetween(a,l),u=be.distanceBetween(l,c),f=d+u,h=r===void 0?.4:r,p={x:a.x-c.x,y:a.y-c.y};if(!o&&f!==0){const m=h*d/f;wn(n,"left",p.x*m,p.y*m)}else Zt(n,"left");if(!s&&f!==0){const m=h*d/f-h;wn(n,"right",p.x*m,p.y*m)}else Zt(n,"right");Uo(n)}function $1(n,e,i,r,o,s){const a=s.type,l=s.factor,c=n.length;for(let d=e;d<=i;d+=1){const u=Gt(d,c),f=n[u];if(f.command===me.move){Zt(f,"left"),Zt(f,"right");continue}const h=d===e&&!o?null:d-1,p=d===i&&!o?null:d+1,m=h===null?null:n[Gt(h,c)],g=p===null?null:n[Gt(p,c)],b=h===null,y=p===null;a==="geometric"?T1(f,m,g,l,b,y):N1(f,m,g,l,b,y)}}const mr=Math.min,pr=Math.max,E1=Math.ceil,R1=Math.floor,P1=new be,F1=new ur,Cn=class Cn extends Fn{constructor(i,r,o,s){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 a in lu)Object.defineProperty(this,a,lu[a]);this._renderer.type="path",this._renderer.flagVertices=cu.bind(this),this._renderer.bindVertices=du.bind(this),this._renderer.unbindVertices=uu.bind(this),this._renderer.flagFill=fu.bind(this),this._renderer.flagStroke=hu.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=i,this.automatic=!s,this.dashes=[],this.dashes.offset=0}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Ei(i.fill),o=typeof i.stroke=="string"?i.stroke:Ei(i.stroke),s=new Cn().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){if(super.copy.call(this,i),i.vertices){this.vertices=[];for(let r=0;r<i.vertices.length;r++){const o=i.vertices[r];o instanceof Ae?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ae().copy(o))}}for(let r=0;r<Cn.Properties.length;r++){const o=Cn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Cn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Cn.Properties.length;o++){const s=Cn.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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="path",i.vertices=this.vertices.map(r=>r.toObject()),je.each(Cn.Properties,r=>{typeof this[r]<"u"&&(this[r].toObject?i[r]=this[r].toObject():i[r]=this[r])},this),i}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let i=0;i<this.vertices.length;i++){const r=this.vertices[i];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 i=this.getBoundingClientRect(!0),r=i.width/2,o=i.height/2,s=i.left+i.width/2,a=i.top+i.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 i=this.getBoundingClientRect(!0),r=i.left+i.width/2-this.translation.x,o=i.top+i.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(i){let r,o,s,a,l,c,d=1/0,u=-1/0,f=1/0,h=-1/0;if(this._update(!0),r=i?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:p,scaleY:m}=X0(r.elements[0],r.elements[3],r.elements[1],r.elements[4],r.elements[2],r.elements[5]);typeof p=="number"&&typeof m=="number"&&(o=Math.max(p,m)*(this.linewidth||0)/2)}else o*=typeof this.scale=="number"?this.scale:Math.max(this.scale.x,this.scale.y);if(s<=0)return{width:0,height:0};for(a=0;a<s;a++){c=this._renderer.vertices[a],l=this._renderer.vertices[(a+s-1)%s];const[p,m]=r.multiply(l.x,l.y),[g,b]=r.multiply(c.x,c.y);if(l.controls&&c.controls){let y=l.controls.right.x,_=l.controls.right.y;l.relative&&(y+=l.x,_+=l.y);let[x,w]=r.multiply(y,_),C=c.controls.left.x,N=c.controls.left.y;c.relative&&(C+=c.x,N+=c.y);let[k,$]=r.multiply(C,N);const v=Q0(p,m,x,w,k,$,g,b);f=mr(v.min.y-o,f),d=mr(v.min.x-o,d),u=pr(v.max.x+o,u),h=pr(v.max.y+o,h)}else a<=1&&(f=mr(m-o,f),d=mr(p-o,d),u=pr(p+o,u),h=pr(m+o,h)),f=mr(b-o,f),d=mr(g-o,d),u=pr(g+o,u),h=pr(b+o,h)}return{top:f,left:d,right:u,bottom:h,width:u-d,height:h-f}}contains(i,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||i<c.left-l||i>c.right+l||r<c.top-l||r>c.bottom+l)return!1;const d=this.worldMatrix,u=d&&d.inverse(F1);if(!u)return super.contains(i,r,s);const[f,h]=u.multiply(i,r,1),p=typeof s.precision=="number"&&!Number.isNaN(s.precision)?Math.max(1,Math.floor(s.precision)):8,m=w1(this,s.fill),g=x1(this,s.stroke),{polygons:b,segments:y}=g1(this,p);if(m&&b.length>0&&y1(b,f,h))return!0;if(g&&y.length>0){const _=typeof this.linewidth=="number"?this.linewidth:0;if(_>0&&_1(y,f,h)<=_/2+l)return!0}return!m&&!g?super.contains(i,r,s):m&&b.length===0?super.contains(i,r,s):!1}getPointAt(i,r){let o,s,a,l,c,d,u,f,h,p,m,g,b,y,_,x=this.length*Math.min(Math.max(i,0),1);const w=this.vertices.length,C=w-1;let N=null,k=null;for(let O=0,A=this._lengths.length,Y=0;O<A;O++){if(Y+this._lengths[O]>=x){this._closed?(o=Gt(O,w),s=Gt(O-1,w),O===0&&(o=s,s=O)):(o=O,s=Math.min(Math.max(O-1,0),C)),N=this.vertices[o],k=this.vertices[s],x-=Y,this._lengths[O]!==0?i=x/this._lengths[O]:i=0;break}Y+=this._lengths[O]}if(N===null||k===null)return null;if(N){if(!k)return N}else return k;_=k.controls&&k.controls.right,y=N.controls&&N.controls.left,c=k.x,p=k.y,d=(_||k).x,m=(_||k).y,u=(y||N).x,g=(y||N).y,f=N.x,b=N.y,_&&k.relative&&(d+=k.x,m+=k.y),y&&N.relative&&(u+=N.x,g+=N.y),l=Do(i,c,d,u,f),h=Do(i,p,m,g,b);const $=Kt(c,d,i),v=Kt(p,m,i),E=Kt(d,u,i),P=Kt(m,g,i),F=Kt(u,f,i),R=Kt(g,b,i),M=Kt($,E,i),X=Kt(v,P,i),G=Kt(E,F,i),Z=Kt(P,R,i);return je.isObject(r)?(r.x=l,r.y=h,r instanceof Ae&&(r.controls.left.x=M,r.controls.left.y=X,r.controls.right.x=G,r.controls.right.y=Z,(typeof r.relative!="boolean"||r.relative)&&(r.controls.left.x-=l,r.controls.left.y-=h,r.controls.right.x-=l,r.controls.right.y-=h)),r.t=i,r):(a=new Ae(l,h,M-l,X-h,G-l,Z-h,this._curved?me.curve:me.line),a.t=i,a)}plot(){if(this.curved)return e1(this._collection,this.closed),this;for(let i=0;i<this._collection.length;i++)this._collection[i].command=i===0?me.move:me.line;return this}smooth(i){const r=i||{},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===me.close,c=(p,m)=>{if(p==null)return m;if(typeof p=="number"){if(l)return Gt(p,a);let b=p;return b<0&&(b+=a),Math.min(Math.max(b,0),a-1)}const g=s.indexOf(p);return g!==-1?g:m},d=l&&r.from===void 0&&r.to===void 0;let u=c(r.from,0),f=c(r.to,a-1);if(u>f)if(l)u-=a;else{const p=u;u=f,f=p}const h=f-u+1;for(let p=0;p<h;p+=1){const m=Gt(u+p,a),g=s[m],b=!l&&m===0;g.command===me.move&&!b&&(g.command=me.line)}if(o==="continuous"||o==="asymmetric")B1(s,u,f,l,d,o==="asymmetric");else if(o==="catmull-rom"||o==="geometric"){const p={type:o,factor:r.factor};$1(s,u,f,l,d,p)}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(i){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===me.move){const f=d.clone();s.push(f),a=d,l=d;continue}if(v1(d,a)){const h=ba(d,a,i).length,p=s[s.length-1];let m=p.clone(),g=d.clone(),b=p,y=0;if(h<=1){const _=d.clone();s.push(_)}else{for(let x=1;x<h;x+=1){const w=x/h,C=1-y,N=C<=Number.EPSILON?w:(w-y)/C,k=S1(m,g,N);wn(b,"right",k.startOut.x-b.x,k.startOut.y-b.y);const $=k.anchor;s.push($),b=$,m=$.clone(),y=w,wn(g,"left",k.endIn.x-g.x,k.endIn.y-g.y)}const _=d.clone();_.controls.left.copy(g.controls.left),s.push(_)}}else{const f=ba(d,a,i);for(let p=1;p<f.length;p+=1){const m=f[p];su(m,a),Zt(m,"left"),Zt(m,"right"),m.command=me.line,s.push(m)}const h=d.clone();s.push(h)}a=d,d.command===me.close&&(a=l)}return this._automatic=!1,this._curved=!1,this.vertices=s,this}_updateLength(i,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===me.move){a=c,this._lengths[d]=0;return}this._lengths[d]=tu(c,a,i),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 i=this._collection.length,r=this._closed,o=Math.min(this._beginning,this._ending),s=Math.max(this._beginning,this._ending),a=Wo(this,o*this._length),l=Wo(this,s*this._length),c=E1(a),d=R1(l);let u,f,h,p,m,g;for(this._renderer.vertices.length=0,g=0;g<i;g++)this._renderer.collection.length<=g&&this._renderer.collection.push(new Ae),g>d&&!f?(m=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(s,m),m.command=this._renderer.collection[g].command,this._renderer.vertices.push(m),f=m,h=this._collection[g-1],h&&h.controls&&(m.relative?m.controls.right.clear():m.controls.right.copy(m),h.relative?this._renderer.collection[g-1].controls.right.copy(h.controls.right).lerp(be.zero,1-m.t):this._renderer.collection[g-1].controls.right.copy(h.controls.right).lerp(h,1-m.t))):g>=c&&g<=d&&(m=this._renderer.collection[g].copy(this._collection[g]),this._renderer.vertices.push(m),g===d&&eu(this,s)?(f=m,!r&&f.controls&&(f.relative?f.controls.right.clear():f.controls.right.copy(f))):g===c&&eu(this,o)&&(u=m,u.command=me.move,!r&&u.controls&&(u.relative?u.controls.left.clear():u.controls.left.copy(u))));c>0&&!u&&(g=c-1,m=this._renderer.collection[g].copy(this._collection[g]),this.getPointAt(o,m),m.command=me.move,this._renderer.vertices.unshift(m),p=this._collection[g+1],p&&p.controls&&(m.controls.left.clear(),p.relative?this._renderer.collection[g+1].controls.left.copy(p.controls.left).lerp(be.zero,m.t):(P1.copy(p),this._renderer.collection[g+1].controls.left.copy(p.controls.left).lerp(p,m.t))))}return Fn.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,Fn.prototype.flagReset.call(this),this}};B(Cn,"Properties",["fill","stroke","linewidth","opacity","visible","cap","join","miter","closed","curved","automatic","beginning","ending","dashes","strokeAttenuation"]),B(Cn,"Utils",{getCurveLength:tu});let Oe=Cn;const lu={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(n){this._linewidth=n,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._opacity=n,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(n){this._visible=n,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(n){this._cap=n,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(n){this._join=n,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(n){this._miter=n,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(n){(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=n,this._flagFill=!0,(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(n){(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=n,this._flagStroke=!0,(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.bind(te.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(n){this._closed=!!n,this._flagVertices=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(n){this._curved=!!n,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(n){if(n===this._automatic)return;this._automatic=!!n;const e=this._automatic?"ignore":"listen";je.each(this.vertices,function(i){i[e]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(n){this._beginning=n,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(n){this._ending=n,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(n){const e=this._renderer.bindVertices,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(te.Types.insert,e).unbind(te.Types.remove,i),n instanceof Ti?this._collection=n:this._collection=new Ti(n||[]),this._collection.bind(te.Types.insert,e).bind(te.Types.remove,i),e(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(n){this._mask=n,this._flagMask=!0,je.isObject(n)&&!n.clip&&(n.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(n){this._clip=n,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(n){typeof n.offset!="number"&&(n.offset=this.dashes&&this._dashes.offset||0),this._dashes=n}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(n){this._strokeAttenuation=!!n,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function cu(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function du(n){let e=n.length;for(;e--;)n[e].bind(te.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function uu(n){let e=n.length;for(;e--;)n[e].unbind(te.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function fu(){this._flagFill=!0}function hu(){this._flagStroke=!0}const V1=Math.ceil,M1=Math.floor,Dn=class Dn extends Fn{constructor(i){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",Oe.prototype.noFill);B(this,"noStroke",Oe.prototype.noStroke);B(this,"corner",Oe.prototype.corner);B(this,"center",Oe.prototype.center);B(this,"getBoundingClientRect",Oe.prototype.getBoundingClientRect);B(this,"_updateLength",Oe.prototype._updateLength);for(let r in mu)Object.defineProperty(this,r,mu[r]);this._renderer.type="points",this._renderer.flagVertices=cu.bind(this),this._renderer.bindVertices=du.bind(this),this._renderer.unbindVertices=uu.bind(this),this._renderer.flagFill=fu.bind(this),this._renderer.flagStroke=hu.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=i,this.dashes=[],this.dashes.offset=0}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Ei(i.fill),o=typeof i.stroke=="string"?i.stroke:Ei(i.stroke),s=new Dn().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){super.copy.call(this,i);for(let r=0;r<i.vertices.length;r++){const o=i.vertices[r];o instanceof Ae?this.vertices.push(i.vertices[r].clone()):this.vertices.push(new Ae().copy(o))}for(let r=0;r<Dn.Properties.length;r++){const o=Dn.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Dn;for(let o=0;o<this.vertices.length;o++)r.vertices.push(this.vertices[o].clone());for(let o=0;o<Dn.Properties.length;o++){const s=Dn.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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="points",i.vertices=this.vertices.map(r=>r.toObject()),je.each(Dn.Properties,function(r){typeof this[r]<"u"&&(this[r].toObject?i[r]=this[r].toObject():i[r]=this[r])},this),i}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind=="function")try{this.vertices.unbind()}catch{}if(this.vertices)for(let i=0;i<this.vertices.length;i++){const r=this.vertices[i];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(i){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,f=qd(l,c,l,c,d,u,d,u,i);r=r.concat(f)}return this.vertices=r,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);const i=Math.min(this._beginning,this._ending),r=Math.max(this._beginning,this._ending),o=Wo(this,i*this._length),s=Wo(this,r*this._length),a=V1(o),l=M1(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}};B(Dn,"Properties",["fill","stroke","linewidth","opacity","visible","size","sizeAttenuation","beginning","ending","dashes","strokeAttenuation"]);let Ko=Dn;const mu={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(n){this._linewidth=n,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._opacity=n,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(n){this._visible=n,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(n){this._size=n,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(n){this._sizeAttenuation=n,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(n){(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=n,this._flagFill=!0,(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(n){(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=n,this._flagStroke=!0,(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.bind(te.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(n){this._beginning=n,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(n){this._ending=n,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(n){const e=this._renderer.bindVertices,i=this._renderer.unbindVertices;this._collection&&this._collection.unbind(te.Types.insert,e).unbind(te.Types.remove,i),n instanceof Ti?this._collection=n:this._collection=new Ti(n||[]),this._collection.bind(te.Types.insert,e).bind(te.Types.remove,i),e(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(n){typeof n.offset!="number"&&(n.offset=this.dashes&&this._dashes.offset||0),this._dashes=n}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(n){this._strokeAttenuation=!!n,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};class pu extends Ti{constructor(i){i=Array.isArray(i)?i:Array.prototype.slice.call(arguments);super(i);Hl(this,Cs,{});this.attach(i),this.on(te.Types.insert,this.attach),this.on(te.Types.remove,this.detach)}get ids(){return qt(this,Cs)}attach(i){for(let r=0;r<i.length;r++){const o=i[r];o&&o.id&&(this.ids[o.id]=o)}return this}detach(i){for(let r=0;r<i.length;r++)delete this.ids[i[r].id];return this}}Cs=new WeakMap;const Qn=class Qn extends Oe{constructor(i,r,o,s,a,l,c){const d=c||Oo.Resolution*3,u=[];for(let f=0;f<d;f++)u.push(new Ae);super(u,!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",nn);B(this,"_innerRadius",0);B(this,"_outerRadius",0);this._renderer.type="arc-segment";for(let f in gu)Object.defineProperty(this,f,gu[f]);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 i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Qn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Qn.Properties.length;r++){const o=Qn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){const i=this._startAngle,r=this._endAngle,o=this._innerRadius,s=this._outerRadius,a=Gt(i,nn)===Gt(r,nn),l=o>0,c=this.vertices;let d=l?c.length/2:c.length,u,f=0,h,p,m,g,b,y,_,x,w;for(a?d--:l||(d-=2),h=0,p=d-1;h<d;h++){switch(m=h/p,g=c[f],b=m*(r-i)+i,y=(r-i)/d,_=s*Math.cos(b),x=s*Math.sin(b),h){case 0:u=me.move;break;default:u=me.curve}g.command=u,g.x=_,g.y=x,g.controls.left.clear(),g.controls.right.clear(),g.command===me.curve&&(w=s*y/Math.PI,g.controls.left.x=w*Math.cos(b-kt),g.controls.left.y=w*Math.sin(b-kt),g.controls.right.x=w*Math.cos(b+kt),g.controls.right.y=w*Math.sin(b+kt),h===1&&g.controls.left.multiplyScalar(2),h===p&&g.controls.right.multiplyScalar(2)),f++}if(l){for(a?(c[f].command=me.close,f++):(d--,p=d-1),h=0;h<d;h++)m=h/p,g=c[f],b=(1-m)*(r-i)+i,y=(r-i)/d,_=o*Math.cos(b),x=o*Math.sin(b),u=me.curve,h<=0&&(u=a?me.move:me.line),g.command=u,g.x=_,g.y=x,g.controls.left.clear(),g.controls.right.clear(),g.command===me.curve&&(w=o*y/Math.PI,g.controls.left.x=w*Math.cos(b+kt),g.controls.left.y=w*Math.sin(b+kt),g.controls.right.x=w*Math.cos(b-kt),g.controls.right.y=w*Math.sin(b-kt),h===1&&g.controls.left.multiplyScalar(2),h===p&&g.controls.right.multiplyScalar(2)),f++;c[f].copy(c[0]),c[f].command=me.line}else a||(c[f].command=me.line,c[f].x=0,c[f].y=0,f++,c[f].copy(c[0]),c[f].command=me.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(i){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<Oe.Properties.length;d++){const u=Oe.Properties[d];c[u]=this[u]}return i&&i.add(c),c}toObject(){const i=super.toObject.call(this);i.renderer.type="arc-segment";for(let r=0;r<Qn.Properties.length;r++){const o=Qn.Properties[r];i[o]=this[o]}return i}};B(Qn,"Properties",["startAngle","endAngle","innerRadius","outerRadius"]);let xa=Qn;const gu={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(n){this._startAngle=n,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(n){this._endAngle=n,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(n){this._innerRadius=n,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(n){this._outerRadius=n,this._flagOuterRadius=!0}}},ka=Math.cos,Ca=Math.sin,Jn=class Jn extends Oe{constructor(i,r,o,s){const a=s?Math.max(s,2):4,l=[];for(let c=0;c<a;c++)l.push(new Ae(0,0,0,0,0,0));super(l,!0,!0,!0);B(this,"_flagRadius",!1);B(this,"_radius",0);this._renderer.type="circle";for(let c in yu)Object.defineProperty(this,c,yu[c]);typeof o=="number"&&(this.radius=o),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new Jn().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Jn.Properties.length;r++){const o=Jn.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagRadius){let i=this.vertices.length;!this._closed&&i>2&&(i-=1);const r=4/3*Math.tan(Math.PI/(i*2)),o=this._radius,s=o*r;for(let a=0;a<this.vertices.length;a++){const c=a/i*nn,d=o*ka(c),u=o*Ca(c),f=s*ka(c-kt),h=s*Ca(c-kt),p=s*ka(c+kt),m=s*Ca(c+kt),g=this.vertices[a];g.command=a===0?me.move:me.curve,g.set(d,u),g.controls.left.set(f,h),g.controls.right.set(p,m)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(i){const r=new Jn(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<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);i.renderer.type="circle";for(let r=0;r<Jn.Properties.length;r++){const o=Jn.Properties[r];i[o]=this[o]}return i}};B(Jn,"Properties",["radius"]);let va=Jn;const yu={radius:{enumerable:!0,get:function(){return this._radius},set:function(n){this._radius=n,this._flagRadius=!0}}},Sa=Math.cos,Ba=Math.sin,ei=class ei extends Oe{constructor(i,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 Ae);super(c,!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 d in bu)Object.defineProperty(this,d,bu[d]);typeof o=="number"&&(this.width=o*2),typeof s=="number"&&(this.height=s*2),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new ei().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ei.Properties.length;r++){const o=ei.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let i=this.vertices.length;!this._closed&&i>2&&(i-=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/i*nn,d=o*Sa(c),u=s*Ba(c),f=o*r*Sa(c-kt),h=s*r*Ba(c-kt),p=o*r*Sa(c+kt),m=s*r*Ba(c+kt),g=this.vertices[a];g.command=a===0?me.move:me.curve,g.set(d,u),g.controls.left.set(f,h),g.controls.right.set(p,m)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(i){const r=this.width/2,o=this.height/2,s=this.vertices.length,a=new ei(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<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}toObject(){const i=super.toObject.call(this);i.renderer.type="ellipse";for(let r=0;r<ei.Properties.length;r++){const o=ei.Properties[r];i[o]=this[o]}return i}};B(ei,"Properties",["width","height"]);let Na=ei;const bu={width:{enumerable:!0,get:function(){return this._width},set:function(n){this._width=n,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(n){this._height=n,this._flagHeight=!0}}},I1=Math.cos,A1=Math.sin,ti=class ti extends Oe{constructor(i,r,o,s){s=Math.max(s||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 a in _u)Object.defineProperty(this,a,_u[a]);this.closed=!0,this.automatic=!1,typeof o=="number"&&(this.radius=o),typeof s=="number"&&(this.sides=s),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new ti().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ti.Properties.length;r++){const o=ti.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){const i=this._sides,r=i+1;let o=this.vertices.length;o>i&&(this.vertices.splice(i-1,o-i),o=i);for(let s=0;s<r;s++){const a=(s+.5)/i,l=nn*a+Math.PI/2,c=this._width*I1(l)/2,d=this._height*A1(l)/2;s>=o?this.vertices.push(new Ae(c,d)):this.vertices[s].set(c,d),this.vertices[s].command=s===0?me.move:me.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(i){const r=new ti(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<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);i.renderer.type="polygon";for(let r=0;r<ti.Properties.length;r++){const o=ti.Properties[r];i[o]=this[o]}return i}};B(ti,"Properties",["width","height","sides"]);let Ta=ti;const _u={radius:{enumerable:!0,get:function(){return this._radius},set:function(n){this._radius=n,this.width=n*2,this.height=n*2}},width:{enumerable:!0,get:function(){return this._width},set:function(n){this._width=n,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(n){this._height=n,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(n){this._sides=n,this._flagSides=!0}}},Xi=class Xi extends Oe{constructor(i,r,o,s){const a=[new Ae,new Ae,new Ae,new Ae];super(a,!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 l in wu)Object.defineProperty(this,l,wu[l]);this.width=typeof o=="number"?o:1,this.height=typeof s=="number"?s:1,this.origin=new be,typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r),this._update()}static fromObject(i){const r=new Xi().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Xi.Properties.length;r++){const o=Xi.Properties[r];o in i&&(typeof i[o]=="number"?this[o]=i[o]:this[o]instanceof be&&this[o].copy(i[o]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){const i=this._width/2,r=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new Ae),this.vertices[0].set(-i,-r).sub(this._origin).command=me.move,this.vertices[1].set(i,-r).sub(this._origin).command=me.line,this.vertices[2].set(i,r).sub(this._origin).command=me.line,this.vertices[3].set(-i,r).sub(this._origin).command=me.line,this.vertices[4]&&(this.vertices[4].set(-i,-r).sub(this._origin).command=me.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(i){const r=new Xi(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<Oe.Properties.length;o++){const s=Oe.Properties[o];r[s]instanceof be?r[s].copy(this[s]):r[s]=this[s]}return i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="rectangle",i.width=this.width,i.height=this.height,i.origin=this.origin.toObject(),i}};B(Xi,"Properties",["width","height","origin"]);let zr=Xi;const wu={width:{enumerable:!0,get:function(){return this._width},set:function(n){this._width=n,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(n){this._height=n,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(n){this._origin&&this._origin.unbind(te.Types.change,this._renderer.flagVertices),this._origin=n,this._origin.bind(te.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},ni=class ni extends Oe{constructor(i,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 Ae(0,0,0,0,0,0,c===0?me.move:me.curve));super(l);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 c in xu)Object.defineProperty(this,c,xu[c]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=O1.bind(this),typeof o=="number"&&(this.width=o),typeof s=="number"&&(this.height=s),(typeof a=="number"||a instanceof be)&&(this.radius=a),this._update(),typeof i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new ni().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ni.Properties.length;r++){const o=ni.Properties[r];if(o in i){const s=i[o];/radius/i.test(o)?this[o]=typeof s=="number"||s instanceof be?s:new be().copy(s):typeof s=="number"&&(this[o]=s)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){const i=this._width,r=this._height;let o,s;this._radius instanceof be?(o=this._radius.x,s=this._radius.y):(o=this._radius,s=this._radius);let a,l=i/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(i){const r=this.width,o=this.height,s=this.radius,a=new ni(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<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}toObject(){const i=super.toObject.call(this);i.renderer.type="rounded-rectangle";for(let r=0;r<ni.Properties.length;r++){const o=ni.Properties[r];i[o]=this[o]}return i.radius=typeof this.radius=="number"?this.radius:this.radius.toObject(),i}};B(ni,"Properties",["width","height","radius"]);let $a=ni;const xu={width:{enumerable:!0,get:function(){return this._width},set:function(n){this._width=n,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(n){this._height=n,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(n){this._radius instanceof be&&this._radius.unbind(te.Types.change,this._renderer.flagRadius),this._radius=n,this._radius instanceof be&&this._radius.bind(te.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function O1(){this._flagRadius=!0}const z1=Math.cos,D1=Math.sin,ii=class ii extends Oe{constructor(i,r,o,s,a){arguments.length<=3&&(s=o,o=s/2),(typeof a!="number"||a<=0)&&(a=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 l in ku)Object.defineProperty(this,l,ku[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 i=="number"&&(this.translation.x=i),typeof r=="number"&&(this.translation.y=r)}static fromObject(i){const r=new ii().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ii.Properties.length;r++){const o=ii.Properties[r];o in i&&typeof i[o]=="number"&&(this[o]=i[o])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){const i=this._sides*2,r=i+1;let o=this.vertices.length;o>i&&(this.vertices.splice(i-1,o-i),o=i);for(let s=0;s<r;s++){const a=(s+.5)/i,l=nn*a,c=(s%2?this._outerRadius:this._innerRadius)/2,d=c*z1(l),u=c*D1(l);s>=o?this.vertices.push(new Ae(d,u)):this.vertices[s].set(d,u),this.vertices[s].command=s===0?me.move:me.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(i){const r=this.innerRadius,o=this.outerRadius,s=this.sides,a=new ii(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<Oe.Properties.length;l++){const c=Oe.Properties[l];a[c]=this[c]}return i&&i.add(a),a}toObject(){const i=super.toObject.call(this);i.renderer.type="star";for(let r=0;r<ii.Properties.length;r++){const o=ii.Properties[r];i[o]=this[o]}return i}};B(ii,"Properties",["innerRadius","outerRadius","sides"]);let Ea=ii;const ku={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(n){this._innerRadius=n,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(n){this._outerRadius=n,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(n){this._sides=n,this._flagSides=!0}}};let Ra;const Cu=Math.min,vu=Math.max;Rn.document&&(Ra=document.createElement("canvas"));const Vt=class Vt extends Fn{constructor(i,r,o,s){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 a in Su)Object.defineProperty(this,a,Su[a]);if(this._renderer.type="text",this._renderer.flagFill=L1.bind(this),this._renderer.flagStroke=H1.bind(this),this.value=i,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<Vt.Properties.length;a++){const l=Vt.Properties[a];l in s&&(this[l]=s[l])}}static Measure(i){if(Ra){const r=Ra.getContext("2d");r.font=[i._style,i._weight,`${i._size}px/${i._leading}px`,i._family].join(" ");const o=r.measureText(i.value,0,0),s=o.actualBoundingBoxDescent+o.actualBoundingBoxAscent;return{width:o.width,height:s}}else{const r=this.value.length*this.size*Vt.Ratio,o=this.leading;return console.warn("Two.Text: unable to accurately measure text, so using an approximation."),{width:r,height:o}}}static fromObject(i){const r=typeof i.fill=="string"?i.fill:Ei(i.fill),o=typeof i.stroke=="string"?i.stroke:Ei(i.stroke),s=new Vt().copy({...i,fill:r,stroke:o});return"id"in i&&(s.id=i.id),s}copy(i){super.copy.call(this,i);for(let r=0;r<Vt.Properties.length;r++){const o=Vt.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Vt(this.value);r.translation.copy(this.translation),r.rotation=this.rotation,r.scale=this.scale;for(let o=0;o<Vt.Properties.length;o++){const s=Vt.Properties[o];r[s]=this[s]}return this.matrix.manual&&r.matrix.copy(this.matrix),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);i.renderer.type="text";for(let r=0;r<Vt.Properties.length;r++){const o=Vt.Properties[r];i[o]=this[o]}return i}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(i){let r,o,s,a,l;this._update(!0),r=i?this.matrix:this.worldMatrix;const{width:c,height:d}=Vt.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[f,h]=r.multiply(o,a),[p,m]=r.multiply(o,l),[g,b]=r.multiply(s,a),[y,_]=r.multiply(s,l);return a=Cu(h,m,b,_),o=Cu(f,p,g,y),s=vu(f,p,g,y),l=vu(h,m,b,_),{top:a,left:o,right:s,bottom:l,width:s-o,height:l-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};B(Vt,"Ratio",.6),B(Vt,"Properties",["value","family","size","leading","alignment","linewidth","style","weight","decoration","direction","baseline","opacity","visible","fill","stroke","dashes","strokeAttenuation"]);let gr=Vt;const Su={value:{enumerable:!0,get:function(){return this._value},set:function(n){this._value=n,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(n){this._family=n,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(n){this._size=n,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(n){this._leading=n,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(n){this._alignment=n,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(n){this._linewidth=n,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(n){this._style=n,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(n){this._weight=n,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(n){this._decoration=n,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(n){this._direction=n,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(n){this._baseline=n,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._opacity=n,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(n){this._visible=n,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(n){(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.unbind(te.Types.change,this._renderer.flagFill),this._fill=n,this._flagFill=!0,(this._fill instanceof gt||this._fill instanceof zt||this._fill instanceof Dt||this._fill instanceof nt)&&this._fill.bind(te.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(n){(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.unbind(te.Types.change,this._renderer.flagStroke),this._stroke=n,this._flagStroke=!0,(this._stroke instanceof gt||this._stroke instanceof zt||this._stroke instanceof Dt||this._stroke instanceof nt)&&this._stroke.bind(te.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(n){this._mask=n,this._flagMask=!0,je.isObject(n)&&!n.clip&&(n.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(n){this._clip=n,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(n){typeof n.offset!="number"&&(n.offset=this.dashes&&this._dashes.offset||0),this._dashes=n}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(n){this._strokeAttenuation=!!n,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function L1(){this._flagFill=!0}function H1(){this._flagStroke=!0}const ri=class ri extends zr{constructor(i,r,o,s){super(r,o,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 a in Bu)Object.defineProperty(this,a,Bu[a]);this._renderer.flagTextures=W1.bind(this),this._renderer.bindTextures=j1.bind(this),this._renderer.unbindTextures=q1.bind(this),this.noStroke(),this.noFill(),Array.isArray(i)?this.textures=i.map(Nu.bind(this)):typeof i=="string"&&(this.textures=[Nu(i)]),this.origin=new be,this._update(),typeof s=="number"?this.frameRate=s:this.frameRate=ri.DefaultFrameRate,this.index=0}static fromObject(i){const r=new ri().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<ri.Properties.length;r++){const o=ri.Properties[r];o in i&&(this[o]=i[o])}return this}play(i,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=je.performance.now(),typeof i=="number"&&(this._firstFrame=i),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(i){const r=new ri(this.textures,this.translation.x,this.translation.y,this.frameRate);return r._loop=this._loop,this._playing&&r.play(),i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="image-sequence",i.textures=this.textures.map(function(r){return r.toObject()}),i.frameRate=this.frameRate,i.index=this.index,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,i.loop=this.loop,i}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 i=0;i<this.textures.length;i++){const r=this.textures[i];typeof r.dispose=="function"?r.dispose():typeof r.unbind=="function"&&r.unbind()}return this}_update(){const i=this._textures;let r,o,s,a,l,c,d,u;return i&&(this._flagTextures&&(this._amount=i.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=Kt(this._firstFrame,u,s/l),d=Math.floor(d),d!==this._index&&(this._index=d,c=i[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 nt))&&(c=i[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}};B(ri,"Properties",["textures","frameRate","index","firstFrame","lastFrame","loop"]),B(ri,"DefaultFrameRate",30);let Pa=ri;const Bu={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(n){this._frameRate=n,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(n){this._index=n,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(n){const e=this._renderer.bindTextures,i=this._renderer.unbindTextures;this._textures&&this._textures.unbind(te.Types.insert,e).unbind(te.Types.remove,i),this._textures=new Ti((n||[]).slice(0)),this._textures.bind(te.Types.insert,e).bind(te.Types.remove,i),e(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(n){this._firstFrame=n}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(n){this._lastFrame=n}},loop:{enumerable:!0,get:function(){return this._loop},set:function(n){this._loop=!!n}}};function W1(){this._flagTextures=!0}function j1(n){let e=n.length;for(;e--;)n[e].bind(te.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function q1(n){let e=n.length;for(;e--;)n[e].unbind(te.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function Nu(n){if(n instanceof nt)return n;if(typeof n=="string")return new nt(n)}const Yi=class Yi extends zr{constructor(i,r,o,s,a,l){super(r,o,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 c in Tu)Object.defineProperty(this,c,Tu[c]);this.noStroke(),this.noFill(),i instanceof nt?this.texture=i:typeof i=="string"&&(this.texture=new nt(i)),this.origin=new be,this._update(),typeof s=="number"&&(this.columns=s),typeof a=="number"&&(this.rows=a),typeof l=="number"&&(this.frameRate=l),this.index=0}static fromObject(i){const r=new Yi().copy(i);return"id"in i&&(r.id=i.id),r}copy(i){super.copy.call(this,i);for(let r=0;r<Yi.Properties.length;r++){const o=Yi.Properties[r];o in i&&(this[o]=i[o])}return this}play(i,r,o){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=je.performance.now(),typeof i=="number"&&(this._firstFrame=i),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(i){const r=new Yi(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,i&&i.add(r),r}toObject(){const i=super.toObject.call(this);return i.renderer.type="sprite",i.texture=this.texture.toObject(),i.columns=this.columns,i.rows=this.rows,i.frameRate=this.frameRate,i.index=this.index,i.firstFrame=this.firstFrame,i.lastFrame=this.lastFrame,i.loop=this.loop,i}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 i=this._texture,r=this._columns,o=this._rows;let s,a,l,c,d,u,f,h,p;if(i&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=i),i.loaded)){f=i.image.width,h=i.image.height,s=f/r,a=h/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,p=this._lastFrame+1,d=1e3*(p-this._firstFrame)/this._frameRate,this._loop?l=l%d:l=Math.min(l,d),u=Kt(this._firstFrame,p,l/d),u=Math.floor(u),u!==this._index&&(this._index=u,u>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));const m=this._index%r,g=Math.floor(this._index/r),b=-s*m+(f-s)/2,y=-a*g+(h-a)/2;b!==i.offset.x&&(i.offset.x=b),y!==i.offset.y&&(i.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(Yi,"Properties",["texture","columns","rows","frameRate","index","firstFrame","lastFrame","loop"]);let Fa=Yi;const Tu={texture:{enumerable:!0,get:function(){return this._texture},set:function(n){this._texture=n,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(n){this._columns=n,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(n){this._rows=n,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(n){this._frameRate=n,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(n){this._index=n,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(n){this._firstFrame=n}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(n){this._lastFrame=n}},loop:{enumerable:!0,get:function(){return this._loop},set:function(n){this._loop=!!n}}},Go=Math.min,Zo=Math.max,X1={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],empty:[]}},Wt=class Wt extends Fn{constructor(i){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 r in $u)Object.defineProperty(this,r,$u[r]);this._renderer.type="group",this.additions=[],this.subtractions=[],this.children=Array.isArray(i)?i:Array.prototype.slice.call(arguments)}static InsertChildren(i){for(let r=0;r<i.length;r++)Eu.call(this,i[r],this)}static RemoveChildren(i){for(let r=0;r<i.length;r++)Eu.call(this,i[r])}static OrderChildren(i){this._flagOrder=!0}static fromObject(i){const r=new Wt;for(let s=0;s<Wt.Properties.length;s++){const a=Wt.Properties[s];a in i&&(/(fill|stroke)/i.test(a)?r[a]=typeof i[a]=="string"?i[a]:Ei(i[a]):r[a]=i[a])}return"mask"in i&&(r.mask=o(i.mask)),"id"in i&&(r.id=i.id),r.children=i.children.map(o),r;function o(s){if(s&&s.renderer)switch(s.renderer.type){case"arc-segment":return xa.fromObject(s);case"circle":return va.fromObject(s);case"element":return Or.fromObject(s);case"ellipse":return Na.fromObject(s);case"group":return Wt.fromObject(s);case"image":return Image.fromObject(s);case"image-sequence":return Pa.fromObject(s);case"path":return Oe.fromObject(s);case"points":return Ko.fromObject(s);case"polygon":return Ta.fromObject(s);case"rectangle":return zr.fromObject(s);case"rounded-rectangle":return $a.fromObject(s);case"shape":return Fn.fromObject(s);case"sprite":return Fa.fromObject(s);case"star":return Ea.fromObject(s);case"text":return gr.fromObject(s)}return s}}static IsVisible(i,r){if(!r)return!0;let o=i;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(i,r,o,s,a,l,c){const d=i&&i.children;if(!d)return!1;const u=r.results;for(let f=d.length-1;f>=0;f--){const h=d[f];if(!h||!Wt.IsVisible(h,r.visibleOnly))continue;const p=typeof h.getBoundingClientRect=="function"?h.getBoundingClientRect():null;if(!(p&&!k1(p,r.x,r.y,l))){if(h instanceof Wt){if(o&&(!s||s(h))&&typeof h.contains=="function"&&h.contains(r.x,r.y,a)&&(u.push(h),c)||Wt.VisitForHitTest(h,r,o,s,a,l,c))return!0;continue}if(h instanceof Fn&&!(s&&!s(h))&&typeof h.contains=="function"&&h.contains(r.x,r.y,a)&&(u.push(h),c))return!0}}return!1}copy(i){super.copy.call(this,i),console.warn("Two.js: attempting to copy group. Two.Group.children copying not supported.");for(let r=0;r<Wt.Properties.length;r++){const o=Wt.Properties[r];o in i&&(this[o]=i[o])}return this}clone(i){const r=new Wt,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),i&&i.add(r),r._update()}toObject(){const i=super.toObject.call(this);return i.renderer.type="group",i.children=[],i.opacity=this.opacity,i.className=this.className,i.mask=this.mask?this.mask.toObject():null,je.each(this.children,(r,o)=>{i.children[o]=r.toObject()},this),i}dispose(){if(super.dispose(),this.children)for(let i=0;i<this.children.length;i++){const r=this.children[i];typeof r.dispose=="function"&&r.dispose()}if(this.children&&typeof this.children.unbind=="function")try{this.children.unbind()}catch{}return this}getShapesAtPoint(i,r,o){const s=o||{},{results:a,hitOptions:l,context:c,single:d,empty:u}=X1.getShapesAtPoint;a.length=0;const f=s.mode==="deepest"||s.deepest?"deepest":"all",h=s.visibleOnly!==!1,p=!!s.includeGroups,m=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=!h;const b=f==="deepest";if(c.x=i,c.y=r,c.visibleOnly=h,c.results=a,Wt.VisitForHitTest(this,c,p,m,l,g,b),b){if(a.length>0){const _=a[0];return a.length=0,d[0]=_,d.length=1,d}return u.length=0,u}const y=a.slice();return a.length=0,y}corner(){const i=this.getBoundingClientRect(!0);for(let r=0;r<this.children.length;r++){const o=this.children[r];o.translation.x-=i.left,o.translation.y-=i.top}return this.mask&&(this.mask.translation.x-=i.left,this.mask.translation.y-=i.top),this}center(){const i=this.getBoundingClientRect(!0),r=i.left+i.width/2-this.translation.x,o=i.top+i.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(i){let r=null;function o(s){if(s.id===i)return s;if(s.children){if(s.children.ids[i])return s.children.ids[i];for(let a=0;a<s.children.length;a++)if(r=o(s.children[a]),r)return r}return null}return o(this)}getByClassName(i){const r=[];function o(s){if(Array.prototype.indexOf.call(s.classList,i)>=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(i){const r=[];function o(s){if(s instanceof i&&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(i){i instanceof Array?i=i.slice():i=Array.prototype.slice.call(arguments);for(let r=0;r<i.length;r++){const o=i[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(i){const r=arguments.length,o=this.parent;if(r<=0&&o)return o.remove(this),this;i instanceof Array?i=i.slice():i=Array.prototype.slice.call(arguments);for(let s=0;s<i.length;s++){const a=i[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(i){let r,o,s,a,l,c;this._update(!0);let d=1/0,u=-1/0,f=1/0,h=-1/0;const p=/texture|gradient/i;o=i?this.matrix:this.worldMatrix;for(let m=0;m<this.children.length;m++){const g=this.children[m];if(!(!g.visible||p.test(g._renderer.type))&&(r=g.getBoundingClientRect(i),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(i){const[b,y]=o.multiply(r.left,r.top),[_,x]=o.multiply(r.right,r.top),[w,C]=o.multiply(r.left,r.bottom),[N,k]=o.multiply(r.right,r.bottom);f=Go(y,x,C,k,f),d=Go(b,_,w,N,d),u=Zo(b,_,w,N,u),h=Zo(y,x,C,k,h)}else f=Go(r.top,f),d=Go(r.left,d),u=Zo(r.right,u),h=Zo(r.bottom,h)}return{top:f,left:d,right:u,bottom:h,width:u-d,height:h-f}}noFill(){return this.children.forEach(function(i){i.noFill()}),this}noStroke(){return this.children.forEach(function(i){i.noStroke()}),this}subdivide(){const i=arguments;return this.children.forEach(function(r){r.subdivide.apply(r,i)}),this}_update(){let i,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(i=0;i<this.children.length;i++)o=this.children[i],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}};B(Wt,"Children",pu),B(Wt,"Properties",["fill","stroke","linewidth","cap","join","miter","closed","curved","automatic"]);let Un=Wt;const $u={visible:{enumerable:!0,get:function(){return this._visible},set:function(n){this._flagVisible=this._visible!==n||this._flagVisible,this._visible=n}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(n){this._flagOpacity=this._opacity!==n||this._flagOpacity,this._opacity=n}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(n){this._flagBeginning=this._beginning!==n||this._flagBeginning,this._beginning=n}},ending:{enumerable:!0,get:function(){return this._ending},set:function(n){this._flagEnding=this._ending!==n||this._flagEnding,this._ending=n}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let n=0;n<this.children.length;n++){const e=this.children[n];this._length+=e.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(n){this._fill=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.fill=n}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(n){this._stroke=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.stroke=n}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(n){this._linewidth=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.linewidth=n}}},join:{enumerable:!0,get:function(){return this._join},set:function(n){this._join=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.join=n}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(n){this._miter=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.miter=n}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(n){this._cap=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.cap=n}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(n){this._closed=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.closed=n}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(n){this._curved=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.curved=n}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(n){this._automatic=n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.automatic=n}}},children:{enumerable:!0,get:function(){return this._children},set:function(n){const e=Un.InsertChildren.bind(this),i=Un.RemoveChildren.bind(this),r=Un.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&i(this._children)),this._children=new pu(n),this._children.bind(te.Types.insert,e),this._children.bind(te.Types.remove,i),this._children.bind(te.Types.order,r),n.length>0&&e(n)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(n){this._mask=n,this._flagMask=!0,je.isObject(n)&&!n.clip&&(n.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(n){this._strokeAttenuation=!!n;for(let e=0;e<this.children.length;e++){const i=this.children[e];i.strokeAttenuation!==void 0&&(i.strokeAttenuation=n)}}}};function Eu(n,e){const i=n.parent;let r;if(i===e){o();return}if(i&&i.children.ids[n.id]&&(r=Array.prototype.indexOf.call(i.children,n),i.children.splice(r,1),s()),e){o();return}s(),i._flagAdditions&&i.additions.length===0&&(i._flagAdditions=!1),i._flagSubtractions&&i.subtractions.length===0&&(i._flagSubtractions=!1),delete n.parent;function o(){e.subtractions.length>0&&(r=Array.prototype.indexOf.call(e.subtractions,n),r>=0&&e.subtractions.splice(r,1)),e.additions.length>0&&(r=Array.prototype.indexOf.call(e.additions,n),r>=0&&e.additions.splice(r,1)),n.parent=e,e.additions.push(n),e._flagAdditions=!0}function s(){r=Array.prototype.indexOf.call(i.additions,n),r>=0&&i.additions.splice(r,1),r=Array.prototype.indexOf.call(i.subtractions,n),r<0&&(i.subtractions.push(n),i._flagSubtractions=!0)}}class Qo extends Oe{constructor(e,i,r,o){const s=[new Ae(e,i),new Ae(r,o)];super(s);for(let a in Ru)Object.defineProperty(this,a,Ru[a]);this.vertices[0].command=me.move,this.vertices[1].command=me.line,this.automatic=!1}}B(Qo,"Properties",["left","right"]);const Ru={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(n){if(je.isObject(n))this.vertices.splice(0,1,n),this.vertices[0].command=me.move;else{const e=new Lo("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(n){if(je.isObject(n))this.vertices.splice(1,1,n),this.vertices[1].command=me.line;else{const e=new Lo("Two.Line.right argument is not an object.");console.warn(e.name,e.message)}}}};class Va{constructor(e=0,i=0){this.x=e,this.y=i}}class Vn{constructor(e=10,i=0,r="A"){B(this,"start",new Va);B(this,"end",new Va);this.width=e,this.angle=i,this.label=r}}const Ke={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"}},Y1={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function U1(n,e){return t.openBlock(),t.createElementBlock("svg",Y1,[...e[0]||(e[0]=[t.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 Jo=t.markRaw({name:"ion-close",render:U1}),K1={class:"mr-3 flex flex-col gap-2"},G1=["onClick"],Z1={class:"h-full p-2"},Q1={},J1=t.defineComponent({...Q1,__name:"kozyrek-configurator-templates",props:{settings:{},selectTemplateIndex:{}},emits:["template:select","init-draw-template","remove-custom-template"],setup(n,{emit:e}){const i=n,r=t.ref(!1),o=t.useTemplateRef("drawing-template-containers"),s=t.useTemplateRef("drawing-custom-template-containers"),a=e,l=c=>{r.value=!0,a("remove-custom-template",c,()=>{r.value=!1})};return t.onMounted(()=>{var c,d;(c=i.settings.templates)==null||c.forEach((u,f)=>{var p;const h=(p=o.value)==null?void 0:p.at(f);h&&a("init-draw-template",h,u)}),(d=i.settings.customTemplates)==null||d.forEach((u,f)=>{var p;const h=(p=s.value)==null?void 0:p.at(f);h&&a("init-draw-template",h,u)})}),t.watch(()=>[...i.settings.customTemplates],(c,d)=>{t.nextTick(()=>{c.forEach((u,f)=>{var h;if(!(d!=null&&d.includes(u))){const p=(h=s.value)==null?void 0:h.at(f);p&&a("init-draw-template",p,u)}}),d.length>c.length&&d.forEach((u,f)=>{var p;const h=(p=s.value)==null?void 0:p.at(f);h&&(h.innerHTML="",a("init-draw-template",h,u))})})},{deep:!0}),(c,d)=>{const u=Jo;return t.openBlock(),t.createBlock(t.unref(I.NScrollbar),{style:{width:"auto"},trigger:"none",class:"max-h-[19rem] md:max-h-[40rem] w-auto"},{default:t.withCtx(()=>[t.createElementVNode("div",K1,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.settings.allTemplates,(f,h)=>(t.openBlock(),t.createElementBlock("div",{key:`${f.id}-${h}`,class:"group relative"},[t.createVNode(t.unref(I.NPopover),{trigger:"hover",placement:"right"},{trigger:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass(["relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200",{"!border-green-700":h===n.selectTemplateIndex}]),onClick:p=>a("template:select",h)},[t.createElementVNode("div",Z1,[t.createElementVNode("div",{ref_for:!0,ref:f.isCustom&&f.id!==-1?"drawing-custom-template-containers":"drawing-template-containers",class:"kozyrek-preview h-full"},null,512)])],10,G1)]),default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(f.label),1)]),_:2},1024),f.isCustom&&!f.isNewRec()?(t.openBlock(),t.createBlock(t.unref(I.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:p=>l(h)},{default:t.withCtx(()=>[t.createVNode(u)]),_:1},8,["loading","disabled","onClick"])):t.createCommentVNode("",!0)]))),128))])]),_:1})}}}),Pu=gn(J1,[["__scopeId","data-v-afccb364"]]),eb={class:"flex gap-3 min-w-[20rem] relative"},tb={class:"kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2"},nb={ref:"drawing-container",class:"size-full"},ib={},Fu=t.defineComponent({...ib,__name:"kozyrek-configurator-preview",props:{settings:{},value:{},selectTemplateIndex:{}},emits:["pointer:move","pointer:up","template:select","remove-custom-template"],setup(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("drawing-container");let s=[],a=[],l=[],c=null;const d=.75,u=t.computed(()=>i.value.configuratorParams.linesAngles.map((O,A)=>new Vn(i.value.configuratorParams.linesWidths[A],O,`A-${A+1}`))),f=t.computed(()=>i.value.configuratorParams.colorSide==="bottom"),h=t.computed(()=>{var O,A;return i.value.configuratorParams.startTailType&&((O=i.settings.startTailConfigs)!=null&&O[i.value.configuratorParams.startTailType])?(A=i.settings.startTailConfigs)==null?void 0:A[i.value.configuratorParams.startTailType].points:[]}),p=t.computed(()=>{var A;const O=i.value.configuratorParams.endTailType!==void 0&&((A=i.settings.endTailConfigs)==null?void 0:A[i.value.configuratorParams.endTailType]);return!O||!O.points?[]:O.points.map((Y,H)=>Array.isArray(Y)?new Vn(Y[0],Y[1],`A-${H+1}`):new Vn(Y.width,Y.angle,`A-${H+1}`))}),m=(O,A=!1)=>{O[0].start.x=0,O[0].start.y=0;let Y=0;for(let H=0;H<O.length;H++){const T=O[H],D=O[H-1]??new Vn(0,Y);Y+=!A||H>1?D.angle:0;const K=(!A||H>0?T.angle:0)+Y;if(O[H].end.x=T.width*Math.cos(K*Math.PI/180)+O[H].start.x,O[H].end.y=T.width*Math.sin(K*Math.PI/180)+O[H].start.y,H<O.length-1){const J=H+1;O[J].start.x=O[H].end.x,O[J].start.y=O[H].end.y}}return O},g=(O,A,Y,H,T=!1)=>{let D=m([...Y,...H]);A.length>0&&(D=[...m(A),...D]);let K=0,J=0,U=0,q=0;D.forEach(oe=>{K=Math.min(K,oe.start.x,oe.end.x),J=Math.min(J,oe.start.y,oe.end.y),U=Math.max(U,oe.start.x,oe.end.x),q=Math.max(q,oe.start.y,oe.end.y)});let L,le;K===0&&J===0&&U===0&&q===0?(L=1,le=1):(L=O.width/Math.abs(U-K),le=(T?O.height:O.height-Ke.colorSideLabel.size)/Math.abs(q-J));const ue=Math.min(L,le);return K=K<0?-K*ue:0,J=J<0?-J*ue:0,[ue,K,J]},b=O=>{const A=new Ko([O]);return A._size=Ke.anchorPoint.size,A.fill=Ke.anchorPoint.color,A.stroke="transparent",A._linewidth=Ke.anchorPoint.strokeSize,l.push(A),A},y=(O,A)=>{if(l=[],i.settings.allowChangeFirstPoint){const Y=O[0],H=new be(Y.vertices[0].x,Y.vertices[0].y);H.bind(te.Types.change,()=>{Y.vertices[0].copy(H)});const T=b(H);A.add(T)}O.forEach((Y,H)=>{const T=O[H+1],D=new be(Y.vertices[1].x,Y.vertices[1].y);D.bind(te.Types.change,()=>{Y.vertices[1].copy(D),T!==void 0&&T.vertices[0].copy(D)});const K=b(D);A.add(K)})},_=O=>O*(Math.PI/180),x=(O,A,Y)=>{const H=A.vertices.length-1;O.position.x=A.vertices[H].x,O.position.y=A.vertices[H].y;const T=Math.atan2(A.vertices[H].y-A.vertices[0].y,A.vertices[H].x-A.vertices[0].x);O.rotation=_(Y)+T},w=(O,A,Y)=>{if(A.vertices[0]===void 0)return;O.position.x=A.vertices[0].x,O.position.y=A.vertices[0].y;const H=A.vertices.length-1,T=Math.atan2(A.vertices[H].y-A.vertices[0].y,A.vertices[H].x-A.vertices[0].x);O.rotation=_(Y)+T},C=(O,A,Y)=>{const H=new Un;if(O.length===0)return H;const T=[];return[...O].reverse().forEach((D,K)=>{K!==0&&D.angle>0&&(D.angle*=-1),T.push(D)}),O=m(T,!0),w(H,A,O[0].angle),[A.vertices[0],A.vertices[1]].forEach(D=>{D.bind(te.Types.change,()=>{w(H,A,O[0].angle)})}),O.forEach(D=>{const K=D.start.x*Y,J=D.end.x*Y,U=D.start.y*Y,q=D.end.y*Y,L=new Qo(K,U,J,q);L.linewidth=Ke.line.size,L.stroke=Ke.line.color,H.add(L)}),H},N=(O,A,Y)=>{const H=new Un;return O.length===0||(O=m(O,!0),x(H,A,O[0].angle),[A.vertices[0],A.vertices[1]].forEach(T=>{T.bind(te.Types.change,()=>{x(H,A,O[0].angle)})}),O.forEach(T=>{const D=T.start.x*Y,K=T.end.x*Y,J=T.start.y*Y,U=T.end.y*Y,q=new Qo(D,J,K,U);q.linewidth=Ke.line.size,q.stroke=Ke.line.color,H.add(q)})),H},k=(O,A,Y,H)=>{const T=A.vertices[0].x+(A.vertices[1].x-A.vertices[0].x)/2-8*Math.sin(O.angle*Math.PI/180),D=A.vertices[0].y+(A.vertices[1].y-A.vertices[0].y)/2-8*Math.cos(O.angle*Math.PI/180),K=new gr(O.label,T+10,D-10);let J;K.size=Ke.lineLabel.size,K.weight=600,K.fill=Ke.lineLabel.color,K.id+=1,K.rotation=Ke.lineLabel.rotation,H>0&&(J=new gr(`${O.angle}°`,A.vertices[0].x+25,A.vertices[0].y-25),J.size=Ke.angleLabel.size,J.weight=600,J.fill=Ke.angleLabel.color,J.rotation=Ke.angleLabel.rotation,J.id+=H,s.push(J),Y.add(J)),Y.add(K),v(K,A,0,J),v(K,A,1)},$=()=>{const{size:O}=Ke.colorSideLabel,A=0,Y=0,H=f.value?O/2:O/2-O,T=f.value?O/2-O:O/2,D=new Un;if(!c)return D;const K=5,J=Math.atan2(T-H,Y-A),U=[new Ae(A,H,0,0,0,0,En.Commands.move),new Ae(Y,T,0,0,0,0,En.Commands.line),new Ae(Y-K*Math.cos(J-Math.PI/4),T-K*Math.sin(J-Math.PI/4),0,0,0,0,En.Commands.line),new Ae(Y,T,0,0,0,0,En.Commands.move),new Ae(Y-K*Math.cos(J+Math.PI/4),T-K*Math.sin(J+Math.PI/4),0,0,0,0,En.Commands.line)],q=new Oe(U,!1,!1,!0);q.noFill(),q.cap="round",q.join="round",q.linewidth=O/7,q.stroke=Ke.colorSideLabel.color,D.add(q);const L=new gr(f.value?"Цвет снизу":"Цвет сверху",10,0);L.size=O,L.weight=600,L.fill=Ke.colorSideLabel.color,L.alignment="left",D.add(L);const le=D.getBoundingClientRect();return D.position.x=(c.width-le.width)*d+10,D.position.y=f.value?c.height+le.height*2:le.height/2,D},v=(O,A,Y,H)=>{A.vertices[Y].bind(te.Types.change,()=>{const T=A.vertices.length-1,D=Math.atan2(A.vertices[0].y-A.vertices[T].y,A.vertices[0].x-A.vertices[T].x)*180/Math.PI,K=A.vertices[0].x+(A.vertices[T].x-A.vertices[0].x)/2-8*Math.sin(D*Math.PI/180),J=A.vertices[0].y+(A.vertices[T].y-A.vertices[0].y)/2-8*Math.cos(D*Math.PI/180);O.position.x=K+10,O.position.y=J-10,O.rotation=-.5,H&&(H.position.x=A.vertices[0].x+25,H.position.y=A.vertices[0].y-25)})},E=(O,A,Y,H,T=!1)=>{var fe;if(O.clear(),Y.length===0){O.update();return}const D=m(Y),[K,J,U]=g(O,A,D,H,T),q=new Un,L=new Array,le=new Array;T||(s=[],a=[]),D.forEach((ge,_e)=>{const Qe=ge.start.x*K+J,Re=ge.end.x*K+J,Mt=ge.start.y*K+U,vn=ge.end.y*K+U,It=new Qo(Qe,Mt,Re,vn);It.linewidth=T?Ke.previewLine.size:Ke.line.size,It.stroke=T?Ke.previewLine.color:Ke.line.color,a.push(It),L.push(It),q.add(It),!T&&ge.label!==""&&k(ge,It,q,_e)});const ue=L.at(-1);let oe=q.getBoundingClientRect();if(!T){const ge=$();le.push(ge)}if(A.length>0){const ge=C(A,L[0],K);q.add(ge)}if(H.length>0&&ue){const ge=N(H,ue,K);q.add(ge)}if(le.push(q),O.makeGroup(le),oe=q.getBoundingClientRect(),q.position.x=0-oe.left+(O.width-oe.width)/(2*(T?1:d)),q.position.y=0-oe.top+(O.height-oe.height)/(2*(T?1:d)),O.update(),!T){const ge=((fe=i.value.configuratorParams)==null?void 0:fe.colorSide)==="top";q.position.y=q.position.y+Ke.colorSideLabel.size*Number(ge),y(L,q),O.update()}},P=(O,A)=>{if(O&&!A.isNewRec()){const Y=new En({width:O.scrollWidth,height:O.scrollHeight});Y.appendTo(O),E(Y,[],A.points,[],!0)}},F=()=>{c&&E(c,h.value,u.value,p.value,!1)},R=O=>O*(180/Math.PI),M=(O,A)=>{const Y=O[1].x-O[0].x,H=O[1].y-O[0].y,T=A[1].x-A[0].x,D=A[1].y-A[0].y;let K=Math.atan2(Y*D-H*T,Y*T+H*D);return K=R(K),Math.round(K)*-1},X=O=>{const A=a.map((Y,H,T)=>{const D=T[H-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]};let K=Ve.multiplyByStep(Math.ceil(Ve.divideByStep(Y._length/O,i.settings.lineWidthStep)),i.settings.lineWidthStep);const J=s[H-1];K<(T.length>1?i.settings.minLineWidth:i.settings.stripMinWidth)&&(K=T.length>1?i.settings.minLineWidth:i.settings.stripMinWidth),K>i.settings.maxLineWidth&&(K=i.settings.maxLineWidth);const U=M(Y.vertices,D.vertices);return J&&(J.value=`${U}°`),new Vn(K,U,`A-${H+1}`)});r("pointer:move",A)},G=O=>{let A=null,Y;const H=J=>{A=l.find(U=>{const q=U.renderer;return(q==null?void 0:q.elem)===J.target}),[Y]=g(O,h.value,u.value.map(U=>U),p.value)},T=J=>{if(A){const U=A.renderer,q=U==null?void 0:U.elem;if(!q)return;const L=q.getBoundingClientRect();A.vertices[0].x-=L.x-(J instanceof MouseEvent?J.clientX:J.targetTouches[0].clientX)+Ke.anchorPoint.size/2,A.vertices[0].y-=L.y-(J instanceof MouseEvent?J.clientY:J.targetTouches[0].clientY)+Ke.anchorPoint.size/2,X(Y),O.update()}},D=()=>{A&&r("pointer:up",u.value),A=null},K=o.value;K&&(K.addEventListener("touchstart",H,{passive:!0}),K.addEventListener("touchend",D,{passive:!0}),K.addEventListener("mousedown",H),K.addEventListener("mouseup",D),K.addEventListener("mousemove",T),K.addEventListener("touchmove",T,{passive:!0}))},Z=(O,A)=>{r("remove-custom-template",O,A)};return t.onMounted(()=>{o.value&&(c=new En({width:o.value.scrollWidth,height:o.value.scrollHeight,fullscreen:!1}).appendTo(o.value),c.scene.scale=d,c.update(),t.watch(()=>i.value,()=>{F()},{deep:!0,immediate:!0}),G(c))}),t.onBeforeUnmount(()=>{c&&(c.clear(),c=null)}),(O,A)=>(t.openBlock(),t.createElementBlock("div",eb,[t.createVNode(Pu,{"select-template-index":n.selectTemplateIndex,settings:n.settings,"onTemplate:select":A[0]||(A[0]=Y=>r("template:select",Y)),onInitDrawTemplate:P,onRemoveCustomTemplate:Z},null,8,["select-template-index","settings"]),t.createElementVNode("div",tb,[t.createElementVNode("div",nb,null,512)])]))}});class yr extends W.Identity{constructor(i,r){super();B(this,"label","");B(this,"points",[]);B(this,"isCustom",!1);B(this,"id",-1);B(this,"guid","");i?(this.label=i.label,this.points=i.points.map((o,s)=>V.isArray(o)?new Vn(o[0],o[1],`A-${s+1}`):new Vn(o.width,o.angle,`A-${s+1}`)),this.isCustom=i.isCustom):(this.label="-- Новая конфигурация --",this.points=[new Vn(0,0,"A-1")],this.isCustom=!0,this.id=r??this.id)}}class Ma extends yr{constructor(i){super(i);B(this,"isDefault");this.isDefault=i.isDefault??!1}}class Vu{constructor(e){B(this,"minLineWidth");B(this,"maxLineWidth");B(this,"lineWidthStep");B(this,"minLineAngle");B(this,"maxLineAngle");B(this,"lineAngleStep");B(this,"stripMinWidth");B(this,"stripMaxWidth");B(this,"stripMinLength");B(this,"stripMaxLength");B(this,"allowShowTable");B(this,"showOnlyTemplates");B(this,"templates");B(this,"customTemplates",[]);B(this,"startTailConfigs");B(this,"endTailConfigs");B(this,"bendCountForExtended");B(this,"extendedProductCatalog");B(this,"allowChangeFirstPoint");B(this,"allowSaveTemplates");B(this,"userTemplatesPrefix");B(this,"lengthStep");B(this,"canSetDopProdaga");var i,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 yr(o)),this.templates.forEach((o,s)=>{o.id=s}),this.startTailConfigs=((i=e.startTailConfigs)==null?void 0:i.map(o=>new Ma(o)))??[],this.endTailConfigs=((r=e.endTailConfigs)==null?void 0:r.map(o=>new Ma(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 yr(s);return a.isCustom=!0,a.id=+o,a}):[],this.customTemplates.some(o=>o.isCustom&&o.isNewRec())||this.customTemplates.push(new yr({label:"-- Новая конфигурация --",points:[new Vn(this.stripMinWidth,0,"A-1")],isCustom:!0,id:-1,guid:""})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;const i=this.customTemplates.findLast(o=>!o.isNewRec()),r=new yr(e);r.isCustom=!0,r.id=i?i.id+1:0,this.customTemplates.splice(-1,0,r)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;const i=this.customTemplates.findIndex(r=>r.id===e);i!==-1&&this.customTemplates.splice(i,1)}}const rb={class:"flex flex-col gap-3"},ob={class:"grid gap-5 md:grid-cols-5"},sb={},Mu=t.defineComponent({...sb,__name:"kozyrek-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.ref(!1),s=t.ref(!1),a=t.ref(!1),l=t.ref(i.cartItem),c=t.ref(new Vu(i.settings)),d=t.ref({linesWidths:[...i.cartItem.configuratorParams.linesWidths],linesAngles:[...i.cartItem.configuratorParams.linesAngles]}),u=t.ref({quantity:{},marker:{},length:{}}),f=t.ref(0),h=t.useTemplateRef("kozyrek-configurator-params-form"),p=(v=0)=>{var P;const E=(P=c.value.allTemplates)==null?void 0:P.at(v);E!==void 0&&(f.value=v,l.value.configuratorParams.linesWidths=E.points.map(F=>V.isArray(F)?F[0]:F.width),l.value.configuratorParams.linesAngles=E.points.map(F=>V.isArray(F)?F[1]:F.angle),x()),y(l.value.configuratorParams)},m=async()=>{const v=prompt("Введите название шаблона:");if(!v)return;a.value=!0;const E={label:v,points:l.value.configuratorParams.linesWidths.map((F,R)=>[F,l.value.configuratorParams.linesAngles[R]])},P=F=>{F&&(c.value.addCustomTemplate(E),f.value=c.value.allTemplates.length-2),a.value=!1};i.eventEmitter.emit("configurator:create-template",{category:i.cartItem.category,template:E,callback:P})},g=async(v,E)=>{var R;const P=(R=c.value.allTemplates)==null?void 0:R.at(v);if(!P||!P.isCustom)return;const F=M=>{M&&(c.value.removeCustomTemplate(P.id),p()),E==null||E()};i.eventEmitter.emit("configurator:remove-template",{category:i.cartItem.category,templateId:P.id,callback:F})},b=()=>{c.value.showOnlyTemplates||c.value.allowSaveTemplates&&(f.value=c.value.allTemplates.length-1)},y=async v=>{var E,P;l.value.product=new W.ClientProduct,(P=(E=h.value)==null?void 0:E.formReference)==null||P.validate(F=>{F||(x(),o.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.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(V.noop)},_=async()=>{var v,E;(E=(v=h.value)==null?void 0:v.formReference)==null||E.validate(P=>{var F,R;if(!P){s.value=!0;const M=new W.OrderItemBase(l.value);(F=c.value.startTailConfigs)!=null&&F.length||delete M.configuratorParams.startTailType,(R=c.value.endTailConfigs)!=null&&R.length||delete M.configuratorParams.endTailType,r("submit",M,u.value,()=>{s.value=!1,t.nextTick(()=>{var X,G;(G=(X=h.value)==null?void 0:X.formReference)==null||G.restoreValidation()})})}}).catch(V.noop)},x=()=>{const v={quantity:u.value.quantity,marker:u.value.marker};l.value.configuratorParams.linesWidths.forEach((E,P)=>{v[`lines_widths[${P+1}]`]={},v[`lines_angles[${P+1}]`]={}}),u.value=v},w=v=>{d.value.linesWidths=v.map(E=>E.width),d.value.linesAngles=v.map(E=>E.angle)},C=v=>{l.value.configuratorParams.linesWidths=d.value.linesWidths,l.value.configuratorParams.linesAngles=d.value.linesAngles,x(),b(),y(l.value.configuratorParams)},N=(v,E)=>{d.value.linesWidths=v,d.value.linesAngles=E},k=v=>{const E=l.value.configuratorParams.linesWidths.length>1?c.value.minLineWidth:c.value.stripMinWidth,P=0;l.value.configuratorParams.linesWidths.splice(v+1,0,E),l.value.configuratorParams.linesAngles.splice(v+1,0,P),d.value.linesWidths=[...l.value.configuratorParams.linesWidths],d.value.linesAngles=[...l.value.configuratorParams.linesAngles],x(),b(),y(l.value.configuratorParams)},$=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],x(),b(),y(l.value.configuratorParams))};return t.onMounted(()=>{i.cartItem.isNewRec()?p():(x(),f.value=-1,y(l.value.configuratorParams))}),t.watch(()=>i.cartItem,v=>{l.value=new W.OrderItemBase(v),v.isNewRec()?p():(x(),f.value=-1,y(l.value.configuratorParams))}),(v,E)=>{const P=I.NButton;return t.openBlock(),t.createElementBlock("div",rb,[n.settings.allowShowTable?(t.openBlock(),t.createBlock(P,{key:0,type:"tertiary",class:"self-end",onClick:E[0]||(E[0]=F=>r("click:view-switch"))},{default:t.withCtx(()=>[...E[3]||(E[3]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",ob,[t.createVNode(Fu,{value:l.value,"select-template-index":f.value,settings:c.value,class:"h-fit col-span-3","onPointer:up":C,"onPointer:move":w,"onTemplate:select":p,onRemoveCustomTemplate:g},null,8,["value","select-template-index","settings"]),t.createVNode(hc,{ref:"kozyrek-configurator-params-form",value:l.value,"onUpdate:value":E[1]||(E[1]=F=>l.value=F),"preview-params":d.value,validation:u.value,settings:c.value,"is-submit-processing":s.value,"is-product-searching":o.value,"select-template-index":f.value,class:"col-span-2","onUpdate:params":E[2]||(E[2]=F=>y(F)),"onUpdate:preview":N,onSubmit:_,"onClick:saveTemplate":m,"onClick:addLine":k,"onClick:removeLine":$},null,8,["value","preview-params","validation","settings","is-submit-processing","is-product-searching","select-template-index"])])])}}}),ab={class:"flex flex-col items-center justify-between rounded-xl"},lb={class:"img-preview relative flex justify-center"},cb={},db=t.defineComponent({...cb,__name:"mosquito-configurator-preview",props:{configuratorParams:{},settings:{}},emits:["open-instructions"],setup(n,{emit:e}){const i=n,r=t.computed(()=>{const{height:s}=i.configuratorParams;return V.keys(i.settings.crossbarCount).reverse().find(a=>s>=i.settings.crossbarCount[Number(a)])}),o=e;return(s,a)=>{const l=I.NButton;return t.openBlock(),t.createElementBlock("div",ab,[t.createElementVNode("div",lb,[a[1]||(a[1]=t.createElementVNode("div",{class:"window"},null,-1)),t.createElementVNode("div",{class:t.normalizeClass(["net",`net-${n.configuratorParams.netType}`])},null,2),t.createElementVNode("div",{class:t.normalizeClass(["frame",`frame-${n.configuratorParams.color}`])},null,2),r.value?(t.openBlock(),t.createElementBlock("div",{key:0,class:t.normalizeClass(["frame-crossbar",`frame-crossbar-${r.value}-${n.configuratorParams.color}`])},null,2)):t.createCommentVNode("",!0),t.createElementVNode("div",{class:t.normalizeClass(["mount",`mount-${n.configuratorParams.mountType}-${n.configuratorParams.color}`])},null,2),t.createElementVNode("div",{class:t.normalizeClass(["cut-preview",`cut-preview-${n.configuratorParams.mountType}-${n.configuratorParams.color}`])},null,2)]),t.createVNode(l,{type:"primary",class:"block justify-self-center",onClick:a[0]||(a[0]=c=>o("open-instructions"))},{default:t.withCtx(()=>[...a[2]||(a[2]=[t.createTextVNode(" Руководство по замеру ",-1)])]),_:1})])}}}),Ia=gn(db,[["__scopeId","data-v-2a790a20"]]),ub={key:0,class:"flex items-baseline gap-1"},fb={key:0,class:"flex items-baseline gap-1"},hb={key:1},mb={class:"text-lg font-semibold"},pb={key:2,class:"text-red-500 text-sm mb-2"},gb={class:"flex gap-3"},yb={},Iu=t.defineComponent({...yb,__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(n,{expose:e,emit:i}){var k;const r=n,o=i,s=t.computed(()=>Ue.isPhoneDevice()),a=t.useTemplateRef("form-reference"),l=t.useTemplateRef("width-form-item-reference"),c=t.useTemplateRef("height-form-item-reference"),d=t.useTemplateRef("width-input-reference"),u=t.ref(V.cloneDeep(r.value)),f=t.computed(()=>r.settings.widthOverlaps[u.value.configuratorParams.mountType]??0),h=t.computed(()=>r.settings.heightOverlaps[u.value.configuratorParams.mountType]??0),p=t.computed(()=>r.settings.maxWidths[u.value.configuratorParams.netType]),m=t.computed(()=>r.settings.maxHeights[u.value.configuratorParams.netType]),g=t.computed(()=>u.value.configuratorParams.width?u.value.configuratorParams.width+f.value:0),b=t.computed(()=>u.value.configuratorParams.height?u.value.configuratorParams.height+h.value:0),y=t.ref(r.settings.canSetDopProdaga??!1),_=t.computed(()=>({"configuratorParams.width":[ce.required,ce.min(r.settings.minWidth-f.value),ce.max(p.value-f.value),ce.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.height":[ce.required,ce.min(r.settings.minHeight-h.value),ce.max(m.value-h.value),ce.step(1),We.serverValidation(r.validation.height.feedback)],quantity:[ce.required,ce.min(1),ce.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),x=t.computed(()=>{var R;const $=g.value,v=b.value,{quantity:E}=r.value,P=((R=r.value.product)==null?void 0:R.costRub)||0;if(!$||!v||!E||P===0)return null;const F=$*v/1e6;return Ve.formatMoney(P*E*F)}),w=t.computed(()=>{const $=g.value,v=b.value,E=!!($&&$>=r.settings.minWidth&&$<=r.settings.maxWidths[u.value.configuratorParams.netType]),P=!!(v&&v>=r.settings.minHeight&&v<=r.settings.maxHeights[u.value.configuratorParams.netType]),F=!!(r.value.quantity&&r.value.quantity>0);return E&&P&&F}),C=($,v)=>{var F,R;const E=u.value.configuratorParams;$&&$ in E&&(E[$]=v);const P={...E,width:g.value??0,height:b.value??0};$==="width"&&((F=l.value)==null||F.validate().catch(V.noop)),$==="height"&&((R=c.value)==null||R.validate().catch(V.noop)),t.nextTick(()=>{var X,G;!((X=l.value)!=null&&X.validationErrored)&&!((G=c.value)!=null&&G.validationErrored)&&P.height&&P.width&&o("update:params",P),N("configuratorParams",P)})},N=($,v)=>{const E=new W.OrderItemBase(r.value);E[$]=v,$==="configuratorParams"&&(E.product=new W.ClientProduct),o("update:value",E)};return t.watch(()=>r.value,$=>{const v=V.cloneDeep(t.toRaw($)),E=v.configuratorParams.mountType,P=r.settings.widthOverlaps[E]??0,F=r.settings.heightOverlaps[E]??0;v.configuratorParams.width&&v.configuratorParams.width>0&&(v.configuratorParams.width-=P),v.configuratorParams.height&&v.configuratorParams.height>0&&(v.configuratorParams.height-=F),u.value=v},{deep:!0,immediate:!0}),t.onMounted(()=>{var $;($=d.value)==null||$.select()}),e({validate:(k=a.value)==null?void 0:k.validate,formReference:a}),($,v)=>{const E=I.NCheckbox;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.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:t.withCtx(()=>[t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Тип сетки"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:u.value.configuratorParams.netType,"onUpdate:value":[v[0]||(v[0]=P=>u.value.configuratorParams.netType=P),v[1]||(v[1]=P=>C("netType",P))],options:n.settings.netType.map(P=>({label:n.settings.descriptions.net_type[P],value:P}))},null,8,["value","options"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Цвет профиля"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:u.value.configuratorParams.color,"onUpdate:value":[v[2]||(v[2]=P=>u.value.configuratorParams.color=P),v[3]||(v[3]=P=>C("color",P))],options:n.settings.color.map(P=>({label:n.settings.descriptions.color[P],value:P}))},null,8,["value","options"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Вид крепления"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:u.value.configuratorParams.mountType,"onUpdate:value":[v[4]||(v[4]=P=>u.value.configuratorParams.mountType=P),v[5]||(v[5]=P=>C("mountType",P))],options:n.settings.mountType.map(P=>({label:n.settings.descriptions.mount_type[P],value:P}))},null,8,["value","options"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{ref:"width-form-item-reference",path:"configuratorParams.width",label:`Ширина светового проёма от ${n.settings.minWidth-f.value} ${p.value?" до "+(p.value-f.value):""} мм.`},{feedback:t.withCtx(()=>[!n.validation.width.showFeedback&&g.value>=n.settings.minWidth&&g.value<=n.settings.maxWidths[u.value.configuratorParams.netType]?(t.openBlock(),t.createElementBlock("div",ub,[t.createVNode(t.unref(I.NText),{type:"success"},{default:t.withCtx(()=>[t.createTextVNode("Ширина готового изделия "+t.toDisplayString(g.value),1)]),_:1}),t.createVNode(t.unref(I.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[10]||(v[10]=P=>o("click:instructions-toggle"))},{default:t.withCtx(()=>[...v[25]||(v[25]=[t.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):t.createCommentVNode("",!0)]),default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{ref:"width-input-reference",value:u.value.configuratorParams.width,"onUpdate:value":[v[6]||(v[6]=P=>u.value.configuratorParams.width=P),v[9]||(v[9]=P=>C("width",P))],parse:t.unref(ht),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[7]||(v[7]=P=>t.unref(ft)(P)),onInput:v[8]||(v[8]=P=>t.unref(dt)(n.validation,"width")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{ref:"height-form-item-reference",path:"configuratorParams.height",label:`Высота светового проёма от ${n.settings.minHeight-h.value} ${m.value?" до "+(m.value-h.value):""} мм.`},{feedback:t.withCtx(()=>[!n.validation.height.showFeedback&&b.value>=n.settings.minHeight&&b.value<=n.settings.maxHeights[u.value.configuratorParams.netType]?(t.openBlock(),t.createElementBlock("div",fb,[t.createVNode(t.unref(I.NText),{type:"success"},{default:t.withCtx(()=>[t.createTextVNode("Высота готового изделия "+t.toDisplayString(b.value),1)]),_:1}),t.createVNode(t.unref(I.NButton),{quaternary:"",type:"info",size:"tiny",onClick:v[15]||(v[15]=P=>o("click:instructions-toggle"))},{default:t.withCtx(()=>[...v[26]||(v[26]=[t.createElementVNode("span",{class:"text-sm"},"Руководство",-1)])]),_:1})])):t.createCommentVNode("",!0)]),default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:u.value.configuratorParams.height,"onUpdate:value":[v[11]||(v[11]=P=>u.value.configuratorParams.height=P),v[14]||(v[14]=P=>C("height",P))],parse:t.unref(ht),"show-button":!1,placeholder:"Введите высоту светового проёма",class:"w-full",onKeydown:v[12]||(v[12]=P=>t.unref(ft)(P)),onInput:v[13]||(v[13]=P=>t.unref(dt)(n.validation,"height")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{path:"quantity",label:"Количество"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:u.value.quantity,"onUpdate:value":[v[16]||(v[16]=P=>u.value.quantity=P),v[19]||(v[19]=P=>N("quantity",P??0))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:v[17]||(v[17]=P=>t.unref(ft)(P,!1)),onInput:v[18]||(v[18]=P=>t.unref(dt)(n.validation,"quantity")),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{path:"marker",label:"Маркировка"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:u.value.marker??null,placeholder:"Введите маркировку",onInput:v[20]||(v[20]=P=>t.unref(dt)(n.validation,"marker")),"onUpdate:value":v[21]||(v[21]=P=>{u.value.marker=P??null,N("marker",P??null)}),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),y.value?(t.openBlock(),t.createBlock(E,{key:0,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":v[22]||(v[22]=P=>{u.value.isAdditionalSale=P??!1,N("isAdditionalSale",P??!1)})},{default:t.withCtx(()=>[...v[27]||(v[27]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),t.createVNode(Fr,{"is-product-searching":n.isProductSearching,product:u.value.product,validation:n.validation.product},null,8,["is-product-searching","product","validation"]),x.value?(t.openBlock(),t.createElementBlock("div",hb,[v[28]||(v[28]=t.createTextVNode(" ИТОГО: ",-1)),t.createElementVNode("span",mb,t.toDisplayString(x.value)+" ₽",1)])):t.createCommentVNode("",!0),w.value?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("div",pb," Пожалуйста, заполните все обязательные поля корректно. ")),t.createElementVNode("div",gb,[t.createVNode(t.unref(I.NButton),{loading:n.isSubmitProcessing,disabled:!w.value||u.value.product.isNewRec(),type:"primary",class:"self-start",onClick:v[23]||(v[23]=P=>o("submit",n.value))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"]),s.value?(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:0,type:"default",onClick:v[24]||(v[24]=P=>o("click:show-preview-drawer"))},{default:t.withCtx(()=>[...v[29]||(v[29]=[t.createTextVNode(" Предварительный просмотр ",-1)])]),_:1})):t.createCommentVNode("",!0)])]),_:1},8,["model","rules"])),[[t.unref(ai),()=>o("submit",u.value)]])}}}),bb="/img/configurators/mosquitto/measurement-instructions/measurement-height.png",_b="/img/configurators/mosquitto/measurement-instructions/measurement-width.png",wb="/img/configurators/mosquitto/measurement-instructions/mount.png",xb="/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png",kb="/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png",Cb={class:"flex flex-col gap-6"},vb={class:"flex gap-4"},Sb={class:"flex flex-col gap-2"},Bb={class:"flex gap-4"},Nb={class:"flex flex-col gap-2"},Tb={class:"flex gap-4"},$b={class:"flex flex-col gap-2"},Eb={},Au=t.defineComponent({...Eb,__name:"mosquito-configurator-measurement-instructions",props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:["update:show"],setup(n,{emit:e}){const i=Ue.initRefDependingOnDeviceResolution("small","small","medium"),r=Ue.initRefDependingOnDeviceResolution(.98,.95,.8),o=t.computed(()=>window.innerWidth*r.value),s=e;return(a,l)=>{const c=I.NText;return t.openBlock(),t.createBlock(t.unref(I.NModal),{show:n.show,"show-icon":!1,size:t.unref(i),style:t.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:t.withCtx(()=>[t.createElementVNode("div",Cb,[t.createVNode(c,{type:"error",class:"text-base font-medium"},{default:t.withCtx(()=>[...l[3]||(l[3]=[t.createTextVNode(" Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. ",-1)])]),_:1}),l[22]||(l[22]=t.createElementVNode("div",{class:"grid gap-6 md:grid-cols-2"},[t.createElementVNode("div",{class:"flex items-start gap-4"},[t.createElementVNode("img",{src:bb,alt:"measurement-height",class:"w-[7.5rem]"}),t.createElementVNode("div",{class:"flex flex-col gap-2"},[t.createElementVNode("span",{class:"text-lg font-bold"},"Замер ширины"),t.createElementVNode("span",null,"Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм")])]),t.createElementVNode("div",{class:"flex items-start gap-4"},[t.createElementVNode("img",{src:_b,alt:"measurement-height",class:"w-[7.5rem]"}),t.createElementVNode("div",{class:"flex flex-col gap-2"},[t.createElementVNode("span",{class:"text-lg font-bold"},"Замер высоты"),t.createElementVNode("span",null,"Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм")])])],-1)),t.createElementVNode("div",vb,[l[9]||(l[9]=t.createElementVNode("img",{src:wb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),t.createElementVNode("div",Sb,[l[8]||(l[8]=t.createElementVNode("span",{class:"text-lg font-bold"},"Крепление на раме сетки",-1)),t.createElementVNode("span",null,[l[4]||(l[4]=t.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[5]||(l[5]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Ширина светового проема +"+t.toDisplayString(n.widthOverlaps.frame)+" мм. Высота светового проема +"+t.toDisplayString(n.heightOverlaps.frame)+" мм. ",1),l[6]||(l[6]=t.createElementVNode("br",null,null,-1)),l[7]||(l[7]=t.createTextVNode(" Крепления находятся на раме сетки. ",-1))])])]),t.createElementVNode("div",Bb,[l[15]||(l[15]=t.createElementVNode("img",{src:xb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),t.createElementVNode("div",Nb,[l[14]||(l[14]=t.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление пластик (верх+низ)",-1)),t.createElementVNode("span",null,[l[10]||(l[10]=t.createTextVNode(" Расчетные размеры москитной сетки:",-1)),l[11]||(l[11]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Ширина светового проема +"+t.toDisplayString(n.widthOverlaps.external_plastic)+" мм. Высота светового проема +"+t.toDisplayString(n.heightOverlaps.external_plastic)+" мм. ",1),l[12]||(l[12]=t.createElementVNode("br",null,null,-1)),l[13]||(l[13]=t.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])]),t.createElementVNode("div",Tb,[l[21]||(l[21]=t.createElementVNode("img",{src:kb,alt:"measurement-height",class:"w-[7.5rem]"},null,-1)),t.createElementVNode("div",$b,[l[20]||(l[20]=t.createElementVNode("span",{class:"text-lg font-bold"},"Z-Образное крепление металл (верх+низ)",-1)),t.createElementVNode("span",null,[l[16]||(l[16]=t.createTextVNode(" Расчетные размеры москитной сетки: ",-1)),l[17]||(l[17]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Ширина светового проема +"+t.toDisplayString(n.widthOverlaps.external_metal)+" мм. Высота светового проема +"+t.toDisplayString(n.heightOverlaps.external_metal)+" мм. ",1),l[18]||(l[18]=t.createElementVNode("br",null,null,-1)),l[19]||(l[19]=t.createTextVNode(" Крепления прикручиваются к раме окна c помощью шурупов. ",-1))])])])])]),_:1},8,["show","size","style"])}}}),Rb={class:"grid md:grid-cols-2"},Pb={},Ou=t.defineComponent({...Pb,__name:"mosquito-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.computed(()=>Ue.isPhoneDevice()),s=t.ref(!1),a=t.ref(!1),l=t.ref(i.cartItem),c=t.useTemplateRef("mosquito-configurator-form"),d=t.ref({width:{},height:{},quantity:{},marker:{}}),u=t.ref(!1),f=t.ref(!1),h=t.computed(()=>t.inject("debounce-input-time",300)),p=V.debounce(async g=>{var b,y;l.value.product=new W.ClientProduct,(y=(b=c.value)==null?void 0:b.formReference)==null||y.validate(_=>{_||(u.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:g,validationFieldResultData:d.value,callback:x=>{x?l.value.product=x:d.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},u.value=!1}}))}).catch(V.noop)},h.value),m=()=>{f.value=!0,r("submit",l.value,d.value,()=>{f.value=!1})};return t.watch(()=>i.cartItem,g=>{l.value=g},{deep:!0}),(g,b)=>{const y=Jo;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createVNode(Au,{show:a.value,"onUpdate:show":b[0]||(b[0]=_=>a.value=_),"height-overlaps":n.settings.heightOverlaps,"width-overlaps":n.settings.widthOverlaps},null,8,["show","height-overlaps","width-overlaps"]),t.createElementVNode("div",Rb,[o.value?(t.openBlock(),t.createBlock(t.unref(I.NDrawer),{key:1,show:s.value,"onUpdate:show":b[4]||(b[4]=_=>s.value=_),"default-width":375,resizable:""},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NDrawerContent),null,{header:t.withCtx(()=>[t.createVNode(t.unref(I.NButton),{size:"small",type:"primary",class:"block justify-self-end",onClick:b[2]||(b[2]=_=>s.value=!1)},{default:t.withCtx(()=>[t.createVNode(y)]),_:1})]),default:t.withCtx(()=>[t.createVNode(Ia,{"configurator-params":l.value.configuratorParams,settings:n.settings,onOpenInstructions:b[3]||(b[3]=_=>a.value=!0)},null,8,["configurator-params","settings"])]),_:1})]),_:1},8,["show"])):(t.openBlock(),t.createBlock(Ia,{key:0,"configurator-params":l.value.configuratorParams,settings:n.settings,onOpenInstructions:b[1]||(b[1]=_=>a.value=!0)},null,8,["configurator-params","settings"])),t.createVNode(Iu,{ref:"mosquito-configurator-form",value:l.value,"onUpdate:value":b[5]||(b[5]=_=>l.value=_),validation:d.value,settings:n.settings,"is-product-searching":u.value,"is-submit-processing":f.value,"onUpdate:params":b[6]||(b[6]=_=>t.unref(p)(_)),onSubmit:b[7]||(b[7]=_=>m()),"onClick:instructionsToggle":b[8]||(b[8]=_=>a.value=!a.value),"onClick:showPreviewDrawer":b[9]||(b[9]=_=>s.value=!0)},null,8,["value","validation","settings","is-product-searching","is-submit-processing"])])],64)}}}),Fb={},zu=t.defineComponent({...Fb,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.useTemplateRef("width-input-element"),a=t.ref(!1),l=t.ref(r.value),c=t.useTemplateRef("form-item-reference"),d=t.computed(()=>{var p;return!((p=c.value)!=null&&p.validationErrored)}),u=p=>{l.value=p,o("update:value",p,r.index,a)},f=p=>{ft(p),(p.key==="Enter"||p.code==="Enter")&&!r.isLastLine&&(p.preventDefault(),p.stopPropagation())},h=()=>{var p;(p=s.value)==null||p.select()};return t.watch(()=>r.value,p=>{l.value=p}),t.onMounted(()=>{r.autoFocus&&t.nextTick(()=>{h()})}),e({isValid:d,formItemReference:c}),(p,m)=>{const g=fc,b=yo;return t.openBlock(),t.createBlock(t.unref(I.NFormItem),{ref:"form-item-reference",path:n.path,label:`Полоса №${n.index+1}, мм`,class:"sc-hide-empty-feedback-message"},{feedback:t.withCtx(()=>[d.value?(t.openBlock(),t.createBlock(Fr,{key:0,"is-product-searching":a.value,product:n.product,validation:n.validation.product},null,8,["is-product-searching","product","validation"])):t.createCommentVNode("",!0)]),default:t.withCtx(()=>[t.createVNode(t.unref(I.NDropdown),{trigger:"click",options:n.suggestionOption,placement:"bottom-start",size:"large",onSelect:u},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{ref:"width-input-element",value:l.value??null,class:"w-full","show-button":!1,parse:t.unref(ht),placeholder:"Введите ширину",onKeydown:f,onInput:m[0]||(m[0]=y=>t.unref(dt)(n.validation,`linesWidths.${n.index}`)),onFocus:t.unref(He),"onUpdate:value":u},null,8,["value","parse","onFocus"])]),_:1},8,["options"]),t.createVNode(t.unref(I.NButton),{disabled:n.addLineButtonDisabled,size:"medium",class:"ml-2",onClick:m[1]||(m[1]=y=>o("click:add-line",n.index))},{default:t.withCtx(()=>[t.createVNode(g)]),_:1},8,["disabled"]),t.createVNode(t.unref(I.NButton),{disabled:n.removeLineButtonDisabled,size:"medium",class:"ml-2",onClick:m[2]||(m[2]=y=>o("click:remove-line",n.index))},{default:t.withCtx(()=>[t.createVNode(b)]),_:1},8,["disabled"])]),_:1},8,["path","label"])}}}),Vb={class:"my-2 flex w-full flex-col"},Mb={key:1},Ib={class:"text-lg font-semibold"},Ab={class:"flex gap-3"},Ob={},Du=t.defineComponent({...Ob,__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(n,{expose:e,emit:i}){var _;const r=n,o=i,s=t.useTemplateRef("form-reference"),a=t.useTemplateRef("line-items-reference"),l=t.ref(V.cloneDeep(r.value)),c=t.computed(()=>{const x={length:[ce.required,ce.min(r.settings.minLength),ce.max(r.settings.maxLength),ce.step(r.settings.lengthStep),We.serverValidation(r.validation.length.feedback)],quantity:[ce.required,ce.min(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]};return V.forEach(l.value,(w,C)=>{var N;x[`configuratorParams.linesWidths.${C}`]=[ce.required,ce.min(r.settings.minLineWidth),ce.step(r.settings.lineWidthStep),We.serverValidation((N=r.validation[`linesWidths.${C}`])==null?void 0:N.feedback)]}),x}),d=t.ref(r.settings.canSetDopProdaga??!1),u=t.computed(()=>r.value[0].configuratorParams.linesWidths.reduce((x,w)=>(x??0)+(w??0),0)),f=t.computed(()=>r.settings.width-u.value),h=t.computed(()=>!r.value.some(({product:x})=>!x||x.isNewRec())),p=t.computed(()=>r.isSubmitProcessing||!h.value||f.value<=0||l.value.length>=r.settings.maxLinesCount||r.value.some(x=>x.product.isNewRec())),m=t.computed(()=>x=>f.value===0?void 0:[{label:`${(f.value>0?"Остаток +":"Излишек ")+f.value} мм.`,key:f.value+x}]),g=t.computed(()=>{const{length:x}=r.value[0];if(!x||u.value!==r.settings.width)return null;const w=V.reduce(r.value,(C,N)=>{var $;const k=(($=N.product)==null?void 0:$.costRub)||0;return C+k},0);return Ve.formatMoney(w*r.value[0].quantity*x)}),b=(x,w,C)=>{var k,$,v;l.value[w].product.id=-1;const{configuratorParams:N}=l.value[w];N.linesWidths[w]=x,y("configuratorParams",N),(v=($=(k=a.value)==null?void 0:k.at(w))==null?void 0:$.formItemReference)==null||v.validate().catch(V.noop),t.nextTick(()=>{var E,P;(P=(E=a.value)==null?void 0:E.at(w))!=null&&P.isValid&&o("update:params",N,w,C)})},y=(x,w)=>{l.value.forEach(C=>{C[x]=w}),o("update:value",l.value)};return t.watch(()=>r.value,x=>{l.value=V.cloneDeep(x)},{deep:!0}),e({validate:(_=s.value)==null?void 0:_.validate,formReference:s}),(x,w)=>{const C=I.NCheckbox;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{ref:"form-reference",model:l.value[0],rules:c.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>{var N;return[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(l.value,(k,$)=>{var v,E,P;return t.openBlock(),t.createBlock(zu,{key:$,ref_for:!0,ref:"line-items-reference",value:((v=k.configuratorParams)==null?void 0:v.linesWidths.at($))??null,"auto-focus":(((E=k.configuratorParams)==null?void 0:E.linesWidths.at($))??0)===0,index:$,path:`configuratorParams.linesWidths.${$}`,product:k.product,settings:n.settings,validation:n.validation,"suggestion-option":m.value(((P=k.configuratorParams)==null?void 0:P.linesWidths.at($))??0),"add-line-button-disabled":f.value<=0||n.value.length>=n.settings.maxLinesCount||n.value.some(F=>F.product.isNewRec()),"remove-line-button-disabled":l.value.length===1,"is-last-line":$===l.value.length-1&&f.value===0,"onUpdate:value":b,"onClick:addLine":w[0]||(w[0]=F=>o("click:add-line",F)),"onClick:removeLine":w[1]||(w[1]=F=>o("click:remove-line",F))},null,8,["value","auto-focus","index","path","product","settings","validation","suggestion-option","add-line-button-disabled","remove-line-button-disabled","is-last-line"])}),128)),t.createElementVNode("div",Vb,[f.value<0?(t.openBlock(),t.createBlock(t.unref(I.NText),{key:0,type:"error"},{default:t.withCtx(()=>[t.createTextVNode(" Сумма ширин всех полос должна быть равна "+t.toDisplayString(n.settings.width),1)]),_:1})):t.createCommentVNode("",!0),h.value&&l.value.length===n.settings.maxLinesCount&&f.value>0?(t.openBlock(),t.createBlock(t.unref(I.NText),{key:1,type:"error"},{default:t.withCtx(()=>[...w[15]||(w[15]=[t.createTextVNode(" Остаток резки должен быть равен 0 ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",null,[w[16]||(w[16]=t.createTextVNode(" Остаток для резки: ",-1)),t.createVNode(t.unref(I.NText),{type:f.value>=0?"Success":"error"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(f.value),1)]),_:1},8,["type"]),t.createTextVNode(" из "+t.toDisplayString(n.settings.width)+" мм ",1)])]),t.createVNode(t.unref(I.NButton),{disabled:p.value,type:"primary",class:"self-center",onClick:w[2]||(w[2]=k=>o("click:add-line",l.value.length))},{default:t.withCtx(()=>[...w[17]||(w[17]=[t.createTextVNode(" Добавить полосу ",-1)])]),_:1},8,["disabled"]),t.createVNode(t.unref(I.NFormItem),{path:"length",label:`Метраж ${n.settings.minLength?" от "+n.settings.minLength:""} ${n.settings.maxLength?" до "+n.settings.maxLength:""} м.`},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:l.value[0].length,"onUpdate:value":[w[3]||(w[3]=k=>l.value[0].length=k),w[6]||(w[6]=k=>y("length",k))],parse:t.unref(ht),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:w[4]||(w[4]=k=>t.unref(ft)(k,!1)),onInput:w[5]||(w[5]=k=>t.unref(dt)(n.validation,"length")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{path:"quantity",label:"Количество"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:l.value[0].quantity,"onUpdate:value":[w[7]||(w[7]=k=>l.value[0].quantity=k),w[10]||(w[10]=k=>y("quantity",k))],"show-button":!1,placeholder:"Введите количество",class:"w-full",onKeydown:w[8]||(w[8]=k=>t.unref(ft)(k,!1)),onInput:w[9]||(w[9]=k=>t.unref(dt)(n.validation,"quantity")),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{path:"marker",label:"Маркировка"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:l.value[0].marker??null,placeholder:"Введите маркировку",onInput:w[11]||(w[11]=k=>t.unref(dt)(n.validation,"marker")),"onUpdate:value":w[12]||(w[12]=k=>{l.value[0].marker=k??null,y("marker",k??null)}),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(t.openBlock(),t.createBlock(C,{key:0,checked:l.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":w[13]||(w[13]=k=>{l.value[0].isAdditionalSale=k??!1,y("isAdditionalSale",k??!1)})},{default:t.withCtx(()=>[...w[18]||(w[18]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),g.value?(t.openBlock(),t.createElementBlock("div",Mb,[w[19]||(w[19]=t.createTextVNode(" ИТОГО: ",-1)),t.createElementVNode("span",Ib,t.toDisplayString(g.value)+" ₽",1)])):t.createCommentVNode("",!0),t.createElementVNode("div",Ab,[t.createVNode(t.unref(I.NButton),{loading:n.isSubmitProcessing,disabled:!h.value||f.value!=0||!((N=l.value[0])!=null&&N.length)||l.value[0].length>n.settings.maxLength||l.value[0].length<n.settings.minLength||l.value[0].quantity===0,type:"primary",class:"self-start",onClick:w[14]||(w[14]=k=>o("submit",l.value))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(l.value[0].isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[t.unref(ai),()=>o("submit",l.value)]])}}}),zb={class:"flex grow flex-col"},Db=["src"],Lb={class:"w-full"},Hb={},Lu=t.defineComponent({...Hb,__name:"strip-configurator-preview",props:{value:{},settings:{}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",zb,[t.createElementVNode("img",{src:"/img/configurators/strip/strip-"+n.value.length+".png",class:"w-full max-w-96 self-center py-5",alt:"Штрипс"},null,8,Db),t.createElementVNode("div",Lb,[t.createTextVNode(" Число полос можно указать от "+t.toDisplayString(n.settings.minLinesCount)+" до "+t.toDisplayString(n.settings.maxLinesCount)+". ",1),i[0]||(i[0]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Минимальная ширина полосы "+t.toDisplayString(n.settings.minLineWidth)+" мм. ",1),i[1]||(i[1]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Ширина всех полос "+t.toDisplayString(n.settings.width)+" мм. ",1),i[2]||(i[2]=t.createElementVNode("br",null,null,-1)),t.createTextVNode(" Шаг ширины полосы - "+t.toDisplayString(n.settings.lineWidthStep)+" мм. ",1)])]))}}),Wb={class:"flex flex-col gap-2"},jb={class:"flex grow flex-col px-5 md:w-104"},qb={},Hu=t.defineComponent({...qb,__name:"strip-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("strip-configurator-form"),s=t.ref(i.cartItems),a=t.ref({width:{},length:{},quantity:{},marker:{}}),l=t.ref(!1),c=t.computed(()=>t.inject("debounce-input-time",300)),d=t.computed(()=>{var m;return(m=s.value[0].configuratorParams)==null?void 0:m.linesWidths.reduce((g,b)=>(g??0)+(b??0),0)}),u=m=>{m===void 0&&(m=s.value.length-1);const g=s.value.at(0);if(!g)return;g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(m+1,0,null),s.value.forEach(y=>{y.configuratorParams.linesWidths=g.configuratorParams.linesWidths});const b=new W.OrderItemBase({quantity:(g==null?void 0:g.quantity)??1,category:g==null?void 0:g.category,length:(g==null?void 0:g.length)??i.settings.minLength,marker:g==null?void 0:g.marker,configuratorParams:{linesWidths:g==null?void 0:g.configuratorParams.linesWidths}});s.value=s.value.toSpliced(m+1,0,b)},f=m=>{const g=s.value.at(0);g&&(g.configuratorParams.linesWidths=g.configuratorParams.linesWidths.toSpliced(m,1),s.value.forEach(b=>{b.configuratorParams.linesWidths=g.configuratorParams.linesWidths}),s.value=s.value.toSpliced(m,1),delete a[`linesWidths.${m}`],delete a[`linesWidths.${m}`])},h=V.debounce(async(m,g,b)=>{const y={linesWidths:m.linesWidths.at(g)};b.value=!0,a.value[`linesWidths.${g}`]={},s.value[g].product=new W.ClientProduct,i.eventEmitter.emit("configurator:search-product",{category:s.value[g].category,params:y,validationFieldResultData:a.value,callback:_=>{_?(s.value[g].product=_,g===s.value.length-1&&s.value.length<i.settings.maxLinesCount&&d.value&&d.value<i.settings.width&&u()):(s.value[g].product=new W.ClientProduct,a.value[`linesWidths.${g}`]={showFeedback:!0,feedback:"Не удалось найти товар",validationStatus:"error"},b.value=!1),b.value=!1}})},c.value),p=async()=>{var m,g;(g=(m=o.value)==null?void 0:m.formReference)==null||g.validate(b=>{if(!b){l.value=!0;const y=s.value.at(0);if(!y)return;r("submit",y,a.value,()=>{l.value=!1,t.nextTick(()=>{var _,x;(x=(_=o.value)==null?void 0:_.formReference)==null||x.restoreValidation()})})}}).catch(V.noop)};return t.watch(()=>i.cartItems,m=>{s.value=m.map(g=>new W.OrderItemBase(g))}),(m,g)=>{const b=I.NButton;return t.openBlock(),t.createElementBlock("div",Wb,[n.settings.allowShowTable?(t.openBlock(),t.createBlock(b,{key:0,type:"tertiary",class:"self-center",onClick:g[0]||(g[0]=y=>r("click:view-switch"))},{default:t.withCtx(()=>[...g[3]||(g[3]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",jb,[t.createVNode(Lu,{value:s.value,"onUpdate:value":g[1]||(g[1]=y=>s.value=y),settings:n.settings},null,8,["value","settings"]),t.createVNode(Du,{ref:"strip-configurator-form",value:s.value,"onUpdate:value":g[2]||(g[2]=y=>s.value=y),validation:a.value,settings:n.settings,"is-submit-processing":l.value,"onUpdate:params":t.unref(h),onSubmit:p,"onClick:addLine":u,"onClick:removeLine":f},null,8,["value","validation","settings","is-submit-processing","onUpdate:params"])])])}}}),Xb={class:"flex flex-col gap-3"},Yb={},Wu=t.defineComponent({...Yb,__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(n,{expose:e,emit:i}){var p;const r=n,o=i,s=t.useTemplateRef("form-reference"),a=t.useTemplateRef("first-input-element"),l=t.ref(V.cloneDeep(r.value)),c=t.computed(()=>({"configuratorParams.width":[ce.required,ce.min(r.settings.minWidth),...r.settings.maxWidth?[ce.max(r.settings.maxWidth)]:[],ce.step(1),We.serverValidation(r.validation.width.feedback)],"configuratorParams.length":[ce.required,ce.min(r.settings.minLength),ce.max(r.settings.maxLength),ce.step(1),We.serverValidation(r.validation.length.feedback)],quantity:[ce.required,ce.min(1),ce.step(1),We.serverValidation(r.validation.quantity.feedback)],marker:[We.serverValidation(r.validation.marker.feedback)]})),d=t.ref(r.settings.canSetDopProdaga??!1),u=()=>{o("update:params",l.value.configuratorParams),f("configuratorParams",l.value.configuratorParams)},f=(m,g)=>{const b=new W.OrderItemBase(r.value);b[m]=g,m==="configuratorParams"&&(b.product=new W.ClientProduct),o("update:value",b)},h=()=>{var m;(m=a.value)==null||m.select()};return t.watch(()=>r.value,m=>{l.value=V.cloneDeep(m)},{deep:!0}),t.onMounted(()=>{r.value.isNewRec()&&t.nextTick(()=>{h()})}),e({validate:(p=s.value)==null?void 0:p.validate,formReference:s}),(m,g)=>{const b=I.NCheckbox;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{ref:"form-reference",model:l.value,rules:c.value,disabled:n.isSubmitProcessing,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NFormItem),{path:"configuratorParams.width",label:`Ширина, ${n.settings.minWidth?" от "+n.settings.minWidth:""}${n.settings.maxWidth?" до "+n.settings.maxWidth:""} мм`},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{ref:"first-input-element",value:l.value.configuratorParams.width,"onUpdate:value":[g[0]||(g[0]=y=>l.value.configuratorParams.width=y),u],class:"w-full",parse:t.unref(ht),"show-button":!1,placeholder:"Введите ширину",onKeydown:g[1]||(g[1]=y=>t.unref(ft)(y)),onInput:g[2]||(g[2]=y=>t.unref(dt)(n.validation,"width")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{path:"configuratorParams.length",label:`Длина, ${n.settings.minLength?" от "+n.settings.minLength:""}${n.settings.maxLength?" до "+n.settings.maxLength:""} мм`},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:l.value.configuratorParams.length,"onUpdate:value":[g[3]||(g[3]=y=>l.value.configuratorParams.length=y),u],placeholder:"Введите длину",parse:t.unref(ht),"show-button":!1,class:"w-full",onKeydown:g[4]||(g[4]=y=>t.unref(ft)(y)),onInput:g[5]||(g[5]=y=>t.unref(dt)(n.validation,"length")),onFocus:t.unref(He)},null,8,["value","parse","onFocus"])]),_:1},8,["label"]),t.createVNode(t.unref(I.NFormItem),{path:"quantity",label:"Количество"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:n.value.quantity,placeholder:"Введите количество",min:1,"show-button":!1,class:"w-full",onKeydown:g[6]||(g[6]=y=>t.unref(ft)(y,!1)),onInput:g[7]||(g[7]=y=>t.unref(dt)(n.validation,"quantity")),"onUpdate:value":g[8]||(g[8]=y=>f("quantity",y??0)),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),t.createVNode(t.unref(I.NFormItem),{path:"marker",label:"Маркировка"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:n.value.marker??null,placeholder:"Введите маркировку",onInput:g[9]||(g[9]=y=>t.unref(dt)(n.validation,"marker")),"onUpdate:value":g[10]||(g[10]=y=>f("marker",y??null)),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1}),d.value?(t.openBlock(),t.createBlock(b,{key:0,checked:l.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":g[11]||(g[11]=y=>{l.value.isAdditionalSale=y??!1,f("isAdditionalSale",y??!1)})},{default:t.withCtx(()=>[...g[13]||(g[13]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),t.createVNode(Fr,{"is-product-searching":n.isProductSearching,product:n.value.product,validation:n.validation.product},null,8,["is-product-searching","product","validation"]),t.createElementVNode("div",Xb,[t.createVNode(t.unref(I.NButton),{disabled:n.value.product.isNewRec()||n.isProductSearching||n.isSubmitProcessing||n.value.length===0||n.value.width===0||n.value.quantity===0,type:"primary",class:"self-start",onClick:g[12]||(g[12]=y=>o("submit",n.value))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["disabled"])])]),_:1},8,["model","rules","disabled"])),[[t.unref(ai),()=>o("submit",l.value)]])}}}),Ub={class:"flex flex-col gap-2 w-72"},Kb={},ju=t.defineComponent({...Kb,__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]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("metal-for-doors-configurator-form"),s=t.ref(i.cartItem),a=t.ref({width:{},length:{},quantity:{},marker:{}}),l=t.ref(!1),c=t.ref(!1),d=t.computed(()=>t.inject("debounce-input-time",300)),u=V.debounce(async h=>{var p,m;s.value.product=new W.ClientProduct,(m=(p=o.value)==null?void 0:p.formReference)==null||m.validate(g=>{g||(l.value=!0,i.eventEmitter.emit("configurator:search-product",{category:i.cartItem.category,params:h,validationFieldResultData:a.value,callback:b=>{b?s.value.product=b:a.value.product={showFeedback:!0,feedback:"Не удалось найти товар по указанным параметрам.",validationStatus:"error"},l.value=!1}}))}).catch(V.noop)},d.value),f=async()=>{var h,p;(p=(h=o.value)==null?void 0:h.formReference)==null||p.validate(m=>{m||(c.value=!0,r("submit",s.value,a.value,()=>{c.value=!1,t.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})}))}).catch(V.noop)};return t.watch(()=>i.cartItem,h=>{s.value=new W.OrderItemBase(h)},{deep:!0}),(h,p)=>{const m=I.NButton;return t.openBlock(),t.createElementBlock("div",Ub,[n.settings.allowShowTable?(t.openBlock(),t.createBlock(m,{key:0,type:"tertiary",class:"self-center",onClick:p[0]||(p[0]=g=>r("click:view-switch"))},{default:t.withCtx(()=>[...p[4]||(p[4]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createVNode(Wu,{ref:"metal-for-doors-configurator-form",value:s.value,"onUpdate:value":p[1]||(p[1]=g=>s.value=g),validation:a.value,settings:n.settings,"is-submit-processing":c.value,"is-product-searching":l.value,"onUpdate:params":p[2]||(p[2]=g=>t.unref(u)(g)),onSubmit:p[3]||(p[3]=g=>f())},null,8,["value","validation","settings","is-submit-processing","is-product-searching"])])}}}),Gb={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Zb(n,e){return t.openBlock(),t.createElementBlock("svg",Gb,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M256 112v288m144-144H112"},null,-1)])])}const qu=t.markRaw({name:"ion-add",render:Zb}),Qb={key:0,class:"-mt-1 text-sm text-gray-500"},Jb={class:"font-bold"},e_={class:"flex flex-col gap-3"},t_={key:0,class:"mt-4 flex flex-col gap-1.5"},n_={class:"flex flex-col gap-1 text-sm text-gray-700"},i_={key:0},r_={key:1},o_={"form-array-name":"items",class:"flex flex-col gap-3"},s_={class:"grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3"},a_={key:0,class:"flex flex-wrap items-end gap-2"},l_={class:"whitespace-nowrap text-xl font-bold"},c_={key:0,class:"whitespace-nowrap text-lg text-gray-500"},d_={class:"font-bold"},u_={class:"font-bold"},f_={class:"flex gap-3"},h_={},Xu=t.defineComponent({...h_,__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]},showProductInfoButton:{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(n,{expose:e,emit:i}){var Y;const r=n,o=i,s=t.useTemplateRef("form-reference"),a=t.ref(V.cloneDeep(r.value)),l=t.ref({...r.validation}),c=H=>{var T;delete l.value[H],(T=s.value)==null||T.restoreValidation()};t.watch(()=>r.validation,H=>{l.value={...H},Object.values(H).some(D=>D==null?void 0:D.feedback)&&t.nextTick(()=>{var D;return(D=s.value)==null?void 0:D.validate(V.noop).catch(V.noop)})},{deep:!0});const d=t.computed(()=>r.value.category),u=t.ref(null),f=t.ref(null),h=t.computed(()=>d.value.products??[]),p=t.computed(()=>h.value.map(H=>({label:H.name,value:H.id}))),m=(H,T,D)=>{const K=H!=null&&H>0,J=T!=null&&T>0;return!K&&!J?null:K&&J?`от ${H} ${D} до ${T} ${D}`:K?`от ${H} ${D}`:`до ${T} ${D}`},g=t.computed(()=>{var H,T;return m(r.settings.minWidth,(T=(H=u.value)==null?void 0:H.properties)==null?void 0:T.width,"мм")}),b=t.computed(()=>{var H,T;return m(r.settings.minLength,(T=(H=u.value)==null?void 0:H.properties)==null?void 0:T.length,"мм")}),y=t.ref(null),_=t.ref(!1),x=t.computed(()=>{var T;const H={marker:[We.serverValidation((T=l.value.marker)==null?void 0:T.feedback)]};return a.value.configuratorParams.items.forEach((D,K)=>{var J,U,q,L,le,ue,oe;H[`configuratorParams.items.${K}.width`]=[ce.required,ce.min(r.settings.minWidth),...(U=(J=u.value)==null?void 0:J.properties)!=null&&U.width?[ce.max(u.value.properties.width)]:[],ce.step(1),We.serverValidation((q=l.value[`items.${K}.width`])==null?void 0:q.feedback)],H[`configuratorParams.items.${K}.length`]=[ce.required,ce.min(r.settings.minLength),...(le=(L=u.value)==null?void 0:L.properties)!=null&&le.length?[ce.max(u.value.properties.length)]:[],ce.step(1),We.serverValidation((ue=l.value[`items.${K}.length`])==null?void 0:ue.feedback)],H[`configuratorParams.items.${K}.count`]=[ce.required,ce.min(1),ce.step(1),We.serverValidation((oe=l.value[`items.${K}.count`])==null?void 0:oe.feedback)]}),H}),w=t.ref(r.settings.canSetDopProdaga??!1),C=t.computed(()=>a.value.configuratorParams.items.some(H=>{var T,D;return!u.value||!H.width||H.width<r.settings.minWidth||H.width>(((T=u.value.properties)==null?void 0:T.width)??0)||H.length===0||H.length<r.settings.minLength||H.length>(((D=u.value.properties)==null?void 0:D.length)??0)||!H.count||H.count<1})),N=t.computed(()=>!u.value||C.value||a.value.configuratorParams.items.length===0),k=t.ref(null),$=t.computed(()=>k.value===null?"":Ve.formatMoney(k.value)),v=H=>{if(!H){u.value=null,f.value=null,a.value.product=new W.ClientProduct,y.value=null;return}const T=h.value.find(D=>D.id===H);T&&(u.value=T,f.value=H,a.value.product=T,O("product",a.value.product),a.value.configuratorParams.items.forEach(D=>{var K,J;(K=T.properties)!=null&&K.width&&D.width>T.properties.width&&(D.width=T.properties.width),(J=T.properties)!=null&&J.length&&D.length>T.properties.length&&(D.length=T.properties.length)}),P())};let E=!1;const P=()=>{E=!0,y.value=null,k.value=null,a.value.configuratorParams.calculationId="",a.value.quantity=0},F=async()=>{var H;if(!u.value||a.value.configuratorParams.items.length===0||C.value){P();return}(H=s.value)==null||H.validate(T=>{if(T){P();return}if(_.value=!0,!u.value||!d.value){P(),_.value=!1;return}r.eventEmitter.emit("configurator:calculate",{category:d.value,params:{productId:u.value.id,items:a.value.configuratorParams.items},callback:D=>{D?(y.value=D,a.value.configuratorParams.calculationId=D.id,a.value.quantity=D.quantity,t.nextTick(()=>{O("quantity",D.quantity)})):(a.value.configuratorParams.calculationId="",a.value.quantity=0,P()),O("configuratorParams",a.value.configuratorParams),R(),_.value=!1}})}).catch(()=>{P(),_.value=!1})},R=()=>{var T;if(!((T=u.value)!=null&&T.costRub)||!y.value){k.value=null;return}const H=y.value.quantity*u.value.costRub;k.value=Ve.roundMoney(H)},M=H=>{var D,K;const T=a.value.configuratorParams.items[H];u.value&&((D=u.value.properties)!=null&&D.width&&T.width>u.value.properties.width&&(T.width=u.value.properties.width),(K=u.value.properties)!=null&&K.length&&T.length>u.value.properties.length&&(T.length=u.value.properties.length)),O("configuratorParams",a.value.configuratorParams),P()},X=()=>{a.value.configuratorParams.calculationId="",a.value.configuratorParams.items.push({width:0,length:0,count:1}),O("configuratorParams",a.value.configuratorParams),P(),o("add-item",a.value.configuratorParams.items.length)},G=H=>{a.value.configuratorParams.items.splice(H,1),O("configuratorParams",a.value.configuratorParams),P(),o("remove-item",H)},Z=()=>{if(!(N.value||_.value||r.isSubmitProcessing)){if(!y.value){F();return}o("submit",a.value)}},O=(H,T)=>{const D=new W.OrderItemBase(r.value);D[H]=T,o("update:value",D)};t.watch(()=>r.value,H=>{const T=V.cloneDeep(t.toRaw(H));(!T.configuratorParams.items||T.configuratorParams.items.length===0)&&(T.configuratorParams.items=[{width:0,length:0,count:1}]),a.value=T,r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,f.value=r.value.product.id),r.value.product.isNewRec()&&(u.value=null,f.value=null),E?E=!1:A()},{deep:!0});const A=()=>{const{calculationId:H}=a.value.configuratorParams,T=a.value.quantity??0;H&&T>0&&a.value.product&&!a.value.product.isNewRec()&&(y.value={id:H,quantity:T,sheets:[]},R())};return t.onMounted(()=>{r.value.product&&!r.value.product.isNewRec()&&(u.value=r.value.product,f.value=r.value.product.id),A()}),e({validate:(Y=s.value)==null?void 0:Y.validate,formReference:s}),(H,T)=>{const D=yo,K=qu;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{ref:"form-reference",model:a.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>{var J;return[t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:f.value,"onUpdate:value":[T[0]||(T[0]=U=>f.value=U),v],options:p.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((J=u.value)==null?void 0:J.costRub)!=null?(t.openBlock(),t.createElementBlock("div",Qb,[t.createElementVNode("span",Jb,t.toDisplayString(u.value.code),1),t.createTextVNode(" — "+t.toDisplayString(t.unref(Ve).formatMoney(u.value.costRub))+" "+t.toDisplayString(u.value.currency.symbol)+"/шт. ",1)])):t.createCommentVNode("",!0),t.createElementVNode("div",e_,[u.value?(t.openBlock(),t.createElementBlock("div",t_,[T[7]||(T[7]=t.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),t.createElementVNode("div",n_,[g.value?(t.openBlock(),t.createElementBlock("div",i_,"Ширина "+t.toDisplayString(g.value)+".",1)):t.createCommentVNode("",!0),b.value?(t.openBlock(),t.createElementBlock("div",r_,"Длина "+t.toDisplayString(b.value)+".",1)):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0),t.createElementVNode("div",o_,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value.configuratorParams.items,(U,q)=>(t.openBlock(),t.createElementBlock("div",{key:q,class:"flex grow gap-2"},[t.createElementVNode("div",s_,[t.createVNode(t.unref(I.NFormItem),{path:`configuratorParams.items.${q}.width`,label:"Ширина, мм"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:a.value.configuratorParams.items[q].width,"onUpdate:value":[L=>a.value.configuratorParams.items[q].width=L,L=>M(q)],parse:t.unref(ht),"show-button":!1,disabled:!u.value,placeholder:"Ширина",class:"w-full",onKeydown:T[1]||(T[1]=L=>t.unref(ft)(L)),onInput:L=>c(`items.${q}.width`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),t.createVNode(t.unref(I.NFormItem),{path:`configuratorParams.items.${q}.length`,label:"Длина, мм"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:a.value.configuratorParams.items[q].length,"onUpdate:value":[L=>a.value.configuratorParams.items[q].length=L,L=>M(q)],parse:t.unref(ht),"show-button":!1,disabled:!u.value,placeholder:"Длина",class:"w-full",onKeydown:T[2]||(T[2]=L=>t.unref(ft)(L)),onInput:L=>c(`items.${q}.length`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),t.createVNode(t.unref(I.NFormItem),{path:`configuratorParams.items.${q}.count`,label:"Количество, шт"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:a.value.configuratorParams.items[q].count,"onUpdate:value":[L=>a.value.configuratorParams.items[q].count=L,L=>M(q)],parse:t.unref(ht),"show-button":!1,disabled:!u.value,placeholder:"Количество",class:"w-full",onKeydown:T[3]||(T[3]=L=>t.unref(ft)(L,!1)),onInput:L=>c(`items.${q}.count`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),t.createVNode(t.unref(I.NButton),{disabled:!u.value||a.value.configuratorParams.items.length<=1,type:"error",size:"medium",class:"mt-5",onClick:L=>G(q)},{default:t.withCtx(()=>[t.createVNode(D)]),_:1},8,["disabled","onClick"])]))),128))]),u.value?(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:1,disabled:C.value,type:"default",class:"self-center",onClick:X},{default:t.withCtx(()=>[t.createVNode(K),T[8]||(T[8]=t.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0)]),t.createVNode(t.unref(I.NFormItem),{path:"marker",label:"Маркировка распила"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:a.value.marker??null,disabled:!u.value,placeholder:"Введите маркировку распила",onInput:T[4]||(T[4]=U=>c("marker")),"onUpdate:value":T[5]||(T[5]=U=>O("marker",U??null)),onFocus:t.unref(He)},null,8,["value","disabled","onFocus"])]),_:1}),w.value?(t.openBlock(),t.createBlock(t.unref(I.NCheckbox),{key:1,checked:a.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":T[6]||(T[6]=U=>{a.value.isAdditionalSale=U??!1,O("isAdditionalSale",U??!1)})},{default:t.withCtx(()=>[...T[9]||(T[9]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),t.createVNode(t.unref(I.NSpin),{show:_.value,size:"small",class:"grow"},{default:t.withCtx(()=>[y.value&&u.value&&k.value?(t.openBlock(),t.createElementBlock("div",a_,[t.createElementVNode("div",null,[T[10]||(T[10]=t.createTextVNode(" Итого: ",-1)),t.createElementVNode("span",l_,t.toDisplayString($.value)+" "+t.toDisplayString(u.value.currency.symbol),1)]),y.value.quantity&&u.value?(t.openBlock(),t.createElementBlock("div",c_,[t.createElementVNode("span",d_,"("+t.toDisplayString(y.value.quantity)+" шт.",1),T[11]||(T[11]=t.createTextVNode(" x ",-1)),t.createElementVNode("span",u_,t.toDisplayString(t.unref(Ve).formatMoney(u.value.costRub))+" "+t.toDisplayString(u.value.currency.symbol)+"/шт.)",1)])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),_:1},8,["show"]),t.createElementVNode("div",f_,[y.value&&!_.value?(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:0,loading:n.isSubmitProcessing,disabled:N.value||_.value,type:"primary",class:"self-start",onClick:Z},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a.value.isNewRec()?"В корзину":"Изменить"),1)]),_:1},8,["loading","disabled"])):(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:1,loading:_.value,disabled:N.value||_.value,type:"info",class:"self-start",onClick:F},{default:t.withCtx(()=>[...T[12]||(T[12]=[t.createTextVNode(" Рассчитать ",-1)])]),_:1},8,["loading","disabled"]))])]}),_:1},8,["model","rules"])),[[t.unref(ai),Z]])}}}),m_={class:"flex flex-col gap-2"},p_={class:"w-104 flex grow flex-col px-5"},g_={},Yu=t.defineComponent({...g_,__name:"sandwich-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("sandwich-configurator-form"),s=t.ref(i.cartItem),a=t.ref({width:{},length:{},quantity:{},marker:{},product:{}}),l=t.ref(!1),c=async()=>{var f,h;(h=(f=o.value)==null?void 0:f.formReference)==null||h.validate(p=>{if(!p){l.value=!0;const m=V.cloneDeep(s.value);"items"in m.configuratorParams&&delete m.configuratorParams.items,r("submit",m,a.value,()=>{l.value=!1,t.nextTick(()=>{var g,b;(b=(g=o.value)==null?void 0:g.formReference)==null||b.restoreValidation()})})}}).catch(V.noop)},d=f=>{a.value[`items.${f}.width`]={},a.value[`items.${f}.length`]={},a.value[`items.${f}.count`]={}},u=f=>{delete a.value[`items.${f}.width`],delete a.value[`items.${f}.length`],delete a.value[`items.${f}.count`]};return t.onMounted(()=>{i.cartItem.configuratorParams.items.forEach((f,h)=>{a.value[`items.${h}.width`]={},a.value[`items.${h}.length`]={},a.value[`items.${h}.count`]={}})}),t.watch(()=>i.cartItem,f=>{s.value=new W.OrderItemBase(f)},{deep:!0}),(f,h)=>{const p=I.NButton;return t.openBlock(),t.createElementBlock("div",m_,[n.settings.allowShowTable&&s.value.isNewRec()?(t.openBlock(),t.createBlock(p,{key:0,type:"tertiary",class:"self-center",onClick:h[0]||(h[0]=m=>r("click:view-switch"))},{default:t.withCtx(()=>[...h[2]||(h[2]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",p_,[t.createVNode(Xu,{ref:"sandwich-configurator-form",value:s.value,"onUpdate:value":h[1]||(h[1]=m=>s.value=m),validation:a.value,settings:n.settings,"event-emitter":n.eventEmitter,"is-submit-processing":l.value,onSubmit:c,onAddItem:d,onRemoveItem:u},null,8,["value","validation","settings","event-emitter","is-submit-processing"])])])}}}),y_={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function b_(n,e){return t.openBlock(),t.createElementBlock("svg",y_,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M416 128L192 384l-96-96"},null,-1)])])}const __=t.markRaw({name:"ion-checkmark",render:b_}),w_={key:0,class:"-mt-1 text-sm text-gray-500"},x_={class:"font-bold"},k_={class:"flex flex-col gap-3"},C_={key:0,class:"mt-4 mb-3 flex flex-col gap-1.5"},v_={class:"flex flex-col gap-1 text-sm text-gray-700"},S_={key:0},B_={key:1},N_={"form-array-name":"items",class:"flex flex-col gap-3"},T_={class:"min-w-0 flex-1"},$_={class:"relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6"},E_={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]"},R_={class:"grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]"},P_={key:0,class:"pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center"},F_={class:"mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6"},V_={key:0,class:"lg:!flex-[2]"},M_={class:"font-bold"},I_={key:1,class:"lg:!flex-[3]"},A_={class:"font-bold"},O_={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"},z_={key:0},D_={class:"font-bold"},L_={key:1},H_={class:"font-bold"},W_={class:"flex flex-wrap items-center gap-3"},j_={},Uu=t.defineComponent({...j_,__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]},showProductInfoButton:{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(n,{expose:e,emit:i}){var J;const r=n,o=i,s=t.useTemplateRef("form-reference"),a=t.useTemplateRef("widthInputs"),l=r.value==null?[]:V.cloneDeep(t.toRaw(r.value)),c=t.ref(l.map(U=>new W.OrderItemBase(U))),d=t.computed(()=>({items:c.value})),u=t.ref({...r.validation}),f=U=>{var q;delete u.value[U],(q=s.value)==null||q.restoreValidation()},h=t.ref(null),p=t.ref(null),m=t.computed(()=>{var U,q;return((q=(U=c.value[0])==null?void 0:U.category)==null?void 0:q.products)??[]}),g=t.computed(()=>m.value.map(U=>({label:U.name,value:U.id}))),b=(U,q,L)=>{const le=U!=null&&U>0,ue=q!=null&&q>0;return!le&&!ue?null:le&&ue?`от ${U} ${L} до ${q} ${L}`:le?`от ${U} ${L}`:`до ${q} ${L}`},y=t.computed(()=>{var U,q;return b(r.settings.minWidth,(q=(U=h.value)==null?void 0:U.properties)==null?void 0:q.width,"мм")}),_=t.computed(()=>{var U,q;return b(r.settings.minLength,(q=(U=h.value)==null?void 0:U.properties)==null?void 0:q.length,"мм")}),x=t.computed(()=>{const U={};return c.value.forEach((q,L)=>{var le,ue,oe,fe,ge,_e,Qe,Re;U[`items.${L}.configuratorParams.width`]=[ce.required,ce.min(r.settings.minWidth),...(ue=(le=h.value)==null?void 0:le.properties)!=null&&ue.width?[ce.max(h.value.properties.width)]:[],ce.step(1),We.serverValidation((oe=u.value[`items.${L}.width`])==null?void 0:oe.feedback)],U[`items.${L}.configuratorParams.length`]=[ce.required,ce.min(r.settings.minLength),...(ge=(fe=h.value)==null?void 0:fe.properties)!=null&&ge.length?[ce.max(h.value.properties.length)]:[],ce.step(1),We.serverValidation((_e=u.value[`items.${L}.length`])==null?void 0:_e.feedback)],U[`items.${L}.quantity`]=[ce.required,ce.min(1),ce.step(1),We.serverValidation((Qe=u.value[`items.${L}.quantity`])==null?void 0:Qe.feedback)],U[`items.${L}.marker`]=[We.serverValidation((Re=u.value[`items.${L}.marker`])==null?void 0:Re.feedback)]}),U});t.watch(()=>r.validation,U=>{u.value={...U},Object.values(U).some(L=>L==null?void 0:L.feedback)&&t.nextTick(()=>{var L;return(L=s.value)==null?void 0:L.validate(V.noop).catch(V.noop)})},{deep:!0});const w=t.ref(r.settings.canSetDopProdaga??!1),C=t.computed(()=>{const U=h.value;return U?c.value.some(q=>{var oe,fe;const L=q.configuratorParams,le=(oe=U.properties)==null?void 0:oe.width,ue=(fe=U.properties)==null?void 0:fe.length;return L.width===0||L.width<r.settings.minWidth||le!=null&&L.width>le||L.length===0||L.length<r.settings.minLength||ue!=null&&L.length>ue||q.quantity===0||q.quantity<1}):!0}),N=t.computed(()=>!h.value||C.value||c.value.length===0),k=t.computed(()=>{const U=c.value[0];return U!=null&&!U.isNewRec()}),$=U=>r.itemStates[U]??"idle",v=U=>$(U)==="success",E=U=>$(U)==="loading",P=t.computed(()=>c.value.length===0?!0:c.value.every((U,q)=>{const L=$(q);return L==="success"||L==="loading"})),F=U=>U.width===0||U.length===0?0:U.width*U.length/1e6,R=U=>Ve.formatArea(F(U)),M=U=>{var oe;const q=U.configuratorParams,L=F(q),le=((oe=h.value)==null?void 0:oe.costRub)??0,ue=U.quantity??0;return!L||!ue?0:Ve.roundMoney(L*le*ue)},X=t.computed(()=>V.sum(c.value.map(U=>{const q=U.configuratorParams;return!q.width||q.length===0||!U.quantity?0:q.width*q.length*U.quantity/1e6}))),G=t.computed(()=>Ve.roundMoney(V.sum(c.value.map(U=>M(U))))),Z=()=>{var U,q,L;return new W.OrderItemBase({category:(U=c.value[0])==null?void 0:U.category,configurator:(q=c.value[0])==null?void 0:q.configurator,product:h.value??new W.ClientProduct,quantity:1,isAdditionalSale:(L=c.value[0])==null?void 0:L.isAdditionalSale,configuratorParams:{width:0,length:0}})},O=U=>{if(!U){h.value=null,p.value=null,c.value.forEach(L=>{L.product=new W.ClientProduct}),o("update:value",c.value);return}const q=m.value.find(L=>L.id===U);q&&(h.value=q,p.value=U,c.value.forEach((L,le)=>{var ue,oe;L.product=q,(ue=q.properties)!=null&&ue.width&&L.configuratorParams.width>q.properties.width&&(L.configuratorParams.width=q.properties.width),(oe=q.properties)!=null&&oe.length&&L.configuratorParams.length>q.properties.length&&(L.configuratorParams.length=q.properties.length),o("item-reset",le)}),o("update:value",c.value))},A=U=>{var le,ue;const q=c.value[U],L=h.value;L&&((le=L.properties)!=null&&le.width&&q.configuratorParams.width>L.properties.width&&(q.configuratorParams.width=L.properties.width),(ue=L.properties)!=null&&ue.length&&q.configuratorParams.length>L.properties.length&&(q.configuratorParams.length=L.properties.length)),o("item-reset",U),o("update:value",c.value)},Y=(U,q)=>{c.value[U].marker=q===null||q===""?void 0:q,o("item-reset",U),o("update:value",c.value)},H=U=>{c.value.forEach(q=>{q.isAdditionalSale=U}),o("update:value",c.value)},T=()=>{c.value.push(Z()),o("update:value",c.value),o("add-item",c.value.length),t.nextTick(()=>{var q,L,le,ue;const U=c.value.length-1;(L=(q=a.value)==null?void 0:q[U])==null||L.focus(),(ue=(le=a.value)==null?void 0:le[U])==null||ue.select()})},D=U=>{c.value.splice(U,1),o("update:value",c.value),o("remove-item",U)};t.watch(()=>r.value,U=>{var ue;const L=(U==null?[]:V.cloneDeep(t.toRaw(U))).map(oe=>new W.OrderItemBase(oe));c.value=L.length>0?L:[Z()];const le=(ue=c.value[0])==null?void 0:ue.product;le&&!le.isNewRec()?(h.value=le,p.value=le.id):(h.value=null,p.value=null)},{deep:!0});const K=()=>{var q;if(h.value!==null)return;const U=(q=m.value[0])==null?void 0:q.id;U!=null&&O(U)};return t.watch(m,()=>{K()}),t.onMounted(()=>{var q;c.value.length===0&&(c.value=[Z()]);const U=(q=c.value[0])==null?void 0:q.product;U&&!U.isNewRec()&&(h.value=U,p.value=U.id),K()}),e({validate:(J=s.value)==null?void 0:J.validate,formReference:s}),(U,q)=>{const L=__,le=yo,ue=qu;return t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{ref:"form-reference",model:d.value,rules:x.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>{var oe,fe;return[t.createVNode(t.unref(I.NFormItem),{required:!0,"show-feedback":!1,label:"Товар"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NSelect),{value:p.value,"onUpdate:value":[q[0]||(q[0]=ge=>p.value=ge),O],options:g.value,placeholder:"Выберите материал",filterable:""},null,8,["value","options"])]),_:1}),((oe=h.value)==null?void 0:oe.costRub)!=null?(t.openBlock(),t.createElementBlock("div",w_,[t.createElementVNode("span",x_,t.toDisplayString(h.value.code),1),t.createTextVNode(" — "+t.toDisplayString(t.unref(Ve).formatMoney(h.value.costRub))+" "+t.toDisplayString(h.value.currency.symbol)+"/м² ",1)])):t.createCommentVNode("",!0),t.createElementVNode("div",k_,[h.value?(t.openBlock(),t.createElementBlock("div",C_,[q[6]||(q[6]=t.createElementVNode("div",{class:"w-full font-bold"},"Размеры изделий",-1)),t.createElementVNode("div",v_,[y.value?(t.openBlock(),t.createElementBlock("div",S_,"Ширина "+t.toDisplayString(y.value)+".",1)):t.createCommentVNode("",!0),_.value?(t.openBlock(),t.createElementBlock("div",B_,"Длина "+t.toDisplayString(_.value)+".",1)):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0),t.createElementVNode("div",N_,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value.items,(ge,_e)=>{var Qe;return t.openBlock(),t.createElementBlock("div",{key:_e,class:t.normalizeClass(["flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0",v(_e)?"opacity-70":""])},[t.createElementVNode("div",T_,[t.createElementVNode("div",$_,[t.createElementVNode("div",E_,[t.createVNode(t.unref(I.NFormItem),{path:`items.${_e}.configuratorParams.width`,label:"Ширина, мм",class:"min-w-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{ref_for:!0,ref:"widthInputs",value:d.value.items[_e].configuratorParams.width,"onUpdate:value":[Re=>d.value.items[_e].configuratorParams.width=Re,Re=>A(_e)],parse:t.unref(ht),"show-button":!1,disabled:!h.value||v(_e)||E(_e),placeholder:"Ширина",class:"w-full",onKeydown:q[1]||(q[1]=Re=>t.unref(ft)(Re)),onInput:Re=>f(`items.${_e}.width`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),t.createVNode(t.unref(I.NFormItem),{path:`items.${_e}.configuratorParams.length`,label:"Длина, мм",class:"min-w-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:d.value.items[_e].configuratorParams.length,"onUpdate:value":[Re=>d.value.items[_e].configuratorParams.length=Re,Re=>A(_e)],parse:t.unref(ht),"show-button":!1,disabled:!h.value||v(_e)||E(_e),placeholder:"Длина",class:"w-full",onKeydown:q[2]||(q[2]=Re=>t.unref(ft)(Re)),onInput:Re=>f(`items.${_e}.length`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"])]),t.createElementVNode("div",R_,[t.createVNode(t.unref(I.NFormItem),{path:`items.${_e}.quantity`,label:"Количество, шт",class:"min-w-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:d.value.items[_e].quantity,"onUpdate:value":[Re=>d.value.items[_e].quantity=Re,Re=>A(_e)],parse:t.unref(ht),"show-button":!1,disabled:!h.value||v(_e)||E(_e),placeholder:"Кол-во",class:"w-full",onKeydown:q[3]||(q[3]=Re=>t.unref(ft)(Re,!1)),onInput:Re=>f(`items.${_e}.quantity`),onFocus:t.unref(He)},null,8,["value","onUpdate:value","parse","disabled","onInput","onFocus"])]),_:2},1032,["path"]),t.createVNode(t.unref(I.NFormItem),{path:`items.${_e}.marker`,label:"Маркировка",class:"min-w-0"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:d.value.items[_e].marker??null,disabled:!h.value||v(_e)||E(_e),placeholder:"Маркировка",class:"w-full",onInput:Re=>f(`items.${_e}.marker`),"onUpdate:value":Re=>Y(_e,Re??null),onFocus:t.unref(He)},null,8,["value","disabled","onInput","onUpdate:value","onFocus"])]),_:2},1032,["path"])]),E(_e)||v(_e)?(t.openBlock(),t.createElementBlock("div",P_,[E(_e)?(t.openBlock(),t.createBlock(t.unref(I.NSpin),{key:0,size:14})):v(_e)?(t.openBlock(),t.createBlock(L,{key:1,class:"text-green-600 text-xl"})):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),t.createElementVNode("div",F_,[ge.configuratorParams.width>0&&ge.configuratorParams.length>0?(t.openBlock(),t.createElementBlock("div",V_,[q[7]||(q[7]=t.createTextVNode(" Площадь (S) = ",-1)),t.createElementVNode("span",M_,t.toDisplayString(R(ge.configuratorParams))+" м²",1)])):t.createCommentVNode("",!0),M(ge)>0?(t.openBlock(),t.createElementBlock("div",I_,[q[8]||(q[8]=t.createTextVNode(" Итого: ",-1)),t.createElementVNode("span",A_,t.toDisplayString(t.unref(Ve).formatMoney(M(ge)))+" "+t.toDisplayString((Qe=h.value)==null?void 0:Qe.currency.symbol),1)])):t.createCommentVNode("",!0)])]),k.value?t.createCommentVNode("",!0):(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:0,disabled:E(_e)||d.value.items.length<=1,type:"error",size:"medium",class:"mt-5 shrink-0 lg:!ml-4",onClick:Re=>D(_e)},{default:t.withCtx(()=>[t.createVNode(le)]),_:1},8,["disabled","onClick"]))],2)}),128))]),h.value?(t.openBlock(),t.createElementBlock("div",O_,[X.value>0?(t.openBlock(),t.createElementBlock("div",z_,[q[9]||(q[9]=t.createTextVNode(" Общая площадь: ",-1)),t.createElementVNode("span",D_,t.toDisplayString(t.unref(Ve).formatArea(X.value))+" м²",1)])):t.createCommentVNode("",!0),G.value>0?(t.openBlock(),t.createElementBlock("div",L_,[q[10]||(q[10]=t.createTextVNode(" Итого: ",-1)),t.createElementVNode("span",H_,t.toDisplayString(t.unref(Ve).formatMoney(G.value))+" "+t.toDisplayString(h.value.currency.symbol),1)])):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)]),w.value?(t.openBlock(),t.createBlock(t.unref(I.NCheckbox),{key:1,checked:((fe=c.value[0])==null?void 0:fe.isAdditionalSale)??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":q[4]||(q[4]=ge=>H(ge??!1))},{default:t.withCtx(()=>[...q[11]||(q[11]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0),t.createElementVNode("div",W_,[h.value&&!k.value?(t.openBlock(),t.createBlock(t.unref(I.NButton),{key:0,disabled:C.value,type:"default",onClick:T},{default:t.withCtx(()=>[t.createVNode(ue),q[12]||(q[12]=t.createTextVNode(" Добавить изделие ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),t.createVNode(t.unref(I.NButton),{loading:n.isSubmitProcessing,disabled:N.value||P.value,type:"primary",class:"ml-auto",onClick:q[5]||(q[5]=ge=>o("submit",c.value))},{default:t.withCtx(()=>{var ge;return[t.createTextVNode(t.toDisplayString((ge=c.value[0])!=null&&ge.isNewRec()?"В корзину":"Изменить"),1)]}),_:1},8,["loading","disabled"])])]}),_:1},8,["model","rules"])),[[t.unref(ai),()=>o("submit",c.value)]])}}}),q_={class:"flex flex-col gap-2"},X_={class:"min-w-56 max-w-3xl flex grow flex-col px-5"},Y_={},Ku=t.defineComponent({...Y_,__name:"sandwich-m2-configurator",props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{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(n,{emit:e}){const i=n,r=e,o=t.useTemplateRef("sandwich-m2-configurator-form"),s=t.ref((i.cartItems??[]).map(x=>new W.OrderItemBase(x))),a=t.ref([]),l=t.ref({width:{},length:{},quantity:{},marker:{}}),c=["width","length","quantity","marker"],d=x=>{c.forEach(w=>{l.value[`items.${x}.${w}`]={}})},u=x=>{c.forEach(w=>{delete l.value[`items.${x}.${w}`]})},f=t.computed(()=>a.value.includes("loading")),h=()=>({width:{},length:{},quantity:{},marker:{}}),p=(x,w)=>{let C=!1;return c.forEach(N=>{var F,R;const k=`items.0.${N}`,$=(F=x[N])==null?void 0:F.feedback,E=((R=x[k])==null?void 0:R.feedback)??$,P=`items.${w}.${N}`;E?(l.value[P]=x[k]??x[N],C=!0):l.value[P]={}}),C},m=(x,w,C)=>new Promise(N=>{const k=h();let $=!1;const v=E=>{if($)return;$=!0;const P=p(k,w),F=(E===void 0?!P:E)&&!P;a.value[w]=F?"success":"error",t.nextTick(()=>{var R,M;(M=(R=o.value)==null?void 0:R.formReference)==null||M.restoreValidation()}),N(F)};a.value[w]="loading",r("submit",[V.cloneDeep(x)],k,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 x=s.value.map((k,$)=>$).filter(k=>{const $=a.value[k]??"idle";return $!=="success"&&$!=="loading"});let w=!0;for(let k=0;k<x.length;k+=1){const $=x[k],v=s.value[$];if(!v)break;const P=k===x.length-1&&w;await m(v,$,P)||(w=!1)}},b=x=>{const w=x-1;a.value[w]="idle",d(w)},y=x=>{a.value.splice(x,1),u(x);for(let w=x;w<s.value.length;w+=1)d(w)},_=x=>{const w=a.value[x];(w==="success"||w==="error")&&(a.value[x]="idle")};return t.onMounted(()=>{(i.cartItems??[]).forEach((x,w)=>{a.value[w]="idle",d(w)})}),t.watch(()=>i.cartItems,x=>{const w=(x??[]).map(C=>new W.OrderItemBase(C));s.value=w,a.value=w.map(()=>"idle"),w.forEach((C,N)=>{d(N)})},{deep:!0}),(x,w)=>{var N;const C=I.NButton;return t.openBlock(),t.createElementBlock("div",q_,[n.settings.allowShowTable&&((N=s.value[0])!=null&&N.isNewRec())?(t.openBlock(),t.createBlock(C,{key:0,type:"tertiary",class:"self-center",onClick:w[0]||(w[0]=k=>r("click:view-switch"))},{default:t.withCtx(()=>[...w[2]||(w[2]=[t.createTextVNode(" Показать в виде списка ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createElementVNode("div",X_,[t.createVNode(Uu,{ref:"sandwich-m2-configurator-form",value:s.value,"onUpdate:value":w[1]||(w[1]=k=>s.value=k),validation:l.value,settings:n.settings,"event-emitter":n.eventEmitter,"is-submit-processing":f.value,"item-states":a.value,onSubmit:g,onAddItem:b,onRemoveItem:y,onItemReset:_},null,8,["value","validation","settings","event-emitter","is-submit-processing","item-states"])])])}}}),U_={key:0,class:"flex justify-center p-4"},K_={key:1,class:"p-4 text-center text-red-500"},G_={key:2,class:"flex justify-center"},Z_={class:"!bg-white p-4 m-2 rounded-md w-max"},Q_={key:3,class:"p-4 text-center text-gray-500"},J_={},Gu=t.defineComponent({...J_,__name:"dynamic-configurator",props:{eventEmitter:{},settings:{},editor:{},cartItem:{},cartItems:{},category:{}},setup(n){const e=n,i=t.ref(!1),r=t.ref(null),o=t.ref(e.cartItem??null),s=t.ref(e.cartItems??null),a=h=>{const p=h.configuratorParams;return[new W.OrderItemBase({...h,quantity:h.quantity??1,marker:h.marker,configuratorParams:{width:(p==null?void 0:p.width)??h.width??0,length:(p==null?void 0:p.length)??h.length??0}})]},l=t.ref(e.editor===W.ConfiguratorsEnum.SandwichM2&&e.cartItem!=null?a(e.cartItem):null),c=()=>{var p,m,g;if(!e.settings){r.value="Настройки конфигуратора не указаны в свойствах категории.";return}const h={category:((p=e.cartItem)==null?void 0:p.category)??e.category,configurator:e.editor,quantity:1};switch(e.editor){case"kozyrek":{const b=e.settings;o.value=new W.OrderItemBase({...h,configuratorParams:{length:b.stripMinLength,linesAngles:[],linesWidths:[],startTailType:V.some(b.startTailConfigs,y=>y.isDefault)?(m=b.startTailConfigs)==null?void 0:m.findIndex(y=>y.isDefault):void 0,endTailType:V.some(b.endTailConfigs,y=>y.isDefault)?(g=b.endTailConfigs)==null?void 0:g.findIndex(y=>y.isDefault):void 0,colorSide:"top"}});break}case"mosquitto":{const b=e.settings;o.value=new W.OrderItemBase({...h,configuratorParams:{width:0,height:0,netType:b.netType[0]||"",color:b.color[0]||"",mountType:b.mountType[0]||""}});break}case"strip":{const b=e.settings;s.value=[new W.OrderItemBase({...h,length:b.minLength,configuratorParams:{linesWidths:[0]}})];break}case"metal_for_doors":{const b=e.settings;o.value=new W.OrderItemBase({...h,configuratorParams:{width:b.minWidth,length:b.minLength}});break}case"sandwich":{o.value=new W.OrderItemBase({...h,configuratorParams:{calculationId:"",items:[{width:0,length:0,count:1}]}});break}case"sandwich_m2":{l.value=[new W.OrderItemBase({...h,configuratorParams:{width:0,length:0}})];break}default:r.value=`Неподдерживаемый тип конфигуратора: ${e.editor}.`}o.value&&(o.value.marker=void 0)},d=(h,p,m)=>{const g=b=>{m==null||m(),b&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:h,callback:g,validation:p})},u=(h,p,m,g)=>{const b=h[0];if(!b){m==null||m();return}const y=(g==null?void 0:g.isFinalSuccessfulCompletion)===!0,_=x=>{m==null||m(x),y&&x&&c()};e.eventEmitter.emit("configurator:submit",{cartItem:b,callback:_,validation:p,additionalParams:g})},f=()=>{e.category&&e.eventEmitter.emit("configurator:click-view-switch",{category:e.category})};return t.onMounted(()=>{!e.cartItem&&!e.cartItems&&c()}),(h,p)=>{const m=I.NSpin;return t.openBlock(),t.createElementBlock(t.Fragment,null,[i.value?(t.openBlock(),t.createElementBlock("div",U_,[t.createVNode(m,{size:"large"})])):r.value?(t.openBlock(),t.createElementBlock("div",K_,t.toDisplayString(r.value),1)):t.createCommentVNode("",!0),n.settings!==null&&(o.value!==null||s.value!==null||l.value!==null)?(t.openBlock(),t.createElementBlock("div",G_,[t.createElementVNode("div",Z_,[n.editor==="kozyrek"?(t.openBlock(),t.createBlock(Mu,{key:0,"event-emitter":n.eventEmitter,settings:n.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):n.editor==="mosquitto"?(t.openBlock(),t.createBlock(Ou,{key:1,"event-emitter":n.eventEmitter,settings:n.settings,"cart-item":o.value,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):n.editor==="strip"?(t.openBlock(),t.createBlock(Hu,{key:2,"event-emitter":n.eventEmitter,settings:n.settings,"cart-items":s.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-items"])):n.editor==="metal_for_doors"?(t.openBlock(),t.createBlock(ju,{key:3,"event-emitter":n.eventEmitter,settings:n.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):n.editor==="sandwich"?(t.openBlock(),t.createBlock(Yu,{key:4,"event-emitter":n.eventEmitter,settings:n.settings,"cart-item":o.value,"onClick:viewSwitch":f,onSubmit:d},null,8,["event-emitter","settings","cart-item"])):n.editor==="sandwich_m2"?(t.openBlock(),t.createBlock(Ku,{key:5,"event-emitter":n.eventEmitter,settings:n.settings,"cart-items":l.value,"onClick:viewSwitch":f,onSubmit:u},null,8,["event-emitter","settings","cart-items"])):t.createCommentVNode("",!0)])])):(t.openBlock(),t.createElementBlock("div",Q_,' Конфигуратор "'+t.toDisplayString(n.editor)+'" не поддерживается. ',1))],64)}}});function Zu(n){return Object.values(W.ConfiguratorsEnum).includes(n)}function Qu(n){var e;return((e=n.properties)==null?void 0:e.configurator)!==W.ConfiguratorsEnum.Sandwich?!0:n.properties.configuratorSettings!==void 0&&V.isArray(n.products)&&n.products.length>0}const ew={key:0,class:"pt-0.5"},tw={key:0},nw={key:1},iw={class:"flex flex-row gap-1"},rw={key:0},ow={class:"m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500"},sw={class:"flex flex-col gap-2.5 sm:flex-row"},aw={key:0,class:"header-extra"},lw={class:"inline-flex"},cw={class:"inline-flex"},dw={class:"inline-flex"},uw={class:"mt-2"},fw={key:1,class:"flex flex-col"},hw={},mw=t.defineComponent({...hw,__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},showProductInfoButton:{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(n){const e=n,i=t.inject(Rr,"medium"),r=uo(),o=t.computed(()=>{var oe;return(oe=e==null?void 0:e.filteredItems)==null?void 0:oe[e.categoryItem.id]}),s=t.computed(()=>{var oe,fe;return V.isArray((oe=e.categoryItem)==null?void 0:oe.categories)&&((fe=e.categoryItem.categories)==null?void 0:fe.length)>0}),a=t.computed(()=>{var oe;return V.isArray((oe=e.categoryItem)==null?void 0:oe.products)?e.categoryItem.products:[]}),l=t.computed(()=>Object.entries(e.categoryItem.currencyRates??{}).map(([oe,fe])=>`${fe} руб./${O(oe)}`).join(", ")),c=t.computed(()=>V.isUndefined(e.filteredItems)||o.value==="*"?a.value:a.value.filter(oe=>{var ge;const fe=(ge=o.value)==null?void 0:ge.products;return V.isArray(fe)&&fe.includes(oe.id)})),d=t.computed(()=>c.value.length>0),u=t.computed(()=>V.isFunction(e.showCategoryHideForClientButton)?e.showCategoryHideForClientButton(e.categoryItem):e.showCategoryHideForClientButton),f=t.computed(()=>V.isFunction(e.showCategoryPinButton)?e.showCategoryPinButton(e.categoryItem):e.showCategoryPinButton),h=t.computed(()=>V.isFunction(e.showCategoryRequiredButton)?e.showCategoryRequiredButton(e.categoryItem):e.showCategoryRequiredButton),p=t.computed(()=>{var ge,_e;const oe=(ge=w.value)==null?void 0:ge.hidingComment,fe=(_e=w.value)!=null&&_e.isDisabled?`Скрыто для клиента${oe?`. Причина: '${oe}'`:""}`:"Видимо клиенту";return u.value==="disabled"?`${fe}. ${Nr}`:fe}),m=t.computed(()=>{var ge;const oe=(ge=w.value)==null?void 0:ge.manager,fe=oe?`Категория закреплена за "${oe.name??"-"}"`:"Закрепить";return f.value==="disabled"?`${fe}. ${Nr}`:fe}),g=t.computed(()=>h.value==="disabled"?`${$s}. ${Nr}`:$s),b=t.computed(()=>V.isFunction(e.showCategoryEditButton)?e.showCategoryEditButton(e.categoryItem):e.showCategoryEditButton),y=t.computed(()=>{var oe,fe,ge;return((oe=e.categoryItem.properties)==null?void 0:oe.configurator)!==void 0&&Zu((fe=e.categoryItem.properties)==null?void 0:fe.configurator)&&Qu(e.categoryItem)&&((ge=e.categoryItem.properties)==null?void 0:ge.configuratorSettings)!==void 0&&(V.isFunction(e.canShowConfigurator)?e.canShowConfigurator():e.canShowConfigurator)}),_=t.computed(()=>y.value&&(V.isFunction(e.showConfigurator)?e.showConfigurator(e.categoryItem):e.showConfigurator)),x=t.computed(()=>V.isNil(e.categoryContextButtonsConfig)?[]:V.isFunction(e.categoryContextButtonsConfig)?e.categoryContextButtonsConfig(e.categoryItem):e.categoryContextButtonsConfig),w=t.computed(()=>new W.ClientCategory(e.categoryItem)),C=t.ref(!1),N=t.ref(!1),k=t.computed(()=>!V.isUndefined(e.isCategoryItemSelected)),$=t.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem):e.isCategoryItemSelected===!0),v=t.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="disabled":e.isCategoryItemSelected==="disabled"),E=t.computed(()=>V.isFunction(e.isCategoryItemSelected)?e.isCategoryItemSelected(e.categoryItem)==="indeterminate":e.isCategoryItemSelected==="indeterminate"),P=t.computed(()=>L.value&&Ue.getDeviceTypeByResolution()===Xe.laptop?"auto":"fixed"),F=t.useTemplateRef("collapse-item-reference"),R=t.computed(()=>{var oe,fe;return(fe=(oe=e.categoryItem.properties)==null?void 0:oe.templateCost)==null?void 0:fe.priceCoefficient}),M=t.computed(()=>{var oe,fe;return(fe=(oe=e.categoryItem.properties)==null?void 0:oe.templateCost)==null?void 0:fe.increasePercent}),X=t.computed(()=>vi.isM2Category(e.categoryItem)?vi.findReferenceProduct(e.categoryItem):void 0),G=t.computed(()=>X.value?vi.calculateM2Cost(X.value,R.value,M.value):void 0),Z=t.computed(()=>{var oe,fe;return`${((fe=(oe=X.value)==null?void 0:oe.currency)==null?void 0:fe.symbol)??""}/м²`}),O=(oe,fe="ru-RU")=>0 .toLocaleString(fe,{style:"currency",currency:oe,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,"").trim(),A=oe=>{e.eventEmitter.emit("category:checked",{category:e.categoryItem,checked:oe,target:F.value})},Y=(oe,fe)=>{e.eventEmitter.emit("category:header-click",{categoryItem:e.categoryItem,expanded:fe,isLoadingState:C,target:F.value})},H=()=>{e.eventEmitter.emit("category:hide",{category:e.categoryItem,target:F.value})},T=()=>{e.eventEmitter.emit("category:required",{category:e.categoryItem,target:F.value})},D=()=>{e.eventEmitter.emit("category:attach",{category:e.categoryItem,target:F.value})},K=()=>{e.eventEmitter.emit("category:detach",{category:e.categoryItem,target:F.value})},J=()=>{e.eventEmitter.emit("category:edit",{category:e.categoryItem,target:F.value})},U=oe=>{e.eventEmitter.emit("category:context-select",{category:e.categoryItem,key:oe,target:F.value})},q=()=>{e.eventEmitter.emit("configurator:click-view-switch",{category:e.categoryItem})},L=t.ref(0),le=t.computed(()=>L.value&&a.value.length>0?oy(a.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,showProductInfoButton:e.showProductInfoButton,showProductAddToCartButton:e.showProductAddToCartButton,isProductItemSelected:e.isProductItemSelected,showProductEditButton:e.showProductEditButton,showProductRequiredButton:e.showProductRequiredButton,currencyRates:e.categoryItem.currencyRates,productContextButtonsConfig:e.productContextButtonsConfig}):[]),ue=V.debounce(()=>{L.value=window.innerWidth},20);return t.onUnmounted(()=>{window.removeEventListener("resize",ue),ue.cancel()}),window.addEventListener("resize",ue),ue(),(oe,fe)=>{const ge=I.NCheckbox,_e=bp,Qe=I.NTooltip,Re=pp,Mt=I.NTag,vn=fp,It=cp,en=I.NButton,Ln=sp,mn=ic,_t=nc,ae=tc,de=Ms,Ge=I.NDropdown,Ui=I.NDataTable,oi=I.NAlert,si=I.NSpin;return t.openBlock(),t.createBlock(rc,{ref:"collapse-item-reference",name:n.categoryItem.id,"data-id":n.categoryItem.id,"onHeader:click":Y},{"pre-arrow":t.withCtx(()=>{var at,qe;return[k.value?(t.openBlock(),t.createElementBlock("div",ew,[t.createVNode(ge,{checked:$.value,indeterminate:E.value,disabled:v.value,"onUpdate:checked":A},null,8,["checked","indeterminate","disabled"])])):t.createCommentVNode("",!0),!u.value&&((at=w.value)!=null&&at.isDisabled)?(t.openBlock(),t.createBlock(Qe,{key:1,placement:"bottom",trigger:"hover"},{trigger:t.withCtx(()=>[t.createVNode(_e,{class:"pt-1.5"})]),default:t.withCtx(()=>[fe[1]||(fe[1]=t.createTextVNode(" Категория скрыта для клиента ",-1))]),_:1})):t.createCommentVNode("",!0),((qe=w.value)==null?void 0:qe.isFavorite)??!1?(t.openBlock(),t.createBlock(Qe,{key:2,placement:"bottom",trigger:"hover"},{trigger:t.withCtx(()=>[t.createVNode(Re,{class:"pt-1.5"})]),default:t.withCtx(()=>[fe[2]||(fe[2]=t.createTextVNode(" Избранная категория ",-1))]),_:1})):t.createCommentVNode("",!0)]}),header:t.withCtx(()=>{var at,qe,on,sn;return[t.createElementVNode("div",{class:t.normalizeClass({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":n.categoryItem.isHidden,"text-gray-400":(at=w.value)==null?void 0:at.isDisabled})},[t.createVNode(Qe,{disabled:!n.categoryItem.isHidden,placement:"bottom",trigger:"hover"},{trigger:t.withCtx(()=>[t.createElementVNode("span",null,t.toDisplayString(n.categoryItem.name),1)]),default:t.withCtx(()=>[fe[3]||(fe[3]=t.createTextVNode(" Категория скрыта ",-1))]),_:1},8,["disabled"])],2),t.createElementVNode("div",{class:"w-fit",onClick:fe[0]||(fe[0]=t.withModifiers((...lt)=>t.unref(V.noop)&&t.unref(V.noop)(...lt),["prevent","stop"]))},[(qe=n.categoryItem.properties)!=null&&qe.templateCost?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[R.value||M.value||!t.unref(V.isNil)(G.value)?(t.openBlock(),t.createBlock(Mt,{key:0,size:t.unref(i),round:""},{default:t.withCtx(()=>{var lt;return[R.value?(t.openBlock(),t.createElementBlock("span",tw,t.toDisplayString((lt=R.value)==null?void 0:lt.name),1)):t.createCommentVNode("",!0),M.value?(t.openBlock(),t.createElementBlock("span",nw,t.toDisplayString(M.value>0?"+":"")+t.toDisplayString(t.unref(Ve).formatPercent(M.value))+"%",1)):t.createCommentVNode("",!0),t.unref(V.isNil)(G.value)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",{key:2,class:t.normalizeClass({"ml-1":R.value||M.value})},t.toDisplayString(G.value.toFixed(2))+" "+t.toDisplayString(Z.value),3))]}),_:1},8,["size"])):t.createCommentVNode("",!0)],64)):(on=n.categoryItem.properties)!=null&&on.m2Price?(t.openBlock(),t.createBlock(Mt,{key:1,size:t.unref(i),round:""},{default:t.withCtx(()=>[t.createTextVNode(" Установленная стоимость: "+t.toDisplayString(n.categoryItem.properties.m2Price)+" руб./м2 ",1)]),_:1},8,["size"])):t.createCommentVNode("",!0),l.value?(t.openBlock(),t.createBlock(Mt,{key:2,size:t.unref(i),round:""},{default:t.withCtx(()=>[t.createTextVNode(" Фиксированный курс: "+t.toDisplayString(l.value),1)]),_:1},8,["size"])):t.createCommentVNode("",!0),f.value&&((sn=w.value)!=null&&sn.manager)?(t.openBlock(),t.createBlock(Mt,{key:3,size:t.unref(i),closable:f.value!=="disabled",round:"",class:"align-bottom",onClose:K},{default:t.withCtx(()=>[t.createVNode(Qe,{placement:"bottom",trigger:"hover"},{trigger:t.withCtx(()=>{var lt,jt;return[t.createElementVNode("span",iw,[t.createVNode(vn),t.createTextVNode(" "+t.toDisplayString((jt=(lt=w.value)==null?void 0:lt.manager)==null?void 0:jt.name),1)])]}),default:t.withCtx(()=>{var lt,jt;return[t.createTextVNode(' Категория закреплена за "'+t.toDisplayString((jt=(lt=w.value)==null?void 0:lt.manager)==null?void 0:jt.name)+'" ',1)]}),_:1})]),_:1},8,["size","closable"])):t.createCommentVNode("",!0)])]}),"sub-header":t.withCtx(()=>[n.showSlugs||n.showProperties?(t.openBlock(),t.createElementBlock("div",rw,[t.createElementVNode("ul",ow,[n.showSlugs?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:0},t.renderList({id:n.categoryItem.id,slug:n.categoryItem.slug},(at,qe)=>(t.openBlock(),t.createElementBlock("li",{key:qe}," ("+t.toDisplayString(qe)+"): "+t.toDisplayString(at),1))),128)):t.createCommentVNode("",!0),n.showProperties?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(n.categoryItem.properties,(at,qe)=>(t.openBlock(),t.createElementBlock("li",{key:qe}," ("+t.toDisplayString(qe)+"): "+t.toDisplayString(at),1))),128)):t.createCommentVNode("",!0)])])):t.createCommentVNode("",!0)]),"header-extra":t.withCtx(()=>{var at;return[t.createElementVNode("div",sw,[oe.$slots["header-extra"]?(t.openBlock(),t.createElementBlock("div",aw,[t.renderSlot(oe.$slots,"header-extra",{categoryItem:n.categoryItem},void 0,!0)])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createBlock(Qe,{key:1,placement:"bottom",trigger:"hover",disabled:!t.unref(r)&&u.value!=="disabled"},{trigger:t.withCtx(()=>[t.createElementVNode("span",lw,[t.createVNode(en,{ghost:!0,disabled:u.value==="disabled",size:t.unref(i),onClick:H},{default:t.withCtx(()=>{var qe;return[(qe=w.value)!=null&&qe.isDisabled?(t.openBlock(),t.createBlock(_e,{key:1})):(t.openBlock(),t.createBlock(It,{key:0}))]}),_:1},8,["disabled","size"])])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(p.value),1)]),_:1},8,["disabled"])):t.createCommentVNode("",!0),f.value&&!((at=w.value)!=null&&at.manager)?(t.openBlock(),t.createBlock(Qe,{key:2,placement:"bottom",trigger:"hover",disabled:!t.unref(r)&&f.value!=="disabled"},{trigger:t.withCtx(()=>[t.createElementVNode("span",cw,[t.createVNode(en,{ghost:!0,disabled:f.value==="disabled",size:t.unref(i),onClick:D},{default:t.withCtx(()=>[t.createVNode(Ln)]),_:1},8,["disabled","size"])])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(m.value),1)]),_:1},8,["disabled"])):t.createCommentVNode("",!0),h.value?(t.openBlock(),t.createBlock(Qe,{key:3,placement:"bottom",trigger:"hover",disabled:!t.unref(r)&&h.value!=="disabled"},{trigger:t.withCtx(()=>[t.createElementVNode("span",dw,[t.createVNode(en,{ghost:!0,disabled:h.value==="disabled",size:t.unref(i),onClick:T},{default:t.withCtx(()=>{var qe;return[(qe=w.value)!=null&&qe.isRequired?(t.openBlock(),t.createBlock(_t,{key:1})):(t.openBlock(),t.createBlock(mn,{key:0}))]}),_:1},8,["disabled","size"])])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(g.value),1)]),_:1},8,["disabled"])):t.createCommentVNode("",!0),b.value?(t.openBlock(),t.createBlock(Qe,{key:4,placement:"bottom",trigger:"hover",disabled:!t.unref(r)},{trigger:t.withCtx(()=>[t.createVNode(en,{ghost:!0,size:t.unref(i),type:"primary",onClick:J},{default:t.withCtx(()=>[t.createVNode(ae)]),_:1},8,["size"])]),default:t.withCtx(()=>[fe[4]||(fe[4]=t.createTextVNode(" Редактировать ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),x.value.length>0?(t.openBlock(),t.createBlock(Ge,{key:5,options:x.value,size:t.unref(i),trigger:"click",onSelect:U},{default:t.withCtx(()=>[t.createVNode(en,{ghost:!0,size:t.unref(i),type:"primary"},{default:t.withCtx(()=>[t.createVNode(de)]),_:1},8,["size"])]),_:1},8,["options","size"])):t.createCommentVNode("",!0)])]}),default:t.withCtx(()=>[t.renderSlot(oe.$slots,"default",{},()=>{var at,qe,on;return[t.createElementVNode("div",uw,[s.value?(t.openBlock(),t.createBlock(ef,{key:0,"categories-items":n.categoryItem.categories??[],"has-products":d.value||C.value,"event-emitter":n.eventEmitter,"filtered-items":o.value?((at=o.value)==null?void 0:at.categories)??{}:void 0,"is-category-item-selected":n.isCategoryItemSelected,"show-slugs":n.showSlugs,"show-properties":n.showProperties,"allow-name-click":n.allowNameClick,"allow-price-click":n.allowPriceClick,"show-price-history":n.showPriceHistory,"show-cost-date":n.showCostDate,"show-product-info-button":n.showProductInfoButton,"show-category-required-button":n.showCategoryRequiredButton,"show-category-hide-for-client-button":n.showCategoryHideForClientButton,"show-category-pin-button":n.showCategoryPinButton,"show-category-edit-button":n.showCategoryEditButton,"category-context-buttons-config":n.categoryContextButtonsConfig,"is-product-item-selected":n.isProductItemSelected,"show-product-add-to-cart-button":n.showProductAddToCartButton,"show-product-costs":n.showProductCosts,"show-product-required-button":n.showProductRequiredButton,"show-product-edit-button":n.showProductEditButton,"product-context-buttons-config":n.productContextButtonsConfig,"show-configurator":n.showConfigurator,"can-show-configurator":n.canShowConfigurator},t.createSlots({_:2},[oe.$slots["header-extra"]?{name:"header-extra",fn:t.withCtx(({categoryItem:sn})=>[t.renderSlot(oe.$slots,"header-extra",{categoryItem:sn},void 0,!0)]),key:"0"}:void 0]),1032,["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-product-info-button","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"])):t.createCommentVNode("",!0)]),y.value&&_.value?(t.openBlock(),t.createBlock(Gu,{key:0,"event-emitter":n.eventEmitter,settings:(qe=n.categoryItem.properties)==null?void 0:qe.configuratorSettings,editor:(on=n.categoryItem.properties)==null?void 0:on.configurator,category:n.categoryItem},null,8,["event-emitter","settings","editor","category"])):d.value?(t.openBlock(),t.createElementBlock("div",fw,[y.value?(t.openBlock(),t.createBlock(en,{key:0,color:"#bdbdbd",strong:"",class:"self-end p-2",onClick:q},{default:t.withCtx(()=>[...fe[5]||(fe[5]=[t.createTextVNode(" Назад в Конфигуратор ",-1)])]),_:1})):t.createCommentVNode("",!0),t.createVNode(Ui,{columns:le.value,data:c.value,bordered:!0,loading:C.value,remote:!0,"row-key":sn=>sn.id,"table-layout":P.value,class:"mt-2"},null,8,["columns","data","loading","row-key","table-layout"])])):t.createCommentVNode("",!0),!C.value&&!N.value&&!s.value&&!d.value?(t.openBlock(),t.createBlock(oi,{key:2,"show-icon":!0,type:"warning",title:"Категория пуста",class:"mx-10"})):t.createCommentVNode("",!0),N.value?(t.openBlock(),t.createBlock(oi,{key:3,"show-icon":!0,type:"error",title:"При получении данных произошла ошибка",class:"mx-10"})):t.createCommentVNode("",!0),C.value?(t.openBlock(),t.createBlock(si,{key:4,size:t.unref(i),class:"w-full"},{description:t.withCtx(()=>[...fe[6]||(fe[6]=[t.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):t.createCommentVNode("",!0)]},!0)]),_:3},8,["name","data-id"])}}}),pw=gn(mw,[["__scopeId","data-v-9ed22ab1"]]),gw={class:"sc-collapse flex w-full flex-col"},yw={},Ju=t.defineComponent({...yw,__name:"collapse",props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:["on-item-header-click"],setup(n,{emit:e}){const i=n,r=e,o=(s,a)=>{r("on-item-header-click",s,a)};return t.provide("itemHeaderClickHandler",o),t.provide("defaultExpandedNames",i.defaultExpandedNames),t.provide("expandedNames",i.expandedNames),(s,a)=>(t.openBlock(),t.createElementBlock("div",gw,[t.renderSlot(s.$slots,"default")]))}}),bw={},ef=t.defineComponent({...bw,__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},showProductInfoButton:{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(n){const e=n,i=t.inject(Rr,"medium"),r=t.computed(()=>V.isUndefined(e.filteredItems)?e.categoriesItems:e.categoriesItems.filter(s=>{var a;return!!((a=e.filteredItems)!=null&&a[s.id])})),o=(s,a)=>{if(V.isUndefined(a))return;const l=a[s.id];if(l==="*")return;const c={};return c[s.id]=structuredClone(t.toRaw(l)),c};return(s,a)=>{const l=I.NSpin,c=I.NAlert;return t.openBlock(),t.createElementBlock(t.Fragment,null,[r.value.length>0?(t.openBlock(),t.createBlock(Ju,{key:0},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,d=>(t.openBlock(),t.createBlock(pw,{key:d.id,"category-item":d,"event-emitter":n.eventEmitter,"filtered-items":o(d,n.filteredItems),"is-category-item-selected":n.isCategoryItemSelected,"show-slugs":n.showSlugs,"show-properties":n.showProperties,"allow-name-click":n.allowNameClick,"allow-price-click":n.allowPriceClick,"show-price-history":n.showPriceHistory,"show-cost-date":n.showCostDate,"show-product-info-button":n.showProductInfoButton,"show-category-required-button":n.showCategoryRequiredButton,"show-category-hide-for-client-button":n.showCategoryHideForClientButton,"show-category-pin-button":n.showCategoryPinButton,"show-category-edit-button":n.showCategoryEditButton,"category-context-buttons-config":n.categoryContextButtonsConfig,"is-product-item-selected":n.isProductItemSelected,"show-product-add-to-cart-button":n.showProductAddToCartButton,"show-product-costs":n.showProductCosts,"show-product-required-button":n.showProductRequiredButton,"show-product-edit-button":n.showProductEditButton,"product-context-buttons-config":n.productContextButtonsConfig,"show-configurator":n.showConfigurator,"can-show-configurator":n.canShowConfigurator},t.createSlots({_:2},[s.$slots["header-extra"]?{name:"header-extra",fn:t.withCtx(({categoryItem:u})=>[t.renderSlot(s.$slots,"header-extra",{categoryItem:u})]),key:"0"}:void 0]),1032,["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-product-info-button","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))]),_:3})):n.loading?(t.openBlock(),t.createBlock(l,{key:1,size:t.unref(i),class:"w-full"},{description:t.withCtx(()=>[...a[0]||(a[0]=[t.createElementVNode("div",null,"Выполняется загрузка данных ...",-1)])]),_:1},8,["size"])):t.createCommentVNode("",!0),!n.hasProducts&&!n.loading&&n.categoriesItems.length>0&&r.value.length===0?(t.openBlock(),t.createBlock(c,{key:2,"show-icon":!0,type:"warning",title:"Товары не найдены",class:"mx-10"})):t.createCommentVNode("",!0)],64)}}}),_w={},tf=t.defineComponent({..._w,__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,default:!1},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(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=new W.Reference,l=t.computed(()=>V.isNil(r.value)?s.value?[]:null:V.isArray(r.value)?r.value.filter(m=>!V.isNil(m)).map(m=>m.id):r.value.id),c=t.computed(()=>wt.convertReferencesToSelectOptionsList(r.referenceList,r.sortOptionsByLabel,!1,r.showEmptyValue,void 0,r.disabledItem)),d=t.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=m=>{var g;if(V.isArray(m)){const b=m.length>0?m.map(y=>{var _;return(_=c.value.find(x=>x.value===y))==null?void 0:_.item}).filter(y=>!V.isNil(y)):[];o("update:value",b)}else{const b=m===a.id||V.isNil(m)||(g=c.value.find(y=>y.value===m))==null?void 0:g.item;o("update:value",b)}},f=t.useTemplateRef("select-component");return e({focus:()=>{var m;return(m=f.value)==null?void 0:m.focus()},blur:()=>{var m;return(m=f.value)==null?void 0:m.blur()}}),(m,g)=>(t.openBlock(),t.createBlock(t.unref(I.NSelect),{ref:"select-component",value:l.value,clearable:r.clearable,"consistent-menu-width":n.consistentMenuWidth,disabled:n.disabled||c.value.length===0,filterable:n.filterable,"max-tag-count":n.maxTagCount,multiple:s.value,options:d.value,placeholder:"",class:"w-full","onUpdate:value":u},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),ww={},xw=t.defineComponent({...ww,__name:"set-client-price-form-item",props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{},m2ReferenceProduct:{},disabledCoefficient:{type:Function},visibleCoefficient:{type:Function}},emits:["update:value"],setup(n,{emit:e}){var E,P;const i=n,r=e,o=()=>{const F=W.PriceCoefficient.getRetailPriceCoefficient();return V.unset(F,"isNewRec"),F},s=F=>!F||F.id===o().id,a=t.computed(()=>{var F;return((F=i.catalogItem)==null?void 0:F.type)==="product"}),l=t.computed(()=>!a.value&&!V.isNil(i.m2ReferenceProduct)),c=t.computed(()=>a.value?i.catalogItem:i.m2ReferenceProduct),d=t.computed(()=>!V.isNil(c.value)),u=t.computed(()=>{var F;return`${((F=c.value)==null?void 0:F.currency.symbol)??""}${l.value?"/м²":""}`}),f=F=>l.value&&i.m2ReferenceProduct?vi.toM2Cost(F,i.m2ReferenceProduct):F,h=t.computed(()=>c.value?f(c.value.retailCost??c.value.cost):void 0),p=t.computed(()=>{var F;return(((F=c.value)==null?void 0:F.priceCoefficients)??[]).map(R=>({...R,cost:f(R.cost)}))}),m=F=>{var R;return F.id===o().id?h.value:(R=p.value.find(M=>M.coefficient.id===F.id))==null?void 0:R.cost},g=t.computed(()=>{var M;const R=[...((M=W.useReferencesStore().priceCoefficientsReference)==null?void 0:M.map(X=>structuredClone(t.toRaw(X))))??[],o()].filter(X=>{var G;return((G=i.visibleCoefficient)==null?void 0:G.call(i,X))??!0});return d.value&&R.forEach(X=>{const G=m(X);G?X.name+=` (${V.round(G,2)} ${u.value})`:X.name=""}),R.filter(X=>X.name!=="")}),b=t.ref(i.value.coefficient),y=t.ref(((P=(E=i.value)==null?void 0:E.value)==null?void 0:P.toString())??null),_=t.ref(null),x=t.computed(()=>p.value.find(F=>F.coefficient.slug===W.PriceCoefficientEnum.K0)),w=t.ref(void 0),C=F=>Number.parseFloat((F??"").replaceAll(/[\s\u00A0\u202F]/g,"").replace(",",".")),N=()=>{var R,M;w.value=void 0;let F=C(y.value);if(F=Number.isNaN(F)?void 0:F,d.value)if(b.value||y.value){const X=o(),G=m(b.value??X)??0,Z=G+G*((F??0)/100);_.value=Ve.formatMoney(Z,(R=c.value)==null?void 0:R.currency.precision),Z>(h.value??Z)&&(w.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}),x.value&&Z<(((M=x.value)==null?void 0:M.cost)??0)&&(w.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"})}else _.value=null;r("update:value",{value:Number.isNaN(F)?void 0:F,coefficient:s(b.value)?void 0:structuredClone(t.toRaw(b.value))})},k=F=>{V.isArray(F)||V.isNull(F)||(b.value=F,y.value=null,!b.value&&y.value&&(b.value=o()),N())},$=()=>{b.value||(b.value=o()),N()},v=F=>{var M,X;const R=C(F);if(d.value){if(Number.isNaN(R)){b.value=void 0,y.value=null,r("update:value",{value:void 0,coefficient:void 0});return}let G=0;if(R<=0)b.value=void 0,y.value=null;else if(x.value&&R<(((M=x.value)==null?void 0:M.cost)??0))b.value=(X=x.value)==null?void 0:X.coefficient,G=(R-x.value.cost)*100/x.value.cost,w.value={validationStatus:"warning",feedback:"Устанавливается цена ниже минимальной цены"};else if(R>(h.value??R)){b.value=o();const Z=h.value??0;G=(R-Z)*100/Z,w.value={validationStatus:"warning",feedback:"Устанавливается цена выше розничной цены"}}else{const Z=p.value,O=V.sortBy(Z,[H=>H.cost]),Y=O.filter(H=>H.cost<=R).at(-1)??O.at(0);Y&&(b.value=Y.coefficient,G=(R-Y.cost)*100/Y.cost),w.value={validationStatus:void 0,feedback:void 0}}G=Ve.roundPercent(G),y.value=Ve.formatPercent(G,Ve.percentFractionDigits),r("update:value",{value:Number.isNaN(G)?void 0:G,coefficient:s(b.value)?void 0:structuredClone(t.toRaw(b.value))})}else r("update:value",{value:Number.isNaN(R)?void 0:R,coefficient:void 0})};return t.onMounted(()=>{var F,R,M,X;i.calculationType===W.CalculationTypeEnum.m2Cost?_.value=((R=(F=i.value)==null?void 0:F.value)==null?void 0:R.toString())??null:!((M=i.value)!=null&&M.coefficient)&&((X=i.value)!=null&&X.value)&&(b.value=o()),N()}),(F,R)=>{var G,Z,O;const M=I.NInput,X=I.NInputGroup;return t.openBlock(),t.createBlock(t.unref(I.NFormItem),{"show-label":!t.unref(V.isNil)(n.label),label:n.label,"show-feedback":!t.unref(V.isNil)(((G=w.value)==null?void 0:G.feedback)??n.feedback),feedback:((Z=w.value)==null?void 0:Z.feedback)??n.feedback,"validation-status":((O=w.value)==null?void 0:O.validationStatus)??n.validationStatus},{default:t.withCtx(()=>[t.createElementVNode("div",{class:t.normalizeClass([{"sm:grid-cols-3":d.value},"grid w-full grid-cols-1 gap-2"])},[n.calculationType!==t.unref(W.CalculationTypeEnum).m2Cost?(t.openBlock(),t.createBlock(X,{key:0,class:t.normalizeClass(["w-full flex-row",{"sm:col-span-2":d.value}])},{default:t.withCtx(()=>[t.createVNode(tf,{class:"w-full min-w-0 flex-1",value:b.value,"reference-list":g.value,clearable:n.clearable,disabled:n.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"disabled-item":n.disabledCoefficient,"onUpdate:value":k},null,8,["value","reference-list","clearable","disabled","disabled-item"]),t.createVNode(M,{value:y.value,"onUpdate:value":[R[0]||(R[0]=A=>y.value=A),$],clearable:n.clearable,disabled:n.disabled,placeholder:"",class:"w-full min-w-0 flex-1"},t.createSlots({suffix:t.withCtx(()=>[R[3]||(R[3]=t.createTextVNode("%",-1))]),_:2},[y.value&&!y.value.startsWith("-")?{name:"prefix",fn:t.withCtx(()=>[R[2]||(R[2]=t.createTextVNode(" + ",-1))]),key:"0"}:void 0]),1032,["value","clearable","disabled"])]),_:1},8,["class"])):t.createCommentVNode("",!0),d.value||n.calculationType===t.unref(W.CalculationTypeEnum).m2Cost?(t.openBlock(),t.createBlock(M,{key:1,value:_.value,"onUpdate:value":[R[1]||(R[1]=A=>_.value=A),v],clearable:n.clearable,disabled:n.disabled,placeholder:l.value?"Стоимость за м²":"Стоимость",class:"w-full"},t.createSlots({_:2},[d.value?{name:"suffix",fn:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(u.value),1)]),key:"0"}:void 0]),1032,["value","clearable","disabled","placeholder"])):t.createCommentVNode("",!0)],2)]),_:1},8,["show-label","label","show-feedback","feedback","validation-status"])}}}),kw={class:"text-sm"},Cw={class:"text-sm"},vw={},Sw=t.defineComponent({...vw,__name:"add-product-to-cart-dialog",emits:["submit"],setup(n,{expose:e,emit:i}){const r=t.useTemplateRef("form-reference"),o=t.useTemplateRef("base-dialog-reference"),s=t.ref(!1),a=t.ref(null),l=t.computed(()=>{var R,M,X;return((R=a.value)==null?void 0:R.unit.isLinear)&&((X=(M=a.value)==null?void 0:M.properties)==null?void 0:X.isLengthConfigurator)}),c=t.computed(()=>a.value?W.UnitsHelper.productIsMeasurable(a.value)||l.value?"шт.":a.value.unit.name:"шт."),d=t.ref(void 0),u=t.ref(void 0),f=t.ref(!0),h=t.ref(null),p=t.computed({get:()=>{var R;return((R=h.value)==null?void 0:R.quantity)??null},set:R=>{h.value&&(h.value.quantity=R??0)}}),m=t.computed({get:()=>{var R;return((R=h.value)==null?void 0:R.length)??null},set:R=>{h.value&&(h.value.length=R??void 0)}}),g=R=>{h.value&&(h.value.marker=R??void 0)},b=i,y=()=>({length:{},quantity:{},marker:{}}),_=t.ref(y()),x=t.ref(!1),w=t.computed(()=>{var Z,O,A,Y;if(!a.value)return{};const R=W.UnitsHelper.getProductLengthMultiplicity(a.value),M=W.UnitsHelper.getProductMultiplicity(a.value),X=((O=(Z=a.value)==null?void 0:Z.properties)==null?void 0:O.minLength)||R,G=(Y=(A=a.value)==null?void 0:A.properties)==null?void 0:Y.maxLength;return{length:[ce.required,ce.min(X??.1),ce.max(G),ce.step(R),We.serverValidation(_.value.length.feedback)],quantity:[ce.required,ce.min(M),ce.step(M),We.serverValidation(_.value.quantity.feedback)],marker:[We.serverValidation(_.value.marker.feedback)]}}),C=t.computed(()=>{var R,M,X;return a.value?((R=a.value.properties)==null?void 0:R.lengthStep)??((M=a.value.properties)!=null&&M.ignoreMinCountCheck?0:((X=a.value.properties)==null?void 0:X.minCount)??0):0}),N=t.computed(()=>{var X,G,Z,O,A,Y,H,T,D;if(!a.value)return"";const R=((G=(X=a.value)==null?void 0:X.properties)==null?void 0:G.minLength)??((O=(Z=a.value)==null?void 0:Z.properties)!=null&&O.ignoreMinCountCheck?0:(Y=(A=a.value)==null?void 0:A.properties)==null?void 0:Y.minCount),M=(T=(H=a.value)==null?void 0:H.properties)==null?void 0:T.maxLength;return R||M?`(${R?`от ${R}`:""}${R&&M?" ":""}${M?`до ${M}`:""} ${(D=a.value)==null?void 0:D.unit.name})`:""}),k=R=>{var O,A;if(!((A=(O=a.value)==null?void 0:O.properties)!=null&&A.isLengthConfigurator)||!h.value||V.isNil(R)||C.value===0)return;const M=R/C.value,X=Math.round(M),G=W.UnitsHelper.getProductMultiplicity(a.value),Z=Math.max(X,G);h.value.quantity=Z},$=R=>{var Z,O,A,Y;if(!((O=(Z=a.value)==null?void 0:Z.properties)!=null&&O.isLengthConfigurator)||!h.value||V.isNil(R)||C.value===0)return;const M=Ve.multiplyByStep(R,C.value),X=((A=a.value.properties)==null?void 0:A.minLength)||W.UnitsHelper.getProductLengthMultiplicity(a.value),G=(Y=a.value.properties)==null?void 0:Y.maxLength;X!==void 0&&M<X?h.value.length=X:G!==void 0&&M>G?h.value.length=G:h.value.length=M},v=async R=>{var X;const M=V.cloneDeep(h.value);try{await((X=r.value)==null?void 0:X.validate(G=>{if(!G){if(!a.value||!M)return;W.UnitsHelper.productIsMeasurable(a.value)||delete M.length,l.value&&C.value&&(M.length=C.value),x.value=!0,b("submit",M,_.value,()=>{x.value=!1,R(!1),t.nextTick(()=>{var Z;(Z=r.value)==null||Z.validate(V.noop).catch(V.noop)})})}}))}catch{}},E=()=>{a.value=null,d.value=void 0,h.value=null,_.value=y()},P=()=>{s.value=!1};return e({show:(R,M)=>{var X,G,Z,O,A;if(E(),s.value=!0,a.value=R,d.value=M==null?void 0:M.cartItemData,u.value=M==null?void 0:M.orderId,f.value=(M==null?void 0:M.canSetDopProdaga)??!1,h.value=new W.OrderItemBase((M==null?void 0:M.cartItemData)??new W.OrderItemBase({product:R,quantity:W.UnitsHelper.productIsMeasurable(a.value)?1:((X=R==null?void 0:R.properties)==null?void 0:X.minCount)??1,length:((G=R==null?void 0:R.properties)==null?void 0:G.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})),(A=R==null?void 0:R.properties)!=null&&A.isLengthConfigurator&&h.value&&C.value>0){const Y=C.value,H=h.value.quantity||1;h.value.length=Ve.multiplyByStep(H,Y)}},closeDialog:P}),(R,M)=>{var A;const X=I.NFormItem,G=I.NInputGroupLabel,Z=I.NInputGroup,O=I.NCheckbox;return t.openBlock(),t.createBlock(Os,{ref:"base-dialog-reference",show:s.value,title:`${d.value?"Изменение":"Добавление"} товара ${(A=a.value)==null?void 0:A.name} в ${u.value?` заказ №${u.value}`:"корзину"}`,"accept-button":{show:!0,text:d.value?"Изменить":"Добавить"},processing:x.value,"modal-width":500,onAccept:v,onClosing:P},{default:t.withCtx(()=>[a.value&&h.value?t.withDirectives((t.openBlock(),t.createBlock(t.unref(I.NForm),{key:0,ref:"form-reference",model:h.value,rules:w.value,class:"flex flex-col gap-2 sc-hide-empty-feedback-message"},{default:t.withCtx(()=>[t.unref(W.UnitsHelper).productIsMeasurable(a.value)?(t.openBlock(),t.createBlock(X,{key:0,path:"length",label:`Метраж, ${N.value+a.value.unit.name}`},t.createSlots({default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:m.value,"onUpdate:value":[M[0]||(M[0]=Y=>m.value=Y),k],parse:t.unref(ht),step:t.unref(W.UnitsHelper).getProductLengthMultiplicity(a.value),"show-button":!1,placeholder:"Введите метраж",class:"w-full",onKeydown:M[1]||(M[1]=Y=>t.unref(fo)(Y,".",!1)),onInput:M[2]||(M[2]=Y=>t.unref(dt)(_.value,"length")),onFocus:t.unref(He)},null,8,["value","parse","step","onFocus"])]),_:2},[!_.value.length.feedback&&t.unref(W.UnitsHelper).getProductLengthMultiplicity(a.value)!==1?{name:"feedback",fn:t.withCtx(()=>[t.createElementVNode("span",kw,"Метраж должно быть кратно "+t.toDisplayString(t.unref(W.UnitsHelper).getProductLengthMultiplicity(a.value)),1)]),key:"0"}:void 0]),1032,["label"])):t.createCommentVNode("",!0),t.createVNode(X,{path:"quantity",label:`Количество, ${c.value}`},{default:t.withCtx(()=>[t.createVNode(Z,null,t.createSlots({default:t.withCtx(()=>[t.createVNode(t.unref(I.NInputNumber),{value:p.value,"onUpdate:value":[M[3]||(M[3]=Y=>p.value=Y),$],parse:t.unref(ht),step:t.unref(W.UnitsHelper).getProductMultiplicity(a.value),"show-button":t.unref(W.UnitsHelper).getProductMultiplicity(a.value)>1,"button-placement":"both",placeholder:"Введите количество",class:"w-full",onKeydown:M[4]||(M[4]=Y=>t.unref(fo)(Y,".",!1)),onInput:M[5]||(M[5]=Y=>t.unref(dt)(_.value,"quantity")),onFocus:t.unref(He)},null,8,["value","parse","step","show-button","onFocus"]),l.value?(t.openBlock(),t.createBlock(G,{key:0,class:"bg-orange-100 font-bold"},{default:t.withCtx(()=>[t.createTextVNode(" x "+t.toDisplayString(C.value)+" "+t.toDisplayString(a.value.unit.name),1)]),_:1})):t.createCommentVNode("",!0)]),_:2},[!_.value.quantity.feedback&&t.unref(W.UnitsHelper).getProductMultiplicity(a.value)!==1?{name:"feedback",fn:t.withCtx(()=>[t.createElementVNode("span",Cw,"Количество должно быть кратно "+t.toDisplayString(t.unref(W.UnitsHelper).getProductMultiplicity(a.value)),1)]),key:"0"}:void 0]),1024)]),_:1},8,["label"]),t.unref(W.UnitsHelper).productIsMeasurable(a.value)?(t.openBlock(),t.createBlock(X,{key:1,path:"marker",label:"Маркировка"},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NInput),{value:h.value.marker??null,placeholder:"Введите маркировку",onInput:M[6]||(M[6]=Y=>t.unref(dt)(_.value,"marker")),"onUpdate:value":M[7]||(M[7]=Y=>g(Y)),onFocus:t.unref(He)},null,8,["value","onFocus"])]),_:1})):t.createCommentVNode("",!0),f.value?(t.openBlock(),t.createBlock(O,{key:2,checked:h.value.isAdditionalSale,"onUpdate:checked":M[8]||(M[8]=Y=>h.value.isAdditionalSale=Y),"true-value":!0,"false-value":!1},{default:t.withCtx(()=>[...M[9]||(M[9]=[t.createTextVNode(" ДопПродажа ",-1)])]),_:1},8,["checked"])):t.createCommentVNode("",!0)]),_:1},8,["model","rules"])),[[t.unref(ai),()=>{var Y,H;return(H=(Y=o.value)==null?void 0:Y.acceptHandler)==null?void 0:H.call(Y)}]]):t.createCommentVNode("",!0)]),_:1},8,["show","title","accept-button","processing"])}}}),Bw={class:"flex flex-row gap-1"},Nw={class:"sc-client-name flex flex-col gap-1 text-base"},Tw=["href"],$w={key:1,class:"text-sc-grey"},Ew={key:0,class:"text-sc-dark-grey sc-client-city text-sm"},Rw={key:0},Pw={key:1,class:"text-sm"},Fw={},Dr=t.defineComponent({...Fw,__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(n,{emit:e}){const i=n,r=e,o=t.computed(()=>i.client.lastLoginAt?Be.format(i.client.lastLoginAt,W.useBaseConfigStateStore().config.dateFormats.uiDateWithTime):""),s=a=>{V.isNil(i.nameLink)&&(a.preventDefault(),a.stopPropagation()),r("click:client-name",i.client,a)};return(a,l)=>{const c=ho,d=I.NButton,u=I.NPopover;return t.openBlock(),t.createElementBlock("div",Bw,[n.showClientInfoIcon?(t.openBlock(),t.createBlock(d,{key:0,quaternary:"",size:"small",onClick:l[0]||(l[0]=f=>a.$emit("click:client-info",n.client))},{default:t.withCtx(()=>[t.createVNode(c)]),_:1})):t.createCommentVNode("",!0),t.createVNode(u,{disabled:t.unref(V.isNil)(n.popoverPosition),placement:n.popoverPosition},{trigger:t.withCtx(()=>[t.createElementVNode("div",Nw,[t.createElementVNode("a",{href:n.nameLink??"#",class:"text-base no-underline",onClick:l[1]||(l[1]=f=>s(f))},[t.createElementVNode("span",{class:t.normalizeClass({"line-through":!n.client.isActive})},t.toDisplayString(n.client.name),3),n.showSalesDirection&&n.client.salesDirection?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass({"line-through":!n.client.isActive})}," ("+t.toDisplayString(n.client.salesDirection.name)+") ",3)):t.createCommentVNode("",!0),n.client.isActive?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",$w," [ Деактивирован ] "))],8,Tw),n.showCityAndRegion&&n.client.city?(t.openBlock(),t.createElementBlock("span",Ew," г. "+t.toDisplayString(n.client.city.name)+", "+t.toDisplayString(n.client.city.region.name),1)):t.createCommentVNode("",!0)])]),default:t.withCtx(()=>[n.client.alternativeName?(t.openBlock(),t.createElementBlock("div",Rw,t.toDisplayString(n.client.alternativeName),1)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("span",Pw," Последний вход: "+t.toDisplayString(o.value),1)):t.createCommentVNode("",!0),t.renderSlot(a.$slots,"popover-content")]),_:3},8,["disabled","placement"])])}}}),Vw={class:"text-base"},Mw={},nf=t.defineComponent({...Mw,__name:"contragent-with-short-info",props:{contragent:{}},setup(n){const e=n,i=t.computed(()=>li.getFormatEntityName(e.contragent));return(r,o)=>(t.openBlock(),t.createElementBlock("span",Vw,t.toDisplayString(i.value),1))}}),Iw={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Aw(n,e){return t.openBlock(),t.createElementBlock("svg",Iw,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.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"}),t.createElementVNode("path",{d:"m3 7l9 6l9-6"})],-1)])])}const Ow=t.markRaw({name:"tabler-mail",render:Aw}),zw=["href"],Dw={},Lw=t.defineComponent({...Dw,__name:"email",props:{email:{default:""},showEmailIcon:{type:Boolean,default:!1}},setup(n){return(e,i)=>{const r=Ow;return t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass({"flex flex-row items-center gap-1":n.showEmailIcon})},[n.showEmailIcon?(t.openBlock(),t.createBlock(r,{key:0})):t.createCommentVNode("",!0),t.createElementVNode("a",{href:`mailto:${n.email}`,class:"no-underline"},t.toDisplayString(n.email),9,zw)],2)}}}),Hw={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Ww(n,e){return t.openBlock(),t.createElementBlock("svg",Hw,[...e[0]||(e[0]=[t.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 rf=t.markRaw({name:"fa6-brands-viber",render:Ww}),jw={viewBox:"0 0 256 258",width:"1.2em",height:"1.2em"},qw=["id"],Xw=["id"],Yw=["fill"],Uw=["fill"];function Kw(n,e){return t.openBlock(),t.createElementBlock("svg",jw,[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:n.idMap.SVGBRLHCcSy,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[0]||(e[0]=[t.createElementVNode("stop",{offset:"0%","stop-color":"#1FAF38"},null,-1),t.createElementVNode("stop",{offset:"100%","stop-color":"#60D669"},null,-1)])],8,qw),t.createElementVNode("linearGradient",{id:n.idMap.SVGHW6lecxh,x1:"50%",x2:"50%",y1:"100%",y2:"0%"},[...e[1]||(e[1]=[t.createElementVNode("stop",{offset:"0%","stop-color":"#F9F9F9"},null,-1),t.createElementVNode("stop",{offset:"100%","stop-color":"#FFF"},null,-1)])],8,Xw)]),t.createElementVNode("path",{fill:"url(#"+n.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,Yw),t.createElementVNode("path",{fill:"url(#"+n.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,Uw),e[2]||(e[2]=t.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 of=t.markRaw({name:"logos-whatsapp-icon",render:Kw,setup(){const n=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGBRLHCcSy:"uicons-"+n(),SVGHW6lecxh:"uicons-"+n()}}}}),Gw={viewBox:"0 0 256 256",width:"1.2em",height:"1.2em"},Zw=["id"],Qw=["fill"];function Jw(n,e){return t.openBlock(),t.createElementBlock("svg",Gw,[t.createElementVNode("defs",null,[t.createElementVNode("linearGradient",{id:n.idMap.SVGuySfwdaH,x1:"50%",x2:"50%",y1:"0%",y2:"100%"},[...e[0]||(e[0]=[t.createElementVNode("stop",{offset:"0%","stop-color":"#2AABEE"},null,-1),t.createElementVNode("stop",{offset:"100%","stop-color":"#229ED9"},null,-1)])],8,Zw)]),t.createElementVNode("path",{fill:"url(#"+n.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,Qw),e[1]||(e[1]=t.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 sf=t.markRaw({name:"logos-telegram",render:Jw,setup(){return{idMap:{SVGuySfwdaH:"uicons-"+Math.random().toString(36).substr(2,10)}}}}),ex={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function tx(n,e){return t.openBlock(),t.createElementBlock("svg",ex,[...e[0]||(e[0]=[t.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 af=t.markRaw({name:"ion-call",render:tx}),nx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function ix(n,e){return t.openBlock(),t.createElementBlock("svg",nx,[...e[0]||(e[0]=[t.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 rx=t.markRaw({name:"tabler-phone-call",render:ix}),ox={key:0,class:"absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm"},sx=["href"],ax=["href"],lx=["href"],cx=["href"],dx={},ux=t.defineComponent({...dx,__name:"phone",props:{defaultCountry:{},phone:{default:""},showPhoneIcon:{type:Boolean,default:!1}},setup(n){const e=n,i=t.computed(()=>{try{return e.phone?Br.parsePhoneNumberWithError(e.phone,e.defaultCountry):void 0}catch{}return e.phone}),r=t.computed(()=>{var l;return V.isString(i.value)?!1:((l=i.value)==null?void 0:l.isValid())??!1}),o=t.computed(()=>{var l;return V.isString(i.value)?i.value:((l=i.value)==null?void 0:l.format("INTERNATIONAL"))??""}),s=t.computed(()=>{var l;return V.isString(i.value)?i.value:((l=i.value)==null?void 0:l.format("E.164"))??""}),a=t.ref(!1);return(l,c)=>{const d=rx,u=af,f=sf,h=of,p=rf;return t.openBlock(),t.createElementBlock("div",null,[t.createElementVNode("div",{class:t.normalizeClass({"border-xl relative inline-flex items-center rounded px-2":r.value&&a.value,"min-w-10":!0}),onClick:c[0]||(c[0]=m=>a.value=!a.value),onFocusout:c[1]||(c[1]=m=>a.value=!1),onMouseleave:c[2]||(c[2]=m=>a.value=!1)},[t.createElementVNode("div",{class:t.normalizeClass({"flex flex-row items-center gap-1":n.showPhoneIcon})},[n.showPhoneIcon?(t.openBlock(),t.createBlock(d,{key:0})):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.value),1)],2),r.value&&a.value?(t.openBlock(),t.createElementBlock("div",ox,[r.value?(t.openBlock(),t.createElementBlock("a",{key:0,href:`tel:${s.value}`,class:"text-blue-600 hover:animate-pulse hover:text-blue-600"},[t.createVNode(u)],8,sx)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock("a",{key:1,href:`https://t.me/${s.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[t.createVNode(f)],8,ax)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock("a",{key:2,href:`https://wa.me/${s.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:animate-pulse"},[t.createVNode(h)],8,lx)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock("a",{key:3,href:`viber://chat?number=${s.value}`,class:"text-purple-600 hover:animate-pulse hover:text-purple-600"},[t.createVNode(p)],8,cx)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],34)])}}}),fx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function hx(n,e){return t.openBlock(),t.createElementBlock("svg",fx,[...e[0]||(e[0]=[t.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 mx=t.markRaw({name:"mdi-envelope",render:hx}),px={class:"flex flex-col gap-1"},gx={key:0,class:"mb-2 flex flex-col text-base"},yx={key:0,class:"text-sc-dark-grey text-sm"},bx={key:1,class:"whitespace-nowrap text-sm"},_x={key:2,class:"whitespace-nowrap text-sm"},wx={key:3,class:"absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm"},xx=["href"],kx=["href"],Cx=["href"],vx=["href"],Sx=["href"],Bx={key:0,class:"flex flex-col text-base"},Nx={key:0,class:"text-sc-dark-grey text-sm"},Tx={key:1,class:"mt-2 text-sm"},$x={key:0,class:"-mt-1"},Ex={},Rx=t.defineComponent({...Ex,__name:"person-contacts-block",props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:""},styles:{default:void 0}},setup(n){const e=n,i=t.computed(()=>li.getFormatEntityName(e.contact)),r=t.computed(()=>{try{return e.contact.phone?Br.parsePhoneNumberWithError(e.contact.phone,e.defaultCountry):void 0}catch{}return e.contact.phone}),o=t.computed(()=>{var d;return V.isString(r.value)?!1:((d=r.value)==null?void 0:d.isValid())??!1}),s=t.computed(()=>{var d;return V.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("INTERNATIONAL"))??""}),a=t.computed(()=>{var d;return V.isString(r.value)?r.value:((d=r.value)==null?void 0:d.format("E.164"))??""}),l=t.computed(()=>o.value||e.contact.email),c=t.ref(!1);return(d,u)=>{var y,_;const f=af,h=sf,p=of,m=rf,g=mx,b=I.NPopover;return t.openBlock(),t.createElementBlock("div",px,[t.createVNode(b,{disabled:n.fullView,placement:"bottom"},{trigger:t.withCtx(()=>{var x,w,C,N;return[t.createElementVNode("div",{class:t.normalizeClass(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${(x=n.contact)!=null&&x.isPrimary?"ring-1 ring-inset ring-green-600 hover:ring-gray-200":""} ${n.classes}`),style:t.normalizeStyle(n.styles),onMouseenter:u[0]||(u[0]=k=>c.value=!0),onFocusin:u[1]||(u[1]=k=>c.value=!0),onMouseleave:u[2]||(u[2]=k=>c.value=!1),onFocusout:u[3]||(u[3]=k=>c.value=!1)},[t.createElementVNode("div",null,[n.fullView&&(n.contact.name||(w=n.contact)!=null&&w.position)?(t.openBlock(),t.createElementBlock("div",gx,[t.createTextVNode(t.toDisplayString(i.value)+" ",1),(C=n.contact)!=null&&C.position?(t.openBlock(),t.createElementBlock("span",yx,t.toDisplayString((N=n.contact)==null?void 0:N.position),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),n.contact.phone?(t.openBlock(),t.createElementBlock("div",bx,t.toDisplayString(s.value),1)):t.createCommentVNode("",!0),n.contact.email?(t.openBlock(),t.createElementBlock("div",_x,t.toDisplayString(n.contact.email),1)):t.createCommentVNode("",!0),l.value&&c.value?(t.openBlock(),t.createElementBlock("div",wx,[o.value?(t.openBlock(),t.createElementBlock("a",{key:0,href:`tel:${a.value}`,class:"text-blue-600 hover:text-3xl hover:text-blue-600"},[t.createVNode(f)],8,xx)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("a",{key:1,href:`https://t.me/${a.value}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[t.createVNode(h)],8,kx)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("a",{key:2,href:`https://wa.me/${a.value.substring(1)}`,target:"_blank",rel:"noopener noreferrer",class:"hover:text-3xl"},[t.createVNode(p)],8,Cx)):t.createCommentVNode("",!0),o.value?(t.openBlock(),t.createElementBlock("a",{key:3,href:`viber://chat?number=${a.value}`,class:"text-purple-600 hover:text-3xl hover:text-purple-600"},[t.createVNode(m)],8,vx)):t.createCommentVNode("",!0),n.contact.email?(t.openBlock(),t.createElementBlock("a",{key:4,href:`mailto:${n.contact.email}`,class:"hover:text-3xl"},[t.createVNode(g)],8,Sx)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])],38)]}),default:t.withCtx(()=>{var x,w,C,N;return[n.contact.name?(t.openBlock(),t.createElementBlock("div",Bx,[t.createTextVNode(t.toDisplayString(i.value)+" ",1),(x=n.contact)!=null&&x.position?(t.openBlock(),t.createElementBlock("span",Nx,t.toDisplayString((w=n.contact)==null?void 0:w.position),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0),(C=n.contact)!=null&&C.comment?(t.openBlock(),t.createElementBlock("div",Tx,[u[4]||(u[4]=t.createElementVNode("sup",null,"**",-1)),t.createTextVNode(" "+t.toDisplayString((N=n.contact)==null?void 0:N.comment),1)])):t.createCommentVNode("",!0)]}),_:1},8,["disabled"]),n.fullView&&((y=n.contact)!=null&&y.comment)?(t.openBlock(),t.createElementBlock("div",$x,[u[5]||(u[5]=t.createElementVNode("sup",null,"**",-1)),t.createTextVNode(" "+t.toDisplayString((_=n.contact)==null?void 0:_.comment),1)])):t.createCommentVNode("",!0)])}}});class Px{constructor(e){B(this,"minHeight");B(this,"maxHeights");B(this,"minWidth");B(this,"maxWidths");B(this,"netType");B(this,"color");B(this,"mountType");B(this,"descriptions");B(this,"crossbarCount");B(this,"heightOverlaps");B(this,"widthOverlaps");B(this,"canSetDopProdaga");this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=Ns.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=Ns.objectToSnake(e.heightOverlaps),this.widthOverlaps=Ns.objectToSnake(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}}function Fx(n){var e;return((e=n.properties)==null?void 0:e.configurator)!==W.ConfiguratorsEnum.SandwichM2?!0:n.properties.configuratorSettings!==void 0&&V.isArray(n.products)&&n.products.length>0}const Vx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mx(n,e){return t.openBlock(),t.createElementBlock("svg",Vx,[...e[0]||(e[0]=[t.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 Ix=t.markRaw({name:"mdi-dots-horizontal",render:Mx}),Ax={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ox(n,e){return t.openBlock(),t.createElementBlock("svg",Ax,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5A6.5 6.5 0 0 0 9.5 3A6.5 6.5 0 0 0 3 9.5A6.5 6.5 0 0 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5l1.5-1.5zm-6 0C7 14 5 12 5 9.5S7 5 9.5 5S14 7 14 9.5S12 14 9.5 14M7 9h5v1H7z"},null,-1)])])}const zx=t.markRaw({name:"mdi-magnify-minus-outline",render:Ox}),Dx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Lx(n,e){return t.openBlock(),t.createElementBlock("svg",Dx,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"m15.5 14l5 5l-1.5 1.5l-5-5v-.79l-.27-.28A6.47 6.47 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27zm-6 0C12 14 14 12 14 9.5S12 5 9.5 5S5 7 5 9.5S7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z"},null,-1)])])}const Hx=t.markRaw({name:"mdi-magnify-plus-outline",render:Lx}),Wx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function jx(n,e){return t.openBlock(),t.createElementBlock("svg",Wx,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z"},null,-1)])])}const lf=t.markRaw({name:"mdi-chevron-right",render:jx}),qx={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Xx(n,e){return t.openBlock(),t.createElementBlock("svg",qx,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z"},null,-1)])])}const cf=t.markRaw({name:"mdi-chevron-left",render:Xx}),Yx={heightMedium:"40px",paddingMedium:"0 16px",borderRadiusMedium:"10px",fontSizeMedium:"14px",iconSizeMedium:"18px",iconMarginMedium:"8px",border:"1px solid #d1d5db",borderHover:"1px solid #9ca3af",borderPressed:"1px solid #9ca3af",borderFocus:"1px solid #9ca3af"},Lr={heightSmall:"36px",paddingSmall:"0 10px",borderRadiusSmall:"8px",iconSizeSmall:"18px",border:"1px solid #d1d5db",borderHover:"1px solid #9ca3af",borderPressed:"1px solid #9ca3af",borderFocus:"1px solid #9ca3af"},df="date-range.dialog.mode",uf="date-range.dialog.scale",ff="date-range.quick-periods",hf=["thisMonth","lastMonth","thisQuarter","lastQuarter","thisYear","lastYear","fromBeginningOfThisYear"],mf=["Янв","Фев","Мар","Апр","Май","Июн","Июл","Авг","Сен","Окт","Ноя","Дек"],Ux=["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь"],Kx=["Пн","Вт","Ср","Чт","Пт","Сб","Вс"],pf=new Date(2e3,0,1),Ri=n=>Be.differenceInCalendarDays(n,pf),gf=n=>Be.addDays(pf,n),yf=(n,e,i)=>{let r=n??void 0,o=e??void 0;return r&&o&&r>o&&(i!=null&&i.from?o=r:i!=null&&i.to?r=o:[r,o]=[o,r]),{from:r?Be.startOfDay(r):void 0,to:o?Be.endOfDay(o):void 0}},Aa=n=>Object.entries(n).map(([e,i])=>({value:e,label:i.label,item:i})),bf=(n,e)=>{const i=Object.entries(n).filter(([,r])=>r.group===e);return e!=="other"?[{type:"group",key:e,children:Aa(Object.fromEntries(i))}]:W.STANDARD_PERIOD_SECTIONS.map(r=>{const o=i.filter(([,s])=>s.section===r.key);return{type:"group",key:r.key,label:r.label,children:Aa(Object.fromEntries(o))}}).filter(r=>r.children.length>0)},_f=(n,e)=>{const i=t.ref(null),r=t.ref(null),o=t.ref(!1),s=t.ref(null),a=(g,b)=>g<=b?[g,b]:[b,g],l=t.computed(()=>o.value&&r.value!==null&&s.value!==null?a(r.value,s.value):i.value!==null?s.value===null?[i.value,i.value]:a(i.value,s.value):n.value),c=(g,b)=>{i.value=null,e(...a(g,b))},d=g=>{i.value===null?(i.value=g,e(g,g)):c(i.value,g)},u=()=>{globalThis.removeEventListener("pointerup",u);const g=r.value;if(g!==null){if(r.value=null,o.value){o.value=!1,s.value!==null&&c(g,s.value);return}d(g)}},f=g=>{r.value=g,o.value=!1,globalThis.addEventListener("pointerup",u)},h=g=>{s.value=g,r.value!==null&&g!==r.value&&(o.value=!0)},p=()=>{s.value=null},m=g=>{const b=l.value;return!b||g<b[0]||g>b[1]?null:g===b[0]||g===b[1]?"bound":"in-range"};return t.onBeforeUnmount(()=>{globalThis.removeEventListener("pointerup",u)}),{activeRange:l,cellPosition:m,pointerDownHandler:f,pointerEnterHandler:h,pointerLeaveHandler:p,selectHandler:d}},Gx={class:"flex items-center justify-between gap-2"},Zx={class:"flex items-center gap-2"},Qx={class:"text-center font-semibold"},Jx={class:"grid grid-cols-7 gap-0.5 text-center text-xs text-gray-500"},ek={class:"grid grid-cols-7 gap-0.5"},tk=["disabled","onPointerdown","onPointerenter","onKeydown"],nk={},ik=t.defineComponent({...nk,__name:"day-range-grid",props:{from:{},to:{}},emits:["select"],setup(n,{emit:e}){const i=n,r=e,o=42,s=I.useThemeVars(),a=t.computed(()=>({"--sc-primary-color":s.value.primaryColor,"--sc-primary-color-hover":s.value.primaryColorHover,"--sc-primary-color-suppl":s.value.primaryColorSuppl,"--sc-hover-color":s.value.hoverColor})),l=Ue.initRefDependingOnDeviceResolution(1,2,3),c=t.computed(()=>["grid-cols-1","grid-cols-2","grid-cols-3"][l.value-1]),d=y=>Be.subMonths(Be.startOfMonth(y),l.value===3?1:0),u=y=>y&&Be.isValid(y)?y:new Date,f=t.ref(d(u(i.from??i.to))),h=t.computed(()=>{const{from:y,to:_}=i;return!y||!_||!Be.isValid(y)||!Be.isValid(_)?null:[Ri(y),Ri(_)]}),p=_f(h,(y,_)=>{r("select",{from:Be.startOfDay(gf(y)),to:Be.endOfDay(gf(_))})}),m=y=>{const _=Be.subDays(y,(Be.getDay(y)+6)%7);return V.times(o,x=>{const w=Be.addDays(_,x);return{index:Ri(w),day:w.getDate(),isCurrentMonth:Be.isSameMonth(w,y),isToday:Be.isToday(w)}})},g=t.computed(()=>V.times(l.value,y=>{const _=Be.addMonths(f.value,y);return{key:`${_.getFullYear()}-${_.getMonth()}`,title:`${Ux[_.getMonth()]} ${_.getFullYear()}`,cells:m(_)}})),b=y=>{if(!y.isCurrentMonth)return["sc-day--outside"];const _=y.isToday?["sc-day--today"]:[],x=p.cellPosition(y.index);return x&&_.push(`sc-day--${x}`),_};return t.watch(()=>[i.from,i.to],()=>{const y=i.from??i.to;if(!y||!Be.isValid(y))return;const _=`${y.getFullYear()}-${y.getMonth()}`;V.some(g.value,["key",_])||(f.value=d(y))}),(y,_)=>{const x=cf,w=I.NButton,C=lf;return t.openBlock(),t.createElementBlock("div",{class:"flex select-none flex-col gap-3",style:t.normalizeStyle(a.value),onPointerleave:_[2]||(_[2]=(...N)=>t.unref(p).pointerLeaveHandler&&t.unref(p).pointerLeaveHandler(...N))},[t.createElementVNode("div",Gx,[t.createVNode(w,{size:"small","aria-label":"Предыдущий месяц","theme-overrides":t.unref(Lr),onClick:_[0]||(_[0]=N=>f.value=t.unref(Be.subMonths)(f.value,1))},{icon:t.withCtx(()=>[t.createVNode(x)]),_:1},8,["theme-overrides"]),_[3]||(_[3]=t.createElementVNode("span",{class:"text-sm text-gray-600"},"Выберите диапазон на календаре",-1)),t.createElementVNode("div",Zx,[t.renderSlot(y.$slots,"actions",{},void 0,!0),t.createVNode(w,{size:"small","aria-label":"Следующий месяц","theme-overrides":t.unref(Lr),onClick:_[1]||(_[1]=N=>f.value=t.unref(Be.addMonths)(f.value,1))},{icon:t.withCtx(()=>[t.createVNode(C)]),_:1},8,["theme-overrides"])])]),t.createElementVNode("div",{class:t.normalizeClass(["grid gap-3",c.value])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(g.value,N=>(t.openBlock(),t.createElementBlock("div",{key:N.key,class:"flex flex-col gap-1"},[t.createElementVNode("div",Qx,t.toDisplayString(N.title),1),t.createElementVNode("div",Jx,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(Kx),k=>(t.openBlock(),t.createElementBlock("span",{key:k},t.toDisplayString(k),1))),128))]),t.createElementVNode("div",ek,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(N.cells,k=>(t.openBlock(),t.createElementBlock("button",{key:k.index,type:"button",class:t.normalizeClass(["sc-day h-7 rounded border-0 p-0 text-xs",b(k)]),disabled:!k.isCurrentMonth,onPointerdown:t.withModifiers($=>t.unref(p).pointerDownHandler(k.index),["prevent"]),onPointerenter:$=>t.unref(p).pointerEnterHandler(k.index),onKeydown:[t.withKeys(t.withModifiers($=>t.unref(p).selectHandler(k.index),["prevent"]),["enter"]),t.withKeys(t.withModifiers($=>t.unref(p).selectHandler(k.index),["prevent"]),["space"])]},t.toDisplayString(k.day),43,tk))),128))])]))),128))],2),_[4]||(_[4]=t.createStaticVNode('<div class="flex flex-wrap items-center gap-x-6 gap-y-1 text-xs text-gray-700" data-v-a41e813d><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--bound" data-v-a41e813d></i>Дата начала</span><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--in-range" data-v-a41e813d></i>Выбранный период</span><span class="flex items-center gap-2" data-v-a41e813d><i class="sc-legend sc-legend--bound" data-v-a41e813d></i>Дата окончания</span></div>',1))],36)}}}),rk=gn(ik,[["__scopeId","data-v-a41e813d"]]),ok={class:"flex items-center justify-between gap-2"},sk={class:"flex items-center gap-2"},ak={class:"text-center font-semibold"},lk={class:"grid grid-cols-3 gap-2"},ck=["onPointerdown","onPointerenter","onKeydown"],dk={},uk=t.defineComponent({...dk,__name:"month-range-grid",props:{from:{},to:{}},emits:["select"],setup(n,{emit:e}){const i=n,r=e,o=I.useThemeVars(),s=t.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=p=>{const m=new Date().getFullYear();return p&&Be.isValid(p)?p.getFullYear():m},l=t.ref(a(i.from??i.to)),c=Ue.initRefDependingOnDeviceResolution(1,3,3),d=t.computed(()=>c.value===1?[l.value]:[l.value-1,l.value,l.value+1]),u=t.computed(()=>{const{from:p,to:m}=i;return!p||!m||!Be.isValid(p)||!Be.isValid(m)?null:[p.getFullYear()*12+p.getMonth(),m.getFullYear()*12+m.getMonth()]}),f=_f(u,(p,m)=>{r("select",{from:new Date(Math.floor(p/12),p%12,1),to:Be.endOfMonth(new Date(Math.floor(m/12),m%12,1))})}),h=(p,m)=>{const g=f.cellPosition(p*12+m);return g?[`sc-month--${g}`]:[]};return t.watch(()=>[i.from,i.to],()=>{const p=i.from??i.to;if(!p||!Be.isValid(p))return;const m=p.getFullYear();(m<l.value-1||m>l.value+1)&&(l.value=m)}),(p,m)=>{const g=cf,b=I.NButton,y=lf;return t.openBlock(),t.createElementBlock("div",{class:"flex select-none flex-col gap-3",style:t.normalizeStyle(s.value),onPointerleave:m[2]||(m[2]=(..._)=>t.unref(f).pointerLeaveHandler&&t.unref(f).pointerLeaveHandler(..._))},[t.createElementVNode("div",ok,[t.createVNode(b,{size:"small","aria-label":"Предыдущий год","theme-overrides":t.unref(Lr),onClick:m[0]||(m[0]=_=>l.value-=1)},{icon:t.withCtx(()=>[t.createVNode(g)]),_:1},8,["theme-overrides"]),m[3]||(m[3]=t.createElementVNode("span",{class:"text-sm text-gray-600"},"Выберите диапазон месяцев",-1)),t.createElementVNode("div",sk,[t.renderSlot(p.$slots,"actions",{},void 0,!0),t.createVNode(b,{size:"small","aria-label":"Следующий год","theme-overrides":t.unref(Lr),onClick:m[1]||(m[1]=_=>l.value+=1)},{icon:t.withCtx(()=>[t.createVNode(y)]),_:1},8,["theme-overrides"])])]),t.createElementVNode("div",{class:t.normalizeClass(["grid gap-4 sm:gap-6",d.value.length===1?"grid-cols-1":"grid-cols-3"])},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,_=>(t.openBlock(),t.createElementBlock("div",{key:_,class:"flex flex-col gap-2"},[t.createElementVNode("div",ak,t.toDisplayString(_),1),t.createElementVNode("div",lk,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(mf),(x,w)=>(t.openBlock(),t.createElementBlock("button",{key:x,type:"button",class:t.normalizeClass(["sc-month cursor-pointer rounded-lg px-1 py-2.5 text-sm",h(_,w)]),onPointerdown:t.withModifiers(C=>t.unref(f).pointerDownHandler(_*12+w),["prevent"]),onPointerenter:C=>t.unref(f).pointerEnterHandler(_*12+w),onKeydown:[t.withKeys(t.withModifiers(C=>t.unref(f).selectHandler(_*12+w),["prevent"]),["enter"]),t.withKeys(t.withModifiers(C=>t.unref(f).selectHandler(_*12+w),["prevent"]),["space"])]},t.toDisplayString(x),43,ck))),128))])]))),128))],2)],36)}}}),fk=gn(uk,[["__scopeId","data-v-dd09a19d"]]),hk={class:"sc-date-range-sidebar flex flex-col gap-1"},mk={class:"flex items-center justify-center gap-1"},pk={class:"min-w-12 text-center font-semibold"},gk={class:"grid grid-flow-col grid-cols-2 grid-rows-6 gap-1"},yk={},bk=t.defineComponent({...yk,__name:"month-year-sidebar",props:{year:{},month:{}},emits:["update:year","select-month","today"],setup(n,{emit:e}){const i=e;return(r,o)=>{const s=I.NButton;return t.openBlock(),t.createElementBlock("div",hk,[t.createElementVNode("div",mk,[t.createVNode(s,{size:"small",quaternary:"",onClick:o[0]||(o[0]=a=>i("update:year",n.year-1))},{default:t.withCtx(()=>[...o[3]||(o[3]=[t.createTextVNode(" ‹ ",-1)])]),_:1}),t.createElementVNode("span",pk,t.toDisplayString(n.year),1),t.createVNode(s,{size:"small",quaternary:"",onClick:o[1]||(o[1]=a=>i("update:year",n.year+1))},{default:t.withCtx(()=>[...o[4]||(o[4]=[t.createTextVNode(" › ",-1)])]),_:1})]),t.createElementVNode("div",gk,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(mf),(a,l)=>(t.openBlock(),t.createBlock(s,{key:a,size:"small",quaternary:"",type:l===n.month?"primary":"default",onClick:c=>i("select-month",l)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(a),1)]),_:2},1032,["type","onClick"]))),128))]),t.createVNode(s,{size:"small",text:"",type:"info",onClick:o[2]||(o[2]=a=>i("today"))},{default:t.withCtx(()=>[...o[5]||(o[5]=[t.createTextVNode(" Сегодня ",-1)])]),_:1})])}}}),_k={},wf=t.defineComponent({..._k,__name:"date-range-input",props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>W.useBaseConfigStateStore().config.dateFormats.uiDate}},emits:["update:value"],setup(n,{emit:e}){const i=n,r=e,o=Ue.initRefDependingOnDeviceResolution(!0,!1,!1),s=t.ref(null),a=t.ref(!1),l=t.ref(0),c=t.ref(i.value&&Be.isValid(i.value)?i.value:new Date),d=t.computed(()=>{const x=i.value&&Be.isValid(i.value)?i.value:c.value;return x.getFullYear()===c.value.getFullYear()?x.getMonth():null});let u=0;const f=x=>{var w,C;(C=(w=x.target)==null?void 0:w.closest)!=null&&C.call(w,".n-base-clear__clear")&&(u=performance.now())},h=x=>{x&&performance.now()-u<300||(a.value=x,x&&(c.value=i.value&&Be.isValid(i.value)?i.value:new Date))},p=x=>{r("update:value",x===null?null:new Date(x))},m=(x,w)=>{const C=new Date(x,w,1);if(c.value=C,i.value&&Be.isValid(i.value)){const N=Math.min(Be.getDate(i.value),Be.getDaysInMonth(C));r("update:value",new Date(x,w,N));return}l.value+=1,t.nextTick().then(()=>{var N;return(N=s.value)==null?void 0:N.focus()})},g=(x,w)=>{c.value=Be.addYears(Be.addMonths(c.value,x),w)},b=x=>{m(x,c.value.getMonth())},y=x=>{m(c.value.getFullYear(),x)},_=()=>{a.value=!1,r("update:value",new Date)};return(x,w)=>{const C=I.NButton,N=I.NDatePicker;return t.openBlock(),t.createBlock(N,{ref_key:"pickerReference",ref:s,key:l.value,value:i.value?i.value.getTime():null,show:a.value,clearable:n.clearable,disabled:n.disabled,placeholder:n.placeholder,format:n.dateFormat,actions:[],"default-calendar-start-time":c.value.getTime(),type:"date",class:"w-full min-w-0",onMousedownCapture:f,"onUpdate:show":h,"onUpdate:value":p,onNextMonth:w[0]||(w[0]=k=>g(1,0)),onPrevMonth:w[1]||(w[1]=k=>g(-1,0)),onNextYear:w[2]||(w[2]=k=>g(0,1)),onPrevYear:w[3]||(w[3]=k=>g(0,-1))},{footer:t.withCtx(()=>[t.unref(o)?(t.openBlock(),t.createBlock(C,{key:1,size:"small",text:"",type:"info",onClick:_},{default:t.withCtx(()=>[...w[4]||(w[4]=[t.createTextVNode(" Сегодня ",-1)])]),_:1})):(t.openBlock(),t.createBlock(bk,{key:0,year:c.value.getFullYear(),month:d.value,"onUpdate:year":b,onSelectMonth:y,onToday:_},null,8,["year","month"]))]),_:1},8,["value","show","clearable","disabled","placeholder","format","default-calendar-start-time"])}}}),wk={key:0,class:"text-gray-400"},xk={},xf=t.defineComponent({...xk,__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(n,{emit:e}){const i=Ue.initRefDependingOnDeviceResolution(!0,!1,!1),r=e;return(o,s)=>{var a,l;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(["flex w-full min-w-0 gap-1",t.unref(i)?"flex-col":"flex-row items-center"])},[t.createVNode(wf,{value:n.from,clearable:n.clearable,disabled:(a=n.disabled)==null?void 0:a.from,placeholder:n.placeholderFrom,"date-format":n.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"]),t.unref(i)?t.createCommentVNode("",!0):(t.openBlock(),t.createElementBlock("span",wk," – ")),t.createVNode(wf,{value:n.to,clearable:n.clearable,disabled:(l=n.disabled)==null?void 0:l.to,placeholder:n.placeholderTo,"date-format":n.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)}}}),kk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ck(n,e){return t.openBlock(),t.createElementBlock("svg",kk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M7 11h2v2H7zm14-6v14c0 1.11-.89 2-2 2H5a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2M5 7h14V5H5zm14 12V9H5v10zm-4-6v-2h2v2zm-4 0v-2h2v2zm-4 2h2v2H7zm8 2v-2h2v2zm-4 0v-2h2v2z"},null,-1)])])}const vk=t.markRaw({name:"mdi-calendar-month-outline",render:Ck}),Sk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Bk(n,e){return t.openBlock(),t.createElementBlock("svg",Sk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"m16 11.78l4.24-7.33l1.73 1l-5.23 9.05l-6.51-3.75L5.46 19H22v2H2V3h2v14.54L9.5 8z"},null,-1)])])}const Nk=t.markRaw({name:"mdi-chart-line",render:Bk}),Tk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $k(n,e){return t.openBlock(),t.createElementBlock("svg",Tk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M22 21H2V3h2v16h2v-9h4v9h2V6h4v13h2v-5h4z"},null,-1)])])}const Ek=t.markRaw({name:"mdi-chart-bar",render:$k}),Rk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Pk(n,e){return t.openBlock(),t.createElementBlock("svg",Rk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M5 3h1V1h2v2h8V1h2v2h1c1.11 0 2 .89 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 16h14V9H5zM5 7h14V5H5zm12 4v2H7v-2z"},null,-1)])])}const Fk=t.markRaw({name:"mdi-calendar-week-outline",render:Pk}),Vk={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Mk(n,e){return t.openBlock(),t.createElementBlock("svg",Vk,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M19 3h-1V1h-2v2H8V1H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2m0 16H5V9h14zm0-12H5V5h14M7 11h5v5H7"},null,-1)])])}const Ik=t.markRaw({name:"mdi-calendar-today-outline",render:Mk}),Ak={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Ok(n,e){return t.openBlock(),t.createElementBlock("svg",Ak,[...e[0]||(e[0]=[t.createElementVNode("path",{fill:"currentColor",d:"M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m-2 12c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1l-.07 1l2.11 1.63c.19.15.25.42.12.64l-2 3.46c-.12.22-.39.31-.61.22l-2.49-1c-.52.39-1.06.73-1.69.98l-.37 2.65c-.04.24-.25.42-.5.42zm1.25-18l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.52l.37-2.61c1.19-.25 2.24-.89 3.01-1.77l2.43 1.04l.75-1.3l-2.12-1.55c.4-1.17.4-2.44 0-3.61l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4z"},null,-1)])])}const zk=t.markRaw({name:"mdi-cog-outline",render:Ok}),Dk={class:"grid gap-x-6 gap-y-4 pr-3 sm:grid-cols-2"},Lk={class:"font-medium"},Hk={key:0,class:"pt-1 text-xs text-gray-500"},Wk={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},jk={class:"flex items-center gap-3"},qk={class:"text-sm text-gray-600"},Xk={class:"flex gap-2"},Yk={},Uk=t.defineComponent({...Yk,__name:"quick-periods-settings",props:{show:{type:Boolean},selectedKeys:{}},emits:["update:show","save"],setup(n,{emit:e}){const i=n,r=e,o=Ue.initRefDependingOnDeviceResolution("100%","90%","40rem"),s=W.DateTimeProvider.standardPeriods(),a=W.STANDARD_PERIOD_GROUPS.map(u=>({key:u.key,label:u.label,sections:bf(s,u.key)})),l=t.ref([]),c=t.computed(()=>{const u=l.value.length;return`Выбрано: ${u} ${W.pluralize(u,["период","периода","периодов"])}`}),d=()=>{r("save",[...l.value]),r("update:show",!1)};return t.watch(()=>i.show,u=>{u&&(l.value=[...i.selectedKeys])}),(u,f)=>{const h=I.NCheckbox,p=I.NCheckboxGroup,m=I.NScrollbar,g=I.NButton,b=I.NModal;return t.openBlock(),t.createBlock(b,{show:n.show,preset:"card",title:"Настройка быстрого выбора",closable:"",style:t.normalizeStyle({width:t.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":f[4]||(f[4]=y=>r("update:show",y))},{footer:t.withCtx(()=>[t.createElementVNode("div",Wk,[t.createElementVNode("div",jk,[t.createElementVNode("span",qk,t.toDisplayString(c.value),1),t.createVNode(g,{text:"",type:"info",onClick:f[1]||(f[1]=y=>l.value=[...t.unref(hf)])},{default:t.withCtx(()=>[...f[5]||(f[5]=[t.createTextVNode(" По умолчанию ",-1)])]),_:1}),t.createVNode(g,{text:"",type:"info",disabled:l.value.length===0,onClick:f[2]||(f[2]=y=>l.value=[])},{default:t.withCtx(()=>[...f[6]||(f[6]=[t.createTextVNode(" Снять все ",-1)])]),_:1},8,["disabled"])]),t.createElementVNode("div",Xk,[t.createVNode(g,{type:"primary",onClick:d},{default:t.withCtx(()=>[...f[7]||(f[7]=[t.createTextVNode(" Сохранить ",-1)])]),_:1}),t.createVNode(g,{onClick:f[3]||(f[3]=y=>r("update:show",!1))},{default:t.withCtx(()=>[...f[8]||(f[8]=[t.createTextVNode("Отмена",-1)])]),_:1})])])]),default:t.withCtx(()=>[t.createVNode(m,{class:"max-h-[60vh]"},{default:t.withCtx(()=>[t.createVNode(p,{value:l.value,"onUpdate:value":f[0]||(f[0]=y=>l.value=y)},{default:t.withCtx(()=>[t.createElementVNode("div",Dk,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(a),y=>(t.openBlock(),t.createElementBlock("div",{key:y.key,class:"flex flex-col gap-1.5"},[t.createElementVNode("div",Lk,t.toDisplayString(y.label),1),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(y.sections,_=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:_.key},[_.label?(t.openBlock(),t.createElementBlock("div",Hk,t.toDisplayString(_.label),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(_.children,x=>(t.openBlock(),t.createBlock(h,{key:x.value,value:x.value,label:x.label},null,8,["value","label"]))),128))],64))),128))]))),128))])]),_:1},8,["value"])]),_:1})]),_:1},8,["show","style"])}}}),Kk={class:"flex flex-col gap-2"},Gk={class:"flex items-center gap-2"},Zk={class:"flex gap-2 px-px pb-4 pt-px"},Qk={key:0,class:"text-sm text-gray-500"},Jk={},e2=t.defineComponent({...Jk,__name:"quick-periods",props:{from:{},to:{}},emits:["apply","preview"],setup(n,{emit:e}){const i=n,r=e,o=W.DateTimeProvider.standardPeriods(),s=()=>{const f=ff,h=W.PreferencesStorageProvider.getActualDataFromStorage(f);return(V.isArray(h)?h:hf).filter(m=>V.isString(m)&&m in o)},a=t.ref(s()),l=t.ref(!1),c=t.computed(()=>Object.entries(o).filter(([f])=>a.value.includes(f)).map(([f,h])=>({value:f,label:h.label,item:h,group:h.group}))),d=t.computed(()=>{const f=i.from?Ri(i.from):null,h=i.to?Ri(i.to):null;if(f===null||h===null)return null;const p=c.value.find(m=>{const{from:g,to:b}=m.item;return!g||!b?!1:Ri(g)===f&&Ri(b)===h});return p?String(p.value):null}),u=f=>{a.value=f;const h=ff;W.PreferencesStorageProvider.saveActualDataToStorage(h,f,Be.addYears(Be.startOfToday(),1))};return(f,h)=>{const p=zk,m=I.NButton,g=Ik,b=Fk,y=Ek,_=Nk,x=vk,w=I.NScrollbar;return t.openBlock(),t.createElementBlock("div",Kk,[t.createElementVNode("div",Gk,[h[3]||(h[3]=t.createElementVNode("span",{class:"text-sm font-medium text-gray-700"},"Быстрый выбор",-1)),t.createVNode(m,{size:"tiny",quaternary:"",circle:"","aria-label":"Настроить быстрый выбор",onClick:h[0]||(h[0]=C=>l.value=!0)},{icon:t.withCtx(()=>[t.createVNode(p)]),_:1})]),t.createVNode(w,{"x-scrollable":""},{default:t.withCtx(()=>[t.createElementVNode("div",Zk,[c.value.length===0?(t.openBlock(),t.createElementBlock("span",Qk," Периоды не выбраны ")):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(c.value,C=>(t.openBlock(),t.createBlock(m,{key:C.value,type:C.value===d.value?"primary":"default",ghost:C.value===d.value,"theme-overrides":t.unref(Yx),class:"shrink-0",onClick:N=>r("apply",C),onMouseenter:N=>r("preview",C),onMouseleave:h[1]||(h[1]=N=>r("preview"))},{icon:t.withCtx(()=>[C.group==="day"?(t.openBlock(),t.createBlock(g,{key:0})):C.group==="week"||C.group==="decade"?(t.openBlock(),t.createBlock(b,{key:1})):C.group==="quarter"||C.group==="halfYear"?(t.openBlock(),t.createBlock(y,{key:2})):C.group==="other"?(t.openBlock(),t.createBlock(_,{key:3})):(t.openBlock(),t.createBlock(x,{key:4}))]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(C.label),1)]),_:2},1032,["type","ghost","theme-overrides","onClick","onMouseenter"]))),128))])]),_:1}),t.createVNode(Uk,{show:l.value,"onUpdate:show":h[2]||(h[2]=C=>l.value=C),"selected-keys":a.value,onSave:u},null,8,["show","selected-keys"])])}}}),t2={class:"flex flex-col items-stretch gap-3 sm:flex-row"},n2={class:"order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm"},i2={class:"flex flex-col items-stretch pr-3"},r2={key:0,class:"px-2 pb-0.5 pt-2 text-xs text-gray-400"},o2={key:1,class:"order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm"},s2={},a2=t.defineComponent({...s2,__name:"standard-periods",props:{activeKey:{},customPeriods:{}},emits:["apply","preview"],setup(n,{emit:e}){const i=n,r=e,o="custom",s=Ue.initRefDependingOnDeviceResolution(!0,!1,!1),a=W.DateTimeProvider.standardPeriods(),l=t.ref(W.STANDARD_PERIOD_GROUPS[0].key),c=t.computed(()=>{const u=W.STANDARD_PERIOD_GROUPS.map(f=>({key:f.key,value:f.key,label:f.label}));return V.isEmpty(i.customPeriods)||u.push({key:o,value:o,label:"Пользовательские"}),u}),d=t.computed(()=>l.value===o?[{type:"group",key:o,children:Aa(i.customPeriods??{})}]:bf(a,l.value));return(u,f)=>{const h=I.NButton,p=I.NScrollbar,m=I.NSelect,g=I.NMenu;return t.openBlock(),t.createElementBlock("div",t2,[t.createElementVNode("div",n2,[t.createVNode(p,{class:"max-h-96"},{default:t.withCtx(()=>[t.createElementVNode("div",i2,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(d.value,b=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:b.key},[b.label?(t.openBlock(),t.createElementBlock("div",r2,t.toDisplayString(b.label),1)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(b.children,y=>(t.openBlock(),t.createBlock(h,{key:y.value,size:"small",quaternary:"",type:y.value===n.activeKey?"primary":"default",class:"justify-start",onClick:_=>r("apply",y),onMouseenter:_=>r("preview",y),onMouseleave:f[0]||(f[0]=_=>r("preview"))},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(y.label),1)]),_:2},1032,["type","onClick","onMouseenter"]))),128))],64))),128))])]),_:1})]),t.unref(s)?(t.openBlock(),t.createBlock(m,{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"])):(t.openBlock(),t.createElementBlock("div",o2,[t.createVNode(g,{value:l.value,options:c.value,mode:"vertical","onUpdate:value":f[2]||(f[2]=b=>l.value=b)},null,8,["value","options"])]))])}}}),l2={class:"flex flex-col gap-3"},c2={class:"flex flex-col gap-1 sm:flex-row sm:items-center"},d2={key:1,class:"overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3"},u2={class:"flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center"},f2={class:"flex gap-2"},h2={},m2=t.defineComponent({...h2,__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(n,{emit:e}){const i=n,r=e,o=Ue.initRefDependingOnDeviceResolution("100%","90%","48rem"),s=t.ref("custom"),a=t.ref("months"),l=t.computed(()=>a.value==="months"?"Показать по дням":"Показать по месяцам"),c=()=>W.PreferencesStorageProvider.getActualDataFromStorage(df)==="standard"?"standard":"custom",d=()=>W.PreferencesStorageProvider.getActualDataFromStorage(uf)==="days"?"days":"months",u=(v,E)=>{W.PreferencesStorageProvider.saveActualDataToStorage(v,E,Be.addYears(Be.startOfToday(),1))},f=t.ref({}),h=t.ref(null),p=t.ref(null),m=t.computed(()=>h.value??f.value),g=(v,E)=>{var R,M;const P=(R=i.disabled)!=null&&R.from?f.value.from:v,F=(M=i.disabled)!=null&&M.to?f.value.to:E;h.value=null,f.value=yf(P,F,i.disabled)},b=v=>{p.value=null,g(v,f.value.to)},y=v=>{p.value=null,g(f.value.from,v)},_=()=>{p.value=null,g(null,null)},x=v=>{p.value=null,g(v.from,v.to)},w=v=>{const E=v.item;g(E.from,E.to),p.value=String(v.value)},C=v=>{const E=v==null?void 0:v.item;h.value=E?{from:E.from,to:E.to}:null},N=()=>{h.value=null,s.value=s.value==="custom"?"standard":"custom",u(df,s.value)},k=()=>{a.value=a.value==="months"?"days":"months",u(uf,a.value)},$=()=>{r("select",f.value),r("update:show",!1)};return t.watch(()=>i.show,v=>{v&&(s.value=c(),a.value=d(),p.value=null,h.value=null,f.value={...i.dateRange})}),(v,E)=>{const P=I.NButton,F=Hx,R=zx,M=I.NTooltip,X=I.NModal;return t.openBlock(),t.createBlock(X,{show:n.show,preset:"card",title:"Выберите период",closable:"",style:t.normalizeStyle({width:t.unref(o),maxWidth:"calc(100vw - 1rem)"}),class:"sc-date-range-dialog","onUpdate:show":E[1]||(E[1]=G=>r("update:show",G))},{footer:t.withCtx(()=>[t.createElementVNode("div",u2,[t.createVNode(P,{text:"",type:"info",onClick:N},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(s.value==="custom"?"Показать стандартные периоды":"Показать произвольный период"),1)]),_:1}),t.createElementVNode("div",f2,[t.createVNode(P,{type:"primary",onClick:$},{default:t.withCtx(()=>[...E[3]||(E[3]=[t.createTextVNode(" Выбрать ",-1)])]),_:1}),t.createVNode(P,{onClick:E[0]||(E[0]=G=>r("update:show",!1))},{default:t.withCtx(()=>[...E[4]||(E[4]=[t.createTextVNode("Отмена",-1)])]),_:1})])])]),default:t.withCtx(()=>[t.createElementVNode("div",l2,[s.value==="custom"?(t.openBlock(),t.createBlock(e2,{key:0,from:f.value.from,to:f.value.to,onApply:w,onPreview:C},null,8,["from","to"])):t.createCommentVNode("",!0),t.createElementVNode("div",c2,[t.createVNode(xf,{from:m.value.from,to:m.value.to,clearable:n.clearable,disabled:n.disabled,"date-format":n.dateFormat,class:"flex-1","onUpdate:from":b,"onUpdate:to":y},null,8,["from","to","clearable","disabled","date-format"]),n.clearable?(t.openBlock(),t.createBlock(P,{key:0,text:"",type:"info",class:"sm:ml-2",onClick:_},{default:t.withCtx(()=>[...E[2]||(E[2]=[t.createTextVNode(" Очистить период ",-1)])]),_:1})):t.createCommentVNode("",!0)]),s.value==="custom"?(t.openBlock(),t.createElementBlock("div",d2,[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.value==="months"?fk:rk),{from:f.value.from,to:f.value.to,onSelect:x},{actions:t.withCtx(()=>[t.createVNode(M,{placement:"top",trigger:"hover"},{trigger:t.withCtx(()=>[t.createVNode(P,{size:"small","aria-label":l.value,"theme-overrides":t.unref(Lr),onClick:k},{icon:t.withCtx(()=>[a.value==="months"?(t.openBlock(),t.createBlock(F,{key:0})):(t.openBlock(),t.createBlock(R,{key:1}))]),_:1},8,["aria-label","theme-overrides"])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(l.value),1)]),_:1})]),_:1},40,["from","to"]))])):(t.openBlock(),t.createBlock(a2,{key:2,"active-key":p.value,"custom-periods":n.customPeriods,onApply:w,onPreview:C},null,8,["active-key","custom-periods"]))])]),_:1},8,["show","style"])}}}),p2={class:"flex w-full min-w-0 items-center gap-1"},g2={},y2=t.defineComponent({...g2,__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(n,{emit:e}){const i=n,r=e,o=t.ref(!1),s=t.computed(()=>{const u={...i.useDefaultPredefinedDateRanges?W.DateTimeProvider.defaultDateRanges():{},...i.predefinedDateRanges};return V.isEmpty(u)?void 0:u}),a=(u,f)=>{r("update:date-range",yf(u,f,i.disabled))},l=u=>{var f;a(u,(f=i.dateRange)==null?void 0:f.to)},c=u=>{var f;a((f=i.dateRange)==null?void 0:f.from,u)},d=u=>{a(u.from,u.to)};return(u,f)=>{var m,g,b,y;const h=Ix,p=I.NButton;return t.openBlock(),t.createElementBlock("div",p2,[t.createVNode(xf,{from:(m=n.dateRange)==null?void 0:m.from,to:(g=n.dateRange)==null?void 0:g.to,clearable:n.clearable,disabled:n.disabled,"placeholder-from":n.placeholderFrom,"placeholder-to":n.placeholderTo,"date-format":n.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"]),t.createVNode(p,{disabled:!!((b=n.disabled)!=null&&b.from&&((y=n.disabled)!=null&&y.to)),title:"Выбрать период","aria-label":"Выбрать период",onClick:f[0]||(f[0]=_=>o.value=!0)},{default:t.withCtx(()=>[t.createVNode(h)]),_:1},8,["disabled"]),t.createVNode(m2,{show:o.value,"onUpdate:show":f[1]||(f[1]=_=>o.value=_),"date-range":n.dateRange,clearable:n.clearable,disabled:n.disabled,"custom-periods":s.value,"date-format":n.dateFormat,onSelect:d},null,8,["show","date-range","clearable","disabled","custom-periods","date-format"])])}}}),b2={class:"sc-lbl-date text-nowrap"},_2={},es=t.defineComponent({..._2,__name:"date-time-label",props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(n){const e=n,i=t.computed(()=>Be.format(e.date,W.useBaseConfigStateStore().config.dateFormats.uiDate)),r=t.computed(()=>Be.format(e.date,"HH:mm"));return(o,s)=>(t.openBlock(),t.createElementBlock("span",{class:t.normalizeClass({"flex flex-col":n.isTimeOnSecondLine})},[t.createElementVNode("span",b2,t.toDisplayString(i.value),1),n.isShowTime?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([{"text-sc-grey":n.isTimeSecondary,"ml-1":!n.isTimeOnSecondLine},"sc-lbl-time"])},t.toDisplayString(r.value),3)):t.createCommentVNode("",!0)],2))}}),w2={},x2=t.defineComponent({...w2,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(n){const e=n,i=t.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>n.debt!==0?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass({"text-sm":n.wrapAsSmall})},[t.createTextVNode(t.toDisplayString(i.value)+" ",1),t.createElementVNode("span",{class:t.normalizeClass({"text-green-700":n.debt>0,"text-red-700":n.debt<0})},t.toDisplayString(n.debt)+" ₽ ",3)],2)):t.createCommentVNode("",!0)}}),k2={class:"flex flex-row gap-2.5"},C2={class:"flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap"},v2={class:"flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row"},S2={class:"mb-0.5 sm:mb-0 sm:ml-3"},B2={},N2=t.defineComponent({...B2,__name:"dialog-header",props:{showCloseButton:{type:Boolean,default:!0}},emits:["close"],setup(n){return(e,i)=>{const r=Jo,o=I.NButton,s=I.NPopover;return t.openBlock(),t.createElementBlock("div",k2,[t.createElementVNode("div",C2,[t.renderSlot(e.$slots,"main")]),t.createElementVNode("div",null,[t.createElementVNode("div",v2,[t.renderSlot(e.$slots,"extra-buttons"),t.createElementVNode("div",S2,[n.showCloseButton?(t.openBlock(),t.createBlock(s,{key:0,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(o,{size:"small",type:"error",onClick:i[0]||(i[0]=a=>e.$emit("close"))},{default:t.withCtx(()=>[t.createVNode(r)]),_:1})]),default:t.withCtx(()=>[i[1]||(i[1]=t.createTextVNode(" Закрыть ",-1))]),_:1})):t.createCommentVNode("",!0)])])])])}}}),T2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function $2(n,e){return t.openBlock(),t.createElementBlock("svg",T2,[...e[0]||(e[0]=[t.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 E2=t.markRaw({name:"ion-checkmark-done-sharp",render:$2}),R2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function P2(n,e){return t.openBlock(),t.createElementBlock("svg",R2,[...e[0]||(e[0]=[t.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),t.createElementVNode("circle",{cx:"336",cy:"128",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),t.createElementVNode("circle",{cx:"176",cy:"256",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),t.createElementVNode("circle",{cx:"336",cy:"384",r:"32",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1)])])}const F2=t.markRaw({name:"ion-options-outline",render:P2}),V2={class:"flex flex-row gap-x-2.5 p-0 sm:p-1"},M2={class:"flex-auto"},I2={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"},A2={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"},O2={},Oa=t.defineComponent({...O2,__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(n,{emit:e}){const i=e,r=t.ref(!1),o=()=>{i("edit")},s=()=>{r.value=!1},a=()=>{r.value=!0,i("apply",s)},l=()=>{i("cancel",s)};return(c,d)=>{const u=F2,f=I.NButton,h=I.NPopover,p=E2,m=Jo;return t.openBlock(),t.createElementBlock("div",V2,[t.createElementVNode("div",M2,[t.renderSlot(c.$slots,"default")]),t.createElementVNode("div",null,[t.createElementVNode("div",I2,[t.createElementVNode("div",A2,[n.showEditButton?(t.openBlock(),t.createBlock(h,{key:0,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(f,{disabled:n.disabled||r.value,type:"info",ghost:"",size:"small",onClick:o},{default:t.withCtx(()=>[t.createVNode(u)]),_:1},8,["disabled"])]),default:t.withCtx(()=>[d[0]||(d[0]=t.createTextVNode(" Редактировать данные ",-1))]),_:1})):t.createCommentVNode("",!0),n.showApplyButton?(t.openBlock(),t.createBlock(h,{key:1,disabled:r.value,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(f,{disabled:n.disabled||r.value,type:"primary",size:"small",onClick:a},{default:t.withCtx(()=>[t.createVNode(p)]),_:1},8,["disabled"])]),default:t.withCtx(()=>[d[1]||(d[1]=t.createTextVNode(" Сохранить изменения ",-1))]),_:1},8,["disabled"])):t.createCommentVNode("",!0),n.showCancelButton?(t.openBlock(),t.createBlock(h,{key:2,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(f,{disabled:n.disabled||r.value,type:"error",size:"small",onClick:l},{default:t.withCtx(()=>[t.createVNode(m)]),_:1},8,["disabled"])]),default:t.withCtx(()=>[d[2]||(d[2]=t.createTextVNode(" Отменить изменения ",-1))]),_:1})):t.createCommentVNode("",!0)]),t.renderSlot(c.$slots,"extra-buttons")])])])}}}),z2={},kf=t.defineComponent({...z2,__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(n,{emit:e}){const i=n,r=e,o=t.ref(i.showEditor),s=l=>{r("editor:apply",d=>{o.value=!d,l()})},a=l=>{o.value=!1,l(),r("editor:cancel")};return t.onMounted(()=>{t.watch(()=>i.showEditor,l=>{o.value=l})}),(l,c)=>(t.openBlock(),t.createElementBlock("div",null,[o.value?(t.openBlock(),t.createBlock(Oa,{key:1,disabled:n.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:s,onCancel:a},{"extra-buttons":t.withCtx(()=>[t.renderSlot(l.$slots,"extra-editor-buttons")]),default:t.withCtx(()=>[t.renderSlot(l.$slots,"editor")]),_:3},8,["disabled"])):(t.openBlock(),t.createBlock(Oa,{key:0,disabled:n.disabled,"show-edit-button":n.showEditButton,onEdit:c[0]||(c[0]=d=>o.value=!0)},{"extra-buttons":t.withCtx(()=>[t.renderSlot(l.$slots,"extra-viewer-buttons")]),default:t.withCtx(()=>[t.renderSlot(l.$slots,"viewer")]),_:3},8,["disabled","show-edit-button"]))]))}}),D2={key:0,class:"whitespace-pre-line"},L2={key:1,class:"text-sc-dark-grey"},H2={},W2=t.defineComponent({...H2,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(n,{emit:e}){const i=n,r=e,o=t.ref(i.comment);t.watch(()=>o.value,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=i.comment};return(l,c)=>{const d=I.NInput;return t.openBlock(),t.createBlock(kf,{disabled:n.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:t.withCtx(()=>[t.createElementVNode("div",null,[n.comment?(t.openBlock(),t.createElementBlock("span",D2,t.toDisplayString(n.comment),1)):(t.openBlock(),t.createElementBlock("span",L2," - Комментарий отсутствует - "))])]),editor:t.withCtx(()=>[t.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"])}}}),j2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function q2(n,e){return t.openBlock(),t.createElementBlock("svg",j2,[...e[0]||(e[0]=[t.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),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m176 272l80 80l80-80M256 48v288"},null,-1)])])}const X2=t.markRaw({name:"ion-download-outline",render:q2}),Y2={},U2=t.defineComponent({...Y2,__name:"single-file-upload-selector",props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:["update:file"],setup(n,{emit:e}){const i=n,r=e,o=t.ref([]),s=t.computed(()=>o.value.map(l=>(l.status=i.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=X2;return t.openBlock(),t.createBlock(t.unref(I.NUpload),{"file-list":s.value,"default-upload":!1,max:1,"show-retry-button":!1,action:"",accept:n.accept,"directory-dnd":"",class:"content-center","onUpdate:fileList":a},{default:t.withCtx(()=>[t.createVNode(t.unref(I.NUploadDragger),null,{default:t.withCtx(()=>[t.renderSlot(l.$slots,"dragged-area",{},()=>[t.createElementVNode("div",null,[t.createVNode(d,{class:"text-2xl"}),t.createElementVNode("div",null,t.toDisplayString(n.draggedAreaText??"Перетащите в эту область файл, который необходимо загрузить."),1)])])]),_:3})]),_:3},8,["file-list","accept"])}}}),K2={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function G2(n,e){return t.openBlock(),t.createElementBlock("svg",K2,[...e[0]||(e[0]=[t.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 Z2=t.markRaw({name:"ion-warning",render:G2}),Q2={},J2=t.defineComponent({...Q2,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(n){return(e,i)=>{const r=Z2,o=I.NPopover;return t.openBlock(),t.createBlock(o,{disabled:n.popoverText.length===0,placement:"bottom"},{trigger:t.withCtx(()=>[t.createVNode(r,{class:t.normalizeClass(`ml-0.5 ${n.iconClass}`)},null,8,["class"])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(n.popoverText),1)]),_:1},8,["disabled"])}}}),eC={},tC=t.defineComponent({...eC,__name:"debounced-input",props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:""}},emits:["update:value"],setup(n,{emit:e}){const i=n,r=e,o=t.ref(i.value),s=t.computed(()=>t.inject("debounce-input-time",i.debounceTime)),a=V.debounce(()=>r("update:value",o.value),s.value),l=c=>{o.value=c,a()};return t.watch(()=>i.value,c=>{o.value=c}),(c,d)=>(t.openBlock(),t.createBlock(t.unref(I.NInput),{value:o.value,"onUpdate:value":[d[0]||(d[0]=u=>o.value=u),l],clearable:n.clearable,placeholder:n.placeholder},{prefix:t.withCtx(()=>[t.renderSlot(c.$slots,"prefix")]),_:3},8,["value","clearable","placeholder"]))}}),nC={},iC=t.defineComponent({...nC,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.ref(r.value),a=t.computed(()=>t.inject("debounce-input-time",r.debounceTime)),l=V.debounce(()=>o("update:value",s.value),a.value),c=p=>{s.value=p,l()};t.watch(()=>r.value,p=>{s.value=p});const d=t.ref(null);return e({focus:()=>{var p;return(p=d.value)==null?void 0:p.focus()},blur:()=>{var p;return(p=d.value)==null?void 0:p.blur()},select:()=>{var p;return(p=d.value)==null?void 0:p.select()}}),(p,m)=>(t.openBlock(),t.createBlock(t.unref(I.NInputNumber),{ref_key:"inputReference",ref:d,value:s.value??null,clearable:n.clearable,parse:n.parse,"show-button":n.showButton,placeholder:n.placeholder,min:n.min,max:n.max,step:n.step,validator:n.validator,"onUpdate:value":c,onKeydown:m[0]||(m[0]=g=>o("keydown",g)),onInput:m[1]||(m[1]=g=>o("input",g)),onFocus:m[2]||(m[2]=g=>o("focus",g))},{prefix:t.withCtx(()=>[t.renderSlot(p.$slots,"prefix")]),_:3},8,["value","clearable","parse","show-button","placeholder","min","max","step","validator"]))}}),rC={},oC=t.defineComponent({...rC,__name:"phone-input",props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:["update:value"],setup(n,{emit:e}){const i=n,r=e,o=t.ref((i.value??"").replaceAll(/\D*/g,"")),s=V.debounce(c=>r("update:value",c),i.debounceTime??0),a=c=>{let d="";if(V.isString(c))o.value=c,d=c.replaceAll(/(\s|\(|\)|-|_)*/g,"");else if(V.isObject(c)){if(o.value=c.formatted,!c.valid)return;d=c instanceof Br.PhoneNumber?c.format("E.164"):`+${c.countryCallingCode}${c.nationalNumber}`}i.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 t.watch(()=>i.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}),t.onBeforeMount(()=>l(o.value??"")),(c,d)=>(t.openBlock(),t.createBlock(t.unref(Pm.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[d[0]||(d[0]=u=>o.value=u),a],"auto-default-country":!1,"auto-format":!0,"default-country":n.defaultCountry,disabled:n.disabled,"input-options":{placeholder:n.placeholder},"preferred-countries":n.preferredCountries,"only-countries":n.onlyCountries,mode:"international",class:"tel-input"},null,8,["modelValue","default-country","disabled","input-options","preferred-countries","only-countries"]))}}),sC=gn(oC,[["__scopeId","data-v-751dbb0e"]]),aC={class:"mb-7 grid grid-cols-2 gap-3.5 lg:grid-cols-4"},lC={class:"mb-2 text-[11.5px] font-semibold uppercase text-gray-500"},cC={},dC=t.defineComponent({...cC,__name:"kpi-grid",props:{items:{},isLoading:{type:Boolean}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",aC,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.items,r=>(t.openBlock(),t.createElementBlock("div",{key:r.label,class:"rounded-lg border border-solid border-gray-200 px-4 py-4"},[t.createElementVNode("div",lC,t.toDisplayString(r.label),1),t.createElementVNode("div",{class:t.normalizeClass(["text-[25px] font-bold",r.valueClass])},t.toDisplayString(n.isLoading?"…":r.value),3),t.createElementVNode("div",{class:t.normalizeClass(["mt-1.5 text-xs font-medium",r.noteClass])},t.toDisplayString(r.note),3)]))),128))]))}}),uC={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function fC(n,e){return t.openBlock(),t.createElementBlock("svg",uC,[...e[0]||(e[0]=[t.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 hC=t.markRaw({name:"tabler-external-link",render:fC}),mC={class:"flex flex-row gap-1 hover:underline hover:decoration-dashed"},pC=["href"],gC={},yC=t.defineComponent({...gC,__name:"external-link",props:{text:{},url:{},description:{}},setup(n){return(e,i)=>{const r=hC,o=I.NTooltip;return t.openBlock(),t.createBlock(o,{disabled:t.unref(V.isUndefined)(n.description),placement:"top-start"},{trigger:t.withCtx(()=>[t.createElementVNode("span",mC,[t.createElementVNode("a",{href:n.url,target:"_blank",class:"no-underline"},t.toDisplayString(n.text),9,pC),t.createVNode(r,{class:"mt-0.5 flex-none"})])]),default:t.withCtx(()=>[t.createTextVNode(" "+t.toDisplayString(n.description),1)]),_:1},8,["disabled"])}}}),bC={key:1,class:"h-24"},_C={key:2,class:"flex flex-col gap-3"},wC={},xC=t.defineComponent({...wC,__name:"compact-card-list",props:{isLoading:{type:Boolean},isEmpty:{type:Boolean},emptyDescription:{},pagination:{}},emits:["update:page","update:pageSize"],setup(n,{emit:e}){const i=e,r=[20,50,100];return(o,s)=>(t.openBlock(),t.createBlock(t.unref(I.NSpin),{show:n.isLoading},{default:t.withCtx(()=>[!n.isLoading&&n.isEmpty?(t.openBlock(),t.createBlock(t.unref(I.NEmpty),{key:0,description:n.emptyDescription},null,8,["description"])):n.isLoading&&n.isEmpty?(t.openBlock(),t.createElementBlock("div",bC)):(t.openBlock(),t.createElementBlock("div",_C,[t.renderSlot(o.$slots,"default")])),n.pagination&&n.pagination.itemCount>0?(t.openBlock(),t.createBlock(t.unref(I.NPagination),{key:3,class:"mt-4 flex-wrap justify-center gap-y-2",size:"small",page:n.pagination.page,"page-size":n.pagination.pageSize,"item-count":n.pagination.itemCount,"page-slot":n.pagination.pageSlot,"page-sizes":r,"show-size-picker":!0,prefix:t.unref(Jl),"onUpdate:page":s[0]||(s[0]=a=>i("update:page",a)),"onUpdate:pageSize":s[1]||(s[1]=a=>i("update:pageSize",a))},null,8,["page","page-size","item-count","page-slot","prefix"])):t.createCommentVNode("",!0)]),_:3},8,["show"]))}}),kC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function CC(n,e){return t.openBlock(),t.createElementBlock("svg",kC,[...e[0]||(e[0]=[t.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),t.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M336 256H176"},null,-1)])])}const vC=t.markRaw({name:"ion-remove-circle-outline",render:CC});let ts=[];const Cf=new WeakMap;function SC(){ts.forEach(n=>n(...Cf.get(n))),ts=[]}function vf(n,...e){Cf.set(n,e),!ts.includes(n)&&ts.push(n)===1&&requestAnimationFrame(SC)}function Hr(n,e){let{target:i}=n;for(;i;){if(i.dataset&&i.dataset[e]!==void 0)return!0;i=i.parentElement}return!1}function Wr(n){return n.composedPath()[0]||null}function jr(n){return typeof n=="string"?n.endsWith("px")?Number(n.slice(0,n.length-2)):Number(n):n}function qr(n){if(n!=null)return typeof n=="number"?`${n}px`:n.endsWith("px")?n:`${n}px`}function xn(n,e){const i=n.trim().split(/\s+/g),r={top:i[0]};switch(i.length){case 1:r.right=i[0],r.bottom=i[0],r.left=i[0];break;case 2:r.right=i[1],r.left=i[1],r.bottom=i[0];break;case 3:r.right=i[1],r.bottom=i[2],r.left=i[1];break;case 4:r.right=i[1],r.bottom=i[2],r.left=i[3];break;default:throw new Error("[seemly/getMargin]:"+n+" is not a valid value.")}return e===void 0?r:r[e]}const Sf={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 BC(n,e,i){e/=100,i/=100;let r=(o,s=(o+n/60)%6)=>i-i*e*Math.max(Math.min(s,4-s,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function NC(n,e,i){e/=100,i/=100;let r=e*Math.min(i,1-i),o=(s,a=(s+n/30)%12)=>i-r*Math.max(Math.min(a-3,9-a,1),-1);return[o(0)*255,o(8)*255,o(4)*255]}const Mn="^\\s*",In="\\s*$",mi="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",rn="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",Pi="([0-9A-Fa-f])",Fi="([0-9A-Fa-f]{2})",Bf=new RegExp(`${Mn}hsl\\s*\\(${rn},${mi},${mi}\\)${In}`),Nf=new RegExp(`${Mn}hsv\\s*\\(${rn},${mi},${mi}\\)${In}`),Tf=new RegExp(`${Mn}hsla\\s*\\(${rn},${mi},${mi},${rn}\\)${In}`),$f=new RegExp(`${Mn}hsva\\s*\\(${rn},${mi},${mi},${rn}\\)${In}`),TC=new RegExp(`${Mn}rgb\\s*\\(${rn},${rn},${rn}\\)${In}`),$C=new RegExp(`${Mn}rgba\\s*\\(${rn},${rn},${rn},${rn}\\)${In}`),EC=new RegExp(`${Mn}#${Pi}${Pi}${Pi}${In}`),RC=new RegExp(`${Mn}#${Fi}${Fi}${Fi}${In}`),PC=new RegExp(`${Mn}#${Pi}${Pi}${Pi}${Pi}${In}`),FC=new RegExp(`${Mn}#${Fi}${Fi}${Fi}${Fi}${In}`);function Qt(n){return parseInt(n,16)}function VC(n){try{let e;if(e=Tf.exec(n))return[is(e[1]),pi(e[5]),pi(e[9]),Mi(e[13])];if(e=Bf.exec(n))return[is(e[1]),pi(e[5]),pi(e[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${n}.`)}catch(e){throw e}}function MC(n){try{let e;if(e=$f.exec(n))return[is(e[1]),pi(e[5]),pi(e[9]),Mi(e[13])];if(e=Nf.exec(n))return[is(e[1]),pi(e[5]),pi(e[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${n}.`)}catch(e){throw e}}function Vi(n){try{let e;if(e=RC.exec(n))return[Qt(e[1]),Qt(e[2]),Qt(e[3]),1];if(e=TC.exec(n))return[$t(e[1]),$t(e[5]),$t(e[9]),1];if(e=$C.exec(n))return[$t(e[1]),$t(e[5]),$t(e[9]),Mi(e[13])];if(e=EC.exec(n))return[Qt(e[1]+e[1]),Qt(e[2]+e[2]),Qt(e[3]+e[3]),1];if(e=FC.exec(n))return[Qt(e[1]),Qt(e[2]),Qt(e[3]),Mi(Qt(e[4])/255)];if(e=PC.exec(n))return[Qt(e[1]+e[1]),Qt(e[2]+e[2]),Qt(e[3]+e[3]),Mi(Qt(e[4]+e[4])/255)];if(n in Sf)return Vi(Sf[n]);if(Bf.test(n)||Tf.test(n)){const[i,r,o,s]=VC(n);return[...NC(i,r,o),s]}else if(Nf.test(n)||$f.test(n)){const[i,r,o,s]=MC(n);return[...BC(i,r,o),s]}throw new Error(`[seemly/rgba]: Invalid color value ${n}.`)}catch(e){throw e}}function IC(n){return n>1?1:n<0?0:n}function za(n,e,i,r){return`rgba(${$t(n)}, ${$t(e)}, ${$t(i)}, ${IC(r)})`}function Da(n,e,i,r,o){return $t((n*e*(1-r)+i*r)/o)}function AC(n,e){Array.isArray(n)||(n=Vi(n)),Array.isArray(e)||(e=Vi(e));const i=n[3],r=e[3],o=Mi(i+r-i*r);return za(Da(n[0],i,e[0],r,o),Da(n[1],i,e[1],r,o),Da(n[2],i,e[2],r,o),o)}function Le(n,e){const[i,r,o,s=1]=Array.isArray(n)?n:Vi(n);return typeof e.alpha=="number"?za(i,r,o,e.alpha):za(i,r,o,s)}function ns(n,e){const[i,r,o,s=1]=Array.isArray(n)?n:Vi(n),{lightness:a=1,alpha:l=1}=e;return OC([i*a,r*a,o*a,s*l])}function Mi(n){const e=Math.round(Number(n)*100)/100;return e>1?1:e<0?0:e}function is(n){const e=Math.round(Number(n));return e>=360||e<0?0:e}function $t(n){const e=Math.round(Number(n));return e>255?255:e<0?0:e}function pi(n){const e=Math.round(Number(n));return e>100?100:e<0?0:e}function OC(n){const[e,i,r]=n;return 3 in n?`rgba(${$t(e)}, ${$t(i)}, ${$t(r)}, ${Mi(n[3])})`:`rgba(${$t(e)}, ${$t(i)}, ${$t(r)}, 1)`}function zC(n=8){return Math.random().toString(16).slice(2,2+n)}function Ef(n){return Array.isArray(n)?n:[n]}const La={STOP:"STOP"};function Rf(n,e){const i=e(n);n.children!==void 0&&i!==La.STOP&&n.children.forEach(r=>Rf(r,e))}function DC(n,e={}){const{preserveGroup:i=!1}=e,r=[],o=i?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(n),r}function LC(n,e){const{isLeaf:i}=n;return i!==void 0?i:!e(n)}function HC(n){return n.children}function WC(n){return n.key}function jC(){return!1}function qC(n,e){const{isLeaf:i}=n;return!(i===!1&&!Array.isArray(e(n)))}function XC(n){return n.disabled===!0}function YC(n,e){return n.isLeaf===!1&&!Array.isArray(e(n))}function UC(n,e){if(n.isLeaf===!0){const i=e(n);if(Array.isArray(i)&&i.length>0)return!0}return!1}function Ha(n){var e;return n==null?[]:Array.isArray(n)?n:(e=n.checkedKeys)!==null&&e!==void 0?e:[]}function Wa(n){var e;return n==null||Array.isArray(n)?[]:(e=n.indeterminateKeys)!==null&&e!==void 0?e:[]}function KC(n,e){const i=new Set(n);return e.forEach(r=>{i.has(r)||i.add(r)}),Array.from(i)}function GC(n,e){const i=new Set(n);return e.forEach(r=>{i.has(r)&&i.delete(r)}),Array.from(i)}function ZC(n){return(n==null?void 0:n.type)==="group"}function QC(n){const e=new Map;return n.forEach((i,r)=>{e.set(i.key,r)}),i=>{var r;return(r=e.get(i))!==null&&r!==void 0?r:null}}class JC extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function ev(n,e,i,r){return rs(e.concat(n),i,r,!1)}function tv(n,e){const i=new Set;return n.forEach(r=>{const o=e.treeNodeMap.get(r);if(o!==void 0){let s=o.parent;for(;s!==null&&!(s.disabled||i.has(s.key));)i.add(s.key),s=s.parent}}),i}function nv(n,e,i,r){const o=rs(e,i,r,!1),s=rs(n,i,r,!0),a=tv(n,i),l=[];return o.forEach(c=>{(s.has(c)||a.has(c))&&l.push(c)}),l.forEach(c=>o.delete(c)),o}function ja(n,e){const{checkedKeys:i,keysToCheck:r,keysToUncheck:o,indeterminateKeys:s,cascade:a,leafOnly:l,checkStrategy:c,allowNotLoaded:d}=n;if(!a)return r!==void 0?{checkedKeys:KC(i,r),indeterminateKeys:Array.from(s)}:o!==void 0?{checkedKeys:GC(i,o),indeterminateKeys:Array.from(s)}:{checkedKeys:Array.from(i),indeterminateKeys:Array.from(s)};const{levelTreeNodeMap:u}=e;let f;o!==void 0?f=nv(o,i,e,d):r!==void 0?f=ev(r,i,e,d):f=rs(i,e,d,!1);const h=c==="parent",p=c==="child"||l,m=f,g=new Set,b=Math.max.apply(null,Array.from(u.keys()));for(let y=b;y>=0;y-=1){const _=y===0,x=u.get(y);for(const w of x){if(w.isLeaf)continue;const{key:C,shallowLoaded:N}=w;if(p&&N&&w.children.forEach(E=>{!E.disabled&&!E.isLeaf&&E.shallowLoaded&&m.has(E.key)&&m.delete(E.key)}),w.disabled||!N)continue;let k=!0,$=!1,v=!0;for(const E of w.children){const P=E.key;if(!E.disabled){if(v&&(v=!1),m.has(P))$=!0;else if(g.has(P)){$=!0,k=!1;break}else if(k=!1,$)break}}k&&!v?(h&&w.children.forEach(E=>{!E.disabled&&m.has(E.key)&&m.delete(E.key)}),m.add(C)):$&&g.add(C),_&&p&&m.has(C)&&m.delete(C)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(g)}}function rs(n,e,i,r){const{treeNodeMap:o,getChildren:s}=e,a=new Set,l=new Set(n);return n.forEach(c=>{const d=o.get(c);d!==void 0&&Rf(d,u=>{if(u.disabled)return La.STOP;const{key:f}=u;if(!a.has(f)&&(a.add(f),l.add(f),YC(u.rawNode,s))){if(r)return La.STOP;if(!i)throw new JC}})}),l}function iv(n,{includeGroup:e=!1,includeSelf:i=!0},r){var o;const s=r.treeNodeMap;let a=n==null?null:(o=s.get(n))!==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(),i||l.treeNodePath.pop(),l.keyPath=l.treeNodePath.map(c=>c.key),l}function rv(n){if(n.length===0)return null;const e=n[0];return e.isGroup||e.ignored||e.disabled?e.getNext():e}function ov(n,e){const i=n.siblings,r=i.length,{index:o}=n;return e?i[(o+1)%r]:o===i.length-1?null:i[o+1]}function Pf(n,e,{loop:i=!1,includeDisabled:r=!1}={}){const o=e==="prev"?sv:ov,s={reverse:e==="prev"};let a=!1,l=null;function c(d){if(d!==null){if(d===n){if(!a)a=!0;else if(!n.disabled&&!n.isGroup){l=n;return}}else if((!d.disabled||r)&&!d.ignored&&!d.isGroup){l=d;return}if(d.isGroup){const u=qa(d,s);u!==null?l=u:c(o(d,i))}else{const u=o(d,!1);if(u!==null)c(u);else{const f=av(d);f!=null&&f.isGroup?c(o(f,i)):i&&c(o(d,!0))}}}}return c(n),l}function sv(n,e){const i=n.siblings,r=i.length,{index:o}=n;return e?i[(o-1+r)%r]:o===0?null:i[o-1]}function av(n){return n.parent}function qa(n,e={}){const{reverse:i=!1}=e,{children:r}=n;if(r){const{length:o}=r,s=i?o-1:0,a=i?-1:o,l=i?-1:1;for(let c=s;c!==a;c+=l){const d=r[c];if(!d.disabled&&!d.ignored)if(d.isGroup){const u=qa(d,e);if(u!==null)return u}else return d}}return null}const lv={getChild(){return this.ignored?null:qa(this)},getParent(){const{parent:n}=this;return n!=null&&n.isGroup?n.getParent():n},getNext(n={}){return Pf(this,"next",n)},getPrev(n={}){return Pf(this,"prev",n)}};function cv(n,e){const i=e?new Set(e):void 0,r=[];function o(s){s.forEach(a=>{r.push(a),!(a.isLeaf||!a.children||a.ignored)&&(a.isGroup||i===void 0||i.has(a.key))&&o(a.children)})}return o(n),r}function dv(n,e){const i=n.key;for(;e;){if(e.key===i)return!0;e=e.parent}return!1}var uv={};function Ff(n,e,i,r,o,s=null,a=0){const l=[];return n.forEach((c,d)=>{var u;uv.NODE_ENV!=="production"&&UC(c,o)&&console.error("[treemate]: node",c,"is invalid");const f=Object.create(r);if(f.rawNode=c,f.siblings=l,f.level=a,f.index=d,f.isFirstChild=d===0,f.isLastChild=d+1===n.length,f.parent=s,!f.ignored){const h=o(c);Array.isArray(h)&&(f.children=Ff(h,e,i,r,o,f,a+1))}l.push(f),e.set(f.key,f),i.has(a)||i.set(a,[]),(u=i.get(a))===null||u===void 0||u.push(f)}),l}function fv(n,e={}){var i;const r=new Map,o=new Map,{getDisabled:s=XC,getIgnored:a=jC,getIsGroup:l=ZC,getKey:c=WC}=e,d=(i=e.getChildren)!==null&&i!==void 0?i:HC,u=e.ignoreEmptyChildren?w=>{const C=d(w);return Array.isArray(C)?C.length?C:null:C}:d,f=Object.assign({get key(){return c(this.rawNode)},get disabled(){return s(this.rawNode)},get isGroup(){return l(this.rawNode)},get isLeaf(){return LC(this.rawNode,u)},get shallowLoaded(){return qC(this.rawNode,u)},get ignored(){return a(this.rawNode)},contains(w){return dv(this,w)}},lv),h=Ff(n,r,o,f,u);function p(w){if(w==null)return null;const C=r.get(w);return C&&!C.isGroup&&!C.ignored?C:null}function m(w){if(w==null)return null;const C=r.get(w);return C&&!C.ignored?C:null}function g(w,C){const N=m(w);return N?N.getPrev(C):null}function b(w,C){const N=m(w);return N?N.getNext(C):null}function y(w){const C=m(w);return C?C.getParent():null}function _(w){const C=m(w);return C?C.getChild():null}const x={treeNodes:h,treeNodeMap:r,levelTreeNodeMap:o,maxLevel:Math.max(...o.keys()),getChildren:u,getFlattenedNodes(w){return cv(h,w)},getNode:p,getPrev:g,getNext:b,getParent:y,getChild:_,getFirstAvailableNode(){return rv(h)},getPath(w,C={}){return iv(w,C,x)},getCheckedKeys(w,C={}){const{cascade:N=!0,leafOnly:k=!1,checkStrategy:$="all",allowNotLoaded:v=!1}=C;return ja({checkedKeys:Ha(w),indeterminateKeys:Wa(w),cascade:N,leafOnly:k,checkStrategy:$,allowNotLoaded:v},x)},check(w,C,N={}){const{cascade:k=!0,leafOnly:$=!1,checkStrategy:v="all",allowNotLoaded:E=!1}=N;return ja({checkedKeys:Ha(C),indeterminateKeys:Wa(C),keysToCheck:w==null?[]:Ef(w),cascade:k,leafOnly:$,checkStrategy:v,allowNotLoaded:E},x)},uncheck(w,C,N={}){const{cascade:k=!0,leafOnly:$=!1,checkStrategy:v="all",allowNotLoaded:E=!1}=N;return ja({checkedKeys:Ha(C),indeterminateKeys:Wa(C),keysToUncheck:w==null?[]:Ef(w),cascade:k,leafOnly:$,checkStrategy:v,allowNotLoaded:E},x)},getNonLeafKeys(w={}){return DC(h,w)}};return x}function os(n){return n.composedPath()[0]}const hv={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function mv(n,e,i){if(n==="mousemoveoutside"){const r=o=>{e.contains(os(o))||i(o)};return{mousemove:r,touchstart:r}}else if(n==="clickoutside"){let r=!1;const o=a=>{r=!e.contains(os(a))},s=a=>{r&&(e.contains(os(a))||i(a))};return{mousedown:o,mouseup:s,touchstart:o,touchend:s}}return console.error(`[evtd/create-trap-handler]: name \`${n}\` is invalid. This could be a bug of evtd.`),{}}function Vf(n,e,i){const r=hv[n];let o=r.get(e);o===void 0&&r.set(e,o=new WeakMap);let s=o.get(i);return s===void 0&&o.set(i,s=mv(n,e,i)),s}function pv(n,e,i,r){if(n==="mousemoveoutside"||n==="clickoutside"){const o=Vf(n,e,i);return Object.keys(o).forEach(s=>{Lt(s,document,o[s],r)}),!0}return!1}function gv(n,e,i,r){if(n==="mousemoveoutside"||n==="clickoutside"){const o=Vf(n,e,i);return Object.keys(o).forEach(s=>{yt(s,document,o[s],r)}),!0}return!1}function yv(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const n=new WeakMap,e=new WeakMap;function i(){n.set(this,!0)}function r(){n.set(this,!0),e.set(this,!0)}function o(k,$,v){const E=k[$];return k[$]=function(){return v.apply(k,arguments),E.apply(k,arguments)},k}function s(k,$){k[$]=Event.prototype[$]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function c(){var k;return(k=a.get(this))!==null&&k!==void 0?k:null}function d(k,$){l!==void 0&&Object.defineProperty(k,"currentTarget",{configurable:!0,enumerable:!0,get:$??l.get})}const u={bubble:{},capture:{}},f={};function h(){const k=function($){const{type:v,eventPhase:E,bubbles:P}=$,F=os($);if(E===2)return;const R=E===1?"capture":"bubble";let M=F;const X=[];for(;M===null&&(M=window),X.push(M),M!==window;)M=M.parentNode||null;const G=u.capture[v],Z=u.bubble[v];if(o($,"stopPropagation",i),o($,"stopImmediatePropagation",r),d($,c),R==="capture"){if(G===void 0)return;for(let O=X.length-1;O>=0&&!n.has($);--O){const A=X[O],Y=G.get(A);if(Y!==void 0){a.set($,A);for(const H of Y){if(e.has($))break;H($)}}if(O===0&&!P&&Z!==void 0){const H=Z.get(A);if(H!==void 0)for(const T of H){if(e.has($))break;T($)}}}}else if(R==="bubble"){if(Z===void 0)return;for(let O=0;O<X.length&&!n.has($);++O){const A=X[O],Y=Z.get(A);if(Y!==void 0){a.set($,A);for(const H of Y){if(e.has($))break;H($)}}}}s($,"stopPropagation"),s($,"stopImmediatePropagation"),d($)};return k.displayName="evtdUnifiedHandler",k}function p(){const k=function($){const{type:v,eventPhase:E}=$;if(E!==2)return;const P=f[v];P!==void 0&&P.forEach(F=>F($))};return k.displayName="evtdUnifiedWindowEventHandler",k}const m=h(),g=p();function b(k,$){const v=u[k];return v[$]===void 0&&(v[$]=new Map,window.addEventListener($,m,k==="capture")),v[$]}function y(k){return f[k]===void 0&&(f[k]=new Set,window.addEventListener(k,g)),f[k]}function _(k,$){let v=k.get($);return v===void 0&&k.set($,v=new Set),v}function x(k,$,v,E){const P=u[$][v];if(P!==void 0){const F=P.get(k);if(F!==void 0&&F.has(E))return!0}return!1}function w(k,$){const v=f[k];return!!(v!==void 0&&v.has($))}function C(k,$,v,E){let P;if(typeof E=="object"&&E.once===!0?P=G=>{N(k,$,P,E),v(G)}:P=v,pv(k,$,P,E))return;const R=E===!0||typeof E=="object"&&E.capture===!0?"capture":"bubble",M=b(R,k),X=_(M,$);if(X.has(P)||X.add(P),$===window){const G=y(k);G.has(P)||G.add(P)}}function N(k,$,v,E){if(gv(k,$,v,E))return;const F=E===!0||typeof E=="object"&&E.capture===!0,R=F?"capture":"bubble",M=b(R,k),X=_(M,$);if($===window&&!x($,F?"bubble":"capture",k,v)&&w(k,v)){const Z=f[k];Z.delete(v),Z.size===0&&(window.removeEventListener(k,g),f[k]=void 0)}X.has(v)&&X.delete(v),X.size===0&&M.delete($),M.size===0&&(window.removeEventListener(k,m,R==="capture"),u[R][k]=void 0)}return{on:C,off:N}}const{on:Lt,off:yt}=yv(),br="@@mmoContext",bv={mounted(n,{value:e}){n[br]={handler:void 0},typeof e=="function"&&(n[br].handler=e,Lt("mousemoveoutside",n,e))},updated(n,{value:e}){const i=n[br];typeof e=="function"?i.handler?i.handler!==e&&(yt("mousemoveoutside",n,i.handler),i.handler=e,Lt("mousemoveoutside",n,e)):(n[br].handler=e,Lt("mousemoveoutside",n,e)):i.handler&&(yt("mousemoveoutside",n,i.handler),i.handler=void 0)},unmounted(n){const{handler:e}=n[br];e&&yt("mousemoveoutside",n,e),n[br].handler=void 0}},_r="@@coContext",ss={mounted(n,{value:e,modifiers:i}){n[_r]={handler:void 0},typeof e=="function"&&(n[_r].handler=e,Lt("clickoutside",n,e,{capture:i.capture}))},updated(n,{value:e,modifiers:i}){const r=n[_r];typeof e=="function"?r.handler?r.handler!==e&&(yt("clickoutside",n,r.handler,{capture:i.capture}),r.handler=e,Lt("clickoutside",n,e,{capture:i.capture})):(n[_r].handler=e,Lt("clickoutside",n,e,{capture:i.capture})):r.handler&&(yt("clickoutside",n,r.handler,{capture:i.capture}),r.handler=void 0)},unmounted(n,{modifiers:e}){const{handler:i}=n[_r];i&&yt("clickoutside",n,i,{capture:e.capture}),n[_r].handler=void 0}};function _v(n,e){console.error(`[vdirs/${n}]: ${e}`)}class wv{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,i){const{elementZIndex:r}=this;if(i!==void 0){e.style.zIndex=`${i}`,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,i){const{elementZIndex:r}=this;r.has(e)?r.delete(e):i===void 0&&_v("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((i,r)=>i[1]-r[1]),this.nextZIndex=2e3,e.forEach(i=>{const r=i[0],o=this.nextZIndex++;`${o}`!==r.style.zIndex&&(r.style.zIndex=`${o}`)})}}const Xa=new wv,wr="@@ziContext",Mf={mounted(n,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i;n[wr]={enabled:!!o,initialized:!1},o&&(Xa.ensureZIndex(n,r),n[wr].initialized=!0)},updated(n,e){const{value:i={}}=e,{zIndex:r,enabled:o}=i,s=n[wr].enabled;o&&!s&&(Xa.ensureZIndex(n,r),n[wr].initialized=!0),n[wr].enabled=!!o},unmounted(n,e){if(!n[wr].initialized)return;const{value:i={}}=e,{zIndex:r}=i;Xa.unregister(n,r)}};function xv(n){const e=t.ref(!!n.value);if(e.value)return t.readonly(e);const i=t.watch(n,r=>{r&&(e.value=!0,i())});return t.readonly(e)}function fn(n){const e=t.computed(n),i=t.ref(e.value);return t.watch(e,r=>{i.value=r}),typeof n=="function"?i:{__v_isRef:!0,get value(){return i.value},set value(r){n.set(r)}}}const kv=typeof window<"u";let xr,Xr;(()=>{var n,e;xr=kv?(e=(n=document)===null||n===void 0?void 0:n.fonts)===null||e===void 0?void 0:e.ready:void 0,Xr=!1,xr!==void 0?xr.then(()=>{Xr=!0}):Xr=!0})();function Cv(n){if(Xr)return;let e=!1;t.onMounted(()=>{Xr||xr==null||xr.then(()=>{e||n()})}),t.onBeforeUnmount(()=>{e=!0})}function Ya(n,e){return t.watch(n,i=>{i!==void 0&&(e.value=i)}),t.computed(()=>n.value===void 0?e.value:n.value)}function as(){const n=t.ref(!1);return t.onMounted(()=>{n.value=!0}),t.readonly(n)}function If(n,e){return t.computed(()=>{for(const i of e)if(n[i]!==void 0)return n[i];return n[e[e.length-1]]})}const vv=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Sv(){return vv}function Ua(n,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${i}] is empty.`);return r()}function Ka(n,e=!0,i=[]){return n.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&i.push(t.createTextVNode(String(r)));return}if(Array.isArray(r)){Ka(r,e,i);return}if(r.type===t.Fragment){if(r.children===null)return;Array.isArray(r.children)&&Ka(r.children,e,i)}else r.type!==t.Comment&&i.push(r)}}),i}function Af(n,e,i="default"){const r=e[i];if(r===void 0)throw new Error(`[vueuc/${n}]: slot[${i}] is empty.`);const o=Ka(r());if(o.length===1)return o[0];throw new Error(`[vueuc/${n}]: slot[${i}] should have exactly one child.`)}let gi=null;function Of(){if(gi===null&&(gi=document.getElementById("v-binder-view-measurer"),gi===null)){gi=document.createElement("div"),gi.id="v-binder-view-measurer";const{style:n}=gi;n.position="fixed",n.left="0",n.right="0",n.top="0",n.bottom="0",n.pointerEvents="none",n.visibility="hidden",document.body.appendChild(gi)}return gi.getBoundingClientRect()}function Bv(n,e){const i=Of();return{top:e,left:n,height:0,width:0,right:i.width-n,bottom:i.height-e}}function Ga(n){const e=n.getBoundingClientRect(),i=Of();return{left:e.left-i.left,top:e.top-i.top,bottom:i.height+i.top-e.bottom,right:i.width+i.left-e.right,width:e.width,height:e.height}}function Nv(n){return n.nodeType===9?null:n.parentNode}function zf(n){if(n===null)return null;const e=Nv(n);if(e===null)return null;if(e.nodeType===9)return document;if(e.nodeType===1){const{overflow:i,overflowX:r,overflowY:o}=getComputedStyle(e);if(/(auto|scroll|overlay)/.test(i+o+r))return e}return zf(e)}const Df=t.defineComponent({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(n){var e;t.provide("VBinder",(e=t.getCurrentInstance())===null||e===void 0?void 0:e.proxy);const i=t.inject("VBinder",null),r=t.ref(null),o=y=>{r.value=y,i&&n.syncTargetWithParent&&i.setTargetRef(y)};let s=[];const a=()=>{let y=r.value;for(;y=zf(y),y!==null;)s.push(y);for(const _ of s)Lt("scroll",_,f,!0)},l=()=>{for(const y of s)yt("scroll",y,f,!0);s=[]},c=new Set,d=y=>{c.size===0&&a(),c.has(y)||c.add(y)},u=y=>{c.has(y)&&c.delete(y),c.size===0&&l()},f=()=>{vf(h)},h=()=>{c.forEach(y=>y())},p=new Set,m=y=>{p.size===0&&Lt("resize",window,b),p.has(y)||p.add(y)},g=y=>{p.has(y)&&p.delete(y),p.size===0&&yt("resize",window,b)},b=()=>{p.forEach(y=>y())};return t.onBeforeUnmount(()=>{yt("resize",window,b),l()}),{targetRef:r,setTargetRef:o,addScrollListener:d,removeScrollListener:u,addResizeListener:m,removeResizeListener:g}},render(){return Ua("binder",this.$slots)}}),Lf=t.defineComponent({name:"Target",setup(){const{setTargetRef:n,syncTarget:e}=t.inject("VBinder");return{syncTarget:e,setTargetDirective:{mounted:n,updated:n}}},render(){const{syncTarget:n,setTargetDirective:e}=this;return n?t.withDirectives(Af("follower",this.$slots),[[e]]):Af("follower",this.$slots)}}),Tv="@css-render/vue3-ssr";function $v(n,e){return`<style cssr-id="${n}">
|
|
104
104
|
${e}
|
|
105
105
|
</style>`}function Ev(n,e,i){const{styles:r,ids:o}=i;o.has(n)||r!==null&&(o.add(n),r.push($v(n,e)))}const Rv=typeof document<"u";function Ii(){if(Rv)return;const n=t.inject(Tv,null);if(n!==null)return{adapter:(e,i)=>Ev(e,i,n),context:n}}function Hf(n,e){console.error(`[vueuc/${n}]: ${e}`)}function Pv(n){let e=0;for(let i=0;i<n.length;++i)n[i]==="&"&&++e;return e}const Wf=/\s*,(?![^(]*\))\s*/g,Fv=/\s+/g;function Vv(n,e){const i=[];return e.split(Wf).forEach(r=>{let o=Pv(r);if(o){if(o===1){n.forEach(a=>{i.push(r.replace("&",a))});return}}else{n.forEach(a=>{i.push((a&&a+" ")+r)});return}let s=[r];for(;o--;){const a=[];s.forEach(l=>{n.forEach(c=>{a.push(l.replace("&",c))})}),s=a}s.forEach(a=>i.push(a))}),i}function Mv(n,e){const i=[];return e.split(Wf).forEach(r=>{n.forEach(o=>{i.push((o&&o+" ")+r)})}),i}function Iv(n){let e=[""];return n.forEach(i=>{i=i&&i.trim(),i&&(i.includes("&")?e=Vv(e,i):e=Mv(e,i))}),e.join(", ").replace(Fv," ")}function jf(n){if(!n)return;const e=n.parentElement;e&&e.removeChild(n)}function ls(n,e){return(e??document.head).querySelector(`style[cssr-id="${n}"]`)}function Av(n){const e=document.createElement("style");return e.setAttribute("cssr-id",n),e}function cs(n){return n?/^\s*@(s|m)/.test(n):!1}const Ov=/[A-Z]/g;function qf(n){return n.replace(Ov,e=>"-"+e.toLowerCase())}function zv(n,e=" "){return typeof n=="object"&&n!==null?` {
|
|
106
106
|
`+Object.entries(n).map(i=>e+` ${qf(i[0])}: ${i[1]};`).join(`
|
|
@@ -113,7 +113,7 @@ ${o}
|
|
|
113
113
|
`);return}l=qf(l),c!=null&&a.push(` ${l}${zv(c)}`)}),n&&a.push("}"),a.join(`
|
|
114
114
|
`)}function Za(n,e,i){n&&n.forEach(r=>{if(Array.isArray(r))Za(r,e,i);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?Za(o,e,i):o&&i(o)}else r&&i(r)})}function Yf(n,e,i,r,o){const s=n.$;let a="";if(!s||typeof s=="string")cs(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});cs(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")cs(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});cs(d)?a=d:e.push(d)}const l=Iv(e),c=Xf(l,n.props,r,o);a?i.push(`${a} {`):c.length&&i.push(c),n.children&&Za(n.children,{context:r.context,props:o},d=>{if(typeof d=="string"){const u=Xf(l,{raw:d},r,o);i.push(u)}else Yf(d,e,i,r,o)}),e.pop(),a&&i.push("}"),s&&s.after&&s.after(r.context)}function Lv(n,e,i){const r=[];return Yf(n,[],r,e,i),r.join(`
|
|
115
115
|
|
|
116
|
-
`)}function Qa(n){for(var e=0,i,r=0,o=n.length;o>=4;++r,o-=4)i=n.charCodeAt(r)&255|(n.charCodeAt(++r)&255)<<8|(n.charCodeAt(++r)&255)<<16|(n.charCodeAt(++r)&255)<<24,i=(i&65535)*1540483477+((i>>>16)*59797<<16),i^=i>>>24,e=(i&65535)*1540483477+((i>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(n.charCodeAt(r+2)&255)<<16;case 2:e^=(n.charCodeAt(r+1)&255)<<8;case 1:e^=n.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 Hv(n,e,i,r){const{els:o}=e;if(i===void 0)o.forEach(jf),e.els=[];else{const s=ls(i,r);s&&o.includes(s)&&(jf(s),e.els=o.filter(a=>a!==s))}}function Uf(n,e){n.push(e)}function Wv(n,e,i,r,o,s,a,l,c){let d;if(i===void 0&&(d=e.render(r),i=Qa(d)),c){c.adapter(i,d??e.render(r));return}l===void 0&&(l=document.head);const u=ls(i,l);if(u!==null&&!s)return u;const f=u??Av(i);if(d===void 0&&(d=e.render(r)),f.textContent=d,u!==null)return u;if(a){const h=l.querySelector(`meta[name="${a}"]`);if(h)return l.insertBefore(f,h),Uf(e.els,f),f}return o?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),Uf(e.els,f),f}function jv(n){return Lv(this,this.instance,n)}function qv(n={}){const{id:e,ssr:i,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=n;return Wv(this.instance,this,e,r,o,s,a,l,i)}function Xv(n={}){const{id:e,parent:i}=n;Hv(this.instance,this,e,i)}const ds=function(n,e,i,r){return{instance:n,$:e,props:i,children:r,els:[],render:jv,mount:qv,unmount:Xv}},Yv=function(n,e,i,r){return Array.isArray(e)?ds(n,{$:null},null,e):Array.isArray(i)?ds(n,e,null,i):Array.isArray(r)?ds(n,e,i,r):ds(n,e,i,null)};function Kf(n={}){const e={c:((...i)=>Yv(e,...i)),use:(i,...r)=>i.install(e,...r),find:ls,context:{},config:n};return e}function Uv(n,e){if(n===void 0)return!1;if(e){const{context:{ids:i}}=e;return i.has(n)}return ls(n)!==null}const{c:yi}=Kf(),Ja="vueuc-style";function Gf(n){return n&-n}class Zf{constructor(e,i){this.l=e,this.min=i;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,i){if(i===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=i,e+=Gf(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:i,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+=i[e],e-=Gf(e);return s}getBound(e){let i=0,r=this.l;for(;r>i;){const o=Math.floor((i+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(i===o)return this.sum(i+1)<=e?i+1:o;i=o}else return o}return i}}function Qf(n){return typeof n=="string"?document.querySelector(n):n()||null}const Kv=t.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(n){return{showTeleport:xv(t.toRef(n,"show")),mergedTo:t.computed(()=>{const{to:e}=n;return e??"body"})}},render(){return this.showTeleport?this.disabled?Ua("lazy-teleport",this.$slots):t.h(t.Teleport,{disabled:this.disabled,to:this.mergedTo},Ua("lazy-teleport",this.$slots)):null}}),us={top:"bottom",bottom:"top",left:"right",right:"left"},Jf={start:"end",center:"center",end:"start"},el={top:"height",bottom:"height",left:"width",right:"width"},Gv={"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"},Zv={"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"},Qv={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},eh={top:!0,bottom:!1,left:!0,right:!1},th={top:"end",bottom:"start",left:"end",right:"start"};function Jv(n,e,i,r,o,s){if(!o||s)return{placement:n,top:0,left:0};const[a,l]=n.split("-");let c=l??"center",d={top:0,left:0};const u=(p,m,g)=>{let b=0,y=0;const _=i[p]-e[m]-e[p];return _>0&&r&&(g?y=eh[m]?_:-_:b=eh[m]?_:-_),{left:b,top:y}},f=a==="left"||a==="right";if(c!=="center"){const p=Qv[n],m=us[p],g=el[p];if(i[g]>e[g]){if(e[p]+e[g]<i[g]){const b=(i[g]-e[g])/2;e[p]<b||e[m]<b?e[p]<e[m]?(c=Jf[l],d=u(g,m,f)):d=u(g,p,f):c="center"}}else i[g]<e[g]&&e[m]<0&&e[p]>e[m]&&(c=Jf[l])}else{const p=a==="bottom"||a==="top"?"left":"top",m=us[p],g=el[p],b=(i[g]-e[g])/2;(e[p]<b||e[m]<b)&&(e[p]>e[m]?(c=th[p],d=u(g,p,f)):(c=th[m],d=u(g,m,f)))}let h=a;return e[a]<i[el[a]]&&e[a]<e[us[a]]&&(h=us[a]),{placement:c!=="center"?`${h}-${c}`:h,left:d.left,top:d.top}}function eS(n,e){return e?Zv[n]:Gv[n]}function tS(n,e,i,r,o,s){if(s)switch(n){case"bottom-start":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(i.top-e.top+i.height/2)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(i.top-e.top+i.height/2)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(n){case"bottom-start":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(i.top-e.top+i.height/2+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(i.top-e.top+i.height/2+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width/2+o)}px`,transform:"translateX(-50%)"}}}const nS=yi([yi(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),yi(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[yi("> *",{pointerEvents:"all"})])]),nh=t.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(n){const e=t.inject("VBinder"),i=fn(()=>n.enabled!==void 0?n.enabled:n.show),r=t.ref(null),o=t.ref(null),s=()=>{const{syncTrigger:h}=n;h.includes("scroll")&&e.addScrollListener(c),h.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};t.onMounted(()=>{i.value&&(c(),s())});const l=Ii();nS.mount({id:"vueuc/binder",head:!0,anchorMetaName:Ja,ssr:l}),t.onBeforeUnmount(()=>{a()}),Cv(()=>{i.value&&c()});const c=()=>{if(!i.value)return;const h=r.value;if(h===null)return;const p=e.targetRef,{x:m,y:g,overlap:b}=n,y=m!==void 0&&g!==void 0?Bv(m,g):Ga(p);h.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),h.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:x,placement:w,internalShift:C,flip:N}=n;h.setAttribute("v-placement",w),b?h.setAttribute("v-overlap",""):h.removeAttribute("v-overlap");const{style:k}=h;_==="target"?k.width=`${y.width}px`:_!==void 0?k.width=_:k.width="",x==="target"?k.minWidth=`${y.width}px`:x!==void 0?k.minWidth=x:k.minWidth="";const $=Ga(h),v=Ga(o.value),{left:E,top:P,placement:F}=Jv(w,y,$,C,N,b),R=eS(F,b),{left:M,top:X,transform:G}=tS(F,v,y,P,E,b);h.setAttribute("v-placement",F),h.style.setProperty("--v-offset-left",`${Math.round(E)}px`),h.style.setProperty("--v-offset-top",`${Math.round(P)}px`),h.style.transform=`translateX(${M}) translateY(${X}) ${G}`,h.style.setProperty("--v-transform-origin",R),h.style.transformOrigin=R};t.watch(i,h=>{h?(s(),d()):a()});const d=()=>{t.nextTick().then(c).catch(h=>console.error(h))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(h=>{t.watch(t.toRef(n,h),c)}),["teleportDisabled"].forEach(h=>{t.watch(t.toRef(n,h),d)}),t.watch(t.toRef(n,"syncTrigger"),h=>{h.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),h.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=as(),f=fn(()=>{const{to:h}=n;if(h!==void 0)return h;u.value});return{VBinder:e,mergedEnabled:i,offsetContainerRef:o,followerRef:r,mergedTo:f,syncPosition:c}},render(){return t.h(Kv,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var n,e;const i=t.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[t.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))]);return this.zindexable?t.withDirectives(i,[[Mf,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):i}})}});var Ai=[],iS=function(){return Ai.some(function(n){return n.activeTargets.length>0})},rS=function(){return Ai.some(function(n){return n.skippedTargets.length>0})},ih="ResizeObserver loop completed with undelivered notifications.",oS=function(){var n;typeof ErrorEvent=="function"?n=new ErrorEvent("error",{message:ih}):(n=document.createEvent("Event"),n.initEvent("error",!1,!1),n.message=ih),window.dispatchEvent(n)},Yr;(function(n){n.BORDER_BOX="border-box",n.CONTENT_BOX="content-box",n.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Yr||(Yr={}));var Oi=function(n){return Object.freeze(n)},sS=(function(){function n(e,i){this.inlineSize=e,this.blockSize=i,Oi(this)}return n})(),rh=(function(){function n(e,i,r,o){return this.x=e,this.y=i,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,Oi(this)}return n.prototype.toJSON=function(){var e=this,i=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:i,y:r,top:o,right:s,bottom:a,left:l,width:c,height:d}},n.fromRect=function(e){return new n(e.x,e.y,e.width,e.height)},n})(),tl=function(n){return n instanceof SVGElement&&"getBBox"in n},oh=function(n){if(tl(n)){var e=n.getBBox(),i=e.width,r=e.height;return!i&&!r}var o=n,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||n.getClientRects().length)},sh=function(n){var e;if(n instanceof Element)return!0;var i=(e=n==null?void 0:n.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(i&&n instanceof i.Element)},aS=function(n){switch(n.tagName){case"INPUT":if(n.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Ur=typeof window<"u"?window:{},fs=new WeakMap,ah=/auto|scroll/,lS=/^tb|vertical/,cS=/msie|trident/i.test(Ur.navigator&&Ur.navigator.userAgent),An=function(n){return parseFloat(n||"0")},kr=function(n,e,i){return n===void 0&&(n=0),e===void 0&&(e=0),i===void 0&&(i=!1),new sS((i?e:n)||0,(i?n:e)||0)},lh=Oi({devicePixelContentBoxSize:kr(),borderBoxSize:kr(),contentBoxSize:kr(),contentRect:new rh(0,0,0,0)}),ch=function(n,e){if(e===void 0&&(e=!1),fs.has(n)&&!e)return fs.get(n);if(oh(n))return fs.set(n,lh),lh;var i=getComputedStyle(n),r=tl(n)&&n.ownerSVGElement&&n.getBBox(),o=!cS&&i.boxSizing==="border-box",s=lS.test(i.writingMode||""),a=!r&&ah.test(i.overflowY||""),l=!r&&ah.test(i.overflowX||""),c=r?0:An(i.paddingTop),d=r?0:An(i.paddingRight),u=r?0:An(i.paddingBottom),f=r?0:An(i.paddingLeft),h=r?0:An(i.borderTopWidth),p=r?0:An(i.borderRightWidth),m=r?0:An(i.borderBottomWidth),g=r?0:An(i.borderLeftWidth),b=f+d,y=c+u,_=g+p,x=h+m,w=l?n.offsetHeight-x-n.clientHeight:0,C=a?n.offsetWidth-_-n.clientWidth:0,N=o?b+_:0,k=o?y+x:0,$=r?r.width:An(i.width)-N-C,v=r?r.height:An(i.height)-k-w,E=$+b+C+_,P=v+y+w+x,F=Oi({devicePixelContentBoxSize:kr(Math.round($*devicePixelRatio),Math.round(v*devicePixelRatio),s),borderBoxSize:kr(E,P,s),contentBoxSize:kr($,v,s),contentRect:new rh(f,c,$,v)});return fs.set(n,F),F},dh=function(n,e,i){var r=ch(n,i),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Yr.DEVICE_PIXEL_CONTENT_BOX:return a;case Yr.BORDER_BOX:return o;default:return s}},dS=(function(){function n(e){var i=ch(e);this.target=e,this.contentRect=i.contentRect,this.borderBoxSize=Oi([i.borderBoxSize]),this.contentBoxSize=Oi([i.contentBoxSize]),this.devicePixelContentBoxSize=Oi([i.devicePixelContentBoxSize])}return n})(),uh=function(n){if(oh(n))return 1/0;for(var e=0,i=n.parentNode;i;)e+=1,i=i.parentNode;return e},uS=function(){var n=1/0,e=[];Ai.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new dS(d.target),f=uh(d.target);l.push(u),d.lastReportedSize=dh(d.target,d.observedBox),f<n&&(n=f)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var i=0,r=e;i<r.length;i++){var o=r[i];o()}return n},fh=function(n){Ai.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(o){o.isActive()&&(uh(o.target)>n?i.activeTargets.push(o):i.skippedTargets.push(o))})})},fS=function(){var n=0;for(fh(n);iS();)n=uS(),fh(n);return rS()&&oS(),n>0},nl,hh=[],hS=function(){return hh.splice(0).forEach(function(n){return n()})},mS=function(n){if(!nl){var e=0,i=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return hS()}).observe(i,r),nl=function(){i.textContent="".concat(e?e--:e++)}}hh.push(n),nl()},pS=function(n){mS(function(){requestAnimationFrame(n)})},hs=0,gS=function(){return!!hs},yS=250,bS={attributes:!0,characterData:!0,childList:!0,subtree:!0},mh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],ph=function(n){return n===void 0&&(n=0),Date.now()+n},il=!1,_S=(function(){function n(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return n.prototype.run=function(e){var i=this;if(e===void 0&&(e=yS),!il){il=!0;var r=ph(e);pS(function(){var o=!1;try{o=fS()}finally{if(il=!1,e=r-ph(),!gS())return;o?i.run(1e3):e>0?i.run(e):i.start()}})}},n.prototype.schedule=function(){this.stop(),this.run()},n.prototype.observe=function(){var e=this,i=function(){return e.observer&&e.observer.observe(document.body,bS)};document.body?i():Ur.addEventListener("DOMContentLoaded",i)},n.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),mh.forEach(function(i){return Ur.addEventListener(i,e.listener,!0)}))},n.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),mh.forEach(function(i){return Ur.removeEventListener(i,e.listener,!0)}),this.stopped=!0)},n})(),rl=new _S,gh=function(n){!hs&&n>0&&rl.start(),hs+=n,!hs&&rl.stop()},wS=function(n){return!tl(n)&&!aS(n)&&getComputedStyle(n).display==="inline"},xS=(function(){function n(e,i){this.target=e,this.observedBox=i||Yr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return n.prototype.isActive=function(){var e=dh(this.target,this.observedBox,!0);return wS(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},n})(),kS=(function(){function n(e,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=i}return n})(),ms=new WeakMap,yh=function(n,e){for(var i=0;i<n.length;i+=1)if(n[i].target===e)return i;return-1},ps=(function(){function n(){}return n.connect=function(e,i){var r=new kS(e,i);ms.set(e,r)},n.observe=function(e,i,r){var o=ms.get(e),s=o.observationTargets.length===0;yh(o.observationTargets,i)<0&&(s&&Ai.push(o),o.observationTargets.push(new xS(i,r&&r.box)),gh(1),rl.schedule())},n.unobserve=function(e,i){var r=ms.get(e),o=yh(r.observationTargets,i),s=r.observationTargets.length===1;o>=0&&(s&&Ai.splice(Ai.indexOf(r),1),r.observationTargets.splice(o,1),gh(-1))},n.disconnect=function(e){var i=this,r=ms.get(e);r.observationTargets.slice().forEach(function(o){return i.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},n})(),CS=(function(){function n(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.");ps.connect(this,e)}return n.prototype.observe=function(e,i){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!sh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ps.observe(this,e,i)},n.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(!sh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ps.unobserve(this,e)},n.prototype.disconnect=function(){ps.disconnect(this)},n.toString=function(){return"function ResizeObserver () { [polyfill code] }"},n})();class vS{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||CS)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const i of e){const r=this.elHandlersMap.get(i.target);r!==void 0&&r(i)}}registerHandler(e,i){this.elHandlersMap.set(e,i),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Kr=new vS,gs=t.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(n){let e=!1;const i=t.getCurrentInstance().proxy;function r(o){const{onResize:s}=n;s!==void 0&&s(o)}t.onMounted(()=>{const o=i.$el;if(o===void 0){Hf("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){Hf("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Kr.registerHandler(o.nextElementSibling,r),e=!0)}),t.onBeforeUnmount(()=>{e&&Kr.unregisterHandler(i.$el.nextElementSibling)})},render(){return t.renderSlot(this.$slots,"default")}});let ys;function SS(){return typeof document>"u"?!1:(ys===void 0&&("matchMedia"in window?ys=window.matchMedia("(pointer:coarse)").matches:ys=!1),ys)}let ol;function bh(){return typeof document>"u"?1:(ol===void 0&&(ol="chrome"in window?window.devicePixelRatio:1),ol)}const _h="VVirtualListXScroll";function BS({columnsRef:n,renderColRef:e,renderItemWithColsRef:i}){const r=t.ref(0),o=t.ref(0),s=t.computed(()=>{const d=n.value;if(d.length===0)return null;const u=new Zf(d.length,0);return d.forEach((f,h)=>{u.add(h,f.width)}),u}),a=fn(()=>{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=fn(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,n.value.length-1):0});return t.provide(_h,{startIndexRef:a,endIndexRef:c,columnsRef:n,renderColRef:e,renderItemWithColsRef:i,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const wh=t.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:n,endIndexRef:e,columnsRef:i,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=t.inject(_h);return{startIndex:n,endIndex:e,columns:i,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:n,endIndex:e,columns:i,renderCol:r,renderItemWithCols:o,getLeft:s,item:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:n,endColIndex:e,allColumns:i,item:a,getLeft:s});if(r!=null){const l=[];for(let c=n;c<=e;++c){const d=i[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),NS=yi(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[yi("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[yi("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),TS=t.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(n){const e=Ii();NS.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Ja,ssr:e}),t.onMounted(()=>{const{defaultScrollIndex:R,defaultScrollKey:M}=n;R!=null?b({index:R}):M!=null&&b({key:M})});let i=!1,r=!1;t.onActivated(()=>{if(i=!1,!r){r=!0;return}b({top:p.value,left:a.value})}),t.onDeactivated(()=>{i=!0,r||(r=!0)});const o=fn(()=>{if(n.renderCol==null&&n.renderItemWithCols==null||n.columns.length===0)return;let R=0;return n.columns.forEach(M=>{R+=M.width}),R}),s=t.computed(()=>{const R=new Map,{keyField:M}=n;return n.items.forEach((X,G)=>{R.set(X[M],G)}),R}),{scrollLeftRef:a,listWidthRef:l}=BS({columnsRef:t.toRef(n,"columns"),renderColRef:t.toRef(n,"renderCol"),renderItemWithColsRef:t.toRef(n,"renderItemWithCols")}),c=t.ref(null),d=t.ref(void 0),u=new Map,f=t.computed(()=>{const{items:R,itemSize:M,keyField:X}=n,G=new Zf(R.length,M);return R.forEach((Z,O)=>{const A=Z[X],Y=u.get(A);Y!==void 0&&G.add(O,Y)}),G}),h=t.ref(0),p=t.ref(0),m=fn(()=>Math.max(f.value.getBound(p.value-jr(n.paddingTop))-1,0)),g=t.computed(()=>{const{value:R}=d;if(R===void 0)return[];const{items:M,itemSize:X}=n,G=m.value,Z=Math.min(G+Math.ceil(R/X+1),M.length-1),O=[];for(let A=G;A<=Z;++A)O.push(M[A]);return O}),b=(R,M)=>{if(typeof R=="number"){w(R,M,"auto");return}const{left:X,top:G,index:Z,key:O,position:A,behavior:Y,debounce:H=!0}=R;if(X!==void 0||G!==void 0)w(X,G,Y);else if(Z!==void 0)x(Z,Y,H);else if(O!==void 0){const T=s.value.get(O);T!==void 0&&x(T,Y,H)}else A==="bottom"?w(0,Number.MAX_SAFE_INTEGER,Y):A==="top"&&w(0,0,Y)};let y,_=null;function x(R,M,X){const{value:G}=f,Z=G.sum(R)+jr(n.paddingTop);if(!X)c.value.scrollTo({left:0,top:Z,behavior:M});else{y=R,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:O,offsetHeight:A}=c.value;if(Z>O){const Y=G.get(R);Z+Y<=O+A||c.value.scrollTo({left:0,top:Z+Y-A,behavior:M})}else c.value.scrollTo({left:0,top:Z,behavior:M})}}function w(R,M,X){c.value.scrollTo({left:R,top:M,behavior:X})}function C(R,M){var X,G,Z;if(i||n.ignoreItemResize||F(M.target))return;const{value:O}=f,A=s.value.get(R),Y=O.get(A),H=(Z=(G=(X=M.borderBoxSize)===null||X===void 0?void 0:X[0])===null||G===void 0?void 0:G.blockSize)!==null&&Z!==void 0?Z:M.contentRect.height;if(H===Y)return;H-n.itemSize===0?u.delete(R):u.set(R,H-n.itemSize);const D=H-Y;if(D===0)return;O.add(A,D);const K=c.value;if(K!=null){if(y===void 0){const J=O.sum(A);K.scrollTop>J&&K.scrollBy(0,D)}else if(A<y)K.scrollBy(0,D);else if(A===y){const J=O.sum(A);H+J>K.scrollTop+K.offsetHeight&&K.scrollBy(0,D)}P()}h.value++}const N=!SS();let k=!1;function $(R){var M;(M=n.onScroll)===null||M===void 0||M.call(n,R),(!N||!k)&&P()}function v(R){var M;if((M=n.onWheel)===null||M===void 0||M.call(n,R),N){const X=c.value;if(X!=null){if(R.deltaX===0&&(X.scrollTop===0&&R.deltaY<=0||X.scrollTop+X.offsetHeight>=X.scrollHeight&&R.deltaY>=0))return;R.preventDefault(),X.scrollTop+=R.deltaY/bh(),X.scrollLeft+=R.deltaX/bh(),P(),k=!0,vf(()=>{k=!1})}}}function E(R){if(i||F(R.target))return;if(n.renderCol==null&&n.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:M}=n;M!==void 0&&M(R)}function P(){const{value:R}=c;R!=null&&(p.value=R.scrollTop,a.value=R.scrollLeft)}function F(R){let M=R;for(;M!==null;){if(M.style.display==="none")return!0;M=M.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:t.computed(()=>{const{itemResizable:R}=n,M=qr(f.value.sum());return h.value,[n.itemsStyle,{boxSizing:"content-box",width:qr(o.value),height:R?"":M,minHeight:R?M:"",paddingTop:qr(n.paddingTop),paddingBottom:qr(n.paddingBottom)}]}),visibleItemsStyle:t.computed(()=>(h.value,{transform:`translateY(${qr(f.value.sum(m.value))})`})),viewportItems:g,listElRef:c,itemsElRef:t.ref(null),scrollTo:b,handleListResize:E,handleListScroll:$,handleListWheel:v,handleItemResize:C}},render(){const{itemResizable:n,keyField:e,keyToIndex:i,visibleItemsTag:r}=this;return t.h(gs,{onResize:this.handleListResize},{default:()=>{var o,s;return t.h("div",t.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?t.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[t.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=i.get(d),f=a!=null?t.h(wh,{index:u,item:c}):void 0,h=l!=null?t.h(wh,{index:u,item:c}):void 0,p=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:h,index:u})[0];return n?t.h(gs,{key:d,onResize:m=>this.handleItemResize(d,m)},{default:()=>p}):(p.key=d,p)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Kn="v-hidden",$S=yi("[v-hidden]",{display:"none!important"}),xh=t.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(n,{slots:e}){const i=t.ref(null),r=t.ref(null);function o(a){const{value:l}=i,{getCounter:c,getTail:d}=n;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Kn)&&u.removeAttribute(Kn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const x of f)x.hasAttribute(Kn)&&x.removeAttribute(Kn);const h=l.offsetWidth,p=[],m=e.tail?d==null?void 0:d():null;let g=m?m.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let x=0;x<y-1;++x){if(x<0)continue;const w=f[x];if(b){w.hasAttribute(Kn)||w.setAttribute(Kn,"");continue}else w.hasAttribute(Kn)&&w.removeAttribute(Kn);const C=w.offsetWidth;if(g+=C,p[x]=C,g>h){const{updateCounter:N}=n;for(let k=x;k>=0;--k){const $=y-1-k;N!==void 0?N($):u.textContent=`${$}`;const v=u.offsetWidth;if(g-=p[k],g+v<=h||k===0){b=!0,x=k-1,m&&(x===-1?(m.style.maxWidth=`${h-v}px`,m.style.boxSizing="border-box"):m.style.maxWidth="");const{onUpdateCount:E}=n;E&&E($);break}}}}const{onUpdateOverflow:_}=n;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Kn,""))}const s=Ii();return $S.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Ja,ssr:s}),t.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:i,counterRef:r,sync:o}},render(){const{$slots:n}=this;return t.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),t.h("div",{class:"v-overflow",ref:"selfRef"},[t.renderSlot(n,"default"),n.counter?n.counter():t.h("span",{style:{display:"inline-block"},ref:"counterRef"}),n.tail?n.tail():null])}});function kh(n){return n instanceof HTMLElement}function Ch(n){for(let e=0;e<n.childNodes.length;e++){const i=n.childNodes[e];if(kh(i)&&(Sh(i)||Ch(i)))return!0}return!1}function vh(n){for(let e=n.childNodes.length-1;e>=0;e--){const i=n.childNodes[e];if(kh(i)&&(Sh(i)||vh(i)))return!0}return!1}function Sh(n){if(!ES(n))return!1;try{n.focus({preventScroll:!0})}catch{}return document.activeElement===n}function ES(n){if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.getAttribute("disabled"))return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return n.type!=="hidden"&&n.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Gr=[];const RS=t.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(n){const e=zC(),i=t.ref(null),r=t.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Gr[Gr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=n.onEsc)===null||y===void 0||y.call(n,b))}t.onMounted(()=>{t.watch(()=>n.active,b=>{b?(f(),Lt("keydown",document,c)):(yt("keydown",document,c),o&&h())},{immediate:!0})}),t.onBeforeUnmount(()=>{yt("keydown",document,c),o&&h()});function d(b){if(!s&&l()){const y=u();if(y===null||y.contains(Wr(b)))return;p("first")}}function u(){const b=i.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var b;if(!n.disabled){if(Gr.push(e),n.autoFocus){const{initialFocusTo:y}=n;y===void 0?p("first"):(b=Qf(y))===null||b===void 0||b.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function h(){var b;if(n.disabled||(document.removeEventListener("focus",d,!0),Gr=Gr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=n;y!==void 0?(b=Qf(y))===null||b===void 0||b.focus({preventScroll:!0}):n.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function p(b){if(l()&&n.active){const y=i.value,_=r.value;if(y!==null&&_!==null){const x=u();if(x==null||x===_){s=!0,y.focus({preventScroll:!0}),s=!1;return}s=!0;const w=b==="first"?Ch(x):vh(x);s=!1,w||(s=!0,y.focus({preventScroll:!0}),s=!1)}}}function m(b){if(s)return;const y=u();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?p("last"):p("first"))}function g(b){s||(b.relatedTarget!==null&&b.relatedTarget===i.value?p("last"):p("first"))}return{focusableStartRef:i,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:m,handleEndFocus:g}},render(){const{default:n}=this.$slots;if(n===void 0)return null;if(this.disabled)return n();const{active:e,focusableStyle:i}=this;return t.h(t.Fragment,null,[t.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:i,onFocus:this.handleStartFocus}),n(),t.h("div",{"aria-hidden":"true",style:i,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function ET(n){return n}const sl="n-internal-select-menu",Bh="n-internal-select-menu-body",Nh="n-drawer-body",Th="n-modal-body",$h="n-popover-body",Eh="__disabled__";function Gn(n){const e=t.inject(Th,null),i=t.inject(Nh,null),r=t.inject($h,null),o=t.inject(Bh,null),s=t.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};t.onMounted(()=>{Lt("fullscreenchange",document,a)}),t.onBeforeUnmount(()=>{yt("fullscreenchange",document,a)})}return fn(()=>{var a;const{to:l}=n;return l!==void 0?l===!1?Eh:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:i!=null&&i.value?i.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}Gn.tdkey=Eh,Gn.propTo={type:[String,Object,Boolean],default:void 0};function PS(n){const e={isDeactivated:!1};let i=!1;return t.onActivated(()=>{if(e.isDeactivated=!1,!i){i=!0;return}n()}),t.onDeactivated(()=>{e.isDeactivated=!0,i||(i=!0)}),e}function Rh(n,e){e&&(t.onMounted(()=>{const{value:i}=n;i&&Kr.registerHandler(i,e)}),t.watch(n,(i,r)=>{r&&Kr.unregisterHandler(r)},{deep:!1}),t.onBeforeUnmount(()=>{const{value:i}=n;i&&Kr.unregisterHandler(i)}))}function Ph(n){return n.replace(/#|\(|\)|,|\s|\./g,"_")}const FS=/^(\d|\.)+$/,Fh=/(\d|\.)+/;function al(n,{c:e=1,offset:i=0,attachPx:r=!0}={}){if(typeof n=="number"){const o=(n+i)*e;return o===0?"0":`${o}px`}else if(typeof n=="string")if(FS.test(n)){const o=(Number(n)+i)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=Fh.exec(n);return o?n.replace(Fh,String((Number(o[0])+i)*e)):n}return n}function Vh(n){const{left:e,right:i,top:r,bottom:o}=xn(n);return`${r} ${e} ${o} ${i}`}var Mh={};function VS(n){let e=".",i="__",r="--",o;if(n){let m=n.blockPrefix;m&&(e=m),m=n.elementPrefix,m&&(i=m),m=n.modifierPrefix,m&&(r=m)}const s={install(m){o=m.c;const g=m.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(m){let g,b;return{before(y){g=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=g,y.bem.els=b},$({context:y,props:_}){return m=typeof m=="string"?m:m({context:y,props:_}),y.bem.b=m,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(m){let g;return{before(b){g=b.bem.els},after(b){b.bem.els=g},$({context:b,props:y}){return m=typeof m=="string"?m:m({context:b,props:y}),b.bem.els=m.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${i}${_}`).join(", ")}}}function c(m){return{$({context:g,props:b}){m=typeof m=="string"?m:m({context:g,props:b});const y=m.split(",").map(w=>w.trim());function _(w){return y.map(C=>`&${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${w!==void 0?`${i}${w}`:""}${r}${C}`).join(", ")}const x=g.bem.els;if(x!==null){if(Mh.NODE_ENV!=="production"&&x.length>=2)throw Error(`[css-render/plugin-bem]: m(${m}) is invalid, using modifier inside multiple elements is not allowed`);return _(x[0])}else return _()}}}function d(m){return{$({context:g,props:b}){m=typeof m=="string"?m:m({context:g,props:b});const y=g.bem.els;if(Mh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${m}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${y!==null&&y.length>0?`${i}${y[0]}`:""}${r}${m})`}}}return Object.assign(s,{cB:((...m)=>o(a(m[0]),m[1],m[2])),cE:((...m)=>o(l(m[0]),m[1],m[2])),cM:((...m)=>o(c(m[0]),m[1],m[2])),cNotM:((...m)=>o(d(m[0]),m[1],m[2]))}),s}const MS=".n-",IS="__",AS="--",Ih=Kf(),Ah=VS({blockPrefix:MS,elementPrefix:IS,modifierPrefix:AS});Ih.use(Ah);const{c:pe,find:PT}=Ih,{cB:ke,cE:Se,cM:Fe,cNotM:kn}=Ah,OS=(...n)=>pe(">",[ke(...n)]);function st(n,e){return n+(e==="default"?"":e.replace(/^[a-z]/,i=>i.toUpperCase()))}let ll;function zS(){return ll===void 0&&(ll=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ll}const DS=new WeakSet;function LS(n){DS.add(n)}function Oh(n){switch(typeof n){case"string":return n||void 0;case"number":return String(n);default:return}}const zh=new Set;function bi(n,e){const i=`[naive/${n}]: ${e}`;zh.has(i)||(zh.add(i),console.error(i))}function Dh(n,e){console.error(`[naive/${n}]: ${e}`)}function Lh(n,e){throw new Error(`[naive/${n}]: ${e}`)}function Et(n,...e){if(Array.isArray(n))n.forEach(i=>Et(i,...e));else return n(...e)}function cl(n,e=!0,i=[]){return n.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&i.push(t.createTextVNode(String(r)));return}if(Array.isArray(r)){cl(r,e,i);return}if(r.type===t.Fragment){if(r.children===null)return;Array.isArray(r.children)&&cl(r.children,e,i)}else{if(r.type===t.Comment&&e)return;i.push(r)}}}),i}function HS(n,e="default",i=void 0){const r=n[e];if(!r)return Dh("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=cl(r(i));return o.length===1?o[0]:(Dh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function WS(n,e=[],i){const r={};return e.forEach(o=>{r[o]=n[o]}),Object.assign(r,i)}function dl(n){const e=n.filter(i=>i!==void 0);if(e.length!==0)return e.length===1?e[0]:i=>{n.forEach(r=>{r&&r(i)})}}function Cr(n,...e){return typeof n=="function"?n(...e):typeof n=="string"?t.createTextVNode(n):typeof n=="number"?t.createTextVNode(String(n)):null}function bs(n){return n.some(e=>t.isVNode(e)?!(e.type===t.Comment||e.type===t.Fragment&&!bs(e.children)):!0)?n:null}function ul(n,e){return n&&bs(n())||e()}function zi(n,e){const i=n&&bs(n());return e(i||null)}function Hh(n){return!(n&&bs(n()))}const fl=t.defineComponent({render(){var n,e;return(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n)}}),Di="n-config-provider",jS="n";function Li(n={},e={defaultBordered:!0}){const i=t.inject(Di,null);return{inlineThemeDisabled:i==null?void 0:i.inlineThemeDisabled,mergedRtlRef:i==null?void 0:i.mergedRtlRef,mergedComponentPropsRef:i==null?void 0:i.mergedComponentPropsRef,mergedBreakpointsRef:i==null?void 0:i.mergedBreakpointsRef,mergedBorderedRef:t.computed(()=>{var r,o;const{bordered:s}=n;return s!==void 0?s:(o=(r=i==null?void 0:i.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:i?i.mergedClsPrefixRef:t.shallowRef(jS),namespaceRef:t.computed(()=>i==null?void 0:i.mergedNamespaceRef.value)}}function Hi(n,e,i,r){i||Lh("useThemeClass","cssVarsRef is not passed");const o=t.inject(Di,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=t.ref(""),c=Ii();let d;const u=`__${n}`,f=()=>{let h=u;const p=e?e.value:void 0,m=s==null?void 0:s.value;m&&(h+=`-${m}`),p&&(h+=`-${p}`);const{themeOverrides:g,builtinThemeOverrides:b}=r;g&&(h+=`-${Qa(JSON.stringify(g))}`),b&&(h+=`-${Qa(JSON.stringify(b))}`),l.value=h,d=()=>{const y=i.value;let _="";for(const x in y)_+=`${x}: ${y[x]};`;pe(`.${h}`,_).mount({id:h,ssr:c,parent:a}),d=void 0}};return t.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const Wh="n-form-item";function qS(n,{defaultSize:e="medium",mergedSize:i,mergedDisabled:r}={}){const o=t.inject(Wh,null);t.provide(Wh,null);const s=t.computed(i?()=>i(o):()=>{const{size:c}=n;if(c)return c;if(o){const{mergedSize:d}=o;if(d.value!==void 0)return d.value}return e}),a=t.computed(r?()=>r(o):()=>{const{disabled:c}=n;return c!==void 0?c:o?o.disabled.value:!1}),l=t.computed(()=>{const{status:c}=n;return c||(o==null?void 0:o.mergedValidationStatus.value)});return t.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 XS={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:n=>`Please load all ${n}'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:n=>`Total ${n} items`,selected:n=>`${n} 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 hl(n){return(e={})=>{const i=e.width?String(e.width):n.defaultWidth;return n.formats[i]||n.formats[n.defaultWidth]}}function Zr(n){return(e,i)=>{const r=i!=null&&i.context?String(i.context):"standalone";let o;if(r==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=i!=null&&i.width?String(i.width):a;o=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=i!=null&&i.width?String(i.width):n.defaultWidth;o=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(e):e;return o[s]}}function Qr(n){return(e,i={})=>{const r=i.width,o=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=e.match(o);if(!s)return null;const a=s[0],l=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(l)?US(l,f=>f.test(a)):YS(l,f=>f.test(a));let d;d=n.valueCallback?n.valueCallback(c):c,d=i.valueCallback?i.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function YS(n,e){for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&e(n[i]))return i}function US(n,e){for(let i=0;i<n.length;i++)if(e(n[i]))return i}function KS(n){return(e,i={})=>{const r=e.match(n.matchPattern);if(!r)return null;const o=r[0],s=e.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=i.valueCallback?i.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const GS={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"}},ZS=(n,e,i)=>{let r;const o=GS[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r},QS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},JS=(n,e,i,r)=>QS[n],eB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nB={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"]},iB={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"]},rB={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"}},oB={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"}},sB={ordinalNumber:(n,e)=>{const i=Number(n),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Zr({values:eB,defaultWidth:"wide"}),quarter:Zr({values:tB,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Zr({values:nB,defaultWidth:"wide"}),day:Zr({values:iB,defaultWidth:"wide"}),dayPeriod:Zr({values:rB,defaultWidth:"wide",formattingValues:oB,defaultFormattingWidth:"wide"})},aB=/^(\d+)(th|st|nd|rd)?/i,lB=/\d+/i,cB={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},dB={any:[/^b/i,/^(a|c)/i]},uB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fB={any:[/1/i,/2/i,/3/i,/4/i]},hB={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},mB={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]},pB={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},gB={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]},yB={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},bB={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}},_B={ordinalNumber:KS({matchPattern:aB,parsePattern:lB,valueCallback:n=>parseInt(n,10)}),era:Qr({matchPatterns:cB,defaultMatchWidth:"wide",parsePatterns:dB,defaultParseWidth:"any"}),quarter:Qr({matchPatterns:uB,defaultMatchWidth:"wide",parsePatterns:fB,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Qr({matchPatterns:hB,defaultMatchWidth:"wide",parsePatterns:mB,defaultParseWidth:"any"}),day:Qr({matchPatterns:pB,defaultMatchWidth:"wide",parsePatterns:gB,defaultParseWidth:"any"}),dayPeriod:Qr({matchPatterns:yB,defaultMatchWidth:"any",parsePatterns:bB,defaultParseWidth:"any"})},wB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},CB={date:hl({formats:wB,defaultWidth:"full"}),time:hl({formats:xB,defaultWidth:"full"}),dateTime:hl({formats:kB,defaultWidth:"full"})},vB={name:"en-US",locale:{code:"en-US",formatDistance:ZS,formatLong:CB,formatRelative:JS,localize:sB,match:_B,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function jh(n){const{mergedLocaleRef:e,mergedDateLocaleRef:i}=t.inject(Di,null)||{},r=t.computed(()=>{var s,a;return(a=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[n])!==null&&a!==void 0?a:XS[n]});return{dateLocaleRef:t.computed(()=>{var s;return(s=i==null?void 0:i.value)!==null&&s!==void 0?s:vB}),localeRef:r}}const Jr="naive-ui-style";function eo(n,e,i){if(!e)return;const r=Ii(),o=t.computed(()=>{const{value:l}=e;if(!l)return;const c=l[n];if(c)return c}),s=t.inject(Di,null),a=()=>{t.watchEffect(()=>{const{value:l}=i,c=`${l}${n}Rtl`;if(Uv(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Jr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():t.onBeforeMount(a),o}const to={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:SB,fontFamily:BB,lineHeight:NB}=to,qh=pe("body",`
|
|
116
|
+
`)}function Qa(n){for(var e=0,i,r=0,o=n.length;o>=4;++r,o-=4)i=n.charCodeAt(r)&255|(n.charCodeAt(++r)&255)<<8|(n.charCodeAt(++r)&255)<<16|(n.charCodeAt(++r)&255)<<24,i=(i&65535)*1540483477+((i>>>16)*59797<<16),i^=i>>>24,e=(i&65535)*1540483477+((i>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(n.charCodeAt(r+2)&255)<<16;case 2:e^=(n.charCodeAt(r+1)&255)<<8;case 1:e^=n.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 Hv(n,e,i,r){const{els:o}=e;if(i===void 0)o.forEach(jf),e.els=[];else{const s=ls(i,r);s&&o.includes(s)&&(jf(s),e.els=o.filter(a=>a!==s))}}function Uf(n,e){n.push(e)}function Wv(n,e,i,r,o,s,a,l,c){let d;if(i===void 0&&(d=e.render(r),i=Qa(d)),c){c.adapter(i,d??e.render(r));return}l===void 0&&(l=document.head);const u=ls(i,l);if(u!==null&&!s)return u;const f=u??Av(i);if(d===void 0&&(d=e.render(r)),f.textContent=d,u!==null)return u;if(a){const h=l.querySelector(`meta[name="${a}"]`);if(h)return l.insertBefore(f,h),Uf(e.els,f),f}return o?l.insertBefore(f,l.querySelector("style, link")):l.appendChild(f),Uf(e.els,f),f}function jv(n){return Lv(this,this.instance,n)}function qv(n={}){const{id:e,ssr:i,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=n;return Wv(this.instance,this,e,r,o,s,a,l,i)}function Xv(n={}){const{id:e,parent:i}=n;Hv(this.instance,this,e,i)}const ds=function(n,e,i,r){return{instance:n,$:e,props:i,children:r,els:[],render:jv,mount:qv,unmount:Xv}},Yv=function(n,e,i,r){return Array.isArray(e)?ds(n,{$:null},null,e):Array.isArray(i)?ds(n,e,null,i):Array.isArray(r)?ds(n,e,i,r):ds(n,e,i,null)};function Kf(n={}){const e={c:((...i)=>Yv(e,...i)),use:(i,...r)=>i.install(e,...r),find:ls,context:{},config:n};return e}function Uv(n,e){if(n===void 0)return!1;if(e){const{context:{ids:i}}=e;return i.has(n)}return ls(n)!==null}const{c:yi}=Kf(),Ja="vueuc-style";function Gf(n){return n&-n}class Zf{constructor(e,i){this.l=e,this.min=i;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,i){if(i===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=i,e+=Gf(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:i,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+=i[e],e-=Gf(e);return s}getBound(e){let i=0,r=this.l;for(;r>i;){const o=Math.floor((i+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(i===o)return this.sum(i+1)<=e?i+1:o;i=o}else return o}return i}}function Qf(n){return typeof n=="string"?document.querySelector(n):n()||null}const Kv=t.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(n){return{showTeleport:xv(t.toRef(n,"show")),mergedTo:t.computed(()=>{const{to:e}=n;return e??"body"})}},render(){return this.showTeleport?this.disabled?Ua("lazy-teleport",this.$slots):t.h(t.Teleport,{disabled:this.disabled,to:this.mergedTo},Ua("lazy-teleport",this.$slots)):null}}),us={top:"bottom",bottom:"top",left:"right",right:"left"},Jf={start:"end",center:"center",end:"start"},el={top:"height",bottom:"height",left:"width",right:"width"},Gv={"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"},Zv={"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"},Qv={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},eh={top:!0,bottom:!1,left:!0,right:!1},th={top:"end",bottom:"start",left:"end",right:"start"};function Jv(n,e,i,r,o,s){if(!o||s)return{placement:n,top:0,left:0};const[a,l]=n.split("-");let c=l??"center",d={top:0,left:0};const u=(p,m,g)=>{let b=0,y=0;const _=i[p]-e[m]-e[p];return _>0&&r&&(g?y=eh[m]?_:-_:b=eh[m]?_:-_),{left:b,top:y}},f=a==="left"||a==="right";if(c!=="center"){const p=Qv[n],m=us[p],g=el[p];if(i[g]>e[g]){if(e[p]+e[g]<i[g]){const b=(i[g]-e[g])/2;e[p]<b||e[m]<b?e[p]<e[m]?(c=Jf[l],d=u(g,m,f)):d=u(g,p,f):c="center"}}else i[g]<e[g]&&e[m]<0&&e[p]>e[m]&&(c=Jf[l])}else{const p=a==="bottom"||a==="top"?"left":"top",m=us[p],g=el[p],b=(i[g]-e[g])/2;(e[p]<b||e[m]<b)&&(e[p]>e[m]?(c=th[p],d=u(g,p,f)):(c=th[m],d=u(g,m,f)))}let h=a;return e[a]<i[el[a]]&&e[a]<e[us[a]]&&(h=us[a]),{placement:c!=="center"?`${h}-${c}`:h,left:d.left,top:d.top}}function eS(n,e){return e?Zv[n]:Gv[n]}function tS(n,e,i,r,o,s){if(s)switch(n){case"bottom-start":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(i.top-e.top)}px`,left:`${Math.round(i.left-e.left+i.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(i.top-e.top+i.height/2)}px`,left:`${Math.round(i.left-e.left+i.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(i.top-e.top+i.height/2)}px`,left:`${Math.round(i.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(i.top-e.top+i.height)}px`,left:`${Math.round(i.left-e.left+i.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(n){case"bottom-start":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(i.top-e.top+r)}px`,left:`${Math.round(i.left-e.left+i.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(i.top-e.top+i.height/2+r)}px`,left:`${Math.round(i.left-e.left+i.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(i.top-e.top+i.height/2+r)}px`,left:`${Math.round(i.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(i.top-e.top+i.height+r)}px`,left:`${Math.round(i.left-e.left+i.width/2+o)}px`,transform:"translateX(-50%)"}}}const nS=yi([yi(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),yi(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[yi("> *",{pointerEvents:"all"})])]),nh=t.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(n){const e=t.inject("VBinder"),i=fn(()=>n.enabled!==void 0?n.enabled:n.show),r=t.ref(null),o=t.ref(null),s=()=>{const{syncTrigger:h}=n;h.includes("scroll")&&e.addScrollListener(c),h.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};t.onMounted(()=>{i.value&&(c(),s())});const l=Ii();nS.mount({id:"vueuc/binder",head:!0,anchorMetaName:Ja,ssr:l}),t.onBeforeUnmount(()=>{a()}),Cv(()=>{i.value&&c()});const c=()=>{if(!i.value)return;const h=r.value;if(h===null)return;const p=e.targetRef,{x:m,y:g,overlap:b}=n,y=m!==void 0&&g!==void 0?Bv(m,g):Ga(p);h.style.setProperty("--v-target-width",`${Math.round(y.width)}px`),h.style.setProperty("--v-target-height",`${Math.round(y.height)}px`);const{width:_,minWidth:x,placement:w,internalShift:C,flip:N}=n;h.setAttribute("v-placement",w),b?h.setAttribute("v-overlap",""):h.removeAttribute("v-overlap");const{style:k}=h;_==="target"?k.width=`${y.width}px`:_!==void 0?k.width=_:k.width="",x==="target"?k.minWidth=`${y.width}px`:x!==void 0?k.minWidth=x:k.minWidth="";const $=Ga(h),v=Ga(o.value),{left:E,top:P,placement:F}=Jv(w,y,$,C,N,b),R=eS(F,b),{left:M,top:X,transform:G}=tS(F,v,y,P,E,b);h.setAttribute("v-placement",F),h.style.setProperty("--v-offset-left",`${Math.round(E)}px`),h.style.setProperty("--v-offset-top",`${Math.round(P)}px`),h.style.transform=`translateX(${M}) translateY(${X}) ${G}`,h.style.setProperty("--v-transform-origin",R),h.style.transformOrigin=R};t.watch(i,h=>{h?(s(),d()):a()});const d=()=>{t.nextTick().then(c).catch(h=>console.error(h))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(h=>{t.watch(t.toRef(n,h),c)}),["teleportDisabled"].forEach(h=>{t.watch(t.toRef(n,h),d)}),t.watch(t.toRef(n,"syncTrigger"),h=>{h.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),h.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=as(),f=fn(()=>{const{to:h}=n;if(h!==void 0)return h;u.value});return{VBinder:e,mergedEnabled:i,offsetContainerRef:o,followerRef:r,mergedTo:f,syncPosition:c}},render(){return t.h(Kv,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var n,e;const i=t.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[t.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n))]);return this.zindexable?t.withDirectives(i,[[Mf,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):i}})}});var Ai=[],iS=function(){return Ai.some(function(n){return n.activeTargets.length>0})},rS=function(){return Ai.some(function(n){return n.skippedTargets.length>0})},ih="ResizeObserver loop completed with undelivered notifications.",oS=function(){var n;typeof ErrorEvent=="function"?n=new ErrorEvent("error",{message:ih}):(n=document.createEvent("Event"),n.initEvent("error",!1,!1),n.message=ih),window.dispatchEvent(n)},Yr;(function(n){n.BORDER_BOX="border-box",n.CONTENT_BOX="content-box",n.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Yr||(Yr={}));var Oi=function(n){return Object.freeze(n)},sS=(function(){function n(e,i){this.inlineSize=e,this.blockSize=i,Oi(this)}return n})(),rh=(function(){function n(e,i,r,o){return this.x=e,this.y=i,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,Oi(this)}return n.prototype.toJSON=function(){var e=this,i=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:i,y:r,top:o,right:s,bottom:a,left:l,width:c,height:d}},n.fromRect=function(e){return new n(e.x,e.y,e.width,e.height)},n})(),tl=function(n){return n instanceof SVGElement&&"getBBox"in n},oh=function(n){if(tl(n)){var e=n.getBBox(),i=e.width,r=e.height;return!i&&!r}var o=n,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||n.getClientRects().length)},sh=function(n){var e;if(n instanceof Element)return!0;var i=(e=n==null?void 0:n.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(i&&n instanceof i.Element)},aS=function(n){switch(n.tagName){case"INPUT":if(n.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Ur=typeof window<"u"?window:{},fs=new WeakMap,ah=/auto|scroll/,lS=/^tb|vertical/,cS=/msie|trident/i.test(Ur.navigator&&Ur.navigator.userAgent),An=function(n){return parseFloat(n||"0")},kr=function(n,e,i){return n===void 0&&(n=0),e===void 0&&(e=0),i===void 0&&(i=!1),new sS((i?e:n)||0,(i?n:e)||0)},lh=Oi({devicePixelContentBoxSize:kr(),borderBoxSize:kr(),contentBoxSize:kr(),contentRect:new rh(0,0,0,0)}),ch=function(n,e){if(e===void 0&&(e=!1),fs.has(n)&&!e)return fs.get(n);if(oh(n))return fs.set(n,lh),lh;var i=getComputedStyle(n),r=tl(n)&&n.ownerSVGElement&&n.getBBox(),o=!cS&&i.boxSizing==="border-box",s=lS.test(i.writingMode||""),a=!r&&ah.test(i.overflowY||""),l=!r&&ah.test(i.overflowX||""),c=r?0:An(i.paddingTop),d=r?0:An(i.paddingRight),u=r?0:An(i.paddingBottom),f=r?0:An(i.paddingLeft),h=r?0:An(i.borderTopWidth),p=r?0:An(i.borderRightWidth),m=r?0:An(i.borderBottomWidth),g=r?0:An(i.borderLeftWidth),b=f+d,y=c+u,_=g+p,x=h+m,w=l?n.offsetHeight-x-n.clientHeight:0,C=a?n.offsetWidth-_-n.clientWidth:0,N=o?b+_:0,k=o?y+x:0,$=r?r.width:An(i.width)-N-C,v=r?r.height:An(i.height)-k-w,E=$+b+C+_,P=v+y+w+x,F=Oi({devicePixelContentBoxSize:kr(Math.round($*devicePixelRatio),Math.round(v*devicePixelRatio),s),borderBoxSize:kr(E,P,s),contentBoxSize:kr($,v,s),contentRect:new rh(f,c,$,v)});return fs.set(n,F),F},dh=function(n,e,i){var r=ch(n,i),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Yr.DEVICE_PIXEL_CONTENT_BOX:return a;case Yr.BORDER_BOX:return o;default:return s}},dS=(function(){function n(e){var i=ch(e);this.target=e,this.contentRect=i.contentRect,this.borderBoxSize=Oi([i.borderBoxSize]),this.contentBoxSize=Oi([i.contentBoxSize]),this.devicePixelContentBoxSize=Oi([i.devicePixelContentBoxSize])}return n})(),uh=function(n){if(oh(n))return 1/0;for(var e=0,i=n.parentNode;i;)e+=1,i=i.parentNode;return e},uS=function(){var n=1/0,e=[];Ai.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new dS(d.target),f=uh(d.target);l.push(u),d.lastReportedSize=dh(d.target,d.observedBox),f<n&&(n=f)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var i=0,r=e;i<r.length;i++){var o=r[i];o()}return n},fh=function(n){Ai.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(o){o.isActive()&&(uh(o.target)>n?i.activeTargets.push(o):i.skippedTargets.push(o))})})},fS=function(){var n=0;for(fh(n);iS();)n=uS(),fh(n);return rS()&&oS(),n>0},nl,hh=[],hS=function(){return hh.splice(0).forEach(function(n){return n()})},mS=function(n){if(!nl){var e=0,i=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return hS()}).observe(i,r),nl=function(){i.textContent="".concat(e?e--:e++)}}hh.push(n),nl()},pS=function(n){mS(function(){requestAnimationFrame(n)})},hs=0,gS=function(){return!!hs},yS=250,bS={attributes:!0,characterData:!0,childList:!0,subtree:!0},mh=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],ph=function(n){return n===void 0&&(n=0),Date.now()+n},il=!1,_S=(function(){function n(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return n.prototype.run=function(e){var i=this;if(e===void 0&&(e=yS),!il){il=!0;var r=ph(e);pS(function(){var o=!1;try{o=fS()}finally{if(il=!1,e=r-ph(),!gS())return;o?i.run(1e3):e>0?i.run(e):i.start()}})}},n.prototype.schedule=function(){this.stop(),this.run()},n.prototype.observe=function(){var e=this,i=function(){return e.observer&&e.observer.observe(document.body,bS)};document.body?i():Ur.addEventListener("DOMContentLoaded",i)},n.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),mh.forEach(function(i){return Ur.addEventListener(i,e.listener,!0)}))},n.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),mh.forEach(function(i){return Ur.removeEventListener(i,e.listener,!0)}),this.stopped=!0)},n})(),rl=new _S,gh=function(n){!hs&&n>0&&rl.start(),hs+=n,!hs&&rl.stop()},wS=function(n){return!tl(n)&&!aS(n)&&getComputedStyle(n).display==="inline"},xS=(function(){function n(e,i){this.target=e,this.observedBox=i||Yr.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return n.prototype.isActive=function(){var e=dh(this.target,this.observedBox,!0);return wS(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},n})(),kS=(function(){function n(e,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=i}return n})(),ms=new WeakMap,yh=function(n,e){for(var i=0;i<n.length;i+=1)if(n[i].target===e)return i;return-1},ps=(function(){function n(){}return n.connect=function(e,i){var r=new kS(e,i);ms.set(e,r)},n.observe=function(e,i,r){var o=ms.get(e),s=o.observationTargets.length===0;yh(o.observationTargets,i)<0&&(s&&Ai.push(o),o.observationTargets.push(new xS(i,r&&r.box)),gh(1),rl.schedule())},n.unobserve=function(e,i){var r=ms.get(e),o=yh(r.observationTargets,i),s=r.observationTargets.length===1;o>=0&&(s&&Ai.splice(Ai.indexOf(r),1),r.observationTargets.splice(o,1),gh(-1))},n.disconnect=function(e){var i=this,r=ms.get(e);r.observationTargets.slice().forEach(function(o){return i.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},n})(),CS=(function(){function n(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.");ps.connect(this,e)}return n.prototype.observe=function(e,i){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!sh(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ps.observe(this,e,i)},n.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(!sh(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ps.unobserve(this,e)},n.prototype.disconnect=function(){ps.disconnect(this)},n.toString=function(){return"function ResizeObserver () { [polyfill code] }"},n})();class vS{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||CS)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const i of e){const r=this.elHandlersMap.get(i.target);r!==void 0&&r(i)}}registerHandler(e,i){this.elHandlersMap.set(e,i),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Kr=new vS,gs=t.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(n){let e=!1;const i=t.getCurrentInstance().proxy;function r(o){const{onResize:s}=n;s!==void 0&&s(o)}t.onMounted(()=>{const o=i.$el;if(o===void 0){Hf("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){Hf("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Kr.registerHandler(o.nextElementSibling,r),e=!0)}),t.onBeforeUnmount(()=>{e&&Kr.unregisterHandler(i.$el.nextElementSibling)})},render(){return t.renderSlot(this.$slots,"default")}});let ys;function SS(){return typeof document>"u"?!1:(ys===void 0&&("matchMedia"in window?ys=window.matchMedia("(pointer:coarse)").matches:ys=!1),ys)}let ol;function bh(){return typeof document>"u"?1:(ol===void 0&&(ol="chrome"in window?window.devicePixelRatio:1),ol)}const _h="VVirtualListXScroll";function BS({columnsRef:n,renderColRef:e,renderItemWithColsRef:i}){const r=t.ref(0),o=t.ref(0),s=t.computed(()=>{const d=n.value;if(d.length===0)return null;const u=new Zf(d.length,0);return d.forEach((f,h)=>{u.add(h,f.width)}),u}),a=fn(()=>{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=fn(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,n.value.length-1):0});return t.provide(_h,{startIndexRef:a,endIndexRef:c,columnsRef:n,renderColRef:e,renderItemWithColsRef:i,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const wh=t.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:n,endIndexRef:e,columnsRef:i,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=t.inject(_h);return{startIndex:n,endIndex:e,columns:i,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:n,endIndex:e,columns:i,renderCol:r,renderItemWithCols:o,getLeft:s,item:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:n,endColIndex:e,allColumns:i,item:a,getLeft:s});if(r!=null){const l=[];for(let c=n;c<=e;++c){const d=i[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),NS=yi(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[yi("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[yi("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),TS=t.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(n){const e=Ii();NS.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:Ja,ssr:e}),t.onMounted(()=>{const{defaultScrollIndex:R,defaultScrollKey:M}=n;R!=null?b({index:R}):M!=null&&b({key:M})});let i=!1,r=!1;t.onActivated(()=>{if(i=!1,!r){r=!0;return}b({top:p.value,left:a.value})}),t.onDeactivated(()=>{i=!0,r||(r=!0)});const o=fn(()=>{if(n.renderCol==null&&n.renderItemWithCols==null||n.columns.length===0)return;let R=0;return n.columns.forEach(M=>{R+=M.width}),R}),s=t.computed(()=>{const R=new Map,{keyField:M}=n;return n.items.forEach((X,G)=>{R.set(X[M],G)}),R}),{scrollLeftRef:a,listWidthRef:l}=BS({columnsRef:t.toRef(n,"columns"),renderColRef:t.toRef(n,"renderCol"),renderItemWithColsRef:t.toRef(n,"renderItemWithCols")}),c=t.ref(null),d=t.ref(void 0),u=new Map,f=t.computed(()=>{const{items:R,itemSize:M,keyField:X}=n,G=new Zf(R.length,M);return R.forEach((Z,O)=>{const A=Z[X],Y=u.get(A);Y!==void 0&&G.add(O,Y)}),G}),h=t.ref(0),p=t.ref(0),m=fn(()=>Math.max(f.value.getBound(p.value-jr(n.paddingTop))-1,0)),g=t.computed(()=>{const{value:R}=d;if(R===void 0)return[];const{items:M,itemSize:X}=n,G=m.value,Z=Math.min(G+Math.ceil(R/X+1),M.length-1),O=[];for(let A=G;A<=Z;++A)O.push(M[A]);return O}),b=(R,M)=>{if(typeof R=="number"){w(R,M,"auto");return}const{left:X,top:G,index:Z,key:O,position:A,behavior:Y,debounce:H=!0}=R;if(X!==void 0||G!==void 0)w(X,G,Y);else if(Z!==void 0)x(Z,Y,H);else if(O!==void 0){const T=s.value.get(O);T!==void 0&&x(T,Y,H)}else A==="bottom"?w(0,Number.MAX_SAFE_INTEGER,Y):A==="top"&&w(0,0,Y)};let y,_=null;function x(R,M,X){const{value:G}=f,Z=G.sum(R)+jr(n.paddingTop);if(!X)c.value.scrollTo({left:0,top:Z,behavior:M});else{y=R,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{y=void 0,_=null},16);const{scrollTop:O,offsetHeight:A}=c.value;if(Z>O){const Y=G.get(R);Z+Y<=O+A||c.value.scrollTo({left:0,top:Z+Y-A,behavior:M})}else c.value.scrollTo({left:0,top:Z,behavior:M})}}function w(R,M,X){c.value.scrollTo({left:R,top:M,behavior:X})}function C(R,M){var X,G,Z;if(i||n.ignoreItemResize||F(M.target))return;const{value:O}=f,A=s.value.get(R),Y=O.get(A),H=(Z=(G=(X=M.borderBoxSize)===null||X===void 0?void 0:X[0])===null||G===void 0?void 0:G.blockSize)!==null&&Z!==void 0?Z:M.contentRect.height;if(H===Y)return;H-n.itemSize===0?u.delete(R):u.set(R,H-n.itemSize);const D=H-Y;if(D===0)return;O.add(A,D);const K=c.value;if(K!=null){if(y===void 0){const J=O.sum(A);K.scrollTop>J&&K.scrollBy(0,D)}else if(A<y)K.scrollBy(0,D);else if(A===y){const J=O.sum(A);H+J>K.scrollTop+K.offsetHeight&&K.scrollBy(0,D)}P()}h.value++}const N=!SS();let k=!1;function $(R){var M;(M=n.onScroll)===null||M===void 0||M.call(n,R),(!N||!k)&&P()}function v(R){var M;if((M=n.onWheel)===null||M===void 0||M.call(n,R),N){const X=c.value;if(X!=null){if(R.deltaX===0&&(X.scrollTop===0&&R.deltaY<=0||X.scrollTop+X.offsetHeight>=X.scrollHeight&&R.deltaY>=0))return;R.preventDefault(),X.scrollTop+=R.deltaY/bh(),X.scrollLeft+=R.deltaX/bh(),P(),k=!0,vf(()=>{k=!1})}}}function E(R){if(i||F(R.target))return;if(n.renderCol==null&&n.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:M}=n;M!==void 0&&M(R)}function P(){const{value:R}=c;R!=null&&(p.value=R.scrollTop,a.value=R.scrollLeft)}function F(R){let M=R;for(;M!==null;){if(M.style.display==="none")return!0;M=M.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:t.computed(()=>{const{itemResizable:R}=n,M=qr(f.value.sum());return h.value,[n.itemsStyle,{boxSizing:"content-box",width:qr(o.value),height:R?"":M,minHeight:R?M:"",paddingTop:qr(n.paddingTop),paddingBottom:qr(n.paddingBottom)}]}),visibleItemsStyle:t.computed(()=>(h.value,{transform:`translateY(${qr(f.value.sum(m.value))})`})),viewportItems:g,listElRef:c,itemsElRef:t.ref(null),scrollTo:b,handleListResize:E,handleListScroll:$,handleListWheel:v,handleItemResize:C}},render(){const{itemResizable:n,keyField:e,keyToIndex:i,visibleItemsTag:r}=this;return t.h(gs,{onResize:this.handleListResize},{default:()=>{var o,s;return t.h("div",t.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?t.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[t.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=i.get(d),f=a!=null?t.h(wh,{index:u,item:c}):void 0,h=l!=null?t.h(wh,{index:u,item:c}):void 0,p=this.$slots.default({item:c,renderedCols:f,renderedItemWithCols:h,index:u})[0];return n?t.h(gs,{key:d,onResize:m=>this.handleItemResize(d,m)},{default:()=>p}):(p.key=d,p)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),Kn="v-hidden",$S=yi("[v-hidden]",{display:"none!important"}),xh=t.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(n,{slots:e}){const i=t.ref(null),r=t.ref(null);function o(a){const{value:l}=i,{getCounter:c,getTail:d}=n;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(Kn)&&u.removeAttribute(Kn);const{children:f}=l;if(a.showAllItemsBeforeCalculate)for(const x of f)x.hasAttribute(Kn)&&x.removeAttribute(Kn);const h=l.offsetWidth,p=[],m=e.tail?d==null?void 0:d():null;let g=m?m.offsetWidth:0,b=!1;const y=l.children.length-(e.tail?1:0);for(let x=0;x<y-1;++x){if(x<0)continue;const w=f[x];if(b){w.hasAttribute(Kn)||w.setAttribute(Kn,"");continue}else w.hasAttribute(Kn)&&w.removeAttribute(Kn);const C=w.offsetWidth;if(g+=C,p[x]=C,g>h){const{updateCounter:N}=n;for(let k=x;k>=0;--k){const $=y-1-k;N!==void 0?N($):u.textContent=`${$}`;const v=u.offsetWidth;if(g-=p[k],g+v<=h||k===0){b=!0,x=k-1,m&&(x===-1?(m.style.maxWidth=`${h-v}px`,m.style.boxSizing="border-box"):m.style.maxWidth="");const{onUpdateCount:E}=n;E&&E($);break}}}}const{onUpdateOverflow:_}=n;b?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(Kn,""))}const s=Ii();return $S.mount({id:"vueuc/overflow",head:!0,anchorMetaName:Ja,ssr:s}),t.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:i,counterRef:r,sync:o}},render(){const{$slots:n}=this;return t.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),t.h("div",{class:"v-overflow",ref:"selfRef"},[t.renderSlot(n,"default"),n.counter?n.counter():t.h("span",{style:{display:"inline-block"},ref:"counterRef"}),n.tail?n.tail():null])}});function kh(n){return n instanceof HTMLElement}function Ch(n){for(let e=0;e<n.childNodes.length;e++){const i=n.childNodes[e];if(kh(i)&&(Sh(i)||Ch(i)))return!0}return!1}function vh(n){for(let e=n.childNodes.length-1;e>=0;e--){const i=n.childNodes[e];if(kh(i)&&(Sh(i)||vh(i)))return!0}return!1}function Sh(n){if(!ES(n))return!1;try{n.focus({preventScroll:!0})}catch{}return document.activeElement===n}function ES(n){if(n.tabIndex>0||n.tabIndex===0&&n.getAttribute("tabIndex")!==null)return!0;if(n.getAttribute("disabled"))return!1;switch(n.nodeName){case"A":return!!n.href&&n.rel!=="ignore";case"INPUT":return n.type!=="hidden"&&n.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Gr=[];const RS=t.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(n){const e=zC(),i=t.ref(null),r=t.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return Gr[Gr.length-1]===e}function c(b){var y;b.code==="Escape"&&l()&&((y=n.onEsc)===null||y===void 0||y.call(n,b))}t.onMounted(()=>{t.watch(()=>n.active,b=>{b?(f(),Lt("keydown",document,c)):(yt("keydown",document,c),o&&h())},{immediate:!0})}),t.onBeforeUnmount(()=>{yt("keydown",document,c),o&&h()});function d(b){if(!s&&l()){const y=u();if(y===null||y.contains(Wr(b)))return;p("first")}}function u(){const b=i.value;if(b===null)return null;let y=b;for(;y=y.nextSibling,!(y===null||y instanceof Element&&y.tagName==="DIV"););return y}function f(){var b;if(!n.disabled){if(Gr.push(e),n.autoFocus){const{initialFocusTo:y}=n;y===void 0?p("first"):(b=Qf(y))===null||b===void 0||b.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function h(){var b;if(n.disabled||(document.removeEventListener("focus",d,!0),Gr=Gr.filter(_=>_!==e),l()))return;const{finalFocusTo:y}=n;y!==void 0?(b=Qf(y))===null||b===void 0||b.focus({preventScroll:!0}):n.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function p(b){if(l()&&n.active){const y=i.value,_=r.value;if(y!==null&&_!==null){const x=u();if(x==null||x===_){s=!0,y.focus({preventScroll:!0}),s=!1;return}s=!0;const w=b==="first"?Ch(x):vh(x);s=!1,w||(s=!0,y.focus({preventScroll:!0}),s=!1)}}}function m(b){if(s)return;const y=u();y!==null&&(b.relatedTarget!==null&&y.contains(b.relatedTarget)?p("last"):p("first"))}function g(b){s||(b.relatedTarget!==null&&b.relatedTarget===i.value?p("last"):p("first"))}return{focusableStartRef:i,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:m,handleEndFocus:g}},render(){const{default:n}=this.$slots;if(n===void 0)return null;if(this.disabled)return n();const{active:e,focusableStyle:i}=this;return t.h(t.Fragment,null,[t.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:i,onFocus:this.handleStartFocus}),n(),t.h("div",{"aria-hidden":"true",style:i,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function ET(n){return n}const sl="n-internal-select-menu",Bh="n-internal-select-menu-body",Nh="n-drawer-body",Th="n-modal-body",$h="n-popover-body",Eh="__disabled__";function Gn(n){const e=t.inject(Th,null),i=t.inject(Nh,null),r=t.inject($h,null),o=t.inject(Bh,null),s=t.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};t.onMounted(()=>{Lt("fullscreenchange",document,a)}),t.onBeforeUnmount(()=>{yt("fullscreenchange",document,a)})}return fn(()=>{var a;const{to:l}=n;return l!==void 0?l===!1?Eh:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:i!=null&&i.value?i.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}Gn.tdkey=Eh,Gn.propTo={type:[String,Object,Boolean],default:void 0};function PS(n){const e={isDeactivated:!1};let i=!1;return t.onActivated(()=>{if(e.isDeactivated=!1,!i){i=!0;return}n()}),t.onDeactivated(()=>{e.isDeactivated=!0,i||(i=!0)}),e}function Rh(n,e){e&&(t.onMounted(()=>{const{value:i}=n;i&&Kr.registerHandler(i,e)}),t.watch(n,(i,r)=>{r&&Kr.unregisterHandler(r)},{deep:!1}),t.onBeforeUnmount(()=>{const{value:i}=n;i&&Kr.unregisterHandler(i)}))}function Ph(n){return n.replace(/#|\(|\)|,|\s|\./g,"_")}const FS=/^(\d|\.)+$/,Fh=/(\d|\.)+/;function al(n,{c:e=1,offset:i=0,attachPx:r=!0}={}){if(typeof n=="number"){const o=(n+i)*e;return o===0?"0":`${o}px`}else if(typeof n=="string")if(FS.test(n)){const o=(Number(n)+i)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=Fh.exec(n);return o?n.replace(Fh,String((Number(o[0])+i)*e)):n}return n}function Vh(n){const{left:e,right:i,top:r,bottom:o}=xn(n);return`${r} ${e} ${o} ${i}`}var Mh={};function VS(n){let e=".",i="__",r="--",o;if(n){let m=n.blockPrefix;m&&(e=m),m=n.elementPrefix,m&&(i=m),m=n.modifierPrefix,m&&(r=m)}const s={install(m){o=m.c;const g=m.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(m){let g,b;return{before(y){g=y.bem.b,b=y.bem.els,y.bem.els=null},after(y){y.bem.b=g,y.bem.els=b},$({context:y,props:_}){return m=typeof m=="string"?m:m({context:y,props:_}),y.bem.b=m,`${(_==null?void 0:_.bPrefix)||e}${y.bem.b}`}}}function l(m){let g;return{before(b){g=b.bem.els},after(b){b.bem.els=g},$({context:b,props:y}){return m=typeof m=="string"?m:m({context:b,props:y}),b.bem.els=m.split(",").map(_=>_.trim()),b.bem.els.map(_=>`${(y==null?void 0:y.bPrefix)||e}${b.bem.b}${i}${_}`).join(", ")}}}function c(m){return{$({context:g,props:b}){m=typeof m=="string"?m:m({context:g,props:b});const y=m.split(",").map(w=>w.trim());function _(w){return y.map(C=>`&${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${w!==void 0?`${i}${w}`:""}${r}${C}`).join(", ")}const x=g.bem.els;if(x!==null){if(Mh.NODE_ENV!=="production"&&x.length>=2)throw Error(`[css-render/plugin-bem]: m(${m}) is invalid, using modifier inside multiple elements is not allowed`);return _(x[0])}else return _()}}}function d(m){return{$({context:g,props:b}){m=typeof m=="string"?m:m({context:g,props:b});const y=g.bem.els;if(Mh.NODE_ENV!=="production"&&y!==null&&y.length>=2)throw Error(`[css-render/plugin-bem]: notM(${m}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(b==null?void 0:b.bPrefix)||e}${g.bem.b}${y!==null&&y.length>0?`${i}${y[0]}`:""}${r}${m})`}}}return Object.assign(s,{cB:((...m)=>o(a(m[0]),m[1],m[2])),cE:((...m)=>o(l(m[0]),m[1],m[2])),cM:((...m)=>o(c(m[0]),m[1],m[2])),cNotM:((...m)=>o(d(m[0]),m[1],m[2]))}),s}const MS=".n-",IS="__",AS="--",Ih=Kf(),Ah=VS({blockPrefix:MS,elementPrefix:IS,modifierPrefix:AS});Ih.use(Ah);const{c:pe,find:PT}=Ih,{cB:ke,cE:ve,cM:Fe,cNotM:kn}=Ah,OS=(...n)=>pe(">",[ke(...n)]);function st(n,e){return n+(e==="default"?"":e.replace(/^[a-z]/,i=>i.toUpperCase()))}let ll;function zS(){return ll===void 0&&(ll=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ll}const DS=new WeakSet;function LS(n){DS.add(n)}function Oh(n){switch(typeof n){case"string":return n||void 0;case"number":return String(n);default:return}}const zh=new Set;function bi(n,e){const i=`[naive/${n}]: ${e}`;zh.has(i)||(zh.add(i),console.error(i))}function Dh(n,e){console.error(`[naive/${n}]: ${e}`)}function Lh(n,e){throw new Error(`[naive/${n}]: ${e}`)}function Et(n,...e){if(Array.isArray(n))n.forEach(i=>Et(i,...e));else return n(...e)}function cl(n,e=!0,i=[]){return n.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&i.push(t.createTextVNode(String(r)));return}if(Array.isArray(r)){cl(r,e,i);return}if(r.type===t.Fragment){if(r.children===null)return;Array.isArray(r.children)&&cl(r.children,e,i)}else{if(r.type===t.Comment&&e)return;i.push(r)}}}),i}function HS(n,e="default",i=void 0){const r=n[e];if(!r)return Dh("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=cl(r(i));return o.length===1?o[0]:(Dh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function WS(n,e=[],i){const r={};return e.forEach(o=>{r[o]=n[o]}),Object.assign(r,i)}function dl(n){const e=n.filter(i=>i!==void 0);if(e.length!==0)return e.length===1?e[0]:i=>{n.forEach(r=>{r&&r(i)})}}function Cr(n,...e){return typeof n=="function"?n(...e):typeof n=="string"?t.createTextVNode(n):typeof n=="number"?t.createTextVNode(String(n)):null}function bs(n){return n.some(e=>t.isVNode(e)?!(e.type===t.Comment||e.type===t.Fragment&&!bs(e.children)):!0)?n:null}function ul(n,e){return n&&bs(n())||e()}function zi(n,e){const i=n&&bs(n());return e(i||null)}function Hh(n){return!(n&&bs(n()))}const fl=t.defineComponent({render(){var n,e;return(e=(n=this.$slots).default)===null||e===void 0?void 0:e.call(n)}}),Di="n-config-provider",jS="n";function Li(n={},e={defaultBordered:!0}){const i=t.inject(Di,null);return{inlineThemeDisabled:i==null?void 0:i.inlineThemeDisabled,mergedRtlRef:i==null?void 0:i.mergedRtlRef,mergedComponentPropsRef:i==null?void 0:i.mergedComponentPropsRef,mergedBreakpointsRef:i==null?void 0:i.mergedBreakpointsRef,mergedBorderedRef:t.computed(()=>{var r,o;const{bordered:s}=n;return s!==void 0?s:(o=(r=i==null?void 0:i.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:i?i.mergedClsPrefixRef:t.shallowRef(jS),namespaceRef:t.computed(()=>i==null?void 0:i.mergedNamespaceRef.value)}}function Hi(n,e,i,r){i||Lh("useThemeClass","cssVarsRef is not passed");const o=t.inject(Di,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=t.ref(""),c=Ii();let d;const u=`__${n}`,f=()=>{let h=u;const p=e?e.value:void 0,m=s==null?void 0:s.value;m&&(h+=`-${m}`),p&&(h+=`-${p}`);const{themeOverrides:g,builtinThemeOverrides:b}=r;g&&(h+=`-${Qa(JSON.stringify(g))}`),b&&(h+=`-${Qa(JSON.stringify(b))}`),l.value=h,d=()=>{const y=i.value;let _="";for(const x in y)_+=`${x}: ${y[x]};`;pe(`.${h}`,_).mount({id:h,ssr:c,parent:a}),d=void 0}};return t.watchEffect(()=>{f()}),{themeClass:l,onRender:()=>{d==null||d()}}}const Wh="n-form-item";function qS(n,{defaultSize:e="medium",mergedSize:i,mergedDisabled:r}={}){const o=t.inject(Wh,null);t.provide(Wh,null);const s=t.computed(i?()=>i(o):()=>{const{size:c}=n;if(c)return c;if(o){const{mergedSize:d}=o;if(d.value!==void 0)return d.value}return e}),a=t.computed(r?()=>r(o):()=>{const{disabled:c}=n;return c!==void 0?c:o?o.disabled.value:!1}),l=t.computed(()=>{const{status:c}=n;return c||(o==null?void 0:o.mergedValidationStatus.value)});return t.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 XS={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:n=>`Please load all ${n}'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:n=>`Total ${n} items`,selected:n=>`${n} 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 hl(n){return(e={})=>{const i=e.width?String(e.width):n.defaultWidth;return n.formats[i]||n.formats[n.defaultWidth]}}function Zr(n){return(e,i)=>{const r=i!=null&&i.context?String(i.context):"standalone";let o;if(r==="formatting"&&n.formattingValues){const a=n.defaultFormattingWidth||n.defaultWidth,l=i!=null&&i.width?String(i.width):a;o=n.formattingValues[l]||n.formattingValues[a]}else{const a=n.defaultWidth,l=i!=null&&i.width?String(i.width):n.defaultWidth;o=n.values[l]||n.values[a]}const s=n.argumentCallback?n.argumentCallback(e):e;return o[s]}}function Qr(n){return(e,i={})=>{const r=i.width,o=r&&n.matchPatterns[r]||n.matchPatterns[n.defaultMatchWidth],s=e.match(o);if(!s)return null;const a=s[0],l=r&&n.parsePatterns[r]||n.parsePatterns[n.defaultParseWidth],c=Array.isArray(l)?US(l,f=>f.test(a)):YS(l,f=>f.test(a));let d;d=n.valueCallback?n.valueCallback(c):c,d=i.valueCallback?i.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function YS(n,e){for(const i in n)if(Object.prototype.hasOwnProperty.call(n,i)&&e(n[i]))return i}function US(n,e){for(let i=0;i<n.length;i++)if(e(n[i]))return i}function KS(n){return(e,i={})=>{const r=e.match(n.matchPattern);if(!r)return null;const o=r[0],s=e.match(n.parsePattern);if(!s)return null;let a=n.valueCallback?n.valueCallback(s[0]):s[0];a=i.valueCallback?i.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const GS={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"}},ZS=(n,e,i)=>{let r;const o=GS[n];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),i!=null&&i.addSuffix?i.comparison&&i.comparison>0?"in "+r:r+" ago":r},QS={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},JS=(n,e,i,r)=>QS[n],eB={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},tB={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},nB={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"]},iB={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"]},rB={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"}},oB={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"}},sB={ordinalNumber:(n,e)=>{const i=Number(n),r=i%100;if(r>20||r<10)switch(r%10){case 1:return i+"st";case 2:return i+"nd";case 3:return i+"rd"}return i+"th"},era:Zr({values:eB,defaultWidth:"wide"}),quarter:Zr({values:tB,defaultWidth:"wide",argumentCallback:n=>n-1}),month:Zr({values:nB,defaultWidth:"wide"}),day:Zr({values:iB,defaultWidth:"wide"}),dayPeriod:Zr({values:rB,defaultWidth:"wide",formattingValues:oB,defaultFormattingWidth:"wide"})},aB=/^(\d+)(th|st|nd|rd)?/i,lB=/\d+/i,cB={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},dB={any:[/^b/i,/^(a|c)/i]},uB={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},fB={any:[/1/i,/2/i,/3/i,/4/i]},hB={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},mB={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]},pB={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},gB={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]},yB={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},bB={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}},_B={ordinalNumber:KS({matchPattern:aB,parsePattern:lB,valueCallback:n=>parseInt(n,10)}),era:Qr({matchPatterns:cB,defaultMatchWidth:"wide",parsePatterns:dB,defaultParseWidth:"any"}),quarter:Qr({matchPatterns:uB,defaultMatchWidth:"wide",parsePatterns:fB,defaultParseWidth:"any",valueCallback:n=>n+1}),month:Qr({matchPatterns:hB,defaultMatchWidth:"wide",parsePatterns:mB,defaultParseWidth:"any"}),day:Qr({matchPatterns:pB,defaultMatchWidth:"wide",parsePatterns:gB,defaultParseWidth:"any"}),dayPeriod:Qr({matchPatterns:yB,defaultMatchWidth:"any",parsePatterns:bB,defaultParseWidth:"any"})},wB={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},xB={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},kB={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},CB={date:hl({formats:wB,defaultWidth:"full"}),time:hl({formats:xB,defaultWidth:"full"}),dateTime:hl({formats:kB,defaultWidth:"full"})},vB={name:"en-US",locale:{code:"en-US",formatDistance:ZS,formatLong:CB,formatRelative:JS,localize:sB,match:_B,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function jh(n){const{mergedLocaleRef:e,mergedDateLocaleRef:i}=t.inject(Di,null)||{},r=t.computed(()=>{var s,a;return(a=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[n])!==null&&a!==void 0?a:XS[n]});return{dateLocaleRef:t.computed(()=>{var s;return(s=i==null?void 0:i.value)!==null&&s!==void 0?s:vB}),localeRef:r}}const Jr="naive-ui-style";function eo(n,e,i){if(!e)return;const r=Ii(),o=t.computed(()=>{const{value:l}=e;if(!l)return;const c=l[n];if(c)return c}),s=t.inject(Di,null),a=()=>{t.watchEffect(()=>{const{value:l}=i,c=`${l}${n}Rtl`;if(Uv(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Jr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():t.onBeforeMount(a),o}const to={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:SB,fontFamily:BB,lineHeight:NB}=to,qh=pe("body",`
|
|
117
117
|
margin: 0;
|
|
118
118
|
font-size: ${SB};
|
|
119
119
|
font-family: ${BB};
|
|
@@ -139,7 +139,7 @@ ${o}
|
|
|
139
139
|
height: 1em;
|
|
140
140
|
width: 1em;
|
|
141
141
|
position: relative;
|
|
142
|
-
`,[pe(">",[
|
|
142
|
+
`,[pe(">",[ve("clear",`
|
|
143
143
|
font-size: var(--n-clear-size);
|
|
144
144
|
height: 1em;
|
|
145
145
|
width: 1em;
|
|
@@ -151,9 +151,9 @@ ${o}
|
|
|
151
151
|
color: var(--n-clear-color-hover)!important;
|
|
152
152
|
`),pe("&:active",`
|
|
153
153
|
color: var(--n-clear-color-pressed)!important;
|
|
154
|
-
`)]),
|
|
154
|
+
`)]),ve("placeholder",`
|
|
155
155
|
display: flex;
|
|
156
|
-
`),
|
|
156
|
+
`),ve("clear, placeholder",`
|
|
157
157
|
position: absolute;
|
|
158
158
|
left: 50%;
|
|
159
159
|
top: 50%;
|
|
@@ -215,18 +215,18 @@ ${o}
|
|
|
215
215
|
line-height: 0;
|
|
216
216
|
width: 1em;
|
|
217
217
|
height: 1em;
|
|
218
|
-
`,[
|
|
218
|
+
`,[ve("transition-wrapper",`
|
|
219
219
|
position: absolute;
|
|
220
220
|
width: 100%;
|
|
221
221
|
height: 100%;
|
|
222
|
-
`,[ml()]),
|
|
222
|
+
`,[ml()]),ve("placeholder",`
|
|
223
223
|
position: absolute;
|
|
224
224
|
left: 50%;
|
|
225
225
|
top: 50%;
|
|
226
226
|
transform: translateX(-50%) translateY(-50%);
|
|
227
|
-
`,[ml({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),
|
|
227
|
+
`,[ml({left:"50%",top:"50%",originalTransform:"translateX(-50%) translateY(-50%)"})]),ve("container",`
|
|
228
228
|
animation: rotator 3s linear infinite both;
|
|
229
|
-
`,[
|
|
229
|
+
`,[ve("icon",`
|
|
230
230
|
height: 1em;
|
|
231
231
|
width: 1em;
|
|
232
232
|
`)])])]),pl="1.6s",HB={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},Uh=t.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}},HB),setup(n){_s("-base-loading",LB,t.toRef(n,"clsPrefix"))},render(){const{clsPrefix:n,radius:e,strokeWidth:i,stroke:r,scale:o}=this,s=e/o;return t.h("div",{class:`${n}-base-loading`,role:"img","aria-label":"loading"},t.h(Xh,null,{default:()=>this.show?t.h("div",{key:"icon",class:`${n}-base-loading__transition-wrapper`},t.h("div",{class:`${n}-base-loading__container`},t.h("svg",{class:`${n}-base-loading__icon`,viewBox:`0 0 ${2*s} ${2*s}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},t.h("g",null,t.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${s} ${s};270 ${s} ${s}`,begin:"0s",dur:pl,fill:"freeze",repeatCount:"indefinite"}),t.h("circle",{class:`${n}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":i,"stroke-linecap":"round",cx:s,cy:s,r:e-i/2,"stroke-dasharray":5.67*e,"stroke-dashoffset":18.48*e},t.h("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${s} ${s};135 ${s} ${s};450 ${s} ${s}`,begin:"0s",dur:pl,fill:"freeze",repeatCount:"indefinite"}),t.h("animate",{attributeName:"stroke-dashoffset",values:`${5.67*e};${1.42*e};${5.67*e}`,begin:"0s",dur:pl,fill:"freeze",repeatCount:"indefinite"})))))):t.h("div",{key:"placeholder",class:`${n}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:Kh}=to;function WB({name:n="fade-in",enterDuration:e="0.2s",leaveDuration:i="0.2s",enterCubicBezier:r=Kh,leaveCubicBezier:o=Kh}={}){return[pe(`&.${n}-transition-enter-active`,{transition:`all ${e} ${r}!important`}),pe(`&.${n}-transition-leave-active`,{transition:`all ${i} ${o}!important`}),pe(`&.${n}-transition-enter-from, &.${n}-transition-leave-to`,{opacity:0}),pe(`&.${n}-transition-leave-from, &.${n}-transition-enter-to`,{opacity:1})]}const xe={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"},jB=Vi(xe.neutralBase),Gh=Vi(xe.neutralInvertBase),qB=`rgba(${Gh.slice(0,3).join(", ")}, `;function Zh(n){return`${qB+String(n)})`}function Pt(n){const e=Array.from(Gh);return e[3]=Number(n),AC(jB,e)}const Wi=Object.assign(Object.assign({name:"common"},to),{baseColor:xe.neutralBase,primaryColor:xe.primaryDefault,primaryColorHover:xe.primaryHover,primaryColorPressed:xe.primaryActive,primaryColorSuppl:xe.primarySuppl,infoColor:xe.infoDefault,infoColorHover:xe.infoHover,infoColorPressed:xe.infoActive,infoColorSuppl:xe.infoSuppl,successColor:xe.successDefault,successColorHover:xe.successHover,successColorPressed:xe.successActive,successColorSuppl:xe.successSuppl,warningColor:xe.warningDefault,warningColorHover:xe.warningHover,warningColorPressed:xe.warningActive,warningColorSuppl:xe.warningSuppl,errorColor:xe.errorDefault,errorColorHover:xe.errorHover,errorColorPressed:xe.errorActive,errorColorSuppl:xe.errorSuppl,textColorBase:xe.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:Pt(xe.alpha4),placeholderColor:Pt(xe.alpha4),placeholderColorDisabled:Pt(xe.alpha5),iconColor:Pt(xe.alpha4),iconColorHover:ns(Pt(xe.alpha4),{lightness:.75}),iconColorPressed:ns(Pt(xe.alpha4),{lightness:.9}),iconColorDisabled:Pt(xe.alpha5),opacity1:xe.alpha1,opacity2:xe.alpha2,opacity3:xe.alpha3,opacity4:xe.alpha4,opacity5:xe.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:Pt(Number(xe.alphaClose)),closeIconColorHover:Pt(Number(xe.alphaClose)),closeIconColorPressed:Pt(Number(xe.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:Pt(xe.alpha4),clearColorHover:ns(Pt(xe.alpha4),{lightness:.75}),clearColorPressed:ns(Pt(xe.alpha4),{lightness:.9}),scrollbarColor:Zh(xe.alphaScrollbar),scrollbarColorHover:Zh(xe.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Pt(xe.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:xe.neutralPopover,tableColor:xe.neutralCard,cardColor:xe.neutralCard,modalColor:xe.neutralModal,bodyColor:xe.neutralBody,tagColor:"#eee",avatarColor:Pt(xe.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:Pt(xe.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:xe.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)"}),XB={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function YB(n){const{scrollbarColor:e,scrollbarColorHover:i,scrollbarHeight:r,scrollbarWidth:o,scrollbarBorderRadius:s}=n;return Object.assign(Object.assign({},XB),{height:r,width:o,borderRadius:s,color:e,colorHover:i})}const gl={name:"Scrollbar",common:Wi,self:YB},UB=ke("scrollbar",`
|
|
@@ -257,7 +257,7 @@ ${o}
|
|
|
257
257
|
-webkit-user-select: none;
|
|
258
258
|
`,[Fe("horizontal",`
|
|
259
259
|
height: var(--n-scrollbar-height);
|
|
260
|
-
`,[pe(">",[
|
|
260
|
+
`,[pe(">",[ve("scrollbar",`
|
|
261
261
|
height: var(--n-scrollbar-height);
|
|
262
262
|
border-radius: var(--n-scrollbar-border-radius);
|
|
263
263
|
right: 0;
|
|
@@ -273,7 +273,7 @@ ${o}
|
|
|
273
273
|
left: var(--n-scrollbar-rail-left-horizontal-bottom);
|
|
274
274
|
`),Fe("vertical",`
|
|
275
275
|
width: var(--n-scrollbar-width);
|
|
276
|
-
`,[pe(">",[
|
|
276
|
+
`,[pe(">",[ve("scrollbar",`
|
|
277
277
|
width: var(--n-scrollbar-width);
|
|
278
278
|
border-radius: var(--n-scrollbar-border-radius);
|
|
279
279
|
bottom: 0;
|
|
@@ -287,19 +287,19 @@ ${o}
|
|
|
287
287
|
right: var(--n-scrollbar-rail-right-vertical-right);
|
|
288
288
|
bottom: var(--n-scrollbar-rail-bottom-vertical-right);
|
|
289
289
|
left: var(--n-scrollbar-rail-left-vertical-right);
|
|
290
|
-
`),Fe("disabled",[pe(">",[
|
|
290
|
+
`),Fe("disabled",[pe(">",[ve("scrollbar","pointer-events: none;")])]),pe(">",[ve("scrollbar",`
|
|
291
291
|
z-index: 1;
|
|
292
292
|
position: absolute;
|
|
293
293
|
cursor: pointer;
|
|
294
294
|
pointer-events: all;
|
|
295
295
|
background-color: var(--n-scrollbar-color);
|
|
296
296
|
transition: background-color .2s var(--n-scrollbar-bezier);
|
|
297
|
-
`,[WB(),pe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),KB=Object.assign(Object.assign({},Rt.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"}}),Qh=t.defineComponent({name:"Scrollbar",props:KB,inheritAttrs:!1,setup(n){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedRtlRef:r}=Li(n),o=eo("Scrollbar",r,e),s=t.ref(null),a=t.ref(null),l=t.ref(null),c=t.ref(null),d=t.ref(null),u=t.ref(null),f=t.ref(null),h=t.ref(null),p=t.ref(null),m=t.ref(null),g=t.ref(null),b=t.ref(0),y=t.ref(0),_=t.ref(!1),x=t.ref(!1);let w=!1,C=!1,N,k,$=0,v=0,E=0,P=0;const F=Sv(),R=Rt("Scrollbar","-scrollbar",UB,gl,n,e),M=t.computed(()=>{const{value:z}=h,{value:Q}=u,{value:se}=m;return z===null||Q===null||se===null?0:Math.min(z,se*z/Q+jr(R.value.self.width)*1.5)}),X=t.computed(()=>`${M.value}px`),G=t.computed(()=>{const{value:z}=p,{value:Q}=f,{value:se}=g;return z===null||Q===null||se===null?0:se*z/Q+jr(R.value.self.height)*1.5}),Z=t.computed(()=>`${G.value}px`),O=t.computed(()=>{const{value:z}=h,{value:Q}=b,{value:se}=u,{value:ye}=m;if(z===null||se===null||ye===null)return 0;{const we=se-z;return we?Q/we*(ye-M.value):0}}),A=t.computed(()=>`${O.value}px`),Y=t.computed(()=>{const{value:z}=p,{value:Q}=y,{value:se}=f,{value:ye}=g;if(z===null||se===null||ye===null)return 0;{const we=se-z;return we?Q/we*(ye-G.value):0}}),H=t.computed(()=>`${Y.value}px`),T=t.computed(()=>{const{value:z}=h,{value:Q}=u;return z!==null&&Q!==null&&Q>z}),D=t.computed(()=>{const{value:z}=p,{value:Q}=f;return z!==null&&Q!==null&&Q>z}),K=t.computed(()=>{const{trigger:z}=n;return z==="none"||_.value}),J=t.computed(()=>{const{trigger:z}=n;return z==="none"||x.value}),U=t.computed(()=>{const{container:z}=n;return z?z():a.value}),q=t.computed(()=>{const{content:z}=n;return z?z():l.value}),L=(z,Q)=>{if(!n.scrollable)return;if(typeof z=="number"){ge(z,Q??0,0,!1,"auto");return}const{left:se,top:ye,index:we,elSize:ve,position:Ne,behavior:$e,el:rt,debounce:Hn=!0}=z;(se!==void 0||ye!==void 0)&&ge(se??0,ye??0,0,!1,$e),rt!==void 0?ge(0,rt.offsetTop,rt.offsetHeight,Hn,$e):we!==void 0&&ve!==void 0?ge(0,we*ve,ve,Hn,$e):Ne==="bottom"?ge(0,Number.MAX_SAFE_INTEGER,0,!1,$e):Ne==="top"&&ge(0,0,0,!1,$e)},le=PS(()=>{n.container||L({top:b.value,left:y.value})}),ue=()=>{le.isDeactivated||de()},oe=z=>{if(le.isDeactivated)return;const{onResize:Q}=n;Q&&Q(z),de()},fe=(z,Q)=>{if(!n.scrollable)return;const{value:se}=U;se&&(typeof z=="object"?se.scrollBy(z):se.scrollBy(z,Q||0))};function ge(z,Q,se,ye,we){const{value:ve}=U;if(ve){if(ye){const{scrollTop:Ne,offsetHeight:$e}=ve;if(Q>Ne){Q+se<=Ne+$e||ve.scrollTo({left:z,top:Q+se-$e,behavior:we});return}}ve.scrollTo({left:z,top:Q,behavior:we})}}function _e(){It(),en(),de()}function Qe(){Re()}function Re(){Mt(),vn()}function Mt(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{x.value=!1},n.duration)}function vn(){N!==void 0&&window.clearTimeout(N),N=window.setTimeout(()=>{_.value=!1},n.duration)}function It(){N!==void 0&&window.clearTimeout(N),_.value=!0}function en(){k!==void 0&&window.clearTimeout(k),x.value=!0}function Ln(z){const{onScroll:Q}=n;Q&&Q(z),mn()}function mn(){const{value:z}=U;z&&(b.value=z.scrollTop,y.value=z.scrollLeft*(o!=null&&o.value?-1:1))}function _t(){const{value:z}=q;z&&(u.value=z.offsetHeight,f.value=z.offsetWidth);const{value:Q}=U;Q&&(h.value=Q.offsetHeight,p.value=Q.offsetWidth);const{value:se}=d,{value:ye}=c;se&&(g.value=se.offsetWidth),ye&&(m.value=ye.offsetHeight)}function ae(){const{value:z}=U;z&&(b.value=z.scrollTop,y.value=z.scrollLeft*(o!=null&&o.value?-1:1),h.value=z.offsetHeight,p.value=z.offsetWidth,u.value=z.scrollHeight,f.value=z.scrollWidth);const{value:Q}=d,{value:se}=c;Q&&(g.value=Q.offsetWidth),se&&(m.value=se.offsetHeight)}function de(){n.scrollable&&(n.useUnifiedContainer?ae():(_t(),mn()))}function Ge(z){var Q;return!(!((Q=s.value)===null||Q===void 0)&&Q.contains(Wr(z)))}function Ui(z){z.preventDefault(),z.stopPropagation(),C=!0,Lt("mousemove",window,oi,!0),Lt("mouseup",window,si,!0),v=y.value,E=o!=null&&o.value?window.innerWidth-z.clientX:z.clientX}function oi(z){if(!C)return;N!==void 0&&window.clearTimeout(N),k!==void 0&&window.clearTimeout(k);const{value:Q}=p,{value:se}=f,{value:ye}=G;if(Q===null||se===null)return;const ve=(o!=null&&o.value?window.innerWidth-z.clientX-E:z.clientX-E)*(se-Q)/(Q-ye),Ne=se-Q;let $e=v+ve;$e=Math.min(Ne,$e),$e=Math.max($e,0);const{value:rt}=U;if(rt){rt.scrollLeft=$e*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:Hn}=n;Hn&&Hn($e)}}function si(z){z.preventDefault(),z.stopPropagation(),yt("mousemove",window,oi,!0),yt("mouseup",window,si,!0),C=!1,de(),Ge(z)&&Re()}function at(z){z.preventDefault(),z.stopPropagation(),w=!0,Lt("mousemove",window,qe,!0),Lt("mouseup",window,on,!0),$=b.value,P=z.clientY}function qe(z){if(!w)return;N!==void 0&&window.clearTimeout(N),k!==void 0&&window.clearTimeout(k);const{value:Q}=h,{value:se}=u,{value:ye}=M;if(Q===null||se===null)return;const ve=(z.clientY-P)*(se-Q)/(Q-ye),Ne=se-Q;let $e=$+ve;$e=Math.min(Ne,$e),$e=Math.max($e,0);const{value:rt}=U;rt&&(rt.scrollTop=$e)}function on(z){z.preventDefault(),z.stopPropagation(),yt("mousemove",window,qe,!0),yt("mouseup",window,on,!0),w=!1,de(),Ge(z)&&Re()}t.watchEffect(()=>{const{value:z}=D,{value:Q}=T,{value:se}=e,{value:ye}=d,{value:we}=c;ye&&(z?ye.classList.remove(`${se}-scrollbar-rail--disabled`):ye.classList.add(`${se}-scrollbar-rail--disabled`)),we&&(Q?we.classList.remove(`${se}-scrollbar-rail--disabled`):we.classList.add(`${se}-scrollbar-rail--disabled`))}),t.onMounted(()=>{n.container||de()}),t.onBeforeUnmount(()=>{N!==void 0&&window.clearTimeout(N),k!==void 0&&window.clearTimeout(k),yt("mousemove",window,qe,!0),yt("mouseup",window,on,!0)});const sn=t.computed(()=>{const{common:{cubicBezierEaseInOut:z},self:{color:Q,colorHover:se,height:ye,width:we,borderRadius:ve,railInsetHorizontalTop:Ne,railInsetHorizontalBottom:$e,railInsetVerticalRight:rt,railInsetVerticalLeft:Hn,railColor:Sl}}=R.value,{top:Bl,right:Nl,bottom:Tl,left:$l}=xn(Ne),{top:El,right:Rl,bottom:Pl,left:Fl}=xn($e),{top:Vl,right:Ml,bottom:Il,left:Al}=xn(o!=null&&o.value?Vh(rt):rt),{top:Ol,right:zl,bottom:Dl,left:Ll}=xn(o!=null&&o.value?Vh(Hn):Hn);return{"--n-scrollbar-bezier":z,"--n-scrollbar-color":Q,"--n-scrollbar-color-hover":se,"--n-scrollbar-border-radius":ve,"--n-scrollbar-width":we,"--n-scrollbar-height":ye,"--n-scrollbar-rail-top-horizontal-top":Bl,"--n-scrollbar-rail-right-horizontal-top":Nl,"--n-scrollbar-rail-bottom-horizontal-top":Tl,"--n-scrollbar-rail-left-horizontal-top":$l,"--n-scrollbar-rail-top-horizontal-bottom":El,"--n-scrollbar-rail-right-horizontal-bottom":Rl,"--n-scrollbar-rail-bottom-horizontal-bottom":Pl,"--n-scrollbar-rail-left-horizontal-bottom":Fl,"--n-scrollbar-rail-top-vertical-right":Vl,"--n-scrollbar-rail-right-vertical-right":Ml,"--n-scrollbar-rail-bottom-vertical-right":Il,"--n-scrollbar-rail-left-vertical-right":Al,"--n-scrollbar-rail-top-vertical-left":Ol,"--n-scrollbar-rail-right-vertical-left":zl,"--n-scrollbar-rail-bottom-vertical-left":Dl,"--n-scrollbar-rail-left-vertical-left":Ll,"--n-scrollbar-rail-color":Sl}}),lt=i?Hi("scrollbar",void 0,sn,n):void 0;return Object.assign(Object.assign({},{scrollTo:L,scrollBy:fe,sync:de,syncUnifiedContainer:ae,handleMouseEnterWrapper:_e,handleMouseLeaveWrapper:Qe}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:b,wrapperRef:s,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:T,needXBar:D,yBarSizePx:X,xBarSizePx:Z,yBarTopPx:A,xBarLeftPx:H,isShowXBar:K,isShowYBar:J,isIos:F,handleScroll:Ln,handleContentResize:ue,handleContainerResize:oe,handleYScrollMouseDown:at,handleXScrollMouseDown:Ui,cssVars:i?void 0:sn,themeClass:lt==null?void 0:lt.themeClass,onRender:lt==null?void 0:lt.onRender})},render(){var n;const{$slots:e,mergedClsPrefix:i,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:s,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(n=e.default)===null||n===void 0?void 0:n.call(e);const d=this.trigger==="none",u=(p,m)=>t.h("div",{ref:"yRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--vertical`,`${i}-scrollbar-rail--vertical--${a}`,p],"data-scrollbar-rail":!0,style:[m||"",this.verticalRailStyle],"aria-hidden":!0},t.h(d?fl:t.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?t.h("div",{class:`${i}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),f=()=>{var p,m;return(p=this.onRender)===null||p===void 0||p.call(this),t.h("div",t.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${i}-scrollbar`,this.themeClass,o&&`${i}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(m=e.default)===null||m===void 0?void 0:m.call(e):t.h("div",{role:"none",ref:"containerRef",class:[`${i}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},t.h(gs,{onResize:this.handleContentResize},{default:()=>t.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${i}-scrollbar-content`,this.contentClass]},e)})),s?null:u(void 0,void 0),c&&t.h("div",{ref:"xRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--horizontal`,`${i}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},t.h(d?fl:t.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?t.h("div",{class:`${i}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},h=this.container?f():t.h(gs,{onResize:this.handleContainerResize},{default:f});return s?t.h(t.Fragment,null,h,u(this.themeClass,this.cssVars)):h}}),GB=Qh,ZB={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function QB(n){const{textColorDisabled:e,iconColor:i,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=n;return Object.assign(Object.assign({},ZB),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:i,extraTextColor:r})}const Jh={name:"Empty",common:Wi,self:QB},JB=ke("empty",`
|
|
297
|
+
`,[WB(),pe("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),KB=Object.assign(Object.assign({},Rt.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"}}),Qh=t.defineComponent({name:"Scrollbar",props:KB,inheritAttrs:!1,setup(n){const{mergedClsPrefixRef:e,inlineThemeDisabled:i,mergedRtlRef:r}=Li(n),o=eo("Scrollbar",r,e),s=t.ref(null),a=t.ref(null),l=t.ref(null),c=t.ref(null),d=t.ref(null),u=t.ref(null),f=t.ref(null),h=t.ref(null),p=t.ref(null),m=t.ref(null),g=t.ref(null),b=t.ref(0),y=t.ref(0),_=t.ref(!1),x=t.ref(!1);let w=!1,C=!1,N,k,$=0,v=0,E=0,P=0;const F=Sv(),R=Rt("Scrollbar","-scrollbar",UB,gl,n,e),M=t.computed(()=>{const{value:z}=h,{value:Q}=u,{value:se}=m;return z===null||Q===null||se===null?0:Math.min(z,se*z/Q+jr(R.value.self.width)*1.5)}),X=t.computed(()=>`${M.value}px`),G=t.computed(()=>{const{value:z}=p,{value:Q}=f,{value:se}=g;return z===null||Q===null||se===null?0:se*z/Q+jr(R.value.self.height)*1.5}),Z=t.computed(()=>`${G.value}px`),O=t.computed(()=>{const{value:z}=h,{value:Q}=b,{value:se}=u,{value:ye}=m;if(z===null||se===null||ye===null)return 0;{const we=se-z;return we?Q/we*(ye-M.value):0}}),A=t.computed(()=>`${O.value}px`),Y=t.computed(()=>{const{value:z}=p,{value:Q}=y,{value:se}=f,{value:ye}=g;if(z===null||se===null||ye===null)return 0;{const we=se-z;return we?Q/we*(ye-G.value):0}}),H=t.computed(()=>`${Y.value}px`),T=t.computed(()=>{const{value:z}=h,{value:Q}=u;return z!==null&&Q!==null&&Q>z}),D=t.computed(()=>{const{value:z}=p,{value:Q}=f;return z!==null&&Q!==null&&Q>z}),K=t.computed(()=>{const{trigger:z}=n;return z==="none"||_.value}),J=t.computed(()=>{const{trigger:z}=n;return z==="none"||x.value}),U=t.computed(()=>{const{container:z}=n;return z?z():a.value}),q=t.computed(()=>{const{content:z}=n;return z?z():l.value}),L=(z,Q)=>{if(!n.scrollable)return;if(typeof z=="number"){ge(z,Q??0,0,!1,"auto");return}const{left:se,top:ye,index:we,elSize:Ce,position:Ne,behavior:$e,el:rt,debounce:Hn=!0}=z;(se!==void 0||ye!==void 0)&&ge(se??0,ye??0,0,!1,$e),rt!==void 0?ge(0,rt.offsetTop,rt.offsetHeight,Hn,$e):we!==void 0&&Ce!==void 0?ge(0,we*Ce,Ce,Hn,$e):Ne==="bottom"?ge(0,Number.MAX_SAFE_INTEGER,0,!1,$e):Ne==="top"&&ge(0,0,0,!1,$e)},le=PS(()=>{n.container||L({top:b.value,left:y.value})}),ue=()=>{le.isDeactivated||de()},oe=z=>{if(le.isDeactivated)return;const{onResize:Q}=n;Q&&Q(z),de()},fe=(z,Q)=>{if(!n.scrollable)return;const{value:se}=U;se&&(typeof z=="object"?se.scrollBy(z):se.scrollBy(z,Q||0))};function ge(z,Q,se,ye,we){const{value:Ce}=U;if(Ce){if(ye){const{scrollTop:Ne,offsetHeight:$e}=Ce;if(Q>Ne){Q+se<=Ne+$e||Ce.scrollTo({left:z,top:Q+se-$e,behavior:we});return}}Ce.scrollTo({left:z,top:Q,behavior:we})}}function _e(){It(),en(),de()}function Qe(){Re()}function Re(){Mt(),vn()}function Mt(){k!==void 0&&window.clearTimeout(k),k=window.setTimeout(()=>{x.value=!1},n.duration)}function vn(){N!==void 0&&window.clearTimeout(N),N=window.setTimeout(()=>{_.value=!1},n.duration)}function It(){N!==void 0&&window.clearTimeout(N),_.value=!0}function en(){k!==void 0&&window.clearTimeout(k),x.value=!0}function Ln(z){const{onScroll:Q}=n;Q&&Q(z),mn()}function mn(){const{value:z}=U;z&&(b.value=z.scrollTop,y.value=z.scrollLeft*(o!=null&&o.value?-1:1))}function _t(){const{value:z}=q;z&&(u.value=z.offsetHeight,f.value=z.offsetWidth);const{value:Q}=U;Q&&(h.value=Q.offsetHeight,p.value=Q.offsetWidth);const{value:se}=d,{value:ye}=c;se&&(g.value=se.offsetWidth),ye&&(m.value=ye.offsetHeight)}function ae(){const{value:z}=U;z&&(b.value=z.scrollTop,y.value=z.scrollLeft*(o!=null&&o.value?-1:1),h.value=z.offsetHeight,p.value=z.offsetWidth,u.value=z.scrollHeight,f.value=z.scrollWidth);const{value:Q}=d,{value:se}=c;Q&&(g.value=Q.offsetWidth),se&&(m.value=se.offsetHeight)}function de(){n.scrollable&&(n.useUnifiedContainer?ae():(_t(),mn()))}function Ge(z){var Q;return!(!((Q=s.value)===null||Q===void 0)&&Q.contains(Wr(z)))}function Ui(z){z.preventDefault(),z.stopPropagation(),C=!0,Lt("mousemove",window,oi,!0),Lt("mouseup",window,si,!0),v=y.value,E=o!=null&&o.value?window.innerWidth-z.clientX:z.clientX}function oi(z){if(!C)return;N!==void 0&&window.clearTimeout(N),k!==void 0&&window.clearTimeout(k);const{value:Q}=p,{value:se}=f,{value:ye}=G;if(Q===null||se===null)return;const Ce=(o!=null&&o.value?window.innerWidth-z.clientX-E:z.clientX-E)*(se-Q)/(Q-ye),Ne=se-Q;let $e=v+Ce;$e=Math.min(Ne,$e),$e=Math.max($e,0);const{value:rt}=U;if(rt){rt.scrollLeft=$e*(o!=null&&o.value?-1:1);const{internalOnUpdateScrollLeft:Hn}=n;Hn&&Hn($e)}}function si(z){z.preventDefault(),z.stopPropagation(),yt("mousemove",window,oi,!0),yt("mouseup",window,si,!0),C=!1,de(),Ge(z)&&Re()}function at(z){z.preventDefault(),z.stopPropagation(),w=!0,Lt("mousemove",window,qe,!0),Lt("mouseup",window,on,!0),$=b.value,P=z.clientY}function qe(z){if(!w)return;N!==void 0&&window.clearTimeout(N),k!==void 0&&window.clearTimeout(k);const{value:Q}=h,{value:se}=u,{value:ye}=M;if(Q===null||se===null)return;const Ce=(z.clientY-P)*(se-Q)/(Q-ye),Ne=se-Q;let $e=$+Ce;$e=Math.min(Ne,$e),$e=Math.max($e,0);const{value:rt}=U;rt&&(rt.scrollTop=$e)}function on(z){z.preventDefault(),z.stopPropagation(),yt("mousemove",window,qe,!0),yt("mouseup",window,on,!0),w=!1,de(),Ge(z)&&Re()}t.watchEffect(()=>{const{value:z}=D,{value:Q}=T,{value:se}=e,{value:ye}=d,{value:we}=c;ye&&(z?ye.classList.remove(`${se}-scrollbar-rail--disabled`):ye.classList.add(`${se}-scrollbar-rail--disabled`)),we&&(Q?we.classList.remove(`${se}-scrollbar-rail--disabled`):we.classList.add(`${se}-scrollbar-rail--disabled`))}),t.onMounted(()=>{n.container||de()}),t.onBeforeUnmount(()=>{N!==void 0&&window.clearTimeout(N),k!==void 0&&window.clearTimeout(k),yt("mousemove",window,qe,!0),yt("mouseup",window,on,!0)});const sn=t.computed(()=>{const{common:{cubicBezierEaseInOut:z},self:{color:Q,colorHover:se,height:ye,width:we,borderRadius:Ce,railInsetHorizontalTop:Ne,railInsetHorizontalBottom:$e,railInsetVerticalRight:rt,railInsetVerticalLeft:Hn,railColor:Sl}}=R.value,{top:Bl,right:Nl,bottom:Tl,left:$l}=xn(Ne),{top:El,right:Rl,bottom:Pl,left:Fl}=xn($e),{top:Vl,right:Ml,bottom:Il,left:Al}=xn(o!=null&&o.value?Vh(rt):rt),{top:Ol,right:zl,bottom:Dl,left:Ll}=xn(o!=null&&o.value?Vh(Hn):Hn);return{"--n-scrollbar-bezier":z,"--n-scrollbar-color":Q,"--n-scrollbar-color-hover":se,"--n-scrollbar-border-radius":Ce,"--n-scrollbar-width":we,"--n-scrollbar-height":ye,"--n-scrollbar-rail-top-horizontal-top":Bl,"--n-scrollbar-rail-right-horizontal-top":Nl,"--n-scrollbar-rail-bottom-horizontal-top":Tl,"--n-scrollbar-rail-left-horizontal-top":$l,"--n-scrollbar-rail-top-horizontal-bottom":El,"--n-scrollbar-rail-right-horizontal-bottom":Rl,"--n-scrollbar-rail-bottom-horizontal-bottom":Pl,"--n-scrollbar-rail-left-horizontal-bottom":Fl,"--n-scrollbar-rail-top-vertical-right":Vl,"--n-scrollbar-rail-right-vertical-right":Ml,"--n-scrollbar-rail-bottom-vertical-right":Il,"--n-scrollbar-rail-left-vertical-right":Al,"--n-scrollbar-rail-top-vertical-left":Ol,"--n-scrollbar-rail-right-vertical-left":zl,"--n-scrollbar-rail-bottom-vertical-left":Dl,"--n-scrollbar-rail-left-vertical-left":Ll,"--n-scrollbar-rail-color":Sl}}),lt=i?Hi("scrollbar",void 0,sn,n):void 0;return Object.assign(Object.assign({},{scrollTo:L,scrollBy:fe,sync:de,syncUnifiedContainer:ae,handleMouseEnterWrapper:_e,handleMouseLeaveWrapper:Qe}),{mergedClsPrefix:e,rtlEnabled:o,containerScrollTop:b,wrapperRef:s,containerRef:a,contentRef:l,yRailRef:c,xRailRef:d,needYBar:T,needXBar:D,yBarSizePx:X,xBarSizePx:Z,yBarTopPx:A,xBarLeftPx:H,isShowXBar:K,isShowYBar:J,isIos:F,handleScroll:Ln,handleContentResize:ue,handleContainerResize:oe,handleYScrollMouseDown:at,handleXScrollMouseDown:Ui,cssVars:i?void 0:sn,themeClass:lt==null?void 0:lt.themeClass,onRender:lt==null?void 0:lt.onRender})},render(){var n;const{$slots:e,mergedClsPrefix:i,triggerDisplayManually:r,rtlEnabled:o,internalHoistYRail:s,yPlacement:a,xPlacement:l,xScrollable:c}=this;if(!this.scrollable)return(n=e.default)===null||n===void 0?void 0:n.call(e);const d=this.trigger==="none",u=(p,m)=>t.h("div",{ref:"yRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--vertical`,`${i}-scrollbar-rail--vertical--${a}`,p],"data-scrollbar-rail":!0,style:[m||"",this.verticalRailStyle],"aria-hidden":!0},t.h(d?fl:t.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?t.h("div",{class:`${i}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),f=()=>{var p,m;return(p=this.onRender)===null||p===void 0||p.call(this),t.h("div",t.mergeProps(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${i}-scrollbar`,this.themeClass,o&&`${i}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(m=e.default)===null||m===void 0?void 0:m.call(e):t.h("div",{role:"none",ref:"containerRef",class:[`${i}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},t.h(gs,{onResize:this.handleContentResize},{default:()=>t.h("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${i}-scrollbar-content`,this.contentClass]},e)})),s?null:u(void 0,void 0),c&&t.h("div",{ref:"xRailRef",class:[`${i}-scrollbar-rail`,`${i}-scrollbar-rail--horizontal`,`${i}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},t.h(d?fl:t.Transition,d?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?t.h("div",{class:`${i}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:o?this.xBarLeftPx:void 0,left:o?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},h=this.container?f():t.h(gs,{onResize:this.handleContainerResize},{default:f});return s?t.h(t.Fragment,null,h,u(this.themeClass,this.cssVars)):h}}),GB=Qh,ZB={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function QB(n){const{textColorDisabled:e,iconColor:i,textColor2:r,fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c}=n;return Object.assign(Object.assign({},ZB),{fontSizeTiny:o,fontSizeSmall:s,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:c,textColor:e,iconColor:i,extraTextColor:r})}const Jh={name:"Empty",common:Wi,self:QB},JB=ke("empty",`
|
|
298
298
|
display: flex;
|
|
299
299
|
flex-direction: column;
|
|
300
300
|
align-items: center;
|
|
301
301
|
font-size: var(--n-font-size);
|
|
302
|
-
`,[
|
|
302
|
+
`,[ve("icon",`
|
|
303
303
|
width: var(--n-icon-size);
|
|
304
304
|
height: var(--n-icon-size);
|
|
305
305
|
font-size: var(--n-icon-size);
|
|
@@ -307,12 +307,12 @@ ${o}
|
|
|
307
307
|
color: var(--n-icon-color);
|
|
308
308
|
transition:
|
|
309
309
|
color .3s var(--n-bezier);
|
|
310
|
-
`,[pe("+",[
|
|
310
|
+
`,[pe("+",[ve("description",`
|
|
311
311
|
margin-top: 8px;
|
|
312
|
-
`)])]),
|
|
312
|
+
`)])]),ve("description",`
|
|
313
313
|
transition: color .3s var(--n-bezier);
|
|
314
314
|
color: var(--n-text-color);
|
|
315
|
-
`),
|
|
315
|
+
`),ve("extra",`
|
|
316
316
|
text-align: center;
|
|
317
317
|
transition: color .3s var(--n-bezier);
|
|
318
318
|
margin-top: 12px;
|
|
@@ -336,7 +336,7 @@ ${o}
|
|
|
336
336
|
font-size: var(--n-option-font-size);
|
|
337
337
|
display: flex;
|
|
338
338
|
align-items: center;
|
|
339
|
-
`,[
|
|
339
|
+
`,[ve("content",`
|
|
340
340
|
z-index: 1;
|
|
341
341
|
white-space: nowrap;
|
|
342
342
|
text-overflow: ellipsis;
|
|
@@ -349,15 +349,15 @@ ${o}
|
|
|
349
349
|
`),ke("base-select-menu-option-wrapper",`
|
|
350
350
|
position: relative;
|
|
351
351
|
width: 100%;
|
|
352
|
-
`),
|
|
352
|
+
`),ve("loading, empty",`
|
|
353
353
|
display: flex;
|
|
354
354
|
padding: 12px 32px;
|
|
355
355
|
flex: 1;
|
|
356
356
|
justify-content: center;
|
|
357
|
-
`),
|
|
357
|
+
`),ve("loading",`
|
|
358
358
|
color: var(--n-loading-color);
|
|
359
359
|
font-size: var(--n-loading-size);
|
|
360
|
-
`),
|
|
360
|
+
`),ve("header",`
|
|
361
361
|
padding: 8px var(--n-option-padding-left);
|
|
362
362
|
font-size: var(--n-option-font-size);
|
|
363
363
|
transition:
|
|
@@ -365,7 +365,7 @@ ${o}
|
|
|
365
365
|
border-color .3s var(--n-bezier);
|
|
366
366
|
border-bottom: 1px solid var(--n-action-divider-color);
|
|
367
367
|
color: var(--n-action-text-color);
|
|
368
|
-
`),
|
|
368
|
+
`),ve("action",`
|
|
369
369
|
padding: 8px var(--n-option-padding-left);
|
|
370
370
|
font-size: var(--n-option-font-size);
|
|
371
371
|
transition:
|
|
@@ -417,7 +417,7 @@ ${o}
|
|
|
417
417
|
color: var(--n-option-text-color-disabled);
|
|
418
418
|
`),Fe("selected",`
|
|
419
419
|
opacity: var(--n-option-opacity-disabled);
|
|
420
|
-
`)]),
|
|
420
|
+
`)]),ve("check",`
|
|
421
421
|
font-size: 16px;
|
|
422
422
|
position: absolute;
|
|
423
423
|
right: calc(var(--n-option-padding-right) - 4px);
|
|
@@ -440,15 +440,15 @@ ${o}
|
|
|
440
440
|
`)]),kn("raw",`
|
|
441
441
|
background-color: var(--n-color);
|
|
442
442
|
border-radius: var(--n-border-radius);
|
|
443
|
-
`,[kn("scrollable",[kn("show-header-or-footer","padding: var(--n-padding);")])]),
|
|
443
|
+
`,[kn("scrollable",[kn("show-header-or-footer","padding: var(--n-padding);")])]),ve("header",`
|
|
444
444
|
padding: var(--n-padding);
|
|
445
445
|
border-bottom: 1px solid var(--n-divider-color);
|
|
446
446
|
transition: border-color .3s var(--n-bezier);
|
|
447
|
-
`),
|
|
447
|
+
`),ve("footer",`
|
|
448
448
|
padding: var(--n-padding);
|
|
449
449
|
border-top: 1px solid var(--n-divider-color);
|
|
450
450
|
transition: border-color .3s var(--n-bezier);
|
|
451
|
-
`),Fe("scrollable, show-header-or-footer",[
|
|
451
|
+
`),Fe("scrollable, show-header-or-footer",[ve("content",`
|
|
452
452
|
padding: var(--n-padding);
|
|
453
453
|
`)])]),ke("popover-shared",`
|
|
454
454
|
transform-origin: inherit;
|
|
@@ -564,7 +564,7 @@ ${o}
|
|
|
564
564
|
font-size: var(--n-font-size);
|
|
565
565
|
`,[Fe("strong",`
|
|
566
566
|
font-weight: var(--n-font-weight-strong);
|
|
567
|
-
`),
|
|
567
|
+
`),ve("border",`
|
|
568
568
|
pointer-events: none;
|
|
569
569
|
position: absolute;
|
|
570
570
|
left: 0;
|
|
@@ -574,16 +574,16 @@ ${o}
|
|
|
574
574
|
border-radius: inherit;
|
|
575
575
|
border: var(--n-border);
|
|
576
576
|
transition: border-color .3s var(--n-bezier);
|
|
577
|
-
`),
|
|
577
|
+
`),ve("icon",`
|
|
578
578
|
display: flex;
|
|
579
579
|
margin: 0 4px 0 0;
|
|
580
580
|
color: var(--n-text-color);
|
|
581
581
|
transition: color .3s var(--n-bezier);
|
|
582
582
|
font-size: var(--n-avatar-size-override);
|
|
583
|
-
`),
|
|
583
|
+
`),ve("avatar",`
|
|
584
584
|
display: flex;
|
|
585
585
|
margin: 0 6px 0 0;
|
|
586
|
-
`),
|
|
586
|
+
`),ve("close",`
|
|
587
587
|
margin: var(--n-close-margin);
|
|
588
588
|
transition:
|
|
589
589
|
background-color .3s var(--n-bezier),
|
|
@@ -591,9 +591,9 @@ ${o}
|
|
|
591
591
|
`),Fe("round",`
|
|
592
592
|
padding: 0 calc(var(--n-height) / 3);
|
|
593
593
|
border-radius: calc(var(--n-height) / 2);
|
|
594
|
-
`,[
|
|
594
|
+
`,[ve("icon",`
|
|
595
595
|
margin: 0 4px 0 calc((var(--n-height) - 8px) / -2);
|
|
596
|
-
`),
|
|
596
|
+
`),ve("avatar",`
|
|
597
597
|
margin: 0 6px 0 calc((var(--n-height) - 8px) / -2);
|
|
598
598
|
`),Fe("closable",`
|
|
599
599
|
padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3);
|
|
@@ -626,7 +626,7 @@ ${o}
|
|
|
626
626
|
font-size: var(--n-font-size);
|
|
627
627
|
`,[ke("base-loading",`
|
|
628
628
|
color: var(--n-loading-color);
|
|
629
|
-
`),ke("base-selection-tags","min-height: var(--n-height);"),
|
|
629
|
+
`),ke("base-selection-tags","min-height: var(--n-height);"),ve("border, state-border",`
|
|
630
630
|
position: absolute;
|
|
631
631
|
left: 0;
|
|
632
632
|
right: 0;
|
|
@@ -638,7 +638,7 @@ ${o}
|
|
|
638
638
|
transition:
|
|
639
639
|
box-shadow .3s var(--n-bezier),
|
|
640
640
|
border-color .3s var(--n-bezier);
|
|
641
|
-
`),
|
|
641
|
+
`),ve("state-border",`
|
|
642
642
|
z-index: 1;
|
|
643
643
|
border-color: #0000;
|
|
644
644
|
`),ke("base-suffix",`
|
|
@@ -647,7 +647,7 @@ ${o}
|
|
|
647
647
|
top: 50%;
|
|
648
648
|
transform: translateY(-50%);
|
|
649
649
|
right: 10px;
|
|
650
|
-
`,[
|
|
650
|
+
`,[ve("arrow",`
|
|
651
651
|
font-size: var(--n-arrow-size);
|
|
652
652
|
color: var(--n-arrow-color);
|
|
653
653
|
transition: color .3s var(--n-bezier);
|
|
@@ -663,14 +663,14 @@ ${o}
|
|
|
663
663
|
left: 0;
|
|
664
664
|
padding: var(--n-padding-single);
|
|
665
665
|
transition: color .3s var(--n-bezier);
|
|
666
|
-
`,[
|
|
666
|
+
`,[ve("wrapper",`
|
|
667
667
|
flex-basis: 0;
|
|
668
668
|
flex-grow: 1;
|
|
669
669
|
overflow: hidden;
|
|
670
670
|
text-overflow: ellipsis;
|
|
671
671
|
`)]),ke("base-selection-placeholder",`
|
|
672
672
|
color: var(--n-placeholder-color);
|
|
673
|
-
`,[
|
|
673
|
+
`,[ve("inner",`
|
|
674
674
|
max-width: 100%;
|
|
675
675
|
overflow: hidden;
|
|
676
676
|
`)]),ke("base-selection-tags",`
|
|
@@ -721,22 +721,22 @@ ${o}
|
|
|
721
721
|
color: var(--n-text-color);
|
|
722
722
|
transition: color .3s var(--n-bezier);
|
|
723
723
|
caret-color: var(--n-caret-color);
|
|
724
|
-
`,[
|
|
724
|
+
`,[ve("content",`
|
|
725
725
|
text-overflow: ellipsis;
|
|
726
726
|
overflow: hidden;
|
|
727
727
|
white-space: nowrap;
|
|
728
|
-
`)]),
|
|
728
|
+
`)]),ve("render-label",`
|
|
729
729
|
color: var(--n-text-color);
|
|
730
|
-
`)]),kn("disabled",[pe("&:hover",[
|
|
730
|
+
`)]),kn("disabled",[pe("&:hover",[ve("state-border",`
|
|
731
731
|
box-shadow: var(--n-box-shadow-hover);
|
|
732
732
|
border: var(--n-border-hover);
|
|
733
|
-
`)]),Fe("focus",[
|
|
733
|
+
`)]),Fe("focus",[ve("state-border",`
|
|
734
734
|
box-shadow: var(--n-box-shadow-focus);
|
|
735
735
|
border: var(--n-border-focus);
|
|
736
|
-
`)]),Fe("active",[
|
|
736
|
+
`)]),Fe("active",[ve("state-border",`
|
|
737
737
|
box-shadow: var(--n-box-shadow-active);
|
|
738
738
|
border: var(--n-border-active);
|
|
739
|
-
`),ke("base-selection-label","background-color: var(--n-color-active);"),ke("base-selection-tags","background-color: var(--n-color-active);")])]),Fe("disabled","cursor: not-allowed;",[
|
|
739
|
+
`),ke("base-selection-label","background-color: var(--n-color-active);"),ke("base-selection-tags","background-color: var(--n-color-active);")])]),Fe("disabled","cursor: not-allowed;",[ve("arrow",`
|
|
740
740
|
color: var(--n-arrow-color-disabled);
|
|
741
741
|
`),ke("base-selection-label",`
|
|
742
742
|
cursor: not-allowed;
|
|
@@ -744,7 +744,7 @@ ${o}
|
|
|
744
744
|
`,[ke("base-selection-input",`
|
|
745
745
|
cursor: not-allowed;
|
|
746
746
|
color: var(--n-text-color-disabled);
|
|
747
|
-
`),
|
|
747
|
+
`),ve("render-label",`
|
|
748
748
|
color: var(--n-text-color-disabled);
|
|
749
749
|
`)]),ke("base-selection-tags",`
|
|
750
750
|
cursor: not-allowed;
|
|
@@ -761,7 +761,7 @@ ${o}
|
|
|
761
761
|
margin-bottom: 3px;
|
|
762
762
|
max-width: 100%;
|
|
763
763
|
vertical-align: bottom;
|
|
764
|
-
`,[
|
|
764
|
+
`,[ve("input",`
|
|
765
765
|
font-size: inherit;
|
|
766
766
|
font-family: inherit;
|
|
767
767
|
min-width: 1px;
|
|
@@ -776,7 +776,7 @@ ${o}
|
|
|
776
776
|
cursor: pointer;
|
|
777
777
|
color: var(--n-text-color);
|
|
778
778
|
caret-color: var(--n-caret-color);
|
|
779
|
-
`),
|
|
779
|
+
`),ve("mirror",`
|
|
780
780
|
position: absolute;
|
|
781
781
|
left: 0;
|
|
782
782
|
top: 0;
|
|
@@ -785,13 +785,13 @@ ${o}
|
|
|
785
785
|
user-select: none;
|
|
786
786
|
-webkit-user-select: none;
|
|
787
787
|
opacity: 0;
|
|
788
|
-
`)]),["warning","error"].map(n=>Fe(`${n}-status`,[
|
|
788
|
+
`)]),["warning","error"].map(n=>Fe(`${n}-status`,[ve("state-border",`border: var(--n-border-${n});`),kn("disabled",[pe("&:hover",[ve("state-border",`
|
|
789
789
|
box-shadow: var(--n-box-shadow-hover-${n});
|
|
790
790
|
border: var(--n-border-hover-${n});
|
|
791
|
-
`)]),Fe("active",[
|
|
791
|
+
`)]),Fe("active",[ve("state-border",`
|
|
792
792
|
box-shadow: var(--n-box-shadow-active-${n});
|
|
793
793
|
border: var(--n-border-active-${n});
|
|
794
|
-
`),ke("base-selection-label",`background-color: var(--n-color-active-${n});`),ke("base-selection-tags",`background-color: var(--n-color-active-${n});`)]),Fe("focus",[
|
|
794
|
+
`),ke("base-selection-label",`background-color: var(--n-color-active-${n});`),ke("base-selection-tags",`background-color: var(--n-color-active-${n});`)]),Fe("focus",[ve("state-border",`
|
|
795
795
|
box-shadow: var(--n-box-shadow-focus-${n});
|
|
796
796
|
border: var(--n-border-focus-${n});
|
|
797
797
|
`)])])]))]),ke("base-selection-popover",`
|
|
@@ -806,11 +806,11 @@ ${o}
|
|
|
806
806
|
`,[pe("&:last-child","padding-right: 0;"),ke("tag",`
|
|
807
807
|
font-size: 14px;
|
|
808
808
|
max-width: 100%;
|
|
809
|
-
`,[
|
|
809
|
+
`,[ve("content",`
|
|
810
810
|
line-height: 1.25;
|
|
811
811
|
text-overflow: ellipsis;
|
|
812
812
|
overflow: hidden;
|
|
813
|
-
`)])])]),R5=t.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},Rt.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(n){const{mergedClsPrefixRef:e,mergedRtlRef:i}=Li(n),r=eo("InternalSelection",i,e),o=t.ref(null),s=t.ref(null),a=t.ref(null),l=t.ref(null),c=t.ref(null),d=t.ref(null),u=t.ref(null),f=t.ref(null),h=t.ref(null),p=t.ref(null),m=t.ref(!1),g=t.ref(!1),b=t.ref(!1),y=Rt("InternalSelection","-internal-selection",E5,lm,n,t.toRef(n,"clsPrefix")),_=t.computed(()=>n.clearable&&!n.disabled&&(b.value||n.active)),x=t.computed(()=>n.selectedOption?n.renderTag?n.renderTag({option:n.selectedOption,handleClose:()=>{}}):n.renderLabel?n.renderLabel(n.selectedOption,!0):Cr(n.selectedOption[n.labelField],n.selectedOption,!0):n.placeholder),w=t.computed(()=>{const ae=n.selectedOption;if(ae)return ae[n.labelField]}),C=t.computed(()=>n.multiple?!!(Array.isArray(n.selectedOptions)&&n.selectedOptions.length):n.selectedOption!==null);function N(){var ae;const{value:de}=o;if(de){const{value:Ge}=s;Ge&&(Ge.style.width=`${de.offsetWidth}px`,n.maxTagCount!=="responsive"&&((ae=h.value)===null||ae===void 0||ae.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:ae}=p;ae&&(ae.style.display="none")}function $(){const{value:ae}=p;ae&&(ae.style.display="inline-block")}t.watch(t.toRef(n,"active"),ae=>{ae||k()}),t.watch(t.toRef(n,"pattern"),()=>{n.multiple&&t.nextTick(N)});function v(ae){const{onFocus:de}=n;de&&de(ae)}function E(ae){const{onBlur:de}=n;de&&de(ae)}function P(ae){const{onDeleteOption:de}=n;de&&de(ae)}function F(ae){const{onClear:de}=n;de&&de(ae)}function R(ae){const{onPatternInput:de}=n;de&&de(ae)}function M(ae){var de;(!ae.relatedTarget||!(!((de=a.value)===null||de===void 0)&&de.contains(ae.relatedTarget)))&&v(ae)}function X(ae){var de;!((de=a.value)===null||de===void 0)&&de.contains(ae.relatedTarget)||E(ae)}function G(ae){F(ae)}function Z(){b.value=!0}function O(){b.value=!1}function A(ae){!n.active||!n.filterable||ae.target!==s.value&&ae.preventDefault()}function Y(ae){P(ae)}const H=t.ref(!1);function T(ae){if(ae.key==="Backspace"&&!H.value&&!n.pattern.length){const{selectedOptions:de}=n;de!=null&&de.length&&Y(de[de.length-1])}}let D=null;function K(ae){const{value:de}=o;if(de){const Ge=ae.target.value;de.textContent=Ge,N()}n.ignoreComposition&&H.value?D=ae:R(ae)}function J(){H.value=!0}function U(){H.value=!1,n.ignoreComposition&&R(D),D=null}function q(ae){var de;g.value=!0,(de=n.onPatternFocus)===null||de===void 0||de.call(n,ae)}function L(ae){var de;g.value=!1,(de=n.onPatternBlur)===null||de===void 0||de.call(n,ae)}function le(){var ae,de;if(n.filterable)g.value=!1,(ae=d.value)===null||ae===void 0||ae.blur(),(de=s.value)===null||de===void 0||de.blur();else if(n.multiple){const{value:Ge}=l;Ge==null||Ge.blur()}else{const{value:Ge}=c;Ge==null||Ge.blur()}}function ue(){var ae,de,Ge;n.filterable?(g.value=!1,(ae=d.value)===null||ae===void 0||ae.focus()):n.multiple?(de=l.value)===null||de===void 0||de.focus():(Ge=c.value)===null||Ge===void 0||Ge.focus()}function oe(){const{value:ae}=s;ae&&($(),ae.focus())}function fe(){const{value:ae}=s;ae&&ae.blur()}function ge(ae){const{value:de}=u;de&&de.setTextContent(`+${ae}`)}function _e(){const{value:ae}=f;return ae}function Qe(){return s.value}let Re=null;function Mt(){Re!==null&&window.clearTimeout(Re)}function vn(){n.active||(Mt(),Re=window.setTimeout(()=>{C.value&&(m.value=!0)},100))}function It(){Mt()}function en(ae){ae||(Mt(),m.value=!1)}t.watch(C,ae=>{ae||(m.value=!1)}),t.onMounted(()=>{t.watchEffect(()=>{const ae=d.value;ae&&(n.disabled?ae.removeAttribute("tabindex"):ae.tabIndex=g.value?-1:0)})}),Rh(a,n.onResize);const{inlineThemeDisabled:Ln}=n,mn=t.computed(()=>{const{size:ae}=n,{common:{cubicBezierEaseInOut:de},self:{fontWeight:Ge,borderRadius:Ui,color:oi,placeholderColor:si,textColor:at,paddingSingle:qe,paddingMultiple:on,caretColor:sn,colorDisabled:lt,textColorDisabled:jt,placeholderColorDisabled:z,colorActive:Q,boxShadowFocus:se,boxShadowActive:ye,boxShadowHover:we,border:ve,borderFocus:Ne,borderHover:$e,borderActive:rt,arrowColor:Hn,arrowColorDisabled:Sl,loadingColor:Bl,colorActiveWarning:Nl,boxShadowFocusWarning:Tl,boxShadowActiveWarning:$l,boxShadowHoverWarning:El,borderWarning:Rl,borderFocusWarning:Pl,borderHoverWarning:Fl,borderActiveWarning:Vl,colorActiveError:Ml,boxShadowFocusError:Il,boxShadowActiveError:Al,boxShadowHoverError:Ol,borderError:zl,borderFocusError:Dl,borderHoverError:Ll,borderActiveError:_T,clearColor:wT,clearColorHover:xT,clearColorPressed:kT,clearSize:CT,arrowSize:vT,[st("height",ae)]:ST,[st("fontSize",ae)]:BT}}=y.value,vs=xn(qe),Ss=xn(on);return{"--n-bezier":de,"--n-border":ve,"--n-border-active":rt,"--n-border-focus":Ne,"--n-border-hover":$e,"--n-border-radius":Ui,"--n-box-shadow-active":ye,"--n-box-shadow-focus":se,"--n-box-shadow-hover":we,"--n-caret-color":sn,"--n-color":oi,"--n-color-active":Q,"--n-color-disabled":lt,"--n-font-size":BT,"--n-height":ST,"--n-padding-single-top":vs.top,"--n-padding-multiple-top":Ss.top,"--n-padding-single-right":vs.right,"--n-padding-multiple-right":Ss.right,"--n-padding-single-left":vs.left,"--n-padding-multiple-left":Ss.left,"--n-padding-single-bottom":vs.bottom,"--n-padding-multiple-bottom":Ss.bottom,"--n-placeholder-color":si,"--n-placeholder-color-disabled":z,"--n-text-color":at,"--n-text-color-disabled":jt,"--n-arrow-color":Hn,"--n-arrow-color-disabled":Sl,"--n-loading-color":Bl,"--n-color-active-warning":Nl,"--n-box-shadow-focus-warning":Tl,"--n-box-shadow-active-warning":$l,"--n-box-shadow-hover-warning":El,"--n-border-warning":Rl,"--n-border-focus-warning":Pl,"--n-border-hover-warning":Fl,"--n-border-active-warning":Vl,"--n-color-active-error":Ml,"--n-box-shadow-focus-error":Il,"--n-box-shadow-active-error":Al,"--n-box-shadow-hover-error":Ol,"--n-border-error":zl,"--n-border-focus-error":Dl,"--n-border-hover-error":Ll,"--n-border-active-error":_T,"--n-clear-size":CT,"--n-clear-color":wT,"--n-clear-color-hover":xT,"--n-clear-color-pressed":kT,"--n-arrow-size":vT,"--n-font-weight":Ge}}),_t=Ln?Hi("internal-selection",t.computed(()=>n.size[0]),mn,n):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:g,filterablePlaceholder:x,label:w,selected:C,showTagsPanel:m,isComposing:H,counterRef:u,counterWrapperRef:f,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:h,inputTagElRef:p,handleMouseDown:A,handleFocusin:M,handleClear:G,handleMouseEnter:Z,handleMouseLeave:O,handleDeleteOption:Y,handlePatternKeyDown:T,handlePatternInputInput:K,handlePatternInputBlur:L,handlePatternInputFocus:q,handleMouseEnterCounter:vn,handleMouseLeaveCounter:It,handleFocusout:X,handleCompositionEnd:U,handleCompositionStart:J,onPopoverUpdateShow:en,focus:ue,focusInput:oe,blur:le,blurInput:fe,updateCounter:ge,getCounter:_e,getTail:Qe,renderLabel:n.renderLabel,cssVars:Ln?void 0:mn,themeClass:_t==null?void 0:_t.themeClass,onRender:_t==null?void 0:_t.onRender}},render(){const{status:n,multiple:e,size:i,disabled:r,filterable:o,maxTagCount:s,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:f}=this;d==null||d();const h=s==="responsive",p=typeof s=="number",m=h||p,g=t.h(fl,null,{default:()=>t.h(N5,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=R=>t.h("div",{class:`${l}-base-selection-tag-wrapper`,key:R.value},u?u({option:R,handleClose:()=>{this.handleDeleteOption(R)}}):t.h(bl,{size:i,closable:!R.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(R)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(R,!0):Cr(R[y],R,!0)})),x=()=>(p?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),w=o?t.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},t.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})),t.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,C=h?()=>t.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},t.h(bl,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let N;if(p){const R=this.selectedOptions.length-s;R>0&&(N=t.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},t.h(bl,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${R}`})))}const k=h?o?t.h(xh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:x,counter:C,tail:()=>w}):t.h(xh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:x,counter:C}):p&&N?x().concat(N):x(),$=m?()=>t.h("div",{class:`${l}-base-selection-popover`},h?x():this.selectedOptions.map(_)):void 0,v=m?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,P=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?t.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},t.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,F=o?t.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,h?null:w,g):t.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,g);b=t.h(t.Fragment,null,m?t.h(b5,Object.assign({},v,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>F,default:$}):F,P)}else if(o){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,x=this.active?!1:this.selected;b=t.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Oh(this.label)},t.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})),x?t.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},t.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Cr(this.label,this.selectedOption,!0))):null,_?t.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},t.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,g)}else b=t.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?t.h("div",{class:`${l}-base-selection-input`,title:Oh(this.label),key:"input"},t.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Cr(this.label,this.selectedOption,!0))):t.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},t.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),g);return t.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,n&&`${l}-base-selection--${n}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?t.h("div",{class:`${l}-base-selection__border`}):null,a?t.h("div",{class:`${l}-base-selection__state-border`}):null)}});function P5(n){const{boxShadow2:e}=n;return{menuBoxShadow:e}}const F5={name:"Select",common:Wi,peers:{InternalSelection:lm,InternalSelectMenu:em},self:P5},V5=pe([ke("select",`
|
|
813
|
+
`)])])]),R5=t.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},Rt.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(n){const{mergedClsPrefixRef:e,mergedRtlRef:i}=Li(n),r=eo("InternalSelection",i,e),o=t.ref(null),s=t.ref(null),a=t.ref(null),l=t.ref(null),c=t.ref(null),d=t.ref(null),u=t.ref(null),f=t.ref(null),h=t.ref(null),p=t.ref(null),m=t.ref(!1),g=t.ref(!1),b=t.ref(!1),y=Rt("InternalSelection","-internal-selection",E5,lm,n,t.toRef(n,"clsPrefix")),_=t.computed(()=>n.clearable&&!n.disabled&&(b.value||n.active)),x=t.computed(()=>n.selectedOption?n.renderTag?n.renderTag({option:n.selectedOption,handleClose:()=>{}}):n.renderLabel?n.renderLabel(n.selectedOption,!0):Cr(n.selectedOption[n.labelField],n.selectedOption,!0):n.placeholder),w=t.computed(()=>{const ae=n.selectedOption;if(ae)return ae[n.labelField]}),C=t.computed(()=>n.multiple?!!(Array.isArray(n.selectedOptions)&&n.selectedOptions.length):n.selectedOption!==null);function N(){var ae;const{value:de}=o;if(de){const{value:Ge}=s;Ge&&(Ge.style.width=`${de.offsetWidth}px`,n.maxTagCount!=="responsive"&&((ae=h.value)===null||ae===void 0||ae.sync({showAllItemsBeforeCalculate:!1})))}}function k(){const{value:ae}=p;ae&&(ae.style.display="none")}function $(){const{value:ae}=p;ae&&(ae.style.display="inline-block")}t.watch(t.toRef(n,"active"),ae=>{ae||k()}),t.watch(t.toRef(n,"pattern"),()=>{n.multiple&&t.nextTick(N)});function v(ae){const{onFocus:de}=n;de&&de(ae)}function E(ae){const{onBlur:de}=n;de&&de(ae)}function P(ae){const{onDeleteOption:de}=n;de&&de(ae)}function F(ae){const{onClear:de}=n;de&&de(ae)}function R(ae){const{onPatternInput:de}=n;de&&de(ae)}function M(ae){var de;(!ae.relatedTarget||!(!((de=a.value)===null||de===void 0)&&de.contains(ae.relatedTarget)))&&v(ae)}function X(ae){var de;!((de=a.value)===null||de===void 0)&&de.contains(ae.relatedTarget)||E(ae)}function G(ae){F(ae)}function Z(){b.value=!0}function O(){b.value=!1}function A(ae){!n.active||!n.filterable||ae.target!==s.value&&ae.preventDefault()}function Y(ae){P(ae)}const H=t.ref(!1);function T(ae){if(ae.key==="Backspace"&&!H.value&&!n.pattern.length){const{selectedOptions:de}=n;de!=null&&de.length&&Y(de[de.length-1])}}let D=null;function K(ae){const{value:de}=o;if(de){const Ge=ae.target.value;de.textContent=Ge,N()}n.ignoreComposition&&H.value?D=ae:R(ae)}function J(){H.value=!0}function U(){H.value=!1,n.ignoreComposition&&R(D),D=null}function q(ae){var de;g.value=!0,(de=n.onPatternFocus)===null||de===void 0||de.call(n,ae)}function L(ae){var de;g.value=!1,(de=n.onPatternBlur)===null||de===void 0||de.call(n,ae)}function le(){var ae,de;if(n.filterable)g.value=!1,(ae=d.value)===null||ae===void 0||ae.blur(),(de=s.value)===null||de===void 0||de.blur();else if(n.multiple){const{value:Ge}=l;Ge==null||Ge.blur()}else{const{value:Ge}=c;Ge==null||Ge.blur()}}function ue(){var ae,de,Ge;n.filterable?(g.value=!1,(ae=d.value)===null||ae===void 0||ae.focus()):n.multiple?(de=l.value)===null||de===void 0||de.focus():(Ge=c.value)===null||Ge===void 0||Ge.focus()}function oe(){const{value:ae}=s;ae&&($(),ae.focus())}function fe(){const{value:ae}=s;ae&&ae.blur()}function ge(ae){const{value:de}=u;de&&de.setTextContent(`+${ae}`)}function _e(){const{value:ae}=f;return ae}function Qe(){return s.value}let Re=null;function Mt(){Re!==null&&window.clearTimeout(Re)}function vn(){n.active||(Mt(),Re=window.setTimeout(()=>{C.value&&(m.value=!0)},100))}function It(){Mt()}function en(ae){ae||(Mt(),m.value=!1)}t.watch(C,ae=>{ae||(m.value=!1)}),t.onMounted(()=>{t.watchEffect(()=>{const ae=d.value;ae&&(n.disabled?ae.removeAttribute("tabindex"):ae.tabIndex=g.value?-1:0)})}),Rh(a,n.onResize);const{inlineThemeDisabled:Ln}=n,mn=t.computed(()=>{const{size:ae}=n,{common:{cubicBezierEaseInOut:de},self:{fontWeight:Ge,borderRadius:Ui,color:oi,placeholderColor:si,textColor:at,paddingSingle:qe,paddingMultiple:on,caretColor:sn,colorDisabled:lt,textColorDisabled:jt,placeholderColorDisabled:z,colorActive:Q,boxShadowFocus:se,boxShadowActive:ye,boxShadowHover:we,border:Ce,borderFocus:Ne,borderHover:$e,borderActive:rt,arrowColor:Hn,arrowColorDisabled:Sl,loadingColor:Bl,colorActiveWarning:Nl,boxShadowFocusWarning:Tl,boxShadowActiveWarning:$l,boxShadowHoverWarning:El,borderWarning:Rl,borderFocusWarning:Pl,borderHoverWarning:Fl,borderActiveWarning:Vl,colorActiveError:Ml,boxShadowFocusError:Il,boxShadowActiveError:Al,boxShadowHoverError:Ol,borderError:zl,borderFocusError:Dl,borderHoverError:Ll,borderActiveError:_T,clearColor:wT,clearColorHover:xT,clearColorPressed:kT,clearSize:CT,arrowSize:vT,[st("height",ae)]:ST,[st("fontSize",ae)]:BT}}=y.value,vs=xn(qe),Ss=xn(on);return{"--n-bezier":de,"--n-border":Ce,"--n-border-active":rt,"--n-border-focus":Ne,"--n-border-hover":$e,"--n-border-radius":Ui,"--n-box-shadow-active":ye,"--n-box-shadow-focus":se,"--n-box-shadow-hover":we,"--n-caret-color":sn,"--n-color":oi,"--n-color-active":Q,"--n-color-disabled":lt,"--n-font-size":BT,"--n-height":ST,"--n-padding-single-top":vs.top,"--n-padding-multiple-top":Ss.top,"--n-padding-single-right":vs.right,"--n-padding-multiple-right":Ss.right,"--n-padding-single-left":vs.left,"--n-padding-multiple-left":Ss.left,"--n-padding-single-bottom":vs.bottom,"--n-padding-multiple-bottom":Ss.bottom,"--n-placeholder-color":si,"--n-placeholder-color-disabled":z,"--n-text-color":at,"--n-text-color-disabled":jt,"--n-arrow-color":Hn,"--n-arrow-color-disabled":Sl,"--n-loading-color":Bl,"--n-color-active-warning":Nl,"--n-box-shadow-focus-warning":Tl,"--n-box-shadow-active-warning":$l,"--n-box-shadow-hover-warning":El,"--n-border-warning":Rl,"--n-border-focus-warning":Pl,"--n-border-hover-warning":Fl,"--n-border-active-warning":Vl,"--n-color-active-error":Ml,"--n-box-shadow-focus-error":Il,"--n-box-shadow-active-error":Al,"--n-box-shadow-hover-error":Ol,"--n-border-error":zl,"--n-border-focus-error":Dl,"--n-border-hover-error":Ll,"--n-border-active-error":_T,"--n-clear-size":CT,"--n-clear-color":wT,"--n-clear-color-hover":xT,"--n-clear-color-pressed":kT,"--n-arrow-size":vT,"--n-font-weight":Ge}}),_t=Ln?Hi("internal-selection",t.computed(()=>n.size[0]),mn,n):void 0;return{mergedTheme:y,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:g,filterablePlaceholder:x,label:w,selected:C,showTagsPanel:m,isComposing:H,counterRef:u,counterWrapperRef:f,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:h,inputTagElRef:p,handleMouseDown:A,handleFocusin:M,handleClear:G,handleMouseEnter:Z,handleMouseLeave:O,handleDeleteOption:Y,handlePatternKeyDown:T,handlePatternInputInput:K,handlePatternInputBlur:L,handlePatternInputFocus:q,handleMouseEnterCounter:vn,handleMouseLeaveCounter:It,handleFocusout:X,handleCompositionEnd:U,handleCompositionStart:J,onPopoverUpdateShow:en,focus:ue,focusInput:oe,blur:le,blurInput:fe,updateCounter:ge,getCounter:_e,getTail:Qe,renderLabel:n.renderLabel,cssVars:Ln?void 0:mn,themeClass:_t==null?void 0:_t.themeClass,onRender:_t==null?void 0:_t.onRender}},render(){const{status:n,multiple:e,size:i,disabled:r,filterable:o,maxTagCount:s,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:f}=this;d==null||d();const h=s==="responsive",p=typeof s=="number",m=h||p,g=t.h(fl,null,{default:()=>t.h(N5,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var y,_;return(_=(y=this.$slots).arrow)===null||_===void 0?void 0:_.call(y)}})});let b;if(e){const{labelField:y}=this,_=R=>t.h("div",{class:`${l}-base-selection-tag-wrapper`,key:R.value},u?u({option:R,handleClose:()=>{this.handleDeleteOption(R)}}):t.h(bl,{size:i,closable:!R.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(R)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(R,!0):Cr(R[y],R,!0)})),x=()=>(p?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),w=o?t.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},t.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})),t.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,C=h?()=>t.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},t.h(bl,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let N;if(p){const R=this.selectedOptions.length-s;R>0&&(N=t.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},t.h(bl,{size:i,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${R}`})))}const k=h?o?t.h(xh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:x,counter:C,tail:()=>w}):t.h(xh,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:x,counter:C}):p&&N?x().concat(N):x(),$=m?()=>t.h("div",{class:`${l}-base-selection-popover`},h?x():this.selectedOptions.map(_)):void 0,v=m?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},c):null,P=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?t.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},t.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,F=o?t.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},k,h?null:w,g):t.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},k,g);b=t.h(t.Fragment,null,m?t.h(b5,Object.assign({},v,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>F,default:$}):F,P)}else if(o){const y=this.pattern||this.isComposing,_=this.active?!y:!this.selected,x=this.active?!1:this.selected;b=t.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:Oh(this.label)},t.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})),x?t.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},t.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Cr(this.label,this.selectedOption,!0))):null,_?t.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},t.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,g)}else b=t.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?t.h("div",{class:`${l}-base-selection-input`,title:Oh(this.label),key:"input"},t.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):f?f(this.selectedOption,!0):Cr(this.label,this.selectedOption,!0))):t.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},t.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),g);return t.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,n&&`${l}-base-selection--${n}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},b,a?t.h("div",{class:`${l}-base-selection__border`}):null,a?t.h("div",{class:`${l}-base-selection__state-border`}):null)}});function P5(n){const{boxShadow2:e}=n;return{menuBoxShadow:e}}const F5={name:"Select",common:Wi,peers:{InternalSelection:lm,InternalSelectMenu:em},self:P5},V5=pe([ke("select",`
|
|
814
814
|
z-index: auto;
|
|
815
815
|
outline: none;
|
|
816
816
|
width: 100%;
|
|
@@ -819,4 +819,4 @@ ${o}
|
|
|
819
819
|
`),ke("select-menu",`
|
|
820
820
|
margin: 4px 0;
|
|
821
821
|
box-shadow: var(--n-menu-box-shadow);
|
|
822
|
-
`,[om({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function ws(n){return n.type==="group"}function cm(n){return n.type==="ignored"}function _l(n,e){try{return!!(1+e.toString().toLowerCase().indexOf(n.trim().toLowerCase()))}catch{return!1}}function M5(n,e){return{getIsGroup:ws,getIgnored:cm,getKey(r){return ws(r)?r.name||r.key||"key-required":r[n]},getChildren(r){return r[e]}}}function I5(n,e,i,r){if(!e)return n;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(ws(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(cm(l))continue;e(i,l)&&a.push(l)}return a}return o(n)}function A5(n,e,i){const r=new Map;return n.forEach(o=>{ws(o)?o[i].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var O5={};const z5=Object.assign(Object.assign({},Rt.props),{to:Gn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),D5=t.defineComponent({name:"Select",props:z5,slots:Object,setup(n){O5.NODE_ENV!=="production"&&t.watchEffect(()=>{n.items!==void 0&&bi("select","`items` is deprecated, please use `options` instead."),n.onChange!==void 0&&bi("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:i,namespaceRef:r,inlineThemeDisabled:o}=Li(n),s=Rt("Select","-select",V5,F5,n,e),a=t.ref(n.defaultValue),l=t.toRef(n,"value"),c=Ya(l,a),d=t.ref(!1),u=t.ref(""),f=If(n,["items","options"]),h=t.ref([]),p=t.ref([]),m=t.computed(()=>p.value.concat(h.value).concat(f.value)),g=t.computed(()=>{const{filter:z}=n;if(z)return z;const{labelField:Q,valueField:se}=n;return(ye,we)=>{if(!we)return!1;const ve=we[Q];if(typeof ve=="string")return _l(ye,ve);const Ne=we[se];return typeof Ne=="string"?_l(ye,Ne):typeof Ne=="number"?_l(ye,String(Ne)):!1}}),b=t.computed(()=>{if(n.remote)return f.value;{const{value:z}=m,{value:Q}=u;return!Q.length||!n.filterable?z:I5(z,g.value,Q,n.childrenField)}}),y=t.computed(()=>{const{valueField:z,childrenField:Q}=n,se=M5(z,Q);return fv(b.value,se)}),_=t.computed(()=>A5(m.value,n.valueField,n.childrenField)),x=t.ref(!1),w=Ya(t.toRef(n,"show"),x),C=t.ref(null),N=t.ref(null),k=t.ref(null),{localeRef:$}=jh("Select"),v=t.computed(()=>{var z;return(z=n.placeholder)!==null&&z!==void 0?z:$.value.placeholder}),E=[],P=t.ref(new Map),F=t.computed(()=>{const{fallbackOption:z}=n;if(z===void 0){const{labelField:Q,valueField:se}=n;return ye=>({[Q]:String(ye),[se]:ye})}return z===!1?!1:Q=>Object.assign(z(Q),{value:Q})});function R(z){const Q=n.remote,{value:se}=P,{value:ye}=_,{value:we}=F,ve=[];return z.forEach(Ne=>{if(ye.has(Ne))ve.push(ye.get(Ne));else if(Q&&se.has(Ne))ve.push(se.get(Ne));else if(we){const $e=we(Ne);$e&&ve.push($e)}}),ve}const M=t.computed(()=>{if(n.multiple){const{value:z}=c;return Array.isArray(z)?R(z):[]}return null}),X=t.computed(()=>{const{value:z}=c;return!n.multiple&&!Array.isArray(z)?z===null?null:R([z])[0]||null:null}),G=qS(n),{mergedSizeRef:Z,mergedDisabledRef:O,mergedStatusRef:A}=G;function Y(z,Q){const{onChange:se,"onUpdate:value":ye,onUpdateValue:we}=n,{nTriggerFormChange:ve,nTriggerFormInput:Ne}=G;se&&Et(se,z,Q),we&&Et(we,z,Q),ye&&Et(ye,z,Q),a.value=z,ve(),Ne()}function H(z){const{onBlur:Q}=n,{nTriggerFormBlur:se}=G;Q&&Et(Q,z),se()}function T(){const{onClear:z}=n;z&&Et(z)}function D(z){const{onFocus:Q,showOnFocus:se}=n,{nTriggerFormFocus:ye}=G;Q&&Et(Q,z),ye(),se&&L()}function K(z){const{onSearch:Q}=n;Q&&Et(Q,z)}function J(z){const{onScroll:Q}=n;Q&&Et(Q,z)}function U(){var z;const{remote:Q,multiple:se}=n;if(Q){const{value:ye}=P;if(se){const{valueField:we}=n;(z=M.value)===null||z===void 0||z.forEach(ve=>{ye.set(ve[we],ve)})}else{const we=X.value;we&&ye.set(we[n.valueField],we)}}}function q(z){const{onUpdateShow:Q,"onUpdate:show":se}=n;Q&&Et(Q,z),se&&Et(se,z),x.value=z}function L(){O.value||(q(!0),x.value=!0,n.filterable&&qe())}function le(){q(!1)}function ue(){u.value="",p.value=E}const oe=t.ref(!1);function fe(){n.filterable&&(oe.value=!0)}function ge(){n.filterable&&(oe.value=!1,w.value||ue())}function _e(){O.value||(w.value?n.filterable?qe():le():L())}function Qe(z){var Q,se;!((se=(Q=k.value)===null||Q===void 0?void 0:Q.selfRef)===null||se===void 0)&&se.contains(z.relatedTarget)||(d.value=!1,H(z),le())}function Re(z){D(z),d.value=!0}function Mt(){d.value=!0}function vn(z){var Q;!((Q=C.value)===null||Q===void 0)&&Q.$el.contains(z.relatedTarget)||(d.value=!1,H(z),le())}function It(){var z;(z=C.value)===null||z===void 0||z.focus(),le()}function en(z){var Q;w.value&&(!((Q=C.value)===null||Q===void 0)&&Q.$el.contains(Wr(z))||le())}function Ln(z){if(!Array.isArray(z))return[];if(F.value)return Array.from(z);{const{remote:Q}=n,{value:se}=_;if(Q){const{value:ye}=P;return z.filter(we=>se.has(we)||ye.has(we))}else return z.filter(ye=>se.has(ye))}}function mn(z){_t(z.rawNode)}function _t(z){if(O.value)return;const{tag:Q,remote:se,clearFilterAfterSelect:ye,valueField:we}=n;if(Q&&!se){const{value:ve}=p,Ne=ve[0]||null;if(Ne){const $e=h.value;$e.length?$e.push(Ne):h.value=[Ne],p.value=E}}if(se&&P.value.set(z[we],z),n.multiple){const ve=Ln(c.value),Ne=ve.findIndex($e=>$e===z[we]);if(~Ne){if(ve.splice(Ne,1),Q&&!se){const $e=ae(z[we]);~$e&&(h.value.splice($e,1),ye&&(u.value=""))}}else ve.push(z[we]),ye&&(u.value="");Y(ve,R(ve))}else{if(Q&&!se){const ve=ae(z[we]);~ve?h.value=[h.value[ve]]:h.value=E}at(),le(),Y(z[we],z)}}function ae(z){return h.value.findIndex(se=>se[n.valueField]===z)}function de(z){w.value||L();const{value:Q}=z.target;u.value=Q;const{tag:se,remote:ye}=n;if(K(Q),se&&!ye){if(!Q){p.value=E;return}const{onCreate:we}=n,ve=we?we(Q):{[n.labelField]:Q,[n.valueField]:Q},{valueField:Ne,labelField:$e}=n;f.value.some(rt=>rt[Ne]===ve[Ne]||rt[$e]===ve[$e])||h.value.some(rt=>rt[Ne]===ve[Ne]||rt[$e]===ve[$e])?p.value=E:p.value=[ve]}}function Ge(z){z.stopPropagation();const{multiple:Q}=n;!Q&&n.filterable&&le(),T(),Q?Y([],[]):Y(null,null)}function Ui(z){!Hr(z,"action")&&!Hr(z,"empty")&&!Hr(z,"header")&&z.preventDefault()}function oi(z){J(z)}function si(z){var Q,se,ye,we,ve;if(!n.keyboard){z.preventDefault();return}switch(z.key){case" ":if(n.filterable)break;z.preventDefault();case"Enter":if(!(!((Q=C.value)===null||Q===void 0)&&Q.isComposing)){if(w.value){const Ne=(se=k.value)===null||se===void 0?void 0:se.getPendingTmNode();Ne?mn(Ne):n.filterable||(le(),at())}else if(L(),n.tag&&oe.value){const Ne=p.value[0];if(Ne){const $e=Ne[n.valueField],{value:rt}=c;n.multiple&&Array.isArray(rt)&&rt.includes($e)||_t(Ne)}}}z.preventDefault();break;case"ArrowUp":if(z.preventDefault(),n.loading)return;w.value&&((ye=k.value)===null||ye===void 0||ye.prev());break;case"ArrowDown":if(z.preventDefault(),n.loading)return;w.value?(we=k.value)===null||we===void 0||we.next():L();break;case"Escape":w.value&&(LS(z),le()),(ve=C.value)===null||ve===void 0||ve.focus();break}}function at(){var z;(z=C.value)===null||z===void 0||z.focus()}function qe(){var z;(z=C.value)===null||z===void 0||z.focusInput()}function on(){var z;w.value&&((z=N.value)===null||z===void 0||z.syncPosition())}U(),t.watch(t.toRef(n,"options"),U);const sn={focus:()=>{var z;(z=C.value)===null||z===void 0||z.focus()},focusInput:()=>{var z;(z=C.value)===null||z===void 0||z.focusInput()},blur:()=>{var z;(z=C.value)===null||z===void 0||z.blur()},blurInput:()=>{var z;(z=C.value)===null||z===void 0||z.blurInput()}},lt=t.computed(()=>{const{self:{menuBoxShadow:z}}=s.value;return{"--n-menu-box-shadow":z}}),jt=o?Hi("select",void 0,lt,n):void 0;return Object.assign(Object.assign({},sn),{mergedStatus:A,mergedClsPrefix:e,mergedBordered:i,namespace:r,treeMate:y,isMounted:as(),triggerRef:C,menuRef:k,pattern:u,uncontrolledShow:x,mergedShow:w,adjustedTo:Gn(n),uncontrolledValue:a,mergedValue:c,followerRef:N,localizedPlaceholder:v,selectedOption:X,selectedOptions:M,mergedSize:Z,mergedDisabled:O,focused:d,activeWithoutMenuOpen:oe,inlineThemeDisabled:o,onTriggerInputFocus:fe,onTriggerInputBlur:ge,handleTriggerOrMenuResize:on,handleMenuFocus:Mt,handleMenuBlur:vn,handleMenuTabOut:It,handleTriggerClick:_e,handleToggle:mn,handleDeleteOption:_t,handlePatternInput:de,handleClear:Ge,handleTriggerBlur:Qe,handleTriggerFocus:Re,handleKeydown:si,handleMenuAfterLeave:ue,handleMenuClickOutside:en,handleMenuScroll:oi,handleMenuKeydown:si,handleMenuMousedown:Ui,mergedTheme:s,cssVars:o?void 0:lt,themeClass:jt==null?void 0:jt.themeClass,onRender:jt==null?void 0:jt.onRender})},render(){return t.h("div",{class:`${this.mergedClsPrefix}-select`},t.h(Df,null,{default:()=>[t.h(Lf,null,{default:()=>t.h(R5,{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 n,e;return[(e=(n=this.$slots).arrow)===null||e===void 0?void 0:e.call(n)]}})}),t.h(nh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Gn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>t.h(t.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var n,e,i;return this.mergedShow||this.displayDirective==="show"?((n=this.onRender)===null||n===void 0||n.call(this),t.withDirectives(t.h(s5,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:[(i=this.menuProps)===null||i===void 0?void 0:i.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"?[[t.vShow,this.mergedShow],[ss,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ss,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),L5={},dm=t.defineComponent({...L5,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=t.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=t.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]);t.watch(()=>r.value,_=>{const w=(V.isArray(_)?_:_?[_]:[]).filter(C=>!l.value.some(N=>N.value===C.id));w.length>0&&(l.value=[...r.optionsListConverter(w),...l.value])},{deep:1});const c=t.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=t.ref(!1),u=t.useTemplateRef("select-component"),f=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(x=>{if(V.isEmpty(x))return;const w=s.value?r.value:r.value?[r.value]:[],C=x.filter(N=>!w.some(k=>k.id===N.id));l.value=r.optionsListConverter([...w,...C])}).finally(()=>{d.value=!1}))};let h="";const p=V.debounce(()=>f(h),800),m=_=>{h=_,p()},g=_=>{var x;if(V.isArray(_)){const w=_.length>0?_.map(C=>{var N;return t.toRaw((N=l.value.find(k=>k.value===C))==null?void 0:N.item)}):[];o("update:value",w)}else if(_>0){const w=t.toRaw((x=l.value.find(C=>C.value===_))==null?void 0:x.item);o("update:value",w)}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()}}),(_,x)=>(t.openBlock(),t.createBlock(t.unref(D5),{ref:"select-component","clear-filter-after-select":!0,clearable:n.clearable,"consistent-menu-width":n.consistentMenuWidth,disabled:n.disabled,filterable:!0,loading:d.value,multiple:s.value,options:c.value,placeholder:n.placeholder,remote:!0,value:a.value,"render-label":n.renderLabel,"render-tag":n.renderTag,onSearch:m,"onUpdate:value":g},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),H5={},um=t.defineComponent({...H5,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?W.HttpRequester.getInstance(W.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?W.HttpRequester.getInstance(W.ProductDataProvider).publicSimpleSearch(f):new Promise(h=>{h([])}),l=f=>r.searchType==="categories"?wt.convertReferencesToSelectOptionsList(f,!0,!1,!1,h=>h!=null&&h.isNewRec()?"-":h.name):r.searchType==="products"?wt.convertReferencesToSelectOptionsList(f,!0,!1,!1,h=>h!=null&&h.isNewRec()?"-":`[${h.code}] ${h.name}`):[],c=(f,h)=>{if(r.renderLabel)return r.renderLabel(f,h);if(r.searchType==="products"){const p=f.item;return t.h("div",{},[t.h("span",{class:"text-sc-grey mr-2.5"},p.code),t.h("span",{},[p.name])])}if(r.searchType==="categories"){const p=f.item;return t.h("div",{},[p.name])}};return e({focus:()=>{var f;return(f=s.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=s.value)==null?void 0:f.blur()}}),(f,h)=>(t.openBlock(),t.createBlock(dm,{ref:"select-component",value:n.value,clearable:n.clearable,disabled:n.disabled,placeholder:n.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":n.consistentMenuWidth,"wrap-content":n.wrapContent,"min-term-length":n.minTermLength,"render-label":c,"render-tag":n.renderTag,"onUpdate:value":h[0]||(h[0]=p=>o("update:value",p))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),W5={class:"col-span-2 flex flex-row gap-2.5"},j5={class:"flex-1"},q5={class:"text-sc-grey"},X5={class:"ml-2.5"},Y5={key:0,class:"flex-none"},U5={},K5=t.defineComponent({...U5,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(n,{emit:e}){const i=n,r=e,o=t.ref(null),s=()=>structuredClone(t.toRaw(i.value)),a=t.ref(s()),l=()=>{r("update:value",a.value.map(f=>t.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(h=>t.toRaw(h)),...(V.isArray(f)?f:[f]).filter(h=>!a.value.some(p=>p.id===h.id))],t.nextTick(()=>{o.value=null}),l())},d=f=>{f&&(a.value=a.value.map(h=>h.id===f.id?f:t.toRaw(h)),l())},u=f=>{a.value=a.value.filter(h=>h.id!==f.id),l()};return t.watch(()=>i.value,()=>{a.value=s()}),(f,h)=>{const p=I.NListItem,m=vC,g=I.NButton,b=I.NList;return t.openBlock(),t.createBlock(b,{"show-divider":!1,hoverable:!0},{header:t.withCtx(()=>[t.renderSlot(f.$slots,"header")]),footer:t.withCtx(()=>[t.createVNode(um,{value:o.value,"onUpdate:value":[h[0]||(h[0]=y=>o.value=y),c],clearable:!0,disabled:n.disabled,"min-term-length":n.minTermLength,"search-type":n.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:t.withCtx(()=>[a.value.length===0?(t.openBlock(),t.createBlock(p,{key:0,class:"text-center text-sm text-gray-600"},{default:t.withCtx(()=>[...h[1]||(h[1]=[t.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,y=>(t.openBlock(),t.createBlock(p,{key:y.id},{suffix:t.withCtx(()=>[t.createVNode(g,{disabled:n.disabled,quaternary:"",type:"error",onClick:_=>u(y)},{default:t.withCtx(()=>[t.createVNode(m)]),_:1},8,["disabled","onClick"])]),default:t.withCtx(()=>[t.createElementVNode("div",W5,[t.createElementVNode("span",j5,[t.createElementVNode("span",q5,t.toDisplayString(y.code),1),t.createElementVNode("span",X5,t.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(t.openBlock(),t.createElementBlock("div",Y5,[t.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):t.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),G5={class:"flex flex-col"},Z5={class:"flex flex-col gap-1.5 text-base text-nowrap"},Q5={class:"font-medium"},J5={class:"flex flex-col text-sc-dark-grey"},e3={key:0},t3={class:"font-medium"},n3={class:"font-medium"},i3={class:"font-medium"},r3={class:"font-medium"},o3={class:"font-medium"},s3={class:"font-medium"},a3={class:"font-medium"},l3={class:"font-medium"},c3={class:"font-medium"},d3={class:"font-medium"},u3={class:"flex flex-col gap-1.5 text-base text-nowrap"},f3={class:"font-medium"},h3={class:"flex flex-col text-sc-dark-grey"},m3={class:"font-medium"},p3={class:"font-medium"},g3={class:"flex flex-col gap-1.5 text-base text-nowrap"},y3={class:"font-medium"},b3={class:"text-sc-dark-grey"},_3={class:"font-medium"},w3={key:1,class:"text-base font-medium text-nowrap"},x3={},wl=t.defineComponent({...x3,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},updateQuantityOnInput:{type:Boolean,default:!0}},setup(n){const e=[W.ConfiguratorsEnum.Kozyrek,W.ConfiguratorsEnum.Mosquitto,W.ConfiguratorsEnum.Strip,W.ConfiguratorsEnum.MetalForDoors,W.ConfiguratorsEnum.Sandwich,W.ConfiguratorsEnum.SandwichM2],i=n,r=t.ref(!1),o=t.computed(()=>i.item),s=t.computed(()=>{var m,g;return((m=i.item.product.unit)==null?void 0:m.isLinear)&&((g=i.item.product.properties)==null?void 0:g.isLengthConfigurator)}),a=t.computed(()=>W.UnitsHelper.getProductLengthMultiplicity(i.item.product)),l=t.computed(()=>Ve.multiplyByStep(i.item.quantity,a.value)),c=t.computed(()=>W.UnitsHelper.getProductMultiplicity(i.item.product)),d=t.computed(()=>c.value>1),u=t.ref({quantity:i.item.quantity});t.watch(()=>i.item,m=>{u.value={quantity:m.quantity}});const f=m=>{var g;m!==null&&(u.value.quantity=m,(g=i.eventEmitter)==null||g.emit("order-item:edit-quantity",{item:o.value,quantity:m,loaderRef:r}))},h=()=>{var m;(m=i.eventEmitter)==null||m.emit("order-item:open-configurator",{item:o.value})},p=()=>{var m;(m=i.eventEmitter)==null||m.emit("order-item:edit",{item:o.value})};return(m,g)=>{const b=I.NInputNumber;return t.openBlock(),t.createElementBlock("div",G5,[n.item.configurator&&n.item.configuratorParams&&e.includes(n.item.configurator)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",Z5,[t.createElementVNode("span",null,[g[1]||(g[1]=t.createTextVNode(" Количество: ",-1)),t.createElementVNode("span",Q5,t.toDisplayString(n.item.quantity)+" шт.",1)]),t.createElementVNode("div",J5,[n.item.configurator===t.unref(W.ConfiguratorsEnum).Kozyrek?(t.openBlock(),t.createElementBlock("span",e3,[g[2]||(g[2]=t.createTextVNode(" Длина: ",-1)),t.createElementVNode("span",t3,t.toDisplayString(Math.round(n.item.length*1e3))+" мм.",1)])):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).Mosquitto?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("span",null,[g[3]||(g[3]=t.createTextVNode(" Ширина: ",-1)),t.createElementVNode("span",n3,t.toDisplayString(Math.round(n.item.width*1e3))+" мм.",1)]),t.createElementVNode("span",null,[g[4]||(g[4]=t.createTextVNode(" Высота: ",-1)),t.createElementVNode("span",i3,t.toDisplayString(Math.round(n.item.height*1e3))+" мм.",1)])],64)):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).Strip?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.item.configuratorParams.linesWidths,(y,_)=>(t.openBlock(),t.createElementBlock("span",{key:_},[t.createTextVNode(" Полоса №"+t.toDisplayString(Number(_)+1)+": ",1),t.createElementVNode("span",r3,t.toDisplayString(y)+" мм.",1)]))),128)),t.createElementVNode("span",null,[g[5]||(g[5]=t.createTextVNode(" Метраж: ",-1)),t.createElementVNode("span",o3,t.toDisplayString(n.item.length)+" м.",1)])],64)):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).MetalForDoors?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("span",null,[g[6]||(g[6]=t.createTextVNode(" Ширина: ",-1)),t.createElementVNode("span",s3,t.toDisplayString(n.item.width)+" мм.",1)]),t.createElementVNode("span",null,[g[7]||(g[7]=t.createTextVNode(" Длина: ",-1)),t.createElementVNode("span",a3,t.toDisplayString(Math.round(n.item.length*1e3))+" мм.",1)])],64)):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).Sandwich?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:4},t.renderList(n.item.configuratorParams.items??[],(y,_)=>(t.openBlock(),t.createElementBlock("span",{key:_},[t.createTextVNode(" Изделие №"+t.toDisplayString(Number(_)+1)+": ",1),t.createElementVNode("span",l3,t.toDisplayString(y.width)+"×"+t.toDisplayString(y.length)+" мм, "+t.toDisplayString(y.count)+" шт.",1)]))),128)):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).SandwichM2?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.createElementVNode("span",null,[g[8]||(g[8]=t.createTextVNode(" Ширина: ",-1)),t.createElementVNode("span",c3,t.toDisplayString(Math.round(n.item.width*1e3))+" мм.",1)]),t.createElementVNode("span",null,[g[9]||(g[9]=t.createTextVNode(" Длина: ",-1)),t.createElementVNode("span",d3,t.toDisplayString(Math.round(n.item.length*1e3))+" мм.",1)])],64)):t.createCommentVNode("",!0)])]),n.allowEdit?(t.openBlock(),t.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:t.withModifiers(h,["prevent"])}," Изменить ")):t.createCommentVNode("",!0)],64)):s.value&&a.value>0?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",u3,[t.createElementVNode("span",null,[g[10]||(g[10]=t.createTextVNode(" Количество: ",-1)),t.createElementVNode("span",f3,t.toDisplayString(n.item.quantity)+" шт.",1)]),t.createElementVNode("div",h3,[t.createElementVNode("span",null,[g[11]||(g[11]=t.createTextVNode(" Длина: ",-1)),t.createElementVNode("span",m3,t.toDisplayString(a.value)+" "+t.toDisplayString(n.item.product.unit.name),1)]),t.createElementVNode("span",null,[g[12]||(g[12]=t.createTextVNode(" Всего: ",-1)),t.createElementVNode("span",p3,t.toDisplayString(l.value)+" "+t.toDisplayString(n.item.product.unit.name),1)])])]),n.allowEdit?(t.openBlock(),t.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:t.withModifiers(p,["prevent"])}," Изменить ")):t.createCommentVNode("",!0)],64)):n.item.product.getIsMeasurable()?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",g3,[t.createElementVNode("span",null,[g[13]||(g[13]=t.createTextVNode(" Количество: ",-1)),t.createElementVNode("span",y3,t.toDisplayString(n.item.quantity)+" шт.",1)]),t.createElementVNode("span",b3,[g[14]||(g[14]=t.createTextVNode(" Метраж: ",-1)),t.createElementVNode("span",_3,t.toDisplayString(n.item.length??n.item.width)+" "+t.toDisplayString(n.item.product.unit.name),1)])]),n.allowEdit?(t.openBlock(),t.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:t.withModifiers(p,["prevent"])}," Изменить ")):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[n.allowEdit?(t.openBlock(),t.createBlock(b,{key:0,value:u.value.quantity,parse:t.unref(ht),min:c.value,step:c.value,"show-button":d.value,"button-placement":"both","update-value-on-input":n.updateQuantityOnInput,disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:g[0]||(g[0]=y=>t.unref(fo)(y,".",!1)),onFocus:t.unref(He),"onUpdate:value":f},{suffix:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.item.product.unit.name),1)]),_:1},8,["value","parse","min","step","show-button","update-value-on-input","disabled","loading","onFocus"])):(t.openBlock(),t.createElementBlock("span",w3,t.toDisplayString(n.item.quantity)+" "+t.toDisplayString(n.item.product.unit.name),1))],64))])}}}),k3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C3(n,e){return t.openBlock(),t.createElementBlock("svg",k3,[...e[0]||(e[0]=[t.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 v3=t.markRaw({name:"tabler-truck-filled",render:C3}),S3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function B3(n,e){return t.openBlock(),t.createElementBlock("svg",S3,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.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"}),t.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const N3=t.markRaw({name:"tabler-truck-delivery",render:B3}),T3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $3(n,e){return t.openBlock(),t.createElementBlock("svg",T3,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),t.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 E3=t.markRaw({name:"tabler-truck-loading",render:$3}),R3={class:"flex flex-col gap-1"},P3={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},F3={key:1,class:"text-base"},V3={class:"text-sc-dark-grey mr-1.5"},M3={key:0},I3={key:1},A3={},xs=t.defineComponent({...A3,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(n){const e=t.computed(()=>{var s;return(s=W.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(a=>a.id===o.delivery.type)}),i=t.computed(()=>Ce.format(o.delivery.date,"dd.MM.yyyy")),r=t.computed(()=>{var s;return(s=o.delivery.address)!=null&&s.address?li.getFormatEntityName({name:o.delivery.address.address,deletedAt:o.delivery.address.deletedAt}):""}),o=n;return(s,a)=>{var u,f,h,p,m,g,b,y;const l=E3,c=N3,d=v3;return t.openBlock(),t.createElementBlock("div",R3,[n.showType?(t.openBlock(),t.createElementBlock("span",P3,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(t.openBlock(),t.createBlock(l,{key:0})):t.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="delivery"?(t.openBlock(),t.createBlock(c,{key:1})):t.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(t.openBlock(),t.createBlock(d,{key:2})):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString((p=e.value)==null?void 0:p.name),1)])):t.createCommentVNode("",!0),n.showDetails?(t.openBlock(),t.createElementBlock("span",F3,[t.createElementVNode("span",V3,t.toDisplayString(i.value),1),(g=(m=n.delivery)==null?void 0:m.address)!=null&&g.address?(t.openBlock(),t.createElementBlock("span",M3,t.toDisplayString(r.value),1)):t.createCommentVNode("",!0),(y=(b=n.delivery)==null?void 0:b.warehouse)!=null&&y.address?(t.openBlock(),t.createElementBlock("span",I3," со склада "+t.toDisplayString(n.delivery.warehouse.address),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])}}}),O3={class:"flex flex-col gap-2.5"},z3={class:"text-base"},D3=["href"],L3={key:1,class:"text-sc-grey"},H3={},fm=t.defineComponent({...H3,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{},highlightSettings:{}},setup(n){const e=n,i=t.computed(()=>e.fields.includes(Ie.Id)?e.order.id:void 0),r=t.computed(()=>{var f,h;return e.fields.includes(Ie.Status)?(h=(f=W.useReferencesStore().orderStatusReference)==null?void 0:f.find(p=>{var m;return p.id===(((m=e.order.status)==null?void 0:m.id)??-1)}))==null?void 0:h.name:void 0}),o=t.computed(()=>{var f;return ki((f=e.order.status)==null?void 0:f.slug)}),s=t.computed(()=>{var h,p;const f=(h=e.order.status)==null?void 0:h.slug;return!!f&&(((p=e.highlightSettings)==null?void 0:p.statuses.includes(f))??!1)}),a=t.computed(()=>Fs(e.order).filter(f=>[ct.OnOrder,ct.NotInStock].includes(f))),l=f=>{var h;return((h=e.highlightSettings)==null?void 0:h.markers.includes(f))??!1},c=t.computed(()=>e.fields.includes(Ie.CreatedAt)),d=t.computed(()=>e.fields.includes(Ie.ClientInfo)||e.fields.includes(Ie.ClientInfoShort)?e.order.client:void 0),u=t.computed(()=>e.fields.includes(Ie.DeliveryInfo)?e.order.delivery:void 0);return(f,h)=>(t.openBlock(),t.createElementBlock("div",O3,[t.createElementVNode("span",z3,[i.value?(t.openBlock(),t.createElementBlock("a",{key:0,href:n.orderUrl.replace(":id",n.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+t.toDisplayString(i.value),9,D3)):t.createCommentVNode("",!0),c.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[h[0]||(h[0]=t.createTextVNode(" от ",-1)),t.createVNode(es,{date:n.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[h[1]||(h[1]=t.createTextVNode(" - ",-1)),s.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"font-medium",style:t.normalizeStyle({color:o.value.color})},t.toDisplayString(r.value),5)):(t.openBlock(),t.createElementBlock("span",L3,t.toDisplayString(r.value),1))],64)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,p=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:p},[h[2]||(h[2]=t.createTextVNode(" - ",-1)),t.createElementVNode("span",{class:t.normalizeClass({"font-medium":l(p),"text-sc-dark-grey":!l(p)}),style:t.normalizeStyle(l(p)?{color:t.unref(Er)(p).color}:void 0)},t.toDisplayString(t.unref(Ps)(p)),7)],64))),128))]),d.value?(t.openBlock(),t.createBlock(Dr,{key:0,client:d.value,class:"ml-3"},null,8,["client"])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createBlock(xs,{key:1,delivery:u.value,class:"ml-3"},null,8,["delivery"])):t.createCommentVNode("",!0)]))}}),W3={},xl=t.defineComponent({...W3,__name:"order-payment",props:{payment:{}},setup(n){const e=n,i=t.computed(()=>{var r;return(r=W.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return t.openBlock(),t.createElementBlock("span",null,t.toDisplayString(((s=i.value)==null?void 0:s.name)??"-"),1)}}}),j3={},q3=t.defineComponent({...j3,__name:"order-item-specification",props:{src:{}},setup(n){const e=t.useTemplateRef("image-reference");return(i,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.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()})}," Спецификация "),t.withDirectives(t.createVNode(t.unref(I.NImage),{ref:"image-reference",src:n.src,"previewed-img-props":{style:"max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;"}},null,8,["src"]),[[t.vShow,!1]])],64))}}),X3={},ks=t.defineComponent({...X3,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(n){const e=n,i={quantity:"количество",length:"длина"},r=t.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=t.computed(()=>{const s={[W.UserTypeEnum.Manager]:"менеджером",[W.UserTypeEnum.Operator]:"оператором",[W.UserTypeEnum.Client]:"клиентом",[W.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>i[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)=>(t.openBlock(),t.createElementBlock("small",{class:t.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}`)},t.toDisplayString(o.value),3))}}),Y3={class:"flex flex-col gap-0.5"},U3={class:"text-gray-600"},K3={},hm=t.defineComponent({...K3,__name:"order-item-name",props:{item:{},showCode:{type:Boolean,default:!1},inactive:{type:Boolean,default:void 0}},setup(n){const e=n,i=t.inject(W.currentOrderInjectionKey,null),r=t.computed(()=>{if(i!=null)return t.toValue(i)??void 0}),o=t.computed(()=>{const{item:d,inactive:u}=e;return u??(!!d.isRemoved||!!d.replacementId)}),s=t.computed(()=>{const{creator:d}=e.item;return!!(d!=null&&d.type)&&(!r.value||r.value.creator.guid!==d.guid)}),a=t.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),l=t.computed(()=>"changedFields"in e.item?e.item.changedFields:[]),c=t.computed(()=>{var d,u;return"replacement"in e.item?(u=(d=e.item.replacement)==null?void 0:d.creator)==null?void 0:u.type:void 0});return(d,u)=>(t.openBlock(),t.createElementBlock("div",Y3,[t.createElementVNode("div",{class:t.normalizeClass(o.value?"line-through opacity-50":"")},[t.createVNode(go,{product:n.item.product,"show-additional-sale-icon":n.item.isAdditionalSale??!1,"show-code":n.showCode},null,8,["product","show-additional-sale-icon","show-code"])],2),n.item.marker?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(o.value?"line-through opacity-50":"")},[u[0]||(u[0]=t.createTextVNode(" Маркировка: ",-1)),t.createElementVNode("span",U3,t.toDisplayString(n.item.marker),1)],2)):t.createCommentVNode("",!0),a.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(o.value?"line-through opacity-50":"")},[t.createVNode(q3,{src:a.value},null,8,["src"])],2)):t.createCommentVNode("",!0),s.value&&!o.value?(t.openBlock(),t.createBlock(ks,{key:2,"user-type":n.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):t.createCommentVNode("",!0),n.item.isRemoved&&!n.item.replacementId&&l.value.length===0?(t.openBlock(),t.createBlock(ks,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):t.createCommentVNode("",!0),n.item.replacementId&&l.value.length>0?(t.openBlock(),t.createBlock(ks,{key:4,"user-type":c.value,"changed-fields":l.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):t.createCommentVNode("",!0)]))}}),G3={class:"flex flex-row gap-1.5"},Z3={class:"flex flex-1 flex-col gap-2.5"},Q3={class:"flex items-start gap-1"},J3={},mm=t.defineComponent({...J3,__name:"order-product-info",props:{product:{},index:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},updateQuantityOnInput:{type:Boolean,default:!0},inactive:{type:Boolean,default:!1}},setup(n){const e=n,i=t.computed(()=>e.inactive?"line-through opacity-50":"");return(r,o)=>(t.openBlock(),t.createElementBlock("div",G3,[t.createElementVNode("span",{class:t.normalizeClass(["flex-none text-nowrap",i.value])},t.toDisplayString(n.index+1)+". ",3),t.createElementVNode("div",Z3,[t.createVNode(hm,{item:n.product,inactive:n.inactive,"show-code":""},null,8,["item","inactive"]),t.createElementVNode("div",Q3,[t.createVNode(wl,{item:n.product,"event-emitter":n.eventEmitter,"allow-edit":n.allowEdit,"update-quantity-on-input":n.updateQuantityOnInput,class:t.normalizeClass(["min-w-0 flex-1",i.value])},null,8,["item","event-emitter","allow-edit","update-quantity-on-input","class"]),n.allowEdit?t.renderSlot(r.$slots,"actions",{key:0}):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:t.normalizeClass(["grid grid-flow-col grid-rows-2 gap-1 text-base",i.value])},[o[0]||(o[0]=t.createElementVNode("span",null,"Цена за ед.",-1)),t.createVNode(ci,{product:n.product,"cost-field-name":"costOneRub"},null,8,["product"]),o[1]||(o[1]=t.createElementVNode("span",null,"Сумма",-1)),t.createVNode(ci,{product:n.product,"cost-field-name":"cost"},null,8,["product"])],2)])]))}}),e4={class:"flex items-center gap-1.5"},t4={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},n4={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},i4={},pm=t.defineComponent({...i4,__name:"order-status-tag",props:{status:{},statusDetail:{default:null},variant:{default:"filled"},size:{default:"medium"},showDot:{type:Boolean,default:!0}},setup(n){const e=n,i=t.computed(()=>ki(e.status.slug)),r=t.computed(()=>Kl(e.status.slug)),o=t.computed(()=>e.statusDetail?`${e.status.name} (${e.statusDetail.name})`:e.status.name);return(s,a)=>{const l=I.NTag;return n.variant==="filled"?(t.openBlock(),t.createBlock(l,{key:0,color:r.value,bordered:!1,size:n.size,round:""},{default:t.withCtx(()=>[t.createElementVNode("span",e4,[n.showDot?(t.openBlock(),t.createElementBlock("span",t4)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.value),1)])]),_:1},8,["color","size"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"inline-flex items-center gap-1.5 font-medium",style:t.normalizeStyle({color:i.value.color})},[n.showDot?(t.openBlock(),t.createElementBlock("span",n4)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.value),1)],4))}}}),r4={},kl=t.defineComponent({...r4,__name:"order-color-swatch",props:{colors:{}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("span",{class:"inline-flex h-5 min-w-8 shrink-0 items-center justify-center rounded px-1.5 text-xs font-semibold leading-none",style:t.normalizeStyle({backgroundColor:n.colors.backgroundColor,color:n.colors.textOnBackgroundColor,border:`1px solid ${n.colors.color}`})}," Аа ",4))}}),o4={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function s4(n,e){return t.openBlock(),t.createElementBlock("svg",o4,[...e[0]||(e[0]=[t.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),t.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),t.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 a4=t.markRaw({name:"ion-trash-outline",render:s4}),l4={key:0,class:"!mb-3 !mt-0 text-base font-semibold"},c4={class:"mb-1 flex flex-wrap items-baseline justify-between gap-2"},d4={class:"flex items-baseline gap-2"},u4={class:"text-base font-bold text-sc-dark-grey"},f4={key:0,class:"text-sm text-sc-grey"},h4={key:0,class:"text-sm text-sc-dark-grey"},m4={},p4=t.defineComponent({...m4,__name:"order-items-list",props:t.mergeModels({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},title:{default:"Список позиций"},groups:{default:void 0},extraColumns:{default:void 0},isItemInactive:{type:Function,default:void 0},isItemSelectable:{type:Function,default:void 0},updateQuantityOnInput:{type:Boolean,default:!0}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:["update:selectedRowKeys"],setup(n){const e=n,i=t.useModel(n,"selectedRowKeys"),r=b=>V.sortBy(b,"ord"),o=t.computed(()=>r(e.products)),s=b=>e.isItemInactive?e.isItemInactive(b):!!b.isRemoved||!!b.replacementId,a=b=>e.isItemSelectable?e.isItemSelectable(b):!s(b),l=(b,y)=>{y?i.value.includes(b)||(i.value=[...i.value,b]):i.value=i.value.filter(_=>_!==b)},c=b=>e.selectable?{class:i.value.includes(b.id)?void 0:"opacity-60"}:{},d=(b,y)=>{const _=o.value,x=b.logicGroupId;if(!x)return 1;const w=_.at(y-1);if(y&&w&&w.logicGroupId===x)return 0;const C=_.slice(y),N=C.findIndex(k=>k.logicGroupId!==x);return N===-1?C.length:N},u=b=>s(b)?null:t.h(I.NButton,{quaternary:!0,size:"small",type:"error",onClick:()=>{var y;(y=e.eventEmitter)==null||y.emit("order-item:delete",{item:b})}},()=>t.h(a4)),f=t.ref(Ue.getDeviceTypeByResolution()),h=t.ref(window.innerWidth),p=()=>{const b=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(_,x)=>t.h("span",{class:`text-base${s(_)?" line-through opacity-50":""}`},[x+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,width:h.value>=1536?156:120,render:_=>t.h("span",{class:`text-base${s(_)?" line-through opacity-50":""}`},[_.product.code])},{title:"Наименование",key:"name",resizable:!0,render:_=>t.h(hm,{item:_,inactive:s(_)})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:d,render:_=>t.h(wl,{class:s(_)?"line-through opacity-50":"",item:_,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!s(_),updateQuantityOnInput:e.updateQuantityOnInput})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,width:120,render:_=>t.h("div",{class:s(_)?"line-through opacity-50":""},[t.h(ci,{product:_,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,width:120,render:_=>t.h("div",{class:s(_)?"line-through opacity-50":""},[t.h(ci,{product:_,costFieldName:"cost",showCurrency:!0})])},...e.extraColumns??[],...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:d,render:_=>u(_)}]:[]],y=e.selectable?[{key:"checkbox",title:"",className:"align-top",width:"32",cellProps:_=>({class:a(_)?"cursor-pointer":void 0,onClick:()=>{a(_)&&l(_.id,!i.value.includes(_.id))}}),render:_=>t.h(I.NCheckbox,{checked:i.value.includes(_.id),disabled:!a(_)})}]:[];switch(f.value){case Xe.phone:case Xe.tablet:return[...y,{title:"",key:"items",resizable:!0,render:(_,x)=>{const w=d(_,x)>0,C=e.allowEdit&&!s(_)&&w;return t.h(mm,{product:_,index:x,eventEmitter:e.eventEmitter,allowEdit:C,updateQuantityOnInput:e.updateQuantityOnInput,inactive:s(_)},{actions:()=>u(_)})}}];case Xe.laptop:return[...y,...b];default:return[...y,...b]}},m=t.computed(()=>p()),g=()=>{f.value=Ue.getDeviceTypeByResolution(),h.value=window.innerWidth};return t.onMounted(()=>{g(),window.addEventListener("resize",g)}),t.onUnmounted(()=>{window.removeEventListener("resize",g)}),(b,y)=>{const _=I.NDataTable;return t.openBlock(),t.createElementBlock(t.Fragment,null,[n.title?(t.openBlock(),t.createElementBlock("h3",l4,t.toDisplayString(n.title),1)):t.createCommentVNode("",!0),n.groups?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(n.groups,x=>(t.openBlock(),t.createElementBlock("div",{key:x.name,class:"mb-6 last:mb-0"},[t.createElementVNode("div",c4,[t.createElementVNode("div",d4,[t.createElementVNode("span",u4,t.toDisplayString(x.name),1),x.description?(t.openBlock(),t.createElementBlock("span",f4,t.toDisplayString(x.description),1)):t.createCommentVNode("",!0)]),x.summary?(t.openBlock(),t.createElementBlock("span",h4,t.toDisplayString(x.summary),1)):t.createCommentVNode("",!0)]),t.createVNode(_,{columns:m.value,data:r(x.items),"row-key":w=>w.id,"row-props":c,"bottom-bordered":!1,bordered:!1,"max-height":n.maxHeight},null,8,["columns","data","row-key","max-height"])]))),128)):(t.openBlock(),t.createBlock(_,{key:2,columns:m.value,data:o.value,"row-key":x=>x.id,"row-props":c,"bottom-bordered":!1,bordered:!1,"max-height":n.maxHeight},null,8,["columns","data","row-key","max-height"]))],64)}}}),gm=gn(p4,[["__scopeId","data-v-be7a0384"]]),g4={key:0,class:"text-sc-dark-grey my-2 text-center"},y4={key:1,class:"text-sc-dark-grey my-2"},b4={},ym=t.defineComponent({...b4,__name:"order-status-history",props:{order:{}},setup(n){const e=n,i=t.ref(!1),r=t.ref([]),o=a=>{const{uiDateWithTime:l}=W.useBaseConfigStateStore().config.dateFormats;return Ce.format(a,l)},s=(a=!0)=>{a&&(i.value=!0),W.HttpRequester.getInstance(W.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(l=>{r.value=l}).finally(()=>{a&&(i.value=!1)})};return t.watch(()=>e.order,()=>{s(!1)}),t.onMounted(()=>{s()}),(a,l)=>{const c=I.NSpin,d=I.NTimelineItem,u=I.NTimeline;return t.openBlock(),t.createElementBlock("div",null,[l[1]||(l[1]=t.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),i.value?(t.openBlock(),t.createElementBlock("div",g4,[t.createVNode(c,{size:"small",class:"mb-1 align-middle"}),l[0]||(l[0]=t.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(t.openBlock(),t.createElementBlock("div",y4," История статусов отсутствует. ")):(t.openBlock(),t.createBlock(u,{key:2},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(f,h)=>(t.openBlock(),t.createBlock(d,{key:h,color:t.unref(ki)(f.status.slug).color,time:o(f.createdAt),content:f.user.name},{header:t.withCtx(()=>[t.createVNode(pm,{status:f.status,"status-detail":f.statusDetail,variant:h===0?"filled":"text","show-dot":!1,size:"small"},null,8,["status","status-detail","variant"])]),_:2},1032,["color","time","content"]))),128))]),_:1}))])}}}),_4={class:"text-base"},w4={},Cl=t.defineComponent({...w4,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass({"flex flex-col":n.showUserType&&n.extraInfoOnSecondLine})},[t.createElementVNode("span",_4,t.toDisplayString(n.user.name),1),n.showUserType?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([{"ml-1":!n.extraInfoOnSecondLine},"text-sc-grey"])}," ["+t.toDisplayString(n.user.type)+"] ",3)):t.createCommentVNode("",!0)],2))}}),x4={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},k4={class:"col-span-2"},C4={class:"col-span-2"},v4={},bm=t.defineComponent({...v4,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(n,{emit:e}){const i=e;return(r,o)=>(t.openBlock(),t.createElementBlock("div",null,[o[11]||(o[11]=t.createElementVNode("h3",null,"Детали заказа",-1)),t.createElementVNode("div",x4,[n.order.creator.id!==n.order.client.id?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[1]||(o[1]=t.createElementVNode("span",null,"Создал",-1)),t.createVNode(Cl,{user:n.order.creator,class:"col-span-2"},null,8,["user"])],64)):t.createCommentVNode("",!0),o[10]||(o[10]=t.createElementVNode("span",null,"Клиент",-1)),t.createVNode(Dr,{client:n.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=s=>i("click:client-name",n.order.client,s))},null,8,["client"]),n.order.contragent?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[2]||(o[2]=t.createElementVNode("span",null,"Контрагент",-1)),t.createVNode(nf,{contragent:n.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):t.createCommentVNode("",!0),n.order.image?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[o[3]||(o[3]=t.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=t.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):t.createCommentVNode("",!0),n.order.barcode?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[o[5]||(o[5]=t.createElementVNode("span",null,"Штрих-код",-1)),t.createElementVNode("span",k4,t.toDisplayString(n.order.barcode),1)],64)):t.createCommentVNode("",!0),n.order.payment?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[o[6]||(o[6]=t.createElementVNode("span",null,"Оплата",-1)),t.createVNode(xl,{payment:n.order.payment,class:"col-span-2"},null,8,["payment"])],64)):t.createCommentVNode("",!0),n.order.delivery?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[o[7]||(o[7]=t.createElementVNode("span",null,"Доставка",-1)),t.createVNode(xs,{delivery:n.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):t.createCommentVNode("",!0),n.order.comment?(t.openBlock(),t.createElementBlock(t.Fragment,{key:6},[o[8]||(o[8]=t.createElementVNode("span",null,"Комментарий",-1)),t.createElementVNode("span",C4,t.toDisplayString(n.order.comment),1)],64)):t.createCommentVNode("",!0),n.order.attachedUser?(t.openBlock(),t.createElementBlock(t.Fragment,{key:7},[o[9]||(o[9]=t.createElementVNode("span",null,"Закреплен за",-1)),t.createVNode(Cl,{user:n.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):t.createCommentVNode("",!0)])]))}}),S4={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function B4(n,e){return t.openBlock(),t.createElementBlock("svg",S4,[...e[0]||(e[0]=[t.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),t.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 N4=t.markRaw({name:"ion-copy-outline",render:B4}),T4={class:"flex flex-col items-stretch gap-1.5 text-base"},$4={},E4=t.defineComponent({...$4,__name:"order-external-links",props:{showErpLink:{type:Boolean,default:!1},order:{}},setup(n){const e=t.computed(()=>{var r,o;const i=(((r=n.order.invoices)==null?void 0:r.length)??0)>0;return n.showErpLink&&!!n.order.erpOrderUrl||i||!!((o=n.order.payment)!=null&&o.onlinePaymentLink)});return(i,r)=>{var a;const o=I.NButton,s=N4;return e.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r[2]||(r[2]=t.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Внешние ссылки",-1)),t.createElementVNode("div",T4,[n.showErpLink&&n.order.erpOrderUrl?(t.openBlock(),t.createBlock(o,{key:0,tag:"a",href:n.order.erpOrderUrl,target:"_blank",block:"",class:"sc-external-link-button"},{default:t.withCtx(()=>[...r[0]||(r[0]=[t.createTextVNode(" Открыть в ERP ",-1)])]),_:1},8,["href"])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.order.invoices??[],(l,c)=>(t.openBlock(),t.createBlock(o,{key:c,tag:"a",href:l,block:"",class:"sc-external-link-button"},{default:t.withCtx(()=>[t.createTextVNode(" Скачать счет №"+t.toDisplayString(c+1),1)]),_:2},1032,["href"]))),128)),(a=n.order.payment)!=null&&a.onlinePaymentLink?t.withDirectives((t.openBlock(),t.createBlock(o,{key:1,block:"",class:"sc-external-link-button",title:"Ссылка на оплату копируется в буфер обмена"},{default:t.withCtx(()=>[t.createVNode(s,{class:"mr-1.5"}),r[1]||(r[1]=t.createTextVNode(" Скопировать ссылку на оплату ",-1))]),_:1})),[[t.unref(ql),n.order.payment.onlinePaymentLink]]):t.createCommentVNode("",!0)])],64)):t.createCommentVNode("",!0)}}}),_m=gn(E4,[["__scopeId","data-v-6a3ae627"]]),R4={key:0},P4={class:"text-sc-dark-grey my-2 text-center"},F4={key:1,class:"text-sc-dark-grey my-2 text-center"},V4={key:2},M4={class:"text-sc-dark-grey mt-4 text-right font-bold"},I4={class:"text-sc-primary"},A4={class:"mb-4 max-w-xs empty:hidden"},O4={},wm=t.defineComponent({...O4,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(n,{emit:e}){const i=n,r=e,o=t.ref(!1),s=t.ref();t.provide(W.currentOrderInjectionKey,t.computed(()=>s.value??null));const a=(d=!0)=>{if("products"in i.order){s.value=new W.Order(i.order);return}d&&(o.value=!0),W.HttpRequester.getInstance(W.OrdersDataProvider).getOrder(i.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=t.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=t.computed(()=>Ve.formatMoney(V.sumBy(l.value,"costRub")));return t.watch(()=>i.order,()=>{a(!1)}),t.onMounted(()=>{a()}),(d,u)=>{const f=I.NSpin;return o.value?(t.openBlock(),t.createElementBlock("div",R4,[t.createElementVNode("div",P4,[t.createVNode(f,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=t.createElementVNode("div",null,[t.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(t.openBlock(),t.createElementBlock("div",F4," --- Не удалось загрузить данные о заказе --- ")):(t.openBlock(),t.createElementBlock("div",V4,[t.createVNode(gm,{products:l.value,"event-emitter":n.eventEmitter,"allow-edit":n.allowEdit},null,8,["products","event-emitter","allow-edit"]),t.createElementVNode("div",M4,[u[2]||(u[2]=t.createTextVNode(" ИТОГО: ",-1)),t.createElementVNode("span",I4,t.toDisplayString(c.value)+" ₽",1)]),t.createVNode(bm,{order:s.value,"onClick:clientName":u[0]||(u[0]=h=>r("click:client-name",s.value.client,h))},null,8,["order"]),t.createElementVNode("div",A4,[t.createVNode(_m,{order:s.value,"show-erp-link":""},null,8,["order"])]),t.createVNode(ym,{order:s.value},null,8,["order"])]))}}}),z4={},D4=t.defineComponent({...z4,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(n){const e=n,i=t.inject(Rr,"small"),r=t.computed(()=>V.isNil(e.orderContextButtonsConfig)?[]:V.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=I.NButton,d=I.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(t.openBlock(),t.createBlock(d,{key:0,options:r.value,size:t.unref(i),trigger:"click",onSelect:o},{default:t.withCtx(()=>[t.createVNode(c,{ghost:!0,size:t.unref(i),type:"primary"},{default:t.withCtx(()=>[t.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):t.createCommentVNode("",!0)}}}),L4={},H4=t.defineComponent({...L4,__name:"orders-list",props:t.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},highlightSettings:{default:void 0},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:t.mergeModels(["click:client-name","dblclick:row","update:pagination","update:sort"],["update:checkedRowKeys"]),setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.useModel(n,"checkedRowKeys"),a=(T,D)=>{D?s.value.includes(T)||(s.value=[...s.value,T]):s.value=s.value.filter(K=>K!==T)},l=()=>V.cloneDeep(r.sort??[{field:"id",direction:"desc"}]),c=t.ref(l()),d=t.ref([]),u=t.ref(!1),f=t.ref(700),h=()=>{const T=Ue.getDeviceTypeByResolution(),D=T===Xe.phone||T===Xe.tablet;if(!(!r.stickyHeaderOnMobile&&D))return f.value*(W.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},p=t.ref(h()),m=t.computed(()=>r.highlightSettings?r.highlightSettings:{statuses:[],markers:r.useCellIndication?[...co]:[]}),g=T=>{const D={onDblclick:()=>o("dblclick:row",T)},K=[];r.selectable&&s.value.length>0&&!s.value.includes(T.id)&&K.push("opacity-60");const J=m.value,U=new Set(Fs(T).filter(ue=>J.markers.includes(ue))),q={},le=[ct.NotInStock,ct.OnOrder,ct.LargeOrder].find(ue=>U.has(ue));if(le){const ue=Er(le);K.push("order-id-marked",le),q["--sc-order-id-bg"]=ue.backgroundColor,q["--sc-order-id-text"]=ue.textOnBackgroundColor}if(U.has(ct.NextDayDelivery)){const ue=Er(ct.NextDayDelivery);K.push("delivery-date-marked"),q["--sc-delivery-date-bg"]=ue.backgroundColor,q["--sc-delivery-date-text"]=ue.textOnBackgroundColor}return T.status.slug&&J.statuses.includes(T.status.slug)&&(K.push("order-status-highlighted",T.status.slug),V.assign(q,Gl(T.status.slug))),V.isEmpty(q)||(D.style=q),K.length>0&&(D.class=K.join(" ")),D},b=()=>{const T=[Ie.CreatedAt,Ie.Id,Ie.ClientInfo,Ie.ClientCity,Ie.DeliveryDate,Ie.PaymentType,Ie.SalesDirections,Ie.Status,...r.showAttachedUserColumn?[Ie.AttachedUser]:[],Ie.actions],D=r.fields.length>0?r.fields:T,K={title:"???",key:"undefined",render:()=>t.h("span",{},["--- unknown ---"])},J={type:"expand",expandable:V.constant(!0),renderExpand:L=>t.h(wm,{order:L,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{o("click:client-name",L.client,null)}}),width:"30"};let U=[{title:"Дата заказа",key:Ie.CreatedAt,resizable:!0,width:100,render:L=>t.h(es,{date:L.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Ie.Id,resizable:!0,width:75,className:"order-id",render:L=>t.h("a",{href:r.orderUrl.replace(":id",L.id.toString()),class:"text-base"},L.id)},{title:"Дата доставки / самовывоза",key:Ie.DeliveryDate,resizable:!0,width:120,className:"delivery-date",render:L=>t.h(es,{date:L.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Ie.ClientInfo,resizable:!0,minWidth:320,render:L=>t.h(Dr,{client:L.client,"onClick:client-name":()=>{o("click:client-name",L.client,null)}})},{title:"Тип доставки",key:Ie.DeliveryInfo,resizable:!0,minWidth:320,render:L=>t.h(xs,{delivery:L.delivery})},{title:"Клиент",key:Ie.ClientInfoShort,resizable:!0,minWidth:320,render:L=>t.h(Dr,{client:L.client,showCityAndRegion:!1,"onClick:client-name":()=>{o("click:client-name",L.client,null)}})},{title:"Город клиента",key:Ie.ClientCity,resizable:!0,minWidth:90,width:120,render:L=>{var le;return t.h("span",{class:"text-base"},((le=L.client)==null?void 0:le.city.name)??"—")}},{title:"Статус",key:Ie.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:L=>t.h("span",{class:"text-base"},[L.status.name])},{title:"Тип оплаты",key:Ie.PaymentType,resizable:!0,width:115,minWidth:95,render:L=>L.payment?t.h(xl,{payment:L.payment}):t.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Ie.SalesDirections,resizable:!0,width:80,render:L=>{var le;return t.h("span",{class:"text-base"},[((le=L.salesDirection)==null?void 0:le.name)??""])}},...r.showAttachedUserColumn?[{title:"Закреплено за",key:Ie.AttachedUser,resizable:!0,minWidth:120,render:L=>{var le;return t.h("span",{class:"text-base"},[((le=L==null?void 0:L.attachedUser)==null?void 0:le.name)??""])}}]:[]];r.orderContextButtonsConfig&&U.push({key:"actions",title:"",className:"align-top",width:50,render:L=>t.h(D4,{order:L,orderContextButtonsConfig:r.orderContextButtonsConfig,onOrderContextSelect:r.onOrderContextSelect})}),r.enableSorting&&(U=U.map(L=>[Ie.Id,Ie.CreatedAt,Ie.DeliveryDate].includes(L.key)?{...L,sorter:!0,sortOrder:!1,...L.width===void 0?{}:{width:L.width+16}}:L));const q=r.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:L=>{var ue;const le=((ue=r.isRowSelectable)==null?void 0:ue.call(r,L))??!0;return{class:le?"cursor-pointer":void 0,onClick:()=>{le&&a(L.id,!s.value.includes(L.id))}}},render:L=>{var le;return((le=r.isRowSelectable)==null?void 0:le.call(r,L))??!0?t.h(I.NCheckbox,{checked:s.value.includes(L.id)}):null}}]:[];switch(Ue.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[...q,J,{key:"order",title:"Заказ",resizable:!0,render:L=>t.h(fm,{order:L,fields:D,orderUrl:r.orderUrl,highlightSettings:m.value})}];case Xe.laptop:{const L=r.showAttachedUserColumn?D:D.filter(le=>le!==Ie.AttachedUser);return[...q,J,...L.map(le=>U.find(ue=>ue.key===le)??K)]}default:return[K]}},y=t.ref(b()),_=t.ref(new W.TableDataPagination(r.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),x=t.computed(()=>({..._.value,prefix({itemCount:T}){return`Всего заказов: ${T}`}})),w=t.ref(null),C=t.ref(null),N=t.ref(null),k=t.ref(null),$=t.ref(null),v=()=>{$.value!==null&&(clearInterval($.value),$.value=null)},E=()=>{v(),r.refreshInterval&&($.value=setInterval(()=>{R()},r.refreshInterval))},P=T=>{_.value.itemCount!==T.meta.total&&(_.value.itemCount=T.meta.total),_.value.page!==T.meta.currentPage&&(_.value.page=T.meta.currentPage),_.value.pageCount!==T.meta.lastPage&&(_.value.pageCount=T.meta.lastPage),_.value.pageSize!==T.meta.perPage&&(_.value.pageSize=T.meta.perPage),d.value=T.data},F=()=>{var T,D,K;r.filters&&((T=C.value)==null||T.abort(),C.value=null,(D=N.value)==null||D.abort(),N.value=null,k.value=null,(K=w.value)==null||K.abort(),w.value=new AbortController,u.value=!0,W.HttpRequester.getInstance(W.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},w.value.signal).then(J=>{P(J),u.value=!1}).catch(J=>{if((J==null?void 0:J.name)!=="CanceledError")throw u.value=!1,J}))},R=()=>{var T;!r.filters||u.value||((T=C.value)==null||T.abort(),C.value=new AbortController,W.HttpRequester.getInstance(W.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},C.value.signal).then(D=>{d.value=d.value.map(K=>D.data.find(U=>U.id===K.id)??K),_.value.itemCount!==D.meta.total&&(_.value.itemCount=D.meta.total),_.value.pageCount!==D.meta.lastPage&&(_.value.pageCount=D.meta.lastPage)}).catch(D=>{if((D==null?void 0:D.name)!=="CanceledError")throw D}))},M=T=>T.meta.total===_.value.itemCount&&V.isEqual(V.map(T.data,"id"),V.map(d.value,"id")),X=async()=>{var D,K;if(!r.filters||u.value)return!1;(D=C.value)==null||D.abort(),C.value=null,(K=N.value)==null||K.abort(),N.value=new AbortController;let T;try{T=await W.HttpRequester.getInstance(W.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},N.value.signal)}catch(J){if((J==null?void 0:J.name)==="CanceledError")return!1;throw J}return M(T)?(d.value=d.value.map(J=>T.data.find(U=>U.id===J.id)??J),k.value=null,!1):(k.value=T,!0)},G=()=>k.value?(P(k.value),k.value=null,!0):!1,Z=()=>{k.value=null},O=T=>{_.value.page=T,F(),o("update:pagination",_.value)},A=T=>{_.value.pageSize=T,_.value.page=1,F(),o("update:pagination",_.value)},Y=T=>{if(V.isNull(T))c.value=l();else{const[D]=c.value;D.field=T.columnKey.toString(),D.direction=T.order==="ascend"?"asc":"desc",c.value=[D]}y.value.forEach(D=>{if(Object.hasOwn(D,"sortOrder")){const K=D;K.sortOrder=K.key===(T==null?void 0:T.columnKey)&&(T!=null&&T.sorter)&&T.order!==!1?T.order:!1}}),F(),o("update:sort",c.value)},H=()=>{y.value=b(),f.value=window.innerHeight,p.value=h()};return t.watch(()=>r.filters,()=>{_.value.page=1,F(),E()}),t.watch(()=>r.sort,()=>{c.value=l(),_.value.page=1,F(),E()}),t.onMounted(()=>{H(),window.addEventListener("resize",H),t.nextTick(()=>{F(),E()})}),t.onUnmounted(()=>{var T,D,K;window.removeEventListener("resize",H),(T=w.value)==null||T.abort(),(D=C.value)==null||D.abort(),(K=N.value)==null||K.abort(),v()}),e({reload:F,checkForUpdates:X,applyPendingUpdate:G,discardPendingUpdate:Z}),(T,D)=>{const K=I.NDataTable;return t.openBlock(),t.createBlock(K,{columns:y.value,data:d.value,"row-key":J=>J.id,"row-props":g,"scroll-x":n.tableMinWidth,pagination:x.value,loading:u.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":p.value,"pagination-behavior-on-filter":"first","onUpdate:page":O,"onUpdate:pageSize":A,"onUpdate:sorter":Y},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),W4=gn(H4,[["__scopeId","data-v-aff76adb"]]),j4=t.computed(()=>W.useReferencesStore().deliveryTypeReference??[]),q4=t.computed(()=>W.useReferencesStore().managersList??[]),X4=t.computed(()=>W.useReferencesStore().opfReference??[]),Y4=t.computed(()=>W.useReferencesStore().partnerGroupsReference??[]),U4=t.computed(()=>W.useReferencesStore().priceCoefficientsReference??[]),K4=t.computed(()=>W.useReferencesStore().productFilesTypesReference??[]),G4=t.computed(()=>W.useReferencesStore().resourceTypesReference),Z4=t.computed(()=>W.useReferencesStore().salesDirectionsReference??[]),Q4=t.computed(()=>W.useReferencesStore().warehousesReference??[]),J4=t.computed(()=>W.useReferencesStore().paymentTypeReference??[]),xm=t.computed(()=>W.useReferencesStore().orderStatusReference??[]),eN=t.computed(()=>W.useReferencesStore().orderStatusDetailReference??[]),tN=t.computed(()=>W.useReferencesStore().operatorReference??[]),nN=t.computed(()=>wt.convertReferencesToSelectOptionsList(W.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),iN=t.computed(()=>wt.convertReferencesToSelectOptionsList(W.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),rN=n=>W.HttpRequester.getInstance(W.ReferenceDataProvider).searchCity(n),oN=n=>wt.convertReferencesToSelectOptionsList(n,!0,!1,!1,e=>{var i,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(i=e==null?void 0:e.region)==null?void 0:i.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()),sN=async n=>V.map(await W.HttpRequester.getInstance(W.ReferenceDataProvider).searchRegion(n),e=>new W.Region(e)),aN=n=>wt.convertReferencesToSelectOptionsList(n,!0,!1,!1,e=>e.isNewRec()?"-":V.join(V.compact([e.name,e.country.name]),", "),e=>e.isNewRec()),lN=n=>W.HttpRequester.getInstance(W.ClientDataProvider).searchClient(n),cN=n=>wt.convertReferencesToSelectOptionsList(n,!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()),dN={class:"flex flex-col gap-4"},uN={class:"flex flex-wrap gap-2"},fN={class:"flex flex-col gap-1.5"},hN={class:"inline-flex items-center gap-2"},mN={class:"flex flex-col gap-1.5"},pN={class:"inline-flex items-center gap-2"},gN={},yN=t.defineComponent({...gN,__name:"order-highlight-settings",props:{settings:{},statuses:{default:void 0}},emits:["update:settings"],setup(n,{emit:e}){const i=n,r=e,o=t.computed(()=>i.statuses??xm.value),s=d=>!!d&&i.settings.statuses.includes(d),a=(d,u)=>{if(!d)return;const f=i.settings.statuses.filter(h=>h!==d);r("update:settings",{...i.settings,statuses:u?[...f,d]:f})},l=(d,u)=>{const f=i.settings.markers.filter(h=>h!==d);r("update:settings",{...i.settings,markers:u?[...f,d]:f})},c=d=>{r("update:settings",{statuses:d?o.value.flatMap(u=>u.slug?[u.slug]:[]):[],markers:d?[...co]:[]})};return(d,u)=>{const f=I.NButton,h=I.NCheckbox;return t.openBlock(),t.createElementBlock("div",dN,[t.createElementVNode("div",uN,[t.createVNode(f,{size:"small",onClick:u[0]||(u[0]=p=>c(!0))},{default:t.withCtx(()=>[...u[2]||(u[2]=[t.createTextVNode(" Выделять всё ",-1)])]),_:1}),t.createVNode(f,{size:"small",onClick:u[1]||(u[1]=p=>c(!1))},{default:t.withCtx(()=>[...u[3]||(u[3]=[t.createTextVNode(" Снять всё ",-1)])]),_:1})]),t.createElementVNode("div",fN,[u[4]||(u[4]=t.createElementVNode("div",{class:"text-sm font-semibold"},"Статусы",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,p=>(t.openBlock(),t.createBlock(h,{key:p.id,checked:s(p.slug),"onUpdate:checked":m=>a(p.slug,m)},{default:t.withCtx(()=>[t.createElementVNode("span",hN,[t.createVNode(kl,{colors:t.unref(ki)(p.slug)},null,8,["colors"]),t.createTextVNode(" "+t.toDisplayString(p.name),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))]),t.createElementVNode("div",mN,[u[5]||(u[5]=t.createElementVNode("div",{class:"text-sm font-semibold"},"Маркеры",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(co),p=>(t.openBlock(),t.createBlock(h,{key:p,checked:n.settings.markers.includes(p),"onUpdate:checked":m=>l(p,m)},{default:t.withCtx(()=>[t.createElementVNode("span",pN,[t.createVNode(kl,{colors:t.unref(Er)(p)},null,8,["colors"]),t.createTextVNode(" "+t.toDisplayString(t.unref(Ps)(p)),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))])])}}}),bN=["href"],_N={class:"text-sc-dark-grey"},wN={},xN=t.defineComponent({...wN,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(n,{emit:e}){const i=n,r=e,o=t.computed(()=>Ce.format(i.order.createdAt,W.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{V.isNil(i.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",i.order,a)};return(a,l)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("span",null,[l[1]||(l[1]=t.createTextVNode(" #",-1)),t.createElementVNode("a",{href:n.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},t.toDisplayString(n.order.id),9,bN),t.createTextVNode(" от "+t.toDisplayString(o.value),1)]),l[2]||(l[2]=t.createTextVNode(", ",-1)),t.createElementVNode("span",_N,"автор: "+t.toDisplayString(n.order.creator.name)+" ["+t.toDisplayString(n.order.creator.type)+"]",1)],64))}}),kN={class:"sc-page flex flex-col bg-inherit"},CN={class:"my-2 flex flex-row items-end"},vN={class:"sc-title grow"},SN={key:0,class:"sc-title-buttons flex-1 grow-0"},BN={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},NN={key:0,class:"sc-title-extra mt-2 sm:mt-4"},TN={},km=t.defineComponent({...TN,__name:"page",props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(n){const e=n,i=t.computed(()=>e.stickyHeaderOnMobile?"sticky z-10 bg-inherit":"lg:sticky z-10 bg-inherit");return(r,o)=>{const s=I.NH1;return t.openBlock(),t.createElementBlock("div",kN,[t.createElementVNode("div",{class:t.normalizeClass(n.stickyHeader?i.value:void 0),style:t.normalizeStyle(n.stickyHeader?{top:`${n.stickyTopOffset??0}px`}:void 0)},[t.createElementVNode("div",CN,[t.createElementVNode("div",vN,[t.renderSlot(r.$slots,"title",{},()=>[t.createVNode(s,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.title??""),1)]),_:1})])]),r.$slots["title-buttons"]?(t.openBlock(),t.createElementBlock("div",SN,[t.createElementVNode("div",BN,[t.renderSlot(r.$slots,"title-buttons")])])):t.createCommentVNode("",!0)]),r.$slots["title-extra"]?(t.openBlock(),t.createElementBlock("div",NN,[t.renderSlot(r.$slots,"title-extra")])):t.createCommentVNode("",!0),t.renderSlot(r.$slots,"sticky-extra")],6),t.renderSlot(r.$slots,"default")])}}}),$N={class:"overflow-hidden transition-all duration-300"},EN={class:"text-lg font-medium leading-none"},RN={},Cm=t.defineComponent({...RN,__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(n,{emit:e}){const i=n,r=e,o=t.ref(0),s=t.ref(i.showDrawer),a=()=>{switch(Ue.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.8;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?V.isUndefined(i.drawerWidth)?o.value=a():o.value=V.isFunction(i.drawerWidth)?i.drawerWidth():i.drawerWidth:o.value=0};return t.watch(()=>i.drawerWidth,()=>{l()}),t.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),t.watch(()=>i.showDrawer,c=>{s.value=c}),t.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=I.NDrawerContent,f=I.NDrawer;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",$N,[t.createElementVNode("div",{style:t.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[t.renderSlot(c.$slots,"default")],4)]),t.createVNode(f,{show:s.value,"onUpdate:show":d[0]||(d[0]=h=>s.value=h),resizable:!0,width:o.value,placement:"left"},{default:t.withCtx(()=>[t.createVNode(u,{closable:""},{header:t.withCtx(()=>[t.renderSlot(c.$slots,"drawer-header",{},()=>[t.createElementVNode("div",EN,t.toDisplayString(n.title),1)])]),default:t.withCtx(()=>[t.renderSlot(c.$slots,"drawer-content")]),footer:t.withCtx(()=>[t.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),PN={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},FN={key:0},VN={class:"sc-page-preview-panel grow"},MN={key:1,class:"sc-page-preview-panel-extra flex-none"},IN={},AN=t.defineComponent({...IN,__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(n,{expose:e}){const i=t.ref(!1),r=()=>{i.value=!0},o=()=>{i.value=!1},s=t.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&t.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=I.NButton;return t.openBlock(),t.createBlock(km,{title:n.title,"sticky-header":n.stickyHeader,"sticky-top-offset":n.stickyTopOffset,"sticky-header-on-mobile":n.stickyHeaderOnMobile},t.createSlots({default:t.withCtx(()=>[t.createVNode(Cm,{"show-drawer":i.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>i.value=u),title:n.panelTitle},t.createSlots({"drawer-content":t.withCtx(()=>[t.renderSlot(l.$slots,"panel-content")]),default:t.withCtx(()=>[t.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||n.isShowPanelButtonVisible?{name:"sticky-extra",fn:t.withCtx(()=>[t.createElementVNode("div",PN,[n.isShowPanelButtonVisible?(t.openBlock(),t.createElementBlock("div",FN,[t.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{i.value=!0}},()=>[t.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>i.value=!0)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.showPanelButtonText),1)]),_:1})])])):t.createCommentVNode("",!0),t.createElementVNode("div",VN,[t.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(t.openBlock(),t.createElementBlock("div",MN,[t.renderSlot(l.$slots,"preview-panel-extra")])):t.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),ON={},zN=t.defineComponent({...ON,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=t.computed(()=>{var m;return V.isArray(r.value)?r.value.map(g=>g.id):((m=r.value)==null?void 0:m.id)??null}),l=t.computed(()=>{const m=new W.Curator({id:-1,name:"",contacts:{},curatedDirection:new W.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),g=r.showEmptyValue?[m]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{g.push(new W.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),g}),c=t.computed(()=>wt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,m=>{const g=V.some(s.value?r.value:[r.value],["id",m.id])?` (${m.curatedDirection.name}) `:"";return m.curatedDirection.isNewRec()?m.name:`${m.name}${g}`})),d=t.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=t.useTemplateRef("select-component"),f=m=>{if(V.isArray(m)){const g=m.length>0?m.map(b=>l.value.find(y=>y.id===b)).filter(b=>!V.isNil(b)):[];o("update:value",g)}else{const g=m>0?l.value.find(b=>b.id===m):null;o("update:value",g??null)}};return t.watch(()=>r.value,()=>{var m,g;(g=(m=u.value)==null?void 0:m.$forceUpdate)==null||g.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,g)=>(t.openBlock(),t.createBlock(t.unref(I.NSelect),{ref:"select-component",value:a.value,clearable:n.clearable,disabled:c.value.length===0,"consistent-menu-width":n.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),DN={},LN=t.defineComponent({...DN,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=t.computed(()=>{var y;return V.isArray(r.value)?r.value.filter(_=>!V.isNil(_)).map(_=>_.id):((y=r.value)==null?void 0:y.id)??null}),l=t.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=t.computed(()=>{var w;const y=[];r.operatorReferenceList.length>0&&y.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=V.isArray(r.value)?r.value.map(N=>N.id):[(w=r.value)==null?void 0:w.id];_=_.filter(N=>N.isActive||C.includes(N.id))}const x=wt.convertReferencesToSelectOptionsList(_,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,C=>`${C.name}${C.isActive?"":" [Не активен]"}`);return y.length>0&&x.length>0&&y.push({key:"manager-operator-divider",disabled:!0,render:()=>t.h("div",{class:"sc-manager-operator-select__divider"})}),y.push(...x),y}),d=y=>`${y.name}${"isActive"in y&&!y.isActive?" [Не активен]":""}`,u=t.computed(()=>{var N;const y=V.isArray(r.value)?r.value.map(k=>k.id):[(N=r.value)==null?void 0:N.id],_=k=>r.showActualOnly?k.filter($=>!("isActive"in $)||$.isActive||y.includes($.id)):k,x=[],w=_(r.managerReferenceList);w.length>0&&x.push({type:"group",label:"Менеджеры",key:"managers",children:wt.convertReferencesToSelectOptionsList(w,!0,!1,!1,d)});const C=_(r.operatorReferenceList);return C.length>0&&x.push({type:"group",label:"Операторы",key:"operators",children:wt.convertReferencesToSelectOptionsList(C,!0,!1,!1,d)}),x}),f=t.computed(()=>r.groupByEmployeeType?u.value:c.value),h=t.computed(()=>f.value.map(y=>({...y,class:r.wrapContent?`${y.class??""} consistent-menu-width`:y.class}))),p=t.useTemplateRef("select-component"),m=y=>{if(V.isArray(y)){const _=y.map(x=>l.value.find(w=>w.id===x)).filter(x=>!V.isNil(x));o("update:value",_)}else{const _=V.isNil(y)?null:l.value.find(x=>x.id===y)??null;o("update:value",_)}};return t.watch(()=>r.value,()=>{var y,_;(_=(y=p.value)==null?void 0:y.$forceUpdate)==null||_.call(y)},{deep:!0}),e({focus:()=>{var y;return(y=p.value)==null?void 0:y.focusInput()},blur:()=>{var y;return(y=p.value)==null?void 0:y.blurInput()}}),(y,_)=>(t.openBlock(),t.createBlock(t.unref(I.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:n.clearable,"consistent-menu-width":n.consistentMenuWidth,disabled:n.disabled||f.value.length===0,filterable:n.filterable,"max-tag-count":n.maxTagCount,multiple:s.value,options:h.value,placeholder:"",class:"w-full","onUpdate:value":m},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),HN={},WN=t.defineComponent({...HN,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=t.computed(()=>{var m;return V.isArray(r.value)?r.value.map(g=>g.id):((m=r.value)==null?void 0:m.id)??null}),l=t.computed(()=>r.showEmptyValue?[W.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=t.computed(()=>{var b;let m=l.value,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=V.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];g=V.union(g,l.value.filter(_=>!_.isActive).map(_=>_.id)),m=m.filter(_=>(r.showEmptyValue?W.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return wt.convertReferencesToSelectOptionsList(m,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&V.some(s.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>g.includes(y.id)&&y.isActive)}),d=t.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=t.useTemplateRef("select-component"),f=m=>{if(V.isArray(m)){const g=m.length>0?m.filter(b=>!V.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!V.isNil(b)):[];o("update:value",g)}else{const g=m>0&&!V.some(r.disabledManagerReferenceList,["id",m])?l.value.find(b=>b.id===m):new W.Manager;o("update:value",g??new W.Manager)}};return t.watch(()=>r.value,()=>{var m,g;(g=(m=u.value)==null?void 0:m.$forceUpdate)==null||g.call(m)},{deep:!0}),t.watch(()=>r.disabledManagerReferenceList,m=>{if(m.length>0&&r.value)if(s.value){const g=r.value;V.some(g,b=>V.some(m,["id",b.id]))&&o("update:value",g.filter(b=>!V.some(m,["id",b.id])))}else{const g=r.value;V.some(m,["id",g.id])&&o("update:value",new W.Manager)}}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,g)=>(t.openBlock(),t.createBlock(t.unref(I.NSelect),{ref:"select-component",value:a.value,clearable:n.clearable,disabled:c.value.length===0,"consistent-menu-width":n.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),jN={class:"m-0.5 flex flex-col p-0.5"},qN={class:"flex flex-row gap-1"},XN={key:0},YN={key:1},UN={key:2},KN={key:3},GN={class:"flex flex-row gap-1"},ZN={key:0},QN={key:1},JN={key:2},eT={key:3},tT={},vm=t.defineComponent({...tT,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",jN,[t.createElementVNode("span",qN,[n.addr.postIndex?(t.openBlock(),t.createElementBlock("span",XN,t.toDisplayString(n.addr.postIndex)+", ",1)):t.createCommentVNode("",!0),n.addr.city?(t.openBlock(),t.createElementBlock("span",YN,t.toDisplayString(n.addr.city)+", ",1)):t.createCommentVNode("",!0),n.addr.locality?(t.openBlock(),t.createElementBlock("span",UN,t.toDisplayString(n.addr.locality)+", ",1)):t.createCommentVNode("",!0),n.addr.region?(t.openBlock(),t.createElementBlock("span",KN,t.toDisplayString(n.addr.region)+", ",1)):t.createCommentVNode("",!0)]),t.createElementVNode("span",GN,[n.addr.street?(t.openBlock(),t.createElementBlock("span",ZN,t.toDisplayString(n.addr.street)+", ",1)):t.createCommentVNode("",!0),n.addr.building?(t.openBlock(),t.createElementBlock("span",QN,t.toDisplayString(n.addr.building)+", ",1)):t.createCommentVNode("",!0),n.addr.buildingPart?(t.openBlock(),t.createElementBlock("span",JN,t.toDisplayString(n.addr.buildingPart)+", ",1)):t.createCommentVNode("",!0),n.addr.apartments?(t.openBlock(),t.createElementBlock("span",eT,t.toDisplayString(n.addr.apartments)+", ",1)):t.createCommentVNode("",!0)])]))}}),vl={clearable:!1,value:"",field:void 0,disabled:!1},nT={},iT=t.defineComponent({...nT,__name:"address-suggestion",props:t.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},searchDataHandler:{type:Function}},{...vl,minTermLength:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0,wrapContent:!0}),emits:["select","update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.ref(r.value),a=t.ref(!1),l=t.ref([]),c=t.computed(()=>l.value.map(g=>({label:g[r.field??"addressString"]??"-",value:g.id})));t.watch(()=>r.value,g=>{s.value=g}),t.watch(s,()=>{o("update:value",s.value)});const d=V.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):W.HttpRequester.getInstance(W.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},f=(g,b)=>{const y=l.value.find(_=>_.id===g.value)||{};return t.h(vm,{addr:y,selected:b},{default:V.constant("-")})},h=g=>{d.cancel();const b=l.value.find(y=>y.id===g)||{};o("select",b)},p=t.ref(null);function m(){p.value.focus()}return e({focus:m}),(g,b)=>{const y=I.NAutoComplete;return t.openBlock(),t.createBlock(y,{ref_key:"autoCompleteElement",ref:p,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),t.unref(d)],class:t.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:n.clearable,disabled:n.disabled,loading:a.value,options:c.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:h},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),rT={class:"m-0.5 flex flex-col p-0.5"},oT={class:"font-medium"},sT={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},aT={key:0},lT={key:1},cT={},Sm=t.defineComponent({...cT,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",rT,[t.createElementVNode("span",oT,t.toDisplayString(n.bank.name),1),t.createElementVNode("span",sT,[n.bank.bic?(t.openBlock(),t.createElementBlock("span",aT," БИК: "+t.toDisplayString(n.bank.bic),1)):t.createCommentVNode("",!0),n.bank.inn?(t.openBlock(),t.createElementBlock("span",lT," ИНН: "+t.toDisplayString(n.bank.inn),1)):t.createCommentVNode("",!0)])]))}}),dT={},uT=t.defineComponent({...dT,__name:"bank-suggestion",props:t.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean}},{...vl,minTermLength:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3},wrapContent:!0}),emits:["select","update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.ref(r.value),a=t.ref(!1),l=t.ref([]),c=t.computed(()=>l.value.map(g=>({label:g[r.field??"_"]??"-",value:g.id})));t.watch(()=>r.value,g=>{s.value=g}),t.watch(s,()=>{o("update:value",s.value)});const d=V.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await W.HttpRequester.getInstance(W.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},f=(g,b)=>{const y=l.value.find(_=>_.id===g.value)||{};return t.h(Sm,{bank:y,selected:b},{default:V.constant("-")})},h=g=>{d.cancel();const b=l.value.find(y=>y.id===g)||{};o("select",b)},p=t.ref(null);function m(){p.value.focus()}return e({focus:m}),(g,b)=>{const y=I.NAutoComplete;return t.openBlock(),t.createBlock(y,{ref_key:"autoCompleteElement",ref:p,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),t.unref(d)],class:t.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:n.clearable,disabled:n.disabled,loading:a.value,options:c.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:h},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),fT={class:"font-medium"},hT={key:0,class:"flex flex-row gap-2"},mT={key:0,class:"text-xs font-light text-blue-800"},pT={key:1,class:"text-sc-dark-grey text-xs font-light"},gT={},Bm=t.defineComponent({...gT,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(n){const e=n,i=t.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=t.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(`m-0.5 flex flex-col p-0.5 ${i.value?"line-through":""}`)},[t.createElementVNode("span",fT,t.toDisplayString(n.org.name),1),n.org.inn||r.value?(t.openBlock(),t.createElementBlock("div",hT,[n.org.inn?(t.openBlock(),t.createElementBlock("span",mT,t.toDisplayString(n.org.inn),1)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock("span",pT,t.toDisplayString(r.value),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2))}}),yT={},bT=t.defineComponent({...yT,__name:"org-suggestion",props:t.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},allowSelectTerminated:{type:Boolean}},{...vl,minTermLength:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3},wrapContent:!0}),emits:["select","update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.ref(r.value),a=t.ref(!1),l=t.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=t.computed(()=>wt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));t.watch(()=>r.value,b=>{s.value=b}),t.watch(s,()=>{o("update:value",s.value)});const u=V.debounce(()=>f(),800),f=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await W.HttpRequester.getInstance(W.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},h=(b,y)=>{const _=l.value.find(x=>x.id===b.value)||{};return t.h(Bm,{org:_,selected:y},{default:V.constant("-")})},p=b=>{u.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&o("select",y)},m=t.ref(null);function g(){m.value.focus()}return e({focus:g}),(b,y)=>{const _=I.NAutoComplete;return t.openBlock(),t.createBlock(_,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[y[0]||(y[0]=x=>s.value=x),t.unref(u)],class:t.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:n.clearable,disabled:n.disabled,loading:a.value,options:d.value,"render-label":h,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:p},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}});j.ALL_ORDER_MARKERS=co,j.CATEGORY_REQUIRED_HINT=$s,j.CommonValidators=Wm,j.ConfiguratorSettingsKozyrek=Vu,j.ConfiguratorSettingsMosquito=Px,j.ContentHelper=Ci,j.CurrencyHelper=ir,j.DEFAULT_ORDER_STATUS_COLORS=Es,j.DateValidators=jm,j.EntityNameHelper=li,j.FileHelper=Hm,j.KozyrekLine=Vn,j.KozyrekTailTemplate=Ma,j.KozyrekTemplate=yr,j.M2PriceHelper=vi,j.MODE_DISABLED_HINT=Nr,j.NumberHelper=Ve,j.NumericValidators=ce,j.ORDER_MARKER_COLORS=Rs,j.ORDER_MARKER_NAMES=Zl,j.ORDER_STATUS_COLORS=Ul,j.OrderMarkerEnum=ct,j.OrdersTableFields=Ie,j.PRODUCT_REQUIRED_HINT=Ts,j.Point=Va,j.ScAddProductToCartDialog=Sw,j.ScAddressSuggestion=iT,j.ScAddressSuggestionLabel=vm,j.ScBankSuggestion=uT,j.ScBankSuggestionLabel=Sm,j.ScBaseDialog=Os,j.ScButtonWithConfirmAction=Xm,j.ScCategoryCollapse=ef,j.ScChipGroup=Km,j.ScClientNameWithShortInfo=Dr,j.ScCollapse=Ju,j.ScCollapseItem=rc,j.ScCommentEditor=W2,j.ScCompactCardList=xC,j.ScConfiguratorsProductInfo=Fr,j.ScContragentWithShortInfo=nf,j.ScCreatorUserTypeTag=ks,j.ScCuratorSelect=zN,j.ScDateRange=y2,j.ScDateTimeLabel=es,j.ScDebouncedInput=tC,j.ScDebouncedInputNumber=iC,j.ScDebt=x2,j.ScDialogHeader=N2,j.ScDynamicConfigurator=Gu,j.ScEmail=Lw,j.ScExternalLink=yC,j.ScImageGallery=cc,j.ScInlineEditableItem=kf,j.ScInlineView=Oa,j.ScKozyrekConfigurator=Mu,j.ScKozyrekConfiguratorParamsForm=hc,j.ScKozyrekConfiguratorPreview=Fu,j.ScKozyrekConfiguratorTemplates=Pu,j.ScKpiGrid=dC,j.ScLightGallery=lc,j.ScManagerOperatorSelect=LN,j.ScManagerSelect=WN,j.ScMetalForDoorsConfigurator=ju,j.ScMetalForDoorsConfiguratorForm=Wu,j.ScMosquitoConfigurator=Ou,j.ScMosquitoConfiguratorForm=Iu,j.ScMosquitoConfiguratorMeasurementInstructions=Au,j.ScMosquitoConfiguratorPreview=Ia,j.ScOrderColorSwatch=kl,j.ScOrderCommonInfo=fm,j.ScOrderDeliveryLabel=xs,j.ScOrderDetails=bm,j.ScOrderExternalLinks=_m,j.ScOrderHighlightSettings=yN,j.ScOrderInfo=wm,j.ScOrderItemParams=wl,j.ScOrderItemsList=gm,j.ScOrderPayment=xl,j.ScOrderProductInfo=mm,j.ScOrderStatusHistory=ym,j.ScOrderStatusTag=pm,j.ScOrdersList=W4,j.ScOrgSuggestion=bT,j.ScOrgSuggestionLabel=Bm,j.ScPage=km,j.ScPageWithSlidingPanel=AN,j.ScPersonContactsBlock=Rx,j.ScPhone=ux,j.ScPhoneInput=sC,j.ScProductInfoContent=As,j.ScProductInfoDialog=dc,j.ScProductInfoPopover=uc,j.ScProductName=go,j.ScProductsList=K5,j.ScReferenceSelect=tf,j.ScSandwichConfigurator=Yu,j.ScSandwichConfiguratorForm=Xu,j.ScSandwichM2Configurator=Ku,j.ScSandwichM2ConfiguratorForm=Uu,j.ScSearchableProductSelect=um,j.ScSearchableReferenceSelect=dm,j.ScSetClientPriceFormItem=xw,j.ScShortTextOrderInfo=xN,j.ScSingleFileUploadSelector=U2,j.ScSlidingContentWithDrawer=Cm,j.ScStripConfigurator=Hu,j.ScStripConfiguratorForm=Du,j.ScStripConfiguratorLineItem=zu,j.ScStripConfiguratorPreview=Lu,j.ScUserShortInfo=Cl,j.ScWarningIcon=J2,j.SelectOptionHelper=wt,j.UiNotificationProvider=Tr,j.Validators=We,j.WindowResolutionEnum=Xe,j.WindowResolutionProvider=Ue,j.channelPrimaryInterestOptionsList=nN,j.componentSizeInjectionKey=Rr,j.copyToClipboard=jl,j.deliveryTypeReferenceList=j4,j.getOrderMarkerColors=Er,j.getOrderMarkerName=Ps,j.getOrderMarkers=Fs,j.getOrderStatusColors=ki,j.getOrderStatusCssVariables=Gl,j.getOrderStatusTagColor=Kl,j.getProductInfoFiles=Vs,j.handleFloatInput=fo,j.handleIntegerInput=ft,j.hasProductInfo=ec,j.isCanSandwichM2Show=Fx,j.isCanSandwichShow=Qu,j.isConfiguratorType=Zu,j.managersReferenceList=q4,j.naiveUiTheme=Mp,j.operatorReferenceList=tN,j.opfReferenceList=X4,j.orderStatusDetailReferenceList=eN,j.orderStatusReferenceList=xm,j.paginationItemsPrefix=Jl,j.parse=ht,j.partnerGroupReferenceList=Y4,j.paymentTypeReferenceList=J4,j.priceCoefficientsReferenceList=U4,j.productFilesTypesReferenceList=K4,j.renderConfig=Ke,j.resetInputValidation=dt,j.resourceReferencesList=G4,j.salesDirectionsReferenceList=Z4,j.searchCityReferenceDataHandler=rN,j.searchCityReferenceLabelRenderer=oN,j.searchClientReferenceDataHandler=lN,j.searchClientReferenceLabelRenderer=cN,j.searchRegionReferenceDataHandler=sN,j.searchRegionReferenceLabelRenderer=aN,j.selectAllTextOnFocus=He,j.showAppVersion=Lm,j.sourcePrimaryInterestOptionsList=iN,j.useCompactLayout=Om,j.useHoverSupport=uo,j.vCopy=ql,j.vFocusNext=ai,j.warehousesReferenceList=Q4,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}));
|
|
822
|
+
`,[om({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function ws(n){return n.type==="group"}function cm(n){return n.type==="ignored"}function _l(n,e){try{return!!(1+e.toString().toLowerCase().indexOf(n.trim().toLowerCase()))}catch{return!1}}function M5(n,e){return{getIsGroup:ws,getIgnored:cm,getKey(r){return ws(r)?r.name||r.key||"key-required":r[n]},getChildren(r){return r[e]}}}function I5(n,e,i,r){if(!e)return n;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(ws(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(cm(l))continue;e(i,l)&&a.push(l)}return a}return o(n)}function A5(n,e,i){const r=new Map;return n.forEach(o=>{ws(o)?o[i].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var O5={};const z5=Object.assign(Object.assign({},Rt.props),{to:Gn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),D5=t.defineComponent({name:"Select",props:z5,slots:Object,setup(n){O5.NODE_ENV!=="production"&&t.watchEffect(()=>{n.items!==void 0&&bi("select","`items` is deprecated, please use `options` instead."),n.onChange!==void 0&&bi("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:i,namespaceRef:r,inlineThemeDisabled:o}=Li(n),s=Rt("Select","-select",V5,F5,n,e),a=t.ref(n.defaultValue),l=t.toRef(n,"value"),c=Ya(l,a),d=t.ref(!1),u=t.ref(""),f=If(n,["items","options"]),h=t.ref([]),p=t.ref([]),m=t.computed(()=>p.value.concat(h.value).concat(f.value)),g=t.computed(()=>{const{filter:z}=n;if(z)return z;const{labelField:Q,valueField:se}=n;return(ye,we)=>{if(!we)return!1;const Ce=we[Q];if(typeof Ce=="string")return _l(ye,Ce);const Ne=we[se];return typeof Ne=="string"?_l(ye,Ne):typeof Ne=="number"?_l(ye,String(Ne)):!1}}),b=t.computed(()=>{if(n.remote)return f.value;{const{value:z}=m,{value:Q}=u;return!Q.length||!n.filterable?z:I5(z,g.value,Q,n.childrenField)}}),y=t.computed(()=>{const{valueField:z,childrenField:Q}=n,se=M5(z,Q);return fv(b.value,se)}),_=t.computed(()=>A5(m.value,n.valueField,n.childrenField)),x=t.ref(!1),w=Ya(t.toRef(n,"show"),x),C=t.ref(null),N=t.ref(null),k=t.ref(null),{localeRef:$}=jh("Select"),v=t.computed(()=>{var z;return(z=n.placeholder)!==null&&z!==void 0?z:$.value.placeholder}),E=[],P=t.ref(new Map),F=t.computed(()=>{const{fallbackOption:z}=n;if(z===void 0){const{labelField:Q,valueField:se}=n;return ye=>({[Q]:String(ye),[se]:ye})}return z===!1?!1:Q=>Object.assign(z(Q),{value:Q})});function R(z){const Q=n.remote,{value:se}=P,{value:ye}=_,{value:we}=F,Ce=[];return z.forEach(Ne=>{if(ye.has(Ne))Ce.push(ye.get(Ne));else if(Q&&se.has(Ne))Ce.push(se.get(Ne));else if(we){const $e=we(Ne);$e&&Ce.push($e)}}),Ce}const M=t.computed(()=>{if(n.multiple){const{value:z}=c;return Array.isArray(z)?R(z):[]}return null}),X=t.computed(()=>{const{value:z}=c;return!n.multiple&&!Array.isArray(z)?z===null?null:R([z])[0]||null:null}),G=qS(n),{mergedSizeRef:Z,mergedDisabledRef:O,mergedStatusRef:A}=G;function Y(z,Q){const{onChange:se,"onUpdate:value":ye,onUpdateValue:we}=n,{nTriggerFormChange:Ce,nTriggerFormInput:Ne}=G;se&&Et(se,z,Q),we&&Et(we,z,Q),ye&&Et(ye,z,Q),a.value=z,Ce(),Ne()}function H(z){const{onBlur:Q}=n,{nTriggerFormBlur:se}=G;Q&&Et(Q,z),se()}function T(){const{onClear:z}=n;z&&Et(z)}function D(z){const{onFocus:Q,showOnFocus:se}=n,{nTriggerFormFocus:ye}=G;Q&&Et(Q,z),ye(),se&&L()}function K(z){const{onSearch:Q}=n;Q&&Et(Q,z)}function J(z){const{onScroll:Q}=n;Q&&Et(Q,z)}function U(){var z;const{remote:Q,multiple:se}=n;if(Q){const{value:ye}=P;if(se){const{valueField:we}=n;(z=M.value)===null||z===void 0||z.forEach(Ce=>{ye.set(Ce[we],Ce)})}else{const we=X.value;we&&ye.set(we[n.valueField],we)}}}function q(z){const{onUpdateShow:Q,"onUpdate:show":se}=n;Q&&Et(Q,z),se&&Et(se,z),x.value=z}function L(){O.value||(q(!0),x.value=!0,n.filterable&&qe())}function le(){q(!1)}function ue(){u.value="",p.value=E}const oe=t.ref(!1);function fe(){n.filterable&&(oe.value=!0)}function ge(){n.filterable&&(oe.value=!1,w.value||ue())}function _e(){O.value||(w.value?n.filterable?qe():le():L())}function Qe(z){var Q,se;!((se=(Q=k.value)===null||Q===void 0?void 0:Q.selfRef)===null||se===void 0)&&se.contains(z.relatedTarget)||(d.value=!1,H(z),le())}function Re(z){D(z),d.value=!0}function Mt(){d.value=!0}function vn(z){var Q;!((Q=C.value)===null||Q===void 0)&&Q.$el.contains(z.relatedTarget)||(d.value=!1,H(z),le())}function It(){var z;(z=C.value)===null||z===void 0||z.focus(),le()}function en(z){var Q;w.value&&(!((Q=C.value)===null||Q===void 0)&&Q.$el.contains(Wr(z))||le())}function Ln(z){if(!Array.isArray(z))return[];if(F.value)return Array.from(z);{const{remote:Q}=n,{value:se}=_;if(Q){const{value:ye}=P;return z.filter(we=>se.has(we)||ye.has(we))}else return z.filter(ye=>se.has(ye))}}function mn(z){_t(z.rawNode)}function _t(z){if(O.value)return;const{tag:Q,remote:se,clearFilterAfterSelect:ye,valueField:we}=n;if(Q&&!se){const{value:Ce}=p,Ne=Ce[0]||null;if(Ne){const $e=h.value;$e.length?$e.push(Ne):h.value=[Ne],p.value=E}}if(se&&P.value.set(z[we],z),n.multiple){const Ce=Ln(c.value),Ne=Ce.findIndex($e=>$e===z[we]);if(~Ne){if(Ce.splice(Ne,1),Q&&!se){const $e=ae(z[we]);~$e&&(h.value.splice($e,1),ye&&(u.value=""))}}else Ce.push(z[we]),ye&&(u.value="");Y(Ce,R(Ce))}else{if(Q&&!se){const Ce=ae(z[we]);~Ce?h.value=[h.value[Ce]]:h.value=E}at(),le(),Y(z[we],z)}}function ae(z){return h.value.findIndex(se=>se[n.valueField]===z)}function de(z){w.value||L();const{value:Q}=z.target;u.value=Q;const{tag:se,remote:ye}=n;if(K(Q),se&&!ye){if(!Q){p.value=E;return}const{onCreate:we}=n,Ce=we?we(Q):{[n.labelField]:Q,[n.valueField]:Q},{valueField:Ne,labelField:$e}=n;f.value.some(rt=>rt[Ne]===Ce[Ne]||rt[$e]===Ce[$e])||h.value.some(rt=>rt[Ne]===Ce[Ne]||rt[$e]===Ce[$e])?p.value=E:p.value=[Ce]}}function Ge(z){z.stopPropagation();const{multiple:Q}=n;!Q&&n.filterable&&le(),T(),Q?Y([],[]):Y(null,null)}function Ui(z){!Hr(z,"action")&&!Hr(z,"empty")&&!Hr(z,"header")&&z.preventDefault()}function oi(z){J(z)}function si(z){var Q,se,ye,we,Ce;if(!n.keyboard){z.preventDefault();return}switch(z.key){case" ":if(n.filterable)break;z.preventDefault();case"Enter":if(!(!((Q=C.value)===null||Q===void 0)&&Q.isComposing)){if(w.value){const Ne=(se=k.value)===null||se===void 0?void 0:se.getPendingTmNode();Ne?mn(Ne):n.filterable||(le(),at())}else if(L(),n.tag&&oe.value){const Ne=p.value[0];if(Ne){const $e=Ne[n.valueField],{value:rt}=c;n.multiple&&Array.isArray(rt)&&rt.includes($e)||_t(Ne)}}}z.preventDefault();break;case"ArrowUp":if(z.preventDefault(),n.loading)return;w.value&&((ye=k.value)===null||ye===void 0||ye.prev());break;case"ArrowDown":if(z.preventDefault(),n.loading)return;w.value?(we=k.value)===null||we===void 0||we.next():L();break;case"Escape":w.value&&(LS(z),le()),(Ce=C.value)===null||Ce===void 0||Ce.focus();break}}function at(){var z;(z=C.value)===null||z===void 0||z.focus()}function qe(){var z;(z=C.value)===null||z===void 0||z.focusInput()}function on(){var z;w.value&&((z=N.value)===null||z===void 0||z.syncPosition())}U(),t.watch(t.toRef(n,"options"),U);const sn={focus:()=>{var z;(z=C.value)===null||z===void 0||z.focus()},focusInput:()=>{var z;(z=C.value)===null||z===void 0||z.focusInput()},blur:()=>{var z;(z=C.value)===null||z===void 0||z.blur()},blurInput:()=>{var z;(z=C.value)===null||z===void 0||z.blurInput()}},lt=t.computed(()=>{const{self:{menuBoxShadow:z}}=s.value;return{"--n-menu-box-shadow":z}}),jt=o?Hi("select",void 0,lt,n):void 0;return Object.assign(Object.assign({},sn),{mergedStatus:A,mergedClsPrefix:e,mergedBordered:i,namespace:r,treeMate:y,isMounted:as(),triggerRef:C,menuRef:k,pattern:u,uncontrolledShow:x,mergedShow:w,adjustedTo:Gn(n),uncontrolledValue:a,mergedValue:c,followerRef:N,localizedPlaceholder:v,selectedOption:X,selectedOptions:M,mergedSize:Z,mergedDisabled:O,focused:d,activeWithoutMenuOpen:oe,inlineThemeDisabled:o,onTriggerInputFocus:fe,onTriggerInputBlur:ge,handleTriggerOrMenuResize:on,handleMenuFocus:Mt,handleMenuBlur:vn,handleMenuTabOut:It,handleTriggerClick:_e,handleToggle:mn,handleDeleteOption:_t,handlePatternInput:de,handleClear:Ge,handleTriggerBlur:Qe,handleTriggerFocus:Re,handleKeydown:si,handleMenuAfterLeave:ue,handleMenuClickOutside:en,handleMenuScroll:oi,handleMenuKeydown:si,handleMenuMousedown:Ui,mergedTheme:s,cssVars:o?void 0:lt,themeClass:jt==null?void 0:jt.themeClass,onRender:jt==null?void 0:jt.onRender})},render(){return t.h("div",{class:`${this.mergedClsPrefix}-select`},t.h(Df,null,{default:()=>[t.h(Lf,null,{default:()=>t.h(R5,{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 n,e;return[(e=(n=this.$slots).arrow)===null||e===void 0?void 0:e.call(n)]}})}),t.h(nh,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Gn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>t.h(t.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var n,e,i;return this.mergedShow||this.displayDirective==="show"?((n=this.onRender)===null||n===void 0||n.call(this),t.withDirectives(t.h(s5,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:[(i=this.menuProps)===null||i===void 0?void 0:i.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"?[[t.vShow,this.mergedShow],[ss,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[ss,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),L5={},dm=t.defineComponent({...L5,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=t.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=t.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]);t.watch(()=>r.value,_=>{const w=(V.isArray(_)?_:_?[_]:[]).filter(C=>!l.value.some(N=>N.value===C.id));w.length>0&&(l.value=[...r.optionsListConverter(w),...l.value])},{deep:1});const c=t.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=t.ref(!1),u=t.useTemplateRef("select-component"),f=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(x=>{if(V.isEmpty(x))return;const w=s.value?r.value:r.value?[r.value]:[],C=x.filter(N=>!w.some(k=>k.id===N.id));l.value=r.optionsListConverter([...w,...C])}).finally(()=>{d.value=!1}))};let h="";const p=V.debounce(()=>f(h),800),m=_=>{h=_,p()},g=_=>{var x;if(V.isArray(_)){const w=_.length>0?_.map(C=>{var N;return t.toRaw((N=l.value.find(k=>k.value===C))==null?void 0:N.item)}):[];o("update:value",w)}else if(_>0){const w=t.toRaw((x=l.value.find(C=>C.value===_))==null?void 0:x.item);o("update:value",w)}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()}}),(_,x)=>(t.openBlock(),t.createBlock(t.unref(D5),{ref:"select-component","clear-filter-after-select":!0,clearable:n.clearable,"consistent-menu-width":n.consistentMenuWidth,disabled:n.disabled,filterable:!0,loading:d.value,multiple:s.value,options:c.value,placeholder:n.placeholder,remote:!0,value:a.value,"render-label":n.renderLabel,"render-tag":n.renderTag,onSearch:m,"onUpdate:value":g},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),H5={},um=t.defineComponent({...H5,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.useTemplateRef("select-component"),a=async f=>r.searchType==="categories"?W.HttpRequester.getInstance(W.ProductCategoryDataProvider).publicSimpleSearch(f):r.searchType==="products"?W.HttpRequester.getInstance(W.ProductDataProvider).publicSimpleSearch(f):new Promise(h=>{h([])}),l=f=>r.searchType==="categories"?wt.convertReferencesToSelectOptionsList(f,!0,!1,!1,h=>h!=null&&h.isNewRec()?"-":h.name):r.searchType==="products"?wt.convertReferencesToSelectOptionsList(f,!0,!1,!1,h=>h!=null&&h.isNewRec()?"-":`[${h.code}] ${h.name}`):[],c=(f,h)=>{if(r.renderLabel)return r.renderLabel(f,h);if(r.searchType==="products"){const p=f.item;return t.h("div",{},[t.h("span",{class:"text-sc-grey mr-2.5"},p.code),t.h("span",{},[p.name])])}if(r.searchType==="categories"){const p=f.item;return t.h("div",{},[p.name])}};return e({focus:()=>{var f;return(f=s.value)==null?void 0:f.focus()},blur:()=>{var f;return(f=s.value)==null?void 0:f.blur()}}),(f,h)=>(t.openBlock(),t.createBlock(dm,{ref:"select-component",value:n.value,clearable:n.clearable,disabled:n.disabled,placeholder:n.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":n.consistentMenuWidth,"wrap-content":n.wrapContent,"min-term-length":n.minTermLength,"render-label":c,"render-tag":n.renderTag,"onUpdate:value":h[0]||(h[0]=p=>o("update:value",p))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),W5={class:"col-span-2 flex flex-row gap-2.5"},j5={class:"flex-1"},q5={class:"text-sc-grey"},X5={class:"ml-2.5"},Y5={key:0,class:"flex-none"},U5={},K5=t.defineComponent({...U5,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(n,{emit:e}){const i=n,r=e,o=t.ref(null),s=()=>structuredClone(t.toRaw(i.value)),a=t.ref(s()),l=()=>{r("update:value",a.value.map(f=>t.toRaw(f)))},c=f=>{f&&(a.value=[...a.value.map(h=>t.toRaw(h)),...(V.isArray(f)?f:[f]).filter(h=>!a.value.some(p=>p.id===h.id))],t.nextTick(()=>{o.value=null}),l())},d=f=>{f&&(a.value=a.value.map(h=>h.id===f.id?f:t.toRaw(h)),l())},u=f=>{a.value=a.value.filter(h=>h.id!==f.id),l()};return t.watch(()=>i.value,()=>{a.value=s()}),(f,h)=>{const p=I.NListItem,m=vC,g=I.NButton,b=I.NList;return t.openBlock(),t.createBlock(b,{"show-divider":!1,hoverable:!0},{header:t.withCtx(()=>[t.renderSlot(f.$slots,"header")]),footer:t.withCtx(()=>[t.createVNode(um,{value:o.value,"onUpdate:value":[h[0]||(h[0]=y=>o.value=y),c],clearable:!0,disabled:n.disabled,"min-term-length":n.minTermLength,"search-type":n.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:t.withCtx(()=>[a.value.length===0?(t.openBlock(),t.createBlock(p,{key:0,class:"text-center text-sm text-gray-600"},{default:t.withCtx(()=>[...h[1]||(h[1]=[t.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,y=>(t.openBlock(),t.createBlock(p,{key:y.id},{suffix:t.withCtx(()=>[t.createVNode(g,{disabled:n.disabled,quaternary:"",type:"error",onClick:_=>u(y)},{default:t.withCtx(()=>[t.createVNode(m)]),_:1},8,["disabled","onClick"])]),default:t.withCtx(()=>[t.createElementVNode("div",W5,[t.createElementVNode("span",j5,[t.createElementVNode("span",q5,t.toDisplayString(y.code),1),t.createElementVNode("span",X5,t.toDisplayString(y.name),1)]),f.$slots["item-extra"]?(t.openBlock(),t.createElementBlock("div",Y5,[t.renderSlot(f.$slots,"item-extra",{item:y,updateItemCallback:d})])):t.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),G5={class:"flex flex-col"},Z5={class:"flex flex-col gap-1.5 text-base text-nowrap"},Q5={class:"font-medium"},J5={class:"flex flex-col text-sc-dark-grey"},e3={key:0},t3={class:"font-medium"},n3={class:"font-medium"},i3={class:"font-medium"},r3={class:"font-medium"},o3={class:"font-medium"},s3={class:"font-medium"},a3={class:"font-medium"},l3={class:"font-medium"},c3={class:"font-medium"},d3={class:"font-medium"},u3={class:"flex flex-col gap-1.5 text-base text-nowrap"},f3={class:"font-medium"},h3={class:"flex flex-col text-sc-dark-grey"},m3={class:"font-medium"},p3={class:"font-medium"},g3={class:"flex flex-col gap-1.5 text-base text-nowrap"},y3={class:"font-medium"},b3={class:"text-sc-dark-grey"},_3={class:"font-medium"},w3={key:1,class:"text-base font-medium text-nowrap"},x3={},wl=t.defineComponent({...x3,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},updateQuantityOnInput:{type:Boolean,default:!0}},setup(n){const e=[W.ConfiguratorsEnum.Kozyrek,W.ConfiguratorsEnum.Mosquitto,W.ConfiguratorsEnum.Strip,W.ConfiguratorsEnum.MetalForDoors,W.ConfiguratorsEnum.Sandwich,W.ConfiguratorsEnum.SandwichM2],i=n,r=t.ref(!1),o=t.computed(()=>i.item),s=t.computed(()=>{var m,g;return((m=i.item.product.unit)==null?void 0:m.isLinear)&&((g=i.item.product.properties)==null?void 0:g.isLengthConfigurator)}),a=t.computed(()=>W.UnitsHelper.getProductLengthMultiplicity(i.item.product)),l=t.computed(()=>Ve.multiplyByStep(i.item.quantity,a.value)),c=t.computed(()=>W.UnitsHelper.getProductMultiplicity(i.item.product)),d=t.computed(()=>c.value>1),u=t.ref({quantity:i.item.quantity});t.watch(()=>i.item,m=>{u.value={quantity:m.quantity}});const f=m=>{var g;m!==null&&(u.value.quantity=m,(g=i.eventEmitter)==null||g.emit("order-item:edit-quantity",{item:o.value,quantity:m,loaderRef:r}))},h=()=>{var m;(m=i.eventEmitter)==null||m.emit("order-item:open-configurator",{item:o.value})},p=()=>{var m;(m=i.eventEmitter)==null||m.emit("order-item:edit",{item:o.value})};return(m,g)=>{const b=I.NInputNumber;return t.openBlock(),t.createElementBlock("div",G5,[n.item.configurator&&n.item.configuratorParams&&e.includes(n.item.configurator)?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[t.createElementVNode("div",Z5,[t.createElementVNode("span",null,[g[1]||(g[1]=t.createTextVNode(" Количество: ",-1)),t.createElementVNode("span",Q5,t.toDisplayString(n.item.quantity)+" шт.",1)]),t.createElementVNode("div",J5,[n.item.configurator===t.unref(W.ConfiguratorsEnum).Kozyrek?(t.openBlock(),t.createElementBlock("span",e3,[g[2]||(g[2]=t.createTextVNode(" Длина: ",-1)),t.createElementVNode("span",t3,t.toDisplayString(Math.round(n.item.length*1e3))+" мм.",1)])):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).Mosquitto?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("span",null,[g[3]||(g[3]=t.createTextVNode(" Ширина: ",-1)),t.createElementVNode("span",n3,t.toDisplayString(Math.round(n.item.width*1e3))+" мм.",1)]),t.createElementVNode("span",null,[g[4]||(g[4]=t.createTextVNode(" Высота: ",-1)),t.createElementVNode("span",i3,t.toDisplayString(Math.round(n.item.height*1e3))+" мм.",1)])],64)):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).Strip?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.item.configuratorParams.linesWidths,(y,_)=>(t.openBlock(),t.createElementBlock("span",{key:_},[t.createTextVNode(" Полоса №"+t.toDisplayString(Number(_)+1)+": ",1),t.createElementVNode("span",r3,t.toDisplayString(y)+" мм.",1)]))),128)),t.createElementVNode("span",null,[g[5]||(g[5]=t.createTextVNode(" Метраж: ",-1)),t.createElementVNode("span",o3,t.toDisplayString(n.item.length)+" м.",1)])],64)):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).MetalForDoors?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[t.createElementVNode("span",null,[g[6]||(g[6]=t.createTextVNode(" Ширина: ",-1)),t.createElementVNode("span",s3,t.toDisplayString(n.item.width)+" мм.",1)]),t.createElementVNode("span",null,[g[7]||(g[7]=t.createTextVNode(" Длина: ",-1)),t.createElementVNode("span",a3,t.toDisplayString(Math.round(n.item.length*1e3))+" мм.",1)])],64)):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).Sandwich?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:4},t.renderList(n.item.configuratorParams.items??[],(y,_)=>(t.openBlock(),t.createElementBlock("span",{key:_},[t.createTextVNode(" Изделие №"+t.toDisplayString(Number(_)+1)+": ",1),t.createElementVNode("span",l3,t.toDisplayString(y.width)+"×"+t.toDisplayString(y.length)+" мм, "+t.toDisplayString(y.count)+" шт.",1)]))),128)):t.createCommentVNode("",!0),n.item.configurator===t.unref(W.ConfiguratorsEnum).SandwichM2?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[t.createElementVNode("span",null,[g[8]||(g[8]=t.createTextVNode(" Ширина: ",-1)),t.createElementVNode("span",c3,t.toDisplayString(Math.round(n.item.width*1e3))+" мм.",1)]),t.createElementVNode("span",null,[g[9]||(g[9]=t.createTextVNode(" Длина: ",-1)),t.createElementVNode("span",d3,t.toDisplayString(Math.round(n.item.length*1e3))+" мм.",1)])],64)):t.createCommentVNode("",!0)])]),n.allowEdit?(t.openBlock(),t.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:t.withModifiers(h,["prevent"])}," Изменить ")):t.createCommentVNode("",!0)],64)):s.value&&a.value>0?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[t.createElementVNode("div",u3,[t.createElementVNode("span",null,[g[10]||(g[10]=t.createTextVNode(" Количество: ",-1)),t.createElementVNode("span",f3,t.toDisplayString(n.item.quantity)+" шт.",1)]),t.createElementVNode("div",h3,[t.createElementVNode("span",null,[g[11]||(g[11]=t.createTextVNode(" Длина: ",-1)),t.createElementVNode("span",m3,t.toDisplayString(a.value)+" "+t.toDisplayString(n.item.product.unit.name),1)]),t.createElementVNode("span",null,[g[12]||(g[12]=t.createTextVNode(" Всего: ",-1)),t.createElementVNode("span",p3,t.toDisplayString(l.value)+" "+t.toDisplayString(n.item.product.unit.name),1)])])]),n.allowEdit?(t.openBlock(),t.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:t.withModifiers(p,["prevent"])}," Изменить ")):t.createCommentVNode("",!0)],64)):n.item.product.getIsMeasurable()?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[t.createElementVNode("div",g3,[t.createElementVNode("span",null,[g[13]||(g[13]=t.createTextVNode(" Количество: ",-1)),t.createElementVNode("span",y3,t.toDisplayString(n.item.quantity)+" шт.",1)]),t.createElementVNode("span",b3,[g[14]||(g[14]=t.createTextVNode(" Метраж: ",-1)),t.createElementVNode("span",_3,t.toDisplayString(n.item.length??n.item.width)+" "+t.toDisplayString(n.item.product.unit.name),1)])]),n.allowEdit?(t.openBlock(),t.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:t.withModifiers(p,["prevent"])}," Изменить ")):t.createCommentVNode("",!0)],64)):(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[n.allowEdit?(t.openBlock(),t.createBlock(b,{key:0,value:u.value.quantity,parse:t.unref(ht),min:c.value,step:c.value,"show-button":d.value,"button-placement":"both","update-value-on-input":n.updateQuantityOnInput,disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:g[0]||(g[0]=y=>t.unref(fo)(y,".",!1)),onFocus:t.unref(He),"onUpdate:value":f},{suffix:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.item.product.unit.name),1)]),_:1},8,["value","parse","min","step","show-button","update-value-on-input","disabled","loading","onFocus"])):(t.openBlock(),t.createElementBlock("span",w3,t.toDisplayString(n.item.quantity)+" "+t.toDisplayString(n.item.product.unit.name),1))],64))])}}}),k3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function C3(n,e){return t.openBlock(),t.createElementBlock("svg",k3,[...e[0]||(e[0]=[t.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 v3=t.markRaw({name:"tabler-truck-filled",render:C3}),S3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function B3(n,e){return t.openBlock(),t.createElementBlock("svg",S3,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.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"}),t.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const N3=t.markRaw({name:"tabler-truck-delivery",render:B3}),T3={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function $3(n,e){return t.openBlock(),t.createElementBlock("svg",T3,[...e[0]||(e[0]=[t.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[t.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),t.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 E3=t.markRaw({name:"tabler-truck-loading",render:$3}),R3={class:"flex flex-col gap-1"},P3={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},F3={key:1,class:"text-base"},V3={class:"text-sc-dark-grey mr-1.5"},M3={key:0},I3={key:1},A3={},xs=t.defineComponent({...A3,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(n){const e=t.computed(()=>{var s;return(s=W.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(a=>a.id===o.delivery.type)}),i=t.computed(()=>Be.format(o.delivery.date,"dd.MM.yyyy")),r=t.computed(()=>{var s;return(s=o.delivery.address)!=null&&s.address?li.getFormatEntityName({name:o.delivery.address.address,deletedAt:o.delivery.address.deletedAt}):""}),o=n;return(s,a)=>{var u,f,h,p,m,g,b,y;const l=E3,c=N3,d=v3;return t.openBlock(),t.createElementBlock("div",R3,[n.showType?(t.openBlock(),t.createElementBlock("span",P3,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(t.openBlock(),t.createBlock(l,{key:0})):t.createCommentVNode("",!0),((f=e.value)==null?void 0:f.slug)==="delivery"?(t.openBlock(),t.createBlock(c,{key:1})):t.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="transport_company_delivery"?(t.openBlock(),t.createBlock(d,{key:2})):t.createCommentVNode("",!0),t.createElementVNode("span",null,t.toDisplayString((p=e.value)==null?void 0:p.name),1)])):t.createCommentVNode("",!0),n.showDetails?(t.openBlock(),t.createElementBlock("span",F3,[t.createElementVNode("span",V3,t.toDisplayString(i.value),1),(g=(m=n.delivery)==null?void 0:m.address)!=null&&g.address?(t.openBlock(),t.createElementBlock("span",M3,t.toDisplayString(r.value),1)):t.createCommentVNode("",!0),(y=(b=n.delivery)==null?void 0:b.warehouse)!=null&&y.address?(t.openBlock(),t.createElementBlock("span",I3," со склада "+t.toDisplayString(n.delivery.warehouse.address),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)])}}}),O3={class:"flex flex-col gap-2.5"},z3={class:"text-base"},D3=["href"],L3={key:1,class:"text-sc-grey"},H3={},fm=t.defineComponent({...H3,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{},highlightSettings:{}},setup(n){const e=n,i=t.computed(()=>e.fields.includes(Ie.Id)?e.order.id:void 0),r=t.computed(()=>{var f,h;return e.fields.includes(Ie.Status)?(h=(f=W.useReferencesStore().orderStatusReference)==null?void 0:f.find(p=>{var m;return p.id===(((m=e.order.status)==null?void 0:m.id)??-1)}))==null?void 0:h.name:void 0}),o=t.computed(()=>{var f;return ki((f=e.order.status)==null?void 0:f.slug)}),s=t.computed(()=>{var h,p;const f=(h=e.order.status)==null?void 0:h.slug;return!!f&&(((p=e.highlightSettings)==null?void 0:p.statuses.includes(f))??!1)}),a=t.computed(()=>Fs(e.order).filter(f=>[ct.OnOrder,ct.NotInStock].includes(f))),l=f=>{var h;return((h=e.highlightSettings)==null?void 0:h.markers.includes(f))??!1},c=t.computed(()=>e.fields.includes(Ie.CreatedAt)),d=t.computed(()=>e.fields.includes(Ie.ClientInfo)||e.fields.includes(Ie.ClientInfoShort)?e.order.client:void 0),u=t.computed(()=>e.fields.includes(Ie.DeliveryInfo)?e.order.delivery:void 0);return(f,h)=>(t.openBlock(),t.createElementBlock("div",O3,[t.createElementVNode("span",z3,[i.value?(t.openBlock(),t.createElementBlock("a",{key:0,href:n.orderUrl.replace(":id",n.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+t.toDisplayString(i.value),9,D3)):t.createCommentVNode("",!0),c.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[h[0]||(h[0]=t.createTextVNode(" от ",-1)),t.createVNode(es,{date:n.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[h[1]||(h[1]=t.createTextVNode(" - ",-1)),s.value?(t.openBlock(),t.createElementBlock("span",{key:0,class:"font-medium",style:t.normalizeStyle({color:o.value.color})},t.toDisplayString(r.value),5)):(t.openBlock(),t.createElementBlock("span",L3,t.toDisplayString(r.value),1))],64)):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(a.value,p=>(t.openBlock(),t.createElementBlock(t.Fragment,{key:p},[h[2]||(h[2]=t.createTextVNode(" - ",-1)),t.createElementVNode("span",{class:t.normalizeClass({"font-medium":l(p),"text-sc-dark-grey":!l(p)}),style:t.normalizeStyle(l(p)?{color:t.unref(Er)(p).color}:void 0)},t.toDisplayString(t.unref(Ps)(p)),7)],64))),128))]),d.value?(t.openBlock(),t.createBlock(Dr,{key:0,client:d.value,class:"ml-3"},null,8,["client"])):t.createCommentVNode("",!0),u.value?(t.openBlock(),t.createBlock(xs,{key:1,delivery:u.value,class:"ml-3"},null,8,["delivery"])):t.createCommentVNode("",!0)]))}}),W3={},xl=t.defineComponent({...W3,__name:"order-payment",props:{payment:{}},setup(n){const e=n,i=t.computed(()=>{var r;return(r=W.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return t.openBlock(),t.createElementBlock("span",null,t.toDisplayString(((s=i.value)==null?void 0:s.name)??"-"),1)}}}),j3={},q3=t.defineComponent({...j3,__name:"order-item-specification",props:{src:{}},setup(n){const e=t.useTemplateRef("image-reference");return(i,r)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.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()})}," Спецификация "),t.withDirectives(t.createVNode(t.unref(I.NImage),{ref:"image-reference",src:n.src,"previewed-img-props":{style:"max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;"}},null,8,["src"]),[[t.vShow,!1]])],64))}}),X3={},ks=t.defineComponent({...X3,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(n){const e=n,i={quantity:"количество",length:"длина"},r=t.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=t.computed(()=>{const s={[W.UserTypeEnum.Manager]:"менеджером",[W.UserTypeEnum.Operator]:"оператором",[W.UserTypeEnum.Client]:"клиентом",[W.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>i[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)=>(t.openBlock(),t.createElementBlock("small",{class:t.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}`)},t.toDisplayString(o.value),3))}}),Y3={class:"flex flex-col gap-0.5"},U3={class:"text-gray-600"},K3={},hm=t.defineComponent({...K3,__name:"order-item-name",props:{item:{},showCode:{type:Boolean,default:!1},inactive:{type:Boolean,default:void 0}},setup(n){const e=n,i=t.inject(W.currentOrderInjectionKey,null),r=t.computed(()=>{if(i!=null)return t.toValue(i)??void 0}),o=t.computed(()=>{const{item:d,inactive:u}=e;return u??(!!d.isRemoved||!!d.replacementId)}),s=t.computed(()=>{const{creator:d}=e.item;return!!(d!=null&&d.type)&&(!r.value||r.value.creator.guid!==d.guid)}),a=t.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),l=t.computed(()=>"changedFields"in e.item?e.item.changedFields:[]),c=t.computed(()=>{var d,u;return"replacement"in e.item?(u=(d=e.item.replacement)==null?void 0:d.creator)==null?void 0:u.type:void 0});return(d,u)=>(t.openBlock(),t.createElementBlock("div",Y3,[t.createElementVNode("div",{class:t.normalizeClass(o.value?"line-through opacity-50":"")},[t.createVNode(go,{product:n.item.product,"show-additional-sale-icon":n.item.isAdditionalSale??!1,"show-code":n.showCode},null,8,["product","show-additional-sale-icon","show-code"])],2),n.item.marker?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass(o.value?"line-through opacity-50":"")},[u[0]||(u[0]=t.createTextVNode(" Маркировка: ",-1)),t.createElementVNode("span",U3,t.toDisplayString(n.item.marker),1)],2)):t.createCommentVNode("",!0),a.value?(t.openBlock(),t.createElementBlock("div",{key:1,class:t.normalizeClass(o.value?"line-through opacity-50":"")},[t.createVNode(q3,{src:a.value},null,8,["src"])],2)):t.createCommentVNode("",!0),s.value&&!o.value?(t.openBlock(),t.createBlock(ks,{key:2,"user-type":n.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):t.createCommentVNode("",!0),n.item.isRemoved&&!n.item.replacementId&&l.value.length===0?(t.openBlock(),t.createBlock(ks,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):t.createCommentVNode("",!0),n.item.replacementId&&l.value.length>0?(t.openBlock(),t.createBlock(ks,{key:4,"user-type":c.value,"changed-fields":l.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):t.createCommentVNode("",!0)]))}}),G3={class:"flex flex-row gap-1.5"},Z3={class:"flex flex-1 flex-col gap-2.5"},Q3={class:"flex items-start gap-1"},J3={},mm=t.defineComponent({...J3,__name:"order-product-info",props:{product:{},index:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},updateQuantityOnInput:{type:Boolean,default:!0},inactive:{type:Boolean,default:!1}},setup(n){const e=n,i=t.computed(()=>e.inactive?"line-through opacity-50":"");return(r,o)=>(t.openBlock(),t.createElementBlock("div",G3,[t.createElementVNode("span",{class:t.normalizeClass(["flex-none text-nowrap",i.value])},t.toDisplayString(n.index+1)+". ",3),t.createElementVNode("div",Z3,[t.createVNode(hm,{item:n.product,inactive:n.inactive,"show-code":""},null,8,["item","inactive"]),t.createElementVNode("div",Q3,[t.createVNode(wl,{item:n.product,"event-emitter":n.eventEmitter,"allow-edit":n.allowEdit,"update-quantity-on-input":n.updateQuantityOnInput,class:t.normalizeClass(["min-w-0 flex-1",i.value])},null,8,["item","event-emitter","allow-edit","update-quantity-on-input","class"]),n.allowEdit?t.renderSlot(r.$slots,"actions",{key:0}):t.createCommentVNode("",!0)]),t.createElementVNode("div",{class:t.normalizeClass(["grid grid-flow-col grid-rows-2 gap-1 text-base",i.value])},[o[0]||(o[0]=t.createElementVNode("span",null,"Цена за ед.",-1)),t.createVNode(ci,{product:n.product,"cost-field-name":"costOneRub"},null,8,["product"]),o[1]||(o[1]=t.createElementVNode("span",null,"Сумма",-1)),t.createVNode(ci,{product:n.product,"cost-field-name":"cost"},null,8,["product"])],2)])]))}}),e4={class:"flex items-center gap-1.5"},t4={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},n4={key:0,class:"h-1.5 w-1.5 shrink-0 rounded-full bg-current"},i4={},pm=t.defineComponent({...i4,__name:"order-status-tag",props:{status:{},statusDetail:{default:null},variant:{default:"filled"},size:{default:"medium"},showDot:{type:Boolean,default:!0}},setup(n){const e=n,i=t.computed(()=>ki(e.status.slug)),r=t.computed(()=>Kl(e.status.slug)),o=t.computed(()=>e.statusDetail?`${e.status.name} (${e.statusDetail.name})`:e.status.name);return(s,a)=>{const l=I.NTag;return n.variant==="filled"?(t.openBlock(),t.createBlock(l,{key:0,color:r.value,bordered:!1,size:n.size,round:""},{default:t.withCtx(()=>[t.createElementVNode("span",e4,[n.showDot?(t.openBlock(),t.createElementBlock("span",t4)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.value),1)])]),_:1},8,["color","size"])):(t.openBlock(),t.createElementBlock("span",{key:1,class:"inline-flex items-center gap-1.5 font-medium",style:t.normalizeStyle({color:i.value.color})},[n.showDot?(t.openBlock(),t.createElementBlock("span",n4)):t.createCommentVNode("",!0),t.createTextVNode(" "+t.toDisplayString(o.value),1)],4))}}}),r4={},kl=t.defineComponent({...r4,__name:"order-color-swatch",props:{colors:{}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("span",{class:"inline-flex h-5 min-w-8 shrink-0 items-center justify-center rounded px-1.5 text-xs font-semibold leading-none",style:t.normalizeStyle({backgroundColor:n.colors.backgroundColor,color:n.colors.textOnBackgroundColor,border:`1px solid ${n.colors.color}`})}," Аа ",4))}}),o4={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function s4(n,e){return t.openBlock(),t.createElementBlock("svg",o4,[...e[0]||(e[0]=[t.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),t.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),t.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 a4=t.markRaw({name:"ion-trash-outline",render:s4}),l4={key:0,class:"!mb-3 !mt-0 text-base font-semibold"},c4={class:"mb-1 flex flex-wrap items-baseline justify-between gap-2"},d4={class:"flex items-baseline gap-2"},u4={class:"text-base font-bold text-sc-dark-grey"},f4={key:0,class:"text-sm text-sc-grey"},h4={key:0,class:"text-sm text-sc-dark-grey"},m4={},p4=t.defineComponent({...m4,__name:"order-items-list",props:t.mergeModels({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},title:{default:"Список позиций"},groups:{default:void 0},extraColumns:{default:void 0},isItemInactive:{type:Function,default:void 0},isItemSelectable:{type:Function,default:void 0},updateQuantityOnInput:{type:Boolean,default:!0}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:["update:selectedRowKeys"],setup(n){const e=n,i=t.useModel(n,"selectedRowKeys"),r=b=>V.sortBy(b,"ord"),o=t.computed(()=>r(e.products)),s=b=>e.isItemInactive?e.isItemInactive(b):!!b.isRemoved||!!b.replacementId,a=b=>e.isItemSelectable?e.isItemSelectable(b):!s(b),l=(b,y)=>{y?i.value.includes(b)||(i.value=[...i.value,b]):i.value=i.value.filter(_=>_!==b)},c=b=>e.selectable?{class:i.value.includes(b.id)?void 0:"opacity-60"}:{},d=(b,y)=>{const _=o.value,x=b.logicGroupId;if(!x)return 1;const w=_.at(y-1);if(y&&w&&w.logicGroupId===x)return 0;const C=_.slice(y),N=C.findIndex(k=>k.logicGroupId!==x);return N===-1?C.length:N},u=b=>s(b)?null:t.h(I.NButton,{quaternary:!0,size:"small",type:"error",onClick:()=>{var y;(y=e.eventEmitter)==null||y.emit("order-item:delete",{item:b})}},()=>t.h(a4)),f=t.ref(Ue.getDeviceTypeByResolution()),h=t.ref(window.innerWidth),p=()=>{const b=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(_,x)=>t.h("span",{class:`text-base${s(_)?" line-through opacity-50":""}`},[x+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,width:h.value>=1536?156:120,render:_=>t.h("span",{class:`text-base${s(_)?" line-through opacity-50":""}`},[_.product.code])},{title:"Наименование",key:"name",resizable:!0,render:_=>t.h(hm,{item:_,inactive:s(_)})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:d,render:_=>t.h(wl,{class:s(_)?"line-through opacity-50":"",item:_,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!s(_),updateQuantityOnInput:e.updateQuantityOnInput})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,width:120,render:_=>t.h("div",{class:s(_)?"line-through opacity-50":""},[t.h(ci,{product:_,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,width:120,render:_=>t.h("div",{class:s(_)?"line-through opacity-50":""},[t.h(ci,{product:_,costFieldName:"cost",showCurrency:!0})])},...e.extraColumns??[],...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:d,render:_=>u(_)}]:[]],y=e.selectable?[{key:"checkbox",title:"",className:"align-top",width:"32",cellProps:_=>({class:a(_)?"cursor-pointer":void 0,onClick:()=>{a(_)&&l(_.id,!i.value.includes(_.id))}}),render:_=>t.h(I.NCheckbox,{checked:i.value.includes(_.id),disabled:!a(_)})}]:[];switch(f.value){case Xe.phone:case Xe.tablet:return[...y,{title:"",key:"items",resizable:!0,render:(_,x)=>{const w=d(_,x)>0,C=e.allowEdit&&!s(_)&&w;return t.h(mm,{product:_,index:x,eventEmitter:e.eventEmitter,allowEdit:C,updateQuantityOnInput:e.updateQuantityOnInput,inactive:s(_)},{actions:()=>u(_)})}}];case Xe.laptop:return[...y,...b];default:return[...y,...b]}},m=t.computed(()=>p()),g=()=>{f.value=Ue.getDeviceTypeByResolution(),h.value=window.innerWidth};return t.onMounted(()=>{g(),window.addEventListener("resize",g)}),t.onUnmounted(()=>{window.removeEventListener("resize",g)}),(b,y)=>{const _=I.NDataTable;return t.openBlock(),t.createElementBlock(t.Fragment,null,[n.title?(t.openBlock(),t.createElementBlock("h3",l4,t.toDisplayString(n.title),1)):t.createCommentVNode("",!0),n.groups?(t.openBlock(!0),t.createElementBlock(t.Fragment,{key:1},t.renderList(n.groups,x=>(t.openBlock(),t.createElementBlock("div",{key:x.name,class:"mb-6 last:mb-0"},[t.createElementVNode("div",c4,[t.createElementVNode("div",d4,[t.createElementVNode("span",u4,t.toDisplayString(x.name),1),x.description?(t.openBlock(),t.createElementBlock("span",f4,t.toDisplayString(x.description),1)):t.createCommentVNode("",!0)]),x.summary?(t.openBlock(),t.createElementBlock("span",h4,t.toDisplayString(x.summary),1)):t.createCommentVNode("",!0)]),t.createVNode(_,{columns:m.value,data:r(x.items),"row-key":w=>w.id,"row-props":c,"bottom-bordered":!1,bordered:!1,"max-height":n.maxHeight},null,8,["columns","data","row-key","max-height"])]))),128)):(t.openBlock(),t.createBlock(_,{key:2,columns:m.value,data:o.value,"row-key":x=>x.id,"row-props":c,"bottom-bordered":!1,bordered:!1,"max-height":n.maxHeight},null,8,["columns","data","row-key","max-height"]))],64)}}}),gm=gn(p4,[["__scopeId","data-v-be7a0384"]]),g4={key:0,class:"text-sc-dark-grey my-2 text-center"},y4={key:1,class:"text-sc-dark-grey my-2"},b4={},ym=t.defineComponent({...b4,__name:"order-status-history",props:{order:{}},setup(n){const e=n,i=t.ref(!1),r=t.ref([]),o=a=>{const{uiDateWithTime:l}=W.useBaseConfigStateStore().config.dateFormats;return Be.format(a,l)},s=(a=!0)=>{a&&(i.value=!0),W.HttpRequester.getInstance(W.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(l=>{r.value=l}).finally(()=>{a&&(i.value=!1)})};return t.watch(()=>e.order,()=>{s(!1)}),t.onMounted(()=>{s()}),(a,l)=>{const c=I.NSpin,d=I.NTimelineItem,u=I.NTimeline;return t.openBlock(),t.createElementBlock("div",null,[l[1]||(l[1]=t.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),i.value?(t.openBlock(),t.createElementBlock("div",g4,[t.createVNode(c,{size:"small",class:"mb-1 align-middle"}),l[0]||(l[0]=t.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(t.openBlock(),t.createElementBlock("div",y4," История статусов отсутствует. ")):(t.openBlock(),t.createBlock(u,{key:2},{default:t.withCtx(()=>[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.value,(f,h)=>(t.openBlock(),t.createBlock(d,{key:h,color:t.unref(ki)(f.status.slug).color,time:o(f.createdAt),content:f.user.name},{header:t.withCtx(()=>[t.createVNode(pm,{status:f.status,"status-detail":f.statusDetail,variant:h===0?"filled":"text","show-dot":!1,size:"small"},null,8,["status","status-detail","variant"])]),_:2},1032,["color","time","content"]))),128))]),_:1}))])}}}),_4={class:"text-base"},w4={},Cl=t.defineComponent({...w4,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass({"flex flex-col":n.showUserType&&n.extraInfoOnSecondLine})},[t.createElementVNode("span",_4,t.toDisplayString(n.user.name),1),n.showUserType?(t.openBlock(),t.createElementBlock("span",{key:0,class:t.normalizeClass([{"ml-1":!n.extraInfoOnSecondLine},"text-sc-grey"])}," ["+t.toDisplayString(n.user.type)+"] ",3)):t.createCommentVNode("",!0)],2))}}),x4={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},k4={class:"col-span-2"},C4={class:"col-span-2"},v4={},bm=t.defineComponent({...v4,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(n,{emit:e}){const i=e;return(r,o)=>(t.openBlock(),t.createElementBlock("div",null,[o[11]||(o[11]=t.createElementVNode("h3",null,"Детали заказа",-1)),t.createElementVNode("div",x4,[n.order.creator.id!==n.order.client.id?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[o[1]||(o[1]=t.createElementVNode("span",null,"Создал",-1)),t.createVNode(Cl,{user:n.order.creator,class:"col-span-2"},null,8,["user"])],64)):t.createCommentVNode("",!0),o[10]||(o[10]=t.createElementVNode("span",null,"Клиент",-1)),t.createVNode(Dr,{client:n.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=s=>i("click:client-name",n.order.client,s))},null,8,["client"]),n.order.contragent?(t.openBlock(),t.createElementBlock(t.Fragment,{key:1},[o[2]||(o[2]=t.createElementVNode("span",null,"Контрагент",-1)),t.createVNode(nf,{contragent:n.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):t.createCommentVNode("",!0),n.order.image?(t.openBlock(),t.createElementBlock(t.Fragment,{key:2},[o[3]||(o[3]=t.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=t.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):t.createCommentVNode("",!0),n.order.barcode?(t.openBlock(),t.createElementBlock(t.Fragment,{key:3},[o[5]||(o[5]=t.createElementVNode("span",null,"Штрих-код",-1)),t.createElementVNode("span",k4,t.toDisplayString(n.order.barcode),1)],64)):t.createCommentVNode("",!0),n.order.payment?(t.openBlock(),t.createElementBlock(t.Fragment,{key:4},[o[6]||(o[6]=t.createElementVNode("span",null,"Оплата",-1)),t.createVNode(xl,{payment:n.order.payment,class:"col-span-2"},null,8,["payment"])],64)):t.createCommentVNode("",!0),n.order.delivery?(t.openBlock(),t.createElementBlock(t.Fragment,{key:5},[o[7]||(o[7]=t.createElementVNode("span",null,"Доставка",-1)),t.createVNode(xs,{delivery:n.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):t.createCommentVNode("",!0),n.order.comment?(t.openBlock(),t.createElementBlock(t.Fragment,{key:6},[o[8]||(o[8]=t.createElementVNode("span",null,"Комментарий",-1)),t.createElementVNode("span",C4,t.toDisplayString(n.order.comment),1)],64)):t.createCommentVNode("",!0),n.order.attachedUser?(t.openBlock(),t.createElementBlock(t.Fragment,{key:7},[o[9]||(o[9]=t.createElementVNode("span",null,"Закреплен за",-1)),t.createVNode(Cl,{user:n.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):t.createCommentVNode("",!0)])]))}}),S4={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function B4(n,e){return t.openBlock(),t.createElementBlock("svg",S4,[...e[0]||(e[0]=[t.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),t.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 N4=t.markRaw({name:"ion-copy-outline",render:B4}),T4={class:"flex flex-col items-stretch gap-1.5 text-base"},$4={},E4=t.defineComponent({...$4,__name:"order-external-links",props:{showErpLink:{type:Boolean,default:!1},order:{}},setup(n){const e=t.computed(()=>{var r,o;const i=(((r=n.order.invoices)==null?void 0:r.length)??0)>0;return n.showErpLink&&!!n.order.erpOrderUrl||i||!!((o=n.order.payment)!=null&&o.onlinePaymentLink)});return(i,r)=>{var a;const o=I.NButton,s=N4;return e.value?(t.openBlock(),t.createElementBlock(t.Fragment,{key:0},[r[2]||(r[2]=t.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Внешние ссылки",-1)),t.createElementVNode("div",T4,[n.showErpLink&&n.order.erpOrderUrl?(t.openBlock(),t.createBlock(o,{key:0,tag:"a",href:n.order.erpOrderUrl,target:"_blank",block:"",class:"sc-external-link-button"},{default:t.withCtx(()=>[...r[0]||(r[0]=[t.createTextVNode(" Открыть в ERP ",-1)])]),_:1},8,["href"])):t.createCommentVNode("",!0),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(n.order.invoices??[],(l,c)=>(t.openBlock(),t.createBlock(o,{key:c,tag:"a",href:l,block:"",class:"sc-external-link-button"},{default:t.withCtx(()=>[t.createTextVNode(" Скачать счет №"+t.toDisplayString(c+1),1)]),_:2},1032,["href"]))),128)),(a=n.order.payment)!=null&&a.onlinePaymentLink?t.withDirectives((t.openBlock(),t.createBlock(o,{key:1,block:"",class:"sc-external-link-button",title:"Ссылка на оплату копируется в буфер обмена"},{default:t.withCtx(()=>[t.createVNode(s,{class:"mr-1.5"}),r[1]||(r[1]=t.createTextVNode(" Скопировать ссылку на оплату ",-1))]),_:1})),[[t.unref(ql),n.order.payment.onlinePaymentLink]]):t.createCommentVNode("",!0)])],64)):t.createCommentVNode("",!0)}}}),_m=gn(E4,[["__scopeId","data-v-6a3ae627"]]),R4={key:0},P4={class:"text-sc-dark-grey my-2 text-center"},F4={key:1,class:"text-sc-dark-grey my-2 text-center"},V4={key:2},M4={class:"text-sc-dark-grey mt-4 text-right font-bold"},I4={class:"text-sc-primary"},A4={class:"mb-4 max-w-xs empty:hidden"},O4={},wm=t.defineComponent({...O4,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(n,{emit:e}){const i=n,r=e,o=t.ref(!1),s=t.ref();t.provide(W.currentOrderInjectionKey,t.computed(()=>s.value??null));const a=(d=!0)=>{if("products"in i.order){s.value=new W.Order(i.order);return}d&&(o.value=!0),W.HttpRequester.getInstance(W.OrdersDataProvider).getOrder(i.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=t.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=t.computed(()=>Ve.formatMoney(V.sumBy(l.value,"costRub")));return t.watch(()=>i.order,()=>{a(!1)}),t.onMounted(()=>{a()}),(d,u)=>{const f=I.NSpin;return o.value?(t.openBlock(),t.createElementBlock("div",R4,[t.createElementVNode("div",P4,[t.createVNode(f,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=t.createElementVNode("div",null,[t.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(t.openBlock(),t.createElementBlock("div",F4," --- Не удалось загрузить данные о заказе --- ")):(t.openBlock(),t.createElementBlock("div",V4,[t.createVNode(gm,{products:l.value,"event-emitter":n.eventEmitter,"allow-edit":n.allowEdit},null,8,["products","event-emitter","allow-edit"]),t.createElementVNode("div",M4,[u[2]||(u[2]=t.createTextVNode(" ИТОГО: ",-1)),t.createElementVNode("span",I4,t.toDisplayString(c.value)+" ₽",1)]),t.createVNode(bm,{order:s.value,"onClick:clientName":u[0]||(u[0]=h=>r("click:client-name",s.value.client,h))},null,8,["order"]),t.createElementVNode("div",A4,[t.createVNode(_m,{order:s.value,"show-erp-link":""},null,8,["order"])]),t.createVNode(ym,{order:s.value},null,8,["order"])]))}}}),z4={},D4=t.defineComponent({...z4,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(n){const e=n,i=t.inject(Rr,"small"),r=t.computed(()=>V.isNil(e.orderContextButtonsConfig)?[]:V.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=I.NButton,d=I.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(t.openBlock(),t.createBlock(d,{key:0,options:r.value,size:t.unref(i),trigger:"click",onSelect:o},{default:t.withCtx(()=>[t.createVNode(c,{ghost:!0,size:t.unref(i),type:"primary"},{default:t.withCtx(()=>[t.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):t.createCommentVNode("",!0)}}}),L4={},H4=t.defineComponent({...L4,__name:"orders-list",props:t.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},highlightSettings:{default:void 0},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:t.mergeModels(["click:client-name","dblclick:row","update:pagination","update:sort"],["update:checkedRowKeys"]),setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.useModel(n,"checkedRowKeys"),a=(T,D)=>{D?s.value.includes(T)||(s.value=[...s.value,T]):s.value=s.value.filter(K=>K!==T)},l=()=>V.cloneDeep(r.sort??[{field:"id",direction:"desc"}]),c=t.ref(l()),d=t.ref([]),u=t.ref(!1),f=t.ref(700),h=()=>{const T=Ue.getDeviceTypeByResolution(),D=T===Xe.phone||T===Xe.tablet;if(!(!r.stickyHeaderOnMobile&&D))return f.value*(W.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},p=t.ref(h()),m=t.computed(()=>r.highlightSettings?r.highlightSettings:{statuses:[],markers:r.useCellIndication?[...co]:[]}),g=T=>{const D={onDblclick:()=>o("dblclick:row",T)},K=[];r.selectable&&s.value.length>0&&!s.value.includes(T.id)&&K.push("opacity-60");const J=m.value,U=new Set(Fs(T).filter(ue=>J.markers.includes(ue))),q={},le=[ct.NotInStock,ct.OnOrder,ct.LargeOrder].find(ue=>U.has(ue));if(le){const ue=Er(le);K.push("order-id-marked",le),q["--sc-order-id-bg"]=ue.backgroundColor,q["--sc-order-id-text"]=ue.textOnBackgroundColor}if(U.has(ct.NextDayDelivery)){const ue=Er(ct.NextDayDelivery);K.push("delivery-date-marked"),q["--sc-delivery-date-bg"]=ue.backgroundColor,q["--sc-delivery-date-text"]=ue.textOnBackgroundColor}return T.status.slug&&J.statuses.includes(T.status.slug)&&(K.push("order-status-highlighted",T.status.slug),V.assign(q,Gl(T.status.slug))),V.isEmpty(q)||(D.style=q),K.length>0&&(D.class=K.join(" ")),D},b=()=>{const T=[Ie.CreatedAt,Ie.Id,Ie.ClientInfo,Ie.ClientCity,Ie.DeliveryDate,Ie.PaymentType,Ie.SalesDirections,Ie.Status,...r.showAttachedUserColumn?[Ie.AttachedUser]:[],Ie.actions],D=r.fields.length>0?r.fields:T,K={title:"???",key:"undefined",render:()=>t.h("span",{},["--- unknown ---"])},J={type:"expand",expandable:V.constant(!0),renderExpand:L=>t.h(wm,{order:L,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{o("click:client-name",L.client,null)}}),width:"30"};let U=[{title:"Дата заказа",key:Ie.CreatedAt,resizable:!0,width:100,render:L=>t.h(es,{date:L.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Ie.Id,resizable:!0,width:75,className:"order-id",render:L=>t.h("a",{href:r.orderUrl.replace(":id",L.id.toString()),class:"text-base"},L.id)},{title:"Дата доставки / самовывоза",key:Ie.DeliveryDate,resizable:!0,width:120,className:"delivery-date",render:L=>t.h(es,{date:L.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Ie.ClientInfo,resizable:!0,minWidth:320,render:L=>t.h(Dr,{client:L.client,"onClick:client-name":()=>{o("click:client-name",L.client,null)}})},{title:"Тип доставки",key:Ie.DeliveryInfo,resizable:!0,minWidth:320,render:L=>t.h(xs,{delivery:L.delivery})},{title:"Клиент",key:Ie.ClientInfoShort,resizable:!0,minWidth:320,render:L=>t.h(Dr,{client:L.client,showCityAndRegion:!1,"onClick:client-name":()=>{o("click:client-name",L.client,null)}})},{title:"Город клиента",key:Ie.ClientCity,resizable:!0,minWidth:90,width:120,render:L=>{var le;return t.h("span",{class:"text-base"},((le=L.client)==null?void 0:le.city.name)??"—")}},{title:"Статус",key:Ie.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:L=>t.h("span",{class:"text-base"},[L.status.name])},{title:"Тип оплаты",key:Ie.PaymentType,resizable:!0,width:115,minWidth:95,render:L=>L.payment?t.h(xl,{payment:L.payment}):t.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Ie.SalesDirections,resizable:!0,width:80,render:L=>{var le;return t.h("span",{class:"text-base"},[((le=L.salesDirection)==null?void 0:le.name)??""])}},...r.showAttachedUserColumn?[{title:"Закреплено за",key:Ie.AttachedUser,resizable:!0,minWidth:120,render:L=>{var le;return t.h("span",{class:"text-base"},[((le=L==null?void 0:L.attachedUser)==null?void 0:le.name)??""])}}]:[]];r.orderContextButtonsConfig&&U.push({key:"actions",title:"",className:"align-top",width:50,render:L=>t.h(D4,{order:L,orderContextButtonsConfig:r.orderContextButtonsConfig,onOrderContextSelect:r.onOrderContextSelect})}),r.enableSorting&&(U=U.map(L=>[Ie.Id,Ie.CreatedAt,Ie.DeliveryDate].includes(L.key)?{...L,sorter:!0,sortOrder:!1,...L.width===void 0?{}:{width:L.width+16}}:L));const q=r.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:L=>{var ue;const le=((ue=r.isRowSelectable)==null?void 0:ue.call(r,L))??!0;return{class:le?"cursor-pointer":void 0,onClick:()=>{le&&a(L.id,!s.value.includes(L.id))}}},render:L=>{var le;return((le=r.isRowSelectable)==null?void 0:le.call(r,L))??!0?t.h(I.NCheckbox,{checked:s.value.includes(L.id)}):null}}]:[];switch(Ue.getDeviceTypeByResolution()){case Xe.phone:case Xe.tablet:return[...q,J,{key:"order",title:"Заказ",resizable:!0,render:L=>t.h(fm,{order:L,fields:D,orderUrl:r.orderUrl,highlightSettings:m.value})}];case Xe.laptop:{const L=r.showAttachedUserColumn?D:D.filter(le=>le!==Ie.AttachedUser);return[...q,J,...L.map(le=>U.find(ue=>ue.key===le)??K)]}default:return[K]}},y=t.ref(b()),_=t.ref(new W.TableDataPagination(r.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),x=t.computed(()=>({..._.value,prefix({itemCount:T}){return`Всего заказов: ${T}`}})),w=t.ref(null),C=t.ref(null),N=t.ref(null),k=t.ref(null),$=t.ref(null),v=()=>{$.value!==null&&(clearInterval($.value),$.value=null)},E=()=>{v(),r.refreshInterval&&($.value=setInterval(()=>{R()},r.refreshInterval))},P=T=>{_.value.itemCount!==T.meta.total&&(_.value.itemCount=T.meta.total),_.value.page!==T.meta.currentPage&&(_.value.page=T.meta.currentPage),_.value.pageCount!==T.meta.lastPage&&(_.value.pageCount=T.meta.lastPage),_.value.pageSize!==T.meta.perPage&&(_.value.pageSize=T.meta.perPage),d.value=T.data},F=()=>{var T,D,K;r.filters&&((T=C.value)==null||T.abort(),C.value=null,(D=N.value)==null||D.abort(),N.value=null,k.value=null,(K=w.value)==null||K.abort(),w.value=new AbortController,u.value=!0,W.HttpRequester.getInstance(W.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},w.value.signal).then(J=>{P(J),u.value=!1}).catch(J=>{if((J==null?void 0:J.name)!=="CanceledError")throw u.value=!1,J}))},R=()=>{var T;!r.filters||u.value||((T=C.value)==null||T.abort(),C.value=new AbortController,W.HttpRequester.getInstance(W.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},C.value.signal).then(D=>{d.value=d.value.map(K=>D.data.find(U=>U.id===K.id)??K),_.value.itemCount!==D.meta.total&&(_.value.itemCount=D.meta.total),_.value.pageCount!==D.meta.lastPage&&(_.value.pageCount=D.meta.lastPage)}).catch(D=>{if((D==null?void 0:D.name)!=="CanceledError")throw D}))},M=T=>T.meta.total===_.value.itemCount&&V.isEqual(V.map(T.data,"id"),V.map(d.value,"id")),X=async()=>{var D,K;if(!r.filters||u.value)return!1;(D=C.value)==null||D.abort(),C.value=null,(K=N.value)==null||K.abort(),N.value=new AbortController;let T;try{T=await W.HttpRequester.getInstance(W.OrdersDataProvider).getOrders(r.filters,c.value,{page:_.value.page,pageSize:_.value.pageSize},N.value.signal)}catch(J){if((J==null?void 0:J.name)==="CanceledError")return!1;throw J}return M(T)?(d.value=d.value.map(J=>T.data.find(U=>U.id===J.id)??J),k.value=null,!1):(k.value=T,!0)},G=()=>k.value?(P(k.value),k.value=null,!0):!1,Z=()=>{k.value=null},O=T=>{_.value.page=T,F(),o("update:pagination",_.value)},A=T=>{_.value.pageSize=T,_.value.page=1,F(),o("update:pagination",_.value)},Y=T=>{if(V.isNull(T))c.value=l();else{const[D]=c.value;D.field=T.columnKey.toString(),D.direction=T.order==="ascend"?"asc":"desc",c.value=[D]}y.value.forEach(D=>{if(Object.hasOwn(D,"sortOrder")){const K=D;K.sortOrder=K.key===(T==null?void 0:T.columnKey)&&(T!=null&&T.sorter)&&T.order!==!1?T.order:!1}}),F(),o("update:sort",c.value)},H=()=>{y.value=b(),f.value=window.innerHeight,p.value=h()};return t.watch(()=>r.filters,()=>{_.value.page=1,F(),E()}),t.watch(()=>r.sort,()=>{c.value=l(),_.value.page=1,F(),E()}),t.onMounted(()=>{H(),window.addEventListener("resize",H),t.nextTick(()=>{F(),E()})}),t.onUnmounted(()=>{var T,D,K;window.removeEventListener("resize",H),(T=w.value)==null||T.abort(),(D=C.value)==null||D.abort(),(K=N.value)==null||K.abort(),v()}),e({reload:F,checkForUpdates:X,applyPendingUpdate:G,discardPendingUpdate:Z}),(T,D)=>{const K=I.NDataTable;return t.openBlock(),t.createBlock(K,{columns:y.value,data:d.value,"row-key":J=>J.id,"row-props":g,"scroll-x":n.tableMinWidth,pagination:x.value,loading:u.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":p.value,"pagination-behavior-on-filter":"first","onUpdate:page":O,"onUpdate:pageSize":A,"onUpdate:sorter":Y},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),W4=gn(H4,[["__scopeId","data-v-aff76adb"]]),j4=t.computed(()=>W.useReferencesStore().deliveryTypeReference??[]),q4=t.computed(()=>W.useReferencesStore().managersList??[]),X4=t.computed(()=>W.useReferencesStore().opfReference??[]),Y4=t.computed(()=>W.useReferencesStore().partnerGroupsReference??[]),U4=t.computed(()=>W.useReferencesStore().priceCoefficientsReference??[]),K4=t.computed(()=>W.useReferencesStore().productFilesTypesReference??[]),G4=t.computed(()=>W.useReferencesStore().resourceTypesReference),Z4=t.computed(()=>W.useReferencesStore().salesDirectionsReference??[]),Q4=t.computed(()=>W.useReferencesStore().warehousesReference??[]),J4=t.computed(()=>W.useReferencesStore().paymentTypeReference??[]),xm=t.computed(()=>W.useReferencesStore().orderStatusReference??[]),eN=t.computed(()=>W.useReferencesStore().orderStatusDetailReference??[]),tN=t.computed(()=>W.useReferencesStore().operatorReference??[]),nN=t.computed(()=>wt.convertReferencesToSelectOptionsList(W.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),iN=t.computed(()=>wt.convertReferencesToSelectOptionsList(W.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),rN=n=>W.HttpRequester.getInstance(W.ReferenceDataProvider).searchCity(n),oN=n=>wt.convertReferencesToSelectOptionsList(n,!0,!1,!1,e=>{var i,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(i=e==null?void 0:e.region)==null?void 0:i.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()),sN=async n=>V.map(await W.HttpRequester.getInstance(W.ReferenceDataProvider).searchRegion(n),e=>new W.Region(e)),aN=n=>wt.convertReferencesToSelectOptionsList(n,!0,!1,!1,e=>e.isNewRec()?"-":V.join(V.compact([e.name,e.country.name]),", "),e=>e.isNewRec()),lN=n=>W.HttpRequester.getInstance(W.ClientDataProvider).searchClient(n),cN=n=>wt.convertReferencesToSelectOptionsList(n,!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()),dN={class:"flex flex-col gap-4"},uN={class:"flex flex-wrap gap-2"},fN={class:"flex flex-col gap-1.5"},hN={class:"inline-flex items-center gap-2"},mN={class:"flex flex-col gap-1.5"},pN={class:"inline-flex items-center gap-2"},gN={},yN=t.defineComponent({...gN,__name:"order-highlight-settings",props:{settings:{},statuses:{default:void 0}},emits:["update:settings"],setup(n,{emit:e}){const i=n,r=e,o=t.computed(()=>i.statuses??xm.value),s=d=>!!d&&i.settings.statuses.includes(d),a=(d,u)=>{if(!d)return;const f=i.settings.statuses.filter(h=>h!==d);r("update:settings",{...i.settings,statuses:u?[...f,d]:f})},l=(d,u)=>{const f=i.settings.markers.filter(h=>h!==d);r("update:settings",{...i.settings,markers:u?[...f,d]:f})},c=d=>{r("update:settings",{statuses:d?o.value.flatMap(u=>u.slug?[u.slug]:[]):[],markers:d?[...co]:[]})};return(d,u)=>{const f=I.NButton,h=I.NCheckbox;return t.openBlock(),t.createElementBlock("div",dN,[t.createElementVNode("div",uN,[t.createVNode(f,{size:"small",onClick:u[0]||(u[0]=p=>c(!0))},{default:t.withCtx(()=>[...u[2]||(u[2]=[t.createTextVNode(" Выделять всё ",-1)])]),_:1}),t.createVNode(f,{size:"small",onClick:u[1]||(u[1]=p=>c(!1))},{default:t.withCtx(()=>[...u[3]||(u[3]=[t.createTextVNode(" Снять всё ",-1)])]),_:1})]),t.createElementVNode("div",fN,[u[4]||(u[4]=t.createElementVNode("div",{class:"text-sm font-semibold"},"Статусы",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.value,p=>(t.openBlock(),t.createBlock(h,{key:p.id,checked:s(p.slug),"onUpdate:checked":m=>a(p.slug,m)},{default:t.withCtx(()=>[t.createElementVNode("span",hN,[t.createVNode(kl,{colors:t.unref(ki)(p.slug)},null,8,["colors"]),t.createTextVNode(" "+t.toDisplayString(p.name),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))]),t.createElementVNode("div",mN,[u[5]||(u[5]=t.createElementVNode("div",{class:"text-sm font-semibold"},"Маркеры",-1)),(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(co),p=>(t.openBlock(),t.createBlock(h,{key:p,checked:n.settings.markers.includes(p),"onUpdate:checked":m=>l(p,m)},{default:t.withCtx(()=>[t.createElementVNode("span",pN,[t.createVNode(kl,{colors:t.unref(Er)(p)},null,8,["colors"]),t.createTextVNode(" "+t.toDisplayString(t.unref(Ps)(p)),1)])]),_:2},1032,["checked","onUpdate:checked"]))),128))])])}}}),bN=["href"],_N={class:"text-sc-dark-grey"},wN={},xN=t.defineComponent({...wN,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(n,{emit:e}){const i=n,r=e,o=t.computed(()=>Be.format(i.order.createdAt,W.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{V.isNil(i.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",i.order,a)};return(a,l)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("span",null,[l[1]||(l[1]=t.createTextVNode(" #",-1)),t.createElementVNode("a",{href:n.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},t.toDisplayString(n.order.id),9,bN),t.createTextVNode(" от "+t.toDisplayString(o.value),1)]),l[2]||(l[2]=t.createTextVNode(", ",-1)),t.createElementVNode("span",_N,"автор: "+t.toDisplayString(n.order.creator.name)+" ["+t.toDisplayString(n.order.creator.type)+"]",1)],64))}}),kN={class:"sc-page flex flex-col bg-inherit"},CN={class:"my-2 flex flex-row items-end"},vN={class:"sc-title grow"},SN={key:0,class:"sc-title-buttons flex-1 grow-0"},BN={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},NN={key:0,class:"sc-title-extra mt-2 sm:mt-4"},TN={},km=t.defineComponent({...TN,__name:"page",props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(n){const e=n,i=t.computed(()=>e.stickyHeaderOnMobile?"sticky z-10 bg-inherit":"lg:sticky z-10 bg-inherit");return(r,o)=>{const s=I.NH1;return t.openBlock(),t.createElementBlock("div",kN,[t.createElementVNode("div",{class:t.normalizeClass(n.stickyHeader?i.value:void 0),style:t.normalizeStyle(n.stickyHeader?{top:`${n.stickyTopOffset??0}px`}:void 0)},[t.createElementVNode("div",CN,[t.createElementVNode("div",vN,[t.renderSlot(r.$slots,"title",{},()=>[t.createVNode(s,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.title??""),1)]),_:1})])]),r.$slots["title-buttons"]?(t.openBlock(),t.createElementBlock("div",SN,[t.createElementVNode("div",BN,[t.renderSlot(r.$slots,"title-buttons")])])):t.createCommentVNode("",!0)]),r.$slots["title-extra"]?(t.openBlock(),t.createElementBlock("div",NN,[t.renderSlot(r.$slots,"title-extra")])):t.createCommentVNode("",!0),t.renderSlot(r.$slots,"sticky-extra")],6),t.renderSlot(r.$slots,"default")])}}}),$N={class:"overflow-hidden transition-all duration-300"},EN={class:"text-lg font-medium leading-none"},RN={},Cm=t.defineComponent({...RN,__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(n,{emit:e}){const i=n,r=e,o=t.ref(0),s=t.ref(i.showDrawer),a=()=>{switch(Ue.getDeviceTypeByResolution()){case Xe.phone:return window.innerWidth*.8;case Xe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?V.isUndefined(i.drawerWidth)?o.value=a():o.value=V.isFunction(i.drawerWidth)?i.drawerWidth():i.drawerWidth:o.value=0};return t.watch(()=>i.drawerWidth,()=>{l()}),t.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),t.watch(()=>i.showDrawer,c=>{s.value=c}),t.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=I.NDrawerContent,f=I.NDrawer;return t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",$N,[t.createElementVNode("div",{style:t.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[t.renderSlot(c.$slots,"default")],4)]),t.createVNode(f,{show:s.value,"onUpdate:show":d[0]||(d[0]=h=>s.value=h),resizable:!0,width:o.value,placement:"left"},{default:t.withCtx(()=>[t.createVNode(u,{closable:""},{header:t.withCtx(()=>[t.renderSlot(c.$slots,"drawer-header",{},()=>[t.createElementVNode("div",EN,t.toDisplayString(n.title),1)])]),default:t.withCtx(()=>[t.renderSlot(c.$slots,"drawer-content")]),footer:t.withCtx(()=>[t.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),PN={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},FN={key:0},VN={class:"sc-page-preview-panel grow"},MN={key:1,class:"sc-page-preview-panel-extra flex-none"},IN={},AN=t.defineComponent({...IN,__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(n,{expose:e}){const i=t.ref(!1),r=()=>{i.value=!0},o=()=>{i.value=!1},s=t.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&t.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=I.NButton;return t.openBlock(),t.createBlock(km,{title:n.title,"sticky-header":n.stickyHeader,"sticky-top-offset":n.stickyTopOffset,"sticky-header-on-mobile":n.stickyHeaderOnMobile},t.createSlots({default:t.withCtx(()=>[t.createVNode(Cm,{"show-drawer":i.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>i.value=u),title:n.panelTitle},t.createSlots({"drawer-content":t.withCtx(()=>[t.renderSlot(l.$slots,"panel-content")]),default:t.withCtx(()=>[t.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:t.withCtx(()=>[t.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||n.isShowPanelButtonVisible?{name:"sticky-extra",fn:t.withCtx(()=>[t.createElementVNode("div",PN,[n.isShowPanelButtonVisible?(t.openBlock(),t.createElementBlock("div",FN,[t.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{i.value=!0}},()=>[t.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>i.value=!0)},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(n.showPanelButtonText),1)]),_:1})])])):t.createCommentVNode("",!0),t.createElementVNode("div",VN,[t.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(t.openBlock(),t.createElementBlock("div",MN,[t.renderSlot(l.$slots,"preview-panel-extra")])):t.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),ON={},zN=t.defineComponent({...ON,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=t.computed(()=>{var m;return V.isArray(r.value)?r.value.map(g=>g.id):((m=r.value)==null?void 0:m.id)??null}),l=t.computed(()=>{const m=new W.Curator({id:-1,name:"",contacts:{},curatedDirection:new W.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),g=r.showEmptyValue?[m]:[];return r.managerReferenceList.filter(b=>{var y;return(((y=b==null?void 0:b.curatedDirections)==null?void 0:y.length)??0)>0}).forEach(b=>{((b==null?void 0:b.curatedDirections)??[]).forEach(y=>{g.push(new W.Curator({id:b.id,guid:b.guid,name:b.name,photo:b.photo,contacts:b.contacts??{},curatedDirection:y}))})}),g}),c=t.computed(()=>wt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,m=>{const g=V.some(s.value?r.value:[r.value],["id",m.id])?` (${m.curatedDirection.name}) `:"";return m.curatedDirection.isNewRec()?m.name:`${m.name}${g}`})),d=t.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=t.useTemplateRef("select-component"),f=m=>{if(V.isArray(m)){const g=m.length>0?m.map(b=>l.value.find(y=>y.id===b)).filter(b=>!V.isNil(b)):[];o("update:value",g)}else{const g=m>0?l.value.find(b=>b.id===m):null;o("update:value",g??null)}};return t.watch(()=>r.value,()=>{var m,g;(g=(m=u.value)==null?void 0:m.$forceUpdate)==null||g.call(m)},{deep:!0}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,g)=>(t.openBlock(),t.createBlock(t.unref(I.NSelect),{ref:"select-component",value:a.value,clearable:n.clearable,disabled:c.value.length===0,"consistent-menu-width":n.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),DN={},LN=t.defineComponent({...DN,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=t.computed(()=>{var y;return V.isArray(r.value)?r.value.filter(_=>!V.isNil(_)).map(_=>_.id):((y=r.value)==null?void 0:y.id)??null}),l=t.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=t.computed(()=>{var w;const y=[];r.operatorReferenceList.length>0&&y.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=V.isArray(r.value)?r.value.map(N=>N.id):[(w=r.value)==null?void 0:w.id];_=_.filter(N=>N.isActive||C.includes(N.id))}const x=wt.convertReferencesToSelectOptionsList(_,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,C=>`${C.name}${C.isActive?"":" [Не активен]"}`);return y.length>0&&x.length>0&&y.push({key:"manager-operator-divider",disabled:!0,render:()=>t.h("div",{class:"sc-manager-operator-select__divider"})}),y.push(...x),y}),d=y=>`${y.name}${"isActive"in y&&!y.isActive?" [Не активен]":""}`,u=t.computed(()=>{var N;const y=V.isArray(r.value)?r.value.map(k=>k.id):[(N=r.value)==null?void 0:N.id],_=k=>r.showActualOnly?k.filter($=>!("isActive"in $)||$.isActive||y.includes($.id)):k,x=[],w=_(r.managerReferenceList);w.length>0&&x.push({type:"group",label:"Менеджеры",key:"managers",children:wt.convertReferencesToSelectOptionsList(w,!0,!1,!1,d)});const C=_(r.operatorReferenceList);return C.length>0&&x.push({type:"group",label:"Операторы",key:"operators",children:wt.convertReferencesToSelectOptionsList(C,!0,!1,!1,d)}),x}),f=t.computed(()=>r.groupByEmployeeType?u.value:c.value),h=t.computed(()=>f.value.map(y=>({...y,class:r.wrapContent?`${y.class??""} consistent-menu-width`:y.class}))),p=t.useTemplateRef("select-component"),m=y=>{if(V.isArray(y)){const _=y.map(x=>l.value.find(w=>w.id===x)).filter(x=>!V.isNil(x));o("update:value",_)}else{const _=V.isNil(y)?null:l.value.find(x=>x.id===y)??null;o("update:value",_)}};return t.watch(()=>r.value,()=>{var y,_;(_=(y=p.value)==null?void 0:y.$forceUpdate)==null||_.call(y)},{deep:!0}),e({focus:()=>{var y;return(y=p.value)==null?void 0:y.focusInput()},blur:()=>{var y;return(y=p.value)==null?void 0:y.blurInput()}}),(y,_)=>(t.openBlock(),t.createBlock(t.unref(I.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:n.clearable,"consistent-menu-width":n.consistentMenuWidth,disabled:n.disabled||f.value.length===0,filterable:n.filterable,"max-tag-count":n.maxTagCount,multiple:s.value,options:h.value,placeholder:"",class:"w-full","onUpdate:value":m},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),HN={},WN=t.defineComponent({...HN,__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(n,{expose:e,emit:i}){const r=n,o=i,s=t.computed(()=>V.isArray(r.value)),a=t.computed(()=>{var m;return V.isArray(r.value)?r.value.map(g=>g.id):((m=r.value)==null?void 0:m.id)??null}),l=t.computed(()=>r.showEmptyValue?[W.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=t.computed(()=>{var b;let m=l.value,g=r.disabledManagerReferenceList.map(y=>y.id);if(r.showActualOnly){const y=V.isArray(r.value)?r.value.map(_=>_.id):[(b=r.value)==null?void 0:b.id];g=V.union(g,l.value.filter(_=>!_.isActive).map(_=>_.id)),m=m.filter(_=>(r.showEmptyValue?W.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||y.includes(_.id))}return wt.convertReferencesToSelectOptionsList(m,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,y=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&V.some(s.value?r.value:[r.value],["id",y.id])?` (${y.salesDirection.name}) `:"";return y.salesDirection.isNewRec()?y.name:`${y.name}${_}${y.isActive?"":" [Не активен]"}`},y=>g.includes(y.id)&&y.isActive)}),d=t.computed(()=>c.value.map(m=>({...m,class:r.wrapContent?`${m.class} consistent-menu-width`:m.class}))),u=t.useTemplateRef("select-component"),f=m=>{if(V.isArray(m)){const g=m.length>0?m.filter(b=>!V.some(r.disabledManagerReferenceList,["id",b])).map(b=>l.value.find(y=>y.id===b)).filter(b=>!V.isNil(b)):[];o("update:value",g)}else{const g=m>0&&!V.some(r.disabledManagerReferenceList,["id",m])?l.value.find(b=>b.id===m):new W.Manager;o("update:value",g??new W.Manager)}};return t.watch(()=>r.value,()=>{var m,g;(g=(m=u.value)==null?void 0:m.$forceUpdate)==null||g.call(m)},{deep:!0}),t.watch(()=>r.disabledManagerReferenceList,m=>{if(m.length>0&&r.value)if(s.value){const g=r.value;V.some(g,b=>V.some(m,["id",b.id]))&&o("update:value",g.filter(b=>!V.some(m,["id",b.id])))}else{const g=r.value;V.some(m,["id",g.id])&&o("update:value",new W.Manager)}}),e({focus:()=>{var m;return(m=u.value)==null?void 0:m.focusInput()},blur:()=>{var m;return(m=u.value)==null?void 0:m.blurInput()}}),(m,g)=>(t.openBlock(),t.createBlock(t.unref(I.NSelect),{ref:"select-component",value:a.value,clearable:n.clearable,disabled:c.value.length===0,"consistent-menu-width":n.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":f},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),jN={class:"m-0.5 flex flex-col p-0.5"},qN={class:"flex flex-row gap-1"},XN={key:0},YN={key:1},UN={key:2},KN={key:3},GN={class:"flex flex-row gap-1"},ZN={key:0},QN={key:1},JN={key:2},eT={key:3},tT={},vm=t.defineComponent({...tT,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",jN,[t.createElementVNode("span",qN,[n.addr.postIndex?(t.openBlock(),t.createElementBlock("span",XN,t.toDisplayString(n.addr.postIndex)+", ",1)):t.createCommentVNode("",!0),n.addr.city?(t.openBlock(),t.createElementBlock("span",YN,t.toDisplayString(n.addr.city)+", ",1)):t.createCommentVNode("",!0),n.addr.locality?(t.openBlock(),t.createElementBlock("span",UN,t.toDisplayString(n.addr.locality)+", ",1)):t.createCommentVNode("",!0),n.addr.region?(t.openBlock(),t.createElementBlock("span",KN,t.toDisplayString(n.addr.region)+", ",1)):t.createCommentVNode("",!0)]),t.createElementVNode("span",GN,[n.addr.street?(t.openBlock(),t.createElementBlock("span",ZN,t.toDisplayString(n.addr.street)+", ",1)):t.createCommentVNode("",!0),n.addr.building?(t.openBlock(),t.createElementBlock("span",QN,t.toDisplayString(n.addr.building)+", ",1)):t.createCommentVNode("",!0),n.addr.buildingPart?(t.openBlock(),t.createElementBlock("span",JN,t.toDisplayString(n.addr.buildingPart)+", ",1)):t.createCommentVNode("",!0),n.addr.apartments?(t.openBlock(),t.createElementBlock("span",eT,t.toDisplayString(n.addr.apartments)+", ",1)):t.createCommentVNode("",!0)])]))}}),vl={clearable:!1,value:"",field:void 0,disabled:!1},nT={},iT=t.defineComponent({...nT,__name:"address-suggestion",props:t.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},searchDataHandler:{type:Function}},{...vl,minTermLength:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0,wrapContent:!0}),emits:["select","update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.ref(r.value),a=t.ref(!1),l=t.ref([]),c=t.computed(()=>l.value.map(g=>({label:g[r.field??"addressString"]??"-",value:g.id})));t.watch(()=>r.value,g=>{s.value=g}),t.watch(s,()=>{o("update:value",s.value)});const d=V.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):W.HttpRequester.getInstance(W.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},f=(g,b)=>{const y=l.value.find(_=>_.id===g.value)||{};return t.h(vm,{addr:y,selected:b},{default:V.constant("-")})},h=g=>{d.cancel();const b=l.value.find(y=>y.id===g)||{};o("select",b)},p=t.ref(null);function m(){p.value.focus()}return e({focus:m}),(g,b)=>{const y=I.NAutoComplete;return t.openBlock(),t.createBlock(y,{ref_key:"autoCompleteElement",ref:p,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),t.unref(d)],class:t.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:n.clearable,disabled:n.disabled,loading:a.value,options:c.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:h},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),rT={class:"m-0.5 flex flex-col p-0.5"},oT={class:"font-medium"},sT={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},aT={key:0},lT={key:1},cT={},Sm=t.defineComponent({...cT,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(n){return(e,i)=>(t.openBlock(),t.createElementBlock("div",rT,[t.createElementVNode("span",oT,t.toDisplayString(n.bank.name),1),t.createElementVNode("span",sT,[n.bank.bic?(t.openBlock(),t.createElementBlock("span",aT," БИК: "+t.toDisplayString(n.bank.bic),1)):t.createCommentVNode("",!0),n.bank.inn?(t.openBlock(),t.createElementBlock("span",lT," ИНН: "+t.toDisplayString(n.bank.inn),1)):t.createCommentVNode("",!0)])]))}}),dT={},uT=t.defineComponent({...dT,__name:"bank-suggestion",props:t.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean}},{...vl,minTermLength:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3},wrapContent:!0}),emits:["select","update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.ref(r.value),a=t.ref(!1),l=t.ref([]),c=t.computed(()=>l.value.map(g=>({label:g[r.field??"_"]??"-",value:g.id})));t.watch(()=>r.value,g=>{s.value=g}),t.watch(s,()=>{o("update:value",s.value)});const d=V.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await W.HttpRequester.getInstance(W.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},f=(g,b)=>{const y=l.value.find(_=>_.id===g.value)||{};return t.h(Sm,{bank:y,selected:b},{default:V.constant("-")})},h=g=>{d.cancel();const b=l.value.find(y=>y.id===g)||{};o("select",b)},p=t.ref(null);function m(){p.value.focus()}return e({focus:m}),(g,b)=>{const y=I.NAutoComplete;return t.openBlock(),t.createBlock(y,{ref_key:"autoCompleteElement",ref:p,value:s.value,"onUpdate:value":[b[0]||(b[0]=_=>s.value=_),t.unref(d)],class:t.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:n.clearable,disabled:n.disabled,loading:a.value,options:c.value,"render-label":f,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:h},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}}),fT={class:"font-medium"},hT={key:0,class:"flex flex-row gap-2"},mT={key:0,class:"text-xs font-light text-blue-800"},pT={key:1,class:"text-sc-dark-grey text-xs font-light"},gT={},Bm=t.defineComponent({...gT,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(n){const e=n,i=t.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=t.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(`m-0.5 flex flex-col p-0.5 ${i.value?"line-through":""}`)},[t.createElementVNode("span",fT,t.toDisplayString(n.org.name),1),n.org.inn||r.value?(t.openBlock(),t.createElementBlock("div",hT,[n.org.inn?(t.openBlock(),t.createElementBlock("span",mT,t.toDisplayString(n.org.inn),1)):t.createCommentVNode("",!0),r.value?(t.openBlock(),t.createElementBlock("span",pT,t.toDisplayString(r.value),1)):t.createCommentVNode("",!0)])):t.createCommentVNode("",!0)],2))}}),yT={},bT=t.defineComponent({...yT,__name:"org-suggestion",props:t.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},allowSelectTerminated:{type:Boolean}},{...vl,minTermLength:()=>{var n,e;return((e=(n=W.useBaseConfigStateStore().getConfig())==null?void 0:n.minLength)==null?void 0:e.searchTerm)??3},wrapContent:!0}),emits:["select","update:value"],setup(n,{expose:e,emit:i}){const r=n,o=i,s=t.ref(r.value),a=t.ref(!1),l=t.ref([]),c=b=>{var y,_;return!!(((_=(y=b.rawData)==null?void 0:y.state)==null?void 0:_.liquidationDate)??!1)},d=t.computed(()=>wt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,b=>b[r.field??"_"]??"-",b=>!r.allowSelectTerminated&&c(b)));t.watch(()=>r.value,b=>{s.value=b}),t.watch(s,()=>{o("update:value",s.value)});const u=V.debounce(()=>f(),800),f=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await W.HttpRequester.getInstance(W.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},h=(b,y)=>{const _=l.value.find(x=>x.id===b.value)||{};return t.h(Bm,{org:_,selected:y},{default:V.constant("-")})},p=b=>{u.cancel();const y=l.value.find(_=>_.id===b)||{};(r.allowSelectTerminated||!c(y))&&o("select",y)},m=t.ref(null);function g(){m.value.focus()}return e({focus:g}),(b,y)=>{const _=I.NAutoComplete;return t.openBlock(),t.createBlock(_,{ref_key:"autoCompleteElement",ref:m,value:s.value,"onUpdate:value":[y[0]||(y[0]=x=>s.value=x),t.unref(u)],class:t.normalizeClass(r.wrapContent?"consistent-menu-width":void 0),clearable:n.clearable,disabled:n.disabled,loading:a.value,options:d.value,"render-label":h,to:r.wrapContent?!1:void 0,placeholder:"",onSelect:p},null,8,["value","class","clearable","disabled","loading","options","to","onUpdate:value"])}}});j.ALL_ORDER_MARKERS=co,j.CATEGORY_REQUIRED_HINT=$s,j.CommonValidators=Wm,j.ConfiguratorSettingsKozyrek=Vu,j.ConfiguratorSettingsMosquito=Px,j.ContentHelper=Ci,j.CurrencyHelper=ir,j.DEFAULT_ORDER_STATUS_COLORS=Es,j.DateValidators=jm,j.EntityNameHelper=li,j.FileHelper=Hm,j.KozyrekLine=Vn,j.KozyrekTailTemplate=Ma,j.KozyrekTemplate=yr,j.M2PriceHelper=vi,j.MODE_DISABLED_HINT=Nr,j.NumberHelper=Ve,j.NumericValidators=ce,j.ORDER_MARKER_COLORS=Rs,j.ORDER_MARKER_NAMES=Zl,j.ORDER_STATUS_COLORS=Ul,j.OrderMarkerEnum=ct,j.OrdersTableFields=Ie,j.PRODUCT_REQUIRED_HINT=Ts,j.Point=Va,j.ScAddProductToCartDialog=Sw,j.ScAddressSuggestion=iT,j.ScAddressSuggestionLabel=vm,j.ScBankSuggestion=uT,j.ScBankSuggestionLabel=Sm,j.ScBaseDialog=Os,j.ScButtonWithConfirmAction=Xm,j.ScCategoryCollapse=ef,j.ScChipGroup=Km,j.ScClientNameWithShortInfo=Dr,j.ScCollapse=Ju,j.ScCollapseItem=rc,j.ScCommentEditor=W2,j.ScCompactCardList=xC,j.ScConfiguratorsProductInfo=Fr,j.ScContragentWithShortInfo=nf,j.ScCreatorUserTypeTag=ks,j.ScCuratorSelect=zN,j.ScDateRange=y2,j.ScDateTimeLabel=es,j.ScDebouncedInput=tC,j.ScDebouncedInputNumber=iC,j.ScDebt=x2,j.ScDialogHeader=N2,j.ScDynamicConfigurator=Gu,j.ScEmail=Lw,j.ScExternalLink=yC,j.ScImageGallery=cc,j.ScInlineEditableItem=kf,j.ScInlineView=Oa,j.ScKozyrekConfigurator=Mu,j.ScKozyrekConfiguratorParamsForm=hc,j.ScKozyrekConfiguratorPreview=Fu,j.ScKozyrekConfiguratorTemplates=Pu,j.ScKpiGrid=dC,j.ScLightGallery=lc,j.ScManagerOperatorSelect=LN,j.ScManagerSelect=WN,j.ScMetalForDoorsConfigurator=ju,j.ScMetalForDoorsConfiguratorForm=Wu,j.ScMosquitoConfigurator=Ou,j.ScMosquitoConfiguratorForm=Iu,j.ScMosquitoConfiguratorMeasurementInstructions=Au,j.ScMosquitoConfiguratorPreview=Ia,j.ScOrderColorSwatch=kl,j.ScOrderCommonInfo=fm,j.ScOrderDeliveryLabel=xs,j.ScOrderDetails=bm,j.ScOrderExternalLinks=_m,j.ScOrderHighlightSettings=yN,j.ScOrderInfo=wm,j.ScOrderItemParams=wl,j.ScOrderItemsList=gm,j.ScOrderPayment=xl,j.ScOrderProductInfo=mm,j.ScOrderStatusHistory=ym,j.ScOrderStatusTag=pm,j.ScOrdersList=W4,j.ScOrgSuggestion=bT,j.ScOrgSuggestionLabel=Bm,j.ScPage=km,j.ScPageWithSlidingPanel=AN,j.ScPersonContactsBlock=Rx,j.ScPhone=ux,j.ScPhoneInput=sC,j.ScProductInfoContent=As,j.ScProductInfoDialog=dc,j.ScProductInfoPopover=uc,j.ScProductName=go,j.ScProductsList=K5,j.ScReferenceSelect=tf,j.ScSandwichConfigurator=Yu,j.ScSandwichConfiguratorForm=Xu,j.ScSandwichM2Configurator=Ku,j.ScSandwichM2ConfiguratorForm=Uu,j.ScSearchableProductSelect=um,j.ScSearchableReferenceSelect=dm,j.ScSetClientPriceFormItem=xw,j.ScShortTextOrderInfo=xN,j.ScSingleFileUploadSelector=U2,j.ScSlidingContentWithDrawer=Cm,j.ScStripConfigurator=Hu,j.ScStripConfiguratorForm=Du,j.ScStripConfiguratorLineItem=zu,j.ScStripConfiguratorPreview=Lu,j.ScUserShortInfo=Cl,j.ScWarningIcon=J2,j.SelectOptionHelper=wt,j.UiNotificationProvider=Tr,j.Validators=We,j.WindowResolutionEnum=Xe,j.WindowResolutionProvider=Ue,j.channelPrimaryInterestOptionsList=nN,j.componentSizeInjectionKey=Rr,j.copyToClipboard=jl,j.deliveryTypeReferenceList=j4,j.getOrderMarkerColors=Er,j.getOrderMarkerName=Ps,j.getOrderMarkers=Fs,j.getOrderStatusColors=ki,j.getOrderStatusCssVariables=Gl,j.getOrderStatusTagColor=Kl,j.getProductInfoFiles=Vs,j.handleFloatInput=fo,j.handleIntegerInput=ft,j.hasProductInfo=ec,j.isCanSandwichM2Show=Fx,j.isCanSandwichShow=Qu,j.isConfiguratorType=Zu,j.managersReferenceList=q4,j.naiveUiTheme=Mp,j.operatorReferenceList=tN,j.opfReferenceList=X4,j.orderStatusDetailReferenceList=eN,j.orderStatusReferenceList=xm,j.paginationItemsPrefix=Jl,j.parse=ht,j.partnerGroupReferenceList=Y4,j.paymentTypeReferenceList=J4,j.priceCoefficientsReferenceList=U4,j.productFilesTypesReferenceList=K4,j.renderConfig=Ke,j.resetInputValidation=dt,j.resourceReferencesList=G4,j.salesDirectionsReferenceList=Z4,j.searchCityReferenceDataHandler=rN,j.searchCityReferenceLabelRenderer=oN,j.searchClientReferenceDataHandler=lN,j.searchClientReferenceLabelRenderer=cN,j.searchRegionReferenceDataHandler=sN,j.searchRegionReferenceLabelRenderer=aN,j.selectAllTextOnFocus=He,j.showAppVersion=Lm,j.sourcePrimaryInterestOptionsList=iN,j.useCompactLayout=Om,j.useHoverSupport=uo,j.vCopy=ql,j.vFocusNext=ai,j.warehousesReferenceList=Q4,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}));
|