@snabcentr/vue-ui-lib 4.16.2 → 4.16.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(X,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("vue"),require("date-fns"),require("naive-ui"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","@snabcentr/common-lib","lodash-es","vue","date-fns","naive-ui","libphonenumber-js","ts-case-convert","vue-tel-input"],j):(X=typeof globalThis<"u"?globalThis:X||self,j(X.SC_VueUiLib={},X["@snabcentr/common-lib"],X["lodash-es"],X.Vue,X["date-fns"],X["naive-ui"],X["libphonenumber-js"],X["ts-case-convert"],X["vue-tel-input"]))})(this,(function(X,j,A,i,en,O,ar,Yo,lf){"use strict";var JB=Object.defineProperty;var rf=X=>{throw TypeError(X)};var e5=(X,j,A)=>j in X?JB(X,j,{enumerable:!0,configurable:!0,writable:!0,value:A}):X[j]=A;var S=(X,j,A)=>e5(X,typeof j!="symbol"?j+"":j,A),of=(X,j,A)=>j.has(X)||rf("Cannot "+A);var Vt=(X,j,A)=>(of(X,j,"read from private field"),A?A.call(X):j.get(X)),Ka=(X,j,A)=>j.has(X)?rf("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(X):j.set(X,A),sf=(X,j,A,i)=>(of(X,j,"write to private field"),i?i.call(X,A):j.set(X,A),A);var Ni,mt,Wo;const vt=class vt{static init(e,n){vt.messagesService&&vt.notificationsService||(vt.messagesService=e,vt.notificationsService=n)}static getMessagesService(){if(!vt.messagesService)throw new Error("UI provider is not initialized.");return vt.messagesService}static getNotificationsService(){if(!vt.notificationsService)throw new Error("UI provider is not initialized.");return vt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,o;if(A.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";vt.notificationsService?vt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const s in e.errors)Object.prototype.hasOwnProperty.call(n,s)?n[s]=new j.FieldValidationResultData(e.errors[s].toString(),"error"):vt.messagesService?vt.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};S(vt,"messagesService"),S(vt,"notificationsService");let lr=vt;const cr=new WeakMap,cf=async t=>{const e=navigator.clipboard;if(e!=null&&e.writeText){await e.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select();const r=document.execCommand("copy");if(n.remove(),!r)throw new Error("Не удалось скопировать через execCommand.")},Za=async t=>{const e=A.isNil(t)?"":String(t);if(e)try{await cf(e),lr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{lr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},df=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),uf=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":df(t)?"click":"dblclick",Qa={mounted(t,e){t.style.setProperty("cursor","pointer");const n=uf(t,e),r=o=>{var a;n==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=cr.get(t);Za(s==null?void 0:s.value).catch(A.noop)};cr.set(t,{value:e.value,eventName:n,handler:r}),t.addEventListener(n,r)},updated(t,e){const n=cr.get(t);n&&(n.value=e.value)},beforeUnmount(t){const e=cr.get(t);e&&(t.removeEventListener(e.eventName,e.handler),cr.delete(t))}},hf=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),ff=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",Hr=new WeakMap,Ja=t=>!hf.has(t.type)&&!t.disabled&&!t.readOnly&&t.closest(ff)===null&&t.getClientRects().length>0,el=t=>{var a;if(t.key!=="Enter"&&t.code!=="Enter"||t.shiftKey||t.isComposing)return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||!Ja(e))return;t.preventDefault();const n=t.currentTarget,r=[...n.querySelectorAll("input")].filter(l=>Ja(l)),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);if(s){s.focus(),s.select();return}(a=Hr.get(n))==null||a()},Wn={mounted(t,e){Hr.set(t,e.value),t.addEventListener("keydown",el)},updated(t,e){Hr.set(t,e.value)},unmounted(t){t.removeEventListener("keydown",el),Hr.delete(t)}};var Pe=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.ClientInfoShort="client_info_short",t.CreatedAt="created_at",t.ClientCity="client_city",t.DeliveryInfo="delivery_info",t.DeliveryDate="delivery_date",t.Id="id",t.PaymentType="payment_type",t.SalesDirections="sales_directions",t.Status="status",t.actions="actions",t))(Pe||{}),qe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(qe||{});class ci{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&A.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ci.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ci.isVnodeEmpty(e()):!1}}class jn{static isDeleted(e){return!!(e.deletedAt&&!en.isFuture(e.deletedAt))}static getFormatEntityName(e){return jn.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const tt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},Wr=(t,e=".",n=!1)=>{const{key:r}=t,o=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!o.value.includes("-")&&((o.selectionStart??0)===0||o.value.length===0)||(r===e||r===(e==="."?",":"."))&&!o.value.includes(e)&&!o.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},it=t=>t?Number.parseFloat(t.replace(",",".")):null,et=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Bt{static convertReferencesToOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):jn.getFormatEntityName(c),value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...l]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(A.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=A.isString(r.key)?A.get(d,r.key):r.key(c),h=A.isString(r.label)?A.get(d,r.label):r.label(c);return{type:"group",label:A.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Bt.convertReferencesToOptionsList(e,n,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Bt.convertReferencesToOptionsList(e,n,r,o,s,a)}}const mf={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},gf={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},He={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},pf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yf(t,e){return i.openBlock(),i.createElementBlock("svg",pf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Uo=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:yf}),bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _f(t,e){return i.openBlock(),i.createElementBlock("svg",bf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const tl=i.markRaw({name:"tabler-edit",render:_f}),wf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xf(t,e){return i.openBlock(),i.createElementBlock("svg",wf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const nl=i.markRaw({name:"ion-checkmark-done-circle",render:xf}),kf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function vf(t,e){return i.openBlock(),i.createElementBlock("svg",kf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const il=i.markRaw({name:"ion-checkmark-done-circle-outline",render:vf}),Cf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Sf(t,e){return i.openBlock(),i.createElementBlock("svg",Cf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 Bf=i.markRaw({name:"fluent-pin32-regular",render:Sf}),Tf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Nf(t,e){return i.openBlock(),i.createElementBlock("svg",Tf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const $f=i.markRaw({name:"ion-eye-outline",render:Nf}),Rf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Ef(t,e){return i.openBlock(),i.createElementBlock("svg",Rf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 Pf=i.markRaw({name:"fluent-pin32-filled",render:Ef}),Ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vf(t,e){return i.openBlock(),i.createElementBlock("svg",Ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 If=i.markRaw({name:"ion-bookmark-outline",render:Vf}),Mf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Mf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const Of=i.markRaw({name:"ion-eye-off-sharp",render:Af}),zf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Df(t,e){return i.openBlock(),i.createElementBlock("svg",zf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const Lf=i.markRaw({name:"ion-chevron-forward-outline",render:Df}),Hf=["data-name"],Wf={class:"sc-collapse-item-header flex flex-row gap-2.5"},jf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},qf={key:0},Xf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Yf={class:"flex flex-1 flex-col"},Uf={key:0,class:"sc-collapse-item-sub-title flex-1"},Kf={key:1,class:"sc-collapse-item-title-extra flex-none"},Gf={key:0,class:"sc-collapse-item-content"},Zf={},Qf=i.defineComponent({...Zf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("itemHeaderClickHandler",A.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=A.some(a,p=>p===r.name),d=i.computed(()=>A.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,o("header:click",r.name,u.value),s(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,o("header:click",r.name,u.value),s(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,o("header:click",r.name,u.value),s(r.name,u.value))},expanded:i.readonly(u)}),(p,y)=>{const b=Lf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",Wf,[i.createElementVNode("div",jf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(ci).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",qf,[i.createElementVNode("div",Xf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Yf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ci).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Uf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ci).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Kf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Gf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,Hf)}}}),qn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},rl=qn(Qf,[["__scopeId","data-v-f1311d1c"]]),Jf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function em(t,e){return i.openBlock(),i.createElementBlock("svg",Jf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const ol=i.markRaw({name:"ion-cart-outline",render:em}),dr=Symbol(),tm={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"}},nm={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},im={},sl=i.defineComponent({...im,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(dr,"medium"),r=i.computed(()=>A.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=i.computed(()=>A.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=i.computed(()=>A.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>A.isNil(e.productContextButtonsConfig)?[]:A.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,m)=>{var N;const g=il,f=nl,p=O.NButton,y=O.NTooltip,b=tl,_=ol,v=Uo,w=O.NDropdown;return i.openBlock(),i.createElementBlock("div",nm,[s.value?(i.openBlock(),i.createBlock(y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:s.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(f,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createBlock(y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:o.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[2]||(m[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((N=a.value)==null?void 0:N.length)>0?(i.openBlock(),i.createBlock(w,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(v)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),rm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function om(t,e){return i.openBlock(),i.createElementBlock("svg",rm,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const sm=i.markRaw({name:"tabler-history",render:om}),am={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lm(t,e){return i.openBlock(),i.createElementBlock("svg",am,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const cm=i.markRaw({name:"mdi-percent-outline",render:lm}),dm={class:"flex flex-row gap-1"},um={key:0,class:"flex gap-1"},hm={key:0,class:"flex text-nowrap text-sm line-through"},fm={key:1,class:"flex flex-row text-nowrap text-sm"},mm={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},gm={},Xn=i.defineComponent({...gm,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCurrency:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var v;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"discount"in e.product&&e.product.discount?jn.getFormatEntityName(e.product.discount):""),o=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>e.showQuantityUnit?`${o.value.currency.symbol}/${o.value.unit.name}`:e.showCurrency?o.value.currency.symbol:""),a=i.computed(()=>e.showQuantityUnit?`₽/${o.value.unit.name}`:e.showCurrency?"₽":""),l=i.computed(()=>A.find(o.value.priceCoefficients,["coefficient.slug",e.costFieldName])),c=i.computed(()=>{const w=A.find(o.value.priceCoefficients,["coefficient.slug","k0"]);return l.value||!w||A.isNil(u.value)||A.isNil(w.cost)?!1:u.value<w.cost}),d=((v=j.useBaseConfigStateStore().getConfig())==null?void 0:v.defaultCurrency)??"RUB",u=i.computed(()=>l.value?l.value.cost:A.get(e.product,e.costFieldName)),h=i.computed(()=>e.additionalThroughFieldName?A.get(e.product,e.additionalThroughFieldName):void 0),m=i.computed(()=>o.value.costDate?en.format(o.value.costDate,j.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),g=i.computed(()=>e.currencyRates||o.value.currency.signature===d?e.currencyRates:{[o.value.currency.signature]:o.value.costRub/o.value.cost}),f=i.computed(()=>(A.isFunction(e.allowPriceClick)?e.allowPriceClick(o.value):e.allowPriceClick)&&!A.isNil(u.value)),p=i.computed(()=>A.isNil(u.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value))),y=i.computed(()=>{if(o.value.currency.signature===d||!g.value||!g.value[o.value.currency.signature])return null;const w=g.value[o.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value)*w)}),b=i.computed(()=>A.isNil(h.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(h.value)),_=i.computed(()=>{if(!h.value||!u.value||h.value===u.value||u.value===0)return null;const w=(u.value-h.value)/h.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(w)});return(w,N)=>{var B;const $=O.NTag,x=O.NTooltip,R=cm,C=sm;return i.openBlock(),i.createElementBlock("div",dm,[t.showTag?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode($,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!l.value}])},{default:i.withCtx(()=>{var T;return[i.createTextVNode(i.toDisplayString(((T=l.value)==null?void 0:T.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var T;return[i.createTextVNode(" "+i.toDisplayString(((T=l.value)==null?void 0:T.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":c.value})},[h.value&&h.value!==u.value||_.value?(i.openBlock(),i.createElementBlock("div",um,[h.value&&h.value!==u.value?(i.openBlock(),i.createElementBlock("span",hm,i.toDisplayString(b.value)+" "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":c.value}])}," ("+i.toDisplayString(_.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(B=l.value)==null?void 0:B.readOnly,"font-bold":!l.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":f.value&&t.eventEmitter}),onClick:N[0]||(N[0]=()=>{var T;f.value&&((T=t.eventEmitter)==null||T.emit("cost:click",{product:o.value,cost:u.value}))})},i.toDisplayString(p.value),3),i.createTextVNode(" "+i.toDisplayString(s.value)+" ",1),u.value&&!l.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode(R,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(r.value)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),y.value?(i.openBlock(),i.createElementBlock("span",fm," ~ "+i.toDisplayString(y.value)+" "+i.toDisplayString(a.value),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(A.isNil)(m.value)?(i.openBlock(),i.createElementBlock("span",mm,[i.createTextVNode(i.toDisplayString(m.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(x,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(C,{class:"cursor-pointer",onClick:N[1]||(N[1]=T=>{var F;return(F=t.eventEmitter)==null?void 0:F.emit("cost:show-price-history",{product:o.value})})})]),default:i.withCtx(()=>[N[2]||(N[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),pm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ym(t,e){return i.openBlock(),i.createElementBlock("svg",pm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const Ko=i.markRaw({name:"ion-information-circle-outline",render:ym}),bm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _m(t,e){return i.openBlock(),i.createElementBlock("svg",bm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const al=i.markRaw({name:"ion-images",render:_m}),wm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xm(t,e){return i.openBlock(),i.createElementBlock("svg",wm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56m0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26m48 226h-88a16 16 0 0 1 0-32h28v-88h-16a16 16 0 0 1 0-32h32a16 16 0 0 1 16 16v104h28a16 16 0 0 1 0 32"},null,-1)])])}const km=i.markRaw({name:"ion-information-circle",render:xm}),vm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cm(t,e){return i.openBlock(),i.createElementBlock("svg",vm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const Sm=i.markRaw({name:"ion-bookmark",render:Cm});/*!
1
+ (function(X,j){typeof exports=="object"&&typeof module<"u"?j(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("vue"),require("date-fns"),require("naive-ui"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define=="function"&&define.amd?define(["exports","@snabcentr/common-lib","lodash-es","vue","date-fns","naive-ui","libphonenumber-js","ts-case-convert","vue-tel-input"],j):(X=typeof globalThis<"u"?globalThis:X||self,j(X.SC_VueUiLib={},X["@snabcentr/common-lib"],X["lodash-es"],X.Vue,X["date-fns"],X["naive-ui"],X["libphonenumber-js"],X["ts-case-convert"],X["vue-tel-input"]))})(this,(function(X,j,A,i,en,O,ar,Yo,lf){"use strict";var QB=Object.defineProperty;var rf=X=>{throw TypeError(X)};var JB=(X,j,A)=>j in X?QB(X,j,{enumerable:!0,configurable:!0,writable:!0,value:A}):X[j]=A;var S=(X,j,A)=>JB(X,typeof j!="symbol"?j+"":j,A),of=(X,j,A)=>j.has(X)||rf("Cannot "+A);var Vt=(X,j,A)=>(of(X,j,"read from private field"),A?A.call(X):j.get(X)),Ka=(X,j,A)=>j.has(X)?rf("Cannot add the same private member more than once"):j instanceof WeakSet?j.add(X):j.set(X,A),sf=(X,j,A,i)=>(of(X,j,"write to private field"),i?i.call(X,A):j.set(X,A),A);var Ni,mt,Wo;const vt=class vt{static init(e,n){vt.messagesService&&vt.notificationsService||(vt.messagesService=e,vt.notificationsService=n)}static getMessagesService(){if(!vt.messagesService)throw new Error("UI provider is not initialized.");return vt.messagesService}static getNotificationsService(){if(!vt.notificationsService)throw new Error("UI provider is not initialized.");return vt.notificationsService}static showNotificationsForErrorResponseData(e,n={}){var r,o;if(A.isEmpty(e.errors)){const s=(o=(r=e.rawError)==null?void 0:r.config)==null?void 0:o.url,a=s?` [ ${s} ]`:"";vt.notificationsService?vt.notificationsService.error({title:"Ошибка выполнения/обработки запроса",content:e.message,meta:`#${e.status}${a}: ${e.statusText}`,duration:3e3}):console.log("Show notification error response data: UI provider is not initialized.",e)}else for(const s in e.errors)Object.prototype.hasOwnProperty.call(n,s)?n[s]=new j.FieldValidationResultData(e.errors[s].toString(),"error"):vt.messagesService?vt.messagesService.error(e.errors[s].toString()):console.log("Show notification error response data: UI provider is not initialized.",e.errors[s])}};S(vt,"messagesService"),S(vt,"notificationsService");let lr=vt;const cr=new WeakMap,cf=async t=>{const e=navigator.clipboard;if(e!=null&&e.writeText){await e.writeText(t);return}const n=document.createElement("textarea");n.value=t,n.style.position="fixed",n.style.opacity="0",document.body.append(n),n.select();const r=document.execCommand("copy");if(n.remove(),!r)throw new Error("Не удалось скопировать через execCommand.")},Za=async t=>{const e=A.isNil(t)?"":String(t);if(e)try{await cf(e),lr.getNotificationsService().success({title:"Готово",description:`Скопировано в буфер обмена: ${e}`,duration:2e3})}catch{lr.getNotificationsService().error({title:"Ошибка",description:"Не удалось скопировать в буфер обмена.",duration:3e3})}},df=t=>t.tagName==="BUTTON"||t.getAttribute("role")==="button"||!!t.closest("button"),uf=(t,e)=>e.modifiers.click?"click":e.modifiers.dblclick?"dblclick":df(t)?"click":"dblclick",Qa={mounted(t,e){t.style.setProperty("cursor","pointer");const n=uf(t,e),r=o=>{var a;n==="dblclick"&&(o.preventDefault(),(a=globalThis.getSelection())==null||a.removeAllRanges());const s=cr.get(t);Za(s==null?void 0:s.value).catch(A.noop)};cr.set(t,{value:e.value,eventName:n,handler:r}),t.addEventListener(n,r)},updated(t,e){const n=cr.get(t);n&&(n.value=e.value)},beforeUnmount(t){const e=cr.get(t);e&&(t.removeEventListener(e.eventName,e.handler),cr.delete(t))}},hf=new Set(["checkbox","radio","range","button","submit","reset","file","color","image","hidden"]),ff=".n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker",Hr=new WeakMap,Ja=t=>!hf.has(t.type)&&!t.disabled&&!t.readOnly&&t.closest(ff)===null&&t.getClientRects().length>0,el=t=>{var a;if(t.key!=="Enter"&&t.code!=="Enter"||t.shiftKey||t.isComposing)return;const{target:e}=t;if(!(e instanceof HTMLInputElement)||!Ja(e))return;t.preventDefault();const n=t.currentTarget,r=[...n.querySelectorAll("input")].filter(l=>Ja(l)),o=r.indexOf(e);if(o===-1)return;const s=r.at(o+1);if(s){s.focus(),s.select();return}(a=Hr.get(n))==null||a()},Wn={mounted(t,e){Hr.set(t,e.value),t.addEventListener("keydown",el)},updated(t,e){Hr.set(t,e.value)},unmounted(t){t.removeEventListener("keydown",el),Hr.delete(t)}};var Pe=(t=>(t.AttachedUser="attached_user",t.ClientInfo="client_info",t.ClientInfoShort="client_info_short",t.CreatedAt="created_at",t.ClientCity="client_city",t.DeliveryInfo="delivery_info",t.DeliveryDate="delivery_date",t.Id="id",t.PaymentType="payment_type",t.SalesDirections="sales_directions",t.Status="status",t.actions="actions",t))(Pe||{}),qe=(t=>(t.phone="phone",t.tablet="tablet",t.laptop="laptop",t))(qe||{});class ci{static isVnodeEmpty(e){return e.every(n=>n.type===i.Comment||n.type===i.Text&&A.isString(n.children)&&!n.children.trim()?!0:n.type===i.Fragment&&ci.isVnodeEmpty(n.children))}static hasSlotContent(e){return e?!ci.isVnodeEmpty(e()):!1}}class jn{static isDeleted(e){return!!(e.deletedAt&&!en.isFuture(e.deletedAt))}static getFormatEntityName(e){return jn.isDeleted(e)?`${e.name} (Удалён)`:e.name}}const tt=(t,e=!1)=>{const{key:n}=t;if(!["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(n)&&!((t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(n.toLowerCase()))){if(e&&n==="-"){const r=t.target;if((r.selectionStart??0)===0&&!r.value.includes("-"))return}/^\d$/.test(n)||t.preventDefault()}},Wr=(t,e=".",n=!1)=>{const{key:r}=t,o=t.target;["Backspace","Delete","Tab","Escape","Enter","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(r)||(t.ctrlKey||t.metaKey)&&["a","c","v","x","z","ф","с","м","ч","я"].includes(r.toLowerCase())||n&&r==="-"&&!o.value.includes("-")&&((o.selectionStart??0)===0||o.value.length===0)||(r===e||r===(e==="."?",":"."))&&!o.value.includes(e)&&!o.value.includes(e==="."?",":".")||/^\d$/.test(r)||t.preventDefault()},it=t=>t?Number.parseFloat(t.replace(",",".")):null,et=(t,e)=>{t[e]={}},Le=t=>{const e=t.target;setTimeout(()=>{e.select()},100)};class Bt{static convertReferencesToOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){let l=e.map(c=>({label:s?s(c):jn.getFormatEntityName(c),value:c.id,item:c,disabled:a?a(c):!1}));return n&&(l=l.map(c=>`${c.label}-[${c.value}]`).sort().map(c=>l.find(d=>c===`${d.label}-[${d.value}]`))),r===!1?[...o?[{label:"",value:-1,disabled:!0}]:[],...l]:[...o?[{type:"group",label:"-",key:"default_group",children:[{label:"-- Отсутствует --",value:-1,disabled:!0}]}]:[],...Object.values(A.groupBy(l,r.key)).filter(c=>c.length>0).map(c=>{const d=c[0],u=A.isString(r.key)?A.get(d,r.key):r.key(c),h=A.isString(r.label)?A.get(d,r.label):r.label(c);return{type:"group",label:A.isEmpty(h)?"- Не определено -":h,key:`group_${u}`,children:c}})]}static convertReferencesToSelectOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Bt.convertReferencesToOptionsList(e,n,r,o,s,a)}static convertReferencesToAutocompleteOptionsList(e,n=!1,r=!1,o=!1,s=void 0,a=void 0){return Bt.convertReferencesToOptionsList(e,n,r,o,s,a)}}const mf={required:{required:!0,type:"any",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},ae={required:{type:"number",required:!0,trigger:["blur","input"],message:"Это поле обязательно для заполнения"},min(t){return{type:"number",min:t,trigger:["blur","input"],message:`Минимальное значение: ${t}`}},max(t){return{type:"number",max:t,trigger:["blur","input"],message:`Максимальное значение: ${t}`}},step(t){return{type:"number",trigger:["blur","input"],validator:(e,n)=>n===null||Math.abs(n/t-Math.round(n/t))<1e-10?!0:new Error(`Значение должно быть кратно ${t}`)}}},gf={required:{required:!0,type:"date",trigger:["blur","input"],message:"Это поле обязательно для заполнения"}},He={serverValidation(t){return{validator:(e,n)=>n===null?!0:t?new Error(t):!0}}},pf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function yf(t,e){return i.openBlock(),i.createElementBlock("svg",pf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"256",cy:"256",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"416",r:"48",fill:"currentColor"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"96",r:"48",fill:"currentColor"},null,-1)])])}const Uo=i.markRaw({name:"ion-ellipsis-vertical-sharp",render:yf}),bf={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function _f(t,e){return i.openBlock(),i.createElementBlock("svg",bf,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1"}),i.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3"})],-1)])])}const tl=i.markRaw({name:"tabler-edit",render:_f}),wf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xf(t,e){return i.openBlock(),i.createElementBlock("svg",wf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M258.9 48C141.92 46.42 46.42 141.92 48 258.9c1.56 112.19 92.91 203.54 205.1 205.1c117 1.6 212.48-93.9 210.88-210.88C462.44 140.91 371.09 49.56 258.9 48m-16.79 192.47l51.55-59a16 16 0 0 1 24.1 21.06l-51.55 59a16 16 0 1 1-24.1-21.06m-38.86 90.85a16 16 0 0 1-22.62 0l-47.95-48a16 16 0 1 1 22.64-22.62l48 48a16 16 0 0 1-.07 22.62m176.8-128.79l-111.88 128a16 16 0 0 1-11.51 5.47h-.54a16 16 0 0 1-11.32-4.69l-47.94-48a16 16 0 1 1 22.64-22.62l29.8 29.83a8 8 0 0 0 11.68-.39l95-108.66a16 16 0 0 1 24.1 21.06Z"},null,-1)])])}const nl=i.markRaw({name:"ion-checkmark-done-circle",render:xf}),kf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function vf(t,e){return i.openBlock(),i.createElementBlock("svg",kf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M448 256c0-106-86-192-192-192S64 150 64 256s86 192 192 192s192-86 192-192Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M368 192L256.13 320l-47.95-48m-16.23 48L144 272m161.71-80l-51.55 59"},null,-1)])])}const il=i.markRaw({name:"ion-checkmark-done-circle-outline",render:vf}),Cf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Sf(t,e){return i.openBlock(),i.createElementBlock("svg",Cf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 Bf=i.markRaw({name:"fluent-pin32-regular",render:Sf}),Tf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Nf(t,e){return i.openBlock(),i.createElementBlock("svg",Tf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112"},null,-1),i.createElementVNode("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"},null,-1)])])}const $f=i.markRaw({name:"ion-eye-outline",render:Nf}),Rf={viewBox:"0 0 32 32",width:"1.2em",height:"1.2em"};function Ef(t,e){return i.openBlock(),i.createElementBlock("svg",Rf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 Pf=i.markRaw({name:"fluent-pin32-filled",render:Ef}),Ff={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Vf(t,e){return i.openBlock(),i.createElementBlock("svg",Ff,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"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 If=i.markRaw({name:"ion-bookmark-outline",render:Vf}),Mf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Af(t,e){return i.openBlock(),i.createElementBlock("svg",Mf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m63.998 86.005l21.998-21.998L447.999 426.01l-21.998 21.998zM259.34 192.09l60.57 60.57a64.07 64.07 0 0 0-60.57-60.57m-6.68 127.82l-60.57-60.57a64.07 64.07 0 0 0 60.57 60.57"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M256 352a96 96 0 0 1-92.6-121.34l-69.07-69.08C66.12 187.42 39.24 221.14 16 256c26.42 44 62.56 89.24 100.2 115.18C159.38 400.92 206.33 416 255.76 416A233.5 233.5 0 0 0 335 402.2l-53.61-53.6A95.8 95.8 0 0 1 256 352m0-192a96 96 0 0 1 92.6 121.34L419.26 352c29.15-26.25 56.07-61.56 76.74-96c-26.38-43.43-62.9-88.56-101.18-114.82C351.1 111.2 304.31 96 255.76 96a222.9 222.9 0 0 0-78.21 14.29l53.11 53.11A95.8 95.8 0 0 1 256 160"},null,-1)])])}const Of=i.markRaw({name:"ion-eye-off-sharp",render:Af}),zf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Df(t,e){return i.openBlock(),i.createElementBlock("svg",zf,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"48",d:"m184 112l144 144l-144 144"},null,-1)])])}const Lf=i.markRaw({name:"ion-chevron-forward-outline",render:Df}),Hf=["data-name"],Wf={class:"sc-collapse-item-header flex flex-row gap-2.5"},jf={class:"sc-collapse-item-arrow flex-none cursor-pointer pt-1.5"},qf={key:0},Xf={class:"sc-collapse-item-pre-arrow flex flex-none flex-row gap-1"},Yf={class:"flex flex-1 flex-col"},Uf={key:0,class:"sc-collapse-item-sub-title flex-1"},Kf={key:1,class:"sc-collapse-item-title-extra flex-none"},Gf={key:0,class:"sc-collapse-item-content"},Zf={},Qf=i.defineComponent({...Zf,__name:"collapse-item",props:{name:{default:""},title:{default:""},disabled:{type:Boolean,default:!1}},emits:["header:click"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.inject("itemHeaderClickHandler",A.noop),a=i.inject("defaultExpandedNames",[]),l=i.inject("expandedNames",[]),c=A.some(a,p=>p===r.name),d=i.computed(()=>A.some(l,p=>p===r.name)),u=i.ref(c),h=()=>{r.disabled||(u.value=d.value||!u.value,o("header:click",r.name,u.value),s(r.name,u.value))};return e({expand:()=>{!r.disabled&&!u.value&&(u.value=!0,o("header:click",r.name,u.value),s(r.name,u.value))},toggle:()=>{r.disabled||h()},collapse:()=>{!r.disabled&&u.value&&!d.value&&(u.value=!1,o("header:click",r.name,u.value),s(r.name,u.value))},expanded:i.readonly(u)}),(p,y)=>{const b=Lf;return i.openBlock(),i.createElementBlock("div",{"data-name":t.name,class:i.normalizeClass([{"cursor-not-allowed text-gray-400":t.disabled},"sc-collapse-item flex flex-col p-2"])},[i.createElementVNode("div",Wf,[i.createElementVNode("div",jf,[i.createElementVNode("div",{class:i.normalizeClass({"rotate-90":u.value}),onClick:h},[i.renderSlot(p.$slots,"arrow",{},()=>[i.createVNode(b)],!0)],2)]),i.unref(ci).hasSlotContent(p.$slots["pre-arrow"])?(i.openBlock(),i.createElementBlock("div",qf,[i.createElementVNode("div",Xf,[i.renderSlot(p.$slots,"pre-arrow",{},void 0,!0)])])):i.createCommentVNode("",!0),i.createElementVNode("div",Yf,[i.createElementVNode("div",{class:"sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold",onClick:h},[i.renderSlot(p.$slots,"header",{},()=>[i.createTextVNode(i.toDisplayString(t.title),1)],!0)]),i.unref(ci).hasSlotContent(p.$slots["sub-header"])?(i.openBlock(),i.createElementBlock("div",Uf,[i.renderSlot(p.$slots,"sub-header",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.unref(ci).hasSlotContent(p.$slots["header-extra"])?(i.openBlock(),i.createElementBlock("div",Kf,[i.renderSlot(p.$slots,"header-extra",{},void 0,!0)])):i.createCommentVNode("",!0)]),i.createVNode(i.Transition,{name:"fade"},{default:i.withCtx(()=>[d.value||u.value?(i.openBlock(),i.createElementBlock("div",Gf,[i.renderSlot(p.$slots,"default",{},void 0,!0)])):i.createCommentVNode("",!0)]),_:3})],10,Hf)}}}),qn=(t,e)=>{const n=t.__vccOpts||t;for(const[r,o]of e)n[r]=o;return n},rl=qn(Qf,[["__scopeId","data-v-f1311d1c"]]),Jf={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function em(t,e){return i.openBlock(),i.createElementBlock("svg",Jf,[...e[0]||(e[0]=[i.createElementVNode("circle",{cx:"176",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("circle",{cx:"400",cy:"416",r:"16",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M48 80h64l48 272h256"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M160 288h249.44a8 8 0 0 0 7.85-6.43l28.8-144a8 8 0 0 0-7.85-9.57H128"},null,-1)])])}const ol=i.markRaw({name:"ion-cart-outline",render:em}),dr=Symbol(),tm={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"}},nm={class:"flex flex-col-reverse gap-2.5 sm:flex-row"},im={},sl=i.defineComponent({...im,__name:"product-actions",props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(t){const e=t,n=i.inject(dr,"medium"),r=i.computed(()=>A.isFunction(e.showProductAddToCartButton)?e.showProductAddToCartButton(e.product):e.showProductAddToCartButton),o=i.computed(()=>A.isFunction(e.showProductEditButton)?e.showProductEditButton(e.product):e.showProductEditButton),s=i.computed(()=>A.isFunction(e.showProductRequiredButton)?e.showProductRequiredButton(e.product):e.showProductRequiredButton),a=i.computed(()=>A.isNil(e.productContextButtonsConfig)?[]:A.isFunction(e.productContextButtonsConfig)?e.productContextButtonsConfig(e.product):e.productContextButtonsConfig),l=()=>{e.eventEmitter.emit("product:add-to-cart",{product:e.product})},c=()=>{e.eventEmitter.emit("product:edit",{product:e.product})},d=()=>{e.eventEmitter.emit("product:required",{product:e.product})},u=h=>{e.eventEmitter.emit("product:context-select",{product:e.product,key:h})};return(h,m)=>{var N;const g=il,f=nl,p=O.NButton,y=O.NTooltip,b=tl,_=ol,v=Uo,w=O.NDropdown;return i.openBlock(),i.createElementBlock("div",nm,[s.value?(i.openBlock(),i.createBlock(y,{key:0,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:s.value==="disabled",type:t.product.isRequired?"primary":"default",onClick:d},{default:i.withCtx(()=>[t.product.isRequired?(i.openBlock(),i.createBlock(f,{key:1})):(i.openBlock(),i.createBlock(g,{key:0}))]),_:1},8,["size","disabled","type"])]),default:i.withCtx(()=>[m[0]||(m[0]=i.createTextVNode(" Товар, который нужно предлагать клиенту ",-1))]),_:1})):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createBlock(y,{key:1,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary",disabled:o.value==="disabled",onClick:c},{default:i.withCtx(()=>[i.createVNode(b)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[1]||(m[1]=i.createTextVNode(" Редактировать ",-1))]),_:1})):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createBlock(y,{key:2,placement:"bottom",trigger:"hover"},{trigger:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),disabled:r.value==="disabled",type:"primary",onClick:l},{default:i.withCtx(()=>[i.createVNode(_)]),_:1},8,["size","disabled"])]),default:i.withCtx(()=>[m[2]||(m[2]=i.createTextVNode(" Добавить в корзину ",-1))]),_:1})):i.createCommentVNode("",!0),((N=a.value)==null?void 0:N.length)>0?(i.openBlock(),i.createBlock(w,{key:3,options:a.value,size:i.unref(n),trigger:"click",onSelect:u},{default:i.withCtx(()=>[i.createVNode(p,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(v)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)])}}}),rm={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function om(t,e){return i.openBlock(),i.createElementBlock("svg",rm,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M12 8v4l2 2"}),i.createElementVNode("path",{d:"M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5"})],-1)])])}const sm=i.markRaw({name:"tabler-history",render:om}),am={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function lm(t,e){return i.openBlock(),i.createElementBlock("svg",am,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"m18.5 3.5l2 2l-15 15l-2-2zM7 4c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3m10 10c1.66 0 3 1.34 3 3s-1.34 3-3 3s-3-1.34-3-3s1.34-3 3-3M7 6c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1m10 10c-.55 0-1 .45-1 1s.45 1 1 1s1-.45 1-1s-.45-1-1-1"},null,-1)])])}const cm=i.markRaw({name:"mdi-percent-outline",render:lm}),dm={class:"flex flex-row gap-1"},um={key:0,class:"flex gap-1"},hm={key:0,class:"flex text-nowrap text-sm line-through"},fm={key:1,class:"flex flex-row text-nowrap text-sm"},mm={key:2,class:"flex flex-row gap-1 text-nowrap text-sm text-gray-600"},gm={},Xn=i.defineComponent({...gm,__name:"product-cost",props:{product:{},additionalThroughFieldName:{},costFieldName:{},eventEmitter:{},allowPriceClick:{type:[Boolean,Function],default:!1},showTag:{type:Boolean,default:!1},showQuantityUnit:{type:Boolean,default:!1},showCurrency:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},showPriceHistory:{type:Boolean,default:!1},currencyRates:{default:void 0}},setup(t){var v;const e=t,n=i.computed(()=>"product"in e.product),r=i.computed(()=>"discount"in e.product&&e.product.discount?jn.getFormatEntityName(e.product.discount):""),o=i.computed(()=>"product"in e.product?e.product.product:e.product),s=i.computed(()=>e.showQuantityUnit?`${o.value.currency.symbol}/${o.value.unit.name}`:e.showCurrency?o.value.currency.symbol:""),a=i.computed(()=>e.showQuantityUnit?`₽/${o.value.unit.name}`:e.showCurrency?"₽":""),l=i.computed(()=>A.find(o.value.priceCoefficients,["coefficient.slug",e.costFieldName])),c=i.computed(()=>{const w=A.find(o.value.priceCoefficients,["coefficient.slug","k0"]);return l.value||!w||A.isNil(u.value)||A.isNil(w.cost)?!1:u.value<w.cost}),d=((v=j.useBaseConfigStateStore().getConfig())==null?void 0:v.defaultCurrency)??"RUB",u=i.computed(()=>l.value?l.value.cost:A.get(e.product,e.costFieldName)),h=i.computed(()=>e.additionalThroughFieldName?A.get(e.product,e.additionalThroughFieldName):void 0),m=i.computed(()=>o.value.costDate?en.format(o.value.costDate,j.useBaseConfigStateStore().config.dateFormats.uiDate):void 0),g=i.computed(()=>e.currencyRates||o.value.currency.signature===d?e.currencyRates:{[o.value.currency.signature]:o.value.costRub/o.value.cost}),f=i.computed(()=>(A.isFunction(e.allowPriceClick)?e.allowPriceClick(o.value):e.allowPriceClick)&&!A.isNil(u.value)),p=i.computed(()=>A.isNil(u.value)?"-":new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value))),y=i.computed(()=>{if(o.value.currency.signature===d||!g.value||!g.value[o.value.currency.signature])return null;const w=g.value[o.value.currency.signature];return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(Number.parseFloat(u.value)*w)}),b=i.computed(()=>A.isNil(h.value)?null:new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2}).format(h.value)),_=i.computed(()=>{if(!h.value||!u.value||h.value===u.value||u.value===0)return null;const w=(u.value-h.value)/h.value*100;return new Intl.NumberFormat("ru-RU",{style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2}).format(w)});return(w,N)=>{var B;const $=O.NTag,x=O.NTooltip,R=cm,C=sm;return i.openBlock(),i.createElementBlock("div",dm,[t.showTag?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode($,{round:"",bordered:!1,size:"small",class:i.normalizeClass(["text-slate-600",{"font-bold":!l.value}])},{default:i.withCtx(()=>{var T;return[i.createTextVNode(i.toDisplayString(((T=l.value)==null?void 0:T.coefficient.slug)??"Ц"),1)]}),_:1},8,["class"])]),default:i.withCtx(()=>{var T;return[i.createTextVNode(" "+i.toDisplayString(((T=l.value)==null?void 0:T.coefficient.name)??"Розничная цена"),1)]}),_:1})):i.createCommentVNode("",!0),i.createElementVNode("div",{class:i.normalizeClass({"!text-red-600":c.value})},[h.value&&h.value!==u.value||_.value?(i.openBlock(),i.createElementBlock("div",um,[h.value&&h.value!==u.value?(i.openBlock(),i.createElementBlock("span",hm,i.toDisplayString(b.value)+" "+i.toDisplayString(s.value),1)):i.createCommentVNode("",!0),_.value?(i.openBlock(),i.createElementBlock("span",{key:1,class:i.normalizeClass(["flex text-nowrap text-sm text-gray-600",{"!text-red-600":c.value}])}," ("+i.toDisplayString(_.value)+"%) ",3)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0),i.createElementVNode("span",{class:i.normalizeClass(["whitespace-nowrap text-base flex items-center gap-1",{"text-gray-600":(B=l.value)==null?void 0:B.readOnly,"font-bold":!l.value&&!n.value}])},[i.createElementVNode("span",{class:i.normalizeClass({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":f.value&&t.eventEmitter}),onClick:N[0]||(N[0]=()=>{var T;f.value&&((T=t.eventEmitter)==null||T.emit("cost:click",{product:o.value,cost:u.value}))})},i.toDisplayString(p.value),3),i.createTextVNode(" "+i.toDisplayString(s.value)+" ",1),u.value&&!l.value&&"discount"in t.product&&t.product.discount?(i.openBlock(),i.createBlock(x,{key:0},{trigger:i.withCtx(()=>[i.createVNode(R,{class:"text-sm text-black bg-amber-400 rounded p-px"})]),default:i.withCtx(()=>[i.createElementVNode("span",null,' На продукт действует скидка "'+i.toDisplayString(r.value)+'"; ',1)]),_:1})):i.createCommentVNode("",!0)],2),y.value?(i.openBlock(),i.createElementBlock("span",fm," ~ "+i.toDisplayString(y.value)+" "+i.toDisplayString(a.value),1)):i.createCommentVNode("",!0),t.showCostDate&&!i.unref(A.isNil)(m.value)?(i.openBlock(),i.createElementBlock("span",mm,[i.createTextVNode(i.toDisplayString(m.value)+" ",1),t.showPriceHistory&&t.eventEmitter?(i.openBlock(),i.createBlock(x,{key:0,placement:"top-end"},{trigger:i.withCtx(()=>[i.createVNode(C,{class:"cursor-pointer",onClick:N[1]||(N[1]=T=>{var F;return(F=t.eventEmitter)==null?void 0:F.emit("cost:show-price-history",{product:o.value})})})]),default:i.withCtx(()=>[N[2]||(N[2]=i.createTextVNode(" История цен ",-1))]),_:1})):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2)])}}}),pm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function ym(t,e){return i.openBlock(),i.createElementBlock("svg",pm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32",d:"M248 64C146.39 64 64 146.39 64 248s82.39 184 184 184s184-82.39 184-184S349.61 64 248 64Z"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M220 220h32v116"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M208 340h88"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26"},null,-1)])])}const Ko=i.markRaw({name:"ion-information-circle-outline",render:ym}),bm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function _m(t,e){return i.openBlock(),i.createElementBlock("svg",bm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M450.29 112H142c-34 0-62 27.51-62 61.33v245.34c0 33.82 28 61.33 62 61.33h308c34 0 62-26.18 62-60V173.33c0-33.82-27.68-61.33-61.71-61.33m-77.15 61.34a46 46 0 1 1-46.28 46a46.19 46.19 0 0 1 46.28-46.01Zm-231.55 276c-17 0-29.86-13.75-29.86-30.66v-64.83l90.46-80.79a46.54 46.54 0 0 1 63.44 1.83L328.27 337l-113 112.33ZM480 418.67a30.67 30.67 0 0 1-30.71 30.66H259L376.08 333a46.24 46.24 0 0 1 59.44-.16L480 370.59Z"},null,-1),i.createElementVNode("path",{fill:"currentColor",d:"M384 32H64A64 64 0 0 0 0 96v256a64.11 64.11 0 0 0 48 62V152a72 72 0 0 1 72-72h326a64.11 64.11 0 0 0-62-48"},null,-1)])])}const al=i.markRaw({name:"ion-images",render:_m}),wm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xm(t,e){return i.openBlock(),i.createElementBlock("svg",wm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200s200-89.72 200-200S366.28 56 256 56m0 82a26 26 0 1 1-26 26a26 26 0 0 1 26-26m48 226h-88a16 16 0 0 1 0-32h28v-88h-16a16 16 0 0 1 0-32h32a16 16 0 0 1 16 16v104h28a16 16 0 0 1 0 32"},null,-1)])])}const km=i.markRaw({name:"ion-information-circle",render:xm}),vm={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function Cm(t,e){return i.openBlock(),i.createElementBlock("svg",vm,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M400 480a16 16 0 0 1-10.63-4L256 357.41L122.63 476A16 16 0 0 1 96 464V96a64.07 64.07 0 0 1 64-64h192a64.07 64.07 0 0 1 64 64v368a16 16 0 0 1-16 16"},null,-1)])])}const Sm=i.markRaw({name:"ion-bookmark",render:Cm});/*!
2
2
  * lightgallery | 2.9.0 | October 1st 2025
3
3
  * http://www.lightgalleryjs.com/
4
4
  * Copyright (c) 2020 Sachin Neravath;
@@ -113,7 +113,7 @@ ${o}
113
113
  `);return}l=vu(l),c!=null&&a.push(` ${l}${cx(c)}`)}),t&&a.push("}"),a.join(`
114
114
  `)}function sa(t,e,n){t&&t.forEach(r=>{if(Array.isArray(r))sa(r,e,n);else if(typeof r=="function"){const o=r(e);Array.isArray(o)?sa(o,e,n):o&&n(o)}else r&&n(r)})}function Su(t,e,n,r,o){const s=t.$;let a="";if(!s||typeof s=="string")Ro(s)?a=s:e.push(s);else if(typeof s=="function"){const d=s({context:r.context,props:o});Ro(d)?a=d:e.push(d)}else if(s.before&&s.before(r.context),!s.$||typeof s.$=="string")Ro(s.$)?a=s.$:e.push(s.$);else if(s.$){const d=s.$({context:r.context,props:o});Ro(d)?a=d:e.push(d)}const l=sx(e),c=Cu(l,t.props,r,o);a?n.push(`${a} {`):c.length&&n.push(c),t.children&&sa(t.children,{context:r.context,props:o},d=>{if(typeof d=="string"){const u=Cu(l,{raw:d},r,o);n.push(u)}else Su(d,e,n,r,o)}),e.pop(),a&&n.push("}"),s&&s.after&&s.after(r.context)}function ux(t,e,n){const r=[];return Su(t,[],r,e,n),r.join(`
115
115
 
116
- `)}function aa(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function hx(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(ku),e.els=[];else{const s=$o(n,r);s&&o.includes(s)&&(ku(s),e.els=o.filter(a=>a!==s))}}function Bu(t,e){t.push(e)}function fx(t,e,n,r,o,s,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=aa(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=$o(n,l);if(u!==null&&!s)return u;const h=u??ax(n);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(h,m),Bu(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),Bu(e.els,h),h}function mx(t){return ux(this,this.instance,t)}function gx(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return fx(this.instance,this,e,r,o,s,a,l,n)}function px(t={}){const{id:e,parent:n}=t;hx(this.instance,this,e,n)}const Eo=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:mx,mount:gx,unmount:px}},yx=function(t,e,n,r){return Array.isArray(e)?Eo(t,{$:null},null,e):Array.isArray(n)?Eo(t,e,null,n):Array.isArray(r)?Eo(t,e,n,r):Eo(t,e,n,null)};function Tu(t={}){const e={c:((...n)=>yx(e,...n)),use:(n,...r)=>n.install(e,...r),find:$o,context:{},config:t};return e}function bx(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return $o(t)!==null}const{c:ti}=Tu(),la="vueuc-style";function Nu(t){return t&-t}class $u{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=n,e+=Nu(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=e*r;for(;e>0;)s+=n[e],e-=Nu(e);return s}getBound(e){let n=0,r=this.l;for(;r>n;){const o=Math.floor((n+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(n===o)return this.sum(n+1)<=e?n+1:o;n=o}else return o}return n}}function Ru(t){return typeof t=="string"?document.querySelector(t):t()||null}const _x=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:qw(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?ia("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},ia("lazy-teleport",this.$slots)):null}}),Po={top:"bottom",bottom:"top",left:"right",right:"left"},Eu={start:"end",center:"center",end:"start"},ca={top:"height",bottom:"height",left:"width",right:"width"},wx={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},xx={"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"},kx={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Pu={top:!0,bottom:!1,left:!0,right:!1},Fu={top:"end",bottom:"start",left:"end",right:"start"};function vx(t,e,n,r,o,s){if(!o||s)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const u=(g,f,p)=>{let y=0,b=0;const _=n[g]-e[f]-e[g];return _>0&&r&&(p?b=Pu[f]?_:-_:y=Pu[f]?_:-_),{left:y,top:b}},h=a==="left"||a==="right";if(c!=="center"){const g=kx[t],f=Po[g],p=ca[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[g]<y||e[f]<y?e[g]<e[f]?(c=Eu[l],d=u(p,f,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[f]<0&&e[g]>e[f]&&(c=Eu[l])}else{const g=a==="bottom"||a==="top"?"left":"top",f=Po[g],p=ca[g],y=(n[p]-e[p])/2;(e[g]<y||e[f]<y)&&(e[g]>e[f]?(c=Fu[g],d=u(p,g,h)):(c=Fu[f],d=u(p,f,h)))}let m=a;return e[a]<n[ca[a]]&&e[a]<e[Po[a]]&&(m=Po[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function Cx(t,e){return e?xx[t]:wx[t]}function Sx(t,e,n,r,o,s){if(s)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const Bx=ti([ti(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),ti(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[ti("> *",{pointerEvents:"all"})])]),Vu=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Zt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),o=i.ref(null),s=()=>{const{syncTrigger:m}=t;m.includes("scroll")&&e.addScrollListener(c),m.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),s())});const l=wi();Bx.mount({id:"vueuc/binder",head:!0,anchorMetaName:la,ssr:l}),i.onBeforeUnmount(()=>{a()}),Yw(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const g=e.targetRef,{x:f,y:p,overlap:y}=t,b=f!==void 0&&p!==void 0?Gw(f,p):oa(g);m.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:v,placement:w,internalShift:N,flip:$}=t;m.setAttribute("v-placement",w),y?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:x}=m;_==="target"?x.width=`${b.width}px`:_!==void 0?x.width=_:x.width="",v==="target"?x.minWidth=`${b.width}px`:v!==void 0?x.minWidth=v:x.minWidth="";const R=oa(m),C=oa(o.value),{left:B,top:T,placement:F}=vx(w,b,R,N,$,y),E=Cx(F,y),{left:M,top:W,transform:Q}=Sx(F,C,b,T,B,y);m.setAttribute("v-placement",F),m.style.setProperty("--v-offset-left",`${Math.round(B)}px`),m.style.setProperty("--v-offset-top",`${Math.round(T)}px`),m.style.transform=`translateX(${M}) translateY(${W}) ${Q}`,m.style.setProperty("--v-transform-origin",E),m.style.transformOrigin=E};i.watch(n,m=>{m?(s(),d()):a()});const d=()=>{i.nextTick().then(c).catch(m=>console.error(m))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(m=>{i.watch(i.toRef(t,m),c)}),["teleportDisabled"].forEach(m=>{i.watch(i.toRef(t,m),d)}),i.watch(i.toRef(t,"syncTrigger"),m=>{m.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),m.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=No(),h=Zt(()=>{const{to:m}=t;if(m!==void 0)return m;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(_x,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[fu,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var xi=[],Tx=function(){return xi.some(function(t){return t.activeTargets.length>0})},Nx=function(){return xi.some(function(t){return t.skippedTargets.length>0})},Iu="ResizeObserver loop completed with undelivered notifications.",$x=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Iu}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Iu),window.dispatchEvent(t)},Br;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Br||(Br={}));var ki=function(t){return Object.freeze(t)},Rx=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,ki(this)}return t})(),Mu=(function(){function t(e,n,r,o){return this.x=e,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ki(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,o=e.top,s=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:o,right:s,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),da=function(t){return t instanceof SVGElement&&"getBBox"in t},Au=function(t){if(da(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||t.getClientRects().length)},Ou=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Ex=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Tr=typeof window<"u"?window:{},Fo=new WeakMap,zu=/auto|scroll/,Px=/^tb|vertical/,Fx=/msie|trident/i.test(Tr.navigator&&Tr.navigator.userAgent),kn=function(t){return parseFloat(t||"0")},tr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Rx((n?e:t)||0,(n?t:e)||0)},Du=ki({devicePixelContentBoxSize:tr(),borderBoxSize:tr(),contentBoxSize:tr(),contentRect:new Mu(0,0,0,0)}),Lu=function(t,e){if(e===void 0&&(e=!1),Fo.has(t)&&!e)return Fo.get(t);if(Au(t))return Fo.set(t,Du),Du;var n=getComputedStyle(t),r=da(t)&&t.ownerSVGElement&&t.getBBox(),o=!Fx&&n.boxSizing==="border-box",s=Px.test(n.writingMode||""),a=!r&&zu.test(n.overflowY||""),l=!r&&zu.test(n.overflowX||""),c=r?0:kn(n.paddingTop),d=r?0:kn(n.paddingRight),u=r?0:kn(n.paddingBottom),h=r?0:kn(n.paddingLeft),m=r?0:kn(n.borderTopWidth),g=r?0:kn(n.borderRightWidth),f=r?0:kn(n.borderBottomWidth),p=r?0:kn(n.borderLeftWidth),y=h+d,b=c+u,_=p+g,v=m+f,w=l?t.offsetHeight-v-t.clientHeight:0,N=a?t.offsetWidth-_-t.clientWidth:0,$=o?y+_:0,x=o?b+v:0,R=r?r.width:kn(n.width)-$-N,C=r?r.height:kn(n.height)-x-w,B=R+y+N+_,T=C+b+w+v,F=ki({devicePixelContentBoxSize:tr(Math.round(R*devicePixelRatio),Math.round(C*devicePixelRatio),s),borderBoxSize:tr(B,T,s),contentBoxSize:tr(R,C,s),contentRect:new Mu(h,c,R,C)});return Fo.set(t,F),F},Hu=function(t,e,n){var r=Lu(t,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Br.DEVICE_PIXEL_CONTENT_BOX:return a;case Br.BORDER_BOX:return o;default:return s}},Vx=(function(){function t(e){var n=Lu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=ki([n.borderBoxSize]),this.contentBoxSize=ki([n.contentBoxSize]),this.devicePixelContentBoxSize=ki([n.devicePixelContentBoxSize])}return t})(),Wu=function(t){if(Au(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Ix=function(){var t=1/0,e=[];xi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new Vx(d.target),h=Wu(d.target);l.push(u),d.lastReportedSize=Hu(d.target,d.observedBox),h<t&&(t=h)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var o=r[n];o()}return t},ju=function(t){xi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(Wu(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Mx=function(){var t=0;for(ju(t);Tx();)t=Ix(),ju(t);return Nx()&&$x(),t>0},ua,qu=[],Ax=function(){return qu.splice(0).forEach(function(t){return t()})},Ox=function(t){if(!ua){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Ax()}).observe(n,r),ua=function(){n.textContent="".concat(e?e--:e++)}}qu.push(t),ua()},zx=function(t){Ox(function(){requestAnimationFrame(t)})},Vo=0,Dx=function(){return!!Vo},Lx=250,Hx={attributes:!0,characterData:!0,childList:!0,subtree:!0},Xu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Yu=function(t){return t===void 0&&(t=0),Date.now()+t},ha=!1,Wx=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Lx),!ha){ha=!0;var r=Yu(e);zx(function(){var o=!1;try{o=Mx()}finally{if(ha=!1,e=r-Yu(),!Dx())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Hx)};document.body?n():Tr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Xu.forEach(function(n){return Tr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Xu.forEach(function(n){return Tr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),fa=new Wx,Uu=function(t){!Vo&&t>0&&fa.start(),Vo+=t,!Vo&&fa.stop()},jx=function(t){return!da(t)&&!Ex(t)&&getComputedStyle(t).display==="inline"},qx=(function(){function t(e,n){this.target=e,this.observedBox=n||Br.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Hu(this.target,this.observedBox,!0);return jx(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Xx=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Io=new WeakMap,Ku=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Mo=(function(){function t(){}return t.connect=function(e,n){var r=new Xx(e,n);Io.set(e,r)},t.observe=function(e,n,r){var o=Io.get(e),s=o.observationTargets.length===0;Ku(o.observationTargets,n)<0&&(s&&xi.push(o),o.observationTargets.push(new qx(n,r&&r.box)),Uu(1),fa.schedule())},t.unobserve=function(e,n){var r=Io.get(e),o=Ku(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&xi.splice(xi.indexOf(r),1),r.observationTargets.splice(o,1),Uu(-1))},t.disconnect=function(e){var n=this,r=Io.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Yx=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Mo.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ou(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Mo.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ou(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Mo.unobserve(this,e)},t.prototype.disconnect=function(){Mo.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Ux{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Yx)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Nr=new Ux,Ao=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(o){const{onResize:s}=t;s!==void 0&&s(o)}i.onMounted(()=>{const o=n.$el;if(o===void 0){wu("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){wu("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Nr.registerHandler(o.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&Nr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Oo;function Kx(){return typeof document>"u"?!1:(Oo===void 0&&("matchMedia"in window?Oo=window.matchMedia("(pointer:coarse)").matches:Oo=!1),Oo)}let ma;function Gu(){return typeof document>"u"?1:(ma===void 0&&(ma="chrome"in window?window.devicePixelRatio:1),ma)}const Zu="VVirtualListXScroll";function Gx({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),o=i.ref(0),s=i.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new $u(d.length,0);return d.forEach((h,m)=>{u.add(m,h.width)}),u}),a=Zt(()=>{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=Zt(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return i.provide(Zu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Qu=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=i.inject(Zu);return{startIndex:t,endIndex:e,columns:n,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:o,getLeft:s,item:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:s});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),Zx=ti(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[ti("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[ti("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Qx=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=wi();Zx.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:la,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:E,defaultScrollKey:M}=t;E!=null?y({index:E}):M!=null&&y({key:M})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const o=Zt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let E=0;return t.columns.forEach(M=>{E+=M.width}),E}),s=i.computed(()=>{const E=new Map,{keyField:M}=t;return t.items.forEach((W,Q)=>{E.set(W[M],Q)}),E}),{scrollLeftRef:a,listWidthRef:l}=Gx({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:E,itemSize:M,keyField:W}=t,Q=new $u(E.length,M);return E.forEach((G,z)=>{const P=G[W],L=u.get(P);L!==void 0&&Q.add(z,L)}),Q}),m=i.ref(0),g=i.ref(0),f=Zt(()=>Math.max(h.value.getBound(g.value-vr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:E}=d;if(E===void 0)return[];const{items:M,itemSize:W}=t,Q=f.value,G=Math.min(Q+Math.ceil(E/W+1),M.length-1),z=[];for(let P=Q;P<=G;++P)z.push(M[P]);return z}),y=(E,M)=>{if(typeof E=="number"){w(E,M,"auto");return}const{left:W,top:Q,index:G,key:z,position:P,behavior:L,debounce:D=!0}=E;if(W!==void 0||Q!==void 0)w(W,Q,L);else if(G!==void 0)v(G,L,D);else if(z!==void 0){const H=s.value.get(z);H!==void 0&&v(H,L,D)}else P==="bottom"?w(0,Number.MAX_SAFE_INTEGER,L):P==="top"&&w(0,0,L)};let b,_=null;function v(E,M,W){const{value:Q}=h,G=Q.sum(E)+vr(t.paddingTop);if(!W)c.value.scrollTo({left:0,top:G,behavior:M});else{b=E,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:z,offsetHeight:P}=c.value;if(G>z){const L=Q.get(E);G+L<=z+P||c.value.scrollTo({left:0,top:G+L-P,behavior:M})}else c.value.scrollTo({left:0,top:G,behavior:M})}}function w(E,M,W){c.value.scrollTo({left:E,top:M,behavior:W})}function N(E,M){var W,Q,G;if(n||t.ignoreItemResize||F(M.target))return;const{value:z}=h,P=s.value.get(E),L=z.get(P),D=(G=(Q=(W=M.borderBoxSize)===null||W===void 0?void 0:W[0])===null||Q===void 0?void 0:Q.blockSize)!==null&&G!==void 0?G:M.contentRect.height;if(D===L)return;D-t.itemSize===0?u.delete(E):u.set(E,D-t.itemSize);const U=D-L;if(U===0)return;z.add(P,U);const K=c.value;if(K!=null){if(b===void 0){const I=z.sum(P);K.scrollTop>I&&K.scrollBy(0,U)}else if(P<b)K.scrollBy(0,U);else if(P===b){const I=z.sum(P);D+I>K.scrollTop+K.offsetHeight&&K.scrollBy(0,U)}T()}m.value++}const $=!Kx();let x=!1;function R(E){var M;(M=t.onScroll)===null||M===void 0||M.call(t,E),(!$||!x)&&T()}function C(E){var M;if((M=t.onWheel)===null||M===void 0||M.call(t,E),$){const W=c.value;if(W!=null){if(E.deltaX===0&&(W.scrollTop===0&&E.deltaY<=0||W.scrollTop+W.offsetHeight>=W.scrollHeight&&E.deltaY>=0))return;E.preventDefault(),W.scrollTop+=E.deltaY/Gu(),W.scrollLeft+=E.deltaX/Gu(),T(),x=!0,nu(()=>{x=!1})}}}function B(E){if(n||F(E.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(E.contentRect.height===d.value)return}else if(E.contentRect.height===d.value&&E.contentRect.width===l.value)return;d.value=E.contentRect.height,l.value=E.contentRect.width;const{onResize:M}=t;M!==void 0&&M(E)}function T(){const{value:E}=c;E!=null&&(g.value=E.scrollTop,a.value=E.scrollLeft)}function F(E){let M=E;for(;M!==null;){if(M.style.display==="none")return!0;M=M.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:i.computed(()=>{const{itemResizable:E}=t,M=Cr(h.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:Cr(o.value),height:E?"":M,minHeight:E?M:"",paddingTop:Cr(t.paddingTop),paddingBottom:Cr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${Cr(h.value.sum(f.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:B,handleListScroll:R,handleListWheel:C,handleItemResize:N}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Ao,{onResize:this.handleListResize},{default:()=>{var o,s;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=n.get(d),h=a!=null?i.h(Qu,{index:u,item:c}):void 0,m=l!=null?i.h(Qu,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:m,index:u})[0];return t?i.h(Ao,{key:d,onResize:f=>this.handleItemResize(d,f)},{default:()=>g}):(g.key=d,g)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),En="v-hidden",Jx=ti("[v-hidden]",{display:"none!important"}),Ju=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function o(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(En)&&u.removeAttribute(En);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const v of h)v.hasAttribute(En)&&v.removeAttribute(En);const m=l.offsetWidth,g=[],f=e.tail?d==null?void 0:d():null;let p=f?f.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let v=0;v<b-1;++v){if(v<0)continue;const w=h[v];if(y){w.hasAttribute(En)||w.setAttribute(En,"");continue}else w.hasAttribute(En)&&w.removeAttribute(En);const N=w.offsetWidth;if(p+=N,g[v]=N,p>m){const{updateCounter:$}=t;for(let x=v;x>=0;--x){const R=b-1-x;$!==void 0?$(R):u.textContent=`${R}`;const C=u.offsetWidth;if(p-=g[x],p+C<=m||x===0){y=!0,v=x-1,f&&(v===-1?(f.style.maxWidth=`${m-C}px`,f.style.boxSizing="border-box"):f.style.maxWidth="");const{onUpdateCount:B}=t;B&&B(R);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(En,""))}const s=wi();return Jx.mount({id:"vueuc/overflow",head:!0,anchorMetaName:la,ssr:s}),i.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:o}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function eh(t){return t instanceof HTMLElement}function th(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(eh(n)&&(ih(n)||th(n)))return!0}return!1}function nh(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(eh(n)&&(ih(n)||nh(n)))return!0}return!1}function ih(t){if(!ek(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function ek(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let $r=[];const tk=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=cw(),n=i.ref(null),r=i.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return $r[$r.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(h(),Et("keydown",document,c)):(at("keydown",document,c),o&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{at("keydown",document,c),o&&m()});function d(y){if(!s&&l()){const b=u();if(b===null||b.contains(kr(y)))return;g("first")}}function u(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function h(){var y;if(!t.disabled){if($r.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?g("first"):(y=Ru(b))===null||y===void 0||y.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function m(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),$r=$r.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=Ru(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function g(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const v=u();if(v==null||v===_){s=!0,b.focus({preventScroll:!0}),s=!1;return}s=!0;const w=y==="first"?th(v):nh(v);s=!1,w||(s=!0,b.focus({preventScroll:!0}),s=!1)}}}function f(y){if(s)return;const b=u();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?g("last"):g("first"))}function p(y){s||(y.relatedTarget!==null&&y.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:f,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function n5(t){return t}const ga="n-internal-select-menu",rh="n-internal-select-menu-body",oh="n-drawer-body",sh="n-modal-body",ah="n-popover-body",lh="__disabled__";function Pn(t){const e=i.inject(sh,null),n=i.inject(oh,null),r=i.inject(ah,null),o=i.inject(rh,null),s=i.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};i.onMounted(()=>{Et("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{at("fullscreenchange",document,a)})}return Zt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?lh:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}Pn.tdkey=lh,Pn.propTo={type:[String,Object,Boolean],default:void 0};function nk(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function ch(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&Nr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&Nr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&Nr.unregisterHandler(n)}))}function dh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const ik=/^(\d|\.)+$/,uh=/(\d|\.)+/;function pa(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+n)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(ik.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=uh.exec(t);return o?t.replace(uh,String((Number(o[0])+n)*e)):t}return t}function hh(t){const{left:e,right:n,top:r,bottom:o}=rn(t);return`${r} ${e} ${o} ${n}`}var fh={};function rk(t){let e=".",n="__",r="--",o;if(t){let f=t.blockPrefix;f&&(e=f),f=t.elementPrefix,f&&(n=f),f=t.modifierPrefix,f&&(r=f)}const s={install(f){o=f.c;const p=f.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(f){let p,y;return{before(b){p=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=p,b.bem.els=y},$({context:b,props:_}){return f=typeof f=="string"?f:f({context:b,props:_}),b.bem.b=f,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(f){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return f=typeof f=="string"?f:f({context:y,props:b}),y.bem.els=f.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(f){return{$({context:p,props:y}){f=typeof f=="string"?f:f({context:p,props:y});const b=f.split(",").map(w=>w.trim());function _(w){return b.map(N=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${w!==void 0?`${n}${w}`:""}${r}${N}`).join(", ")}const v=p.bem.els;if(v!==null){if(fh.NODE_ENV!=="production"&&v.length>=2)throw Error(`[css-render/plugin-bem]: m(${f}) is invalid, using modifier inside multiple elements is not allowed`);return _(v[0])}else return _()}}}function d(f){return{$({context:p,props:y}){f=typeof f=="string"?f:f({context:p,props:y});const b=p.bem.els;if(fh.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${f}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${f})`}}}return Object.assign(s,{cB:((...f)=>o(a(f[0]),f[1],f[2])),cE:((...f)=>o(l(f[0]),f[1],f[2])),cM:((...f)=>o(c(f[0]),f[1],f[2])),cNotM:((...f)=>o(d(f[0]),f[1],f[2]))}),s}const ok=".n-",sk="__",ak="--",mh=Tu(),gh=rk({blockPrefix:ok,elementPrefix:sk,modifierPrefix:ak});mh.use(gh);const{c:he,find:r5}=mh,{cB:ye,cE:we,cM:Re,cNotM:on}=gh,lk=(...t)=>he(">",[ye(...t)]);function Je(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ya;function ck(){return ya===void 0&&(ya=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ya}const dk=new WeakSet;function uk(t){dk.add(t)}function ph(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const yh=new Set;function ni(t,e){const n=`[naive/${t}]: ${e}`;yh.has(n)||(yh.add(n),console.error(n))}function bh(t,e){console.error(`[naive/${t}]: ${e}`)}function _h(t,e){throw new Error(`[naive/${t}]: ${e}`)}function wt(t,...e){if(Array.isArray(t))t.forEach(n=>wt(n,...e));else return t(...e)}function ba(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ba(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ba(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function hk(t,e="default",n=void 0){const r=t[e];if(!r)return bh("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=ba(r(n));return o.length===1?o[0]:(bh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function fk(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function _a(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function nr(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function zo(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!zo(e.children)):!0)?t:null}function wa(t,e){return t&&zo(t())||e()}function vi(t,e){const n=t&&zo(t());return e(n||null)}function wh(t){return!(t&&zo(t()))}const xa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Ci="n-config-provider",mk="n";function Si(t={},e={defaultBordered:!0}){const n=i.inject(Ci,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,o;const{bordered:s}=t;return s!==void 0?s:(o=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(mk),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Bi(t,e,n,r){n||_h("useThemeClass","cssVarsRef is not passed");const o=i.inject(Ci,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=i.ref(""),c=wi();let d;const u=`__${t}`,h=()=>{let m=u;const g=e?e.value:void 0,f=s==null?void 0:s.value;f&&(m+=`-${f}`),g&&(m+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(m+=`-${aa(JSON.stringify(p))}`),y&&(m+=`-${aa(JSON.stringify(y))}`),l.value=m,d=()=>{const b=n.value;let _="";for(const v in b)_+=`${v}: ${b[v]};`;he(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const xh="n-form-item";function gk(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const o=i.inject(xh,null);i.provide(xh,null);const s=i.computed(n?()=>n(o):()=>{const{size:c}=t;if(c)return c;if(o){const{mergedSize:d}=o;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{o&&o.restoreValidation()}),{mergedSizeRef:s,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}const pk={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ka(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Rr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;o=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function Er(t){return(e,n={})=>{const r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(o);if(!s)return null;const a=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?bk(l,h=>h.test(a)):yk(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function yk(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function bk(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function _k(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const o=r[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const wk={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xk=(t,e,n)=>{let r;const o=wk[t];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},kk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vk=(t,e,n,r)=>kk[t],Ck={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Sk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bk={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"]},Tk={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"]},Nk={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"}},$k={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"}},Rk={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Rr({values:Ck,defaultWidth:"wide"}),quarter:Rr({values:Sk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Rr({values:Bk,defaultWidth:"wide"}),day:Rr({values:Tk,defaultWidth:"wide"}),dayPeriod:Rr({values:Nk,defaultWidth:"wide",formattingValues:$k,defaultFormattingWidth:"wide"})},Ek=/^(\d+)(th|st|nd|rd)?/i,Pk=/\d+/i,Fk={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},Vk={any:[/^b/i,/^(a|c)/i]},Ik={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mk={any:[/1/i,/2/i,/3/i,/4/i]},Ak={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},Ok={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]},zk={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},Dk={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]},Lk={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},Hk={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}},Wk={ordinalNumber:_k({matchPattern:Ek,parsePattern:Pk,valueCallback:t=>parseInt(t,10)}),era:Er({matchPatterns:Fk,defaultMatchWidth:"wide",parsePatterns:Vk,defaultParseWidth:"any"}),quarter:Er({matchPatterns:Ik,defaultMatchWidth:"wide",parsePatterns:Mk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Er({matchPatterns:Ak,defaultMatchWidth:"wide",parsePatterns:Ok,defaultParseWidth:"any"}),day:Er({matchPatterns:zk,defaultMatchWidth:"wide",parsePatterns:Dk,defaultParseWidth:"any"}),dayPeriod:Er({matchPatterns:Lk,defaultMatchWidth:"any",parsePatterns:Hk,defaultParseWidth:"any"})},jk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yk={date:ka({formats:jk,defaultWidth:"full"}),time:ka({formats:qk,defaultWidth:"full"}),dateTime:ka({formats:Xk,defaultWidth:"full"})},Uk={name:"en-US",locale:{code:"en-US",formatDistance:xk,formatLong:Yk,formatRelative:vk,localize:Rk,match:Wk,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function kh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(Ci,null)||{},r=i.computed(()=>{var s,a;return(a=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[t])!==null&&a!==void 0?a:pk[t]});return{dateLocaleRef:i.computed(()=>{var s;return(s=n==null?void 0:n.value)!==null&&s!==void 0?s:Uk}),localeRef:r}}const Pr="naive-ui-style";function Fr(t,e,n){if(!e)return;const r=wi(),o=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=i.inject(Ci,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(bx(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Pr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():i.onBeforeMount(a),o}const Vr={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:Kk,fontFamily:Gk,lineHeight:Zk}=Vr,vh=he("body",`
116
+ `)}function aa(t){for(var e=0,n,r=0,o=t.length;o>=4;++r,o-=4)n=t.charCodeAt(r)&255|(t.charCodeAt(++r)&255)<<8|(t.charCodeAt(++r)&255)<<16|(t.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,e=(n&65535)*1540483477+((n>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(o){case 3:e^=(t.charCodeAt(r+2)&255)<<16;case 2:e^=(t.charCodeAt(r+1)&255)<<8;case 1:e^=t.charCodeAt(r)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function hx(t,e,n,r){const{els:o}=e;if(n===void 0)o.forEach(ku),e.els=[];else{const s=$o(n,r);s&&o.includes(s)&&(ku(s),e.els=o.filter(a=>a!==s))}}function Bu(t,e){t.push(e)}function fx(t,e,n,r,o,s,a,l,c){let d;if(n===void 0&&(d=e.render(r),n=aa(d)),c){c.adapter(n,d??e.render(r));return}l===void 0&&(l=document.head);const u=$o(n,l);if(u!==null&&!s)return u;const h=u??ax(n);if(d===void 0&&(d=e.render(r)),h.textContent=d,u!==null)return u;if(a){const m=l.querySelector(`meta[name="${a}"]`);if(m)return l.insertBefore(h,m),Bu(e.els,h),h}return o?l.insertBefore(h,l.querySelector("style, link")):l.appendChild(h),Bu(e.els,h),h}function mx(t){return ux(this,this.instance,t)}function gx(t={}){const{id:e,ssr:n,props:r,head:o=!1,force:s=!1,anchorMetaName:a,parent:l}=t;return fx(this.instance,this,e,r,o,s,a,l,n)}function px(t={}){const{id:e,parent:n}=t;hx(this.instance,this,e,n)}const Eo=function(t,e,n,r){return{instance:t,$:e,props:n,children:r,els:[],render:mx,mount:gx,unmount:px}},yx=function(t,e,n,r){return Array.isArray(e)?Eo(t,{$:null},null,e):Array.isArray(n)?Eo(t,e,null,n):Array.isArray(r)?Eo(t,e,n,r):Eo(t,e,n,null)};function Tu(t={}){const e={c:((...n)=>yx(e,...n)),use:(n,...r)=>n.install(e,...r),find:$o,context:{},config:t};return e}function bx(t,e){if(t===void 0)return!1;if(e){const{context:{ids:n}}=e;return n.has(t)}return $o(t)!==null}const{c:ti}=Tu(),la="vueuc-style";function Nu(t){return t&-t}class $u{constructor(e,n){this.l=e,this.min=n;const r=new Array(e+1);for(let o=0;o<e+1;++o)r[o]=0;this.ft=r}add(e,n){if(n===0)return;const{l:r,ft:o}=this;for(e+=1;e<=r;)o[e]+=n,e+=Nu(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;const{ft:n,min:r,l:o}=this;if(e>o)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let s=e*r;for(;e>0;)s+=n[e],e-=Nu(e);return s}getBound(e){let n=0,r=this.l;for(;r>n;){const o=Math.floor((n+r)/2),s=this.sum(o);if(s>e){r=o;continue}else if(s<e){if(n===o)return this.sum(n+1)<=e?n+1:o;n=o}else return o}return n}}function Ru(t){return typeof t=="string"?document.querySelector(t):t()||null}const _x=i.defineComponent({name:"LazyTeleport",props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(t){return{showTeleport:qw(i.toRef(t,"show")),mergedTo:i.computed(()=>{const{to:e}=t;return e??"body"})}},render(){return this.showTeleport?this.disabled?ia("lazy-teleport",this.$slots):i.h(i.Teleport,{disabled:this.disabled,to:this.mergedTo},ia("lazy-teleport",this.$slots)):null}}),Po={top:"bottom",bottom:"top",left:"right",right:"left"},Eu={start:"end",center:"center",end:"start"},ca={top:"height",bottom:"height",left:"width",right:"width"},wx={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},xx={"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"},kx={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},Pu={top:!0,bottom:!1,left:!0,right:!1},Fu={top:"end",bottom:"start",left:"end",right:"start"};function vx(t,e,n,r,o,s){if(!o||s)return{placement:t,top:0,left:0};const[a,l]=t.split("-");let c=l??"center",d={top:0,left:0};const u=(g,f,p)=>{let y=0,b=0;const _=n[g]-e[f]-e[g];return _>0&&r&&(p?b=Pu[f]?_:-_:y=Pu[f]?_:-_),{left:y,top:b}},h=a==="left"||a==="right";if(c!=="center"){const g=kx[t],f=Po[g],p=ca[g];if(n[p]>e[p]){if(e[g]+e[p]<n[p]){const y=(n[p]-e[p])/2;e[g]<y||e[f]<y?e[g]<e[f]?(c=Eu[l],d=u(p,f,h)):d=u(p,g,h):c="center"}}else n[p]<e[p]&&e[f]<0&&e[g]>e[f]&&(c=Eu[l])}else{const g=a==="bottom"||a==="top"?"left":"top",f=Po[g],p=ca[g],y=(n[p]-e[p])/2;(e[g]<y||e[f]<y)&&(e[g]>e[f]?(c=Fu[g],d=u(p,g,h)):(c=Fu[f],d=u(p,f,h)))}let m=a;return e[a]<n[ca[a]]&&e[a]<e[Po[a]]&&(m=Po[a]),{placement:c!=="center"?`${m}-${c}`:m,left:d.left,top:d.top}}function Cx(t,e){return e?xx[t]:wx[t]}function Sx(t,e,n,r,o,s){if(s)switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"top-end":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%)"};case"right-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left)}px`,transform:""};case"left-end":return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left+n.width)}px`,transform:"translateX(-100%) translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2)}px`,left:`${Math.round(n.left-e.left)}px`,transform:"translateY(-50%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height)}px`,left:`${Math.round(n.left-e.left+n.width/2)}px`,transform:"translateX(-50%) translateY(-100%)"}}switch(t){case"bottom-start":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:""};case"bottom-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%)"};case"top-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-100%)"};case"top-end":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"right-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:""};case"right-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-100%)"};case"left-start":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%)"};case"left-end":return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateX(-100%) translateY(-100%)"};case"top":return{top:`${Math.round(n.top-e.top+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateY(-100%) translateX(-50%)"};case"right":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+n.width+o)}px`,transform:"translateY(-50%)"};case"left":return{top:`${Math.round(n.top-e.top+n.height/2+r)}px`,left:`${Math.round(n.left-e.left+o)}px`,transform:"translateY(-50%) translateX(-100%)"};case"bottom":default:return{top:`${Math.round(n.top-e.top+n.height+r)}px`,left:`${Math.round(n.left-e.left+n.width/2+o)}px`,transform:"translateX(-50%)"}}}const Bx=ti([ti(".v-binder-follower-container",{position:"absolute",left:"0",right:"0",top:"0",height:"0",pointerEvents:"none",zIndex:"auto"}),ti(".v-binder-follower-content",{position:"absolute",zIndex:"auto"},[ti("> *",{pointerEvents:"all"})])]),Vu=i.defineComponent({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(t){const e=i.inject("VBinder"),n=Zt(()=>t.enabled!==void 0?t.enabled:t.show),r=i.ref(null),o=i.ref(null),s=()=>{const{syncTrigger:m}=t;m.includes("scroll")&&e.addScrollListener(c),m.includes("resize")&&e.addResizeListener(c)},a=()=>{e.removeScrollListener(c),e.removeResizeListener(c)};i.onMounted(()=>{n.value&&(c(),s())});const l=wi();Bx.mount({id:"vueuc/binder",head:!0,anchorMetaName:la,ssr:l}),i.onBeforeUnmount(()=>{a()}),Yw(()=>{n.value&&c()});const c=()=>{if(!n.value)return;const m=r.value;if(m===null)return;const g=e.targetRef,{x:f,y:p,overlap:y}=t,b=f!==void 0&&p!==void 0?Gw(f,p):oa(g);m.style.setProperty("--v-target-width",`${Math.round(b.width)}px`),m.style.setProperty("--v-target-height",`${Math.round(b.height)}px`);const{width:_,minWidth:v,placement:w,internalShift:N,flip:$}=t;m.setAttribute("v-placement",w),y?m.setAttribute("v-overlap",""):m.removeAttribute("v-overlap");const{style:x}=m;_==="target"?x.width=`${b.width}px`:_!==void 0?x.width=_:x.width="",v==="target"?x.minWidth=`${b.width}px`:v!==void 0?x.minWidth=v:x.minWidth="";const R=oa(m),C=oa(o.value),{left:B,top:T,placement:F}=vx(w,b,R,N,$,y),E=Cx(F,y),{left:M,top:W,transform:Q}=Sx(F,C,b,T,B,y);m.setAttribute("v-placement",F),m.style.setProperty("--v-offset-left",`${Math.round(B)}px`),m.style.setProperty("--v-offset-top",`${Math.round(T)}px`),m.style.transform=`translateX(${M}) translateY(${W}) ${Q}`,m.style.setProperty("--v-transform-origin",E),m.style.transformOrigin=E};i.watch(n,m=>{m?(s(),d()):a()});const d=()=>{i.nextTick().then(c).catch(m=>console.error(m))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(m=>{i.watch(i.toRef(t,m),c)}),["teleportDisabled"].forEach(m=>{i.watch(i.toRef(t,m),d)}),i.watch(i.toRef(t,"syncTrigger"),m=>{m.includes("resize")?e.addResizeListener(c):e.removeResizeListener(c),m.includes("scroll")?e.addScrollListener(c):e.removeScrollListener(c)});const u=No(),h=Zt(()=>{const{to:m}=t;if(m!==void 0)return m;u.value});return{VBinder:e,mergedEnabled:n,offsetContainerRef:o,followerRef:r,mergedTo:h,syncPosition:c}},render(){return i.h(_x,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var t,e;const n=i.h("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[i.h("div",{class:"v-binder-follower-content",ref:"followerRef"},(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t))]);return this.zindexable?i.withDirectives(n,[[fu,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});var xi=[],Tx=function(){return xi.some(function(t){return t.activeTargets.length>0})},Nx=function(){return xi.some(function(t){return t.skippedTargets.length>0})},Iu="ResizeObserver loop completed with undelivered notifications.",$x=function(){var t;typeof ErrorEvent=="function"?t=new ErrorEvent("error",{message:Iu}):(t=document.createEvent("Event"),t.initEvent("error",!1,!1),t.message=Iu),window.dispatchEvent(t)},Br;(function(t){t.BORDER_BOX="border-box",t.CONTENT_BOX="content-box",t.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Br||(Br={}));var ki=function(t){return Object.freeze(t)},Rx=(function(){function t(e,n){this.inlineSize=e,this.blockSize=n,ki(this)}return t})(),Mu=(function(){function t(e,n,r,o){return this.x=e,this.y=n,this.width=r,this.height=o,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ki(this)}return t.prototype.toJSON=function(){var e=this,n=e.x,r=e.y,o=e.top,s=e.right,a=e.bottom,l=e.left,c=e.width,d=e.height;return{x:n,y:r,top:o,right:s,bottom:a,left:l,width:c,height:d}},t.fromRect=function(e){return new t(e.x,e.y,e.width,e.height)},t})(),da=function(t){return t instanceof SVGElement&&"getBBox"in t},Au=function(t){if(da(t)){var e=t.getBBox(),n=e.width,r=e.height;return!n&&!r}var o=t,s=o.offsetWidth,a=o.offsetHeight;return!(s||a||t.getClientRects().length)},Ou=function(t){var e;if(t instanceof Element)return!0;var n=(e=t==null?void 0:t.ownerDocument)===null||e===void 0?void 0:e.defaultView;return!!(n&&t instanceof n.Element)},Ex=function(t){switch(t.tagName){case"INPUT":if(t.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Tr=typeof window<"u"?window:{},Fo=new WeakMap,zu=/auto|scroll/,Px=/^tb|vertical/,Fx=/msie|trident/i.test(Tr.navigator&&Tr.navigator.userAgent),kn=function(t){return parseFloat(t||"0")},tr=function(t,e,n){return t===void 0&&(t=0),e===void 0&&(e=0),n===void 0&&(n=!1),new Rx((n?e:t)||0,(n?t:e)||0)},Du=ki({devicePixelContentBoxSize:tr(),borderBoxSize:tr(),contentBoxSize:tr(),contentRect:new Mu(0,0,0,0)}),Lu=function(t,e){if(e===void 0&&(e=!1),Fo.has(t)&&!e)return Fo.get(t);if(Au(t))return Fo.set(t,Du),Du;var n=getComputedStyle(t),r=da(t)&&t.ownerSVGElement&&t.getBBox(),o=!Fx&&n.boxSizing==="border-box",s=Px.test(n.writingMode||""),a=!r&&zu.test(n.overflowY||""),l=!r&&zu.test(n.overflowX||""),c=r?0:kn(n.paddingTop),d=r?0:kn(n.paddingRight),u=r?0:kn(n.paddingBottom),h=r?0:kn(n.paddingLeft),m=r?0:kn(n.borderTopWidth),g=r?0:kn(n.borderRightWidth),f=r?0:kn(n.borderBottomWidth),p=r?0:kn(n.borderLeftWidth),y=h+d,b=c+u,_=p+g,v=m+f,w=l?t.offsetHeight-v-t.clientHeight:0,N=a?t.offsetWidth-_-t.clientWidth:0,$=o?y+_:0,x=o?b+v:0,R=r?r.width:kn(n.width)-$-N,C=r?r.height:kn(n.height)-x-w,B=R+y+N+_,T=C+b+w+v,F=ki({devicePixelContentBoxSize:tr(Math.round(R*devicePixelRatio),Math.round(C*devicePixelRatio),s),borderBoxSize:tr(B,T,s),contentBoxSize:tr(R,C,s),contentRect:new Mu(h,c,R,C)});return Fo.set(t,F),F},Hu=function(t,e,n){var r=Lu(t,n),o=r.borderBoxSize,s=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(e){case Br.DEVICE_PIXEL_CONTENT_BOX:return a;case Br.BORDER_BOX:return o;default:return s}},Vx=(function(){function t(e){var n=Lu(e);this.target=e,this.contentRect=n.contentRect,this.borderBoxSize=ki([n.borderBoxSize]),this.contentBoxSize=ki([n.contentBoxSize]),this.devicePixelContentBoxSize=ki([n.devicePixelContentBoxSize])}return t})(),Wu=function(t){if(Au(t))return 1/0;for(var e=0,n=t.parentNode;n;)e+=1,n=n.parentNode;return e},Ix=function(){var t=1/0,e=[];xi.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(d){var u=new Vx(d.target),h=Wu(d.target);l.push(u),d.lastReportedSize=Hu(d.target,d.observedBox),h<t&&(t=h)}),e.push(function(){a.callback.call(a.observer,l,a.observer)}),a.activeTargets.splice(0,a.activeTargets.length)}});for(var n=0,r=e;n<r.length;n++){var o=r[n];o()}return t},ju=function(t){xi.forEach(function(n){n.activeTargets.splice(0,n.activeTargets.length),n.skippedTargets.splice(0,n.skippedTargets.length),n.observationTargets.forEach(function(o){o.isActive()&&(Wu(o.target)>t?n.activeTargets.push(o):n.skippedTargets.push(o))})})},Mx=function(){var t=0;for(ju(t);Tx();)t=Ix(),ju(t);return Nx()&&$x(),t>0},ua,qu=[],Ax=function(){return qu.splice(0).forEach(function(t){return t()})},Ox=function(t){if(!ua){var e=0,n=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return Ax()}).observe(n,r),ua=function(){n.textContent="".concat(e?e--:e++)}}qu.push(t),ua()},zx=function(t){Ox(function(){requestAnimationFrame(t)})},Vo=0,Dx=function(){return!!Vo},Lx=250,Hx={attributes:!0,characterData:!0,childList:!0,subtree:!0},Xu=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Yu=function(t){return t===void 0&&(t=0),Date.now()+t},ha=!1,Wx=(function(){function t(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return t.prototype.run=function(e){var n=this;if(e===void 0&&(e=Lx),!ha){ha=!0;var r=Yu(e);zx(function(){var o=!1;try{o=Mx()}finally{if(ha=!1,e=r-Yu(),!Dx())return;o?n.run(1e3):e>0?n.run(e):n.start()}})}},t.prototype.schedule=function(){this.stop(),this.run()},t.prototype.observe=function(){var e=this,n=function(){return e.observer&&e.observer.observe(document.body,Hx)};document.body?n():Tr.addEventListener("DOMContentLoaded",n)},t.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Xu.forEach(function(n){return Tr.addEventListener(n,e.listener,!0)}))},t.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),Xu.forEach(function(n){return Tr.removeEventListener(n,e.listener,!0)}),this.stopped=!0)},t})(),fa=new Wx,Uu=function(t){!Vo&&t>0&&fa.start(),Vo+=t,!Vo&&fa.stop()},jx=function(t){return!da(t)&&!Ex(t)&&getComputedStyle(t).display==="inline"},qx=(function(){function t(e,n){this.target=e,this.observedBox=n||Br.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return t.prototype.isActive=function(){var e=Hu(this.target,this.observedBox,!0);return jx(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},t})(),Xx=(function(){function t(e,n){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=n}return t})(),Io=new WeakMap,Ku=function(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1},Mo=(function(){function t(){}return t.connect=function(e,n){var r=new Xx(e,n);Io.set(e,r)},t.observe=function(e,n,r){var o=Io.get(e),s=o.observationTargets.length===0;Ku(o.observationTargets,n)<0&&(s&&xi.push(o),o.observationTargets.push(new qx(n,r&&r.box)),Uu(1),fa.schedule())},t.unobserve=function(e,n){var r=Io.get(e),o=Ku(r.observationTargets,n),s=r.observationTargets.length===1;o>=0&&(s&&xi.splice(xi.indexOf(r),1),r.observationTargets.splice(o,1),Uu(-1))},t.disconnect=function(e){var n=this,r=Io.get(e);r.observationTargets.slice().forEach(function(o){return n.unobserve(e,o.target)}),r.activeTargets.splice(0,r.activeTargets.length)},t})(),Yx=(function(){function t(e){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof e!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Mo.connect(this,e)}return t.prototype.observe=function(e,n){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ou(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Mo.observe(this,e,n)},t.prototype.unobserve=function(e){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ou(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Mo.unobserve(this,e)},t.prototype.disconnect=function(){Mo.disconnect(this)},t.toString=function(){return"function ResizeObserver () { [polyfill code] }"},t})();class Ux{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Yx)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(const n of e){const r=this.elHandlersMap.get(n.target);r!==void 0&&r(n)}}registerHandler(e,n){this.elHandlersMap.set(e,n),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}}const Nr=new Ux,Ao=i.defineComponent({name:"ResizeObserver",props:{onResize:Function},setup(t){let e=!1;const n=i.getCurrentInstance().proxy;function r(o){const{onResize:s}=t;s!==void 0&&s(o)}i.onMounted(()=>{const o=n.$el;if(o===void 0){wu("resize-observer","$el does not exist.");return}if(o.nextElementSibling!==o.nextSibling&&o.nodeType===3&&o.nodeValue!==""){wu("resize-observer","$el can not be observed (it may be a text node).");return}o.nextElementSibling!==null&&(Nr.registerHandler(o.nextElementSibling,r),e=!0)}),i.onBeforeUnmount(()=>{e&&Nr.unregisterHandler(n.$el.nextElementSibling)})},render(){return i.renderSlot(this.$slots,"default")}});let Oo;function Kx(){return typeof document>"u"?!1:(Oo===void 0&&("matchMedia"in window?Oo=window.matchMedia("(pointer:coarse)").matches:Oo=!1),Oo)}let ma;function Gu(){return typeof document>"u"?1:(ma===void 0&&(ma="chrome"in window?window.devicePixelRatio:1),ma)}const Zu="VVirtualListXScroll";function Gx({columnsRef:t,renderColRef:e,renderItemWithColsRef:n}){const r=i.ref(0),o=i.ref(0),s=i.computed(()=>{const d=t.value;if(d.length===0)return null;const u=new $u(d.length,0);return d.forEach((h,m)=>{u.add(m,h.width)}),u}),a=Zt(()=>{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=Zt(()=>{const d=s.value;return d!==null?Math.min(d.getBound(o.value+r.value)+1,t.value.length-1):0});return i.provide(Zu,{startIndexRef:a,endIndexRef:c,columnsRef:t,renderColRef:e,renderItemWithColsRef:n,getLeft:l}),{listWidthRef:r,scrollLeftRef:o}}const Qu=i.defineComponent({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:t,endIndexRef:e,columnsRef:n,getLeft:r,renderColRef:o,renderItemWithColsRef:s}=i.inject(Zu);return{startIndex:t,endIndex:e,columns:n,renderCol:o,renderItemWithCols:s,getLeft:r}},render(){const{startIndex:t,endIndex:e,columns:n,renderCol:r,renderItemWithCols:o,getLeft:s,item:a}=this;if(o!=null)return o({itemIndex:this.index,startColIndex:t,endColIndex:e,allColumns:n,item:a,getLeft:s});if(r!=null){const l=[];for(let c=t;c<=e;++c){const d=n[c];l.push(r({column:d,left:s(c),item:a}))}return l}return null}}),Zx=ti(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[ti("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[ti("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),Qx=i.defineComponent({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(t){const e=wi();Zx.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:la,ssr:e}),i.onMounted(()=>{const{defaultScrollIndex:E,defaultScrollKey:M}=t;E!=null?y({index:E}):M!=null&&y({key:M})});let n=!1,r=!1;i.onActivated(()=>{if(n=!1,!r){r=!0;return}y({top:g.value,left:a.value})}),i.onDeactivated(()=>{n=!0,r||(r=!0)});const o=Zt(()=>{if(t.renderCol==null&&t.renderItemWithCols==null||t.columns.length===0)return;let E=0;return t.columns.forEach(M=>{E+=M.width}),E}),s=i.computed(()=>{const E=new Map,{keyField:M}=t;return t.items.forEach((W,Q)=>{E.set(W[M],Q)}),E}),{scrollLeftRef:a,listWidthRef:l}=Gx({columnsRef:i.toRef(t,"columns"),renderColRef:i.toRef(t,"renderCol"),renderItemWithColsRef:i.toRef(t,"renderItemWithCols")}),c=i.ref(null),d=i.ref(void 0),u=new Map,h=i.computed(()=>{const{items:E,itemSize:M,keyField:W}=t,Q=new $u(E.length,M);return E.forEach((G,z)=>{const P=G[W],L=u.get(P);L!==void 0&&Q.add(z,L)}),Q}),m=i.ref(0),g=i.ref(0),f=Zt(()=>Math.max(h.value.getBound(g.value-vr(t.paddingTop))-1,0)),p=i.computed(()=>{const{value:E}=d;if(E===void 0)return[];const{items:M,itemSize:W}=t,Q=f.value,G=Math.min(Q+Math.ceil(E/W+1),M.length-1),z=[];for(let P=Q;P<=G;++P)z.push(M[P]);return z}),y=(E,M)=>{if(typeof E=="number"){w(E,M,"auto");return}const{left:W,top:Q,index:G,key:z,position:P,behavior:L,debounce:D=!0}=E;if(W!==void 0||Q!==void 0)w(W,Q,L);else if(G!==void 0)v(G,L,D);else if(z!==void 0){const H=s.value.get(z);H!==void 0&&v(H,L,D)}else P==="bottom"?w(0,Number.MAX_SAFE_INTEGER,L):P==="top"&&w(0,0,L)};let b,_=null;function v(E,M,W){const{value:Q}=h,G=Q.sum(E)+vr(t.paddingTop);if(!W)c.value.scrollTo({left:0,top:G,behavior:M});else{b=E,_!==null&&window.clearTimeout(_),_=window.setTimeout(()=>{b=void 0,_=null},16);const{scrollTop:z,offsetHeight:P}=c.value;if(G>z){const L=Q.get(E);G+L<=z+P||c.value.scrollTo({left:0,top:G+L-P,behavior:M})}else c.value.scrollTo({left:0,top:G,behavior:M})}}function w(E,M,W){c.value.scrollTo({left:E,top:M,behavior:W})}function N(E,M){var W,Q,G;if(n||t.ignoreItemResize||F(M.target))return;const{value:z}=h,P=s.value.get(E),L=z.get(P),D=(G=(Q=(W=M.borderBoxSize)===null||W===void 0?void 0:W[0])===null||Q===void 0?void 0:Q.blockSize)!==null&&G!==void 0?G:M.contentRect.height;if(D===L)return;D-t.itemSize===0?u.delete(E):u.set(E,D-t.itemSize);const U=D-L;if(U===0)return;z.add(P,U);const K=c.value;if(K!=null){if(b===void 0){const I=z.sum(P);K.scrollTop>I&&K.scrollBy(0,U)}else if(P<b)K.scrollBy(0,U);else if(P===b){const I=z.sum(P);D+I>K.scrollTop+K.offsetHeight&&K.scrollBy(0,U)}T()}m.value++}const $=!Kx();let x=!1;function R(E){var M;(M=t.onScroll)===null||M===void 0||M.call(t,E),(!$||!x)&&T()}function C(E){var M;if((M=t.onWheel)===null||M===void 0||M.call(t,E),$){const W=c.value;if(W!=null){if(E.deltaX===0&&(W.scrollTop===0&&E.deltaY<=0||W.scrollTop+W.offsetHeight>=W.scrollHeight&&E.deltaY>=0))return;E.preventDefault(),W.scrollTop+=E.deltaY/Gu(),W.scrollLeft+=E.deltaX/Gu(),T(),x=!0,nu(()=>{x=!1})}}}function B(E){if(n||F(E.target))return;if(t.renderCol==null&&t.renderItemWithCols==null){if(E.contentRect.height===d.value)return}else if(E.contentRect.height===d.value&&E.contentRect.width===l.value)return;d.value=E.contentRect.height,l.value=E.contentRect.width;const{onResize:M}=t;M!==void 0&&M(E)}function T(){const{value:E}=c;E!=null&&(g.value=E.scrollTop,a.value=E.scrollLeft)}function F(E){let M=E;for(;M!==null;){if(M.style.display==="none")return!0;M=M.parentElement}return!1}return{listHeight:d,listStyle:{overflow:"auto"},keyToIndex:s,itemsStyle:i.computed(()=>{const{itemResizable:E}=t,M=Cr(h.value.sum());return m.value,[t.itemsStyle,{boxSizing:"content-box",width:Cr(o.value),height:E?"":M,minHeight:E?M:"",paddingTop:Cr(t.paddingTop),paddingBottom:Cr(t.paddingBottom)}]}),visibleItemsStyle:i.computed(()=>(m.value,{transform:`translateY(${Cr(h.value.sum(f.value))})`})),viewportItems:p,listElRef:c,itemsElRef:i.ref(null),scrollTo:y,handleListResize:B,handleListScroll:R,handleListWheel:C,handleItemResize:N}},render(){const{itemResizable:t,keyField:e,keyToIndex:n,visibleItemsTag:r}=this;return i.h(Ao,{onResize:this.handleListResize},{default:()=>{var o,s;return i.h("div",i.mergeProps(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?i.h("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[i.h(r,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:a,renderItemWithCols:l}=this;return this.viewportItems.map(c=>{const d=c[e],u=n.get(d),h=a!=null?i.h(Qu,{index:u,item:c}):void 0,m=l!=null?i.h(Qu,{index:u,item:c}):void 0,g=this.$slots.default({item:c,renderedCols:h,renderedItemWithCols:m,index:u})[0];return t?i.h(Ao,{key:d,onResize:f=>this.handleItemResize(d,f)},{default:()=>g}):(g.key=d,g)})}})]):(s=(o=this.$slots).empty)===null||s===void 0?void 0:s.call(o)])}})}}),En="v-hidden",Jx=ti("[v-hidden]",{display:"none!important"}),Ju=i.defineComponent({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(t,{slots:e}){const n=i.ref(null),r=i.ref(null);function o(a){const{value:l}=n,{getCounter:c,getTail:d}=t;let u;if(c!==void 0?u=c():u=r.value,!l||!u)return;u.hasAttribute(En)&&u.removeAttribute(En);const{children:h}=l;if(a.showAllItemsBeforeCalculate)for(const v of h)v.hasAttribute(En)&&v.removeAttribute(En);const m=l.offsetWidth,g=[],f=e.tail?d==null?void 0:d():null;let p=f?f.offsetWidth:0,y=!1;const b=l.children.length-(e.tail?1:0);for(let v=0;v<b-1;++v){if(v<0)continue;const w=h[v];if(y){w.hasAttribute(En)||w.setAttribute(En,"");continue}else w.hasAttribute(En)&&w.removeAttribute(En);const N=w.offsetWidth;if(p+=N,g[v]=N,p>m){const{updateCounter:$}=t;for(let x=v;x>=0;--x){const R=b-1-x;$!==void 0?$(R):u.textContent=`${R}`;const C=u.offsetWidth;if(p-=g[x],p+C<=m||x===0){y=!0,v=x-1,f&&(v===-1?(f.style.maxWidth=`${m-C}px`,f.style.boxSizing="border-box"):f.style.maxWidth="");const{onUpdateCount:B}=t;B&&B(R);break}}}}const{onUpdateOverflow:_}=t;y?_!==void 0&&_(!0):(_!==void 0&&_(!1),u.setAttribute(En,""))}const s=wi();return Jx.mount({id:"vueuc/overflow",head:!0,anchorMetaName:la,ssr:s}),i.onMounted(()=>o({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:r,sync:o}},render(){const{$slots:t}=this;return i.nextTick(()=>this.sync({showAllItemsBeforeCalculate:!1})),i.h("div",{class:"v-overflow",ref:"selfRef"},[i.renderSlot(t,"default"),t.counter?t.counter():i.h("span",{style:{display:"inline-block"},ref:"counterRef"}),t.tail?t.tail():null])}});function eh(t){return t instanceof HTMLElement}function th(t){for(let e=0;e<t.childNodes.length;e++){const n=t.childNodes[e];if(eh(n)&&(ih(n)||th(n)))return!0}return!1}function nh(t){for(let e=t.childNodes.length-1;e>=0;e--){const n=t.childNodes[e];if(eh(n)&&(ih(n)||nh(n)))return!0}return!1}function ih(t){if(!ek(t))return!1;try{t.focus({preventScroll:!0})}catch{}return document.activeElement===t}function ek(t){if(t.tabIndex>0||t.tabIndex===0&&t.getAttribute("tabIndex")!==null)return!0;if(t.getAttribute("disabled"))return!1;switch(t.nodeName){case"A":return!!t.href&&t.rel!=="ignore";case"INPUT":return t.type!=="hidden"&&t.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let $r=[];const tk=i.defineComponent({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(t){const e=cw(),n=i.ref(null),r=i.ref(null);let o=!1,s=!1;const a=typeof document>"u"?null:document.activeElement;function l(){return $r[$r.length-1]===e}function c(y){var b;y.code==="Escape"&&l()&&((b=t.onEsc)===null||b===void 0||b.call(t,y))}i.onMounted(()=>{i.watch(()=>t.active,y=>{y?(h(),Et("keydown",document,c)):(at("keydown",document,c),o&&m())},{immediate:!0})}),i.onBeforeUnmount(()=>{at("keydown",document,c),o&&m()});function d(y){if(!s&&l()){const b=u();if(b===null||b.contains(kr(y)))return;g("first")}}function u(){const y=n.value;if(y===null)return null;let b=y;for(;b=b.nextSibling,!(b===null||b instanceof Element&&b.tagName==="DIV"););return b}function h(){var y;if(!t.disabled){if($r.push(e),t.autoFocus){const{initialFocusTo:b}=t;b===void 0?g("first"):(y=Ru(b))===null||y===void 0||y.focus({preventScroll:!0})}o=!0,document.addEventListener("focus",d,!0)}}function m(){var y;if(t.disabled||(document.removeEventListener("focus",d,!0),$r=$r.filter(_=>_!==e),l()))return;const{finalFocusTo:b}=t;b!==void 0?(y=Ru(b))===null||y===void 0||y.focus({preventScroll:!0}):t.returnFocusOnDeactivated&&a instanceof HTMLElement&&(s=!0,a.focus({preventScroll:!0}),s=!1)}function g(y){if(l()&&t.active){const b=n.value,_=r.value;if(b!==null&&_!==null){const v=u();if(v==null||v===_){s=!0,b.focus({preventScroll:!0}),s=!1;return}s=!0;const w=y==="first"?th(v):nh(v);s=!1,w||(s=!0,b.focus({preventScroll:!0}),s=!1)}}}function f(y){if(s)return;const b=u();b!==null&&(y.relatedTarget!==null&&b.contains(y.relatedTarget)?g("last"):g("first"))}function p(y){s||(y.relatedTarget!==null&&y.relatedTarget===n.value?g("last"):g("first"))}return{focusableStartRef:n,focusableEndRef:r,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:f,handleEndFocus:p}},render(){const{default:t}=this.$slots;if(t===void 0)return null;if(this.disabled)return t();const{active:e,focusableStyle:n}=this;return i.h(i.Fragment,null,[i.h("div",{"aria-hidden":"true",tabindex:e?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),t(),i.h("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:e?"0":"-1",onFocus:this.handleEndFocus})])}});function t5(t){return t}const ga="n-internal-select-menu",rh="n-internal-select-menu-body",oh="n-drawer-body",sh="n-modal-body",ah="n-popover-body",lh="__disabled__";function Pn(t){const e=i.inject(sh,null),n=i.inject(oh,null),r=i.inject(ah,null),o=i.inject(rh,null),s=i.ref();if(typeof document<"u"){s.value=document.fullscreenElement;const a=()=>{s.value=document.fullscreenElement};i.onMounted(()=>{Et("fullscreenchange",document,a)}),i.onBeforeUnmount(()=>{at("fullscreenchange",document,a)})}return Zt(()=>{var a;const{to:l}=t;return l!==void 0?l===!1?lh:l===!0?s.value||"body":l:e!=null&&e.value?(a=e.value.$el)!==null&&a!==void 0?a:e.value:n!=null&&n.value?n.value:r!=null&&r.value?r.value:o!=null&&o.value?o.value:l??(s.value||"body")})}Pn.tdkey=lh,Pn.propTo={type:[String,Object,Boolean],default:void 0};function nk(t){const e={isDeactivated:!1};let n=!1;return i.onActivated(()=>{if(e.isDeactivated=!1,!n){n=!0;return}t()}),i.onDeactivated(()=>{e.isDeactivated=!0,n||(n=!0)}),e}function ch(t,e){e&&(i.onMounted(()=>{const{value:n}=t;n&&Nr.registerHandler(n,e)}),i.watch(t,(n,r)=>{r&&Nr.unregisterHandler(r)},{deep:!1}),i.onBeforeUnmount(()=>{const{value:n}=t;n&&Nr.unregisterHandler(n)}))}function dh(t){return t.replace(/#|\(|\)|,|\s|\./g,"_")}const ik=/^(\d|\.)+$/,uh=/(\d|\.)+/;function pa(t,{c:e=1,offset:n=0,attachPx:r=!0}={}){if(typeof t=="number"){const o=(t+n)*e;return o===0?"0":`${o}px`}else if(typeof t=="string")if(ik.test(t)){const o=(Number(t)+n)*e;return r?o===0?"0":`${o}px`:`${o}`}else{const o=uh.exec(t);return o?t.replace(uh,String((Number(o[0])+n)*e)):t}return t}function hh(t){const{left:e,right:n,top:r,bottom:o}=rn(t);return`${r} ${e} ${o} ${n}`}var fh={};function rk(t){let e=".",n="__",r="--",o;if(t){let f=t.blockPrefix;f&&(e=f),f=t.elementPrefix,f&&(n=f),f=t.modifierPrefix,f&&(r=f)}const s={install(f){o=f.c;const p=f.context;p.bem={},p.bem.b=null,p.bem.els=null}};function a(f){let p,y;return{before(b){p=b.bem.b,y=b.bem.els,b.bem.els=null},after(b){b.bem.b=p,b.bem.els=y},$({context:b,props:_}){return f=typeof f=="string"?f:f({context:b,props:_}),b.bem.b=f,`${(_==null?void 0:_.bPrefix)||e}${b.bem.b}`}}}function l(f){let p;return{before(y){p=y.bem.els},after(y){y.bem.els=p},$({context:y,props:b}){return f=typeof f=="string"?f:f({context:y,props:b}),y.bem.els=f.split(",").map(_=>_.trim()),y.bem.els.map(_=>`${(b==null?void 0:b.bPrefix)||e}${y.bem.b}${n}${_}`).join(", ")}}}function c(f){return{$({context:p,props:y}){f=typeof f=="string"?f:f({context:p,props:y});const b=f.split(",").map(w=>w.trim());function _(w){return b.map(N=>`&${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${w!==void 0?`${n}${w}`:""}${r}${N}`).join(", ")}const v=p.bem.els;if(v!==null){if(fh.NODE_ENV!=="production"&&v.length>=2)throw Error(`[css-render/plugin-bem]: m(${f}) is invalid, using modifier inside multiple elements is not allowed`);return _(v[0])}else return _()}}}function d(f){return{$({context:p,props:y}){f=typeof f=="string"?f:f({context:p,props:y});const b=p.bem.els;if(fh.NODE_ENV!=="production"&&b!==null&&b.length>=2)throw Error(`[css-render/plugin-bem]: notM(${f}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${(y==null?void 0:y.bPrefix)||e}${p.bem.b}${b!==null&&b.length>0?`${n}${b[0]}`:""}${r}${f})`}}}return Object.assign(s,{cB:((...f)=>o(a(f[0]),f[1],f[2])),cE:((...f)=>o(l(f[0]),f[1],f[2])),cM:((...f)=>o(c(f[0]),f[1],f[2])),cNotM:((...f)=>o(d(f[0]),f[1],f[2]))}),s}const ok=".n-",sk="__",ak="--",mh=Tu(),gh=rk({blockPrefix:ok,elementPrefix:sk,modifierPrefix:ak});mh.use(gh);const{c:he,find:i5}=mh,{cB:ye,cE:we,cM:Re,cNotM:on}=gh,lk=(...t)=>he(">",[ye(...t)]);function Je(t,e){return t+(e==="default"?"":e.replace(/^[a-z]/,n=>n.toUpperCase()))}let ya;function ck(){return ya===void 0&&(ya=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ya}const dk=new WeakSet;function uk(t){dk.add(t)}function ph(t){switch(typeof t){case"string":return t||void 0;case"number":return String(t);default:return}}const yh=new Set;function ni(t,e){const n=`[naive/${t}]: ${e}`;yh.has(n)||(yh.add(n),console.error(n))}function bh(t,e){console.error(`[naive/${t}]: ${e}`)}function _h(t,e){throw new Error(`[naive/${t}]: ${e}`)}function wt(t,...e){if(Array.isArray(t))t.forEach(n=>wt(n,...e));else return t(...e)}function ba(t,e=!0,n=[]){return t.forEach(r=>{if(r!==null){if(typeof r!="object"){(typeof r=="string"||typeof r=="number")&&n.push(i.createTextVNode(String(r)));return}if(Array.isArray(r)){ba(r,e,n);return}if(r.type===i.Fragment){if(r.children===null)return;Array.isArray(r.children)&&ba(r.children,e,n)}else{if(r.type===i.Comment&&e)return;n.push(r)}}}),n}function hk(t,e="default",n=void 0){const r=t[e];if(!r)return bh("getFirstSlotVNode",`slot[${e}] is empty`),null;const o=ba(r(n));return o.length===1?o[0]:(bh("getFirstSlotVNode",`slot[${e}] should have exactly one child`),null)}function fk(t,e=[],n){const r={};return e.forEach(o=>{r[o]=t[o]}),Object.assign(r,n)}function _a(t){const e=t.filter(n=>n!==void 0);if(e.length!==0)return e.length===1?e[0]:n=>{t.forEach(r=>{r&&r(n)})}}function nr(t,...e){return typeof t=="function"?t(...e):typeof t=="string"?i.createTextVNode(t):typeof t=="number"?i.createTextVNode(String(t)):null}function zo(t){return t.some(e=>i.isVNode(e)?!(e.type===i.Comment||e.type===i.Fragment&&!zo(e.children)):!0)?t:null}function wa(t,e){return t&&zo(t())||e()}function vi(t,e){const n=t&&zo(t());return e(n||null)}function wh(t){return!(t&&zo(t()))}const xa=i.defineComponent({render(){var t,e;return(e=(t=this.$slots).default)===null||e===void 0?void 0:e.call(t)}}),Ci="n-config-provider",mk="n";function Si(t={},e={defaultBordered:!0}){const n=i.inject(Ci,null);return{inlineThemeDisabled:n==null?void 0:n.inlineThemeDisabled,mergedRtlRef:n==null?void 0:n.mergedRtlRef,mergedComponentPropsRef:n==null?void 0:n.mergedComponentPropsRef,mergedBreakpointsRef:n==null?void 0:n.mergedBreakpointsRef,mergedBorderedRef:i.computed(()=>{var r,o;const{bordered:s}=t;return s!==void 0?s:(o=(r=n==null?void 0:n.mergedBorderedRef.value)!==null&&r!==void 0?r:e.defaultBordered)!==null&&o!==void 0?o:!0}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:i.shallowRef(mk),namespaceRef:i.computed(()=>n==null?void 0:n.mergedNamespaceRef.value)}}function Bi(t,e,n,r){n||_h("useThemeClass","cssVarsRef is not passed");const o=i.inject(Ci,null),s=o==null?void 0:o.mergedThemeHashRef,a=o==null?void 0:o.styleMountTarget,l=i.ref(""),c=wi();let d;const u=`__${t}`,h=()=>{let m=u;const g=e?e.value:void 0,f=s==null?void 0:s.value;f&&(m+=`-${f}`),g&&(m+=`-${g}`);const{themeOverrides:p,builtinThemeOverrides:y}=r;p&&(m+=`-${aa(JSON.stringify(p))}`),y&&(m+=`-${aa(JSON.stringify(y))}`),l.value=m,d=()=>{const b=n.value;let _="";for(const v in b)_+=`${v}: ${b[v]};`;he(`.${m}`,_).mount({id:m,ssr:c,parent:a}),d=void 0}};return i.watchEffect(()=>{h()}),{themeClass:l,onRender:()=>{d==null||d()}}}const xh="n-form-item";function gk(t,{defaultSize:e="medium",mergedSize:n,mergedDisabled:r}={}){const o=i.inject(xh,null);i.provide(xh,null);const s=i.computed(n?()=>n(o):()=>{const{size:c}=t;if(c)return c;if(o){const{mergedSize:d}=o;if(d.value!==void 0)return d.value}return e}),a=i.computed(r?()=>r(o):()=>{const{disabled:c}=t;return c!==void 0?c:o?o.disabled.value:!1}),l=i.computed(()=>{const{status:c}=t;return c||(o==null?void 0:o.mergedValidationStatus.value)});return i.onBeforeUnmount(()=>{o&&o.restoreValidation()}),{mergedSizeRef:s,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){o&&o.handleContentBlur()},nTriggerFormChange(){o&&o.handleContentChange()},nTriggerFormFocus(){o&&o.handleContentFocus()},nTriggerFormInput(){o&&o.handleContentInput()}}}const pk={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:t=>`Please load all ${t}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:t=>`Total ${t} items`,selected:t=>`${t} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"},Heatmap:{less:"less",more:"more",monthFormat:"MMM",weekdayFormat:"eee"}};function ka(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}function Rr(t){return(e,n)=>{const r=n!=null&&n.context?String(n.context):"standalone";let o;if(r==="formatting"&&t.formattingValues){const a=t.defaultFormattingWidth||t.defaultWidth,l=n!=null&&n.width?String(n.width):a;o=t.formattingValues[l]||t.formattingValues[a]}else{const a=t.defaultWidth,l=n!=null&&n.width?String(n.width):t.defaultWidth;o=t.values[l]||t.values[a]}const s=t.argumentCallback?t.argumentCallback(e):e;return o[s]}}function Er(t){return(e,n={})=>{const r=n.width,o=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],s=e.match(o);if(!s)return null;const a=s[0],l=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?bk(l,h=>h.test(a)):yk(l,h=>h.test(a));let d;d=t.valueCallback?t.valueCallback(c):c,d=n.valueCallback?n.valueCallback(d):d;const u=e.slice(a.length);return{value:d,rest:u}}}function yk(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n}function bk(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n}function _k(t){return(e,n={})=>{const r=e.match(t.matchPattern);if(!r)return null;const o=r[0],s=e.match(t.parsePattern);if(!s)return null;let a=t.valueCallback?t.valueCallback(s[0]):s[0];a=n.valueCallback?n.valueCallback(a):a;const l=e.slice(o.length);return{value:a,rest:l}}}const wk={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},xk=(t,e,n)=>{let r;const o=wk[t];return typeof o=="string"?r=o:e===1?r=o.one:r=o.other.replace("{{count}}",e.toString()),n!=null&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},kk={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},vk=(t,e,n,r)=>kk[t],Ck={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Sk={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Bk={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"]},Tk={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"]},Nk={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"}},$k={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"}},Rk={ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:Rr({values:Ck,defaultWidth:"wide"}),quarter:Rr({values:Sk,defaultWidth:"wide",argumentCallback:t=>t-1}),month:Rr({values:Bk,defaultWidth:"wide"}),day:Rr({values:Tk,defaultWidth:"wide"}),dayPeriod:Rr({values:Nk,defaultWidth:"wide",formattingValues:$k,defaultFormattingWidth:"wide"})},Ek=/^(\d+)(th|st|nd|rd)?/i,Pk=/\d+/i,Fk={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},Vk={any:[/^b/i,/^(a|c)/i]},Ik={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Mk={any:[/1/i,/2/i,/3/i,/4/i]},Ak={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},Ok={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]},zk={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},Dk={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]},Lk={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},Hk={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}},Wk={ordinalNumber:_k({matchPattern:Ek,parsePattern:Pk,valueCallback:t=>parseInt(t,10)}),era:Er({matchPatterns:Fk,defaultMatchWidth:"wide",parsePatterns:Vk,defaultParseWidth:"any"}),quarter:Er({matchPatterns:Ik,defaultMatchWidth:"wide",parsePatterns:Mk,defaultParseWidth:"any",valueCallback:t=>t+1}),month:Er({matchPatterns:Ak,defaultMatchWidth:"wide",parsePatterns:Ok,defaultParseWidth:"any"}),day:Er({matchPatterns:zk,defaultMatchWidth:"wide",parsePatterns:Dk,defaultParseWidth:"any"}),dayPeriod:Er({matchPatterns:Lk,defaultMatchWidth:"any",parsePatterns:Hk,defaultParseWidth:"any"})},jk={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},qk={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Xk={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Yk={date:ka({formats:jk,defaultWidth:"full"}),time:ka({formats:qk,defaultWidth:"full"}),dateTime:ka({formats:Xk,defaultWidth:"full"})},Uk={name:"en-US",locale:{code:"en-US",formatDistance:xk,formatLong:Yk,formatRelative:vk,localize:Rk,match:Wk,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function kh(t){const{mergedLocaleRef:e,mergedDateLocaleRef:n}=i.inject(Ci,null)||{},r=i.computed(()=>{var s,a;return(a=(s=e==null?void 0:e.value)===null||s===void 0?void 0:s[t])!==null&&a!==void 0?a:pk[t]});return{dateLocaleRef:i.computed(()=>{var s;return(s=n==null?void 0:n.value)!==null&&s!==void 0?s:Uk}),localeRef:r}}const Pr="naive-ui-style";function Fr(t,e,n){if(!e)return;const r=wi(),o=i.computed(()=>{const{value:l}=e;if(!l)return;const c=l[t];if(c)return c}),s=i.inject(Ci,null),a=()=>{i.watchEffect(()=>{const{value:l}=n,c=`${l}${t}Rtl`;if(bx(c,r))return;const{value:d}=o;d&&d.style.mount({id:c,head:!0,anchorMetaName:Pr,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:s==null?void 0:s.styleMountTarget})})};return r?a():i.onBeforeMount(a),o}const Vr={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:Kk,fontFamily:Gk,lineHeight:Zk}=Vr,vh=he("body",`
117
117
  margin: 0;
118
118
  font-size: ${Kk};
119
119
  font-family: ${Gk};
@@ -123,7 +123,7 @@ ${o}
123
123
  `,[he("input",`
124
124
  font-family: inherit;
125
125
  font-size: inherit;
126
- `)]);var Qk={};function Do(t,e,n){if(!e){Qk.NODE_ENV!=="production"&&_h("use-style","No style is specified.");return}const r=wi(),o=i.inject(Ci,null),s=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Pr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||vh.mount({id:"n-global",head:!0,anchorMetaName:Pr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():i.onBeforeMount(s)}function a5(t){return t}function xt(t,e,n,r,o,s){const a=wi(),l=i.inject(Ci,null);if(n){const d=()=>{const u=s==null?void 0:s.value;n.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:Pr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||vh.mount({id:"n-global",head:!0,anchorMetaName:Pr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:u,self:h,peers:m={}}={},themeOverrides:g={},builtinThemeOverrides:f={}}=o,{common:p,peers:y}=g,{common:b=void 0,[t]:{common:_=void 0,self:v=void 0,peers:w={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:N=void 0,[t]:$={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:x,peers:R={}}=$,C=A.merge({},u||_||b||r.common,N,x,p),B=A.merge((d=h||v||r.self)===null||d===void 0?void 0:d(C),f,$,g);return{common:C,self:B,peers:A.merge({},r.peers,w,m),peerOverrides:A.merge({},f.peers,R,y)}})}xt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const Jk=ye("base-icon",`
126
+ `)]);var Qk={};function Do(t,e,n){if(!e){Qk.NODE_ENV!=="production"&&_h("use-style","No style is specified.");return}const r=wi(),o=i.inject(Ci,null),s=()=>{const a=n.value;e.mount({id:a===void 0?t:a+t,head:!0,anchorMetaName:Pr,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:o==null?void 0:o.styleMountTarget}),o!=null&&o.preflightStyleDisabled||vh.mount({id:"n-global",head:!0,anchorMetaName:Pr,ssr:r,parent:o==null?void 0:o.styleMountTarget})};r?s():i.onBeforeMount(s)}function s5(t){return t}function xt(t,e,n,r,o,s){const a=wi(),l=i.inject(Ci,null);if(n){const d=()=>{const u=s==null?void 0:s.value;n.mount({id:u===void 0?e:u+e,head:!0,props:{bPrefix:u?`.${u}-`:void 0},anchorMetaName:Pr,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||vh.mount({id:"n-global",head:!0,anchorMetaName:Pr,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?d():i.onBeforeMount(d)}return i.computed(()=>{var d;const{theme:{common:u,self:h,peers:m={}}={},themeOverrides:g={},builtinThemeOverrides:f={}}=o,{common:p,peers:y}=g,{common:b=void 0,[t]:{common:_=void 0,self:v=void 0,peers:w={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:N=void 0,[t]:$={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:x,peers:R={}}=$,C=A.merge({},u||_||b||r.common,N,x,p),B=A.merge((d=h||v||r.self)===null||d===void 0?void 0:d(C),f,$,g);return{common:C,self:B,peers:A.merge({},r.peers,w,m),peerOverrides:A.merge({},f.peers,R,y)}})}xt.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const Jk=ye("base-icon",`
127
127
  height: 1em;
128
128
  width: 1em;
129
129
  line-height: 1em;
@@ -810,7 +810,7 @@ ${o}
810
810
  line-height: 1.25;
811
811
  text-overflow: ellipsis;
812
812
  overflow: hidden;
813
- `)])])]),t2=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},xt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=Si(t),r=Fr("InternalSelection",n,e),o=i.ref(null),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=xt("InternalSelection","-internal-selection",e2,Dh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),v=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):nr(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),w=i.computed(()=>{const ee=t.selectedOption;if(ee)return ee[t.labelField]}),N=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function $(){var ee;const{value:le}=o;if(le){const{value:De}=s;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((ee=m.value)===null||ee===void 0||ee.sync({showAllItemsBeforeCalculate:!1})))}}function x(){const{value:ee}=g;ee&&(ee.style.display="none")}function R(){const{value:ee}=g;ee&&(ee.style.display="inline-block")}i.watch(i.toRef(t,"active"),ee=>{ee||x()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick($)});function C(ee){const{onFocus:le}=t;le&&le(ee)}function B(ee){const{onBlur:le}=t;le&&le(ee)}function T(ee){const{onDeleteOption:le}=t;le&&le(ee)}function F(ee){const{onClear:le}=t;le&&le(ee)}function E(ee){const{onPatternInput:le}=t;le&&le(ee)}function M(ee){var le;(!ee.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(ee.relatedTarget)))&&C(ee)}function W(ee){var le;!((le=a.value)===null||le===void 0)&&le.contains(ee.relatedTarget)||B(ee)}function Q(ee){F(ee)}function G(){y.value=!0}function z(){y.value=!1}function P(ee){!t.active||!t.filterable||ee.target!==s.value&&ee.preventDefault()}function L(ee){T(ee)}const D=i.ref(!1);function H(ee){if(ee.key==="Backspace"&&!D.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&L(le[le.length-1])}}let U=null;function K(ee){const{value:le}=o;if(le){const De=ee.target.value;le.textContent=De,$()}t.ignoreComposition&&D.value?U=ee:E(ee)}function I(){D.value=!0}function q(){D.value=!1,t.ignoreComposition&&E(U),U=null}function Y(ee){var le;p.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,ee)}function te(ee){var le;p.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,ee)}function ue(){var ee,le;if(t.filterable)p.value=!1,(ee=d.value)===null||ee===void 0||ee.blur(),(le=s.value)===null||le===void 0||le.blur();else if(t.multiple){const{value:De}=l;De==null||De.blur()}else{const{value:De}=c;De==null||De.blur()}}function ve(){var ee,le,De;t.filterable?(p.value=!1,(ee=d.value)===null||ee===void 0||ee.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function Te(){const{value:ee}=s;ee&&(R(),ee.focus())}function We(){const{value:ee}=s;ee&&ee.blur()}function ce(ee){const{value:le}=u;le&&le.setTextContent(`+${ee}`)}function gt(){const{value:ee}=h;return ee}function Ne(){return s.value}let Ft=null;function Wt(){Ft!==null&&window.clearTimeout(Ft)}function ln(){t.active||(Wt(),Ft=window.setTimeout(()=>{N.value&&(f.value=!0)},100))}function St(){Wt()}function Ln(ee){ee||(Wt(),f.value=!1)}i.watch(N,ee=>{ee||(f.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const ee=d.value;ee&&(t.disabled?ee.removeAttribute("tabindex"):ee.tabIndex=p.value?-1:0)})}),ch(a,t.onResize);const{inlineThemeDisabled:cn}=t,Jt=i.computed(()=>{const{size:ee}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:ri,color:nt,placeholderColor:jt,textColor:ir,paddingSingle:oi,paddingMultiple:Ei,caretColor:rr,colorDisabled:dn,textColorDisabled:Hn,placeholderColorDisabled:V,colorActive:Z,boxShadowFocus:se,boxShadowActive:fe,boxShadowHover:me,border:_e,borderFocus:ke,borderHover:Se,borderActive:Qe,arrowColor:Bn,arrowColorDisabled:Pa,loadingColor:Fa,colorActiveWarning:Va,boxShadowFocusWarning:Ia,boxShadowActiveWarning:Ma,boxShadowHoverWarning:Aa,borderWarning:Oa,borderFocusWarning:za,borderHoverWarning:Da,borderActiveWarning:La,colorActiveError:Ha,boxShadowFocusError:Wa,boxShadowActiveError:ja,boxShadowHoverError:qa,borderError:Xa,borderFocusError:Ya,borderHoverError:Ua,borderActiveError:qB,clearColor:XB,clearColorHover:YB,clearColorPressed:UB,clearSize:KB,arrowSize:GB,[Je("height",ee)]:ZB,[Je("fontSize",ee)]:QB}}=b.value,jo=rn(oi),qo=rn(Ei);return{"--n-bezier":le,"--n-border":_e,"--n-border-active":Qe,"--n-border-focus":ke,"--n-border-hover":Se,"--n-border-radius":ri,"--n-box-shadow-active":fe,"--n-box-shadow-focus":se,"--n-box-shadow-hover":me,"--n-caret-color":rr,"--n-color":nt,"--n-color-active":Z,"--n-color-disabled":dn,"--n-font-size":QB,"--n-height":ZB,"--n-padding-single-top":jo.top,"--n-padding-multiple-top":qo.top,"--n-padding-single-right":jo.right,"--n-padding-multiple-right":qo.right,"--n-padding-single-left":jo.left,"--n-padding-multiple-left":qo.left,"--n-padding-single-bottom":jo.bottom,"--n-padding-multiple-bottom":qo.bottom,"--n-placeholder-color":jt,"--n-placeholder-color-disabled":V,"--n-text-color":ir,"--n-text-color-disabled":Hn,"--n-arrow-color":Bn,"--n-arrow-color-disabled":Pa,"--n-loading-color":Fa,"--n-color-active-warning":Va,"--n-box-shadow-focus-warning":Ia,"--n-box-shadow-active-warning":Ma,"--n-box-shadow-hover-warning":Aa,"--n-border-warning":Oa,"--n-border-focus-warning":za,"--n-border-hover-warning":Da,"--n-border-active-warning":La,"--n-color-active-error":Ha,"--n-box-shadow-focus-error":Wa,"--n-box-shadow-active-error":ja,"--n-box-shadow-hover-error":qa,"--n-border-error":Xa,"--n-border-focus-error":Ya,"--n-border-hover-error":Ua,"--n-border-active-error":qB,"--n-clear-size":KB,"--n-clear-color":XB,"--n-clear-color-hover":YB,"--n-clear-color-pressed":UB,"--n-arrow-size":GB,"--n-font-weight":De}}),Ve=cn?Bi("internal-selection",i.computed(()=>t.size[0]),Jt,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:v,label:w,selected:N,showTagsPanel:f,isComposing:D,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:P,handleFocusin:M,handleClear:Q,handleMouseEnter:G,handleMouseLeave:z,handleDeleteOption:L,handlePatternKeyDown:H,handlePatternInputInput:K,handlePatternInputBlur:te,handlePatternInputFocus:Y,handleMouseEnterCounter:ln,handleMouseLeaveCounter:St,handleFocusout:W,handleCompositionEnd:q,handleCompositionStart:I,onPopoverUpdateShow:Ln,focus:ve,focusInput:Te,blur:ue,blurInput:We,updateCounter:ce,getCounter:gt,getTail:Ne,renderLabel:t.renderLabel,cssVars:cn?void 0:Jt,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:o,maxTagCount:s,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const m=s==="responsive",g=typeof s=="number",f=m||g,p=i.h(xa,null,{default:()=>i.h(Zv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=E=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:E.value},u?u({option:E,handleClose:()=>{this.handleDeleteOption(E)}}):i.h(Ta,{size:n,closable:!E.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(E)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(E,!0):nr(E[b],E,!0)})),v=()=>(g?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),w=o?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,N=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(Ta,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let $;if(g){const E=this.selectedOptions.length-s;E>0&&($=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(Ta,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${E}`})))}const x=m?o?i.h(Ju,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:N,tail:()=>w}):i.h(Ju,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:N}):g&&$?v().concat($):v(),R=f?()=>i.h("div",{class:`${l}-base-selection-popover`},m?v():this.selectedOptions.map(_)):void 0,C=f?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,T=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,F=o?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},x,m?null:w,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},x,p);y=i.h(i.Fragment,null,f?i.h(Hv,Object.assign({},C,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>F,default:R}):F,T)}else if(o){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,v=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:ph(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),v?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):nr(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else y=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:ph(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):nr(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function n2(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const i2={name:"Select",common:Ti,peers:{InternalSelection:Dh,InternalSelectMenu:Ph},self:n2},r2=he([ye("select",`
813
+ `)])])]),t2=i.defineComponent({name:"InternalSelection",props:Object.assign(Object.assign({},xt.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(t){const{mergedClsPrefixRef:e,mergedRtlRef:n}=Si(t),r=Fr("InternalSelection",n,e),o=i.ref(null),s=i.ref(null),a=i.ref(null),l=i.ref(null),c=i.ref(null),d=i.ref(null),u=i.ref(null),h=i.ref(null),m=i.ref(null),g=i.ref(null),f=i.ref(!1),p=i.ref(!1),y=i.ref(!1),b=xt("InternalSelection","-internal-selection",e2,Dh,t,i.toRef(t,"clsPrefix")),_=i.computed(()=>t.clearable&&!t.disabled&&(y.value||t.active)),v=i.computed(()=>t.selectedOption?t.renderTag?t.renderTag({option:t.selectedOption,handleClose:()=>{}}):t.renderLabel?t.renderLabel(t.selectedOption,!0):nr(t.selectedOption[t.labelField],t.selectedOption,!0):t.placeholder),w=i.computed(()=>{const ee=t.selectedOption;if(ee)return ee[t.labelField]}),N=i.computed(()=>t.multiple?!!(Array.isArray(t.selectedOptions)&&t.selectedOptions.length):t.selectedOption!==null);function $(){var ee;const{value:le}=o;if(le){const{value:De}=s;De&&(De.style.width=`${le.offsetWidth}px`,t.maxTagCount!=="responsive"&&((ee=m.value)===null||ee===void 0||ee.sync({showAllItemsBeforeCalculate:!1})))}}function x(){const{value:ee}=g;ee&&(ee.style.display="none")}function R(){const{value:ee}=g;ee&&(ee.style.display="inline-block")}i.watch(i.toRef(t,"active"),ee=>{ee||x()}),i.watch(i.toRef(t,"pattern"),()=>{t.multiple&&i.nextTick($)});function C(ee){const{onFocus:le}=t;le&&le(ee)}function B(ee){const{onBlur:le}=t;le&&le(ee)}function T(ee){const{onDeleteOption:le}=t;le&&le(ee)}function F(ee){const{onClear:le}=t;le&&le(ee)}function E(ee){const{onPatternInput:le}=t;le&&le(ee)}function M(ee){var le;(!ee.relatedTarget||!(!((le=a.value)===null||le===void 0)&&le.contains(ee.relatedTarget)))&&C(ee)}function W(ee){var le;!((le=a.value)===null||le===void 0)&&le.contains(ee.relatedTarget)||B(ee)}function Q(ee){F(ee)}function G(){y.value=!0}function z(){y.value=!1}function P(ee){!t.active||!t.filterable||ee.target!==s.value&&ee.preventDefault()}function L(ee){T(ee)}const D=i.ref(!1);function H(ee){if(ee.key==="Backspace"&&!D.value&&!t.pattern.length){const{selectedOptions:le}=t;le!=null&&le.length&&L(le[le.length-1])}}let U=null;function K(ee){const{value:le}=o;if(le){const De=ee.target.value;le.textContent=De,$()}t.ignoreComposition&&D.value?U=ee:E(ee)}function I(){D.value=!0}function q(){D.value=!1,t.ignoreComposition&&E(U),U=null}function Y(ee){var le;p.value=!0,(le=t.onPatternFocus)===null||le===void 0||le.call(t,ee)}function te(ee){var le;p.value=!1,(le=t.onPatternBlur)===null||le===void 0||le.call(t,ee)}function ue(){var ee,le;if(t.filterable)p.value=!1,(ee=d.value)===null||ee===void 0||ee.blur(),(le=s.value)===null||le===void 0||le.blur();else if(t.multiple){const{value:De}=l;De==null||De.blur()}else{const{value:De}=c;De==null||De.blur()}}function ve(){var ee,le,De;t.filterable?(p.value=!1,(ee=d.value)===null||ee===void 0||ee.focus()):t.multiple?(le=l.value)===null||le===void 0||le.focus():(De=c.value)===null||De===void 0||De.focus()}function Te(){const{value:ee}=s;ee&&(R(),ee.focus())}function We(){const{value:ee}=s;ee&&ee.blur()}function ce(ee){const{value:le}=u;le&&le.setTextContent(`+${ee}`)}function gt(){const{value:ee}=h;return ee}function Ne(){return s.value}let Ft=null;function Wt(){Ft!==null&&window.clearTimeout(Ft)}function ln(){t.active||(Wt(),Ft=window.setTimeout(()=>{N.value&&(f.value=!0)},100))}function St(){Wt()}function Ln(ee){ee||(Wt(),f.value=!1)}i.watch(N,ee=>{ee||(f.value=!1)}),i.onMounted(()=>{i.watchEffect(()=>{const ee=d.value;ee&&(t.disabled?ee.removeAttribute("tabindex"):ee.tabIndex=p.value?-1:0)})}),ch(a,t.onResize);const{inlineThemeDisabled:cn}=t,Jt=i.computed(()=>{const{size:ee}=t,{common:{cubicBezierEaseInOut:le},self:{fontWeight:De,borderRadius:ri,color:nt,placeholderColor:jt,textColor:ir,paddingSingle:oi,paddingMultiple:Ei,caretColor:rr,colorDisabled:dn,textColorDisabled:Hn,placeholderColorDisabled:V,colorActive:Z,boxShadowFocus:se,boxShadowActive:fe,boxShadowHover:me,border:_e,borderFocus:ke,borderHover:Se,borderActive:Qe,arrowColor:Bn,arrowColorDisabled:Pa,loadingColor:Fa,colorActiveWarning:Va,boxShadowFocusWarning:Ia,boxShadowActiveWarning:Ma,boxShadowHoverWarning:Aa,borderWarning:Oa,borderFocusWarning:za,borderHoverWarning:Da,borderActiveWarning:La,colorActiveError:Ha,boxShadowFocusError:Wa,boxShadowActiveError:ja,boxShadowHoverError:qa,borderError:Xa,borderFocusError:Ya,borderHoverError:Ua,borderActiveError:jB,clearColor:qB,clearColorHover:XB,clearColorPressed:YB,clearSize:UB,arrowSize:KB,[Je("height",ee)]:GB,[Je("fontSize",ee)]:ZB}}=b.value,jo=rn(oi),qo=rn(Ei);return{"--n-bezier":le,"--n-border":_e,"--n-border-active":Qe,"--n-border-focus":ke,"--n-border-hover":Se,"--n-border-radius":ri,"--n-box-shadow-active":fe,"--n-box-shadow-focus":se,"--n-box-shadow-hover":me,"--n-caret-color":rr,"--n-color":nt,"--n-color-active":Z,"--n-color-disabled":dn,"--n-font-size":ZB,"--n-height":GB,"--n-padding-single-top":jo.top,"--n-padding-multiple-top":qo.top,"--n-padding-single-right":jo.right,"--n-padding-multiple-right":qo.right,"--n-padding-single-left":jo.left,"--n-padding-multiple-left":qo.left,"--n-padding-single-bottom":jo.bottom,"--n-padding-multiple-bottom":qo.bottom,"--n-placeholder-color":jt,"--n-placeholder-color-disabled":V,"--n-text-color":ir,"--n-text-color-disabled":Hn,"--n-arrow-color":Bn,"--n-arrow-color-disabled":Pa,"--n-loading-color":Fa,"--n-color-active-warning":Va,"--n-box-shadow-focus-warning":Ia,"--n-box-shadow-active-warning":Ma,"--n-box-shadow-hover-warning":Aa,"--n-border-warning":Oa,"--n-border-focus-warning":za,"--n-border-hover-warning":Da,"--n-border-active-warning":La,"--n-color-active-error":Ha,"--n-box-shadow-focus-error":Wa,"--n-box-shadow-active-error":ja,"--n-box-shadow-hover-error":qa,"--n-border-error":Xa,"--n-border-focus-error":Ya,"--n-border-hover-error":Ua,"--n-border-active-error":jB,"--n-clear-size":UB,"--n-clear-color":qB,"--n-clear-color-hover":XB,"--n-clear-color-pressed":YB,"--n-arrow-size":KB,"--n-font-weight":De}}),Ve=cn?Bi("internal-selection",i.computed(()=>t.size[0]),Jt,t):void 0;return{mergedTheme:b,mergedClearable:_,mergedClsPrefix:e,rtlEnabled:r,patternInputFocused:p,filterablePlaceholder:v,label:w,selected:N,showTagsPanel:f,isComposing:D,counterRef:u,counterWrapperRef:h,patternInputMirrorRef:o,patternInputRef:s,selfRef:a,multipleElRef:l,singleElRef:c,patternInputWrapperRef:d,overflowRef:m,inputTagElRef:g,handleMouseDown:P,handleFocusin:M,handleClear:Q,handleMouseEnter:G,handleMouseLeave:z,handleDeleteOption:L,handlePatternKeyDown:H,handlePatternInputInput:K,handlePatternInputBlur:te,handlePatternInputFocus:Y,handleMouseEnterCounter:ln,handleMouseLeaveCounter:St,handleFocusout:W,handleCompositionEnd:q,handleCompositionStart:I,onPopoverUpdateShow:Ln,focus:ve,focusInput:Te,blur:ue,blurInput:We,updateCounter:ce,getCounter:gt,getTail:Ne,renderLabel:t.renderLabel,cssVars:cn?void 0:Jt,themeClass:Ve==null?void 0:Ve.themeClass,onRender:Ve==null?void 0:Ve.onRender}},render(){const{status:t,multiple:e,size:n,disabled:r,filterable:o,maxTagCount:s,bordered:a,clsPrefix:l,ellipsisTagPopoverProps:c,onRender:d,renderTag:u,renderLabel:h}=this;d==null||d();const m=s==="responsive",g=typeof s=="number",f=m||g,p=i.h(xa,null,{default:()=>i.h(Zv,{clsPrefix:l,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var b,_;return(_=(b=this.$slots).arrow)===null||_===void 0?void 0:_.call(b)}})});let y;if(e){const{labelField:b}=this,_=E=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:E.value},u?u({option:E,handleClose:()=>{this.handleDeleteOption(E)}}):i.h(Ta,{size:n,closable:!E.disabled,disabled:r,onClose:()=>{this.handleDeleteOption(E)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>h?h(E,!0):nr(E[b],E,!0)})),v=()=>(g?this.selectedOptions.slice(0,s):this.selectedOptions).map(_),w=o?i.h("div",{class:`${l}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:r,value:this.pattern,autofocus:this.autofocus,class:`${l}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),i.h("span",{ref:"patternInputMirrorRef",class:`${l}-base-selection-input-tag__mirror`},this.pattern)):null,N=m?()=>i.h("div",{class:`${l}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},i.h(Ta,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:r})):void 0;let $;if(g){const E=this.selectedOptions.length-s;E>0&&($=i.h("div",{class:`${l}-base-selection-tag-wrapper`,key:"__counter__"},i.h(Ta,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:r},{default:()=>`+${E}`})))}const x=m?o?i.h(Ju,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:N,tail:()=>w}):i.h(Ju,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:v,counter:N}):g&&$?v().concat($):v(),R=f?()=>i.h("div",{class:`${l}-base-selection-popover`},m?v():this.selectedOptions.map(_)):void 0,C=f?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,T=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)):null,F=o?i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-tags`},x,m?null:w,p):i.h("div",{ref:"multipleElRef",class:`${l}-base-selection-tags`,tabindex:r?void 0:0},x,p);y=i.h(i.Fragment,null,f?i.h(Hv,Object.assign({},C,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>F,default:R}):F,T)}else if(o){const b=this.pattern||this.isComposing,_=this.active?!b:!this.selected,v=this.active?!1:this.selected;y=i.h("div",{ref:"patternInputWrapperRef",class:`${l}-base-selection-label`,title:this.patternInputFocused?void 0:ph(this.label)},i.h("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${l}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:r,disabled:r,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),v?i.h("div",{class:`${l}-base-selection-label__render-label ${l}-base-selection-overlay`,key:"input"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):nr(this.label,this.selectedOption,!0))):null,_?i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,p)}else y=i.h("div",{ref:"singleElRef",class:`${l}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?i.h("div",{class:`${l}-base-selection-input`,title:ph(this.label),key:"input"},i.h("div",{class:`${l}-base-selection-input__content`},u?u({option:this.selectedOption,handleClose:()=>{}}):h?h(this.selectedOption,!0):nr(this.label,this.selectedOption,!0))):i.h("div",{class:`${l}-base-selection-placeholder ${l}-base-selection-overlay`,key:"placeholder"},i.h("div",{class:`${l}-base-selection-placeholder__inner`},this.placeholder)),p);return i.h("div",{ref:"selfRef",class:[`${l}-base-selection`,this.rtlEnabled&&`${l}-base-selection--rtl`,this.themeClass,t&&`${l}-base-selection--${t}-status`,{[`${l}-base-selection--active`]:this.active,[`${l}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${l}-base-selection--disabled`]:this.disabled,[`${l}-base-selection--multiple`]:this.multiple,[`${l}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},y,a?i.h("div",{class:`${l}-base-selection__border`}):null,a?i.h("div",{class:`${l}-base-selection__state-border`}):null)}});function n2(t){const{boxShadow2:e}=t;return{menuBoxShadow:e}}const i2={name:"Select",common:Ti,peers:{InternalSelection:Dh,InternalSelectMenu:Ph},self:n2},r2=he([ye("select",`
814
814
  z-index: auto;
815
815
  outline: none;
816
816
  width: 100%;
@@ -819,4 +819,4 @@ ${o}
819
819
  `),ye("select-menu",`
820
820
  margin: 4px 0;
821
821
  box-shadow: var(--n-menu-box-shadow);
822
- `,[Ah({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Lo(t){return t.type==="group"}function Lh(t){return t.type==="ignored"}function Na(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function o2(t,e){return{getIsGroup:Lo,getIgnored:Lh,getKey(r){return Lo(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function s2(t,e,n,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(Lo(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Lh(l))continue;e(n,l)&&a.push(l)}return a}return o(t)}function a2(t,e,n){const r=new Map;return t.forEach(o=>{Lo(o)?o[n].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var l2={};const c2=Object.assign(Object.assign({},xt.props),{to:Pn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),d2=i.defineComponent({name:"Select",props:c2,slots:Object,setup(t){l2.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ni("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ni("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:o}=Si(t),s=xt("Select","-select",r2,i2,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=na(l,a),d=i.ref(!1),u=i.ref(""),h=mu(t,["items","options"]),m=i.ref([]),g=i.ref([]),f=i.computed(()=>g.value.concat(m.value).concat(h.value)),p=i.computed(()=>{const{filter:V}=t;if(V)return V;const{labelField:Z,valueField:se}=t;return(fe,me)=>{if(!me)return!1;const _e=me[Z];if(typeof _e=="string")return Na(fe,_e);const ke=me[se];return typeof ke=="string"?Na(fe,ke):typeof ke=="number"?Na(fe,String(ke)):!1}}),y=i.computed(()=>{if(t.remote)return h.value;{const{value:V}=f,{value:Z}=u;return!Z.length||!t.filterable?V:s2(V,p.value,Z,t.childrenField)}}),b=i.computed(()=>{const{valueField:V,childrenField:Z}=t,se=o2(V,Z);return Mw(y.value,se)}),_=i.computed(()=>a2(f.value,t.valueField,t.childrenField)),v=i.ref(!1),w=na(i.toRef(t,"show"),v),N=i.ref(null),$=i.ref(null),x=i.ref(null),{localeRef:R}=kh("Select"),C=i.computed(()=>{var V;return(V=t.placeholder)!==null&&V!==void 0?V:R.value.placeholder}),B=[],T=i.ref(new Map),F=i.computed(()=>{const{fallbackOption:V}=t;if(V===void 0){const{labelField:Z,valueField:se}=t;return fe=>({[Z]:String(fe),[se]:fe})}return V===!1?!1:Z=>Object.assign(V(Z),{value:Z})});function E(V){const Z=t.remote,{value:se}=T,{value:fe}=_,{value:me}=F,_e=[];return V.forEach(ke=>{if(fe.has(ke))_e.push(fe.get(ke));else if(Z&&se.has(ke))_e.push(se.get(ke));else if(me){const Se=me(ke);Se&&_e.push(Se)}}),_e}const M=i.computed(()=>{if(t.multiple){const{value:V}=c;return Array.isArray(V)?E(V):[]}return null}),W=i.computed(()=>{const{value:V}=c;return!t.multiple&&!Array.isArray(V)?V===null?null:E([V])[0]||null:null}),Q=gk(t),{mergedSizeRef:G,mergedDisabledRef:z,mergedStatusRef:P}=Q;function L(V,Z){const{onChange:se,"onUpdate:value":fe,onUpdateValue:me}=t,{nTriggerFormChange:_e,nTriggerFormInput:ke}=Q;se&&wt(se,V,Z),me&&wt(me,V,Z),fe&&wt(fe,V,Z),a.value=V,_e(),ke()}function D(V){const{onBlur:Z}=t,{nTriggerFormBlur:se}=Q;Z&&wt(Z,V),se()}function H(){const{onClear:V}=t;V&&wt(V)}function U(V){const{onFocus:Z,showOnFocus:se}=t,{nTriggerFormFocus:fe}=Q;Z&&wt(Z,V),fe(),se&&te()}function K(V){const{onSearch:Z}=t;Z&&wt(Z,V)}function I(V){const{onScroll:Z}=t;Z&&wt(Z,V)}function q(){var V;const{remote:Z,multiple:se}=t;if(Z){const{value:fe}=T;if(se){const{valueField:me}=t;(V=M.value)===null||V===void 0||V.forEach(_e=>{fe.set(_e[me],_e)})}else{const me=W.value;me&&fe.set(me[t.valueField],me)}}}function Y(V){const{onUpdateShow:Z,"onUpdate:show":se}=t;Z&&wt(Z,V),se&&wt(se,V),v.value=V}function te(){z.value||(Y(!0),v.value=!0,t.filterable&&oi())}function ue(){Y(!1)}function ve(){u.value="",g.value=B}const Te=i.ref(!1);function We(){t.filterable&&(Te.value=!0)}function ce(){t.filterable&&(Te.value=!1,w.value||ve())}function gt(){z.value||(w.value?t.filterable?oi():ue():te())}function Ne(V){var Z,se;!((se=(Z=x.value)===null||Z===void 0?void 0:Z.selfRef)===null||se===void 0)&&se.contains(V.relatedTarget)||(d.value=!1,D(V),ue())}function Ft(V){U(V),d.value=!0}function Wt(){d.value=!0}function ln(V){var Z;!((Z=N.value)===null||Z===void 0)&&Z.$el.contains(V.relatedTarget)||(d.value=!1,D(V),ue())}function St(){var V;(V=N.value)===null||V===void 0||V.focus(),ue()}function Ln(V){var Z;w.value&&(!((Z=N.value)===null||Z===void 0)&&Z.$el.contains(kr(V))||ue())}function cn(V){if(!Array.isArray(V))return[];if(F.value)return Array.from(V);{const{remote:Z}=t,{value:se}=_;if(Z){const{value:fe}=T;return V.filter(me=>se.has(me)||fe.has(me))}else return V.filter(fe=>se.has(fe))}}function Jt(V){Ve(V.rawNode)}function Ve(V){if(z.value)return;const{tag:Z,remote:se,clearFilterAfterSelect:fe,valueField:me}=t;if(Z&&!se){const{value:_e}=g,ke=_e[0]||null;if(ke){const Se=m.value;Se.length?Se.push(ke):m.value=[ke],g.value=B}}if(se&&T.value.set(V[me],V),t.multiple){const _e=cn(c.value),ke=_e.findIndex(Se=>Se===V[me]);if(~ke){if(_e.splice(ke,1),Z&&!se){const Se=ee(V[me]);~Se&&(m.value.splice(Se,1),fe&&(u.value=""))}}else _e.push(V[me]),fe&&(u.value="");L(_e,E(_e))}else{if(Z&&!se){const _e=ee(V[me]);~_e?m.value=[m.value[_e]]:m.value=B}ir(),ue(),L(V[me],V)}}function ee(V){return m.value.findIndex(se=>se[t.valueField]===V)}function le(V){w.value||te();const{value:Z}=V.target;u.value=Z;const{tag:se,remote:fe}=t;if(K(Z),se&&!fe){if(!Z){g.value=B;return}const{onCreate:me}=t,_e=me?me(Z):{[t.labelField]:Z,[t.valueField]:Z},{valueField:ke,labelField:Se}=t;h.value.some(Qe=>Qe[ke]===_e[ke]||Qe[Se]===_e[Se])||m.value.some(Qe=>Qe[ke]===_e[ke]||Qe[Se]===_e[Se])?g.value=B:g.value=[_e]}}function De(V){V.stopPropagation();const{multiple:Z}=t;!Z&&t.filterable&&ue(),H(),Z?L([],[]):L(null,null)}function ri(V){!xr(V,"action")&&!xr(V,"empty")&&!xr(V,"header")&&V.preventDefault()}function nt(V){I(V)}function jt(V){var Z,se,fe,me,_e;if(!t.keyboard){V.preventDefault();return}switch(V.key){case" ":if(t.filterable)break;V.preventDefault();case"Enter":if(!(!((Z=N.value)===null||Z===void 0)&&Z.isComposing)){if(w.value){const ke=(se=x.value)===null||se===void 0?void 0:se.getPendingTmNode();ke?Jt(ke):t.filterable||(ue(),ir())}else if(te(),t.tag&&Te.value){const ke=g.value[0];if(ke){const Se=ke[t.valueField],{value:Qe}=c;t.multiple&&Array.isArray(Qe)&&Qe.includes(Se)||Ve(ke)}}}V.preventDefault();break;case"ArrowUp":if(V.preventDefault(),t.loading)return;w.value&&((fe=x.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(V.preventDefault(),t.loading)return;w.value?(me=x.value)===null||me===void 0||me.next():te();break;case"Escape":w.value&&(uk(V),ue()),(_e=N.value)===null||_e===void 0||_e.focus();break}}function ir(){var V;(V=N.value)===null||V===void 0||V.focus()}function oi(){var V;(V=N.value)===null||V===void 0||V.focusInput()}function Ei(){var V;w.value&&((V=$.value)===null||V===void 0||V.syncPosition())}q(),i.watch(i.toRef(t,"options"),q);const rr={focus:()=>{var V;(V=N.value)===null||V===void 0||V.focus()},focusInput:()=>{var V;(V=N.value)===null||V===void 0||V.focusInput()},blur:()=>{var V;(V=N.value)===null||V===void 0||V.blur()},blurInput:()=>{var V;(V=N.value)===null||V===void 0||V.blurInput()}},dn=i.computed(()=>{const{self:{menuBoxShadow:V}}=s.value;return{"--n-menu-box-shadow":V}}),Hn=o?Bi("select",void 0,dn,t):void 0;return Object.assign(Object.assign({},rr),{mergedStatus:P,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:No(),triggerRef:N,menuRef:x,pattern:u,uncontrolledShow:v,mergedShow:w,adjustedTo:Pn(t),uncontrolledValue:a,mergedValue:c,followerRef:$,localizedPlaceholder:C,selectedOption:W,selectedOptions:M,mergedSize:G,mergedDisabled:z,focused:d,activeWithoutMenuOpen:Te,inlineThemeDisabled:o,onTriggerInputFocus:We,onTriggerInputBlur:ce,handleTriggerOrMenuResize:Ei,handleMenuFocus:Wt,handleMenuBlur:ln,handleMenuTabOut:St,handleTriggerClick:gt,handleToggle:Jt,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:Ne,handleTriggerFocus:Ft,handleKeydown:jt,handleMenuAfterLeave:ve,handleMenuClickOutside:Ln,handleMenuScroll:nt,handleMenuKeydown:jt,handleMenuMousedown:ri,mergedTheme:s,cssVars:o?void 0:dn,themeClass:Hn==null?void 0:Hn.themeClass,onRender:Hn==null?void 0:Hn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(bu,null,{default:()=>[i.h(_u,null,{default:()=>i.h(t2,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(Vu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Pn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(Rv,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,o;return[(o=(r=this.$slots).empty)===null||o===void 0?void 0:o.call(r)]},header:()=>{var r,o;return[(o=(r=this.$slots).header)===null||o===void 0?void 0:o.call(r)]},action:()=>{var r,o;return[(o=(r=this.$slots).action)===null||o===void 0?void 0:o.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[To,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[To,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),u2={},Hh=i.defineComponent({...u2,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(v=>{if(A.isEmpty(v))return;const w=s.value?r.value:r.value?[r.value]:[],N=v.filter($=>!w.some(x=>x.id===$.id));l.value=r.optionsListConverter([...w,...N])}).finally(()=>{d.value=!1}))};let m="";const g=A.debounce(()=>h(m),800),f=_=>{m=_,g()},p=_=>{var v;if(A.isArray(_)){const w=_.length>0?_.map(N=>{var $;return i.toRaw(($=l.value.find(x=>x.value===N))==null?void 0:$.item)}):[];o("update:value",w)}else if(_>0){const w=i.toRaw((v=l.value.find(N=>N.value===_))==null?void 0:v.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()}}),(_,v)=>(i.openBlock(),i.createBlock(i.unref(d2),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:s.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:f,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),h2={},Wh=i.defineComponent({...h2,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useTemplateRef("select-component"),a=async h=>r.searchType==="categories"?j.HttpRequester.getInstance(j.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?j.HttpRequester.getInstance(j.ProductDataProvider).publicSimpleSearch(h):new Promise(m=>{m([])}),l=h=>r.searchType==="categories"?Bt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Bt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(h,m)=>{if(r.renderLabel)return r.renderLabel(h,m);if(r.searchType==="products"){const g=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=s.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=s.value)==null?void 0:h.blur()}}),(h,m)=>(i.openBlock(),i.createBlock(Hh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":m[0]||(m[0]=g=>o("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),f2={class:"col-span-2 flex flex-row gap-2.5"},m2={class:"flex-1"},g2={class:"text-sc-grey"},p2={class:"ml-2.5"},y2={key:0,class:"flex-none"},b2={},_2=i.defineComponent({...b2,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(null),s=()=>structuredClone(i.toRaw(n.value)),a=i.ref(s()),l=()=>{r("update:value",a.value.map(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(A.isArray(h)?h:[h]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{o.value=null}),l())},d=h=>{h&&(a.value=a.value.map(m=>m.id===h.id?h:i.toRaw(m)),l())},u=h=>{a.value=a.value.filter(m=>m.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=s()}),(h,m)=>{const g=O.NListItem,f=U1,p=O.NButton,y=O.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Wh,{value:o.value,"onUpdate:value":[m[0]||(m[0]=b=>o.value=b),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...m[1]||(m[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,b=>(i.openBlock(),i.createBlock(g,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(b)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",f2,[i.createElementVNode("span",m2,[i.createElementVNode("span",g2,i.toDisplayString(b.code),1),i.createElementVNode("span",p2,i.toDisplayString(b.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",y2,[i.renderSlot(h.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),w2={class:"flex flex-col"},x2={class:"flex flex-col gap-1.5 text-base text-nowrap"},k2={class:"font-medium"},v2={class:"flex flex-col text-sc-dark-grey"},C2={key:0},S2={class:"font-medium"},B2={class:"font-medium"},T2={class:"font-medium"},N2={class:"font-medium"},$2={class:"font-medium"},R2={class:"font-medium"},E2={class:"font-medium"},P2={class:"font-medium"},F2={class:"font-medium"},V2={class:"font-medium"},I2={class:"flex flex-col gap-1.5 text-base text-nowrap"},M2={class:"font-medium"},A2={class:"flex flex-col text-sc-dark-grey"},O2={class:"font-medium"},z2={class:"font-medium"},D2={class:"flex flex-col gap-1.5 text-base text-nowrap"},L2={class:"font-medium"},H2={class:"text-sc-dark-grey"},W2={class:"font-medium"},j2={key:1,class:"text-base text-nowrap"},q2={class:"font-medium"},X2={},jh=i.defineComponent({...X2,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[j.ConfiguratorsEnum.Kozyrek,j.ConfiguratorsEnum.Mosquitto,j.ConfiguratorsEnum.Strip,j.ConfiguratorsEnum.MetalForDoors,j.ConfiguratorsEnum.Sandwich,j.ConfiguratorsEnum.SandwichM2],n=t,r=i.ref(!1),o=i.computed(()=>{var m,g;return((m=n.item.product.unit)==null?void 0:m.isLinear)&&((g=n.item.product.properties)==null?void 0:g.isLengthConfigurator)}),s=i.computed(()=>j.UnitsHelper.getProductLengthMultiplicity(n.item.product)),a=i.computed(()=>j.UnitsHelper.getProductMultiplicity(n.item.product)),l=i.computed(()=>a.value>1),c=i.ref({quantity:n.item.quantity});i.watch(()=>n.item,m=>{c.value={quantity:m.quantity}});const d=m=>{var g;m!==null&&(c.value.quantity=m,(g=n.eventEmitter)==null||g.emit("order-item:edit-quantity",{item:n.item,quantity:m,loaderRef:r}))},u=()=>{var m;(m=n.eventEmitter)==null||m.emit("order-item:open-configurator",{item:n.item})},h=()=>{var m;(m=n.eventEmitter)==null||m.emit("order-item:edit",{item:n.item})};return(m,g)=>{const f=O.NInputNumber;return i.openBlock(),i.createElementBlock("div",w2,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",x2,[i.createElementVNode("span",null,[g[1]||(g[1]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",k2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",v2,[t.item.configurator===i.unref(j.ConfiguratorsEnum).Kozyrek?(i.openBlock(),i.createElementBlock("span",C2,[g[2]||(g[2]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",S2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Mosquitto?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("span",null,[g[3]||(g[3]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",B2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[g[4]||(g[4]=i.createTextVNode(" Высота: ",-1)),i.createElementVNode("span",T2,i.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Strip?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.item.configuratorParams.linesWidths,(p,y)=>(i.openBlock(),i.createElementBlock("span",{key:y},[i.createTextVNode(" Полоса №"+i.toDisplayString(Number(y)+1)+": ",1),i.createElementVNode("span",N2,i.toDisplayString(p)+" мм.",1)]))),128)),i.createElementVNode("span",null,[g[5]||(g[5]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",$2,i.toDisplayString(t.item.length)+" м.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).MetalForDoors?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("span",null,[g[6]||(g[6]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",R2,i.toDisplayString(t.item.width)+" мм.",1)]),i.createElementVNode("span",null,[g[7]||(g[7]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",E2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Sandwich?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:4},i.renderList(t.item.configuratorParams.items??[],(p,y)=>(i.openBlock(),i.createElementBlock("span",{key:y},[i.createTextVNode(" Изделие №"+i.toDisplayString(Number(y)+1)+": ",1),i.createElementVNode("span",P2,i.toDisplayString(p.width)+"×"+i.toDisplayString(p.length)+" мм, "+i.toDisplayString(p.count)+" шт.",1)]))),128)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).SandwichM2?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[i.createElementVNode("span",null,[g[8]||(g[8]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",F2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[g[9]||(g[9]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",V2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(u,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):o.value&&s.value>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("div",I2,[i.createElementVNode("span",null,[g[10]||(g[10]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",M2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",A2,[i.createElementVNode("span",null,[g[11]||(g[11]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",O2,i.toDisplayString(s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)]),i.createElementVNode("span",null,[g[12]||(g[12]=i.createTextVNode(" Всего: ",-1)),i.createElementVNode("span",z2,i.toDisplayString(t.item.quantity*s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)])])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(h,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",D2,[i.createElementVNode("span",null,[g[13]||(g[13]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",L2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("span",H2,[g[14]||(g[14]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",W2,i.toDisplayString(t.item.length??t.item.width)+" "+i.toDisplayString(t.item.product.unit.name),1)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(h,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[t.allowEdit?(i.openBlock(),i.createBlock(f,{key:0,value:c.value.quantity,parse:i.unref(it),min:a.value,step:a.value,"show-button":l.value,"button-placement":"both",disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:g[0]||(g[0]=p=>i.unref(Wr)(p,".",!1)),onFocus:i.unref(Le),"onUpdate:value":d},{suffix:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.item.product.unit.name),1)]),_:1},8,["value","parse","min","step","show-button","disabled","loading","onFocus"])):(i.openBlock(),i.createElementBlock("span",j2,[g[15]||(g[15]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",q2,i.toDisplayString(t.item.quantity)+" "+i.toDisplayString(t.item.product.unit.name),1)]))],64))])}}}),Y2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function U2(t,e){return i.openBlock(),i.createElementBlock("svg",Y2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const K2=i.markRaw({name:"tabler-truck-filled",render:U2}),G2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Z2(t,e){return i.openBlock(),i.createElementBlock("svg",G2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const Q2=i.markRaw({name:"tabler-truck-delivery",render:Z2}),J2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function eC(t,e){return i.openBlock(),i.createElementBlock("svg",J2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const tC=i.markRaw({name:"tabler-truck-loading",render:eC}),nC={class:"flex flex-col gap-1"},iC={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},rC={key:1,class:"text-base"},oC={class:"text-sc-dark-grey mr-1.5"},sC={key:0},aC={key:1},lC={},Ho=i.defineComponent({...lC,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=j.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(a=>a.id===o.delivery.type)}),n=i.computed(()=>en.format(o.delivery.date,"dd.MM.yyyy")),r=i.computed(()=>{var s;return(s=o.delivery.address)!=null&&s.address?jn.getFormatEntityName({name:o.delivery.address.address,deletedAt:o.delivery.address.deletedAt}):""}),o=t;return(s,a)=>{var u,h,m,g,f,p,y,b;const l=tC,c=Q2,d=K2;return i.openBlock(),i.createElementBlock("div",nC,[t.showType?(i.openBlock(),i.createElementBlock("span",iC,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(i.openBlock(),i.createBlock(l,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(c,{key:1})):i.createCommentVNode("",!0),((m=e.value)==null?void 0:m.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(d,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((g=e.value)==null?void 0:g.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",rC,[i.createElementVNode("span",oC,i.toDisplayString(n.value),1),(p=(f=t.delivery)==null?void 0:f.address)!=null&&p.address?(i.openBlock(),i.createElementBlock("span",sC,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),(b=(y=t.delivery)==null?void 0:y.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",aC," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),cC={class:"flex flex-col gap-2.5"},dC={class:"text-base"},uC=["href"],hC={class:"text-sc-grey"},fC={},qh=i.defineComponent({...fC,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Pe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Pe.Status)?(c=(l=j.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>{var u;return d.id===(((u=e.order.status)==null?void 0:u.id)??-1)}))==null?void 0:c.name:void 0}),o=i.computed(()=>e.fields.includes(Pe.CreatedAt)),s=i.computed(()=>e.fields.includes(Pe.ClientInfo)||e.fields.includes(Pe.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Pe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",cC,[i.createElementVNode("span",dC,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,uC)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(xo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",hC,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0),t.order.isOnOrder?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[c[2]||(c[2]=i.createTextVNode(" - ",-1)),c[3]||(c[3]=i.createElementVNode("span",{class:"text-yellow-400"},"Под заказ",-1))],64)):i.createCommentVNode("",!0),t.order.isNotInStock?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[c[4]||(c[4]=i.createTextVNode(" - ",-1)),c[5]||(c[5]=i.createElementVNode("span",{class:"text-red-500"},"Нет в наличии",-1))],64)):i.createCommentVNode("",!0)]),s.value?(i.openBlock(),i.createBlock(wr,{key:0,client:s.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ho,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),mC={},$a=i.defineComponent({...mC,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=j.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((s=n.value)==null?void 0:s.name)??"-"),1)}}}),gC={},Mr=i.defineComponent({...gC,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(t){const e=t,n={quantity:"количество",length:"длина"},r=i.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=i.computed(()=>{const s={[j.UserTypeEnum.Manager]:"менеджером",[j.UserTypeEnum.Operator]:"оператором",[j.UserTypeEnum.Client]:"клиентом",[j.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>n[d]??d).join(", ");return`Было изменено${e.userType?` ${s[e.userType]??""}`:""}: ${l}`}const a=e.userType?` ${s[e.userType]??""}`:"";return`${e.prefixText}${a}`.trim()});return(s,a)=>(i.openBlock(),i.createElementBlock("small",{class:i.normalizeClass(`inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white no-underline opacity-100 ${r.value}`)},i.toDisplayString(o.value),3))}}),pC={class:"flex flex-row gap-1.5"},yC={class:"flex-none text-nowrap"},bC={class:"flex flex-1 flex-col gap-2.5"},_C={key:0,class:"text-sm"},wC={class:"text-gray-600"},xC={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},kC={key:0},vC={key:1},CC={},Xh=i.defineComponent({...CC,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",pC,[i.createElementVNode("span",yC,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",bC,[i.createVNode(hr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.marker?(i.openBlock(),i.createElementBlock("span",_C,[n[0]||(n[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",wC,i.toDisplayString(t.product.marker),1)])):i.createCommentVNode("",!0),t.product.creator&&t.product.creator.type?(i.openBlock(),i.createBlock(Mr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",xC,[n[1]||(n[1]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",kC,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",vC,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[2]||(n[2]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(Xn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[3]||(n[3]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(Xn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])]))}}),SC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function BC(t,e){return i.openBlock(),i.createElementBlock("svg",SC,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"},null,-1),i.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 112V72h0a23.93 23.93 0 0 1 24-24h80a23.93 23.93 0 0 1 24 24h0v40m-64 64v224m-72-224l8 224m136-224l-8 224"},null,-1)])])}const TC=i.markRaw({name:"ion-trash-outline",render:BC}),NC={},$C=i.defineComponent({...NC,__name:"order-item-specification",props:{src:{}},setup(t){const e=i.useTemplateRef("image-reference");return(n,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("a",{class:"text-blue-500 hover:underline text-sm mt-1 block cursor-pointer",onClick:r[0]||(r[0]=o=>{var s;return(s=e.value)==null?void 0:s.showPreview()})}," Спецификация "),i.withDirectives(i.createVNode(i.unref(O.NImage),{ref:"image-reference",src:t.src,"previewed-img-props":{style:"max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;"}},null,8,["src"]),[[i.vShow,!1]])],64))}}),RC={class:"flex flex-col gap-0.5"},EC={class:"text-gray-600"},PC={},FC=i.defineComponent({...PC,__name:"order-item-name",props:{item:{}},setup(t){const e=t,n=i.computed(()=>!!e.item.isRemoved||!!e.item.replacementId),r=i.computed(()=>{var l;return"creator"in e.item&&!!((l=e.item.creator)!=null&&l.type)}),o=i.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),s=i.computed(()=>"changedFields"in e.item?e.item.changedFields:[]),a=i.computed(()=>{var l,c;return"replacement"in e.item?(c=(l=e.item.replacement)==null?void 0:l.creator)==null?void 0:c.type:void 0});return(l,c)=>(i.openBlock(),i.createElementBlock("div",RC,[i.createElementVNode("div",{class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(hr,{product:t.item.product,"show-additional-sale-icon":t.item.isAdditionalSale??!1,"show-code":!1,"show-planning-dates":!1},null,8,["product","show-additional-sale-icon"])],2),t.item.marker?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[c[0]||(c[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",EC,i.toDisplayString(t.item.marker),1)],2)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode($C,{src:o.value},null,8,["src"])],2)):i.createCommentVNode("",!0),r.value&&!n.value?(i.openBlock(),i.createBlock(Mr,{key:2,"user-type":t.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):i.createCommentVNode("",!0),t.item.isRemoved&&!t.item.replacementId&&s.value.length===0?(i.openBlock(),i.createBlock(Mr,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):i.createCommentVNode("",!0),t.item.replacementId&&s.value.length>0?(i.openBlock(),i.createBlock(Mr,{key:4,"user-type":a.value,"changed-fields":s.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):i.createCommentVNode("",!0)]))}}),VC={},IC=i.defineComponent({...VC,__name:"order-items-list",props:i.mergeModels({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:["update:selectedRowKeys"],setup(t){const e=t,n=i.useModel(t,"selectedRowKeys"),r=i.computed(()=>A.sortBy(e.products,"ord")),o=g=>!!g.isRemoved||!!g.replacementId,s=(g,f)=>{f?n.value.includes(g)||(n.value=[...n.value,g]):n.value=n.value.filter(p=>p!==g)},a=g=>e.selectable?{class:n.value.includes(g.id)?void 0:"opacity-60"}:{},l=(g,f)=>{const p=r.value,y=g.logicGroupId;if(!y)return 1;const b=p.at(f-1);if(f&&b&&b.logicGroupId===y)return 0;const _=p.slice(f),v=_.findIndex(w=>w.logicGroupId!==y);return v===-1?_.length:v},c=i.ref(ht.getDeviceTypeByResolution()),d=i.ref(window.innerWidth),u=()=>{const g=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(p,y)=>i.h("span",{class:`text-base${o(p)?" line-through opacity-50":""}`},[y+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,width:d.value>=1536?156:120,render:p=>i.h("span",{class:`text-base${o(p)?" line-through opacity-50":""}`},[p.product.code])},{title:"Наименование",key:"name",resizable:!0,render:p=>i.h(FC,{item:p})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:l,render:p=>i.h(jh,{class:o(p)?"line-through opacity-50":"",item:p,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!o(p)})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,width:120,render:p=>i.h("div",{class:o(p)?"line-through opacity-50":""},[i.h(Xn,{product:p,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,width:120,render:p=>i.h("div",{class:o(p)?"line-through opacity-50":""},[i.h(Xn,{product:p,costFieldName:"cost",showCurrency:!0})])},...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:l,render:p=>o(p)?null:i.h(O.NButton,{quaternary:!0,type:"error",onClick:()=>{var y;(y=e.eventEmitter)==null||y.emit("order-item:delete",{item:p})}},()=>i.h(TC))}]:[]],f=e.selectable?[{key:"checkbox",title:"",className:"align-top",width:"32",cellProps:p=>({class:o(p)?void 0:"cursor-pointer",onClick:()=>{o(p)||s(p.id,!n.value.includes(p.id))}}),render:p=>i.h(O.NCheckbox,{checked:n.value.includes(p.id),disabled:o(p)})}]:[];switch(c.value){case qe.phone:case qe.tablet:return[...f,{title:"",key:"items",resizable:!0,render:(p,y)=>i.h(Xh,{product:p,index:y})}];case qe.laptop:return[...f,...g];default:return[...f,...g]}},h=i.computed(()=>u()),m=()=>{c.value=ht.getDeviceTypeByResolution(),d.value=window.innerWidth};return i.onMounted(()=>{m(),window.addEventListener("resize",m)}),i.onUnmounted(()=>{window.removeEventListener("resize",m)}),(g,f)=>{const p=O.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[f[0]||(f[0]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Список позиций",-1)),i.createVNode(p,{columns:h.value,data:r.value,"row-key":y=>y.id,"row-props":a,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Yh=qn(IC,[["__scopeId","data-v-e1fad754"]]),MC={key:0,class:"text-sc-dark-grey my-2 text-center"},AC={key:1,class:"text-sc-dark-grey my-2"},OC={},Uh=i.defineComponent({...OC,__name:"order-status-history",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref([]),o=l=>en.format(l,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime),s=l=>l.statusDetail?`${l.status.name} (${l.statusDetail.name})`:l.status.name,a=(l=!0)=>{l&&(n.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(c=>{r.value=c}).finally(()=>{l&&(n.value=!1)})};return i.watch(()=>e.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(l,c)=>{const d=O.NSpin,u=O.NTimelineItem,h=O.NTimeline;return i.openBlock(),i.createElementBlock("div",null,[c[1]||(c[1]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),n.value?(i.openBlock(),i.createElementBlock("div",MC,[i.createVNode(d,{size:"small",class:"mb-1 align-middle"}),c[0]||(c[0]=i.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(i.openBlock(),i.createElementBlock("div",AC," История статусов отсутствует. ")):(i.openBlock(),i.createBlock(h,{key:2},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(m,g)=>(i.openBlock(),i.createBlock(u,{key:g,type:g===0?"info":"default",title:s(m),time:o(m.createdAt),content:m.user.name},null,8,["type","title","time","content"]))),128))]),_:1}))])}}}),zC={class:"text-base"},DC={},Ra=i.defineComponent({...DC,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",zC,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),LC={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},HC={class:"col-span-2"},WC={class:"col-span-2"},jC={},Kh=i.defineComponent({...jC,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,o)=>(i.openBlock(),i.createElementBlock("div",null,[o[11]||(o[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",LC,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[o[1]||(o[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Ra,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),o[10]||(o[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(wr,{client:t.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=s=>n("click:client-name",t.order.client,s))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o[2]||(o[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Kd,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[o[3]||(o[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[o[5]||(o[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",HC,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[o[6]||(o[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode($a,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[o[7]||(o[7]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Ho,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[o[8]||(o[8]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",WC,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[o[9]||(o[9]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Ra,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0)])]))}}),qC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function XC(t,e){return i.openBlock(),i.createElementBlock("svg",qC,[...e[0]||(e[0]=[i.createElementVNode("rect",{width:"336",height:"336",x:"128",y:"128",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32",rx:"57",ry:"57"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m383.5 128l.5-24a56.16 56.16 0 0 0-56-56H112a64.19 64.19 0 0 0-64 64v216a56.16 56.16 0 0 0 56 56h24"},null,-1)])])}const YC=i.markRaw({name:"ion-copy-outline",render:XC}),UC={class:"flex flex-col items-start gap-1.5 text-base"},KC=["href"],GC=["href"],ZC={key:1,class:"flex items-center gap-2"},QC=["href"],JC={},Gh=i.defineComponent({...JC,__name:"order-external-links",props:{order:{}},setup(t){const e=i.computed(()=>{var n,r;return!!t.order.erpOrderUrl||(((n=t.order.invoices)==null?void 0:n.length)??0)>0||!!((r=t.order.payment)!=null&&r.onlinePaymentLink)});return(n,r)=>{var a;const o=YC,s=O.NButton;return e.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[r[0]||(r[0]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Внешние ссылки",-1)),i.createElementVNode("div",UC,[t.order.erpOrderUrl?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.order.erpOrderUrl,target:"_blank"}," Открыть заявку в ERP ",8,KC)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices??[],(l,c)=>(i.openBlock(),i.createElementBlock("a",{key:c,class:"btn btn-primary",href:l}," Скачать счет №"+i.toDisplayString(c+1),9,GC))),128)),(a=t.order.payment)!=null&&a.onlinePaymentLink?(i.openBlock(),i.createElementBlock("div",ZC,[i.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank"}," Оплатить заказ ",8,QC),i.withDirectives((i.openBlock(),i.createBlock(s,{text:"",title:"Скопировать ссылку на оплату"},{default:i.withCtx(()=>[i.createVNode(o)]),_:1})),[[i.unref(Qa),t.order.payment.onlinePaymentLink]])])):i.createCommentVNode("",!0)])],64)):i.createCommentVNode("",!0)}}}),eS={key:0},tS={class:"text-sc-dark-grey my-2 text-center"},nS={key:1,class:"text-sc-dark-grey my-2 text-center"},iS={key:2},rS={class:"text-sc-dark-grey mt-4 text-right font-bold"},oS={class:"text-sc-primary"},sS={},Zh=i.defineComponent({...sS,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(),a=(d=!0)=>{if("products"in n.order){s.value=new j.Order(n.order);return}d&&(o.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrder(n.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=i.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=i.computed(()=>l.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(d,u)=>{const h=O.NSpin;return o.value?(i.openBlock(),i.createElementBlock("div",eS,[i.createElementVNode("div",tS,[i.createVNode(h,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(i.openBlock(),i.createElementBlock("div",nS," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",iS,[i.createVNode(Yh,{products:l.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),i.createElementVNode("div",rS,[u[2]||(u[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",oS,i.toDisplayString(c.value)+" ₽",1)]),i.createVNode(Kh,{order:s.value,"onClick:clientName":u[0]||(u[0]=m=>r("click:client-name",s.value.client,m))},null,8,["order"]),i.createVNode(Gh,{order:s.value},null,8,["order"]),i.createVNode(Uh,{order:s.value},null,8,["order"])]))}}}),aS={},lS=i.defineComponent({...aS,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(dr,"small"),r=i.computed(()=>A.isNil(e.orderContextButtonsConfig)?[]:A.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=Uo,c=O.NButton,d=O.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:o},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),cS={},dS=i.defineComponent({...cS,__name:"orders-list",props:i.mergeModels({fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},isRowSelectable:{type:Function,default:void 0}},{checkedRowKeys:{default:()=>[]},checkedRowKeysModifiers:{}}),emits:i.mergeModels(["click:client-name","dblclick:row","update:pagination","update:sort"],["update:checkedRowKeys"]),setup(t,{emit:e}){const n=t,r=e,o=i.useModel(t,"checkedRowKeys"),s=(E,M)=>{M?o.value.includes(E)||(o.value=[...o.value,E]):o.value=o.value.filter(W=>W!==E)},a=()=>A.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),l=i.ref(a()),c=i.ref([]),d=i.ref(!1),u=i.ref(700),h=()=>{const E=ht.getDeviceTypeByResolution(),M=E===qe.phone||E===qe.tablet;if(!(!n.stickyHeaderOnMobile&&M))return u.value*(j.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},m=i.ref(h()),g=E=>{const M={onDblclick:()=>r("dblclick:row",E)},W=[];return n.selectable&&o.value.length>0&&!o.value.includes(E.id)&&W.push("opacity-60"),n.useCellIndication&&(E.isOnOrder&&W.push("on-order"),E.isLargeOrder&&W.push("large-order"),E.isNotInStock&&W.push("not-in-stock"),W.push("order-status",E.status.slug),E.delivery.date&&en.isTomorrow(new Date(E.delivery.date))&&W.push("next-day-order")),W.length>0&&(M.class=W.join(" ")),M},f=()=>{const E=[Pe.CreatedAt,Pe.Id,Pe.ClientInfo,Pe.ClientCity,Pe.DeliveryDate,Pe.PaymentType,Pe.SalesDirections,Pe.Status,...n.showAttachedUserColumn?[Pe.AttachedUser]:[],Pe.actions],M=n.fields.length>0?n.fields:E,W={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},Q={type:"expand",expandable:A.constant(!0),renderExpand:P=>i.h(Zh,{order:P,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",P.client,null)}}),width:"30"};let G=[{title:"Дата заказа",key:Pe.CreatedAt,resizable:!0,width:100,render:P=>i.h(xo,{date:P.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Pe.Id,resizable:!0,width:75,className:"order-id",render:P=>i.h("a",{href:n.orderUrl.replace(":id",P.id.toString()),class:"text-base"},P.id)},{title:"Дата доставки / самовывоза",key:Pe.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:P=>i.h(xo,{date:P.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Pe.ClientInfo,resizable:!0,minWidth:320,render:P=>i.h(wr,{client:P.client,"onClick:client-name":()=>{r("click:client-name",P.client,null)}})},{title:"Тип доставки",key:Pe.DeliveryInfo,resizable:!0,minWidth:320,render:P=>i.h(Ho,{delivery:P.delivery})},{title:"Клиент",key:Pe.ClientInfoShort,resizable:!0,minWidth:320,render:P=>i.h(wr,{client:P.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",P.client,null)}})},{title:"Город клиента",key:Pe.ClientCity,resizable:!0,minWidth:90,width:120,render:P=>{var L;return i.h("span",{class:"text-base"},((L=P.client)==null?void 0:L.city.name)??"—")}},{title:"Статус",key:Pe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:P=>i.h("span",{class:"text-base"},[P.status.name])},{title:"Тип оплаты",key:Pe.PaymentType,resizable:!0,width:115,minWidth:95,render:P=>P.payment?i.h($a,{payment:P.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Pe.SalesDirections,resizable:!0,width:70,render:P=>{var L;return i.h("span",{class:"text-base"},[((L=P.salesDirection)==null?void 0:L.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Pe.AttachedUser,resizable:!0,minWidth:120,render:P=>{var L;return i.h("span",{class:"text-base"},[((L=P==null?void 0:P.attachedUser)==null?void 0:L.name)??""])}}]:[]];n.orderContextButtonsConfig&&G.push({key:"actions",title:"",className:"align-top",width:50,render:P=>i.h(lS,{order:P,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(G=G.map(P=>[Pe.Id,Pe.CreatedAt,Pe.DeliveryDate].includes(P.key)?{...P,sorter:!0,sortOrder:!1,...P.width===void 0?{}:{width:P.width+16}}:P));const z=n.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:P=>{var D;const L=((D=n.isRowSelectable)==null?void 0:D.call(n,P))??!0;return{class:L?"cursor-pointer":void 0,onClick:()=>{L&&s(P.id,!o.value.includes(P.id))}}},render:P=>{var L;return((L=n.isRowSelectable)==null?void 0:L.call(n,P))??!0?i.h(O.NCheckbox,{checked:o.value.includes(P.id)}):null}}]:[];switch(ht.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:return[...z,Q,{key:"order",title:"Заказ",resizable:!0,render:P=>i.h(qh,{order:P,fields:M,orderUrl:n.orderUrl})}];case qe.laptop:{const P=n.showAttachedUserColumn?M:M.filter(L=>L!==Pe.AttachedUser);return[...z,Q,...P.map(L=>G.find(D=>D.key===L)??W)]}default:return[W]}},p=i.ref(f()),y=i.ref(new j.TableDataPagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),b=i.computed(()=>({...y.value,prefix({itemCount:E}){return`Всего заказов: ${E}`}})),_=i.ref(null),v=i.ref(null),w=i.ref(null),N=()=>{w.value!==null&&(clearInterval(w.value),w.value=null)},$=()=>{N(),n.refreshInterval&&(w.value=setInterval(()=>{R()},n.refreshInterval))},x=()=>{var E,M;n.filters&&((E=v.value)==null||E.abort(),v.value=null,(M=_.value)==null||M.abort(),_.value=new AbortController,d.value=!0,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,l.value,{page:y.value.page,pageSize:y.value.pageSize},_.value.signal).then(W=>{y.value.itemCount!==W.meta.total&&(y.value.itemCount=W.meta.total),y.value.page!==W.meta.currentPage&&(y.value.page=W.meta.currentPage),y.value.pageCount!==W.meta.lastPage&&(y.value.pageCount=W.meta.lastPage),y.value.pageSize!==W.meta.perPage&&(y.value.pageSize=W.meta.perPage),c.value=W.data,d.value=!1}).catch(W=>{if((W==null?void 0:W.name)!=="CanceledError")throw d.value=!1,W}))},R=()=>{var E;!n.filters||d.value||((E=v.value)==null||E.abort(),v.value=new AbortController,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,l.value,{page:y.value.page,pageSize:y.value.pageSize},v.value.signal).then(M=>{c.value=c.value.map(W=>M.data.find(G=>G.id===W.id)??W),y.value.itemCount!==M.meta.total&&(y.value.itemCount=M.meta.total),y.value.pageCount!==M.meta.lastPage&&(y.value.pageCount=M.meta.lastPage)}).catch(M=>{if((M==null?void 0:M.name)!=="CanceledError")throw M}))},C=E=>{y.value.page=E,x(),r("update:pagination",y.value)},B=E=>{y.value.pageSize=E,y.value.page=1,x(),r("update:pagination",y.value)},T=E=>{if(A.isNull(E))l.value=a();else{const[M]=l.value;M.field=E.columnKey.toString(),M.direction=E.order==="ascend"?"asc":"desc",l.value=[M]}p.value.forEach(M=>{if(Object.hasOwn(M,"sortOrder")){const W=M;W.sortOrder=W.key===(E==null?void 0:E.columnKey)&&(E!=null&&E.sorter)&&E.order!==!1?E.order:!1}}),x(),r("update:sort",l.value)},F=()=>{p.value=f(),u.value=window.innerHeight,m.value=h()};return i.watch(()=>n.filters,()=>{y.value.page=1,x(),$()}),i.watch(()=>n.sort,()=>{l.value=a(),y.value.page=1,x(),$()}),i.onMounted(()=>{F(),window.addEventListener("resize",F),i.nextTick(()=>{x(),$()})}),i.onUnmounted(()=>{var E,M;window.removeEventListener("resize",F),(E=_.value)==null||E.abort(),(M=v.value)==null||M.abort(),N()}),(E,M)=>{const W=O.NDataTable;return i.openBlock(),i.createBlock(W,{columns:p.value,data:c.value,"row-key":Q=>Q.id,"row-props":g,"scroll-x":t.tableMinWidth,pagination:b.value,loading:d.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":m.value,"pagination-behavior-on-filter":"first","onUpdate:page":C,"onUpdate:pageSize":B,"onUpdate:sorter":T},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),uS=qn(dS,[["__scopeId","data-v-14035b7c"]]),hS=["href"],fS={class:"text-sc-dark-grey"},mS={},gS=i.defineComponent({...mS,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>en.format(n.order.createdAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{A.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},i.toDisplayString(t.order.id),9,hS),i.createTextVNode(" от "+i.toDisplayString(o.value),1)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",fS,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),pS={class:"sc-page flex flex-col bg-inherit"},yS={class:"my-2 flex flex-row items-end"},bS={class:"sc-title grow"},_S={key:0,class:"sc-title-buttons flex-1 grow-0"},wS={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},xS={key:0,class:"sc-title-extra mt-2 sm:mt-4"},kS={},Qh=i.defineComponent({...kS,__name:"page",props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>e.stickyHeaderOnMobile?"sticky z-10 bg-inherit":"lg:sticky z-10 bg-inherit");return(r,o)=>{const s=O.NH1;return i.openBlock(),i.createElementBlock("div",pS,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?n.value:void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",yS,[i.createElementVNode("div",bS,[i.renderSlot(r.$slots,"title",{},()=>[i.createVNode(s,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),r.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",_S,[i.createElementVNode("div",wS,[i.renderSlot(r.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),r.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",xS,[i.renderSlot(r.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(r.$slots,"sticky-extra")],6),i.renderSlot(r.$slots,"default")])}}}),vS={class:"overflow-hidden transition-all duration-300"},CS={class:"text-lg font-medium leading-none"},SS={},Jh=i.defineComponent({...SS,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(0),s=i.ref(n.showDrawer),a=()=>{switch(ht.getDeviceTypeByResolution()){case qe.phone:return window.innerWidth*.8;case qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?A.isUndefined(n.drawerWidth)?o.value=a():o.value=A.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:o.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),i.watch(()=>n.showDrawer,c=>{s.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=O.NDrawerContent,h=O.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",vS,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:s.value,"onUpdate:show":d[0]||(d[0]=m=>s.value=m),resizable:!0,width:o.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",CS,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),BS={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},TS={key:0},NS={class:"sc-page-preview-panel grow"},$S={key:1,class:"sc-page-preview-panel-extra flex-none"},RS={},ES=i.defineComponent({...RS,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},o=()=>{n.value=!1},s=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,u;window.scrollTo({top:(((u=(d=s.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:o}),(l,c)=>{const d=O.NButton;return i.openBlock(),i.createBlock(Qh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset,"sticky-header-on-mobile":t.stickyHeaderOnMobile},i.createSlots({default:i.withCtx(()=>[i.createVNode(Jh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",BS,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",TS,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",NS,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",$S,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),PS={},FS=i.defineComponent({...PS,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var f;return A.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{const f=new j.Curator({id:-1,name:"",contacts:{},curatedDirection:new j.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[f]:[];return r.managerReferenceList.filter(y=>{var b;return(((b=y==null?void 0:y.curatedDirections)==null?void 0:b.length)??0)>0}).forEach(y=>{((y==null?void 0:y.curatedDirections)??[]).forEach(b=>{p.push(new j.Curator({id:y.id,guid:y.guid,name:y.name,photo:y.photo,contacts:y.contacts??{},curatedDirection:b}))})}),p}),c=i.computed(()=>Bt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,f=>{const p=A.some(s.value?r.value:[r.value],["id",f.id])?` (${f.curatedDirection.name}) `:"";return f.curatedDirection.isNewRec()?f.name:`${f.name}${p}`})),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(A.isArray(f)){const p=f.length>0?f.map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y)):[];o("update:value",p)}else{const p=f>0?l.value.find(y=>y.id===f):null;o("update:value",p??null)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),VS={},IS=i.defineComponent({...VS,__name:"manager-operator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},operatorReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var f;return A.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=i.computed(()=>{var b;const f=[];r.operatorReferenceList.length>0&&f.push({type:"group",label:"Операторы",key:"operators",children:r.operatorReferenceList.map(_=>({label:_.name,value:_.id,item:_}))});let p=r.managerReferenceList;if(r.showActualOnly){const _=A.isArray(r.value)?r.value.map(v=>v.id):[(b=r.value)==null?void 0:b.id];p=p.filter(v=>v.isActive||_.includes(v.id))}const y=Bt.convertReferencesToSelectOptionsList(p,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,_=>`${_.name}${_.isActive?"":" [Не активен]"}`);return f.length>0&&y.length>0&&f.push({key:"manager-operator-divider",disabled:!0,render:()=>i.h("div",{class:"sc-manager-operator-select__divider"})}),f.push(...y),f}),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class??""} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(A.isArray(f)){const p=f.map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y));o("update:value",p)}else{const p=A.isNil(f)?null:l.value.find(y=>y.id===f)??null;o("update:value",p)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:d.value,placeholder:"",class:"w-full","onUpdate:value":h},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),MS={},AS=i.defineComponent({...MS,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var f;return A.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>r.showEmptyValue?[j.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var y;let f=l.value,p=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=A.isArray(r.value)?r.value.map(_=>_.id):[(y=r.value)==null?void 0:y.id];p=A.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),f=f.filter(_=>(r.showEmptyValue?j.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||b.includes(_.id))}return Bt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&A.some(s.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${_}${b.isActive?"":" [Не активен]"}`},b=>p.includes(b.id)&&b.isActive)}),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(A.isArray(f)){const p=f.length>0?f.filter(y=>!A.some(r.disabledManagerReferenceList,["id",y])).map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y)):[];o("update:value",p)}else{const p=f>0&&!A.some(r.disabledManagerReferenceList,["id",f])?l.value.find(y=>y.id===f):new j.Manager;o("update:value",p??new j.Manager)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(s.value){const p=r.value;A.some(p,y=>A.some(f,["id",y.id]))&&o("update:value",p.filter(y=>!A.some(f,["id",y.id])))}else{const p=r.value;A.some(f,["id",p.id])&&o("update:value",new j.Manager)}}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),OS={class:"m-0.5 flex flex-col p-0.5"},zS={class:"flex flex-row gap-1"},DS={key:0},LS={key:1},HS={key:2},WS={key:3},jS={class:"flex flex-row gap-1"},qS={key:0},XS={key:1},YS={key:2},US={key:3},KS={},ef=i.defineComponent({...KS,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",OS,[i.createElementVNode("span",zS,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",DS,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",LS,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",HS,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",WS,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",jS,[t.addr.street?(i.openBlock(),i.createElementBlock("span",qS,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",XS,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",YS,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",US,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ea={clearable:!1,value:"",field:void 0,disabled:!1},GS={},ZS=i.defineComponent({...GS,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ea,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{!s.value||s.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(s.value,a):j.HttpRequester.getInstance(j.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(ef,{addr:b,selected:y},{default:A.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};o("select",y)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,y)=>{const b=O.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[y[0]||(y[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),QS={class:"m-0.5 flex flex-col p-0.5"},JS={class:"font-medium"},eB={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},tB={key:0},nB={key:1},iB={},tf=i.defineComponent({...iB,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",QS,[i.createElementVNode("span",JS,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",eB,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",tB," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",nB," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),rB={},oB=i.defineComponent({...rB,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ea,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await j.HttpRequester.getInstance(j.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(tf,{bank:b,selected:y},{default:A.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};o("select",y)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,y)=>{const b=O.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[y[0]||(y[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),sB={class:"font-medium"},aB={key:0,class:"flex flex-row gap-2"},lB={key:0,class:"text-xs font-light text-blue-800"},cB={key:1,class:"text-sc-dark-grey text-xs font-light"},dB={},nf=i.defineComponent({...dB,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",sB,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",aB,[t.org.inn?(i.openBlock(),i.createElementBlock("span",lB,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",cB,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),uB={},hB=i.defineComponent({...uB,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ea,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Bt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{s.value=y}),i.watch(s,()=>{o("update:value",s.value)});const u=A.debounce(()=>h(),800),h=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await j.HttpRequester.getInstance(j.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},m=(y,b)=>{const _=l.value.find(v=>v.id===y.value)||{};return i.h(nf,{org:_,selected:b},{default:A.constant("-")})},g=y=>{u.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&o("select",b)},f=i.ref(null);function p(){f.value.focus()}return e({focus:p}),(y,b)=>{const _=O.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:s.value,"onUpdate:value":[b[0]||(b[0]=v=>s.value=v),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),fB={},mB=i.defineComponent({...fB,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},a=()=>{n.disableConfirm?s():o.value=!0};return(l,c)=>{const d=O.NButton,u=O.NPopover,h=O.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(h,{show:o.value,"onUpdate:show":c[1]||(c[1]=m=>o.value=m),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=m=>o.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),gB={key:0,class:"whitespace-pre-line"},pB={key:1,class:"text-sc-dark-grey"},yB={},bB=i.defineComponent({...yB,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.comment);i.watch(()=>o.value,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=n.comment};return(l,c)=>{const d=O.NInput;return i.openBlock(),i.createBlock(eu,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",gB,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",pB," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:o.value,"onUpdate:value":c[0]||(c[0]=u=>o.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),_B={},wB=i.defineComponent({..._B,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),xB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function kB(t,e){return i.openBlock(),i.createElementBlock("svg",xB,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const vB=i.markRaw({name:"ion-warning",render:kB}),CB={},SB=i.defineComponent({...CB,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=vB,o=O.NPopover;return i.openBlock(),i.createBlock(o,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),BB=i.computed(()=>j.useReferencesStore().deliveryTypeReference??[]),TB=i.computed(()=>j.useReferencesStore().managersList??[]),NB=i.computed(()=>j.useReferencesStore().opfReference??[]),$B=i.computed(()=>j.useReferencesStore().partnerGroupsReference??[]),RB=i.computed(()=>j.useReferencesStore().priceCoefficientsReference??[]),EB=i.computed(()=>j.useReferencesStore().productFilesTypesReference??[]),PB=i.computed(()=>j.useReferencesStore().resourceTypesReference),FB=i.computed(()=>j.useReferencesStore().salesDirectionsReference??[]),VB=i.computed(()=>j.useReferencesStore().warehousesReference??[]),IB=i.computed(()=>j.useReferencesStore().paymentTypeReference??[]),MB=i.computed(()=>j.useReferencesStore().orderStatusReference??[]),AB=i.computed(()=>j.useReferencesStore().orderStatusDetailReference??[]),OB=i.computed(()=>j.useReferencesStore().operatorReference??[]),zB=i.computed(()=>Bt.convertReferencesToSelectOptionsList(j.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),DB=i.computed(()=>Bt.convertReferencesToSelectOptionsList(j.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),LB=t=>j.HttpRequester.getInstance(j.ReferenceDataProvider).searchCity(t),HB=t=>Bt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(o=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:o.name}`},e=>e==null?void 0:e.isNewRec()),WB=t=>j.HttpRequester.getInstance(j.ClientDataProvider).searchClient(t),jB=t=>Bt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>e.isNewRec()?"-":[e.name,e.salesDirection.name?`(${e.salesDirection.name})`:void 0,e.city.name?`г. ${e.city.name}${e.city.region.name?`, ${e.city.region.name}`:""}`:void 0,e.isActive?void 0:"[ Деактивирован ]"].filter(Boolean).join(" "),e=>e==null?void 0:e.isNewRec());X.CommonValidators=mf,X.ConfiguratorSettingsKozyrek=Bd,X.ConfiguratorSettingsMosquito=e1,X.ContentHelper=ci,X.DateValidators=gf,X.EntityNameHelper=jn,X.KozyrekLine=_n,X.KozyrekTailTemplate=qs,X.KozyrekTemplate=Gi,X.NumericValidators=ae,X.OrdersTableFields=Pe,X.Point=js,X.ScAddProductToCartDialog=Yb,X.ScAddressSuggestion=ZS,X.ScAddressSuggestionLabel=ef,X.ScBankSuggestion=oB,X.ScBankSuggestionLabel=tf,X.ScBaseDialog=Ud,X.ScButtonWithConfirmAction=mB,X.ScCategoryCollapse=Xd,X.ScClientNameWithShortInfo=wr,X.ScCollapse=qd,X.ScCollapseItem=rl,X.ScCommentEditor=bB,X.ScConfiguratorsProductInfo=fr,X.ScContragentWithShortInfo=Kd,X.ScCreatorUserTypeTag=Mr,X.ScCuratorSelect=FS,X.ScDateRange=s1,X.ScDateTimeLabel=xo,X.ScDebouncedInput=F1,X.ScDebouncedInputNumber=I1,X.ScDebt=wB,X.ScDialogHeader=m1,X.ScDynamicConfigurator=Hd,X.ScEmail=c_,X.ScExternalLink=q1,X.ScImageGallery=cl,X.ScInlineEditableItem=eu,X.ScInlineView=Ys,X.ScKozyrekConfigurator=Td,X.ScKozyrekConfiguratorParamsForm=ul,X.ScKozyrekConfiguratorPreview=Sd,X.ScKozyrekConfiguratorTemplates=Cd,X.ScLightGallery=ll,X.ScManagerOperatorSelect=IS,X.ScManagerSelect=AS,X.ScMetalForDoorsConfigurator=Md,X.ScMetalForDoorsConfiguratorForm=Id,X.ScMosquitoConfigurator=Rd,X.ScMosquitoConfiguratorForm=Nd,X.ScMosquitoConfiguratorMeasurementInstructions=$d,X.ScMosquitoConfiguratorPreview=Xs,X.ScOrderCommonInfo=qh,X.ScOrderDeliveryLabel=Ho,X.ScOrderDetails=Kh,X.ScOrderExternalLinks=Gh,X.ScOrderInfo=Zh,X.ScOrderItemParams=jh,X.ScOrderItemsList=Yh,X.ScOrderPayment=$a,X.ScOrderProductInfo=Xh,X.ScOrderStatusHistory=Uh,X.ScOrdersList=uS,X.ScOrgSuggestion=hB,X.ScOrgSuggestionLabel=nf,X.ScPage=Qh,X.ScPageWithSlidingPanel=ES,X.ScPersonContactsBlock=J_,X.ScPhone=F_,X.ScPhoneInput=O1,X.ScProductName=hr,X.ScProductsList=_2,X.ScReferenceSelect=Yd,X.ScSandwichConfigurator=zd,X.ScSandwichConfiguratorForm=Od,X.ScSandwichM2Configurator=Ld,X.ScSandwichM2ConfiguratorForm=Dd,X.ScSearchableProductSelect=Wh,X.ScSearchableReferenceSelect=Hh,X.ScSetClientPriceFormItem=Db,X.ScShortTextOrderInfo=gS,X.ScSingleFileUploadSelector=_1,X.ScSlidingContentWithDrawer=Jh,X.ScStripConfigurator=Vd,X.ScStripConfiguratorForm=Pd,X.ScStripConfiguratorLineItem=Ed,X.ScStripConfiguratorPreview=Fd,X.ScUserShortInfo=Ra,X.ScWarningIcon=SB,X.SelectOptionHelper=Bt,X.UiNotificationProvider=lr,X.Validators=He,X.WindowResolutionEnum=qe,X.WindowResolutionProvider=ht,X.channelPrimaryInterestOptionsList=zB,X.componentSizeInjectionKey=dr,X.copyToClipboard=Za,X.deliveryTypeReferenceList=BB,X.handleFloatInput=Wr,X.handleIntegerInput=tt,X.isCanSandwichM2Show=t1,X.isCanSandwichShow=jd,X.isConfiguratorType=Wd,X.managersReferenceList=TB,X.naiveUiTheme=tm,X.operatorReferenceList=OB,X.opfReferenceList=NB,X.orderStatusDetailReferenceList=AB,X.orderStatusReferenceList=MB,X.parse=it,X.partnerGroupReferenceList=$B,X.paymentTypeReferenceList=IB,X.priceCoefficientsReferenceList=RB,X.productFilesTypesReferenceList=EB,X.renderConfig=je,X.resetInputValidation=et,X.resourceReferencesList=PB,X.salesDirectionsReferenceList=FB,X.searchCityReferenceDataHandler=LB,X.searchCityReferenceLabelRenderer=HB,X.searchClientReferenceDataHandler=WB,X.searchClientReferenceLabelRenderer=jB,X.selectAllTextOnFocus=Le,X.sourcePrimaryInterestOptionsList=DB,X.vCopy=Qa,X.vFocusNext=Wn,X.warehousesReferenceList=VB,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));
822
+ `,[Ah({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]);function Lo(t){return t.type==="group"}function Lh(t){return t.type==="ignored"}function Na(t,e){try{return!!(1+e.toString().toLowerCase().indexOf(t.trim().toLowerCase()))}catch{return!1}}function o2(t,e){return{getIsGroup:Lo,getIgnored:Lh,getKey(r){return Lo(r)?r.name||r.key||"key-required":r[t]},getChildren(r){return r[e]}}}function s2(t,e,n,r){if(!e)return t;function o(s){if(!Array.isArray(s))return[];const a=[];for(const l of s)if(Lo(l)){const c=o(l[r]);c.length&&a.push(Object.assign({},l,{[r]:c}))}else{if(Lh(l))continue;e(n,l)&&a.push(l)}return a}return o(t)}function a2(t,e,n){const r=new Map;return t.forEach(o=>{Lo(o)?o[n].forEach(s=>{r.set(s[e],s)}):r.set(o[e],o)}),r}var l2={};const c2=Object.assign(Object.assign({},xt.props),{to:Pn.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),d2=i.defineComponent({name:"Select",props:c2,slots:Object,setup(t){l2.NODE_ENV!=="production"&&i.watchEffect(()=>{t.items!==void 0&&ni("select","`items` is deprecated, please use `options` instead."),t.onChange!==void 0&&ni("select","`on-change` is deprecated, please use `on-update:value` instead.")});const{mergedClsPrefixRef:e,mergedBorderedRef:n,namespaceRef:r,inlineThemeDisabled:o}=Si(t),s=xt("Select","-select",r2,i2,t,e),a=i.ref(t.defaultValue),l=i.toRef(t,"value"),c=na(l,a),d=i.ref(!1),u=i.ref(""),h=mu(t,["items","options"]),m=i.ref([]),g=i.ref([]),f=i.computed(()=>g.value.concat(m.value).concat(h.value)),p=i.computed(()=>{const{filter:V}=t;if(V)return V;const{labelField:Z,valueField:se}=t;return(fe,me)=>{if(!me)return!1;const _e=me[Z];if(typeof _e=="string")return Na(fe,_e);const ke=me[se];return typeof ke=="string"?Na(fe,ke):typeof ke=="number"?Na(fe,String(ke)):!1}}),y=i.computed(()=>{if(t.remote)return h.value;{const{value:V}=f,{value:Z}=u;return!Z.length||!t.filterable?V:s2(V,p.value,Z,t.childrenField)}}),b=i.computed(()=>{const{valueField:V,childrenField:Z}=t,se=o2(V,Z);return Mw(y.value,se)}),_=i.computed(()=>a2(f.value,t.valueField,t.childrenField)),v=i.ref(!1),w=na(i.toRef(t,"show"),v),N=i.ref(null),$=i.ref(null),x=i.ref(null),{localeRef:R}=kh("Select"),C=i.computed(()=>{var V;return(V=t.placeholder)!==null&&V!==void 0?V:R.value.placeholder}),B=[],T=i.ref(new Map),F=i.computed(()=>{const{fallbackOption:V}=t;if(V===void 0){const{labelField:Z,valueField:se}=t;return fe=>({[Z]:String(fe),[se]:fe})}return V===!1?!1:Z=>Object.assign(V(Z),{value:Z})});function E(V){const Z=t.remote,{value:se}=T,{value:fe}=_,{value:me}=F,_e=[];return V.forEach(ke=>{if(fe.has(ke))_e.push(fe.get(ke));else if(Z&&se.has(ke))_e.push(se.get(ke));else if(me){const Se=me(ke);Se&&_e.push(Se)}}),_e}const M=i.computed(()=>{if(t.multiple){const{value:V}=c;return Array.isArray(V)?E(V):[]}return null}),W=i.computed(()=>{const{value:V}=c;return!t.multiple&&!Array.isArray(V)?V===null?null:E([V])[0]||null:null}),Q=gk(t),{mergedSizeRef:G,mergedDisabledRef:z,mergedStatusRef:P}=Q;function L(V,Z){const{onChange:se,"onUpdate:value":fe,onUpdateValue:me}=t,{nTriggerFormChange:_e,nTriggerFormInput:ke}=Q;se&&wt(se,V,Z),me&&wt(me,V,Z),fe&&wt(fe,V,Z),a.value=V,_e(),ke()}function D(V){const{onBlur:Z}=t,{nTriggerFormBlur:se}=Q;Z&&wt(Z,V),se()}function H(){const{onClear:V}=t;V&&wt(V)}function U(V){const{onFocus:Z,showOnFocus:se}=t,{nTriggerFormFocus:fe}=Q;Z&&wt(Z,V),fe(),se&&te()}function K(V){const{onSearch:Z}=t;Z&&wt(Z,V)}function I(V){const{onScroll:Z}=t;Z&&wt(Z,V)}function q(){var V;const{remote:Z,multiple:se}=t;if(Z){const{value:fe}=T;if(se){const{valueField:me}=t;(V=M.value)===null||V===void 0||V.forEach(_e=>{fe.set(_e[me],_e)})}else{const me=W.value;me&&fe.set(me[t.valueField],me)}}}function Y(V){const{onUpdateShow:Z,"onUpdate:show":se}=t;Z&&wt(Z,V),se&&wt(se,V),v.value=V}function te(){z.value||(Y(!0),v.value=!0,t.filterable&&oi())}function ue(){Y(!1)}function ve(){u.value="",g.value=B}const Te=i.ref(!1);function We(){t.filterable&&(Te.value=!0)}function ce(){t.filterable&&(Te.value=!1,w.value||ve())}function gt(){z.value||(w.value?t.filterable?oi():ue():te())}function Ne(V){var Z,se;!((se=(Z=x.value)===null||Z===void 0?void 0:Z.selfRef)===null||se===void 0)&&se.contains(V.relatedTarget)||(d.value=!1,D(V),ue())}function Ft(V){U(V),d.value=!0}function Wt(){d.value=!0}function ln(V){var Z;!((Z=N.value)===null||Z===void 0)&&Z.$el.contains(V.relatedTarget)||(d.value=!1,D(V),ue())}function St(){var V;(V=N.value)===null||V===void 0||V.focus(),ue()}function Ln(V){var Z;w.value&&(!((Z=N.value)===null||Z===void 0)&&Z.$el.contains(kr(V))||ue())}function cn(V){if(!Array.isArray(V))return[];if(F.value)return Array.from(V);{const{remote:Z}=t,{value:se}=_;if(Z){const{value:fe}=T;return V.filter(me=>se.has(me)||fe.has(me))}else return V.filter(fe=>se.has(fe))}}function Jt(V){Ve(V.rawNode)}function Ve(V){if(z.value)return;const{tag:Z,remote:se,clearFilterAfterSelect:fe,valueField:me}=t;if(Z&&!se){const{value:_e}=g,ke=_e[0]||null;if(ke){const Se=m.value;Se.length?Se.push(ke):m.value=[ke],g.value=B}}if(se&&T.value.set(V[me],V),t.multiple){const _e=cn(c.value),ke=_e.findIndex(Se=>Se===V[me]);if(~ke){if(_e.splice(ke,1),Z&&!se){const Se=ee(V[me]);~Se&&(m.value.splice(Se,1),fe&&(u.value=""))}}else _e.push(V[me]),fe&&(u.value="");L(_e,E(_e))}else{if(Z&&!se){const _e=ee(V[me]);~_e?m.value=[m.value[_e]]:m.value=B}ir(),ue(),L(V[me],V)}}function ee(V){return m.value.findIndex(se=>se[t.valueField]===V)}function le(V){w.value||te();const{value:Z}=V.target;u.value=Z;const{tag:se,remote:fe}=t;if(K(Z),se&&!fe){if(!Z){g.value=B;return}const{onCreate:me}=t,_e=me?me(Z):{[t.labelField]:Z,[t.valueField]:Z},{valueField:ke,labelField:Se}=t;h.value.some(Qe=>Qe[ke]===_e[ke]||Qe[Se]===_e[Se])||m.value.some(Qe=>Qe[ke]===_e[ke]||Qe[Se]===_e[Se])?g.value=B:g.value=[_e]}}function De(V){V.stopPropagation();const{multiple:Z}=t;!Z&&t.filterable&&ue(),H(),Z?L([],[]):L(null,null)}function ri(V){!xr(V,"action")&&!xr(V,"empty")&&!xr(V,"header")&&V.preventDefault()}function nt(V){I(V)}function jt(V){var Z,se,fe,me,_e;if(!t.keyboard){V.preventDefault();return}switch(V.key){case" ":if(t.filterable)break;V.preventDefault();case"Enter":if(!(!((Z=N.value)===null||Z===void 0)&&Z.isComposing)){if(w.value){const ke=(se=x.value)===null||se===void 0?void 0:se.getPendingTmNode();ke?Jt(ke):t.filterable||(ue(),ir())}else if(te(),t.tag&&Te.value){const ke=g.value[0];if(ke){const Se=ke[t.valueField],{value:Qe}=c;t.multiple&&Array.isArray(Qe)&&Qe.includes(Se)||Ve(ke)}}}V.preventDefault();break;case"ArrowUp":if(V.preventDefault(),t.loading)return;w.value&&((fe=x.value)===null||fe===void 0||fe.prev());break;case"ArrowDown":if(V.preventDefault(),t.loading)return;w.value?(me=x.value)===null||me===void 0||me.next():te();break;case"Escape":w.value&&(uk(V),ue()),(_e=N.value)===null||_e===void 0||_e.focus();break}}function ir(){var V;(V=N.value)===null||V===void 0||V.focus()}function oi(){var V;(V=N.value)===null||V===void 0||V.focusInput()}function Ei(){var V;w.value&&((V=$.value)===null||V===void 0||V.syncPosition())}q(),i.watch(i.toRef(t,"options"),q);const rr={focus:()=>{var V;(V=N.value)===null||V===void 0||V.focus()},focusInput:()=>{var V;(V=N.value)===null||V===void 0||V.focusInput()},blur:()=>{var V;(V=N.value)===null||V===void 0||V.blur()},blurInput:()=>{var V;(V=N.value)===null||V===void 0||V.blurInput()}},dn=i.computed(()=>{const{self:{menuBoxShadow:V}}=s.value;return{"--n-menu-box-shadow":V}}),Hn=o?Bi("select",void 0,dn,t):void 0;return Object.assign(Object.assign({},rr),{mergedStatus:P,mergedClsPrefix:e,mergedBordered:n,namespace:r,treeMate:b,isMounted:No(),triggerRef:N,menuRef:x,pattern:u,uncontrolledShow:v,mergedShow:w,adjustedTo:Pn(t),uncontrolledValue:a,mergedValue:c,followerRef:$,localizedPlaceholder:C,selectedOption:W,selectedOptions:M,mergedSize:G,mergedDisabled:z,focused:d,activeWithoutMenuOpen:Te,inlineThemeDisabled:o,onTriggerInputFocus:We,onTriggerInputBlur:ce,handleTriggerOrMenuResize:Ei,handleMenuFocus:Wt,handleMenuBlur:ln,handleMenuTabOut:St,handleTriggerClick:gt,handleToggle:Jt,handleDeleteOption:Ve,handlePatternInput:le,handleClear:De,handleTriggerBlur:Ne,handleTriggerFocus:Ft,handleKeydown:jt,handleMenuAfterLeave:ve,handleMenuClickOutside:Ln,handleMenuScroll:nt,handleMenuKeydown:jt,handleMenuMousedown:ri,mergedTheme:s,cssVars:o?void 0:dn,themeClass:Hn==null?void 0:Hn.themeClass,onRender:Hn==null?void 0:Hn.onRender})},render(){return i.h("div",{class:`${this.mergedClsPrefix}-select`},i.h(bu,null,{default:()=>[i.h(_u,null,{default:()=>i.h(t2,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var t,e;return[(e=(t=this.$slots).arrow)===null||e===void 0?void 0:e.call(t)]}})}),i.h(Vu,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===Pn.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>i.h(i.Transition,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var t,e,n;return this.mergedShow||this.displayDirective==="show"?((t=this.onRender)===null||t===void 0||t.call(this),i.withDirectives(i.h(Rv,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(e=this.menuProps)===null||e===void 0?void 0:e.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var r,o;return[(o=(r=this.$slots).empty)===null||o===void 0?void 0:o.call(r)]},header:()=>{var r,o;return[(o=(r=this.$slots).header)===null||o===void 0?void 0:o.call(r)]},action:()=>{var r,o;return[(o=(r=this.$slots).action)===null||o===void 0?void 0:o.call(r)]}}),this.displayDirective==="show"?[[i.vShow,this.mergedShow],[To,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[To,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),u2={},Hh=i.defineComponent({...u2,__name:"searchable-reference-select",props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>s.value?r.value.map(_=>_.id):r.value?r.value.id:null),l=i.ref(s.value?r.optionsListConverter(r.value):r.value?r.optionsListConverter([r.value]):[]),c=i.computed(()=>l.value.map(_=>({..._,class:r.wrapContent?`${_.class} consistent-menu-width`:_.class}))),d=i.ref(!1),u=i.useTemplateRef("select-component"),h=_=>{_.length<r.minTermLength||(d.value=!0,r.searchDataHandler(_,d).then(v=>{if(A.isEmpty(v))return;const w=s.value?r.value:r.value?[r.value]:[],N=v.filter($=>!w.some(x=>x.id===$.id));l.value=r.optionsListConverter([...w,...N])}).finally(()=>{d.value=!1}))};let m="";const g=A.debounce(()=>h(m),800),f=_=>{m=_,g()},p=_=>{var v;if(A.isArray(_)){const w=_.length>0?_.map(N=>{var $;return i.toRaw(($=l.value.find(x=>x.value===N))==null?void 0:$.item)}):[];o("update:value",w)}else if(_>0){const w=i.toRaw((v=l.value.find(N=>N.value===_))==null?void 0:v.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()}}),(_,v)=>(i.openBlock(),i.createBlock(i.unref(d2),{ref:"select-component","clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled,filterable:!0,loading:d.value,multiple:s.value,options:c.value,placeholder:t.placeholder,remote:!0,value:a.value,"render-label":t.renderLabel,"render-tag":t.renderTag,onSearch:f,"onUpdate:value":p},null,8,["clearable","consistent-menu-width","disabled","loading","multiple","options","placeholder","value","render-label","render-tag"]))}}),h2={},Wh=i.defineComponent({...h2,__name:"searchable-product-select",props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:""},searchType:{}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.useTemplateRef("select-component"),a=async h=>r.searchType==="categories"?j.HttpRequester.getInstance(j.ProductCategoryDataProvider).publicSimpleSearch(h):r.searchType==="products"?j.HttpRequester.getInstance(j.ProductDataProvider).publicSimpleSearch(h):new Promise(m=>{m([])}),l=h=>r.searchType==="categories"?Bt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":m.name):r.searchType==="products"?Bt.convertReferencesToSelectOptionsList(h,!0,!1,!1,m=>m!=null&&m.isNewRec()?"-":`[${m.code}] ${m.name}`):[],c=(h,m)=>{if(r.renderLabel)return r.renderLabel(h,m);if(r.searchType==="products"){const g=h.item;return i.h("div",{},[i.h("span",{class:"text-sc-grey mr-2.5"},g.code),i.h("span",{},[g.name])])}if(r.searchType==="categories"){const g=h.item;return i.h("div",{},[g.name])}};return e({focus:()=>{var h;return(h=s.value)==null?void 0:h.focus()},blur:()=>{var h;return(h=s.value)==null?void 0:h.blur()}}),(h,m)=>(i.openBlock(),i.createBlock(Hh,{ref:"select-component",value:t.value,clearable:t.clearable,disabled:t.disabled,placeholder:t.placeholder,"search-data-handler":a,"options-list-converter":l,"consistent-menu-width":t.consistentMenuWidth,"wrap-content":t.wrapContent,"min-term-length":t.minTermLength,"render-label":c,"render-tag":t.renderTag,"onUpdate:value":m[0]||(m[0]=g=>o("update:value",g))},null,8,["value","clearable","disabled","placeholder","consistent-menu-width","wrap-content","min-term-length","render-tag"]))}}),f2={class:"col-span-2 flex flex-row gap-2.5"},m2={class:"flex-1"},g2={class:"text-sc-grey"},p2={class:"ml-2.5"},y2={key:0,class:"flex-none"},b2={},_2=i.defineComponent({...b2,__name:"products-list",props:{value:{},searchType:{},minTermLength:{default:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}},disabled:{type:Boolean}},emits:["update:value"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(null),s=()=>structuredClone(i.toRaw(n.value)),a=i.ref(s()),l=()=>{r("update:value",a.value.map(h=>i.toRaw(h)))},c=h=>{h&&(a.value=[...a.value.map(m=>i.toRaw(m)),...(A.isArray(h)?h:[h]).filter(m=>!a.value.some(g=>g.id===m.id))],i.nextTick(()=>{o.value=null}),l())},d=h=>{h&&(a.value=a.value.map(m=>m.id===h.id?h:i.toRaw(m)),l())},u=h=>{a.value=a.value.filter(m=>m.id!==h.id),l()};return i.watch(()=>n.value,()=>{a.value=s()}),(h,m)=>{const g=O.NListItem,f=U1,p=O.NButton,y=O.NList;return i.openBlock(),i.createBlock(y,{"show-divider":!1,hoverable:!0},{header:i.withCtx(()=>[i.renderSlot(h.$slots,"header")]),footer:i.withCtx(()=>[i.createVNode(Wh,{value:o.value,"onUpdate:value":[m[0]||(m[0]=b=>o.value=b),c],clearable:!0,disabled:t.disabled,"min-term-length":t.minTermLength,"search-type":t.searchType,placeholder:"Введите название"},null,8,["value","disabled","min-term-length","search-type"])]),default:i.withCtx(()=>[a.value.length===0?(i.openBlock(),i.createBlock(g,{key:0,class:"text-center text-sm text-gray-600"},{default:i.withCtx(()=>[...m[1]||(m[1]=[i.createTextVNode(" --- Список пуст --- ",-1)])]),_:1})):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(a.value,b=>(i.openBlock(),i.createBlock(g,{key:b.id},{suffix:i.withCtx(()=>[i.createVNode(p,{disabled:t.disabled,quaternary:"",type:"error",onClick:_=>u(b)},{default:i.withCtx(()=>[i.createVNode(f)]),_:1},8,["disabled","onClick"])]),default:i.withCtx(()=>[i.createElementVNode("div",f2,[i.createElementVNode("span",m2,[i.createElementVNode("span",g2,i.toDisplayString(b.code),1),i.createElementVNode("span",p2,i.toDisplayString(b.name),1)]),h.$slots["item-extra"]?(i.openBlock(),i.createElementBlock("div",y2,[i.renderSlot(h.$slots,"item-extra",{item:b,updateItemCallback:d})])):i.createCommentVNode("",!0)])]),_:2},1024))),128))]),_:3})}}}),w2={class:"flex flex-col"},x2={class:"flex flex-col gap-1.5 text-base text-nowrap"},k2={class:"font-medium"},v2={class:"flex flex-col text-sc-dark-grey"},C2={key:0},S2={class:"font-medium"},B2={class:"font-medium"},T2={class:"font-medium"},N2={class:"font-medium"},$2={class:"font-medium"},R2={class:"font-medium"},E2={class:"font-medium"},P2={class:"font-medium"},F2={class:"font-medium"},V2={class:"font-medium"},I2={class:"flex flex-col gap-1.5 text-base text-nowrap"},M2={class:"font-medium"},A2={class:"flex flex-col text-sc-dark-grey"},O2={class:"font-medium"},z2={class:"font-medium"},D2={class:"flex flex-col gap-1.5 text-base text-nowrap"},L2={class:"font-medium"},H2={class:"text-sc-dark-grey"},W2={class:"font-medium"},j2={key:1,class:"text-base font-medium text-nowrap"},q2={},jh=i.defineComponent({...q2,__name:"order-item-params",props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},setup(t){const e=[j.ConfiguratorsEnum.Kozyrek,j.ConfiguratorsEnum.Mosquitto,j.ConfiguratorsEnum.Strip,j.ConfiguratorsEnum.MetalForDoors,j.ConfiguratorsEnum.Sandwich,j.ConfiguratorsEnum.SandwichM2],n=t,r=i.ref(!1),o=i.computed(()=>{var m,g;return((m=n.item.product.unit)==null?void 0:m.isLinear)&&((g=n.item.product.properties)==null?void 0:g.isLengthConfigurator)}),s=i.computed(()=>j.UnitsHelper.getProductLengthMultiplicity(n.item.product)),a=i.computed(()=>j.UnitsHelper.getProductMultiplicity(n.item.product)),l=i.computed(()=>a.value>1),c=i.ref({quantity:n.item.quantity});i.watch(()=>n.item,m=>{c.value={quantity:m.quantity}});const d=m=>{var g;m!==null&&(c.value.quantity=m,(g=n.eventEmitter)==null||g.emit("order-item:edit-quantity",{item:n.item,quantity:m,loaderRef:r}))},u=()=>{var m;(m=n.eventEmitter)==null||m.emit("order-item:open-configurator",{item:n.item})},h=()=>{var m;(m=n.eventEmitter)==null||m.emit("order-item:edit",{item:n.item})};return(m,g)=>{const f=O.NInputNumber;return i.openBlock(),i.createElementBlock("div",w2,[t.item.configurator&&t.item.configuratorParams&&e.includes(t.item.configurator)?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[i.createElementVNode("div",x2,[i.createElementVNode("span",null,[g[1]||(g[1]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",k2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",v2,[t.item.configurator===i.unref(j.ConfiguratorsEnum).Kozyrek?(i.openBlock(),i.createElementBlock("span",C2,[g[2]||(g[2]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",S2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Mosquitto?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("span",null,[g[3]||(g[3]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",B2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[g[4]||(g[4]=i.createTextVNode(" Высота: ",-1)),i.createElementVNode("span",T2,i.toDisplayString(Math.round(t.item.height*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Strip?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.item.configuratorParams.linesWidths,(p,y)=>(i.openBlock(),i.createElementBlock("span",{key:y},[i.createTextVNode(" Полоса №"+i.toDisplayString(Number(y)+1)+": ",1),i.createElementVNode("span",N2,i.toDisplayString(p)+" мм.",1)]))),128)),i.createElementVNode("span",null,[g[5]||(g[5]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",$2,i.toDisplayString(t.item.length)+" м.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).MetalForDoors?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[i.createElementVNode("span",null,[g[6]||(g[6]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",R2,i.toDisplayString(t.item.width)+" мм.",1)]),i.createElementVNode("span",null,[g[7]||(g[7]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",E2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).Sandwich?(i.openBlock(!0),i.createElementBlock(i.Fragment,{key:4},i.renderList(t.item.configuratorParams.items??[],(p,y)=>(i.openBlock(),i.createElementBlock("span",{key:y},[i.createTextVNode(" Изделие №"+i.toDisplayString(Number(y)+1)+": ",1),i.createElementVNode("span",P2,i.toDisplayString(p.width)+"×"+i.toDisplayString(p.length)+" мм, "+i.toDisplayString(p.count)+" шт.",1)]))),128)):i.createCommentVNode("",!0),t.item.configurator===i.unref(j.ConfiguratorsEnum).SandwichM2?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[i.createElementVNode("span",null,[g[8]||(g[8]=i.createTextVNode(" Ширина: ",-1)),i.createElementVNode("span",F2,i.toDisplayString(Math.round(t.item.width*1e3))+" мм.",1)]),i.createElementVNode("span",null,[g[9]||(g[9]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",V2,i.toDisplayString(Math.round(t.item.length*1e3))+" мм.",1)])],64)):i.createCommentVNode("",!0)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(u,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):o.value&&s.value>0?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[i.createElementVNode("div",I2,[i.createElementVNode("span",null,[g[10]||(g[10]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",M2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("div",A2,[i.createElementVNode("span",null,[g[11]||(g[11]=i.createTextVNode(" Длина: ",-1)),i.createElementVNode("span",O2,i.toDisplayString(s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)]),i.createElementVNode("span",null,[g[12]||(g[12]=i.createTextVNode(" Всего: ",-1)),i.createElementVNode("span",z2,i.toDisplayString(t.item.quantity*s.value)+" "+i.toDisplayString(t.item.product.unit.name),1)])])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(h,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):t.item.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[i.createElementVNode("div",D2,[i.createElementVNode("span",null,[g[13]||(g[13]=i.createTextVNode(" Количество: ",-1)),i.createElementVNode("span",L2,i.toDisplayString(t.item.quantity)+" шт.",1)]),i.createElementVNode("span",H2,[g[14]||(g[14]=i.createTextVNode(" Метраж: ",-1)),i.createElementVNode("span",W2,i.toDisplayString(t.item.length??t.item.width)+" "+i.toDisplayString(t.item.product.unit.name),1)])]),t.allowEdit?(i.openBlock(),i.createElementBlock("a",{key:0,href:"#",class:"text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5",onClick:i.withModifiers(h,["prevent"])}," Изменить ")):i.createCommentVNode("",!0)],64)):(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[t.allowEdit?(i.openBlock(),i.createBlock(f,{key:0,value:c.value.quantity,parse:i.unref(it),min:a.value,step:a.value,"show-button":l.value,"button-placement":"both",disabled:!!r.value,loading:!!r.value,placeholder:"Кол-во",size:"small",class:"min-w-16 grow",onKeydown:g[0]||(g[0]=p=>i.unref(Wr)(p,".",!1)),onFocus:i.unref(Le),"onUpdate:value":d},{suffix:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.item.product.unit.name),1)]),_:1},8,["value","parse","min","step","show-button","disabled","loading","onFocus"])):(i.openBlock(),i.createElementBlock("span",j2,i.toDisplayString(t.item.quantity)+" "+i.toDisplayString(t.item.product.unit.name),1))],64))])}}}),X2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function Y2(t,e){return i.openBlock(),i.createElementBlock("svg",X2,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M13 4a1 1 0 0 1 1 1h4a1 1 0 0 1 .783.378l.074.108l3 5l.055.103l.04.107l.029.109l.016.11L22 11v6a1 1 0 0 1-1 1h-1.171a3.001 3.001 0 0 1-5.658 0H9.829a3.001 3.001 0 0 1-5.658 0H3a1 1 0 0 1-1-1V6a2 2 0 0 1 2-2zM7 16a1 1 0 1 0 0 2a1 1 0 0 0 0-2m10 0a1 1 0 1 0 0 2a1 1 0 0 0 0-2m.434-9H14v3h5.234z"},null,-1)])])}const U2=i.markRaw({name:"tabler-truck-filled",render:Y2}),K2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function G2(t,e){return i.openBlock(),i.createElementBlock("svg",K2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M5 17a2 2 0 1 0 4 0a2 2 0 1 0-4 0m10 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"}),i.createElementVNode("path",{d:"M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4"})],-1)])])}const Z2=i.markRaw({name:"tabler-truck-delivery",render:G2}),Q2={viewBox:"0 0 24 24",width:"1.2em",height:"1.2em"};function J2(t,e){return i.openBlock(),i.createElementBlock("svg",Q2,[...e[0]||(e[0]=[i.createElementVNode("g",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2"},[i.createElementVNode("path",{d:"M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15"}),i.createElementVNode("path",{d:"M9 9a3 3 0 0 1 3-3h4a3 3 0 0 1 3 3v2a3 3 0 0 1-3 3h-4a3 3 0 0 1-3-3zM7 19a2 2 0 1 0 4 0a2 2 0 1 0-4 0m9 0a2 2 0 1 0 4 0a2 2 0 1 0-4 0"})],-1)])])}const eC=i.markRaw({name:"tabler-truck-loading",render:J2}),tC={class:"flex flex-col gap-1"},nC={key:0,class:"flex flex-row gap-1 text-sm text-sc-grey"},iC={key:1,class:"text-base"},rC={class:"text-sc-dark-grey mr-1.5"},oC={key:0},sC={key:1},aC={},Ho=i.defineComponent({...aC,__name:"order-delivery-label",props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(t){const e=i.computed(()=>{var s;return(s=j.useReferencesStore().deliveryTypeReference)==null?void 0:s.find(a=>a.id===o.delivery.type)}),n=i.computed(()=>en.format(o.delivery.date,"dd.MM.yyyy")),r=i.computed(()=>{var s;return(s=o.delivery.address)!=null&&s.address?jn.getFormatEntityName({name:o.delivery.address.address,deletedAt:o.delivery.address.deletedAt}):""}),o=t;return(s,a)=>{var u,h,m,g,f,p,y,b;const l=eC,c=Z2,d=U2;return i.openBlock(),i.createElementBlock("div",tC,[t.showType?(i.openBlock(),i.createElementBlock("span",nC,[((u=e.value)==null?void 0:u.slug)==="self_delivery"?(i.openBlock(),i.createBlock(l,{key:0})):i.createCommentVNode("",!0),((h=e.value)==null?void 0:h.slug)==="delivery"?(i.openBlock(),i.createBlock(c,{key:1})):i.createCommentVNode("",!0),((m=e.value)==null?void 0:m.slug)==="transport_company_delivery"?(i.openBlock(),i.createBlock(d,{key:2})):i.createCommentVNode("",!0),i.createElementVNode("span",null,i.toDisplayString((g=e.value)==null?void 0:g.name),1)])):i.createCommentVNode("",!0),t.showDetails?(i.openBlock(),i.createElementBlock("span",iC,[i.createElementVNode("span",rC,i.toDisplayString(n.value),1),(p=(f=t.delivery)==null?void 0:f.address)!=null&&p.address?(i.openBlock(),i.createElementBlock("span",oC,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0),(b=(y=t.delivery)==null?void 0:y.warehouse)!=null&&b.address?(i.openBlock(),i.createElementBlock("span",sC," со склада "+i.toDisplayString(t.delivery.warehouse.address),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)])}}}),lC={class:"flex flex-col gap-2.5"},cC={class:"text-base"},dC=["href"],uC={class:"text-sc-grey"},hC={},qh=i.defineComponent({...hC,__name:"order-common-info",props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{}},setup(t){const e=t,n=i.computed(()=>e.fields.includes(Pe.Id)?e.order.id:void 0),r=i.computed(()=>{var l,c;return e.fields.includes(Pe.Status)?(c=(l=j.useReferencesStore().orderStatusReference)==null?void 0:l.find(d=>{var u;return d.id===(((u=e.order.status)==null?void 0:u.id)??-1)}))==null?void 0:c.name:void 0}),o=i.computed(()=>e.fields.includes(Pe.CreatedAt)),s=i.computed(()=>e.fields.includes(Pe.ClientInfo)||e.fields.includes(Pe.ClientInfoShort)?e.order.client:void 0),a=i.computed(()=>e.fields.includes(Pe.DeliveryInfo)?e.order.delivery:void 0);return(l,c)=>(i.openBlock(),i.createElementBlock("div",lC,[i.createElementVNode("span",cC,[n.value?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.orderUrl.replace(":id",t.order.id.toString()),target:"_blank",class:"text-sc-dark-grey"}," #"+i.toDisplayString(n.value),9,dC)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[c[0]||(c[0]=i.createTextVNode(" от ",-1)),i.createVNode(xo,{date:t.order.createdAt,"is-time-secondary":!0},null,8,["date"])],64)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[c[1]||(c[1]=i.createTextVNode(" - ",-1)),i.createElementVNode("span",uC,i.toDisplayString(r.value),1)],64)):i.createCommentVNode("",!0),t.order.isOnOrder?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[c[2]||(c[2]=i.createTextVNode(" - ",-1)),c[3]||(c[3]=i.createElementVNode("span",{class:"text-yellow-400"},"Под заказ",-1))],64)):i.createCommentVNode("",!0),t.order.isNotInStock?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[c[4]||(c[4]=i.createTextVNode(" - ",-1)),c[5]||(c[5]=i.createElementVNode("span",{class:"text-red-500"},"Нет в наличии",-1))],64)):i.createCommentVNode("",!0)]),s.value?(i.openBlock(),i.createBlock(wr,{key:0,client:s.value,class:"ml-3"},null,8,["client"])):i.createCommentVNode("",!0),a.value?(i.openBlock(),i.createBlock(Ho,{key:1,delivery:a.value,class:"ml-3"},null,8,["delivery"])):i.createCommentVNode("",!0)]))}}),fC={},$a=i.defineComponent({...fC,__name:"order-payment",props:{payment:{}},setup(t){const e=t,n=i.computed(()=>{var r;return(r=j.useReferencesStore().paymentTypeReference)==null?void 0:r.find(o=>o.id===e.payment.type)});return(r,o)=>{var s;return i.openBlock(),i.createElementBlock("span",null,i.toDisplayString(((s=n.value)==null?void 0:s.name)??"-"),1)}}}),mC={},Mr=i.defineComponent({...mC,__name:"creator-user-type-tag",props:{userType:{default:void 0},prefixText:{default:"Добавлено"},variant:{default:"info"},changedFields:{default:void 0}},setup(t){const e=t,n={quantity:"количество",length:"длина"},r=i.computed(()=>e.variant==="danger"||e.changedFields?"bg-orange-500":"bg-sky-500"),o=i.computed(()=>{const s={[j.UserTypeEnum.Manager]:"менеджером",[j.UserTypeEnum.Operator]:"оператором",[j.UserTypeEnum.Client]:"клиентом",[j.UserTypeEnum.Admin]:"администратором"};if(e.changedFields){const l=e.changedFields.map(d=>n[d]??d).join(", ");return`Было изменено${e.userType?` ${s[e.userType]??""}`:""}: ${l}`}const a=e.userType?` ${s[e.userType]??""}`:"";return`${e.prefixText}${a}`.trim()});return(s,a)=>(i.openBlock(),i.createElementBlock("small",{class:i.normalizeClass(`inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white no-underline opacity-100 ${r.value}`)},i.toDisplayString(o.value),3))}}),gC={class:"flex flex-row gap-1.5"},pC={class:"flex-none text-nowrap"},yC={class:"flex flex-1 flex-col gap-2.5"},bC={key:0,class:"text-sm"},_C={class:"text-gray-600"},wC={class:"grid grid-flow-col grid-rows-2 gap-1 text-base"},xC={key:0},kC={key:1},vC={},Xh=i.defineComponent({...vC,__name:"order-product-info",props:{product:{},index:{}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",gC,[i.createElementVNode("span",pC,i.toDisplayString(t.index+1)+".",1),i.createElementVNode("div",yC,[i.createVNode(hr,{product:t.product.product,"show-planning-dates":!1},null,8,["product"]),t.product.marker?(i.openBlock(),i.createElementBlock("span",bC,[n[0]||(n[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",_C,i.toDisplayString(t.product.marker),1)])):i.createCommentVNode("",!0),t.product.creator&&t.product.creator.type?(i.openBlock(),i.createBlock(Mr,{key:1,"user-type":t.product.creator.type,class:"self-start"},null,8,["user-type"])):i.createCommentVNode("",!0),i.createElementVNode("div",wC,[n[1]||(n[1]=i.createElementVNode("span",null,"Кол-во",-1)),t.product.product.getIsMeasurable()?(i.openBlock(),i.createElementBlock("span",xC,i.toDisplayString(`${t.product.length} ${t.product.product.unit.name} x ${t.product.quantity} шт.`),1)):(i.openBlock(),i.createElementBlock("span",kC,i.toDisplayString(`${t.product.quantity} ${t.product.product.unit.name}`),1)),n[2]||(n[2]=i.createElementVNode("span",null,"Цена за ед.",-1)),i.createVNode(Xn,{product:t.product,"cost-field-name":"costOneRub"},null,8,["product"]),n[3]||(n[3]=i.createElementVNode("span",null,"Сумма",-1)),i.createVNode(Xn,{product:t.product,"cost-field-name":"cost"},null,8,["product"])])])]))}}),CC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function SC(t,e){return i.openBlock(),i.createElementBlock("svg",CC,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m112 112l20 320c.95 18.49 14.4 32 32 32h184c17.67 0 30.87-13.51 32-32l20-320"},null,-1),i.createElementVNode("path",{fill:"currentColor",stroke:"currentColor","stroke-linecap":"round","stroke-miterlimit":"10","stroke-width":"32",d:"M80 112h352"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"M192 112V72h0a23.93 23.93 0 0 1 24-24h80a23.93 23.93 0 0 1 24 24h0v40m-64 64v224m-72-224l8 224m136-224l-8 224"},null,-1)])])}const BC=i.markRaw({name:"ion-trash-outline",render:SC}),TC={},NC=i.defineComponent({...TC,__name:"order-item-specification",props:{src:{}},setup(t){const e=i.useTemplateRef("image-reference");return(n,r)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("a",{class:"text-blue-500 hover:underline text-sm mt-1 block cursor-pointer",onClick:r[0]||(r[0]=o=>{var s;return(s=e.value)==null?void 0:s.showPreview()})}," Спецификация "),i.withDirectives(i.createVNode(i.unref(O.NImage),{ref:"image-reference",src:t.src,"previewed-img-props":{style:"max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;"}},null,8,["src"]),[[i.vShow,!1]])],64))}}),$C={class:"flex flex-col gap-0.5"},RC={class:"text-gray-600"},EC={},PC=i.defineComponent({...EC,__name:"order-item-name",props:{item:{}},setup(t){const e=t,n=i.computed(()=>!!e.item.isRemoved||!!e.item.replacementId),r=i.computed(()=>{var l;return"creator"in e.item&&!!((l=e.item.creator)!=null&&l.type)}),o=i.computed(()=>"specificationImgUrl"in e.item?e.item.specificationImgUrl:void 0),s=i.computed(()=>"changedFields"in e.item?e.item.changedFields:[]),a=i.computed(()=>{var l,c;return"replacement"in e.item?(c=(l=e.item.replacement)==null?void 0:l.creator)==null?void 0:c.type:void 0});return(l,c)=>(i.openBlock(),i.createElementBlock("div",$C,[i.createElementVNode("div",{class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(hr,{product:t.item.product,"show-additional-sale-icon":t.item.isAdditionalSale??!1,"show-code":!1,"show-planning-dates":!1},null,8,["product","show-additional-sale-icon"])],2),t.item.marker?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[c[0]||(c[0]=i.createTextVNode(" Маркировка: ",-1)),i.createElementVNode("span",RC,i.toDisplayString(t.item.marker),1)],2)):i.createCommentVNode("",!0),o.value?(i.openBlock(),i.createElementBlock("div",{key:1,class:i.normalizeClass(n.value?"line-through opacity-50":"")},[i.createVNode(NC,{src:o.value},null,8,["src"])],2)):i.createCommentVNode("",!0),r.value&&!n.value?(i.openBlock(),i.createBlock(Mr,{key:2,"user-type":t.item.creator.type,class:"mt-1 self-start","prefix-text":"Добавлено"},null,8,["user-type"])):i.createCommentVNode("",!0),t.item.isRemoved&&!t.item.replacementId&&s.value.length===0?(i.openBlock(),i.createBlock(Mr,{key:3,class:"mt-1 self-start","prefix-text":"Удалено",variant:"danger"})):i.createCommentVNode("",!0),t.item.replacementId&&s.value.length>0?(i.openBlock(),i.createBlock(Mr,{key:4,"user-type":a.value,"changed-fields":s.value,class:"mt-1 self-start"},null,8,["user-type","changed-fields"])):i.createCommentVNode("",!0)]))}}),FC={},VC=i.defineComponent({...FC,__name:"order-items-list",props:i.mergeModels({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:["update:selectedRowKeys"],setup(t){const e=t,n=i.useModel(t,"selectedRowKeys"),r=i.computed(()=>A.sortBy(e.products,"ord")),o=g=>!!g.isRemoved||!!g.replacementId,s=(g,f)=>{f?n.value.includes(g)||(n.value=[...n.value,g]):n.value=n.value.filter(p=>p!==g)},a=g=>e.selectable?{class:n.value.includes(g.id)?void 0:"opacity-60"}:{},l=(g,f)=>{const p=r.value,y=g.logicGroupId;if(!y)return 1;const b=p.at(f-1);if(f&&b&&b.logicGroupId===y)return 0;const _=p.slice(f),v=_.findIndex(w=>w.logicGroupId!==y);return v===-1?_.length:v},c=i.ref(ht.getDeviceTypeByResolution()),d=i.ref(window.innerWidth),u=()=>{const g=[{title:"№ п.п.",key:"id",resizable:!0,width:50,render:(p,y)=>i.h("span",{class:`text-base${o(p)?" line-through opacity-50":""}`},[y+1,"."])},{title:"Артикул",key:"codeNumber",resizable:!0,width:d.value>=1536?156:120,render:p=>i.h("span",{class:`text-base${o(p)?" line-through opacity-50":""}`},[p.product.code])},{title:"Наименование",key:"name",resizable:!0,render:p=>i.h(PC,{item:p})},{title:"Кол-во",key:"quantity",resizable:!0,width:180,rowSpan:l,render:p=>i.h(jh,{class:o(p)?"line-through opacity-50":"",item:p,eventEmitter:e.eventEmitter,allowEdit:e.allowEdit&&!o(p)})},{title:"Цена за ед.",key:"costOneRub",resizable:!0,width:120,render:p=>i.h("div",{class:o(p)?"line-through opacity-50":""},[i.h(Xn,{product:p,costFieldName:"costOne",showQuantityUnit:!0})])},{title:"Сумма",key:"cost",resizable:!0,width:120,render:p=>i.h("div",{class:o(p)?"line-through opacity-50":""},[i.h(Xn,{product:p,costFieldName:"cost",showCurrency:!0})])},...e.allowEdit?[{title:"",key:"delete",width:44,rowSpan:l,render:p=>o(p)?null:i.h(O.NButton,{quaternary:!0,type:"error",onClick:()=>{var y;(y=e.eventEmitter)==null||y.emit("order-item:delete",{item:p})}},()=>i.h(BC))}]:[]],f=e.selectable?[{key:"checkbox",title:"",className:"align-top",width:"32",cellProps:p=>({class:o(p)?void 0:"cursor-pointer",onClick:()=>{o(p)||s(p.id,!n.value.includes(p.id))}}),render:p=>i.h(O.NCheckbox,{checked:n.value.includes(p.id),disabled:o(p)})}]:[];switch(c.value){case qe.phone:case qe.tablet:return[...f,{title:"",key:"items",resizable:!0,render:(p,y)=>i.h(Xh,{product:p,index:y})}];case qe.laptop:return[...f,...g];default:return[...f,...g]}},h=i.computed(()=>u()),m=()=>{c.value=ht.getDeviceTypeByResolution(),d.value=window.innerWidth};return i.onMounted(()=>{m(),window.addEventListener("resize",m)}),i.onUnmounted(()=>{window.removeEventListener("resize",m)}),(g,f)=>{const p=O.NDataTable;return i.openBlock(),i.createElementBlock(i.Fragment,null,[f[0]||(f[0]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Список позиций",-1)),i.createVNode(p,{columns:h.value,data:r.value,"row-key":y=>y.id,"row-props":a,"bottom-bordered":!1,bordered:!1,"max-height":t.maxHeight},null,8,["columns","data","row-key","max-height"])],64)}}}),Yh=qn(VC,[["__scopeId","data-v-e1fad754"]]),IC={key:0,class:"text-sc-dark-grey my-2 text-center"},MC={key:1,class:"text-sc-dark-grey my-2"},AC={},Uh=i.defineComponent({...AC,__name:"order-status-history",props:{order:{}},setup(t){const e=t,n=i.ref(!1),r=i.ref([]),o=l=>en.format(l,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime),s=l=>l.statusDetail?`${l.status.name} (${l.statusDetail.name})`:l.status.name,a=(l=!0)=>{l&&(n.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrderStatusHistory(e.order.id).then(c=>{r.value=c}).finally(()=>{l&&(n.value=!1)})};return i.watch(()=>e.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(l,c)=>{const d=O.NSpin,u=O.NTimelineItem,h=O.NTimeline;return i.openBlock(),i.createElementBlock("div",null,[c[1]||(c[1]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"История статусов",-1)),n.value?(i.openBlock(),i.createElementBlock("div",IC,[i.createVNode(d,{size:"small",class:"mb-1 align-middle"}),c[0]||(c[0]=i.createElementVNode("span",{class:"ml-2"},"Загрузка истории ...",-1))])):r.value.length===0?(i.openBlock(),i.createElementBlock("div",MC," История статусов отсутствует. ")):(i.openBlock(),i.createBlock(h,{key:2},{default:i.withCtx(()=>[(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(r.value,(m,g)=>(i.openBlock(),i.createBlock(u,{key:g,type:g===0?"info":"default",title:s(m),time:o(m.createdAt),content:m.user.name},null,8,["type","title","time","content"]))),128))]),_:1}))])}}}),OC={class:"text-base"},zC={},Ra=i.defineComponent({...zC,__name:"user-short-info",props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass({"flex flex-col":t.showUserType&&t.extraInfoOnSecondLine})},[i.createElementVNode("span",OC,i.toDisplayString(t.user.name),1),t.showUserType?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass([{"ml-1":!t.extraInfoOnSecondLine},"text-sc-grey"])}," ["+i.toDisplayString(t.user.type)+"] ",3)):i.createCommentVNode("",!0)],2))}}),DC={class:"ml-4 grid grid-cols-3 gap-1.5 text-base"},LC={class:"col-span-2"},HC={class:"col-span-2"},WC={},Kh=i.defineComponent({...WC,__name:"order-details",props:{order:{}},emits:["click:client-name"],setup(t,{emit:e}){const n=e;return(r,o)=>(i.openBlock(),i.createElementBlock("div",null,[o[11]||(o[11]=i.createElementVNode("h3",null,"Детали заказа",-1)),i.createElementVNode("div",DC,[t.order.creator.id!==t.order.client.id?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[o[1]||(o[1]=i.createElementVNode("span",null,"Создал",-1)),i.createVNode(Ra,{user:t.order.creator,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0),o[10]||(o[10]=i.createElementVNode("span",null,"Клиент",-1)),i.createVNode(wr,{client:t.order.client,class:"col-span-2","onClick:clientName":o[0]||(o[0]=s=>n("click:client-name",t.order.client,s))},null,8,["client"]),t.order.contragent?(i.openBlock(),i.createElementBlock(i.Fragment,{key:1},[o[2]||(o[2]=i.createElementVNode("span",null,"Контрагент",-1)),i.createVNode(Kd,{contragent:t.order.contragent,class:"col-span-2"},null,8,["contragent"])],64)):i.createCommentVNode("",!0),t.order.image?(i.openBlock(),i.createElementBlock(i.Fragment,{key:2},[o[3]||(o[3]=i.createElementVNode("span",null,"Графический файл клиента",-1)),o[4]||(o[4]=i.createElementVNode("a",{class:"fancybox col-span-2",href:"{{ order.image }}"}," Посмотреть ",-1))],64)):i.createCommentVNode("",!0),t.order.barcode?(i.openBlock(),i.createElementBlock(i.Fragment,{key:3},[o[5]||(o[5]=i.createElementVNode("span",null,"Штрих-код",-1)),i.createElementVNode("span",LC,i.toDisplayString(t.order.barcode),1)],64)):i.createCommentVNode("",!0),t.order.payment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:4},[o[6]||(o[6]=i.createElementVNode("span",null,"Оплата",-1)),i.createVNode($a,{payment:t.order.payment,class:"col-span-2"},null,8,["payment"])],64)):i.createCommentVNode("",!0),t.order.delivery?(i.openBlock(),i.createElementBlock(i.Fragment,{key:5},[o[7]||(o[7]=i.createElementVNode("span",null,"Доставка",-1)),i.createVNode(Ho,{delivery:t.order.delivery,class:"col-span-2"},null,8,["delivery"])],64)):i.createCommentVNode("",!0),t.order.comment?(i.openBlock(),i.createElementBlock(i.Fragment,{key:6},[o[8]||(o[8]=i.createElementVNode("span",null,"Комментарий",-1)),i.createElementVNode("span",HC,i.toDisplayString(t.order.comment),1)],64)):i.createCommentVNode("",!0),t.order.attachedUser?(i.openBlock(),i.createElementBlock(i.Fragment,{key:7},[o[9]||(o[9]=i.createElementVNode("span",null,"Закреплен за",-1)),i.createVNode(Ra,{user:t.order.attachedUser,class:"col-span-2"},null,8,["user"])],64)):i.createCommentVNode("",!0)])]))}}),jC={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function qC(t,e){return i.openBlock(),i.createElementBlock("svg",jC,[...e[0]||(e[0]=[i.createElementVNode("rect",{width:"336",height:"336",x:"128",y:"128",fill:"none",stroke:"currentColor","stroke-linejoin":"round","stroke-width":"32",rx:"57",ry:"57"},null,-1),i.createElementVNode("path",{fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32",d:"m383.5 128l.5-24a56.16 56.16 0 0 0-56-56H112a64.19 64.19 0 0 0-64 64v216a56.16 56.16 0 0 0 56 56h24"},null,-1)])])}const XC=i.markRaw({name:"ion-copy-outline",render:qC}),YC={class:"flex flex-col items-start gap-1.5 text-base"},UC=["href"],KC=["href"],GC={key:1,class:"flex items-center gap-2"},ZC=["href"],QC={},Gh=i.defineComponent({...QC,__name:"order-external-links",props:{order:{}},setup(t){const e=i.computed(()=>{var n,r;return!!t.order.erpOrderUrl||(((n=t.order.invoices)==null?void 0:n.length)??0)>0||!!((r=t.order.payment)!=null&&r.onlinePaymentLink)});return(n,r)=>{var a;const o=XC,s=O.NButton;return e.value?(i.openBlock(),i.createElementBlock(i.Fragment,{key:0},[r[0]||(r[0]=i.createElementVNode("h3",{class:"!mb-3 !mt-0 text-base font-semibold"},"Внешние ссылки",-1)),i.createElementVNode("div",YC,[t.order.erpOrderUrl?(i.openBlock(),i.createElementBlock("a",{key:0,href:t.order.erpOrderUrl,target:"_blank"}," Открыть заявку в ERP ",8,UC)):i.createCommentVNode("",!0),(i.openBlock(!0),i.createElementBlock(i.Fragment,null,i.renderList(t.order.invoices??[],(l,c)=>(i.openBlock(),i.createElementBlock("a",{key:c,class:"btn btn-primary",href:l}," Скачать счет №"+i.toDisplayString(c+1),9,KC))),128)),(a=t.order.payment)!=null&&a.onlinePaymentLink?(i.openBlock(),i.createElementBlock("div",GC,[i.createElementVNode("a",{href:t.order.payment.onlinePaymentLink,target:"_blank"}," Оплатить заказ ",8,ZC),i.withDirectives((i.openBlock(),i.createBlock(s,{text:"",title:"Скопировать ссылку на оплату"},{default:i.withCtx(()=>[i.createVNode(o)]),_:1})),[[i.unref(Qa),t.order.payment.onlinePaymentLink]])])):i.createCommentVNode("",!0)])],64)):i.createCommentVNode("",!0)}}}),JC={key:0},eS={class:"text-sc-dark-grey my-2 text-center"},tS={key:1,class:"text-sc-dark-grey my-2 text-center"},nS={key:2},iS={class:"text-sc-dark-grey mt-4 text-right font-bold"},rS={class:"text-sc-primary"},oS={},Zh=i.defineComponent({...oS,__name:"order-info",props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:["click:client-name"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=i.ref(),a=(d=!0)=>{if("products"in n.order){s.value=new j.Order(n.order);return}d&&(o.value=!0),j.HttpRequester.getInstance(j.OrdersDataProvider).getOrder(n.order.id).then(u=>{s.value=u}).finally(()=>{d&&(o.value=!1)})},l=i.computed(()=>{var d;return(((d=s.value)==null?void 0:d.products)??[]).filter(u=>!u.isRemoved&&!u.replacementId)}),c=i.computed(()=>l.value.reduce((d,u)=>d+u.costRub,0).toLocaleString("ru-ru",{minimumFractionDigits:2}));return i.watch(()=>n.order,()=>{a(!1)}),i.onMounted(()=>{a()}),(d,u)=>{const h=O.NSpin;return o.value?(i.openBlock(),i.createElementBlock("div",JC,[i.createElementVNode("div",eS,[i.createVNode(h,{size:"small",class:"mb-2.5 align-middle"}),u[1]||(u[1]=i.createElementVNode("div",null,[i.createElementVNode("span",null,"Загрузка данных ...")],-1))])])):!s.value||s.value.products.length===0?(i.openBlock(),i.createElementBlock("div",tS," --- Не удалось загрузить данные о заказе --- ")):(i.openBlock(),i.createElementBlock("div",nS,[i.createVNode(Yh,{products:l.value,"event-emitter":t.eventEmitter,"allow-edit":t.allowEdit},null,8,["products","event-emitter","allow-edit"]),i.createElementVNode("div",iS,[u[2]||(u[2]=i.createTextVNode(" ИТОГО: ",-1)),i.createElementVNode("span",rS,i.toDisplayString(c.value)+" ₽",1)]),i.createVNode(Kh,{order:s.value,"onClick:clientName":u[0]||(u[0]=m=>r("click:client-name",s.value.client,m))},null,8,["order"]),i.createVNode(Gh,{order:s.value},null,8,["order"]),i.createVNode(Uh,{order:s.value},null,8,["order"])]))}}}),sS={},aS=i.defineComponent({...sS,__name:"order-actions",props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(t){const e=t,n=i.inject(dr,"small"),r=i.computed(()=>A.isNil(e.orderContextButtonsConfig)?[]:A.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=Uo,c=O.NButton,d=O.NDropdown;return((u=r.value)==null?void 0:u.length)>0?(i.openBlock(),i.createBlock(d,{key:0,options:r.value,size:i.unref(n),trigger:"click",onSelect:o},{default:i.withCtx(()=>[i.createVNode(c,{ghost:!0,size:i.unref(n),type:"primary"},{default:i.withCtx(()=>[i.createVNode(l)]),_:1},8,["size"])]),_:1},8,["options","size"])):i.createCommentVNode("",!0)}}}),lS={},cS=i.defineComponent({...lS,__name:"orders-list",props:i.mergeModels({fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},isRowSelectable:{type:Function,default:void 0}},{checkedRowKeys:{default:()=>[]},checkedRowKeysModifiers:{}}),emits:i.mergeModels(["click:client-name","dblclick:row","update:pagination","update:sort"],["update:checkedRowKeys"]),setup(t,{emit:e}){const n=t,r=e,o=i.useModel(t,"checkedRowKeys"),s=(E,M)=>{M?o.value.includes(E)||(o.value=[...o.value,E]):o.value=o.value.filter(W=>W!==E)},a=()=>A.cloneDeep(n.sort??[{field:"id",direction:"desc"}]),l=i.ref(a()),c=i.ref([]),d=i.ref(!1),u=i.ref(700),h=()=>{const E=ht.getDeviceTypeByResolution(),M=E===qe.phone||E===qe.tablet;if(!(!n.stickyHeaderOnMobile&&M))return u.value*(j.useBaseConfigStateStore().config.tableDefaultHeightCoefficient??.6)},m=i.ref(h()),g=E=>{const M={onDblclick:()=>r("dblclick:row",E)},W=[];return n.selectable&&o.value.length>0&&!o.value.includes(E.id)&&W.push("opacity-60"),n.useCellIndication&&(E.isOnOrder&&W.push("on-order"),E.isLargeOrder&&W.push("large-order"),E.isNotInStock&&W.push("not-in-stock"),W.push("order-status",E.status.slug),E.delivery.date&&en.isTomorrow(new Date(E.delivery.date))&&W.push("next-day-order")),W.length>0&&(M.class=W.join(" ")),M},f=()=>{const E=[Pe.CreatedAt,Pe.Id,Pe.ClientInfo,Pe.ClientCity,Pe.DeliveryDate,Pe.PaymentType,Pe.SalesDirections,Pe.Status,...n.showAttachedUserColumn?[Pe.AttachedUser]:[],Pe.actions],M=n.fields.length>0?n.fields:E,W={title:"???",key:"undefined",render:()=>i.h("span",{},["--- unknown ---"])},Q={type:"expand",expandable:A.constant(!0),renderExpand:P=>i.h(Zh,{order:P,class:"pl-10 pt-3 pb-10","onClick:client-name":()=>{r("click:client-name",P.client,null)}}),width:"30"};let G=[{title:"Дата заказа",key:Pe.CreatedAt,resizable:!0,width:100,render:P=>i.h(xo,{date:P.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:"text-base"})},{title:"№ заказа",key:Pe.Id,resizable:!0,width:75,className:"order-id",render:P=>i.h("a",{href:n.orderUrl.replace(":id",P.id.toString()),class:"text-base"},P.id)},{title:"Дата доставки / самовывоза",key:Pe.DeliveryDate,resizable:!0,width:100,className:"delivery-date",render:P=>i.h(xo,{date:P.delivery.date,isShowTime:!1,class:"text-base"})},{title:"Клиент",key:Pe.ClientInfo,resizable:!0,minWidth:320,render:P=>i.h(wr,{client:P.client,"onClick:client-name":()=>{r("click:client-name",P.client,null)}})},{title:"Тип доставки",key:Pe.DeliveryInfo,resizable:!0,minWidth:320,render:P=>i.h(Ho,{delivery:P.delivery})},{title:"Клиент",key:Pe.ClientInfoShort,resizable:!0,minWidth:320,render:P=>i.h(wr,{client:P.client,showCityAndRegion:!1,"onClick:client-name":()=>{r("click:client-name",P.client,null)}})},{title:"Город клиента",key:Pe.ClientCity,resizable:!0,minWidth:90,width:120,render:P=>{var L;return i.h("span",{class:"text-base"},((L=P.client)==null?void 0:L.city.name)??"—")}},{title:"Статус",key:Pe.Status,resizable:!0,width:150,minWidth:115,className:"order-status",render:P=>i.h("span",{class:"text-base"},[P.status.name])},{title:"Тип оплаты",key:Pe.PaymentType,resizable:!0,width:115,minWidth:95,render:P=>P.payment?i.h($a,{payment:P.payment}):i.h("span",{class:"text-base"},"—")},{title:"Напр. продаж",key:Pe.SalesDirections,resizable:!0,width:70,render:P=>{var L;return i.h("span",{class:"text-base"},[((L=P.salesDirection)==null?void 0:L.name)??""])}},...n.showAttachedUserColumn?[{title:"Закреплено за",key:Pe.AttachedUser,resizable:!0,minWidth:120,render:P=>{var L;return i.h("span",{class:"text-base"},[((L=P==null?void 0:P.attachedUser)==null?void 0:L.name)??""])}}]:[]];n.orderContextButtonsConfig&&G.push({key:"actions",title:"",className:"align-top",width:50,render:P=>i.h(aS,{order:P,orderContextButtonsConfig:n.orderContextButtonsConfig,onOrderContextSelect:n.onOrderContextSelect})}),n.enableSorting&&(G=G.map(P=>[Pe.Id,Pe.CreatedAt,Pe.DeliveryDate].includes(P.key)?{...P,sorter:!0,sortOrder:!1,...P.width===void 0?{}:{width:P.width+16}}:P));const z=n.selectable?[{key:"selection",title:"",className:"align-top",width:"32",cellProps:P=>{var D;const L=((D=n.isRowSelectable)==null?void 0:D.call(n,P))??!0;return{class:L?"cursor-pointer":void 0,onClick:()=>{L&&s(P.id,!o.value.includes(P.id))}}},render:P=>{var L;return((L=n.isRowSelectable)==null?void 0:L.call(n,P))??!0?i.h(O.NCheckbox,{checked:o.value.includes(P.id)}):null}}]:[];switch(ht.getDeviceTypeByResolution()){case qe.phone:case qe.tablet:return[...z,Q,{key:"order",title:"Заказ",resizable:!0,render:P=>i.h(qh,{order:P,fields:M,orderUrl:n.orderUrl})}];case qe.laptop:{const P=n.showAttachedUserColumn?M:M.filter(L=>L!==Pe.AttachedUser);return[...z,Q,...P.map(L=>G.find(D=>D.key===L)??W)]}default:return[W]}},p=i.ref(f()),y=i.ref(new j.TableDataPagination(n.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),b=i.computed(()=>({...y.value,prefix({itemCount:E}){return`Всего заказов: ${E}`}})),_=i.ref(null),v=i.ref(null),w=i.ref(null),N=()=>{w.value!==null&&(clearInterval(w.value),w.value=null)},$=()=>{N(),n.refreshInterval&&(w.value=setInterval(()=>{R()},n.refreshInterval))},x=()=>{var E,M;n.filters&&((E=v.value)==null||E.abort(),v.value=null,(M=_.value)==null||M.abort(),_.value=new AbortController,d.value=!0,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,l.value,{page:y.value.page,pageSize:y.value.pageSize},_.value.signal).then(W=>{y.value.itemCount!==W.meta.total&&(y.value.itemCount=W.meta.total),y.value.page!==W.meta.currentPage&&(y.value.page=W.meta.currentPage),y.value.pageCount!==W.meta.lastPage&&(y.value.pageCount=W.meta.lastPage),y.value.pageSize!==W.meta.perPage&&(y.value.pageSize=W.meta.perPage),c.value=W.data,d.value=!1}).catch(W=>{if((W==null?void 0:W.name)!=="CanceledError")throw d.value=!1,W}))},R=()=>{var E;!n.filters||d.value||((E=v.value)==null||E.abort(),v.value=new AbortController,j.HttpRequester.getInstance(j.OrdersDataProvider).getOrders(n.filters,l.value,{page:y.value.page,pageSize:y.value.pageSize},v.value.signal).then(M=>{c.value=c.value.map(W=>M.data.find(G=>G.id===W.id)??W),y.value.itemCount!==M.meta.total&&(y.value.itemCount=M.meta.total),y.value.pageCount!==M.meta.lastPage&&(y.value.pageCount=M.meta.lastPage)}).catch(M=>{if((M==null?void 0:M.name)!=="CanceledError")throw M}))},C=E=>{y.value.page=E,x(),r("update:pagination",y.value)},B=E=>{y.value.pageSize=E,y.value.page=1,x(),r("update:pagination",y.value)},T=E=>{if(A.isNull(E))l.value=a();else{const[M]=l.value;M.field=E.columnKey.toString(),M.direction=E.order==="ascend"?"asc":"desc",l.value=[M]}p.value.forEach(M=>{if(Object.hasOwn(M,"sortOrder")){const W=M;W.sortOrder=W.key===(E==null?void 0:E.columnKey)&&(E!=null&&E.sorter)&&E.order!==!1?E.order:!1}}),x(),r("update:sort",l.value)},F=()=>{p.value=f(),u.value=window.innerHeight,m.value=h()};return i.watch(()=>n.filters,()=>{y.value.page=1,x(),$()}),i.watch(()=>n.sort,()=>{l.value=a(),y.value.page=1,x(),$()}),i.onMounted(()=>{F(),window.addEventListener("resize",F),i.nextTick(()=>{x(),$()})}),i.onUnmounted(()=>{var E,M;window.removeEventListener("resize",F),(E=_.value)==null||E.abort(),(M=v.value)==null||M.abort(),N()}),(E,M)=>{const W=O.NDataTable;return i.openBlock(),i.createBlock(W,{columns:p.value,data:c.value,"row-key":Q=>Q.id,"row-props":g,"scroll-x":t.tableMinWidth,pagination:b.value,loading:d.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":m.value,"pagination-behavior-on-filter":"first","onUpdate:page":C,"onUpdate:pageSize":B,"onUpdate:sorter":T},null,8,["columns","data","row-key","scroll-x","pagination","loading","max-height"])}}}),dS=qn(cS,[["__scopeId","data-v-14035b7c"]]),uS=["href"],hS={class:"text-sc-dark-grey"},fS={},mS=i.defineComponent({...fS,__name:"short-text-order-info",props:{order:{},orderLink:{}},emits:["click:order-id"],setup(t,{emit:e}){const n=t,r=e,o=i.computed(()=>en.format(n.order.createdAt,j.useBaseConfigStateStore().config.dateFormats.uiDateWithTime)),s=a=>{A.isNil(n.orderLink)&&(a.preventDefault(),a.stopPropagation()),r("click:order-id",n.order,a)};return(a,l)=>(i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("span",null,[l[1]||(l[1]=i.createTextVNode(" #",-1)),i.createElementVNode("a",{href:t.orderLink??"#",onClick:l[0]||(l[0]=c=>s(c))},i.toDisplayString(t.order.id),9,uS),i.createTextVNode(" от "+i.toDisplayString(o.value),1)]),l[2]||(l[2]=i.createTextVNode(", ",-1)),i.createElementVNode("span",hS,"автор: "+i.toDisplayString(t.order.creator.name)+" ["+i.toDisplayString(t.order.creator.type)+"]",1)],64))}}),gS={class:"sc-page flex flex-col bg-inherit"},pS={class:"my-2 flex flex-row items-end"},yS={class:"sc-title grow"},bS={key:0,class:"sc-title-buttons flex-1 grow-0"},_S={class:"flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row"},wS={key:0,class:"sc-title-extra mt-2 sm:mt-4"},xS={},Qh=i.defineComponent({...xS,__name:"page",props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t){const e=t,n=i.computed(()=>e.stickyHeaderOnMobile?"sticky z-10 bg-inherit":"lg:sticky z-10 bg-inherit");return(r,o)=>{const s=O.NH1;return i.openBlock(),i.createElementBlock("div",gS,[i.createElementVNode("div",{class:i.normalizeClass(t.stickyHeader?n.value:void 0),style:i.normalizeStyle(t.stickyHeader?{top:`${t.stickyTopOffset??0}px`}:void 0)},[i.createElementVNode("div",pS,[i.createElementVNode("div",yS,[i.renderSlot(r.$slots,"title",{},()=>[i.createVNode(s,{class:"m-0 leading-none lg:mb-3 lg:leading-normal"},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.title??""),1)]),_:1})])]),r.$slots["title-buttons"]?(i.openBlock(),i.createElementBlock("div",bS,[i.createElementVNode("div",_S,[i.renderSlot(r.$slots,"title-buttons")])])):i.createCommentVNode("",!0)]),r.$slots["title-extra"]?(i.openBlock(),i.createElementBlock("div",wS,[i.renderSlot(r.$slots,"title-extra")])):i.createCommentVNode("",!0),i.renderSlot(r.$slots,"sticky-extra")],6),i.renderSlot(r.$slots,"default")])}}}),kS={class:"overflow-hidden transition-all duration-300"},vS={class:"text-lg font-medium leading-none"},CS={},Jh=i.defineComponent({...CS,__name:"sliding-content-with-drawer",props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:""}},emits:["update:show-drawer"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(0),s=i.ref(n.showDrawer),a=()=>{switch(ht.getDeviceTypeByResolution()){case qe.phone:return window.innerWidth*.8;case qe.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},l=()=>{s.value?A.isUndefined(n.drawerWidth)?o.value=a():o.value=A.isFunction(n.drawerWidth)?n.drawerWidth():n.drawerWidth:o.value=0};return i.watch(()=>n.drawerWidth,()=>{l()}),i.watch(()=>s.value,()=>{l(),r("update:show-drawer",s.value)}),i.watch(()=>n.showDrawer,c=>{s.value=c}),i.onUnmounted(()=>{window.removeEventListener("resize",l)}),l(),window.addEventListener("resize",l),(c,d)=>{const u=O.NDrawerContent,h=O.NDrawer;return i.openBlock(),i.createElementBlock(i.Fragment,null,[i.createElementVNode("div",kS,[i.createElementVNode("div",{style:i.normalizeStyle(`margin-left: ${o.value}px;`),class:"w-full"},[i.renderSlot(c.$slots,"default")],4)]),i.createVNode(h,{show:s.value,"onUpdate:show":d[0]||(d[0]=m=>s.value=m),resizable:!0,width:o.value,placement:"left"},{default:i.withCtx(()=>[i.createVNode(u,{closable:""},{header:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-header",{},()=>[i.createElementVNode("div",vS,i.toDisplayString(t.title),1)])]),default:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-content")]),footer:i.withCtx(()=>[i.renderSlot(c.$slots,"drawer-footer")]),_:3})]),_:3},8,["show","width"])],64)}}}),SS={ref:"panel-component-ref",class:"sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8"},BS={key:0},TS={class:"sc-page-preview-panel grow"},NS={key:1,class:"sc-page-preview-panel-extra flex-none"},$S={},RS=i.defineComponent({...$S,__name:"page-with-sliding-panel",props:{title:{},isShowPanelButtonVisible:{type:Boolean,default:!0},showPanelButtonText:{default:""},panelTitle:{default:""},stickyHeader:{type:Boolean,default:!1},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(t,{expose:e}){const n=i.ref(!1),r=()=>{n.value=!0},o=()=>{n.value=!1},s=i.useTemplateRef("panel-component-ref");return e({scrollToTopOfPanel:l=>{var c;(c=s.value)==null||c.scrollIntoView({behavior:"smooth"}),l&&i.nextTick(()=>{var d,u;window.scrollTo({top:(((u=(d=s.value)==null?void 0:d.getBoundingClientRect())==null?void 0:u.top)??0)+window.pageYOffset+l,behavior:"smooth"})})},showPanel:r,closePanel:o}),(l,c)=>{const d=O.NButton;return i.openBlock(),i.createBlock(Qh,{title:t.title,"sticky-header":t.stickyHeader,"sticky-top-offset":t.stickyTopOffset,"sticky-header-on-mobile":t.stickyHeaderOnMobile},i.createSlots({default:i.withCtx(()=>[i.createVNode(Jh,{"show-drawer":n.value,"onUpdate:showDrawer":c[1]||(c[1]=u=>n.value=u),title:t.panelTitle},i.createSlots({"drawer-content":i.withCtx(()=>[i.renderSlot(l.$slots,"panel-content")]),default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:2},[l.$slots["panel-header"]?{name:"drawer-header",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-header")]),key:"0"}:void 0,l.$slots["panel-bottom"]?{name:"drawer-footer",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"panel-bottom")]),key:"1"}:void 0]),1032,["show-drawer","title"])]),_:2},[l.$slots.title?{name:"title",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title")]),key:"0"}:void 0,l.$slots["title-buttons"]?{name:"title-buttons",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-buttons")]),key:"1"}:void 0,l.$slots["title-extra"]?{name:"title-extra",fn:i.withCtx(()=>[i.renderSlot(l.$slots,"title-extra")]),key:"2"}:void 0,l.$slots["preview-panel"]||l.$slots["preview-panel-extra"]||t.isShowPanelButtonVisible?{name:"sticky-extra",fn:i.withCtx(()=>[i.createElementVNode("div",SS,[t.isShowPanelButtonVisible?(i.openBlock(),i.createElementBlock("div",BS,[i.renderSlot(l.$slots,"show-panel-button",{onClickHandler:()=>{n.value=!0}},()=>[i.createVNode(d,{class:"flex-none sm:px-10 sm:py-4",onClick:c[0]||(c[0]=u=>n.value=!0)},{default:i.withCtx(()=>[i.createTextVNode(i.toDisplayString(t.showPanelButtonText),1)]),_:1})])])):i.createCommentVNode("",!0),i.createElementVNode("div",TS,[i.renderSlot(l.$slots,"preview-panel")]),l.$slots["preview-panel-extra"]?(i.openBlock(),i.createElementBlock("div",NS,[i.renderSlot(l.$slots,"preview-panel-extra")])):i.createCommentVNode("",!0)],512)]),key:"3"}:void 0]),1032,["title","sticky-header","sticky-top-offset","sticky-header-on-mobile"])}}}),ES={},PS=i.defineComponent({...ES,__name:"curator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},managerReferenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var f;return A.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>{const f=new j.Curator({id:-1,name:"",contacts:{},curatedDirection:new j.CuratedDirection({id:-1,name:"",guid:""}),guid:""}),p=r.showEmptyValue?[f]:[];return r.managerReferenceList.filter(y=>{var b;return(((b=y==null?void 0:y.curatedDirections)==null?void 0:b.length)??0)>0}).forEach(y=>{((y==null?void 0:y.curatedDirections)??[]).forEach(b=>{p.push(new j.Curator({id:y.id,guid:y.guid,name:y.name,photo:y.photo,contacts:y.contacts??{},curatedDirection:b}))})}),p}),c=i.computed(()=>Bt.convertReferencesToSelectOptionsList(l.value,!0,{key:"item.curatedDirection.id",label:"item.curatedDirection.name"},!1,f=>{const p=A.some(s.value?r.value:[r.value],["id",f.id])?` (${f.curatedDirection.name}) `:"";return f.curatedDirection.isNewRec()?f.name:`${f.name}${p}`})),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(A.isArray(f)){const p=f.length>0?f.map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y)):[];o("update:value",p)}else{const p=f>0?l.value.find(y=>y.id===f):null;o("update:value",p??null)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),FS={},VS=i.defineComponent({...FS,__name:"manager-operator-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},operatorReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},maxTagCount:{default:void 0}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var f;return A.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>[...r.operatorReferenceList,...r.managerReferenceList]),c=i.computed(()=>{var b;const f=[];r.operatorReferenceList.length>0&&f.push({type:"group",label:"Операторы",key:"operators",children:r.operatorReferenceList.map(_=>({label:_.name,value:_.id,item:_}))});let p=r.managerReferenceList;if(r.showActualOnly){const _=A.isArray(r.value)?r.value.map(v=>v.id):[(b=r.value)==null?void 0:b.id];p=p.filter(v=>v.isActive||_.includes(v.id))}const y=Bt.convertReferencesToSelectOptionsList(p,!0,{key:"item.salesDirection.id",label:"item.salesDirection.name"},!1,_=>`${_.name}${_.isActive?"":" [Не активен]"}`);return f.length>0&&y.length>0&&f.push({key:"manager-operator-divider",disabled:!0,render:()=>i.h("div",{class:"sc-manager-operator-select__divider"})}),f.push(...y),f}),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class??""} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(A.isArray(f)){const p=f.map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y));o("update:value",p)}else{const p=A.isNil(f)?null:l.value.find(y=>y.id===f)??null;o("update:value",p)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:a.value,"clear-filter-after-select":!0,clearable:t.clearable,"consistent-menu-width":t.consistentMenuWidth,disabled:t.disabled||c.value.length===0,filterable:t.filterable,"max-tag-count":t.maxTagCount,multiple:s.value,options:d.value,placeholder:"",class:"w-full","onUpdate:value":h},null,8,["value","clearable","consistent-menu-width","disabled","filterable","max-tag-count","multiple","options"]))}}),IS={},MS=i.defineComponent({...IS,__name:"manager-select",props:{value:{default:null},clearable:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!0},managerReferenceList:{default:()=>[]},disabledManagerReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},showEmptyValue:{type:Boolean,default:!1},groupBySalesDirection:{type:Boolean,default:!1}},emits:["update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.computed(()=>A.isArray(r.value)),a=i.computed(()=>{var f;return A.isArray(r.value)?r.value.map(p=>p.id):((f=r.value)==null?void 0:f.id)??null}),l=i.computed(()=>r.showEmptyValue?[j.ManagerDataFactory.generateUndefinedManagerInstance(),...r.managerReferenceList]:r.managerReferenceList),c=i.computed(()=>{var y;let f=l.value,p=r.disabledManagerReferenceList.map(b=>b.id);if(r.showActualOnly){const b=A.isArray(r.value)?r.value.map(_=>_.id):[(y=r.value)==null?void 0:y.id];p=A.union(p,l.value.filter(_=>!_.isActive).map(_=>_.id)),f=f.filter(_=>(r.showEmptyValue?j.ManagerDataFactory.isUndefinedManagerInstance(_):!1)||_.isActive||b.includes(_.id))}return Bt.convertReferencesToSelectOptionsList(f,!0,r.groupBySalesDirection?{key:"item.salesDirection.id",label:"item.salesDirection.name"}:!1,!1,b=>{const _=!r.groupBySalesDirection||r.groupBySalesDirection&&A.some(s.value?r.value:[r.value],["id",b.id])?` (${b.salesDirection.name}) `:"";return b.salesDirection.isNewRec()?b.name:`${b.name}${_}${b.isActive?"":" [Не активен]"}`},b=>p.includes(b.id)&&b.isActive)}),d=i.computed(()=>c.value.map(f=>({...f,class:r.wrapContent?`${f.class} consistent-menu-width`:f.class}))),u=i.useTemplateRef("select-component"),h=f=>{if(A.isArray(f)){const p=f.length>0?f.filter(y=>!A.some(r.disabledManagerReferenceList,["id",y])).map(y=>l.value.find(b=>b.id===y)).filter(y=>!A.isNil(y)):[];o("update:value",p)}else{const p=f>0&&!A.some(r.disabledManagerReferenceList,["id",f])?l.value.find(y=>y.id===f):new j.Manager;o("update:value",p??new j.Manager)}};return i.watch(()=>r.value,()=>{var f,p;(p=(f=u.value)==null?void 0:f.$forceUpdate)==null||p.call(f)},{deep:!0}),i.watch(()=>r.disabledManagerReferenceList,f=>{if(f.length>0&&r.value)if(s.value){const p=r.value;A.some(p,y=>A.some(f,["id",y.id]))&&o("update:value",p.filter(y=>!A.some(f,["id",y.id])))}else{const p=r.value;A.some(f,["id",p.id])&&o("update:value",new j.Manager)}}),e({focus:()=>{var f;return(f=u.value)==null?void 0:f.focusInput()},blur:()=>{var f;return(f=u.value)==null?void 0:f.blurInput()}}),(f,p)=>(i.openBlock(),i.createBlock(i.unref(O.NSelect),{ref:"select-component",value:a.value,clearable:t.clearable,disabled:c.value.length===0,"consistent-menu-width":t.consistentMenuWidth,multiple:s.value,options:d.value,placeholder:"","onUpdate:value":h},null,8,["value","clearable","disabled","consistent-menu-width","multiple","options"]))}}),AS={class:"m-0.5 flex flex-col p-0.5"},OS={class:"flex flex-row gap-1"},zS={key:0},DS={key:1},LS={key:2},HS={key:3},WS={class:"flex flex-row gap-1"},jS={key:0},qS={key:1},XS={key:2},YS={key:3},US={},ef=i.defineComponent({...US,__name:"address-suggestion-label",props:{addr:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",AS,[i.createElementVNode("span",OS,[t.addr.postIndex?(i.openBlock(),i.createElementBlock("span",zS,i.toDisplayString(t.addr.postIndex)+", ",1)):i.createCommentVNode("",!0),t.addr.city?(i.openBlock(),i.createElementBlock("span",DS,i.toDisplayString(t.addr.city)+", ",1)):i.createCommentVNode("",!0),t.addr.locality?(i.openBlock(),i.createElementBlock("span",LS,i.toDisplayString(t.addr.locality)+", ",1)):i.createCommentVNode("",!0),t.addr.region?(i.openBlock(),i.createElementBlock("span",HS,i.toDisplayString(t.addr.region)+", ",1)):i.createCommentVNode("",!0)]),i.createElementVNode("span",WS,[t.addr.street?(i.openBlock(),i.createElementBlock("span",jS,i.toDisplayString(t.addr.street)+", ",1)):i.createCommentVNode("",!0),t.addr.building?(i.openBlock(),i.createElementBlock("span",qS,i.toDisplayString(t.addr.building)+", ",1)):i.createCommentVNode("",!0),t.addr.buildingPart?(i.openBlock(),i.createElementBlock("span",XS,i.toDisplayString(t.addr.buildingPart)+", ",1)):i.createCommentVNode("",!0),t.addr.apartments?(i.openBlock(),i.createElementBlock("span",YS,i.toDisplayString(t.addr.apartments)+", ",1)):i.createCommentVNode("",!0)])]))}}),Ea={clearable:!1,value:"",field:void 0,disabled:!1},KS={},GS=i.defineComponent({...KS,__name:"address-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},searchDataHandler:{type:Function}},{...Ea,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3},searchDataHandler:void 0}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"addressString"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{!s.value||s.value.length<r.minTermLength||(a.value=!0,l.value=await(r.searchDataHandler?r.searchDataHandler(s.value,a):j.HttpRequester.getInstance(j.DataSuggestionProvider).searchAddresses(s.value)).finally(()=>{a.value=!1}))},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(ef,{addr:b,selected:y},{default:A.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};o("select",y)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,y)=>{const b=O.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[y[0]||(y[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),ZS={class:"m-0.5 flex flex-col p-0.5"},QS={class:"font-medium"},JS={class:"flex flex-row gap-1 text-xs font-light text-blue-800"},eB={key:0},tB={key:1},nB={},tf=i.defineComponent({...nB,__name:"bank-suggestion-label",props:{bank:{},selected:{type:Boolean}},setup(t){return(e,n)=>(i.openBlock(),i.createElementBlock("div",ZS,[i.createElementVNode("span",QS,i.toDisplayString(t.bank.name),1),i.createElementVNode("span",JS,[t.bank.bic?(i.openBlock(),i.createElementBlock("span",eB," БИК: "+i.toDisplayString(t.bank.bic),1)):i.createCommentVNode("",!0),t.bank.inn?(i.openBlock(),i.createElementBlock("span",tB," ИНН: "+i.toDisplayString(t.bank.inn),1)):i.createCommentVNode("",!0)])]))}}),iB={},rB=i.defineComponent({...iB,__name:"bank-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{}},{...Ea,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=i.computed(()=>l.value.map(p=>({label:p[r.field??"_"]??"-",value:p.id})));i.watch(()=>r.value,p=>{s.value=p}),i.watch(s,()=>{o("update:value",s.value)});const d=A.debounce(()=>u(),800),u=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await j.HttpRequester.getInstance(j.DataSuggestionProvider).searchBank(s.value)}finally{a.value=!1}}},h=(p,y)=>{const b=l.value.find(_=>_.id===p.value)||{};return i.h(tf,{bank:b,selected:y},{default:A.constant("-")})},m=p=>{d.cancel();const y=l.value.find(b=>b.id===p)||{};o("select",y)},g=i.ref(null);function f(){g.value.focus()}return e({focus:f}),(p,y)=>{const b=O.NAutoComplete;return i.openBlock(),i.createBlock(b,{ref_key:"autoCompleteElement",ref:g,value:s.value,"onUpdate:value":[y[0]||(y[0]=_=>s.value=_),i.unref(d)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:c.value,"render-label":h,placeholder:"",onSelect:m},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),oB={class:"font-medium"},sB={key:0,class:"flex flex-row gap-2"},aB={key:0,class:"text-xs font-light text-blue-800"},lB={key:1,class:"text-sc-dark-grey text-xs font-light"},cB={},nf=i.defineComponent({...cB,__name:"org-suggestion-label",props:{org:{},selected:{type:Boolean}},setup(t){const e=t,n=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.state)==null?void 0:s.liquidationDate)??!1}),r=i.computed(()=>{var o,s;return((s=(o=e.org.rawData)==null?void 0:o.address)==null?void 0:s.value)??""});return(o,s)=>(i.openBlock(),i.createElementBlock("div",{class:i.normalizeClass(`m-0.5 flex flex-col p-0.5 ${n.value?"line-through":""}`)},[i.createElementVNode("span",oB,i.toDisplayString(t.org.name),1),t.org.inn||r.value?(i.openBlock(),i.createElementBlock("div",sB,[t.org.inn?(i.openBlock(),i.createElementBlock("span",aB,i.toDisplayString(t.org.inn),1)):i.createCommentVNode("",!0),r.value?(i.openBlock(),i.createElementBlock("span",lB,i.toDisplayString(r.value),1)):i.createCommentVNode("",!0)])):i.createCommentVNode("",!0)],2))}}),dB={},uB=i.defineComponent({...dB,__name:"org-suggestion",props:i.mergeDefaults({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},allowSelectTerminated:{type:Boolean}},{...Ea,minTermLength:()=>{var t,e;return((e=(t=j.useBaseConfigStateStore().getConfig())==null?void 0:t.minLength)==null?void 0:e.searchTerm)??3}}),emits:["select","update:value"],setup(t,{expose:e,emit:n}){const r=t,o=n,s=i.ref(r.value),a=i.ref(!1),l=i.ref([]),c=y=>{var b,_;return!!(((_=(b=y.rawData)==null?void 0:b.state)==null?void 0:_.liquidationDate)??!1)},d=i.computed(()=>Bt.convertReferencesToSelectOptionsList(l.value,!1,!1,!1,y=>y[r.field??"_"]??"-",y=>!r.allowSelectTerminated&&c(y)));i.watch(()=>r.value,y=>{s.value=y}),i.watch(s,()=>{o("update:value",s.value)});const u=A.debounce(()=>h(),800),h=async()=>{if(!(!s.value||s.value.length<r.minTermLength)){a.value=!0;try{l.value=await j.HttpRequester.getInstance(j.DataSuggestionProvider).searchOrganization(s.value)}finally{a.value=!1}}},m=(y,b)=>{const _=l.value.find(v=>v.id===y.value)||{};return i.h(nf,{org:_,selected:b},{default:A.constant("-")})},g=y=>{u.cancel();const b=l.value.find(_=>_.id===y)||{};(r.allowSelectTerminated||!c(b))&&o("select",b)},f=i.ref(null);function p(){f.value.focus()}return e({focus:p}),(y,b)=>{const _=O.NAutoComplete;return i.openBlock(),i.createBlock(_,{ref_key:"autoCompleteElement",ref:f,value:s.value,"onUpdate:value":[b[0]||(b[0]=v=>s.value=v),i.unref(u)],clearable:t.clearable,disabled:t.disabled,loading:a.value,options:d.value,"render-label":m,placeholder:"",onSelect:g},null,8,["value","clearable","disabled","loading","options","onUpdate:value"])}}}),hB={},fB=i.defineComponent({...hB,__name:"button-with-confirm-action",props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:""},dialogContent:{default:""},disableConfirm:{type:Boolean,default:!1},popoverText:{default:""},type:{default:"default"},size:{default:"small"},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:["accept"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(!1),s=()=>{r("accept",()=>{o.value=!1})},a=()=>{n.disableConfirm?s():o.value=!0};return(l,c)=>{const d=O.NButton,u=O.NPopover,h=O.NModal;return i.openBlock(),i.createElementBlock("div",null,[i.createVNode(u,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(d,{disabled:t.disabled,ghost:t.ghost,loading:t.loading,size:t.size,type:t.type,quaternary:t.quaternary,circle:t.circle,onClick:a},{default:i.withCtx(()=>[i.renderSlot(l.$slots,"default")]),_:3},8,["disabled","ghost","loading","size","type","quaternary","circle"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:3},8,["disabled"]),i.createVNode(h,{show:o.value,"onUpdate:show":c[1]||(c[1]=m=>o.value=m),content:t.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:t.dialogTitle,"action-class":"",preset:"dialog"},{action:i.withCtx(()=>[i.createVNode(d,{type:"primary",class:"px-8",onClick:s},{default:i.withCtx(()=>[...c[2]||(c[2]=[i.createTextVNode(" Да ",-1)])]),_:1}),i.createVNode(d,{type:"default",onClick:c[0]||(c[0]=m=>o.value=!1)},{default:i.withCtx(()=>[...c[3]||(c[3]=[i.createTextVNode(" Отмена ",-1)])]),_:1})]),_:1},8,["show","content","title"])])}}}),mB={key:0,class:"whitespace-pre-line"},gB={key:1,class:"text-sc-dark-grey"},pB={},yB=i.defineComponent({...pB,__name:"comment-editor",props:{disabled:{type:Boolean,default:!1},comment:{default:""}},emits:["update:comment"],setup(t,{emit:e}){const n=t,r=e,o=i.ref(n.comment);i.watch(()=>o.value,l=>{o.value=l});const s=l=>{r("update:comment",o.value,l)},a=()=>{o.value=n.comment};return(l,c)=>{const d=O.NInput;return i.openBlock(),i.createBlock(eu,{disabled:t.disabled,"onEditor:apply":s,"onEditor:cancel":a},{viewer:i.withCtx(()=>[i.createElementVNode("div",null,[t.comment?(i.openBlock(),i.createElementBlock("span",mB,i.toDisplayString(t.comment),1)):(i.openBlock(),i.createElementBlock("span",gB," - Комментарий отсутствует - "))])]),editor:i.withCtx(()=>[i.createVNode(d,{value:o.value,"onUpdate:value":c[0]||(c[0]=u=>o.value=u),clearable:!0,type:"textarea"},null,8,["value"])]),_:1},8,["disabled"])}}}),bB={},_B=i.defineComponent({...bB,__name:"debt",props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(t){const e=t,n=i.computed(()=>{let r="";return(e.showLabel??!1)&&(e.debt>0?r="Переплата: ":e.debt<0&&(r="Задолженность: ")),r});return(r,o)=>t.debt!==0?(i.openBlock(),i.createElementBlock("span",{key:0,class:i.normalizeClass({"text-sm":t.wrapAsSmall})},[i.createTextVNode(i.toDisplayString(n.value)+" ",1),i.createElementVNode("span",{class:i.normalizeClass({"text-green-700":t.debt>0,"text-red-700":t.debt<0})},i.toDisplayString(t.debt)+" ₽ ",3)],2)):i.createCommentVNode("",!0)}}),wB={viewBox:"0 0 512 512",width:"1.2em",height:"1.2em"};function xB(t,e){return i.openBlock(),i.createElementBlock("svg",wB,[...e[0]||(e[0]=[i.createElementVNode("path",{fill:"currentColor",d:"M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"},null,-1)])])}const kB=i.markRaw({name:"ion-warning",render:xB}),vB={},CB=i.defineComponent({...vB,__name:"warning-icon",props:{popoverText:{default:""},iconClass:{default:"text-sc-warning"}},setup(t){return(e,n)=>{const r=kB,o=O.NPopover;return i.openBlock(),i.createBlock(o,{disabled:t.popoverText.length===0,placement:"bottom"},{trigger:i.withCtx(()=>[i.createVNode(r,{class:i.normalizeClass(`ml-0.5 ${t.iconClass}`)},null,8,["class"])]),default:i.withCtx(()=>[i.createTextVNode(" "+i.toDisplayString(t.popoverText),1)]),_:1},8,["disabled"])}}}),SB=i.computed(()=>j.useReferencesStore().deliveryTypeReference??[]),BB=i.computed(()=>j.useReferencesStore().managersList??[]),TB=i.computed(()=>j.useReferencesStore().opfReference??[]),NB=i.computed(()=>j.useReferencesStore().partnerGroupsReference??[]),$B=i.computed(()=>j.useReferencesStore().priceCoefficientsReference??[]),RB=i.computed(()=>j.useReferencesStore().productFilesTypesReference??[]),EB=i.computed(()=>j.useReferencesStore().resourceTypesReference),PB=i.computed(()=>j.useReferencesStore().salesDirectionsReference??[]),FB=i.computed(()=>j.useReferencesStore().warehousesReference??[]),VB=i.computed(()=>j.useReferencesStore().paymentTypeReference??[]),IB=i.computed(()=>j.useReferencesStore().orderStatusReference??[]),MB=i.computed(()=>j.useReferencesStore().orderStatusDetailReference??[]),AB=i.computed(()=>j.useReferencesStore().operatorReference??[]),OB=i.computed(()=>Bt.convertReferencesToSelectOptionsList(j.useReferencesStore().channelPrimaryInterestsReference??[],!0,!1,!0)),zB=i.computed(()=>Bt.convertReferencesToSelectOptionsList(j.useReferencesStore().sourcePrimaryInterestsReference??[],!0,!1,!0)),DB=t=>j.HttpRequester.getInstance(j.ReferenceDataProvider).searchCity(t),LB=t=>Bt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>{var n,r,o;return e!=null&&e.isNewRec()?"-":`${e.name}, ${(n=e==null?void 0:e.region)==null?void 0:n.name}, ${(o=(r=e==null?void 0:e.region)==null?void 0:r.country)==null?void 0:o.name}`},e=>e==null?void 0:e.isNewRec()),HB=t=>j.HttpRequester.getInstance(j.ClientDataProvider).searchClient(t),WB=t=>Bt.convertReferencesToSelectOptionsList(t,!0,!1,!1,e=>e.isNewRec()?"-":[e.name,e.salesDirection.name?`(${e.salesDirection.name})`:void 0,e.city.name?`г. ${e.city.name}${e.city.region.name?`, ${e.city.region.name}`:""}`:void 0,e.isActive?void 0:"[ Деактивирован ]"].filter(Boolean).join(" "),e=>e==null?void 0:e.isNewRec());X.CommonValidators=mf,X.ConfiguratorSettingsKozyrek=Bd,X.ConfiguratorSettingsMosquito=e1,X.ContentHelper=ci,X.DateValidators=gf,X.EntityNameHelper=jn,X.KozyrekLine=_n,X.KozyrekTailTemplate=qs,X.KozyrekTemplate=Gi,X.NumericValidators=ae,X.OrdersTableFields=Pe,X.Point=js,X.ScAddProductToCartDialog=Yb,X.ScAddressSuggestion=GS,X.ScAddressSuggestionLabel=ef,X.ScBankSuggestion=rB,X.ScBankSuggestionLabel=tf,X.ScBaseDialog=Ud,X.ScButtonWithConfirmAction=fB,X.ScCategoryCollapse=Xd,X.ScClientNameWithShortInfo=wr,X.ScCollapse=qd,X.ScCollapseItem=rl,X.ScCommentEditor=yB,X.ScConfiguratorsProductInfo=fr,X.ScContragentWithShortInfo=Kd,X.ScCreatorUserTypeTag=Mr,X.ScCuratorSelect=PS,X.ScDateRange=s1,X.ScDateTimeLabel=xo,X.ScDebouncedInput=F1,X.ScDebouncedInputNumber=I1,X.ScDebt=_B,X.ScDialogHeader=m1,X.ScDynamicConfigurator=Hd,X.ScEmail=c_,X.ScExternalLink=q1,X.ScImageGallery=cl,X.ScInlineEditableItem=eu,X.ScInlineView=Ys,X.ScKozyrekConfigurator=Td,X.ScKozyrekConfiguratorParamsForm=ul,X.ScKozyrekConfiguratorPreview=Sd,X.ScKozyrekConfiguratorTemplates=Cd,X.ScLightGallery=ll,X.ScManagerOperatorSelect=VS,X.ScManagerSelect=MS,X.ScMetalForDoorsConfigurator=Md,X.ScMetalForDoorsConfiguratorForm=Id,X.ScMosquitoConfigurator=Rd,X.ScMosquitoConfiguratorForm=Nd,X.ScMosquitoConfiguratorMeasurementInstructions=$d,X.ScMosquitoConfiguratorPreview=Xs,X.ScOrderCommonInfo=qh,X.ScOrderDeliveryLabel=Ho,X.ScOrderDetails=Kh,X.ScOrderExternalLinks=Gh,X.ScOrderInfo=Zh,X.ScOrderItemParams=jh,X.ScOrderItemsList=Yh,X.ScOrderPayment=$a,X.ScOrderProductInfo=Xh,X.ScOrderStatusHistory=Uh,X.ScOrdersList=dS,X.ScOrgSuggestion=uB,X.ScOrgSuggestionLabel=nf,X.ScPage=Qh,X.ScPageWithSlidingPanel=RS,X.ScPersonContactsBlock=J_,X.ScPhone=F_,X.ScPhoneInput=O1,X.ScProductName=hr,X.ScProductsList=_2,X.ScReferenceSelect=Yd,X.ScSandwichConfigurator=zd,X.ScSandwichConfiguratorForm=Od,X.ScSandwichM2Configurator=Ld,X.ScSandwichM2ConfiguratorForm=Dd,X.ScSearchableProductSelect=Wh,X.ScSearchableReferenceSelect=Hh,X.ScSetClientPriceFormItem=Db,X.ScShortTextOrderInfo=mS,X.ScSingleFileUploadSelector=_1,X.ScSlidingContentWithDrawer=Jh,X.ScStripConfigurator=Vd,X.ScStripConfiguratorForm=Pd,X.ScStripConfiguratorLineItem=Ed,X.ScStripConfiguratorPreview=Fd,X.ScUserShortInfo=Ra,X.ScWarningIcon=CB,X.SelectOptionHelper=Bt,X.UiNotificationProvider=lr,X.Validators=He,X.WindowResolutionEnum=qe,X.WindowResolutionProvider=ht,X.channelPrimaryInterestOptionsList=OB,X.componentSizeInjectionKey=dr,X.copyToClipboard=Za,X.deliveryTypeReferenceList=SB,X.handleFloatInput=Wr,X.handleIntegerInput=tt,X.isCanSandwichM2Show=t1,X.isCanSandwichShow=jd,X.isConfiguratorType=Wd,X.managersReferenceList=BB,X.naiveUiTheme=tm,X.operatorReferenceList=AB,X.opfReferenceList=TB,X.orderStatusDetailReferenceList=MB,X.orderStatusReferenceList=IB,X.parse=it,X.partnerGroupReferenceList=NB,X.paymentTypeReferenceList=VB,X.priceCoefficientsReferenceList=$B,X.productFilesTypesReferenceList=RB,X.renderConfig=je,X.resetInputValidation=et,X.resourceReferencesList=EB,X.salesDirectionsReferenceList=PB,X.searchCityReferenceDataHandler=DB,X.searchCityReferenceLabelRenderer=LB,X.searchClientReferenceDataHandler=HB,X.searchClientReferenceLabelRenderer=WB,X.selectAllTextOnFocus=Le,X.sourcePrimaryInterestOptionsList=zB,X.vCopy=Qa,X.vFocusNext=Wn,X.warehousesReferenceList=FB,Object.defineProperty(X,Symbol.toStringTag,{value:"Module"})}));