@snabcentr/vue-ui-lib 6.1.0-dev → 6.2.0-dev

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,7 +1,7 @@
1
- (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("vue"),require("date-fns"),require("pinia"),require("naive-ui"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define==`function`&&define.amd?define([`exports`,`@snabcentr/common-lib`,`lodash-es`,`vue`,`date-fns`,`pinia`,`naive-ui`,`libphonenumber-js`,`ts-case-convert`,`vue-tel-input`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.SC_VueUiLib={},e[`@snabcentr/common-lib`],e[`lodash-es`],e.Vue,e[`date-fns`],e.pinia,e[`naive-ui`],e[`libphonenumber-js`],e[`ts-case-convert`],e[`vue-tel-input`]))})(this,function(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var u=`Чтобы изменить, включите режим управления`,d=`Товар, который нужно предлагать клиенту`,f=`Категория, которую нужно предлагать клиенту`,p=class e{static messagesService;static notificationsService;static init(t,n){e.messagesService&&e.notificationsService||(e.messagesService=t,e.notificationsService=n)}static getMessagesService(){if(!e.messagesService)throw Error(`UI provider is not initialized.`);return e.messagesService}static getNotificationsService(){if(!e.notificationsService)throw Error(`UI provider is not initialized.`);return e.notificationsService}static showNotificationsForErrorResponseData(r,i={}){if((0,n.isEmpty)(r.errors)){let t=r.rawError?.config?.url,n=t?` [ ${t} ]`:``;e.notificationsService?e.notificationsService.error({title:`Ошибка выполнения/обработки запроса`,content:r.message,meta:`#${r.status}${n}: ${r.statusText}`,duration:3e3}):console.log(`Show notification error response data: UI provider is not initialized.`,r)}else{let n=[];for(let e in r.errors)Object.prototype.hasOwnProperty.call(i,e)?i[e]=new t.FieldValidationResultData(r.errors[e].toString(),`error`):n.push(r.errors[e].toString());e.showErrorMessages(n)}}static showErrorMessages(t){let{messagesService:n,notificationsService:i}=e;t.length===1&&n?n.error(t[0]):t.length>1&&i?i.error({title:`Ошибки выполнения запроса`,meta:`Всего ошибок: ${t.length}`,content:()=>(0,r.h)(`ul`,{style:{maxHeight:`240px`,overflowY:`auto`,margin:0,paddingLeft:`1.25em`,listStyleType:`disc`}},t.map(e=>(0,r.h)(`li`,e)))}):t.length>0&&console.log(`Show notification error response data: UI provider is not initialized.`,t)}},m=new WeakMap,h=async e=>{let t=navigator.clipboard;if(t?.writeText){await t.writeText(e);return}let n=document.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,document.body.append(n),n.select();let r=document.execCommand(`copy`);if(n.remove(),!r)throw Error(`Не удалось скопировать через execCommand.`)},g=async e=>{let t=(0,n.isNil)(e)?``:String(e);if(t)try{await h(t),p.getNotificationsService().success({title:`Готово`,description:`Скопировано в буфер обмена: ${t}`,duration:2e3})}catch{p.getNotificationsService().error({title:`Ошибка`,description:`Не удалось скопировать в буфер обмена.`,duration:3e3})}},_=e=>e.tagName===`BUTTON`||e.getAttribute(`role`)===`button`||!!e.closest(`button`),v=(e,t)=>t.modifiers.click?`click`:t.modifiers.dblclick?`dblclick`:_(e)?`click`:`dblclick`,y={mounted(e,t){e.style.setProperty(`cursor`,`pointer`);let r=v(e,t),i=t=>{r===`dblclick`&&(t.preventDefault(),globalThis.getSelection()?.removeAllRanges()),g(m.get(e)?.value).catch(n.noop)};m.set(e,{value:t.value,eventName:r,handler:i}),e.addEventListener(r,i)},updated(e,t){let n=m.get(e);n&&(n.value=t.value)},beforeUnmount(e){let t=m.get(e);t&&(e.removeEventListener(t.eventName,t.handler),m.delete(e))}},b=new Set([`checkbox`,`radio`,`range`,`button`,`submit`,`reset`,`file`,`color`,`image`,`hidden`]),x=`.n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker`,S=new WeakMap,C=e=>!b.has(e.type)&&!e.disabled&&!e.readOnly&&e.closest(x)===null&&e.getClientRects().length>0,w=e=>{if(e.key!==`Enter`&&e.code!==`Enter`||e.shiftKey||e.isComposing)return;let{target:t}=e;if(!(t instanceof HTMLInputElement)||!C(t))return;e.preventDefault();let n=e.currentTarget,r=[...n.querySelectorAll(`input`)].filter(e=>C(e)),i=r.indexOf(t);if(i===-1)return;let a=r.at(i+1);a?(a.focus(),a.select()):S.get(n)?.()},T={mounted(e,t){S.set(e,t.value),e.addEventListener(`keydown`,w)},updated(e,t){S.set(e,t.value)},unmounted(e){e.removeEventListener(`keydown`,w),S.delete(e)}},E=function(e){return e.NotInStock=`not_in_stock`,e.OnOrder=`on_order`,e.LargeOrder=`large_order`,e.NextDayDelivery=`next_day_delivery`,e}({}),D={color:`#4b5563`,backgroundColor:`#e5e7eb`,textOnBackgroundColor:`#1f2937`},O=new Map([[t.OrderStatusEnum.New,{color:`#15803d`,backgroundColor:`#bbf7d0`,textOnBackgroundColor:`#166534`}],[t.OrderStatusEnum.Processing,{color:`#ea580c`,backgroundColor:`#fed7aa`,textOnBackgroundColor:`#9a3412`}],[t.OrderStatusEnum.AwaitingSupplyProducts,{color:`#ca8a04`,backgroundColor:`#fef08a`,textOnBackgroundColor:`#854d0e`}],[t.OrderStatusEnum.InvoiceIssued,{color:`#1d4ed8`,backgroundColor:`#bfdbfe`,textOnBackgroundColor:`#1e40af`}],[t.OrderStatusEnum.ProcessingOnStock,{color:`#0e7490`,backgroundColor:`#a5f3fc`,textOnBackgroundColor:`#155e75`}],[t.OrderStatusEnum.OrderUpdated,{color:`#6d28d9`,backgroundColor:`#ddd6fe`,textOnBackgroundColor:`#5b21b6`}],[t.OrderStatusEnum.Finished,{color:`#475569`,backgroundColor:`#e2e8f0`,textOnBackgroundColor:`#1e293b`}],[t.OrderStatusEnum.Canceled,{color:`#b91c1c`,backgroundColor:`#fecaca`,textOnBackgroundColor:`#991b1b`}],[t.OrderStatusEnum.Error,{color:`#991b1b`,backgroundColor:`#fca5a5`,textOnBackgroundColor:`#7f1d1d`}]]),k=e=>O.get(e)??D,A=e=>{let t=k(e);return{color:t.backgroundColor,textColor:t.textOnBackgroundColor,borderColor:t.color}},ee=e=>{let t=k(e);return{"--sc-order-status-color":t.color,"--sc-order-status-bg":t.backgroundColor,"--sc-order-status-text":t.textOnBackgroundColor}},j=new Map([[E.NotInStock,{color:`#ef4444`,backgroundColor:`#f7ff00`,textOnBackgroundColor:`#ff0000`}],[E.OnOrder,{color:`#ca8a04`,backgroundColor:`#f7ff00`,textOnBackgroundColor:`#ff0000`}],[E.LargeOrder,{color:`#ef2929`,backgroundColor:`#ef2929`,textOnBackgroundColor:`#ffffff`}],[E.NextDayDelivery,{color:`#ef2929`,backgroundColor:`#ef2929`,textOnBackgroundColor:`#ffffff`}]]),te=new Map([[E.NotInStock,`Нет в наличии`],[E.OnOrder,`Под заказ`],[E.LargeOrder,`Крупный заказ`],[E.NextDayDelivery,`Доставка на завтра`]]),ne=[...j.keys()],M=e=>j.get(e)??D,re=e=>te.get(e)??e,ie=e=>{let t=[];return e.isNotInStock&&t.push(E.NotInStock),e.isOnOrder&&t.push(E.OnOrder),e.isLargeOrder&&t.push(E.LargeOrder),!(0,n.isNil)(e.delivery.date)&&(0,i.isTomorrow)(new Date(e.delivery.date))&&t.push(E.NextDayDelivery),t},N=function(e){return e.AttachedUser=`attached_user`,e.ClientInfo=`client_info`,e.ClientInfoShort=`client_info_short`,e.CreatedAt=`created_at`,e.ClientCity=`client_city`,e.DeliveryInfo=`delivery_info`,e.DeliveryDate=`delivery_date`,e.Id=`id`,e.PaymentType=`payment_type`,e.SalesDirections=`sales_directions`,e.Status=`status`,e.actions=`actions`,e}({}),P=function(e){return e.phone=`phone`,e.tablet=`tablet`,e.laptop=`laptop`,e}({}),F=class e{static isInitialized=!1;static refsDependingOnDeviceResolution=[];static init(){e.isInitialized||(e.isInitialized=!0,e.windowResizeHandler(),window.addEventListener(`resize`,e.windowResizeHandler))}static destroy(){window.removeEventListener(`resize`,e.windowResizeHandler),e.isInitialized=!1}static getDeviceTypeByResolution(){let e=(0,t.useBaseConfigStore)().config.deviceTypeByResolution;return window.innerWidth<e.tablet?P.phone:window.innerWidth<e.laptop?P.tablet:P.laptop}static initRefDependingOnDeviceResolution(t,n,i){let a=(0,r.ref)(i);return e.setRefValueDependingOnDeviceResolution(a,t,n,i),e.refsDependingOnDeviceResolution.push({r:a,phoneValue:t,tabletValue:n,defaultValue:i}),a}static isPhoneDevice(){return e.getDeviceTypeByResolution()===P.phone}static isTabletDevice(){return e.getDeviceTypeByResolution()===P.tablet}static isLaptopDevice(){return e.getDeviceTypeByResolution()===P.laptop}static setRefValueDependingOnDeviceResolution(t,n,r,i){switch(e.getDeviceTypeByResolution()){case P.phone:t.value=n;break;case P.tablet:t.value=r;break;default:t.value=i}}static windowResizeHandler(){(0,n.forEach)(e.refsDependingOnDeviceResolution,t=>{e.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};function ae(){try{return F.getDeviceTypeByResolution()}catch(e){return console.error(e),P.laptop}}function oe(){let e=(0,r.ref)(ae()),t=(0,r.computed)(()=>e.value===P.phone||e.value===P.tablet),n=()=>{e.value=ae()};return(0,r.onMounted)(()=>{window.addEventListener(`resize`,n)}),(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,n)}),{isCompactLayout:t}}var se=`(hover: hover) and (pointer: fine)`,ce=()=>{let e=(0,n.isFunction)(globalThis.matchMedia)?globalThis.matchMedia(se):void 0,t=(0,r.ref)(!e||e.matches),i=e=>{t.value=e.matches};return e?.addEventListener(`change`,i),(0,r.onScopeDispose)(()=>{e?.removeEventListener(`change`,i)},!0),(0,r.readonly)(t)},le=class{static getLabel(e){return e===t.AddressQualityEnum.Incomplete||e===t.AddressQualityEnum.Undetermined?`Проверьте адрес`:void 0}},ue=`.sc-versions-list`;function de(e,t,r){let a=document.querySelectorAll(ue);if(a.length===0)return;let o=a[0],s=`${e}:`;if((0,n.some)(o.querySelectorAll(`li`),e=>(0,n.startsWith)((0,n.trim)(e.textContent||``),s)))return;let c=document.createElement(`li`);c.append(document.createTextNode(`${s} ${t} от ${(0,i.format)(r,`dd.MM.yyyy`)}`)),o.append(c)}var fe=class e{static isVnodeEmpty(t){return t.every(t=>t.type===r.Comment||t.type===r.Text&&(0,n.isString)(t.children)&&!t.children.trim()?!0:t.type===r.Fragment&&e.isVnodeEmpty(t.children))}static hasSlotContent(t){return t?!e.isVnodeEmpty(t()):!1}},pe=class e{static getDefaultCurrency(){if(!(0,a.getActivePinia)())return;let e=(0,t.useBaseConfigStore)().getConfig().defaultCurrency;return(0,t.useReferencesStore)().currencyReference?.find(t=>t.signature===e)}static getPrecision(t){return t?.precision??e.getDefaultCurrency()?.precision}},me={readAsFileData(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`load`,()=>{t({name:e.name,content:r.result})}),r.addEventListener(`error`,()=>{n(Error(`Не удалось прочитать файл «${e.name}».`))}),r.readAsDataURL(e)})}},he=class e{static isDeleted(e){return!(!e.deletedAt||(0,i.isFuture)(e.deletedAt))}static getFormatEntityName(t){return e.isDeleted(t)?`${t.name} (Удалён)`:t.name}},ge=(e,t=!1)=>{let{key:n}=e;if(![`Backspace`,`Delete`,`Tab`,`Escape`,`Enter`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(n)&&!((e.ctrlKey||e.metaKey)&&[`a`,`c`,`v`,`x`,`z`,`ф`,`с`,`м`,`ч`,`я`].includes(n.toLowerCase()))){if(t&&n===`-`){let t=e.target;if((t.selectionStart??0)===0&&!t.value.includes(`-`))return}/^\d$/.test(n)||e.preventDefault()}},_e=(e,t=`.`,n=!1)=>{let{key:r}=e,i=e.target;[`Backspace`,`Delete`,`Tab`,`Escape`,`Enter`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(r)||(e.ctrlKey||e.metaKey)&&[`a`,`c`,`v`,`x`,`z`,`ф`,`с`,`м`,`ч`,`я`].includes(r.toLowerCase())||(!n||r!==`-`||i.value.includes(`-`)||(i.selectionStart??0)!==0&&i.value.length!==0)&&(r!==t&&r!==(t===`.`?`,`:`.`)||i.value.includes(t)||i.value.includes(t===`.`?`,`:`.`))&&(/^\d$/.test(r)||e.preventDefault())},ve=e=>e?Number.parseFloat(e.replace(`,`,`.`)):null,ye=(e,t)=>{e[t]={}},be=e=>{let t=e.target;setTimeout(()=>{t.select()},100)},xe=class e{static percentFractionDigits=5;static percentDisplayFractionDigits=2;static areaFractionDigits=4;static coordinateFractionDigits=6;static significantDigits=12;static epsilon=1e-6;static moneyFormatters=new Map;static areaFormatter=new Intl.NumberFormat(`ru-RU`,{style:`decimal`,maximumFractionDigits:e.areaFractionDigits});static getDecimalsCount(e){if(!Number.isFinite(e)||Number.isInteger(e))return 0;let[t,r]=(0,n.split)(e.toString(),`e`),i=(0,n.split)(t,`.`),a=i.length>1?i[1].length:0;return Math.max(a-(Number(r)||0),0)}static normalize(t){return Number.isFinite(t)?Number(t.toPrecision(e.significantDigits)):t}static multiplyByStep(t,r){return(0,n.round)(t*r,e.getDecimalsCount(r)+e.getDecimalsCount(t))}static divideByStep(t,n){return e.normalize(t/n)}static isMultipleOf(t,n){let r=t/n;return Math.abs(r-Math.round(r))<e.epsilon}static isLessOrEqual(t,n){return t<=n+e.epsilon}static roundCoordinate(t){return(0,n.round)(t,e.coordinateFractionDigits)}static roundMoney(t,r=pe.getPrecision()){return r===void 0?e.normalize(t):(0,n.round)(t,r)}static floorMoney(t,r=pe.getPrecision()){return r===void 0?e.normalize(t):(0,n.floor)(t,r)}static roundPercent(t,r=e.percentFractionDigits){return(0,n.round)(t,r)}static formatMoney(t,n=pe.getPrecision()){let r=e.moneyFormatters.get(n);return r||(r=new Intl.NumberFormat(`ru-RU`,{style:`decimal`,minimumFractionDigits:n,maximumFractionDigits:n}),e.moneyFormatters.set(n,r)),r.format(e.normalize(t))}static formatPercent(t,n=e.percentDisplayFractionDigits){return new Intl.NumberFormat(`ru-RU`,{style:`decimal`,maximumFractionDigits:n}).format(t)}static formatArea(t){return e.areaFormatter.format(t)}};function Se(e){return e.itemCount&&e.itemCount>0?`Всего ${e.itemCount} записей`:``}var Ce=class e{static convertReferencesToOptionsList(e,t=!1,r=!1,i=!1,a=void 0,o=void 0){let s=e.map(e=>({label:a?a(e):he.getFormatEntityName(e),value:e.id,item:e,disabled:o?o(e):!1}));return t&&(s=s.map(e=>`${e.label}-[${e.value}]`).sort().map(e=>s.find(t=>e===`${t.label}-[${t.value}]`))),r===!1?[...i?[{label:``,value:-1,disabled:!0}]:[],...s]:[...i?[{type:`group`,label:`-`,key:`default_group`,children:[{label:`-- Отсутствует --`,value:-1,disabled:!0}]}]:[],...Object.values((0,n.groupBy)(s,r.key)).filter(e=>e.length>0).map(e=>{let t=e[0],i=(0,n.isString)(r.key)?(0,n.get)(t,r.key):r.key(e),a=(0,n.isString)(r.label)?(0,n.get)(t,r.label):r.label(e);return{type:`group`,label:(0,n.isEmpty)(a)?`- Не определено -`:a,key:`group_${i}`,children:e}})]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,i=!1,a=void 0,o=void 0){return e.convertReferencesToOptionsList(t,n,r,i,a,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,i=!1,a=void 0,o=void 0){return e.convertReferencesToOptionsList(t,n,r,i,a,o)}},we={required:{required:!0,type:`any`,trigger:[`blur`,`input`],message:`Это поле обязательно для заполнения`}},I={required:{type:`number`,required:!0,trigger:[`blur`,`input`],message:`Это поле обязательно для заполнения`},min(e){return{type:`number`,min:e,trigger:[`blur`,`input`],message:`Минимальное значение: ${e}`}},max(e){return{type:`number`,max:e,trigger:[`blur`,`input`],message:`Максимальное значение: ${e}`}},step(e){return{type:`number`,trigger:[`blur`,`input`],validator:(t,n)=>n===null||xe.isMultipleOf(n,e)?!0:Error(`Значение должно быть кратно ${e}`)}}},Te={required:{required:!0,type:`date`,trigger:[`blur`,`input`],message:`Это поле обязательно для заполнения`}},Ee={serverValidation(e){return{validator:(t,n)=>n===null||!e||Error(e)}}},De=e=>e.properties?.files??[],Oe=e=>!!e.properties?.description||!!e.properties?.specification||De(e).length>0,ke=class e{static defaultLinearSizeMm=1e3;static isM2Category(e){return e.properties?.allowSetM2ClientPrice??!1}static findReferenceProduct(e){return e.products?.find(t=>t.category?.id===e.id&&(!!t.properties?.length||!!t.properties?.width))}static getSquare(t){return(t.properties?.width??e.defaultLinearSizeMm)*(t.properties?.length??e.defaultLinearSizeMm)/1e6}static toM2Cost(t,n){return t/e.getSquare(n)}static calculateM2Cost(t,r,i){let a=(0,n.isNil)(r)?t.retailCost??t.cost:t.priceCoefficients?.find(e=>e.coefficient.id===r.id)?.cost;return(0,n.isNil)(a)?void 0:e.toM2Cost(a*(1+(i??0)/100),t)}},Ae=(0,r.defineComponent)({__name:`button-with-confirm-action`,props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:``},dialogContent:{default:``},disableConfirm:{type:Boolean,default:!1},popoverText:{default:``},type:{default:`default`},size:{default:`small`},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`accept`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.ref)(!1),s=()=>{i(`accept`,()=>{a.value=!1})},c=()=>{n.disableConfirm?s():a.value=!0};return(t,n)=>{let i=o.NButton,l=o.NPopover,u=o.NModal;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[(0,r.createVNode)(l,{disabled:e.popoverText.length===0,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{disabled:e.disabled,ghost:e.ghost,loading:e.loading,size:e.size,type:e.type,quaternary:e.quaternary,circle:e.circle,onClick:c},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`)]),_:3},8,[`disabled`,`ghost`,`loading`,`size`,`type`,`quaternary`,`circle`])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.popoverText),1)]),_:3},8,[`disabled`]),(0,r.createVNode)(u,{show:a.value,"onUpdate:show":n[1]||=e=>a.value=e,content:e.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:e.dialogTitle,"action-class":``,preset:`dialog`},{action:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{type:`primary`,class:`px-8`,onClick:s},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Да `,-1)]]),_:1}),(0,r.createVNode)(i,{type:`default`,onClick:n[0]||=e=>a.value=!1},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Отмена `,-1)]]),_:1})]),_:1},8,[`show`,`content`,`title`])])}}}),je={class:`flex gap-2 overflow-x-auto max-sm:flex-nowrap sm:flex-wrap sm:overflow-visible`},Me=(0,r.defineComponent)({__name:`chip-group`,props:{items:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,je,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.items,t=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:t.key,class:`shrink-0`,round:``,size:`small`,type:e.modelValue===t.key?`primary`:`default`,onClick:e=>n(`update:modelValue`,t.key)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(t.label),1)]),_:2},1032,[`type`,`onClick`]))),128))]))}}),Ne={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Pe(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ne,[...t[0]||=[(0,r.createElementVNode)(`circle`,{cx:`256`,cy:`256`,r:`48`,fill:`currentColor`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`256`,cy:`416`,r:`48`,fill:`currentColor`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`256`,cy:`96`,r:`48`,fill:`currentColor`},null,-1)]])}var Fe=(0,r.markRaw)({name:`ion-ellipsis-vertical-sharp`,render:Pe}),Ie={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Le(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ie,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.createElementVNode)(`path`,{d:`M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1`}),(0,r.createElementVNode)(`path`,{d:`M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3`})],-1)]])}var Re=(0,r.markRaw)({name:`tabler-edit`,render:Le}),ze={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Be(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,ze,[...t[0]||=[(0,r.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)]])}var Ve=(0,r.markRaw)({name:`ion-checkmark-done-circle`,render:Be}),He={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Ue(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,He,[...t[0]||=[(0,r.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),(0,r.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)]])}var We=(0,r.markRaw)({name:`ion-checkmark-done-circle-outline`,render:Ue}),Ge={viewBox:`0 0 32 32`,width:`1.2em`,height:`1.2em`};function Ke(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ge,[...t[0]||=[(0,r.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)]])}var qe=(0,r.markRaw)({name:`fluent-pin32-regular`,render:Ke}),Je={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Ye(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Je,[...t[0]||=[(0,r.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),(0,r.createElementVNode)(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`},null,-1)]])}var Xe=(0,r.markRaw)({name:`ion-eye-outline`,render:Ye}),Ze={viewBox:`0 0 32 32`,width:`1.2em`,height:`1.2em`};function Qe(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ze,[...t[0]||=[(0,r.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)]])}var $e=(0,r.markRaw)({name:`fluent-pin32-filled`,render:Qe}),et={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function tt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,et,[...t[0]||=[(0,r.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)]])}var nt=(0,r.markRaw)({name:`ion-bookmark-outline`,render:tt}),rt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function it(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,rt,[...t[0]||=[(0,r.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),(0,r.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)]])}var at=(0,r.markRaw)({name:`ion-eye-off-sharp`,render:it}),ot={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function st(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,ot,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`48`,d:`m184 112l144 144l-144 144`},null,-1)]])}var ct=(0,r.markRaw)({name:`ion-chevron-forward-outline`,render:st}),lt=[`data-name`],ut={class:`sc-collapse-item-header flex flex-row gap-2.5`},dt={class:`sc-collapse-item-arrow flex-none cursor-pointer pt-1.5`},ft={key:0},pt={class:`sc-collapse-item-pre-arrow flex flex-none flex-row gap-1`},mt={class:`flex flex-1 flex-col`},ht={key:0,class:`sc-collapse-item-sub-title flex-1`},gt={key:1,class:`sc-collapse-item-title-extra flex-none`},_t={key:0,class:`sc-collapse-item-content`},vt=(0,r.defineComponent)({__name:`collapse-item`,props:{name:{default:``},title:{default:``},disabled:{type:Boolean,default:!1}},emits:[`header:click`],setup(e,{expose:t,emit:i}){let a=e,o=i,s=(0,r.inject)(`itemHeaderClickHandler`,n.noop),c=(0,r.inject)(`defaultExpandedNames`,[]),l=(0,r.inject)(`expandedNames`,[]),u=(0,n.some)(c,e=>e===a.name),d=(0,r.computed)(()=>(0,n.some)(l,e=>e===a.name)),f=(0,r.ref)(u),p=()=>{a.disabled||(f.value=d.value||!f.value,o(`header:click`,a.name,f.value),s(a.name,f.value))};return t({expand:()=>{!a.disabled&&!f.value&&(f.value=!0,o(`header:click`,a.name,f.value),s(a.name,f.value))},toggle:()=>{a.disabled||p()},collapse:()=>{!a.disabled&&f.value&&!d.value&&(f.value=!1,o(`header:click`,a.name,f.value),s(a.name,f.value))},expanded:(0,r.readonly)(f)}),(t,n)=>{let i=ct;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{"data-name":e.name,class:(0,r.normalizeClass)([{"cursor-not-allowed text-gray-400":e.disabled},`sc-collapse-item flex flex-col p-2`])},[(0,r.createElementVNode)(`div`,ut,[(0,r.createElementVNode)(`div`,dt,[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"rotate-90":f.value}),onClick:p},[(0,r.renderSlot)(t.$slots,`arrow`,{},()=>[(0,r.createVNode)(i)],!0)],2)]),(0,r.unref)(fe).hasSlotContent(t.$slots[`pre-arrow`])?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ft,[(0,r.createElementVNode)(`div`,pt,[(0,r.renderSlot)(t.$slots,`pre-arrow`,{},void 0,!0)])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,mt,[(0,r.createElementVNode)(`div`,{class:`sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold`,onClick:p},[(0,r.renderSlot)(t.$slots,`header`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.title),1)],!0)]),(0,r.unref)(fe).hasSlotContent(t.$slots[`sub-header`])?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ht,[(0,r.renderSlot)(t.$slots,`sub-header`,{},void 0,!0)])):(0,r.createCommentVNode)(``,!0)]),(0,r.unref)(fe).hasSlotContent(t.$slots[`header-extra`])?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,gt,[(0,r.renderSlot)(t.$slots,`header-extra`,{},void 0,!0)])):(0,r.createCommentVNode)(``,!0)]),(0,r.createVNode)(r.Transition,{name:`fade`},{default:(0,r.withCtx)(()=>[d.value||f.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,_t,[(0,r.renderSlot)(t.$slots,`default`,{},void 0,!0)])):(0,r.createCommentVNode)(``,!0)]),_:3})],10,lt)}}}),yt=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},bt=yt(vt,[[`__scopeId`,`data-v-f7f7fed1`]]),xt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function St(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,xt,[...t[0]||=[(0,r.createElementVNode)(`circle`,{cx:`176`,cy:`416`,r:`16`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`400`,cy:`416`,r:`16`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M48 80h64l48 272h256`},null,-1),(0,r.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)]])}var Ct=(0,r.markRaw)({name:`ion-cart-outline`,render:St}),wt=Symbol(),Tt={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`}},Et={class:`flex flex-col-reverse gap-2.5 sm:flex-row`},Dt={class:`inline-flex`},Ot=(0,r.defineComponent)({__name:`product-actions`,props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(e){let t=e,i=(0,r.inject)(wt,`medium`),a=ce(),s=(0,r.computed)(()=>(0,n.isFunction)(t.showProductAddToCartButton)?t.showProductAddToCartButton(t.product):t.showProductAddToCartButton),c=(0,r.computed)(()=>(0,n.isFunction)(t.showProductEditButton)?t.showProductEditButton(t.product):t.showProductEditButton),l=(0,r.computed)(()=>(0,n.isFunction)(t.showProductRequiredButton)?t.showProductRequiredButton(t.product):t.showProductRequiredButton),f=(0,r.computed)(()=>l.value===`disabled`?`${d}. ${u}`:d),p=(0,r.computed)(()=>(0,n.isNil)(t.productContextButtonsConfig)?[]:(0,n.isFunction)(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),m=()=>{t.eventEmitter.emit(`product:add-to-cart`,{product:t.product})},h=()=>{t.eventEmitter.emit(`product:edit`,{product:t.product})},g=()=>{t.eventEmitter.emit(`product:required`,{product:t.product})},_=e=>{t.eventEmitter.emit(`product:context-select`,{product:t.product,key:e})};return(t,n)=>{let u=We,d=Ve,v=o.NButton,y=o.NTooltip,b=Re,x=Ct,S=Fe,C=o.NDropdown;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Et,[l.value?((0,r.openBlock)(),(0,r.createBlock)(y,{key:0,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(a)},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Dt,[(0,r.createVNode)(v,{ghost:!0,size:(0,r.unref)(i),disabled:l.value===`disabled`,type:e.product.isRequired?`primary`:`default`,onClick:g},{default:(0,r.withCtx)(()=>[e.product.isRequired?((0,r.openBlock)(),(0,r.createBlock)(d,{key:1})):((0,r.openBlock)(),(0,r.createBlock)(u,{key:0}))]),_:1},8,[`size`,`disabled`,`type`])])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(f.value),1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createBlock)(y,{key:1,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(a)},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(v,{ghost:!0,size:(0,r.unref)(i),type:`primary`,disabled:c.value===`disabled`,onClick:h},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(b)]),_:1},8,[`size`,`disabled`])]),default:(0,r.withCtx)(()=>[n[0]||=(0,r.createTextVNode)(` Редактировать `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),s.value?((0,r.openBlock)(),(0,r.createBlock)(y,{key:2,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(a)},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(v,{ghost:!0,size:(0,r.unref)(i),disabled:s.value===`disabled`,type:`primary`,onClick:m},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(x)]),_:1},8,[`size`,`disabled`])]),default:(0,r.withCtx)(()=>[n[1]||=(0,r.createTextVNode)(` Добавить в корзину `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),p.value?.length>0?((0,r.openBlock)(),(0,r.createBlock)(C,{key:3,options:p.value,size:(0,r.unref)(i),trigger:`click`,onSelect:_},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(v,{ghost:!0,size:(0,r.unref)(i),type:`primary`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(S)]),_:1},8,[`size`])]),_:1},8,[`options`,`size`])):(0,r.createCommentVNode)(``,!0)])}}}),kt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function At(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,kt,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.createElementVNode)(`path`,{d:`M12 8v4l2 2`}),(0,r.createElementVNode)(`path`,{d:`M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5`})],-1)]])}var jt=(0,r.markRaw)({name:`tabler-history`,render:At}),Mt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Nt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Mt,[...t[0]||=[(0,r.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)]])}var Pt=(0,r.markRaw)({name:`mdi-percent-outline`,render:Nt}),Ft={class:`flex flex-row gap-1`},It={key:0,class:`flex gap-1`},Lt={key:0,class:`flex text-nowrap text-sm line-through`},Rt={key:1,class:`flex flex-row text-nowrap text-sm`},zt={key:2,class:`flex flex-row gap-1 text-nowrap text-sm text-gray-600`},Bt=(0,r.defineComponent)({__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(e){let a=e,s=ce(),c=(0,r.computed)(()=>`product`in a.product),l=(0,r.computed)(()=>`discount`in a.product&&a.product.discount?he.getFormatEntityName(a.product.discount):``),u=(0,r.computed)(()=>`product`in a.product?a.product.product:a.product),d=(0,r.computed)(()=>(0,n.isNil)(g.value)?``:a.showQuantityUnit?(0,n.compact)([u.value.currency.symbol,u.value.unit.name]).join(`/`):a.showCurrency?u.value.currency.symbol:``),f=(0,r.computed)(()=>a.showQuantityUnit?(0,n.compact)([`₽`,u.value.unit.name]).join(`/`):a.showCurrency?`₽`:``),p=(0,r.computed)(()=>(0,n.find)(u.value.priceCoefficients,[`coefficient.slug`,a.costFieldName])),m=(0,r.computed)(()=>{let e=(0,n.find)(u.value.priceCoefficients,[`coefficient.slug`,`k0`]);return p.value||!e||(0,n.isNil)(g.value)||(0,n.isNil)(e.cost)?!1:g.value<e.cost}),h=(0,t.useBaseConfigStore)().getConfig()?.defaultCurrency??`RUB`,g=(0,r.computed)(()=>p.value?p.value.cost:(0,n.get)(a.product,a.costFieldName)),_=(0,r.computed)(()=>a.additionalThroughFieldName?(0,n.get)(a.product,a.additionalThroughFieldName):void 0),v=(0,r.computed)(()=>u.value.costDate?(0,i.format)(u.value.costDate,(0,t.useBaseConfigStore)().config.dateFormats.uiDate):void 0),y=(0,r.computed)(()=>a.currencyRates||u.value.currency.signature===h?a.currencyRates:{[u.value.currency.signature]:u.value.costRub/u.value.cost}),b=(0,r.computed)(()=>((0,n.isFunction)(a.allowPriceClick)?a.allowPriceClick(u.value):a.allowPriceClick)&&!(0,n.isNil)(g.value)),x=(0,r.computed)(()=>(0,n.isNil)(g.value)?`-`:xe.formatMoney(Number.parseFloat(g.value),u.value.currency.precision)),S=(0,r.computed)(()=>{if(u.value.currency.signature===h||!y.value||!y.value[u.value.currency.signature])return null;let e=y.value[u.value.currency.signature];return xe.formatMoney(Number.parseFloat(g.value)*e)}),C=(0,r.computed)(()=>(0,n.isNil)(_.value)?null:xe.formatMoney(_.value,u.value.currency.precision)),w=(0,r.computed)(()=>{if(!_.value||!g.value||_.value===g.value||g.value===0)return null;let e=(g.value-_.value)/_.value*100;return xe.formatPercent(e)});return(t,i)=>{let a=o.NTag,h=o.NTooltip,y=Pt,T=jt;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ft,[e.showTag?((0,r.openBlock)(),(0,r.createBlock)(h,{key:0},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(a,{round:``,bordered:!1,size:`small`,class:(0,r.normalizeClass)([`text-slate-600`,{"font-bold":!p.value}])},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(p.value?.coefficient.slug??`Ц`),1)]),_:1},8,[`class`])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(p.value?.coefficient.name??`Розничная цена`),1)]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"!text-red-600":m.value})},[_.value&&_.value!==g.value||w.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,It,[_.value&&_.value!==g.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Lt,(0,r.toDisplayString)(C.value)+` `+(0,r.toDisplayString)(d.value),1)):(0,r.createCommentVNode)(``,!0),w.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:1,class:(0,r.normalizeClass)([`flex text-nowrap text-sm text-gray-600`,{"!text-red-600":m.value}])},` (`+(0,r.toDisplayString)(w.value)+`%) `,3)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)([`whitespace-nowrap text-base flex items-center gap-1`,{"text-gray-600":p.value?.readOnly,"font-bold":!p.value&&!c.value}])},[(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":b.value&&e.eventEmitter}),onClick:i[0]||=()=>{b.value&&e.eventEmitter?.emit(`cost:click`,{product:u.value,cost:g.value})}},(0,r.toDisplayString)(x.value),3),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(d.value)+` `,1),g.value&&!p.value&&`discount`in e.product&&e.product.discount?((0,r.openBlock)(),(0,r.createBlock)(h,{key:0},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(y,{class:`text-sm text-black bg-amber-400 rounded p-px`})]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,null,` На продукт действует скидка "`+(0,r.toDisplayString)(l.value)+`"; `,1)]),_:1})):(0,r.createCommentVNode)(``,!0)],2),S.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Rt,` ~ `+(0,r.toDisplayString)(S.value)+` `+(0,r.toDisplayString)(f.value),1)):(0,r.createCommentVNode)(``,!0),e.showCostDate&&!(0,r.unref)(n.isNil)(v.value)?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,zt,[(0,r.createTextVNode)((0,r.toDisplayString)(v.value)+` `,1),e.showPriceHistory&&e.eventEmitter?((0,r.openBlock)(),(0,r.createBlock)(h,{key:0,placement:`top-end`,disabled:!(0,r.unref)(s)},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(T,{class:`cursor-pointer`,onClick:i[1]||=t=>e.eventEmitter?.emit(`cost:show-price-history`,{product:u.value})})]),default:(0,r.withCtx)(()=>[i[2]||=(0,r.createTextVNode)(` История цен `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)],2)])}}}),Vt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Ht(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Vt,[...t[0]||=[(0,r.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),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M220 220h32v116`},null,-1),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`32`,d:`M208 340h88`},null,-1),(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26`},null,-1)]])}var Ut=(0,r.markRaw)({name:`ion-information-circle-outline`,render:Ht}),Wt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Gt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Wt,[...t[0]||=[(0,r.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),(0,r.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)]])}var Kt=(0,r.markRaw)({name:`ion-images`,render:Gt}),qt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Jt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,qt,[...t[0]||=[(0,r.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)]])}var Yt=(0,r.markRaw)({name:`ion-information-circle`,render:Jt}),Xt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Zt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Xt,[...t[0]||=[(0,r.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)]])}var Qt=(0,r.markRaw)({name:`ion-bookmark`,render:Zt}),$t=function(){return $t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},$t.apply(this,arguments)},en={thumbnail:!0,animateThumb:!0,currentPagerPosition:`middle`,alignThumbnails:`middle`,thumbWidth:100,thumbHeight:`80px`,thumbMargin:5,appendThumbnailsTo:`.lg-components`,toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:`Toggle thumbnails`}},tn={afterAppendSlide:`lgAfterAppendSlide`,init:`lgInit`,hasVideo:`lgHasVideo`,containerResize:`lgContainerResize`,updateSlides:`lgUpdateSlides`,afterAppendSubHtml:`lgAfterAppendSubHtml`,beforeOpen:`lgBeforeOpen`,afterOpen:`lgAfterOpen`,slideItemLoad:`lgSlideItemLoad`,beforeSlide:`lgBeforeSlide`,afterSlide:`lgAfterSlide`,posterClick:`lgPosterClick`,dragStart:`lgDragStart`,dragMove:`lgDragMove`,dragEnd:`lgDragEnd`,beforeNextSlide:`lgBeforeNextSlide`,beforePrevSlide:`lgBeforePrevSlide`,beforeClose:`lgBeforeClose`,afterClose:`lgAfterClose`,rotateLeft:`lgRotateLeft`,rotateRight:`lgRotateRight`,flipHorizontal:`lgFlipHorizontal`,flipVertical:`lgFlipVertical`,autoplay:`lgAutoplay`,autoplayStart:`lgAutoplayStart`,autoplayStop:`lgAutoplayStop`},nn=function(){function e(e,t){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=e,this.$LG=t,this}return e.prototype.init=function(){this.settings=$t($t({},en),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},e.prototype.build=function(){var e=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on(`click.lg touchend.lg`,function(t){var n=e.$LG(t.target);n.hasAttribute(`data-lg-item-id`)&&setTimeout(function(){if(e.thumbClickable&&!e.core.lgBusy){var t=parseInt(n.attr(`data-lg-item-id`));e.core.slide(t,!1,!0,!1)}},50)}),this.core.LGel.on(tn.beforeSlide+`.thumb`,function(t){var n=t.detail.index;e.animateThumb(n)}),this.core.LGel.on(tn.beforeOpen+`.thumb`,function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth}),this.core.LGel.on(tn.updateSlides+`.thumb`,function(){e.rebuildThumbnails()}),this.core.LGel.on(tn.containerResize+`.thumb`,function(){e.core.lgOpened&&setTimeout(function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth,e.animateThumb(e.core.index),e.thumbOuterWidth=e.core.outer.get().offsetWidth},50)})},e.prototype.setThumbMarkup=function(){var e=`lg-thumb-outer `;this.settings.alignThumbnails&&(e+=`lg-thumb-align-`+this.settings.alignThumbnails);var t=`<div class="`+e+`">
1
+ (function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@snabcentr/common-lib"),require("lodash-es"),require("vue"),require("date-fns"),require("pinia"),require("naive-ui"),require("libphonenumber-js"),require("ts-case-convert"),require("vue-tel-input")):typeof define==`function`&&define.amd?define([`exports`,`@snabcentr/common-lib`,`lodash-es`,`vue`,`date-fns`,`pinia`,`naive-ui`,`libphonenumber-js`,`ts-case-convert`,`vue-tel-input`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.SC_VueUiLib={},e[`@snabcentr/common-lib`],e[`lodash-es`],e.Vue,e[`date-fns`],e.pinia,e[`naive-ui`],e[`libphonenumber-js`],e[`ts-case-convert`],e[`vue-tel-input`]))})(this,function(e,t,n,r,i,a,o,s,c,l){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var u=`Чтобы изменить, включите режим управления`,d=`Товар, который нужно предлагать клиенту`,f=`Категория, которую нужно предлагать клиенту`,p=class e{static messagesService;static notificationsService;static init(t,n){e.messagesService&&e.notificationsService||(e.messagesService=t,e.notificationsService=n)}static getMessagesService(){if(!e.messagesService)throw Error(`UI provider is not initialized.`);return e.messagesService}static getNotificationsService(){if(!e.notificationsService)throw Error(`UI provider is not initialized.`);return e.notificationsService}static showNotificationsForErrorResponseData(r,i={}){if((0,n.isEmpty)(r.errors)){let t=r.rawError?.config?.url,n=t?` [ ${t} ]`:``;e.notificationsService?e.notificationsService.error({title:`Ошибка выполнения/обработки запроса`,content:r.message,meta:`#${r.status}${n}: ${r.statusText}`,duration:3e3}):console.log(`Show notification error response data: UI provider is not initialized.`,r)}else{let n=[];for(let e in r.errors)Object.prototype.hasOwnProperty.call(i,e)?i[e]=new t.FieldValidationResultData(r.errors[e].toString(),`error`):n.push(r.errors[e].toString());e.showErrorMessages(n)}}static showErrorMessages(t){let{messagesService:n,notificationsService:i}=e;t.length===1&&n?n.error(t[0]):t.length>1&&i?i.error({title:`Ошибки выполнения запроса`,meta:`Всего ошибок: ${t.length}`,content:()=>(0,r.h)(`ul`,{style:{maxHeight:`240px`,overflowY:`auto`,margin:0,paddingLeft:`1.25em`,listStyleType:`disc`}},t.map(e=>(0,r.h)(`li`,e)))}):t.length>0&&console.log(`Show notification error response data: UI provider is not initialized.`,t)}},m=new WeakMap,h=async e=>{let t=navigator.clipboard;if(t?.writeText){await t.writeText(e);return}let n=document.createElement(`textarea`);n.value=e,n.style.position=`fixed`,n.style.opacity=`0`,document.body.append(n),n.select();let r=document.execCommand(`copy`);if(n.remove(),!r)throw Error(`Не удалось скопировать через execCommand.`)},g=async e=>{let t=(0,n.isNil)(e)?``:String(e);if(t)try{await h(t),p.getNotificationsService().success({title:`Готово`,description:`Скопировано в буфер обмена: ${t}`,duration:2e3})}catch{p.getNotificationsService().error({title:`Ошибка`,description:`Не удалось скопировать в буфер обмена.`,duration:3e3})}},_=e=>e.tagName===`BUTTON`||e.getAttribute(`role`)===`button`||!!e.closest(`button`),v=(e,t)=>t.modifiers.click?`click`:t.modifiers.dblclick?`dblclick`:_(e)?`click`:`dblclick`,y={mounted(e,t){e.style.setProperty(`cursor`,`pointer`);let r=v(e,t),i=t=>{r===`dblclick`&&(t.preventDefault(),globalThis.getSelection()?.removeAllRanges()),g(m.get(e)?.value).catch(n.noop)};m.set(e,{value:t.value,eventName:r,handler:i}),e.addEventListener(r,i)},updated(e,t){let n=m.get(e);n&&(n.value=t.value)},beforeUnmount(e){let t=m.get(e);t&&(e.removeEventListener(t.eventName,t.handler),m.delete(e))}},b=new Set([`checkbox`,`radio`,`range`,`button`,`submit`,`reset`,`file`,`color`,`image`,`hidden`]),x=`.n-base-selection, .n-date-picker, .n-time-picker, .n-color-picker`,S=new WeakMap,C=e=>!b.has(e.type)&&!e.disabled&&!e.readOnly&&e.closest(x)===null&&e.getClientRects().length>0,w=e=>{if(e.key!==`Enter`&&e.code!==`Enter`||e.shiftKey||e.isComposing)return;let{target:t}=e;if(!(t instanceof HTMLInputElement)||!C(t))return;e.preventDefault();let n=e.currentTarget,r=[...n.querySelectorAll(`input`)].filter(e=>C(e)),i=r.indexOf(t);if(i===-1)return;let a=r.at(i+1);a?(a.focus(),a.select()):S.get(n)?.()},T={mounted(e,t){S.set(e,t.value),e.addEventListener(`keydown`,w)},updated(e,t){S.set(e,t.value)},unmounted(e){e.removeEventListener(`keydown`,w),S.delete(e)}},E=function(e){return e.NotInStock=`not_in_stock`,e.OnOrder=`on_order`,e.LargeOrder=`large_order`,e.NextDayDelivery=`next_day_delivery`,e}({}),D=e=>({color:e.backgroundColor,textColor:e.textOnBackgroundColor,borderColor:e.color}),O={color:`#4b5563`,backgroundColor:`#e5e7eb`,textOnBackgroundColor:`#1f2937`},k=new Map([[t.OrderStatusEnum.New,{color:`#15803d`,backgroundColor:`#bbf7d0`,textOnBackgroundColor:`#166534`}],[t.OrderStatusEnum.Processing,{color:`#ea580c`,backgroundColor:`#fed7aa`,textOnBackgroundColor:`#9a3412`}],[t.OrderStatusEnum.AwaitingSupplyProducts,{color:`#ca8a04`,backgroundColor:`#fef08a`,textOnBackgroundColor:`#854d0e`}],[t.OrderStatusEnum.InvoiceIssued,{color:`#1d4ed8`,backgroundColor:`#bfdbfe`,textOnBackgroundColor:`#1e40af`}],[t.OrderStatusEnum.ProcessingOnStock,{color:`#0e7490`,backgroundColor:`#a5f3fc`,textOnBackgroundColor:`#155e75`}],[t.OrderStatusEnum.OrderUpdated,{color:`#6d28d9`,backgroundColor:`#ddd6fe`,textOnBackgroundColor:`#5b21b6`}],[t.OrderStatusEnum.Finished,{color:`#475569`,backgroundColor:`#e2e8f0`,textOnBackgroundColor:`#1e293b`}],[t.OrderStatusEnum.Canceled,{color:`#b91c1c`,backgroundColor:`#fecaca`,textOnBackgroundColor:`#991b1b`}],[t.OrderStatusEnum.Error,{color:`#991b1b`,backgroundColor:`#fca5a5`,textOnBackgroundColor:`#7f1d1d`}]]),A=e=>k.get(e)??O,ee=e=>D(A(e)),te=e=>{let t=A(e);return{"--sc-order-status-color":t.color,"--sc-order-status-bg":t.backgroundColor,"--sc-order-status-text":t.textOnBackgroundColor}},ne=new Map([[E.NotInStock,{color:`#ef4444`,backgroundColor:`#f7ff00`,textOnBackgroundColor:`#ff0000`}],[E.OnOrder,{color:`#ca8a04`,backgroundColor:`#f7ff00`,textOnBackgroundColor:`#ff0000`}],[E.LargeOrder,{color:`#ef2929`,backgroundColor:`#ef2929`,textOnBackgroundColor:`#ffffff`}],[E.NextDayDelivery,{color:`#ef2929`,backgroundColor:`#ef2929`,textOnBackgroundColor:`#ffffff`}]]),j=new Map([[E.NotInStock,`Нет в наличии`],[E.OnOrder,`Под заказ`],[E.LargeOrder,`Крупный заказ`],[E.NextDayDelivery,`Доставка на завтра`]]),M=[...ne.keys()],re=e=>ne.get(e)??O,ie=e=>j.get(e)??e,ae=e=>{let t=[];return e.isNotInStock&&t.push(E.NotInStock),e.isOnOrder&&t.push(E.OnOrder),e.isLargeOrder&&t.push(E.LargeOrder),!(0,n.isNil)(e.delivery.date)&&(0,i.isTomorrow)(new Date(e.delivery.date))&&t.push(E.NextDayDelivery),t},N=function(e){return e.AttachedUser=`attached_user`,e.ClientInfo=`client_info`,e.ClientInfoShort=`client_info_short`,e.CreatedAt=`created_at`,e.ClientCity=`client_city`,e.DeliveryInfo=`delivery_info`,e.DeliveryDate=`delivery_date`,e.Id=`id`,e.PaymentType=`payment_type`,e.SalesDirections=`sales_directions`,e.Status=`status`,e.actions=`actions`,e}({}),P=function(e){return e.phone=`phone`,e.tablet=`tablet`,e.laptop=`laptop`,e}({}),oe=class e{static isInitialized=!1;static refsDependingOnDeviceResolution=[];static init(){e.isInitialized||(e.isInitialized=!0,e.windowResizeHandler(),window.addEventListener(`resize`,e.windowResizeHandler))}static destroy(){window.removeEventListener(`resize`,e.windowResizeHandler),e.isInitialized=!1}static getDeviceTypeByResolution(){let e=(0,t.useBaseConfigStore)().config.deviceTypeByResolution;return window.innerWidth<e.tablet?P.phone:window.innerWidth<e.laptop?P.tablet:P.laptop}static initRefDependingOnDeviceResolution(t,n,i){let a=(0,r.ref)(i);return e.setRefValueDependingOnDeviceResolution(a,t,n,i),e.refsDependingOnDeviceResolution.push({r:a,phoneValue:t,tabletValue:n,defaultValue:i}),a}static isPhoneDevice(){return e.getDeviceTypeByResolution()===P.phone}static isTabletDevice(){return e.getDeviceTypeByResolution()===P.tablet}static isLaptopDevice(){return e.getDeviceTypeByResolution()===P.laptop}static setRefValueDependingOnDeviceResolution(t,n,r,i){switch(e.getDeviceTypeByResolution()){case P.phone:t.value=n;break;case P.tablet:t.value=r;break;default:t.value=i}}static windowResizeHandler(){(0,n.forEach)(e.refsDependingOnDeviceResolution,t=>{e.setRefValueDependingOnDeviceResolution(t.r,t.phoneValue,t.tabletValue,t.defaultValue)})}};function se(){try{return oe.getDeviceTypeByResolution()}catch(e){return console.error(e),P.laptop}}function ce(){let e=(0,r.ref)(se()),t=(0,r.computed)(()=>e.value===P.phone||e.value===P.tablet),n=()=>{e.value=se()};return(0,r.onMounted)(()=>{window.addEventListener(`resize`,n)}),(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,n)}),{isCompactLayout:t}}var le=`(hover: hover) and (pointer: fine)`,ue=()=>{let e=(0,n.isFunction)(globalThis.matchMedia)?globalThis.matchMedia(le):void 0,t=(0,r.ref)(!e||e.matches),i=e=>{t.value=e.matches};return e?.addEventListener(`change`,i),(0,r.onScopeDispose)(()=>{e?.removeEventListener(`change`,i)},!0),(0,r.readonly)(t)},de=class{static getLabel(e){return e===t.AddressQualityEnum.Incomplete||e===t.AddressQualityEnum.Undetermined?`Проверьте адрес`:void 0}},fe=`.sc-versions-list`;function pe(e,t,r){let a=document.querySelectorAll(fe);if(a.length===0)return;let o=a[0],s=`${e}:`;if((0,n.some)(o.querySelectorAll(`li`),e=>(0,n.startsWith)((0,n.trim)(e.textContent||``),s)))return;let c=document.createElement(`li`);c.append(document.createTextNode(`${s} ${t} от ${(0,i.format)(r,`dd.MM.yyyy`)}`)),o.append(c)}var me=class e{static isVnodeEmpty(t){return t.every(t=>t.type===r.Comment||t.type===r.Text&&(0,n.isString)(t.children)&&!t.children.trim()?!0:t.type===r.Fragment&&e.isVnodeEmpty(t.children))}static hasSlotContent(t){return t?!e.isVnodeEmpty(t()):!1}},he=class e{static getDefaultCurrency(){if(!(0,a.getActivePinia)())return;let e=(0,t.useBaseConfigStore)().getConfig().defaultCurrency;return(0,t.useReferencesStore)().currencyReference?.find(t=>t.signature===e)}static getPrecision(t){return t?.precision??e.getDefaultCurrency()?.precision}},ge={readAsFileData(e){return new Promise((t,n)=>{let r=new FileReader;r.addEventListener(`load`,()=>{t({name:e.name,content:r.result})}),r.addEventListener(`error`,()=>{n(Error(`Не удалось прочитать файл «${e.name}».`))}),r.readAsDataURL(e)})}},_e=class e{static isDeleted(e){return!(!e.deletedAt||(0,i.isFuture)(e.deletedAt))}static getFormatEntityName(t){return e.isDeleted(t)?`${t.name} (Удалён)`:t.name}},ve=(e,t=!1)=>{let{key:n}=e;if(![`Backspace`,`Delete`,`Tab`,`Escape`,`Enter`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(n)&&!((e.ctrlKey||e.metaKey)&&[`a`,`c`,`v`,`x`,`z`,`ф`,`с`,`м`,`ч`,`я`].includes(n.toLowerCase()))){if(t&&n===`-`){let t=e.target;if((t.selectionStart??0)===0&&!t.value.includes(`-`))return}/^\d$/.test(n)||e.preventDefault()}},ye=(e,t=`.`,n=!1)=>{let{key:r}=e,i=e.target;[`Backspace`,`Delete`,`Tab`,`Escape`,`Enter`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(r)||(e.ctrlKey||e.metaKey)&&[`a`,`c`,`v`,`x`,`z`,`ф`,`с`,`м`,`ч`,`я`].includes(r.toLowerCase())||(!n||r!==`-`||i.value.includes(`-`)||(i.selectionStart??0)!==0&&i.value.length!==0)&&(r!==t&&r!==(t===`.`?`,`:`.`)||i.value.includes(t)||i.value.includes(t===`.`?`,`:`.`))&&(/^\d$/.test(r)||e.preventDefault())},be=e=>e?Number.parseFloat(e.replace(`,`,`.`)):null,xe=(e,t)=>{e[t]={}},Se=e=>{let t=e.target;setTimeout(()=>{t.select()},100)},F=class e{static percentFractionDigits=5;static percentDisplayFractionDigits=2;static areaFractionDigits=4;static coordinateFractionDigits=6;static significantDigits=12;static epsilon=1e-6;static moneyFormatters=new Map;static areaFormatter=new Intl.NumberFormat(`ru-RU`,{style:`decimal`,maximumFractionDigits:e.areaFractionDigits});static getDecimalsCount(e){if(!Number.isFinite(e)||Number.isInteger(e))return 0;let[t,r]=(0,n.split)(e.toString(),`e`),i=(0,n.split)(t,`.`),a=i.length>1?i[1].length:0;return Math.max(a-(Number(r)||0),0)}static normalize(t){return Number.isFinite(t)?Number(t.toPrecision(e.significantDigits)):t}static multiplyByStep(t,r){return(0,n.round)(t*r,e.getDecimalsCount(r)+e.getDecimalsCount(t))}static divideByStep(t,n){return e.normalize(t/n)}static isMultipleOf(t,n){let r=t/n;return Math.abs(r-Math.round(r))<e.epsilon}static isLessOrEqual(t,n){return t<=n+e.epsilon}static roundCoordinate(t){return(0,n.round)(t,e.coordinateFractionDigits)}static roundMoney(t,r=he.getPrecision()){return r===void 0?e.normalize(t):(0,n.round)(t,r)}static floorMoney(t,r=he.getPrecision()){return r===void 0?e.normalize(t):(0,n.floor)(t,r)}static roundPercent(t,r=e.percentFractionDigits){return(0,n.round)(t,r)}static formatMoney(t,n=he.getPrecision()){let r=e.moneyFormatters.get(n);return r||(r=new Intl.NumberFormat(`ru-RU`,{style:`decimal`,minimumFractionDigits:n,maximumFractionDigits:n}),e.moneyFormatters.set(n,r)),r.format(e.normalize(t))}static formatPercent(t,n=e.percentDisplayFractionDigits){return new Intl.NumberFormat(`ru-RU`,{style:`decimal`,maximumFractionDigits:n}).format(t)}static formatArea(t){return e.areaFormatter.format(t)}};function Ce(e){return e.itemCount&&e.itemCount>0?`Всего ${e.itemCount} записей`:``}var we=class e{static convertReferencesToOptionsList(e,t=!1,r=!1,i=!1,a=void 0,o=void 0){let s=e.map(e=>({label:a?a(e):_e.getFormatEntityName(e),value:e.id,item:e,disabled:o?o(e):!1}));return t&&(s=s.map(e=>`${e.label}-[${e.value}]`).sort().map(e=>s.find(t=>e===`${t.label}-[${t.value}]`))),r===!1?[...i?[{label:``,value:-1,disabled:!0}]:[],...s]:[...i?[{type:`group`,label:`-`,key:`default_group`,children:[{label:`-- Отсутствует --`,value:-1,disabled:!0}]}]:[],...Object.values((0,n.groupBy)(s,r.key)).filter(e=>e.length>0).map(e=>{let t=e[0],i=(0,n.isString)(r.key)?(0,n.get)(t,r.key):r.key(e),a=(0,n.isString)(r.label)?(0,n.get)(t,r.label):r.label(e);return{type:`group`,label:(0,n.isEmpty)(a)?`- Не определено -`:a,key:`group_${i}`,children:e}})]}static convertReferencesToSelectOptionsList(t,n=!1,r=!1,i=!1,a=void 0,o=void 0){return e.convertReferencesToOptionsList(t,n,r,i,a,o)}static convertReferencesToAutocompleteOptionsList(t,n=!1,r=!1,i=!1,a=void 0,o=void 0){return e.convertReferencesToOptionsList(t,n,r,i,a,o)}},Te={required:{required:!0,type:`any`,trigger:[`blur`,`input`],message:`Это поле обязательно для заполнения`}},I={required:{type:`number`,required:!0,trigger:[`blur`,`input`],message:`Это поле обязательно для заполнения`},min(e){return{type:`number`,min:e,trigger:[`blur`,`input`],message:`Минимальное значение: ${e}`}},max(e){return{type:`number`,max:e,trigger:[`blur`,`input`],message:`Максимальное значение: ${e}`}},step(e){return{type:`number`,trigger:[`blur`,`input`],validator:(t,n)=>n===null||F.isMultipleOf(n,e)?!0:Error(`Значение должно быть кратно ${e}`)}}},Ee={required:{required:!0,type:`date`,trigger:[`blur`,`input`],message:`Это поле обязательно для заполнения`}},De={serverValidation(e){return{validator:(t,n)=>n===null||!e||Error(e)}}},Oe=e=>e.properties?.files??[],ke=e=>!!e.properties?.description||!!e.properties?.specification||Oe(e).length>0,Ae=class e{static defaultLinearSizeMm=1e3;static isM2Category(e){return e.properties?.allowSetM2ClientPrice??!1}static findReferenceProduct(e){return e.products?.find(t=>t.category?.id===e.id&&(!!t.properties?.length||!!t.properties?.width))}static getSquare(t){return(t.properties?.width??e.defaultLinearSizeMm)*(t.properties?.length??e.defaultLinearSizeMm)/1e6}static toM2Cost(t,n){return t/e.getSquare(n)}static calculateM2Cost(t,r,i){let a=(0,n.isNil)(r)?t.retailCost??t.cost:t.priceCoefficients?.find(e=>e.coefficient.id===r.id)?.cost;return(0,n.isNil)(a)?void 0:e.toM2Cost(a*(1+(i??0)/100),t)}},je=(0,r.defineComponent)({__name:`button-with-confirm-action`,props:{disabled:{type:Boolean,default:!1},dialogTitle:{default:``},dialogContent:{default:``},disableConfirm:{type:Boolean,default:!1},popoverText:{default:``},type:{default:`default`},size:{default:`small`},quaternary:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},ghost:{type:Boolean,default:!1},loading:{type:Boolean,default:!1}},emits:[`accept`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.ref)(!1),s=()=>{i(`accept`,()=>{a.value=!1})},c=()=>{n.disableConfirm?s():a.value=!0};return(t,n)=>{let i=o.NButton,l=o.NPopover,u=o.NModal;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[(0,r.createVNode)(l,{disabled:e.popoverText.length===0,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{disabled:e.disabled,ghost:e.ghost,loading:e.loading,size:e.size,type:e.type,quaternary:e.quaternary,circle:e.circle,onClick:c},{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`)]),_:3},8,[`disabled`,`ghost`,`loading`,`size`,`type`,`quaternary`,`circle`])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.popoverText),1)]),_:3},8,[`disabled`]),(0,r.createVNode)(u,{show:a.value,"onUpdate:show":n[1]||=e=>a.value=e,content:e.dialogContent,closable:!1,"mask-closable":!1,"show-icon":!1,title:e.dialogTitle,"action-class":``,preset:`dialog`},{action:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{type:`primary`,class:`px-8`,onClick:s},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Да `,-1)]]),_:1}),(0,r.createVNode)(i,{type:`default`,onClick:n[0]||=e=>a.value=!1},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Отмена `,-1)]]),_:1})]),_:1},8,[`show`,`content`,`title`])])}}}),Me={class:`flex gap-2 overflow-x-auto max-sm:flex-nowrap sm:flex-wrap sm:overflow-visible`},Ne=(0,r.defineComponent)({__name:`chip-group`,props:{items:{},modelValue:{}},emits:[`update:modelValue`],setup(e,{emit:t}){let n=t;return(t,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Me,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.items,t=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:t.key,class:`shrink-0`,round:``,size:`small`,type:e.modelValue===t.key?`primary`:`default`,onClick:e=>n(`update:modelValue`,t.key)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(t.label),1)]),_:2},1032,[`type`,`onClick`]))),128))]))}}),Pe={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Fe(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Pe,[...t[0]||=[(0,r.createElementVNode)(`circle`,{cx:`256`,cy:`256`,r:`48`,fill:`currentColor`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`256`,cy:`416`,r:`48`,fill:`currentColor`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`256`,cy:`96`,r:`48`,fill:`currentColor`},null,-1)]])}var Ie=(0,r.markRaw)({name:`ion-ellipsis-vertical-sharp`,render:Fe}),Le={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Re(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Le,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.createElementVNode)(`path`,{d:`M7 7H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-1`}),(0,r.createElementVNode)(`path`,{d:`M20.385 6.585a2.1 2.1 0 0 0-2.97-2.97L9 12v3h3zM16 5l3 3`})],-1)]])}var ze=(0,r.markRaw)({name:`tabler-edit`,render:Re}),Be={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Ve(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Be,[...t[0]||=[(0,r.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)]])}var He=(0,r.markRaw)({name:`ion-checkmark-done-circle`,render:Ve}),Ue={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function We(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ue,[...t[0]||=[(0,r.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),(0,r.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)]])}var Ge=(0,r.markRaw)({name:`ion-checkmark-done-circle-outline`,render:We}),Ke={viewBox:`0 0 32 32`,width:`1.2em`,height:`1.2em`};function qe(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ke,[...t[0]||=[(0,r.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)]])}var Je=(0,r.markRaw)({name:`fluent-pin32-regular`,render:qe}),Ye={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Xe(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ye,[...t[0]||=[(0,r.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),(0,r.createElementVNode)(`circle`,{cx:`256`,cy:`256`,r:`80`,fill:`none`,stroke:`currentColor`,"stroke-miterlimit":`10`,"stroke-width":`32`},null,-1)]])}var Ze=(0,r.markRaw)({name:`ion-eye-outline`,render:Xe}),Qe={viewBox:`0 0 32 32`,width:`1.2em`,height:`1.2em`};function $e(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Qe,[...t[0]||=[(0,r.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)]])}var et=(0,r.markRaw)({name:`fluent-pin32-filled`,render:$e}),tt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function nt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,tt,[...t[0]||=[(0,r.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)]])}var rt=(0,r.markRaw)({name:`ion-bookmark-outline`,render:nt}),it={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function at(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,it,[...t[0]||=[(0,r.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),(0,r.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)]])}var ot=(0,r.markRaw)({name:`ion-eye-off-sharp`,render:at}),st={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function ct(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,st,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`48`,d:`m184 112l144 144l-144 144`},null,-1)]])}var lt=(0,r.markRaw)({name:`ion-chevron-forward-outline`,render:ct}),ut=[`data-name`],dt={class:`sc-collapse-item-header flex flex-row gap-2.5`},ft={class:`sc-collapse-item-arrow flex-none cursor-pointer pt-1.5`},pt={key:0},mt={class:`sc-collapse-item-pre-arrow flex flex-none flex-row gap-1`},ht={class:`flex flex-1 flex-col`},gt={key:0,class:`sc-collapse-item-sub-title flex-1`},_t={key:1,class:`sc-collapse-item-title-extra flex-none`},vt={key:0,class:`sc-collapse-item-content`},yt=(0,r.defineComponent)({__name:`collapse-item`,props:{name:{default:``},title:{default:``},disabled:{type:Boolean,default:!1}},emits:[`header:click`],setup(e,{expose:t,emit:i}){let a=e,o=i,s=(0,r.inject)(`itemHeaderClickHandler`,n.noop),c=(0,r.inject)(`defaultExpandedNames`,[]),l=(0,r.inject)(`expandedNames`,[]),u=(0,n.some)(c,e=>e===a.name),d=(0,r.computed)(()=>(0,n.some)(l,e=>e===a.name)),f=(0,r.ref)(u),p=()=>{a.disabled||(f.value=d.value||!f.value,o(`header:click`,a.name,f.value),s(a.name,f.value))};return t({expand:()=>{!a.disabled&&!f.value&&(f.value=!0,o(`header:click`,a.name,f.value),s(a.name,f.value))},toggle:()=>{a.disabled||p()},collapse:()=>{!a.disabled&&f.value&&!d.value&&(f.value=!1,o(`header:click`,a.name,f.value),s(a.name,f.value))},expanded:(0,r.readonly)(f)}),(t,n)=>{let i=lt;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{"data-name":e.name,class:(0,r.normalizeClass)([{"cursor-not-allowed text-gray-400":e.disabled},`sc-collapse-item flex flex-col p-2`])},[(0,r.createElementVNode)(`div`,dt,[(0,r.createElementVNode)(`div`,ft,[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"rotate-90":f.value}),onClick:p},[(0,r.renderSlot)(t.$slots,`arrow`,{},()=>[(0,r.createVNode)(i)],!0)],2)]),(0,r.unref)(me).hasSlotContent(t.$slots[`pre-arrow`])?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,pt,[(0,r.createElementVNode)(`div`,mt,[(0,r.renderSlot)(t.$slots,`pre-arrow`,{},void 0,!0)])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,ht,[(0,r.createElementVNode)(`div`,{class:`sc-collapse-item-title flex flex-1 cursor-pointer flex-col text-lg font-semibold`,onClick:p},[(0,r.renderSlot)(t.$slots,`header`,{},()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.title),1)],!0)]),(0,r.unref)(me).hasSlotContent(t.$slots[`sub-header`])?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,gt,[(0,r.renderSlot)(t.$slots,`sub-header`,{},void 0,!0)])):(0,r.createCommentVNode)(``,!0)]),(0,r.unref)(me).hasSlotContent(t.$slots[`header-extra`])?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,_t,[(0,r.renderSlot)(t.$slots,`header-extra`,{},void 0,!0)])):(0,r.createCommentVNode)(``,!0)]),(0,r.createVNode)(r.Transition,{name:`fade`},{default:(0,r.withCtx)(()=>[d.value||f.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,vt,[(0,r.renderSlot)(t.$slots,`default`,{},void 0,!0)])):(0,r.createCommentVNode)(``,!0)]),_:3})],10,ut)}}}),bt=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},xt=bt(yt,[[`__scopeId`,`data-v-f7f7fed1`]]),St={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Ct(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,St,[...t[0]||=[(0,r.createElementVNode)(`circle`,{cx:`176`,cy:`416`,r:`16`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`400`,cy:`416`,r:`16`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M48 80h64l48 272h256`},null,-1),(0,r.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)]])}var wt=(0,r.markRaw)({name:`ion-cart-outline`,render:Ct}),Tt=Symbol(),Et={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`}},Dt={class:`flex flex-col-reverse gap-2.5 sm:flex-row`},Ot={class:`inline-flex`},kt=(0,r.defineComponent)({__name:`product-actions`,props:{eventEmitter:{},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0},product:{}},setup(e){let t=e,i=(0,r.inject)(Tt,`medium`),a=ue(),s=(0,r.computed)(()=>(0,n.isFunction)(t.showProductAddToCartButton)?t.showProductAddToCartButton(t.product):t.showProductAddToCartButton),c=(0,r.computed)(()=>(0,n.isFunction)(t.showProductEditButton)?t.showProductEditButton(t.product):t.showProductEditButton),l=(0,r.computed)(()=>(0,n.isFunction)(t.showProductRequiredButton)?t.showProductRequiredButton(t.product):t.showProductRequiredButton),f=(0,r.computed)(()=>l.value===`disabled`?`${d}. ${u}`:d),p=(0,r.computed)(()=>(0,n.isNil)(t.productContextButtonsConfig)?[]:(0,n.isFunction)(t.productContextButtonsConfig)?t.productContextButtonsConfig(t.product):t.productContextButtonsConfig),m=()=>{t.eventEmitter.emit(`product:add-to-cart`,{product:t.product})},h=()=>{t.eventEmitter.emit(`product:edit`,{product:t.product})},g=()=>{t.eventEmitter.emit(`product:required`,{product:t.product})},_=e=>{t.eventEmitter.emit(`product:context-select`,{product:t.product,key:e})};return(t,n)=>{let u=Ge,d=He,v=o.NButton,y=o.NTooltip,b=ze,x=wt,S=Ie,C=o.NDropdown;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Dt,[l.value?((0,r.openBlock)(),(0,r.createBlock)(y,{key:0,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(a)},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Ot,[(0,r.createVNode)(v,{ghost:!0,size:(0,r.unref)(i),disabled:l.value===`disabled`,type:e.product.isRequired?`primary`:`default`,onClick:g},{default:(0,r.withCtx)(()=>[e.product.isRequired?((0,r.openBlock)(),(0,r.createBlock)(d,{key:1})):((0,r.openBlock)(),(0,r.createBlock)(u,{key:0}))]),_:1},8,[`size`,`disabled`,`type`])])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(f.value),1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createBlock)(y,{key:1,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(a)},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(v,{ghost:!0,size:(0,r.unref)(i),type:`primary`,disabled:c.value===`disabled`,onClick:h},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(b)]),_:1},8,[`size`,`disabled`])]),default:(0,r.withCtx)(()=>[n[0]||=(0,r.createTextVNode)(` Редактировать `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),s.value?((0,r.openBlock)(),(0,r.createBlock)(y,{key:2,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(a)},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(v,{ghost:!0,size:(0,r.unref)(i),disabled:s.value===`disabled`,type:`primary`,onClick:m},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(x)]),_:1},8,[`size`,`disabled`])]),default:(0,r.withCtx)(()=>[n[1]||=(0,r.createTextVNode)(` Добавить в корзину `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),p.value?.length>0?((0,r.openBlock)(),(0,r.createBlock)(C,{key:3,options:p.value,size:(0,r.unref)(i),trigger:`click`,onSelect:_},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(v,{ghost:!0,size:(0,r.unref)(i),type:`primary`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(S)]),_:1},8,[`size`])]),_:1},8,[`options`,`size`])):(0,r.createCommentVNode)(``,!0)])}}}),At={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function jt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,At,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.createElementVNode)(`path`,{d:`M12 8v4l2 2`}),(0,r.createElementVNode)(`path`,{d:`M3.05 11a9 9 0 1 1 .5 4m-.5 5v-5h5`})],-1)]])}var Mt=(0,r.markRaw)({name:`tabler-history`,render:jt}),Nt={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Pt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Nt,[...t[0]||=[(0,r.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)]])}var Ft=(0,r.markRaw)({name:`mdi-percent-outline`,render:Pt}),It={class:`flex flex-row gap-1`},Lt={key:0,class:`flex gap-1`},Rt={key:0,class:`flex text-nowrap text-sm line-through`},zt={key:1,class:`flex flex-row text-nowrap text-sm`},Bt={key:2,class:`flex flex-row gap-1 text-nowrap text-sm text-gray-600`},Vt=(0,r.defineComponent)({__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(e){let a=e,s=ue(),c=(0,r.computed)(()=>`product`in a.product),l=(0,r.computed)(()=>`discount`in a.product&&a.product.discount?_e.getFormatEntityName(a.product.discount):``),u=(0,r.computed)(()=>`product`in a.product?a.product.product:a.product),d=(0,r.computed)(()=>(0,n.isNil)(g.value)?``:a.showQuantityUnit?(0,n.compact)([u.value.currency.symbol,u.value.unit.name]).join(`/`):a.showCurrency?u.value.currency.symbol:``),f=(0,r.computed)(()=>a.showQuantityUnit?(0,n.compact)([`₽`,u.value.unit.name]).join(`/`):a.showCurrency?`₽`:``),p=(0,r.computed)(()=>(0,n.find)(u.value.priceCoefficients,[`coefficient.slug`,a.costFieldName])),m=(0,r.computed)(()=>{let e=(0,n.find)(u.value.priceCoefficients,[`coefficient.slug`,`k0`]);return p.value||!e||(0,n.isNil)(g.value)||(0,n.isNil)(e.cost)?!1:g.value<e.cost}),h=(0,t.useBaseConfigStore)().getConfig()?.defaultCurrency??`RUB`,g=(0,r.computed)(()=>p.value?p.value.cost:(0,n.get)(a.product,a.costFieldName)),_=(0,r.computed)(()=>a.additionalThroughFieldName?(0,n.get)(a.product,a.additionalThroughFieldName):void 0),v=(0,r.computed)(()=>u.value.costDate?(0,i.format)(u.value.costDate,(0,t.useBaseConfigStore)().config.dateFormats.uiDate):void 0),y=(0,r.computed)(()=>a.currencyRates||u.value.currency.signature===h?a.currencyRates:{[u.value.currency.signature]:u.value.costRub/u.value.cost}),b=(0,r.computed)(()=>((0,n.isFunction)(a.allowPriceClick)?a.allowPriceClick(u.value):a.allowPriceClick)&&!(0,n.isNil)(g.value)),x=(0,r.computed)(()=>(0,n.isNil)(g.value)?`-`:F.formatMoney(Number.parseFloat(g.value),u.value.currency.precision)),S=(0,r.computed)(()=>{if(u.value.currency.signature===h||!y.value||!y.value[u.value.currency.signature])return null;let e=y.value[u.value.currency.signature];return F.formatMoney(Number.parseFloat(g.value)*e)}),C=(0,r.computed)(()=>(0,n.isNil)(_.value)?null:F.formatMoney(_.value,u.value.currency.precision)),w=(0,r.computed)(()=>{if(!_.value||!g.value||_.value===g.value||g.value===0)return null;let e=(g.value-_.value)/_.value*100;return F.formatPercent(e)});return(t,i)=>{let a=o.NTag,h=o.NTooltip,y=Ft,T=Mt;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,It,[e.showTag?((0,r.openBlock)(),(0,r.createBlock)(h,{key:0},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(a,{round:``,bordered:!1,size:`small`,class:(0,r.normalizeClass)([`text-slate-600`,{"font-bold":!p.value}])},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(p.value?.coefficient.slug??`Ц`),1)]),_:1},8,[`class`])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(p.value?.coefficient.name??`Розничная цена`),1)]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"!text-red-600":m.value})},[_.value&&_.value!==g.value||w.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Lt,[_.value&&_.value!==g.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Rt,(0,r.toDisplayString)(C.value)+` `+(0,r.toDisplayString)(d.value),1)):(0,r.createCommentVNode)(``,!0),w.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:1,class:(0,r.normalizeClass)([`flex text-nowrap text-sm text-gray-600`,{"!text-red-600":m.value}])},` (`+(0,r.toDisplayString)(w.value)+`%) `,3)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)([`whitespace-nowrap text-base flex items-center gap-1`,{"text-gray-600":p.value?.readOnly,"font-bold":!p.value&&!c.value}])},[(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"text-nowrap":!0,"cursor-pointer underline decoration-dashed":b.value&&e.eventEmitter}),onClick:i[0]||=()=>{b.value&&e.eventEmitter?.emit(`cost:click`,{product:u.value,cost:g.value})}},(0,r.toDisplayString)(x.value),3),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(d.value)+` `,1),g.value&&!p.value&&`discount`in e.product&&e.product.discount?((0,r.openBlock)(),(0,r.createBlock)(h,{key:0},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(y,{class:`text-sm text-black bg-amber-400 rounded p-px`})]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,null,` На продукт действует скидка "`+(0,r.toDisplayString)(l.value)+`"; `,1)]),_:1})):(0,r.createCommentVNode)(``,!0)],2),S.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,zt,` ~ `+(0,r.toDisplayString)(S.value)+` `+(0,r.toDisplayString)(f.value),1)):(0,r.createCommentVNode)(``,!0),e.showCostDate&&!(0,r.unref)(n.isNil)(v.value)?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Bt,[(0,r.createTextVNode)((0,r.toDisplayString)(v.value)+` `,1),e.showPriceHistory&&e.eventEmitter?((0,r.openBlock)(),(0,r.createBlock)(h,{key:0,placement:`top-end`,disabled:!(0,r.unref)(s)},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(T,{class:`cursor-pointer`,onClick:i[1]||=t=>e.eventEmitter?.emit(`cost:show-price-history`,{product:u.value})})]),default:(0,r.withCtx)(()=>[i[2]||=(0,r.createTextVNode)(` История цен `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)],2)])}}}),Ht={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Ut(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ht,[...t[0]||=[(0,r.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),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M220 220h32v116`},null,-1),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`32`,d:`M208 340h88`},null,-1),(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M248 130a26 26 0 1 0 26 26a26 26 0 0 0-26-26`},null,-1)]])}var Wt=(0,r.markRaw)({name:`ion-information-circle-outline`,render:Ut}),Gt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Kt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Gt,[...t[0]||=[(0,r.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),(0,r.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)]])}var qt=(0,r.markRaw)({name:`ion-images`,render:Kt}),Jt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Yt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Jt,[...t[0]||=[(0,r.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)]])}var Xt=(0,r.markRaw)({name:`ion-information-circle`,render:Yt}),Zt={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Qt(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Zt,[...t[0]||=[(0,r.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)]])}var $t=(0,r.markRaw)({name:`ion-bookmark`,render:Qt}),en=function(){return en=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},en.apply(this,arguments)},tn={thumbnail:!0,animateThumb:!0,currentPagerPosition:`middle`,alignThumbnails:`middle`,thumbWidth:100,thumbHeight:`80px`,thumbMargin:5,appendThumbnailsTo:`.lg-components`,toggleThumb:!1,enableThumbDrag:!0,enableThumbSwipe:!0,thumbnailSwipeThreshold:10,loadYouTubeThumbnail:!0,youTubeThumbSize:1,thumbnailPluginStrings:{toggleThumbnails:`Toggle thumbnails`}},nn={afterAppendSlide:`lgAfterAppendSlide`,init:`lgInit`,hasVideo:`lgHasVideo`,containerResize:`lgContainerResize`,updateSlides:`lgUpdateSlides`,afterAppendSubHtml:`lgAfterAppendSubHtml`,beforeOpen:`lgBeforeOpen`,afterOpen:`lgAfterOpen`,slideItemLoad:`lgSlideItemLoad`,beforeSlide:`lgBeforeSlide`,afterSlide:`lgAfterSlide`,posterClick:`lgPosterClick`,dragStart:`lgDragStart`,dragMove:`lgDragMove`,dragEnd:`lgDragEnd`,beforeNextSlide:`lgBeforeNextSlide`,beforePrevSlide:`lgBeforePrevSlide`,beforeClose:`lgBeforeClose`,afterClose:`lgAfterClose`,rotateLeft:`lgRotateLeft`,rotateRight:`lgRotateRight`,flipHorizontal:`lgFlipHorizontal`,flipVertical:`lgFlipVertical`,autoplay:`lgAutoplay`,autoplayStart:`lgAutoplayStart`,autoplayStop:`lgAutoplayStop`},rn=function(){function e(e,t){return this.thumbOuterWidth=0,this.thumbTotalWidth=0,this.translateX=0,this.thumbClickable=!1,this.core=e,this.$LG=t,this}return e.prototype.init=function(){this.settings=en(en({},tn),this.core.settings),this.thumbOuterWidth=0,this.thumbTotalWidth=this.core.galleryItems.length*(this.settings.thumbWidth+this.settings.thumbMargin),this.translateX=0,this.setAnimateThumbStyles(),this.core.settings.allowMediaOverlap||(this.settings.toggleThumb=!1),this.settings.thumbnail&&(this.build(),this.settings.animateThumb?(this.settings.enableThumbDrag&&this.enableThumbDrag(),this.settings.enableThumbSwipe&&this.enableThumbSwipe(),this.thumbClickable=!1):this.thumbClickable=!0,this.toggleThumbBar(),this.thumbKeyPress())},e.prototype.build=function(){var e=this;this.setThumbMarkup(),this.manageActiveClassOnSlideChange(),this.$lgThumb.first().on(`click.lg touchend.lg`,function(t){var n=e.$LG(t.target);n.hasAttribute(`data-lg-item-id`)&&setTimeout(function(){if(e.thumbClickable&&!e.core.lgBusy){var t=parseInt(n.attr(`data-lg-item-id`));e.core.slide(t,!1,!0,!1)}},50)}),this.core.LGel.on(nn.beforeSlide+`.thumb`,function(t){var n=t.detail.index;e.animateThumb(n)}),this.core.LGel.on(nn.beforeOpen+`.thumb`,function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth}),this.core.LGel.on(nn.updateSlides+`.thumb`,function(){e.rebuildThumbnails()}),this.core.LGel.on(nn.containerResize+`.thumb`,function(){e.core.lgOpened&&setTimeout(function(){e.thumbOuterWidth=e.core.outer.get().offsetWidth,e.animateThumb(e.core.index),e.thumbOuterWidth=e.core.outer.get().offsetWidth},50)})},e.prototype.setThumbMarkup=function(){var e=`lg-thumb-outer `;this.settings.alignThumbnails&&(e+=`lg-thumb-align-`+this.settings.alignThumbnails);var t=`<div class="`+e+`">
2
2
  <div class="lg-thumb lg-group">
3
3
  </div>
4
- </div>`;this.core.outer.addClass(`lg-has-thumb`),this.settings.appendThumbnailsTo===`.lg-components`?this.core.$lgComponents.append(t):this.core.outer.append(t),this.$thumbOuter=this.core.outer.find(`.lg-thumb-outer`).first(),this.$lgThumb=this.core.outer.find(`.lg-thumb`).first(),this.settings.animateThumb&&this.core.outer.find(`.lg-thumb`).css(`transition-duration`,this.core.settings.speed+`ms`).css(`width`,this.thumbTotalWidth+`px`).css(`position`,`relative`),this.setThumbItemHtml(this.core.galleryItems)},e.prototype.enableThumbDrag=function(){var e=this,t={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},n=!1;this.$thumbOuter.addClass(`lg-grab`),this.core.outer.find(`.lg-thumb`).first().on(`mousedown.lg.thumb`,function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),t.cords.startX=r.pageX,t.startTime=new Date,e.thumbClickable=!1,n=!0,e.core.outer.get().scrollLeft+=1,--e.core.outer.get().scrollLeft,e.$thumbOuter.removeClass(`lg-grab`).addClass(`lg-grabbing`))}),this.$LG(window).on(`mousemove.lg.thumb.global`+this.core.lgId,function(r){e.core.lgOpened&&n&&(t.cords.endX=r.pageX,t=e.onThumbTouchMove(t))}),this.$LG(window).on(`mouseup.lg.thumb.global`+this.core.lgId,function(){e.core.lgOpened&&(t.isMoved?t=e.onThumbTouchEnd(t):e.thumbClickable=!0,n&&(n=!1,e.$thumbOuter.removeClass(`lg-grabbing`).addClass(`lg-grab`)))})},e.prototype.enableThumbSwipe=function(){var e=this,t={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on(`touchstart.lg`,function(n){e.thumbTotalWidth>e.thumbOuterWidth&&(n.preventDefault(),t.cords.startX=n.targetTouches[0].pageX,e.thumbClickable=!1,t.startTime=new Date)}),this.$lgThumb.on(`touchmove.lg`,function(n){e.thumbTotalWidth>e.thumbOuterWidth&&(n.preventDefault(),t.cords.endX=n.targetTouches[0].pageX,t=e.onThumbTouchMove(t))}),this.$lgThumb.on(`touchend.lg`,function(){t.isMoved?t=e.onThumbTouchEnd(t):e.thumbClickable=!0})},e.prototype.rebuildThumbnails=function(){var e=this;this.$thumbOuter.addClass(`lg-rebuilding-thumbnails`),setTimeout(function(){e.thumbTotalWidth=e.core.galleryItems.length*(e.settings.thumbWidth+e.settings.thumbMargin),e.$lgThumb.css(`width`,e.thumbTotalWidth+`px`),e.$lgThumb.empty(),e.setThumbItemHtml(e.core.galleryItems),e.animateThumb(e.core.index)},50),setTimeout(function(){e.$thumbOuter.removeClass(`lg-rebuilding-thumbnails`)},200)},e.prototype.setTranslate=function(e){this.$lgThumb.css(`transform`,`translate3d(-`+e+`px, 0px, 0px)`)},e.prototype.getPossibleTransformX=function(e){return e>this.thumbTotalWidth-this.thumbOuterWidth&&(e=this.thumbTotalWidth-this.thumbOuterWidth),e<0&&(e=0),e},e.prototype.animateThumb=function(e){if(this.$lgThumb.css(`transition-duration`,this.core.settings.speed+`ms`),this.settings.animateThumb){var t=0;switch(this.settings.currentPagerPosition){case`left`:t=0;break;case`middle`:t=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case`right`:t=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*e-1-t,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},e.prototype.onThumbTouchMove=function(e){return e.newTranslateX=this.translateX,e.isMoved=!0,e.touchMoveTime=new Date().valueOf(),e.newTranslateX-=e.cords.endX-e.cords.startX,e.newTranslateX=this.getPossibleTransformX(e.newTranslateX),this.setTranslate(e.newTranslateX),this.$thumbOuter.addClass(`lg-dragging`),e},e.prototype.onThumbTouchEnd=function(e){e.isMoved=!1,e.endTime=new Date,this.$thumbOuter.removeClass(`lg-dragging`);var t=e.endTime.valueOf()-e.startTime.valueOf(),n=e.cords.endX-e.cords.startX,r=Math.abs(n)/t;return r>.15&&e.endTime.valueOf()-e.touchMoveTime<30?(r+=1,r>2&&(r+=1),r+=r*(Math.abs(n)/this.thumbOuterWidth),this.$lgThumb.css(`transition-duration`,Math.min(r-1,2)+`settings`),n*=r,this.translateX=this.getPossibleTransformX(this.translateX-n),this.setTranslate(this.translateX)):this.translateX=e.newTranslateX,Math.abs(e.cords.endX-e.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),e},e.prototype.getThumbHtml=function(e,t,n){var r=this.core.galleryItems[t].__slideVideoInfo||{},i=r.youtube&&this.settings.loadYouTubeThumbnail?`//img.youtube.com/vi/`+r.youtube[1]+`/`+this.settings.youTubeThumbSize+`.jpg`:e,a=document.createElement(`div`);a.setAttribute(`data-lg-item-id`,t+``),a.className=`lg-thumb-item `+(t===this.core.index?`active`:``),a.style.cssText=`width: `+this.settings.thumbWidth+`px; height: `+this.settings.thumbHeight+`; margin-right: `+this.settings.thumbMargin+`px;`;var o=document.createElement(`img`);return o.alt=n||``,o.setAttribute(`data-lg-item-id`,t+``),o.src=i,a.appendChild(o),a},e.prototype.setThumbItemHtml=function(e){for(var t=0;t<e.length;t++){var n=this.getThumbHtml(e[t].thumb,t,e[t].alt);this.$lgThumb.append(n)}},e.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass(`lg-animate-thumb`)},e.prototype.manageActiveClassOnSlideChange=function(){var e=this;this.core.LGel.on(tn.beforeSlide+`.thumb`,function(t){var n=e.core.outer.find(`.lg-thumb-item`),r=t.detail.index;n.removeClass(`active`),n.eq(r).addClass(`active`)})},e.prototype.toggleThumbBar=function(){var e=this;this.settings.toggleThumb&&(this.core.outer.addClass(`lg-can-toggle`),this.core.$toolbar.append(`<button type="button" aria-label="`+this.settings.thumbnailPluginStrings.toggleThumbnails+`" class="lg-toggle-thumb lg-icon"></button>`),this.core.outer.find(`.lg-toggle-thumb`).first().on(`click.lg`,function(){e.core.outer.toggleClass(`lg-components-open`)}))},e.prototype.thumbKeyPress=function(){var e=this;this.$LG(window).on(`keydown.lg.thumb.global`+this.core.lgId,function(t){e.core.lgOpened&&e.settings.toggleThumb&&(t.keyCode===38?(t.preventDefault(),e.core.outer.addClass(`lg-components-open`)):t.keyCode===40&&(t.preventDefault(),e.core.outer.removeClass(`lg-components-open`)))})},e.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(`.lg.thumb.global`+this.core.lgId),this.core.LGel.off(`.lg.thumb`),this.core.LGel.off(`.thumb`),this.$thumbOuter.remove(),this.core.outer.removeClass(`lg-has-thumb`))},e}(),rn=function(){return rn=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},rn.apply(this,arguments)},an={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:`lg-zoom-in`,zoomOut:`lg-zoom-out`},enableZoomAfter:300,zoomPluginStrings:{zoomIn:`Zoom in`,zoomOut:`Zoom out`,viewActualSize:`View actual size`}},on={afterAppendSlide:`lgAfterAppendSlide`,init:`lgInit`,hasVideo:`lgHasVideo`,containerResize:`lgContainerResize`,updateSlides:`lgUpdateSlides`,afterAppendSubHtml:`lgAfterAppendSubHtml`,beforeOpen:`lgBeforeOpen`,afterOpen:`lgAfterOpen`,slideItemLoad:`lgSlideItemLoad`,beforeSlide:`lgBeforeSlide`,afterSlide:`lgAfterSlide`,posterClick:`lgPosterClick`,dragStart:`lgDragStart`,dragMove:`lgDragMove`,dragEnd:`lgDragEnd`,beforeNextSlide:`lgBeforeNextSlide`,beforePrevSlide:`lgBeforePrevSlide`,beforeClose:`lgBeforeClose`,afterClose:`lgAfterClose`,rotateLeft:`lgRotateLeft`,rotateRight:`lgRotateRight`,flipHorizontal:`lgFlipHorizontal`,flipVertical:`lgFlipVertical`,autoplay:`lgAutoplay`,autoplayStart:`lgAutoplayStart`,autoplayStop:`lgAutoplayStop`},sn=500,cn=function(){function e(e,t){return this.core=e,this.$LG=t,this.settings=rn(rn({},an),this.core.settings),this}return e.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?`<button id="`+this.core.getIdName(`lg-zoom-in`)+`" type="button" aria-label="`+this.settings.zoomPluginStrings.zoomIn+`" class="lg-zoom-in lg-icon"></button><button id="`+this.core.getIdName(`lg-zoom-out`)+`" type="button" aria-label="`+this.settings.zoomPluginStrings.zoomOut+`" class="lg-zoom-out lg-icon"></button>`:``;this.settings.actualSize&&(e+=`<button id="`+this.core.getIdName(`lg-actual-size`)+`" type="button" aria-label="`+this.settings.zoomPluginStrings.viewActualSize+`" class="`+this.settings.actualSizeIcons.zoomIn+` lg-icon"></button>`),this.core.outer.addClass(`lg-use-transition-for-zoom`),this.core.$toolbar.first().append(e)},e.prototype.enableZoom=function(e){var t=this,n=this.settings.enableZoomAfter+e.detail.delay;this.$LG(`body`).first().hasClass(`lg-from-hash`)&&e.detail.delay?n=0:this.$LG(`body`).first().removeClass(`lg-from-hash`),this.zoomableTimeout=setTimeout(function(){t.isImageSlide(t.core.index)&&(t.core.getSlideItem(e.detail.index).addClass(`lg-zoomable`),e.detail.index===t.core.index&&t.setZoomEssentials())},n+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(on.slideItemLoad+`.zoom`,this.enableZoom.bind(this))},e.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},e.prototype.getSwipeCords=function(e){return{x:e.touches[0].pageX,y:e.touches[0].pageY}},e.prototype.getDragAllowedAxises=function(e,t){if(!this.containerRect)return{allowX:!1,allowY:!1};var n=this.core.getSlideItem(this.core.index).find(`.lg-image`).first().get(),r=0,i=0,a=n.getBoundingClientRect();e?(r=n.offsetHeight*e,i=n.offsetWidth*e):t?(r=a.height+t*a.height,i=a.width+t*a.width):(r=a.height,i=a.width);var o=r>this.containerRect.height;return{allowX:i>this.containerRect.width,allowY:o}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(e,t,n,r){if(!(!this.containerRect||Math.abs(t)<=0)){var i=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,o,s;e===1&&(this.positionChanged=!1);var c=this.getDragAllowedAxises(0,t),l=c.allowY,u=c.allowX;this.positionChanged&&=(o=this.left/(this.scale-t),s=this.top/(this.scale-t),this.pageX=i-o,this.pageY=a-s,!1);var d=this.getPossibleSwipeDragCords(t),f,p,m=i-this.pageX,h=a-this.pageY;if(e-t>1){var g=(e-t)/Math.abs(t);m=(t<0?-m:m)+this.left*(g+(t<0?-1:1)),h=(t<0?-h:h)+this.top*(g+(t<0?-1:1)),f=m/g,p=h/g}else{var g=(e-t)*t;f=m*g,p=h*g}n&&(u?this.isBeyondPossibleLeft(f,d.minX)?f=d.minX:this.isBeyondPossibleRight(f,d.maxX)&&(f=d.maxX):e>1&&(f<d.minX?f=d.minX:f>d.maxX&&(f=d.maxX)),l?this.isBeyondPossibleTop(p,d.minY)?p=d.minY:this.isBeyondPossibleBottom(p,d.maxY)&&(p=d.maxY):e>1&&(p<d.minY?p=d.minY:p>d.maxY&&(p=d.maxY))),this.setZoomStyles({x:f,y:p,scale:e}),this.left=f,this.top=p,r&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var t=this.core.getSlideItem(e).find(`.lg-image`).first();this.imageReset=!1,t.removeClass(`reset-transition reset-transition-y reset-transition-x`),this.core.outer.removeClass(`lg-actual-size`),t.css(`width`,`auto`).css(`height`,`auto`),setTimeout(function(){t.removeClass(`no-transition`)},10)}},e.prototype.setZoomImageSize=function(){var e=this,t=this.core.getSlideItem(this.core.index).find(`.lg-image`).first();setTimeout(function(){var n=e.getCurrentImageActualSizeScale();e.scale>=n&&(t.addClass(`no-transition`),e.imageReset=!0)},sn),setTimeout(function(){var n=e.getCurrentImageActualSizeScale();if(e.scale>=n){var r=e.getDragAllowedAxises(e.scale);t.css(`width`,t.get().naturalWidth+`px`).css(`height`,t.get().naturalHeight+`px`),e.core.outer.addClass(`lg-actual-size`),r.allowX&&r.allowY?t.addClass(`reset-transition`):r.allowX&&!r.allowY?t.addClass(`reset-transition-x`):!r.allowX&&r.allowY&&t.addClass(`reset-transition-y`)}},sn+50)},e.prototype.setZoomStyles=function(e){var t=this.core.getSlideItem(this.core.index).find(`.lg-img-wrap`).first(),n=this.core.getSlideItem(this.core.index).find(`.lg-image`).first(),r=this.core.outer.find(`.lg-current .lg-dummy-img`).first();this.scale=e.scale,n.css(`transform`,`scale3d(`+e.scale+`, `+e.scale+`, 1)`),r.css(`transform`,`scale3d(`+e.scale+`, `+e.scale+`, 1)`);var i=`translate3d(`+e.x+`px, `+e.y+`px, 0)`;t.css(`transform`,i)},e.prototype.setActualSize=function(e,t){var n=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var r=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(r.src&&!n.core.outer.hasClass(`lg-first-slide-loading`)){var e=n.getCurrentImageActualSizeScale(),i=n.scale;n.scale=n.core.outer.hasClass(`lg-zoomed`)?1:n.getScale(e),n.setPageCords(t),n.beginZoom(n.scale),n.zoomImage(n.scale,n.scale-i,!0,!0)}},50),setTimeout(function(){n.core.outer.removeClass(`lg-grabbing`).addClass(`lg-grab`)},60),setTimeout(function(){n.zoomInProgress=!1},sn+110)}},e.prototype.getNaturalWidth=function(e){var t=this.core.getSlideItem(e).find(`.lg-image`).first(),n=this.core.galleryItems[e].width;return n?parseFloat(n):t.get().naturalWidth},e.prototype.getActualSizeScale=function(e,t){var n,r;return e>=t?(n=e/t,r=n||2):r=1,r},e.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(`.lg-image`).first().get().offsetWidth,t=this.getNaturalWidth(this.core.index)||e;return this.getActualSizeScale(t,e)},e.prototype.getPageCords=function(e){var t={};if(e)t.x=e.pageX||e.touches[0].pageX,t.y=e.pageY||e.touches[0].pageY;else{var n=this.core.$content.get().getBoundingClientRect();t.x=n.width/2+n.left,t.y=n.height/2+this.scrollTop+n.top}return t},e.prototype.setPageCords=function(e){var t=this.getPageCords(e);this.pageX=t.x,this.pageY=t.y},e.prototype.manageActualPixelClassNames=function(){this.core.getElementById(`lg-actual-size`).removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(e){return this.core.outer.removeClass(`lg-zoom-drag-transition lg-zoom-dragging`),e>1?(this.core.outer.addClass(`lg-zoomed`),this.manageActualPixelClassNames()):this.resetZoom(),e>1},e.prototype.getScale=function(e){var t=this.getCurrentImageActualSizeScale();return e<1?e=1:e>t&&(e=t),e},e.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var t=null;this.core.outer.on(`dblclick.lg`,function(t){e.$LG(t.target).hasClass(`lg-image`)&&e.setActualSize(e.core.index,t)}),this.core.outer.on(`touchstart.lg`,function(n){var r=e.$LG(n.target);n.touches.length===1&&r.hasClass(`lg-image`)&&(t?(clearTimeout(t),t=null,n.preventDefault(),e.setActualSize(e.core.index,n)):t=setTimeout(function(){t=null},300))}),this.core.LGel.on(on.containerResize+`.zoom `+on.rotateRight+`.zoom `+on.rotateLeft+`.zoom `+on.flipHorizontal+`.zoom `+on.flipVertical+`.zoom`,function(){if(e.core.lgOpened&&e.isImageSlide(e.core.index)&&!e.core.touchAction){var t=e.core.getSlideItem(e.core.index).find(`.lg-img-wrap`).first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(t,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on(`scroll.lg.zoom.global`+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById(`lg-zoom-out`).on(`click.lg`,function(){if(e.isImageSlide(e.core.index)){var t=0;e.imageReset&&(e.resetImageTranslate(e.core.index),t=50),setTimeout(function(){var t=e.scale-e.settings.scale;t<1&&(t=1),e.beginZoom(t),e.zoomImage(t,-e.settings.scale,!0,!e.settings.infiniteZoom)},t)}}),this.core.getElementById(`lg-zoom-in`).on(`click.lg`,function(){e.zoomIn()}),this.core.getElementById(`lg-actual-size`).on(`click.lg`,function(){e.setActualSize(e.core.index)}),this.core.LGel.on(on.beforeOpen+`.zoom`,function(){e.core.outer.find(`.lg-item`).removeClass(`lg-zoomable`)}),this.core.LGel.on(on.afterOpen+`.zoom`,function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(on.afterSlide+`.zoom`,function(t){var n=t.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(n),e.resetImageTranslate(n),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(e){this.core.outer.removeClass(`lg-zoomed lg-zoom-drag-transition`);var t=this.core.getElementById(`lg-actual-size`),n=this.core.getSlideItem(e===void 0?this.core.index:e);t.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),n.find(`.lg-img-wrap`).first().removeAttr(`style`),n.find(`.lg-image`).first().removeAttr(`style`),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},e.prototype.pinchZoom=function(){var e=this,t=0,n=!1,r=1,i=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on(`touchstart.lg`,function(n){if(a=e.core.getSlideItem(e.core.index),e.isImageSlide(e.core.index)&&n.touches.length===2){if(n.preventDefault(),e.core.outer.hasClass(`lg-first-slide-loading`))return;r=e.scale||1,e.core.outer.removeClass(`lg-zoom-drag-transition lg-zoom-dragging`),e.setPageCords(n),e.resetImageTranslate(e.core.index),e.core.touchAction=`pinch`,t=e.getTouchDistance(n)}}),this.core.$inner.on(`touchmove.lg`,function(o){if(o.touches.length===2&&e.core.touchAction===`pinch`&&(e.$LG(o.target).hasClass(`lg-item`)||a.get().contains(o.target))){o.preventDefault();var s=e.getTouchDistance(o),c=t-s;if(!n&&Math.abs(c)>5&&(n=!0),n){i=e.scale;var l=Math.max(1,r+-c*.02);e.scale=Math.round((l+2**-52)*100)/100;var u=e.scale-i;e.zoomImage(e.scale,Math.round((u+2**-52)*100)/100,!1,!1)}}}),this.core.$inner.on(`touchend.lg`,function(r){if(e.core.touchAction===`pinch`&&(e.$LG(r.target).hasClass(`lg-item`)||a.get().contains(r.target))){if(n=!1,t=0,e.scale<=1)e.resetZoom();else{var i=e.getCurrentImageActualSizeScale();if(e.scale>=i){var o=i-e.scale;o===0&&(o=.01),e.zoomImage(i,o,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass(`lg-zoomed`)}e.core.touchAction=void 0}})},e.prototype.touchendZoom=function(e,t,n,r,i){var a=t.x-e.x,o=t.y-e.y,s=Math.abs(a)/i+1,c=Math.abs(o)/i+1;s>2&&(s+=1),c>2&&(c+=1),a*=s,o*=c;var l=this.core.getSlideItem(this.core.index).find(`.lg-img-wrap`).first(),u={};u.x=this.left+a,u.y=this.top+o;var d=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(o)>15)&&(r&&(this.isBeyondPossibleTop(u.y,d.minY)?u.y=d.minY:this.isBeyondPossibleBottom(u.y,d.maxY)&&(u.y=d.maxY)),n&&(this.isBeyondPossibleLeft(u.x,d.minX)?u.x=d.minX:this.isBeyondPossibleRight(u.x,d.maxX)&&(u.x=d.maxX)),r?this.top=u.y:u.y=this.top,n?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(l,u),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(e,t,n,r,i){var a={};if(r){if(a.y=this.top+(t.y-e.y),this.isBeyondPossibleTop(a.y,i.minY)){var o=i.minY-a.y;a.y=i.minY-o/6}else if(this.isBeyondPossibleBottom(a.y,i.maxY)){var s=a.y-i.maxY;a.y=i.maxY+s/6}}else a.y=this.top;if(n){if(a.x=this.left+(t.x-e.x),this.isBeyondPossibleLeft(a.x,i.minX)){var c=i.minX-a.x;a.x=i.minX-c/6}else if(this.isBeyondPossibleRight(a.x,i.maxX)){var l=a.x-i.maxX;a.x=i.maxX+l/6}}else a.x=this.left;return a},e.prototype.isBeyondPossibleLeft=function(e,t){return e>=t},e.prototype.isBeyondPossibleRight=function(e,t){return e<=t},e.prototype.isBeyondPossibleTop=function(e,t){return e>=t},e.prototype.isBeyondPossibleBottom=function(e,t){return e<=t},e.prototype.isImageSlide=function(e){var t=this.core.galleryItems[e];return this.core.getSlideType(t)===`image`},e.prototype.getPossibleSwipeDragCords=function(e){var t=this.core.getSlideItem(this.core.index).find(`.lg-image`).first(),n=this.core.mediaContainerPosition.bottom,r=t.get().getBoundingClientRect(),i=r.height,a=r.width;return e&&(i+=e*i,a+=e*a),{minY:(i-this.containerRect.height)/2,maxY:(this.containerRect.height-i)/2+n,minX:(a-this.containerRect.width)/2,maxX:(this.containerRect.width-a)/2}},e.prototype.setZoomSwipeStyles=function(e,t){e.css(`transform`,`translate3d(`+t.x+`px, `+t.y+`px, 0)`)},e.prototype.zoomSwipe=function(){var e=this,t={},n={},r=!1,i=!1,a=!1,o=new Date,s=new Date,c,l,u=this.core.getSlideItem(this.core.index);this.core.$inner.on(`touchstart.lg`,function(n){if(e.isImageSlide(e.core.index)&&(u=e.core.getSlideItem(e.core.index),(e.$LG(n.target).hasClass(`lg-item`)||u.get().contains(n.target))&&n.touches.length===1&&e.core.outer.hasClass(`lg-zoomed`))){n.preventDefault(),o=new Date,e.core.touchAction=`zoomSwipe`,l=e.core.getSlideItem(e.core.index).find(`.lg-img-wrap`).first();var r=e.getDragAllowedAxises(0);a=r.allowY,i=r.allowX,(i||a)&&(t=e.getSwipeCords(n)),c=e.getPossibleSwipeDragCords(),e.core.outer.addClass(`lg-zoom-dragging lg-zoom-drag-transition`)}}),this.core.$inner.on(`touchmove.lg`,function(o){if(o.touches.length===1&&e.core.touchAction===`zoomSwipe`&&(e.$LG(o.target).hasClass(`lg-item`)||u.get().contains(o.target))){o.preventDefault(),e.core.touchAction=`zoomSwipe`,n=e.getSwipeCords(o);var s=e.getZoomSwipeCords(t,n,i,a,c);(Math.abs(n.x-t.x)>15||Math.abs(n.y-t.y)>15)&&(r=!0,e.setZoomSwipeStyles(l,s))}}),this.core.$inner.on(`touchend.lg`,function(c){if(e.core.touchAction===`zoomSwipe`&&(e.$LG(c.target).hasClass(`lg-item`)||u.get().contains(c.target))){if(c.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass(`lg-zoom-dragging`),!r)return;r=!1,s=new Date;var l=s.valueOf()-o.valueOf();e.touchendZoom(t,n,i,a,l)}})},e.prototype.zoomDrag=function(){var e=this,t={},n={},r=!1,i=!1,a=!1,o=!1,s,c,l,u;this.core.outer.on(`mousedown.lg.zoom`,function(n){if(e.isImageSlide(e.core.index)){var i=e.core.getSlideItem(e.core.index);if(e.$LG(n.target).hasClass(`lg-item`)||i.get().contains(n.target)){s=new Date,u=e.core.getSlideItem(e.core.index).find(`.lg-img-wrap`).first();var c=e.getDragAllowedAxises(0);o=c.allowY,a=c.allowX,e.core.outer.hasClass(`lg-zoomed`)&&e.$LG(n.target).hasClass(`lg-object`)&&(a||o)&&(n.preventDefault(),t=e.getDragCords(n),l=e.getPossibleSwipeDragCords(),r=!0,e.core.outer.removeClass(`lg-grab`).addClass(`lg-grabbing lg-zoom-drag-transition lg-zoom-dragging`))}}}),this.$LG(window).on(`mousemove.lg.zoom.global`+this.core.lgId,function(s){if(r){i=!0,n=e.getDragCords(s);var c=e.getZoomSwipeCords(t,n,a,o,l);e.setZoomSwipeStyles(u,c)}}),this.$LG(window).on(`mouseup.lg.zoom.global`+this.core.lgId,function(l){if(r){if(c=new Date,r=!1,e.core.outer.removeClass(`lg-zoom-dragging`),i&&(t.x!==n.x||t.y!==n.y)){n=e.getDragCords(l);var u=c.valueOf()-s.valueOf();e.touchendZoom(t,n,a,o,u)}i=!1}e.core.outer.removeClass(`lg-grabbing`).addClass(`lg-grab`)})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.prototype.destroy=function(){this.$LG(window).off(`.lg.zoom.global`+this.core.lgId),this.core.LGel.off(`.lg.zoom`),this.core.LGel.off(`.zoom`),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},e}(),ln={ref:`gallery-container`,class:`lightgallery-wrapper`},un=(0,r.defineComponent)({__name:`lightgallery`,props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(e){let t=e,i={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.onFlipVertical},a=(0,r.useTemplateRef)(`gallery-container`),o=(0,r.ref)(null);return(0,r.onMounted)(async()=>{if(!a.value)return;let e=await import(`lightgallery`);o.value=e.default(a.value,{...t.settings}),(0,n.forOwn)(i,(e,t)=>{e&&a.value?.addEventListener(t,e)})}),(0,r.onBeforeUnmount)(()=>{o.value&&=(o.value?.destroy(),null)}),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ln,[(0,r.renderSlot)(e.$slots,`default`)],512))}}),dn=[`href`],fn=[`src`,`alt`],pn=(0,r.defineComponent)({__name:`image-gallery`,props:{images:{}},setup(e,{expose:t}){let n=(0,r.ref)(!1),i=(0,r.ref)(!1),a=(0,r.ref)({plugins:[nn,cn],addClass:`sc-lg-container`,licenseKey:`0000-0000-000-0000`,strings:{closeGallery:`Закрыть`,download:`Скачать`,mediaLoadingFailed:`Ошибка загрузки контента...`,nextSlide:`Следующее изображение`,playVideo:`Воспроизвести видео`,previousSlide:`Предыдущее изображение`,toggleMaximize:`Расширить`}}),s=()=>window.innerWidth*(F.getDeviceTypeByResolution()===P.phone?.7:.8),c=(0,r.ref)(s()),l=()=>{c.value=s()};return(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,l)}),t({show:()=>{n.value=!0}}),window.addEventListener(`resize`,l),(t,s)=>{let l=Kt,u=o.NPopover;return(0,r.openBlock)(),(0,r.createBlock)(u,{trigger:`manual`,show:n.value,class:`sc-image`,placement:`top-start`,onClickoutside:s[3]||=()=>{i.value||(n.value=!1)}},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:`inline-flex`,onClick:s[0]||=e=>n.value=!n.value},[(0,r.renderSlot)(t.$slots,`default`,{},()=>[(0,r.createVNode)(l)])])]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(un,{settings:a.value,style:(0,r.normalizeStyle)(`max-width: ${c.value}px`),class:`flex flex-row overflow-x-scroll`,onAfterOpen:s[1]||=()=>{i.value=!0},onAfterClose:s[2]||=()=>{i.value=!1,n.value=!1}},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.images,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:t,href:e.image},[(0,r.createElementVNode)(`img`,{src:e.preview,alt:`Изображение #${t+1}`},null,8,fn)],8,dn))),128))]),_:1},8,[`settings`,`style`])]),_:3},8,[`show`])}}}),mn={class:`text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline`},hn={class:`pr-3`},gn={class:`text-right`},_n=(0,r.defineComponent)({__name:`product-stock-count`,props:{product:{}},setup(e){return(t,n)=>{let i=Ut,a=o.NPopover;return(0,r.openBlock)(),(0,r.createBlock)(a,{trigger:`click`,placement:`top-start`,class:`sc-stock-count`},{trigger:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`,{},()=>[(0,r.createVNode)(i)])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,mn,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.product.stockCount,(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:n},[(0,r.createElementVNode)(`span`,hn,(0,r.toDisplayString)(t.warehouse.name),1),(0,r.createElementVNode)(`span`,gn,[(0,r.createTextVNode)((0,r.toDisplayString)(t.count??`В наличии`)+` `,1),t.count?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createTextVNode)((0,r.toDisplayString)(e.product.unit.name),1)],64)):(0,r.createCommentVNode)(``,!0)])],64))),128))])]),_:3})}}}),vn=[`innerHTML`],yn=[`innerHTML`],bn={class:`m-0 flex list-none flex-col gap-1 p-0 text-sm`},xn=[`href`],Sn={key:1,class:`text-sm text-gray-500`},Cn=(0,r.defineComponent)({__name:`product-info-content`,props:{product:{},size:{default:`medium`},maxHeight:{default:void 0},activeTab:{default:void 0}},setup(e){let t=e,n=(0,r.computed)(()=>t.maxHeight?{maxHeight:t.maxHeight}:void 0),i=(0,r.computed)(()=>t.product.properties?.description??``),a=(0,r.computed)(()=>t.product.properties?.specification??``),s=(0,r.computed)(()=>De(t.product)),c=(0,r.computed)(()=>[i.value?`description`:null,a.value?`specification`:null,s.value.length>0?`files`:null].filter(e=>e!==null)),l=(0,r.ref)(t.activeTab&&c.value.includes(t.activeTab)?t.activeTab:c.value[0]);return(t,u)=>{let d=o.NScrollbar,f=o.NTabPane,p=o.NTabs;return c.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(p,{key:0,value:l.value,"onUpdate:value":u[0]||=e=>l.value=e,size:e.size,type:`line`,class:`sc-product-info-content`},{default:(0,r.withCtx)(()=>[i.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:0,name:`description`,tab:`Описание`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(d,{style:(0,r.normalizeStyle)(n.value)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:`sc-product-info-html`,innerHTML:i.value},null,8,vn)]),_:1},8,[`style`])]),_:1})):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:1,name:`specification`,tab:`Характеристики`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(d,{style:(0,r.normalizeStyle)(n.value)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:`sc-product-info-html`,innerHTML:a.value},null,8,yn)]),_:1},8,[`style`])]),_:1})):(0,r.createCommentVNode)(``,!0),s.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(f,{key:2,name:`files`,tab:`Файлы (${s.value.length})`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(d,{style:(0,r.normalizeStyle)(n.value)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`ul`,bn,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:e.id},[(0,r.createElementVNode)(`a`,{href:e.url,target:`_blank`,rel:`noopener`},(0,r.toDisplayString)(e.typeName),9,xn)]))),128))])]),_:1},8,[`style`])]),_:1},8,[`tab`])):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`value`,`size`])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Sn,` Описание, характеристики и файлы не заданы. `))}}}),wn={key:0,class:`flex flex-row gap-2.5`},Tn={key:1,class:`flex flex-row flex-wrap justify-end gap-2.5`},En=(0,r.defineComponent)({__name:`base-dialog`,props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:`small`,scale:.98},tablet:{size:`small`,scale:.9},default:{size:`medium`,scale:.7}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:`ОК`})},cancelButton:{default:()=>({show:!0,text:`Отмена`})},trapFocus:{type:Boolean,default:!0}},emits:[`update:show`,`opening`,`closing`,`accept`,`processing:cancel`],setup(e,{expose:t,emit:n}){let i=e,a=n,s=(0,r.ref)(i.show),c=(0,r.ref)(i.processing),l=F.initRefDependingOnDeviceResolution(i.sizes.phone.size,i.sizes.tablet.size,i.sizes.default.size),u=F.initRefDependingOnDeviceResolution(i.sizes.phone.scale,i.sizes.tablet.scale,i.sizes.default.scale),d=(0,r.computed)(()=>i.modalWidth??window.innerWidth*u.value),f=()=>{a(`opening`),s.value=!0,a(`update:show`,s.value)},p=(e=`other`,t=!1)=>{if(c.value&&!t){a(`processing:cancel`,e=>{c.value=e});return}let n=!1;a(`closing`,e,()=>{n=!0}),n||(s.value=!1,a(`update:show`,s.value))},m=()=>{a(`accept`,e=>{c.value=e})};return(0,r.watch)(()=>i.show,e=>{e?f():p(`other`,!0)}),(0,r.watch)(()=>i.processing,e=>{c.value=e}),t({open:f,close:p,acceptHandler:m}),(t,n)=>{let i=o.NButton,a=o.NModal;return(0,r.openBlock)(),(0,r.createBlock)(a,{loading:c.value,show:s.value,"show-icon":!1,size:(0,r.unref)(l),style:(0,r.normalizeStyle)(`width: ${d.value}px`),title:e.title,"trap-focus":e.trapFocus??!0,"action-class":t.$slots[`extra-action`]?`grid grid-cols-2 !justify-between`:void 0,preset:`dialog`,onClose:n[1]||=e=>p(`header`),onEsc:n[2]||=e=>p(`esc`),onMaskClick:n[3]||=e=>p(`mask`)},(0,r.createSlots)({default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`)]),_:2},[t.$slots.header?{name:`header`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`header`)]),key:`0`}:void 0,t.$slots.action||t.$slots[`extra-action`]||e.acceptButton.show||e.cancelButton.show?{name:`action`,fn:(0,r.withCtx)(()=>[t.$slots[`extra-action`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,wn,[(0,r.renderSlot)(t.$slots,`extra-action`)])):(0,r.createCommentVNode)(``,!0),t.$slots.action||e.acceptButton.show||e.cancelButton.show?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Tn,[(0,r.renderSlot)(t.$slots,`action`,{disabled:c.value}),e.acceptButton.show??!0?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,disabled:c.value||!e.valid,loading:c.value,size:(0,r.unref)(l),type:`primary`,onClick:m},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.acceptButton.text??`ОК`),1)]),_:1},8,[`disabled`,`loading`,`size`])):(0,r.createCommentVNode)(``,!0),e.cancelButton.show??!0?((0,r.openBlock)(),(0,r.createBlock)(i,{key:1,disabled:c.value,size:(0,r.unref)(l),type:`default`,onClick:n[0]||=e=>p(`footer`)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.cancelButton.text??`Отмена`),1)]),_:1},8,[`disabled`,`size`])):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)]),key:`1`}:void 0]),1032,[`loading`,`show`,`size`,`style`,`title`,`trap-focus`,`action-class`])}}}),Dn={class:`flex flex-col gap-3`},On={class:`text-xs text-gray-500`},kn=(0,r.defineComponent)({__name:`product-info-dialog`,props:{product:{},show:{type:Boolean,default:!1},activeTab:{default:void 0}},emits:[`update:show`],setup(e,{emit:t}){let n=t,i=()=>{n(`update:show`,!1)};return(t,n)=>((0,r.openBlock)(),(0,r.createBlock)(En,{show:e.show,title:e.product.name,"accept-button":{show:!1},"cancel-button":{show:!0,text:`Закрыть`},"trap-focus":!1,onClosing:i},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Dn,[(0,r.createElementVNode)(`span`,On,`Артикул: `+(0,r.toDisplayString)(e.product.code),1),(0,r.createVNode)(Cn,{product:e.product,"active-tab":e.activeTab,"max-height":`60vh`},null,8,[`product`,`active-tab`])])]),_:1},8,[`show`,`title`]))}}),An={class:`flex flex-col gap-2`},jn={class:`flex justify-end border-0 border-t border-solid border-gray-200 pt-2`},Mn=(0,r.defineComponent)({__name:`product-info-popover`,props:{product:{}},setup(e){let t=(0,r.ref)(!1),n=(0,r.ref)(!1),i=(0,r.ref)(!1),a=()=>{t.value=!1,n.value=!0,i.value=!0};return(s,c)=>{let l=Ut,u=o.NButton,d=o.NPopover;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(d,{show:t.value,"onUpdate:show":c[0]||=e=>t.value=e,width:560,style:{maxWidth:`calc(100vw - 2rem)`},trigger:`click`,placement:`bottom-start`,class:`sc-product-info-popover`},{trigger:(0,r.withCtx)(()=>[(0,r.renderSlot)(s.$slots,`default`,{},()=>[(0,r.createVNode)(l,{title:`Описание и характеристики`,class:`cursor-pointer`})])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,An,[(0,r.createVNode)(Cn,{product:e.product,size:`small`,"max-height":`16rem`},null,8,[`product`]),(0,r.createElementVNode)(`div`,jn,[(0,r.createVNode)(u,{text:``,type:`info`,size:`small`,onClick:a},{default:(0,r.withCtx)(()=>[...c[2]||=[(0,r.createTextVNode)(` Открыть полностью `,-1)]]),_:1})])])]),_:3},8,[`show`]),n.value?((0,r.openBlock)(),(0,r.createBlock)(kn,{key:0,show:i.value,"onUpdate:show":c[1]||=e=>i.value=e,product:e.product},null,8,[`show`,`product`])):(0,r.createCommentVNode)(``,!0)],64)}}}),Nn={class:`flex flex-row justify-between`},Pn={key:0,class:`inline-flex flex-row gap-0.5 mr-2 align-sub`},Fn={key:1},In={class:`ml-2 align-sub`},Ln={class:`flex cursor-pointer flex-row gap-2 whitespace-nowrap`},Rn={key:2,class:`ml-2 align-sub`},zn={class:`@container`},Bn={class:`text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm`},Vn={key:0,class:`sc-supplier-sku col-span-full whitespace-nowrap text-wrap`},Hn={class:`text-sc-dark-grey`},Un={key:1,class:`sc-product-code col-start-1 whitespace-nowrap`},Wn={class:`text-gray-600`},Gn={class:`flex cursor-pointer flex-row gap-1 whitespace-nowrap`},Kn={key:3,class:`underline decoration-dashed`},qn={key:4,class:`sc-product-pack whitespace-nowrap`},Jn={class:`text-gray-600`},Yn={key:5,class:`sc-product-planning-incoming-date col-span-full mt-1.5 text-wrap`},Xn={class:`text-gray-600`},Zn={key:0,class:`mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg`},Qn={key:0},$n={class:`sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500`},er=(0,r.defineComponent)({__name:`product-name`,props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showProductInfoButton:{type:[Boolean,Function],default:!1},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showAdditionalSaleIcon:{type:Boolean,default:!1},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){let i=e,a=(0,r.computed)(()=>(0,n.isFunction)(i.showProductCosts)?i.showProductCosts(i.product):i.showProductCosts),s=(0,r.computed)(()=>(0,n.sortBy)(i.product.priceCoefficients,[`coefficient.slug`])),c=(0,r.computed)(()=>i.product?.properties?.planingIncomingDate),l=(0,r.useTemplateRef)(`image-gallery`),u=()=>{l.value?.show()},d=(0,r.computed)(()=>(0,n.isFunction)(i.allowNameClick)?i.allowNameClick(i.product):i.allowNameClick),f=(0,r.computed)(()=>((0,n.isFunction)(i.showProductInfoButton)?i.showProductInfoButton(i.product):i.showProductInfoButton)&&Oe(i.product)),p=(0,r.computed)(()=>i.showProductAddToCartButton||i.showProductEditButton||i.showProductRequiredButton||(i.productContextButtonsConfig?.length??0)>0),m=()=>{d.value&&i.eventEmitter?.emit(`product:name-click`,{product:i.product,exposedMethods:{showProductImagesPreview:u}})};return t({showProductImagesPreview:u}),(t,n)=>{let i=Qt,l=o.NTooltip,u=Ct,h=Yt,g=Kt,_=o.NText,v=Ot,y=Ut,b=o.NScrollbar;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[(0,r.createElementVNode)(`div`,Nn,[(0,r.createVNode)(_,{type:`info`,class:`sc-product-name text-balance text-base font-medium text-black`},{default:(0,r.withCtx)(()=>[e.product?.isFavorite||e.product?.isPreviouslyOrdered||e.showAdditionalSaleIcon?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Pn,[e.product?.isFavorite??!1?((0,r.openBlock)(),(0,r.createBlock)(l,{key:0,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{class:`!text-yellow-300`})]),default:(0,r.withCtx)(()=>[n[0]||=(0,r.createTextVNode)(` Избранный товар `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0),e.product?.isPreviouslyOrdered??!1?((0,r.openBlock)(),(0,r.createBlock)(l,{key:1,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(u,{class:`!text-green-700`})]),default:(0,r.withCtx)(()=>[n[1]||=(0,r.createTextVNode)(` Ранее заказанный товар `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0),e.showAdditionalSaleIcon?((0,r.openBlock)(),(0,r.createBlock)(l,{key:2,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(h,{class:`!text-green-500`})]),default:(0,r.withCtx)(()=>[n[2]||=(0,r.createTextVNode)(` Дополнительная продажа `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"cursor-pointer":d.value&&e.eventEmitter,"text-gray-400 line-through":e.product.isHidden}),onClick:m},(0,r.toDisplayString)(e.product.name),3),e.product.onOrder?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Fn,` [Под заказ] `)):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,In,[e.product.images&&e.product.images.length>0?((0,r.openBlock)(),(0,r.createBlock)(pn,{key:0,ref:`image-gallery`,images:e.product.images},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Ln,[(0,r.createVNode)(g)])]),_:1},8,[`images`])):(0,r.createCommentVNode)(``,!0)]),f.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Rn,[(0,r.createVNode)(Mn,{product:e.product},null,8,[`product`])])):(0,r.createCommentVNode)(``,!0)]),_:1}),p.value?((0,r.openBlock)(),(0,r.createBlock)(v,{key:0,product:e.product,"event-emitter":e.eventEmitter,"show-product-add-to-cart-button":e.showProductAddToCartButton,"show-product-edit-button":e.showProductEditButton,"show-product-required-button":e.showProductRequiredButton,"product-context-buttons-config":e.productContextButtonsConfig},null,8,[`product`,`event-emitter`,`show-product-add-to-cart-button`,`show-product-edit-button`,`show-product-required-button`,`product-context-buttons-config`])):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,zn,[(0,r.createElementVNode)(`div`,Bn,[e.product.supplierSku?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Vn,[n[3]||=(0,r.createTextVNode)(` Артикул производителя/поставщика: `,-1),(0,r.createElementVNode)(`span`,Hn,(0,r.toDisplayString)(e.product.supplierSku),1)])):(0,r.createCommentVNode)(``,!0),e.showCode?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Un,[n[4]||=(0,r.createTextVNode)(` Артикул: `,-1),(0,r.createElementVNode)(`span`,Wn,(0,r.toDisplayString)(e.product.code),1)])):(0,r.createCommentVNode)(``,!0),e.product.stockCount&&e.product.stockCount.length>0?((0,r.openBlock)(),(0,r.createBlock)(_n,{key:2,product:e.product},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Gn,[n[5]||=(0,r.createElementVNode)(`span`,{class:`underline decoration-dashed`},`В наличии`,-1),(0,r.createVNode)(y,{class:`mt-0.5`})])]),_:1},8,[`product`])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Kn,` Нет в наличии `)),e.product.pack??e.product?.properties?.pack?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,qn,[n[6]||=(0,r.createTextVNode)(` Норма упаковки: `,-1),(0,r.createElementVNode)(`span`,Jn,(0,r.toDisplayString)(e.product.pack??e.product?.properties?.pack),1)])):(0,r.createCommentVNode)(``,!0),e.showPlanningDates&&c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Yn,[n[7]||=(0,r.createTextVNode)(` Планируемая дата поступления на основной склад: `,-1),(0,r.createElementVNode)(`span`,Xn,(0,r.toDisplayString)(c.value),1)])):(0,r.createCommentVNode)(``,!0)])]),(0,r.createVNode)(b,{"x-scrollable":``},{default:(0,r.withCtx)(()=>[a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Zn,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value,t=>((0,r.openBlock)(),(0,r.createBlock)(Bt,{key:t.coefficient.slug,product:e.product,"cost-field-name":t.coefficient.slug??``,"event-emitter":e.eventEmitter,"allow-price-click":e.allowPriceClick,"show-tag":!0,"show-price-history":e.showPriceHistory,"currency-rates":e.currencyRates},null,8,[`product`,`cost-field-name`,`event-emitter`,`allow-price-click`,`show-price-history`,`currency-rates`]))),128)),(0,r.createVNode)(Bt,{product:e.product,"event-emitter":e.eventEmitter,"allow-price-click":e.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":e.showCostDate,"show-price-history":e.showPriceHistory,"currency-rates":e.currencyRates,"cost-field-name":`cost`,"additional-through-field-name":`retailCost`,style:{"background-color":`var(--n-merged-td-color)`},class:`sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2`},null,8,[`product`,`event-emitter`,`allow-price-click`,`show-cost-date`,`show-price-history`,`currency-rates`])])):(0,r.createCommentVNode)(``,!0)]),_:1}),e.showSlugs||e.showProperties?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Qn,[(0,r.createElementVNode)(`ul`,$n,[e.showSlugs?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)({id:e.product.id,slug:e.product.slug},(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:t},` (`+(0,r.toDisplayString)(t)+`): `+(0,r.toDisplayString)(e),1))),128)):(0,r.createCommentVNode)(``,!0),e.showProperties?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(e.product.properties,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:t},` (`+(0,r.toDisplayString)(t)+`): `+(0,r.toDisplayString)(e),1))),128)):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0)])}}}),tr=(e,t,n)=>({key:e,title:t,className:`align-top`,resizable:!0,render:t=>(0,r.h)(Bt,{product:t,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),nr=(e,t)=>{if(e.length===0)return[];let i=[],a={};switch((0,n.isNil)(t.isProductItemSelected)||i.push({key:`checkbox`,title:``,className:`align-top`,width:`32`,render:e=>(0,r.h)(o.NCheckbox,{checked:!!t.isProductItemSelected?.(e),disabled:t.isProductItemSelected?.(e)===`disabled`,onUpdateChecked:n=>{t.eventEmitter.emit(`product:checked`,{product:e,checked:n})}})}),F.getDeviceTypeByResolution()){case P.phone:case P.tablet:i.push({key:`name`,title:`Наименование`,className:`align-top`,render:e=>(0,r.h)(er,{product:e,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductInfoButton:t.showProductInfoButton,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,showProductRequiredButton:t.showProductRequiredButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:i.push({key:`name`,title:`Наименование`,className:`align-top`,resizable:!0,render:e=>(0,r.h)(er,{product:e,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductInfoButton:t.showProductInfoButton,currencyRates:t.currencyRates})}),t.showProductCosts&&((0,n.forEach)(e,e=>{(0,n.forEach)(e.priceCoefficients,e=>{a[e.coefficient.slug??``]||(a[e.coefficient.slug??``]=e.coefficient)})}),(0,n.forEach)((0,n.sortBy)(a,[`slug`]),e=>{i.push(tr(e.slug??``,e.name,t))}),i.push({key:`cost`,title:`Цена`,className:`align-top`,resizable:!0,render:e=>(0,r.h)(Bt,{product:e,costFieldName:`cost`,additionalThroughFieldName:`retailCost`,eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})})),(t.showProductEditButton||t.showProductRequiredButton||t.showProductAddToCartButton||!(0,n.isNil)(t.productContextButtonsConfig))&&i.push({key:`actions`,title:``,className:`align-top`,width:`50`,render:e=>(0,r.h)(Ot,{product:e,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,showProductRequiredButton:t.showProductRequiredButton,productContextButtonsConfig:t.productContextButtonsConfig})})}return i},rr={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function ir(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,rr,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,d:`M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8`},null,-1),(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z`},null,-1)]])}var ar=(0,r.markRaw)({name:`ion-trash`,render:ir}),or={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function sr(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,or,[...t[0]||=[(0,r.createElementVNode)(`path`,{d:`M448 224H288V64h-64v160H64v64h160v160h64V288h160z`,fill:`currentColor`},null,-1)]])}var cr=(0,r.markRaw)({name:`ion-plus`,render:sr}),lr={key:0,class:`flex w-fit items-center gap-2`},ur={key:1,class:`flex flex-wrap gap-1`},dr={key:0},fr={key:2},pr=(0,r.defineComponent)({__name:`configurators-product-info`,props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(e){let t=e,n=(0,r.computed)(()=>t.product?.properties?.planingProductionDate);return(t,i)=>{let a=o.NSpin,s=o.NText;return e.isProductSearching?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,lr,[(0,r.createVNode)(a,{size:17,class:`w-fit`}),i[0]||=(0,r.createElementVNode)(`div`,null,`Выполняется поиск товара ...`,-1)])):e.product&&!e.product.isNewRec()?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ur,[(0,r.createElementVNode)(`div`,null,(0,r.toDisplayString)(e.product.code)+` - `+(0,r.toDisplayString)(e.product.name)+` - `+(0,r.toDisplayString)((0,r.unref)(xe).formatMoney(e.product.costRub))+` ₽ / `+(0,r.toDisplayString)(e.product.unit.name),1),n.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,dr,`(Планируемая дата производства: `+(0,r.toDisplayString)(n.value)+`)`,1)):(0,r.createCommentVNode)(``,!0)])):e.validation?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,fr,[(0,r.createVNode)(s,{type:e.validation.validationStatus},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.validation.feedback),1)]),_:1},8,[`type`])])):(0,r.createCommentVNode)(``,!0)}}}),mr={class:`flex flex-col gap-4`},hr={class:`flex flex-col gap-2`},gr={class:`mt-8 font-bold`},_r={class:`grid grow grid-cols-2 items-start gap-2`},vr={key:2,class:`text-red-500 text-sm`},yr={key:3,class:`text-red-500 text-sm mb-2`},br={class:`flex flex-col gap-4`},xr={key:1},Sr={class:`text-lg font-semibold`},Cr={class:`flex gap-3`},wr=yt((0,r.defineComponent)({__name:`kozyrek-configurator-params-form`,props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:[`update:value`,`update:params`,`submit`,`click:add-line`,`click:remove-line`,`click:save-template`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useTemplateRef)(`form-reference`),u=(0,r.ref)(!1),d=(0,r.ref)((0,n.cloneDeep)(s.value)),f=(0,r.computed)(()=>{let e={"configuratorParams.length":[I.required,I.min(s.settings.stripMinLength),I.max(s.settings.stripMaxLength||Number.MAX_VALUE),I.step(s.settings.lengthStep),Ee.serverValidation(s.validation.length?.feedback)],quantity:[I.required,I.min(1),I.step(1),Ee.serverValidation(s.validation.quantity?.feedback)],marker:[Ee.serverValidation(s.validation.marker?.feedback)]};return(0,n.forEach)(d.value.configuratorParams.linesWidths,(t,n)=>{let r=d.value.configuratorParams.linesWidths.length>1?s.settings.minLineWidth:s.settings.stripMinWidth;e[`configuratorParams.linesWidths.${n}`]=[I.required,I.min(r),I.max(s.settings.maxLineWidth),I.step(s.settings.lineWidthStep),Ee.serverValidation(s.validation[`lines_widths[${n+1}]`]?.feedback)]}),(0,n.forEach)(d.value.configuratorParams.linesAngles,(t,n)=>{e[`configuratorParams.linesAngles.${n}`]=[I.required,I.min(s.settings.minLineAngle),I.max(s.settings.maxLineAngle),I.step(s.settings.lineAngleStep),Ee.serverValidation(s.validation[`lines_angles[${n+1}]`]?.feedback)]}),e}),p=(0,r.ref)(s.settings.canSetDopProdaga??!1),m=(0,r.computed)(()=>{let{length:e}=d.value.configuratorParams,{quantity:t}=d.value,n=d.value.product?.costRub||0;if(!e||!t||n===0)return null;let r=e/1e3;return xe.formatMoney(n*t*r)}),h=(0,r.computed)(()=>(0,n.reduce)(d.value.configuratorParams.linesWidths,(e,t)=>e+(t||0),0)),g=(0,r.computed)(()=>{let e=h.value;return e>=s.settings.stripMinWidth&&e<=s.settings.stripMaxWidth}),_=(0,r.computed)(()=>{let{configuratorParams:e}=d.value,t=(0,n.every)(e.linesWidths,e=>!!(e&&e>0)),r=(0,n.every)(e.linesAngles,e=>!(0,n.isNil)(e)),i=!!(d.value.quantity&&d.value.quantity>0),a=e.length>0&&e.length>0;return t&&r&&i&&a&&g.value}),v=()=>{(0,r.nextTick)(()=>{l.value?.validate(e=>{e||(c(`update:params`,d.value.configuratorParams),y(`configuratorParams`,d.value.configuratorParams))}).catch(n.noop)})},y=(e,n)=>{let r=new t.OrderItemBase(d.value);r[e]=n,e===`configuratorParams`&&(r.product=new t.ClientProduct),c(`update:value`,r)};return(0,r.watch)(()=>s.previewParams,e=>{d.value.configuratorParams.linesWidths=e.linesWidths,d.value.configuratorParams.linesAngles=e.linesAngles},{deep:!0}),(0,r.watch)(()=>s.value,e=>{d.value=(0,n.cloneDeep)(e)},{deep:!0}),i({validate:l.value?.validate,formReference:l}),(t,n)=>{let i=cr,a=ar,s=o.NCheckbox;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:d.value,rules:f.value,class:`flex flex-col gap-4 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,mr,[n[21]||=(0,r.createElementVNode)(`span`,{class:`w-full font-bold`},`Ширина участка, мм / Угол сгиба, ° (А)`,-1),e.settings.startTailConfigs&&e.settings.startTailConfigs.length>0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NFormItem),{key:0,required:!0,"show-feedback":!1,label:`Тип стартового капельника`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:d.value.configuratorParams.startTailType,"onUpdate:value":[n[0]||=e=>d.value.configuratorParams.startTailType=e,v],options:e.settings.startTailConfigs.map(({label:e},t)=>({label:e,value:t})),placeholder:`Тип стартового капельника`},null,8,[`value`,`options`])]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,hr,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(d.value.configuratorParams.linesAngles,(t,s)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:s,class:`flex items-start gap-2`},[(0,r.createElementVNode)(`div`,gr,(0,r.toDisplayString)(s+1),1),(0,r.createElementVNode)(`div`,_r,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.linesWidths.${s}`,label:`Ширина, мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.configuratorParams.linesWidths[s],"onUpdate:value":[e=>d.value.configuratorParams.linesWidths[s]=e,n[2]||=e=>v()],parse:(0,r.unref)(ve),"show-button":!1,class:`w-full`,onKeydown:n[1]||=e=>(0,r.unref)(ge)(e),onInput:t=>(0,r.unref)(ye)(e.validation,`lines_widths[${s+1}]`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onUpdate:value`,`parse`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.linesAngles.${s}`,label:`Угол сгиба, °`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.configuratorParams.linesAngles[s],"onUpdate:value":[e=>d.value.configuratorParams.linesAngles[s]=e,n[4]||=e=>v()],parse:(0,r.unref)(ve),"show-button":!1,class:`w-full`,onKeydown:n[3]||=e=>(0,r.unref)(ge)(e,!0),onInput:t=>(0,r.unref)(ye)(e.validation,`lines_angles[${s+1}]`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onUpdate:value`,`parse`,`onInput`,`onFocus`])]),_:2},1032,[`path`])]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:`shrink-0`},{default:(0,r.withCtx)(()=>[e.settings.showOnlyTemplates?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,size:`medium`,onClick:e=>c(`click:add-line`,s)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1},8,[`onClick`])),e.settings.showOnlyTemplates?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:1,disabled:d.value.configuratorParams.linesWidths.length===1,size:`medium`,class:`ml-2`,onClick:e=>c(`click:remove-line`,s)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`disabled`,`onClick`]))]),_:2},1024)]))),128))]),e.settings.endTailConfigs&&e.settings.endTailConfigs.length>0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NFormItem),{key:1,label:`Тип конечного капельника`,"show-feedback":!1,required:!0},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:d.value.configuratorParams.endTailType,"onUpdate:value":[n[5]||=e=>d.value.configuratorParams.endTailType=e,v],options:e.settings.endTailConfigs.map(({label:e},t)=>({label:e,value:t})),placeholder:`Тип конечного капельника`},null,8,[`value`,`options`])]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(pr,{"is-product-searching":e.isProductSearching,product:d.value.product,validation:e.validation.product},null,8,[`is-product-searching`,`product`,`validation`]),g.value?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,vr,` Суммарная ширина участков гиба должна быть от `+(0,r.toDisplayString)(e.settings.stripMinWidth)+` до `+(0,r.toDisplayString)(e.settings.stripMaxWidth)+` мм., текущая ширина: `+(0,r.toDisplayString)(h.value)+` мм. `,1)),_.value?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,yr,` Пожалуйста, заполните все обязательные поля корректно. `)),e.settings.allowSaveTemplates&&e.selectTemplateIndex===e.settings.allTemplates?.length-1?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:4,type:`tertiary`,class:`self-start`,loading:u.value,onClick:n[6]||=e=>c(`click:save-template`)},{default:(0,r.withCtx)(()=>[...n[20]||=[(0,r.createTextVNode)(` Сохранить шаблон `,-1)]]),_:1},8,[`loading`])):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,br,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{label:`С какой стороны изделие будет иметь цвет`,"show-feedback":!1},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:d.value.configuratorParams.colorSide,"onUpdate:value":[n[7]||=e=>d.value.configuratorParams.colorSide=e,v],options:[{label:`Цвет сверху`,value:`top`},{label:` Цвет снизу`,value:`bottom`}],placeholder:`С какой стороны изделие будет иметь цвет`},null,8,[`value`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.length`,label:`Метраж${e.settings.stripMinLength?` от `+e.settings.stripMinLength:``}${e.settings.stripMaxLength?` до `+e.settings.stripMaxLength:``} мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.configuratorParams.length,"onUpdate:value":[n[8]||=e=>d.value.configuratorParams.length=e,n[11]||=e=>v()],parse:(0,r.unref)(ve),"show-button":!1,placeholder:`Введите метраж`,class:`w-full`,onKeydown:n[9]||=e=>(0,r.unref)(ge)(e),onInput:n[10]||=t=>(0,r.unref)(ye)(e.validation,`length`),onFocus:(0,r.unref)(be)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`quantity`,label:`Количество`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.quantity,"onUpdate:value":[n[12]||=e=>d.value.quantity=e,n[15]||=e=>y(`quantity`,e??0)],"show-button":!1,placeholder:`Введите количество`,class:`w-full`,onKeydown:n[13]||=e=>(0,r.unref)(ge)(e,!1),onInput:n[14]||=t=>(0,r.unref)(ye)(e.validation,`quantity`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:d.value.marker??null,placeholder:`Введите маркировку`,onInput:n[16]||=t=>(0,r.unref)(ye)(e.validation,`marker`),"onUpdate:value":n[17]||=e=>{d.value.marker=e??null,y(`marker`,e??null)},onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1}),p.value?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0,checked:d.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[18]||=e=>{d.value.isAdditionalSale=e??!1,y(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[22]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),m.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,xr,[n[23]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,Sr,(0,r.toDisplayString)(m.value)+` ₽`,1)])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,Cr,[(0,r.createVNode)((0,r.unref)(o.NButton),{loading:e.isSubmitProcessing,disabled:!_.value||d.value.product.isNewRec(),type:`primary`,class:`self-start`,onClick:n[19]||=e=>c(`submit`,d.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(d.value.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`])])])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>c(`submit`,d.value)]])}}}),[[`__scopeId`,`data-v-d7be5193`]]),Tr=Object.defineProperty,Er=Object.defineProperties,Dr=Object.getOwnPropertyDescriptors,Or=Object.getOwnPropertySymbols,kr=Object.prototype.hasOwnProperty,Ar=Object.prototype.propertyIsEnumerable,jr=e=>{throw TypeError(e)},Mr=(e,t,n)=>t in e?Tr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Nr=(e,t)=>{for(var n in t||={})kr.call(t,n)&&Mr(e,n,t[n]);if(Or)for(var n of Or(t))Ar.call(t,n)&&Mr(e,n,t[n]);return e},Pr=(e,t)=>Er(e,Dr(t)),Fr=(e,t)=>{for(var n in t)Tr(e,n,{get:t[n],enumerable:!0})},L=(e,t,n)=>Mr(e,typeof t==`symbol`?t:t+``,n),Ir=(e,t,n)=>t.has(e)||jr(`Cannot `+n),Lr=(e,t,n)=>(Ir(e,t,`read from private field`),n?n.call(e):t.get(e)),Rr=(e,t,n)=>t.has(e)?jr(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),zr=(e,t,n,r)=>(Ir(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Br={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||`canvas`,e.nodeType=1,e.getAttribute=function(e){return this[e]},e.setAttribute=function(e,t){return this[e]=t,this},e},polyfill:function(e,t){return Br.shim(e),t!==void 0&&(Br.Image=t),Br.isHeadless=!0,e}},Vr={};Fr(Vr,{Curve:()=>li,getAnchorsFromArcData:()=>vi,getComponentOnCubicBezier:()=>ui,getControlPoints:()=>gi,getCurveBoundingBox:()=>pi,getCurveFromPoints:()=>hi,getCurveLength:()=>fi,getReflection:()=>_i,integrate:()=>mi,subdivide:()=>di});var Hr={};Fr(Hr,{HALF_PI:()=>Kr,NumArray:()=>ei,TWO_PI:()=>Gr,decomposeMatrix:()=>qr,getComputedMatrix:()=>Yr,getEffectiveStrokeWidth:()=>ri,getPoT:()=>Qr,lerp:()=>Xr,mod:()=>$r,setMatrix:()=>Jr,toFixed:()=>ni});var Ur;typeof window<`u`?Ur=window:typeof global<`u`?Ur=global:typeof self<`u`&&(Ur=self);var Wr,Gr=Math.PI*2,Kr=Math.PI*.5;function qr(e,t,n,r,i,a){let o;return arguments.length<=1?(o=e.a,t=e.b,n=e.c,r=e.d,i=e.e,a=e.f):o=e,{translateX:i,translateY:a,scaleX:Math.sqrt(o*o+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,o)/Math.PI}}function Jr(e){Wr=e}function Yr(e,t){t=t&&t.identity()||new Wr;let n=e,r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let e=0;e<r.length;e++){let n=r[e].elements;t.multiply(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])}return t}function Xr(e,t,n){return n*(t-e)+e}var Zr=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function Qr(e){let t=0;for(;Zr[t]&&Zr[t]<e;)t++;return Zr[t]}function $r(e,t){for(;e<0;)e+=t;return e%t}var ei=Ur.Float32Array||Array,ti=Math.floor;function ni(e){return ti(e*1e6)/1e6}function ri(e,t){let n=e._linewidth;if(e.strokeAttenuation)return n;t||=e.worldMatrix||Yr(e);let r=qr(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]),i=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return i>0?n/i:n}var R={move:`M`,line:`L`,curve:`C`,arc:`A`,close:`Z`},z=class{constructor(){L(this,`_events`,{}),L(this,`_bound`,!1)}addEventListener(e,t){return(this._events[e]||(this._events[e]=[])).push(t),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,t){if(!this._events)return this;if(!e&&!t)return this._events={},this._bound=!1,this;let n=e?[e]:Object.keys(this._events);for(let r=0,i=n.length;r<i;r++){e=n[r];let i=this._events[e];if(i){let n=[];if(t)for(let e=0,r=i.length;e<r;e++){let r=i[e];r=r.handler?r.handler:r,t!==r&&n.push(r)}this._events[e]=n}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;let t=Array.prototype.slice.call(arguments,1),n=this._events[e];if(n)for(let e=0;e<n.length;e++)n[e].call(this,...t);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,t,n){let r=this;e&&(i.obj=e,i.name=t,i.handler=n,e.on(t,i));function i(){n.apply(r,arguments)}return r}ignore(e,t,n){return e.off(t,n),this}};L(z,`Types`,{play:`play`,pause:`pause`,update:`update`,render:`render`,resize:`resize`,change:`change`,remove:`remove`,insert:`insert`,order:`order`,load:`load`}),L(z,`Methods`,[`addEventListener`,`on`,`removeEventListener`,`off`,`unbind`,`dispatchEvent`,`trigger`,`listen`,`ignore`]);var ii={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(z.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(z.Types.change))}}},ai=class e extends z{constructor(e=0,t=0){super(),L(this,`_x`,0),L(this,`_y`,0);for(let e in ii)Object.defineProperty(this,e,ii[e]);this.x=e,this.y=t}static add(t,n){return new e(t.x+n.x,t.y+n.y)}static sub(t,n){return new e(t.x-n.x,t.y-n.y)}static subtract(t,n){return e.sub(t,n)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){let e=arguments[0]-arguments[2],t=arguments[1]-arguments[3];return Math.atan2(t,e)}let n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(t,n){return Math.sqrt(e.distanceBetweenSquared(t,n))}static distanceBetweenSquared(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new e(this.x,this.y)}add(e,t){return arguments.length<=0||(arguments.length<=1?typeof e==`number`?(this.x+=e,this.y+=e):e&&typeof e.x==`number`&&typeof e.y==`number`&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=t)),this}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){return arguments.length<=0||(arguments.length<=1?typeof e==`number`?(this.x-=e,this.y-=e):e&&typeof e.x==`number`&&typeof e.y==`number`&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=t)),this}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,t){return arguments.length<=0||(arguments.length<=1?typeof e==`number`?(this.x*=e,this.y*=e):e&&typeof e.x==`number`&&typeof e.y==`number`&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=t)),this}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){return arguments.length<=0||(arguments.length<=1?typeof e==`number`?(this.x/=e,this.y/=e):e&&typeof e.x==`number`&&typeof e.y==`number`&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=t),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0)),this}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=t===void 0?1e-4:t,this.distanceTo(e)<t}lerp(e,t){let n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}isZero(e){return e=e===void 0?1e-4:e,this.length()<e}toString(){return this.x+`, `+this.y}toObject(){return{x:ni(this.x),y:ni(this.y)}}rotate(e){let t=this.x,n=this.y,r=Math.cos(e),i=Math.sin(e);return this.x=t*r-n*i,this.y=t*i+n*r,this}};L(ai,`zero`,new ai),L(ai,`left`,new ai(-1,0)),L(ai,`right`,new ai(1,0)),L(ai,`up`,new ai(0,-1)),L(ai,`down`,new ai(0,1));var B=ai,V=class e extends B{constructor(t=0,n=0,r=0,i=0,a=0,o=0,s=R.move){super(t,n),L(this,`controls`,{left:new B,right:new B}),L(this,`_command`,R.move),L(this,`_relative`,!0),L(this,`_rx`,0),L(this,`_ry`,0),L(this,`_xAxisRotation`,0),L(this,`_largeArcFlag`,0),L(this,`_sweepFlag`,1);for(let e in oi)Object.defineProperty(this,e,oi[e]);this.command=s,this.relative=!0;let c=e.makeBroadcast(this);this.controls.left.set(r,i).addEventListener(z.Types.change,c),this.controls.right.set(a,o).addEventListener(z.Types.change,c)}static makeBroadcast(e){return t;function t(){e._bound&&e.dispatchEvent(z.Types.change)}}static fromObject(t){return new e().copy(t)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command==`string`&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative==`boolean`&&(this.relative=e.relative),typeof e.rx==`number`&&(this.rx=e.rx),typeof e.ry==`number`&&(this.ry=e.ry),typeof e.xAxisRotation==`number`&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag==`number`&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag==`number`&&(this.sweepFlag=e.sweepFlag),this}clone(){return new e().copy(this)}toObject(){return{x:ni(this.x),y:ni(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:ni(this.rx),ry:ni(this.ry),xAxisRotation:ni(this.xAxisRotation),largeArcFlag:ni(this.largeArcFlag),sweepFlag:ni(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},oi={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(z.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(z.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(z.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(z.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(z.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(z.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(z.Types.change))}}},si=0,ci={NextFrameId:null,Types:{webgl:`WebGLRenderer`,svg:`SVGRenderer`,canvas:`CanvasRenderer`},Version:`v0.8.24`,PublishDate:`2026-08-29T05:23:23.915Z`,Identifier:`two-`,Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return si++}},li={CollinearityEpsilon:10**-30,RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:2**-52},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function ui(e,t,n,r,i){let a=1-e;return a*a*a*t+3*a*a*e*n+3*a*e*e*r+e*e*e*i}function di(e,t,n,r,i,a,o,s,c){c||=li.RecursionLimit;let l=c+1;if(Math.abs(e-o)<.001&&Math.abs(t-s)<.001)return[new V(o,s)];let u=[];for(let c=0;c<l;c++){let d=c/l,f=ui(d,e,n,i,o),p=ui(d,t,r,a,s);u.push(new V(f,p))}return u}function fi(e,t,n,r,i,a,o,s,c){if(e===n&&t===r&&i===o&&a===s){let n=o-e,r=s-t;return Math.sqrt(n*n+r*r)}let l=9*(n-i)+3*(o-e),u=6*(e+i)-12*n,d=3*(n-e),f=9*(r-a)+3*(s-t),p=6*(t+a)-12*r,m=3*(r-t);function h(e){let t=(l*e+u)*e+d,n=(f*e+p)*e+m;return Math.sqrt(t*t+n*n)}return mi(h,0,1,c||li.RecursionLimit)}function pi(e,t,n,r,i,a,o,s){let c=[],l=[[],[]],u,d,f,p,m,h,g,_;for(let l=0;l<2;++l)if(l===0?(d=6*e-12*n+6*i,u=-3*e+9*n-9*i+3*o,f=3*n-3*e):(d=6*t-12*r+6*a,u=-3*t+9*r-9*a+3*s,f=3*r-3*t),Math.abs(u)<.001){if(Math.abs(d)<.001)continue;p=-f/d,0<p&&p<1&&c.push(p)}else g=d*d-4*f*u,_=Math.sqrt(g),!(g<0)&&(m=(-d+_)/(2*u),0<m&&m<1&&c.push(m),h=(-d-_)/(2*u),0<h&&h<1&&c.push(h));let v=c.length,y=v,b;for(;v--;)p=c[v],b=1-p,l[0][v]=b*b*b*e+3*b*b*p*n+3*b*p*p*i+p*p*p*o,l[1][v]=b*b*b*t+3*b*b*p*r+3*b*p*p*a+p*p*p*s;return l[0][y]=e,l[1][y]=t,l[0][y+1]=o,l[1][y+1]=s,l[0].length=l[1].length=y+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}function mi(e,t,n,r){let i=li.abscissas[r-2],a=li.weights[r-2],o=.5*(n-t),s=o+t,c=0,l=r+1>>1,u=r&1?a[c++]*e(s):0;for(;c<l;){let t=o*i[c];u+=a[c++]*(e(s+t)+e(s-t))}return o*u}function hi(e,t){let n=e.length,r=n-1;for(let i=0;i<n;i++){let a=e[i],o=t?$r(i-1,n):Math.max(i-1,0),s=t?$r(i+1,n):Math.min(i+1,r),c=e[o],l=a,u=e[s];gi(c,l,u),l.command=i===0?R.move:R.curve}}function gi(e,t,n){let r=B.angleBetween(e,t),i=B.angleBetween(n,t),a=B.distanceBetween(e,t),o=B.distanceBetween(n,t),s=(r+i)/2;return a<.001||o<.001?(typeof t.relative==`boolean`&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(a*=.33,o*=.33,i<r?s+=Kr:s-=Kr,t.controls.left.x=Math.cos(s)*a,t.controls.left.y=Math.sin(s)*a,s-=Math.PI,t.controls.right.x=Math.cos(s)*o,t.controls.right.y=Math.sin(s)*o,typeof t.relative==`boolean`&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function _i(e,t,n){return new B(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function vi(e,t,n,r,i,a,o){let s=ci.Resolution,c=[];for(let e=0;e<s;e++){let t=(e+1)/s;o&&(t=1-t);let l=t*a+i,u=new V(n*Math.cos(l),r*Math.sin(l));u.command=R.line,c.push(u)}}var yi=Array.prototype.slice;function bi(e){if(e==null)return!1;let t=e.length;return typeof t==`number`&&t>=0&&t<4294967296}var H={isNaN:function(e){return typeof e==`number`&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){let t=typeof e;return t===`function`||t===`object`&&!!e},isFunction:function(e){return typeof e==`function`},extend:function(e){let t=yi.call(arguments,1);for(let n=0;n<t.length;n++){let r=t[n];for(let t in r)e[t]=r[t]}return e},defaults:function(e){let t=yi.call(arguments,1);for(let n=0;n<t.length;n++){let r=t[n];for(let t in r)e[t]===void 0&&(e[t]=r[t])}return e},each:function(e,t,n){let r=n||this,i=!bi(e)&&Object.keys(e),a=(i||e).length;for(let n=0;n<a;n++){let a=i?i[n]:n;t.call(r,e[a],a,e)}return e},performance:Ur.performance&&Ur.performance.now?Ur.performance:Date},xi={hasEventListeners:typeof Ur.addEventListener==`function`,bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent(`on`+t,n),xi},unbind:function(e,t,n,r){return xi.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent(`on`+t,n),xi},getRequestAnimationFrame:function(){let e=[`ms`,`moz`,`webkit`,`o`],t=0,n=Ur.requestAnimationFrame;if(!n){for(let t=0;t<e.length;t++)n=Ur[e[t]+`RequestAnimationFrame`]||n;n||=r}function r(e,n){let r=new Date().getTime(),i=Math.max(0,16-(r-t)),a=Ur.setTimeout(o,i);t=r+i;function o(){e(r+i)}return a}return n}},Si=Ur.document?Ur.document.createElement(`div`):{};Si.id=`help-two-load`,Object.defineProperty(xi,"temp",{enumerable:!0,get:function(){return H.isElement(Si)&&!Ur.document.head.contains(Si)&&(Si.style.display=`none`,Ur.document.head.appendChild(Si)),Si}});var Ci=class extends Error{constructor(e){super(),L(this,`name`,`Two.js`),L(this,`message`),this.message=e}},wi=Ur.devicePixelRatio||1;function Ti(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Ei(e){return wi/Ti(e)}var Di=class{constructor(){L(this,`map`,{})}add(e,t){return this.map[e]=t,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},Oi,ki=class extends Array{constructor(){super(),Rr(this,Oi,new z),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Lr(this,Oi)}set _events(e){zr(this,Oi,e)}get _bound(){return Lr(this,Oi)._bound}set _bound(e){Lr(this,Oi)._bound=e}addEventListener(){return Lr(this,Oi).addEventListener?.apply(this,arguments)}on(){return Lr(this,Oi).on?.apply(this,arguments)}bind(){return Lr(this,Oi).bind?.apply(this,arguments)}removeEventListener(){return Lr(this,Oi).removeEventListener?.apply(this,arguments)}off(){return Lr(this,Oi).off?.apply(this,arguments)}unbind(){return Lr(this,Oi).unbind?.apply(this,arguments)}dispatchEvent(){return Lr(this,Oi).dispatchEvent?.apply(this,arguments)}trigger(){return Lr(this,Oi).trigger?.apply(this,arguments)}listen(){return Lr(this,Oi).listen?.apply(this,arguments)}ignore(){return Lr(this,Oi).ignore?.apply(this,arguments)}pop(){let e=super.pop.apply(this,arguments);return this.trigger(z.Types.remove,[e]),e}shift(){let e=super.shift.apply(this,arguments);return this.trigger(z.Types.remove,[e]),e}push(){let e=super.push.apply(this,arguments);return this.trigger(z.Types.insert,arguments),e}unshift(){let e=super.unshift.apply(this,arguments);return this.trigger(z.Types.insert,arguments),e}splice(){let e=super.splice.apply(this,arguments);if(this.trigger(z.Types.remove,e),arguments.length>2){let e=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(z.Types.insert,e),this.trigger(z.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(z.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(z.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,t){let n=[];for(let r=0;r<this.length;r++){let i=this[r],a;a=t?e.call(t,i,r):e(i,r),n.push(a)}return n}};Oi=new WeakMap;var Ai=class e extends z{constructor(){super(),L(this,`_flagId`,!1),L(this,`_flagClassName`,!1),L(this,`_renderer`,{}),L(this,`_id`,ci.Identifier+ci.uniqueId()),L(this,`_className`,``),L(this,`classList`,[]);for(let e in Mi)Object.defineProperty(this,e,Mi[e])}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type==`string`&&(this.renderer.type=e.renderer.type),typeof e.className==`string`&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){if(typeof this.unbind==`function`&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type===`WebGLRenderer`&&this.renderer.ctx){let e=this.renderer.ctx;this._renderer.texture&&(e.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(e.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type===`CanvasRenderer`&&this._renderer.context&&delete this._renderer.context}let e=this._renderer.type;return this._renderer={type:e},this}};L(Ai,`Properties`,[`renderer`,`id`,`className`]);var ji=Ai,Mi={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){let t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Ni,Pi={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Ur.document&&(Ni=document.createElement(`a`));var Fi=class e extends ji{constructor(e,t){super(),L(this,`_flagSrc`,!1),L(this,`_flagImage`,!1),L(this,`_flagVideo`,!1),L(this,`_flagLoaded`,!1),L(this,`_flagRepeat`,!1),L(this,`_flagOffset`,!1),L(this,`_flagScale`,!1),L(this,`_src`,``),L(this,`_image`,null),L(this,`_loaded`,!1),L(this,`_repeat`,`no-repeat`),L(this,`_scale`,1),L(this,`_offset`,null);for(let e in Li)Object.defineProperty(this,e,Li[e]);if(this._renderer.type=`texture`,this._renderer.flagOffset=Ri.bind(this),this._renderer.flagScale=zi.bind(this),this.loaded=!1,this.repeat=`no-repeat`,this.offset=new B,typeof t==`function`){let e=function(){this.unbind(z.Types.load,e),typeof t==`function`&&t()}.bind(this);this.bind(z.Types.load,e)}if(typeof e==`string`)this.src=e;else if(typeof e==`object`){let t=Object.prototype.toString.call(e);(t===`[object HTMLImageElement]`||t===`[object HTMLCanvasElement]`||t===`[object HTMLVideoElement]`||t===`[object Image]`)&&(this.image=e)}this._update()}fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}static getAbsoluteURL(e){return Ni?(Ni.href=e,Ni.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||`img`}static getImage(t){let n=e.getAbsoluteURL(t);if(e.ImageRegistry.contains(n))return e.ImageRegistry.get(n);let r;return Br.Image?(r=new Br.Image,Br.shim(r,`img`)):Ur.document?r=Pi.video.test(n)?document.createElement(`video`):document.createElement(`img`):console.warn(`Two.js: no prototypical image defined for Two.Texture`),r.crossOrigin=`anonymous`,r.referrerPolicy=`no-referrer`,r}static load(t,n){let r=t.image,i=e.getTag(r);t._flagImage&&(/canvas/i.test(i)?e.Register.canvas(t,n):(t._src=!Br.isHeadless&&r.getAttribute(`two-src`)||r.src,e.Register[i](t,n))),t._flagSrc&&(r||(r=e.getImage(t.src),t.image=r),i=e.getTag(r),e.Register[i](t,n))}clone(){let t=new e(this.src);return t.repeat=this.repeat,t.offset.copy(this.offset),t.scale=this.scale,t}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset==`number`||e.offset instanceof B?e.offset:new B().copy(e.offset),this.scale=typeof e.scale==`number`||e.scale instanceof B?e.scale:new B().copy(e.scale),this}toObject(){let e=super.toObject.call(this);return e.renderer.type=`texture`,e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale==`number`?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(z.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,e.load(this,function(){this.loaded=!0,this.trigger(z.Types.change).trigger(z.Types.load)}.bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),`elem`in this._renderer){let e=this._renderer.elem;e.parentNode.removeChild(e)}return`effect`in this._renderer&&(this._renderer.effect=null),this}};L(Fi,`Properties`,[`src`,`loaded`,`repeat`,`scale`,`offset`,`image`]),L(Fi,`RegularExpressions`,Pi),L(Fi,`ImageRegistry`,new Di),L(Fi,`Register`,{canvas:function(e,t){e._src=`#`+e.id,Fi.ImageRegistry.add(e.src,e.image),typeof t==`function`&&t()},img:function(e,t){let n=e.image,r=function(e){!Br.isHeadless&&n.removeEventListener&&typeof n.removeEventListener==`function`&&(n.removeEventListener(`load`,r,!1),n.removeEventListener(`error`,i,!1)),typeof t==`function`&&t()},i=function(t){throw!Br.isHeadless&&typeof n.removeEventListener==`function`&&(n.removeEventListener(`load`,r,!1),n.removeEventListener(`error`,i,!1)),new Ci(`unable to load `+e.src)};typeof n.width==`number`&&n.width>0&&typeof n.height==`number`&&n.height>0?r():!Br.isHeadless&&typeof n.addEventListener==`function`&&(n.addEventListener(`load`,r,!1),n.addEventListener(`error`,i,!1)),e._src=Fi.getAbsoluteURL(e._src),!(!Br.isHeadless&&n&&n.getAttribute(`two-src`))&&(Br.isHeadless||n.setAttribute(`two-src`,e.src),Fi.ImageRegistry.add(e.src,n),Br.isHeadless?Fi.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(Br.isHeadless)throw new Ci(`video textures are not implemented in headless environments.`);let n=function(i){e.image.removeEventListener(`canplaythrough`,n,!1),e.image.removeEventListener(`error`,r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t==`function`&&t()},r=function(t){throw e.image.removeEventListener(`canplaythrough`,n,!1),e.image.removeEventListener(`error`,r,!1),new Ci(`unable to load `+e.src)};e._src=Fi.getAbsoluteURL(e._src),e.image.getAttribute(`two-src`)||(e.image.setAttribute(`two-src`,e.src),Fi.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener(`canplaythrough`,n,!1),e.image.addEventListener(`error`,r,!1),e.image.src=e.src,e.image.load())}});var Ii=Fi,Li={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){let t=Ii.getTag(e),n;switch(t){case`canvas`:n=`#`+e.id;break;default:n=e.src}this._image=Ii.ImageRegistry.contains(n)?Ii.ImageRegistry.get(e.src):e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(z.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(z.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof B&&this._scale.unbind(z.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof B&&this._scale.bind(z.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function Ri(){this._flagOffset=!0}function zi(){this._flagScale=!0}var Bi=class e extends ji{constructor(t,n,r){super(),L(this,`_flagOffset`,!0),L(this,`_flagOpacity`,!0),L(this,`_flagColor`,!0),L(this,`_offset`,0),L(this,`_opacity`,1),L(this,`_color`,`#fff`);for(let e in Hi)Object.defineProperty(this,e,Hi[e]);this._renderer.type=`stop`,this.offset=typeof t==`number`?t:e.Index<=0?0:1,this.opacity=typeof r==`number`?r:1,this.color=typeof n==`string`?n:e.Index<=0?`#fff`:`#000`,e.Index=(e.Index+1)%2}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e;return H.each(e.Properties,function(e){n[e]=this[e]},this),t&&t.stops&&t.stops.push(n),n}toObject(){let t=super.toObject.call(this);return t.renderer.type=`stop`,H.each(e.Properties,e=>{t[e]=this[e]},this),t}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};L(Bi,`Index`,0),L(Bi,`Properties`,[`offset`,`opacity`,`color`]);var Vi=Bi,Hi={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Ui=class e extends ji{constructor(e){super(),L(this,`_flagStops`,!1),L(this,`_flagSpread`,!1),L(this,`_flagUnits`,!1),L(this,`_spread`,``),L(this,`_units`,``);for(let e in Gi)Object.defineProperty(this,e,Gi[e]);this._renderer.type=`gradient`,this._renderer.flagStops=Ki.bind(this),this._renderer.bindStops=qi.bind(this),this._renderer.unbindStops=Ji.bind(this),this.spread=`pad`,this.units=`objectBoundingBox`,e&&(this.stops=e)}static fromObject(t){let n=t.stops;n&&n.length>0&&(n=n.map(e=>e instanceof Vi?e:new Vi().copy(e)));let r=new e(n).copy(t);return`id`in t&&(r.id=t.id),r}clone(t){let n=this.stops.map(e=>e.clone()),r=new e(n);return H.each(e.Properties,e=>{r[e]=this[e]},this),t&&t.add(r),r}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}toObject(){let t={stops:this.stops.map(e=>e.toObject())};return H.each(e.Properties,e=>{t[e]=this[e]},this),t}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(z.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if(`elem`in this._renderer){let e=this._renderer.elem;e.parentNode.removeChild(e)}return`effect`in this._renderer&&(this._renderer.effect=null),this}};L(Ui,`Stop`,Vi),L(Ui,`Properties`,[`spread`,`stops`,`units`]);var Wi=Ui,Gi={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){let t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(z.Types.insert,t).unbind(z.Types.remove,n),this._stops=new ki((e||[]).slice(0)),this._stops.bind(z.Types.insert,t).bind(z.Types.remove,n),t(this._stops)}}};function Ki(){this._flagStops=!0}function qi(e){let t=e.length;for(;t--;)e[t].bind(z.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Ji(e){let t=e.length;for(;t--;)e[t].unbind(z.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Yi=class e extends Wi{constructor(e,t,n,r,i){super(i),L(this,`_flagEndPoints`,!1),L(this,`_left`,null),L(this,`_right`,null);for(let e in Zi)Object.defineProperty(this,e,Zi[e]);this._renderer.type=`linear-gradient`,this._renderer.flagEndPoints=Qi.bind(this),this.left=new B,this.right=new B,typeof e==`number`&&(this.left.x=e),typeof t==`number`&&(this.left.y=t),typeof n==`number`&&(this.right.x=n),typeof r==`number`&&(this.right.y=r)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r]instanceof B?t[r]:new B().copy(t[r]))}return this}clone(t){let n=this.stops.map(function(e){return e.clone()}),r=new e(this.left._x,this.left._y,this.right._x,this.right._y,n);return H.each(Wi.Properties,function(e){r[e]=this[e]},this),t&&t.add(r),r}toObject(){let e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(z.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};L(Yi,`Stop`,Vi),L(Yi,`Properties`,[`left`,`right`]);var Xi=Yi,Zi={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof B&&this._left.unbind(z.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(z.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof B&&this._right.unbind(z.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(z.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function Qi(){this._flagEndPoints=!0}var $i=class e extends Wi{constructor(e,t,n,r,i,a){super(r),L(this,`_flagRadius`,!1),L(this,`_flagCenter`,!1),L(this,`_flagFocal`,!1),L(this,`_radius`,0),L(this,`_center`,null),L(this,`_focal`,null);for(let e in ta)Object.defineProperty(this,e,ta[e]);this._renderer.type=`radial-gradient`,this._renderer.flagCenter=na.bind(this),this._renderer.flagFocal=ra.bind(this),this.center=new B,this.radius=typeof n==`number`?n:1,this.focal=new B,typeof e==`number`&&(this.center.x=e),typeof t==`number`&&(this.center.y=t),this.focal.copy(this.center),typeof i==`number`&&(this.focal.x=i),typeof a==`number`&&(this.focal.y=a)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(/(center|focal)i/.test(r)?this[r]=t[r]instanceof B?t[r]:new B().copy(t[r]):typeof t[r]==`number`&&(this[r]=t[MediaKeySystemAccess]))}return this}clone(t){let n=this.stops.map(function(e){return e.clone()}),r=new e(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return H.each(Wi.Properties.concat(e.Properties),function(e){r[e]=this[e]},this),t&&t.add(r),r}toObject(){let t=super.toObject.call(this);return H.each(e.Properties,function(e){t[e]=this[e]},this),t.center=this.center.toObject(),t.focal=this.focal.toObject(),t}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(z.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};L($i,`Stop`,Vi),L($i,`Properties`,[`center`,`radius`,`focal`]);var ea=$i,ta={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(z.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(z.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(z.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(z.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function na(){this._flagCenter=!0}function ra(){this._flagFocal=!0}function ia(e,t){if(t===0||t===1)return!0;let n=e._length*t,r=0;for(let t=0;t<e._lengths.length;t++){let i=e._lengths[t];if(r>=n)return n-r>=0;r+=i}return!1}function aa(e,t){let n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let n=0,r=0;n<e._lengths.length;n++){if(r+e._lengths[n]>=t)return t-=r,Math.max(n-1,0)+t/e._lengths[n];r+=e._lengths[n]}return-1}function oa(e,t,n){let r,i,a,o,s,c,l,u,d=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,s=t.y,i=(d||t).x,c=(d||t).y,a=(f||e).x,l=(f||e).y,o=e.x,u=e.y,d&&t._relative&&(i+=t.x,c+=t.y),f&&e._relative&&(a+=e.x,l+=e.y),fi(r,s,i,c,a,l,o,u,n)}function sa(e,t,n){let r,i,a,o,s,c,l,u,d=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,s=t.y,i=(d||t).x,c=(d||t).y,a=(f||e).x,l=(f||e).y,o=e.x,u=e.y,d&&t._relative&&(i+=t.x,c+=t.y),f&&e._relative&&(a+=e.x,l+=e.y),di(r,s,i,c,a,l,o,u,n)}function ca(e){switch(e.renderer.type){case`texture`:return Ii.fromObject(e);case`gradient`:return Wi.fromObject(e);case`linear-gradient`:return Xi.fromObject(e);case`radial-gradient`:return ea.fromObject(e)}return e}var la=Math.cos,ua=Math.sin,da=Math.tan,fa=[],pa=class e extends z{constructor(e,t,n,r,i,a){super(),L(this,`elements`,new ei(9)),L(this,`manual`,!1);let o=e;Array.isArray(o)||(o=Array.prototype.slice.call(arguments)),this.identity(),o.length>0&&this.set(o)}static Multiply(e,t,n){if(t.length<=3){let n=e,r,i,a,o=t[0]||0,s=t[1]||0,c=t[2]||0;return r=n[0]*o+n[1]*s+n[2]*c,i=n[3]*o+n[4]*s+n[5]*c,a=n[6]*o+n[7]*s+n[8]*c,[r,i,a]}let r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],d=e[8],f=t[0],p=t[1],m=t[2],h=t[3],g=t[4],_=t[5],v=t[6],y=t[7],b=t[8];return n||=new ei(9),n[0]=r*f+i*h+a*v,n[1]=r*p+i*g+a*y,n[2]=r*m+i*_+a*b,n[3]=o*f+s*h+c*v,n[4]=o*p+s*g+c*y,n[5]=o*m+s*_+c*b,n[6]=l*f+u*h+d*v,n[7]=l*p+u*g+d*y,n[8]=l*m+u*_+d*b,n}static fromObject(t){return new e().copy(t)}set(e,t,n,r,i,a,o,s,c){if(t===void 0){let l=e;e=l[0],t=l[1],n=l[2],r=l[3],i=l[4],a=l[5],o=l[6],s=l[7],c=l[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=i,this.elements[5]=a,this.elements[6]=o,this.elements[7]=s,this.elements[8]=c,this.trigger(z.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(z.Types.change)}identity(){return this.elements[0]=e.Identity[0],this.elements[1]=e.Identity[1],this.elements[2]=e.Identity[2],this.elements[3]=e.Identity[3],this.elements[4]=e.Identity[4],this.elements[5]=e.Identity[5],this.elements[6]=e.Identity[6],this.elements[7]=e.Identity[7],this.elements[8]=e.Identity[8],this.trigger(z.Types.change)}multiply(e,t,n,r,i,a,o,s,c){if(t===void 0)return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(z.Types.change);if(n===void 0&&(n=1),r===void 0)return e||=0,t||=0,n||=0,i=this.elements,[i[0]*e+i[1]*t+i[2]*n,i[3]*e+i[4]*t+i[5]*n,i[6]*e+i[7]*t+i[8]*n];let l=this.elements,u=[e,t,n,r,i,a,o,s,c],d=l[0],f=l[1],p=l[2],m=l[3],h=l[4],g=l[5],_=l[6],v=l[7],y=l[8],b=u[0],x=u[1],S=u[2],C=u[3],w=u[4],T=u[5],E=u[6],D=u[7],O=u[8];return this.elements[0]=d*b+f*C+p*E,this.elements[1]=d*x+f*w+p*D,this.elements[2]=d*S+f*T+p*O,this.elements[3]=m*b+h*C+g*E,this.elements[4]=m*x+h*w+g*D,this.elements[5]=m*S+h*T+g*O,this.elements[6]=_*b+v*C+y*E,this.elements[7]=_*x+v*w+y*D,this.elements[8]=_*S+v*T+y*O,this.trigger(z.Types.change)}inverse(t){let n=this.elements;t||=new e;let r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],d=n[8],f=d*s-c*u,p=-d*o+c*l,m=u*o-s*l,h=r*f+i*p+a*m;return h?(h=1/h,t.elements[0]=f*h,t.elements[1]=(-d*i+a*u)*h,t.elements[2]=(c*i-a*s)*h,t.elements[3]=p*h,t.elements[4]=(d*r-a*l)*h,t.elements[5]=(-c*r+a*o)*h,t.elements[6]=m*h,t.elements[7]=(-u*r+i*l)*h,t.elements[8]=(s*r-i*o)*h,t):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){let t=la(e),n=ua(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){let t=da(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){let t=da(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return fa.length=0,this.toTransformArray(e,fa),fa.map(ni).join(` `)}toTransformArray(e,t){let n=this.elements,r=!!t,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5];if(e){let e=n[6],u=n[7],d=n[8];if(r){t[0]=i,t[1]=s,t[2]=e,t[3]=a,t[4]=c,t[5]=u,t[6]=o,t[7]=l,t[8]=d;return}return[i,s,e,a,c,u,o,l,d]}if(r)t[0]=i,t[1]=s,t[2]=a,t[3]=c,t[4]=o,t[5]=l;else return[i,s,a,c,o,l]}toArray(e,t){let n=this.elements,r=!!t,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5];if(e){let e=n[6],u=n[7],d=n[8];if(r){t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l,t[6]=e,t[7]=u,t[8]=d;return}return[i,a,o,s,c,l,e,u,d]}if(r)t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l;else return[i,a,o,s,c,l]}toObject(){return{renderer:{type:`matrix`},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new e().copy(this)}};L(pa,`Identity`,[1,0,0,0,1,0,0,0,1]);var ma=pa;Jr(ma);var ha=class e extends ji{constructor(){super(),L(this,`_flagMatrix`,!0),L(this,`_flagScale`,!1),L(this,`_matrix`,null),L(this,`_worldMatrix`,null),L(this,`_position`,null),L(this,`_rotation`,0),L(this,`_scale`,1),L(this,`_skewX`,0),L(this,`_skewY`,0);for(let e in _a)Object.defineProperty(this,e,_a[e]);this._renderer.flagMatrix=va.bind(this),this.isShape=!0,this.matrix=new ma,this.worldMatrix=new ma,this.position=new B,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return _a.position.get.apply(this,arguments)}set translation(e){_a.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent&&this.parent.remove(this),this}contains(e,t,n){let r=n||{},i=r.ignoreVisibility===!0;if(!i&&`visible`in this&&this.visible===!1||!i&&`opacity`in this&&typeof this.opacity==`number`&&this.opacity<=0||typeof this.getBoundingClientRect!=`function`)return!1;let a=typeof r.tolerance==`number`?r.tolerance:0;this._update(!0);let o=this.getBoundingClientRect();return o?e>=o.left-a&&e<=o.right+a&&t>=o.top-a&&t<=o.bottom+a:!1}copy(e){return super.copy.call(this,e),`position`in e&&(e.position instanceof B?this.position=e.position:this.position.copy(e.position)),`rotation`in e&&(this.rotation=e.rotation),`scale`in e&&(this.scale=typeof e.scale==`number`||e.scale instanceof B?e.scale:new B(e.scale.x,e.scale.y)),`skewX`in e&&(this.skewX=e.skewX),`skewY`in e&&(this.skewY=e.skewY),`matrix`in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(t){let n=new e;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let e=super.toObject.call(this);return e.renderer={type:`shape`},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof B?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}dispose(){super.dispose(),typeof this.translation==`object`&&typeof this.translation.unbind==`function`&&this.translation.unbind(),typeof this.scale==`object`&&typeof this.scale.unbind==`function`&&this.scale.unbind()}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof B?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};L(ha,`Properties`,[`position`,`rotation`,`scale`,`skewX`,`skewY`,`matrix`,`worldMatrix`]);var ga=ha,_a={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(z.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(z.Types.change,this._renderer.flagMatrix),va.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof B&&this._scale.unbind(z.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof B&&this._scale.bind(z.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Yr(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function va(){this._flagMatrix=!0}var ya=/^(?:none|transparent)$/i,ba=8,xa=2**-52;function Sa(e,t){return{x:e,y:t}}function Ca(e,t,n=xa){return Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n}function wa(e,t,n,r){let i=e*n+t*r,a=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r)||1e-12,o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function Ta(e,t,n){if(!e)return[Sa(t.x,t.y)];let r=t.rx,i=t.ry;if(!(r&&i))return[Sa(t.x,t.y)];let a=(t.xAxisRotation||0)*Math.PI/180,o=+!!t.largeArcFlag,s=+!!t.sweepFlag;r=Math.abs(r),i=Math.abs(i);let c=e.x,l=e.y,u=t.x,d=t.y,f=(c-u)/2,p=(l-d)/2,m=Math.cos(a),h=Math.sin(a),g=m*f+h*p,_=-h*f+m*p,v=r*r,y=i*i,b=g*g/v+_*_/y;if(b>1){let e=Math.sqrt(b);r*=e,i*=e,v=r*r,y=i*i}let x=v*_*_+y*g*g,S=x===0?0:(v*y-x)/x,C=Math.sqrt(Math.max(0,S));o===s&&(C=-C);let w=C*r*_/i,T=-C*i*g/r,E=m*w-h*T+(c+u)/2,D=h*w+m*T+(l+d)/2,O=wa(1,0,(g-w)/r,(_-T)/i),k=O+wa((g-w)/r,(_-T)/i,(-g-w)/r,(-_-T)/i)%Gr,A=s===0,ee=(()=>{let e=k-O,t=Math.abs(e)<2**-52,n=$r(e,Gr);return n<2**-52&&(n=t?0:Gr),A&&!t&&(n=n===Gr?-Gr:n-Gr),n})(),j=Math.max(ci.Resolution,Math.max(n*2,1)),te=[];for(let e=1;e<=j;e++){let t=O+e/j*ee,n=E+r*Math.cos(t),o=D+i*Math.sin(t);if(a!==0){let e=n-E,t=o-D,r=Math.cos(a),i=Math.sin(a);n=e*r-t*i+E,o=e*i+t*r+D}te.push(Sa(n,o))}return te}function Ea(e,t=ba){let n=[],r=[],i=e._renderer&&e._renderer.vertices&&e._renderer.vertices.length>0?e._renderer.vertices:e.vertices;if(!i||i.length===0)return{polygons:n,segments:r};let a=Math.max(1,Math.floor(t)),o=null,s=null,c=null,l=null,u=(e=!1)=>{if(o){if(e&&s&&c&&!Ca(s,c)){let e=Sa(s.x,s.y);r.push({a:c,b:e}),o.push(e),c=e}o.length>=3&&s&&c&&Ca(s,c)&&n.push(o),o=null,s=null,c=null}},d=e=>{c?Ca(c,e)||(r.push({a:c,b:e}),o&&o.push(e),c=e):(c=e,o&&o.push(e))};for(let e=0;e<i.length;e++){let t=i[e],n=t.command||(e===0?R.move:R.line);if(n===R.move){u(!1);let e=Sa(t.x,t.y);o=[e],s=e,c=e,l=t}else{if(l||=i[Math.max(e-1,0)],n===R.line)d(Sa(t.x,t.y));else if(n===R.curve){let e=sa(t,l,a);for(let t=1;t<e.length;t++){let n=e[t];d(Sa(n.x,n.y))}d(Sa(t.x,t.y))}else if(n===R.arc){let e=Ta(l,t,a);for(let t=0;t<e.length;t++)d(e[t])}else if(n===R.close){u(!0),l=t;continue}else d(Sa(t.x,t.y));l=t}}return o&&u(!!e._closed||!!e.closed||s&&c&&!Ca(s,c)),{polygons:n,segments:r}}function Da(e,t,n){let r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(!a||a.length<3)continue;let o=a.length-1;for(let e=0;e<a.length;e++){let i=a[o],s=a[e];s.y>n!=i.y>n&&t<(i.x-s.x)*(n-s.y)/(i.y-s.y||1e-12)+s.x&&(r=!r),o=e}}return r}function Oa(e,t,n,r){let i=r.x-n.x,a=r.y-n.y;if(Math.abs(i)<xa&&Math.abs(a)<xa){let r=e-n.x,i=t-n.y;return r*r+i*i}let o=((e-n.x)*i+(t-n.y)*a)/(i*i+a*a),s=Math.max(0,Math.min(1,o)),c=n.x+s*i,l=n.y+s*a,u=e-c,d=t-l;return u*u+d*d}function ka(e,t,n){if(!e||e.length===0)return 1/0;let r=1/0;for(let i=0;i<e.length;i++){let a=e[i],o=Oa(t,n,a.a,a.b);o<r&&(r=o)}return Math.sqrt(r)}function Aa(e,t){if(typeof t==`boolean`)return t;let n=e.fill;return!n&&n!==0?!1:typeof n!=`string`||!ya.test(n)}function ja(e,t){let n=typeof e.linewidth==`number`?e.linewidth:e._linewidth||0;if(typeof t==`boolean`)return t&&n>0;if(!(n>0))return!1;let r=e.stroke;return!r&&r!==0?!1:typeof r!=`string`||!ya.test(r)}function Ma(e,t,n,r=0){if(!e)return!1;let i=e.left-r,a=e.right+r,o=e.top-r,s=e.bottom+r;return t>=i&&t<=a&&n>=o&&n<=s}var Na=2**-52;function Pa(e){return typeof e.relative!=`boolean`||!!e.relative}function Fa(e,t,n,r){let i=e.controls;i&&i[t]&&(Math.abs(n)<Na&&Math.abs(r)<Na?Pa(e)?i[t].clear():i[t].set(e.x,e.y):Pa(e)?i[t].set(n,r):i[t].set(e.x+n,e.y+r))}function Ia(e,t){Fa(e,t,0,0)}function La(e,t){let n=e.controls;return!n||!n[t]?{x:0,y:0}:Pa(e)?{x:n[t].x,y:n[t].y}:{x:n[t].x-e.x,y:n[t].y-e.y}}function Ra(e,t){let n=La(e,t);return Math.abs(n.x)>Na||Math.abs(n.y)>Na}function za(e){e.command!==R.move&&e.command!==R.close&&(e.command=Ra(e,`left`)||Ra(e,`right`)?R.curve:R.line)}function Ba(e,t){typeof t.relative==`boolean`&&(e.relative=t.relative)}function Va(e,t){return Ra(t,`right`)||Ra(e,`left`)||Ra(e,`right`)||Ra(t,`left`)||e.command===R.curve||t.command===R.curve}function Ha(e,t,n){return{x:Xr(e.x,t.x,n),y:Xr(e.y,t.y,n)}}function Ua(e,t){let n=e.controls&&e.controls[t];return n?Pa(e)?{x:e.x+n.x,y:e.y+n.y}:{x:n.x,y:n.y}:{x:e.x,y:e.y}}function Wa(e,t,n){let r=e.controls&&e.controls.right,i=t.controls&&t.controls.left,a={x:e.x,y:e.y},o=r?Ua(e,`right`):Nr({},a),s={x:t.x,y:t.y},c=i?Ua(t,`left`):Nr({},s),l=Ha(a,o,n),u=Ha(o,c,n),d=Ha(c,s,n),f=Ha(l,u,n),p=Ha(u,d,n),m=Ha(f,p,n),h=new V(m.x,m.y);return Ba(h,e),Fa(h,`left`,f.x-m.x,f.y-m.y),Fa(h,`right`,p.x-m.x,p.y-m.y),h.command=R.curve,{anchor:h,startOut:l,endIn:d}}function Ga(e,t,n,r,i,a){let o=e.length,s=n-t+1,c=s-1,l=i?Math.min(s,4):1,u=l,d=l;if(r||(u=Math.min(1,t),d=Math.min(1,o-n-1)),c+=u+d,c<=1)return;let f=Array(c+1);for(let n=0,r=t-u;n<=c;n+=1,r+=1){let t=$r(r,o);f[n]=e[t]}let p=f[0].x+2*f[1].x,m=f[0].y+2*f[1].y,h=2,g=c-1,_=[p],v=[m],y=[h],b=Array(c+1),x=Array(c+1);for(let e=1;e<c;e+=1){let t=e<g,n=t||a?1:2,r=t?4:a?2:7,i=t?4:a?3:8,o=t?2:+!a,s=n/h;h=y[e]=r-s,p=_[e]=i*f[e].x+o*f[e+1].x-s*p,m=v[e]=i*f[e].y+o*f[e+1].y-s*m}b[g]=_[g]/y[g],x[g]=v[g]/y[g];for(let e=c-2;e>=0;--e)b[e]=(_[e]-b[e+1])/y[e],x[e]=(v[e]-x[e+1])/y[e];b[c]=(3*f[c].x-b[g])/2,x[c]=(3*f[c].y-x[g])/2;let S=c-d;for(let n=u,r=t;n<=S;n+=1,r+=1){let t=e[$r(r,o)],a=b[n]-t.x,s=x[n]-t.y;i||n<S?Fa(t,`right`,a,s):Ia(t,`right`),i||n>u?Fa(t,`left`,-a,-s):Ia(t,`left`),za(t)}}function Ka(e,t,n,r,i,a){let o=t||e,s=e,c=n||e,l=B.distanceBetween(o,s),u=B.distanceBetween(s,c),d=r===void 0?.5:r,f=l**+d,p=u**+d,m=f*f,h=p*p;if(!i&&t){let t=2*h+3*p*f+m,n=3*p*(p+f);n===0?Ia(e,`left`):Fa(e,`left`,(h*o.x+t*s.x-m*c.x)/n-s.x,(h*o.y+t*s.y-m*c.y)/n-s.y)}else Ia(e,`left`);if(!a&&n){let t=2*m+3*f*p+h,n=3*f*(f+p);n===0?Ia(e,`right`):Fa(e,`right`,(m*c.x+t*s.x-h*o.x)/n-s.x,(m*c.y+t*s.y-h*o.y)/n-s.y)}else Ia(e,`right`);za(e)}function qa(e,t,n,r,i,a){if(!(t&&n)){t||Ia(e,`left`),n||Ia(e,`right`),za(e);return}let o=t,s=e,c=n,l=B.distanceBetween(o,s),u=l+B.distanceBetween(s,c),d=r===void 0?.4:r,f={x:o.x-c.x,y:o.y-c.y};if(!i&&u!==0){let t=d*l/u;Fa(e,`left`,f.x*t,f.y*t)}else Ia(e,`left`);if(!a&&u!==0){let t=d*l/u-d;Fa(e,`right`,f.x*t,f.y*t)}else Ia(e,`right`);za(e)}function Ja(e,t,n,r,i,a){let o=a.type||`catmull-rom`,s=a.factor,c=e.length;for(let r=t;r<=n;r+=1){let a=e[$r(r,c)];if(a.command===R.move){Ia(a,`left`),Ia(a,`right`);continue}let l=r===t&&!i?null:r-1,u=r===n&&!i?null:r+1,d=l===null?null:e[$r(l,c)],f=u===null?null:e[$r(u,c)],p=l===null,m=u===null;o===`geometric`?qa(a,d,f,s,p,m):Ka(a,d,f,s,p,m)}}var Ya=Math.min,Xa=Math.max,Za=Math.ceil,Qa=Math.floor,$a=new B;function eo(e,t,n){let r=e.controls&&e.controls[t];r&&(e.relative?r.multiplyScalar(n):r.lerp(e,1-n))}var to=new ma,no=class e extends ga{constructor(e,t,n,r){super(),L(this,`_flagVertices`,!0),L(this,`_flagLength`,!0),L(this,`_flagFill`,!0),L(this,`_flagStroke`,!0),L(this,`_flagLinewidth`,!0),L(this,`_flagOpacity`,!0),L(this,`_flagVisible`,!0),L(this,`_flagCap`,!0),L(this,`_flagJoin`,!0),L(this,`_flagMiter`,!0),L(this,`_flagStrokeAttenuation`,!0),L(this,`_flagMask`,!1),L(this,`_flagClip`,!1),L(this,`_length`,0),L(this,`_fill`,`#fff`),L(this,`_stroke`,`#000`),L(this,`_linewidth`,1),L(this,`_opacity`,1),L(this,`_visible`,!0),L(this,`_cap`,`round`),L(this,`_join`,`round`),L(this,`_miter`,4),L(this,`_closed`,!0),L(this,`_curved`,!1),L(this,`_automatic`,!0),L(this,`_beginning`,0),L(this,`_ending`,1),L(this,`_mask`,null),L(this,`_clip`,!1),L(this,`_dashes`,null),L(this,`_strokeAttenuation`,!0);for(let e in ro)Object.defineProperty(this,e,ro[e]);this._renderer.type=`path`,this._renderer.flagVertices=io.bind(this),this._renderer.bindVertices=ao.bind(this),this._renderer.unbindVertices=oo.bind(this),this._renderer.flagFill=so.bind(this),this._renderer.flagStroke=co.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,this.beginning=0,this.ending=1,this.fill=`#fff`,this.stroke=`#000`,this.linewidth=1,this.opacity=1,this.className=``,this.visible=!0,this.cap=`butt`,this.join=`miter`,this.miter=4,this.vertices=e,this.automatic=!r,this.dashes=[],this.dashes.offset=0}static fromObject(t){let n=typeof t.fill==`string`?t.fill:ca(t.fill),r=typeof t.stroke==`string`?t.stroke:ca(t.stroke),i=new e().copy(Pr(Nr({},t),{fill:n,stroke:r}));return`id`in t&&(i.id=t.id),i}copy(t){if(super.copy.call(this,t),t.vertices){this.vertices=[];for(let e=0;e<t.vertices.length;e++){let n=t.vertices[e];n instanceof V?this.vertices.push(t.vertices[e].clone()):this.vertices.push(new V().copy(n))}}for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e;for(let e=0;e<this.vertices.length;e++)n.vertices.push(this.vertices[e].clone());for(let t=0;t<e.Properties.length;t++){let r=e.Properties[t];n[r]=this[r]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let t=super.toObject.call(this);return t.renderer.type=`path`,t.vertices=this.vertices.map(e=>e.toObject()),H.each(e.Properties,e=>{this[e]!==void 0&&(this[e].toObject?t[e]=this[e].toObject():t[e]=this[e])},this),t}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind==`function`)try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){let t=this.vertices[e];typeof t.unbind==`function`&&t.unbind(),t.controls&&(t.controls.left&&typeof t.controls.left.unbind==`function`&&t.controls.left.unbind(),t.controls.right&&typeof t.controls.right.unbind==`function`&&t.controls.right.unbind())}return typeof this.fill==`object`&&typeof this.fill.dispose==`function`?this.fill.dispose():typeof this.fill==`object`&&typeof this.fill.unbind==`function`&&this.fill.unbind(),typeof this.stroke==`object`&&typeof this.stroke.dispose==`function`?this.stroke.dispose():typeof this.stroke==`object`&&typeof this.stroke.unbind==`function`&&this.stroke.unbind(),this}noFill(){return this.fill=`none`,this}noStroke(){return this.stroke=`none`,this.linewidth=0,this}corner(){let e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,i=e.top+e.height/2;for(let e=0;e<this.vertices.length;e++){let a=this.vertices[e];a.x-=r,a.y-=i,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=i,this.mask.translation.y+=n),this}center(){let e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let e=0;e<this.vertices.length;e++){let r=this.vertices[e];r.x-=t,r.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,i,a,o,s=1/0,c=-1/0,l=1/0,u=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke)){if(this.matrix.manual){let{scaleX:e,scaleY:r}=qr(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof e==`number`&&typeof r==`number`&&(n=Math.max(e,r)*(this.linewidth||0)/2)}else n*=typeof this.scale==`number`?this.scale:Math.max(this.scale.x,this.scale.y)}if(r<=0)return{width:0,height:0};for(i=0;i<r;i++){o=this._renderer.vertices[i],a=this._renderer.vertices[(i+r-1)%r];let[e,d]=t.multiply(a.x,a.y),[f,p]=t.multiply(o.x,o.y);if(a.controls&&o.controls){let r=a.controls.right.x,i=a.controls.right.y;a.relative&&(r+=a.x,i+=a.y);let[m,h]=t.multiply(r,i),g=o.controls.left.x,_=o.controls.left.y;o.relative&&(g+=o.x,_+=o.y);let[v,y]=t.multiply(g,_),b=pi(e,d,m,h,v,y,f,p);l=Ya(b.min.y-n,l),s=Ya(b.min.x-n,s),c=Xa(b.max.x+n,c),u=Xa(b.max.y+n,u)}else i<=1&&(l=Ya(d-n,l),s=Ya(e-n,s),c=Xa(e+n,c),u=Xa(d+n,u)),l=Ya(p-n,l),s=Ya(f-n,s),c=Xa(f+n,c),u=Xa(p+n,u)}return{top:l,left:s,right:c,bottom:u,width:c-s,height:u-l}}contains(e,t,n){let r=n||{},i=r.ignoreVisibility===!0;if(!i&&this.visible===!1||!i&&typeof this.opacity==`number`&&this.opacity<=0)return!1;let a=typeof r.tolerance==`number`?r.tolerance:0;this._update(!0);let o=this.getBoundingClientRect();if(!o||e<o.left-a||e>o.right+a||t<o.top-a||t>o.bottom+a)return!1;let s=this.worldMatrix,c=s&&s.inverse(to);if(!c)return super.contains(e,t,r);let[l,u]=c.multiply(e,t,1),d=typeof r.precision==`number`&&!Number.isNaN(r.precision)?Math.max(1,Math.floor(r.precision)):8,f=Aa(this,r.fill),p=ja(this,r.stroke),{polygons:m,segments:h}=Ea(this,d);if(f&&m.length>0&&Da(m,l,u))return!0;if(p&&h.length>0){let e=typeof this.linewidth==`number`?this.linewidth:0;if(e>0&&ka(h,l,u)<=e/2+a)return!0}return!f&&!p||f&&m.length===0?super.contains(e,t,r):!1}getPointAt(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=this.length*Math.min(Math.max(e,0),1),v=this.vertices.length,y=v-1,b=this._lengths.length===v+1?this._closingSubpathStart:-1,x=null,S=null;for(let t=0,i=this._lengths.length,a=0;t<i;t++){if(a+this._lengths[t]>=_){t===v?(n=b,r=y):this.vertices[t].command===R.close&&this._closeSubpathStarts?(n=this._closeSubpathStarts[t],r=Math.max(t-1,0)):(n=t,r=Math.min(Math.max(t-1,0),y)),x=this.vertices[n],S=this.vertices[r],_-=a,e=this._lengths[t]===0?0:_/this._lengths[t];break}a+=this._lengths[t]}if(x===null||S===null)return null;if(!x)return S;if(!S)return x;g=S.controls&&S.controls.right,h=x.controls&&x.controls.left,o=S.x,d=S.y,s=(g||S).x,f=(g||S).y,c=(h||x).x,p=(h||x).y,l=x.x,m=x.y,g&&S.relative&&(s+=S.x,f+=S.y),h&&x.relative&&(c+=x.x,p+=x.y),a=ui(e,o,s,c,l),u=ui(e,d,f,p,m);let C=Xr(o,s,e),w=Xr(d,f,e),T=Xr(s,c,e),E=Xr(f,p,e),D=Xr(c,l,e),O=Xr(p,m,e),k=Xr(C,T,e),A=Xr(w,E,e),ee=Xr(T,D,e),j=Xr(E,O,e);return H.isObject(t)?(t.x=a,t.y=u,t instanceof V&&(t.controls.left.x=k,t.controls.left.y=A,t.controls.right.x=ee,t.controls.right.y=j,(typeof t.relative!=`boolean`||t.relative)&&(t.controls.left.x-=a,t.controls.left.y-=u,t.controls.right.x-=a,t.controls.right.y-=u)),t.t=e,t):(i=new V(a,u,k-a,A-u,ee-a,j-u,this._curved?R.curve:R.line),i.t=e,i)}plot(){if(this.curved)return hi(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?R.move:R.line;return this}smooth(e){let t=e||{},n=t.type||`continuous`,r=this._collection,i=r.length;if(i<2)return this;let a=this._closed||i>0&&r[i-1]&&r[i-1].command===R.close,o=(e,t)=>{if(e==null)return t;if(typeof e==`number`){if(a)return $r(e,i);let t=e;return t<0&&(t+=i),Math.min(Math.max(t,0),i-1)}let n=r.indexOf(e);return n===-1?t:n},s=a&&t.from===void 0&&t.to===void 0,c=o(t.from,0),l=o(t.to,i-1);if(c>l){if(a)c-=i;else{let e=c;c=l,l=e}}let u=l-c+1;for(let e=0;e<u;e+=1){let t=$r(c+e,i),n=r[t],o=!a&&t===0;n.command===R.move&&!o&&(n.command=R.line)}if(n===`continuous`||n===`asymmetric`)Ga(r,c,l,a,s,n===`asymmetric`);else if(n===`catmull-rom`||n===`geometric`){let e={type:n,factor:t.factor};Ja(r,c,l,a,s,e)}else throw Error(`Path.smooth does not support type "${n}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(e){this._update();let t=this.vertices,n=t.length;if(n<2)return this;let r=[],i=null,a=null;for(let o=0;o<n;o+=1){let n=t[o];if(!i||n.command===R.move){let e=n.clone();r.push(e),i=n,a=n}else{if(Va(n,i)){let t=sa(n,i,e).length,a=r[r.length-1],o=a.clone(),s=n.clone(),c=a,l=0;if(t<=1){let e=n.clone();r.push(e)}else{for(let e=1;e<t;e+=1){let n=e/t,i=1-l,a=i<=2**-52?n:(n-l)/i,u=Wa(o,s,a);Fa(c,`right`,u.startOut.x-c.x,u.startOut.y-c.y);let d=u.anchor;r.push(d),c=d,o=d.clone(),l=n,Fa(s,`left`,u.endIn.x-s.x,u.endIn.y-s.y)}let e=n.clone();e.controls.left.copy(s.controls.left),r.push(e)}}else{let t=sa(n,i,e);for(let e=1;e<t.length;e+=1){let n=t[e];Ba(n,i),Ia(n,`left`),Ia(n,`right`),n.command=R.line,r.push(n)}let a=n.clone();r.push(a)}i=n,n.command===R.close&&(i=a)}}return this._automatic=!1,this._curved=!1,this.vertices=r,this}_updateLength(e,t){t||this._update();let n=this.vertices.length,r=n-1,i=n>0&&this.vertices[r].command===R.close,a=n>1&&this._closed&&!i,o=0;this._closeSubpathStarts=[],this._needsImplicitClose=a;let s=this.vertices[0],c=0;return this._lengths===void 0&&(this._lengths=[]),this._lengths.length=n,H.each(this.vertices,function(t,n){n<=0||t.command===R.move?(o=n,s=t,this._lengths[n]=0):(t.command===R.close?(this._closeSubpathStarts[n]=o,this._lengths[n]=oa(this.vertices[o],s,e),s=this.vertices[o]):(this._lengths[n]=oa(t,s,e),s=t),c+=this._lengths[n])},this),this._closingSubpathStart=o,a&&(this._lengths[n]=oa(this.vertices[o],this.vertices[r],e),c+=this._lengths[n]),this._length=c,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);let e=this._collection.length,t=e-1,n=this._closed,r=Math.min(this._beginning,this._ending),i=Math.max(this._beginning,this._ending),a=aa(this,r*this._length),o=aa(this,i*this._length),s=Za(a),c=Qa(o),l=r===0&&i===1,u=this._needsImplicitClose&&a>t,d=this._needsImplicitClose&&!l&&o>t,f,p,m,h,g,_;for(this._renderer.vertices.length=0,_=0;_<e;_++)if(this._renderer.collection.length<=_&&this._renderer.collection.push(new V),_>c&&!p)g=this._renderer.collection[_].copy(this._collection[_]),this.getPointAt(i,g),g.command=this._collection[_].command===R.close?R.line:this._renderer.collection[_].command,this._renderer.vertices.push(g),p=g,m=this._collection[_-1],m&&m.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),m.relative?this._renderer.collection[_-1].controls.right.copy(m.controls.right).lerp(B.zero,1-g.t):this._renderer.collection[_-1].controls.right.copy(m.controls.right).lerp(m,1-g.t));else if(_>=s&&_<=c){if(g=this._renderer.collection[_].copy(this._collection[_]),!l&&g.command===R.close){let e=this._closeSubpathStarts[_];typeof e==`number`&&(g.copy(this._collection[e]),g.command=R.line)}this._renderer.vertices.push(g),_===c&&ia(this,i)?(p=g,!n&&p.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p))):_===s&&ia(this,r)&&(f=g,f.command=R.move,!n&&f.controls&&(f.relative?f.controls.left.clear():f.controls.left.copy(f)))}if(u){let e=new V,n=new V;this.getPointAt(r,e),this.getPointAt(i,n);let a=this._collection[t].command===R.curve,o=e.t,s=n.t;if(e.command=R.move,e.controls.left.clear(),n.controls.right.clear(),a){let t=Math.max(s-o,0);eo(e,`right`,o<1?t/(1-o):0),eo(n,`left`,s>0?t/s:0),n.command=R.curve}else e.controls.right.clear(),n.controls.left.clear(),n.command=R.line;this._renderer.vertices.length=0,this._renderer.vertices.push(e,n),f=e,p=n}else if(d&&!p){let e=new V;this.getPointAt(i,e);let n=this._renderer.vertices[this._renderer.vertices.length-1];this._collection[t].command===R.curve?(eo(n,`right`,e.t),e.command=R.curve):(e.controls.left.clear(),e.command=R.line),e.controls.right.clear(),this._renderer.vertices.push(e),p=e}s>0&&!f&&(_=s-1,g=this._renderer.collection[_].copy(this._collection[_]),this.getPointAt(r,g),g.command=R.move,this._renderer.vertices.unshift(g),h=this._collection[_+1],h&&h.controls&&(g.controls.left.clear(),h.relative?this._renderer.collection[_+1].controls.left.copy(h.controls.left).lerp(B.zero,g.t):($a.copy(h),this._renderer.collection[_+1].controls.left.copy(h.controls.left).lerp(h,g.t)))),this._renderer.closed=n&&r===0&&i===1}return ga.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,ga.prototype.flagReset.call(this),this}};L(no,`Properties`,[`fill`,`stroke`,`linewidth`,`opacity`,`visible`,`cap`,`join`,`miter`,`closed`,`curved`,`automatic`,`beginning`,`ending`,`dashes`,`strokeAttenuation`]),L(no,`Utils`,{getCurveLength:oa});var U=no,ro={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Wi||this._fill instanceof Xi||this._fill instanceof ea||this._fill instanceof Ii)&&this._fill.unbind(z.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Wi||this._fill instanceof Xi||this._fill instanceof ea||this._fill instanceof Ii)&&this._fill.bind(z.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Wi||this._stroke instanceof Xi||this._stroke instanceof ea||this._stroke instanceof Ii)&&this._stroke.unbind(z.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Wi||this._stroke instanceof Xi||this._stroke instanceof ea||this._stroke instanceof Ii)&&this._stroke.bind(z.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=!!e,this._flagVertices=!0,this._flagLength=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;let t=this._automatic?`ignore`:`listen`;H.each(this.vertices,function(e){e[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){let t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(z.Types.insert,t).unbind(z.Types.remove,n),this._collection=e instanceof ki?e:new ki(e||[]),this._collection.bind(z.Types.insert,t).bind(z.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,H.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!=`number`&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(e){this._strokeAttenuation=!!e,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function io(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function ao(e){let t=e.length;for(;t--;)e[t].bind(z.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function oo(e){let t=e.length;for(;t--;)e[t].unbind(z.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function so(){this._flagFill=!0}function co(){this._flagStroke=!0}var lo=class e extends U{constructor(e,t,n,r){let i=[new V,new V,new V,new V];super(i,!0,!1,!0),L(this,`_flagWidth`,!1),L(this,`_flagHeight`,!1),L(this,`_width`,0),L(this,`_height`,0),L(this,`_origin`,null),this._renderer.type=`rectangle`;for(let e in fo)Object.defineProperty(this,e,fo[e]);this.width=typeof n==`number`?n:1,this.height=typeof r==`number`?r:1,this.origin=new B,typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t),this._update()}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(typeof t[r]==`number`?this[r]=t[r]:this[r]instanceof B&&this[r].copy(t[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new V),this.vertices[0].set(-e,-t).sub(this._origin).command=R.move,this.vertices[1].set(e,-t).sub(this._origin).command=R.line,this.vertices[2].set(e,t).sub(this._origin).command=R.line,this.vertices[3].set(-e,t).sub(this._origin).command=R.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=R.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(t){let n=new e(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];n[t]instanceof B?n[t].copy(this[t]):n[t]=this[t]}return t&&t.add(n),n}toObject(){let e=super.toObject.call(this);return e.renderer.type=`rectangle`,e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};L(lo,`Properties`,[`width`,`height`,`origin`]);var uo=lo,fo={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(z.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(z.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},po=class e extends uo{constructor(e,t,n,r,i,a){super(t,n,0,0),L(this,`_flagTexture`,!1),L(this,`_flagColumns`,!1),L(this,`_flagRows`,!1),L(this,`_flagFrameRate`,!1),L(this,`_flagIndex`,!1),L(this,`_amount`,1),L(this,`_duration`,0),L(this,`_startTime`,0),L(this,`_playing`,!1),L(this,`_firstFrame`,0),L(this,`_lastFrame`,0),L(this,`_loop`,!0),L(this,`_texture`,null),L(this,`_columns`,1),L(this,`_rows`,1),L(this,`_frameRate`,0),L(this,`_index`,0),L(this,`_origin`,null),this._renderer.type=`sprite`;for(let e in ho)Object.defineProperty(this,e,ho[e]);this.noStroke(),this.noFill(),e instanceof Ii?this.texture=e:typeof e==`string`&&(this.texture=new Ii(e)),this.origin=new B,this._update(),typeof r==`number`&&(this.columns=r),typeof i==`number`&&(this.rows=i),typeof a==`number`&&(this.frameRate=a),this.index=0}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=H.performance.now(),typeof e==`number`&&(this._firstFrame=e),typeof t==`number`&&(this._lastFrame=t),typeof n==`function`?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(t){let n=new e(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,t&&t.add(n),n}toObject(){let e=super.toObject.call(this);return e.renderer.type=`sprite`,e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&=!1,this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose==`function`?this._texture.dispose():this._texture&&typeof this._texture.unbind==`function`&&this._texture.unbind(),this}_update(){let e=this._texture,t=this._columns,n=this._rows,r,i,a,o,s,c,l,u,d;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){l=e.image.width,u=e.image.height,r=l/t,i=u/n,o=this._amount,this.width!==r&&(this.width=r),this.height!==i&&(this.height=i),this._playing&&this._frameRate>0&&(H.isNaN(this._lastFrame)&&(this._lastFrame=o-1),a=H.performance.now()-this._startTime,d=this._lastFrame+1,s=1e3*(d-this._firstFrame)/this._frameRate,this._loop?a%=s:a=Math.min(a,s),c=Xr(this._firstFrame,d,a/s),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));let f=this._index%t,p=Math.floor(this._index/t),m=-r*f+(l-r)/2,h=-i*p+(u-i)/2;m!==e.offset.x&&(e.offset.x=m),h!==e.offset.y&&(e.offset.y=h)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};L(po,`Properties`,[`texture`,`columns`,`rows`,`frameRate`,`index`,`firstFrame`,`lastFrame`,`loop`]);var mo=po,ho={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},go,_o=class extends ki{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),Rr(this,go,{}),this.attach(e),this.on(z.Types.insert,this.attach),this.on(z.Types.remove,this.detach)}get ids(){return Lr(this,go)}attach(e){for(let t=0;t<e.length;t++){let n=e[t];n&&n.id&&(this.ids[n.id]=n)}return this}detach(e){for(let t=0;t<e.length;t++)delete this.ids[e[t].id];return this}};go=new WeakMap;var vo=class e extends U{constructor(e,t,n,r,i,a,o){let s=o||ci.Resolution*3,c=[];for(let e=0;e<s;e++)c.push(new V);super(c,!0,!1,!0),L(this,`_flagStartAngle`,!1),L(this,`_flagEndAngle`,!1),L(this,`_flagInnerRadius`,!1),L(this,`_flagOuterRadius`,!1),L(this,`_startAngle`,0),L(this,`_endAngle`,Gr),L(this,`_innerRadius`,0),L(this,`_outerRadius`,0),this._renderer.type=`arc-segment`;for(let e in bo)Object.defineProperty(this,e,bo[e]);typeof n==`number`&&(this.innerRadius=n),typeof r==`number`&&(this.outerRadius=r),typeof i==`number`&&(this.startAngle=i),typeof a==`number`&&(this.endAngle=a),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){let e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,i=$r(e,Gr)===$r(t,Gr),a=n>0,o=this.vertices,s=a?o.length/2:o.length,c,l=0,u,d,f,p,m,h,g,_,v;for(i?s--:a||(s-=2),u=0,d=s-1;u<s;u++){switch(f=u/d,p=o[l],m=f*(t-e)+e,h=(t-e)/s,g=r*Math.cos(m),_=r*Math.sin(m),u){case 0:c=R.move;break;default:c=R.curve}p.command=c,p.x=g,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===R.curve&&(v=r*h/Math.PI,p.controls.left.x=v*Math.cos(m-Kr),p.controls.left.y=v*Math.sin(m-Kr),p.controls.right.x=v*Math.cos(m+Kr),p.controls.right.y=v*Math.sin(m+Kr),u===1&&p.controls.left.multiplyScalar(2),u===d&&p.controls.right.multiplyScalar(2)),l++}if(a){for(i?(o[l].command=R.close,l++):(s--,d=s-1),u=0;u<s;u++)f=u/d,p=o[l],m=(1-f)*(t-e)+e,h=(t-e)/s,g=n*Math.cos(m),_=n*Math.sin(m),c=R.curve,u<=0&&(c=i?R.move:R.line),p.command=c,p.x=g,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===R.curve&&(v=n*h/Math.PI,p.controls.left.x=v*Math.cos(m+Kr),p.controls.left.y=v*Math.sin(m+Kr),p.controls.right.x=v*Math.cos(m-Kr),p.controls.right.y=v*Math.sin(m-Kr),u===1&&p.controls.left.multiplyScalar(2),u===d&&p.controls.right.multiplyScalar(2)),l++;o[l].copy(o[0]),o[l].command=R.line}else i||(o[l].command=R.line,o[l].x=0,o[l].y=0,l++,o[l].copy(o[0]),o[l].command=R.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(t){let n=this.innerRadius,r=this.outerRadius,i=this.startAngle,a=this.endAngle,o=this.vertices.length,s=new e(0,0,n,r,i,a,o);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];s[t]=this[t]}return t&&t.add(s),s}toObject(){let t=super.toObject.call(this);t.renderer.type=`arc-segment`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(vo,`Properties`,[`startAngle`,`endAngle`,`innerRadius`,`outerRadius`]);var yo=vo,bo={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},xo=Math.cos,So=Math.sin,Co=class e extends U{constructor(e,t,n,r){let i=r?Math.max(r,2):4,a=[];for(let e=0;e<i;e++)a.push(new V(0,0,0,0,0,0));super(a,!0,!0,!0),L(this,`_flagRadius`,!1),L(this,`_radius`,0),this._renderer.type=`circle`;for(let e in To)Object.defineProperty(this,e,To[e]);typeof n==`number`&&(this.radius=n),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&--e;let t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let t=0;t<this.vertices.length;t++){let i=t/e*Gr,a=n*xo(i),o=n*So(i),s=r*xo(i-Kr),c=r*So(i-Kr),l=r*xo(i+Kr),u=r*So(i+Kr),d=this.vertices[t];d.command=t===0?R.move:R.curve,d.set(a,o),d.controls.left.set(s,c),d.controls.right.set(l,u)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(t){let n=new e(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];n[t]=this[t]}return t&&t.add(n),n}toObject(){let t=super.toObject.call(this);t.renderer.type=`circle`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(Co,`Properties`,[`radius`]);var wo=Co,To={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Eo=Math.cos,Do=Math.sin,Oo=class e extends U{constructor(e,t,n,r,i){typeof r!=`number`&&typeof n==`number`&&(r=n);let a=i?Math.max(i,2):4,o=[];for(let e=0;e<a;e++)o.push(new V);super(o,!0,!0,!0),L(this,`_flagWidth`,!1),L(this,`_flagHeight`,!1),L(this,`_width`,0),L(this,`_height`,0),this._renderer.type=`ellipse`;for(let e in Ao)Object.defineProperty(this,e,Ao[e]);typeof n==`number`&&(this.width=n*2),typeof r==`number`&&(this.height=r*2),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&--e;let t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let i=0;i<this.vertices.length;i++){let a=i/e*Gr,o=n*Eo(a),s=r*Do(a),c=n*t*Eo(a-Kr),l=r*t*Do(a-Kr),u=n*t*Eo(a+Kr),d=r*t*Do(a+Kr),f=this.vertices[i];f.command=i===0?R.move:R.curve,f.set(o,s),f.controls.left.set(c,l),f.controls.right.set(u,d)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(t){let n=this.width/2,r=this.height/2,i=this.vertices.length,a=new e(0,0,n,r,i);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];a[t]=this[t]}return t&&t.add(a),a}toObject(){let t=super.toObject.call(this);t.renderer.type=`ellipse`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(Oo,`Properties`,[`width`,`height`]);var ko=Oo,Ao={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},jo=Math.ceil,Mo=Math.floor,No=class e extends ga{constructor(e){super(),L(this,`_flagVertices`,!0),L(this,`_flagLength`,!0),L(this,`_flagFill`,!0),L(this,`_flagStroke`,!0),L(this,`_flagLinewidth`,!0),L(this,`_flagOpacity`,!0),L(this,`_flagVisible`,!0),L(this,`_flagSize`,!0),L(this,`_flagSizeAttenuation`,!0),L(this,`_flagStrokeAttenuation`,!0),L(this,`_length`,0),L(this,`_fill`,`#fff`),L(this,`_stroke`,`#000`),L(this,`_linewidth`,1),L(this,`_opacity`,1),L(this,`_visible`,!0),L(this,`_size`,1),L(this,`_sizeAttenuation`,!1),L(this,`_beginning`,0),L(this,`_ending`,1),L(this,`_dashes`,null),L(this,`_strokeAttenuation`,!0),L(this,`noFill`,U.prototype.noFill),L(this,`noStroke`,U.prototype.noStroke),L(this,`corner`,U.prototype.corner),L(this,`center`,U.prototype.center),L(this,`getBoundingClientRect`,U.prototype.getBoundingClientRect),L(this,`_updateLength`,U.prototype._updateLength);for(let e in Fo)Object.defineProperty(this,e,Fo[e]);this._renderer.type=`points`,this._renderer.flagVertices=io.bind(this),this._renderer.bindVertices=ao.bind(this),this._renderer.unbindVertices=oo.bind(this),this._renderer.flagFill=so.bind(this),this._renderer.flagStroke=co.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill=`#fff`,this.stroke=`#000`,this.linewidth=1,this.opacity=1,this.className=``,this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(t){let n=typeof t.fill==`string`?t.fill:ca(t.fill),r=typeof t.stroke==`string`?t.stroke:ca(t.stroke),i=new e().copy(Pr(Nr({},t),{fill:n,stroke:r}));return`id`in t&&(i.id=t.id),i}copy(t){super.copy.call(this,t);for(let e=0;e<t.vertices.length;e++){let n=t.vertices[e];n instanceof V?this.vertices.push(t.vertices[e].clone()):this.vertices.push(new V().copy(n))}for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e;for(let e=0;e<this.vertices.length;e++)n.vertices.push(this.vertices[e].clone());for(let t=0;t<e.Properties.length;t++){let r=e.Properties[t];n[r]=this[r]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let t=super.toObject.call(this);return t.renderer.type=`points`,t.vertices=this.vertices.map(e=>e.toObject()),H.each(e.Properties,function(e){this[e]!==void 0&&(this[e].toObject?t[e]=this[e].toObject():t[e]=this[e])},this),t}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind==`function`)try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){let t=this.vertices[e];typeof t.unbind==`function`&&t.unbind()}return typeof this.fill==`object`&&typeof this.fill.dispose==`function`?this.fill.dispose():typeof this.fill==`object`&&typeof this.fill.unbind==`function`&&this.fill.unbind(),typeof this.stroke==`object`&&typeof this.stroke.dispose==`function`?this.stroke.dispose():typeof this.stroke==`object`&&typeof this.stroke.unbind==`function`&&this.stroke.unbind(),this}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){let r=this.vertices[n],i=this.vertices[n-1];if(!i)continue;let a=r.x,o=r.y,s=i.x,c=i.y,l=di(a,o,a,o,s,c,s,c,e);t=t.concat(l)}return this.vertices=t,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);let e=Math.min(this._beginning,this._ending),t=Math.max(this._beginning,this._ending),n=aa(this,e*this._length),r=aa(this,t*this._length),i=jo(n),a=Mo(r),o=0,s;this._renderer.vertices=[],this._renderer.collection=[];for(let e=0;e<this._collection.length;e++)e>=i&&e<=a&&(s=this._collection[e],this._renderer.collection.push(s),this._renderer.vertices[o*2+0]=s.x,this._renderer.vertices[o*2+1]=s.y,o++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};L(No,`Properties`,[`fill`,`stroke`,`linewidth`,`opacity`,`visible`,`size`,`sizeAttenuation`,`beginning`,`ending`,`dashes`,`strokeAttenuation`]);var Po=No,Fo={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Wi||this._fill instanceof Xi||this._fill instanceof ea||this._fill instanceof Ii)&&this._fill.unbind(z.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Wi||this._fill instanceof Xi||this._fill instanceof ea||this._fill instanceof Ii)&&this._fill.bind(z.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Wi||this._stroke instanceof Xi||this._stroke instanceof ea||this._stroke instanceof Ii)&&this._stroke.unbind(z.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Wi||this._stroke instanceof Xi||this._stroke instanceof ea||this._stroke instanceof Ii)&&this._stroke.bind(z.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){let t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(z.Types.insert,t).unbind(z.Types.remove,n),this._collection=e instanceof ki?e:new ki(e||[]),this._collection.bind(z.Types.insert,t).bind(z.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!=`number`&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(e){this._strokeAttenuation=!!e,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},Io=Math.cos,Lo=Math.sin,Ro=class e extends U{constructor(e,t,n,r){r=Math.max(r||0,3),super(),L(this,`_flagWidth`,!1),L(this,`_flagHeight`,!1),L(this,`_flagSides`,!1),L(this,`_radius`,0),L(this,`_width`,0),L(this,`_height`,0),L(this,`_sides`,0),this._renderer.type=`polygon`;for(let e in Bo)Object.defineProperty(this,e,Bo[e]);this.closed=!0,this.automatic=!1,typeof n==`number`&&(this.radius=n),typeof r==`number`&&(this.sides=r),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){let e=this._sides,t=e+1,n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){let t=Gr*((r+.5)/e)+Math.PI/2,i=this._width*Io(t)/2,a=this._height*Lo(t)/2;r>=n?this.vertices.push(new V(i,a)):this.vertices[r].set(i,a),this.vertices[r].command=r===0?R.move:R.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(t){let n=new e(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];n[t]=this[t]}return t&&t.add(n),n}toObject(){let t=super.toObject.call(this);t.renderer.type=`polygon`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(Ro,`Properties`,[`width`,`height`,`sides`]);var zo=Ro,Bo={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Vo=class e extends U{constructor(e,t,n,r,i){i===void 0&&typeof n==`number`&&typeof r==`number`&&(i=Math.floor(Math.min(n,r)/12));let a=[];for(let e=0;e<10;e++)a.push(new V(0,0,0,0,0,0,e===0?R.move:R.curve));super(a),L(this,`_flagWidth`,!1),L(this,`_flagHeight`,!1),L(this,`_flagRadius`,!1),L(this,`_width`,0),L(this,`_height`,0),L(this,`_radius`,12),this._renderer.type=`rounded-rectangle`;for(let e in Uo)Object.defineProperty(this,e,Uo[e]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Wo.bind(this),typeof n==`number`&&(this.width=n),typeof r==`number`&&(this.height=r),(typeof i==`number`||i instanceof B)&&(this.radius=i),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];if(r in t){let e=t[r];/radius/i.test(r)?this[r]=typeof e==`number`||e instanceof B?e:new B().copy(e):typeof e==`number`&&(this[r]=e)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){let e=this._width,t=this._height,n,r;this._radius instanceof B?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let i,a=e/2,o=t/2;i=this.vertices[0],i.x=-(a-n),i.y=-o,i=this.vertices[1],i.x=a-n,i.y=-o,i.controls.left.clear(),i.controls.right.x=n,i.controls.right.y=0,i=this.vertices[2],i.x=a,i.y=-(o-r),i.controls.right.clear(),i.controls.left.clear(),i=this.vertices[3],i.x=a,i.y=o-r,i.controls.left.clear(),i.controls.right.x=0,i.controls.right.y=r,i=this.vertices[4],i.x=a-n,i.y=o,i.controls.right.clear(),i.controls.left.clear(),i=this.vertices[5],i.x=-(a-n),i.y=o,i.controls.left.clear(),i.controls.right.x=-n,i.controls.right.y=0,i=this.vertices[6],i.x=-a,i.y=o-r,i.controls.left.clear(),i.controls.right.clear(),i=this.vertices[7],i.x=-a,i.y=-(o-r),i.controls.left.clear(),i.controls.right.x=0,i.controls.right.y=-r,i=this.vertices[8],i.x=-(a-n),i.y=-o,i.controls.left.clear(),i.controls.right.clear(),i=this.vertices[9],i.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(t){let n=this.width,r=this.height,i=this.radius,a=new e(0,0,n,r,i);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];a[t]=this[t]}return t&&t.add(a),a}toObject(){let t=super.toObject.call(this);t.renderer.type=`rounded-rectangle`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t.radius=typeof this.radius==`number`?this.radius:this.radius.toObject(),t}};L(Vo,`Properties`,[`width`,`height`,`radius`]);var Ho=Vo,Uo={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof B&&this._radius.unbind(z.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof B&&this._radius.bind(z.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Wo(){this._flagRadius=!0}var Go=Math.cos,Ko=Math.sin,qo=class e extends U{constructor(e,t,n,r,i){arguments.length<=3&&(r=n,n=r/2),(typeof i!=`number`||i<=0)&&(i=5),super(),L(this,`_flagInnerRadius`,!1),L(this,`_flagOuterRadius`,!1),L(this,`_flagSides`,!1),L(this,`_innerRadius`,0),L(this,`_outerRadius`,0),L(this,`_sides`,0),this._renderer.type=`star`;for(let e in Yo)Object.defineProperty(this,e,Yo[e]);this.closed=!0,this.automatic=!1,typeof n==`number`&&(this.innerRadius=n),typeof r==`number`&&(this.outerRadius=r),typeof i==`number`&&(this.sides=i),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){let e=this._sides*2,t=e+1,n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){let t=Gr*((r+.5)/e),i=(r%2?this._outerRadius:this._innerRadius)/2,a=i*Go(t),o=i*Ko(t);r>=n?this.vertices.push(new V(a,o)):this.vertices[r].set(a,o),this.vertices[r].command=r===0?R.move:R.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(t){let n=this.innerRadius,r=this.outerRadius,i=this.sides,a=new e(0,0,n,r,i);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];a[t]=this[t]}return t&&t.add(a),a}toObject(){let t=super.toObject.call(this);t.renderer.type=`star`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(qo,`Properties`,[`innerRadius`,`outerRadius`,`sides`]);var Jo=qo,Yo={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Xo,Zo=Math.min,Qo=Math.max;Ur.document&&(Xo=document.createElement(`canvas`));var $o=class e extends ga{constructor(t,n,r,i){super(),L(this,`_flagValue`,!0),L(this,`_flagFamily`,!0),L(this,`_flagSize`,!0),L(this,`_flagLeading`,!0),L(this,`_flagAlignment`,!0),L(this,`_flagBaseline`,!0),L(this,`_flagStyle`,!0),L(this,`_flagWeight`,!0),L(this,`_flagDecoration`,!0),L(this,`_flagFill`,!0),L(this,`_flagStroke`,!0),L(this,`_flagLinewidth`,!0),L(this,`_flagOpacity`,!0),L(this,`_flagVisible`,!0),L(this,`_flagMask`,!1),L(this,`_flagClip`,!1),L(this,`_flagDirection`,!0),L(this,`_flagStrokeAttenuation`,!0),L(this,`_value`,``),L(this,`_family`,`sans-serif`),L(this,`_size`,13),L(this,`_leading`,17),L(this,`_alignment`,`center`),L(this,`_baseline`,`middle`),L(this,`_style`,`normal`),L(this,`_weight`,500),L(this,`_decoration`,`none`),L(this,`_direction`,`ltr`),L(this,`_fill`,`#000`),L(this,`_stroke`,`none`),L(this,`_linewidth`,1),L(this,`_opacity`,1),L(this,`_visible`,!0),L(this,`_mask`,null),L(this,`_clip`,!1),L(this,`_dashes`,null),L(this,`_strokeAttenuation`,!0);for(let e in ts)Object.defineProperty(this,e,ts[e]);if(this._renderer.type=`text`,this._renderer.flagFill=ns.bind(this),this._renderer.flagStroke=rs.bind(this),this.value=t,typeof n==`number`&&(this.translation.x=n),typeof r==`number`&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!H.isObject(i))return this;for(let t=0;t<e.Properties.length;t++){let n=e.Properties[t];n in i&&(this[n]=i[n])}}static Measure(t){if(Xo){let e=Xo.getContext(`2d`);e.font=[t._style,t._weight,`${t._size}px/${t._leading}px`,t._family].join(` `);let n=e.measureText(t.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}{let t=this.value.length*this.size*e.Ratio,n=this.leading;return console.warn(`Two.Text: unable to accurately measure text, so using an approximation.`),{width:t,height:n}}}static fromObject(t){let n=typeof t.fill==`string`?t.fill:ca(t.fill),r=typeof t.stroke==`string`?t.stroke:ca(t.stroke),i=new e().copy(Pr(Nr({},t),{fill:n,stroke:r}));return`id`in t&&(i.id=t.id),i}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let t=0;t<e.Properties.length;t++){let r=e.Properties[t];n[r]=this[r]}return this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let t=super.toObject.call(this);t.renderer.type=`text`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}dispose(){return super.dispose(),typeof this.fill==`object`&&typeof this.fill.dispose==`function`?this.fill.dispose():typeof this.fill==`object`&&typeof this.fill.unbind==`function`&&this.fill.unbind(),typeof this.stroke==`object`&&typeof this.stroke.dispose==`function`?this.stroke.dispose():typeof this.stroke==`object`&&typeof this.stroke.unbind==`function`&&this.stroke.unbind(),this}noFill(){return this.fill=`none`,this}noStroke(){return this.stroke=`none`,this.linewidth=0,this}getBoundingClientRect(t){let n,r,i,a,o;this._update(!0),n=t?this.matrix:this.worldMatrix;let{width:s,height:c}=e.Measure(this),l=(this._linewidth||0)/2;switch(this.alignment){case`left`:r=-l,i=s+l;break;case`right`:r=-(s+l),i=l;break;default:r=-(s/2+l),i=s/2+l}switch(this.baseline){case`middle`:a=-(c/2+l),o=c/2+l;break;default:a=-(c+l),o=l}let[u,d]=n.multiply(r,a),[f,p]=n.multiply(r,o),[m,h]=n.multiply(i,a),[g,_]=n.multiply(i,o);return a=Zo(d,p,h,_),r=Zo(u,f,m,g),i=Qo(u,f,m,g),o=Qo(d,p,h,_),{top:a,left:r,right:i,bottom:o,width:i-r,height:o-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};L($o,`Ratio`,.6),L($o,`Properties`,[`value`,`family`,`size`,`leading`,`alignment`,`linewidth`,`style`,`weight`,`decoration`,`direction`,`baseline`,`opacity`,`visible`,`fill`,`stroke`,`dashes`,`strokeAttenuation`]);var es=$o,ts={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Wi||this._fill instanceof Xi||this._fill instanceof ea||this._fill instanceof Ii)&&this._fill.unbind(z.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Wi||this._fill instanceof Xi||this._fill instanceof ea||this._fill instanceof Ii)&&this._fill.bind(z.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Wi||this._stroke instanceof Xi||this._stroke instanceof ea||this._stroke instanceof Ii)&&this._stroke.unbind(z.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Wi||this._stroke instanceof Xi||this._stroke instanceof ea||this._stroke instanceof Ii)&&this._stroke.bind(z.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,H.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!=`number`&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(e){this._strokeAttenuation=!!e,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function ns(){this._flagFill=!0}function rs(){this._flagStroke=!0}var is=class e extends uo{constructor(t,n,r,i){super(n,r,0,0),L(this,`_flagTextures`,!1),L(this,`_flagFrameRate`,!1),L(this,`_flagIndex`,!1),L(this,`_amount`,1),L(this,`_duration`,0),L(this,`_index`,0),L(this,`_startTime`,0),L(this,`_playing`,!1),L(this,`_firstFrame`,0),L(this,`_lastFrame`,0),L(this,`_loop`,!0),L(this,`_textures`,null),L(this,`_frameRate`,0),L(this,`_origin`,null),this._renderer.type=`image-sequence`;for(let e in os)Object.defineProperty(this,e,os[e]);this._renderer.flagTextures=ss.bind(this),this._renderer.bindTextures=cs.bind(this),this._renderer.unbindTextures=ls.bind(this),this.noStroke(),this.noFill(),Array.isArray(t)?this.textures=t.map(us.bind(this)):typeof t==`string`&&(this.textures=[us(t)]),this.origin=new B,this._update(),this.frameRate=typeof i==`number`?i:e.DefaultFrameRate,this.index=0}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=H.performance.now(),typeof e==`number`&&(this._firstFrame=e),typeof t==`number`&&(this._lastFrame=t),typeof n==`function`?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(t){let n=new e(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),t&&t.add(n),n}toObject(){let e=super.toObject.call(this);return e.renderer.type=`image-sequence`,e.textures=this.textures.map(function(e){return e.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&=!1,this._onLastFrame=null,this.textures&&typeof this.textures.unbind==`function`)try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){let t=this.textures[e];typeof t.dispose==`function`?t.dispose():typeof t.unbind==`function`&&t.unbind()}return this}_update(){let e=this._textures,t,n,r,i,a,o,s,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(i=this._amount,H.isNaN(this._lastFrame)&&(this._lastFrame=i-1),r=H.performance.now()-this._startTime,c=this._lastFrame+1,a=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r%=a:r=Math.min(r,a),s=Xr(this._firstFrame,c,r/a),s=Math.floor(s),s!==this._index&&(this._index=s,o=e[this._index],o.loaded&&(t=o.image.width,n=o.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=o,s>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Ii))&&(o=e[this._index],o.loaded&&(t=o.image.width,n=o.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=o)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};L(is,`Properties`,[`textures`,`frameRate`,`index`,`firstFrame`,`lastFrame`,`loop`]),L(is,`DefaultFrameRate`,30);var as=is,os={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){let t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(z.Types.insert,t).unbind(z.Types.remove,n),this._textures=new ki((e||[]).slice(0)),this._textures.bind(z.Types.insert,t).bind(z.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function ss(){this._flagTextures=!0}function cs(e){let t=e.length;for(;t--;)e[t].bind(z.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function ls(e){let t=e.length;for(;t--;)e[t].unbind(z.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function us(e){if(e instanceof Ii)return e;if(typeof e==`string`)return new Ii(e)}var ds=Math.min,fs=Math.max,ps={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],output:[],empty:[]}},ms=class e extends ga{constructor(e){super(),L(this,`_flagAdditions`,!1),L(this,`_flagSubtractions`,!1),L(this,`_flagOrder`,!1),L(this,`_flagOpacity`,!0),L(this,`_flagBeginning`,!1),L(this,`_flagEnding`,!1),L(this,`_flagLength`,!1),L(this,`_flagMask`,!1),L(this,`_fill`,`#fff`),L(this,`_stroke`,`#000`),L(this,`_linewidth`,1),L(this,`_opacity`,1),L(this,`_visible`,!0),L(this,`_cap`,`round`),L(this,`_join`,`round`),L(this,`_miter`,4),L(this,`_closed`,!0),L(this,`_curved`,!1),L(this,`_automatic`,!0),L(this,`_beginning`,0),L(this,`_ending`,1),L(this,`_length`,0),L(this,`_mask`,null),L(this,`_strokeAttenuation`,!0);for(let e in gs)Object.defineProperty(this,e,gs[e]);this._renderer.type=`group`,this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)_s.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)_s.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(t){let n=new e;for(let r=0;r<e.Properties.length;r++){let i=e.Properties[r];i in t&&(n[i]=/(fill|stroke)/i.test(i)?typeof t[i]==`string`?t[i]:ca(t[i]):t[i])}return`mask`in t&&(n.mask=r(t.mask)),`id`in t&&(n.id=t.id),n.children=t.children.map(r),n;function r(t){if(t&&t.renderer)switch(t.renderer.type){case`arc-segment`:return yo.fromObject(t);case`circle`:return wo.fromObject(t);case`element`:return ji.fromObject(t);case`ellipse`:return ko.fromObject(t);case`group`:return e.fromObject(t);case`image`:return Image.fromObject(t);case`image-sequence`:return as.fromObject(t);case`path`:return U.fromObject(t);case`points`:return Po.fromObject(t);case`polygon`:return zo.fromObject(t);case`rectangle`:return uo.fromObject(t);case`rounded-rectangle`:return Ho.fromObject(t);case`shape`:return ga.fromObject(t);case`sprite`:return mo.fromObject(t);case`star`:return Jo.fromObject(t);case`text`:return es.fromObject(t)}return t}}static IsVisible(e,t){if(!t)return!0;let n=e;for(;n;){if(typeof n.visible==`boolean`&&!n.visible||typeof n.opacity==`number`&&n.opacity<=0)return!1;n=n.parent}return!0}static VisitForHitTest(t,n,r,i,a,o,s){let c=t&&t.children;if(!c)return!1;let l=n.results;for(let t=c.length-1;t>=0;t--){let u=c[t];if(!u||!e.IsVisible(u,n.visibleOnly))continue;let d=typeof u.getBoundingClientRect==`function`?u.getBoundingClientRect():null;if(!d||Ma(d,n.x,n.y,o)){if(u instanceof e){if(r&&(!i||i(u))&&typeof u.contains==`function`&&u.contains(n.x,n.y,a)&&(l.push(u),s)||e.VisitForHitTest(u,n,r,i,a,o,s))return!0}else if(u instanceof ga&&(!i||i(u))&&typeof u.contains==`function`&&u.contains(n.x,n.y,a)&&(l.push(u),s))return!0}}return!1}copy(t){super.copy.call(this,t),console.warn(`Two.js: attempting to copy group. Two.Group.children copying not supported.`);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e,r=this.children.map(function(e){return e.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let e=super.toObject.call(this);return e.renderer.type=`group`,e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,H.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){let t=this.children[e];typeof t.dispose==`function`&&t.dispose()}if(this.children&&typeof this.children.unbind==`function`)try{this.children.unbind()}catch{}return this}getShapesAtPoint(t,n,r){let i=r||{},{results:a,hitOptions:o,context:s,single:c,empty:l}=ps.getShapesAtPoint;a.length=0;let u=i.mode===`deepest`||i.deepest?`deepest`:`all`,d=i.visibleOnly!==!1,f=!!i.includeGroups,p=typeof i.filter==`function`?i.filter:null,m=typeof i.tolerance==`number`?i.tolerance:0;typeof i.precision==`number`?o.precision=i.precision:delete o.precision,i.fill===void 0?delete o.fill:o.fill=i.fill,i.stroke===void 0?delete o.stroke:o.stroke=i.stroke,o.tolerance=m,o.ignoreVisibility=!d;let h=u===`deepest`;if(s.x=t,s.y=n,s.visibleOnly=d,s.results=a,e.VisitForHitTest(this,s,f,p,o,m,h),h){if(a.length>0){let e=a[0];return a.length=0,c[0]=e,c.length=1,c}return l.length=0,l}let g=a.slice();return a.length=0,g}corner(){let e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){let n=this.children[t];n.translation.x-=e.left,n.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){let e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let e=0;e<this.children.length;e++){let r=this.children[e];r.isShape&&(r.translation.x-=t,r.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let e=0;e<r.children.length;e++)if(t=n(r.children[e]),t)return t}return null}return n(this)}getByClassName(e){let t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let e=0;e<r.children.length;e++){let t=r.children[e];n(t)}return t}return n(this)}getByType(e){let t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let e=0;e<r.children.length;e++){let t=r.children[e];n(t)}return t}return n(this)}add(e){e=e instanceof Array?e.slice():Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){let n=e[t];if(!(n&&n.id))continue;let r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){let t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e=e instanceof Array?e.slice():Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){let n=e[t];if(!n||!this.children.ids[n.id])continue;let r=this.children.indexOf(n);r>=0&&this.children.splice(r,1)}return this}getBoundingClientRect(e){let t,n,r,i,a,o;this._update(!0);let s=1/0,c=-1/0,l=1/0,u=-1/0,d=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){let p=this.children[f];if(p.visible&&!d.test(p._renderer.type)&&(t=p.getBoundingClientRect(e),r=typeof t.top!=`number`||H.isNaN(t.top)||!isFinite(t.top),i=typeof t.left!=`number`||H.isNaN(t.left)||!isFinite(t.left),a=typeof t.right!=`number`||H.isNaN(t.right)||!isFinite(t.right),o=typeof t.bottom!=`number`||H.isNaN(t.bottom)||!isFinite(t.bottom),!(r||i||a||o))){if(e){let[e,r]=n.multiply(t.left,t.top),[i,a]=n.multiply(t.right,t.top),[o,d]=n.multiply(t.left,t.bottom),[f,p]=n.multiply(t.right,t.bottom);l=ds(r,a,d,p,l),s=ds(e,i,o,f,s),c=fs(e,i,o,f,c),u=fs(r,a,d,p,u)}else l=ds(t.top,l),s=ds(t.left,s),c=fs(t.right,c),u=fs(t.bottom,u)}}return{top:l,left:s,right:c,bottom:u,width:c-s,height:u-l}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){let e=arguments;return this.children.forEach(function(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){let r=Math.min(this._beginning,this._ending),i=Math.max(this._beginning,this._ending),a=this.length,o=0,s=r*a,c=i*a;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,s>o+t?(n.beginning=1,n.ending=1):c<o?(n.beginning=0,n.ending=0):s>o&&s<o+t?(n.beginning=(s-o)/t,n.ending=1):c>o&&c<o+t?(n.beginning=0,n.ending=(c-o)/t):(n.beginning=0,n.ending=1),o+=t}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&=(this.additions.length=0,!1),this._flagSubtractions&&=(this.subtractions.length=0,!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};L(ms,`Children`,_o),L(ms,`Properties`,[`fill`,`stroke`,`linewidth`,`cap`,`join`,`miter`,`closed`,`curved`,`automatic`]);var hs=ms,gs={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){let t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){let t=hs.InsertChildren.bind(this),n=hs.RemoveChildren.bind(this),r=hs.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new _o(e),this._children.bind(z.Types.insert,t),this._children.bind(z.Types.remove,n),this._children.bind(z.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,H.isObject(e)&&!e.clip&&(e.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(e){this._strokeAttenuation=!!e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=e)}}}};function _s(e,t){let n=e.parent,r;if(n===t||(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),a()),t)){i();return}a(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function i(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function a(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var vs=class extends U{constructor(e,t,n,r){let i=[new V(e,t),new V(n,r)];super(i);for(let e in ys)Object.defineProperty(this,e,ys[e]);this.vertices[0].command=R.move,this.vertices[1].command=R.line,this.automatic=!1}};L(vs,`Properties`,[`left`,`right`]);var ys={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(H.isObject(e))this.vertices.splice(0,1,e),this.vertices[0].command=R.move;else{let e=new Ci(`Two.Line.left argument is not an object.`);console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(H.isObject(e))this.vertices.splice(1,1,e),this.vertices[1].command=R.line;else{let e=new Ci(`Two.Line.right argument is not an object.`);console.warn(e.name,e.message)}}}},bs={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},xs={start:`left`,middle:`center`,end:`right`},Ss=[`id`,`class`,`transform`,`xmlns`,`viewBox`],Cs=[`x`,`y`,`width`,`height`,`href`,`xlink:href`];function ws(e){return xs[e]}function Ts(e){let t=e.getAttribute(`dominant-baseline`),n=e.getAttribute(`alignment-baseline`);return t||n}function Es(e){return e.replace(/svg:/gi,``).toLowerCase()}function Ds(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){let n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function Os(e,t){t||={};let n=e.split(`;`);for(let e=0;e<n.length;e++){let r=n[e].split(`:`),i=r[0],a=r[1];if(i===void 0||a===void 0)continue;let o=i.replace(/\s/g,``),s=a.replace(/\s/g,``);t[o]=s}return t}function ks(e){let t={},n=As(e),r=Math.max(n.length,e.style.length);for(let i=0;i<r;i++){let r=e.style[i],a=n[i];r&&(t[r]=e.style[r]),a&&(t[a]=e.getAttribute(a))}return t}function As(e){let t=e.getAttributeNames();for(let e=0;e<Ss.length;e++){let n=Ss[e],r=Array.prototype.indexOf.call(t,n);r>=0&&t.splice(r,1)}return t}function js(e,t){let n=t.split(/[\s,]/),r=-parseFloat(n[0]),i=-parseFloat(n[1]),a=parseFloat(n[2]),o=parseFloat(n[3]);if(r&&i)for(let t=0;t<e.children.length;t++){let n=e.children[t];`translation`in n?n.translation.add(r,i):`x`in n?n.x=r:`y`in n&&(n.y=i)}let s=typeof e.x==`number`,c=typeof e.y==`number`,l=typeof e.width==`number`,u=typeof e.height==`number`;return s&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(l||u)&&(e.scale=new B(1,1)),l&&(e.scale.x=e.width/a),u&&(e.scale.y=e.height/o),e.mask=new uo(0,0,a,o),e.mask.origin.set(-a/2,-o/2),e}function Ms(e,t,n){let r={},i={},a={},o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S;if(e===null)return r;if(Ur.getComputedStyle){let t=Ur.getComputedStyle(e);for(o=t.length;o--;)c=t[o],l=t[c],l!==void 0&&(r[c]=l)}for(o=0;o<e.attributes.length;o++)d=e.attributes[o],/style/i.test(d.nodeName)?Os(d.value,a):i[d.nodeName]=d.value;for(c in r.opacity!==void 0&&(r[`stroke-opacity`]=r.opacity,r[`fill-opacity`]=r.opacity,delete r.opacity),n&&H.defaults(r,n),H.extend(r,a,i),r.visible=!(r.display===void 0&&/none/i.test(r.display))||r.visibility===void 0&&/hidden/i.test(r.visibility),r)switch(l=r[c],c){case`gradientTransform`:if(/none/i.test(l)||(s=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,s===null))break;switch(f=qr(s),t._renderer.type){case`linear-gradient`:Ds(f,t.left),Ds(f,t.right);break;case`radial-gradient`:t.center.x+=f.translateX,t.center.y+=f.translateY,t.focal.x+=f.translateX,t.focal.y+=f.translateY,t.radius*=Math.max(f.scaleX,f.scaleY)}break;case`transform`:if(/none/i.test(l)||(s=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,s===null))break;ci.AutoCalculateImportedMatrices?(f=qr(s),t.translation.set(f.translateX,f.translateY),t.rotation=Math.PI*(f.rotation/180),t.scale=new B(f.scaleX,f.scaleY),p=parseFloat((r.x+``).replace(`px`)),m=parseFloat((r.y+``).replace(`px`)),p&&(t.translation.x=p),m&&(t.translation.y=m)):(s=e.getCTM(),t._matrix.manual=!0,t._matrix.set(s.a,s.b,s.c,s.d,s.e,s.f));break;case`visible`:if(t instanceof hs){t._visible=l;break}t.visible=l;break;case`stroke-linecap`:if(t instanceof hs){t._cap=l;break}t.cap=l;break;case`stroke-linejoin`:if(t instanceof hs){t._join=l;break}t.join=l;break;case`stroke-miterlimit`:if(t instanceof hs){t._miter=l;break}t.miter=l;break;case`stroke-width`:if(t instanceof hs){t._linewidth=parseFloat(l);break}t.linewidth=parseFloat(l);break;case`opacity`:case`stroke-opacity`:case`fill-opacity`:if(t instanceof hs){t._opacity=parseFloat(l);break}t.opacity=parseFloat(l);break;case`clip-path`:if(bs.cssBackgroundImage.test(l)&&(h=l.replace(bs.cssBackgroundImage,`$1`),Fs.defs.current&&Fs.defs.current.contains(h)&&(_=Fs.defs.current.get(h),_&&_.childNodes.length>0)))switch(_=_.childNodes[0],v=Es(_.nodeName),t.mask=Fs[v].call(this,_,{}),t._renderer.type){case`text`:case`path`:t.position.add(t.mask.position),t.mask.position.clear()}break;case`fill`:case`stroke`:u=(t instanceof hs?`_`:``)+c,bs.cssBackgroundImage.test(l)?(h=l.replace(bs.cssBackgroundImage,`$1`),Fs.defs.current&&Fs.defs.current.contains(h)?(_=Fs.defs.current.get(h),_.object||(v=Es(_.nodeName),_.object=Fs[v].call(this,_,{})),_=_.object):(g=Ps(this),_=g.getById(h)),t[u]=_):t[u]=l;break;case`id`:t.id=l;break;case`class`:case`className`:t.classList=l.split(` `),t._flagClassName=!0;break;case`x`:case`y`:if(y=t instanceof Wi,b=t instanceof Xi,x=t instanceof ea,y||b||x)break;l.match(`[a-z%]$`)&&!l.endsWith(`px`)&&(S=new Ci(`only pixel values are supported with the `+c+` attribute.`),console.warn(S.name,S.message)),t.translation[c]=parseFloat(l);break;case`font-family`:t instanceof es&&(t.family=l);break;case`font-size`:t instanceof es&&(l.match(`[a-z%]$`)&&!l.endsWith(`px`)&&(S=new Ci(`only pixel values are supported with the `+c+` attribute.`),console.warn(S.name,S.message)),t.size=parseFloat(l));break;case`font-weight`:t instanceof es&&(t.weight=l);break;case`font-style`:t instanceof es&&(t.style=l);break;case`text-decoration`:t instanceof es&&(t.decoration=l);break;case`line-height`:t instanceof es&&(t.leading=l)}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function Ns(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){let r=e.childNodes[n];r.id&&Es(e.nodeName)!==`#text`&&t.add(r.id,r)}}function Ps(e){for(;e.parent;)e=e.parent;return e.scene}var Fs={svg:function(e){let t=Fs.defs.current=new Di,n=e.getElementsByTagName(`defs`);for(let e=0;e<n.length;e++)Ns(n[e],t);let r=Fs.g.call(this,e),i=e.getAttribute(`viewBox`),a=e.getAttribute(`x`),o=e.getAttribute(`y`),s=e.getAttribute(`width`),c=e.getAttribute(`height`);r.defs=t;let l=i!==null,u=a!==null,d=o!==null,f=s!==null,p=c!==null;return u&&(r.x=parseFloat(a.replace(bs.unitSuffix,``))),d&&(r.y=parseFloat(o.replace(bs.unitSuffix,``))),f&&(r.width=parseFloat(s.replace(bs.unitSuffix,``))),p&&(r.height=parseFloat(c.replace(bs.unitSuffix,``))),l&&js(r,i),delete Fs.defs.current,r},defs:function(e){return null},use:function(e,t){let n,r=e.getAttribute(`href`)||e.getAttribute(`xlink:href`);if(!r)return n=new Ci(`encountered <use /> with no href.`),console.warn(n.name,n.message),null;let i=r.slice(1);if(!Fs.defs.current.contains(i))return n=new Ci(`unable to find element for reference `+r+`.`),console.warn(n.name,n.message),null;let a=Fs.defs.current.get(i).cloneNode(!0);for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t],r=Cs.includes(n.nodeName),i=!a.hasAttribute(n.nodeName);(r||i)&&a.setAttribute(n.nodeName,n.value)}return Fs[Es(a.nodeName)].call(this,a,t)},g:function(e,t){let n=new hs;Ms.call(this,e,n,t),this.add(n);let r=ks.call(this,e);for(let t=0,i=e.childNodes.length;t<i;t++){let i=e.childNodes[t],a=i.nodeName;if(!a)return;let o=Es(a);if(o in Fs){let e=Fs[o].call(n,i,r);e&&!e.parent&&n.add(e)}}return n},polygon:function(e,t){let n;n=typeof e==`string`?e:e.getAttribute(`points`);let r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(e,t,n){r.push(new V(parseFloat(t),parseFloat(n)))});let i=new U(r,!0);return i.stroke=`none`,i.fill=`black`,Ms.call(this,e,i,t),i},polyline:function(e,t){let n=Fs.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e==`string`?(n=e,e=null):n=e.getAttribute(`d`);let r=[],i=!1,a=!1;if(n){let e=new V,t,o,s=n.match(/[a-df-z][^a-df-z]*/gi),c=s.length-1;H.each(s.slice(0),function(e,t){let n=e.slice(1).trim().match(bs.path),r=e[0],i=r.toLowerCase(),a,o,c,l,u,d=[];switch(t===0&&(s=[]),i){case`h`:case`v`:n.length>1&&(a=1);break;case`m`:case`l`:case`t`:n.length>2&&(a=2);break;case`s`:case`q`:n.length>4&&(a=4);break;case`c`:n.length>6&&(a=6);break;case`a`:n.length>7&&(a=7)}if(a){for(o=0,c=n.length,u=0;o<c;o+=a){if(l=r,u>0)switch(r){case`m`:l=`l`;break;case`M`:l=`L`}d.push(l+n.slice(o,o+a).join(` `)),u++}s=Array.prototype.concat.apply(s,d)}else s.push(e)}),H.each(s,function(n,s){let l,u,d,f=n[0],p=f.toLowerCase();o=n.slice(1).trim().match(bs.path),a=f===p;let m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A;switch(p){case`z`:if(s>=c)i=!0;else{u=e.x,d=e.y,l=new V(u,d,void 0,void 0,void 0,void 0,R.close);for(let t=r.length-1;t>=0;t--){let n=r[t];if(/m/i.test(n.command)){e=n;break}}}break;case`m`:case`l`:t=void 0,u=parseFloat(o[0]),d=parseFloat(o[1]),l=new V(u,d,void 0,void 0,void 0,void 0,/m/i.test(p)?R.move:R.line),a&&l.addSelf(e),e=l;break;case`h`:case`v`:C=/h/i.test(p)?`x`:`y`,w=/x/i.test(C)?`y`:`x`,l=new V(void 0,void 0,void 0,void 0,void 0,void 0,R.line),l[C]=parseFloat(o[0]),l[w]=e[w],a&&(l[C]+=e[C]),e=l;break;case`c`:case`s`:m=e.x,h=e.y,t||=new B,/c/i.test(p)?(g=parseFloat(o[0]),_=parseFloat(o[1]),v=parseFloat(o[2]),y=parseFloat(o[3]),b=parseFloat(o[4]),x=parseFloat(o[5])):(S=_i(e,t,a),g=S.x,_=S.y,v=parseFloat(o[0]),y=parseFloat(o[1]),b=parseFloat(o[2]),x=parseFloat(o[3])),a&&(g+=m,_+=h,v+=m,y+=h,b+=m,x+=h),e.controls.right.set(g-e.x,_-e.y),l=new V(b,x,v-b,y-x,void 0,void 0,R.curve),e=l,t=l.controls.left;break;case`t`:case`q`:m=e.x,h=e.y,t||=new B,/q/i.test(p)?(g=parseFloat(o[0]),_=parseFloat(o[1]),v=parseFloat(o[0]),y=parseFloat(o[1]),b=parseFloat(o[2]),x=parseFloat(o[3])):(S=_i(e,t,a),g=S.x,_=S.y,v=S.x,y=S.y,b=parseFloat(o[0]),x=parseFloat(o[1])),a&&(g+=m,_+=h,v+=m,y+=h,b+=m,x+=h),e.controls.right.set((g-e.x)*.33,(_-e.y)*.33),l=new V(b,x,v-b,y-x,void 0,void 0,R.curve),e=l,t=l.controls.left;break;case`a`:m=e.x,h=e.y,E=parseFloat(o[0]),D=parseFloat(o[1]),O=parseFloat(o[2]),k=parseFloat(o[3]),A=parseFloat(o[4]),b=parseFloat(o[5]),x=parseFloat(o[6]),a&&(b+=m,x+=h),T=new V(b,x),T.command=R.arc,T.rx=E,T.ry=D,T.xAxisRotation=O,T.largeArcFlag=k,T.sweepFlag=A,l=T,e=T,t=void 0}l&&(Array.isArray(l)?r=r.concat(l):r.push(l))})}n=new U(r,i,void 0,!0),n.stroke=`none`,n.fill=`black`;let o=n.getBoundingClientRect(!0);return o.centroid={x:o.left+o.width/2,y:o.top+o.height/2},H.each(n.vertices,function(e){e.subSelf(o.centroid)}),Ms.call(this,e,n,t),n.translation.addSelf(o.centroid),n},circle:function(e,t){let n=parseFloat(e.getAttribute(`cx`)),r=parseFloat(e.getAttribute(`cy`)),i=new wo(0,0,parseFloat(e.getAttribute(`r`)));return i.stroke=`none`,i.fill=`black`,Ms.call(this,e,i,t),i.translation.x=n,i.translation.y=r,i},ellipse:function(e,t){let n=parseFloat(e.getAttribute(`cx`)),r=parseFloat(e.getAttribute(`cy`)),i=new ko(0,0,parseFloat(e.getAttribute(`rx`)),parseFloat(e.getAttribute(`ry`)));return i.stroke=`none`,i.fill=`black`,Ms.call(this,e,i,t),i.translation.x=n,i.translation.y=r,i},rect:function(e,t){let n=parseFloat(e.getAttribute(`rx`)),r=parseFloat(e.getAttribute(`ry`));if(!H.isNaN(n)||!H.isNaN(r))return Fs[`rounded-rect`](e);let i=parseFloat(e.getAttribute(`width`)),a=parseFloat(e.getAttribute(`height`)),o=i/2,s=a/2,c=new uo(0,0,i,a);return c.stroke=`none`,c.fill=`black`,Ms.call(this,e,c,t),c.translation.x+=o,c.translation.y+=s,c},"rounded-rect":function(e,t){let n=parseFloat(e.getAttribute(`rx`))||0,r=parseFloat(e.getAttribute(`ry`))||0,i=parseFloat(e.getAttribute(`width`)),a=parseFloat(e.getAttribute(`height`)),o=i/2,s=a/2,c=new Ho(0,0,i,a,new B(n,r));return c.stroke=`none`,c.fill=`black`,Ms.call(this,e,c,t),c.translation.x+=o,c.translation.y+=s,c},line:function(e,t){let n=new vs(parseFloat(e.getAttribute(`x1`)),parseFloat(e.getAttribute(`y1`)),parseFloat(e.getAttribute(`x2`)),parseFloat(e.getAttribute(`y2`))).noFill();return Ms.call(this,e,n,t),n},lineargradient:function(e,t){let n=e.getAttribute(`gradientUnits`),r=e.getAttribute(`spreadMethod`);n||=`objectBoundingBox`,r||=`pad`;let i=parseFloat(e.getAttribute(`x1`)||0),a=parseFloat(e.getAttribute(`y1`)||0),o=parseFloat(e.getAttribute(`x2`)||0),s=parseFloat(e.getAttribute(`y2`)||0),c=(o+i)/2,l=(s+a)/2;/userSpaceOnUse/i.test(n)&&(i-=c,a-=l,o-=c,s-=l);let u=[];for(let t=0;t<e.children.length;t++){let n=e.children[t],r=n.getAttribute(`offset`);/%/gi.test(r)&&(r=parseFloat(r.replace(/%/gi,``))/100),r=parseFloat(r);let i=n.getAttribute(`stop-color`),a=n.getAttribute(`stop-opacity`),o=n.getAttribute(`style`),s;i===null&&(s=o?o.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,i=s&&s.length>1?s[1]:void 0),a===null?(s=o?o.match(/stop-opacity:\s?([0-9.-]*)/):!1,a=s&&s.length>1?parseFloat(s[1]):1):a=parseFloat(a),u.push(new Vi(r,i,a))}let d=new Xi(i,a,o,s,u);return d.spread=r,d.units=n,Ms.call(this,e,d,t),d},radialgradient:function(e,t){let n=e.getAttribute(`gradientUnits`),r=e.getAttribute(`spreadMethod`);n||=`objectBoundingBox`,r||=`pad`;let i=parseFloat(e.getAttribute(`cx`))||0,a=parseFloat(e.getAttribute(`cy`))||0,o=parseFloat(e.getAttribute(`r`)),s=parseFloat(e.getAttribute(`fx`)),c=parseFloat(e.getAttribute(`fy`));H.isNaN(s)&&(s=i),H.isNaN(c)&&(c=a);let l=Math.abs(i+s)/2,u=Math.abs(a+c)/2;/userSpaceOnUse/i.test(n)&&(i-=l,a-=u,s-=l,c-=u);let d=[];for(let t=0;t<e.children.length;t++){let n=e.children[t],r=n.getAttribute(`offset`);/%/gi.test(r)&&(r=parseFloat(r.replace(/%/gi,``))/100),r=parseFloat(r);let i=n.getAttribute(`stop-color`),a=n.getAttribute(`stop-opacity`),o=n.getAttribute(`style`),s;i===null&&(s=o?o.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,i=s&&s.length>1?s[1]:void 0),a===null?(s=o?o.match(/stop-opacity:\s?([0-9.-]*)/):!1,a=s&&s.length>1?parseFloat(s[1]):1):a=parseFloat(a),d.push(new Vi(r,i,a))}let f=new ea(i,a,o,d,s,c);return f.spread=r,f.units=n,Ms.call(this,e,f,t),f},text:function(e,t){let n=ws(e.getAttribute(`text-anchor`))||`left`,r=Ts(e)||`baseline`,i=``;i=e.childNodes.length>0&&e.childNodes[0].tagName===`TSPAN`?e.childNodes[0].textContent:e.textContent;let a=new es(i);return Ms.call(this,e,a,t),a.alignment=n,a.baseline=r,a},clippath:function(e,t){return Fs.defs.current&&!Fs.defs.current.contains(e.id)&&Fs.defs.current.add(e.id,e),null},image:function(e,t){let n,r=e.getAttribute(`href`)||e.getAttribute(`xlink:href`);if(!r)return n=new Ci(`encountered <image /> with no href.`),console.warn(n.name,n.message),null;let i=parseFloat(e.getAttribute(`x`))||0,a=parseFloat(e.getAttribute(`y`))||0,o=parseFloat(e.getAttribute(`width`)),s=parseFloat(e.getAttribute(`height`)),c=new mo(r,i,a);return H.isNaN(o)||(c.width=o),H.isNaN(s)||(c.height=s),Ms.call(this,e,c,t),c}};function Is(e,t){let n=new XMLHttpRequest;return n.open(`GET`,e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Ls=class e extends uo{constructor(e,t,n,r,i,a){super(t,n,r||1,i||1),L(this,`_flagTexture`,!1),L(this,`_flagMode`,!1),L(this,`_texture`,null),L(this,`_mode`,`fill`),this._renderer.type=`image`;for(let e in zs)Object.defineProperty(this,e,zs[e]);this.noStroke(),this.noFill(),e instanceof Ii?this.texture=e:typeof e==`string`&&(this.texture=new Ii(e)),typeof a==`string`&&(this.mode=a),this._update()}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e(this.texture,this.translation.x,this.translation.y,this.width,this.height);return t&&t.add(n),n}toObject(){let e=super.toObject.call(this);return e.renderer.type=`image`,e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose==`function`?this._texture.dispose():this._texture&&typeof this._texture.unbind==`function`&&this._texture.unbind(),this}_update(){let t=this._texture;if(t&&(this._flagTexture&&(this.fill=t),t.loaded)){let n=t.image.width,r=t.image.height,i=this.width,a=this.height,o=i/n,s=a/r;switch(this._mode){case e.Modes.fill:t.scale=Math.max(o,s),t.offset.x=0,t.offset.y=0,t.repeat=`repeat`;break;case e.Modes.fit:t.scale=Math.min(o,s),t.offset.x=0,t.offset.y=0,t.repeat=`no-repeat`;break;case e.Modes.crop:break;case e.Modes.tile:t.offset.x=(n-i)/2,t.offset.y=(r-a)/2,t.repeat=`repeat`;break;case e.Modes.stretch:default:t.scale=new B(o,s),t.offset.x=0,t.offset.y=0,t.repeat=`repeat`}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};L(Ls,`Modes`,{fill:`fill`,fit:`fit`,crop:`crop`,tile:`tile`,stretch:`stretch`}),L(Ls,`Properties`,[`texture`,`mode`]);var Rs=Ls,zs={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(e){this._mode=e,this._flagMode=!0}}},Bs=[],Vs=Math.max,Hs=Math.min,Us=Math.abs,Ws=Math.sin,Gs=Math.cos,Ks=Math.acos,qs=Math.sqrt,Js={isHidden:/(undefined|none|transparent)/i,alignments:{left:`start`,middle:`center`,right:`end`},baselines:{top:`top`,middle:`middle`,bottom:`bottom`,baseline:`alphabetic`},getRendererType:function(e){return e in Js?e:`path`},group:{renderChild:function(e){Js[Js.getRendererType(e._renderer.type)].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let t=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let r=this._mask,i=Qs(t),a=!i||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,a&&(e.save(),i||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r&&Js[Js.getRendererType(r._renderer.type)].render.call(r,e,!0),this._opacity>0&&this._scale!==0)for(let t=0;t<this.children.length;t++){let n=this.children[t];Js[Js.getRendererType(n._renderer.type)].render.call(n,e)}return a&&e.restore(),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(e,t,n){let r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,ee,j,te,ne,M,re;if(re=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,ee=this._mask,j=this._clip,s=this._opacity*(re||1),c=this._visible,!t&&(!c||j||s===0))return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,i=this._stroke,a=this._linewidth,o=this._fill,l=this._cap,u=this._join,d=this._miter,f=this._renderer.closed,p=this._renderer.vertices,m=p.length,h=m-1,te=Qs(r),M=this.dashes,te||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),ee&&Js[Js.getRendererType(ee._renderer.type)].render.call(ee,e,!0),o&&(typeof o==`string`?e.fillStyle=o:(Js[Js.getRendererType(o._renderer.type)].render.call(o,e,this),e.fillStyle=o._renderer.effect)),i&&(typeof i==`string`?e.strokeStyle=i:(Js[Js.getRendererType(i._renderer.type)].render.call(i,e,this),e.strokeStyle=i._renderer.effect),a&&(e.lineWidth=ri(this)),d&&(e.miterLimit=d),u&&(e.lineJoin=u),!f&&l&&(e.lineCap=l)),typeof s==`number`&&(e.globalAlpha=s),M&&M.length>0&&(e.lineDashOffset=M.offset||0,e.setLineDash(M)),e.beginPath();let ie,N,P,F,ae,oe,se;for(let t=0;t<m;t++)switch(v=p[t],k=v.x,A=v.y,v.command){case R.close:e.closePath();break;case R.arc:ie=v.rx,N=v.ry,P=v.xAxisRotation,F=v.largeArcFlag,ae=v.sweepFlag,g=f?$r(t-1,m):Vs(t-1,0),_=p[g],oe=_.x,se=_.y,Js.renderSvgArcCommand(e,oe,se,ie,N,F,ae,P,k,A);break;case R.curve:g=f?$r(t-1,m):Math.max(t-1,0),_=p[g],T=_.controls&&_.controls.right||B.zero,E=v.controls&&v.controls.left||B.zero,_._relative?(C=T.x+_.x,w=T.y+_.y):(C=T.x,w=T.y),v._relative?(x=E.x+v.x,S=E.y+v.y):(x=E.x,S=E.y),e.bezierCurveTo(C,w,x,S,k,A),t>=h&&f&&(y=b,D=v.controls&&v.controls.right||B.zero,O=y.controls&&y.controls.left||B.zero,v._relative?(C=D.x+v.x,w=D.y+v.y):(C=D.x,w=D.y),y._relative?(x=O.x+y.x,S=O.y+y.y):(x=O.x,S=O.y),k=y.x,A=y.y,e.bezierCurveTo(C,w,x,S,k,A));break;case R.line:e.lineTo(k,A);break;case R.move:b=v,e.moveTo(k,A)}return f&&e.closePath(),!j&&!n&&(Js.isHidden.test(o)||(ne=o._renderer&&o._renderer.offset,ne&&(e.save(),e.translate(-o._renderer.offset.x,-o._renderer.offset.y),e.scale(o._renderer.scale.x,o._renderer.scale.y)),e.fill(),ne&&e.restore()),Js.isHidden.test(i)||(ne=i._renderer&&i._renderer.offset,ne&&(e.save(),e.translate(-i._renderer.offset.x,-i._renderer.offset.y),e.scale(i._renderer.scale.x,i._renderer.scale.y),e.lineWidth=a/i._renderer.scale.x),e.stroke(),ne&&e.restore())),te||e.restore(),j&&!n&&e.clip(),M&&M.length>0&&e.setLineDash(Bs),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(e,t,n){let r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v;if(v=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*(v||1),c=this._visible,!t&&(!c||s===0))return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,i=this._stroke,a=this._linewidth,o=this._fill,u=this._renderer.collection,d=u.length,h=Qs(r),_=this.dashes,l=this._size,h||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),o&&(typeof o==`string`?e.fillStyle=o:(Js[Js.getRendererType(o._renderer.type)].render.call(o,e,this),e.fillStyle=o._renderer.effect)),i&&(typeof i==`string`?e.strokeStyle=i:(Js[Js.getRendererType(i._renderer.type)].render.call(i,e,this),e.strokeStyle=i._renderer.effect),a&&(e.lineWidth=ri(this))),typeof s==`number`&&(e.globalAlpha=s),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),e.beginPath();let y=l*.5,b;this._sizeAttenuation||(b=this.worldMatrix.elements,b=qr(b[0],b[3],b[1],b[4],b[2],b[5]),y/=Math.max(b.scaleX,b.scaleY));for(let t=0;t<d;t++)f=u[t],p=f.x,m=f.y,e.moveTo(p+y,m),e.arc(p,m,y,0,Gr);return n||(Js.isHidden.test(o)||(g=o._renderer&&o._renderer.offset,g&&(e.save(),e.translate(-o._renderer.offset.x,-o._renderer.offset.y),e.scale(o._renderer.scale.x,o._renderer.scale.y)),e.fill(),g&&e.restore()),Js.isHidden.test(i)||(g=i._renderer&&i._renderer.offset,g&&(e.save(),e.translate(-i._renderer.offset.x,-i._renderer.offset.y),e.scale(i._renderer.scale.x,i._renderer.scale.y),e.lineWidth=a/i._renderer.scale.x),e.stroke(),g&&e.restore())),h||e.restore(),_&&_.length>0&&e.setLineDash(Bs),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(e,t,n){let r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,i=this._opacity*r,a=this._visible,o=this._mask,s=this._clip;if(!t&&(!a||s||i===0))return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let c=this._matrix.elements,l=this._stroke,u=this._linewidth,d=this._fill,f=this._decoration,p=this._direction,m=Qs(c),h=d._renderer&&d._renderer.offset&&l._renderer&&l._renderer.offset,g=this.dashes,_=Js.alignments[this._alignment]||this._alignment,v=Js.baselines[this._baseline]||this._baseline,y,b,x,S,C,w,T,E,D,O,k;if(m||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),o&&Js[Js.getRendererType(o._renderer.type)].render.call(o,e,!0),h||(e.font=[this._style,this._weight,this._size+`px/`+this._leading+`px`,this._family].join(` `)),e.textAlign=_,e.textBaseline=v,e.direction=p,d&&(typeof d==`string`?e.fillStyle=d:(Js[Js.getRendererType(d._renderer.type)].render.call(d,e,this),e.fillStyle=d._renderer.effect)),l&&(typeof l==`string`?e.strokeStyle=l:(Js[Js.getRendererType(l._renderer.type)].render.call(l,e,this),e.strokeStyle=l._renderer.effect),u&&(e.lineWidth=ri(this))),typeof i==`number`&&(e.globalAlpha=i),g&&g.length>0&&(e.lineDashOffset=g.offset||0,e.setLineDash(g)),!s&&!n&&(Js.isHidden.test(d)||(d._renderer&&d._renderer.offset?(w=d._renderer.scale.x,T=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(w,T),y=this._size/d._renderer.scale.y,b=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,y+`px/`,b+`px`,this._family].join(` `),x=d._renderer.offset.x/d._renderer.scale.x,S=d._renderer.offset.y/d._renderer.scale.y,e.fillText(this.value,x,S),e.restore()):e.fillText(this.value,0,0)),Js.isHidden.test(l)||(l._renderer&&l._renderer.offset?(w=l._renderer.scale.x,T=l._renderer.scale.y,e.save(),e.translate(-l._renderer.offset.x,-l._renderer.offset.y),e.scale(w,T),y=this._size/l._renderer.scale.y,b=this._leading/l._renderer.scale.y,e.font=[this._style,this._weight,y+`px/`,b+`px`,this._family].join(` `),x=l._renderer.offset.x/l._renderer.scale.x,S=l._renderer.offset.y/l._renderer.scale.y,C=u/l._renderer.scale.x,e.lineWidth=C,e.strokeText(this.value,x,S),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){let t=e.measureText(this.value),n=1;switch(f){case`underline`:D=t.actualBoundingBoxDescent,k=t.actualBoundingBoxDescent;break;case`strikethrough`:D=0,k=0,n=.5}switch(v){case`top`:D+=this._size*n,k+=this._size*n;break;case`baseline`:case`bottom`:D-=this._size*n,k-=this._size*n}switch(_){case`left`:case`start`:E=0,O=t.width;break;case`right`:case`end`:E=-t.width,O=0;break;default:E=-t.width/2,O=t.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(E,D),e.lineTo(O,k),e.stroke()}return m||e.restore(),s&&!n&&e.clip(),g&&g.length>0&&e.setLineDash(Bs),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,i=this.left._y,a=this.right._x,o=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,i=(i-.5)*n.height,a=(a-.5)*n.width,o=(o-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,i,a,o);for(let e=0;e<this.stops.length;e++){let t=this.stops[e];this._renderer.effect.addColorStop(t._offset,t._color)}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,i=this.center._y,a=this.focal._x,o=this.focal._y,s=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,i=(i-.5)*n.height*.5,a=(a-.5)*n.width*.5,o=(o-.5)*n.height*.5,s*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,i,0,a,o,s);for(let e=0;e<this.stops.length;e++){let t=this.stops[e];this._renderer.effect.addColorStop(t._offset,t._color)}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(e){H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let t=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof B||(this._renderer.offset=new B),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,t&&(this._renderer.offset.x+=t.width/2,this._renderer.offset.y+=t.height/2,this._scale instanceof B?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof B||(this._renderer.scale=new B),this._scale instanceof B?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,i,a,o,s,c,l){s=s*Math.PI/180,r=Us(r),i=Us(i);let u=(t-c)/2,d=(n-l)/2,f=Gs(s)*u+Ws(s)*d,p=-Ws(s)*u+Gs(s)*d,m=f*f,h=p*p,g=r*r,_=i*i,v=m/g+h/_;if(v>1){let e=qs(v);r=e*r,i=e*i,g=r*r,_=i*i}let y=g*h+_*m,b=qs(Vs(0,(g*_-y)/y));a===o&&(b=-b);let x=b*r*p/i,S=-b*i*f/r,C=Gs(s)*x-Ws(s)*S+(t+c)/2,w=Ws(s)*x+Gs(s)*S+(n+l)/2,T=Zs(1,0,(f-x)/r,(p-S)/i),E=T+Zs((f-x)/r,(p-S)/i,(-f-x)/r,(-p-S)/i)%Gr;Xs(e,C,w,r,i,T,E,o===0,s)}},Ys=class extends z{constructor(e){super();let t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement(`canvas`),this.ctx=this.domElement.getContext(`2d`),this.overdraw=e.overdraw||!1,this.ctx.imageSmoothingEnabled!==void 0&&(this.ctx.imageSmoothingEnabled=t),this.scene=new hs,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=n===void 0?Ei(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&H.extend(this.domElement.style,{width:e+`px`,height:t+`px`}),this.trigger(z.Types.resize,e,t,n)}render(){let e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Js.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};L(Ys,`Utils`,Js);function Xs(e,t,n,r,i,a,o,s,c){let l=o-a,u=li.Tolerance.epsilon,d=Math.abs(l)<u,f=$r(l,Gr);f<u&&(f=d?0:Gr),s===!0&&!d&&(f===Gr?f=-Gr:f-=Gr);for(let o=0;o<ci.Resolution;o++){let s=a+o/(ci.Resolution-1)*f,l=t+r*Math.cos(s),u=n+i*Math.sin(s);if(c!==0){let e=Math.cos(c),r=Math.sin(c),i=l-t,a=u-n;l=i*e-a*r+t,u=i*r+a*e+n}e.lineTo(l,u)}}function Zs(e,t,n,r){let i=Ks(Vs(-1,Hs(1,(e*n+t*r)/(qs(e*e+t*t)*qs(n*n+r*r)))));return e*r-t*n<0&&(i=-i),i}function Qs(e){return e[0]===1&&e[3]===0&&e[1]===0&&e[4]===1&&e[2]===0&&e[5]===0}var W={version:1.1,ns:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,alignments:{left:`start`,center:`middle`,right:`end`},baselines:{top:`hanging`,middle:`middle`,bottom:`ideographic`,baseline:`alphabetic`},createElement:function(e,t){let n=e,r=document.createElementNS(W.ns,n);return n===`svg`&&(t=H.defaults(t||{},{version:W.version})),t&&Object.keys(t).length>0&&W.setAttributes(r,t),r},setAttributes:function(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r++)/href/.test(n[r])?e.setAttributeNS(W.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,i,a=``;for(let o=0;o<n;o++){let s=e[o],c=e[t?$r(o-1,n):Math.max(o-1,0)],l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w=ni(s.x),T=ni(s.y);switch(s.command){case R.close:l=R.close;break;case R.arc:y=s.rx,b=s.ry,x=s.xAxisRotation,S=s.largeArcFlag,C=s.sweepFlag,l=R.arc+` `+y+` `+b+` `+x+` `+S+` `+C+` `+w+` `+T;break;case R.curve:h=c.controls&&c.controls.right||B.zero,g=s.controls&&s.controls.left||B.zero,c.relative?(d=ni(h.x+c.x),f=ni(h.y+c.y)):(d=ni(h.x),f=ni(h.y)),s.relative?(p=ni(g.x+s.x),m=ni(g.y+s.y)):(p=ni(g.x),m=ni(g.y)),l=(o===0?R.move:R.curve)+` `+d+` `+f+` `+p+` `+m+` `+w+` `+T;break;case R.move:i=s,l=R.move+` `+w+` `+T;break;default:l=s.command+` `+w+` `+T}o>=r&&t&&(s.command===R.curve&&(u=i,_=s.controls&&s.controls.right||s,v=u.controls&&u.controls.left||u,s.relative?(d=ni(_.x+s.x),f=ni(_.y+s.y)):(d=ni(_.x),f=ni(_.y)),u.relative?(p=ni(v.x+u.x),m=ni(v.y+u.y)):(p=ni(v.x),m=ni(v.y)),w=ni(u.x),T=ni(u.y),l+=` C `+d+` `+f+` `+p+` `+m+` `+w+` `+T),s.command!==R.close&&(l+=` Z`)),a+=l+` `}return a},pointsToString:function(e,t){let n=``,r=t*.5;for(let t=0;t<e.length;t++){let i=e[t].x,a=e[t].y-r;n+=R.move+` `+i+` `+a+` `,n+=`a `+r+` `+r+` 0 1 0 0.001 0 Z`}return n},getClip:function(e,t){let n=e._renderer.clip;return n||=e._renderer.clip=W.createElement(`clipPath`,{"clip-rule":`nonzero`}),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in W?e:`path`},defs:{update:function(e){let{defs:t}=e;if(t._flagUpdate){let n=Array.prototype.slice.call(t.children,0);for(let r=0;r<n.length;r++){let i=n[r],a=i.id,o=`[fill="url(#${a})"],[stroke="url(#${a})"],[clip-path="url(#${a})"]`;e.querySelector(o)||t.removeChild(i)}t._flagUpdate=!1}}},group:{appendChild:function(e){let t=e._renderer.elem;if(!t)return;let n=t.nodeName;!n||/(radial|linear)gradient/i.test(n)||e._clip||this.elem.appendChild(t)},removeChild:function(e){let t=e._renderer.elem;t&&t.parentNode==this.elem&&t.nodeName&&(e._clip||this.elem.removeChild(t))},orderChild:function(e){this.elem.appendChild(e._renderer.elem)},renderChild:function(e){W[W.getRendererType(e._renderer.type)].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=W.createElement(`g`,{id:this.id}),e.appendChild(this._renderer.elem));let t=this._matrix.manual||this._flagMatrix,n={domElement:e,elem:this._renderer.elem};t&&this._renderer.elem.setAttribute(`transform`,`matrix(`+this._matrix.toString()+`)`);for(let t=0;t<this.children.length;t++){let n=this.children[t];W[W.getRendererType(n._renderer.type)].render.call(n,e)}return this._flagId&&this._renderer.elem.setAttribute(`id`,this._id),this._flagOpacity&&this._renderer.elem.setAttribute(`opacity`,this._opacity),this._flagVisible&&this._renderer.elem.setAttribute(`display`,this._visible?`inline`:`none`),this._flagClassName&&this._renderer.elem.setAttribute(`class`,this.classList.join(` `)),this._flagAdditions&&this.additions.forEach(W.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(W.group.removeChild,n),this._flagOrder&&this.children.forEach(W.group.orderChild,n),this._flagMask&&(this._mask?(W[W.getRendererType(this._mask._renderer.type)].render.call(this._mask,e),this._renderer.elem.setAttribute(`clip-path`,`url(#`+this._mask.id+`)`)):this._renderer.elem.removeAttribute(`clip-path`)),this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform=`matrix(`+this._matrix.toString()+`)`),this._flagId&&(t.id=this._id),this._flagVertices&&(t.d=W.toString(this._renderer.vertices,this._renderer.closed)),this._fill&&this._fill._renderer&&(this._renderer.hasFillEffect=!0,this._fill._update(),W[W.getRendererType(this._fill._renderer.type)].render.call(this._fill,e,!0)),this._flagFill&&(t.fill=this._fill&&this._fill.id?`url(#`+this._fill.id+`)`:this._fill,this._renderer.hasFillEffect&&this._fill.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer&&(this._renderer.hasStrokeEffect=!0,this._stroke._update(),W[W.getRendererType(this._stroke._renderer.type)].render.call(this._stroke,e,!0)),this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?`url(#`+this._stroke.id+`)`:this._stroke,this._renderer.hasStrokeEffect&&this._stroke.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t[`stroke-width`]=ri(this)),this._flagOpacity&&(t[`stroke-opacity`]=this._opacity,t[`fill-opacity`]=this._opacity),this._flagClassName&&(t.class=this.classList.join(` `)),this._flagVisible&&(t.visibility=this._visible?`visible`:`hidden`),this._flagCap&&(t[`stroke-linecap`]=this._cap),this._flagJoin&&(t[`stroke-linejoin`]=this._join),this._flagMiter&&(t[`stroke-miterlimit`]=this._miter),this.dashes&&this.dashes.length>0&&(t[`stroke-dasharray`]=this.dashes.join(` `),t[`stroke-dashoffset`]=this.dashes.offset||0),this._renderer.elem?W.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=W.createElement(`path`,t),e.appendChild(this._renderer.elem)),this._flagClip){let t=W.getClip(this,e),n=this._renderer.elem;this._clip?(n.removeAttribute(`id`),t.setAttribute(`id`,this.id),t.appendChild(n)):(t.removeAttribute(`id`),n.setAttribute(`id`,this.id),this.parent._renderer.elem.appendChild(n))}return this._flagMask&&(this._mask?(W[W.getRendererType(this._mask._renderer.type)].render.call(this._mask,e),this._renderer.elem.setAttribute(`clip-path`,`url(#`+this._mask.id+`)`)):this._renderer.elem.removeAttribute(`clip-path`)),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform=`matrix(`+this._matrix.toString()+`)`),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let e=this._size;if(!this._sizeAttenuation){let t=this.worldMatrix.elements,n=qr(t[0],t[3],t[1],t[4],t[2],t[5]);e/=Math.max(n.scaleX,n.scaleY)}t.d=W.pointsToString(this._renderer.collection,e)}return this._fill&&this._fill._renderer&&(this._renderer.hasFillEffect=!0,this._fill._update(),W[W.getRendererType(this._fill._renderer.type)].render.call(this._fill,e,!0)),this._flagFill&&(t.fill=this._fill&&this._fill.id?`url(#`+this._fill.id+`)`:this._fill,this._renderer.hasFillEffect&&this._fill.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer&&(this._renderer.hasStrokeEffect=!0,this._stroke._update(),W[W.getRendererType(this._stroke._renderer.type)].render.call(this._stroke,e,!0)),this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?`url(#`+this._stroke.id+`)`:this._stroke,this._renderer.hasStrokeEffect&&this._stroke.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t[`stroke-width`]=ri(this)),this._flagOpacity&&(t[`stroke-opacity`]=this._opacity,t[`fill-opacity`]=this._opacity),this._flagClassName&&(t.class=this.classList.join(` `)),this._flagVisible&&(t.visibility=this._visible?`visible`:`hidden`),this.dashes&&this.dashes.length>0&&(t[`stroke-dasharray`]=this.dashes.join(` `),t[`stroke-dashoffset`]=this.dashes.offset||0),this._renderer.elem?W.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=W.createElement(`path`,t),e.appendChild(this._renderer.elem)),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(e){this._update();let t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform=`matrix(`+this._matrix.toString()+`)`),this._flagId&&(t.id=this._id),this._flagFamily&&(t[`font-family`]=this._family),this._flagSize&&(t[`font-size`]=this._size),this._flagLeading&&(t[`line-height`]=this._leading),this._flagAlignment&&(t[`text-anchor`]=W.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t[`dominant-baseline`]=W.baselines[this._baseline]||this._baseline),this._flagStyle&&(t[`font-style`]=this._style),this._flagWeight&&(t[`font-weight`]=this._weight),this._flagDecoration&&(t[`text-decoration`]=this._decoration),this._flagDirection&&(t.direction=this._direction),this._fill&&this._fill._renderer&&(this._renderer.hasFillEffect=!0,this._fill._update(),W[W.getRendererType(this._fill._renderer.type)].render.call(this._fill,e,!0)),this._flagFill&&(t.fill=this._fill&&this._fill.id?`url(#`+this._fill.id+`)`:this._fill,this._renderer.hasFillEffect&&this._fill.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer&&(this._renderer.hasStrokeEffect=!0,this._stroke._update(),W[W.getRendererType(this._stroke._renderer.type)].render.call(this._stroke,e,!0)),this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?`url(#`+this._stroke.id+`)`:this._stroke,this._renderer.hasStrokeEffect&&this._stroke.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t[`stroke-width`]=ri(this)),this._flagOpacity&&(t.opacity=this._opacity),this._flagClassName&&(t.class=this.classList.join(` `)),this._flagVisible&&(t.visibility=this._visible?`visible`:`hidden`),this.dashes&&this.dashes.length>0&&(t[`stroke-dasharray`]=this.dashes.join(` `),t[`stroke-dashoffset`]=this.dashes.offset||0),this._renderer.elem?W.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=W.createElement(`text`,t),e.appendChild(this._renderer.elem)),this._flagClip){let t=W.getClip(this,e),n=this._renderer.elem;this._clip?(n.removeAttribute(`id`),t.setAttribute(`id`,this.id),t.appendChild(n)):(t.removeAttribute(`id`),n.setAttribute(`id`,this.id),this.parent._renderer.elem.appendChild(n))}return this._flagMask&&(this._mask?(W[W.getRendererType(this._mask._renderer.type)].render.call(this._mask,e),this._renderer.elem.setAttribute(`clip-path`,`url(#`+this._mask.id+`)`)):this._renderer.elem.removeAttribute(`clip-path`)),this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(e,t){H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),t||this._update();let n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?W.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=W.createElement(`linearGradient`,n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){let e=this._renderer.elem.childNodes.length!==this.stops.length;if(e)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let t=0;t<this.stops.length;t++){let n=this.stops[t],r={};n._flagOffset&&(r.offset=100*n._offset+`%`),n._flagColor&&(r[`stop-color`]=n._color),n._flagOpacity&&(r[`stop-opacity`]=n._opacity),n._renderer.elem?W.setAttributes(n._renderer.elem,r):n._renderer.elem=W.createElement(`stop`,r),e&&this._renderer.elem.appendChild(n._renderer.elem),n.flagReset()}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(e,t){H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),t||this._update();let n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?W.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=W.createElement(`radialGradient`,n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){let e=this._renderer.elem.childNodes.length!==this.stops.length;if(e)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let t=0;t<this.stops.length;t++){let n=this.stops[t],r={};n._flagOffset&&(r.offset=100*n._offset+`%`),n._flagColor&&(r[`stop-color`]=n._color),n._flagOpacity&&(r[`stop-opacity`]=n._opacity),n._renderer.elem?W.setAttributes(n._renderer.elem,r):n._renderer.elem=W.createElement(`stop`,r),e&&this._renderer.elem.appendChild(n._renderer.elem),n.flagReset()}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(e,t){H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),t||this._update();let n={},r={x:0,y:0},i=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(i.nodeName.toLowerCase()){case`canvas`:r.href=r[`xlink:href`]=i.toDataURL(`image/png`);break;case`img`:case`image`:r.href=r[`xlink:href`]=this.src}return(this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,i&&(n.x-=i.width/2,n.y-=i.height/2,this._scale instanceof B?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,i)&&(n.width=i.width,n.height=i.height,this._repeat===`no-repeat`&&(n.width+=1,n.height+=1),this._scale instanceof B?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.preserveAspectRatio=/no-repeat/i.test(this._repeat)?`xMidYMid`:`none`,r.width=n.width,r.height=n.height),(this._flagScale||this._flagLoaded)&&(this._renderer.image?W.setAttributes(this._renderer.image,r):this._renderer.image=W.createElement(`image`,r)),this._renderer.elem?Object.keys(n).length!==0&&W.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits=`userSpaceOnUse`,this._renderer.elem=W.createElement(`pattern`,n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},$s=class extends z{constructor(e){super(),this.domElement=e.domElement||W.createElement(`svg`),this.scene=new hs,this.scene.parent=this,this.defs=W.createElement(`defs`),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow=`hidden`}setSize(e,t){return this.width=e,this.height=t,W.setAttributes(this.domElement,{width:e,height:t}),this.trigger(z.Types.resize,e,t)}render(){return W.group.render.call(this.scene,this.domElement),W.defs.update(this.domElement),this}};L($s,`Utils`,W);var ec={create:function(e,t,n){let r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw e.deleteShader(r),new Ci(`unable to compile shader `+r+`: `+t)}return r},types:{vertex:`VERTEX_SHADER`,fragment:`FRAGMENT_SHADER`},path:{vertex:`
4
+ </div>`;this.core.outer.addClass(`lg-has-thumb`),this.settings.appendThumbnailsTo===`.lg-components`?this.core.$lgComponents.append(t):this.core.outer.append(t),this.$thumbOuter=this.core.outer.find(`.lg-thumb-outer`).first(),this.$lgThumb=this.core.outer.find(`.lg-thumb`).first(),this.settings.animateThumb&&this.core.outer.find(`.lg-thumb`).css(`transition-duration`,this.core.settings.speed+`ms`).css(`width`,this.thumbTotalWidth+`px`).css(`position`,`relative`),this.setThumbItemHtml(this.core.galleryItems)},e.prototype.enableThumbDrag=function(){var e=this,t={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0},n=!1;this.$thumbOuter.addClass(`lg-grab`),this.core.outer.find(`.lg-thumb`).first().on(`mousedown.lg.thumb`,function(r){e.thumbTotalWidth>e.thumbOuterWidth&&(r.preventDefault(),t.cords.startX=r.pageX,t.startTime=new Date,e.thumbClickable=!1,n=!0,e.core.outer.get().scrollLeft+=1,--e.core.outer.get().scrollLeft,e.$thumbOuter.removeClass(`lg-grab`).addClass(`lg-grabbing`))}),this.$LG(window).on(`mousemove.lg.thumb.global`+this.core.lgId,function(r){e.core.lgOpened&&n&&(t.cords.endX=r.pageX,t=e.onThumbTouchMove(t))}),this.$LG(window).on(`mouseup.lg.thumb.global`+this.core.lgId,function(){e.core.lgOpened&&(t.isMoved?t=e.onThumbTouchEnd(t):e.thumbClickable=!0,n&&(n=!1,e.$thumbOuter.removeClass(`lg-grabbing`).addClass(`lg-grab`)))})},e.prototype.enableThumbSwipe=function(){var e=this,t={cords:{startX:0,endX:0},isMoved:!1,newTranslateX:0,startTime:new Date,endTime:new Date,touchMoveTime:0};this.$lgThumb.on(`touchstart.lg`,function(n){e.thumbTotalWidth>e.thumbOuterWidth&&(n.preventDefault(),t.cords.startX=n.targetTouches[0].pageX,e.thumbClickable=!1,t.startTime=new Date)}),this.$lgThumb.on(`touchmove.lg`,function(n){e.thumbTotalWidth>e.thumbOuterWidth&&(n.preventDefault(),t.cords.endX=n.targetTouches[0].pageX,t=e.onThumbTouchMove(t))}),this.$lgThumb.on(`touchend.lg`,function(){t.isMoved?t=e.onThumbTouchEnd(t):e.thumbClickable=!0})},e.prototype.rebuildThumbnails=function(){var e=this;this.$thumbOuter.addClass(`lg-rebuilding-thumbnails`),setTimeout(function(){e.thumbTotalWidth=e.core.galleryItems.length*(e.settings.thumbWidth+e.settings.thumbMargin),e.$lgThumb.css(`width`,e.thumbTotalWidth+`px`),e.$lgThumb.empty(),e.setThumbItemHtml(e.core.galleryItems),e.animateThumb(e.core.index)},50),setTimeout(function(){e.$thumbOuter.removeClass(`lg-rebuilding-thumbnails`)},200)},e.prototype.setTranslate=function(e){this.$lgThumb.css(`transform`,`translate3d(-`+e+`px, 0px, 0px)`)},e.prototype.getPossibleTransformX=function(e){return e>this.thumbTotalWidth-this.thumbOuterWidth&&(e=this.thumbTotalWidth-this.thumbOuterWidth),e<0&&(e=0),e},e.prototype.animateThumb=function(e){if(this.$lgThumb.css(`transition-duration`,this.core.settings.speed+`ms`),this.settings.animateThumb){var t=0;switch(this.settings.currentPagerPosition){case`left`:t=0;break;case`middle`:t=this.thumbOuterWidth/2-this.settings.thumbWidth/2;break;case`right`:t=this.thumbOuterWidth-this.settings.thumbWidth}this.translateX=(this.settings.thumbWidth+this.settings.thumbMargin)*e-1-t,this.translateX>this.thumbTotalWidth-this.thumbOuterWidth&&(this.translateX=this.thumbTotalWidth-this.thumbOuterWidth),this.translateX<0&&(this.translateX=0),this.setTranslate(this.translateX)}},e.prototype.onThumbTouchMove=function(e){return e.newTranslateX=this.translateX,e.isMoved=!0,e.touchMoveTime=new Date().valueOf(),e.newTranslateX-=e.cords.endX-e.cords.startX,e.newTranslateX=this.getPossibleTransformX(e.newTranslateX),this.setTranslate(e.newTranslateX),this.$thumbOuter.addClass(`lg-dragging`),e},e.prototype.onThumbTouchEnd=function(e){e.isMoved=!1,e.endTime=new Date,this.$thumbOuter.removeClass(`lg-dragging`);var t=e.endTime.valueOf()-e.startTime.valueOf(),n=e.cords.endX-e.cords.startX,r=Math.abs(n)/t;return r>.15&&e.endTime.valueOf()-e.touchMoveTime<30?(r+=1,r>2&&(r+=1),r+=r*(Math.abs(n)/this.thumbOuterWidth),this.$lgThumb.css(`transition-duration`,Math.min(r-1,2)+`settings`),n*=r,this.translateX=this.getPossibleTransformX(this.translateX-n),this.setTranslate(this.translateX)):this.translateX=e.newTranslateX,Math.abs(e.cords.endX-e.cords.startX)<this.settings.thumbnailSwipeThreshold&&(this.thumbClickable=!0),e},e.prototype.getThumbHtml=function(e,t,n){var r=this.core.galleryItems[t].__slideVideoInfo||{},i=r.youtube&&this.settings.loadYouTubeThumbnail?`//img.youtube.com/vi/`+r.youtube[1]+`/`+this.settings.youTubeThumbSize+`.jpg`:e,a=document.createElement(`div`);a.setAttribute(`data-lg-item-id`,t+``),a.className=`lg-thumb-item `+(t===this.core.index?`active`:``),a.style.cssText=`width: `+this.settings.thumbWidth+`px; height: `+this.settings.thumbHeight+`; margin-right: `+this.settings.thumbMargin+`px;`;var o=document.createElement(`img`);return o.alt=n||``,o.setAttribute(`data-lg-item-id`,t+``),o.src=i,a.appendChild(o),a},e.prototype.setThumbItemHtml=function(e){for(var t=0;t<e.length;t++){var n=this.getThumbHtml(e[t].thumb,t,e[t].alt);this.$lgThumb.append(n)}},e.prototype.setAnimateThumbStyles=function(){this.settings.animateThumb&&this.core.outer.addClass(`lg-animate-thumb`)},e.prototype.manageActiveClassOnSlideChange=function(){var e=this;this.core.LGel.on(nn.beforeSlide+`.thumb`,function(t){var n=e.core.outer.find(`.lg-thumb-item`),r=t.detail.index;n.removeClass(`active`),n.eq(r).addClass(`active`)})},e.prototype.toggleThumbBar=function(){var e=this;this.settings.toggleThumb&&(this.core.outer.addClass(`lg-can-toggle`),this.core.$toolbar.append(`<button type="button" aria-label="`+this.settings.thumbnailPluginStrings.toggleThumbnails+`" class="lg-toggle-thumb lg-icon"></button>`),this.core.outer.find(`.lg-toggle-thumb`).first().on(`click.lg`,function(){e.core.outer.toggleClass(`lg-components-open`)}))},e.prototype.thumbKeyPress=function(){var e=this;this.$LG(window).on(`keydown.lg.thumb.global`+this.core.lgId,function(t){e.core.lgOpened&&e.settings.toggleThumb&&(t.keyCode===38?(t.preventDefault(),e.core.outer.addClass(`lg-components-open`)):t.keyCode===40&&(t.preventDefault(),e.core.outer.removeClass(`lg-components-open`)))})},e.prototype.destroy=function(){this.settings.thumbnail&&(this.$LG(window).off(`.lg.thumb.global`+this.core.lgId),this.core.LGel.off(`.lg.thumb`),this.core.LGel.off(`.thumb`),this.$thumbOuter.remove(),this.core.outer.removeClass(`lg-has-thumb`))},e}(),an=function(){return an=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},an.apply(this,arguments)},on={scale:1,zoom:!0,infiniteZoom:!0,actualSize:!0,showZoomInOutIcons:!1,actualSizeIcons:{zoomIn:`lg-zoom-in`,zoomOut:`lg-zoom-out`},enableZoomAfter:300,zoomPluginStrings:{zoomIn:`Zoom in`,zoomOut:`Zoom out`,viewActualSize:`View actual size`}},sn={afterAppendSlide:`lgAfterAppendSlide`,init:`lgInit`,hasVideo:`lgHasVideo`,containerResize:`lgContainerResize`,updateSlides:`lgUpdateSlides`,afterAppendSubHtml:`lgAfterAppendSubHtml`,beforeOpen:`lgBeforeOpen`,afterOpen:`lgAfterOpen`,slideItemLoad:`lgSlideItemLoad`,beforeSlide:`lgBeforeSlide`,afterSlide:`lgAfterSlide`,posterClick:`lgPosterClick`,dragStart:`lgDragStart`,dragMove:`lgDragMove`,dragEnd:`lgDragEnd`,beforeNextSlide:`lgBeforeNextSlide`,beforePrevSlide:`lgBeforePrevSlide`,beforeClose:`lgBeforeClose`,afterClose:`lgAfterClose`,rotateLeft:`lgRotateLeft`,rotateRight:`lgRotateRight`,flipHorizontal:`lgFlipHorizontal`,flipVertical:`lgFlipVertical`,autoplay:`lgAutoplay`,autoplayStart:`lgAutoplayStart`,autoplayStop:`lgAutoplayStop`},cn=500,ln=function(){function e(e,t){return this.core=e,this.$LG=t,this.settings=an(an({},on),this.core.settings),this}return e.prototype.buildTemplates=function(){var e=this.settings.showZoomInOutIcons?`<button id="`+this.core.getIdName(`lg-zoom-in`)+`" type="button" aria-label="`+this.settings.zoomPluginStrings.zoomIn+`" class="lg-zoom-in lg-icon"></button><button id="`+this.core.getIdName(`lg-zoom-out`)+`" type="button" aria-label="`+this.settings.zoomPluginStrings.zoomOut+`" class="lg-zoom-out lg-icon"></button>`:``;this.settings.actualSize&&(e+=`<button id="`+this.core.getIdName(`lg-actual-size`)+`" type="button" aria-label="`+this.settings.zoomPluginStrings.viewActualSize+`" class="`+this.settings.actualSizeIcons.zoomIn+` lg-icon"></button>`),this.core.outer.addClass(`lg-use-transition-for-zoom`),this.core.$toolbar.first().append(e)},e.prototype.enableZoom=function(e){var t=this,n=this.settings.enableZoomAfter+e.detail.delay;this.$LG(`body`).first().hasClass(`lg-from-hash`)&&e.detail.delay?n=0:this.$LG(`body`).first().removeClass(`lg-from-hash`),this.zoomableTimeout=setTimeout(function(){t.isImageSlide(t.core.index)&&(t.core.getSlideItem(e.detail.index).addClass(`lg-zoomable`),e.detail.index===t.core.index&&t.setZoomEssentials())},n+30)},e.prototype.enableZoomOnSlideItemLoad=function(){this.core.LGel.on(sn.slideItemLoad+`.zoom`,this.enableZoom.bind(this))},e.prototype.getDragCords=function(e){return{x:e.pageX,y:e.pageY}},e.prototype.getSwipeCords=function(e){return{x:e.touches[0].pageX,y:e.touches[0].pageY}},e.prototype.getDragAllowedAxises=function(e,t){if(!this.containerRect)return{allowX:!1,allowY:!1};var n=this.core.getSlideItem(this.core.index).find(`.lg-image`).first().get(),r=0,i=0,a=n.getBoundingClientRect();e?(r=n.offsetHeight*e,i=n.offsetWidth*e):t?(r=a.height+t*a.height,i=a.width+t*a.width):(r=a.height,i=a.width);var o=r>this.containerRect.height;return{allowX:i>this.containerRect.width,allowY:o}},e.prototype.setZoomEssentials=function(){this.containerRect=this.core.$content.get().getBoundingClientRect()},e.prototype.zoomImage=function(e,t,n,r){if(!(!this.containerRect||Math.abs(t)<=0)){var i=this.containerRect.width/2+this.containerRect.left,a=this.containerRect.height/2+this.containerRect.top+this.scrollTop,o,s;e===1&&(this.positionChanged=!1);var c=this.getDragAllowedAxises(0,t),l=c.allowY,u=c.allowX;this.positionChanged&&=(o=this.left/(this.scale-t),s=this.top/(this.scale-t),this.pageX=i-o,this.pageY=a-s,!1);var d=this.getPossibleSwipeDragCords(t),f,p,m=i-this.pageX,h=a-this.pageY;if(e-t>1){var g=(e-t)/Math.abs(t);m=(t<0?-m:m)+this.left*(g+(t<0?-1:1)),h=(t<0?-h:h)+this.top*(g+(t<0?-1:1)),f=m/g,p=h/g}else{var g=(e-t)*t;f=m*g,p=h*g}n&&(u?this.isBeyondPossibleLeft(f,d.minX)?f=d.minX:this.isBeyondPossibleRight(f,d.maxX)&&(f=d.maxX):e>1&&(f<d.minX?f=d.minX:f>d.maxX&&(f=d.maxX)),l?this.isBeyondPossibleTop(p,d.minY)?p=d.minY:this.isBeyondPossibleBottom(p,d.maxY)&&(p=d.maxY):e>1&&(p<d.minY?p=d.minY:p>d.maxY&&(p=d.maxY))),this.setZoomStyles({x:f,y:p,scale:e}),this.left=f,this.top=p,r&&this.setZoomImageSize()}},e.prototype.resetImageTranslate=function(e){if(this.isImageSlide(e)){var t=this.core.getSlideItem(e).find(`.lg-image`).first();this.imageReset=!1,t.removeClass(`reset-transition reset-transition-y reset-transition-x`),this.core.outer.removeClass(`lg-actual-size`),t.css(`width`,`auto`).css(`height`,`auto`),setTimeout(function(){t.removeClass(`no-transition`)},10)}},e.prototype.setZoomImageSize=function(){var e=this,t=this.core.getSlideItem(this.core.index).find(`.lg-image`).first();setTimeout(function(){var n=e.getCurrentImageActualSizeScale();e.scale>=n&&(t.addClass(`no-transition`),e.imageReset=!0)},cn),setTimeout(function(){var n=e.getCurrentImageActualSizeScale();if(e.scale>=n){var r=e.getDragAllowedAxises(e.scale);t.css(`width`,t.get().naturalWidth+`px`).css(`height`,t.get().naturalHeight+`px`),e.core.outer.addClass(`lg-actual-size`),r.allowX&&r.allowY?t.addClass(`reset-transition`):r.allowX&&!r.allowY?t.addClass(`reset-transition-x`):!r.allowX&&r.allowY&&t.addClass(`reset-transition-y`)}},cn+50)},e.prototype.setZoomStyles=function(e){var t=this.core.getSlideItem(this.core.index).find(`.lg-img-wrap`).first(),n=this.core.getSlideItem(this.core.index).find(`.lg-image`).first(),r=this.core.outer.find(`.lg-current .lg-dummy-img`).first();this.scale=e.scale,n.css(`transform`,`scale3d(`+e.scale+`, `+e.scale+`, 1)`),r.css(`transform`,`scale3d(`+e.scale+`, `+e.scale+`, 1)`);var i=`translate3d(`+e.x+`px, `+e.y+`px, 0)`;t.css(`transform`,i)},e.prototype.setActualSize=function(e,t){var n=this;if(!this.zoomInProgress){this.zoomInProgress=!0;var r=this.core.galleryItems[this.core.index];this.resetImageTranslate(e),setTimeout(function(){if(r.src&&!n.core.outer.hasClass(`lg-first-slide-loading`)){var e=n.getCurrentImageActualSizeScale(),i=n.scale;n.scale=n.core.outer.hasClass(`lg-zoomed`)?1:n.getScale(e),n.setPageCords(t),n.beginZoom(n.scale),n.zoomImage(n.scale,n.scale-i,!0,!0)}},50),setTimeout(function(){n.core.outer.removeClass(`lg-grabbing`).addClass(`lg-grab`)},60),setTimeout(function(){n.zoomInProgress=!1},cn+110)}},e.prototype.getNaturalWidth=function(e){var t=this.core.getSlideItem(e).find(`.lg-image`).first(),n=this.core.galleryItems[e].width;return n?parseFloat(n):t.get().naturalWidth},e.prototype.getActualSizeScale=function(e,t){var n,r;return e>=t?(n=e/t,r=n||2):r=1,r},e.prototype.getCurrentImageActualSizeScale=function(){var e=this.core.getSlideItem(this.core.index).find(`.lg-image`).first().get().offsetWidth,t=this.getNaturalWidth(this.core.index)||e;return this.getActualSizeScale(t,e)},e.prototype.getPageCords=function(e){var t={};if(e)t.x=e.pageX||e.touches[0].pageX,t.y=e.pageY||e.touches[0].pageY;else{var n=this.core.$content.get().getBoundingClientRect();t.x=n.width/2+n.left,t.y=n.height/2+this.scrollTop+n.top}return t},e.prototype.setPageCords=function(e){var t=this.getPageCords(e);this.pageX=t.x,this.pageY=t.y},e.prototype.manageActualPixelClassNames=function(){this.core.getElementById(`lg-actual-size`).removeClass(this.settings.actualSizeIcons.zoomIn).addClass(this.settings.actualSizeIcons.zoomOut)},e.prototype.beginZoom=function(e){return this.core.outer.removeClass(`lg-zoom-drag-transition lg-zoom-dragging`),e>1?(this.core.outer.addClass(`lg-zoomed`),this.manageActualPixelClassNames()):this.resetZoom(),e>1},e.prototype.getScale=function(e){var t=this.getCurrentImageActualSizeScale();return e<1?e=1:e>t&&(e=t),e},e.prototype.init=function(){var e=this;if(this.settings.zoom){this.buildTemplates(),this.enableZoomOnSlideItemLoad();var t=null;this.core.outer.on(`dblclick.lg`,function(t){e.$LG(t.target).hasClass(`lg-image`)&&e.setActualSize(e.core.index,t)}),this.core.outer.on(`touchstart.lg`,function(n){var r=e.$LG(n.target);n.touches.length===1&&r.hasClass(`lg-image`)&&(t?(clearTimeout(t),t=null,n.preventDefault(),e.setActualSize(e.core.index,n)):t=setTimeout(function(){t=null},300))}),this.core.LGel.on(sn.containerResize+`.zoom `+sn.rotateRight+`.zoom `+sn.rotateLeft+`.zoom `+sn.flipHorizontal+`.zoom `+sn.flipVertical+`.zoom`,function(){if(e.core.lgOpened&&e.isImageSlide(e.core.index)&&!e.core.touchAction){var t=e.core.getSlideItem(e.core.index).find(`.lg-img-wrap`).first();e.top=0,e.left=0,e.setZoomEssentials(),e.setZoomSwipeStyles(t,{x:0,y:0}),e.positionChanged=!0}}),this.$LG(window).on(`scroll.lg.zoom.global`+this.core.lgId,function(){e.core.lgOpened&&(e.scrollTop=e.$LG(window).scrollTop())}),this.core.getElementById(`lg-zoom-out`).on(`click.lg`,function(){if(e.isImageSlide(e.core.index)){var t=0;e.imageReset&&(e.resetImageTranslate(e.core.index),t=50),setTimeout(function(){var t=e.scale-e.settings.scale;t<1&&(t=1),e.beginZoom(t),e.zoomImage(t,-e.settings.scale,!0,!e.settings.infiniteZoom)},t)}}),this.core.getElementById(`lg-zoom-in`).on(`click.lg`,function(){e.zoomIn()}),this.core.getElementById(`lg-actual-size`).on(`click.lg`,function(){e.setActualSize(e.core.index)}),this.core.LGel.on(sn.beforeOpen+`.zoom`,function(){e.core.outer.find(`.lg-item`).removeClass(`lg-zoomable`)}),this.core.LGel.on(sn.afterOpen+`.zoom`,function(){e.scrollTop=e.$LG(window).scrollTop(),e.pageX=e.core.outer.width()/2,e.pageY=e.core.outer.height()/2+e.scrollTop,e.scale=1}),this.core.LGel.on(sn.afterSlide+`.zoom`,function(t){var n=t.detail.prevIndex;e.scale=1,e.positionChanged=!1,e.zoomInProgress=!1,e.resetZoom(n),e.resetImageTranslate(n),e.isImageSlide(e.core.index)&&e.setZoomEssentials()}),this.zoomDrag(),this.pinchZoom(),this.zoomSwipe(),this.zoomableTimeout=!1,this.positionChanged=!1,this.zoomInProgress=!1}},e.prototype.zoomIn=function(){if(this.isImageSlide(this.core.index)){var e=this.scale+this.settings.scale;this.settings.infiniteZoom||(e=this.getScale(e)),this.beginZoom(e),this.zoomImage(e,Math.min(this.settings.scale,e-this.scale),!0,!this.settings.infiniteZoom)}},e.prototype.resetZoom=function(e){this.core.outer.removeClass(`lg-zoomed lg-zoom-drag-transition`);var t=this.core.getElementById(`lg-actual-size`),n=this.core.getSlideItem(e===void 0?this.core.index:e);t.removeClass(this.settings.actualSizeIcons.zoomOut).addClass(this.settings.actualSizeIcons.zoomIn),n.find(`.lg-img-wrap`).first().removeAttr(`style`),n.find(`.lg-image`).first().removeAttr(`style`),this.scale=1,this.left=0,this.top=0,this.setPageCords()},e.prototype.getTouchDistance=function(e){return Math.sqrt((e.touches[0].pageX-e.touches[1].pageX)*(e.touches[0].pageX-e.touches[1].pageX)+(e.touches[0].pageY-e.touches[1].pageY)*(e.touches[0].pageY-e.touches[1].pageY))},e.prototype.pinchZoom=function(){var e=this,t=0,n=!1,r=1,i=0,a=this.core.getSlideItem(this.core.index);this.core.outer.on(`touchstart.lg`,function(n){if(a=e.core.getSlideItem(e.core.index),e.isImageSlide(e.core.index)&&n.touches.length===2){if(n.preventDefault(),e.core.outer.hasClass(`lg-first-slide-loading`))return;r=e.scale||1,e.core.outer.removeClass(`lg-zoom-drag-transition lg-zoom-dragging`),e.setPageCords(n),e.resetImageTranslate(e.core.index),e.core.touchAction=`pinch`,t=e.getTouchDistance(n)}}),this.core.$inner.on(`touchmove.lg`,function(o){if(o.touches.length===2&&e.core.touchAction===`pinch`&&(e.$LG(o.target).hasClass(`lg-item`)||a.get().contains(o.target))){o.preventDefault();var s=e.getTouchDistance(o),c=t-s;if(!n&&Math.abs(c)>5&&(n=!0),n){i=e.scale;var l=Math.max(1,r+-c*.02);e.scale=Math.round((l+2**-52)*100)/100;var u=e.scale-i;e.zoomImage(e.scale,Math.round((u+2**-52)*100)/100,!1,!1)}}}),this.core.$inner.on(`touchend.lg`,function(r){if(e.core.touchAction===`pinch`&&(e.$LG(r.target).hasClass(`lg-item`)||a.get().contains(r.target))){if(n=!1,t=0,e.scale<=1)e.resetZoom();else{var i=e.getCurrentImageActualSizeScale();if(e.scale>=i){var o=i-e.scale;o===0&&(o=.01),e.zoomImage(i,o,!1,!0)}e.manageActualPixelClassNames(),e.core.outer.addClass(`lg-zoomed`)}e.core.touchAction=void 0}})},e.prototype.touchendZoom=function(e,t,n,r,i){var a=t.x-e.x,o=t.y-e.y,s=Math.abs(a)/i+1,c=Math.abs(o)/i+1;s>2&&(s+=1),c>2&&(c+=1),a*=s,o*=c;var l=this.core.getSlideItem(this.core.index).find(`.lg-img-wrap`).first(),u={};u.x=this.left+a,u.y=this.top+o;var d=this.getPossibleSwipeDragCords();(Math.abs(a)>15||Math.abs(o)>15)&&(r&&(this.isBeyondPossibleTop(u.y,d.minY)?u.y=d.minY:this.isBeyondPossibleBottom(u.y,d.maxY)&&(u.y=d.maxY)),n&&(this.isBeyondPossibleLeft(u.x,d.minX)?u.x=d.minX:this.isBeyondPossibleRight(u.x,d.maxX)&&(u.x=d.maxX)),r?this.top=u.y:u.y=this.top,n?this.left=u.x:u.x=this.left,this.setZoomSwipeStyles(l,u),this.positionChanged=!0)},e.prototype.getZoomSwipeCords=function(e,t,n,r,i){var a={};if(r){if(a.y=this.top+(t.y-e.y),this.isBeyondPossibleTop(a.y,i.minY)){var o=i.minY-a.y;a.y=i.minY-o/6}else if(this.isBeyondPossibleBottom(a.y,i.maxY)){var s=a.y-i.maxY;a.y=i.maxY+s/6}}else a.y=this.top;if(n){if(a.x=this.left+(t.x-e.x),this.isBeyondPossibleLeft(a.x,i.minX)){var c=i.minX-a.x;a.x=i.minX-c/6}else if(this.isBeyondPossibleRight(a.x,i.maxX)){var l=a.x-i.maxX;a.x=i.maxX+l/6}}else a.x=this.left;return a},e.prototype.isBeyondPossibleLeft=function(e,t){return e>=t},e.prototype.isBeyondPossibleRight=function(e,t){return e<=t},e.prototype.isBeyondPossibleTop=function(e,t){return e>=t},e.prototype.isBeyondPossibleBottom=function(e,t){return e<=t},e.prototype.isImageSlide=function(e){var t=this.core.galleryItems[e];return this.core.getSlideType(t)===`image`},e.prototype.getPossibleSwipeDragCords=function(e){var t=this.core.getSlideItem(this.core.index).find(`.lg-image`).first(),n=this.core.mediaContainerPosition.bottom,r=t.get().getBoundingClientRect(),i=r.height,a=r.width;return e&&(i+=e*i,a+=e*a),{minY:(i-this.containerRect.height)/2,maxY:(this.containerRect.height-i)/2+n,minX:(a-this.containerRect.width)/2,maxX:(this.containerRect.width-a)/2}},e.prototype.setZoomSwipeStyles=function(e,t){e.css(`transform`,`translate3d(`+t.x+`px, `+t.y+`px, 0)`)},e.prototype.zoomSwipe=function(){var e=this,t={},n={},r=!1,i=!1,a=!1,o=new Date,s=new Date,c,l,u=this.core.getSlideItem(this.core.index);this.core.$inner.on(`touchstart.lg`,function(n){if(e.isImageSlide(e.core.index)&&(u=e.core.getSlideItem(e.core.index),(e.$LG(n.target).hasClass(`lg-item`)||u.get().contains(n.target))&&n.touches.length===1&&e.core.outer.hasClass(`lg-zoomed`))){n.preventDefault(),o=new Date,e.core.touchAction=`zoomSwipe`,l=e.core.getSlideItem(e.core.index).find(`.lg-img-wrap`).first();var r=e.getDragAllowedAxises(0);a=r.allowY,i=r.allowX,(i||a)&&(t=e.getSwipeCords(n)),c=e.getPossibleSwipeDragCords(),e.core.outer.addClass(`lg-zoom-dragging lg-zoom-drag-transition`)}}),this.core.$inner.on(`touchmove.lg`,function(o){if(o.touches.length===1&&e.core.touchAction===`zoomSwipe`&&(e.$LG(o.target).hasClass(`lg-item`)||u.get().contains(o.target))){o.preventDefault(),e.core.touchAction=`zoomSwipe`,n=e.getSwipeCords(o);var s=e.getZoomSwipeCords(t,n,i,a,c);(Math.abs(n.x-t.x)>15||Math.abs(n.y-t.y)>15)&&(r=!0,e.setZoomSwipeStyles(l,s))}}),this.core.$inner.on(`touchend.lg`,function(c){if(e.core.touchAction===`zoomSwipe`&&(e.$LG(c.target).hasClass(`lg-item`)||u.get().contains(c.target))){if(c.preventDefault(),e.core.touchAction=void 0,e.core.outer.removeClass(`lg-zoom-dragging`),!r)return;r=!1,s=new Date;var l=s.valueOf()-o.valueOf();e.touchendZoom(t,n,i,a,l)}})},e.prototype.zoomDrag=function(){var e=this,t={},n={},r=!1,i=!1,a=!1,o=!1,s,c,l,u;this.core.outer.on(`mousedown.lg.zoom`,function(n){if(e.isImageSlide(e.core.index)){var i=e.core.getSlideItem(e.core.index);if(e.$LG(n.target).hasClass(`lg-item`)||i.get().contains(n.target)){s=new Date,u=e.core.getSlideItem(e.core.index).find(`.lg-img-wrap`).first();var c=e.getDragAllowedAxises(0);o=c.allowY,a=c.allowX,e.core.outer.hasClass(`lg-zoomed`)&&e.$LG(n.target).hasClass(`lg-object`)&&(a||o)&&(n.preventDefault(),t=e.getDragCords(n),l=e.getPossibleSwipeDragCords(),r=!0,e.core.outer.removeClass(`lg-grab`).addClass(`lg-grabbing lg-zoom-drag-transition lg-zoom-dragging`))}}}),this.$LG(window).on(`mousemove.lg.zoom.global`+this.core.lgId,function(s){if(r){i=!0,n=e.getDragCords(s);var c=e.getZoomSwipeCords(t,n,a,o,l);e.setZoomSwipeStyles(u,c)}}),this.$LG(window).on(`mouseup.lg.zoom.global`+this.core.lgId,function(l){if(r){if(c=new Date,r=!1,e.core.outer.removeClass(`lg-zoom-dragging`),i&&(t.x!==n.x||t.y!==n.y)){n=e.getDragCords(l);var u=c.valueOf()-s.valueOf();e.touchendZoom(t,n,a,o,u)}i=!1}e.core.outer.removeClass(`lg-grabbing`).addClass(`lg-grab`)})},e.prototype.closeGallery=function(){this.resetZoom(),this.zoomInProgress=!1},e.prototype.destroy=function(){this.$LG(window).off(`.lg.zoom.global`+this.core.lgId),this.core.LGel.off(`.lg.zoom`),this.core.LGel.off(`.zoom`),clearTimeout(this.zoomableTimeout),this.zoomableTimeout=!1},e}(),un={ref:`gallery-container`,class:`lightgallery-wrapper`},dn=(0,r.defineComponent)({__name:`lightgallery`,props:{settings:{},onAfterAppendSlide:{type:Function},onInit:{type:Function},onHasVideo:{type:Function},onContainerResize:{type:Function},onAfterAppendSubHtml:{type:Function},onBeforeOpen:{type:Function},onAfterOpen:{type:Function},onSlideItemLoad:{type:Function},onBeforeSlide:{type:Function},onAfterSlide:{type:Function},onPosterClick:{type:Function},onDragStart:{type:Function},onDragMove:{type:Function},onDragEnd:{type:Function},onBeforeNextSlide:{type:Function},onBeforePrevSlide:{type:Function},onBeforeClose:{type:Function},onAfterClose:{type:Function},onRotateLeft:{type:Function},onRotateRight:{type:Function},onFlipHorizontal:{type:Function},onFlipVertical:{type:Function}},setup(e){let t=e,i={lgAfterAppendSlide:t.onAfterAppendSlide,lgInit:t.onInit,lgHasVideo:t.onHasVideo,lgContainerResize:t.onContainerResize,lgAfterAppendSubHtml:t.onAfterAppendSubHtml,lgBeforeOpen:t.onBeforeOpen,lgAfterOpen:t.onAfterOpen,lgSlideItemLoad:t.onSlideItemLoad,lgBeforeSlide:t.onBeforeSlide,lgAfterSlide:t.onAfterSlide,lgPosterClick:t.onPosterClick,lgDragStart:t.onDragStart,lgDragMove:t.onDragMove,lgDragEnd:t.onDragEnd,lgBeforeNextSlide:t.onBeforeNextSlide,lgBeforePrevSlide:t.onBeforePrevSlide,lgBeforeClose:t.onBeforeClose,lgAfterClose:t.onAfterClose,lgRotateLeft:t.onRotateLeft,lgRotateRight:t.onRotateRight,lgFlipHorizontal:t.onFlipHorizontal,lgFlipVertical:t.onFlipVertical},a=(0,r.useTemplateRef)(`gallery-container`),o=(0,r.ref)(null);return(0,r.onMounted)(async()=>{if(!a.value)return;let e=await import(`lightgallery`);o.value=e.default(a.value,{...t.settings}),(0,n.forOwn)(i,(e,t)=>{e&&a.value?.addEventListener(t,e)})}),(0,r.onBeforeUnmount)(()=>{o.value&&=(o.value?.destroy(),null)}),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,un,[(0,r.renderSlot)(e.$slots,`default`)],512))}}),fn=[`href`],pn=[`src`,`alt`],mn=(0,r.defineComponent)({__name:`image-gallery`,props:{images:{}},setup(e,{expose:t}){let n=(0,r.ref)(!1),i=(0,r.ref)(!1),a=(0,r.ref)({plugins:[rn,ln],addClass:`sc-lg-container`,licenseKey:`0000-0000-000-0000`,strings:{closeGallery:`Закрыть`,download:`Скачать`,mediaLoadingFailed:`Ошибка загрузки контента...`,nextSlide:`Следующее изображение`,playVideo:`Воспроизвести видео`,previousSlide:`Предыдущее изображение`,toggleMaximize:`Расширить`}}),s=()=>window.innerWidth*(oe.getDeviceTypeByResolution()===P.phone?.7:.8),c=(0,r.ref)(s()),l=()=>{c.value=s()};return(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,l)}),t({show:()=>{n.value=!0}}),window.addEventListener(`resize`,l),(t,s)=>{let l=qt,u=o.NPopover;return(0,r.openBlock)(),(0,r.createBlock)(u,{trigger:`manual`,show:n.value,class:`sc-image`,placement:`top-start`,onClickoutside:s[3]||=()=>{i.value||(n.value=!1)}},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:`inline-flex`,onClick:s[0]||=e=>n.value=!n.value},[(0,r.renderSlot)(t.$slots,`default`,{},()=>[(0,r.createVNode)(l)])])]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(dn,{settings:a.value,style:(0,r.normalizeStyle)(`max-width: ${c.value}px`),class:`flex flex-row overflow-x-scroll`,onAfterOpen:s[1]||=()=>{i.value=!0},onAfterClose:s[2]||=()=>{i.value=!1,n.value=!1}},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.images,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:t,href:e.image},[(0,r.createElementVNode)(`img`,{src:e.preview,alt:`Изображение #${t+1}`},null,8,pn)],8,fn))),128))]),_:1},8,[`settings`,`style`])]),_:3},8,[`show`])}}}),hn={class:`text-sm grid grid-cols-[auto_auto] gap-x-3 gap-y-1 items-baseline`},gn={class:`pr-3`},_n={class:`text-right`},vn=(0,r.defineComponent)({__name:`product-stock-count`,props:{product:{}},setup(e){return(t,n)=>{let i=Wt,a=o.NPopover;return(0,r.openBlock)(),(0,r.createBlock)(a,{trigger:`click`,placement:`top-start`,class:`sc-stock-count`},{trigger:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`,{},()=>[(0,r.createVNode)(i)])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,hn,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.product.stockCount,(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:n},[(0,r.createElementVNode)(`span`,gn,(0,r.toDisplayString)(t.warehouse.name),1),(0,r.createElementVNode)(`span`,_n,[(0,r.createTextVNode)((0,r.toDisplayString)(t.count??`В наличии`)+` `,1),t.count?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createTextVNode)((0,r.toDisplayString)(e.product.unit.name),1)],64)):(0,r.createCommentVNode)(``,!0)])],64))),128))])]),_:3})}}}),yn=[`innerHTML`],bn=[`innerHTML`],xn={class:`m-0 flex list-none flex-col gap-1 p-0 text-sm`},Sn=[`href`],Cn={key:1,class:`text-sm text-gray-500`},wn=(0,r.defineComponent)({__name:`product-info-content`,props:{product:{},size:{default:`medium`},maxHeight:{default:void 0},activeTab:{default:void 0}},setup(e){let t=e,n=(0,r.computed)(()=>t.maxHeight?{maxHeight:t.maxHeight}:void 0),i=(0,r.computed)(()=>t.product.properties?.description??``),a=(0,r.computed)(()=>t.product.properties?.specification??``),s=(0,r.computed)(()=>Oe(t.product)),c=(0,r.computed)(()=>[i.value?`description`:null,a.value?`specification`:null,s.value.length>0?`files`:null].filter(e=>e!==null)),l=(0,r.ref)(t.activeTab&&c.value.includes(t.activeTab)?t.activeTab:c.value[0]);return(t,u)=>{let d=o.NScrollbar,f=o.NTabPane,p=o.NTabs;return c.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(p,{key:0,value:l.value,"onUpdate:value":u[0]||=e=>l.value=e,size:e.size,type:`line`,class:`sc-product-info-content`},{default:(0,r.withCtx)(()=>[i.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:0,name:`description`,tab:`Описание`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(d,{style:(0,r.normalizeStyle)(n.value)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:`sc-product-info-html`,innerHTML:i.value},null,8,yn)]),_:1},8,[`style`])]),_:1})):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:1,name:`specification`,tab:`Характеристики`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(d,{style:(0,r.normalizeStyle)(n.value)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:`sc-product-info-html`,innerHTML:a.value},null,8,bn)]),_:1},8,[`style`])]),_:1})):(0,r.createCommentVNode)(``,!0),s.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(f,{key:2,name:`files`,tab:`Файлы (${s.value.length})`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(d,{style:(0,r.normalizeStyle)(n.value)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`ul`,xn,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:e.id},[(0,r.createElementVNode)(`a`,{href:e.url,target:`_blank`,rel:`noopener`},(0,r.toDisplayString)(e.typeName),9,Sn)]))),128))])]),_:1},8,[`style`])]),_:1},8,[`tab`])):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`value`,`size`])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Cn,` Описание, характеристики и файлы не заданы. `))}}}),Tn={key:0,class:`flex flex-row gap-2.5`},En={key:1,class:`flex flex-row flex-wrap justify-end gap-2.5`},Dn=(0,r.defineComponent)({__name:`base-dialog`,props:{show:{type:Boolean},title:{},sizes:{default:()=>({phone:{size:`small`,scale:.98},tablet:{size:`small`,scale:.9},default:{size:`medium`,scale:.7}})},modalWidth:{default:void 0},processing:{type:Boolean,default:!1},valid:{type:Boolean,default:!0},acceptButton:{default:()=>({show:!0,text:`ОК`})},cancelButton:{default:()=>({show:!0,text:`Отмена`})},trapFocus:{type:Boolean,default:!0}},emits:[`update:show`,`opening`,`closing`,`accept`,`processing:cancel`],setup(e,{expose:t,emit:n}){let i=e,a=n,s=(0,r.ref)(i.show),c=(0,r.ref)(i.processing),l=oe.initRefDependingOnDeviceResolution(i.sizes.phone.size,i.sizes.tablet.size,i.sizes.default.size),u=oe.initRefDependingOnDeviceResolution(i.sizes.phone.scale,i.sizes.tablet.scale,i.sizes.default.scale),d=(0,r.computed)(()=>i.modalWidth??window.innerWidth*u.value),f=()=>{a(`opening`),s.value=!0,a(`update:show`,s.value)},p=(e=`other`,t=!1)=>{if(c.value&&!t){a(`processing:cancel`,e=>{c.value=e});return}let n=!1;a(`closing`,e,()=>{n=!0}),n||(s.value=!1,a(`update:show`,s.value))},m=(0,r.ref)(null),h=e=>{let t=m.value?.containerRef,n=e.composedPath()[0]??e.target;t&&n instanceof Node&&!t.contains(n)||p(`mask`)},g=()=>{a(`accept`,e=>{c.value=e})};return(0,r.watch)(()=>i.show,e=>{e?f():p(`other`,!0)}),(0,r.watch)(()=>i.processing,e=>{c.value=e}),t({open:f,close:p,acceptHandler:g}),(t,n)=>{let i=o.NButton,a=o.NModal;return(0,r.openBlock)(),(0,r.createBlock)(a,{ref_key:`modalReference`,ref:m,loading:c.value,show:s.value,"show-icon":!1,size:(0,r.unref)(l),style:(0,r.normalizeStyle)(`width: ${d.value}px`),title:e.title,"trap-focus":e.trapFocus??!0,"action-class":t.$slots[`extra-action`]?`grid grid-cols-2 !justify-between`:void 0,preset:`dialog`,onClose:n[1]||=e=>p(`header`),onEsc:n[2]||=e=>p(`esc`),onMaskClick:h},(0,r.createSlots)({default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`)]),_:2},[t.$slots.header?{name:`header`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`header`)]),key:`0`}:void 0,t.$slots.action||t.$slots[`extra-action`]||e.acceptButton.show||e.cancelButton.show?{name:`action`,fn:(0,r.withCtx)(()=>[t.$slots[`extra-action`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Tn,[(0,r.renderSlot)(t.$slots,`extra-action`)])):(0,r.createCommentVNode)(``,!0),t.$slots.action||e.acceptButton.show||e.cancelButton.show?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,En,[(0,r.renderSlot)(t.$slots,`action`,{disabled:c.value}),e.acceptButton.show??!0?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,disabled:c.value||!e.valid,loading:c.value,size:(0,r.unref)(l),type:`primary`,onClick:g},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.acceptButton.text??`ОК`),1)]),_:1},8,[`disabled`,`loading`,`size`])):(0,r.createCommentVNode)(``,!0),e.cancelButton.show??!0?((0,r.openBlock)(),(0,r.createBlock)(i,{key:1,disabled:c.value,size:(0,r.unref)(l),type:`default`,onClick:n[0]||=e=>p(`footer`)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.cancelButton.text??`Отмена`),1)]),_:1},8,[`disabled`,`size`])):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)]),key:`1`}:void 0]),1032,[`loading`,`show`,`size`,`style`,`title`,`trap-focus`,`action-class`])}}}),On={class:`flex flex-col gap-3`},kn={class:`text-xs text-gray-500`},An=(0,r.defineComponent)({__name:`product-info-dialog`,props:{product:{},show:{type:Boolean,default:!1},activeTab:{default:void 0}},emits:[`update:show`],setup(e,{emit:t}){let n=t,i=()=>{n(`update:show`,!1)};return(t,n)=>((0,r.openBlock)(),(0,r.createBlock)(Dn,{show:e.show,title:e.product.name,"accept-button":{show:!1},"cancel-button":{show:!0,text:`Закрыть`},"trap-focus":!1,onClosing:i},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,On,[(0,r.createElementVNode)(`span`,kn,`Артикул: `+(0,r.toDisplayString)(e.product.code),1),(0,r.createVNode)(wn,{product:e.product,"active-tab":e.activeTab,"max-height":`60vh`},null,8,[`product`,`active-tab`])])]),_:1},8,[`show`,`title`]))}}),jn={class:`flex flex-col gap-2`},Mn={class:`flex justify-end border-0 border-t border-solid border-gray-200 pt-2`},Nn=(0,r.defineComponent)({__name:`product-info-popover`,props:{product:{}},setup(e){let t=(0,r.ref)(!1),n=(0,r.ref)(!1),i=(0,r.ref)(!1),a=()=>{t.value=!1,n.value=!0,i.value=!0};return(s,c)=>{let l=Wt,u=o.NButton,d=o.NPopover;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(d,{show:t.value,"onUpdate:show":c[0]||=e=>t.value=e,width:560,style:{maxWidth:`calc(100vw - 2rem)`},trigger:`click`,placement:`bottom-start`,class:`sc-product-info-popover`},{trigger:(0,r.withCtx)(()=>[(0,r.renderSlot)(s.$slots,`default`,{},()=>[(0,r.createVNode)(l,{title:`Описание и характеристики`,class:`cursor-pointer`})])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,jn,[(0,r.createVNode)(wn,{product:e.product,size:`small`,"max-height":`16rem`},null,8,[`product`]),(0,r.createElementVNode)(`div`,Mn,[(0,r.createVNode)(u,{text:``,type:`info`,size:`small`,onClick:a},{default:(0,r.withCtx)(()=>[...c[2]||=[(0,r.createTextVNode)(` Открыть полностью `,-1)]]),_:1})])])]),_:3},8,[`show`]),n.value?((0,r.openBlock)(),(0,r.createBlock)(An,{key:0,show:i.value,"onUpdate:show":c[1]||=e=>i.value=e,product:e.product},null,8,[`show`,`product`])):(0,r.createCommentVNode)(``,!0)],64)}}}),Pn={class:`flex flex-row justify-between`},Fn={key:0,class:`inline-flex flex-row gap-0.5 mr-2 align-sub`},In={key:1},Ln={class:`ml-2 align-sub`},Rn={class:`flex cursor-pointer flex-row gap-2 whitespace-nowrap`},zn={key:2,class:`ml-2 align-sub`},Bn={class:`@container`},Vn={class:`text-sc-dark-grey @sm:grid-cols-2 @2xl:grid-cols-3 grid grid-cols-1 gap-1 text-sm`},Hn={key:0,class:`sc-supplier-sku col-span-full whitespace-nowrap text-wrap`},Un={class:`text-sc-dark-grey`},Wn={key:1,class:`sc-product-code col-start-1 whitespace-nowrap`},Gn={class:`text-gray-600`},Kn={class:`flex cursor-pointer flex-row gap-1 whitespace-nowrap`},qn={key:3,class:`underline decoration-dashed`},Jn={key:4,class:`sc-product-pack whitespace-nowrap`},Yn={class:`text-gray-600`},Xn={key:5,class:`sc-product-planning-incoming-date col-span-full mt-1.5 text-wrap`},Zn={class:`text-gray-600`},Qn={key:0,class:`mt-3 flex flex-row gap-3 pb-2 text-base xl:text-lg`},$n={key:0},er={class:`sc-product-properties m-0 mt-3 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500`},tr=(0,r.defineComponent)({__name:`product-name`,props:{product:{},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showCode:{type:Boolean,default:!0},showProductCosts:{type:[Boolean,Function],default:!1},showPlanningDates:{type:Boolean,default:!0},showProductInfoButton:{type:[Boolean,Function],default:!1},showPriceHistory:{type:Boolean,default:!1},showCostDate:{type:Boolean,default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},currencyRates:{default:void 0},showAdditionalSaleIcon:{type:Boolean,default:!1},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductEditButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function],default:!1},productContextButtonsConfig:{type:Function,default:void 0}},setup(e,{expose:t}){let i=e,a=(0,r.computed)(()=>(0,n.isFunction)(i.showProductCosts)?i.showProductCosts(i.product):i.showProductCosts),s=(0,r.computed)(()=>(0,n.sortBy)(i.product.priceCoefficients,[`coefficient.slug`])),c=(0,r.computed)(()=>i.product?.properties?.planingIncomingDate),l=(0,r.useTemplateRef)(`image-gallery`),u=()=>{l.value?.show()},d=(0,r.computed)(()=>(0,n.isFunction)(i.allowNameClick)?i.allowNameClick(i.product):i.allowNameClick),f=(0,r.computed)(()=>((0,n.isFunction)(i.showProductInfoButton)?i.showProductInfoButton(i.product):i.showProductInfoButton)&&ke(i.product)),p=(0,r.computed)(()=>i.showProductAddToCartButton||i.showProductEditButton||i.showProductRequiredButton||(i.productContextButtonsConfig?.length??0)>0),m=()=>{d.value&&i.eventEmitter?.emit(`product:name-click`,{product:i.product,exposedMethods:{showProductImagesPreview:u}})};return t({showProductImagesPreview:u}),(t,n)=>{let i=$t,l=o.NTooltip,u=wt,h=Xt,g=qt,_=o.NText,v=kt,y=Wt,b=o.NScrollbar;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[(0,r.createElementVNode)(`div`,Pn,[(0,r.createVNode)(_,{type:`info`,class:`sc-product-name text-balance text-base font-medium text-black`},{default:(0,r.withCtx)(()=>[e.product?.isFavorite||e.product?.isPreviouslyOrdered||e.showAdditionalSaleIcon?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Fn,[e.product?.isFavorite??!1?((0,r.openBlock)(),(0,r.createBlock)(l,{key:0,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{class:`!text-yellow-300`})]),default:(0,r.withCtx)(()=>[n[0]||=(0,r.createTextVNode)(` Избранный товар `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0),e.product?.isPreviouslyOrdered??!1?((0,r.openBlock)(),(0,r.createBlock)(l,{key:1,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(u,{class:`!text-green-700`})]),default:(0,r.withCtx)(()=>[n[1]||=(0,r.createTextVNode)(` Ранее заказанный товар `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0),e.showAdditionalSaleIcon?((0,r.openBlock)(),(0,r.createBlock)(l,{key:2,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(h,{class:`!text-green-500`})]),default:(0,r.withCtx)(()=>[n[2]||=(0,r.createTextVNode)(` Дополнительная продажа `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"cursor-pointer":d.value&&e.eventEmitter,"text-gray-400 line-through":e.product.isHidden}),onClick:m},(0,r.toDisplayString)(e.product.name),3),e.product.onOrder?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,In,` [Под заказ] `)):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,Ln,[e.product.images&&e.product.images.length>0?((0,r.openBlock)(),(0,r.createBlock)(mn,{key:0,ref:`image-gallery`,images:e.product.images},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Rn,[(0,r.createVNode)(g)])]),_:1},8,[`images`])):(0,r.createCommentVNode)(``,!0)]),f.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,zn,[(0,r.createVNode)(Nn,{product:e.product},null,8,[`product`])])):(0,r.createCommentVNode)(``,!0)]),_:1}),p.value?((0,r.openBlock)(),(0,r.createBlock)(v,{key:0,product:e.product,"event-emitter":e.eventEmitter,"show-product-add-to-cart-button":e.showProductAddToCartButton,"show-product-edit-button":e.showProductEditButton,"show-product-required-button":e.showProductRequiredButton,"product-context-buttons-config":e.productContextButtonsConfig},null,8,[`product`,`event-emitter`,`show-product-add-to-cart-button`,`show-product-edit-button`,`show-product-required-button`,`product-context-buttons-config`])):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,Bn,[(0,r.createElementVNode)(`div`,Vn,[e.product.supplierSku?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Hn,[n[3]||=(0,r.createTextVNode)(` Артикул производителя/поставщика: `,-1),(0,r.createElementVNode)(`span`,Un,(0,r.toDisplayString)(e.product.supplierSku),1)])):(0,r.createCommentVNode)(``,!0),e.showCode?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Wn,[n[4]||=(0,r.createTextVNode)(` Артикул: `,-1),(0,r.createElementVNode)(`span`,Gn,(0,r.toDisplayString)(e.product.code),1)])):(0,r.createCommentVNode)(``,!0),e.product.stockCount&&e.product.stockCount.length>0?((0,r.openBlock)(),(0,r.createBlock)(vn,{key:2,product:e.product},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Kn,[n[5]||=(0,r.createElementVNode)(`span`,{class:`underline decoration-dashed`},`В наличии`,-1),(0,r.createVNode)(y,{class:`mt-0.5`})])]),_:1},8,[`product`])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,qn,` Нет в наличии `)),e.product.pack??e.product?.properties?.pack?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Jn,[n[6]||=(0,r.createTextVNode)(` Норма упаковки: `,-1),(0,r.createElementVNode)(`span`,Yn,(0,r.toDisplayString)(e.product.pack??e.product?.properties?.pack),1)])):(0,r.createCommentVNode)(``,!0),e.showPlanningDates&&c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Xn,[n[7]||=(0,r.createTextVNode)(` Планируемая дата поступления на основной склад: `,-1),(0,r.createElementVNode)(`span`,Zn,(0,r.toDisplayString)(c.value),1)])):(0,r.createCommentVNode)(``,!0)])]),(0,r.createVNode)(b,{"x-scrollable":``},{default:(0,r.withCtx)(()=>[a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Qn,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value,t=>((0,r.openBlock)(),(0,r.createBlock)(Vt,{key:t.coefficient.slug,product:e.product,"cost-field-name":t.coefficient.slug??``,"event-emitter":e.eventEmitter,"allow-price-click":e.allowPriceClick,"show-tag":!0,"show-price-history":e.showPriceHistory,"currency-rates":e.currencyRates},null,8,[`product`,`cost-field-name`,`event-emitter`,`allow-price-click`,`show-price-history`,`currency-rates`]))),128)),(0,r.createVNode)(Vt,{product:e.product,"event-emitter":e.eventEmitter,"allow-price-click":e.allowPriceClick,"show-tag":!0,"show-quantity-unit":!0,"show-cost-date":e.showCostDate,"show-price-history":e.showPriceHistory,"currency-rates":e.currencyRates,"cost-field-name":`cost`,"additional-through-field-name":`retailCost`,style:{"background-color":`var(--n-merged-td-color)`},class:`sticky right-0 border-0 border-l-2 border-solid border-gray-300 pl-2`},null,8,[`product`,`event-emitter`,`allow-price-click`,`show-cost-date`,`show-price-history`,`currency-rates`])])):(0,r.createCommentVNode)(``,!0)]),_:1}),e.showSlugs||e.showProperties?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,$n,[(0,r.createElementVNode)(`ul`,er,[e.showSlugs?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)({id:e.product.id,slug:e.product.slug},(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:t},` (`+(0,r.toDisplayString)(t)+`): `+(0,r.toDisplayString)(e),1))),128)):(0,r.createCommentVNode)(``,!0),e.showProperties?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(e.product.properties,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:t},` (`+(0,r.toDisplayString)(t)+`): `+(0,r.toDisplayString)(e),1))),128)):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0)])}}}),nr=(e,t,n)=>({key:e,title:t,className:`align-top`,resizable:!0,render:t=>(0,r.h)(Vt,{product:t,costFieldName:e,eventEmitter:n.eventEmitter,allowPriceClick:n.allowPriceClick,currencyRates:n.currencyRates})}),rr=(e,t)=>{if(e.length===0)return[];let i=[],a={};switch((0,n.isNil)(t.isProductItemSelected)||i.push({key:`checkbox`,title:``,className:`align-top`,width:`32`,render:e=>(0,r.h)(o.NCheckbox,{checked:!!t.isProductItemSelected?.(e),disabled:t.isProductItemSelected?.(e)===`disabled`,onUpdateChecked:n=>{t.eventEmitter.emit(`product:checked`,{product:e,checked:n})}})}),oe.getDeviceTypeByResolution()){case P.phone:case P.tablet:i.push({key:`name`,title:`Наименование`,className:`align-top`,render:e=>(0,r.h)(tr,{product:e,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,showProductCosts:t.showProductCosts,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductInfoButton:t.showProductInfoButton,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,showProductRequiredButton:t.showProductRequiredButton,currencyRates:t.currencyRates,productContextButtonsConfig:t.productContextButtonsConfig})});break;default:i.push({key:`name`,title:`Наименование`,className:`align-top`,resizable:!0,render:e=>(0,r.h)(tr,{product:e,eventEmitter:t.eventEmitter,showSlugs:t.showSlugs,showProperties:t.showProperties,allowNameClick:t.allowNameClick,allowPriceClick:t.allowPriceClick,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,showProductInfoButton:t.showProductInfoButton,currencyRates:t.currencyRates})}),t.showProductCosts&&((0,n.forEach)(e,e=>{(0,n.forEach)(e.priceCoefficients,e=>{a[e.coefficient.slug??``]||(a[e.coefficient.slug??``]=e.coefficient)})}),(0,n.forEach)((0,n.sortBy)(a,[`slug`]),e=>{i.push(nr(e.slug??``,e.name,t))}),i.push({key:`cost`,title:`Цена`,className:`align-top`,resizable:!0,render:e=>(0,r.h)(Vt,{product:e,costFieldName:`cost`,additionalThroughFieldName:`retailCost`,eventEmitter:t.eventEmitter,allowPriceClick:t.allowPriceClick,showQuantityUnit:!0,showPriceHistory:t.showPriceHistory,showCostDate:t.showCostDate,currencyRates:t.currencyRates})})),(t.showProductEditButton||t.showProductRequiredButton||t.showProductAddToCartButton||!(0,n.isNil)(t.productContextButtonsConfig))&&i.push({key:`actions`,title:``,className:`align-top`,width:`50`,render:e=>(0,r.h)(kt,{product:e,eventEmitter:t.eventEmitter,showProductAddToCartButton:t.showProductAddToCartButton,showProductEditButton:t.showProductEditButton,showProductRequiredButton:t.showProductRequiredButton,productContextButtonsConfig:t.productContextButtonsConfig})})}return i},ir={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function ar(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,ir,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,d:`M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8`},null,-1),(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32M192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416M272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0Zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8Zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14Z`},null,-1)]])}var or=(0,r.markRaw)({name:`ion-trash`,render:ar}),sr={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function cr(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,sr,[...t[0]||=[(0,r.createElementVNode)(`path`,{d:`M448 224H288V64h-64v160H64v64h160v160h64V288h160z`,fill:`currentColor`},null,-1)]])}var lr=(0,r.markRaw)({name:`ion-plus`,render:cr}),ur={key:0,class:`flex w-fit items-center gap-2`},dr={key:1,class:`flex flex-wrap gap-1`},fr={key:0},pr={key:2},mr=(0,r.defineComponent)({__name:`configurators-product-info`,props:{isProductSearching:{type:Boolean,default:!1},product:{default:void 0},validation:{default:void 0}},setup(e){let t=e,n=(0,r.computed)(()=>t.product?.properties?.planingProductionDate);return(t,i)=>{let a=o.NSpin,s=o.NText;return e.isProductSearching?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ur,[(0,r.createVNode)(a,{size:17,class:`w-fit`}),i[0]||=(0,r.createElementVNode)(`div`,null,`Выполняется поиск товара ...`,-1)])):e.product&&!e.product.isNewRec()?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,dr,[(0,r.createElementVNode)(`div`,null,(0,r.toDisplayString)(e.product.code)+` - `+(0,r.toDisplayString)(e.product.name)+` - `+(0,r.toDisplayString)((0,r.unref)(F).formatMoney(e.product.costRub))+` ₽ / `+(0,r.toDisplayString)(e.product.unit.name),1),n.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,fr,`(Планируемая дата производства: `+(0,r.toDisplayString)(n.value)+`)`,1)):(0,r.createCommentVNode)(``,!0)])):e.validation?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,pr,[(0,r.createVNode)(s,{type:e.validation.validationStatus},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.validation.feedback),1)]),_:1},8,[`type`])])):(0,r.createCommentVNode)(``,!0)}}}),hr={class:`flex flex-col gap-4`},gr={class:`flex flex-col gap-2`},_r={class:`mt-8 font-bold`},vr={class:`grid grow grid-cols-2 items-start gap-2`},yr={key:2,class:`text-red-500 text-sm`},br={key:3,class:`text-red-500 text-sm mb-2`},xr={class:`flex flex-col gap-4`},Sr={key:1},Cr={class:`text-lg font-semibold`},wr={class:`flex gap-3`},Tr=bt((0,r.defineComponent)({__name:`kozyrek-configurator-params-form`,props:{value:{},settings:{},previewParams:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},selectTemplateIndex:{}},emits:[`update:value`,`update:params`,`submit`,`click:add-line`,`click:remove-line`,`click:save-template`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useTemplateRef)(`form-reference`),u=(0,r.ref)(!1),d=(0,r.ref)((0,n.cloneDeep)(s.value)),f=(0,r.computed)(()=>{let e={"configuratorParams.length":[I.required,I.min(s.settings.stripMinLength),I.max(s.settings.stripMaxLength||Number.MAX_VALUE),I.step(s.settings.lengthStep),De.serverValidation(s.validation.length?.feedback)],quantity:[I.required,I.min(1),I.step(1),De.serverValidation(s.validation.quantity?.feedback)],marker:[De.serverValidation(s.validation.marker?.feedback)]};return(0,n.forEach)(d.value.configuratorParams.linesWidths,(t,n)=>{let r=d.value.configuratorParams.linesWidths.length>1?s.settings.minLineWidth:s.settings.stripMinWidth;e[`configuratorParams.linesWidths.${n}`]=[I.required,I.min(r),I.max(s.settings.maxLineWidth),I.step(s.settings.lineWidthStep),De.serverValidation(s.validation[`lines_widths[${n+1}]`]?.feedback)]}),(0,n.forEach)(d.value.configuratorParams.linesAngles,(t,n)=>{e[`configuratorParams.linesAngles.${n}`]=[I.required,I.min(s.settings.minLineAngle),I.max(s.settings.maxLineAngle),I.step(s.settings.lineAngleStep),De.serverValidation(s.validation[`lines_angles[${n+1}]`]?.feedback)]}),e}),p=(0,r.ref)(s.settings.canSetDopProdaga??!1),m=(0,r.computed)(()=>{let{length:e}=d.value.configuratorParams,{quantity:t}=d.value,n=d.value.product?.costRub||0;if(!e||!t||n===0)return null;let r=e/1e3;return F.formatMoney(n*t*r)}),h=(0,r.computed)(()=>(0,n.reduce)(d.value.configuratorParams.linesWidths,(e,t)=>e+(t||0),0)),g=(0,r.computed)(()=>{let e=h.value;return e>=s.settings.stripMinWidth&&e<=s.settings.stripMaxWidth}),_=(0,r.computed)(()=>{let{configuratorParams:e}=d.value,t=(0,n.every)(e.linesWidths,e=>!!(e&&e>0)),r=(0,n.every)(e.linesAngles,e=>!(0,n.isNil)(e)),i=!!(d.value.quantity&&d.value.quantity>0),a=e.length>0&&e.length>0;return t&&r&&i&&a&&g.value}),v=()=>{(0,r.nextTick)(()=>{l.value?.validate(e=>{e||(c(`update:params`,d.value.configuratorParams),y(`configuratorParams`,d.value.configuratorParams))}).catch(n.noop)})},y=(e,n)=>{let r=new t.OrderItemBase(d.value);r[e]=n,e===`configuratorParams`&&(r.product=new t.ClientProduct),c(`update:value`,r)};return(0,r.watch)(()=>s.previewParams,e=>{d.value.configuratorParams.linesWidths=e.linesWidths,d.value.configuratorParams.linesAngles=e.linesAngles},{deep:!0}),(0,r.watch)(()=>s.value,e=>{d.value=(0,n.cloneDeep)(e)},{deep:!0}),i({validate:l.value?.validate,formReference:l}),(t,n)=>{let i=lr,a=or,s=o.NCheckbox;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:d.value,rules:f.value,class:`flex flex-col gap-4 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,hr,[n[21]||=(0,r.createElementVNode)(`span`,{class:`w-full font-bold`},`Ширина участка, мм / Угол сгиба, ° (А)`,-1),e.settings.startTailConfigs&&e.settings.startTailConfigs.length>0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NFormItem),{key:0,required:!0,"show-feedback":!1,label:`Тип стартового капельника`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:d.value.configuratorParams.startTailType,"onUpdate:value":[n[0]||=e=>d.value.configuratorParams.startTailType=e,v],options:e.settings.startTailConfigs.map(({label:e},t)=>({label:e,value:t})),placeholder:`Тип стартового капельника`},null,8,[`value`,`options`])]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,gr,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(d.value.configuratorParams.linesAngles,(t,s)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:s,class:`flex items-start gap-2`},[(0,r.createElementVNode)(`div`,_r,(0,r.toDisplayString)(s+1),1),(0,r.createElementVNode)(`div`,vr,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.linesWidths.${s}`,label:`Ширина, мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.configuratorParams.linesWidths[s],"onUpdate:value":[e=>d.value.configuratorParams.linesWidths[s]=e,n[2]||=e=>v()],parse:(0,r.unref)(be),"show-button":!1,class:`w-full`,onKeydown:n[1]||=e=>(0,r.unref)(ve)(e),onInput:t=>(0,r.unref)(xe)(e.validation,`lines_widths[${s+1}]`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onUpdate:value`,`parse`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.linesAngles.${s}`,label:`Угол сгиба, °`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.configuratorParams.linesAngles[s],"onUpdate:value":[e=>d.value.configuratorParams.linesAngles[s]=e,n[4]||=e=>v()],parse:(0,r.unref)(be),"show-button":!1,class:`w-full`,onKeydown:n[3]||=e=>(0,r.unref)(ve)(e,!0),onInput:t=>(0,r.unref)(xe)(e.validation,`lines_angles[${s+1}]`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onUpdate:value`,`parse`,`onInput`,`onFocus`])]),_:2},1032,[`path`])]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{label:void 0,"show-feedback":!1,required:!0,class:`shrink-0`},{default:(0,r.withCtx)(()=>[e.settings.showOnlyTemplates?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,size:`medium`,onClick:e=>c(`click:add-line`,s)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1},8,[`onClick`])),e.settings.showOnlyTemplates?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:1,disabled:d.value.configuratorParams.linesWidths.length===1,size:`medium`,class:`ml-2`,onClick:e=>c(`click:remove-line`,s)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`disabled`,`onClick`]))]),_:2},1024)]))),128))]),e.settings.endTailConfigs&&e.settings.endTailConfigs.length>0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NFormItem),{key:1,label:`Тип конечного капельника`,"show-feedback":!1,required:!0},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:d.value.configuratorParams.endTailType,"onUpdate:value":[n[5]||=e=>d.value.configuratorParams.endTailType=e,v],options:e.settings.endTailConfigs.map(({label:e},t)=>({label:e,value:t})),placeholder:`Тип конечного капельника`},null,8,[`value`,`options`])]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(mr,{"is-product-searching":e.isProductSearching,product:d.value.product,validation:e.validation.product},null,8,[`is-product-searching`,`product`,`validation`]),g.value?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,yr,` Суммарная ширина участков гиба должна быть от `+(0,r.toDisplayString)(e.settings.stripMinWidth)+` до `+(0,r.toDisplayString)(e.settings.stripMaxWidth)+` мм., текущая ширина: `+(0,r.toDisplayString)(h.value)+` мм. `,1)),_.value?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,br,` Пожалуйста, заполните все обязательные поля корректно. `)),e.settings.allowSaveTemplates&&e.selectTemplateIndex===e.settings.allTemplates?.length-1?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:4,type:`tertiary`,class:`self-start`,loading:u.value,onClick:n[6]||=e=>c(`click:save-template`)},{default:(0,r.withCtx)(()=>[...n[20]||=[(0,r.createTextVNode)(` Сохранить шаблон `,-1)]]),_:1},8,[`loading`])):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,xr,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{label:`С какой стороны изделие будет иметь цвет`,"show-feedback":!1},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:d.value.configuratorParams.colorSide,"onUpdate:value":[n[7]||=e=>d.value.configuratorParams.colorSide=e,v],options:[{label:`Цвет сверху`,value:`top`},{label:` Цвет снизу`,value:`bottom`}],placeholder:`С какой стороны изделие будет иметь цвет`},null,8,[`value`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.length`,label:`Метраж${e.settings.stripMinLength?` от `+e.settings.stripMinLength:``}${e.settings.stripMaxLength?` до `+e.settings.stripMaxLength:``} мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.configuratorParams.length,"onUpdate:value":[n[8]||=e=>d.value.configuratorParams.length=e,n[11]||=e=>v()],parse:(0,r.unref)(be),"show-button":!1,placeholder:`Введите метраж`,class:`w-full`,onKeydown:n[9]||=e=>(0,r.unref)(ve)(e),onInput:n[10]||=t=>(0,r.unref)(xe)(e.validation,`length`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`quantity`,label:`Количество`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.quantity,"onUpdate:value":[n[12]||=e=>d.value.quantity=e,n[15]||=e=>y(`quantity`,e??0)],"show-button":!1,placeholder:`Введите количество`,class:`w-full`,onKeydown:n[13]||=e=>(0,r.unref)(ve)(e,!1),onInput:n[14]||=t=>(0,r.unref)(xe)(e.validation,`quantity`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:d.value.marker??null,placeholder:`Введите маркировку`,onInput:n[16]||=t=>(0,r.unref)(xe)(e.validation,`marker`),"onUpdate:value":n[17]||=e=>{d.value.marker=e??null,y(`marker`,e??null)},onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1}),p.value?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0,checked:d.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[18]||=e=>{d.value.isAdditionalSale=e??!1,y(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[22]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),m.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Sr,[n[23]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,Cr,(0,r.toDisplayString)(m.value)+` ₽`,1)])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,wr,[(0,r.createVNode)((0,r.unref)(o.NButton),{loading:e.isSubmitProcessing,disabled:!_.value||d.value.product.isNewRec(),type:`primary`,class:`self-start`,onClick:n[19]||=e=>c(`submit`,d.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(d.value.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`])])])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>c(`submit`,d.value)]])}}}),[[`__scopeId`,`data-v-d7be5193`]]),Er=Object.defineProperty,Dr=Object.defineProperties,Or=Object.getOwnPropertyDescriptors,kr=Object.getOwnPropertySymbols,Ar=Object.prototype.hasOwnProperty,jr=Object.prototype.propertyIsEnumerable,Mr=e=>{throw TypeError(e)},Nr=(e,t,n)=>t in e?Er(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Pr=(e,t)=>{for(var n in t||={})Ar.call(t,n)&&Nr(e,n,t[n]);if(kr)for(var n of kr(t))jr.call(t,n)&&Nr(e,n,t[n]);return e},Fr=(e,t)=>Dr(e,Or(t)),Ir=(e,t)=>{for(var n in t)Er(e,n,{get:t[n],enumerable:!0})},L=(e,t,n)=>Nr(e,typeof t==`symbol`?t:t+``,n),Lr=(e,t,n)=>t.has(e)||Mr(`Cannot `+n),Rr=(e,t,n)=>(Lr(e,t,`read from private field`),n?n.call(e):t.get(e)),zr=(e,t,n)=>t.has(e)?Mr(`Cannot add the same private member more than once`):t instanceof WeakSet?t.add(e):t.set(e,n),Br=(e,t,n,r)=>(Lr(e,t,`write to private field`),r?r.call(e,n):t.set(e,n),n),Vr={Image:null,isHeadless:!1,shim:function(e,t){return e.tagName=e.nodeName=t||`canvas`,e.nodeType=1,e.getAttribute=function(e){return this[e]},e.setAttribute=function(e,t){return this[e]=t,this},e},polyfill:function(e,t){return Vr.shim(e),t!==void 0&&(Vr.Image=t),Vr.isHeadless=!0,e}},Hr={};Ir(Hr,{Curve:()=>ui,getAnchorsFromArcData:()=>yi,getComponentOnCubicBezier:()=>di,getControlPoints:()=>_i,getCurveBoundingBox:()=>mi,getCurveFromPoints:()=>gi,getCurveLength:()=>pi,getReflection:()=>vi,integrate:()=>hi,subdivide:()=>fi});var Ur={};Ir(Ur,{HALF_PI:()=>qr,NumArray:()=>ti,TWO_PI:()=>Kr,decomposeMatrix:()=>Jr,getComputedMatrix:()=>Xr,getEffectiveStrokeWidth:()=>ii,getPoT:()=>$r,lerp:()=>Zr,mod:()=>ei,setMatrix:()=>Yr,toFixed:()=>ri});var Wr;typeof window<`u`?Wr=window:typeof global<`u`?Wr=global:typeof self<`u`&&(Wr=self);var Gr,Kr=Math.PI*2,qr=Math.PI*.5;function Jr(e,t,n,r,i,a){let o;return arguments.length<=1?(o=e.a,t=e.b,n=e.c,r=e.d,i=e.e,a=e.f):o=e,{translateX:i,translateY:a,scaleX:Math.sqrt(o*o+t*t),scaleY:Math.sqrt(n*n+r*r),rotation:180*Math.atan2(t,o)/Math.PI}}function Yr(e){Gr=e}function Xr(e,t){t=t&&t.identity()||new Gr;let n=e,r=[];for(;n&&n._matrix;)r.push(n._matrix),n=n.parent;r.reverse();for(let e=0;e<r.length;e++){let n=r[e].elements;t.multiply(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])}return t}function Zr(e,t,n){return n*(t-e)+e}var Qr=[2,4,8,16,32,64,128,256,512,1024,2048,4096];function $r(e){let t=0;for(;Qr[t]&&Qr[t]<e;)t++;return Qr[t]}function ei(e,t){for(;e<0;)e+=t;return e%t}var ti=Wr.Float32Array||Array,ni=Math.floor;function ri(e){return ni(e*1e6)/1e6}function ii(e,t){let n=e._linewidth;if(e.strokeAttenuation)return n;t||=e.worldMatrix||Xr(e);let r=Jr(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]),i=Math.max(Math.abs(r.scaleX),Math.abs(r.scaleY));return i>0?n/i:n}var R={move:`M`,line:`L`,curve:`C`,arc:`A`,close:`Z`},z=class{constructor(){L(this,`_events`,{}),L(this,`_bound`,!1)}addEventListener(e,t){return(this._events[e]||(this._events[e]=[])).push(t),this._bound=!0,this}on(){return this.addEventListener.apply(this,arguments)}bind(){return this.addEventListener.apply(this,arguments)}removeEventListener(e,t){if(!this._events)return this;if(!e&&!t)return this._events={},this._bound=!1,this;let n=e?[e]:Object.keys(this._events);for(let r=0,i=n.length;r<i;r++){e=n[r];let i=this._events[e];if(i){let n=[];if(t)for(let e=0,r=i.length;e<r;e++){let r=i[e];r=r.handler?r.handler:r,t!==r&&n.push(r)}this._events[e]=n}}return this}off(){return this.removeEventListener.apply(this,arguments)}unbind(){return this.removeEventListener.apply(this,arguments)}dispatchEvent(e){if(!this._events)return this;let t=Array.prototype.slice.call(arguments,1),n=this._events[e];if(n)for(let e=0;e<n.length;e++)n[e].call(this,...t);return this}trigger(){return this.dispatchEvent.apply(this,arguments)}listen(e,t,n){let r=this;e&&(i.obj=e,i.name=t,i.handler=n,e.on(t,i));function i(){n.apply(r,arguments)}return r}ignore(e,t,n){return e.off(t,n),this}};L(z,`Types`,{play:`play`,pause:`pause`,update:`update`,render:`render`,resize:`resize`,change:`change`,remove:`remove`,insert:`insert`,order:`order`,load:`load`}),L(z,`Methods`,[`addEventListener`,`on`,`removeEventListener`,`off`,`unbind`,`dispatchEvent`,`trigger`,`listen`,`ignore`]);var ai={x:{enumerable:!0,get:function(){return this._x},set:function(e){this._x!==e&&(this._x=e,this._bound&&this.dispatchEvent(z.Types.change))}},y:{enumerable:!0,get:function(){return this._y},set:function(e){this._y!==e&&(this._y=e,this._bound&&this.dispatchEvent(z.Types.change))}}},oi=class e extends z{constructor(e=0,t=0){super(),L(this,`_x`,0),L(this,`_y`,0);for(let e in ai)Object.defineProperty(this,e,ai[e]);this.x=e,this.y=t}static add(t,n){return new e(t.x+n.x,t.y+n.y)}static sub(t,n){return new e(t.x-n.x,t.y-n.y)}static subtract(t,n){return e.sub(t,n)}static ratioBetween(e,t){return(e.x*t.x+e.y*t.y)/(e.length()*t.length())}static angleBetween(e,t){if(arguments.length>=4){let e=arguments[0]-arguments[2],t=arguments[1]-arguments[3];return Math.atan2(t,e)}let n=e.x-t.x,r=e.y-t.y;return Math.atan2(r,n)}static distanceBetween(t,n){return Math.sqrt(e.distanceBetweenSquared(t,n))}static distanceBetweenSquared(e,t){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r}set(e,t){return this.x=e,this.y=t,this}copy(e){return this.x=e.x,this.y=e.y,this}clear(){return this.x=0,this.y=0,this}clone(){return new e(this.x,this.y)}add(e,t){return arguments.length<=0||(arguments.length<=1?typeof e==`number`?(this.x+=e,this.y+=e):e&&typeof e.x==`number`&&typeof e.y==`number`&&(this.x+=e.x,this.y+=e.y):(this.x+=e,this.y+=t)),this}addSelf(e){return this.add.apply(this,arguments)}sub(e,t){return arguments.length<=0||(arguments.length<=1?typeof e==`number`?(this.x-=e,this.y-=e):e&&typeof e.x==`number`&&typeof e.y==`number`&&(this.x-=e.x,this.y-=e.y):(this.x-=e,this.y-=t)),this}subtract(){return this.sub.apply(this,arguments)}subSelf(e){return this.sub.apply(this,arguments)}subtractSelf(e){return this.sub.apply(this,arguments)}multiply(e,t){return arguments.length<=0||(arguments.length<=1?typeof e==`number`?(this.x*=e,this.y*=e):e&&typeof e.x==`number`&&typeof e.y==`number`&&(this.x*=e.x,this.y*=e.y):(this.x*=e,this.y*=t)),this}multiplySelf(e){return this.multiply.apply(this,arguments)}multiplyScalar(e){return this.multiply(e)}divide(e,t){return arguments.length<=0||(arguments.length<=1?typeof e==`number`?(this.x/=e,this.y/=e):e&&typeof e.x==`number`&&typeof e.y==`number`&&(this.x/=e.x,this.y/=e.y):(this.x/=e,this.y/=t),isNaN(this.x)&&(this.x=0),isNaN(this.y)&&(this.y=0)),this}divideSelf(e){return this.divide.apply(this,arguments)}divideScalar(e){return this.divide(e)}negate(){return this.multiply(-1)}dot(e){return this.x*e.x+this.y*e.y}length(){return Math.sqrt(this.lengthSquared())}lengthSquared(){return this.x*this.x+this.y*this.y}normalize(){return this.divideScalar(this.length())}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){let t=this.x-e.x,n=this.y-e.y;return t*t+n*n}setLength(e){return this.normalize().multiplyScalar(e)}equals(e,t){return t=t===void 0?1e-4:t,this.distanceTo(e)<t}lerp(e,t){let n=(e.x-this.x)*t+this.x,r=(e.y-this.y)*t+this.y;return this.set(n,r)}isZero(e){return e=e===void 0?1e-4:e,this.length()<e}toString(){return this.x+`, `+this.y}toObject(){return{x:ri(this.x),y:ri(this.y)}}rotate(e){let t=this.x,n=this.y,r=Math.cos(e),i=Math.sin(e);return this.x=t*r-n*i,this.y=t*i+n*r,this}};L(oi,`zero`,new oi),L(oi,`left`,new oi(-1,0)),L(oi,`right`,new oi(1,0)),L(oi,`up`,new oi(0,-1)),L(oi,`down`,new oi(0,1));var B=oi,V=class e extends B{constructor(t=0,n=0,r=0,i=0,a=0,o=0,s=R.move){super(t,n),L(this,`controls`,{left:new B,right:new B}),L(this,`_command`,R.move),L(this,`_relative`,!0),L(this,`_rx`,0),L(this,`_ry`,0),L(this,`_xAxisRotation`,0),L(this,`_largeArcFlag`,0),L(this,`_sweepFlag`,1);for(let e in si)Object.defineProperty(this,e,si[e]);this.command=s,this.relative=!0;let c=e.makeBroadcast(this);this.controls.left.set(r,i).addEventListener(z.Types.change,c),this.controls.right.set(a,o).addEventListener(z.Types.change,c)}static makeBroadcast(e){return t;function t(){e._bound&&e.dispatchEvent(z.Types.change)}}static fromObject(t){return new e().copy(t)}copy(e){return this.x=e.x,this.y=e.y,typeof e.command==`string`&&(this.command=e.command),e.controls&&(e.controls.left&&this.controls.left.copy(e.controls.left),e.controls.right&&this.controls.right.copy(e.controls.right)),typeof e.relative==`boolean`&&(this.relative=e.relative),typeof e.rx==`number`&&(this.rx=e.rx),typeof e.ry==`number`&&(this.ry=e.ry),typeof e.xAxisRotation==`number`&&(this.xAxisRotation=e.xAxisRotation),typeof e.largeArcFlag==`number`&&(this.largeArcFlag=e.largeArcFlag),typeof e.sweepFlag==`number`&&(this.sweepFlag=e.sweepFlag),this}clone(){return new e().copy(this)}toObject(){return{x:ri(this.x),y:ri(this.y),command:this.command,relative:this.relative,controls:{left:this.controls.left.toObject(),right:this.controls.right.toObject()},rx:ri(this.rx),ry:ri(this.ry),xAxisRotation:ri(this.xAxisRotation),largeArcFlag:ri(this.largeArcFlag),sweepFlag:ri(this.sweepFlag)}}toString(){return JSON.stringify(this.toObject())}},si={command:{enumerable:!0,get:function(){return this._command},set:function(e){this._command!==e&&(this._command=e,this._bound&&this.dispatchEvent(z.Types.change))}},relative:{enumerable:!0,get:function(){return this._relative},set:function(e){this._relative!==!!e&&(this._relative=!!e,this._bound&&this.dispatchEvent(z.Types.change))}},rx:{enumerable:!0,get:function(){return this._rx},set:function(e){this._rx!==e&&(this._rx=e,this._bound&&this.dispatchEvent(z.Types.change))}},ry:{enumerable:!0,get:function(){return this._ry},set:function(e){this._ry!==e&&(this._ry=e,this._bound&&this.dispatchEvent(z.Types.change))}},xAxisRotation:{enumerable:!0,get:function(){return this._xAxisRotation},set:function(e){this._xAxisRotation!==e&&(this._xAxisRotation=e,this._bound&&this.dispatchEvent(z.Types.change))}},largeArcFlag:{enumerable:!0,get:function(){return this._largeArcFlag},set:function(e){this._largeArcFlag!==e&&(this._largeArcFlag=e,this._bound&&this.dispatchEvent(z.Types.change))}},sweepFlag:{get:function(){return this._sweepFlag},set:function(e){this._sweepFlag!==e&&(this._sweepFlag=e,this._bound&&this.dispatchEvent(z.Types.change))}}},ci=0,li={NextFrameId:null,Types:{webgl:`WebGLRenderer`,svg:`SVGRenderer`,canvas:`CanvasRenderer`},Version:`v0.8.24`,PublishDate:`2026-08-29T05:23:23.915Z`,Identifier:`two-`,Resolution:12,AutoCalculateImportedMatrices:!0,Instances:[],uniqueId:function(){return ci++}},ui={CollinearityEpsilon:10**-30,RecursionLimit:16,CuspLimit:0,Tolerance:{distance:.25,angle:0,epsilon:2**-52},abscissas:[[.5773502691896],[0,.7745966692415],[.3399810435849,.8611363115941],[0,.5384693101057,.9061798459387],[.2386191860832,.6612093864663,.9324695142032],[0,.4058451513774,.7415311855994,.9491079123428],[.1834346424956,.5255324099163,.7966664774136,.9602898564975],[0,.3242534234038,.6133714327006,.8360311073266,.9681602395076],[.1488743389816,.4333953941292,.679409568299,.865063366689,.9739065285172],[0,.2695431559523,.5190961292068,.730152005574,.8870625997681,.9782286581461],[.1252334085115,.3678314989982,.5873179542866,.7699026741943,.9041172563705,.9815606342467],[0,.2304583159551,.4484927510364,.6423493394403,.8015780907333,.917598399223,.9841830547186],[.1080549487073,.3191123689279,.5152486363582,.6872929048117,.8272013150698,.9284348836636,.9862838086968],[0,.2011940939974,.3941513470776,.5709721726085,.7244177313602,.8482065834104,.9372733924007,.9879925180205],[.0950125098376,.2816035507793,.4580167776572,.6178762444026,.755404408355,.8656312023878,.9445750230732,.9894009349916]],weights:[[1],[.8888888888889,.5555555555556],[.6521451548625,.3478548451375],[.5688888888889,.4786286704994,.2369268850562],[.4679139345727,.3607615730481,.1713244923792],[.4179591836735,.3818300505051,.2797053914893,.1294849661689],[.3626837833784,.3137066458779,.2223810344534,.1012285362904],[.3302393550013,.31234707704,.2606106964029,.1806481606949,.0812743883616],[.2955242247148,.26926671931,.219086362516,.1494513491506,.0666713443087],[.2729250867779,.2628045445102,.233193764592,.1862902109277,.1255803694649,.0556685671162],[.2491470458134,.2334925365384,.2031674267231,.1600783285433,.1069393259953,.0471753363865],[.2325515532309,.2262831802629,.2078160475369,.1781459807619,.1388735102198,.0921214998377,.0404840047653],[.2152638534632,.2051984637213,.1855383974779,.1572031671582,.1215185706879,.0801580871598,.0351194603318],[.2025782419256,.1984314853271,.1861610000156,.166269205817,.1395706779262,.1071592204672,.0703660474881,.0307532419961],[.1894506104551,.1826034150449,.169156519395,.1495959888166,.1246289712555,.0951585116825,.0622535239386,.0271524594118]]};function di(e,t,n,r,i){let a=1-e;return a*a*a*t+3*a*a*e*n+3*a*e*e*r+e*e*e*i}function fi(e,t,n,r,i,a,o,s,c){c||=ui.RecursionLimit;let l=c+1;if(Math.abs(e-o)<.001&&Math.abs(t-s)<.001)return[new V(o,s)];let u=[];for(let c=0;c<l;c++){let d=c/l,f=di(d,e,n,i,o),p=di(d,t,r,a,s);u.push(new V(f,p))}return u}function pi(e,t,n,r,i,a,o,s,c){if(e===n&&t===r&&i===o&&a===s){let n=o-e,r=s-t;return Math.sqrt(n*n+r*r)}let l=9*(n-i)+3*(o-e),u=6*(e+i)-12*n,d=3*(n-e),f=9*(r-a)+3*(s-t),p=6*(t+a)-12*r,m=3*(r-t);function h(e){let t=(l*e+u)*e+d,n=(f*e+p)*e+m;return Math.sqrt(t*t+n*n)}return hi(h,0,1,c||ui.RecursionLimit)}function mi(e,t,n,r,i,a,o,s){let c=[],l=[[],[]],u,d,f,p,m,h,g,_;for(let l=0;l<2;++l)if(l===0?(d=6*e-12*n+6*i,u=-3*e+9*n-9*i+3*o,f=3*n-3*e):(d=6*t-12*r+6*a,u=-3*t+9*r-9*a+3*s,f=3*r-3*t),Math.abs(u)<.001){if(Math.abs(d)<.001)continue;p=-f/d,0<p&&p<1&&c.push(p)}else g=d*d-4*f*u,_=Math.sqrt(g),!(g<0)&&(m=(-d+_)/(2*u),0<m&&m<1&&c.push(m),h=(-d-_)/(2*u),0<h&&h<1&&c.push(h));let v=c.length,y=v,b;for(;v--;)p=c[v],b=1-p,l[0][v]=b*b*b*e+3*b*b*p*n+3*b*p*p*i+p*p*p*o,l[1][v]=b*b*b*t+3*b*b*p*r+3*b*p*p*a+p*p*p*s;return l[0][y]=e,l[1][y]=t,l[0][y+1]=o,l[1][y+1]=s,l[0].length=l[1].length=y+2,{min:{x:Math.min.apply(0,l[0]),y:Math.min.apply(0,l[1])},max:{x:Math.max.apply(0,l[0]),y:Math.max.apply(0,l[1])}}}function hi(e,t,n,r){let i=ui.abscissas[r-2],a=ui.weights[r-2],o=.5*(n-t),s=o+t,c=0,l=r+1>>1,u=r&1?a[c++]*e(s):0;for(;c<l;){let t=o*i[c];u+=a[c++]*(e(s+t)+e(s-t))}return o*u}function gi(e,t){let n=e.length,r=n-1;for(let i=0;i<n;i++){let a=e[i],o=t?ei(i-1,n):Math.max(i-1,0),s=t?ei(i+1,n):Math.min(i+1,r),c=e[o],l=a,u=e[s];_i(c,l,u),l.command=i===0?R.move:R.curve}}function _i(e,t,n){let r=B.angleBetween(e,t),i=B.angleBetween(n,t),a=B.distanceBetween(e,t),o=B.distanceBetween(n,t),s=(r+i)/2;return a<.001||o<.001?(typeof t.relative==`boolean`&&!t.relative&&(t.controls.left.copy(t),t.controls.right.copy(t)),t):(a*=.33,o*=.33,i<r?s+=qr:s-=qr,t.controls.left.x=Math.cos(s)*a,t.controls.left.y=Math.sin(s)*a,s-=Math.PI,t.controls.right.x=Math.cos(s)*o,t.controls.right.y=Math.sin(s)*o,typeof t.relative==`boolean`&&!t.relative&&(t.controls.left.x+=t.x,t.controls.left.y+=t.y,t.controls.right.x+=t.x,t.controls.right.y+=t.y),t)}function vi(e,t,n){return new B(2*e.x-(t.x+e.x)-(n?e.x:0),2*e.y-(t.y+e.y)-(n?e.y:0))}function yi(e,t,n,r,i,a,o){let s=li.Resolution,c=[];for(let e=0;e<s;e++){let t=(e+1)/s;o&&(t=1-t);let l=t*a+i,u=new V(n*Math.cos(l),r*Math.sin(l));u.command=R.line,c.push(u)}}var bi=Array.prototype.slice;function xi(e){if(e==null)return!1;let t=e.length;return typeof t==`number`&&t>=0&&t<4294967296}var H={isNaN:function(e){return typeof e==`number`&&e!==+e},isElement:function(e){return!!(e&&e.nodeType===1)},isObject:function(e){let t=typeof e;return t===`function`||t===`object`&&!!e},isFunction:function(e){return typeof e==`function`},extend:function(e){let t=bi.call(arguments,1);for(let n=0;n<t.length;n++){let r=t[n];for(let t in r)e[t]=r[t]}return e},defaults:function(e){let t=bi.call(arguments,1);for(let n=0;n<t.length;n++){let r=t[n];for(let t in r)e[t]===void 0&&(e[t]=r[t])}return e},each:function(e,t,n){let r=n||this,i=!xi(e)&&Object.keys(e),a=(i||e).length;for(let n=0;n<a;n++){let a=i?i[n]:n;t.call(r,e[a],a,e)}return e},performance:Wr.performance&&Wr.performance.now?Wr.performance:Date},Si={hasEventListeners:typeof Wr.addEventListener==`function`,bind:function(e,t,n,r){return this.hasEventListeners?e.addEventListener(t,n,!!r):e.attachEvent(`on`+t,n),Si},unbind:function(e,t,n,r){return Si.hasEventListeners?e.removeEventListeners(t,n,!!r):e.detachEvent(`on`+t,n),Si},getRequestAnimationFrame:function(){let e=[`ms`,`moz`,`webkit`,`o`],t=0,n=Wr.requestAnimationFrame;if(!n){for(let t=0;t<e.length;t++)n=Wr[e[t]+`RequestAnimationFrame`]||n;n||=r}function r(e,n){let r=new Date().getTime(),i=Math.max(0,16-(r-t)),a=Wr.setTimeout(o,i);t=r+i;function o(){e(r+i)}return a}return n}},Ci=Wr.document?Wr.document.createElement(`div`):{};Ci.id=`help-two-load`,Object.defineProperty(Si,"temp",{enumerable:!0,get:function(){return H.isElement(Ci)&&!Wr.document.head.contains(Ci)&&(Ci.style.display=`none`,Wr.document.head.appendChild(Ci)),Ci}});var wi=class extends Error{constructor(e){super(),L(this,`name`,`Two.js`),L(this,`message`),this.message=e}},Ti=Wr.devicePixelRatio||1;function Ei(e){return e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1}function Di(e){return Ti/Ei(e)}var Oi=class{constructor(){L(this,`map`,{})}add(e,t){return this.map[e]=t,this}remove(e){return delete this.map[e],this}get(e){return this.map[e]}contains(e){return e in this.map}},ki,Ai=class extends Array{constructor(){super(),zr(this,ki,new z),arguments[0]&&Array.isArray(arguments[0])?arguments[0].length>0&&this.push.apply(this,arguments[0]):arguments.length>0&&this.push.apply(this,arguments)}get _events(){return Rr(this,ki)}set _events(e){Br(this,ki,e)}get _bound(){return Rr(this,ki)._bound}set _bound(e){Rr(this,ki)._bound=e}addEventListener(){return Rr(this,ki).addEventListener?.apply(this,arguments)}on(){return Rr(this,ki).on?.apply(this,arguments)}bind(){return Rr(this,ki).bind?.apply(this,arguments)}removeEventListener(){return Rr(this,ki).removeEventListener?.apply(this,arguments)}off(){return Rr(this,ki).off?.apply(this,arguments)}unbind(){return Rr(this,ki).unbind?.apply(this,arguments)}dispatchEvent(){return Rr(this,ki).dispatchEvent?.apply(this,arguments)}trigger(){return Rr(this,ki).trigger?.apply(this,arguments)}listen(){return Rr(this,ki).listen?.apply(this,arguments)}ignore(){return Rr(this,ki).ignore?.apply(this,arguments)}pop(){let e=super.pop.apply(this,arguments);return this.trigger(z.Types.remove,[e]),e}shift(){let e=super.shift.apply(this,arguments);return this.trigger(z.Types.remove,[e]),e}push(){let e=super.push.apply(this,arguments);return this.trigger(z.Types.insert,arguments),e}unshift(){let e=super.unshift.apply(this,arguments);return this.trigger(z.Types.insert,arguments),e}splice(){let e=super.splice.apply(this,arguments);if(this.trigger(z.Types.remove,e),arguments.length>2){let e=this.slice(arguments[0],arguments[0]+arguments.length-2);this.trigger(z.Types.insert,e),this.trigger(z.Types.order)}return e}sort(){return super.sort.apply(this,arguments),this.trigger(z.Types.order),this}reverse(){return super.reverse.apply(this,arguments),this.trigger(z.Types.order),this}indexOf(){return super.indexOf.apply(this,arguments)}map(e,t){let n=[];for(let r=0;r<this.length;r++){let i=this[r],a;a=t?e.call(t,i,r):e(i,r),n.push(a)}return n}};ki=new WeakMap;var ji=class e extends z{constructor(){super(),L(this,`_flagId`,!1),L(this,`_flagClassName`,!1),L(this,`_renderer`,{}),L(this,`_id`,li.Identifier+li.uniqueId()),L(this,`_className`,``),L(this,`classList`,[]);for(let e in Ni)Object.defineProperty(this,e,Ni[e])}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}flagReset(){return this._flagId=this._flagClassName=!1,this}copy(e){return e.renderer&&typeof e.renderer.type==`string`&&(this.renderer.type=e.renderer.type),typeof e.className==`string`&&(this.className=e.className),this}toObject(){return{renderer:{type:this.renderer.type},id:this.id,className:this.className}}dispose(){if(typeof this.unbind==`function`&&this.unbind(),this._renderer){if(this._renderer.elem&&this._renderer.elem.parentNode&&(this._renderer.elem.parentNode.removeChild(this._renderer.elem),delete this._renderer.elem),this.type===`WebGLRenderer`&&this.renderer.ctx){let e=this.renderer.ctx;this._renderer.texture&&(e.deleteTexture(this._renderer.texture),delete this._renderer.texture),this._renderer.positionBuffer&&(e.deleteBuffer(this._renderer.positionBuffer),delete this._renderer.positionBuffer),this._renderer.effect&&(this._renderer.effect=null)}this.type===`CanvasRenderer`&&this._renderer.context&&delete this._renderer.context}let e=this._renderer.type;return this._renderer={type:e},this}};L(ji,`Properties`,[`renderer`,`id`,`className`]);var Mi=ji,Ni={renderer:{enumerable:!1,get:function(){return this._renderer}},id:{enumerable:!0,get:function(){return this._id},set:function(e){let t=this._id;e!==this._id&&(this._id=e,this._flagId=!0,this.parent&&(delete this.parent.children.ids[t],this.parent.children.ids[this._id]=this))}},className:{enumerable:!0,get:function(){return this._className},set:function(e){this._className!==e&&(this._flagClassName=!0,this.classList=e.split(/\s+?/),this._className=e)}}},Pi,Fi={video:/\.(mp4|webm|ogg)$/i,image:/\.(jpe?g|png|gif|tiff|webp)$/i,effect:/texture|gradient/i};Wr.document&&(Pi=document.createElement(`a`));var Ii=class e extends Mi{constructor(e,t){super(),L(this,`_flagSrc`,!1),L(this,`_flagImage`,!1),L(this,`_flagVideo`,!1),L(this,`_flagLoaded`,!1),L(this,`_flagRepeat`,!1),L(this,`_flagOffset`,!1),L(this,`_flagScale`,!1),L(this,`_src`,``),L(this,`_image`,null),L(this,`_loaded`,!1),L(this,`_repeat`,`no-repeat`),L(this,`_scale`,1),L(this,`_offset`,null);for(let e in Ri)Object.defineProperty(this,e,Ri[e]);if(this._renderer.type=`texture`,this._renderer.flagOffset=zi.bind(this),this._renderer.flagScale=Bi.bind(this),this.loaded=!1,this.repeat=`no-repeat`,this.offset=new B,typeof t==`function`){let e=function(){this.unbind(z.Types.load,e),typeof t==`function`&&t()}.bind(this);this.bind(z.Types.load,e)}if(typeof e==`string`)this.src=e;else if(typeof e==`object`){let t=Object.prototype.toString.call(e);(t===`[object HTMLImageElement]`||t===`[object HTMLCanvasElement]`||t===`[object HTMLVideoElement]`||t===`[object Image]`)&&(this.image=e)}this._update()}fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}static getAbsoluteURL(e){return Pi?(Pi.href=e,Pi.href):e}static loadHeadlessBuffer(e,t){e.image.onload=t,e.image.src=e.src}static getTag(e){return e&&e.nodeName&&e.nodeName.toLowerCase()||`img`}static getImage(t){let n=e.getAbsoluteURL(t);if(e.ImageRegistry.contains(n))return e.ImageRegistry.get(n);let r;return Vr.Image?(r=new Vr.Image,Vr.shim(r,`img`)):Wr.document?r=Fi.video.test(n)?document.createElement(`video`):document.createElement(`img`):console.warn(`Two.js: no prototypical image defined for Two.Texture`),r.crossOrigin=`anonymous`,r.referrerPolicy=`no-referrer`,r}static load(t,n){let r=t.image,i=e.getTag(r);t._flagImage&&(/canvas/i.test(i)?e.Register.canvas(t,n):(t._src=!Vr.isHeadless&&r.getAttribute(`two-src`)||r.src,e.Register[i](t,n))),t._flagSrc&&(r||(r=e.getImage(t.src),t.image=r),i=e.getTag(r),e.Register[i](t,n))}clone(){let t=new e(this.src);return t.repeat=this.repeat,t.offset.copy(this.offset),t.scale=this.scale,t}copy(e){return this.src=e.src,this.repeat=e.repeat,this.offset=typeof e.offset==`number`||e.offset instanceof B?e.offset:new B().copy(e.offset),this.scale=typeof e.scale==`number`||e.scale instanceof B?e.scale:new B().copy(e.scale),this}toObject(){let e=super.toObject.call(this);return e.renderer.type=`texture`,e.src=this.src,e.repeat=this.repeat,e.offset=this.offset.toObject(),e.scale=typeof this.scale==`number`?this.scale:this.scale.toObject(),e}_update(){return(this._flagSrc||this._flagImage)&&(this.trigger(z.Types.change),(this._flagSrc||this._flagImage)&&(this.loaded=!1,e.load(this,function(){this.loaded=!0,this.trigger(z.Types.change).trigger(z.Types.load)}.bind(this)))),this._image&&this._image.readyState>=4&&(this._flagVideo=!0),this}flagReset(){return this._flagSrc=this._flagImage=this._flagLoaded=this._flagRepeat=this._flagVideo=this._flagScale=this._flagOffset=!1,super.flagReset.call(this),this}dispose(){if(super.dispose(),`elem`in this._renderer){let e=this._renderer.elem;e.parentNode.removeChild(e)}return`effect`in this._renderer&&(this._renderer.effect=null),this}};L(Ii,`Properties`,[`src`,`loaded`,`repeat`,`scale`,`offset`,`image`]),L(Ii,`RegularExpressions`,Fi),L(Ii,`ImageRegistry`,new Oi),L(Ii,`Register`,{canvas:function(e,t){e._src=`#`+e.id,Ii.ImageRegistry.add(e.src,e.image),typeof t==`function`&&t()},img:function(e,t){let n=e.image,r=function(e){!Vr.isHeadless&&n.removeEventListener&&typeof n.removeEventListener==`function`&&(n.removeEventListener(`load`,r,!1),n.removeEventListener(`error`,i,!1)),typeof t==`function`&&t()},i=function(t){throw!Vr.isHeadless&&typeof n.removeEventListener==`function`&&(n.removeEventListener(`load`,r,!1),n.removeEventListener(`error`,i,!1)),new wi(`unable to load `+e.src)};typeof n.width==`number`&&n.width>0&&typeof n.height==`number`&&n.height>0?r():!Vr.isHeadless&&typeof n.addEventListener==`function`&&(n.addEventListener(`load`,r,!1),n.addEventListener(`error`,i,!1)),e._src=Ii.getAbsoluteURL(e._src),!(!Vr.isHeadless&&n&&n.getAttribute(`two-src`))&&(Vr.isHeadless||n.setAttribute(`two-src`,e.src),Ii.ImageRegistry.add(e.src,n),Vr.isHeadless?Ii.loadHeadlessBuffer(e,r):e.image.src=e.src)},video:function(e,t){if(Vr.isHeadless)throw new wi(`video textures are not implemented in headless environments.`);let n=function(i){e.image.removeEventListener(`canplaythrough`,n,!1),e.image.removeEventListener(`error`,r,!1),e.image.width=e.image.videoWidth,e.image.height=e.image.videoHeight,typeof t==`function`&&t()},r=function(t){throw e.image.removeEventListener(`canplaythrough`,n,!1),e.image.removeEventListener(`error`,r,!1),new wi(`unable to load `+e.src)};e._src=Ii.getAbsoluteURL(e._src),e.image.getAttribute(`two-src`)||(e.image.setAttribute(`two-src`,e.src),Ii.ImageRegistry.add(e.src,e.image)),e.image.readyState>=4?n():(e.image.addEventListener(`canplaythrough`,n,!1),e.image.addEventListener(`error`,r,!1),e.image.src=e.src,e.image.load())}});var Li=Ii,Ri={src:{enumerable:!0,get:function(){return this._src},set:function(e){this._src=e,this._flagSrc=!0}},loaded:{enumerable:!0,get:function(){return this._loaded},set:function(e){this._loaded=e,this._flagLoaded=!0}},repeat:{enumerable:!0,get:function(){return this._repeat},set:function(e){this._repeat=e,this._flagRepeat=!0}},image:{enumerable:!0,get:function(){return this._image},set:function(e){let t=Li.getTag(e),n;switch(t){case`canvas`:n=`#`+e.id;break;default:n=e.src}this._image=Li.ImageRegistry.contains(n)?Li.ImageRegistry.get(e.src):e,this._flagImage=!0}},offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset&&this._offset.unbind(z.Types.change,this._renderer.flagOffset),this._offset=e,this._offset.bind(z.Types.change,this._renderer.flagOffset),this._flagOffset=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof B&&this._scale.unbind(z.Types.change,this._renderer.flagScale),this._scale=e,this._scale instanceof B&&this._scale.bind(z.Types.change,this._renderer.flagScale),this._flagScale=!0}}};function zi(){this._flagOffset=!0}function Bi(){this._flagScale=!0}var Vi=class e extends Mi{constructor(t,n,r){super(),L(this,`_flagOffset`,!0),L(this,`_flagOpacity`,!0),L(this,`_flagColor`,!0),L(this,`_offset`,0),L(this,`_opacity`,1),L(this,`_color`,`#fff`);for(let e in Ui)Object.defineProperty(this,e,Ui[e]);this._renderer.type=`stop`,this.offset=typeof t==`number`?t:e.Index<=0?0:1,this.opacity=typeof r==`number`?r:1,this.color=typeof n==`string`?n:e.Index<=0?`#fff`:`#000`,e.Index=(e.Index+1)%2}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e;return H.each(e.Properties,function(e){n[e]=this[e]},this),t&&t.stops&&t.stops.push(n),n}toObject(){let t=super.toObject.call(this);return t.renderer.type=`stop`,H.each(e.Properties,e=>{t[e]=this[e]},this),t}flagReset(){return this._flagOffset=this._flagColor=this._flagOpacity=!1,super.flagReset.call(this),this}};L(Vi,`Index`,0),L(Vi,`Properties`,[`offset`,`opacity`,`color`]);var Hi=Vi,Ui={offset:{enumerable:!0,get:function(){return this._offset},set:function(e){this._offset=e,this._flagOffset=!0,this.parent&&(this.parent._flagStops=!0)}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0,this.parent&&(this.parent._flagStops=!0)}},color:{enumerable:!0,get:function(){return this._color},set:function(e){this._color=e,this._flagColor=!0,this.parent&&(this.parent._flagStops=!0)}}},Wi=class e extends Mi{constructor(e){super(),L(this,`_flagStops`,!1),L(this,`_flagSpread`,!1),L(this,`_flagUnits`,!1),L(this,`_spread`,``),L(this,`_units`,``);for(let e in Ki)Object.defineProperty(this,e,Ki[e]);this._renderer.type=`gradient`,this._renderer.flagStops=qi.bind(this),this._renderer.bindStops=Ji.bind(this),this._renderer.unbindStops=Yi.bind(this),this.spread=`pad`,this.units=`objectBoundingBox`,e&&(this.stops=e)}static fromObject(t){let n=t.stops;n&&n.length>0&&(n=n.map(e=>e instanceof Hi?e:new Hi().copy(e)));let r=new e(n).copy(t);return`id`in t&&(r.id=t.id),r}clone(t){let n=this.stops.map(e=>e.clone()),r=new e(n);return H.each(e.Properties,e=>{r[e]=this[e]},this),t&&t.add(r),r}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}toObject(){let t={stops:this.stops.map(e=>e.toObject())};return H.each(e.Properties,e=>{t[e]=this[e]},this),t}_update(){return(this._flagSpread||this._flagStops)&&this.trigger(z.Types.change),this}flagReset(){return this._flagSpread=this._flagUnits=this._flagStops=!1,super.flagReset.call(this),this}dispose(){if(`elem`in this._renderer){let e=this._renderer.elem;e.parentNode.removeChild(e)}return`effect`in this._renderer&&(this._renderer.effect=null),this}};L(Wi,`Stop`,Hi),L(Wi,`Properties`,[`spread`,`stops`,`units`]);var Gi=Wi,Ki={spread:{enumerable:!0,get:function(){return this._spread},set:function(e){this._spread=e,this._flagSpread=!0}},units:{enumerable:!0,get:function(){return this._units},set:function(e){this._units=e,this._flagUnits=!0}},stops:{enumerable:!0,get:function(){return this._stops},set:function(e){let t=this._renderer.bindStops,n=this._renderer.unbindStops;this._stops&&this._stops.unbind(z.Types.insert,t).unbind(z.Types.remove,n),this._stops=new Ai((e||[]).slice(0)),this._stops.bind(z.Types.insert,t).bind(z.Types.remove,n),t(this._stops)}}};function qi(){this._flagStops=!0}function Ji(e){let t=e.length;for(;t--;)e[t].bind(z.Types.change,this._renderer.flagStops),e[t].parent=this;this._renderer.flagStops()}function Yi(e){let t=e.length;for(;t--;)e[t].unbind(z.Types.change,this._renderer.flagStops),delete e[t].parent;this._renderer.flagStops()}var Xi=class e extends Gi{constructor(e,t,n,r,i){super(i),L(this,`_flagEndPoints`,!1),L(this,`_left`,null),L(this,`_right`,null);for(let e in Qi)Object.defineProperty(this,e,Qi[e]);this._renderer.type=`linear-gradient`,this._renderer.flagEndPoints=$i.bind(this),this.left=new B,this.right=new B,typeof e==`number`&&(this.left.x=e),typeof t==`number`&&(this.left.y=t),typeof n==`number`&&(this.right.x=n),typeof r==`number`&&(this.right.y=r)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r]instanceof B?t[r]:new B().copy(t[r]))}return this}clone(t){let n=this.stops.map(function(e){return e.clone()}),r=new e(this.left._x,this.left._y,this.right._x,this.right._y,n);return H.each(Gi.Properties,function(e){r[e]=this[e]},this),t&&t.add(r),r}toObject(){let e=super.toObject.call(this);return e.left=this.left.toObject(),e.right=this.right.toObject(),e}_update(){return(this._flagEndPoints||this._flagSpread||this._flagStops)&&this.trigger(z.Types.change),this}flagReset(){return this._flagEndPoints=!1,super.flagReset.call(this),this}};L(Xi,`Stop`,Hi),L(Xi,`Properties`,[`left`,`right`]);var Zi=Xi,Qi={left:{enumerable:!0,get:function(){return this._left},set:function(e){this._left instanceof B&&this._left.unbind(z.Types.change,this._renderer.flagEndPoints),this._left=e,this._left.bind(z.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}},right:{enumerable:!0,get:function(){return this._right},set:function(e){this._right instanceof B&&this._right.unbind(z.Types.change,this._renderer.flagEndPoints),this._right=e,this._right.bind(z.Types.change,this._renderer.flagEndPoints),this._flagEndPoints=!0}}};function $i(){this._flagEndPoints=!0}var ea=class e extends Gi{constructor(e,t,n,r,i,a){super(r),L(this,`_flagRadius`,!1),L(this,`_flagCenter`,!1),L(this,`_flagFocal`,!1),L(this,`_radius`,0),L(this,`_center`,null),L(this,`_focal`,null);for(let e in na)Object.defineProperty(this,e,na[e]);this._renderer.type=`radial-gradient`,this._renderer.flagCenter=ra.bind(this),this._renderer.flagFocal=ia.bind(this),this.center=new B,this.radius=typeof n==`number`?n:1,this.focal=new B,typeof e==`number`&&(this.center.x=e),typeof t==`number`&&(this.center.y=t),this.focal.copy(this.center),typeof i==`number`&&(this.focal.x=i),typeof a==`number`&&(this.focal.y=a)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(/(center|focal)i/.test(r)?this[r]=t[r]instanceof B?t[r]:new B().copy(t[r]):typeof t[r]==`number`&&(this[r]=t[MediaKeySystemAccess]))}return this}clone(t){let n=this.stops.map(function(e){return e.clone()}),r=new e(this.center._x,this.center._y,this._radius,n,this.focal._x,this.focal._y);return H.each(Gi.Properties.concat(e.Properties),function(e){r[e]=this[e]},this),t&&t.add(r),r}toObject(){let t=super.toObject.call(this);return H.each(e.Properties,function(e){t[e]=this[e]},this),t.center=this.center.toObject(),t.focal=this.focal.toObject(),t}_update(){return(this._flagRadius||this._flatCenter||this._flagFocal||this._flagSpread||this._flagStops)&&this.trigger(z.Types.change),this}flagReset(){return this._flagRadius=this._flagCenter=this._flagFocal=!1,super.flagReset.call(this),this}};L(ea,`Stop`,Hi),L(ea,`Properties`,[`center`,`radius`,`focal`]);var ta=ea,na={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}},center:{enumerable:!0,get:function(){return this._center},set:function(e){this._center&&this._center.unbind(z.Types.change,this._renderer.flagCenter),this._center=e,this._center.bind(z.Types.change,this._renderer.flagCenter),this._flagCenter=!0}},focal:{enumerable:!0,get:function(){return this._focal},set:function(e){this._focal&&this._focal.unbind(z.Types.change,this._renderer.flagFocal),this._focal=e,this._focal.bind(z.Types.change,this._renderer.flagFocal),this._flagFocal=!0}}};function ra(){this._flagCenter=!0}function ia(){this._flagFocal=!0}function aa(e,t){if(t===0||t===1)return!0;let n=e._length*t,r=0;for(let t=0;t<e._lengths.length;t++){let i=e._lengths[t];if(r>=n)return n-r>=0;r+=i}return!1}function oa(e,t){let n=e._length;if(t<=0)return 0;if(t>=n)return e._lengths.length-1;for(let n=0,r=0;n<e._lengths.length;n++){if(r+e._lengths[n]>=t)return t-=r,Math.max(n-1,0)+t/e._lengths[n];r+=e._lengths[n]}return-1}function sa(e,t,n){let r,i,a,o,s,c,l,u,d=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,s=t.y,i=(d||t).x,c=(d||t).y,a=(f||e).x,l=(f||e).y,o=e.x,u=e.y,d&&t._relative&&(i+=t.x,c+=t.y),f&&e._relative&&(a+=e.x,l+=e.y),pi(r,s,i,c,a,l,o,u,n)}function ca(e,t,n){let r,i,a,o,s,c,l,u,d=t.controls&&t.controls.right,f=e.controls&&e.controls.left;return r=t.x,s=t.y,i=(d||t).x,c=(d||t).y,a=(f||e).x,l=(f||e).y,o=e.x,u=e.y,d&&t._relative&&(i+=t.x,c+=t.y),f&&e._relative&&(a+=e.x,l+=e.y),fi(r,s,i,c,a,l,o,u,n)}function la(e){switch(e.renderer.type){case`texture`:return Li.fromObject(e);case`gradient`:return Gi.fromObject(e);case`linear-gradient`:return Zi.fromObject(e);case`radial-gradient`:return ta.fromObject(e)}return e}var ua=Math.cos,da=Math.sin,fa=Math.tan,pa=[],ma=class e extends z{constructor(e,t,n,r,i,a){super(),L(this,`elements`,new ti(9)),L(this,`manual`,!1);let o=e;Array.isArray(o)||(o=Array.prototype.slice.call(arguments)),this.identity(),o.length>0&&this.set(o)}static Multiply(e,t,n){if(t.length<=3){let n=e,r,i,a,o=t[0]||0,s=t[1]||0,c=t[2]||0;return r=n[0]*o+n[1]*s+n[2]*c,i=n[3]*o+n[4]*s+n[5]*c,a=n[6]*o+n[7]*s+n[8]*c,[r,i,a]}let r=e[0],i=e[1],a=e[2],o=e[3],s=e[4],c=e[5],l=e[6],u=e[7],d=e[8],f=t[0],p=t[1],m=t[2],h=t[3],g=t[4],_=t[5],v=t[6],y=t[7],b=t[8];return n||=new ti(9),n[0]=r*f+i*h+a*v,n[1]=r*p+i*g+a*y,n[2]=r*m+i*_+a*b,n[3]=o*f+s*h+c*v,n[4]=o*p+s*g+c*y,n[5]=o*m+s*_+c*b,n[6]=l*f+u*h+d*v,n[7]=l*p+u*g+d*y,n[8]=l*m+u*_+d*b,n}static fromObject(t){return new e().copy(t)}set(e,t,n,r,i,a,o,s,c){if(t===void 0){let l=e;e=l[0],t=l[1],n=l[2],r=l[3],i=l[4],a=l[5],o=l[6],s=l[7],c=l[8]}return this.elements[0]=e,this.elements[1]=t,this.elements[2]=n,this.elements[3]=r,this.elements[4]=i,this.elements[5]=a,this.elements[6]=o,this.elements[7]=s,this.elements[8]=c,this.trigger(z.Types.change)}copy(e){return this.elements[0]=e.elements[0],this.elements[1]=e.elements[1],this.elements[2]=e.elements[2],this.elements[3]=e.elements[3],this.elements[4]=e.elements[4],this.elements[5]=e.elements[5],this.elements[6]=e.elements[6],this.elements[7]=e.elements[7],this.elements[8]=e.elements[8],this.manual=e.manual,this.trigger(z.Types.change)}identity(){return this.elements[0]=e.Identity[0],this.elements[1]=e.Identity[1],this.elements[2]=e.Identity[2],this.elements[3]=e.Identity[3],this.elements[4]=e.Identity[4],this.elements[5]=e.Identity[5],this.elements[6]=e.Identity[6],this.elements[7]=e.Identity[7],this.elements[8]=e.Identity[8],this.trigger(z.Types.change)}multiply(e,t,n,r,i,a,o,s,c){if(t===void 0)return this.elements[0]*=e,this.elements[1]*=e,this.elements[2]*=e,this.elements[3]*=e,this.elements[4]*=e,this.elements[5]*=e,this.elements[6]*=e,this.elements[7]*=e,this.elements[8]*=e,this.trigger(z.Types.change);if(n===void 0&&(n=1),r===void 0)return e||=0,t||=0,n||=0,i=this.elements,[i[0]*e+i[1]*t+i[2]*n,i[3]*e+i[4]*t+i[5]*n,i[6]*e+i[7]*t+i[8]*n];let l=this.elements,u=[e,t,n,r,i,a,o,s,c],d=l[0],f=l[1],p=l[2],m=l[3],h=l[4],g=l[5],_=l[6],v=l[7],y=l[8],b=u[0],x=u[1],S=u[2],C=u[3],w=u[4],T=u[5],E=u[6],D=u[7],O=u[8];return this.elements[0]=d*b+f*C+p*E,this.elements[1]=d*x+f*w+p*D,this.elements[2]=d*S+f*T+p*O,this.elements[3]=m*b+h*C+g*E,this.elements[4]=m*x+h*w+g*D,this.elements[5]=m*S+h*T+g*O,this.elements[6]=_*b+v*C+y*E,this.elements[7]=_*x+v*w+y*D,this.elements[8]=_*S+v*T+y*O,this.trigger(z.Types.change)}inverse(t){let n=this.elements;t||=new e;let r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],c=n[5],l=n[6],u=n[7],d=n[8],f=d*s-c*u,p=-d*o+c*l,m=u*o-s*l,h=r*f+i*p+a*m;return h?(h=1/h,t.elements[0]=f*h,t.elements[1]=(-d*i+a*u)*h,t.elements[2]=(c*i-a*s)*h,t.elements[3]=p*h,t.elements[4]=(d*r-a*l)*h,t.elements[5]=(-c*r+a*o)*h,t.elements[6]=m*h,t.elements[7]=(-u*r+i*l)*h,t.elements[8]=(s*r-i*o)*h,t):null}scale(e,t){return arguments.length<=1&&(t=e),this.multiply(e,0,0,0,t,0,0,0,1)}rotate(e){let t=ua(e),n=da(e);return this.multiply(t,-n,0,n,t,0,0,0,1)}translate(e,t){return this.multiply(1,0,e,0,1,t,0,0,1)}skewX(e){let t=fa(e);return this.multiply(1,t,0,0,1,0,0,0,1)}skewY(e){let t=fa(e);return this.multiply(1,0,0,t,1,0,0,0,1)}toString(e){return pa.length=0,this.toTransformArray(e,pa),pa.map(ri).join(` `)}toTransformArray(e,t){let n=this.elements,r=!!t,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5];if(e){let e=n[6],u=n[7],d=n[8];if(r){t[0]=i,t[1]=s,t[2]=e,t[3]=a,t[4]=c,t[5]=u,t[6]=o,t[7]=l,t[8]=d;return}return[i,s,e,a,c,u,o,l,d]}if(r)t[0]=i,t[1]=s,t[2]=a,t[3]=c,t[4]=o,t[5]=l;else return[i,s,a,c,o,l]}toArray(e,t){let n=this.elements,r=!!t,i=n[0],a=n[1],o=n[2],s=n[3],c=n[4],l=n[5];if(e){let e=n[6],u=n[7],d=n[8];if(r){t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l,t[6]=e,t[7]=u,t[8]=d;return}return[i,a,o,s,c,l,e,u,d]}if(r)t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l;else return[i,a,o,s,c,l]}toObject(){return{renderer:{type:`matrix`},elements:this.toArray(!0),manual:!!this.manual}}clone(){return new e().copy(this)}};L(ma,`Identity`,[1,0,0,0,1,0,0,0,1]);var ha=ma;Yr(ha);var ga=class e extends Mi{constructor(){super(),L(this,`_flagMatrix`,!0),L(this,`_flagScale`,!1),L(this,`_matrix`,null),L(this,`_worldMatrix`,null),L(this,`_position`,null),L(this,`_rotation`,0),L(this,`_scale`,1),L(this,`_skewX`,0),L(this,`_skewY`,0);for(let e in va)Object.defineProperty(this,e,va[e]);this._renderer.flagMatrix=ya.bind(this),this.isShape=!0,this.matrix=new ha,this.worldMatrix=new ha,this.position=new B,this.rotation=0,this.scale=1,this.skewX=0,this.skewY=0}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}get renderer(){return this._renderer}set renderer(e){this._renderer=e}get translation(){return va.position.get.apply(this,arguments)}set translation(e){va.position.set.apply(this,arguments)}addTo(e){return e.add(this),this}remove(){return this.parent&&this.parent.remove(this),this}contains(e,t,n){let r=n||{},i=r.ignoreVisibility===!0;if(!i&&`visible`in this&&this.visible===!1||!i&&`opacity`in this&&typeof this.opacity==`number`&&this.opacity<=0||typeof this.getBoundingClientRect!=`function`)return!1;let a=typeof r.tolerance==`number`?r.tolerance:0;this._update(!0);let o=this.getBoundingClientRect();return o?e>=o.left-a&&e<=o.right+a&&t>=o.top-a&&t<=o.bottom+a:!1}copy(e){return super.copy.call(this,e),`position`in e&&(e.position instanceof B?this.position=e.position:this.position.copy(e.position)),`rotation`in e&&(this.rotation=e.rotation),`scale`in e&&(this.scale=typeof e.scale==`number`||e.scale instanceof B?e.scale:new B(e.scale.x,e.scale.y)),`skewX`in e&&(this.skewX=e.skewX),`skewY`in e&&(this.skewY=e.skewY),`matrix`in e&&e.matrix.manual&&(this.matrix.copy(e.matrix),this.matrix.manual=!0),this}clone(t){let n=new e;return n.position.copy(this.position),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let e=super.toObject.call(this);return e.renderer={type:`shape`},e.isShape=!0,e.translation=this.translation.toObject(),e.rotation=this.translation.rotation,e.scale=this.scale instanceof B?this.scale.toObject():this.scale,e.skewX=this.skewX,e.skewY=this.skewY,e.matrix=this.matrix.toObject(),e}dispose(){super.dispose(),typeof this.translation==`object`&&typeof this.translation.unbind==`function`&&this.translation.unbind(),typeof this.scale==`object`&&typeof this.scale.unbind==`function`&&this.scale.unbind()}_update(e){return!this._matrix.manual&&this._flagMatrix&&(this._matrix.identity().translate(this.position.x,this.position.y),this._matrix.rotate(this.rotation),this._scale instanceof B?this._matrix.scale(this._scale.x,this._scale.y):this._matrix.scale(this._scale),this._matrix.skewX(this.skewX),this._matrix.skewY(this.skewY)),e&&this.parent&&this.parent._update&&this.parent._update(),this}flagReset(){return this._flagMatrix=this._flagScale=!1,super.flagReset.call(this),this}};L(ga,`Properties`,[`position`,`rotation`,`scale`,`skewX`,`skewY`,`matrix`,`worldMatrix`]);var _a=ga,va={position:{enumerable:!0,get:function(){return this._position},set:function(e){this._position&&this._position.unbind(z.Types.change,this._renderer.flagMatrix),this._position=e,this._position.bind(z.Types.change,this._renderer.flagMatrix),ya.call(this)}},rotation:{enumerable:!0,get:function(){return this._rotation},set:function(e){this._rotation=e,this._flagMatrix=!0}},scale:{enumerable:!0,get:function(){return this._scale},set:function(e){this._scale instanceof B&&this._scale.unbind(z.Types.change,this._renderer.flagMatrix),this._scale=e,this._scale instanceof B&&this._scale.bind(z.Types.change,this._renderer.flagMatrix),this._flagMatrix=!0,this._flagScale=!0}},skewX:{enumerable:!0,get:function(){return this._skewX},set:function(e){this._skewX=e,this._flagMatrix=!0}},skewY:{enumerable:!0,get:function(){return this._skewY},set:function(e){this._skewY=e,this._flagMatrix=!0}},matrix:{enumerable:!0,get:function(){return this._matrix},set:function(e){this._matrix=e,this._flagMatrix=!0}},worldMatrix:{enumerable:!0,get:function(){return Xr(this,this._worldMatrix),this._worldMatrix},set:function(e){this._worldMatrix=e}}};function ya(){this._flagMatrix=!0}var ba=/^(?:none|transparent)$/i,xa=8,Sa=2**-52;function Ca(e,t){return{x:e,y:t}}function wa(e,t,n=Sa){return Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n}function Ta(e,t,n,r){let i=e*n+t*r,a=Math.sqrt(e*e+t*t)*Math.sqrt(n*n+r*r)||1e-12,o=Math.acos(Math.max(-1,Math.min(1,i/a)));return e*r-t*n<0&&(o=-o),o}function Ea(e,t,n){if(!e)return[Ca(t.x,t.y)];let r=t.rx,i=t.ry;if(!(r&&i))return[Ca(t.x,t.y)];let a=(t.xAxisRotation||0)*Math.PI/180,o=+!!t.largeArcFlag,s=+!!t.sweepFlag;r=Math.abs(r),i=Math.abs(i);let c=e.x,l=e.y,u=t.x,d=t.y,f=(c-u)/2,p=(l-d)/2,m=Math.cos(a),h=Math.sin(a),g=m*f+h*p,_=-h*f+m*p,v=r*r,y=i*i,b=g*g/v+_*_/y;if(b>1){let e=Math.sqrt(b);r*=e,i*=e,v=r*r,y=i*i}let x=v*_*_+y*g*g,S=x===0?0:(v*y-x)/x,C=Math.sqrt(Math.max(0,S));o===s&&(C=-C);let w=C*r*_/i,T=-C*i*g/r,E=m*w-h*T+(c+u)/2,D=h*w+m*T+(l+d)/2,O=Ta(1,0,(g-w)/r,(_-T)/i),k=O+Ta((g-w)/r,(_-T)/i,(-g-w)/r,(-_-T)/i)%Kr,A=s===0,ee=(()=>{let e=k-O,t=Math.abs(e)<2**-52,n=ei(e,Kr);return n<2**-52&&(n=t?0:Kr),A&&!t&&(n=n===Kr?-Kr:n-Kr),n})(),te=Math.max(li.Resolution,Math.max(n*2,1)),ne=[];for(let e=1;e<=te;e++){let t=O+e/te*ee,n=E+r*Math.cos(t),o=D+i*Math.sin(t);if(a!==0){let e=n-E,t=o-D,r=Math.cos(a),i=Math.sin(a);n=e*r-t*i+E,o=e*i+t*r+D}ne.push(Ca(n,o))}return ne}function Da(e,t=xa){let n=[],r=[],i=e._renderer&&e._renderer.vertices&&e._renderer.vertices.length>0?e._renderer.vertices:e.vertices;if(!i||i.length===0)return{polygons:n,segments:r};let a=Math.max(1,Math.floor(t)),o=null,s=null,c=null,l=null,u=(e=!1)=>{if(o){if(e&&s&&c&&!wa(s,c)){let e=Ca(s.x,s.y);r.push({a:c,b:e}),o.push(e),c=e}o.length>=3&&s&&c&&wa(s,c)&&n.push(o),o=null,s=null,c=null}},d=e=>{c?wa(c,e)||(r.push({a:c,b:e}),o&&o.push(e),c=e):(c=e,o&&o.push(e))};for(let e=0;e<i.length;e++){let t=i[e],n=t.command||(e===0?R.move:R.line);if(n===R.move){u(!1);let e=Ca(t.x,t.y);o=[e],s=e,c=e,l=t}else{if(l||=i[Math.max(e-1,0)],n===R.line)d(Ca(t.x,t.y));else if(n===R.curve){let e=ca(t,l,a);for(let t=1;t<e.length;t++){let n=e[t];d(Ca(n.x,n.y))}d(Ca(t.x,t.y))}else if(n===R.arc){let e=Ea(l,t,a);for(let t=0;t<e.length;t++)d(e[t])}else if(n===R.close){u(!0),l=t;continue}else d(Ca(t.x,t.y));l=t}}return o&&u(!!e._closed||!!e.closed||s&&c&&!wa(s,c)),{polygons:n,segments:r}}function Oa(e,t,n){let r=!1;for(let i=0;i<e.length;i++){let a=e[i];if(!a||a.length<3)continue;let o=a.length-1;for(let e=0;e<a.length;e++){let i=a[o],s=a[e];s.y>n!=i.y>n&&t<(i.x-s.x)*(n-s.y)/(i.y-s.y||1e-12)+s.x&&(r=!r),o=e}}return r}function ka(e,t,n,r){let i=r.x-n.x,a=r.y-n.y;if(Math.abs(i)<Sa&&Math.abs(a)<Sa){let r=e-n.x,i=t-n.y;return r*r+i*i}let o=((e-n.x)*i+(t-n.y)*a)/(i*i+a*a),s=Math.max(0,Math.min(1,o)),c=n.x+s*i,l=n.y+s*a,u=e-c,d=t-l;return u*u+d*d}function Aa(e,t,n){if(!e||e.length===0)return 1/0;let r=1/0;for(let i=0;i<e.length;i++){let a=e[i],o=ka(t,n,a.a,a.b);o<r&&(r=o)}return Math.sqrt(r)}function ja(e,t){if(typeof t==`boolean`)return t;let n=e.fill;return!n&&n!==0?!1:typeof n!=`string`||!ba.test(n)}function Ma(e,t){let n=typeof e.linewidth==`number`?e.linewidth:e._linewidth||0;if(typeof t==`boolean`)return t&&n>0;if(!(n>0))return!1;let r=e.stroke;return!r&&r!==0?!1:typeof r!=`string`||!ba.test(r)}function Na(e,t,n,r=0){if(!e)return!1;let i=e.left-r,a=e.right+r,o=e.top-r,s=e.bottom+r;return t>=i&&t<=a&&n>=o&&n<=s}var Pa=2**-52;function Fa(e){return typeof e.relative!=`boolean`||!!e.relative}function Ia(e,t,n,r){let i=e.controls;i&&i[t]&&(Math.abs(n)<Pa&&Math.abs(r)<Pa?Fa(e)?i[t].clear():i[t].set(e.x,e.y):Fa(e)?i[t].set(n,r):i[t].set(e.x+n,e.y+r))}function La(e,t){Ia(e,t,0,0)}function Ra(e,t){let n=e.controls;return!n||!n[t]?{x:0,y:0}:Fa(e)?{x:n[t].x,y:n[t].y}:{x:n[t].x-e.x,y:n[t].y-e.y}}function za(e,t){let n=Ra(e,t);return Math.abs(n.x)>Pa||Math.abs(n.y)>Pa}function Ba(e){e.command!==R.move&&e.command!==R.close&&(e.command=za(e,`left`)||za(e,`right`)?R.curve:R.line)}function Va(e,t){typeof t.relative==`boolean`&&(e.relative=t.relative)}function Ha(e,t){return za(t,`right`)||za(e,`left`)||za(e,`right`)||za(t,`left`)||e.command===R.curve||t.command===R.curve}function Ua(e,t,n){return{x:Zr(e.x,t.x,n),y:Zr(e.y,t.y,n)}}function Wa(e,t){let n=e.controls&&e.controls[t];return n?Fa(e)?{x:e.x+n.x,y:e.y+n.y}:{x:n.x,y:n.y}:{x:e.x,y:e.y}}function Ga(e,t,n){let r=e.controls&&e.controls.right,i=t.controls&&t.controls.left,a={x:e.x,y:e.y},o=r?Wa(e,`right`):Pr({},a),s={x:t.x,y:t.y},c=i?Wa(t,`left`):Pr({},s),l=Ua(a,o,n),u=Ua(o,c,n),d=Ua(c,s,n),f=Ua(l,u,n),p=Ua(u,d,n),m=Ua(f,p,n),h=new V(m.x,m.y);return Va(h,e),Ia(h,`left`,f.x-m.x,f.y-m.y),Ia(h,`right`,p.x-m.x,p.y-m.y),h.command=R.curve,{anchor:h,startOut:l,endIn:d}}function Ka(e,t,n,r,i,a){let o=e.length,s=n-t+1,c=s-1,l=i?Math.min(s,4):1,u=l,d=l;if(r||(u=Math.min(1,t),d=Math.min(1,o-n-1)),c+=u+d,c<=1)return;let f=Array(c+1);for(let n=0,r=t-u;n<=c;n+=1,r+=1){let t=ei(r,o);f[n]=e[t]}let p=f[0].x+2*f[1].x,m=f[0].y+2*f[1].y,h=2,g=c-1,_=[p],v=[m],y=[h],b=Array(c+1),x=Array(c+1);for(let e=1;e<c;e+=1){let t=e<g,n=t||a?1:2,r=t?4:a?2:7,i=t?4:a?3:8,o=t?2:+!a,s=n/h;h=y[e]=r-s,p=_[e]=i*f[e].x+o*f[e+1].x-s*p,m=v[e]=i*f[e].y+o*f[e+1].y-s*m}b[g]=_[g]/y[g],x[g]=v[g]/y[g];for(let e=c-2;e>=0;--e)b[e]=(_[e]-b[e+1])/y[e],x[e]=(v[e]-x[e+1])/y[e];b[c]=(3*f[c].x-b[g])/2,x[c]=(3*f[c].y-x[g])/2;let S=c-d;for(let n=u,r=t;n<=S;n+=1,r+=1){let t=e[ei(r,o)],a=b[n]-t.x,s=x[n]-t.y;i||n<S?Ia(t,`right`,a,s):La(t,`right`),i||n>u?Ia(t,`left`,-a,-s):La(t,`left`),Ba(t)}}function qa(e,t,n,r,i,a){let o=t||e,s=e,c=n||e,l=B.distanceBetween(o,s),u=B.distanceBetween(s,c),d=r===void 0?.5:r,f=l**+d,p=u**+d,m=f*f,h=p*p;if(!i&&t){let t=2*h+3*p*f+m,n=3*p*(p+f);n===0?La(e,`left`):Ia(e,`left`,(h*o.x+t*s.x-m*c.x)/n-s.x,(h*o.y+t*s.y-m*c.y)/n-s.y)}else La(e,`left`);if(!a&&n){let t=2*m+3*f*p+h,n=3*f*(f+p);n===0?La(e,`right`):Ia(e,`right`,(m*c.x+t*s.x-h*o.x)/n-s.x,(m*c.y+t*s.y-h*o.y)/n-s.y)}else La(e,`right`);Ba(e)}function Ja(e,t,n,r,i,a){if(!(t&&n)){t||La(e,`left`),n||La(e,`right`),Ba(e);return}let o=t,s=e,c=n,l=B.distanceBetween(o,s),u=l+B.distanceBetween(s,c),d=r===void 0?.4:r,f={x:o.x-c.x,y:o.y-c.y};if(!i&&u!==0){let t=d*l/u;Ia(e,`left`,f.x*t,f.y*t)}else La(e,`left`);if(!a&&u!==0){let t=d*l/u-d;Ia(e,`right`,f.x*t,f.y*t)}else La(e,`right`);Ba(e)}function Ya(e,t,n,r,i,a){let o=a.type||`catmull-rom`,s=a.factor,c=e.length;for(let r=t;r<=n;r+=1){let a=e[ei(r,c)];if(a.command===R.move){La(a,`left`),La(a,`right`);continue}let l=r===t&&!i?null:r-1,u=r===n&&!i?null:r+1,d=l===null?null:e[ei(l,c)],f=u===null?null:e[ei(u,c)],p=l===null,m=u===null;o===`geometric`?Ja(a,d,f,s,p,m):qa(a,d,f,s,p,m)}}var Xa=Math.min,Za=Math.max,Qa=Math.ceil,$a=Math.floor,eo=new B;function to(e,t,n){let r=e.controls&&e.controls[t];r&&(e.relative?r.multiplyScalar(n):r.lerp(e,1-n))}var no=new ha,ro=class e extends _a{constructor(e,t,n,r){super(),L(this,`_flagVertices`,!0),L(this,`_flagLength`,!0),L(this,`_flagFill`,!0),L(this,`_flagStroke`,!0),L(this,`_flagLinewidth`,!0),L(this,`_flagOpacity`,!0),L(this,`_flagVisible`,!0),L(this,`_flagCap`,!0),L(this,`_flagJoin`,!0),L(this,`_flagMiter`,!0),L(this,`_flagStrokeAttenuation`,!0),L(this,`_flagMask`,!1),L(this,`_flagClip`,!1),L(this,`_length`,0),L(this,`_fill`,`#fff`),L(this,`_stroke`,`#000`),L(this,`_linewidth`,1),L(this,`_opacity`,1),L(this,`_visible`,!0),L(this,`_cap`,`round`),L(this,`_join`,`round`),L(this,`_miter`,4),L(this,`_closed`,!0),L(this,`_curved`,!1),L(this,`_automatic`,!0),L(this,`_beginning`,0),L(this,`_ending`,1),L(this,`_mask`,null),L(this,`_clip`,!1),L(this,`_dashes`,null),L(this,`_strokeAttenuation`,!0);for(let e in io)Object.defineProperty(this,e,io[e]);this._renderer.type=`path`,this._renderer.flagVertices=ao.bind(this),this._renderer.bindVertices=oo.bind(this),this._renderer.unbindVertices=so.bind(this),this._renderer.flagFill=co.bind(this),this._renderer.flagStroke=lo.bind(this),this._renderer.vertices=[],this._renderer.collection=[],this.closed=!!t,this.curved=!!n,this.beginning=0,this.ending=1,this.fill=`#fff`,this.stroke=`#000`,this.linewidth=1,this.opacity=1,this.className=``,this.visible=!0,this.cap=`butt`,this.join=`miter`,this.miter=4,this.vertices=e,this.automatic=!r,this.dashes=[],this.dashes.offset=0}static fromObject(t){let n=typeof t.fill==`string`?t.fill:la(t.fill),r=typeof t.stroke==`string`?t.stroke:la(t.stroke),i=new e().copy(Fr(Pr({},t),{fill:n,stroke:r}));return`id`in t&&(i.id=t.id),i}copy(t){if(super.copy.call(this,t),t.vertices){this.vertices=[];for(let e=0;e<t.vertices.length;e++){let n=t.vertices[e];n instanceof V?this.vertices.push(t.vertices[e].clone()):this.vertices.push(new V().copy(n))}}for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e;for(let e=0;e<this.vertices.length;e++)n.vertices.push(this.vertices[e].clone());for(let t=0;t<e.Properties.length;t++){let r=e.Properties[t];n[r]=this[r]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let t=super.toObject.call(this);return t.renderer.type=`path`,t.vertices=this.vertices.map(e=>e.toObject()),H.each(e.Properties,e=>{this[e]!==void 0&&(this[e].toObject?t[e]=this[e].toObject():t[e]=this[e])},this),t}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind==`function`)try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){let t=this.vertices[e];typeof t.unbind==`function`&&t.unbind(),t.controls&&(t.controls.left&&typeof t.controls.left.unbind==`function`&&t.controls.left.unbind(),t.controls.right&&typeof t.controls.right.unbind==`function`&&t.controls.right.unbind())}return typeof this.fill==`object`&&typeof this.fill.dispose==`function`?this.fill.dispose():typeof this.fill==`object`&&typeof this.fill.unbind==`function`&&this.fill.unbind(),typeof this.stroke==`object`&&typeof this.stroke.dispose==`function`?this.stroke.dispose():typeof this.stroke==`object`&&typeof this.stroke.unbind==`function`&&this.stroke.unbind(),this}noFill(){return this.fill=`none`,this}noStroke(){return this.stroke=`none`,this.linewidth=0,this}corner(){let e=this.getBoundingClientRect(!0),t=e.width/2,n=e.height/2,r=e.left+e.width/2,i=e.top+e.height/2;for(let e=0;e<this.vertices.length;e++){let a=this.vertices[e];a.x-=r,a.y-=i,a.x+=t,a.y+=n}return this.mask&&(this.mask.translation.x-=r,this.mask.translation.x+=t,this.mask.translation.y-=i,this.mask.translation.y+=n),this}center(){let e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let e=0;e<this.vertices.length;e++){let r=this.vertices[e];r.x-=t,r.y-=n}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getBoundingClientRect(e){let t,n,r,i,a,o,s=1/0,c=-1/0,l=1/0,u=-1/0;if(this._update(!0),t=e?this.matrix:this.worldMatrix,n=(this.linewidth||0)/2,r=this._renderer.vertices.length,this.linewidth>0||this.stroke&&!/(transparent|none)/i.test(this.stroke)){if(this.matrix.manual){let{scaleX:e,scaleY:r}=Jr(t.elements[0],t.elements[3],t.elements[1],t.elements[4],t.elements[2],t.elements[5]);typeof e==`number`&&typeof r==`number`&&(n=Math.max(e,r)*(this.linewidth||0)/2)}else n*=typeof this.scale==`number`?this.scale:Math.max(this.scale.x,this.scale.y)}if(r<=0)return{width:0,height:0};for(i=0;i<r;i++){o=this._renderer.vertices[i],a=this._renderer.vertices[(i+r-1)%r];let[e,d]=t.multiply(a.x,a.y),[f,p]=t.multiply(o.x,o.y);if(a.controls&&o.controls){let r=a.controls.right.x,i=a.controls.right.y;a.relative&&(r+=a.x,i+=a.y);let[m,h]=t.multiply(r,i),g=o.controls.left.x,_=o.controls.left.y;o.relative&&(g+=o.x,_+=o.y);let[v,y]=t.multiply(g,_),b=mi(e,d,m,h,v,y,f,p);l=Xa(b.min.y-n,l),s=Xa(b.min.x-n,s),c=Za(b.max.x+n,c),u=Za(b.max.y+n,u)}else i<=1&&(l=Xa(d-n,l),s=Xa(e-n,s),c=Za(e+n,c),u=Za(d+n,u)),l=Xa(p-n,l),s=Xa(f-n,s),c=Za(f+n,c),u=Za(p+n,u)}return{top:l,left:s,right:c,bottom:u,width:c-s,height:u-l}}contains(e,t,n){let r=n||{},i=r.ignoreVisibility===!0;if(!i&&this.visible===!1||!i&&typeof this.opacity==`number`&&this.opacity<=0)return!1;let a=typeof r.tolerance==`number`?r.tolerance:0;this._update(!0);let o=this.getBoundingClientRect();if(!o||e<o.left-a||e>o.right+a||t<o.top-a||t>o.bottom+a)return!1;let s=this.worldMatrix,c=s&&s.inverse(no);if(!c)return super.contains(e,t,r);let[l,u]=c.multiply(e,t,1),d=typeof r.precision==`number`&&!Number.isNaN(r.precision)?Math.max(1,Math.floor(r.precision)):8,f=ja(this,r.fill),p=Ma(this,r.stroke),{polygons:m,segments:h}=Da(this,d);if(f&&m.length>0&&Oa(m,l,u))return!0;if(p&&h.length>0){let e=typeof this.linewidth==`number`?this.linewidth:0;if(e>0&&Aa(h,l,u)<=e/2+a)return!0}return!f&&!p||f&&m.length===0?super.contains(e,t,r):!1}getPointAt(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_=this.length*Math.min(Math.max(e,0),1),v=this.vertices.length,y=v-1,b=this._lengths.length===v+1?this._closingSubpathStart:-1,x=null,S=null;for(let t=0,i=this._lengths.length,a=0;t<i;t++){if(a+this._lengths[t]>=_){t===v?(n=b,r=y):this.vertices[t].command===R.close&&this._closeSubpathStarts?(n=this._closeSubpathStarts[t],r=Math.max(t-1,0)):(n=t,r=Math.min(Math.max(t-1,0),y)),x=this.vertices[n],S=this.vertices[r],_-=a,e=this._lengths[t]===0?0:_/this._lengths[t];break}a+=this._lengths[t]}if(x===null||S===null)return null;if(!x)return S;if(!S)return x;g=S.controls&&S.controls.right,h=x.controls&&x.controls.left,o=S.x,d=S.y,s=(g||S).x,f=(g||S).y,c=(h||x).x,p=(h||x).y,l=x.x,m=x.y,g&&S.relative&&(s+=S.x,f+=S.y),h&&x.relative&&(c+=x.x,p+=x.y),a=di(e,o,s,c,l),u=di(e,d,f,p,m);let C=Zr(o,s,e),w=Zr(d,f,e),T=Zr(s,c,e),E=Zr(f,p,e),D=Zr(c,l,e),O=Zr(p,m,e),k=Zr(C,T,e),A=Zr(w,E,e),ee=Zr(T,D,e),te=Zr(E,O,e);return H.isObject(t)?(t.x=a,t.y=u,t instanceof V&&(t.controls.left.x=k,t.controls.left.y=A,t.controls.right.x=ee,t.controls.right.y=te,(typeof t.relative!=`boolean`||t.relative)&&(t.controls.left.x-=a,t.controls.left.y-=u,t.controls.right.x-=a,t.controls.right.y-=u)),t.t=e,t):(i=new V(a,u,k-a,A-u,ee-a,te-u,this._curved?R.curve:R.line),i.t=e,i)}plot(){if(this.curved)return gi(this._collection,this.closed),this;for(let e=0;e<this._collection.length;e++)this._collection[e].command=e===0?R.move:R.line;return this}smooth(e){let t=e||{},n=t.type||`continuous`,r=this._collection,i=r.length;if(i<2)return this;let a=this._closed||i>0&&r[i-1]&&r[i-1].command===R.close,o=(e,t)=>{if(e==null)return t;if(typeof e==`number`){if(a)return ei(e,i);let t=e;return t<0&&(t+=i),Math.min(Math.max(t,0),i-1)}let n=r.indexOf(e);return n===-1?t:n},s=a&&t.from===void 0&&t.to===void 0,c=o(t.from,0),l=o(t.to,i-1);if(c>l){if(a)c-=i;else{let e=c;c=l,l=e}}let u=l-c+1;for(let e=0;e<u;e+=1){let t=ei(c+e,i),n=r[t],o=!a&&t===0;n.command===R.move&&!o&&(n.command=R.line)}if(n===`continuous`||n===`asymmetric`)Ka(r,c,l,a,s,n===`asymmetric`);else if(n===`catmull-rom`||n===`geometric`){let e={type:n,factor:t.factor};Ya(r,c,l,a,s,e)}else throw Error(`Path.smooth does not support type "${n}". Try 'continuous', 'asymmetric', 'catmull-rom', or 'geometric'.`);return this._automatic=!1,this._flagVertices=!0,this._flagLength=!0,this}subdivide(e){this._update();let t=this.vertices,n=t.length;if(n<2)return this;let r=[],i=null,a=null;for(let o=0;o<n;o+=1){let n=t[o];if(!i||n.command===R.move){let e=n.clone();r.push(e),i=n,a=n}else{if(Ha(n,i)){let t=ca(n,i,e).length,a=r[r.length-1],o=a.clone(),s=n.clone(),c=a,l=0;if(t<=1){let e=n.clone();r.push(e)}else{for(let e=1;e<t;e+=1){let n=e/t,i=1-l,a=i<=2**-52?n:(n-l)/i,u=Ga(o,s,a);Ia(c,`right`,u.startOut.x-c.x,u.startOut.y-c.y);let d=u.anchor;r.push(d),c=d,o=d.clone(),l=n,Ia(s,`left`,u.endIn.x-s.x,u.endIn.y-s.y)}let e=n.clone();e.controls.left.copy(s.controls.left),r.push(e)}}else{let t=ca(n,i,e);for(let e=1;e<t.length;e+=1){let n=t[e];Va(n,i),La(n,`left`),La(n,`right`),n.command=R.line,r.push(n)}let a=n.clone();r.push(a)}i=n,n.command===R.close&&(i=a)}}return this._automatic=!1,this._curved=!1,this.vertices=r,this}_updateLength(e,t){t||this._update();let n=this.vertices.length,r=n-1,i=n>0&&this.vertices[r].command===R.close,a=n>1&&this._closed&&!i,o=0;this._closeSubpathStarts=[],this._needsImplicitClose=a;let s=this.vertices[0],c=0;return this._lengths===void 0&&(this._lengths=[]),this._lengths.length=n,H.each(this.vertices,function(t,n){n<=0||t.command===R.move?(o=n,s=t,this._lengths[n]=0):(t.command===R.close?(this._closeSubpathStarts[n]=o,this._lengths[n]=sa(this.vertices[o],s,e),s=this.vertices[o]):(this._lengths[n]=sa(t,s,e),s=t),c+=this._lengths[n])},this),this._closingSubpathStart=o,a&&(this._lengths[n]=sa(this.vertices[o],this.vertices[r],e),c+=this._lengths[n]),this._length=c,this._flagLength=!1,this}_update(){if(this._flagVertices){this._automatic&&this.plot(),this._flagLength&&this._updateLength(void 0,!0);let e=this._collection.length,t=e-1,n=this._closed,r=Math.min(this._beginning,this._ending),i=Math.max(this._beginning,this._ending),a=oa(this,r*this._length),o=oa(this,i*this._length),s=Qa(a),c=$a(o),l=r===0&&i===1,u=this._needsImplicitClose&&a>t,d=this._needsImplicitClose&&!l&&o>t,f,p,m,h,g,_;for(this._renderer.vertices.length=0,_=0;_<e;_++)if(this._renderer.collection.length<=_&&this._renderer.collection.push(new V),_>c&&!p)g=this._renderer.collection[_].copy(this._collection[_]),this.getPointAt(i,g),g.command=this._collection[_].command===R.close?R.line:this._renderer.collection[_].command,this._renderer.vertices.push(g),p=g,m=this._collection[_-1],m&&m.controls&&(g.relative?g.controls.right.clear():g.controls.right.copy(g),m.relative?this._renderer.collection[_-1].controls.right.copy(m.controls.right).lerp(B.zero,1-g.t):this._renderer.collection[_-1].controls.right.copy(m.controls.right).lerp(m,1-g.t));else if(_>=s&&_<=c){if(g=this._renderer.collection[_].copy(this._collection[_]),!l&&g.command===R.close){let e=this._closeSubpathStarts[_];typeof e==`number`&&(g.copy(this._collection[e]),g.command=R.line)}this._renderer.vertices.push(g),_===c&&aa(this,i)?(p=g,!n&&p.controls&&(p.relative?p.controls.right.clear():p.controls.right.copy(p))):_===s&&aa(this,r)&&(f=g,f.command=R.move,!n&&f.controls&&(f.relative?f.controls.left.clear():f.controls.left.copy(f)))}if(u){let e=new V,n=new V;this.getPointAt(r,e),this.getPointAt(i,n);let a=this._collection[t].command===R.curve,o=e.t,s=n.t;if(e.command=R.move,e.controls.left.clear(),n.controls.right.clear(),a){let t=Math.max(s-o,0);to(e,`right`,o<1?t/(1-o):0),to(n,`left`,s>0?t/s:0),n.command=R.curve}else e.controls.right.clear(),n.controls.left.clear(),n.command=R.line;this._renderer.vertices.length=0,this._renderer.vertices.push(e,n),f=e,p=n}else if(d&&!p){let e=new V;this.getPointAt(i,e);let n=this._renderer.vertices[this._renderer.vertices.length-1];this._collection[t].command===R.curve?(to(n,`right`,e.t),e.command=R.curve):(e.controls.left.clear(),e.command=R.line),e.controls.right.clear(),this._renderer.vertices.push(e),p=e}s>0&&!f&&(_=s-1,g=this._renderer.collection[_].copy(this._collection[_]),this.getPointAt(r,g),g.command=R.move,this._renderer.vertices.unshift(g),h=this._collection[_+1],h&&h.controls&&(g.controls.left.clear(),h.relative?this._renderer.collection[_+1].controls.left.copy(h.controls.left).lerp(B.zero,g.t):(eo.copy(h),this._renderer.collection[_+1].controls.left.copy(h.controls.left).lerp(h,g.t)))),this._renderer.closed=n&&r===0&&i===1}return _a.prototype._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagCap=this._flagJoin=this._flagMiter=this._flagClip=this._flagStrokeAttenuation=!1,_a.prototype.flagReset.call(this),this}};L(ro,`Properties`,[`fill`,`stroke`,`linewidth`,`opacity`,`visible`,`cap`,`join`,`miter`,`closed`,`curved`,`automatic`,`beginning`,`ending`,`dashes`,`strokeAttenuation`]),L(ro,`Utils`,{getCurveLength:sa});var U=ro,io={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e,this._flagCap=!0}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e,this._flagJoin=!0}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e,this._flagMiter=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Gi||this._fill instanceof Zi||this._fill instanceof ta||this._fill instanceof Li)&&this._fill.unbind(z.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Gi||this._fill instanceof Zi||this._fill instanceof ta||this._fill instanceof Li)&&this._fill.bind(z.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Gi||this._stroke instanceof Zi||this._stroke instanceof ta||this._stroke instanceof Li)&&this._stroke.unbind(z.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Gi||this._stroke instanceof Zi||this._stroke instanceof ta||this._stroke instanceof Li)&&this._stroke.bind(z.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=!!e,this._flagVertices=!0,this._flagLength=!0}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=!!e,this._flagVertices=!0}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){if(e===this._automatic)return;this._automatic=!!e;let t=this._automatic?`ignore`:`listen`;H.each(this.vertices,function(e){e[t]()})}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){let t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(z.Types.insert,t).unbind(z.Types.remove,n),this._collection=e instanceof Ai?e:new Ai(e||[]),this._collection.bind(z.Types.insert,t).bind(z.Types.remove,n),t(this._collection)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,H.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!=`number`&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(e){this._strokeAttenuation=!!e,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function ao(){this._flagVertices=!0,this._flagLength=!0,this.parent&&(this.parent._flagLength=!0)}function oo(e){let t=e.length;for(;t--;)e[t].bind(z.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function so(e){let t=e.length;for(;t--;)e[t].unbind(z.Types.change,this._renderer.flagVertices);this._renderer.flagVertices()}function co(){this._flagFill=!0}function lo(){this._flagStroke=!0}var uo=class e extends U{constructor(e,t,n,r){let i=[new V,new V,new V,new V];super(i,!0,!1,!0),L(this,`_flagWidth`,!1),L(this,`_flagHeight`,!1),L(this,`_width`,0),L(this,`_height`,0),L(this,`_origin`,null),this._renderer.type=`rectangle`;for(let e in po)Object.defineProperty(this,e,po[e]);this.width=typeof n==`number`?n:1,this.height=typeof r==`number`?r:1,this.origin=new B,typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t),this._update()}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(typeof t[r]==`number`?this[r]=t[r]:this[r]instanceof B&&this[r].copy(t[r]))}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this._width/2,t=this._height/2;!this._closed&&this.vertices.length===4&&this.vertices.push(new V),this.vertices[0].set(-e,-t).sub(this._origin).command=R.move,this.vertices[1].set(e,-t).sub(this._origin).command=R.line,this.vertices[2].set(e,t).sub(this._origin).command=R.line,this.vertices[3].set(-e,t).sub(this._origin).command=R.line,this.vertices[4]&&(this.vertices[4].set(-e,-t).sub(this._origin).command=R.line)}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(t){let n=new e(0,0,this.width,this.height);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];n[t]instanceof B?n[t].copy(this[t]):n[t]=this[t]}return t&&t.add(n),n}toObject(){let e=super.toObject.call(this);return e.renderer.type=`rectangle`,e.width=this.width,e.height=this.height,e.origin=this.origin.toObject(),e}};L(uo,`Properties`,[`width`,`height`,`origin`]);var fo=uo,po={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},origin:{enumerable:!0,get:function(){return this._origin},set:function(e){this._origin&&this._origin.unbind(z.Types.change,this._renderer.flagVertices),this._origin=e,this._origin.bind(z.Types.change,this._renderer.flagVertices),this._renderer.flagVertices()}}},mo=class e extends fo{constructor(e,t,n,r,i,a){super(t,n,0,0),L(this,`_flagTexture`,!1),L(this,`_flagColumns`,!1),L(this,`_flagRows`,!1),L(this,`_flagFrameRate`,!1),L(this,`_flagIndex`,!1),L(this,`_amount`,1),L(this,`_duration`,0),L(this,`_startTime`,0),L(this,`_playing`,!1),L(this,`_firstFrame`,0),L(this,`_lastFrame`,0),L(this,`_loop`,!0),L(this,`_texture`,null),L(this,`_columns`,1),L(this,`_rows`,1),L(this,`_frameRate`,0),L(this,`_index`,0),L(this,`_origin`,null),this._renderer.type=`sprite`;for(let e in go)Object.defineProperty(this,e,go[e]);this.noStroke(),this.noFill(),e instanceof Li?this.texture=e:typeof e==`string`&&(this.texture=new Li(e)),this.origin=new B,this._update(),typeof r==`number`&&(this.columns=r),typeof i==`number`&&(this.rows=i),typeof a==`number`&&(this.frameRate=a),this.index=0}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=H.performance.now(),typeof e==`number`&&(this._firstFrame=e),typeof t==`number`&&(this._lastFrame=t),typeof n==`function`?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=0,this}clone(t){let n=new e(this.texture,this.translation.x,this.translation.y,this.columns,this.rows,this.frameRate);return this.playing&&n.play(this._firstFrame,this._lastFrame),n.loop=this.loop,n.firstFrame=this.firstFrame,n.lastFrame=this.lastFrame,t&&t.add(n),n}toObject(){let e=super.toObject.call(this);return e.renderer.type=`sprite`,e.texture=this.texture.toObject(),e.columns=this.columns,e.rows=this.rows,e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){return super.dispose(),this._playing&&=!1,this._onLastFrame=null,this._startTime=0,this._texture&&typeof this._texture.dispose==`function`?this._texture.dispose():this._texture&&typeof this._texture.unbind==`function`&&this._texture.unbind(),this}_update(){let e=this._texture,t=this._columns,n=this._rows,r,i,a,o,s,c,l,u,d;if(e&&((this._flagColumns||this._flagRows)&&(this._amount=this._columns*this._rows),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._flagTexture&&(this.fill=e),e.loaded)){l=e.image.width,u=e.image.height,r=l/t,i=u/n,o=this._amount,this.width!==r&&(this.width=r),this.height!==i&&(this.height=i),this._playing&&this._frameRate>0&&(H.isNaN(this._lastFrame)&&(this._lastFrame=o-1),a=H.performance.now()-this._startTime,d=this._lastFrame+1,s=1e3*(d-this._firstFrame)/this._frameRate,this._loop?a%=s:a=Math.min(a,s),c=Zr(this._firstFrame,d,a/s),c=Math.floor(c),c!==this._index&&(this._index=c,c>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()));let f=this._index%t,p=Math.floor(this._index/t),m=-r*f+(l-r)/2,h=-i*p+(u-i)/2;m!==e.offset.x&&(e.offset.x=m),h!==e.offset.y&&(e.offset.y=h)}return super._update.call(this),this}flagReset(){return this._flagTexture=this._flagColumns=this._flagRows=this._flagFrameRate=!1,super.flagReset.call(this),this}};L(mo,`Properties`,[`texture`,`columns`,`rows`,`frameRate`,`index`,`firstFrame`,`lastFrame`,`loop`]);var ho=mo,go={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},columns:{enumerable:!0,get:function(){return this._columns},set:function(e){this._columns=e,this._flagColumns=!0}},rows:{enumerable:!0,get:function(){return this._rows},set:function(e){this._rows=e,this._flagRows=!0}},frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}},_o,vo=class extends Ai{constructor(e){e=Array.isArray(e)?e:Array.prototype.slice.call(arguments),super(e),zr(this,_o,{}),this.attach(e),this.on(z.Types.insert,this.attach),this.on(z.Types.remove,this.detach)}get ids(){return Rr(this,_o)}attach(e){for(let t=0;t<e.length;t++){let n=e[t];n&&n.id&&(this.ids[n.id]=n)}return this}detach(e){for(let t=0;t<e.length;t++)delete this.ids[e[t].id];return this}};_o=new WeakMap;var yo=class e extends U{constructor(e,t,n,r,i,a,o){let s=o||li.Resolution*3,c=[];for(let e=0;e<s;e++)c.push(new V);super(c,!0,!1,!0),L(this,`_flagStartAngle`,!1),L(this,`_flagEndAngle`,!1),L(this,`_flagInnerRadius`,!1),L(this,`_flagOuterRadius`,!1),L(this,`_startAngle`,0),L(this,`_endAngle`,Kr),L(this,`_innerRadius`,0),L(this,`_outerRadius`,0),this._renderer.type=`arc-segment`;for(let e in xo)Object.defineProperty(this,e,xo[e]);typeof n==`number`&&(this.innerRadius=n),typeof r==`number`&&(this.outerRadius=r),typeof i==`number`&&(this.startAngle=i),typeof a==`number`&&(this.endAngle=a),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagStartAngle||this._flagEndAngle||this._flagInnerRadius||this._flagOuterRadius){let e=this._startAngle,t=this._endAngle,n=this._innerRadius,r=this._outerRadius,i=ei(e,Kr)===ei(t,Kr),a=n>0,o=this.vertices,s=a?o.length/2:o.length,c,l=0,u,d,f,p,m,h,g,_,v;for(i?s--:a||(s-=2),u=0,d=s-1;u<s;u++){switch(f=u/d,p=o[l],m=f*(t-e)+e,h=(t-e)/s,g=r*Math.cos(m),_=r*Math.sin(m),u){case 0:c=R.move;break;default:c=R.curve}p.command=c,p.x=g,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===R.curve&&(v=r*h/Math.PI,p.controls.left.x=v*Math.cos(m-qr),p.controls.left.y=v*Math.sin(m-qr),p.controls.right.x=v*Math.cos(m+qr),p.controls.right.y=v*Math.sin(m+qr),u===1&&p.controls.left.multiplyScalar(2),u===d&&p.controls.right.multiplyScalar(2)),l++}if(a){for(i?(o[l].command=R.close,l++):(s--,d=s-1),u=0;u<s;u++)f=u/d,p=o[l],m=(1-f)*(t-e)+e,h=(t-e)/s,g=n*Math.cos(m),_=n*Math.sin(m),c=R.curve,u<=0&&(c=i?R.move:R.line),p.command=c,p.x=g,p.y=_,p.controls.left.clear(),p.controls.right.clear(),p.command===R.curve&&(v=n*h/Math.PI,p.controls.left.x=v*Math.cos(m+qr),p.controls.left.y=v*Math.sin(m+qr),p.controls.right.x=v*Math.cos(m-qr),p.controls.right.y=v*Math.sin(m-qr),u===1&&p.controls.left.multiplyScalar(2),u===d&&p.controls.right.multiplyScalar(2)),l++;o[l].copy(o[0]),o[l].command=R.line}else i||(o[l].command=R.line,o[l].x=0,o[l].y=0,l++,o[l].copy(o[0]),o[l].command=R.line)}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagStartAngle=this._flagEndAngle=this._flagInnerRadius=this._flagOuterRadius=!1,this}clone(t){let n=this.innerRadius,r=this.outerRadius,i=this.startAngle,a=this.endAngle,o=this.vertices.length,s=new e(0,0,n,r,i,a,o);s.translation.copy(this.translation),s.rotation=this.rotation,s.scale=this.scale,s.skewX=this.skewX,s.skewY=this.skewY,this.matrix.manual&&s.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];s[t]=this[t]}return t&&t.add(s),s}toObject(){let t=super.toObject.call(this);t.renderer.type=`arc-segment`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(yo,`Properties`,[`startAngle`,`endAngle`,`innerRadius`,`outerRadius`]);var bo=yo,xo={startAngle:{enumerable:!0,get:function(){return this._startAngle},set:function(e){this._startAngle=e,this._flagStartAngle=!0}},endAngle:{enumerable:!0,get:function(){return this._endAngle},set:function(e){this._endAngle=e,this._flagEndAngle=!0}},innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}}},So=Math.cos,Co=Math.sin,wo=class e extends U{constructor(e,t,n,r){let i=r?Math.max(r,2):4,a=[];for(let e=0;e<i;e++)a.push(new V(0,0,0,0,0,0));super(a,!0,!0,!0),L(this,`_flagRadius`,!1),L(this,`_radius`,0),this._renderer.type=`circle`;for(let e in Eo)Object.defineProperty(this,e,Eo[e]);typeof n==`number`&&(this.radius=n),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagRadius){let e=this.vertices.length;!this._closed&&e>2&&--e;let t=4/3*Math.tan(Math.PI/(e*2)),n=this._radius,r=n*t;for(let t=0;t<this.vertices.length;t++){let i=t/e*Kr,a=n*So(i),o=n*Co(i),s=r*So(i-qr),c=r*Co(i-qr),l=r*So(i+qr),u=r*Co(i+qr),d=this.vertices[t];d.command=t===0?R.move:R.curve,d.set(a,o),d.controls.left.set(s,c),d.controls.right.set(l,u)}}return super._update.call(this),this}flagReset(){return this._flagRadius=!1,super.flagReset.call(this),this}clone(t){let n=new e(0,0,this.radius,this.vertices.length);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];n[t]=this[t]}return t&&t.add(n),n}toObject(){let t=super.toObject.call(this);t.renderer.type=`circle`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(wo,`Properties`,[`radius`]);var To=wo,Eo={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this._flagRadius=!0}}},Do=Math.cos,Oo=Math.sin,ko=class e extends U{constructor(e,t,n,r,i){typeof r!=`number`&&typeof n==`number`&&(r=n);let a=i?Math.max(i,2):4,o=[];for(let e=0;e<a;e++)o.push(new V);super(o,!0,!0,!0),L(this,`_flagWidth`,!1),L(this,`_flagHeight`,!1),L(this,`_width`,0),L(this,`_height`,0),this._renderer.type=`ellipse`;for(let e in jo)Object.defineProperty(this,e,jo[e]);typeof n==`number`&&(this.width=n*2),typeof r==`number`&&(this.height=r*2),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight){let e=this.vertices.length;!this._closed&&e>2&&--e;let t=4/3*Math.tan(Math.PI/(this.vertices.length*2)),n=this._width/2,r=this._height/2;for(let i=0;i<this.vertices.length;i++){let a=i/e*Kr,o=n*Do(a),s=r*Oo(a),c=n*t*Do(a-qr),l=r*t*Oo(a-qr),u=n*t*Do(a+qr),d=r*t*Oo(a+qr),f=this.vertices[i];f.command=i===0?R.move:R.curve,f.set(o,s),f.controls.left.set(c,l),f.controls.right.set(u,d)}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=!1,super.flagReset.call(this),this}clone(t){let n=this.width/2,r=this.height/2,i=this.vertices.length,a=new e(0,0,n,r,i);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];a[t]=this[t]}return t&&t.add(a),a}toObject(){let t=super.toObject.call(this);t.renderer.type=`ellipse`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(ko,`Properties`,[`width`,`height`]);var Ao=ko,jo={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}}},Mo=Math.ceil,No=Math.floor,Po=class e extends _a{constructor(e){super(),L(this,`_flagVertices`,!0),L(this,`_flagLength`,!0),L(this,`_flagFill`,!0),L(this,`_flagStroke`,!0),L(this,`_flagLinewidth`,!0),L(this,`_flagOpacity`,!0),L(this,`_flagVisible`,!0),L(this,`_flagSize`,!0),L(this,`_flagSizeAttenuation`,!0),L(this,`_flagStrokeAttenuation`,!0),L(this,`_length`,0),L(this,`_fill`,`#fff`),L(this,`_stroke`,`#000`),L(this,`_linewidth`,1),L(this,`_opacity`,1),L(this,`_visible`,!0),L(this,`_size`,1),L(this,`_sizeAttenuation`,!1),L(this,`_beginning`,0),L(this,`_ending`,1),L(this,`_dashes`,null),L(this,`_strokeAttenuation`,!0),L(this,`noFill`,U.prototype.noFill),L(this,`noStroke`,U.prototype.noStroke),L(this,`corner`,U.prototype.corner),L(this,`center`,U.prototype.center),L(this,`getBoundingClientRect`,U.prototype.getBoundingClientRect),L(this,`_updateLength`,U.prototype._updateLength);for(let e in Io)Object.defineProperty(this,e,Io[e]);this._renderer.type=`points`,this._renderer.flagVertices=ao.bind(this),this._renderer.bindVertices=oo.bind(this),this._renderer.unbindVertices=so.bind(this),this._renderer.flagFill=co.bind(this),this._renderer.flagStroke=lo.bind(this),this._renderer.vertices=null,this._renderer.collection=null,this.size=1,this.sizeAttenuation=!1,this.beginning=0,this.ending=1,this.fill=`#fff`,this.stroke=`#000`,this.linewidth=1,this.opacity=1,this.className=``,this.visible=!0,this.vertices=e,this.dashes=[],this.dashes.offset=0}static fromObject(t){let n=typeof t.fill==`string`?t.fill:la(t.fill),r=typeof t.stroke==`string`?t.stroke:la(t.stroke),i=new e().copy(Fr(Pr({},t),{fill:n,stroke:r}));return`id`in t&&(i.id=t.id),i}copy(t){super.copy.call(this,t);for(let e=0;e<t.vertices.length;e++){let n=t.vertices[e];n instanceof V?this.vertices.push(t.vertices[e].clone()):this.vertices.push(new V().copy(n))}for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e;for(let e=0;e<this.vertices.length;e++)n.vertices.push(this.vertices[e].clone());for(let t=0;t<e.Properties.length;t++){let r=e.Properties[t];n[r]=this[r]}return n.className=this.className,n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let t=super.toObject.call(this);return t.renderer.type=`points`,t.vertices=this.vertices.map(e=>e.toObject()),H.each(e.Properties,function(e){this[e]!==void 0&&(this[e].toObject?t[e]=this[e].toObject():t[e]=this[e])},this),t}dispose(){if(super.dispose(),this.vertices&&typeof this.vertices.unbind==`function`)try{this.vertices.unbind()}catch{}if(this.vertices)for(let e=0;e<this.vertices.length;e++){let t=this.vertices[e];typeof t.unbind==`function`&&t.unbind()}return typeof this.fill==`object`&&typeof this.fill.dispose==`function`?this.fill.dispose():typeof this.fill==`object`&&typeof this.fill.unbind==`function`&&this.fill.unbind(),typeof this.stroke==`object`&&typeof this.stroke.dispose==`function`?this.stroke.dispose():typeof this.stroke==`object`&&typeof this.stroke.unbind==`function`&&this.stroke.unbind(),this}subdivide(e){this._update();let t=[];for(let n=0;n<this.vertices.length;n++){let r=this.vertices[n],i=this.vertices[n-1];if(!i)continue;let a=r.x,o=r.y,s=i.x,c=i.y,l=fi(a,o,a,o,s,c,s,c,e);t=t.concat(l)}return this.vertices=t,this}_update(){if(this._flagVertices){this._flagLength&&this._updateLength(void 0,!0);let e=Math.min(this._beginning,this._ending),t=Math.max(this._beginning,this._ending),n=oa(this,e*this._length),r=oa(this,t*this._length),i=Mo(n),a=No(r),o=0,s;this._renderer.vertices=[],this._renderer.collection=[];for(let e=0;e<this._collection.length;e++)e>=i&&e<=a&&(s=this._collection[e],this._renderer.collection.push(s),this._renderer.vertices[o*2+0]=s.x,this._renderer.vertices[o*2+1]=s.y,o++)}return super._update.apply(this,arguments),this}flagReset(){return this._flagVertices=this._flagLength=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagSize=this._flagSizeAttenuation=!1,super.flagReset.call(this),this}};L(Po,`Properties`,[`fill`,`stroke`,`linewidth`,`opacity`,`visible`,`size`,`sizeAttenuation`,`beginning`,`ending`,`dashes`,`strokeAttenuation`]);var Fo=Po,Io={linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},sizeAttenuation:{enumerable:!0,get:function(){return this._sizeAttenuation},set:function(e){this._sizeAttenuation=e,this._flagSizeAttenuation=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Gi||this._fill instanceof Zi||this._fill instanceof ta||this._fill instanceof Li)&&this._fill.unbind(z.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Gi||this._fill instanceof Zi||this._fill instanceof ta||this._fill instanceof Li)&&this._fill.bind(z.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Gi||this._stroke instanceof Zi||this._stroke instanceof ta||this._stroke instanceof Li)&&this._stroke.unbind(z.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Gi||this._stroke instanceof Zi||this._stroke instanceof ta||this._stroke instanceof Li)&&this._stroke.bind(z.Types.change,this._renderer.flagStroke)}},length:{get:function(){return this._flagLength&&this._updateLength(),this._length}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._beginning=e,this._flagVertices=!0}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._ending=e,this._flagVertices=!0}},vertices:{enumerable:!0,get:function(){return this._collection},set:function(e){let t=this._renderer.bindVertices,n=this._renderer.unbindVertices;this._collection&&this._collection.unbind(z.Types.insert,t).unbind(z.Types.remove,n),this._collection=e instanceof Ai?e:new Ai(e||[]),this._collection.bind(z.Types.insert,t).bind(z.Types.remove,n),t(this._collection)}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!=`number`&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(e){this._strokeAttenuation=!!e,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}},Lo=Math.cos,Ro=Math.sin,zo=class e extends U{constructor(e,t,n,r){r=Math.max(r||0,3),super(),L(this,`_flagWidth`,!1),L(this,`_flagHeight`,!1),L(this,`_flagSides`,!1),L(this,`_radius`,0),L(this,`_width`,0),L(this,`_height`,0),L(this,`_sides`,0),this._renderer.type=`polygon`;for(let e in Vo)Object.defineProperty(this,e,Vo[e]);this.closed=!0,this.automatic=!1,typeof n==`number`&&(this.radius=n),typeof r==`number`&&(this.sides=r),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagSides){let e=this._sides,t=e+1,n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){let t=Kr*((r+.5)/e)+Math.PI/2,i=this._width*Lo(t)/2,a=this._height*Ro(t)/2;r>=n?this.vertices.push(new V(i,a)):this.vertices[r].set(i,a),this.vertices[r].command=r===0?R.move:R.line}}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagSides=!1,super.flagReset.call(this),this}clone(t){let n=new e(0,0,0,this.sides);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.skewX=this.skewX,n.skewY=this.skewY,n.width=this.width,n.height=this.height,this.matrix.manual&&n.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];n[t]=this[t]}return t&&t.add(n),n}toObject(){let t=super.toObject.call(this);t.renderer.type=`polygon`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(zo,`Properties`,[`width`,`height`,`sides`]);var Bo=zo,Vo={radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius=e,this.width=e*2,this.height=e*2}},width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0,this._radius=Math.max(this.width,this.height)/2}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0,this._radius=Math.max(this.width,this.height)/2}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Ho=class e extends U{constructor(e,t,n,r,i){i===void 0&&typeof n==`number`&&typeof r==`number`&&(i=Math.floor(Math.min(n,r)/12));let a=[];for(let e=0;e<10;e++)a.push(new V(0,0,0,0,0,0,e===0?R.move:R.curve));super(a),L(this,`_flagWidth`,!1),L(this,`_flagHeight`,!1),L(this,`_flagRadius`,!1),L(this,`_width`,0),L(this,`_height`,0),L(this,`_radius`,12),this._renderer.type=`rounded-rectangle`;for(let e in Wo)Object.defineProperty(this,e,Wo[e]);this.closed=!0,this.automatic=!1,this._renderer.flagRadius=Go.bind(this),typeof n==`number`&&(this.width=n),typeof r==`number`&&(this.height=r),(typeof i==`number`||i instanceof B)&&(this.radius=i),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];if(r in t){let e=t[r];/radius/i.test(r)?this[r]=typeof e==`number`||e instanceof B?e:new B().copy(e):typeof e==`number`&&(this[r]=e)}}return this}_update(){if(this._flagVertices||this._flagWidth||this._flagHeight||this._flagRadius){let e=this._width,t=this._height,n,r;this._radius instanceof B?(n=this._radius.x,r=this._radius.y):(n=this._radius,r=this._radius);let i,a=e/2,o=t/2;i=this.vertices[0],i.x=-(a-n),i.y=-o,i=this.vertices[1],i.x=a-n,i.y=-o,i.controls.left.clear(),i.controls.right.x=n,i.controls.right.y=0,i=this.vertices[2],i.x=a,i.y=-(o-r),i.controls.right.clear(),i.controls.left.clear(),i=this.vertices[3],i.x=a,i.y=o-r,i.controls.left.clear(),i.controls.right.x=0,i.controls.right.y=r,i=this.vertices[4],i.x=a-n,i.y=o,i.controls.right.clear(),i.controls.left.clear(),i=this.vertices[5],i.x=-(a-n),i.y=o,i.controls.left.clear(),i.controls.right.x=-n,i.controls.right.y=0,i=this.vertices[6],i.x=-a,i.y=o-r,i.controls.left.clear(),i.controls.right.clear(),i=this.vertices[7],i.x=-a,i.y=-(o-r),i.controls.left.clear(),i.controls.right.x=0,i.controls.right.y=-r,i=this.vertices[8],i.x=-(a-n),i.y=-o,i.controls.left.clear(),i.controls.right.clear(),i=this.vertices[9],i.copy(this.vertices[8])}return super._update.call(this),this}flagReset(){return this._flagWidth=this._flagHeight=this._flagRadius=!1,super.flagReset.call(this),this}clone(t){let n=this.width,r=this.height,i=this.radius,a=new e(0,0,n,r,i);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];a[t]=this[t]}return t&&t.add(a),a}toObject(){let t=super.toObject.call(this);t.renderer.type=`rounded-rectangle`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t.radius=typeof this.radius==`number`?this.radius:this.radius.toObject(),t}};L(Ho,`Properties`,[`width`,`height`,`radius`]);var Uo=Ho,Wo={width:{enumerable:!0,get:function(){return this._width},set:function(e){this._width=e,this._flagWidth=!0}},height:{enumerable:!0,get:function(){return this._height},set:function(e){this._height=e,this._flagHeight=!0}},radius:{enumerable:!0,get:function(){return this._radius},set:function(e){this._radius instanceof B&&this._radius.unbind(z.Types.change,this._renderer.flagRadius),this._radius=e,this._radius instanceof B&&this._radius.bind(z.Types.change,this._renderer.flagRadius),this._flagRadius=!0}}};function Go(){this._flagRadius=!0}var Ko=Math.cos,qo=Math.sin,Jo=class e extends U{constructor(e,t,n,r,i){arguments.length<=3&&(r=n,n=r/2),(typeof i!=`number`||i<=0)&&(i=5),super(),L(this,`_flagInnerRadius`,!1),L(this,`_flagOuterRadius`,!1),L(this,`_flagSides`,!1),L(this,`_innerRadius`,0),L(this,`_outerRadius`,0),L(this,`_sides`,0),this._renderer.type=`star`;for(let e in Xo)Object.defineProperty(this,e,Xo[e]);this.closed=!0,this.automatic=!1,typeof n==`number`&&(this.innerRadius=n),typeof r==`number`&&(this.outerRadius=r),typeof i==`number`&&(this.sides=i),this._update(),typeof e==`number`&&(this.translation.x=e),typeof t==`number`&&(this.translation.y=t)}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&typeof t[r]==`number`&&(this[r]=t[r])}return this}_update(){if(this._flagVertices||this._flagInnerRadius||this._flagOuterRadius||this._flagSides){let e=this._sides*2,t=e+1,n=this.vertices.length;n>e&&(this.vertices.splice(e-1,n-e),n=e);for(let r=0;r<t;r++){let t=Kr*((r+.5)/e),i=(r%2?this._outerRadius:this._innerRadius)/2,a=i*Ko(t),o=i*qo(t);r>=n?this.vertices.push(new V(a,o)):this.vertices[r].set(a,o),this.vertices[r].command=r===0?R.move:R.line}}return super._update.call(this),this}flagReset(){return this._flagInnerRadius=this._flagOuterRadius=this._flagSides=!1,super.flagReset.call(this),this}clone(t){let n=this.innerRadius,r=this.outerRadius,i=this.sides,a=new e(0,0,n,r,i);a.translation.copy(this.translation),a.rotation=this.rotation,a.scale=this.scale,a.skewX=this.skewX,a.skewY=this.skewY,this.matrix.manual&&a.matrix.copy(this.matrix);for(let e=0;e<U.Properties.length;e++){let t=U.Properties[e];a[t]=this[t]}return t&&t.add(a),a}toObject(){let t=super.toObject.call(this);t.renderer.type=`star`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}};L(Jo,`Properties`,[`innerRadius`,`outerRadius`,`sides`]);var Yo=Jo,Xo={innerRadius:{enumerable:!0,get:function(){return this._innerRadius},set:function(e){this._innerRadius=e,this._flagInnerRadius=!0}},outerRadius:{enumerable:!0,get:function(){return this._outerRadius},set:function(e){this._outerRadius=e,this._flagOuterRadius=!0}},sides:{enumerable:!0,get:function(){return this._sides},set:function(e){this._sides=e,this._flagSides=!0}}},Zo,Qo=Math.min,$o=Math.max;Wr.document&&(Zo=document.createElement(`canvas`));var es=class e extends _a{constructor(t,n,r,i){super(),L(this,`_flagValue`,!0),L(this,`_flagFamily`,!0),L(this,`_flagSize`,!0),L(this,`_flagLeading`,!0),L(this,`_flagAlignment`,!0),L(this,`_flagBaseline`,!0),L(this,`_flagStyle`,!0),L(this,`_flagWeight`,!0),L(this,`_flagDecoration`,!0),L(this,`_flagFill`,!0),L(this,`_flagStroke`,!0),L(this,`_flagLinewidth`,!0),L(this,`_flagOpacity`,!0),L(this,`_flagVisible`,!0),L(this,`_flagMask`,!1),L(this,`_flagClip`,!1),L(this,`_flagDirection`,!0),L(this,`_flagStrokeAttenuation`,!0),L(this,`_value`,``),L(this,`_family`,`sans-serif`),L(this,`_size`,13),L(this,`_leading`,17),L(this,`_alignment`,`center`),L(this,`_baseline`,`middle`),L(this,`_style`,`normal`),L(this,`_weight`,500),L(this,`_decoration`,`none`),L(this,`_direction`,`ltr`),L(this,`_fill`,`#000`),L(this,`_stroke`,`none`),L(this,`_linewidth`,1),L(this,`_opacity`,1),L(this,`_visible`,!0),L(this,`_mask`,null),L(this,`_clip`,!1),L(this,`_dashes`,null),L(this,`_strokeAttenuation`,!0);for(let e in ns)Object.defineProperty(this,e,ns[e]);if(this._renderer.type=`text`,this._renderer.flagFill=rs.bind(this),this._renderer.flagStroke=is.bind(this),this.value=t,typeof n==`number`&&(this.translation.x=n),typeof r==`number`&&(this.translation.y=r),this.dashes=[],this.dashes.offset=0,!H.isObject(i))return this;for(let t=0;t<e.Properties.length;t++){let n=e.Properties[t];n in i&&(this[n]=i[n])}}static Measure(t){if(Zo){let e=Zo.getContext(`2d`);e.font=[t._style,t._weight,`${t._size}px/${t._leading}px`,t._family].join(` `);let n=e.measureText(t.value,0,0),r=n.actualBoundingBoxDescent+n.actualBoundingBoxAscent;return{width:n.width,height:r}}{let t=this.value.length*this.size*e.Ratio,n=this.leading;return console.warn(`Two.Text: unable to accurately measure text, so using an approximation.`),{width:t,height:n}}}static fromObject(t){let n=typeof t.fill==`string`?t.fill:la(t.fill),r=typeof t.stroke==`string`?t.stroke:la(t.stroke),i=new e().copy(Fr(Pr({},t),{fill:n,stroke:r}));return`id`in t&&(i.id=t.id),i}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e(this.value);n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale;for(let t=0;t<e.Properties.length;t++){let r=e.Properties[t];n[r]=this[r]}return this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let t=super.toObject.call(this);t.renderer.type=`text`;for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];t[r]=this[r]}return t}dispose(){return super.dispose(),typeof this.fill==`object`&&typeof this.fill.dispose==`function`?this.fill.dispose():typeof this.fill==`object`&&typeof this.fill.unbind==`function`&&this.fill.unbind(),typeof this.stroke==`object`&&typeof this.stroke.dispose==`function`?this.stroke.dispose():typeof this.stroke==`object`&&typeof this.stroke.unbind==`function`&&this.stroke.unbind(),this}noFill(){return this.fill=`none`,this}noStroke(){return this.stroke=`none`,this.linewidth=0,this}getBoundingClientRect(t){let n,r,i,a,o;this._update(!0),n=t?this.matrix:this.worldMatrix;let{width:s,height:c}=e.Measure(this),l=(this._linewidth||0)/2;switch(this.alignment){case`left`:r=-l,i=s+l;break;case`right`:r=-(s+l),i=l;break;default:r=-(s/2+l),i=s/2+l}switch(this.baseline){case`middle`:a=-(c/2+l),o=c/2+l;break;default:a=-(c+l),o=l}let[u,d]=n.multiply(r,a),[f,p]=n.multiply(r,o),[m,h]=n.multiply(i,a),[g,_]=n.multiply(i,o);return a=Qo(d,p,h,_),r=Qo(u,f,m,g),i=$o(u,f,m,g),o=$o(d,p,h,_),{top:a,left:r,right:i,bottom:o,width:i-r,height:o-a}}flagReset(){return super.flagReset.call(this),this._flagValue=this._flagFamily=this._flagSize=this._flagLeading=this._flagAlignment=this._flagFill=this._flagStroke=this._flagLinewidth=this._flagOpacity=this._flagVisible=this._flagClip=this._flagDecoration=this._flagClassName=this._flagBaseline=this._flagWeight=this._flagStyle=this._flagDirection=!1,this}};L(es,`Ratio`,.6),L(es,`Properties`,[`value`,`family`,`size`,`leading`,`alignment`,`linewidth`,`style`,`weight`,`decoration`,`direction`,`baseline`,`opacity`,`visible`,`fill`,`stroke`,`dashes`,`strokeAttenuation`]);var ts=es,ns={value:{enumerable:!0,get:function(){return this._value},set:function(e){this._value=e,this._flagValue=!0}},family:{enumerable:!0,get:function(){return this._family},set:function(e){this._family=e,this._flagFamily=!0}},size:{enumerable:!0,get:function(){return this._size},set:function(e){this._size=e,this._flagSize=!0}},leading:{enumerable:!0,get:function(){return this._leading},set:function(e){this._leading=e,this._flagLeading=!0}},alignment:{enumerable:!0,get:function(){return this._alignment},set:function(e){this._alignment=e,this._flagAlignment=!0}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e,this._flagLinewidth=!0}},style:{enumerable:!0,get:function(){return this._style},set:function(e){this._style=e,this._flagStyle=!0}},weight:{enumerable:!0,get:function(){return this._weight},set:function(e){this._weight=e,this._flagWeight=!0}},decoration:{enumerable:!0,get:function(){return this._decoration},set:function(e){this._decoration=e,this._flagDecoration=!0}},direction:{enumerable:!0,get:function(){return this._direction},set:function(e){this._direction=e,this._flagDirection=!0}},baseline:{enumerable:!0,get:function(){return this._baseline},set:function(e){this._baseline=e,this._flagBaseline=!0}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._opacity=e,this._flagOpacity=!0}},visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._visible=e,this._flagVisible=!0}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){(this._fill instanceof Gi||this._fill instanceof Zi||this._fill instanceof ta||this._fill instanceof Li)&&this._fill.unbind(z.Types.change,this._renderer.flagFill),this._fill=e,this._flagFill=!0,(this._fill instanceof Gi||this._fill instanceof Zi||this._fill instanceof ta||this._fill instanceof Li)&&this._fill.bind(z.Types.change,this._renderer.flagFill)}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){(this._stroke instanceof Gi||this._stroke instanceof Zi||this._stroke instanceof ta||this._stroke instanceof Li)&&this._stroke.unbind(z.Types.change,this._renderer.flagStroke),this._stroke=e,this._flagStroke=!0,(this._stroke instanceof Gi||this._stroke instanceof Zi||this._stroke instanceof ta||this._stroke instanceof Li)&&this._stroke.bind(z.Types.change,this._renderer.flagStroke)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,H.isObject(e)&&!e.clip&&(e.clip=!0)}},clip:{enumerable:!0,get:function(){return this._clip},set:function(e){this._clip=e,this._flagClip=!0}},dashes:{enumerable:!0,get:function(){return this._dashes},set:function(e){typeof e.offset!=`number`&&(e.offset=this.dashes&&this._dashes.offset||0),this._dashes=e}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(e){this._strokeAttenuation=!!e,this._flagStrokeAttenuation=!0,this._flagLinewidth=!0}}};function rs(){this._flagFill=!0}function is(){this._flagStroke=!0}var as=class e extends fo{constructor(t,n,r,i){super(n,r,0,0),L(this,`_flagTextures`,!1),L(this,`_flagFrameRate`,!1),L(this,`_flagIndex`,!1),L(this,`_amount`,1),L(this,`_duration`,0),L(this,`_index`,0),L(this,`_startTime`,0),L(this,`_playing`,!1),L(this,`_firstFrame`,0),L(this,`_lastFrame`,0),L(this,`_loop`,!0),L(this,`_textures`,null),L(this,`_frameRate`,0),L(this,`_origin`,null),this._renderer.type=`image-sequence`;for(let e in ss)Object.defineProperty(this,e,ss[e]);this._renderer.flagTextures=cs.bind(this),this._renderer.bindTextures=ls.bind(this),this._renderer.unbindTextures=us.bind(this),this.noStroke(),this.noFill(),Array.isArray(t)?this.textures=t.map(ds.bind(this)):typeof t==`string`&&(this.textures=[ds(t)]),this.origin=new B,this._update(),this.frameRate=typeof i==`number`?i:e.DefaultFrameRate,this.index=0}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}play(e,t,n){return this._playing=!0,this._firstFrame=0,this._lastFrame=this.amount-1,this._startTime=H.performance.now(),typeof e==`number`&&(this._firstFrame=e),typeof t==`number`&&(this._lastFrame=t),typeof n==`function`?this._onLastFrame=n:delete this._onLastFrame,this._index!==this._firstFrame&&(this._startTime-=1e3*Math.abs(this._index-this._firstFrame)/this._frameRate),this}pause(){return this._playing=!1,this}stop(){return this._playing=!1,this._index=this._firstFrame,this}clone(t){let n=new e(this.textures,this.translation.x,this.translation.y,this.frameRate);return n._loop=this._loop,this._playing&&n.play(),t&&t.add(n),n}toObject(){let e=super.toObject.call(this);return e.renderer.type=`image-sequence`,e.textures=this.textures.map(function(e){return e.toObject()}),e.frameRate=this.frameRate,e.index=this.index,e.firstFrame=this.firstFrame,e.lastFrame=this.lastFrame,e.loop=this.loop,e}dispose(){if(super.dispose(),this._playing&&=!1,this._onLastFrame=null,this.textures&&typeof this.textures.unbind==`function`)try{this.textures.unbind()}catch{}if(this.textures)for(let e=0;e<this.textures.length;e++){let t=this.textures[e];typeof t.dispose==`function`?t.dispose():typeof t.unbind==`function`&&t.unbind()}return this}_update(){let e=this._textures,t,n,r,i,a,o,s,c;return e&&(this._flagTextures&&(this._amount=e.length),this._flagFrameRate&&(this._duration=1e3*this._amount/this._frameRate),this._playing&&this._frameRate>0?(i=this._amount,H.isNaN(this._lastFrame)&&(this._lastFrame=i-1),r=H.performance.now()-this._startTime,c=this._lastFrame+1,a=1e3*(c-this._firstFrame)/this._frameRate,this._loop?r%=a:r=Math.min(r,a),s=Zr(this._firstFrame,c,r/a),s=Math.floor(s),s!==this._index&&(this._index=s,o=e[this._index],o.loaded&&(t=o.image.width,n=o.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n),this.fill=o,s>=this._lastFrame-1&&this._onLastFrame&&this._onLastFrame()))):(this._flagIndex||!(this.fill instanceof Li))&&(o=e[this._index],o.loaded&&(t=o.image.width,n=o.image.height,this.width!==t&&(this.width=t),this.height!==n&&(this.height=n)),this.fill=o)),super._update.call(this),this}flagReset(){return this._flagTextures=this._flagFrameRate=!1,super.flagReset.call(this),this}};L(as,`Properties`,[`textures`,`frameRate`,`index`,`firstFrame`,`lastFrame`,`loop`]),L(as,`DefaultFrameRate`,30);var os=as,ss={frameRate:{enumerable:!0,get:function(){return this._frameRate},set:function(e){this._frameRate=e,this._flagFrameRate=!0}},index:{enumerable:!0,get:function(){return this._index},set:function(e){this._index=e,this._flagIndex=!0}},textures:{enumerable:!0,get:function(){return this._textures},set:function(e){let t=this._renderer.bindTextures,n=this._renderer.unbindTextures;this._textures&&this._textures.unbind(z.Types.insert,t).unbind(z.Types.remove,n),this._textures=new Ai((e||[]).slice(0)),this._textures.bind(z.Types.insert,t).bind(z.Types.remove,n),t(this._textures)}},firstFrame:{enumerable:!0,get:function(){return this._firstFrame},set:function(e){this._firstFrame=e}},lastFrame:{enumerable:!0,get:function(){return this._lastFrame},set:function(e){this._lastFrame=e}},loop:{enumerable:!0,get:function(){return this._loop},set:function(e){this._loop=!!e}}};function cs(){this._flagTextures=!0}function ls(e){let t=e.length;for(;t--;)e[t].bind(z.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function us(e){let t=e.length;for(;t--;)e[t].unbind(z.Types.change,this._renderer.flagTextures);this._renderer.flagTextures()}function ds(e){if(e instanceof Li)return e;if(typeof e==`string`)return new Li(e)}var fs=Math.min,ps=Math.max,ms={getShapesAtPoint:{results:[],hitOptions:{},context:{x:0,y:0,visibleOnly:!0,results:null},single:[],output:[],empty:[]}},hs=class e extends _a{constructor(e){super(),L(this,`_flagAdditions`,!1),L(this,`_flagSubtractions`,!1),L(this,`_flagOrder`,!1),L(this,`_flagOpacity`,!0),L(this,`_flagBeginning`,!1),L(this,`_flagEnding`,!1),L(this,`_flagLength`,!1),L(this,`_flagMask`,!1),L(this,`_fill`,`#fff`),L(this,`_stroke`,`#000`),L(this,`_linewidth`,1),L(this,`_opacity`,1),L(this,`_visible`,!0),L(this,`_cap`,`round`),L(this,`_join`,`round`),L(this,`_miter`,4),L(this,`_closed`,!0),L(this,`_curved`,!1),L(this,`_automatic`,!0),L(this,`_beginning`,0),L(this,`_ending`,1),L(this,`_length`,0),L(this,`_mask`,null),L(this,`_strokeAttenuation`,!0);for(let e in _s)Object.defineProperty(this,e,_s[e]);this._renderer.type=`group`,this.additions=[],this.subtractions=[],this.children=Array.isArray(e)?e:Array.prototype.slice.call(arguments)}static InsertChildren(e){for(let t=0;t<e.length;t++)vs.call(this,e[t],this)}static RemoveChildren(e){for(let t=0;t<e.length;t++)vs.call(this,e[t])}static OrderChildren(e){this._flagOrder=!0}static fromObject(t){let n=new e;for(let r=0;r<e.Properties.length;r++){let i=e.Properties[r];i in t&&(n[i]=/(fill|stroke)/i.test(i)?typeof t[i]==`string`?t[i]:la(t[i]):t[i])}return`mask`in t&&(n.mask=r(t.mask)),`id`in t&&(n.id=t.id),n.children=t.children.map(r),n;function r(t){if(t&&t.renderer)switch(t.renderer.type){case`arc-segment`:return bo.fromObject(t);case`circle`:return To.fromObject(t);case`element`:return Mi.fromObject(t);case`ellipse`:return Ao.fromObject(t);case`group`:return e.fromObject(t);case`image`:return Image.fromObject(t);case`image-sequence`:return os.fromObject(t);case`path`:return U.fromObject(t);case`points`:return Fo.fromObject(t);case`polygon`:return Bo.fromObject(t);case`rectangle`:return fo.fromObject(t);case`rounded-rectangle`:return Uo.fromObject(t);case`shape`:return _a.fromObject(t);case`sprite`:return ho.fromObject(t);case`star`:return Yo.fromObject(t);case`text`:return ts.fromObject(t)}return t}}static IsVisible(e,t){if(!t)return!0;let n=e;for(;n;){if(typeof n.visible==`boolean`&&!n.visible||typeof n.opacity==`number`&&n.opacity<=0)return!1;n=n.parent}return!0}static VisitForHitTest(t,n,r,i,a,o,s){let c=t&&t.children;if(!c)return!1;let l=n.results;for(let t=c.length-1;t>=0;t--){let u=c[t];if(!u||!e.IsVisible(u,n.visibleOnly))continue;let d=typeof u.getBoundingClientRect==`function`?u.getBoundingClientRect():null;if(!d||Na(d,n.x,n.y,o)){if(u instanceof e){if(r&&(!i||i(u))&&typeof u.contains==`function`&&u.contains(n.x,n.y,a)&&(l.push(u),s)||e.VisitForHitTest(u,n,r,i,a,o,s))return!0}else if(u instanceof _a&&(!i||i(u))&&typeof u.contains==`function`&&u.contains(n.x,n.y,a)&&(l.push(u),s))return!0}}return!1}copy(t){super.copy.call(this,t),console.warn(`Two.js: attempting to copy group. Two.Group.children copying not supported.`);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e,r=this.children.map(function(e){return e.clone()});return n.add(r),n.opacity=this.opacity,this.mask&&(n.mask=this.mask),n.translation.copy(this.translation),n.rotation=this.rotation,n.scale=this.scale,n.className=this.className,this.matrix.manual&&n.matrix.copy(this.matrix),t&&t.add(n),n._update()}toObject(){let e=super.toObject.call(this);return e.renderer.type=`group`,e.children=[],e.opacity=this.opacity,e.className=this.className,e.mask=this.mask?this.mask.toObject():null,H.each(this.children,(t,n)=>{e.children[n]=t.toObject()},this),e}dispose(){if(super.dispose(),this.children)for(let e=0;e<this.children.length;e++){let t=this.children[e];typeof t.dispose==`function`&&t.dispose()}if(this.children&&typeof this.children.unbind==`function`)try{this.children.unbind()}catch{}return this}getShapesAtPoint(t,n,r){let i=r||{},{results:a,hitOptions:o,context:s,single:c,empty:l}=ms.getShapesAtPoint;a.length=0;let u=i.mode===`deepest`||i.deepest?`deepest`:`all`,d=i.visibleOnly!==!1,f=!!i.includeGroups,p=typeof i.filter==`function`?i.filter:null,m=typeof i.tolerance==`number`?i.tolerance:0;typeof i.precision==`number`?o.precision=i.precision:delete o.precision,i.fill===void 0?delete o.fill:o.fill=i.fill,i.stroke===void 0?delete o.stroke:o.stroke=i.stroke,o.tolerance=m,o.ignoreVisibility=!d;let h=u===`deepest`;if(s.x=t,s.y=n,s.visibleOnly=d,s.results=a,e.VisitForHitTest(this,s,f,p,o,m,h),h){if(a.length>0){let e=a[0];return a.length=0,c[0]=e,c.length=1,c}return l.length=0,l}let g=a.slice();return a.length=0,g}corner(){let e=this.getBoundingClientRect(!0);for(let t=0;t<this.children.length;t++){let n=this.children[t];n.translation.x-=e.left,n.translation.y-=e.top}return this.mask&&(this.mask.translation.x-=e.left,this.mask.translation.y-=e.top),this}center(){let e=this.getBoundingClientRect(!0),t=e.left+e.width/2-this.translation.x,n=e.top+e.height/2-this.translation.y;for(let e=0;e<this.children.length;e++){let r=this.children[e];r.isShape&&(r.translation.x-=t,r.translation.y-=n)}return this.mask&&(this.mask.translation.x-=t,this.mask.translation.y-=n),this}getById(e){let t=null;function n(r){if(r.id===e)return r;if(r.children){if(r.children.ids[e])return r.children.ids[e];for(let e=0;e<r.children.length;e++)if(t=n(r.children[e]),t)return t}return null}return n(this)}getByClassName(e){let t=[];function n(r){if(Array.prototype.indexOf.call(r.classList,e)>=0&&t.push(r),r.children)for(let e=0;e<r.children.length;e++){let t=r.children[e];n(t)}return t}return n(this)}getByType(e){let t=[];function n(r){if(r instanceof e&&t.push(r),r.children)for(let e=0;e<r.children.length;e++){let t=r.children[e];n(t)}return t}return n(this)}add(e){e=e instanceof Array?e.slice():Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){let n=e[t];if(!(n&&n.id))continue;let r=Array.prototype.indexOf.call(this.children,n);r>=0&&this.children.splice(r,1),this.children.push(n)}return this}remove(e){let t=arguments.length,n=this.parent;if(t<=0&&n)return n.remove(this),this;e=e instanceof Array?e.slice():Array.prototype.slice.call(arguments);for(let t=0;t<e.length;t++){let n=e[t];if(!n||!this.children.ids[n.id])continue;let r=this.children.indexOf(n);r>=0&&this.children.splice(r,1)}return this}getBoundingClientRect(e){let t,n,r,i,a,o;this._update(!0);let s=1/0,c=-1/0,l=1/0,u=-1/0,d=/texture|gradient/i;n=e?this.matrix:this.worldMatrix;for(let f=0;f<this.children.length;f++){let p=this.children[f];if(p.visible&&!d.test(p._renderer.type)&&(t=p.getBoundingClientRect(e),r=typeof t.top!=`number`||H.isNaN(t.top)||!isFinite(t.top),i=typeof t.left!=`number`||H.isNaN(t.left)||!isFinite(t.left),a=typeof t.right!=`number`||H.isNaN(t.right)||!isFinite(t.right),o=typeof t.bottom!=`number`||H.isNaN(t.bottom)||!isFinite(t.bottom),!(r||i||a||o))){if(e){let[e,r]=n.multiply(t.left,t.top),[i,a]=n.multiply(t.right,t.top),[o,d]=n.multiply(t.left,t.bottom),[f,p]=n.multiply(t.right,t.bottom);l=fs(r,a,d,p,l),s=fs(e,i,o,f,s),c=ps(e,i,o,f,c),u=ps(r,a,d,p,u)}else l=fs(t.top,l),s=fs(t.left,s),c=ps(t.right,c),u=ps(t.bottom,u)}}return{top:l,left:s,right:c,bottom:u,width:c-s,height:u-l}}noFill(){return this.children.forEach(function(e){e.noFill()}),this}noStroke(){return this.children.forEach(function(e){e.noStroke()}),this}subdivide(){let e=arguments;return this.children.forEach(function(t){t.subdivide.apply(t,e)}),this}_update(){let e,t,n;if(this._flagBeginning||this._flagEnding){let r=Math.min(this._beginning,this._ending),i=Math.max(this._beginning,this._ending),a=this.length,o=0,s=r*a,c=i*a;for(e=0;e<this.children.length;e++)n=this.children[e],t=n.length,s>o+t?(n.beginning=1,n.ending=1):c<o?(n.beginning=0,n.ending=0):s>o&&s<o+t?(n.beginning=(s-o)/t,n.ending=1):c>o&&c<o+t?(n.beginning=0,n.ending=(c-o)/t):(n.beginning=0,n.ending=1),o+=t}return super._update.apply(this,arguments)}flagReset(){return this._flagAdditions&&=(this.additions.length=0,!1),this._flagSubtractions&&=(this.subtractions.length=0,!1),this._flagOrder=this._flagMask=this._flagOpacity=this._flagBeginning=this._flagEnding=!1,super.flagReset.call(this),this}};L(hs,`Children`,vo),L(hs,`Properties`,[`fill`,`stroke`,`linewidth`,`cap`,`join`,`miter`,`closed`,`curved`,`automatic`]);var gs=hs,_s={visible:{enumerable:!0,get:function(){return this._visible},set:function(e){this._flagVisible=this._visible!==e||this._flagVisible,this._visible=e}},opacity:{enumerable:!0,get:function(){return this._opacity},set:function(e){this._flagOpacity=this._opacity!==e||this._flagOpacity,this._opacity=e}},beginning:{enumerable:!0,get:function(){return this._beginning},set:function(e){this._flagBeginning=this._beginning!==e||this._flagBeginning,this._beginning=e}},ending:{enumerable:!0,get:function(){return this._ending},set:function(e){this._flagEnding=this._ending!==e||this._flagEnding,this._ending=e}},length:{enumerable:!0,get:function(){if(this._flagLength||this._length<=0){if(this._length=0,!this.children)return this._length;for(let e=0;e<this.children.length;e++){let t=this.children[e];this._length+=t.length}}return this._length}},fill:{enumerable:!0,get:function(){return this._fill},set:function(e){this._fill=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.fill=e}}},stroke:{enumerable:!0,get:function(){return this._stroke},set:function(e){this._stroke=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.stroke=e}}},linewidth:{enumerable:!0,get:function(){return this._linewidth},set:function(e){this._linewidth=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.linewidth=e}}},join:{enumerable:!0,get:function(){return this._join},set:function(e){this._join=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.join=e}}},miter:{enumerable:!0,get:function(){return this._miter},set:function(e){this._miter=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.miter=e}}},cap:{enumerable:!0,get:function(){return this._cap},set:function(e){this._cap=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.cap=e}}},closed:{enumerable:!0,get:function(){return this._closed},set:function(e){this._closed=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.closed=e}}},curved:{enumerable:!0,get:function(){return this._curved},set:function(e){this._curved=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.curved=e}}},automatic:{enumerable:!0,get:function(){return this._automatic},set:function(e){this._automatic=e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.automatic=e}}},children:{enumerable:!0,get:function(){return this._children},set:function(e){let t=gs.InsertChildren.bind(this),n=gs.RemoveChildren.bind(this),r=gs.OrderChildren.bind(this);this._children&&(this._children.unbind(),this._children.length>0&&n(this._children)),this._children=new vo(e),this._children.bind(z.Types.insert,t),this._children.bind(z.Types.remove,n),this._children.bind(z.Types.order,r),e.length>0&&t(e)}},mask:{enumerable:!0,get:function(){return this._mask},set:function(e){this._mask=e,this._flagMask=!0,H.isObject(e)&&!e.clip&&(e.clip=!0)}},strokeAttenuation:{enumerable:!0,get:function(){return this._strokeAttenuation},set:function(e){this._strokeAttenuation=!!e;for(let t=0;t<this.children.length;t++){let n=this.children[t];n.strokeAttenuation!==void 0&&(n.strokeAttenuation=e)}}}};function vs(e,t){let n=e.parent,r;if(n===t||(n&&n.children.ids[e.id]&&(r=Array.prototype.indexOf.call(n.children,e),n.children.splice(r,1),a()),t)){i();return}a(),n._flagAdditions&&n.additions.length===0&&(n._flagAdditions=!1),n._flagSubtractions&&n.subtractions.length===0&&(n._flagSubtractions=!1),delete e.parent;function i(){t.subtractions.length>0&&(r=Array.prototype.indexOf.call(t.subtractions,e),r>=0&&t.subtractions.splice(r,1)),t.additions.length>0&&(r=Array.prototype.indexOf.call(t.additions,e),r>=0&&t.additions.splice(r,1)),e.parent=t,t.additions.push(e),t._flagAdditions=!0}function a(){r=Array.prototype.indexOf.call(n.additions,e),r>=0&&n.additions.splice(r,1),r=Array.prototype.indexOf.call(n.subtractions,e),r<0&&(n.subtractions.push(e),n._flagSubtractions=!0)}}var ys=class extends U{constructor(e,t,n,r){let i=[new V(e,t),new V(n,r)];super(i);for(let e in bs)Object.defineProperty(this,e,bs[e]);this.vertices[0].command=R.move,this.vertices[1].command=R.line,this.automatic=!1}};L(ys,`Properties`,[`left`,`right`]);var bs={left:{enumerable:!0,get:function(){return this.vertices[0]},set:function(e){if(H.isObject(e))this.vertices.splice(0,1,e),this.vertices[0].command=R.move;else{let e=new wi(`Two.Line.left argument is not an object.`);console.warn(e.name,e.message)}}},right:{enumerable:!0,get:function(){return this.vertices[1]},set:function(e){if(H.isObject(e))this.vertices.splice(1,1,e),this.vertices[1].command=R.line;else{let e=new wi(`Two.Line.right argument is not an object.`);console.warn(e.name,e.message)}}}},xs={path:/[+-]?(?:\d*\.\d+|\d+)(?:[eE][+-]\d+)?/g,cssBackgroundImage:/url\(['"]?#([\w\d-_]*)['"]?\)/i,unitSuffix:/[a-zA-Z%]*/i},Ss={start:`left`,middle:`center`,end:`right`},Cs=[`id`,`class`,`transform`,`xmlns`,`viewBox`],ws=[`x`,`y`,`width`,`height`,`href`,`xlink:href`];function Ts(e){return Ss[e]}function Es(e){let t=e.getAttribute(`dominant-baseline`),n=e.getAttribute(`alignment-baseline`);return t||n}function Ds(e){return e.replace(/svg:/gi,``).toLowerCase()}function Os(e,t){if(t.x+=e.translateX,t.y+=e.translateY,t.x*=e.scaleX,t.y*=e.scaleY,e.rotation!==0){let n=t.length();t.x=n*Math.cos(e.rotation),t.y=n*Math.sin(e.rotation)}}function ks(e,t){t||={};let n=e.split(`;`);for(let e=0;e<n.length;e++){let r=n[e].split(`:`),i=r[0],a=r[1];if(i===void 0||a===void 0)continue;let o=i.replace(/\s/g,``),s=a.replace(/\s/g,``);t[o]=s}return t}function As(e){let t={},n=js(e),r=Math.max(n.length,e.style.length);for(let i=0;i<r;i++){let r=e.style[i],a=n[i];r&&(t[r]=e.style[r]),a&&(t[a]=e.getAttribute(a))}return t}function js(e){let t=e.getAttributeNames();for(let e=0;e<Cs.length;e++){let n=Cs[e],r=Array.prototype.indexOf.call(t,n);r>=0&&t.splice(r,1)}return t}function Ms(e,t){let n=t.split(/[\s,]/),r=-parseFloat(n[0]),i=-parseFloat(n[1]),a=parseFloat(n[2]),o=parseFloat(n[3]);if(r&&i)for(let t=0;t<e.children.length;t++){let n=e.children[t];`translation`in n?n.translation.add(r,i):`x`in n?n.x=r:`y`in n&&(n.y=i)}let s=typeof e.x==`number`,c=typeof e.y==`number`,l=typeof e.width==`number`,u=typeof e.height==`number`;return s&&(e.translation.x+=e.x),c&&(e.translation.y+=e.y),(l||u)&&(e.scale=new B(1,1)),l&&(e.scale.x=e.width/a),u&&(e.scale.y=e.height/o),e.mask=new fo(0,0,a,o),e.mask.origin.set(-a/2,-o/2),e}function Ns(e,t,n){let r={},i={},a={},o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S;if(e===null)return r;if(Wr.getComputedStyle){let t=Wr.getComputedStyle(e);for(o=t.length;o--;)c=t[o],l=t[c],l!==void 0&&(r[c]=l)}for(o=0;o<e.attributes.length;o++)d=e.attributes[o],/style/i.test(d.nodeName)?ks(d.value,a):i[d.nodeName]=d.value;for(c in r.opacity!==void 0&&(r[`stroke-opacity`]=r.opacity,r[`fill-opacity`]=r.opacity,delete r.opacity),n&&H.defaults(r,n),H.extend(r,a,i),r.visible=!(r.display===void 0&&/none/i.test(r.display))||r.visibility===void 0&&/hidden/i.test(r.visibility),r)switch(l=r[c],c){case`gradientTransform`:if(/none/i.test(l)||(s=e.gradientTransform&&e.gradientTransform.baseVal&&e.gradientTransform.baseVal.length>0?e.gradientTransform.baseVal[0].matrix:e.getCTM?e.getCTM():null,s===null))break;switch(f=Jr(s),t._renderer.type){case`linear-gradient`:Os(f,t.left),Os(f,t.right);break;case`radial-gradient`:t.center.x+=f.translateX,t.center.y+=f.translateY,t.focal.x+=f.translateX,t.focal.y+=f.translateY,t.radius*=Math.max(f.scaleX,f.scaleY)}break;case`transform`:if(/none/i.test(l)||(s=e.transform&&e.transform.baseVal&&e.transform.baseVal.length>0?e.transform.baseVal[0].matrix:e.getCTM?e.getCTM():null,s===null))break;li.AutoCalculateImportedMatrices?(f=Jr(s),t.translation.set(f.translateX,f.translateY),t.rotation=Math.PI*(f.rotation/180),t.scale=new B(f.scaleX,f.scaleY),p=parseFloat((r.x+``).replace(`px`)),m=parseFloat((r.y+``).replace(`px`)),p&&(t.translation.x=p),m&&(t.translation.y=m)):(s=e.getCTM(),t._matrix.manual=!0,t._matrix.set(s.a,s.b,s.c,s.d,s.e,s.f));break;case`visible`:if(t instanceof gs){t._visible=l;break}t.visible=l;break;case`stroke-linecap`:if(t instanceof gs){t._cap=l;break}t.cap=l;break;case`stroke-linejoin`:if(t instanceof gs){t._join=l;break}t.join=l;break;case`stroke-miterlimit`:if(t instanceof gs){t._miter=l;break}t.miter=l;break;case`stroke-width`:if(t instanceof gs){t._linewidth=parseFloat(l);break}t.linewidth=parseFloat(l);break;case`opacity`:case`stroke-opacity`:case`fill-opacity`:if(t instanceof gs){t._opacity=parseFloat(l);break}t.opacity=parseFloat(l);break;case`clip-path`:if(xs.cssBackgroundImage.test(l)&&(h=l.replace(xs.cssBackgroundImage,`$1`),Is.defs.current&&Is.defs.current.contains(h)&&(_=Is.defs.current.get(h),_&&_.childNodes.length>0)))switch(_=_.childNodes[0],v=Ds(_.nodeName),t.mask=Is[v].call(this,_,{}),t._renderer.type){case`text`:case`path`:t.position.add(t.mask.position),t.mask.position.clear()}break;case`fill`:case`stroke`:u=(t instanceof gs?`_`:``)+c,xs.cssBackgroundImage.test(l)?(h=l.replace(xs.cssBackgroundImage,`$1`),Is.defs.current&&Is.defs.current.contains(h)?(_=Is.defs.current.get(h),_.object||(v=Ds(_.nodeName),_.object=Is[v].call(this,_,{})),_=_.object):(g=Fs(this),_=g.getById(h)),t[u]=_):t[u]=l;break;case`id`:t.id=l;break;case`class`:case`className`:t.classList=l.split(` `),t._flagClassName=!0;break;case`x`:case`y`:if(y=t instanceof Gi,b=t instanceof Zi,x=t instanceof ta,y||b||x)break;l.match(`[a-z%]$`)&&!l.endsWith(`px`)&&(S=new wi(`only pixel values are supported with the `+c+` attribute.`),console.warn(S.name,S.message)),t.translation[c]=parseFloat(l);break;case`font-family`:t instanceof ts&&(t.family=l);break;case`font-size`:t instanceof ts&&(l.match(`[a-z%]$`)&&!l.endsWith(`px`)&&(S=new wi(`only pixel values are supported with the `+c+` attribute.`),console.warn(S.name,S.message)),t.size=parseFloat(l));break;case`font-weight`:t instanceof ts&&(t.weight=l);break;case`font-style`:t instanceof ts&&(t.style=l);break;case`text-decoration`:t instanceof ts&&(t.decoration=l);break;case`line-height`:t instanceof ts&&(t.leading=l)}return Object.keys(e.dataset).length&&(t.dataset=e.dataset),r}function Ps(e,t){for(let n=0,r=e.childNodes.length;n<r;n++){let r=e.childNodes[n];r.id&&Ds(e.nodeName)!==`#text`&&t.add(r.id,r)}}function Fs(e){for(;e.parent;)e=e.parent;return e.scene}var Is={svg:function(e){let t=Is.defs.current=new Oi,n=e.getElementsByTagName(`defs`);for(let e=0;e<n.length;e++)Ps(n[e],t);let r=Is.g.call(this,e),i=e.getAttribute(`viewBox`),a=e.getAttribute(`x`),o=e.getAttribute(`y`),s=e.getAttribute(`width`),c=e.getAttribute(`height`);r.defs=t;let l=i!==null,u=a!==null,d=o!==null,f=s!==null,p=c!==null;return u&&(r.x=parseFloat(a.replace(xs.unitSuffix,``))),d&&(r.y=parseFloat(o.replace(xs.unitSuffix,``))),f&&(r.width=parseFloat(s.replace(xs.unitSuffix,``))),p&&(r.height=parseFloat(c.replace(xs.unitSuffix,``))),l&&Ms(r,i),delete Is.defs.current,r},defs:function(e){return null},use:function(e,t){let n,r=e.getAttribute(`href`)||e.getAttribute(`xlink:href`);if(!r)return n=new wi(`encountered <use /> with no href.`),console.warn(n.name,n.message),null;let i=r.slice(1);if(!Is.defs.current.contains(i))return n=new wi(`unable to find element for reference `+r+`.`),console.warn(n.name,n.message),null;let a=Is.defs.current.get(i).cloneNode(!0);for(let t=0;t<e.attributes.length;t++){let n=e.attributes[t],r=ws.includes(n.nodeName),i=!a.hasAttribute(n.nodeName);(r||i)&&a.setAttribute(n.nodeName,n.value)}return Is[Ds(a.nodeName)].call(this,a,t)},g:function(e,t){let n=new gs;Ns.call(this,e,n,t),this.add(n);let r=As.call(this,e);for(let t=0,i=e.childNodes.length;t<i;t++){let i=e.childNodes[t],a=i.nodeName;if(!a)return;let o=Ds(a);if(o in Is){let e=Is[o].call(n,i,r);e&&!e.parent&&n.add(e)}}return n},polygon:function(e,t){let n;n=typeof e==`string`?e:e.getAttribute(`points`);let r=[];n.replace(/(-?[\d.eE-]+)[,|\s](-?[\d.eE-]+)/g,function(e,t,n){r.push(new V(parseFloat(t),parseFloat(n)))});let i=new U(r,!0);return i.stroke=`none`,i.fill=`black`,Ns.call(this,e,i,t),i},polyline:function(e,t){let n=Is.polygon.call(this,e,t);return n.closed=!1,n},path:function(e,t){let n;typeof e==`string`?(n=e,e=null):n=e.getAttribute(`d`);let r=[],i=!1,a=!1;if(n){let e=new V,t,o,s=n.match(/[a-df-z][^a-df-z]*/gi),c=s.length-1;H.each(s.slice(0),function(e,t){let n=e.slice(1).trim().match(xs.path),r=e[0],i=r.toLowerCase(),a,o,c,l,u,d=[];switch(t===0&&(s=[]),i){case`h`:case`v`:n.length>1&&(a=1);break;case`m`:case`l`:case`t`:n.length>2&&(a=2);break;case`s`:case`q`:n.length>4&&(a=4);break;case`c`:n.length>6&&(a=6);break;case`a`:n.length>7&&(a=7)}if(a){for(o=0,c=n.length,u=0;o<c;o+=a){if(l=r,u>0)switch(r){case`m`:l=`l`;break;case`M`:l=`L`}d.push(l+n.slice(o,o+a).join(` `)),u++}s=Array.prototype.concat.apply(s,d)}else s.push(e)}),H.each(s,function(n,s){let l,u,d,f=n[0],p=f.toLowerCase();o=n.slice(1).trim().match(xs.path),a=f===p;let m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A;switch(p){case`z`:if(s>=c)i=!0;else{u=e.x,d=e.y,l=new V(u,d,void 0,void 0,void 0,void 0,R.close);for(let t=r.length-1;t>=0;t--){let n=r[t];if(/m/i.test(n.command)){e=n;break}}}break;case`m`:case`l`:t=void 0,u=parseFloat(o[0]),d=parseFloat(o[1]),l=new V(u,d,void 0,void 0,void 0,void 0,/m/i.test(p)?R.move:R.line),a&&l.addSelf(e),e=l;break;case`h`:case`v`:C=/h/i.test(p)?`x`:`y`,w=/x/i.test(C)?`y`:`x`,l=new V(void 0,void 0,void 0,void 0,void 0,void 0,R.line),l[C]=parseFloat(o[0]),l[w]=e[w],a&&(l[C]+=e[C]),e=l;break;case`c`:case`s`:m=e.x,h=e.y,t||=new B,/c/i.test(p)?(g=parseFloat(o[0]),_=parseFloat(o[1]),v=parseFloat(o[2]),y=parseFloat(o[3]),b=parseFloat(o[4]),x=parseFloat(o[5])):(S=vi(e,t,a),g=S.x,_=S.y,v=parseFloat(o[0]),y=parseFloat(o[1]),b=parseFloat(o[2]),x=parseFloat(o[3])),a&&(g+=m,_+=h,v+=m,y+=h,b+=m,x+=h),e.controls.right.set(g-e.x,_-e.y),l=new V(b,x,v-b,y-x,void 0,void 0,R.curve),e=l,t=l.controls.left;break;case`t`:case`q`:m=e.x,h=e.y,t||=new B,/q/i.test(p)?(g=parseFloat(o[0]),_=parseFloat(o[1]),v=parseFloat(o[0]),y=parseFloat(o[1]),b=parseFloat(o[2]),x=parseFloat(o[3])):(S=vi(e,t,a),g=S.x,_=S.y,v=S.x,y=S.y,b=parseFloat(o[0]),x=parseFloat(o[1])),a&&(g+=m,_+=h,v+=m,y+=h,b+=m,x+=h),e.controls.right.set((g-e.x)*.33,(_-e.y)*.33),l=new V(b,x,v-b,y-x,void 0,void 0,R.curve),e=l,t=l.controls.left;break;case`a`:m=e.x,h=e.y,E=parseFloat(o[0]),D=parseFloat(o[1]),O=parseFloat(o[2]),k=parseFloat(o[3]),A=parseFloat(o[4]),b=parseFloat(o[5]),x=parseFloat(o[6]),a&&(b+=m,x+=h),T=new V(b,x),T.command=R.arc,T.rx=E,T.ry=D,T.xAxisRotation=O,T.largeArcFlag=k,T.sweepFlag=A,l=T,e=T,t=void 0}l&&(Array.isArray(l)?r=r.concat(l):r.push(l))})}n=new U(r,i,void 0,!0),n.stroke=`none`,n.fill=`black`;let o=n.getBoundingClientRect(!0);return o.centroid={x:o.left+o.width/2,y:o.top+o.height/2},H.each(n.vertices,function(e){e.subSelf(o.centroid)}),Ns.call(this,e,n,t),n.translation.addSelf(o.centroid),n},circle:function(e,t){let n=parseFloat(e.getAttribute(`cx`)),r=parseFloat(e.getAttribute(`cy`)),i=new To(0,0,parseFloat(e.getAttribute(`r`)));return i.stroke=`none`,i.fill=`black`,Ns.call(this,e,i,t),i.translation.x=n,i.translation.y=r,i},ellipse:function(e,t){let n=parseFloat(e.getAttribute(`cx`)),r=parseFloat(e.getAttribute(`cy`)),i=new Ao(0,0,parseFloat(e.getAttribute(`rx`)),parseFloat(e.getAttribute(`ry`)));return i.stroke=`none`,i.fill=`black`,Ns.call(this,e,i,t),i.translation.x=n,i.translation.y=r,i},rect:function(e,t){let n=parseFloat(e.getAttribute(`rx`)),r=parseFloat(e.getAttribute(`ry`));if(!H.isNaN(n)||!H.isNaN(r))return Is[`rounded-rect`](e);let i=parseFloat(e.getAttribute(`width`)),a=parseFloat(e.getAttribute(`height`)),o=i/2,s=a/2,c=new fo(0,0,i,a);return c.stroke=`none`,c.fill=`black`,Ns.call(this,e,c,t),c.translation.x+=o,c.translation.y+=s,c},"rounded-rect":function(e,t){let n=parseFloat(e.getAttribute(`rx`))||0,r=parseFloat(e.getAttribute(`ry`))||0,i=parseFloat(e.getAttribute(`width`)),a=parseFloat(e.getAttribute(`height`)),o=i/2,s=a/2,c=new Uo(0,0,i,a,new B(n,r));return c.stroke=`none`,c.fill=`black`,Ns.call(this,e,c,t),c.translation.x+=o,c.translation.y+=s,c},line:function(e,t){let n=new ys(parseFloat(e.getAttribute(`x1`)),parseFloat(e.getAttribute(`y1`)),parseFloat(e.getAttribute(`x2`)),parseFloat(e.getAttribute(`y2`))).noFill();return Ns.call(this,e,n,t),n},lineargradient:function(e,t){let n=e.getAttribute(`gradientUnits`),r=e.getAttribute(`spreadMethod`);n||=`objectBoundingBox`,r||=`pad`;let i=parseFloat(e.getAttribute(`x1`)||0),a=parseFloat(e.getAttribute(`y1`)||0),o=parseFloat(e.getAttribute(`x2`)||0),s=parseFloat(e.getAttribute(`y2`)||0),c=(o+i)/2,l=(s+a)/2;/userSpaceOnUse/i.test(n)&&(i-=c,a-=l,o-=c,s-=l);let u=[];for(let t=0;t<e.children.length;t++){let n=e.children[t],r=n.getAttribute(`offset`);/%/gi.test(r)&&(r=parseFloat(r.replace(/%/gi,``))/100),r=parseFloat(r);let i=n.getAttribute(`stop-color`),a=n.getAttribute(`stop-opacity`),o=n.getAttribute(`style`),s;i===null&&(s=o?o.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,i=s&&s.length>1?s[1]:void 0),a===null?(s=o?o.match(/stop-opacity:\s?([0-9.-]*)/):!1,a=s&&s.length>1?parseFloat(s[1]):1):a=parseFloat(a),u.push(new Hi(r,i,a))}let d=new Zi(i,a,o,s,u);return d.spread=r,d.units=n,Ns.call(this,e,d,t),d},radialgradient:function(e,t){let n=e.getAttribute(`gradientUnits`),r=e.getAttribute(`spreadMethod`);n||=`objectBoundingBox`,r||=`pad`;let i=parseFloat(e.getAttribute(`cx`))||0,a=parseFloat(e.getAttribute(`cy`))||0,o=parseFloat(e.getAttribute(`r`)),s=parseFloat(e.getAttribute(`fx`)),c=parseFloat(e.getAttribute(`fy`));H.isNaN(s)&&(s=i),H.isNaN(c)&&(c=a);let l=Math.abs(i+s)/2,u=Math.abs(a+c)/2;/userSpaceOnUse/i.test(n)&&(i-=l,a-=u,s-=l,c-=u);let d=[];for(let t=0;t<e.children.length;t++){let n=e.children[t],r=n.getAttribute(`offset`);/%/gi.test(r)&&(r=parseFloat(r.replace(/%/gi,``))/100),r=parseFloat(r);let i=n.getAttribute(`stop-color`),a=n.getAttribute(`stop-opacity`),o=n.getAttribute(`style`),s;i===null&&(s=o?o.match(/stop-color:\s?([#a-fA-F0-9]*)/):!1,i=s&&s.length>1?s[1]:void 0),a===null?(s=o?o.match(/stop-opacity:\s?([0-9.-]*)/):!1,a=s&&s.length>1?parseFloat(s[1]):1):a=parseFloat(a),d.push(new Hi(r,i,a))}let f=new ta(i,a,o,d,s,c);return f.spread=r,f.units=n,Ns.call(this,e,f,t),f},text:function(e,t){let n=Ts(e.getAttribute(`text-anchor`))||`left`,r=Es(e)||`baseline`,i=``;i=e.childNodes.length>0&&e.childNodes[0].tagName===`TSPAN`?e.childNodes[0].textContent:e.textContent;let a=new ts(i);return Ns.call(this,e,a,t),a.alignment=n,a.baseline=r,a},clippath:function(e,t){return Is.defs.current&&!Is.defs.current.contains(e.id)&&Is.defs.current.add(e.id,e),null},image:function(e,t){let n,r=e.getAttribute(`href`)||e.getAttribute(`xlink:href`);if(!r)return n=new wi(`encountered <image /> with no href.`),console.warn(n.name,n.message),null;let i=parseFloat(e.getAttribute(`x`))||0,a=parseFloat(e.getAttribute(`y`))||0,o=parseFloat(e.getAttribute(`width`)),s=parseFloat(e.getAttribute(`height`)),c=new ho(r,i,a);return H.isNaN(o)||(c.width=o),H.isNaN(s)||(c.height=s),Ns.call(this,e,c,t),c}};function Ls(e,t){let n=new XMLHttpRequest;return n.open(`GET`,e),n.onreadystatechange=function(){n.readyState===4&&n.status===200&&t(n.responseText)},n.send(),n}var Rs=class e extends fo{constructor(e,t,n,r,i,a){super(t,n,r||1,i||1),L(this,`_flagTexture`,!1),L(this,`_flagMode`,!1),L(this,`_texture`,null),L(this,`_mode`,`fill`),this._renderer.type=`image`;for(let e in Bs)Object.defineProperty(this,e,Bs[e]);this.noStroke(),this.noFill(),e instanceof Li?this.texture=e:typeof e==`string`&&(this.texture=new Li(e)),typeof a==`string`&&(this.mode=a),this._update()}static fromObject(t){let n=new e().copy(t);return`id`in t&&(n.id=t.id),n}copy(t){super.copy.call(this,t);for(let n=0;n<e.Properties.length;n++){let r=e.Properties[n];r in t&&(this[r]=t[r])}return this}clone(t){let n=new e(this.texture,this.translation.x,this.translation.y,this.width,this.height);return t&&t.add(n),n}toObject(){let e=super.toObject.call(this);return e.renderer.type=`image`,e.texture=this.texture.toObject(),e.mode=this.mode,e}dispose(){return super.dispose(),this._texture&&typeof this._texture.dispose==`function`?this._texture.dispose():this._texture&&typeof this._texture.unbind==`function`&&this._texture.unbind(),this}_update(){let t=this._texture;if(t&&(this._flagTexture&&(this.fill=t),t.loaded)){let n=t.image.width,r=t.image.height,i=this.width,a=this.height,o=i/n,s=a/r;switch(this._mode){case e.Modes.fill:t.scale=Math.max(o,s),t.offset.x=0,t.offset.y=0,t.repeat=`repeat`;break;case e.Modes.fit:t.scale=Math.min(o,s),t.offset.x=0,t.offset.y=0,t.repeat=`no-repeat`;break;case e.Modes.crop:break;case e.Modes.tile:t.offset.x=(n-i)/2,t.offset.y=(r-a)/2,t.repeat=`repeat`;break;case e.Modes.stretch:default:t.scale=new B(o,s),t.offset.x=0,t.offset.y=0,t.repeat=`repeat`}}return super._update.call(this),this}flagReset(){return super.flagReset.call(this),this._flagTexture=this._flagMode=!1,this}};L(Rs,`Modes`,{fill:`fill`,fit:`fit`,crop:`crop`,tile:`tile`,stretch:`stretch`}),L(Rs,`Properties`,[`texture`,`mode`]);var zs=Rs,Bs={texture:{enumerable:!0,get:function(){return this._texture},set:function(e){this._texture=e,this._flagTexture=!0}},mode:{enumerable:!0,get:function(){return this._mode},set:function(e){this._mode=e,this._flagMode=!0}}},Vs=[],Hs=Math.max,Us=Math.min,Ws=Math.abs,Gs=Math.sin,Ks=Math.cos,qs=Math.acos,Js=Math.sqrt,Ys={isHidden:/(undefined|none|transparent)/i,alignments:{left:`start`,middle:`center`,right:`end`},baselines:{top:`top`,middle:`middle`,bottom:`bottom`,baseline:`alphabetic`},getRendererType:function(e){return e in Ys?e:`path`},group:{renderChild:function(e){Ys[Ys.getRendererType(e._renderer.type)].render.call(e,this.ctx,!0,this.clip)},render:function(e){if(!this._visible)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let t=this._matrix.elements,n=this.parent;this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let r=this._mask,i=$s(t),a=!i||!!r;if(this._renderer.context||(this._renderer.context={}),this._renderer.context.ctx=e,a&&(e.save(),i||e.transform(t[0],t[3],t[1],t[4],t[2],t[5])),r&&Ys[Ys.getRendererType(r._renderer.type)].render.call(r,e,!0),this._opacity>0&&this._scale!==0)for(let t=0;t<this.children.length;t++){let n=this.children[t];Ys[Ys.getRendererType(n._renderer.type)].render.call(n,e)}return a&&e.restore(),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(e,t,n){let r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,ee,te,ne,j,M,re;if(re=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,ee=this._mask,te=this._clip,s=this._opacity*(re||1),c=this._visible,!t&&(!c||te||s===0))return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,i=this._stroke,a=this._linewidth,o=this._fill,l=this._cap,u=this._join,d=this._miter,f=this._renderer.closed,p=this._renderer.vertices,m=p.length,h=m-1,ne=$s(r),M=this.dashes,ne||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),ee&&Ys[Ys.getRendererType(ee._renderer.type)].render.call(ee,e,!0),o&&(typeof o==`string`?e.fillStyle=o:(Ys[Ys.getRendererType(o._renderer.type)].render.call(o,e,this),e.fillStyle=o._renderer.effect)),i&&(typeof i==`string`?e.strokeStyle=i:(Ys[Ys.getRendererType(i._renderer.type)].render.call(i,e,this),e.strokeStyle=i._renderer.effect),a&&(e.lineWidth=ii(this)),d&&(e.miterLimit=d),u&&(e.lineJoin=u),!f&&l&&(e.lineCap=l)),typeof s==`number`&&(e.globalAlpha=s),M&&M.length>0&&(e.lineDashOffset=M.offset||0,e.setLineDash(M)),e.beginPath();let ie,ae,N,P,oe,se,ce;for(let t=0;t<m;t++)switch(v=p[t],k=v.x,A=v.y,v.command){case R.close:e.closePath();break;case R.arc:ie=v.rx,ae=v.ry,N=v.xAxisRotation,P=v.largeArcFlag,oe=v.sweepFlag,g=f?ei(t-1,m):Hs(t-1,0),_=p[g],se=_.x,ce=_.y,Ys.renderSvgArcCommand(e,se,ce,ie,ae,P,oe,N,k,A);break;case R.curve:g=f?ei(t-1,m):Math.max(t-1,0),_=p[g],T=_.controls&&_.controls.right||B.zero,E=v.controls&&v.controls.left||B.zero,_._relative?(C=T.x+_.x,w=T.y+_.y):(C=T.x,w=T.y),v._relative?(x=E.x+v.x,S=E.y+v.y):(x=E.x,S=E.y),e.bezierCurveTo(C,w,x,S,k,A),t>=h&&f&&(y=b,D=v.controls&&v.controls.right||B.zero,O=y.controls&&y.controls.left||B.zero,v._relative?(C=D.x+v.x,w=D.y+v.y):(C=D.x,w=D.y),y._relative?(x=O.x+y.x,S=O.y+y.y):(x=O.x,S=O.y),k=y.x,A=y.y,e.bezierCurveTo(C,w,x,S,k,A));break;case R.line:e.lineTo(k,A);break;case R.move:b=v,e.moveTo(k,A)}return f&&e.closePath(),!te&&!n&&(Ys.isHidden.test(o)||(j=o._renderer&&o._renderer.offset,j&&(e.save(),e.translate(-o._renderer.offset.x,-o._renderer.offset.y),e.scale(o._renderer.scale.x,o._renderer.scale.y)),e.fill(),j&&e.restore()),Ys.isHidden.test(i)||(j=i._renderer&&i._renderer.offset,j&&(e.save(),e.translate(-i._renderer.offset.x,-i._renderer.offset.y),e.scale(i._renderer.scale.x,i._renderer.scale.y),e.lineWidth=a/i._renderer.scale.x),e.stroke(),j&&e.restore())),ne||e.restore(),te&&!n&&e.clip(),M&&M.length>0&&e.setLineDash(Vs),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(e,t,n){let r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v;if(v=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,s=this._opacity*(v||1),c=this._visible,!t&&(!c||s===0))return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),r=this._matrix.elements,i=this._stroke,a=this._linewidth,o=this._fill,u=this._renderer.collection,d=u.length,h=$s(r),_=this.dashes,l=this._size,h||(e.save(),e.transform(r[0],r[3],r[1],r[4],r[2],r[5])),o&&(typeof o==`string`?e.fillStyle=o:(Ys[Ys.getRendererType(o._renderer.type)].render.call(o,e,this),e.fillStyle=o._renderer.effect)),i&&(typeof i==`string`?e.strokeStyle=i:(Ys[Ys.getRendererType(i._renderer.type)].render.call(i,e,this),e.strokeStyle=i._renderer.effect),a&&(e.lineWidth=ii(this))),typeof s==`number`&&(e.globalAlpha=s),_&&_.length>0&&(e.lineDashOffset=_.offset||0,e.setLineDash(_)),e.beginPath();let y=l*.5,b;this._sizeAttenuation||(b=this.worldMatrix.elements,b=Jr(b[0],b[3],b[1],b[4],b[2],b[5]),y/=Math.max(b.scaleX,b.scaleY));for(let t=0;t<d;t++)f=u[t],p=f.x,m=f.y,e.moveTo(p+y,m),e.arc(p,m,y,0,Kr);return n||(Ys.isHidden.test(o)||(g=o._renderer&&o._renderer.offset,g&&(e.save(),e.translate(-o._renderer.offset.x,-o._renderer.offset.y),e.scale(o._renderer.scale.x,o._renderer.scale.y)),e.fill(),g&&e.restore()),Ys.isHidden.test(i)||(g=i._renderer&&i._renderer.offset,g&&(e.save(),e.translate(-i._renderer.offset.x,-i._renderer.offset.y),e.scale(i._renderer.scale.x,i._renderer.scale.y),e.lineWidth=a/i._renderer.scale.x),e.stroke(),g&&e.restore())),h||e.restore(),_&&_.length>0&&e.setLineDash(Vs),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(e,t,n){let r=this.parent&&this.parent._renderer?this.parent._renderer.opacity:1,i=this._opacity*r,a=this._visible,o=this._mask,s=this._clip;if(!t&&(!a||s||i===0))return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let c=this._matrix.elements,l=this._stroke,u=this._linewidth,d=this._fill,f=this._decoration,p=this._direction,m=$s(c),h=d._renderer&&d._renderer.offset&&l._renderer&&l._renderer.offset,g=this.dashes,_=Ys.alignments[this._alignment]||this._alignment,v=Ys.baselines[this._baseline]||this._baseline,y,b,x,S,C,w,T,E,D,O,k;if(m||(e.save(),e.transform(c[0],c[3],c[1],c[4],c[2],c[5])),o&&Ys[Ys.getRendererType(o._renderer.type)].render.call(o,e,!0),h||(e.font=[this._style,this._weight,this._size+`px/`+this._leading+`px`,this._family].join(` `)),e.textAlign=_,e.textBaseline=v,e.direction=p,d&&(typeof d==`string`?e.fillStyle=d:(Ys[Ys.getRendererType(d._renderer.type)].render.call(d,e,this),e.fillStyle=d._renderer.effect)),l&&(typeof l==`string`?e.strokeStyle=l:(Ys[Ys.getRendererType(l._renderer.type)].render.call(l,e,this),e.strokeStyle=l._renderer.effect),u&&(e.lineWidth=ii(this))),typeof i==`number`&&(e.globalAlpha=i),g&&g.length>0&&(e.lineDashOffset=g.offset||0,e.setLineDash(g)),!s&&!n&&(Ys.isHidden.test(d)||(d._renderer&&d._renderer.offset?(w=d._renderer.scale.x,T=d._renderer.scale.y,e.save(),e.translate(-d._renderer.offset.x,-d._renderer.offset.y),e.scale(w,T),y=this._size/d._renderer.scale.y,b=this._leading/d._renderer.scale.y,e.font=[this._style,this._weight,y+`px/`,b+`px`,this._family].join(` `),x=d._renderer.offset.x/d._renderer.scale.x,S=d._renderer.offset.y/d._renderer.scale.y,e.fillText(this.value,x,S),e.restore()):e.fillText(this.value,0,0)),Ys.isHidden.test(l)||(l._renderer&&l._renderer.offset?(w=l._renderer.scale.x,T=l._renderer.scale.y,e.save(),e.translate(-l._renderer.offset.x,-l._renderer.offset.y),e.scale(w,T),y=this._size/l._renderer.scale.y,b=this._leading/l._renderer.scale.y,e.font=[this._style,this._weight,y+`px/`,b+`px`,this._family].join(` `),x=l._renderer.offset.x/l._renderer.scale.x,S=l._renderer.offset.y/l._renderer.scale.y,C=u/l._renderer.scale.x,e.lineWidth=C,e.strokeText(this.value,x,S),e.restore()):e.strokeText(this.value,0,0))),/(underline|strikethrough)/i.test(f)){let t=e.measureText(this.value),n=1;switch(f){case`underline`:D=t.actualBoundingBoxDescent,k=t.actualBoundingBoxDescent;break;case`strikethrough`:D=0,k=0,n=.5}switch(v){case`top`:D+=this._size*n,k+=this._size*n;break;case`baseline`:case`bottom`:D-=this._size*n,k-=this._size*n}switch(_){case`left`:case`start`:E=0,O=t.width;break;case`right`:case`end`:E=-t.width,O=0;break;default:E=-t.width/2,O=t.width/2}e.lineWidth=Math.max(Math.floor(this._size/15),1),e.strokeStyle=e.fillStyle,e.beginPath(),e.moveTo(E,D),e.lineTo(O,k),e.stroke()}return m||e.restore(),s&&!n&&e.clip(),g&&g.length>0&&e.setLineDash(Vs),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(e,t){if(t){if(H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,i=this.left._y,a=this.right._x,o=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,i=(i-.5)*n.height,a=(a-.5)*n.width,o=(o-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,i,a,o);for(let e=0;e<this.stops.length;e++){let t=this.stops[e];this._renderer.effect.addColorStop(t._offset,t._color)}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(e,t){if(t){if(H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,i=this.center._y,a=this.focal._x,o=this.focal._y,s=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,i=(i-.5)*n.height*.5,a=(a-.5)*n.width*.5,o=(o-.5)*n.height*.5,s*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,i,0,a,o,s);for(let e=0;e<this.stops.length;e++){let t=this.stops[e];this._renderer.effect.addColorStop(t._offset,t._color)}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(e){H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let t=this.image;return(!this._renderer.effect||(this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)&&(this._renderer.effect=e.createPattern(this.image,this._repeat)),(this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof B||(this._renderer.offset=new B),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,t&&(this._renderer.offset.x+=t.width/2,this._renderer.offset.y+=t.height/2,this._scale instanceof B?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),(this._flagScale||this._flagLoaded)&&(this._renderer.scale instanceof B||(this._renderer.scale=new B),this._scale instanceof B?this._renderer.scale.copy(this._scale):this._renderer.scale.set(this._scale,this._scale)),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},renderSvgArcCommand:function(e,t,n,r,i,a,o,s,c,l){s=s*Math.PI/180,r=Ws(r),i=Ws(i);let u=(t-c)/2,d=(n-l)/2,f=Ks(s)*u+Gs(s)*d,p=-Gs(s)*u+Ks(s)*d,m=f*f,h=p*p,g=r*r,_=i*i,v=m/g+h/_;if(v>1){let e=Js(v);r=e*r,i=e*i,g=r*r,_=i*i}let y=g*h+_*m,b=Js(Hs(0,(g*_-y)/y));a===o&&(b=-b);let x=b*r*p/i,S=-b*i*f/r,C=Ks(s)*x-Gs(s)*S+(t+c)/2,w=Gs(s)*x+Ks(s)*S+(n+l)/2,T=Qs(1,0,(f-x)/r,(p-S)/i),E=T+Qs((f-x)/r,(p-S)/i,(-f-x)/r,(-p-S)/i)%Kr;Zs(e,C,w,r,i,T,E,o===0,s)}},Xs=class extends z{constructor(e){super();let t=e.smoothing!==!1;this.domElement=e.domElement||document.createElement(`canvas`),this.ctx=this.domElement.getContext(`2d`),this.overdraw=e.overdraw||!1,this.ctx.imageSmoothingEnabled!==void 0&&(this.ctx.imageSmoothingEnabled=t),this.scene=new gs,this.scene.parent=this}setSize(e,t,n){return this.width=e,this.height=t,this.ratio=n===void 0?Di(this.ctx):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,this.domElement.style&&H.extend(this.domElement.style,{width:e+`px`,height:t+`px`}),this.trigger(z.Types.resize,e,t,n)}render(){let e=this.ratio===1;return e||(this.ctx.save(),this.ctx.scale(this.ratio,this.ratio)),this.overdraw||this.ctx.clearRect(0,0,this.width,this.height),Ys.group.render.call(this.scene,this.ctx),e||this.ctx.restore(),this}};L(Xs,`Utils`,Ys);function Zs(e,t,n,r,i,a,o,s,c){let l=o-a,u=ui.Tolerance.epsilon,d=Math.abs(l)<u,f=ei(l,Kr);f<u&&(f=d?0:Kr),s===!0&&!d&&(f===Kr?f=-Kr:f-=Kr);for(let o=0;o<li.Resolution;o++){let s=a+o/(li.Resolution-1)*f,l=t+r*Math.cos(s),u=n+i*Math.sin(s);if(c!==0){let e=Math.cos(c),r=Math.sin(c),i=l-t,a=u-n;l=i*e-a*r+t,u=i*r+a*e+n}e.lineTo(l,u)}}function Qs(e,t,n,r){let i=qs(Hs(-1,Us(1,(e*n+t*r)/(Js(e*e+t*t)*Js(n*n+r*r)))));return e*r-t*n<0&&(i=-i),i}function $s(e){return e[0]===1&&e[3]===0&&e[1]===0&&e[4]===1&&e[2]===0&&e[5]===0}var W={version:1.1,ns:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,alignments:{left:`start`,center:`middle`,right:`end`},baselines:{top:`hanging`,middle:`middle`,bottom:`ideographic`,baseline:`alphabetic`},createElement:function(e,t){let n=e,r=document.createElementNS(W.ns,n);return n===`svg`&&(t=H.defaults(t||{},{version:W.version})),t&&Object.keys(t).length>0&&W.setAttributes(r,t),r},setAttributes:function(e,t){let n=Object.keys(t);for(let r=0;r<n.length;r++)/href/.test(n[r])?e.setAttributeNS(W.xlink,n[r],t[n[r]]):e.setAttribute(n[r],t[n[r]]);return this},removeAttributes:function(e,t){for(let n in t)e.removeAttribute(n);return this},toString:function(e,t){let n=e.length,r=n-1,i,a=``;for(let o=0;o<n;o++){let s=e[o],c=e[t?ei(o-1,n):Math.max(o-1,0)],l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w=ri(s.x),T=ri(s.y);switch(s.command){case R.close:l=R.close;break;case R.arc:y=s.rx,b=s.ry,x=s.xAxisRotation,S=s.largeArcFlag,C=s.sweepFlag,l=R.arc+` `+y+` `+b+` `+x+` `+S+` `+C+` `+w+` `+T;break;case R.curve:h=c.controls&&c.controls.right||B.zero,g=s.controls&&s.controls.left||B.zero,c.relative?(d=ri(h.x+c.x),f=ri(h.y+c.y)):(d=ri(h.x),f=ri(h.y)),s.relative?(p=ri(g.x+s.x),m=ri(g.y+s.y)):(p=ri(g.x),m=ri(g.y)),l=(o===0?R.move:R.curve)+` `+d+` `+f+` `+p+` `+m+` `+w+` `+T;break;case R.move:i=s,l=R.move+` `+w+` `+T;break;default:l=s.command+` `+w+` `+T}o>=r&&t&&(s.command===R.curve&&(u=i,_=s.controls&&s.controls.right||s,v=u.controls&&u.controls.left||u,s.relative?(d=ri(_.x+s.x),f=ri(_.y+s.y)):(d=ri(_.x),f=ri(_.y)),u.relative?(p=ri(v.x+u.x),m=ri(v.y+u.y)):(p=ri(v.x),m=ri(v.y)),w=ri(u.x),T=ri(u.y),l+=` C `+d+` `+f+` `+p+` `+m+` `+w+` `+T),s.command!==R.close&&(l+=` Z`)),a+=l+` `}return a},pointsToString:function(e,t){let n=``,r=t*.5;for(let t=0;t<e.length;t++){let i=e[t].x,a=e[t].y-r;n+=R.move+` `+i+` `+a+` `,n+=`a `+r+` `+r+` 0 1 0 0.001 0 Z`}return n},getClip:function(e,t){let n=e._renderer.clip;return n||=e._renderer.clip=W.createElement(`clipPath`,{"clip-rule":`nonzero`}),n.parentNode===null&&t.defs.appendChild(n),n},getRendererType:function(e){return e in W?e:`path`},defs:{update:function(e){let{defs:t}=e;if(t._flagUpdate){let n=Array.prototype.slice.call(t.children,0);for(let r=0;r<n.length;r++){let i=n[r],a=i.id,o=`[fill="url(#${a})"],[stroke="url(#${a})"],[clip-path="url(#${a})"]`;e.querySelector(o)||t.removeChild(i)}t._flagUpdate=!1}}},group:{appendChild:function(e){let t=e._renderer.elem;if(!t)return;let n=t.nodeName;!n||/(radial|linear)gradient/i.test(n)||e._clip||this.elem.appendChild(t)},removeChild:function(e){let t=e._renderer.elem;t&&t.parentNode==this.elem&&t.nodeName&&(e._clip||this.elem.removeChild(t))},orderChild:function(e){this.elem.appendChild(e._renderer.elem)},renderChild:function(e){W[W.getRendererType(e._renderer.type)].render.call(e,this)},render:function(e){if(!this._visible&&!this._flagVisible||this._opacity===0&&!this._flagOpacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),this._renderer.elem||(this._renderer.elem=W.createElement(`g`,{id:this.id}),e.appendChild(this._renderer.elem));let t=this._matrix.manual||this._flagMatrix,n={domElement:e,elem:this._renderer.elem};t&&this._renderer.elem.setAttribute(`transform`,`matrix(`+this._matrix.toString()+`)`);for(let t=0;t<this.children.length;t++){let n=this.children[t];W[W.getRendererType(n._renderer.type)].render.call(n,e)}return this._flagId&&this._renderer.elem.setAttribute(`id`,this._id),this._flagOpacity&&this._renderer.elem.setAttribute(`opacity`,this._opacity),this._flagVisible&&this._renderer.elem.setAttribute(`display`,this._visible?`inline`:`none`),this._flagClassName&&this._renderer.elem.setAttribute(`class`,this.classList.join(` `)),this._flagAdditions&&this.additions.forEach(W.group.appendChild,n),this._flagSubtractions&&this.subtractions.forEach(W.group.removeChild,n),this._flagOrder&&this.children.forEach(W.group.orderChild,n),this._flagMask&&(this._mask?(W[W.getRendererType(this._mask._renderer.type)].render.call(this._mask,e),this._renderer.elem.setAttribute(`clip-path`,`url(#`+this._mask.id+`)`)):this._renderer.elem.removeAttribute(`clip-path`)),this.dataset&&Object.assign(this._renderer.elem.dataset,this.dataset),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform=`matrix(`+this._matrix.toString()+`)`),this._flagId&&(t.id=this._id),this._flagVertices&&(t.d=W.toString(this._renderer.vertices,this._renderer.closed)),this._fill&&this._fill._renderer&&(this._renderer.hasFillEffect=!0,this._fill._update(),W[W.getRendererType(this._fill._renderer.type)].render.call(this._fill,e,!0)),this._flagFill&&(t.fill=this._fill&&this._fill.id?`url(#`+this._fill.id+`)`:this._fill,this._renderer.hasFillEffect&&this._fill.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer&&(this._renderer.hasStrokeEffect=!0,this._stroke._update(),W[W.getRendererType(this._stroke._renderer.type)].render.call(this._stroke,e,!0)),this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?`url(#`+this._stroke.id+`)`:this._stroke,this._renderer.hasStrokeEffect&&this._stroke.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t[`stroke-width`]=ii(this)),this._flagOpacity&&(t[`stroke-opacity`]=this._opacity,t[`fill-opacity`]=this._opacity),this._flagClassName&&(t.class=this.classList.join(` `)),this._flagVisible&&(t.visibility=this._visible?`visible`:`hidden`),this._flagCap&&(t[`stroke-linecap`]=this._cap),this._flagJoin&&(t[`stroke-linejoin`]=this._join),this._flagMiter&&(t[`stroke-miterlimit`]=this._miter),this.dashes&&this.dashes.length>0&&(t[`stroke-dasharray`]=this.dashes.join(` `),t[`stroke-dashoffset`]=this.dashes.offset||0),this._renderer.elem?W.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=W.createElement(`path`,t),e.appendChild(this._renderer.elem)),this._flagClip){let t=W.getClip(this,e),n=this._renderer.elem;this._clip?(n.removeAttribute(`id`),t.setAttribute(`id`,this.id),t.appendChild(n)):(t.removeAttribute(`id`),n.setAttribute(`id`,this.id),this.parent._renderer.elem.appendChild(n))}return this._flagMask&&(this._mask?(W[W.getRendererType(this._mask._renderer.type)].render.call(this._mask,e),this._renderer.elem.setAttribute(`clip-path`,`url(#`+this._mask.id+`)`)):this._renderer.elem.removeAttribute(`clip-path`)),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{render:function(e){if(this._opacity===0&&!this._flagOpacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform=`matrix(`+this._matrix.toString()+`)`),this._flagId&&(t.id=this._id),this._flagVertices||this._flagSize||this._flagSizeAttenuation){let e=this._size;if(!this._sizeAttenuation){let t=this.worldMatrix.elements,n=Jr(t[0],t[3],t[1],t[4],t[2],t[5]);e/=Math.max(n.scaleX,n.scaleY)}t.d=W.pointsToString(this._renderer.collection,e)}return this._fill&&this._fill._renderer&&(this._renderer.hasFillEffect=!0,this._fill._update(),W[W.getRendererType(this._fill._renderer.type)].render.call(this._fill,e,!0)),this._flagFill&&(t.fill=this._fill&&this._fill.id?`url(#`+this._fill.id+`)`:this._fill,this._renderer.hasFillEffect&&this._fill.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer&&(this._renderer.hasStrokeEffect=!0,this._stroke._update(),W[W.getRendererType(this._stroke._renderer.type)].render.call(this._stroke,e,!0)),this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?`url(#`+this._stroke.id+`)`:this._stroke,this._renderer.hasStrokeEffect&&this._stroke.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t[`stroke-width`]=ii(this)),this._flagOpacity&&(t[`stroke-opacity`]=this._opacity,t[`fill-opacity`]=this._opacity),this._flagClassName&&(t.class=this.classList.join(` `)),this._flagVisible&&(t.visibility=this._visible?`visible`:`hidden`),this.dashes&&this.dashes.length>0&&(t[`stroke-dasharray`]=this.dashes.join(` `),t[`stroke-dashoffset`]=this.dashes.offset||0),this._renderer.elem?W.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=W.createElement(`path`,t),e.appendChild(this._renderer.elem)),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},text:{render:function(e){this._update();let t={};if((this._matrix.manual||this._flagMatrix)&&(t.transform=`matrix(`+this._matrix.toString()+`)`),this._flagId&&(t.id=this._id),this._flagFamily&&(t[`font-family`]=this._family),this._flagSize&&(t[`font-size`]=this._size),this._flagLeading&&(t[`line-height`]=this._leading),this._flagAlignment&&(t[`text-anchor`]=W.alignments[this._alignment]||this._alignment),this._flagBaseline&&(t[`dominant-baseline`]=W.baselines[this._baseline]||this._baseline),this._flagStyle&&(t[`font-style`]=this._style),this._flagWeight&&(t[`font-weight`]=this._weight),this._flagDecoration&&(t[`text-decoration`]=this._decoration),this._flagDirection&&(t.direction=this._direction),this._fill&&this._fill._renderer&&(this._renderer.hasFillEffect=!0,this._fill._update(),W[W.getRendererType(this._fill._renderer.type)].render.call(this._fill,e,!0)),this._flagFill&&(t.fill=this._fill&&this._fill.id?`url(#`+this._fill.id+`)`:this._fill,this._renderer.hasFillEffect&&this._fill.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasFillEffect)),this._stroke&&this._stroke._renderer&&(this._renderer.hasStrokeEffect=!0,this._stroke._update(),W[W.getRendererType(this._stroke._renderer.type)].render.call(this._stroke,e,!0)),this._flagStroke&&(t.stroke=this._stroke&&this._stroke.id?`url(#`+this._stroke.id+`)`:this._stroke,this._renderer.hasStrokeEffect&&this._stroke.id===void 0&&(e.defs._flagUpdate=!0,delete this._renderer.hasStrokeEffect)),this._flagLinewidth&&(t[`stroke-width`]=ii(this)),this._flagOpacity&&(t.opacity=this._opacity),this._flagClassName&&(t.class=this.classList.join(` `)),this._flagVisible&&(t.visibility=this._visible?`visible`:`hidden`),this.dashes&&this.dashes.length>0&&(t[`stroke-dasharray`]=this.dashes.join(` `),t[`stroke-dashoffset`]=this.dashes.offset||0),this._renderer.elem?W.setAttributes(this._renderer.elem,t):(t.id=this._id,this._renderer.elem=W.createElement(`text`,t),e.appendChild(this._renderer.elem)),this._flagClip){let t=W.getClip(this,e),n=this._renderer.elem;this._clip?(n.removeAttribute(`id`),t.setAttribute(`id`,this.id),t.appendChild(n)):(t.removeAttribute(`id`),n.setAttribute(`id`,this.id),this.parent._renderer.elem.appendChild(n))}return this._flagMask&&(this._mask?(W[W.getRendererType(this._mask._renderer.type)].render.call(this._mask,e),this._renderer.elem.setAttribute(`clip-path`,`url(#`+this._mask.id+`)`)):this._renderer.elem.removeAttribute(`clip-path`)),this._flagValue&&(this._renderer.elem.textContent=this._value),this.flagReset()}},"linear-gradient":{render:function(e,t){H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),t||this._update();let n={};if(this._flagId&&(n.id=this._id),this._flagEndPoints&&(n.x1=this.left._x,n.y1=this.left._y,n.x2=this.right._x,n.y2=this.right._y),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?W.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=W.createElement(`linearGradient`,n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){let e=this._renderer.elem.childNodes.length!==this.stops.length;if(e)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let t=0;t<this.stops.length;t++){let n=this.stops[t],r={};n._flagOffset&&(r.offset=100*n._offset+`%`),n._flagColor&&(r[`stop-color`]=n._color),n._flagOpacity&&(r[`stop-opacity`]=n._opacity),n._renderer.elem?W.setAttributes(n._renderer.elem,r):n._renderer.elem=W.createElement(`stop`,r),e&&this._renderer.elem.appendChild(n._renderer.elem),n.flagReset()}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"radial-gradient":{render:function(e,t){H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),t||this._update();let n={};if(this._flagId&&(n.id=this._id),this._flagCenter&&(n.cx=this.center._x,n.cy=this.center._y),this._flagFocal&&(n.fx=this.focal._x,n.fy=this.focal._y),this._flagRadius&&(n.r=this._radius),this._flagSpread&&(n.spreadMethod=this._spread),this._flagUnits&&(n.gradientUnits=this._units),this._renderer.elem?W.setAttributes(this._renderer.elem,n):(n.id=this._id,this._renderer.elem=W.createElement(`radialGradient`,n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._flagStops){let e=this._renderer.elem.childNodes.length!==this.stops.length;if(e)for(;this._renderer.elem.lastChild;)this._renderer.elem.removeChild(this._renderer.elem.lastChild);for(let t=0;t<this.stops.length;t++){let n=this.stops[t],r={};n._flagOffset&&(r.offset=100*n._offset+`%`),n._flagColor&&(r[`stop-color`]=n._color),n._flagOpacity&&(r[`stop-opacity`]=n._opacity),n._renderer.elem?W.setAttributes(n._renderer.elem,r):n._renderer.elem=W.createElement(`stop`,r),e&&this._renderer.elem.appendChild(n._renderer.elem),n.flagReset()}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},texture:{render:function(e,t){H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),t||this._update();let n={},r={x:0,y:0},i=this.image;if(this._flagId&&(n.id=this._id),this._flagLoaded&&this.loaded)switch(i.nodeName.toLowerCase()){case`canvas`:r.href=r[`xlink:href`]=i.toDataURL(`image/png`);break;case`img`:case`image`:r.href=r[`xlink:href`]=this.src}return(this._flagOffset||this._flagLoaded||this._flagScale)&&(n.x=this._offset.x,n.y=this._offset.y,i&&(n.x-=i.width/2,n.y-=i.height/2,this._scale instanceof B?(n.x*=this._scale.x,n.y*=this._scale.y):(n.x*=this._scale,n.y*=this._scale)),n.x>0&&(n.x*=-1),n.y>0&&(n.y*=-1)),(this._flagScale||this._flagLoaded||this._flagRepeat)&&(n.width=0,n.height=0,i)&&(n.width=i.width,n.height=i.height,this._repeat===`no-repeat`&&(n.width+=1,n.height+=1),this._scale instanceof B?(n.width*=this._scale.x,n.height*=this._scale.y):(n.width*=this._scale,n.height*=this._scale),r.preserveAspectRatio=/no-repeat/i.test(this._repeat)?`xMidYMid`:`none`,r.width=n.width,r.height=n.height),(this._flagScale||this._flagLoaded)&&(this._renderer.image?W.setAttributes(this._renderer.image,r):this._renderer.image=W.createElement(`image`,r)),this._renderer.elem?Object.keys(n).length!==0&&W.setAttributes(this._renderer.elem,n):(n.id=this._id,n.patternUnits=`userSpaceOnUse`,this._renderer.elem=W.createElement(`pattern`,n)),this._renderer.elem.parentNode===null&&e.defs.appendChild(this._renderer.elem),this._renderer.elem&&this._renderer.image&&!this._renderer.appended&&(this._renderer.elem.appendChild(this._renderer.image),this._renderer.appended=!0),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},ec=class extends z{constructor(e){super(),this.domElement=e.domElement||W.createElement(`svg`),this.scene=new gs,this.scene.parent=this,this.defs=W.createElement(`defs`),this.defs._flagUpdate=!1,this.domElement.appendChild(this.defs),this.domElement.defs=this.defs,this.domElement.style.overflow=`hidden`}setSize(e,t){return this.width=e,this.height=t,W.setAttributes(this.domElement,{width:e,height:t}),this.trigger(z.Types.resize,e,t)}render(){return W.group.render.call(this.scene,this.domElement),W.defs.update(this.domElement),this}};L(ec,`Utils`,W);var tc={create:function(e,t,n){let r=e.createShader(e[n]);if(e.shaderSource(r,t),e.compileShader(r),!e.getShaderParameter(r,e.COMPILE_STATUS)){let t=e.getShaderInfoLog(r);throw e.deleteShader(r),new wi(`unable to compile shader `+r+`: `+t)}return r},types:{vertex:`VERTEX_SHADER`,fragment:`FRAGMENT_SHADER`},path:{vertex:`
5
5
  precision mediump float;
6
6
  attribute vec2 a_position;
7
7
 
@@ -64,26 +64,26 @@
64
64
  }
65
65
  gl_FragColor = texel;
66
66
  }
67
- `}},tc=ma.Multiply,nc=[1,0,0,0,1,0,0,0,1],rc=new ei(9),ic=Ys.Utils,ac=new B,oc=new ei([0,0,1,0,0,1,0,1,1,0,1,1]),G={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Ur.document?Ur.document.createElement(`canvas`):{getContext:function(){}},alignments:{left:`start`,middle:`center`,right:`end`},matrix:new ma,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)G.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,i=this._matrix.manual||this._flagMatrix;(r||i)&&(this._renderer.matrix||(this._renderer.matrix=new ei(9)),this._matrix.toTransformArray(!0,rc),tc(rc,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof B||(this._renderer.scale=new B),this._scale instanceof B?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask&&(e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1),G[Ys.Utils.getRendererType(this._mask._renderer.type)].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)),this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let a;if(this._flagSubtractions)for(a=0;a<this.subtractions.length;a++)G.group.removeChild(this.subtractions[a],e);for(a=0;a<this.children.length;a++){let n=this.children[a];G[Ys.Utils.getRendererType(n._renderer.type)].render.call(n,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=t._renderer.vertices,_=this.canvas,v=this.ctx,y=e.renderer.ratio,b=ac.copy(t._renderer.scale).multiply(y),x=t._stroke,S=t._linewidth,C=t._fill,w=t._renderer.opacity||t._opacity,T=t._cap,E=t._join,D=t._miter,O=t._renderer.closed,k=t.dashes,A=g.length,ee=A-1;_.width=Math.max(Math.ceil(t._renderer.rect.width*b.x),1),_.height=Math.max(Math.ceil(t._renderer.rect.height*b.y),1);let j=t._renderer.rect.centroid,te=j.x,ne=j.y;v.clearRect(0,0,_.width,_.height),C&&(typeof C==`string`?v.fillStyle=C:(G[Ys.Utils.getRendererType(C._renderer.type)].render.call(C,v,t),v.fillStyle=C._renderer.effect)),x&&(typeof x==`string`?v.strokeStyle=x:(G[Ys.Utils.getRendererType(x._renderer.type)].render.call(x,v,t),v.strokeStyle=x._renderer.effect),S&&(v.lineWidth=ri(t)),D&&(v.miterLimit=D),E&&(v.lineJoin=E),!O&&T&&(v.lineCap=T)),typeof w==`number`&&(v.globalAlpha=w),k&&k.length>0&&(v.lineDashOffset=k.offset||0,v.setLineDash(k));let M,re,ie,N,P,F,ae,oe;v.save(),v.scale(b.x,b.y),v.translate(te,ne),v.beginPath();for(let e=0;e<g.length;e++){let t=g[e];switch(p=t.x,m=t.y,t.command){case R.close:v.closePath();break;case R.arc:re=t.rx,ie=t.ry,N=t.xAxisRotation,P=t.largeArcFlag,F=t.sweepFlag,n=O?$r(e-1,A):Math.max(e-1,0),r=g[n],ae=r.x,oe=r.y,ic.renderSvgArcCommand(v,ae,oe,re,ie,P,F,N,p,m);break;case R.curve:n=O?$r(e-1,A):Math.max(e-1,0),r=g[n],l=r.controls&&r.controls.right||B.zero,u=t.controls&&t.controls.left||B.zero,r._relative?(s=l.x+r.x,c=l.y+r.y):(s=l.x,c=l.y),t._relative?(a=u.x+t.x,o=u.y+t.y):(a=u.x,o=u.y),v.bezierCurveTo(s,c,a,o,p,m),e>=ee&&O&&(i=M,d=t.controls&&t.controls.right||B.zero,f=i.controls&&i.controls.left||B.zero,t._relative?(s=d.x+t.x,c=d.y+t.y):(s=d.x,c=d.y),i._relative?(a=f.x+i.x,o=f.y+i.y):(a=f.x,o=f.y),p=i.x,m=i.y,v.bezierCurveTo(s,c,a,o,p,m));break;case R.line:v.lineTo(p,m);break;case R.move:M=t,v.moveTo(p,m)}}O&&v.closePath(),G.isHidden.test(C)||(h=C._renderer&&C._renderer.offset,h&&(v.save(),v.translate(-C._renderer.offset.x,-C._renderer.offset.y),v.scale(C._renderer.scale.x,C._renderer.scale.y)),v.fill(),h&&v.restore()),G.isHidden.test(x)||(h=x._renderer&&x._renderer.offset,h&&(v.save(),v.translate(-x._renderer.offset.x,-x._renderer.offset.y),v.scale(x._renderer.scale.x,x._renderer.scale.y),v.lineWidth=S/x._renderer.scale.x),v.stroke(),h&&v.restore()),v.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,i=-1/0,a=1/0,o=-1/0,s,c;e.forEach(function(e){let t=e.x,n=e.y,s=e.controls,c,l,u,d,f,p;a=Math.min(n,a),r=Math.min(t,r),i=Math.max(t,i),o=Math.max(n,o),e.controls&&(f=s.left,p=s.right,f&&p&&(c=e._relative?f.x+t:f.x,l=e._relative?f.y+n:f.y,u=e._relative?p.x+t:p.x,d=e._relative?p.y+n:p.y,c&&l&&u&&d&&(a=Math.min(l,d,a),r=Math.min(c,u,r),i=Math.max(c,u,i),o=Math.max(l,d,o))))}),typeof t==`number`&&(a-=t,r-=t,i+=t,o+=t),s=i-r,c=o-a,n.top=a,n.left=r,n.right=i,n.bottom=o,n.width=s,n.height=c,n.centroid||={},n.centroid.x=-r,n.centroid.y=-a},render:function(e,t,n){if(!this._visible||!this._opacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=n||this.parent,i=t[Ys.Utils.getRendererType(this._renderer.type)],a=r._matrix.manual||r._flagMatrix,o=this._matrix.manual||this._flagMatrix,s=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Xi&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof ea&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ii&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xi&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof ea&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ii&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||o||s){this._renderer.matrix||(this._renderer.matrix=new ei(9)),this._matrix.toTransformArray(!0,rc),tc(rc,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof B||(this._renderer.scale=new B);let e,t;this._scale instanceof B?(e=this._scale.x*r._renderer.scale.x,t=this._scale.y*r._renderer.scale.y):(e=this._scale*r._renderer.scale.x,t=this._scale*r._renderer.scale.y),this._renderer.scale.x=e<0?-e:e,this._renderer.scale.y=t<0?-t:t,s&&(this._renderer.parent=r)}if(this._mask&&(e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1),G[Ys.Utils.getRendererType(this._mask._renderer.type)].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)),c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,G.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),G.updateTexture.call(G,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==i&&(e.useProgram(i),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(i.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(i.position),e.bufferData(e.ARRAY_BUFFER,oc,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(i,`u_resolution`),t.resolution.width,t.resolution.height),t.current=i),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(i,`u_resolution`),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);let l=this._renderer.rect;return e.uniformMatrix3fv(i.matrix,!1,this._renderer.matrix),e.uniform4f(i.rect,l.left,l.top,l.right,l.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(e,t){let n,r=this.canvas,i=this.ctx,a=e.renderer.ratio,o=t._stroke,s=t._linewidth,c=t._fill,l=t._renderer.opacity||t._opacity,u=t.dashes,d=t._size*a,f=t._closed,p=d;G.isHidden.test(o)||(p+=s),r.width=Qr(p),r.height=r.width;let m=p/r.width,h=r.width/2,g=r.height/2;i.clearRect(0,0,r.width,r.height),c&&(typeof c==`string`?i.fillStyle=c:(G[Ys.Utils.getRendererType(c._renderer.type)].render.call(c,i,t),i.fillStyle=c._renderer.effect)),o&&(typeof o==`string`?i.strokeStyle=o:(G[Ys.Utils.getRendererType(o._renderer.type)].render.call(o,i,t),i.strokeStyle=o._renderer.effect),s&&(i.lineWidth=ri(t)/m)),typeof l==`number`&&(i.globalAlpha=l),u&&u.length>0&&(i.lineDashOffset=u.offset||0,i.setLineDash(u)),i.save(),i.translate(h,g),i.scale(G.precision,G.precision),i.beginPath(),i.arc(0,0,d/m*.5,0,Gr),i.restore(),f&&i.closePath(),G.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(i.save(),i.translate(-c._renderer.offset.x,-c._renderer.offset.y),i.scale(c._renderer.scale.x,c._renderer.scale.y)),i.fill(),n&&i.restore()),G.isHidden.test(o)||(n=o._renderer&&o._renderer.offset,n&&(i.save(),i.translate(-o._renderer.offset.x,-o._renderer.offset.y),i.scale(o._renderer.scale.x,o._renderer.scale.y),i.lineWidth=s/o._renderer.scale.x),i.stroke(),n&&i.restore())},render:function(e,t,n){if(!this._visible||!this._opacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size,i=n||this.parent,a=t[this._renderer.type],o=this._sizeAttenuation,s=this._stroke,c=this._linewidth,l=i._matrix.manual||i._flagMatrix,u=this._matrix.manual||this._flagMatrix,d=this._renderer.parent!==i,f=this._renderer.vertices,p=this._renderer.collection.length,m=this._flagVertices,h=this._flagFill||this._fill instanceof Xi&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof ea&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ii&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xi&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof ea&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ii&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||i._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(l||u||d){this._renderer.matrix||(this._renderer.matrix=new ei(9)),this._matrix.toTransformArray(!0,rc),tc(rc,i._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof B||(this._renderer.scale=new B);let e,t;this._scale instanceof B?(e=this._scale.x*i._renderer.scale.x,t=this._scale.y*i._renderer.scale.y):(e=this._scale*i._renderer.scale.x,t=this._scale*i._renderer.scale.y),this._renderer.scale.x=e<0?-e:e,this._renderer.scale.y=t<0?-t:t,d&&(this._renderer.parent=i)}if(m){let t=this._renderer.positionBuffer;t&&e.deleteBuffer(t),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(a.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(a.position),e.bufferData(e.ARRAY_BUFFER,f,e.STATIC_DRAW)}return h?(this._renderer.opacity=this._opacity*i._renderer.opacity,G.updateTexture.call(G,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(G.isHidden.test(s)||(r+=c),r/=G.precision,o&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==a&&(e.useProgram(a),t.resolution.flagged||e.uniform2f(e.getUniformLocation(a,`u_resolution`),t.resolution.width,t.resolution.height),t.current=a),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(a,`u_resolution`),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(a.matrix,!1,this._renderer.matrix),e.uniform1f(a.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,p),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(e,t){let n=this.canvas,r=this.ctx,i=e.renderer.ratio,a=ac.copy(t._renderer.scale).multiply(i),o=t._stroke,s=t._linewidth,c=t._fill,l=t._renderer.opacity||t._opacity,u=t.dashes,d=t._decoration,f=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*a.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*a.y),1);let p=t._renderer.rect.centroid,m=p.x,h=p.y,g,_,v,y,b,x,S,C,w,T,E,D=c._renderer&&c._renderer.offset&&o._renderer&&o._renderer.offset;if(r.clearRect(0,0,n.width,n.height),D||(r.font=[t._style,t._weight,t._size+`px/`+t._leading+`px`,t._family].join(` `)),r.textAlign=`center`,r.textBaseline=`middle`,r.textDirection=f,c&&(typeof c==`string`?r.fillStyle=c:(G[Ys.Utils.getRendererType(c._renderer.type)].render.call(c,r,t),r.fillStyle=c._renderer.effect)),o&&(typeof o==`string`?r.strokeStyle=o:(G[Ys.Utils.getRendererType(o._renderer.type)].render.call(o,r,t),r.strokeStyle=o._renderer.effect),s&&(r.lineWidth=ri(t))),typeof l==`number`&&(r.globalAlpha=l),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(a.x,a.y),r.translate(m,h),G.isHidden.test(c)||(c._renderer&&c._renderer.offset?(x=c._renderer.scale.x,S=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(x,S),g=t._size/c._renderer.scale.y,_=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,g+`px/`,_+`px`,t._family].join(` `),v=c._renderer.offset.x/c._renderer.scale.x,y=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,v,y),r.restore()):r.fillText(t.value,0,0)),G.isHidden.test(o)||(o._renderer&&o._renderer.offset?(x=o._renderer.scale.x,S=o._renderer.scale.y,r.save(),r.translate(-o._renderer.offset.x,-o._renderer.offset.y),r.scale(x,S),g=t._size/o._renderer.scale.y,_=t._leading/o._renderer.scale.y,r.font=[t._style,t._weight,g+`px/`,_+`px`,t._family].join(` `),v=o._renderer.offset.x/o._renderer.scale.x,y=o._renderer.offset.y/o._renderer.scale.y,b=s/o._renderer.scale.x,r.lineWidth=b,r.strokeText(t.value,v,y),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(d)){let e=r.measureText(t.value);switch(d){case`underline`:w=e.actualBoundingBoxDescent,E=e.actualBoundingBoxDescent;break;case`strikethrough`:w=0,E=0}C=-e.width/2,T=e.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(C,w),r.lineTo(T,E),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){let n=G.ctx;n.font=[e._style,e._weight,e._size+`px/`+e._leading+`px`,e._family].join(` `),n.textAlign=`center`,n.textBaseline=Ys.Utils.baselines[e._baseline]||e._baseline;let r=n.measureText(e._value),i=r.width,a=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!G.isHidden.test(this._stroke)&&(i+=this._linewidth*2,a+=this._linewidth*2);let o=i/2,s=a/2;switch(G.alignments[e._alignment]||e._alignment){case G.alignments.left:e.direction===`ltr`?(t.left=0,t.right=i):(t.left=-i,t.right=0);break;case G.alignments.right:e.direction===`ltr`?(t.left=-i,t.right=0):(t.left=0,t.right=i);break;default:t.left=-o,t.right=o}switch(e._baseline){case`bottom`:t.top=-a,t.bottom=0;break;case`top`:t.top=0,t.bottom=a;break;case`baseline`:t.top=-s*1.5,t.bottom=s*.5;break;default:t.top=-s,t.bottom=s}t.width=i,t.height=a,t.centroid||={},t.centroid.x=o,t.centroid.y=s},render:function(e,t,n){if(!this._visible||!this._opacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=n||this.parent,i=t[this._renderer.type],a=r._matrix.manual||r._flagMatrix,o=this._matrix.manual||this._flagMatrix,s=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Xi&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof ea&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Ii&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Xi&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof ea&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Ii&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||o||s){this._renderer.matrix||(this._renderer.matrix=new ei(9)),this._matrix.toTransformArray(!0,rc),tc(rc,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof B||(this._renderer.scale=new B);let e,t;this._scale instanceof B?(e=this._scale.x*r._renderer.scale.x,t=this._scale.y*r._renderer.scale.y):(e=this._scale*r._renderer.scale.x,t=this._scale*r._renderer.scale.y),this._renderer.scale.x=e<0?-e:e,this._renderer.scale.y=t<0?-t:t,s&&(this._renderer.parent=r)}if(this._mask&&(e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1),G[Ys.Utils.getRendererType(this._mask._renderer.type)].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)),c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,G.text.getBoundingClientRect(this,this._renderer.rect),G.updateTexture.call(G,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==i&&(e.useProgram(i),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(i.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(i.position),e.bufferData(e.ARRAY_BUFFER,oc,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(i,`u_resolution`),t.resolution.width,t.resolution.height),t.current=i),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(i,`u_resolution`),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);let l=this._renderer.rect;return e.uniformMatrix3fv(i.matrix,!1,this._renderer.matrix),e.uniform4f(i.rect,l.left,l.top,l.right,l.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(e,t){if(e.canvas.getContext(`2d`)&&t){if(H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,i=this.left._y,a=this.right._x,o=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,i=(i-.5)*n.height,a=(a-.5)*n.width,o=(o-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,i,a,o);for(let e=0;e<this.stops.length;e++){let t=this.stops[e];this._renderer.effect.addColorStop(t._offset,t._color)}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(e,t){if(e.canvas.getContext(`2d`)&&t){if(H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,i=this.center._y,a=this.focal._x,o=this.focal._y,s=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,i=(i-.5)*n.height*.5,a=(a-.5)*n.width*.5,o=(o-.5)*n.height*.5,s*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,i,0,a,o,s);for(let e=0;e<this.stops.length;e++){let t=this.stops[e];this._renderer.effect.addColorStop(t._offset,t._color)}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext(`2d`))return;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof B||(this._renderer.offset=new B),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof B?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof B||(this._renderer.scale=new B);let e,t;this._scale instanceof B?(e=this._scale.x,t=this._scale.y):(e=this._scale,t=this._scale),this._renderer.scale.x=e<0?-e:e,this._renderer.scale.y=t<0?-t:t}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(e,t){let n=Ys.Utils.getRendererType(t._renderer.type);this[n].updateCanvas.call(G,e,t),this.canvas.width<=0||this.canvas.height<=0?(t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture):(t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR))},program:{create:function(e,t){let n,r,i;if(n=e.createProgram(),H.each(t,function(t){e.attachShader(n,t)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw i=e.getProgramInfoLog(n),e.deleteProgram(n),new Ci(`unable to link program: `+i);return n}},extensions:{init:function(e){let t={},n=[`EXT_texture_filter_anisotropic`,`WEBGL_compressed_texture_s3tc`,`OES_texture_float_linear`,`WEBGL_multisampled_render_to_texture`];for(let r=0;r<n.length;r++){let i=n[r];t[i]=G.extensions.get(e,i)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new Di};G.ctx=G.canvas.getContext(`2d`);var sc=class extends z{constructor(e){super();let t,n,r,i;if(this.domElement=e.domElement||document.createElement(`canvas`),e.offscreenElement!==void 0&&(G.canvas=e.offscreenElement,G.ctx=G.canvas.getContext(`2d`)),this.scene=new hs,this.scene.parent=this,this._renderer={type:`renderer`,matrix:new ei(nc),scale:1,opacity:1},this._flagMatrix=!0,e=H.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext(`webgl`,e)||this.domElement.getContext(`experimental-webgl`,e),!this.ctx)throw new Ci(`unable to create a webgl context. Try using another renderer.`);r=ec.create(t,ec.path.vertex,ec.types.vertex),i=ec.create(t,ec.path.fragment,ec.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=G.program.create(t,[r,i]),this.programs.text=this.programs.path,t.extensions=G.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,`a_position`),n.matrix=t.getUniformLocation(n,`u_matrix`),n.rect=t.getUniformLocation(n,`u_rect`);let a=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,a),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,oc,t.STATIC_DRAW),r=ec.create(t,ec.points.vertex,ec.types.vertex),i=ec.create(t,ec.points.fragment,ec.types.fragment),n=this.programs.points=G.program.create(t,[r,i]),n.position=t.getAttribLocation(n,`a_position`),n.matrix=t.getUniformLocation(n,`u_matrix`),n.size=t.getUniformLocation(n,`u_size`),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,i,a=this.ctx;return this.width=e,this.height=t,this.ratio=n===void 0?Ei(a):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,H.isObject(this.domElement.style)&&H.extend(this.domElement.style,{width:e+`px`,height:t+`px`}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=e*this.ratio,i=t*this.ratio,a.viewport(0,0,r,i),this.programs.resolution.width=r,this.programs.resolution.height=i,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(z.Types.resize,e,t,n)}render(){let e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),G.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};L(sc,`Utils`,G);var cc=H.extend({Error:Ci,getRatio:Ei,read:Fs,xhr:Is},H,Br,Vr,Hr),K=class e{constructor(t){L(this,`_events`,new z),L(this,`type`,``),L(this,`renderer`,null),L(this,`scene`,null),L(this,`width`,0),L(this,`height`,0),L(this,`frameCount`,0),L(this,`timeDelta`,0),L(this,`playing`,!1);let n=H.defaults(t||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:e.Types.svg,autostart:!1});if(H.each(n,function(e,t){/fullscreen/i.test(t)||/autostart/i.test(t)||(this[t]=e)},this),H.isElement(n.domElement)){let t=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+`-`+t)||(this.type=e.Types[t])}this.renderer=new e[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=uc.bind(this),this.fit.domElement=window,this.fit.attached=!0,H.extend(document.body.style,{overflow:`hidden`,margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:`fixed`}),H.extend(this.renderer.domElement.style,{display:`block`,top:0,left:0,right:0,bottom:0,position:`fixed`}),xi.bind(this.fit.domElement,`resize`,this.fit),this.fit()):n.fitted?(this.fit=dc.bind(this),H.extend(this.renderer.domElement.style,{display:`block`})):typeof n.width==`number`&&typeof n.height==`number`&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(z.Types.resize,fc.bind(this)),this.scene=this.renderer.scene,e.Instances.push(this),n.autostart&&pc.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener?.apply(this,arguments)}on(){return this._events.addEventListener?.apply(this,arguments)}bind(){return this._events.addEventListener?.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener?.apply(this,arguments)}off(){return this._events.removeEventListener?.apply(this,arguments)}unbind(){return this._events.removeEventListener?.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent?.apply(this,arguments)}trigger(){return this._events.dispatchEvent?.apply(this,arguments)}listen(){return this._events.listen?.apply(this,arguments)}ignore(){return this._events.ignore?.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,pc.init(),this.trigger(z.Types.play)}pause(){return this.playing=!1,this.trigger(z.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;if(e===void 0)return this.release(this.scene);if(typeof e.unbind==`function`&&e.unbind(),typeof e.fill==`object`&&typeof e.fill.unbind==`function`&&e.fill.unbind(),typeof e.stroke==`object`&&typeof e.stroke.unbind==`function`&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind==`function`)try{e.vertices.unbind()}catch{}for(t=0;t<e.vertices.length;t++)n=e.vertices[t],typeof n.unbind==`function`&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind==`function`&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind==`function`&&n.controls.right.unbind())}if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);if(typeof e.children.unbind==`function`)try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type===`WebGLRenderer`&&this.renderer.ctx){let t=this.renderer.ctx;e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type===`CanvasRenderer`&&e._renderer.context&&delete e._renderer.context}return e}getShapesAtPoint(e,t,n){return this.scene&&typeof this.scene.getShapesAtPoint==`function`?this.scene.getShapesAtPoint(e,t,n):[]}update(){let e=!!this._lastFrame,t=H.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(xi.bind(this.fit.domElement,`resize`,this.fit),this.fit.attached=!0,this.fit());let n=this.width,r=this.height,i=this.renderer;return(n!==i.width||r!==i.height)&&i.setSize(n,r,this.ratio),this.trigger(z.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(z.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,t,n,r){let i=new vs(e,t,n,r);return this.scene.add(i),i}makeArrow(e,t,n,r,i){let a=typeof i==`number`?i:10,o=Math.atan2(r-t,n-e),s=new U([new V(e,t,void 0,void 0,void 0,void 0,R.move),new V(n,r,void 0,void 0,void 0,void 0,R.line),new V(n-a*Math.cos(o-Math.PI/4),r-a*Math.sin(o-Math.PI/4),void 0,void 0,void 0,void 0,R.line),new V(n,r,void 0,void 0,void 0,void 0,R.move),new V(n-a*Math.cos(o+Math.PI/4),r-a*Math.sin(o+Math.PI/4),void 0,void 0,void 0,void 0,R.line)],!1,!1,!0);return s.noFill(),s.cap=`round`,s.join=`round`,this.scene.add(s),s}makeRectangle(e,t,n,r){let i=new uo(e,t,n,r);return this.scene.add(i),i}makeRoundedRectangle(e,t,n,r,i){let a=new Ho(e,t,n,r,i);return this.scene.add(a),a}makeCircle(e,t,n,r){let i=new wo(e,t,n,r);return this.scene.add(i),i}makeEllipse(e,t,n,r,i){let a=new ko(e,t,n,r,i);return this.scene.add(a),a}makeStar(e,t,n,r,i){let a=new Jo(e,t,n,r,i);return this.scene.add(a),a}makeCurve(e){let t=arguments.length;if(!Array.isArray(e)){e=[];for(let n=0;n<t;n+=2){let t=arguments[n];if(typeof t!=`number`)break;let r=arguments[n+1];e.push(new V(t,r))}}let n=arguments[t-1],r=new U(e,!(typeof n==`boolean`&&n),!0),i=r.getBoundingClientRect();return r.center().translation.set(i.left+i.width/2,i.top+i.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){let i=new zo(e,t,n,r);return this.scene.add(i),i}makeArcSegment(e,t,n,r,i,a,o){let s=new yo(e,t,n,r,i,a,o);return this.scene.add(s),s}makePoints(e){let t=arguments.length,n=e;if(!Array.isArray(e)){n=[];for(let e=0;e<t;e+=2){let t=arguments[e];if(typeof t!=`number`)break;let r=arguments[e+1];n.push(new B(t,r))}}let r=new Po(n);return this.scene.add(r),r}makePath(e){let t=arguments.length,n=e;if(!Array.isArray(e)){n=[];for(let e=0;e<t;e+=2){let t=arguments[e];if(typeof t!=`number`)break;let r=arguments[e+1];n.push(new V(t,r))}}let r=arguments[t-1],i=new U(n,!(typeof r==`boolean`&&r)),a=i.getBoundingClientRect();return typeof a.top==`number`&&typeof a.left==`number`&&typeof a.right==`number`&&typeof a.bottom==`number`&&i.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(i),i}makeText(e,t,n,r){let i=new es(e,t,n,r);return this.add(i),i}makeLinearGradient(e,t,n,r){let i=new Xi(e,t,n,r,Array.prototype.slice.call(arguments,4));return this.add(i),i}makeRadialGradient(e,t,n){let r=new ea(e,t,n,Array.prototype.slice.call(arguments,3));return this.add(r),r}makeSprite(e,t,n,r,i,a,o){let s=new mo(e,t,n,r,i,a);return o&&s.play(),this.add(s),s}makeImage(e,t,n,r,i,a){let o=new Rs(e,t,n,r,i,a);return this.add(o),o}makeImageSequence(e,t,n,r,i){let a=new as(e,t,n,r);return i&&a.play(),this.add(a),a}makeTexture(e,t){return new Ii(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));let t=new hs;return this.scene.add(t),t.add(e),t}interpret(e,t,n){let r=e.tagName.toLowerCase();if(n=n===void 0||n,!(r in Fs))return null;let i=Fs[r].call(this,e);return n?this.add(t&&i instanceof hs?i.children:i):i.parent&&i.remove(),i}load(e,t){let n=new hs,r,i,a,o=function(e){for(xi.temp.innerHTML=e,i=0;i<xi.temp.children.length;i++)r=xi.temp.children[i],a=this.interpret(r,!1,!1),a!==null&&n.add(a);if(typeof t==`function`){let e=xi.temp.children.length<=1?xi.temp.children[0]:xi.temp.children;t(n,e)}}.bind(this);return/\.svg$/i.test(e)?(Is(e,o),n):(o(e),n)}};L(K,`NextFrameId`,ci.NextFrameId),L(K,`Types`,ci.Types),L(K,`Version`,ci.Version),L(K,`PublishDate`,ci.PublishDate),L(K,`Identifier`,ci.Identifier),L(K,`Resolution`,ci.Resolution),L(K,`AutoCalculateImportedMatrices`,ci.AutoCalculateImportedMatrices),L(K,`Instances`,ci.Instances),L(K,`uniqueId`,ci.uniqueId),L(K,`Anchor`,V),L(K,`Collection`,ki),L(K,`Events`,z),L(K,`Group`,hs),L(K,`Matrix`,ma),L(K,`Path`,U),L(K,`Registry`,Di),L(K,`Element`,ji),L(K,`Shape`,ga),L(K,`Text`,es),L(K,`Vector`,B),L(K,`Gradient`,Wi),L(K,`Image`,Rs),L(K,`ImageSequence`,as),L(K,`LinearGradient`,Xi),L(K,`RadialGradient`,ea),L(K,`Sprite`,mo),L(K,`Stop`,Vi),L(K,`Texture`,Ii),L(K,`ArcSegment`,yo),L(K,`Circle`,wo),L(K,`Ellipse`,ko),L(K,`Line`,vs),L(K,`Points`,Po),L(K,`Polygon`,zo),L(K,`Rectangle`,uo),L(K,`RoundedRectangle`,Ho),L(K,`Star`,Jo),L(K,`CanvasRenderer`,Ys),L(K,`SVGRenderer`,$s),L(K,`WebGLRenderer`,sc),L(K,`Commands`,R),L(K,`Utils`,cc);var lc=K;function uc(){let e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function dc(){let e=this.renderer.domElement.parentElement;if(!e){console.warn(`Two.js: Attempting to fit to parent, but no parent found.`);return}let t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function fc(e,t){this.width=e,this.height=t,this.trigger(z.Types.resize,e,t)}var pc=xi.getRequestAnimationFrame();function mc(){for(let e=0;e<lc.Instances.length;e++){let t=lc.Instances[e];t.playing&&t.update()}lc.NextFrameId=pc(mc)}pc.init=function(){mc(),pc.init=function(){}};var hc=class{x;y;constructor(e=0,t=0){this.x=e,this.y=t}},gc=class{width;angle;label;start=new hc;end=new hc;constructor(e=10,t=0,n=`A`){this.width=e,this.angle=t,this.label=n}},_c={line:{color:`#000`,size:5},previewLine:{color:`#000`,size:2},anchorPoint:{color:`#FF8000`,size:12,strokeSize:20},lineLabel:{color:`#FF8000`,size:22,rotation:-.5},angleLabel:{size:22,color:`#088c00`,rotation:-.5},colorSideLabel:{size:20,color:`#439227`}},vc={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function yc(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,vc,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z`},null,-1)]])}var bc=(0,r.markRaw)({name:`ion-close`,render:yc}),xc={class:`mr-3 flex flex-col gap-2`},Sc=[`onClick`],Cc={class:`h-full p-2`},wc=yt((0,r.defineComponent)({__name:`kozyrek-configurator-templates`,props:{settings:{},selectTemplateIndex:{}},emits:[`template:select`,`init-draw-template`,`remove-custom-template`],setup(e,{emit:t}){let n=e,i=(0,r.ref)(!1),a=(0,r.useTemplateRef)(`drawing-template-containers`),s=(0,r.useTemplateRef)(`drawing-custom-template-containers`),c=t,l=e=>{i.value=!0,c(`remove-custom-template`,e,()=>{i.value=!1})};return(0,r.onMounted)(()=>{n.settings.templates?.forEach((e,t)=>{let n=a.value?.at(t);n&&c(`init-draw-template`,n,e)}),n.settings.customTemplates?.forEach((e,t)=>{let n=s.value?.at(t);n&&c(`init-draw-template`,n,e)})}),(0,r.watch)(()=>[...n.settings.customTemplates],(e,t)=>{(0,r.nextTick)(()=>{e.forEach((e,n)=>{if(!t?.includes(e)){let t=s.value?.at(n);t&&c(`init-draw-template`,t,e)}}),t.length>e.length&&t.forEach((e,t)=>{let n=s.value?.at(t);n&&(n.innerHTML=``,c(`init-draw-template`,n,e))})})},{deep:!0}),(t,n)=>{let a=bc;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NScrollbar),{style:{width:`auto`},trigger:`none`,class:`max-h-[19rem] md:max-h-[40rem] w-auto`},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,xc,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.settings.allTemplates,(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`${t.id}-${n}`,class:`group relative`},[(0,r.createVNode)((0,r.unref)(o.NPopover),{trigger:`hover`,placement:`right`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200`,{"!border-green-700":n===e.selectTemplateIndex}]),onClick:e=>c(`template:select`,n)},[(0,r.createElementVNode)(`div`,Cc,[(0,r.createElementVNode)(`div`,{ref_for:!0,ref:t.isCustom&&t.id!==-1?`drawing-custom-template-containers`:`drawing-template-containers`,class:`kozyrek-preview h-full`},null,512)])],10,Sc)]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(t.label),1)]),_:2},1024),t.isCustom&&!t.isNewRec()?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,size:`tiny`,quaternary:``,loading:i.value,disabled:i.value,circle:``,class:`!absolute right-0.5 top-0.5 !hidden group-hover:!flex`,onClick:e=>l(n)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`loading`,`disabled`,`onClick`])):(0,r.createCommentVNode)(``,!0)]))),128))])]),_:1})}}}),[[`__scopeId`,`data-v-afccb364`]]),Tc={class:`flex gap-3 min-w-[20rem] relative`},Ec={class:`kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2`},Dc={ref:`drawing-container`,class:`size-full`},Oc=(0,r.defineComponent)({__name:`kozyrek-configurator-preview`,props:{settings:{},value:{},selectTemplateIndex:{}},emits:[`pointer:move`,`pointer:up`,`template:select`,`remove-custom-template`],setup(e,{emit:t}){let{Points:n,Group:i,Line:a,Vector:o,Text:s,Anchor:c,Events:l,Path:u}=lc,d=e,f=t,p=(0,r.useTemplateRef)(`drawing-container`),m=[],h=[],g=[],_=null,v=.75,y=(0,r.computed)(()=>d.value.configuratorParams.linesAngles.map((e,t)=>new gc(d.value.configuratorParams.linesWidths[t],e,`A-${t+1}`))),b=(0,r.computed)(()=>d.value.configuratorParams.colorSide===`bottom`),x=(0,r.computed)(()=>d.value.configuratorParams.startTailType&&d.settings.startTailConfigs?.[d.value.configuratorParams.startTailType]?d.settings.startTailConfigs?.[d.value.configuratorParams.startTailType].points:[]),S=(0,r.computed)(()=>{let e=d.value.configuratorParams.endTailType!==void 0&&d.settings.endTailConfigs?.[d.value.configuratorParams.endTailType];return!e||!e.points?[]:e.points.map((e,t)=>Array.isArray(e)?new gc(e[0],e[1],`A-${t+1}`):new gc(e.width,e.angle,`A-${t+1}`))}),C=(e,t=!1)=>{e[0].start.x=0,e[0].start.y=0;let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[r-1]??new gc(0,n);n+=!t||r>1?a.angle:0;let o=(!t||r>0?i.angle:0)+n;if(e[r].end.x=i.width*Math.cos(o*Math.PI/180)+e[r].start.x,e[r].end.y=i.width*Math.sin(o*Math.PI/180)+e[r].start.y,r<e.length-1){let t=r+1;e[t].start.x=e[r].end.x,e[t].start.y=e[r].end.y}}return e},w=(e,t,n,r,i=!1)=>{let a=C([...n,...r]);t.length>0&&(a=[...C(t),...a]);let o=0,s=0,c=0,l=0;a.forEach(e=>{o=Math.min(o,e.start.x,e.end.x),s=Math.min(s,e.start.y,e.end.y),c=Math.max(c,e.start.x,e.end.x),l=Math.max(l,e.start.y,e.end.y)});let u,d;o===0&&s===0&&c===0&&l===0?(u=1,d=1):(u=e.width/Math.abs(c-o),d=(i?e.height:e.height-_c.colorSideLabel.size)/Math.abs(l-s));let f=Math.min(u,d);return o=o<0?-o*f:0,s=s<0?-s*f:0,[f,o,s]},T=e=>{let t=new n([e]);return t._size=_c.anchorPoint.size,t.fill=_c.anchorPoint.color,t.stroke=`transparent`,t._linewidth=_c.anchorPoint.strokeSize,g.push(t),t},E=(e,t)=>{if(g=[],d.settings.allowChangeFirstPoint){let n=e[0],r=new o(n.vertices[0].x,n.vertices[0].y);r.bind(l.Types.change,()=>{n.vertices[0].copy(r)});let i=T(r);t.add(i)}e.forEach((n,r)=>{let i=e[r+1],a=new o(n.vertices[1].x,n.vertices[1].y);a.bind(l.Types.change,()=>{n.vertices[1].copy(a),i!==void 0&&i.vertices[0].copy(a)});let s=T(a);t.add(s)})},D=e=>Math.PI/180*e,O=(e,t,n)=>{let r=t.vertices.length-1;e.position.x=t.vertices[r].x,e.position.y=t.vertices[r].y;let i=Math.atan2(t.vertices[r].y-t.vertices[0].y,t.vertices[r].x-t.vertices[0].x);e.rotation=D(n)+i},k=(e,t,n)=>{if(t.vertices[0]===void 0)return;e.position.x=t.vertices[0].x,e.position.y=t.vertices[0].y;let r=t.vertices.length-1,i=Math.atan2(t.vertices[r].y-t.vertices[0].y,t.vertices[r].x-t.vertices[0].x);e.rotation=D(n)+i},A=(e,t,n)=>{let r=new i;if(e.length===0)return r;let o=[];return[...e].reverse().forEach((e,t)=>{t!==0&&e.angle>0&&(e.angle*=-1),o.push(e)}),e=C(o,!0),k(r,t,e[0].angle),[t.vertices[0],t.vertices[1]].forEach(n=>{n.bind(l.Types.change,()=>{k(r,t,e[0].angle)})}),e.forEach(e=>{let t=e.start.x*n,i=e.end.x*n,o=e.start.y*n,s=e.end.y*n,c=new a(t,o,i,s);c.linewidth=_c.line.size,c.stroke=_c.line.color,r.add(c)}),r},ee=(e,t,n)=>{let r=new i;return e.length===0||(e=C(e,!0),O(r,t,e[0].angle),[t.vertices[0],t.vertices[1]].forEach(n=>{n.bind(l.Types.change,()=>{O(r,t,e[0].angle)})}),e.forEach(e=>{let t=e.start.x*n,i=e.end.x*n,o=e.start.y*n,s=e.end.y*n,c=new a(t,o,i,s);c.linewidth=_c.line.size,c.stroke=_c.line.color,r.add(c)})),r},j=(e,t,n,r)=>{let i=t.vertices[0].x+(t.vertices[1].x-t.vertices[0].x)/2-8*Math.sin(e.angle*Math.PI/180),a=t.vertices[0].y+(t.vertices[1].y-t.vertices[0].y)/2-8*Math.cos(e.angle*Math.PI/180),o=new s(e.label,i+10,a-10),c;o.size=_c.lineLabel.size,o.weight=600,o.fill=_c.lineLabel.color,o.id+=1,o.rotation=_c.lineLabel.rotation,r>0&&(c=new s(`${e.angle}°`,t.vertices[0].x+25,t.vertices[0].y-25),c.size=_c.angleLabel.size,c.weight=600,c.fill=_c.angleLabel.color,c.rotation=_c.angleLabel.rotation,c.id+=r,m.push(c),n.add(c)),n.add(o),ne(o,t,0,c),ne(o,t,1)},te=()=>{let{size:e}=_c.colorSideLabel,t=b.value?e/2:e/2-e,n=b.value?e/2-e:e/2,r=new i;if(!_)return r;let a=Math.atan2(n-t,0),o=[new c(0,t,0,0,0,0,lc.Commands.move),new c(0,n,0,0,0,0,lc.Commands.line),new c(0-5*Math.cos(a-Math.PI/4),n-5*Math.sin(a-Math.PI/4),0,0,0,0,lc.Commands.line),new c(0,n,0,0,0,0,lc.Commands.move),new c(0-5*Math.cos(a+Math.PI/4),n-5*Math.sin(a+Math.PI/4),0,0,0,0,lc.Commands.line)],l=new u(o,!1,!1,!0);l.noFill(),l.cap=`round`,l.join=`round`,l.linewidth=e/7,l.stroke=_c.colorSideLabel.color,r.add(l);let d=new s(b.value?`Цвет снизу`:`Цвет сверху`,10,0);d.size=e,d.weight=600,d.fill=_c.colorSideLabel.color,d.alignment=`left`,r.add(d);let f=r.getBoundingClientRect();return r.position.x=(_.width-f.width)*v+10,r.position.y=b.value?_.height+f.height*2:f.height/2,r},ne=(e,t,n,r)=>{t.vertices[n].bind(l.Types.change,()=>{let n=t.vertices.length-1,i=Math.atan2(t.vertices[0].y-t.vertices[n].y,t.vertices[0].x-t.vertices[n].x)*180/Math.PI,a=t.vertices[0].x+(t.vertices[n].x-t.vertices[0].x)/2-8*Math.sin(i*Math.PI/180),o=t.vertices[0].y+(t.vertices[n].y-t.vertices[0].y)/2-8*Math.cos(i*Math.PI/180);e.position.x=a+10,e.position.y=o-10,e.rotation=-.5,r&&(r.position.x=t.vertices[0].x+25,r.position.y=t.vertices[0].y-25)})},M=(e,t,n,r,o=!1)=>{if(e.clear(),n.length===0){e.update();return}let s=C(n),[c,l,u]=w(e,t,s,r,o),f=new i,p=[],g=[];o||(m=[],h=[]),s.forEach((e,t)=>{let n=e.start.x*c+l,r=e.end.x*c+l,i=e.start.y*c+u,s=e.end.y*c+u,d=new a(n,i,r,s);d.linewidth=o?_c.previewLine.size:_c.line.size,d.stroke=o?_c.previewLine.color:_c.line.color,h.push(d),p.push(d),f.add(d),!o&&e.label!==``&&j(e,d,f,t)});let _=p.at(-1),y=f.getBoundingClientRect();if(!o){let e=te();g.push(e)}if(t.length>0){let e=A(t,p[0],c);f.add(e)}if(r.length>0&&_){let e=ee(r,_,c);f.add(e)}if(g.push(f),e.makeGroup(g),y=f.getBoundingClientRect(),f.position.x=0-y.left+(e.width-y.width)/(2*(o?1:v)),f.position.y=0-y.top+(e.height-y.height)/(2*(o?1:v)),e.update(),!o){let t=d.value.configuratorParams?.colorSide===`top`;f.position.y=f.position.y+_c.colorSideLabel.size*Number(t),E(p,f),e.update()}},re=(e,t)=>{if(e&&!t.isNewRec()){let n=new lc({width:e.scrollWidth,height:e.scrollHeight});n.appendTo(e),M(n,[],t.points,[],!0)}},ie=()=>{_&&M(_,x.value,y.value,S.value,!1)},N=e=>180/Math.PI*e,P=(e,t)=>{let n=e[1].x-e[0].x,r=e[1].y-e[0].y,i=t[1].x-t[0].x,a=t[1].y-t[0].y,o=Math.atan2(n*a-r*i,n*i+r*a);return o=N(o),Math.round(o)*-1},F=e=>{let t=h.map((t,n,r)=>{let i=r[n-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]},a=xe.multiplyByStep(Math.ceil(xe.divideByStep(t._length/e,d.settings.lineWidthStep)),d.settings.lineWidthStep),o=m[n-1];a<(r.length>1?d.settings.minLineWidth:d.settings.stripMinWidth)&&(a=r.length>1?d.settings.minLineWidth:d.settings.stripMinWidth),a>d.settings.maxLineWidth&&(a=d.settings.maxLineWidth);let s=P(t.vertices,i.vertices);return o&&(o.value=`${s}°`),new gc(a,s,`A-${n+1}`)});f(`pointer:move`,t)},ae=e=>{let t=null,n,r=r=>{t=g.find(e=>e.renderer?.elem===r.target),[n]=w(e,x.value,y.value.map(e=>e),S.value)},i=r=>{if(t){let i=t.renderer?.elem;if(!i)return;let a=i.getBoundingClientRect();t.vertices[0].x-=a.x-(r instanceof MouseEvent?r.clientX:r.targetTouches[0].clientX)+_c.anchorPoint.size/2,t.vertices[0].y-=a.y-(r instanceof MouseEvent?r.clientY:r.targetTouches[0].clientY)+_c.anchorPoint.size/2,F(n),e.update()}},a=()=>{t&&f(`pointer:up`,y.value),t=null},o=p.value;o&&(o.addEventListener(`touchstart`,r,{passive:!0}),o.addEventListener(`touchend`,a,{passive:!0}),o.addEventListener(`mousedown`,r),o.addEventListener(`mouseup`,a),o.addEventListener(`mousemove`,i),o.addEventListener(`touchmove`,i,{passive:!0}))},oe=(e,t)=>{f(`remove-custom-template`,e,t)};return(0,r.onMounted)(()=>{p.value&&(_=new lc({width:p.value.scrollWidth,height:p.value.scrollHeight,fullscreen:!1}).appendTo(p.value),_.scene.scale=v,_.update(),(0,r.watch)(()=>d.value,()=>{ie()},{deep:!0,immediate:!0}),ae(_))}),(0,r.onBeforeUnmount)(()=>{_&&=(_.clear(),null)}),(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Tc,[(0,r.createVNode)(wc,{"select-template-index":e.selectTemplateIndex,settings:e.settings,"onTemplate:select":n[0]||=e=>f(`template:select`,e),onInitDrawTemplate:re,onRemoveCustomTemplate:oe},null,8,[`select-template-index`,`settings`]),(0,r.createElementVNode)(`div`,Ec,[(0,r.createElementVNode)(`div`,Dc,null,512)])]))}}),kc=class extends t.Identity{label=``;points=[];isCustom=!1;id=-1;guid=``;constructor(e,t){super(),e?(this.label=e.label,this.points=e.points.map((e,t)=>(0,n.isArray)(e)?new gc(e[0],e[1],`A-${t+1}`):new gc(e.width,e.angle,`A-${t+1}`)),this.isCustom=e.isCustom):(this.label=`-- Новая конфигурация --`,this.points=[new gc(0,0,`A-1`)],this.isCustom=!0,this.id=t??this.id)}},Ac=class extends kc{isDefault;constructor(e){super(e),this.isDefault=e.isDefault??!1}},jc=class{minLineWidth;maxLineWidth;lineWidthStep;minLineAngle;maxLineAngle;lineAngleStep;stripMinWidth;stripMaxWidth;stripMinLength;stripMaxLength;allowShowTable;showOnlyTemplates;templates;customTemplates=[];startTailConfigs;endTailConfigs;bendCountForExtended;extendedProductCatalog;allowChangeFirstPoint;allowSaveTemplates;userTemplatesPrefix;lengthStep;canSetDopProdaga;constructor(e){this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(e=>new kc(e)),this.templates.forEach((e,t)=>{e.id=t}),this.startTailConfigs=e.startTailConfigs?.map(e=>new Ac(e))??[],this.endTailConfigs=e.endTailConfigs?.map(e=>new Ac(e))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,e])=>e.id!==-1).map(([e,t])=>{let n=new kc(t);return n.isCustom=!0,n.id=+e,n}):[],this.customTemplates.some(e=>e.isCustom&&e.isNewRec())||this.customTemplates.push(new kc({label:`-- Новая конфигурация --`,points:[new gc(this.stripMinWidth,0,`A-1`)],isCustom:!0,id:-1,guid:``})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;let t=this.customTemplates.findLast(e=>!e.isNewRec()),n=new kc(e);n.isCustom=!0,n.id=t?t.id+1:0,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;let t=this.customTemplates.findIndex(t=>t.id===e);t!==-1&&this.customTemplates.splice(t,1)}},Mc={class:`flex flex-col gap-3`},Nc={class:`grid gap-5 md:grid-cols-5`},Pc=(0,r.defineComponent)({__name:`kozyrek-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.ref)(!1),l=(0,r.ref)(!1),u=(0,r.ref)(!1),d=(0,r.ref)(a.cartItem),f=(0,r.ref)(new jc(a.settings)),p=(0,r.ref)({linesWidths:[...a.cartItem.configuratorParams.linesWidths],linesAngles:[...a.cartItem.configuratorParams.linesAngles]}),m=(0,r.ref)({quantity:{},marker:{},length:{}}),h=(0,r.ref)(0),g=(0,r.useTemplateRef)(`kozyrek-configurator-params-form`),_=(e=0)=>{let t=f.value.allTemplates?.at(e);t!==void 0&&(h.value=e,d.value.configuratorParams.linesWidths=t.points.map(e=>(0,n.isArray)(e)?e[0]:e.width),d.value.configuratorParams.linesAngles=t.points.map(e=>(0,n.isArray)(e)?e[1]:e.angle),C()),x(d.value.configuratorParams)},v=async()=>{let e=prompt(`Введите название шаблона:`);if(!e)return;u.value=!0;let t={label:e,points:d.value.configuratorParams.linesWidths.map((e,t)=>[e,d.value.configuratorParams.linesAngles[t]])};a.eventEmitter.emit(`configurator:create-template`,{category:a.cartItem.category,template:t,callback:e=>{e&&(f.value.addCustomTemplate(t),h.value=f.value.allTemplates.length-2),u.value=!1}})},y=async(e,t)=>{let n=f.value.allTemplates?.at(e);n&&n.isCustom&&a.eventEmitter.emit(`configurator:remove-template`,{category:a.cartItem.category,templateId:n.id,callback:e=>{e&&(f.value.removeCustomTemplate(n.id),_()),t?.()}})},b=()=>{f.value.showOnlyTemplates||f.value.allowSaveTemplates&&(h.value=f.value.allTemplates.length-1)},x=async e=>{d.value.product=new t.ClientProduct,g.value?.formReference?.validate(t=>{t||(C(),c.value=!0,a.eventEmitter.emit(`configurator:search-product`,{category:a.cartItem.category,params:e,validationFieldResultData:m.value,callback:e=>{e?d.value.product=e:m.value.product={showFeedback:!0,feedback:`Не удалось найти товар по указанным параметрам.`,validationStatus:`error`},c.value=!1}}))}).catch(n.noop)},S=async()=>{g.value?.formReference?.validate(e=>{if(!e){l.value=!0;let e=new t.OrderItemBase(d.value);f.value.startTailConfigs?.length||delete e.configuratorParams.startTailType,f.value.endTailConfigs?.length||delete e.configuratorParams.endTailType,s(`submit`,e,m.value,()=>{l.value=!1,(0,r.nextTick)(()=>{g.value?.formReference?.restoreValidation()})})}}).catch(n.noop)},C=()=>{let e={quantity:m.value.quantity,marker:m.value.marker};d.value.configuratorParams.linesWidths.forEach((t,n)=>{e[`lines_widths[${n+1}]`]={},e[`lines_angles[${n+1}]`]={}}),m.value=e},w=e=>{p.value.linesWidths=e.map(e=>e.width),p.value.linesAngles=e.map(e=>e.angle)},T=e=>{d.value.configuratorParams.linesWidths=p.value.linesWidths,d.value.configuratorParams.linesAngles=p.value.linesAngles,C(),b(),x(d.value.configuratorParams)},E=(e,t)=>{p.value.linesWidths=e,p.value.linesAngles=t},D=e=>{let t=d.value.configuratorParams.linesWidths.length>1?f.value.minLineWidth:f.value.stripMinWidth;d.value.configuratorParams.linesWidths.splice(e+1,0,t),d.value.configuratorParams.linesAngles.splice(e+1,0,0),p.value.linesWidths=[...d.value.configuratorParams.linesWidths],p.value.linesAngles=[...d.value.configuratorParams.linesAngles],C(),b(),x(d.value.configuratorParams)},O=e=>{d.value.configuratorParams.linesWidths.length<=1||(d.value.configuratorParams.linesWidths.splice(e,1),d.value.configuratorParams.linesAngles.splice(e,1),p.value.linesWidths=[...d.value.configuratorParams.linesWidths],p.value.linesAngles=[...d.value.configuratorParams.linesAngles],C(),b(),x(d.value.configuratorParams))};return(0,r.onMounted)(()=>{a.cartItem.isNewRec()?_():(C(),h.value=-1,x(d.value.configuratorParams))}),(0,r.watch)(()=>a.cartItem,e=>{d.value=new t.OrderItemBase(e),e.isNewRec()?_():(C(),h.value=-1,x(d.value.configuratorParams))}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Mc,[e.settings.allowShowTable?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-end`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,Nc,[(0,r.createVNode)(Oc,{value:d.value,"select-template-index":h.value,settings:f.value,class:`h-fit col-span-3`,"onPointer:up":T,"onPointer:move":w,"onTemplate:select":_,onRemoveCustomTemplate:y},null,8,[`value`,`select-template-index`,`settings`]),(0,r.createVNode)(wr,{ref:`kozyrek-configurator-params-form`,value:d.value,"onUpdate:value":n[1]||=e=>d.value=e,"preview-params":p.value,validation:m.value,settings:f.value,"is-submit-processing":l.value,"is-product-searching":c.value,"select-template-index":h.value,class:`col-span-2`,"onUpdate:params":n[2]||=e=>x(e),"onUpdate:preview":E,onSubmit:S,"onClick:saveTemplate":v,"onClick:addLine":D,"onClick:removeLine":O},null,8,[`value`,`preview-params`,`validation`,`settings`,`is-submit-processing`,`is-product-searching`,`select-template-index`])])])}}}),Fc={class:`flex flex-col items-center justify-between rounded-xl`},Ic={class:`img-preview relative flex justify-center`},Lc=yt((0,r.defineComponent)({__name:`mosquito-configurator-preview`,props:{configuratorParams:{},settings:{}},emits:[`open-instructions`],setup(e,{emit:t}){let i=e,a=(0,r.computed)(()=>{let{height:e}=i.configuratorParams;return(0,n.keys)(i.settings.crossbarCount).reverse().find(t=>e>=i.settings.crossbarCount[Number(t)])}),s=t;return(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Fc,[(0,r.createElementVNode)(`div`,Ic,[n[1]||=(0,r.createElementVNode)(`div`,{class:`window`},null,-1),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`net`,`net-${e.configuratorParams.netType}`])},null,2),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`frame`,`frame-${e.configuratorParams.color}`])},null,2),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:(0,r.normalizeClass)([`frame-crossbar`,`frame-crossbar-${a.value}-${e.configuratorParams.color}`])},null,2)):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`mount`,`mount-${e.configuratorParams.mountType}-${e.configuratorParams.color}`])},null,2),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`cut-preview`,`cut-preview-${e.configuratorParams.mountType}-${e.configuratorParams.color}`])},null,2)]),(0,r.createVNode)(i,{type:`primary`,class:`block justify-self-center`,onClick:n[0]||=e=>s(`open-instructions`)},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Руководство по замеру `,-1)]]),_:1})])}}}),[[`__scopeId`,`data-v-2a790a20`]]),Rc={key:0,class:`flex items-baseline gap-1`},zc={key:0,class:`flex items-baseline gap-1`},Bc={key:1},Vc={class:`text-lg font-semibold`},Hc={key:2,class:`text-red-500 text-sm mb-2`},Uc={class:`flex gap-3`},Wc=(0,r.defineComponent)({__name:`mosquito-configurator-form`,props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:[`update:value`,`update:params`,`submit`,`click:instructions-toggle`,`click:show-preview-drawer`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.computed)(()=>F.isPhoneDevice()),u=(0,r.useTemplateRef)(`form-reference`),d=(0,r.useTemplateRef)(`width-form-item-reference`),f=(0,r.useTemplateRef)(`height-form-item-reference`),p=(0,r.useTemplateRef)(`width-input-reference`),m=(0,r.ref)((0,n.cloneDeep)(s.value)),h=(0,r.computed)(()=>s.settings.widthOverlaps[m.value.configuratorParams.mountType]??0),g=(0,r.computed)(()=>s.settings.heightOverlaps[m.value.configuratorParams.mountType]??0),_=(0,r.computed)(()=>s.settings.maxWidths[m.value.configuratorParams.netType]),v=(0,r.computed)(()=>s.settings.maxHeights[m.value.configuratorParams.netType]),y=(0,r.computed)(()=>m.value.configuratorParams.width?m.value.configuratorParams.width+h.value:0),b=(0,r.computed)(()=>m.value.configuratorParams.height?m.value.configuratorParams.height+g.value:0),x=(0,r.ref)(s.settings.canSetDopProdaga??!1),S=(0,r.computed)(()=>({"configuratorParams.width":[I.required,I.min(s.settings.minWidth-h.value),I.max(_.value-h.value),I.step(1),Ee.serverValidation(s.validation.width.feedback)],"configuratorParams.height":[I.required,I.min(s.settings.minHeight-g.value),I.max(v.value-g.value),I.step(1),Ee.serverValidation(s.validation.height.feedback)],quantity:[I.required,I.min(1),I.step(1),Ee.serverValidation(s.validation.quantity.feedback)],marker:[Ee.serverValidation(s.validation.marker.feedback)]})),C=(0,r.computed)(()=>{let e=y.value,t=b.value,{quantity:n}=s.value,r=s.value.product?.costRub||0;if(!e||!t||!n||r===0)return null;let i=e*t/1e6;return xe.formatMoney(r*n*i)}),w=(0,r.computed)(()=>{let e=y.value,t=b.value,n=!!(e&&e>=s.settings.minWidth&&e<=s.settings.maxWidths[m.value.configuratorParams.netType]),r=!!(t&&t>=s.settings.minHeight&&t<=s.settings.maxHeights[m.value.configuratorParams.netType]),i=!!(s.value.quantity&&s.value.quantity>0);return n&&r&&i}),E=(e,t)=>{let i=m.value.configuratorParams;e&&e in i&&(i[e]=t);let a={...i,width:y.value??0,height:b.value??0};e===`width`&&d.value?.validate().catch(n.noop),e===`height`&&f.value?.validate().catch(n.noop),(0,r.nextTick)(()=>{!d.value?.validationErrored&&!f.value?.validationErrored&&a.height&&a.width&&c(`update:params`,a),D(`configuratorParams`,a)})},D=(e,n)=>{let r=new t.OrderItemBase(s.value);r[e]=n,e===`configuratorParams`&&(r.product=new t.ClientProduct),c(`update:value`,r)};return(0,r.watch)(()=>s.value,e=>{let t=(0,n.cloneDeep)((0,r.toRaw)(e)),i=t.configuratorParams.mountType,a=s.settings.widthOverlaps[i]??0,o=s.settings.heightOverlaps[i]??0;t.configuratorParams.width&&t.configuratorParams.width>0&&(t.configuratorParams.width-=a),t.configuratorParams.height&&t.configuratorParams.height>0&&(t.configuratorParams.height-=o),m.value=t},{deep:!0,immediate:!0}),(0,r.onMounted)(()=>{p.value?.select()}),i({validate:u.value?.validate,formReference:u}),(t,n)=>{let i=o.NCheckbox;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:m.value,rules:S.value,class:`flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Тип сетки`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:m.value.configuratorParams.netType,"onUpdate:value":[n[0]||=e=>m.value.configuratorParams.netType=e,n[1]||=e=>E(`netType`,e)],options:e.settings.netType.map(t=>({label:e.settings.descriptions.net_type[t],value:t}))},null,8,[`value`,`options`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Цвет профиля`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:m.value.configuratorParams.color,"onUpdate:value":[n[2]||=e=>m.value.configuratorParams.color=e,n[3]||=e=>E(`color`,e)],options:e.settings.color.map(t=>({label:e.settings.descriptions.color[t],value:t}))},null,8,[`value`,`options`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Вид крепления`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:m.value.configuratorParams.mountType,"onUpdate:value":[n[4]||=e=>m.value.configuratorParams.mountType=e,n[5]||=e=>E(`mountType`,e)],options:e.settings.mountType.map(t=>({label:e.settings.descriptions.mount_type[t],value:t}))},null,8,[`value`,`options`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{ref:`width-form-item-reference`,path:`configuratorParams.width`,label:`Ширина светового проёма от ${e.settings.minWidth-h.value} ${_.value?` до `+(_.value-h.value):``} мм.`},{feedback:(0,r.withCtx)(()=>[!e.validation.width.showFeedback&&y.value>=e.settings.minWidth&&y.value<=e.settings.maxWidths[m.value.configuratorParams.netType]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Rc,[(0,r.createVNode)((0,r.unref)(o.NText),{type:`success`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(`Ширина готового изделия `+(0,r.toDisplayString)(y.value),1)]),_:1}),(0,r.createVNode)((0,r.unref)(o.NButton),{quaternary:``,type:`info`,size:`tiny`,onClick:n[10]||=e=>c(`click:instructions-toggle`)},{default:(0,r.withCtx)(()=>[...n[25]||=[(0,r.createElementVNode)(`span`,{class:`text-sm`},`Руководство`,-1)]]),_:1})])):(0,r.createCommentVNode)(``,!0)]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{ref:`width-input-reference`,value:m.value.configuratorParams.width,"onUpdate:value":[n[6]||=e=>m.value.configuratorParams.width=e,n[9]||=e=>E(`width`,e)],parse:(0,r.unref)(ve),"show-button":!1,placeholder:`Введите высоту светового проёма`,class:`w-full`,onKeydown:n[7]||=e=>(0,r.unref)(ge)(e),onInput:n[8]||=t=>(0,r.unref)(ye)(e.validation,`width`),onFocus:(0,r.unref)(be)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{ref:`height-form-item-reference`,path:`configuratorParams.height`,label:`Высота светового проёма от ${e.settings.minHeight-g.value} ${v.value?` до `+(v.value-g.value):``} мм.`},{feedback:(0,r.withCtx)(()=>[!e.validation.height.showFeedback&&b.value>=e.settings.minHeight&&b.value<=e.settings.maxHeights[m.value.configuratorParams.netType]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,zc,[(0,r.createVNode)((0,r.unref)(o.NText),{type:`success`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(`Высота готового изделия `+(0,r.toDisplayString)(b.value),1)]),_:1}),(0,r.createVNode)((0,r.unref)(o.NButton),{quaternary:``,type:`info`,size:`tiny`,onClick:n[15]||=e=>c(`click:instructions-toggle`)},{default:(0,r.withCtx)(()=>[...n[26]||=[(0,r.createElementVNode)(`span`,{class:`text-sm`},`Руководство`,-1)]]),_:1})])):(0,r.createCommentVNode)(``,!0)]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:m.value.configuratorParams.height,"onUpdate:value":[n[11]||=e=>m.value.configuratorParams.height=e,n[14]||=e=>E(`height`,e)],parse:(0,r.unref)(ve),"show-button":!1,placeholder:`Введите высоту светового проёма`,class:`w-full`,onKeydown:n[12]||=e=>(0,r.unref)(ge)(e),onInput:n[13]||=t=>(0,r.unref)(ye)(e.validation,`height`),onFocus:(0,r.unref)(be)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`quantity`,label:`Количество`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:m.value.quantity,"onUpdate:value":[n[16]||=e=>m.value.quantity=e,n[19]||=e=>D(`quantity`,e??0)],"show-button":!1,placeholder:`Введите количество`,class:`w-full`,onKeydown:n[17]||=e=>(0,r.unref)(ge)(e,!1),onInput:n[18]||=t=>(0,r.unref)(ye)(e.validation,`quantity`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:m.value.marker??null,placeholder:`Введите маркировку`,onInput:n[20]||=t=>(0,r.unref)(ye)(e.validation,`marker`),"onUpdate:value":n[21]||=e=>{m.value.marker=e??null,D(`marker`,e??null)},onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1}),x.value?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,checked:m.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[22]||=e=>{m.value.isAdditionalSale=e??!1,D(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[27]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(pr,{"is-product-searching":e.isProductSearching,product:m.value.product,validation:e.validation.product},null,8,[`is-product-searching`,`product`,`validation`]),C.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Bc,[n[28]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,Vc,(0,r.toDisplayString)(C.value)+` ₽`,1)])):(0,r.createCommentVNode)(``,!0),w.value?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Hc,` Пожалуйста, заполните все обязательные поля корректно. `)),(0,r.createElementVNode)(`div`,Uc,[(0,r.createVNode)((0,r.unref)(o.NButton),{loading:e.isSubmitProcessing,disabled:!w.value||m.value.product.isNewRec(),type:`primary`,class:`self-start`,onClick:n[23]||=t=>c(`submit`,e.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.value.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`]),l.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,type:`default`,onClick:n[24]||=e=>c(`click:show-preview-drawer`)},{default:(0,r.withCtx)(()=>[...n[29]||=[(0,r.createTextVNode)(` Предварительный просмотр `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0)])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>c(`submit`,m.value)]])}}}),Gc={class:`flex flex-col gap-6`},Kc={class:`flex gap-4`},qc={class:`flex flex-col gap-2`},Jc={class:`flex gap-4`},Yc={class:`flex flex-col gap-2`},Xc={class:`flex gap-4`},Zc={class:`flex flex-col gap-2`},Qc=(0,r.defineComponent)({__name:`mosquito-configurator-measurement-instructions`,props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:[`update:show`],setup(e,{emit:t}){let n=F.initRefDependingOnDeviceResolution(`small`,`small`,`medium`),i=F.initRefDependingOnDeviceResolution(.98,.95,.8),a=(0,r.computed)(()=>window.innerWidth*i.value),s=t;return(t,i)=>{let c=o.NText;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NModal),{show:e.show,"show-icon":!1,size:(0,r.unref)(n),style:(0,r.normalizeStyle)(`width: ${a.value}px`),title:`Руководство по замеру`,"action-class":`grid grid-cols-2 !justify-between`,preset:`dialog`,onClose:i[0]||=e=>s(`update:show`,!1),onEsc:i[1]||=e=>s(`update:show`,!1),onMaskClick:i[2]||=e=>s(`update:show`,!1)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Gc,[(0,r.createVNode)(c,{type:`error`,class:`text-base font-medium`},{default:(0,r.withCtx)(()=>[...i[3]||=[(0,r.createTextVNode)(` Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. `,-1)]]),_:1}),i[22]||=(0,r.createElementVNode)(`div`,{class:`grid gap-6 md:grid-cols-2`},[(0,r.createElementVNode)(`div`,{class:`flex items-start gap-4`},[(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/measurement-height.png`,alt:`measurement-height`,class:`w-[7.5rem]`}),(0,r.createElementVNode)(`div`,{class:`flex flex-col gap-2`},[(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Замер ширины`),(0,r.createElementVNode)(`span`,null,`Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм`)])]),(0,r.createElementVNode)(`div`,{class:`flex items-start gap-4`},[(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/measurement-width.png`,alt:`measurement-height`,class:`w-[7.5rem]`}),(0,r.createElementVNode)(`div`,{class:`flex flex-col gap-2`},[(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Замер высоты`),(0,r.createElementVNode)(`span`,null,`Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм`)])])],-1),(0,r.createElementVNode)(`div`,Kc,[i[9]||=(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/mount.png`,alt:`measurement-height`,class:`w-[7.5rem]`},null,-1),(0,r.createElementVNode)(`div`,qc,[i[8]||=(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Крепление на раме сетки`,-1),(0,r.createElementVNode)(`span`,null,[i[4]||=(0,r.createTextVNode)(` Расчетные размеры москитной сетки: `,-1),i[5]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Ширина светового проема +`+(0,r.toDisplayString)(e.widthOverlaps.frame)+` мм. Высота светового проема +`+(0,r.toDisplayString)(e.heightOverlaps.frame)+` мм. `,1),i[6]||=(0,r.createElementVNode)(`br`,null,null,-1),i[7]||=(0,r.createTextVNode)(` Крепления находятся на раме сетки. `,-1)])])]),(0,r.createElementVNode)(`div`,Jc,[i[15]||=(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png`,alt:`measurement-height`,class:`w-[7.5rem]`},null,-1),(0,r.createElementVNode)(`div`,Yc,[i[14]||=(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Z-Образное крепление пластик (верх+низ)`,-1),(0,r.createElementVNode)(`span`,null,[i[10]||=(0,r.createTextVNode)(` Расчетные размеры москитной сетки:`,-1),i[11]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Ширина светового проема +`+(0,r.toDisplayString)(e.widthOverlaps.external_plastic)+` мм. Высота светового проема +`+(0,r.toDisplayString)(e.heightOverlaps.external_plastic)+` мм. `,1),i[12]||=(0,r.createElementVNode)(`br`,null,null,-1),i[13]||=(0,r.createTextVNode)(` Крепления прикручиваются к раме окна c помощью шурупов. `,-1)])])]),(0,r.createElementVNode)(`div`,Xc,[i[21]||=(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png`,alt:`measurement-height`,class:`w-[7.5rem]`},null,-1),(0,r.createElementVNode)(`div`,Zc,[i[20]||=(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Z-Образное крепление металл (верх+низ)`,-1),(0,r.createElementVNode)(`span`,null,[i[16]||=(0,r.createTextVNode)(` Расчетные размеры москитной сетки: `,-1),i[17]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Ширина светового проема +`+(0,r.toDisplayString)(e.widthOverlaps.external_metal)+` мм. Высота светового проема +`+(0,r.toDisplayString)(e.heightOverlaps.external_metal)+` мм. `,1),i[18]||=(0,r.createElementVNode)(`br`,null,null,-1),i[19]||=(0,r.createTextVNode)(` Крепления прикручиваются к раме окна c помощью шурупов. `,-1)])])])])]),_:1},8,[`show`,`size`,`style`])}}}),$c={class:`grid md:grid-cols-2`},el=(0,r.defineComponent)({__name:`mosquito-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.computed)(()=>F.isPhoneDevice()),l=(0,r.ref)(!1),u=(0,r.ref)(!1),d=(0,r.ref)(a.cartItem),f=(0,r.useTemplateRef)(`mosquito-configurator-form`),p=(0,r.ref)({width:{},height:{},quantity:{},marker:{}}),m=(0,r.ref)(!1),h=(0,r.ref)(!1),g=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,300)),_=(0,n.debounce)(async e=>{d.value.product=new t.ClientProduct,f.value?.formReference?.validate(t=>{t||(m.value=!0,a.eventEmitter.emit(`configurator:search-product`,{category:a.cartItem.category,params:e,validationFieldResultData:p.value,callback:e=>{e?d.value.product=e:p.value.product={showFeedback:!0,feedback:`Не удалось найти товар по указанным параметрам.`,validationStatus:`error`},m.value=!1}}))}).catch(n.noop)},g.value),v=()=>{h.value=!0,s(`submit`,d.value,p.value,()=>{h.value=!1})};return(0,r.watch)(()=>a.cartItem,e=>{d.value=e},{deep:!0}),(t,n)=>{let i=bc;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)(Qc,{show:u.value,"onUpdate:show":n[0]||=e=>u.value=e,"height-overlaps":e.settings.heightOverlaps,"width-overlaps":e.settings.widthOverlaps},null,8,[`show`,`height-overlaps`,`width-overlaps`]),(0,r.createElementVNode)(`div`,$c,[c.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NDrawer),{key:1,show:l.value,"onUpdate:show":n[4]||=e=>l.value=e,"default-width":375,resizable:``},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NDrawerContent),null,{header:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NButton),{size:`small`,type:`primary`,class:`block justify-self-end`,onClick:n[2]||=e=>l.value=!1},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1})]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(Lc,{"configurator-params":d.value.configuratorParams,settings:e.settings,onOpenInstructions:n[3]||=e=>u.value=!0},null,8,[`configurator-params`,`settings`])]),_:1})]),_:1},8,[`show`])):((0,r.openBlock)(),(0,r.createBlock)(Lc,{key:0,"configurator-params":d.value.configuratorParams,settings:e.settings,onOpenInstructions:n[1]||=e=>u.value=!0},null,8,[`configurator-params`,`settings`])),(0,r.createVNode)(Wc,{ref:`mosquito-configurator-form`,value:d.value,"onUpdate:value":n[5]||=e=>d.value=e,validation:p.value,settings:e.settings,"is-product-searching":m.value,"is-submit-processing":h.value,"onUpdate:params":n[6]||=e=>(0,r.unref)(_)(e),onSubmit:n[7]||=e=>v(),"onClick:instructionsToggle":n[8]||=e=>u.value=!u.value,"onClick:showPreviewDrawer":n[9]||=e=>l.value=!0},null,8,[`value`,`validation`,`settings`,`is-product-searching`,`is-submit-processing`])])],64)}}}),tl=(0,r.defineComponent)({__name:`strip-configurator-line-item`,props:{value:{},index:{},path:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},isLastLine:{type:Boolean,default:!1},validation:{}},emits:[`update:value`,`click:add-line`,`click:remove-line`],setup(e,{expose:t,emit:n}){let i=e,a=n,s=(0,r.useTemplateRef)(`width-input-element`),c=(0,r.ref)(!1),l=(0,r.ref)(i.value),u=(0,r.useTemplateRef)(`form-item-reference`),d=(0,r.computed)(()=>!u.value?.validationErrored),f=e=>{l.value=e,a(`update:value`,e,i.index,c)},p=e=>{ge(e),(e.key===`Enter`||e.code===`Enter`)&&!i.isLastLine&&(e.preventDefault(),e.stopPropagation())},m=()=>{s.value?.select()};return(0,r.watch)(()=>i.value,e=>{l.value=e}),(0,r.onMounted)(()=>{i.autoFocus&&(0,r.nextTick)(()=>{m()})}),t({isValid:d,formItemReference:u}),(t,n)=>{let i=cr,s=ar;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NFormItem),{ref:`form-item-reference`,path:e.path,label:`Полоса №${e.index+1}, мм`,class:`sc-hide-empty-feedback-message`},{feedback:(0,r.withCtx)(()=>[d.value?((0,r.openBlock)(),(0,r.createBlock)(pr,{key:0,"is-product-searching":c.value,product:e.product,validation:e.validation.product},null,8,[`is-product-searching`,`product`,`validation`])):(0,r.createCommentVNode)(``,!0)]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NDropdown),{trigger:`click`,options:e.suggestionOption,placement:`bottom-start`,size:`large`,onSelect:f},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{ref:`width-input-element`,value:l.value??null,class:`w-full`,"show-button":!1,parse:(0,r.unref)(ve),placeholder:`Введите ширину`,onKeydown:p,onInput:n[0]||=t=>(0,r.unref)(ye)(e.validation,`linesWidths.${e.index}`),onFocus:(0,r.unref)(be),"onUpdate:value":f},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`options`]),(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:e.addLineButtonDisabled,size:`medium`,class:`ml-2`,onClick:n[1]||=t=>a(`click:add-line`,e.index)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1},8,[`disabled`]),(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:e.removeLineButtonDisabled,size:`medium`,class:`ml-2`,onClick:n[2]||=t=>a(`click:remove-line`,e.index)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s)]),_:1},8,[`disabled`])]),_:1},8,[`path`,`label`])}}}),nl={class:`my-2 flex w-full flex-col`},rl={key:1},il={class:`text-lg font-semibold`},al={class:`flex gap-3`},ol=(0,r.defineComponent)({__name:`strip-configurator-form`,props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:[`update:value`,`update:params`,`submit`,`click:add-line`,`click:remove-line`],setup(e,{expose:t,emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`form-reference`),l=(0,r.useTemplateRef)(`line-items-reference`),u=(0,r.ref)((0,n.cloneDeep)(a.value)),d=(0,r.computed)(()=>{let e={length:[I.required,I.min(a.settings.minLength),I.max(a.settings.maxLength),I.step(a.settings.lengthStep),Ee.serverValidation(a.validation.length.feedback)],quantity:[I.required,I.min(1),Ee.serverValidation(a.validation.quantity.feedback)],marker:[Ee.serverValidation(a.validation.marker.feedback)]};return(0,n.forEach)(u.value,(t,n)=>{e[`configuratorParams.linesWidths.${n}`]=[I.required,I.min(a.settings.minLineWidth),I.step(a.settings.lineWidthStep),Ee.serverValidation(a.validation[`linesWidths.${n}`]?.feedback)]}),e}),f=(0,r.ref)(a.settings.canSetDopProdaga??!1),p=(0,r.computed)(()=>a.value[0].configuratorParams.linesWidths.reduce((e,t)=>(e??0)+(t??0),0)),m=(0,r.computed)(()=>a.settings.width-p.value),h=(0,r.computed)(()=>!a.value.some(({product:e})=>!e||e.isNewRec())),g=(0,r.computed)(()=>a.isSubmitProcessing||!h.value||m.value<=0||u.value.length>=a.settings.maxLinesCount||a.value.some(e=>e.product.isNewRec())),_=(0,r.computed)(()=>{let[e]=u.value;return!h.value||m.value!==0||!e?.length||e.length>a.settings.maxLength||e.length<a.settings.minLength||e.quantity===0}),v=(0,r.computed)(()=>e=>m.value===0?void 0:[{label:`${(m.value>0?`Остаток +`:`Излишек `)+m.value} мм.`,key:m.value+e}]),y=(0,r.computed)(()=>{let{length:e}=a.value[0];if(!e||p.value!==a.settings.width)return null;let t=(0,n.reduce)(a.value,(e,t)=>e+(t.product?.costRub||0),0);return xe.formatMoney(t*a.value[0].quantity*e)}),b=(e,t,i)=>{u.value[t].product.id=-1;let{configuratorParams:a}=u.value[t];a.linesWidths[t]=e,x(`configuratorParams`,a),l.value?.at(t)?.formItemReference?.validate().catch(n.noop),(0,r.nextTick)(()=>{l.value?.at(t)?.isValid&&s(`update:params`,a,t,i)})},x=(e,t)=>{u.value.forEach(n=>{n[e]=t}),s(`update:value`,u.value)};return(0,r.watch)(()=>a.value,e=>{u.value=(0,n.cloneDeep)(e)},{deep:!0}),t({validate:c.value?.validate,formReference:c}),(t,n)=>{let i=o.NCheckbox;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:u.value[0],rules:d.value,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(u.value,(t,i)=>((0,r.openBlock)(),(0,r.createBlock)(tl,{key:i,ref_for:!0,ref:`line-items-reference`,value:t.configuratorParams?.linesWidths.at(i)??null,"auto-focus":(t.configuratorParams?.linesWidths.at(i)??0)===0,index:i,path:`configuratorParams.linesWidths.${i}`,product:t.product,settings:e.settings,validation:e.validation,"suggestion-option":v.value(t.configuratorParams?.linesWidths.at(i)??0),"add-line-button-disabled":m.value<=0||e.value.length>=e.settings.maxLinesCount||e.value.some(e=>e.product.isNewRec()),"remove-line-button-disabled":u.value.length===1,"is-last-line":i===u.value.length-1&&m.value===0,"onUpdate:value":b,"onClick:addLine":n[0]||=e=>s(`click:add-line`,e),"onClick:removeLine":n[1]||=e=>s(`click:remove-line`,e)},null,8,[`value`,`auto-focus`,`index`,`path`,`product`,`settings`,`validation`,`suggestion-option`,`add-line-button-disabled`,`remove-line-button-disabled`,`is-last-line`]))),128)),(0,r.createElementVNode)(`div`,nl,[m.value<0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NText),{key:0,type:`error`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Сумма ширин всех полос должна быть равна `+(0,r.toDisplayString)(e.settings.width),1)]),_:1})):(0,r.createCommentVNode)(``,!0),h.value&&u.value.length===e.settings.maxLinesCount&&m.value>0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NText),{key:1,type:`error`},{default:(0,r.withCtx)(()=>[...n[15]||=[(0,r.createTextVNode)(` Остаток резки должен быть равен 0 `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,null,[n[16]||=(0,r.createTextVNode)(` Остаток для резки: `,-1),(0,r.createVNode)((0,r.unref)(o.NText),{type:m.value>=0?`Success`:`error`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(m.value),1)]),_:1},8,[`type`]),(0,r.createTextVNode)(` из `+(0,r.toDisplayString)(e.settings.width)+` мм `,1)])]),(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:g.value,type:`primary`,class:`self-center`,onClick:n[2]||=e=>s(`click:add-line`,u.value.length)},{default:(0,r.withCtx)(()=>[...n[17]||=[(0,r.createTextVNode)(` Добавить полосу `,-1)]]),_:1},8,[`disabled`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`length`,label:`Метраж ${e.settings.minLength?` от `+e.settings.minLength:``} ${e.settings.maxLength?` до `+e.settings.maxLength:``} м.`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value[0].length,"onUpdate:value":[n[3]||=e=>u.value[0].length=e,n[6]||=e=>x(`length`,e)],parse:(0,r.unref)(ve),"show-button":!1,placeholder:`Введите метраж`,class:`w-full`,onKeydown:n[4]||=e=>(0,r.unref)(ge)(e,!1),onInput:n[5]||=t=>(0,r.unref)(ye)(e.validation,`length`),onFocus:(0,r.unref)(be)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`quantity`,label:`Количество`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value[0].quantity,"onUpdate:value":[n[7]||=e=>u.value[0].quantity=e,n[10]||=e=>x(`quantity`,e)],"show-button":!1,placeholder:`Введите количество`,class:`w-full`,onKeydown:n[8]||=e=>(0,r.unref)(ge)(e,!1),onInput:n[9]||=t=>(0,r.unref)(ye)(e.validation,`quantity`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:u.value[0].marker??null,placeholder:`Введите маркировку`,onInput:n[11]||=t=>(0,r.unref)(ye)(e.validation,`marker`),"onUpdate:value":n[12]||=e=>{u.value[0].marker=e??null,x(`marker`,e??null)},onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1}),f.value?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,checked:u.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[13]||=e=>{u.value[0].isAdditionalSale=e??!1,x(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[18]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),y.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,rl,[n[19]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,il,(0,r.toDisplayString)(y.value)+` ₽`,1)])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,al,[(0,r.createVNode)((0,r.unref)(o.NButton),{loading:e.isSubmitProcessing,disabled:_.value,type:`primary`,class:`self-start`,onClick:n[14]||=e=>s(`submit`,u.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(u.value[0].isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`])])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>s(`submit`,u.value)]])}}}),sl={class:`flex grow flex-col`},cl=[`src`],ll={class:`w-full`},ul=(0,r.defineComponent)({__name:`strip-configurator-preview`,props:{value:{},settings:{}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,sl,[(0,r.createElementVNode)(`img`,{src:`/img/configurators/strip/strip-`+e.value.length+`.png`,class:`w-full max-w-96 self-center py-5`,alt:`Штрипс`},null,8,cl),(0,r.createElementVNode)(`div`,ll,[(0,r.createTextVNode)(` Число полос можно указать от `+(0,r.toDisplayString)(e.settings.minLinesCount)+` до `+(0,r.toDisplayString)(e.settings.maxLinesCount)+`. `,1),n[0]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Минимальная ширина полосы `+(0,r.toDisplayString)(e.settings.minLineWidth)+` мм. `,1),n[1]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Ширина всех полос `+(0,r.toDisplayString)(e.settings.width)+` мм. `,1),n[2]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Шаг ширины полосы - `+(0,r.toDisplayString)(e.settings.lineWidthStep)+` мм. `,1)])]))}}),dl={class:`flex flex-col gap-2`},fl={class:`flex grow flex-col px-5 md:w-104`},pl=(0,r.defineComponent)({__name:`strip-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`strip-configurator-form`),l=(0,r.ref)(a.cartItems),u=(0,r.ref)({width:{},length:{},quantity:{},marker:{}}),d=(0,r.ref)(!1),f=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,300)),p=(0,r.computed)(()=>l.value[0].configuratorParams?.linesWidths.reduce((e,t)=>(e??0)+(t??0),0)),m=e=>{e===void 0&&(e=l.value.length-1);let n=l.value.at(0);if(!n)return;n.configuratorParams.linesWidths=n.configuratorParams.linesWidths.toSpliced(e+1,0,null),l.value.forEach(e=>{e.configuratorParams.linesWidths=n.configuratorParams.linesWidths});let r=new t.OrderItemBase({quantity:n?.quantity??1,category:n?.category,length:n?.length??a.settings.minLength,marker:n?.marker,configuratorParams:{linesWidths:n?.configuratorParams.linesWidths}});l.value=l.value.toSpliced(e+1,0,r)},h=e=>{let t=l.value.at(0);t&&(t.configuratorParams.linesWidths=t.configuratorParams.linesWidths.toSpliced(e,1),l.value.forEach(e=>{e.configuratorParams.linesWidths=t.configuratorParams.linesWidths}),l.value=l.value.toSpliced(e,1),delete u[`linesWidths.${e}`],delete u[`linesWidths.${e}`])},g=(0,n.debounce)(async(e,n,r)=>{let i={linesWidths:e.linesWidths.at(n)};r.value=!0,u.value[`linesWidths.${n}`]={},l.value[n].product=new t.ClientProduct,a.eventEmitter.emit(`configurator:search-product`,{category:l.value[n].category,params:i,validationFieldResultData:u.value,callback:e=>{e?(l.value[n].product=e,n===l.value.length-1&&l.value.length<a.settings.maxLinesCount&&p.value&&p.value<a.settings.width&&m()):(l.value[n].product=new t.ClientProduct,u.value[`linesWidths.${n}`]={showFeedback:!0,feedback:`Не удалось найти товар`,validationStatus:`error`},r.value=!1),r.value=!1}})},f.value),_=async()=>{c.value?.formReference?.validate(e=>{if(!e){d.value=!0;let e=l.value.at(0);if(!e)return;s(`submit`,e,u.value,()=>{d.value=!1,(0,r.nextTick)(()=>{c.value?.formReference?.restoreValidation()})})}}).catch(n.noop)};return(0,r.watch)(()=>a.cartItems,e=>{l.value=e.map(e=>new t.OrderItemBase(e))}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,dl,[e.settings.allowShowTable?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-center`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,fl,[(0,r.createVNode)(ul,{value:l.value,"onUpdate:value":n[1]||=e=>l.value=e,settings:e.settings},null,8,[`value`,`settings`]),(0,r.createVNode)(ol,{ref:`strip-configurator-form`,value:l.value,"onUpdate:value":n[2]||=e=>l.value=e,validation:u.value,settings:e.settings,"is-submit-processing":d.value,"onUpdate:params":(0,r.unref)(g),onSubmit:_,"onClick:addLine":m,"onClick:removeLine":h},null,8,[`value`,`validation`,`settings`,`is-submit-processing`,`onUpdate:params`])])])}}}),ml={class:`flex flex-col gap-3`},hl=(0,r.defineComponent)({__name:`metal-for-doors-configurator-form`,props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:[`update:value`,`update:params`,`submit`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useTemplateRef)(`form-reference`),u=(0,r.useTemplateRef)(`first-input-element`),d=(0,r.ref)((0,n.cloneDeep)(s.value)),f=(0,r.computed)(()=>({"configuratorParams.width":[I.required,I.min(s.settings.minWidth),...s.settings.maxWidth?[I.max(s.settings.maxWidth)]:[],I.step(1),Ee.serverValidation(s.validation.width.feedback)],"configuratorParams.length":[I.required,I.min(s.settings.minLength),I.max(s.settings.maxLength),I.step(1),Ee.serverValidation(s.validation.length.feedback)],quantity:[I.required,I.min(1),I.step(1),Ee.serverValidation(s.validation.quantity.feedback)],marker:[Ee.serverValidation(s.validation.marker.feedback)]})),p=(0,r.ref)(s.settings.canSetDopProdaga??!1),m=()=>{c(`update:params`,d.value.configuratorParams),h(`configuratorParams`,d.value.configuratorParams)},h=(e,n)=>{let r=new t.OrderItemBase(s.value);r[e]=n,e===`configuratorParams`&&(r.product=new t.ClientProduct),c(`update:value`,r)},g=()=>{u.value?.select()};return(0,r.watch)(()=>s.value,e=>{d.value=(0,n.cloneDeep)(e)},{deep:!0}),(0,r.onMounted)(()=>{s.value.isNewRec()&&(0,r.nextTick)(()=>{g()})}),i({validate:l.value?.validate,formReference:l}),(t,n)=>{let i=o.NCheckbox;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:d.value,rules:f.value,disabled:e.isSubmitProcessing,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.width`,label:`Ширина, ${e.settings.minWidth?` от `+e.settings.minWidth:``}${e.settings.maxWidth?` до `+e.settings.maxWidth:``} мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{ref:`first-input-element`,value:d.value.configuratorParams.width,"onUpdate:value":[n[0]||=e=>d.value.configuratorParams.width=e,m],class:`w-full`,parse:(0,r.unref)(ve),"show-button":!1,placeholder:`Введите ширину`,onKeydown:n[1]||=e=>(0,r.unref)(ge)(e),onInput:n[2]||=t=>(0,r.unref)(ye)(e.validation,`width`),onFocus:(0,r.unref)(be)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.length`,label:`Длина, ${e.settings.minLength?` от `+e.settings.minLength:``}${e.settings.maxLength?` до `+e.settings.maxLength:``} мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.configuratorParams.length,"onUpdate:value":[n[3]||=e=>d.value.configuratorParams.length=e,m],placeholder:`Введите длину`,parse:(0,r.unref)(ve),"show-button":!1,class:`w-full`,onKeydown:n[4]||=e=>(0,r.unref)(ge)(e),onInput:n[5]||=t=>(0,r.unref)(ye)(e.validation,`length`),onFocus:(0,r.unref)(be)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`quantity`,label:`Количество`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:e.value.quantity,placeholder:`Введите количество`,min:1,"show-button":!1,class:`w-full`,onKeydown:n[6]||=e=>(0,r.unref)(ge)(e,!1),onInput:n[7]||=t=>(0,r.unref)(ye)(e.validation,`quantity`),"onUpdate:value":n[8]||=e=>h(`quantity`,e??0),onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:e.value.marker??null,placeholder:`Введите маркировку`,onInput:n[9]||=t=>(0,r.unref)(ye)(e.validation,`marker`),"onUpdate:value":n[10]||=e=>h(`marker`,e??null),onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1}),p.value?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,checked:d.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[11]||=e=>{d.value.isAdditionalSale=e??!1,h(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[13]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(pr,{"is-product-searching":e.isProductSearching,product:e.value.product,validation:e.validation.product},null,8,[`is-product-searching`,`product`,`validation`]),(0,r.createElementVNode)(`div`,ml,[(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:e.value.product.isNewRec()||e.isProductSearching||e.isSubmitProcessing||e.value.length===0||e.value.width===0||e.value.quantity===0,type:`primary`,class:`self-start`,onClick:n[12]||=t=>c(`submit`,e.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.value.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`disabled`])])]),_:1},8,[`model`,`rules`,`disabled`])),[[(0,r.unref)(T),()=>c(`submit`,d.value)]])}}}),gl={class:`flex flex-col gap-2 w-72`},_l=(0,r.defineComponent)({__name:`metal-for-doors-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`metal-for-doors-configurator-form`),l=(0,r.ref)(a.cartItem),u=(0,r.ref)({width:{},length:{},quantity:{},marker:{}}),d=(0,r.ref)(!1),f=(0,r.ref)(!1),p=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,300)),m=(0,n.debounce)(async e=>{l.value.product=new t.ClientProduct,c.value?.formReference?.validate(t=>{t||(d.value=!0,a.eventEmitter.emit(`configurator:search-product`,{category:a.cartItem.category,params:e,validationFieldResultData:u.value,callback:e=>{e?l.value.product=e:u.value.product={showFeedback:!0,feedback:`Не удалось найти товар по указанным параметрам.`,validationStatus:`error`},d.value=!1}}))}).catch(n.noop)},p.value),h=async()=>{c.value?.formReference?.validate(e=>{e||(f.value=!0,s(`submit`,l.value,u.value,()=>{f.value=!1,(0,r.nextTick)(()=>{c.value?.formReference?.restoreValidation()})}))}).catch(n.noop)};return(0,r.watch)(()=>a.cartItem,e=>{l.value=new t.OrderItemBase(e)},{deep:!0}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,gl,[e.settings.allowShowTable?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-center`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[4]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(hl,{ref:`metal-for-doors-configurator-form`,value:l.value,"onUpdate:value":n[1]||=e=>l.value=e,validation:u.value,settings:e.settings,"is-submit-processing":f.value,"is-product-searching":d.value,"onUpdate:params":n[2]||=e=>(0,r.unref)(m)(e),onSubmit:n[3]||=e=>h()},null,8,[`value`,`validation`,`settings`,`is-submit-processing`,`is-product-searching`])])}}}),vl={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function yl(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,vl,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M256 112v288m144-144H112`},null,-1)]])}var bl=(0,r.markRaw)({name:`ion-add`,render:yl}),xl={key:0,class:`-mt-1 text-sm text-gray-500`},Sl={class:`font-bold`},Cl={class:`flex flex-col gap-3`},wl={key:0,class:`mt-4 flex flex-col gap-1.5`},Tl={class:`flex flex-col gap-1 text-sm text-gray-700`},El={key:0},Dl={key:1},Ol={"form-array-name":`items`,class:`flex flex-col gap-3`},kl={class:`grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3`},Al={key:0,class:`flex flex-wrap items-end gap-2`},jl={class:`whitespace-nowrap text-xl font-bold`},Ml={key:0,class:`whitespace-nowrap text-lg text-gray-500`},Nl={class:`font-bold`},Pl={class:`font-bold`},Fl={class:`flex gap-3`},Il=(0,r.defineComponent)({__name:`sandwich-configurator-form`,props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:[`update:value`,`update:params`,`submit`,`add-item`,`remove-item`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useTemplateRef)(`form-reference`),u=(0,r.ref)((0,n.cloneDeep)(s.value)),d=(0,r.ref)({...s.validation}),f=e=>{delete d.value[e],l.value?.restoreValidation()};(0,r.watch)(()=>s.validation,e=>{d.value={...e},Object.values(e).some(e=>e?.feedback)&&(0,r.nextTick)(()=>l.value?.validate(n.noop).catch(n.noop))},{deep:!0});let p=(0,r.computed)(()=>s.value.category),m=(0,r.ref)(null),h=(0,r.ref)(null),g=(0,r.computed)(()=>p.value.products??[]),_=(0,r.computed)(()=>g.value.map(e=>({label:e.name,value:e.id}))),v=(e,t,n)=>{let r=e!=null&&e>0,i=t!=null&&t>0;return!r&&!i?null:r&&i?`от ${e} ${n} до ${t} ${n}`:r?`от ${e} ${n}`:`до ${t} ${n}`},y=(0,r.computed)(()=>v(s.settings.minWidth,m.value?.properties?.width,`мм`)),b=(0,r.computed)(()=>v(s.settings.minLength,m.value?.properties?.length,`мм`)),x=(0,r.ref)(null),S=(0,r.ref)(!1),C=(0,r.computed)(()=>{let e={marker:[Ee.serverValidation(d.value.marker?.feedback)]};return u.value.configuratorParams.items.forEach((t,n)=>{e[`configuratorParams.items.${n}.width`]=[I.required,I.min(s.settings.minWidth),...m.value?.properties?.width?[I.max(m.value.properties.width)]:[],I.step(1),Ee.serverValidation(d.value[`items.${n}.width`]?.feedback)],e[`configuratorParams.items.${n}.length`]=[I.required,I.min(s.settings.minLength),...m.value?.properties?.length?[I.max(m.value.properties.length)]:[],I.step(1),Ee.serverValidation(d.value[`items.${n}.length`]?.feedback)],e[`configuratorParams.items.${n}.count`]=[I.required,I.min(1),I.step(1),Ee.serverValidation(d.value[`items.${n}.count`]?.feedback)]}),e}),w=(0,r.ref)(s.settings.canSetDopProdaga??!1),E=(0,r.computed)(()=>u.value.configuratorParams.items.some(e=>!m.value||!e.width||e.width<s.settings.minWidth||e.width>(m.value.properties?.width??0)||e.length===0||e.length<s.settings.minLength||e.length>(m.value.properties?.length??0)||!e.count||e.count<1)),D=(0,r.computed)(()=>!m.value||E.value||u.value.configuratorParams.items.length===0),O=(0,r.ref)(null),k=(0,r.computed)(()=>O.value===null?``:xe.formatMoney(O.value)),A=e=>{if(!e){m.value=null,h.value=null,u.value.product=new t.ClientProduct,x.value=null;return}let n=g.value.find(t=>t.id===e);n&&(m.value=n,h.value=e,u.value.product=n,P(`product`,u.value.product),u.value.configuratorParams.items.forEach(e=>{n.properties?.width&&e.width>n.properties.width&&(e.width=n.properties.width),n.properties?.length&&e.length>n.properties.length&&(e.length=n.properties.length)}),j())},ee=!1,j=()=>{ee=!0,x.value=null,O.value=null,u.value.configuratorParams.calculationId=``,u.value.quantity=0},te=async()=>{!m.value||u.value.configuratorParams.items.length===0||E.value?j():l.value?.validate(e=>{e?j():(S.value=!0,!m.value||!p.value?(j(),S.value=!1):s.eventEmitter.emit(`configurator:calculate`,{category:p.value,params:{productId:m.value.id,items:u.value.configuratorParams.items},callback:e=>{e?(x.value=e,u.value.configuratorParams.calculationId=e.id,u.value.quantity=e.quantity,(0,r.nextTick)(()=>{P(`quantity`,e.quantity)})):(u.value.configuratorParams.calculationId=``,u.value.quantity=0,j()),P(`configuratorParams`,u.value.configuratorParams),ne(),S.value=!1}}))}).catch(()=>{j(),S.value=!1})},ne=()=>{if(!m.value?.costRub||!x.value){O.value=null;return}let e=x.value.quantity*m.value.costRub;O.value=xe.roundMoney(e)},M=e=>{let t=u.value.configuratorParams.items[e];m.value&&(m.value.properties?.width&&t.width>m.value.properties.width&&(t.width=m.value.properties.width),m.value.properties?.length&&t.length>m.value.properties.length&&(t.length=m.value.properties.length)),P(`configuratorParams`,u.value.configuratorParams),j()},re=()=>{u.value.configuratorParams.calculationId=``,u.value.configuratorParams.items.push({width:0,length:0,count:1}),P(`configuratorParams`,u.value.configuratorParams),j(),c(`add-item`,u.value.configuratorParams.items.length)},ie=e=>{u.value.configuratorParams.items.splice(e,1),P(`configuratorParams`,u.value.configuratorParams),j(),c(`remove-item`,e)},N=()=>{D.value||S.value||s.isSubmitProcessing||(x.value?c(`submit`,u.value):te())},P=(e,n)=>{let r=new t.OrderItemBase(s.value);r[e]=n,c(`update:value`,r)};(0,r.watch)(()=>s.value,e=>{let t=(0,n.cloneDeep)((0,r.toRaw)(e));(!t.configuratorParams.items||t.configuratorParams.items.length===0)&&(t.configuratorParams.items=[{width:0,length:0,count:1}]),u.value=t,s.value.product&&!s.value.product.isNewRec()&&(m.value=s.value.product,h.value=s.value.product.id),s.value.product.isNewRec()&&(m.value=null,h.value=null),ee?ee=!1:F()},{deep:!0});let F=()=>{let{calculationId:e}=u.value.configuratorParams,t=u.value.quantity??0;e&&t>0&&u.value.product&&!u.value.product.isNewRec()&&(x.value={id:e,quantity:t,sheets:[]},ne())};return(0,r.onMounted)(()=>{s.value.product&&!s.value.product.isNewRec()&&(m.value=s.value.product,h.value=s.value.product.id),F()}),i({validate:l.value?.validate,formReference:l}),(t,n)=>{let i=ar,a=bl;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:u.value,rules:C.value,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Товар`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:h.value,"onUpdate:value":[n[0]||=e=>h.value=e,A],options:_.value,placeholder:`Выберите материал`,filterable:``},null,8,[`value`,`options`])]),_:1}),m.value?.costRub==null?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,xl,[(0,r.createElementVNode)(`span`,Sl,(0,r.toDisplayString)(m.value.code),1),(0,r.createTextVNode)(` — `+(0,r.toDisplayString)((0,r.unref)(xe).formatMoney(m.value.costRub))+` `+(0,r.toDisplayString)(m.value.currency.symbol)+`/шт. `,1)])),(0,r.createElementVNode)(`div`,Cl,[m.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,wl,[n[7]||=(0,r.createElementVNode)(`div`,{class:`w-full font-bold`},`Размеры изделий`,-1),(0,r.createElementVNode)(`div`,Tl,[y.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,El,`Ширина `+(0,r.toDisplayString)(y.value)+`.`,1)):(0,r.createCommentVNode)(``,!0),b.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Dl,`Длина `+(0,r.toDisplayString)(b.value)+`.`,1)):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,Ol,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(u.value.configuratorParams.items,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:t,class:`flex grow gap-2`},[(0,r.createElementVNode)(`div`,kl,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.items.${t}.width`,label:`Ширина, мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value.configuratorParams.items[t].width,"onUpdate:value":[e=>u.value.configuratorParams.items[t].width=e,e=>M(t)],parse:(0,r.unref)(ve),"show-button":!1,disabled:!m.value,placeholder:`Ширина`,class:`w-full`,onKeydown:n[1]||=e=>(0,r.unref)(ge)(e),onInput:e=>f(`items.${t}.width`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.items.${t}.length`,label:`Длина, мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value.configuratorParams.items[t].length,"onUpdate:value":[e=>u.value.configuratorParams.items[t].length=e,e=>M(t)],parse:(0,r.unref)(ve),"show-button":!1,disabled:!m.value,placeholder:`Длина`,class:`w-full`,onKeydown:n[2]||=e=>(0,r.unref)(ge)(e),onInput:e=>f(`items.${t}.length`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.items.${t}.count`,label:`Количество, шт`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value.configuratorParams.items[t].count,"onUpdate:value":[e=>u.value.configuratorParams.items[t].count=e,e=>M(t)],parse:(0,r.unref)(ve),"show-button":!1,disabled:!m.value,placeholder:`Количество`,class:`w-full`,onKeydown:n[3]||=e=>(0,r.unref)(ge)(e,!1),onInput:e=>f(`items.${t}.count`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`])]),(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:!m.value||u.value.configuratorParams.items.length<=1,type:`error`,size:`medium`,class:`mt-5`,onClick:e=>ie(t)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1},8,[`disabled`,`onClick`])]))),128))]),m.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:1,disabled:E.value,type:`default`,class:`self-center`,onClick:re},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a),n[8]||=(0,r.createTextVNode)(` Добавить изделие `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0)]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка распила`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:u.value.marker??null,disabled:!m.value,placeholder:`Введите маркировку распила`,onInput:n[4]||=e=>f(`marker`),"onUpdate:value":n[5]||=e=>P(`marker`,e??null),onFocus:(0,r.unref)(be)},null,8,[`value`,`disabled`,`onFocus`])]),_:1}),w.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NCheckbox),{key:1,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[6]||=e=>{u.value.isAdditionalSale=e??!1,P(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[9]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)((0,r.unref)(o.NSpin),{show:S.value,size:`small`,class:`grow`},{default:(0,r.withCtx)(()=>[x.value&&m.value&&O.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Al,[(0,r.createElementVNode)(`div`,null,[n[10]||=(0,r.createTextVNode)(` Итого: `,-1),(0,r.createElementVNode)(`span`,jl,(0,r.toDisplayString)(k.value)+` `+(0,r.toDisplayString)(m.value.currency.symbol),1)]),x.value.quantity&&m.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ml,[(0,r.createElementVNode)(`span`,Nl,`(`+(0,r.toDisplayString)(x.value.quantity)+` шт.`,1),n[11]||=(0,r.createTextVNode)(` x `,-1),(0,r.createElementVNode)(`span`,Pl,(0,r.toDisplayString)((0,r.unref)(xe).formatMoney(m.value.costRub))+` `+(0,r.toDisplayString)(m.value.currency.symbol)+`/шт.)`,1)])):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`show`]),(0,r.createElementVNode)(`div`,Fl,[x.value&&!S.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,loading:e.isSubmitProcessing,disabled:D.value||S.value,type:`primary`,class:`self-start`,onClick:N},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(u.value.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`])):((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:1,loading:S.value,disabled:D.value||S.value,type:`info`,class:`self-start`,onClick:te},{default:(0,r.withCtx)(()=>[...n[12]||=[(0,r.createTextVNode)(` Рассчитать `,-1)]]),_:1},8,[`loading`,`disabled`]))])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),N]])}}}),Ll={class:`flex flex-col gap-2`},Rl={class:`w-104 flex grow flex-col px-5`},zl=(0,r.defineComponent)({__name:`sandwich-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`sandwich-configurator-form`),l=(0,r.ref)(a.cartItem),u=(0,r.ref)({width:{},length:{},quantity:{},marker:{},product:{}}),d=(0,r.ref)(!1),f=async()=>{c.value?.formReference?.validate(e=>{if(!e){d.value=!0;let e=(0,n.cloneDeep)(l.value);`items`in e.configuratorParams&&delete e.configuratorParams.items,s(`submit`,e,u.value,()=>{d.value=!1,(0,r.nextTick)(()=>{c.value?.formReference?.restoreValidation()})})}}).catch(n.noop)},p=e=>{u.value[`items.${e}.width`]={},u.value[`items.${e}.length`]={},u.value[`items.${e}.count`]={}},m=e=>{delete u.value[`items.${e}.width`],delete u.value[`items.${e}.length`],delete u.value[`items.${e}.count`]};return(0,r.onMounted)(()=>{a.cartItem.configuratorParams.items.forEach((e,t)=>{u.value[`items.${t}.width`]={},u.value[`items.${t}.length`]={},u.value[`items.${t}.count`]={}})}),(0,r.watch)(()=>a.cartItem,e=>{l.value=new t.OrderItemBase(e)},{deep:!0}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ll,[e.settings.allowShowTable&&l.value.isNewRec()?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-center`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,Rl,[(0,r.createVNode)(Il,{ref:`sandwich-configurator-form`,value:l.value,"onUpdate:value":n[1]||=e=>l.value=e,validation:u.value,settings:e.settings,"event-emitter":e.eventEmitter,"is-submit-processing":d.value,onSubmit:f,onAddItem:p,onRemoveItem:m},null,8,[`value`,`validation`,`settings`,`event-emitter`,`is-submit-processing`])])])}}}),Bl={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Vl(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Bl,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M416 128L192 384l-96-96`},null,-1)]])}var Hl=(0,r.markRaw)({name:`ion-checkmark`,render:Vl}),Ul={key:0,class:`-mt-1 text-sm text-gray-500`},Wl={class:`font-bold`},Gl={class:`flex flex-col gap-3`},Kl={key:0,class:`mt-4 mb-3 flex flex-col gap-1.5`},ql={class:`flex flex-col gap-1 text-sm text-gray-700`},Jl={key:0},Yl={key:1},Xl={"form-array-name":`items`,class:`flex flex-col gap-3`},Zl={class:`min-w-0 flex-1`},Ql={class:`relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6`},$l={class:`grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]`},eu={class:`grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]`},tu={key:0,class:`pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center`},nu={class:`mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6`},ru={key:0,class:`lg:!flex-[2]`},iu={class:`font-bold`},au={key:1,class:`lg:!flex-[3]`},ou={class:`font-bold`},su={key:1,class:`min-w-0 flex flex-col items-end gap-1 text-right text-sm text-gray-700 border-t border-gray-200 pt-2`},cu={key:0},lu={class:`font-bold`},uu={key:1},du={class:`font-bold`},fu={class:`flex flex-wrap items-center gap-3`},pu=(0,r.defineComponent)({__name:`sandwich-m2-configurator-form`,props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},itemStates:{default:()=>[]}},emits:[`submit`,`update:value`,`add-item`,`remove-item`,`item-reset`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useTemplateRef)(`form-reference`),u=(0,r.useTemplateRef)(`widthInputs`),d=s.value==null?[]:(0,n.cloneDeep)((0,r.toRaw)(s.value)),f=(0,r.ref)(d.map(e=>new t.OrderItemBase(e))),p=(0,r.computed)(()=>({items:f.value})),m=(0,r.ref)({...s.validation}),h=e=>{delete m.value[e],l.value?.restoreValidation()},g=(0,r.ref)(null),_=(0,r.ref)(null),v=(0,r.computed)(()=>f.value[0]?.category?.products??[]),y=(0,r.computed)(()=>v.value.map(e=>({label:e.name,value:e.id}))),b=(e,t,n)=>{let r=e!=null&&e>0,i=t!=null&&t>0;return!r&&!i?null:r&&i?`от ${e} ${n} до ${t} ${n}`:r?`от ${e} ${n}`:`до ${t} ${n}`},x=(0,r.computed)(()=>b(s.settings.minWidth,g.value?.properties?.width,`мм`)),S=(0,r.computed)(()=>b(s.settings.minLength,g.value?.properties?.length,`мм`)),C=(0,r.computed)(()=>{let e={};return f.value.forEach((t,n)=>{e[`items.${n}.configuratorParams.width`]=[I.required,I.min(s.settings.minWidth),...g.value?.properties?.width?[I.max(g.value.properties.width)]:[],I.step(1),Ee.serverValidation(m.value[`items.${n}.width`]?.feedback)],e[`items.${n}.configuratorParams.length`]=[I.required,I.min(s.settings.minLength),...g.value?.properties?.length?[I.max(g.value.properties.length)]:[],I.step(1),Ee.serverValidation(m.value[`items.${n}.length`]?.feedback)],e[`items.${n}.quantity`]=[I.required,I.min(1),I.step(1),Ee.serverValidation(m.value[`items.${n}.quantity`]?.feedback)],e[`items.${n}.marker`]=[Ee.serverValidation(m.value[`items.${n}.marker`]?.feedback)]}),e});(0,r.watch)(()=>s.validation,e=>{m.value={...e},Object.values(e).some(e=>e?.feedback)&&(0,r.nextTick)(()=>l.value?.validate(n.noop).catch(n.noop))},{deep:!0});let w=(0,r.ref)(s.settings.canSetDopProdaga??!1),E=(0,r.computed)(()=>{let e=g.value;return!e||f.value.some(t=>{let n=t.configuratorParams,r=e.properties?.width,i=e.properties?.length;return n.width===0||n.width<s.settings.minWidth||r!=null&&n.width>r||n.length===0||n.length<s.settings.minLength||i!=null&&n.length>i||t.quantity===0||t.quantity<1})}),D=(0,r.computed)(()=>!g.value||E.value||f.value.length===0),O=(0,r.computed)(()=>{let e=f.value[0];return e!=null&&!e.isNewRec()}),k=e=>s.itemStates[e]??`idle`,A=e=>k(e)===`success`,ee=e=>k(e)===`loading`,j=(0,r.computed)(()=>f.value.length===0||f.value.every((e,t)=>{let n=k(t);return n===`success`||n===`loading`})),te=e=>e.width===0||e.length===0?0:e.width*e.length/1e6,ne=e=>xe.formatArea(te(e)),M=e=>{let t=e.configuratorParams,n=te(t),r=g.value?.costRub??0,i=e.quantity??0;return!n||!i?0:xe.roundMoney(n*r*i)},re=(0,r.computed)(()=>(0,n.sum)(f.value.map(e=>{let t=e.configuratorParams;return!t.width||t.length===0||!e.quantity?0:t.width*t.length*e.quantity/1e6}))),ie=(0,r.computed)(()=>xe.roundMoney((0,n.sum)(f.value.map(e=>M(e))))),N=()=>new t.OrderItemBase({category:f.value[0]?.category,configurator:f.value[0]?.configurator,product:g.value??new t.ClientProduct,quantity:1,isAdditionalSale:f.value[0]?.isAdditionalSale,configuratorParams:{width:0,length:0}}),P=e=>{if(!e){g.value=null,_.value=null,f.value.forEach(e=>{e.product=new t.ClientProduct}),c(`update:value`,f.value);return}let n=v.value.find(t=>t.id===e);n&&(g.value=n,_.value=e,f.value.forEach((e,t)=>{e.product=n,n.properties?.width&&e.configuratorParams.width>n.properties.width&&(e.configuratorParams.width=n.properties.width),n.properties?.length&&e.configuratorParams.length>n.properties.length&&(e.configuratorParams.length=n.properties.length),c(`item-reset`,t)}),c(`update:value`,f.value))},F=e=>{let t=f.value[e],n=g.value;n&&(n.properties?.width&&t.configuratorParams.width>n.properties.width&&(t.configuratorParams.width=n.properties.width),n.properties?.length&&t.configuratorParams.length>n.properties.length&&(t.configuratorParams.length=n.properties.length)),c(`item-reset`,e),c(`update:value`,f.value)},ae=(e,t)=>{f.value[e].marker=t===null||t===``?void 0:t,c(`item-reset`,e),c(`update:value`,f.value)},oe=e=>{f.value.forEach(t=>{t.isAdditionalSale=e}),c(`update:value`,f.value)},se=()=>{f.value.push(N()),c(`update:value`,f.value),c(`add-item`,f.value.length),(0,r.nextTick)(()=>{let e=f.value.length-1;u.value?.[e]?.focus(),u.value?.[e]?.select()})},ce=e=>{f.value.splice(e,1),c(`update:value`,f.value),c(`remove-item`,e)};(0,r.watch)(()=>s.value,e=>{let i=(e==null?[]:(0,n.cloneDeep)((0,r.toRaw)(e))).map(e=>new t.OrderItemBase(e));f.value=i.length>0?i:[N()];let a=f.value[0]?.product;a&&!a.isNewRec()?(g.value=a,_.value=a.id):(g.value=null,_.value=null)},{deep:!0});let le=()=>{if(g.value!==null)return;let e=v.value[0]?.id;e!=null&&P(e)};return(0,r.watch)(v,()=>{le()}),(0,r.onMounted)(()=>{f.value.length===0&&(f.value=[N()]);let e=f.value[0]?.product;e&&!e.isNewRec()&&(g.value=e,_.value=e.id),le()}),i({validate:l.value?.validate,formReference:l}),(t,n)=>{let i=Hl,a=ar,s=bl;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:p.value,rules:C.value,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Товар`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:_.value,"onUpdate:value":[n[0]||=e=>_.value=e,P],options:y.value,placeholder:`Выберите материал`,filterable:``},null,8,[`value`,`options`])]),_:1}),g.value?.costRub==null?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ul,[(0,r.createElementVNode)(`span`,Wl,(0,r.toDisplayString)(g.value.code),1),(0,r.createTextVNode)(` — `+(0,r.toDisplayString)((0,r.unref)(xe).formatMoney(g.value.costRub))+` `+(0,r.toDisplayString)(g.value.currency.symbol)+`/м² `,1)])),(0,r.createElementVNode)(`div`,Gl,[g.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Kl,[n[6]||=(0,r.createElementVNode)(`div`,{class:`w-full font-bold`},`Размеры изделий`,-1),(0,r.createElementVNode)(`div`,ql,[x.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Jl,`Ширина `+(0,r.toDisplayString)(x.value)+`.`,1)):(0,r.createCommentVNode)(``,!0),S.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Yl,`Длина `+(0,r.toDisplayString)(S.value)+`.`,1)):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,Xl,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(p.value.items,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:t,class:(0,r.normalizeClass)([`flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0`,A(t)?`opacity-70`:``])},[(0,r.createElementVNode)(`div`,Zl,[(0,r.createElementVNode)(`div`,Ql,[(0,r.createElementVNode)(`div`,$l,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`items.${t}.configuratorParams.width`,label:`Ширина, мм`,class:`min-w-0`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{ref_for:!0,ref:`widthInputs`,value:p.value.items[t].configuratorParams.width,"onUpdate:value":[e=>p.value.items[t].configuratorParams.width=e,e=>F(t)],parse:(0,r.unref)(ve),"show-button":!1,disabled:!g.value||A(t)||ee(t),placeholder:`Ширина`,class:`w-full`,onKeydown:n[1]||=e=>(0,r.unref)(ge)(e),onInput:e=>h(`items.${t}.width`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`items.${t}.configuratorParams.length`,label:`Длина, мм`,class:`min-w-0`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:p.value.items[t].configuratorParams.length,"onUpdate:value":[e=>p.value.items[t].configuratorParams.length=e,e=>F(t)],parse:(0,r.unref)(ve),"show-button":!1,disabled:!g.value||A(t)||ee(t),placeholder:`Длина`,class:`w-full`,onKeydown:n[2]||=e=>(0,r.unref)(ge)(e),onInput:e=>h(`items.${t}.length`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`])]),(0,r.createElementVNode)(`div`,eu,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`items.${t}.quantity`,label:`Количество, шт`,class:`min-w-0`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:p.value.items[t].quantity,"onUpdate:value":[e=>p.value.items[t].quantity=e,e=>F(t)],parse:(0,r.unref)(ve),"show-button":!1,disabled:!g.value||A(t)||ee(t),placeholder:`Кол-во`,class:`w-full`,onKeydown:n[3]||=e=>(0,r.unref)(ge)(e,!1),onInput:e=>h(`items.${t}.quantity`),onFocus:(0,r.unref)(be)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`items.${t}.marker`,label:`Маркировка`,class:`min-w-0`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:p.value.items[t].marker??null,disabled:!g.value||A(t)||ee(t),placeholder:`Маркировка`,class:`w-full`,onInput:e=>h(`items.${t}.marker`),"onUpdate:value":e=>ae(t,e??null),onFocus:(0,r.unref)(be)},null,8,[`value`,`disabled`,`onInput`,`onUpdate:value`,`onFocus`])]),_:2},1032,[`path`])]),ee(t)||A(t)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,tu,[ee(t)?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSpin),{key:0,size:14})):A(t)?((0,r.openBlock)(),(0,r.createBlock)(i,{key:1,class:`text-green-600 text-xl`})):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,nu,[e.configuratorParams.width>0&&e.configuratorParams.length>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ru,[n[7]||=(0,r.createTextVNode)(` Площадь (S) = `,-1),(0,r.createElementVNode)(`span`,iu,(0,r.toDisplayString)(ne(e.configuratorParams))+` м²`,1)])):(0,r.createCommentVNode)(``,!0),M(e)>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,au,[n[8]||=(0,r.createTextVNode)(` Итого: `,-1),(0,r.createElementVNode)(`span`,ou,(0,r.toDisplayString)((0,r.unref)(xe).formatMoney(M(e)))+` `+(0,r.toDisplayString)(g.value?.currency.symbol),1)])):(0,r.createCommentVNode)(``,!0)])]),O.value?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,disabled:ee(t)||p.value.items.length<=1,type:`error`,size:`medium`,class:`mt-5 shrink-0 lg:!ml-4`,onClick:e=>ce(t)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`disabled`,`onClick`]))],2))),128))]),g.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,su,[re.value>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,cu,[n[9]||=(0,r.createTextVNode)(` Общая площадь: `,-1),(0,r.createElementVNode)(`span`,lu,(0,r.toDisplayString)((0,r.unref)(xe).formatArea(re.value))+` м²`,1)])):(0,r.createCommentVNode)(``,!0),ie.value>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,uu,[n[10]||=(0,r.createTextVNode)(` Итого: `,-1),(0,r.createElementVNode)(`span`,du,(0,r.toDisplayString)((0,r.unref)(xe).formatMoney(ie.value))+` `+(0,r.toDisplayString)(g.value.currency.symbol),1)])):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)]),w.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NCheckbox),{key:1,checked:f.value[0]?.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[4]||=e=>oe(e??!1)},{default:(0,r.withCtx)(()=>[...n[11]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,fu,[g.value&&!O.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,disabled:E.value,type:`default`,onClick:se},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s),n[12]||=(0,r.createTextVNode)(` Добавить изделие `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)((0,r.unref)(o.NButton),{loading:e.isSubmitProcessing,disabled:D.value||j.value,type:`primary`,class:`ml-auto`,onClick:n[5]||=e=>c(`submit`,f.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(f.value[0]?.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`])])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>c(`submit`,f.value)]])}}}),mu={class:`flex flex-col gap-2`},hu={class:`min-w-56 max-w-3xl flex grow flex-col px-5`},gu=(0,r.defineComponent)({__name:`sandwich-m2-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:[`click:view-switch`,`submit`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`sandwich-m2-configurator-form`),l=(0,r.ref)((a.cartItems??[]).map(e=>new t.OrderItemBase(e))),u=(0,r.ref)([]),d=(0,r.ref)({width:{},length:{},quantity:{},marker:{}}),f=[`width`,`length`,`quantity`,`marker`],p=e=>{f.forEach(t=>{d.value[`items.${e}.${t}`]={}})},m=e=>{f.forEach(t=>{delete d.value[`items.${e}.${t}`]})},h=(0,r.computed)(()=>u.value.includes(`loading`)),g=()=>({width:{},length:{},quantity:{},marker:{}}),_=(e,t)=>{let n=!1;return f.forEach(r=>{let i=`items.0.${r}`,a=e[r]?.feedback,o=e[i]?.feedback??a,s=`items.${t}.${r}`;o?(d.value[s]=e[i]??e[r],n=!0):d.value[s]={}}),n},v=(e,t,i)=>new Promise(a=>{let o=g(),l=!1,d=e=>{if(l)return;l=!0;let n=_(o,t),i=(e===void 0?!n:e)&&!n;u.value[t]=i?`success`:`error`,(0,r.nextTick)(()=>{c.value?.formReference?.restoreValidation()}),a(i)};u.value[t]=`loading`,s(`submit`,[(0,n.cloneDeep)(e)],o,d,{isFinalSuccessfulCompletion:i})}),y=async()=>{try{await c.value?.formReference?.validate()}catch{return}let e=l.value.map((e,t)=>t).filter(e=>{let t=u.value[e]??`idle`;return t!==`success`&&t!==`loading`}),t=!0;for(let n=0;n<e.length;n+=1){let r=e[n],i=l.value[r];if(!i)break;let a=n===e.length-1&&t;await v(i,r,a)||(t=!1)}},b=e=>{let t=e-1;u.value[t]=`idle`,p(t)},x=e=>{u.value.splice(e,1),m(e);for(let t=e;t<l.value.length;t+=1)p(t)},S=e=>{let t=u.value[e];(t===`success`||t===`error`)&&(u.value[e]=`idle`)};return(0,r.onMounted)(()=>{(a.cartItems??[]).forEach((e,t)=>{u.value[t]=`idle`,p(t)})}),(0,r.watch)(()=>a.cartItems,e=>{let n=(e??[]).map(e=>new t.OrderItemBase(e));l.value=n,u.value=n.map(()=>`idle`),n.forEach((e,t)=>{p(t)})},{deep:!0}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,mu,[e.settings.allowShowTable&&l.value[0]?.isNewRec()?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-center`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,hu,[(0,r.createVNode)(pu,{ref:`sandwich-m2-configurator-form`,value:l.value,"onUpdate:value":n[1]||=e=>l.value=e,validation:d.value,settings:e.settings,"event-emitter":e.eventEmitter,"is-submit-processing":h.value,"item-states":u.value,onSubmit:y,onAddItem:b,onRemoveItem:x,onItemReset:S},null,8,[`value`,`validation`,`settings`,`event-emitter`,`is-submit-processing`,`item-states`])])])}}}),_u={key:0,class:`flex justify-center p-4`},vu={key:1,class:`p-4 text-center text-red-500`},yu={key:2,class:`flex justify-center`},bu={class:`!bg-white p-4 m-2 rounded-md w-max`},xu={key:3,class:`p-4 text-center text-gray-500`},Su=(0,r.defineComponent)({__name:`dynamic-configurator`,props:{eventEmitter:{},settings:{},editor:{},cartItem:{},cartItems:{},category:{}},setup(e){let i=e,a=(0,r.ref)(!1),s=(0,r.ref)(null),c=(0,r.ref)(i.cartItem??null),l=(0,r.ref)(i.cartItems??null),u=(0,r.ref)(i.editor===t.ConfiguratorsEnum.SandwichM2&&i.cartItem!=null?(e=>{let n=e.configuratorParams;return[new t.OrderItemBase({...e,quantity:e.quantity??1,marker:e.marker,configuratorParams:{width:n?.width??e.width??0,length:n?.length??e.length??0}})]})(i.cartItem):null),d=()=>{if(!i.settings){s.value=`Настройки конфигуратора не указаны в свойствах категории.`;return}let e={category:i.cartItem?.category??i.category,configurator:i.editor,quantity:1};switch(i.editor){case`kozyrek`:{let r=i.settings;c.value=new t.OrderItemBase({...e,configuratorParams:{length:r.stripMinLength,linesAngles:[],linesWidths:[],startTailType:(0,n.some)(r.startTailConfigs,e=>e.isDefault)?r.startTailConfigs?.findIndex(e=>e.isDefault):void 0,endTailType:(0,n.some)(r.endTailConfigs,e=>e.isDefault)?r.endTailConfigs?.findIndex(e=>e.isDefault):void 0,colorSide:`top`}});break}case`mosquitto`:{let n=i.settings;c.value=new t.OrderItemBase({...e,configuratorParams:{width:0,height:0,netType:n.netType[0]||``,color:n.color[0]||``,mountType:n.mountType[0]||``}});break}case`strip`:{let n=i.settings;l.value=[new t.OrderItemBase({...e,length:n.minLength,configuratorParams:{linesWidths:[0]}})];break}case`metal_for_doors`:{let n=i.settings;c.value=new t.OrderItemBase({...e,configuratorParams:{width:n.minWidth,length:n.minLength}});break}case`sandwich`:c.value=new t.OrderItemBase({...e,configuratorParams:{calculationId:``,items:[{width:0,length:0,count:1}]}});break;case`sandwich_m2`:u.value=[new t.OrderItemBase({...e,configuratorParams:{width:0,length:0}})];break;default:s.value=`Неподдерживаемый тип конфигуратора: ${i.editor}.`}c.value&&(c.value.marker=void 0)},f=(e,t,n)=>{i.eventEmitter.emit(`configurator:submit`,{cartItem:e,callback:e=>{n?.(),e&&d()},validation:t})},p=(e,t,n,r)=>{let a=e[0];if(!a){n?.();return}let o=r?.isFinalSuccessfulCompletion===!0;i.eventEmitter.emit(`configurator:submit`,{cartItem:a,callback:e=>{n?.(e),o&&e&&d()},validation:t,additionalParams:r})},m=()=>{i.category&&i.eventEmitter.emit(`configurator:click-view-switch`,{category:i.category})};return(0,r.onMounted)(()=>{!i.cartItem&&!i.cartItems&&d()}),(t,n)=>{let i=o.NSpin;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,_u,[(0,r.createVNode)(i,{size:`large`})])):s.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,vu,(0,r.toDisplayString)(s.value),1)):(0,r.createCommentVNode)(``,!0),e.settings!==null&&(c.value!==null||l.value!==null||u.value!==null)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,yu,[(0,r.createElementVNode)(`div`,bu,[e.editor===`kozyrek`?((0,r.openBlock)(),(0,r.createBlock)(Pc,{key:0,"event-emitter":e.eventEmitter,settings:e.settings,"cart-item":c.value,"onClick:viewSwitch":m,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-item`])):e.editor===`mosquitto`?((0,r.openBlock)(),(0,r.createBlock)(el,{key:1,"event-emitter":e.eventEmitter,settings:e.settings,"cart-item":c.value,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-item`])):e.editor===`strip`?((0,r.openBlock)(),(0,r.createBlock)(pl,{key:2,"event-emitter":e.eventEmitter,settings:e.settings,"cart-items":l.value,"onClick:viewSwitch":m,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-items`])):e.editor===`metal_for_doors`?((0,r.openBlock)(),(0,r.createBlock)(_l,{key:3,"event-emitter":e.eventEmitter,settings:e.settings,"cart-item":c.value,"onClick:viewSwitch":m,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-item`])):e.editor===`sandwich`?((0,r.openBlock)(),(0,r.createBlock)(zl,{key:4,"event-emitter":e.eventEmitter,settings:e.settings,"cart-item":c.value,"onClick:viewSwitch":m,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-item`])):e.editor===`sandwich_m2`?((0,r.openBlock)(),(0,r.createBlock)(gu,{key:5,"event-emitter":e.eventEmitter,settings:e.settings,"cart-items":u.value,"onClick:viewSwitch":m,onSubmit:p},null,8,[`event-emitter`,`settings`,`cart-items`])):(0,r.createCommentVNode)(``,!0)])])):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,xu,` Конфигуратор "`+(0,r.toDisplayString)(e.editor)+`" не поддерживается. `,1))],64)}}});function Cu(e){return Object.values(t.ConfiguratorsEnum).includes(e)}function wu(e){return e.properties?.configurator!==t.ConfiguratorsEnum.Sandwich||e.properties.configuratorSettings!==void 0&&(0,n.isArray)(e.products)&&e.products.length>0}var Tu={key:0,class:`pt-0.5`},Eu={key:0},Du={key:1},Ou={class:`flex flex-row gap-1`},ku={key:0},Au={class:`m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500`},ju={class:`flex flex-col gap-2.5 sm:flex-row`},Mu={key:0,class:`header-extra`},Nu={class:`inline-flex`},Pu={class:`inline-flex`},Fu={class:`inline-flex`},Iu={class:`mt-2`},Lu={key:1,class:`flex flex-col`},Ru=yt((0,r.defineComponent)({__name:`category-collapse-item`,props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showProductInfoButton:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){let i=e,a=(0,r.inject)(wt,`medium`),s=ce(),c=(0,r.computed)(()=>i?.filteredItems?.[i.categoryItem.id]),l=(0,r.computed)(()=>(0,n.isArray)(i.categoryItem?.categories)&&i.categoryItem.categories?.length>0),d=(0,r.computed)(()=>(0,n.isArray)(i.categoryItem?.products)?i.categoryItem.products:[]),p=(0,r.computed)(()=>Object.entries(i.categoryItem.currencyRates??{}).map(([e,t])=>`${t} руб./${oe(e)}`).join(`, `)),m=(0,r.computed)(()=>(0,n.isUndefined)(i.filteredItems)||c.value===`*`?d.value:d.value.filter(e=>{let t=c.value?.products;return(0,n.isArray)(t)&&t.includes(e.id)})),h=(0,r.computed)(()=>m.value.length>0),g=(0,r.computed)(()=>(0,n.isFunction)(i.showCategoryHideForClientButton)?i.showCategoryHideForClientButton(i.categoryItem):i.showCategoryHideForClientButton),_=(0,r.computed)(()=>(0,n.isFunction)(i.showCategoryPinButton)?i.showCategoryPinButton(i.categoryItem):i.showCategoryPinButton),v=(0,r.computed)(()=>(0,n.isFunction)(i.showCategoryRequiredButton)?i.showCategoryRequiredButton(i.categoryItem):i.showCategoryRequiredButton),y=(0,r.computed)(()=>{let e=E.value?.hidingComment,t=E.value?.isDisabled?`Скрыто для клиента${e?`. Причина: '${e}'`:``}`:`Видимо клиенту`;return g.value===`disabled`?`${t}. ${u}`:t}),b=(0,r.computed)(()=>{let e=E.value?.manager,t=e?`Категория закреплена за "${e.name??`-`}"`:`Закрепить`;return _.value===`disabled`?`${t}. ${u}`:t}),x=(0,r.computed)(()=>v.value===`disabled`?`${f}. ${u}`:f),S=(0,r.computed)(()=>(0,n.isFunction)(i.showCategoryEditButton)?i.showCategoryEditButton(i.categoryItem):i.showCategoryEditButton),C=(0,r.computed)(()=>i.categoryItem.properties?.configurator!==void 0&&Cu(i.categoryItem.properties?.configurator)&&wu(i.categoryItem)&&i.categoryItem.properties?.configuratorSettings!==void 0&&((0,n.isFunction)(i.canShowConfigurator)?i.canShowConfigurator():i.canShowConfigurator)),w=(0,r.computed)(()=>C.value&&((0,n.isFunction)(i.showConfigurator)?i.showConfigurator(i.categoryItem):i.showConfigurator)),T=(0,r.computed)(()=>(0,n.isNil)(i.categoryContextButtonsConfig)?[]:(0,n.isFunction)(i.categoryContextButtonsConfig)?i.categoryContextButtonsConfig(i.categoryItem):i.categoryContextButtonsConfig),E=(0,r.computed)(()=>new t.ClientCategory(i.categoryItem)),D=(0,r.ref)(!1),O=(0,r.ref)(!1),k=(0,r.computed)(()=>!(0,n.isUndefined)(i.isCategoryItemSelected)),A=(0,r.computed)(()=>(0,n.isFunction)(i.isCategoryItemSelected)?i.isCategoryItemSelected(i.categoryItem):i.isCategoryItemSelected===!0),ee=(0,r.computed)(()=>(0,n.isFunction)(i.isCategoryItemSelected)?i.isCategoryItemSelected(i.categoryItem)===`disabled`:i.isCategoryItemSelected===`disabled`),j=(0,r.computed)(()=>(0,n.isFunction)(i.isCategoryItemSelected)?i.isCategoryItemSelected(i.categoryItem)===`indeterminate`:i.isCategoryItemSelected===`indeterminate`),te=(0,r.computed)(()=>_e.value&&F.getDeviceTypeByResolution()===P.laptop?`auto`:`fixed`),ne=(0,r.useTemplateRef)(`collapse-item-reference`),M=(0,r.computed)(()=>i.categoryItem.properties?.templateCost?.priceCoefficient),re=(0,r.computed)(()=>i.categoryItem.properties?.templateCost?.increasePercent),ie=(0,r.computed)(()=>ke.isM2Category(i.categoryItem)?ke.findReferenceProduct(i.categoryItem):void 0),N=(0,r.computed)(()=>ie.value?ke.calculateM2Cost(ie.value,M.value,re.value):void 0),ae=(0,r.computed)(()=>`${ie.value?.currency?.symbol??``}/м²`),oe=(e,t=`ru-RU`)=>0 .toLocaleString(t,{style:`currency`,currency:e,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,``).trim(),se=e=>{i.eventEmitter.emit(`category:checked`,{category:i.categoryItem,checked:e,target:ne.value})},le=(e,t)=>{i.eventEmitter.emit(`category:header-click`,{categoryItem:i.categoryItem,expanded:t,isLoadingState:D,target:ne.value})},ue=()=>{i.eventEmitter.emit(`category:hide`,{category:i.categoryItem,target:ne.value})},de=()=>{i.eventEmitter.emit(`category:required`,{category:i.categoryItem,target:ne.value})},fe=()=>{i.eventEmitter.emit(`category:attach`,{category:i.categoryItem,target:ne.value})},pe=()=>{i.eventEmitter.emit(`category:detach`,{category:i.categoryItem,target:ne.value})},me=()=>{i.eventEmitter.emit(`category:edit`,{category:i.categoryItem,target:ne.value})},he=e=>{i.eventEmitter.emit(`category:context-select`,{category:i.categoryItem,key:e,target:ne.value})},ge=()=>{i.eventEmitter.emit(`configurator:click-view-switch`,{category:i.categoryItem})},_e=(0,r.ref)(0),ve=(0,r.computed)(()=>_e.value&&d.value.length>0?nr(d.value,{eventEmitter:i.eventEmitter,showSlugs:i.showSlugs,showProperties:i.showProperties,showProductCosts:i.showProductCosts,allowNameClick:i.allowNameClick,allowPriceClick:i.allowPriceClick,showPriceHistory:i.showPriceHistory,showCostDate:i.showCostDate,showProductInfoButton:i.showProductInfoButton,showProductAddToCartButton:i.showProductAddToCartButton,isProductItemSelected:i.isProductItemSelected,showProductEditButton:i.showProductEditButton,showProductRequiredButton:i.showProductRequiredButton,currencyRates:i.categoryItem.currencyRates,productContextButtonsConfig:i.productContextButtonsConfig}):[]),ye=(0,n.debounce)(()=>{_e.value=window.innerWidth},20);return(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,ye),ye.cancel()}),window.addEventListener(`resize`,ye),ye(),(t,i)=>{let u=o.NCheckbox,d=at,f=o.NTooltip,ne=nt,ie=o.NTag,P=$e,F=Xe,oe=o.NButton,ce=qe,_e=We,ye=Ve,be=Re,Se=Fe,Ce=o.NDropdown,we=o.NDataTable,I=o.NAlert,Te=o.NSpin;return(0,r.openBlock)(),(0,r.createBlock)(bt,{ref:`collapse-item-reference`,name:e.categoryItem.id,"data-id":e.categoryItem.id,"onHeader:click":le},{"pre-arrow":(0,r.withCtx)(()=>[k.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Tu,[(0,r.createVNode)(u,{checked:A.value,indeterminate:j.value,disabled:ee.value,"onUpdate:checked":se},null,8,[`checked`,`indeterminate`,`disabled`])])):(0,r.createCommentVNode)(``,!0),!g.value&&E.value?.isDisabled?((0,r.openBlock)(),(0,r.createBlock)(f,{key:1,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(d,{class:`pt-1.5`})]),default:(0,r.withCtx)(()=>[i[1]||=(0,r.createTextVNode)(` Категория скрыта для клиента `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0),E.value?.isFavorite??!1?((0,r.openBlock)(),(0,r.createBlock)(f,{key:2,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(ne,{class:`pt-1.5`})]),default:(0,r.withCtx)(()=>[i[2]||=(0,r.createTextVNode)(` Избранная категория `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0)]),header:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":e.categoryItem.isHidden,"text-gray-400":E.value?.isDisabled})},[(0,r.createVNode)(f,{disabled:!e.categoryItem.isHidden,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,null,(0,r.toDisplayString)(e.categoryItem.name),1)]),default:(0,r.withCtx)(()=>[i[3]||=(0,r.createTextVNode)(` Категория скрыта `,-1)]),_:1},8,[`disabled`])],2),(0,r.createElementVNode)(`div`,{class:`w-fit`,onClick:i[0]||=(0,r.withModifiers)((...e)=>(0,r.unref)(n.noop)&&(0,r.unref)(n.noop)(...e),[`prevent`,`stop`])},[e.categoryItem.properties?.templateCost?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[M.value||re.value||!(0,r.unref)(n.isNil)(N.value)?((0,r.openBlock)(),(0,r.createBlock)(ie,{key:0,size:(0,r.unref)(a),round:``},{default:(0,r.withCtx)(()=>[M.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Eu,(0,r.toDisplayString)(M.value?.name),1)):(0,r.createCommentVNode)(``,!0),re.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Du,(0,r.toDisplayString)(re.value>0?`+`:``)+(0,r.toDisplayString)((0,r.unref)(xe).formatPercent(re.value))+`%`,1)):(0,r.createCommentVNode)(``,!0),(0,r.unref)(n.isNil)(N.value)?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:2,class:(0,r.normalizeClass)({"ml-1":M.value||re.value})},(0,r.toDisplayString)(N.value.toFixed(2))+` `+(0,r.toDisplayString)(ae.value),3))]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0)],64)):e.categoryItem.properties?.m2Price?((0,r.openBlock)(),(0,r.createBlock)(ie,{key:1,size:(0,r.unref)(a),round:``},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Установленная стоимость: `+(0,r.toDisplayString)(e.categoryItem.properties.m2Price)+` руб./м2 `,1)]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0),p.value?((0,r.openBlock)(),(0,r.createBlock)(ie,{key:2,size:(0,r.unref)(a),round:``},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Фиксированный курс: `+(0,r.toDisplayString)(p.value),1)]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0),_.value&&E.value?.manager?((0,r.openBlock)(),(0,r.createBlock)(ie,{key:3,size:(0,r.unref)(a),closable:_.value!==`disabled`,round:``,class:`align-bottom`,onClose:pe},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(f,{placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Ou,[(0,r.createVNode)(P),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(E.value?.manager?.name),1)])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Категория закреплена за "`+(0,r.toDisplayString)(E.value?.manager?.name)+`" `,1)]),_:1})]),_:1},8,[`size`,`closable`])):(0,r.createCommentVNode)(``,!0)])]),"sub-header":(0,r.withCtx)(()=>[e.showSlugs||e.showProperties?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ku,[(0,r.createElementVNode)(`ul`,Au,[e.showSlugs?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)({id:e.categoryItem.id,slug:e.categoryItem.slug},(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:t},` (`+(0,r.toDisplayString)(t)+`): `+(0,r.toDisplayString)(e),1))),128)):(0,r.createCommentVNode)(``,!0),e.showProperties?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(e.categoryItem.properties,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:t},` (`+(0,r.toDisplayString)(t)+`): `+(0,r.toDisplayString)(e),1))),128)):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0)]),"header-extra":(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,ju,[t.$slots[`header-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Mu,[(0,r.renderSlot)(t.$slots,`header-extra`,{categoryItem:e.categoryItem},void 0,!0)])):(0,r.createCommentVNode)(``,!0),g.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:1,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(s)&&g.value!==`disabled`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Nu,[(0,r.createVNode)(oe,{ghost:!0,disabled:g.value===`disabled`,size:(0,r.unref)(a),onClick:ue},{default:(0,r.withCtx)(()=>[E.value?.isDisabled?((0,r.openBlock)(),(0,r.createBlock)(d,{key:1})):((0,r.openBlock)(),(0,r.createBlock)(F,{key:0}))]),_:1},8,[`disabled`,`size`])])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(y.value),1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),_.value&&!E.value?.manager?((0,r.openBlock)(),(0,r.createBlock)(f,{key:2,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(s)&&_.value!==`disabled`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Pu,[(0,r.createVNode)(oe,{ghost:!0,disabled:_.value===`disabled`,size:(0,r.unref)(a),onClick:fe},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(ce)]),_:1},8,[`disabled`,`size`])])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(b.value),1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),v.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:3,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(s)&&v.value!==`disabled`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Fu,[(0,r.createVNode)(oe,{ghost:!0,disabled:v.value===`disabled`,size:(0,r.unref)(a),onClick:de},{default:(0,r.withCtx)(()=>[E.value?.isRequired?((0,r.openBlock)(),(0,r.createBlock)(ye,{key:1})):((0,r.openBlock)(),(0,r.createBlock)(_e,{key:0}))]),_:1},8,[`disabled`,`size`])])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(x.value),1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),S.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:4,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(s)},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(oe,{ghost:!0,size:(0,r.unref)(a),type:`primary`,onClick:me},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(be)]),_:1},8,[`size`])]),default:(0,r.withCtx)(()=>[i[4]||=(0,r.createTextVNode)(` Редактировать `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),T.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(Ce,{key:5,options:T.value,size:(0,r.unref)(a),trigger:`click`,onSelect:he},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(oe,{ghost:!0,size:(0,r.unref)(a),type:`primary`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Se)]),_:1},8,[`size`])]),_:1},8,[`options`,`size`])):(0,r.createCommentVNode)(``,!0)])]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`,{},()=>[(0,r.createElementVNode)(`div`,Iu,[l.value?((0,r.openBlock)(),(0,r.createBlock)(Vu,{key:0,"categories-items":e.categoryItem.categories??[],"has-products":h.value||D.value,"event-emitter":e.eventEmitter,"filtered-items":c.value?c.value?.categories??{}:void 0,"is-category-item-selected":e.isCategoryItemSelected,"show-slugs":e.showSlugs,"show-properties":e.showProperties,"allow-name-click":e.allowNameClick,"allow-price-click":e.allowPriceClick,"show-price-history":e.showPriceHistory,"show-cost-date":e.showCostDate,"show-product-info-button":e.showProductInfoButton,"show-category-required-button":e.showCategoryRequiredButton,"show-category-hide-for-client-button":e.showCategoryHideForClientButton,"show-category-pin-button":e.showCategoryPinButton,"show-category-edit-button":e.showCategoryEditButton,"category-context-buttons-config":e.categoryContextButtonsConfig,"is-product-item-selected":e.isProductItemSelected,"show-product-add-to-cart-button":e.showProductAddToCartButton,"show-product-costs":e.showProductCosts,"show-product-required-button":e.showProductRequiredButton,"show-product-edit-button":e.showProductEditButton,"product-context-buttons-config":e.productContextButtonsConfig,"show-configurator":e.showConfigurator,"can-show-configurator":e.canShowConfigurator},(0,r.createSlots)({_:2},[t.$slots[`header-extra`]?{name:`header-extra`,fn:(0,r.withCtx)(({categoryItem:e})=>[(0,r.renderSlot)(t.$slots,`header-extra`,{categoryItem:e},void 0,!0)]),key:`0`}:void 0]),1032,[`categories-items`,`has-products`,`event-emitter`,`filtered-items`,`is-category-item-selected`,`show-slugs`,`show-properties`,`allow-name-click`,`allow-price-click`,`show-price-history`,`show-cost-date`,`show-product-info-button`,`show-category-required-button`,`show-category-hide-for-client-button`,`show-category-pin-button`,`show-category-edit-button`,`category-context-buttons-config`,`is-product-item-selected`,`show-product-add-to-cart-button`,`show-product-costs`,`show-product-required-button`,`show-product-edit-button`,`product-context-buttons-config`,`show-configurator`,`can-show-configurator`])):(0,r.createCommentVNode)(``,!0)]),C.value&&w.value?((0,r.openBlock)(),(0,r.createBlock)(Su,{key:0,"event-emitter":e.eventEmitter,settings:e.categoryItem.properties?.configuratorSettings,editor:e.categoryItem.properties?.configurator,category:e.categoryItem},null,8,[`event-emitter`,`settings`,`editor`,`category`])):h.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Lu,[C.value?((0,r.openBlock)(),(0,r.createBlock)(oe,{key:0,color:`#bdbdbd`,strong:``,class:`self-end p-2`,onClick:ge},{default:(0,r.withCtx)(()=>[...i[5]||=[(0,r.createTextVNode)(` Назад в Конфигуратор `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(we,{columns:ve.value,data:m.value,bordered:!0,loading:D.value,remote:!0,"row-key":e=>e.id,"table-layout":te.value,class:`mt-2`},null,8,[`columns`,`data`,`loading`,`row-key`,`table-layout`])])):(0,r.createCommentVNode)(``,!0),!D.value&&!O.value&&!l.value&&!h.value?((0,r.openBlock)(),(0,r.createBlock)(I,{key:2,"show-icon":!0,type:`warning`,title:`Категория пуста`,class:`mx-10`})):(0,r.createCommentVNode)(``,!0),O.value?((0,r.openBlock)(),(0,r.createBlock)(I,{key:3,"show-icon":!0,type:`error`,title:`При получении данных произошла ошибка`,class:`mx-10`})):(0,r.createCommentVNode)(``,!0),D.value?((0,r.openBlock)(),(0,r.createBlock)(Te,{key:4,size:(0,r.unref)(a),class:`w-full`},{description:(0,r.withCtx)(()=>[...i[6]||=[(0,r.createElementVNode)(`div`,null,`Выполняется загрузка данных ...`,-1)]]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0)],!0)]),_:3},8,[`name`,`data-id`])}}}),[[`__scopeId`,`data-v-955d9ea8`]]),zu={class:`sc-collapse flex w-full flex-col`},Bu=(0,r.defineComponent)({__name:`collapse`,props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:[`on-item-header-click`],setup(e,{emit:t}){let n=e,i=t;return(0,r.provide)(`itemHeaderClickHandler`,(e,t)=>{i(`on-item-header-click`,e,t)}),(0,r.provide)(`defaultExpandedNames`,n.defaultExpandedNames),(0,r.provide)(`expandedNames`,n.expandedNames),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,zu,[(0,r.renderSlot)(e.$slots,`default`)]))}}),Vu=(0,r.defineComponent)({__name:`category-collapse`,props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showProductInfoButton:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){let t=e,i=(0,r.inject)(wt,`medium`),a=(0,r.computed)(()=>(0,n.isUndefined)(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(e=>!!t.filteredItems?.[e.id])),s=(e,t)=>{if((0,n.isUndefined)(t))return;let i=t[e.id];if(i===`*`)return;let a={};return a[e.id]=structuredClone((0,r.toRaw)(i)),a};return(t,n)=>{let c=o.NSpin,l=o.NAlert;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[a.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(Bu,{key:0},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(a.value,n=>((0,r.openBlock)(),(0,r.createBlock)(Ru,{key:n.id,"category-item":n,"event-emitter":e.eventEmitter,"filtered-items":s(n,e.filteredItems),"is-category-item-selected":e.isCategoryItemSelected,"show-slugs":e.showSlugs,"show-properties":e.showProperties,"allow-name-click":e.allowNameClick,"allow-price-click":e.allowPriceClick,"show-price-history":e.showPriceHistory,"show-cost-date":e.showCostDate,"show-product-info-button":e.showProductInfoButton,"show-category-required-button":e.showCategoryRequiredButton,"show-category-hide-for-client-button":e.showCategoryHideForClientButton,"show-category-pin-button":e.showCategoryPinButton,"show-category-edit-button":e.showCategoryEditButton,"category-context-buttons-config":e.categoryContextButtonsConfig,"is-product-item-selected":e.isProductItemSelected,"show-product-add-to-cart-button":e.showProductAddToCartButton,"show-product-costs":e.showProductCosts,"show-product-required-button":e.showProductRequiredButton,"show-product-edit-button":e.showProductEditButton,"product-context-buttons-config":e.productContextButtonsConfig,"show-configurator":e.showConfigurator,"can-show-configurator":e.canShowConfigurator},(0,r.createSlots)({_:2},[t.$slots[`header-extra`]?{name:`header-extra`,fn:(0,r.withCtx)(({categoryItem:e})=>[(0,r.renderSlot)(t.$slots,`header-extra`,{categoryItem:e})]),key:`0`}:void 0]),1032,[`category-item`,`event-emitter`,`filtered-items`,`is-category-item-selected`,`show-slugs`,`show-properties`,`allow-name-click`,`allow-price-click`,`show-price-history`,`show-cost-date`,`show-product-info-button`,`show-category-required-button`,`show-category-hide-for-client-button`,`show-category-pin-button`,`show-category-edit-button`,`category-context-buttons-config`,`is-product-item-selected`,`show-product-add-to-cart-button`,`show-product-costs`,`show-product-required-button`,`show-product-edit-button`,`product-context-buttons-config`,`show-configurator`,`can-show-configurator`]))),128))]),_:3})):e.loading?((0,r.openBlock)(),(0,r.createBlock)(c,{key:1,size:(0,r.unref)(i),class:`w-full`},{description:(0,r.withCtx)(()=>[...n[0]||=[(0,r.createElementVNode)(`div`,null,`Выполняется загрузка данных ...`,-1)]]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0),!e.hasProducts&&!e.loading&&e.categoriesItems.length>0&&a.value.length===0?((0,r.openBlock)(),(0,r.createBlock)(l,{key:2,"show-icon":!0,type:`warning`,title:`Товары не найдены`,class:`mx-10`})):(0,r.createCommentVNode)(``,!0)],64)}}}),Hu=(0,r.defineComponent)({__name:`reference-select`,props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0},disabledItem:{type:Function,default:void 0}},emits:[`update:value`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.computed)(()=>(0,n.isArray)(s.value)),u=new t.Reference,d=(0,r.computed)(()=>(0,n.isNil)(s.value)?l.value?[]:null:(0,n.isArray)(s.value)?s.value.filter(e=>!(0,n.isNil)(e)).map(e=>e.id):s.value.id),f=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList(s.referenceList,s.sortOptionsByLabel,!1,s.showEmptyValue,void 0,s.disabledItem)),p=(0,r.computed)(()=>f.value.map(e=>({...e,class:s.wrapContent?`${e.class} consistent-menu-width`:e.class}))),m=e=>{if((0,n.isArray)(e)){let t=e.length>0?e.map(e=>f.value.find(t=>t.value===e)?.item).filter(e=>!(0,n.isNil)(e)):[];c(`update:value`,t)}else{let t=e===u.id||(0,n.isNil)(e)?void 0:f.value.find(t=>t.value===e)?.item;c(`update:value`,t)}},h=(0,r.useTemplateRef)(`select-component`);return i({focus:()=>h.value?.focus(),blur:()=>h.value?.blur()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSelect),{ref:`select-component`,value:d.value,clearable:s.clearable,"consistent-menu-width":e.consistentMenuWidth,disabled:e.disabled||f.value.length===0,filterable:e.filterable,"max-tag-count":e.maxTagCount,multiple:l.value,options:p.value,placeholder:``,class:`w-full`,"onUpdate:value":m},null,8,[`value`,`clearable`,`consistent-menu-width`,`disabled`,`filterable`,`max-tag-count`,`multiple`,`options`]))}}),Uu=(0,r.defineComponent)({__name:`set-client-price-form-item`,props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{},m2ReferenceProduct:{},disabledCoefficient:{type:Function},visibleCoefficient:{type:Function}},emits:[`update:value`],setup(e,{emit:i}){let a=e,s=i,c=()=>{let e=t.PriceCoefficient.getRetailPriceCoefficient();return(0,n.unset)(e,`isNewRec`),e},l=e=>!e||e.id===c().id,u=(0,r.computed)(()=>a.catalogItem?.type===`product`),d=(0,r.computed)(()=>!u.value&&!(0,n.isNil)(a.m2ReferenceProduct)),f=(0,r.computed)(()=>u.value?a.catalogItem:a.m2ReferenceProduct),p=(0,r.computed)(()=>!(0,n.isNil)(f.value)),m=(0,r.computed)(()=>`${f.value?.currency.symbol??``}${d.value?`/м²`:``}`),h=e=>d.value&&a.m2ReferenceProduct?ke.toM2Cost(e,a.m2ReferenceProduct):e,g=(0,r.computed)(()=>f.value?h(f.value.retailCost??f.value.cost):void 0),_=(0,r.computed)(()=>(f.value?.priceCoefficients??[]).map(e=>({...e,cost:h(e.cost)}))),v=e=>e.id===c().id?g.value:_.value.find(t=>t.coefficient.id===e.id)?.cost,y=(0,r.computed)(()=>{let e=[...(0,t.useReferencesStore)().priceCoefficientsReference?.map(e=>structuredClone((0,r.toRaw)(e)))??[],c()].filter(e=>a.visibleCoefficient?.(e)??!0);return p.value&&e.forEach(e=>{let t=v(e);t?e.name+=` (${(0,n.round)(t,2)} ${m.value})`:e.name=``}),e.filter(e=>e.name!==``)}),b=(0,r.ref)(a.value.coefficient),x=(0,r.ref)(a.value?.value?.toString()??null),S=(0,r.ref)(null),C=(0,r.computed)(()=>_.value.find(e=>e.coefficient.slug===t.PriceCoefficientEnum.K0)),w=(0,r.ref)(void 0),T=e=>Number.parseFloat((e??``).replaceAll(/[\s\u00A0\u202F]/g,``).replace(`,`,`.`)),E=()=>{w.value=void 0;let e=T(x.value);if(e=Number.isNaN(e)?void 0:e,p.value){if(b.value||x.value){let t=c(),n=v(b.value??t)??0,r=n+(e??0)/100*n;S.value=xe.formatMoney(r,f.value?.currency.precision),r>(g.value??r)&&(w.value={validationStatus:`warning`,feedback:`Устанавливается цена выше розничной цены`}),C.value&&r<(C.value?.cost??0)&&(w.value={validationStatus:`warning`,feedback:`Устанавливается цена ниже минимальной цены`})}else S.value=null}s(`update:value`,{value:Number.isNaN(e)?void 0:e,coefficient:l(b.value)?void 0:structuredClone((0,r.toRaw)(b.value))})},D=e=>{(0,n.isArray)(e)||(0,n.isNull)(e)||(b.value=e,x.value=null,!b.value&&x.value&&(b.value=c()),E())},O=()=>{b.value||=c(),E()},k=e=>{let t=T(e);if(p.value){if(Number.isNaN(t)){b.value=void 0,x.value=null,s(`update:value`,{value:void 0,coefficient:void 0});return}let e=0;if(t<=0)b.value=void 0,x.value=null;else if(C.value&&t<(C.value?.cost??0))b.value=C.value?.coefficient,e=(t-C.value.cost)*100/C.value.cost,w.value={validationStatus:`warning`,feedback:`Устанавливается цена ниже минимальной цены`};else if(t>(g.value??t)){b.value=c();let n=g.value??0;e=(t-n)*100/n,w.value={validationStatus:`warning`,feedback:`Устанавливается цена выше розничной цены`}}else{let r=_.value,i=(0,n.sortBy)(r,[e=>e.cost]),a=i.filter(e=>e.cost<=t).at(-1)??i.at(0);a&&(b.value=a.coefficient,e=(t-a.cost)*100/a.cost),w.value={validationStatus:void 0,feedback:void 0}}e=xe.roundPercent(e),x.value=xe.formatPercent(e,xe.percentFractionDigits),s(`update:value`,{value:Number.isNaN(e)?void 0:e,coefficient:l(b.value)?void 0:structuredClone((0,r.toRaw)(b.value))})}else s(`update:value`,{value:Number.isNaN(t)?void 0:t,coefficient:void 0})};return(0,r.onMounted)(()=>{a.calculationType===t.CalculationTypeEnum.m2Cost?S.value=a.value?.value?.toString()??null:!a.value?.coefficient&&a.value?.value&&(b.value=c()),E()}),(i,a)=>{let s=o.NInput,c=o.NInputGroup;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NFormItem),{"show-label":!(0,r.unref)(n.isNil)(e.label),label:e.label,"show-feedback":!(0,r.unref)(n.isNil)(w.value?.feedback??e.feedback),feedback:w.value?.feedback??e.feedback,"validation-status":w.value?.validationStatus??e.validationStatus},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([{"sm:grid-cols-3":p.value},`grid w-full grid-cols-1 gap-2`])},[e.calculationType===(0,r.unref)(t.CalculationTypeEnum).m2Cost?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)(c,{key:0,class:(0,r.normalizeClass)([`w-full flex-row`,{"sm:col-span-2":p.value}])},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Hu,{class:`w-full min-w-0 flex-1`,value:b.value,"reference-list":y.value,clearable:e.clearable,disabled:e.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"disabled-item":e.disabledCoefficient,"onUpdate:value":D},null,8,[`value`,`reference-list`,`clearable`,`disabled`,`disabled-item`]),(0,r.createVNode)(s,{value:x.value,"onUpdate:value":[a[0]||=e=>x.value=e,O],clearable:e.clearable,disabled:e.disabled,placeholder:``,class:`w-full min-w-0 flex-1`},(0,r.createSlots)({suffix:(0,r.withCtx)(()=>[a[3]||=(0,r.createTextVNode)(`%`,-1)]),_:2},[x.value&&!x.value.startsWith(`-`)?{name:`prefix`,fn:(0,r.withCtx)(()=>[a[2]||=(0,r.createTextVNode)(` + `,-1)]),key:`0`}:void 0]),1032,[`value`,`clearable`,`disabled`])]),_:1},8,[`class`])),p.value||e.calculationType===(0,r.unref)(t.CalculationTypeEnum).m2Cost?((0,r.openBlock)(),(0,r.createBlock)(s,{key:1,value:S.value,"onUpdate:value":[a[1]||=e=>S.value=e,k],clearable:e.clearable,disabled:e.disabled,placeholder:d.value?`Стоимость за м²`:`Стоимость`,class:`w-full`},(0,r.createSlots)({_:2},[p.value?{name:`suffix`,fn:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(m.value),1)]),key:`0`}:void 0]),1032,[`value`,`clearable`,`disabled`,`placeholder`])):(0,r.createCommentVNode)(``,!0)],2)]),_:1},8,[`show-label`,`label`,`show-feedback`,`feedback`,`validation-status`])}}}),Wu={class:`text-sm`},Gu={class:`text-sm`},Ku=(0,r.defineComponent)({__name:`add-product-to-cart-dialog`,emits:[`submit`],setup(e,{expose:i,emit:a}){let s=(0,r.useTemplateRef)(`form-reference`),c=(0,r.useTemplateRef)(`base-dialog-reference`),l=(0,r.ref)(!1),u=(0,r.ref)(null),d=(0,r.computed)(()=>u.value?.unit.isLinear&&u.value?.properties?.isLengthConfigurator),f=(0,r.computed)(()=>u.value?t.UnitsHelper.productIsMeasurable(u.value)||d.value?`шт.`:u.value.unit.name:`шт.`),p=(0,r.ref)(void 0),m=(0,r.ref)(void 0),h=(0,r.ref)(!0),g=(0,r.ref)(null),_=(0,r.computed)({get:()=>g.value?.quantity??null,set:e=>{g.value&&(g.value.quantity=e??0)}}),v=(0,r.computed)({get:()=>g.value?.length??null,set:e=>{g.value&&(g.value.length=e??void 0)}}),y=e=>{g.value&&(g.value.marker=e??void 0)},b=a,x=()=>({length:{},quantity:{},marker:{}}),S=(0,r.ref)(x()),C=(0,r.ref)(!1),w=(0,r.computed)(()=>{if(!u.value)return{};let e=t.UnitsHelper.getProductLengthMultiplicity(u.value),n=t.UnitsHelper.getProductMultiplicity(u.value),r=u.value?.properties?.minLength||e,i=u.value?.properties?.maxLength;return{length:[I.required,I.min(r??.1),I.max(i),I.step(e),Ee.serverValidation(S.value.length.feedback)],quantity:[I.required,I.min(n),I.step(n),Ee.serverValidation(S.value.quantity.feedback)],marker:[Ee.serverValidation(S.value.marker.feedback)]}}),E=(0,r.computed)(()=>u.value?u.value.properties?.lengthStep??(u.value.properties?.ignoreMinCountCheck?0:u.value.properties?.minCount??0):0),D=(0,r.computed)(()=>{if(!u.value)return``;let e=u.value?.properties?.minLength??(u.value?.properties?.ignoreMinCountCheck?0:u.value?.properties?.minCount),t=u.value?.properties?.maxLength;return e||t?`(${e?`от ${e}`:``}${e&&t?` `:``}${t?`до ${t}`:``} ${u.value?.unit.name})`:``}),O=e=>{if(!u.value?.properties?.isLengthConfigurator||!g.value||(0,n.isNil)(e)||E.value===0)return;let r=e/E.value,i=Math.round(r),a=t.UnitsHelper.getProductMultiplicity(u.value),o=Math.max(i,a);g.value.quantity=o},k=e=>{if(!u.value?.properties?.isLengthConfigurator||!g.value||(0,n.isNil)(e)||E.value===0)return;let r=xe.multiplyByStep(e,E.value),i=u.value.properties?.minLength||t.UnitsHelper.getProductLengthMultiplicity(u.value),a=u.value.properties?.maxLength;i!==void 0&&r<i?g.value.length=i:a!==void 0&&r>a?g.value.length=a:g.value.length=r},A=async e=>{let i=(0,n.cloneDeep)(g.value);try{await s.value?.validate(a=>{if(!a){if(!u.value||!i)return;t.UnitsHelper.productIsMeasurable(u.value)||delete i.length,d.value&&E.value&&(i.length=E.value),C.value=!0,b(`submit`,i,S.value,()=>{C.value=!1,e(!1),(0,r.nextTick)(()=>{s.value?.validate(n.noop).catch(n.noop)})})}})}catch{}},ee=()=>{u.value=null,p.value=void 0,g.value=null,S.value=x()},j=()=>{l.value=!1};return i({show:(e,n)=>{if(ee(),l.value=!0,u.value=e,p.value=n?.cartItemData,m.value=n?.orderId,h.value=n?.canSetDopProdaga??!1,g.value=new t.OrderItemBase(n?.cartItemData??new t.OrderItemBase({product:e,quantity:t.UnitsHelper.productIsMeasurable(u.value)?1:e?.properties?.minCount??1,length:e?.properties?.minLength||(e?.properties?.ignoreMinCountCheck?0:e?.properties?.minCount)||0})),e?.properties?.isLengthConfigurator&&g.value&&E.value>0){let e=E.value,t=g.value.quantity||1;g.value.length=xe.multiplyByStep(t,e)}},closeDialog:j}),(e,n)=>{let i=o.NFormItem,a=o.NInputGroupLabel,s=o.NInputGroup,b=o.NCheckbox;return(0,r.openBlock)(),(0,r.createBlock)(En,{ref:`base-dialog-reference`,show:l.value,title:`${p.value?`Изменение`:`Добавление`} товара ${u.value?.name} в ${m.value?` заказ №${m.value}`:`корзину`}`,"accept-button":{show:!0,text:p.value?`Изменить`:`Добавить`},processing:C.value,"modal-width":500,onAccept:A,onClosing:j},{default:(0,r.withCtx)(()=>[u.value&&g.value?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{key:0,ref:`form-reference`,model:g.value,rules:w.value,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.unref)(t.UnitsHelper).productIsMeasurable(u.value)?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,path:`length`,label:`Метраж, ${D.value+u.value.unit.name}`},(0,r.createSlots)({default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:v.value,"onUpdate:value":[n[0]||=e=>v.value=e,O],parse:(0,r.unref)(ve),step:(0,r.unref)(t.UnitsHelper).getProductLengthMultiplicity(u.value),"show-button":!1,placeholder:`Введите метраж`,class:`w-full`,onKeydown:n[1]||=e=>(0,r.unref)(_e)(e,`.`,!1),onInput:n[2]||=e=>(0,r.unref)(ye)(S.value,`length`),onFocus:(0,r.unref)(be)},null,8,[`value`,`parse`,`step`,`onFocus`])]),_:2},[!S.value.length.feedback&&(0,r.unref)(t.UnitsHelper).getProductLengthMultiplicity(u.value)!==1?{name:`feedback`,fn:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Wu,`Метраж должно быть кратно `+(0,r.toDisplayString)((0,r.unref)(t.UnitsHelper).getProductLengthMultiplicity(u.value)),1)]),key:`0`}:void 0]),1032,[`label`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(i,{path:`quantity`,label:`Количество, ${f.value}`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s,null,(0,r.createSlots)({default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:_.value,"onUpdate:value":[n[3]||=e=>_.value=e,k],parse:(0,r.unref)(ve),step:(0,r.unref)(t.UnitsHelper).getProductMultiplicity(u.value),"show-button":(0,r.unref)(t.UnitsHelper).getProductMultiplicity(u.value)>1,"button-placement":`both`,placeholder:`Введите количество`,class:`w-full`,onKeydown:n[4]||=e=>(0,r.unref)(_e)(e,`.`,!1),onInput:n[5]||=e=>(0,r.unref)(ye)(S.value,`quantity`),onFocus:(0,r.unref)(be)},null,8,[`value`,`parse`,`step`,`show-button`,`onFocus`]),d.value?((0,r.openBlock)(),(0,r.createBlock)(a,{key:0,class:`bg-orange-100 font-bold`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` x `+(0,r.toDisplayString)(E.value)+` `+(0,r.toDisplayString)(u.value.unit.name),1)]),_:1})):(0,r.createCommentVNode)(``,!0)]),_:2},[!S.value.quantity.feedback&&(0,r.unref)(t.UnitsHelper).getProductMultiplicity(u.value)!==1?{name:`feedback`,fn:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Gu,`Количество должно быть кратно `+(0,r.toDisplayString)((0,r.unref)(t.UnitsHelper).getProductMultiplicity(u.value)),1)]),key:`0`}:void 0]),1024)]),_:1},8,[`label`]),(0,r.unref)(t.UnitsHelper).productIsMeasurable(u.value)?((0,r.openBlock)(),(0,r.createBlock)(i,{key:1,path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:g.value.marker??null,placeholder:`Введите маркировку`,onInput:n[6]||=e=>(0,r.unref)(ye)(S.value,`marker`),"onUpdate:value":n[7]||=e=>y(e),onFocus:(0,r.unref)(be)},null,8,[`value`,`onFocus`])]),_:1})):(0,r.createCommentVNode)(``,!0),h.value?((0,r.openBlock)(),(0,r.createBlock)(b,{key:2,checked:g.value.isAdditionalSale,"onUpdate:checked":n[8]||=e=>g.value.isAdditionalSale=e,"true-value":!0,"false-value":!1},{default:(0,r.withCtx)(()=>[...n[9]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>c.value?.acceptHandler?.()]]):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`show`,`title`,`accept-button`,`processing`])}}}),qu={class:`flex flex-row gap-1`},Ju={class:`sc-client-name flex flex-col gap-1 text-base`},Yu=[`href`],Xu={key:1,class:`text-sc-grey`},Zu={key:0,class:`text-sc-dark-grey sc-client-city text-sm`},Qu={key:0},$u={key:1,class:`text-sm`},ed=(0,r.defineComponent)({__name:`client-name-with-short-info`,props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:[`click:client-name`,`click:client-info`],setup(e,{emit:a}){let s=e,c=a,l=(0,r.computed)(()=>s.client.lastLoginAt?(0,i.format)(s.client.lastLoginAt,(0,t.useBaseConfigStore)().config.dateFormats.uiDateWithTime):``),u=e=>{(0,n.isNil)(s.nameLink)&&(e.preventDefault(),e.stopPropagation()),c(`click:client-name`,s.client,e)};return(t,i)=>{let a=Ut,s=o.NButton,c=o.NPopover;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,qu,[e.showClientInfoIcon?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0,quaternary:``,size:`small`,onClick:i[0]||=n=>t.$emit(`click:client-info`,e.client)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(c,{disabled:(0,r.unref)(n.isNil)(e.popoverPosition),placement:e.popoverPosition},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Ju,[(0,r.createElementVNode)(`a`,{href:e.nameLink??`#`,class:`text-base no-underline`,onClick:i[1]||=e=>u(e)},[(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"line-through":!e.client.isActive})},(0,r.toDisplayString)(e.client.name),3),e.showSalesDirection&&e.client.salesDirection?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)({"line-through":!e.client.isActive})},` (`+(0,r.toDisplayString)(e.client.salesDirection.name)+`) `,3)):(0,r.createCommentVNode)(``,!0),e.client.isActive?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Xu,` [ Деактивирован ] `))],8,Yu),e.showCityAndRegion&&e.client.city?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Zu,` г. `+(0,r.toDisplayString)(e.client.city.name)+`, `+(0,r.toDisplayString)(e.client.city.region.name),1)):(0,r.createCommentVNode)(``,!0)])]),default:(0,r.withCtx)(()=>[e.client.alternativeName?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Qu,(0,r.toDisplayString)(e.client.alternativeName),1)):(0,r.createCommentVNode)(``,!0),l.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,$u,` Последний вход: `+(0,r.toDisplayString)(l.value),1)):(0,r.createCommentVNode)(``,!0),(0,r.renderSlot)(t.$slots,`popover-content`)]),_:3},8,[`disabled`,`placement`])])}}}),td={class:`text-base`},nd=(0,r.defineComponent)({__name:`contragent-with-short-info`,props:{contragent:{}},setup(e){let t=e,n=(0,r.computed)(()=>he.getFormatEntityName(t.contragent));return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,td,(0,r.toDisplayString)(n.value),1))}}),rd={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function id(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,rd,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.createElementVNode)(`path`,{d:`M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}),(0,r.createElementVNode)(`path`,{d:`m3 7l9 6l9-6`})],-1)]])}var ad=(0,r.markRaw)({name:`tabler-mail`,render:id}),od=[`href`],sd=(0,r.defineComponent)({__name:`email`,props:{email:{default:``},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let i=ad;return(0,r.openBlock)(),(0,r.createElementBlock)(`span`,{class:(0,r.normalizeClass)({"flex flex-row items-center gap-1":e.showEmailIcon})},[e.showEmailIcon?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`a`,{href:`mailto:${e.email}`,class:`no-underline`},(0,r.toDisplayString)(e.email),9,od)],2)}}}),cd={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function ld(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,cd,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6`},null,-1)]])}var ud=(0,r.markRaw)({name:`fa6-brands-viber`,render:ld}),dd={viewBox:`0 0 256 258`,width:`1.2em`,height:`1.2em`},fd=[`id`],pd=[`id`],md=[`fill`],hd=[`fill`];function gd(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,dd,[(0,r.createElementVNode)(`defs`,null,[(0,r.createElementVNode)(`linearGradient`,{id:e.idMap.SVGK3KZq49U,x1:`50%`,x2:`50%`,y1:`100%`,y2:`0%`},[...t[0]||=[(0,r.createElementVNode)(`stop`,{offset:`0%`,"stop-color":`#1faf38`},null,-1),(0,r.createElementVNode)(`stop`,{offset:`100%`,"stop-color":`#60d669`},null,-1)]],8,fd),(0,r.createElementVNode)(`linearGradient`,{id:e.idMap.SVGefMkoEOd,x1:`50%`,x2:`50%`,y1:`100%`,y2:`0%`},[...t[1]||=[(0,r.createElementVNode)(`stop`,{offset:`0%`,"stop-color":`#f9f9f9`},null,-1),(0,r.createElementVNode)(`stop`,{offset:`100%`,"stop-color":`#fff`},null,-1)]],8,pd)]),(0,r.createElementVNode)(`path`,{fill:`url(#`+e.idMap.SVGK3KZq49U+`)`,d:`M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004`},null,8,md),(0,r.createElementVNode)(`path`,{fill:`url(#`+e.idMap.SVGefMkoEOd+`)`,d:`M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z`},null,8,hd),t[2]||=(0,r.createElementVNode)(`path`,{fill:`#fff`,d:`M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64`},null,-1)])}var _d=(0,r.markRaw)({name:`logos-whatsapp-icon`,render:gd,setup(){let e=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGK3KZq49U:`uicons-`+e(),SVGefMkoEOd:`uicons-`+e()}}}}),vd={viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`},yd=[`id`],bd=[`fill`];function xd(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,vd,[(0,r.createElementVNode)(`defs`,null,[(0,r.createElementVNode)(`linearGradient`,{id:e.idMap.SVG6DaOZcwt,x1:`50%`,x2:`50%`,y1:`0%`,y2:`100%`},[...t[0]||=[(0,r.createElementVNode)(`stop`,{offset:`0%`,"stop-color":`#2aabee`},null,-1),(0,r.createElementVNode)(`stop`,{offset:`100%`,"stop-color":`#229ed9`},null,-1)]],8,yd)]),(0,r.createElementVNode)(`path`,{fill:`url(#`+e.idMap.SVG6DaOZcwt+`)`,d:`M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0`},null,8,bd),t[1]||=(0,r.createElementVNode)(`path`,{fill:`#fff`,d:`M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072`},null,-1)])}var Sd=(0,r.markRaw)({name:`logos-telegram`,render:xd,setup(){return{idMap:{SVG6DaOZcwt:`uicons-`+Math.random().toString(36).substr(2,10)}}}}),Cd={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function wd(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Cd,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480`},null,-1)]])}var Td=(0,r.markRaw)({name:`ion-call`,render:wd}),Ed={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Dd(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ed,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6`},null,-1)]])}var Od=(0,r.markRaw)({name:`tabler-phone-call`,render:Dd}),kd={key:0,class:`absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm`},Ad=[`href`],jd=[`href`],Md=[`href`],Nd=[`href`],Pd=(0,r.defineComponent)({__name:`phone`,props:{defaultCountry:{},phone:{default:``},showPhoneIcon:{type:Boolean,default:!1}},setup(e){let t=e,i=(0,r.computed)(()=>{try{return t.phone?(0,s.parsePhoneNumberWithError)(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),a=(0,r.computed)(()=>(0,n.isString)(i.value)?!1:i.value?.isValid()??!1),o=(0,r.computed)(()=>(0,n.isString)(i.value)?i.value:i.value?.format(`INTERNATIONAL`)??``),c=(0,r.computed)(()=>(0,n.isString)(i.value)?i.value:i.value?.format(`E.164`)??``),l=(0,r.ref)(!1);return(t,n)=>{let i=Od,s=Td,u=Sd,d=_d,f=ud;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"border-xl relative inline-flex items-center rounded px-2":a.value&&l.value,"min-w-10":!0}),onClick:n[0]||=e=>l.value=!l.value,onFocusout:n[1]||=e=>l.value=!1,onMouseleave:n[2]||=e=>l.value=!1},[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"flex flex-row items-center gap-1":e.showPhoneIcon})},[e.showPhoneIcon?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0})):(0,r.createCommentVNode)(``,!0),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(o.value),1)],2),a.value&&l.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,kd,[a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`tel:${c.value}`,class:`text-blue-600 hover:animate-pulse hover:text-blue-600`},[(0,r.createVNode)(s)],8,Ad)):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:1,href:`https://t.me/${c.value}`,target:`_blank`,rel:`noopener noreferrer`,class:`hover:animate-pulse`},[(0,r.createVNode)(u)],8,jd)):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:2,href:`https://wa.me/${c.value.substring(1)}`,target:`_blank`,rel:`noopener noreferrer`,class:`hover:animate-pulse`},[(0,r.createVNode)(d)],8,Md)):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:3,href:`viber://chat?number=${c.value}`,class:`text-purple-600 hover:animate-pulse hover:text-purple-600`},[(0,r.createVNode)(f)],8,Nd)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)],34)])}}}),Fd={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Id(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Fd,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2`},null,-1)]])}var Ld=(0,r.markRaw)({name:`mdi-envelope`,render:Id}),Rd={class:`flex flex-col gap-1`},zd={key:0,class:`mb-2 flex flex-col text-base`},Bd={key:0,class:`text-sc-dark-grey text-sm`},Vd={key:1,class:`whitespace-nowrap text-sm`},Hd={key:2,class:`whitespace-nowrap text-sm`},Ud={key:3,class:`absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm`},Wd=[`href`],Gd=[`href`],Kd=[`href`],qd=[`href`],Jd=[`href`],Yd={key:0,class:`flex flex-col text-base`},Xd={key:0,class:`text-sc-dark-grey text-sm`},Zd={key:1,class:`mt-2 text-sm`},Qd={key:0,class:`-mt-1`},$d=(0,r.defineComponent)({__name:`person-contacts-block`,props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:``},styles:{default:void 0}},setup(e){let t=e,i=(0,r.computed)(()=>he.getFormatEntityName(t.contact)),a=(0,r.computed)(()=>{try{return t.contact.phone?(0,s.parsePhoneNumberWithError)(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),c=(0,r.computed)(()=>(0,n.isString)(a.value)?!1:a.value?.isValid()??!1),l=(0,r.computed)(()=>(0,n.isString)(a.value)?a.value:a.value?.format(`INTERNATIONAL`)??``),u=(0,r.computed)(()=>(0,n.isString)(a.value)?a.value:a.value?.format(`E.164`)??``),d=(0,r.computed)(()=>c.value||t.contact.email),f=(0,r.ref)(!1);return(t,n)=>{let a=Td,s=Sd,p=_d,m=ud,h=Ld,g=o.NPopover;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Rd,[(0,r.createVNode)(g,{disabled:e.fullView,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${e.contact?.isPrimary?`ring-1 ring-inset ring-green-600 hover:ring-gray-200`:``} ${e.classes}`),style:(0,r.normalizeStyle)(e.styles),onMouseenter:n[0]||=e=>f.value=!0,onFocusin:n[1]||=e=>f.value=!0,onMouseleave:n[2]||=e=>f.value=!1,onFocusout:n[3]||=e=>f.value=!1},[(0,r.createElementVNode)(`div`,null,[e.fullView&&(e.contact.name||e.contact?.position)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,zd,[(0,r.createTextVNode)((0,r.toDisplayString)(i.value)+` `,1),e.contact?.position?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Bd,(0,r.toDisplayString)(e.contact?.position),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0),e.contact.phone?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Vd,(0,r.toDisplayString)(l.value),1)):(0,r.createCommentVNode)(``,!0),e.contact.email?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Hd,(0,r.toDisplayString)(e.contact.email),1)):(0,r.createCommentVNode)(``,!0),d.value&&f.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ud,[c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`tel:${u.value}`,class:`text-blue-600 hover:text-3xl hover:text-blue-600`},[(0,r.createVNode)(a)],8,Wd)):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:1,href:`https://t.me/${u.value}`,target:`_blank`,rel:`noopener noreferrer`,class:`hover:text-3xl`},[(0,r.createVNode)(s)],8,Gd)):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:2,href:`https://wa.me/${u.value.substring(1)}`,target:`_blank`,rel:`noopener noreferrer`,class:`hover:text-3xl`},[(0,r.createVNode)(p)],8,Kd)):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:3,href:`viber://chat?number=${u.value}`,class:`text-purple-600 hover:text-3xl hover:text-purple-600`},[(0,r.createVNode)(m)],8,qd)):(0,r.createCommentVNode)(``,!0),e.contact.email?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:4,href:`mailto:${e.contact.email}`,class:`hover:text-3xl`},[(0,r.createVNode)(h)],8,Jd)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)])],38)]),default:(0,r.withCtx)(()=>[e.contact.name?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Yd,[(0,r.createTextVNode)((0,r.toDisplayString)(i.value)+` `,1),e.contact?.position?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Xd,(0,r.toDisplayString)(e.contact?.position),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0),e.contact?.comment?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Zd,[n[4]||=(0,r.createElementVNode)(`sup`,null,`**`,-1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.contact?.comment),1)])):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`disabled`]),e.fullView&&e.contact?.comment?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Qd,[n[5]||=(0,r.createElementVNode)(`sup`,null,`**`,-1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.contact?.comment),1)])):(0,r.createCommentVNode)(``,!0)])}}}),ef=class{minHeight;maxHeights;minWidth;maxWidths;netType;color;mountType;descriptions;crossbarCount;heightOverlaps;widthOverlaps;canSetDopProdaga;constructor(e){this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=(0,c.objectToSnake)(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=(0,c.objectToSnake)(e.heightOverlaps),this.widthOverlaps=(0,c.objectToSnake)(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}};function tf(e){return e.properties?.configurator!==t.ConfiguratorsEnum.SandwichM2||e.properties.configuratorSettings!==void 0&&(0,n.isArray)(e.products)&&e.products.length>0}var nf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rf(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,nf,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M16 12a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2`},null,-1)]])}var af=(0,r.markRaw)({name:`mdi-dots-horizontal`,render:rf}),of={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function sf(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,of,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5A6.5 6.5 0 0 0 9.5 3A6.5 6.5 0 0 0 3 9.5A6.5 6.5 0 0 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5l1.5-1.5zm-6 0C7 14 5 12 5 9.5S7 5 9.5 5S14 7 14 9.5S12 14 9.5 14M7 9h5v1H7z`},null,-1)]])}var cf=(0,r.markRaw)({name:`mdi-magnify-minus-outline`,render:sf}),lf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function uf(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,lf,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`m15.5 14l5 5l-1.5 1.5l-5-5v-.79l-.27-.28A6.47 6.47 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27zm-6 0C12 14 14 12 14 9.5S12 5 9.5 5S5 7 5 9.5S7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z`},null,-1)]])}var df=(0,r.markRaw)({name:`mdi-magnify-plus-outline`,render:uf}),ff={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function pf(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,ff,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z`},null,-1)]])}var mf=(0,r.markRaw)({name:`mdi-chevron-right`,render:pf}),hf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function gf(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,hf,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z`},null,-1)]])}var _f=(0,r.markRaw)({name:`mdi-chevron-left`,render:gf}),vf={heightMedium:`40px`,paddingMedium:`0 16px`,borderRadiusMedium:`10px`,fontSizeMedium:`14px`,iconSizeMedium:`18px`,iconMarginMedium:`8px`,border:`1px solid #d1d5db`,borderHover:`1px solid #9ca3af`,borderPressed:`1px solid #9ca3af`,borderFocus:`1px solid #9ca3af`},yf={heightSmall:`36px`,paddingSmall:`0 10px`,borderRadiusSmall:`8px`,iconSizeSmall:`18px`,border:`1px solid #d1d5db`,borderHover:`1px solid #9ca3af`,borderPressed:`1px solid #9ca3af`,borderFocus:`1px solid #9ca3af`},bf=`date-range.dialog.mode`,xf=`date-range.dialog.scale`,Sf=`date-range.quick-periods`,Cf=[`thisMonth`,`lastMonth`,`thisQuarter`,`lastQuarter`,`thisYear`,`lastYear`,`fromBeginningOfThisYear`],wf=[`Янв`,`Фев`,`Мар`,`Апр`,`Май`,`Июн`,`Июл`,`Авг`,`Сен`,`Окт`,`Ноя`,`Дек`],Tf=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],Ef=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],Df=new Date(2e3,0,1),Of=e=>(0,i.differenceInCalendarDays)(e,Df),kf=e=>(0,i.addDays)(Df,e),Af=(e,t,n)=>{let r=e??void 0,a=t??void 0;return r&&a&&r>a&&(n?.from?a=r:n?.to?r=a:[r,a]=[a,r]),{from:r?(0,i.startOfDay)(r):void 0,to:a?(0,i.endOfDay)(a):void 0}},jf=e=>Object.entries(e).map(([e,t])=>({value:e,label:t.label,item:t})),Mf=(e,n)=>{let r=Object.entries(e).filter(([,e])=>e.group===n);return n===`other`?t.STANDARD_PERIOD_SECTIONS.map(e=>{let t=r.filter(([,t])=>t.section===e.key);return{type:`group`,key:e.key,label:e.label,children:jf(Object.fromEntries(t))}}).filter(e=>e.children.length>0):[{type:`group`,key:n,children:jf(Object.fromEntries(r))}]},Nf=(e,t)=>{let n=(0,r.ref)(null),i=(0,r.ref)(null),a=(0,r.ref)(!1),o=(0,r.ref)(null),s=(e,t)=>e<=t?[e,t]:[t,e],c=(0,r.computed)(()=>a.value&&i.value!==null&&o.value!==null?s(i.value,o.value):n.value===null?e.value:o.value===null?[n.value,n.value]:s(n.value,o.value)),l=(e,r)=>{n.value=null,t(...s(e,r))},u=e=>{n.value===null?(n.value=e,t(e,e)):l(n.value,e)},d=()=>{globalThis.removeEventListener(`pointerup`,d);let e=i.value;e!==null&&(i.value=null,a.value?(a.value=!1,o.value!==null&&l(e,o.value)):u(e))};return(0,r.onBeforeUnmount)(()=>{globalThis.removeEventListener(`pointerup`,d)}),{activeRange:c,cellPosition:e=>{let t=c.value;return!t||e<t[0]||e>t[1]?null:e===t[0]||e===t[1]?`bound`:`in-range`},pointerDownHandler:e=>{i.value=e,a.value=!1,globalThis.addEventListener(`pointerup`,d)},pointerEnterHandler:e=>{o.value=e,i.value!==null&&e!==i.value&&(a.value=!0)},pointerLeaveHandler:()=>{o.value=null},selectHandler:u}},Pf={class:`flex items-center justify-between gap-2`},Ff={class:`flex items-center gap-2`},If={class:`text-center font-semibold`},Lf={class:`grid grid-cols-7 gap-0.5 text-center text-xs text-gray-500`},Rf={class:`grid grid-cols-7 gap-0.5`},zf=[`disabled`,`onPointerdown`,`onPointerenter`,`onKeydown`],Bf=yt((0,r.defineComponent)({__name:`day-range-grid`,props:{from:{},to:{}},emits:[`select`],setup(e,{emit:t}){let a=e,s=t,c=(0,o.useThemeVars)(),l=(0,r.computed)(()=>({"--sc-primary-color":c.value.primaryColor,"--sc-primary-color-hover":c.value.primaryColorHover,"--sc-primary-color-suppl":c.value.primaryColorSuppl,"--sc-hover-color":c.value.hoverColor})),u=F.initRefDependingOnDeviceResolution(1,2,3),d=(0,r.computed)(()=>[`grid-cols-1`,`grid-cols-2`,`grid-cols-3`][u.value-1]),f=e=>(0,i.subMonths)((0,i.startOfMonth)(e),+(u.value===3)),p=(0,r.ref)(f((e=>e&&(0,i.isValid)(e)?e:new Date)(a.from??a.to))),m=Nf((0,r.computed)(()=>{let{from:e,to:t}=a;return!e||!t||!(0,i.isValid)(e)||!(0,i.isValid)(t)?null:[Of(e),Of(t)]}),(e,t)=>{s(`select`,{from:(0,i.startOfDay)(kf(e)),to:(0,i.endOfDay)(kf(t))})}),h=e=>{let t=(0,i.subDays)(e,((0,i.getDay)(e)+6)%7);return(0,n.times)(42,n=>{let r=(0,i.addDays)(t,n);return{index:Of(r),day:r.getDate(),isCurrentMonth:(0,i.isSameMonth)(r,e),isToday:(0,i.isToday)(r)}})},g=(0,r.computed)(()=>(0,n.times)(u.value,e=>{let t=(0,i.addMonths)(p.value,e);return{key:`${t.getFullYear()}-${t.getMonth()}`,title:`${Tf[t.getMonth()]} ${t.getFullYear()}`,cells:h(t)}})),_=e=>{if(!e.isCurrentMonth)return[`sc-day--outside`];let t=e.isToday?[`sc-day--today`]:[],n=m.cellPosition(e.index);return n&&t.push(`sc-day--${n}`),t};return(0,r.watch)(()=>[a.from,a.to],()=>{let e=a.from??a.to;if(!e||!(0,i.isValid)(e))return;let t=`${e.getFullYear()}-${e.getMonth()}`;(0,n.some)(g.value,[`key`,t])||(p.value=f(e))}),(e,t)=>{let n=_f,a=o.NButton,s=mf;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:`flex select-none flex-col gap-3`,style:(0,r.normalizeStyle)(l.value),onPointerleave:t[2]||=(...e)=>(0,r.unref)(m).pointerLeaveHandler&&(0,r.unref)(m).pointerLeaveHandler(...e)},[(0,r.createElementVNode)(`div`,Pf,[(0,r.createVNode)(a,{size:`small`,"aria-label":`Предыдущий месяц`,"theme-overrides":(0,r.unref)(yf),onClick:t[0]||=e=>p.value=(0,r.unref)(i.subMonths)(p.value,1)},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(n)]),_:1},8,[`theme-overrides`]),t[3]||=(0,r.createElementVNode)(`span`,{class:`text-sm text-gray-600`},`Выберите диапазон на календаре`,-1),(0,r.createElementVNode)(`div`,Ff,[(0,r.renderSlot)(e.$slots,`actions`,{},void 0,!0),(0,r.createVNode)(a,{size:`small`,"aria-label":`Следующий месяц`,"theme-overrides":(0,r.unref)(yf),onClick:t[1]||=e=>p.value=(0,r.unref)(i.addMonths)(p.value,1)},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(s)]),_:1},8,[`theme-overrides`])])]),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`grid gap-3`,d.value])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(g.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:e.key,class:`flex flex-col gap-1`},[(0,r.createElementVNode)(`div`,If,(0,r.toDisplayString)(e.title),1),(0,r.createElementVNode)(`div`,Lf,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(Ef),e=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:e},(0,r.toDisplayString)(e),1))),128))]),(0,r.createElementVNode)(`div`,Rf,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.cells,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:e.index,type:`button`,class:(0,r.normalizeClass)([`sc-day h-7 rounded border-0 p-0 text-xs`,_(e)]),disabled:!e.isCurrentMonth,onPointerdown:(0,r.withModifiers)(t=>(0,r.unref)(m).pointerDownHandler(e.index),[`prevent`]),onPointerenter:t=>(0,r.unref)(m).pointerEnterHandler(e.index),onKeydown:[(0,r.withKeys)((0,r.withModifiers)(t=>(0,r.unref)(m).selectHandler(e.index),[`prevent`]),[`enter`]),(0,r.withKeys)((0,r.withModifiers)(t=>(0,r.unref)(m).selectHandler(e.index),[`prevent`]),[`space`])]},(0,r.toDisplayString)(e.day),43,zf))),128))])]))),128))],2),t[4]||=(0,r.createStaticVNode)(`<div class="flex flex-wrap items-center gap-x-6 gap-y-1 text-xs text-gray-700" data-v-0a24c228><span class="flex items-center gap-2" data-v-0a24c228><i class="sc-legend sc-legend--bound" data-v-0a24c228></i>Дата начала</span><span class="flex items-center gap-2" data-v-0a24c228><i class="sc-legend sc-legend--in-range" data-v-0a24c228></i>Выбранный период</span><span class="flex items-center gap-2" data-v-0a24c228><i class="sc-legend sc-legend--bound" data-v-0a24c228></i>Дата окончания</span></div>`,1)],36)}}}),[[`__scopeId`,`data-v-0a24c228`]]),Vf={class:`flex items-center justify-between gap-2`},Hf={class:`flex items-center gap-2`},Uf={class:`text-center font-semibold`},Wf={class:`grid grid-cols-3 gap-2`},Gf=[`onPointerdown`,`onPointerenter`,`onKeydown`],Kf=yt((0,r.defineComponent)({__name:`month-range-grid`,props:{from:{},to:{}},emits:[`select`],setup(e,{emit:t}){let n=e,a=t,s=(0,o.useThemeVars)(),c=(0,r.computed)(()=>({"--sc-primary-color":s.value.primaryColor,"--sc-primary-color-hover":s.value.primaryColorHover,"--sc-primary-color-suppl":s.value.primaryColorSuppl,"--sc-hover-color":s.value.hoverColor})),l=(0,r.ref)((e=>{let t=new Date().getFullYear();return e&&(0,i.isValid)(e)?e.getFullYear():t})(n.from??n.to)),u=F.initRefDependingOnDeviceResolution(1,3,3),d=(0,r.computed)(()=>u.value===1?[l.value]:[l.value-1,l.value,l.value+1]),f=Nf((0,r.computed)(()=>{let{from:e,to:t}=n;return!e||!t||!(0,i.isValid)(e)||!(0,i.isValid)(t)?null:[e.getFullYear()*12+e.getMonth(),t.getFullYear()*12+t.getMonth()]}),(e,t)=>{a(`select`,{from:new Date(Math.floor(e/12),e%12,1),to:(0,i.endOfMonth)(new Date(Math.floor(t/12),t%12,1))})}),p=(e,t)=>{let n=f.cellPosition(e*12+t);return n?[`sc-month--${n}`]:[]};return(0,r.watch)(()=>[n.from,n.to],()=>{let e=n.from??n.to;if(!e||!(0,i.isValid)(e))return;let t=e.getFullYear();(t<l.value-1||t>l.value+1)&&(l.value=t)}),(e,t)=>{let n=_f,i=o.NButton,a=mf;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:`flex select-none flex-col gap-3`,style:(0,r.normalizeStyle)(c.value),onPointerleave:t[2]||=(...e)=>(0,r.unref)(f).pointerLeaveHandler&&(0,r.unref)(f).pointerLeaveHandler(...e)},[(0,r.createElementVNode)(`div`,Vf,[(0,r.createVNode)(i,{size:`small`,"aria-label":`Предыдущий год`,"theme-overrides":(0,r.unref)(yf),onClick:t[0]||=e=>--l.value},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(n)]),_:1},8,[`theme-overrides`]),t[3]||=(0,r.createElementVNode)(`span`,{class:`text-sm text-gray-600`},`Выберите диапазон месяцев`,-1),(0,r.createElementVNode)(`div`,Hf,[(0,r.renderSlot)(e.$slots,`actions`,{},void 0,!0),(0,r.createVNode)(i,{size:`small`,"aria-label":`Следующий год`,"theme-overrides":(0,r.unref)(yf),onClick:t[1]||=e=>l.value+=1},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`theme-overrides`])])]),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`grid gap-4 sm:gap-6`,d.value.length===1?`grid-cols-1`:`grid-cols-3`])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(d.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:e,class:`flex flex-col gap-2`},[(0,r.createElementVNode)(`div`,Uf,(0,r.toDisplayString)(e),1),(0,r.createElementVNode)(`div`,Wf,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(wf),(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:t,type:`button`,class:(0,r.normalizeClass)([`sc-month cursor-pointer rounded-lg px-1 py-2.5 text-sm`,p(e,n)]),onPointerdown:(0,r.withModifiers)(t=>(0,r.unref)(f).pointerDownHandler(e*12+n),[`prevent`]),onPointerenter:t=>(0,r.unref)(f).pointerEnterHandler(e*12+n),onKeydown:[(0,r.withKeys)((0,r.withModifiers)(t=>(0,r.unref)(f).selectHandler(e*12+n),[`prevent`]),[`enter`]),(0,r.withKeys)((0,r.withModifiers)(t=>(0,r.unref)(f).selectHandler(e*12+n),[`prevent`]),[`space`])]},(0,r.toDisplayString)(t),43,Gf))),128))])]))),128))],2)],36)}}}),[[`__scopeId`,`data-v-4b12bde5`]]),qf={class:`sc-date-range-sidebar flex flex-col gap-1`},Jf={class:`flex items-center justify-center gap-1`},Yf={class:`min-w-12 text-center font-semibold`},Xf={class:`grid grid-flow-col grid-cols-2 grid-rows-6 gap-1`},Zf=(0,r.defineComponent)({__name:`month-year-sidebar`,props:{year:{},month:{}},emits:[`update:year`,`select-month`,`today`],setup(e,{emit:t}){let n=t;return(t,i)=>{let a=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,qf,[(0,r.createElementVNode)(`div`,Jf,[(0,r.createVNode)(a,{size:`small`,quaternary:``,onClick:i[0]||=t=>n(`update:year`,e.year-1)},{default:(0,r.withCtx)(()=>[...i[3]||=[(0,r.createTextVNode)(` ‹ `,-1)]]),_:1}),(0,r.createElementVNode)(`span`,Yf,(0,r.toDisplayString)(e.year),1),(0,r.createVNode)(a,{size:`small`,quaternary:``,onClick:i[1]||=t=>n(`update:year`,e.year+1)},{default:(0,r.withCtx)(()=>[...i[4]||=[(0,r.createTextVNode)(` › `,-1)]]),_:1})]),(0,r.createElementVNode)(`div`,Xf,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(wf),(t,i)=>((0,r.openBlock)(),(0,r.createBlock)(a,{key:t,size:`small`,quaternary:``,type:i===e.month?`primary`:`default`,onClick:e=>n(`select-month`,i)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(t),1)]),_:2},1032,[`type`,`onClick`]))),128))]),(0,r.createVNode)(a,{size:`small`,text:``,type:`info`,onClick:i[2]||=e=>n(`today`)},{default:(0,r.withCtx)(()=>[...i[5]||=[(0,r.createTextVNode)(` Сегодня `,-1)]]),_:1})])}}}),Qf=(0,r.defineComponent)({__name:`date-range-input`,props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>(0,t.useBaseConfigStore)().config.dateFormats.uiDate}},emits:[`update:value`],setup(e,{emit:t}){let n=e,a=t,s=F.initRefDependingOnDeviceResolution(!0,!1,!1),c=(0,r.ref)(null),l=(0,r.ref)(!1),u=(0,r.ref)(0),d=(0,r.ref)(n.value&&(0,i.isValid)(n.value)?n.value:new Date),f=(0,r.computed)(()=>{let e=n.value&&(0,i.isValid)(n.value)?n.value:d.value;return e.getFullYear()===d.value.getFullYear()?e.getMonth():null}),p=0,m=e=>{e.target?.closest?.(`.n-base-clear__clear`)&&(p=performance.now())},h=e=>{e&&performance.now()-p<300||(l.value=e,e&&(d.value=n.value&&(0,i.isValid)(n.value)?n.value:new Date))},g=e=>{a(`update:value`,e===null?null:new Date(e))},_=(e,t)=>{let o=new Date(e,t,1);if(d.value=o,n.value&&(0,i.isValid)(n.value)){let r=Math.min((0,i.getDate)(n.value),(0,i.getDaysInMonth)(o));a(`update:value`,new Date(e,t,r))}else u.value+=1,(0,r.nextTick)().then(()=>c.value?.focus())},v=(e,t)=>{d.value=(0,i.addYears)((0,i.addMonths)(d.value,e),t)},y=e=>{_(e,d.value.getMonth())},b=e=>{_(d.value.getFullYear(),e)},x=()=>{l.value=!1,a(`update:value`,new Date)};return(t,i)=>{let a=o.NButton,p=o.NDatePicker;return(0,r.openBlock)(),(0,r.createBlock)(p,{ref_key:`pickerReference`,ref:c,key:u.value,value:n.value?n.value.getTime():null,show:l.value,clearable:e.clearable,disabled:e.disabled,placeholder:e.placeholder,format:e.dateFormat,actions:[],"default-calendar-start-time":d.value.getTime(),type:`date`,class:`w-full min-w-0`,onMousedownCapture:m,"onUpdate:show":h,"onUpdate:value":g,onNextMonth:i[0]||=e=>v(1,0),onPrevMonth:i[1]||=e=>v(-1,0),onNextYear:i[2]||=e=>v(0,1),onPrevYear:i[3]||=e=>v(0,-1)},{footer:(0,r.withCtx)(()=>[(0,r.unref)(s)?((0,r.openBlock)(),(0,r.createBlock)(a,{key:1,size:`small`,text:``,type:`info`,onClick:x},{default:(0,r.withCtx)(()=>[...i[4]||=[(0,r.createTextVNode)(` Сегодня `,-1)]]),_:1})):((0,r.openBlock)(),(0,r.createBlock)(Zf,{key:0,year:d.value.getFullYear(),month:f.value,"onUpdate:year":y,onSelectMonth:b,onToday:x},null,8,[`year`,`month`]))]),_:1},8,[`value`,`show`,`clearable`,`disabled`,`placeholder`,`format`,`default-calendar-start-time`])}}}),$f={key:0,class:`text-gray-400`},ep=(0,r.defineComponent)({__name:`date-range-fields`,props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},from:{default:null},to:{default:null},placeholderFrom:{default:`Дата начала`},placeholderTo:{default:`Дата окончания`},dateFormat:{default:void 0}},emits:[`update:from`,`update:to`],setup(e,{emit:t}){let n=F.initRefDependingOnDeviceResolution(!0,!1,!1),i=t;return(t,a)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`flex w-full min-w-0 gap-1`,(0,r.unref)(n)?`flex-col`:`flex-row items-center`])},[(0,r.createVNode)(Qf,{value:e.from,clearable:e.clearable,disabled:e.disabled?.from,placeholder:e.placeholderFrom,"date-format":e.dateFormat,class:`min-w-0 flex-1`,"onUpdate:value":a[0]||=e=>i(`update:from`,e)},null,8,[`value`,`clearable`,`disabled`,`placeholder`,`date-format`]),(0,r.unref)(n)?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,$f,` – `)),(0,r.createVNode)(Qf,{value:e.to,clearable:e.clearable,disabled:e.disabled?.to,placeholder:e.placeholderTo,"date-format":e.dateFormat,class:`min-w-0 flex-1`,"onUpdate:value":a[1]||=e=>i(`update:to`,e)},null,8,[`value`,`clearable`,`disabled`,`placeholder`,`date-format`])],2))}}),tp={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function np(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,tp,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M7 11h2v2H7zm14-6v14c0 1.11-.89 2-2 2H5a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2M5 7h14V5H5zm14 12V9H5v10zm-4-6v-2h2v2zm-4 0v-2h2v2zm-4 2h2v2H7zm8 2v-2h2v2zm-4 0v-2h2v2z`},null,-1)]])}var rp=(0,r.markRaw)({name:`mdi-calendar-month-outline`,render:np}),ip={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ap(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,ip,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`m16 11.78l4.24-7.33l1.73 1l-5.23 9.05l-6.51-3.75L5.46 19H22v2H2V3h2v14.54L9.5 8z`},null,-1)]])}var op=(0,r.markRaw)({name:`mdi-chart-line`,render:ap}),sp={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function cp(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,sp,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M22 21H2V3h2v16h2v-9h4v9h2V6h4v13h2v-5h4z`},null,-1)]])}var lp=(0,r.markRaw)({name:`mdi-chart-bar`,render:cp}),up={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function dp(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,up,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M5 3h1V1h2v2h8V1h2v2h1c1.11 0 2 .89 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 16h14V9H5zM5 7h14V5H5zm12 4v2H7v-2z`},null,-1)]])}var fp=(0,r.markRaw)({name:`mdi-calendar-week-outline`,render:dp}),pp={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function mp(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,pp,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M19 3h-1V1h-2v2H8V1H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2m0 16H5V9h14zm0-12H5V5h14M7 11h5v5H7`},null,-1)]])}var hp=(0,r.markRaw)({name:`mdi-calendar-today-outline`,render:mp}),gp={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function _p(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,gp,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m-2 12c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1l-.07 1l2.11 1.63c.19.15.25.42.12.64l-2 3.46c-.12.22-.39.31-.61.22l-2.49-1c-.52.39-1.06.73-1.69.98l-.37 2.65c-.04.24-.25.42-.5.42zm1.25-18l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.52l.37-2.61c1.19-.25 2.24-.89 3.01-1.77l2.43 1.04l.75-1.3l-2.12-1.55c.4-1.17.4-2.44 0-3.61l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4z`},null,-1)]])}var vp=(0,r.markRaw)({name:`mdi-cog-outline`,render:_p}),yp={class:`grid gap-x-6 gap-y-4 pr-3 sm:grid-cols-2`},bp={class:`font-medium`},xp={key:0,class:`pt-1 text-xs text-gray-500`},Sp={class:`flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center`},Cp={class:`flex items-center gap-3`},wp={class:`text-sm text-gray-600`},Tp={class:`flex gap-2`},Ep=(0,r.defineComponent)({__name:`quick-periods-settings`,props:{show:{type:Boolean},selectedKeys:{}},emits:[`update:show`,`save`],setup(e,{emit:n}){let i=e,a=n,s=F.initRefDependingOnDeviceResolution(`100%`,`90%`,`40rem`),c=t.DateTimeProvider.standardPeriods(),l=t.STANDARD_PERIOD_GROUPS.map(e=>({key:e.key,label:e.label,sections:Mf(c,e.key)})),u=(0,r.ref)([]),d=(0,r.computed)(()=>{let e=u.value.length;return`Выбрано: ${e} ${(0,t.pluralize)(e,[`период`,`периода`,`периодов`])}`}),f=()=>{a(`save`,[...u.value]),a(`update:show`,!1)};return(0,r.watch)(()=>i.show,e=>{e&&(u.value=[...i.selectedKeys])}),(t,n)=>{let i=o.NCheckbox,c=o.NCheckboxGroup,p=o.NScrollbar,m=o.NButton,h=o.NModal;return(0,r.openBlock)(),(0,r.createBlock)(h,{show:e.show,preset:`card`,title:`Настройка быстрого выбора`,closable:``,style:(0,r.normalizeStyle)({width:(0,r.unref)(s),maxWidth:`calc(100vw - 1rem)`}),class:`sc-date-range-dialog`,"onUpdate:show":n[4]||=e=>a(`update:show`,e)},{footer:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Sp,[(0,r.createElementVNode)(`div`,Cp,[(0,r.createElementVNode)(`span`,wp,(0,r.toDisplayString)(d.value),1),(0,r.createVNode)(m,{text:``,type:`info`,onClick:n[1]||=e=>u.value=[...(0,r.unref)(Cf)]},{default:(0,r.withCtx)(()=>[...n[5]||=[(0,r.createTextVNode)(` По умолчанию `,-1)]]),_:1}),(0,r.createVNode)(m,{text:``,type:`info`,disabled:u.value.length===0,onClick:n[2]||=e=>u.value=[]},{default:(0,r.withCtx)(()=>[...n[6]||=[(0,r.createTextVNode)(` Снять все `,-1)]]),_:1},8,[`disabled`])]),(0,r.createElementVNode)(`div`,Tp,[(0,r.createVNode)(m,{type:`primary`,onClick:f},{default:(0,r.withCtx)(()=>[...n[7]||=[(0,r.createTextVNode)(` Сохранить `,-1)]]),_:1}),(0,r.createVNode)(m,{onClick:n[3]||=e=>a(`update:show`,!1)},{default:(0,r.withCtx)(()=>[...n[8]||=[(0,r.createTextVNode)(`Отмена`,-1)]]),_:1})])])]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(p,{class:`max-h-[60vh]`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(c,{value:u.value,"onUpdate:value":n[0]||=e=>u.value=e},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,yp,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(l),e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:e.key,class:`flex flex-col gap-1.5`},[(0,r.createElementVNode)(`div`,bp,(0,r.toDisplayString)(e.label),1),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.sections,e=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e.key},[e.label?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,xp,(0,r.toDisplayString)(e.label),1)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.children,e=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:e.value,value:e.value,label:e.label},null,8,[`value`,`label`]))),128))],64))),128))]))),128))])]),_:1},8,[`value`])]),_:1})]),_:1},8,[`show`,`style`])}}}),Dp={class:`flex flex-col gap-2`},Op={class:`flex items-center gap-2`},kp={class:`flex gap-2 px-px pb-4 pt-px`},Ap={key:0,class:`text-sm text-gray-500`},jp=(0,r.defineComponent)({__name:`quick-periods`,props:{from:{},to:{}},emits:[`apply`,`preview`],setup(e,{emit:a}){let s=e,c=a,l=t.DateTimeProvider.standardPeriods(),u=(0,r.ref)((()=>{let e=Sf,r=t.PreferencesStorageProvider.getActualDataFromStorage(e);return((0,n.isArray)(r)?r:Cf).filter(e=>(0,n.isString)(e)&&e in l)})()),d=(0,r.ref)(!1),f=(0,r.computed)(()=>Object.entries(l).filter(([e])=>u.value.includes(e)).map(([e,t])=>({value:e,label:t.label,item:t,group:t.group}))),p=(0,r.computed)(()=>{let e=s.from?Of(s.from):null,t=s.to?Of(s.to):null;if(e===null||t===null)return null;let n=f.value.find(n=>{let{from:r,to:i}=n.item;return!r||!i?!1:Of(r)===e&&Of(i)===t});return n?String(n.value):null}),m=e=>{u.value=e;let n=Sf;t.PreferencesStorageProvider.saveActualDataToStorage(n,e,(0,i.addYears)((0,i.startOfToday)(),1))};return(e,t)=>{let n=vp,i=o.NButton,a=hp,s=fp,l=lp,h=op,g=rp,_=o.NScrollbar;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Dp,[(0,r.createElementVNode)(`div`,Op,[t[3]||=(0,r.createElementVNode)(`span`,{class:`text-sm font-medium text-gray-700`},`Быстрый выбор`,-1),(0,r.createVNode)(i,{size:`tiny`,quaternary:``,circle:``,"aria-label":`Настроить быстрый выбор`,onClick:t[0]||=e=>d.value=!0},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(n)]),_:1})]),(0,r.createVNode)(_,{"x-scrollable":``},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,kp,[f.value.length===0?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Ap,` Периоды не выбраны `)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(f.value,e=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:e.value,type:e.value===p.value?`primary`:`default`,ghost:e.value===p.value,"theme-overrides":(0,r.unref)(vf),class:`shrink-0`,onClick:t=>c(`apply`,e),onMouseenter:t=>c(`preview`,e),onMouseleave:t[1]||=e=>c(`preview`)},{icon:(0,r.withCtx)(()=>[e.group===`day`?((0,r.openBlock)(),(0,r.createBlock)(a,{key:0})):e.group===`week`||e.group===`decade`?((0,r.openBlock)(),(0,r.createBlock)(s,{key:1})):e.group===`quarter`||e.group===`halfYear`?((0,r.openBlock)(),(0,r.createBlock)(l,{key:2})):e.group===`other`?((0,r.openBlock)(),(0,r.createBlock)(h,{key:3})):((0,r.openBlock)(),(0,r.createBlock)(g,{key:4}))]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.label),1)]),_:2},1032,[`type`,`ghost`,`theme-overrides`,`onClick`,`onMouseenter`]))),128))])]),_:1}),(0,r.createVNode)(Ep,{show:d.value,"onUpdate:show":t[2]||=e=>d.value=e,"selected-keys":u.value,onSave:m},null,8,[`show`,`selected-keys`])])}}}),Mp={class:`flex flex-col items-stretch gap-3 sm:flex-row`},Np={class:`order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm`},Pp={class:`flex flex-col items-stretch pr-3`},Fp={key:0,class:`px-2 pb-0.5 pt-2 text-xs text-gray-400`},Ip={key:1,class:`order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm`},Lp=(0,r.defineComponent)({__name:`standard-periods`,props:{activeKey:{},customPeriods:{}},emits:[`apply`,`preview`],setup(e,{emit:i}){let a=e,s=i,c=`custom`,l=F.initRefDependingOnDeviceResolution(!0,!1,!1),u=t.DateTimeProvider.standardPeriods(),d=(0,r.ref)(t.STANDARD_PERIOD_GROUPS[0].key),f=(0,r.computed)(()=>{let e=t.STANDARD_PERIOD_GROUPS.map(e=>({key:e.key,value:e.key,label:e.label}));return(0,n.isEmpty)(a.customPeriods)||e.push({key:c,value:c,label:`Пользовательские`}),e}),p=(0,r.computed)(()=>d.value===c?[{type:`group`,key:c,children:jf(a.customPeriods??{})}]:Mf(u,d.value));return(t,n)=>{let i=o.NButton,a=o.NScrollbar,c=o.NSelect,u=o.NMenu;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Mp,[(0,r.createElementVNode)(`div`,Np,[(0,r.createVNode)(a,{class:`max-h-96`},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Pp,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(p.value,t=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:t.key},[t.label?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Fp,(0,r.toDisplayString)(t.label),1)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.children,t=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:t.value,size:`small`,quaternary:``,type:t.value===e.activeKey?`primary`:`default`,class:`justify-start`,onClick:e=>s(`apply`,t),onMouseenter:e=>s(`preview`,t),onMouseleave:n[0]||=e=>s(`preview`)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(t.label),1)]),_:2},1032,[`type`,`onClick`,`onMouseenter`]))),128))],64))),128))])]),_:1})]),(0,r.unref)(l)?((0,r.openBlock)(),(0,r.createBlock)(c,{key:0,value:d.value,options:f.value,class:`order-1`,"onUpdate:value":n[1]||=e=>d.value=e},null,8,[`value`,`options`])):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ip,[(0,r.createVNode)(u,{value:d.value,options:f.value,mode:`vertical`,"onUpdate:value":n[2]||=e=>d.value=e},null,8,[`value`,`options`])]))])}}}),Rp={class:`flex flex-col gap-3`},zp={class:`flex flex-col gap-1 sm:flex-row sm:items-center`},Bp={key:1,class:`overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3`},Vp={class:`flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center`},Hp={class:`flex gap-2`},Up=(0,r.defineComponent)({__name:`date-range-dialog`,props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},show:{type:Boolean},dateRange:{default:void 0},customPeriods:{default:void 0},dateFormat:{default:void 0}},emits:[`update:show`,`select`],setup(e,{emit:n}){let a=e,s=n,c=F.initRefDependingOnDeviceResolution(`100%`,`90%`,`48rem`),l=(0,r.ref)(`custom`),u=(0,r.ref)(`months`),d=(0,r.computed)(()=>u.value===`months`?`Показать по дням`:`Показать по месяцам`),f=()=>t.PreferencesStorageProvider.getActualDataFromStorage(`date-range.dialog.mode`)===`standard`?`standard`:`custom`,p=()=>t.PreferencesStorageProvider.getActualDataFromStorage(`date-range.dialog.scale`)===`days`?`days`:`months`,m=(e,n)=>{t.PreferencesStorageProvider.saveActualDataToStorage(e,n,(0,i.addYears)((0,i.startOfToday)(),1))},h=(0,r.ref)({}),g=(0,r.ref)(null),_=(0,r.ref)(null),v=(0,r.computed)(()=>g.value??h.value),y=(e,t)=>{let n=a.disabled?.from?h.value.from:e,r=a.disabled?.to?h.value.to:t;g.value=null,h.value=Af(n,r,a.disabled)},b=e=>{_.value=null,y(e,h.value.to)},x=e=>{_.value=null,y(h.value.from,e)},S=()=>{_.value=null,y(null,null)},C=e=>{_.value=null,y(e.from,e.to)},w=e=>{let t=e.item;y(t.from,t.to),_.value=String(e.value)},T=e=>{let t=e?.item;g.value=t?{from:t.from,to:t.to}:null},E=()=>{g.value=null,l.value=l.value===`custom`?`standard`:`custom`,m(bf,l.value)},D=()=>{u.value=u.value===`months`?`days`:`months`,m(xf,u.value)},O=()=>{s(`select`,h.value),s(`update:show`,!1)};return(0,r.watch)(()=>a.show,e=>{e&&(l.value=f(),u.value=p(),_.value=null,g.value=null,h.value={...a.dateRange})}),(t,n)=>{let i=o.NButton,a=df,f=cf,p=o.NTooltip,m=o.NModal;return(0,r.openBlock)(),(0,r.createBlock)(m,{show:e.show,preset:`card`,title:`Выберите период`,closable:``,style:(0,r.normalizeStyle)({width:(0,r.unref)(c),maxWidth:`calc(100vw - 1rem)`}),class:`sc-date-range-dialog`,"onUpdate:show":n[1]||=e=>s(`update:show`,e)},{footer:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Vp,[(0,r.createVNode)(i,{text:``,type:`info`,onClick:E},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(l.value===`custom`?`Показать стандартные периоды`:`Показать произвольный период`),1)]),_:1}),(0,r.createElementVNode)(`div`,Hp,[(0,r.createVNode)(i,{type:`primary`,onClick:O},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Выбрать `,-1)]]),_:1}),(0,r.createVNode)(i,{onClick:n[0]||=e=>s(`update:show`,!1)},{default:(0,r.withCtx)(()=>[...n[4]||=[(0,r.createTextVNode)(`Отмена`,-1)]]),_:1})])])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Rp,[l.value===`custom`?((0,r.openBlock)(),(0,r.createBlock)(jp,{key:0,from:h.value.from,to:h.value.to,onApply:w,onPreview:T},null,8,[`from`,`to`])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,zp,[(0,r.createVNode)(ep,{from:v.value.from,to:v.value.to,clearable:e.clearable,disabled:e.disabled,"date-format":e.dateFormat,class:`flex-1`,"onUpdate:from":b,"onUpdate:to":x},null,8,[`from`,`to`,`clearable`,`disabled`,`date-format`]),e.clearable?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,text:``,type:`info`,class:`sm:ml-2`,onClick:S},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Очистить период `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0)]),l.value===`custom`?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Bp,[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(u.value===`months`?Kf:Bf),{from:h.value.from,to:h.value.to,onSelect:C},{actions:(0,r.withCtx)(()=>[(0,r.createVNode)(p,{placement:`top`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{size:`small`,"aria-label":d.value,"theme-overrides":(0,r.unref)(yf),onClick:D},{icon:(0,r.withCtx)(()=>[u.value===`months`?((0,r.openBlock)(),(0,r.createBlock)(a,{key:0})):((0,r.openBlock)(),(0,r.createBlock)(f,{key:1}))]),_:1},8,[`aria-label`,`theme-overrides`])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(d.value),1)]),_:1})]),_:1},40,[`from`,`to`]))])):((0,r.openBlock)(),(0,r.createBlock)(Lp,{key:2,"active-key":_.value,"custom-periods":e.customPeriods,onApply:w,onPreview:T},null,8,[`active-key`,`custom-periods`]))])]),_:1},8,[`show`,`style`])}}}),Wp={class:`flex w-full min-w-0 items-center gap-1`},Gp=(0,r.defineComponent)({__name:`date-range`,props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},dateRange:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1},placeholderFrom:{default:`Дата начала`},placeholderTo:{default:`Дата окончания`},dateFormat:{default:void 0}},emits:[`update:date-range`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.ref)(!1),l=(0,r.computed)(()=>{let e={...a.useDefaultPredefinedDateRanges?t.DateTimeProvider.defaultDateRanges():{},...a.predefinedDateRanges};return(0,n.isEmpty)(e)?void 0:e}),u=(e,t)=>{s(`update:date-range`,Af(e,t,a.disabled))},d=e=>{u(e,a.dateRange?.to)},f=e=>{u(a.dateRange?.from,e)},p=e=>{u(e.from,e.to)};return(t,n)=>{let i=af,a=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Wp,[(0,r.createVNode)(ep,{from:e.dateRange?.from,to:e.dateRange?.to,clearable:e.clearable,disabled:e.disabled,"placeholder-from":e.placeholderFrom,"placeholder-to":e.placeholderTo,"date-format":e.dateFormat,class:`min-w-0 flex-1`,"onUpdate:from":d,"onUpdate:to":f},null,8,[`from`,`to`,`clearable`,`disabled`,`placeholder-from`,`placeholder-to`,`date-format`]),(0,r.createVNode)(a,{disabled:!!(e.disabled?.from&&e.disabled?.to),title:`Выбрать период`,"aria-label":`Выбрать период`,onClick:n[0]||=e=>c.value=!0},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1},8,[`disabled`]),(0,r.createVNode)(Up,{show:c.value,"onUpdate:show":n[1]||=e=>c.value=e,"date-range":e.dateRange,clearable:e.clearable,disabled:e.disabled,"custom-periods":l.value,"date-format":e.dateFormat,onSelect:p},null,8,[`show`,`date-range`,`clearable`,`disabled`,`custom-periods`,`date-format`])])}}}),Kp={class:`sc-lbl-date text-nowrap`},qp=(0,r.defineComponent)({__name:`date-time-label`,props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(e){let n=e,a=(0,r.computed)(()=>(0,i.format)(n.date,(0,t.useBaseConfigStore)().config.dateFormats.uiDate)),o=(0,r.computed)(()=>(0,i.format)(n.date,`HH:mm`));return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{class:(0,r.normalizeClass)({"flex flex-col":e.isTimeOnSecondLine})},[(0,r.createElementVNode)(`span`,Kp,(0,r.toDisplayString)(a.value),1),e.isShowTime?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)([{"text-sc-grey":e.isTimeSecondary,"ml-1":!e.isTimeOnSecondLine},`sc-lbl-time`])},(0,r.toDisplayString)(o.value),3)):(0,r.createCommentVNode)(``,!0)],2))}}),Jp=(0,r.defineComponent)({__name:`debt`,props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){let t=e,n=(0,r.computed)(()=>{let e=``;return(t.showLabel??!1)&&(t.debt>0?e=`Переплата: `:t.debt<0&&(e=`Задолженность: `)),e});return(t,i)=>e.debt===0?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)({"text-sm":e.wrapAsSmall})},[(0,r.createTextVNode)((0,r.toDisplayString)(n.value)+` `,1),(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"text-green-700":e.debt>0,"text-red-700":e.debt<0})},(0,r.toDisplayString)(e.debt)+` ₽ `,3)],2))}}),Yp={class:`flex flex-row gap-2.5`},Xp={class:`flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap`},Zp={class:`flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row`},Qp={class:`mb-0.5 sm:mb-0 sm:ml-3`},$p=(0,r.defineComponent)({__name:`dialog-header`,props:{showCloseButton:{type:Boolean,default:!0}},emits:[`close`],setup(e){return(t,n)=>{let i=bc,a=o.NButton,s=o.NPopover;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Yp,[(0,r.createElementVNode)(`div`,Xp,[(0,r.renderSlot)(t.$slots,`main`)]),(0,r.createElementVNode)(`div`,null,[(0,r.createElementVNode)(`div`,Zp,[(0,r.renderSlot)(t.$slots,`extra-buttons`),(0,r.createElementVNode)(`div`,Qp,[e.showCloseButton?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(a,{size:`small`,type:`error`,onClick:n[0]||=e=>t.$emit(`close`)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1})]),default:(0,r.withCtx)(()=>[n[1]||=(0,r.createTextVNode)(` Закрыть `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0)])])])])}}}),em={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function tm(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,em,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`square`,"stroke-miterlimit":`10`,"stroke-width":`44`,d:`M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273`},null,-1)]])}var nm=(0,r.markRaw)({name:`ion-checkmark-done-sharp`,render:tm}),rm={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function im(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,rm,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`336`,cy:`128`,r:`32`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`176`,cy:`256`,r:`32`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`336`,cy:`384`,r:`32`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1)]])}var am=(0,r.markRaw)({name:`ion-options-outline`,render:im}),om={class:`flex flex-row gap-x-2.5 p-0 sm:p-1`},sm={class:`flex-auto`},cm={class:`sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0`},lm={class:`flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0`},um=(0,r.defineComponent)({__name:`inline-view`,props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:[`edit`,`apply`,`cancel`],setup(e,{emit:t}){let n=t,i=(0,r.ref)(!1),a=()=>{n(`edit`)},s=()=>{i.value=!1},c=()=>{i.value=!0,n(`apply`,s)},l=()=>{n(`cancel`,s)};return(t,n)=>{let s=am,u=o.NButton,d=o.NPopover,f=nm,p=bc;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,om,[(0,r.createElementVNode)(`div`,sm,[(0,r.renderSlot)(t.$slots,`default`)]),(0,r.createElementVNode)(`div`,null,[(0,r.createElementVNode)(`div`,cm,[(0,r.createElementVNode)(`div`,lm,[e.showEditButton?((0,r.openBlock)(),(0,r.createBlock)(d,{key:0,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(u,{disabled:e.disabled||i.value,type:`info`,ghost:``,size:`small`,onClick:a},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s)]),_:1},8,[`disabled`])]),default:(0,r.withCtx)(()=>[n[0]||=(0,r.createTextVNode)(` Редактировать данные `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0),e.showApplyButton?((0,r.openBlock)(),(0,r.createBlock)(d,{key:1,disabled:i.value,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(u,{disabled:e.disabled||i.value,type:`primary`,size:`small`,onClick:c},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(f)]),_:1},8,[`disabled`])]),default:(0,r.withCtx)(()=>[n[1]||=(0,r.createTextVNode)(` Сохранить изменения `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),e.showCancelButton?((0,r.openBlock)(),(0,r.createBlock)(d,{key:2,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(u,{disabled:e.disabled||i.value,type:`error`,size:`small`,onClick:l},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(p)]),_:1},8,[`disabled`])]),default:(0,r.withCtx)(()=>[n[2]||=(0,r.createTextVNode)(` Отменить изменения `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0)]),(0,r.renderSlot)(t.$slots,`extra-buttons`)])])])}}}),dm=(0,r.defineComponent)({__name:`inline-editable-item`,props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:[`editor:apply`,`editor:cancel`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.ref)(n.showEditor),o=e=>{i(`editor:apply`,t=>{a.value=!t,e()})},s=e=>{a.value=!1,e(),i(`editor:cancel`)};return(0,r.onMounted)(()=>{(0,r.watch)(()=>n.showEditor,e=>{a.value=e})}),(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[a.value?((0,r.openBlock)(),(0,r.createBlock)(um,{key:1,disabled:e.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:s},{"extra-buttons":(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`extra-editor-buttons`)]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`editor`)]),_:3},8,[`disabled`])):((0,r.openBlock)(),(0,r.createBlock)(um,{key:0,disabled:e.disabled,"show-edit-button":e.showEditButton,onEdit:n[0]||=e=>a.value=!0},{"extra-buttons":(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`extra-viewer-buttons`)]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`viewer`)]),_:3},8,[`disabled`,`show-edit-button`]))]))}}),fm={key:0,class:`whitespace-pre-line`},pm={key:1,class:`text-sc-dark-grey`},mm=(0,r.defineComponent)({__name:`comment-editor`,props:{disabled:{type:Boolean,default:!1},comment:{default:``}},emits:[`update:comment`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.ref)(n.comment);(0,r.watch)(()=>a.value,e=>{a.value=e});let s=e=>{i(`update:comment`,a.value,e)},c=()=>{a.value=n.comment};return(t,n)=>{let i=o.NInput;return(0,r.openBlock)(),(0,r.createBlock)(dm,{disabled:e.disabled,"onEditor:apply":s,"onEditor:cancel":c},{viewer:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,null,[e.comment?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,fm,(0,r.toDisplayString)(e.comment),1)):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,pm,` - Комментарий отсутствует - `))])]),editor:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{value:a.value,"onUpdate:value":n[0]||=e=>a.value=e,clearable:!0,type:`textarea`},null,8,[`value`])]),_:1},8,[`disabled`])}}}),hm={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function gm(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,hm,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40`},null,-1),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`m176 272l80 80l80-80M256 48v288`},null,-1)]])}var _m=(0,r.markRaw)({name:`ion-download-outline`,render:gm}),vm=(0,r.defineComponent)({__name:`single-file-upload-selector`,props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:[`update:file`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.ref)([]),s=(0,r.computed)(()=>a.value.map(e=>(e.status=n.isError?`error`:`finished`,e))),c=e=>{a.value=e;let t={name:``,content:``};if(e.length===0){i(`update:file`,null);return}let n=e[0];t.name=n.name;let r=new FileReader;r.addEventListener(`load`,()=>{t.content=r.result??``,i(`update:file`,t)}),r.readAsDataURL(n.file)};return(t,n)=>{let i=_m;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NUpload),{"file-list":s.value,"default-upload":!1,max:1,"show-retry-button":!1,action:``,accept:e.accept,"directory-dnd":``,class:`content-center`,"onUpdate:fileList":c},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NUploadDragger),null,{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`dragged-area`,{},()=>[(0,r.createElementVNode)(`div`,null,[(0,r.createVNode)(i,{class:`text-2xl`}),(0,r.createElementVNode)(`div`,null,(0,r.toDisplayString)(e.draggedAreaText??`Перетащите в эту область файл, который необходимо загрузить.`),1)])])]),_:3})]),_:3},8,[`file-list`,`accept`])}}}),ym={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function bm(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,ym,[...t[0]||=[(0,r.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)]])}var xm=(0,r.markRaw)({name:`ion-warning`,render:bm}),Sm=(0,r.defineComponent)({__name:`warning-icon`,props:{popoverText:{default:``},iconClass:{default:`text-sc-warning`}},setup(e){return(t,n)=>{let i=xm,a=o.NPopover;return(0,r.openBlock)(),(0,r.createBlock)(a,{disabled:e.popoverText.length===0,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{class:(0,r.normalizeClass)(`ml-0.5 ${e.iconClass}`)},null,8,[`class`])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.popoverText),1)]),_:1},8,[`disabled`])}}}),Cm=(0,r.defineComponent)({__name:`debounced-input`,props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:``}},emits:[`update:value`],setup(e,{emit:t}){let i=e,a=t,s=(0,r.ref)(i.value),c=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,i.debounceTime)),l=(0,n.debounce)(()=>a(`update:value`,s.value),c.value),u=e=>{s.value=e,l()};return(0,r.watch)(()=>i.value,e=>{s.value=e}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NInput),{value:s.value,"onUpdate:value":[n[0]||=e=>s.value=e,u],clearable:e.clearable,placeholder:e.placeholder},{prefix:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`prefix`)]),_:3},8,[`value`,`clearable`,`placeholder`]))}}),wm=(0,r.defineComponent)({__name:`debounced-input-number`,props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:``},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:[`update:value`,`keydown`,`input`,`focus`],setup(e,{expose:t,emit:i}){let a=e,s=i,c=(0,r.ref)(a.value),l=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,a.debounceTime)),u=(0,n.debounce)(()=>s(`update:value`,c.value),l.value),d=e=>{c.value=e,u()};(0,r.watch)(()=>a.value,e=>{c.value=e});let f=(0,r.ref)(null);return t({focus:()=>f.value?.focus(),blur:()=>f.value?.blur(),select:()=>f.value?.select()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NInputNumber),{ref_key:`inputReference`,ref:f,value:c.value??null,clearable:e.clearable,parse:e.parse,"show-button":e.showButton,placeholder:e.placeholder,min:e.min,max:e.max,step:e.step,validator:e.validator,"onUpdate:value":d,onKeydown:n[0]||=e=>s(`keydown`,e),onInput:n[1]||=e=>s(`input`,e),onFocus:n[2]||=e=>s(`focus`,e)},{prefix:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`prefix`)]),_:3},8,[`value`,`clearable`,`parse`,`show-button`,`placeholder`,`min`,`max`,`step`,`validator`]))}}),Tm=yt((0,r.defineComponent)({__name:`phone-input`,props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:[`update:value`],setup(e,{emit:t}){let i=e,a=t,o=(0,r.ref)((i.value??``).replaceAll(/\D*/g,``)),c=(0,n.debounce)(e=>a(`update:value`,e),i.debounceTime??0),u=e=>{let t=``;if((0,n.isString)(e))o.value=e,t=e.replaceAll(/(\s|\(|\)|-|_)*/g,``);else if((0,n.isObject)(e)){if(o.value=e.formatted,!e.valid)return;t=e instanceof s.PhoneNumber?e.format(`E.164`):`+${e.countryCallingCode}${e.nationalNumber}`}i.debounceTime?c(t):a(`update:value`,t)},d=e=>{let t=e.replaceAll(/\D*/g,``);try{let e=(0,s.parsePhoneNumberWithError)(`+${t}`);e.isValid()?o.value=e.format(`E.164`):e.getPossibleCountries().length>0&&(o.value=`+${t}`)}catch(e){if(e instanceof s.ParseError)o.value=t;else throw e}};return(0,r.watch)(()=>i.value,e=>{e?.replaceAll(/\D*/g,``)!==o.value?.replaceAll(/\D*/g,``)&&d(e)},{immediate:!0}),(0,r.onBeforeMount)(()=>d(o.value??``)),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(l.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[n[0]||=e=>o.value=e,u],"auto-default-country":!1,"auto-format":!0,"default-country":e.defaultCountry,disabled:e.disabled,"input-options":{placeholder:e.placeholder},"preferred-countries":e.preferredCountries,"only-countries":e.onlyCountries,mode:`international`,class:`tel-input`},null,8,[`modelValue`,`default-country`,`disabled`,`input-options`,`preferred-countries`,`only-countries`]))}}),[[`__scopeId`,`data-v-4f05dd7b`]]),Em={class:`mb-7 grid grid-cols-2 gap-3.5 lg:grid-cols-4`},Dm={class:`mb-2 text-[11.5px] font-semibold uppercase text-gray-500`},Om=(0,r.defineComponent)({__name:`kpi-grid`,props:{items:{},isLoading:{type:Boolean}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Em,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.items,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:t.label,class:`rounded-lg border border-solid border-gray-200 px-4 py-4`},[(0,r.createElementVNode)(`div`,Dm,(0,r.toDisplayString)(t.label),1),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`text-[25px] font-bold`,t.valueClass])},(0,r.toDisplayString)(e.isLoading?`…`:t.value),3),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`mt-1.5 text-xs font-medium`,t.noteClass])},(0,r.toDisplayString)(t.note),3)]))),128))]))}}),km={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Am(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,km,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5`},null,-1)]])}var jm=(0,r.markRaw)({name:`tabler-external-link`,render:Am}),Mm={class:`flex flex-row gap-1 hover:underline hover:decoration-dashed`},Nm=[`href`],Pm=(0,r.defineComponent)({__name:`external-link`,props:{text:{},url:{},description:{}},setup(e){return(t,i)=>{let a=jm,s=o.NTooltip;return(0,r.openBlock)(),(0,r.createBlock)(s,{disabled:(0,r.unref)(n.isUndefined)(e.description),placement:`top-start`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Mm,[(0,r.createElementVNode)(`a`,{href:e.url,target:`_blank`,class:`no-underline`},(0,r.toDisplayString)(e.text),9,Nm),(0,r.createVNode)(a,{class:`mt-0.5 flex-none`})])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.description),1)]),_:1},8,[`disabled`])}}}),Fm={key:1,class:`h-24`},Im={key:2,class:`flex flex-col gap-3`},Lm=(0,r.defineComponent)({__name:`compact-card-list`,props:{isLoading:{type:Boolean},isEmpty:{type:Boolean},emptyDescription:{},pagination:{}},emits:[`update:page`,`update:pageSize`],setup(e,{emit:t}){let n=t,i=[20,50,100];return(t,a)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSpin),{show:e.isLoading},{default:(0,r.withCtx)(()=>[!e.isLoading&&e.isEmpty?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NEmpty),{key:0,description:e.emptyDescription},null,8,[`description`])):e.isLoading&&e.isEmpty?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Fm)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Im,[(0,r.renderSlot)(t.$slots,`default`)])),e.pagination&&e.pagination.itemCount>0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NPagination),{key:3,class:`mt-4 flex-wrap justify-center gap-y-2`,size:`small`,page:e.pagination.page,"page-size":e.pagination.pageSize,"item-count":e.pagination.itemCount,"page-slot":e.pagination.pageSlot,"page-sizes":i,"show-size-picker":!0,prefix:(0,r.unref)(Se),"onUpdate:page":a[0]||=e=>n(`update:page`,e),"onUpdate:pageSize":a[1]||=e=>n(`update:pageSize`,e)},null,8,[`page`,`page-size`,`item-count`,`page-slot`,`prefix`])):(0,r.createCommentVNode)(``,!0)]),_:3},8,[`show`]))}}),Rm={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function zm(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Rm,[...t[0]||=[(0,r.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),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M336 256H176`},null,-1)]])}var Bm=(0,r.markRaw)({name:`ion-remove-circle-outline`,render:zm});function Vm(e){return e}var Hm=Vm(`n-internal-select-menu`),Um=Vm(`n-internal-select-menu-body`),Wm=Vm(`n-drawer-body`),Gm=Vm(`n-modal-body`),Km=Vm(`n-popover-body`);function qm(e){return e.composedPath()[0]}var Jm={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Ym(e,t,n){if(e===`mousemoveoutside`){let e=e=>{t.contains(qm(e))||n(e)};return{mousemove:e,touchstart:e}}if(e===`clickoutside`){let e=!1,r=n=>{e=!t.contains(qm(n))},i=r=>{e&&(t.contains(qm(r))||n(r))};return{mousedown:r,mouseup:i,touchstart:r,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function Xm(e,t,n){let r=Jm[e],i=r.get(t);i===void 0&&r.set(t,i=new WeakMap);let a=i.get(n);return a===void 0&&i.set(n,a=Ym(e,t,n)),a}function Zm(e,t,n,r){if(e===`mousemoveoutside`||e===`clickoutside`){let i=Xm(e,t,n);return Object.keys(i).forEach(e=>{eh(e,document,i[e],r)}),!0}return!1}function Qm(e,t,n,r){if(e===`mousemoveoutside`||e===`clickoutside`){let i=Xm(e,t,n);return Object.keys(i).forEach(e=>{th(e,document,i[e],r)}),!0}return!1}function $m(){if(typeof window>`u`)return{on:()=>{},off:()=>{}};let e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function i(e,t,n){let r=e[t];return e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)},e}function a(e,t){e[t]=Event.prototype[t]}let o=new WeakMap,s=Object.getOwnPropertyDescriptor(Event.prototype,`currentTarget`);function c(){return o.get(this)??null}function l(e,t){s!==void 0&&Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:t??s.get})}let u={bubble:{},capture:{}},d={};function f(){let s=function(s){let{type:d,eventPhase:f,bubbles:p}=s,m=qm(s);if(f===2)return;let h=f===1?`capture`:`bubble`,g=m,_=[];for(;g===null&&(g=window),_.push(g),g!==window;)g=g.parentNode||null;let v=u.capture[d],y=u.bubble[d];if(i(s,`stopPropagation`,n),i(s,`stopImmediatePropagation`,r),l(s,c),h===`capture`){if(v===void 0)return;for(let n=_.length-1;n>=0&&!e.has(s);--n){let e=_[n],r=v.get(e);if(r!==void 0){o.set(s,e);for(let e of r){if(t.has(s))break;e(s)}}if(n===0&&!p&&y!==void 0){let n=y.get(e);if(n!==void 0)for(let e of n){if(t.has(s))break;e(s)}}}}else if(h===`bubble`){if(y===void 0)return;for(let n=0;n<_.length&&!e.has(s);++n){let e=_[n],r=y.get(e);if(r!==void 0){o.set(s,e);for(let e of r){if(t.has(s))break;e(s)}}}}a(s,`stopPropagation`),a(s,`stopImmediatePropagation`),l(s)};return s.displayName=`evtdUnifiedHandler`,s}function p(){let e=function(e){let{type:t,eventPhase:n}=e;if(n!==2)return;let r=d[t];r!==void 0&&r.forEach(t=>t(e))};return e.displayName=`evtdUnifiedWindowEventHandler`,e}let m=f(),h=p();function g(e,t){let n=u[e];return n[t]===void 0&&(n[t]=new Map,window.addEventListener(t,m,e===`capture`)),n[t]}function _(e){return d[e]===void 0&&(d[e]=new Set,window.addEventListener(e,h)),d[e]}function v(e,t){let n=e.get(t);return n===void 0&&e.set(t,n=new Set),n}function y(e,t,n,r){let i=u[t][n];if(i!==void 0){let t=i.get(e);if(t!==void 0&&t.has(r))return!0}return!1}function b(e,t){let n=d[e];return!!(n!==void 0&&n.has(t))}function x(e,t,n,r){let i;if(i=typeof r==`object`&&r.once===!0?a=>{S(e,t,i,r),n(a)}:n,Zm(e,t,i,r))return;let a=v(g(r===!0||typeof r==`object`&&r.capture===!0?`capture`:`bubble`,e),t);if(a.has(i)||a.add(i),t===window){let t=_(e);t.has(i)||t.add(i)}}function S(e,t,n,r){if(Qm(e,t,n,r))return;let i=r===!0||typeof r==`object`&&r.capture===!0,a=i?`capture`:`bubble`,o=g(a,e),s=v(o,t);if(t===window&&!y(t,i?`bubble`:`capture`,e,n)&&b(e,n)){let t=d[e];t.delete(n),t.size===0&&(window.removeEventListener(e,h),d[e]=void 0)}s.has(n)&&s.delete(n),s.size===0&&o.delete(t),o.size===0&&(window.removeEventListener(e,m,a===`capture`),u[a][e]=void 0)}return{on:x,off:S}}var{on:eh,off:th}=$m();function nh(e){let t=(0,r.ref)(!!e.value);if(t.value)return(0,r.readonly)(t);let n=(0,r.watch)(e,e=>{e&&(t.value=!0,n())});return(0,r.readonly)(t)}function rh(e){let t=(0,r.computed)(e),n=(0,r.ref)(t.value);return(0,r.watch)(t,e=>{n.value=e}),typeof e==`function`?n:{__v_isRef:!0,get value(){return n.value},set value(t){e.set(t)}}}var ih=typeof window<`u`?document?.fonts?.ready:void 0,ah=!1;ih===void 0?ah=!0:ih.then(()=>{ah=!0});function oh(e){if(ah)return;let t=!1;(0,r.onMounted)(()=>{ah||ih?.then(()=>{t||e()})}),(0,r.onBeforeUnmount)(()=>{t=!0})}function sh(e,t){return(0,r.watch)(e,e=>{e!==void 0&&(t.value=e)}),(0,r.computed)(()=>e.value===void 0?t.value:e.value)}function ch(){let e=(0,r.ref)(!1);return(0,r.onMounted)(()=>{e.value=!0}),(0,r.readonly)(e)}function lh(e,t){return(0,r.computed)(()=>{for(let n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}var uh=(typeof window>`u`?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1)&&!window.MSStream;function dh(){return uh}var fh=`__disabled__`;function ph(e){let t=(0,r.inject)(Gm,null),n=(0,r.inject)(Wm,null),i=(0,r.inject)(Km,null),a=(0,r.inject)(Um,null),o=(0,r.ref)();if(typeof document<`u`){o.value=document.fullscreenElement;let e=()=>{o.value=document.fullscreenElement};(0,r.onMounted)(()=>{eh(`fullscreenchange`,document,e)}),(0,r.onBeforeUnmount)(()=>{th(`fullscreenchange`,document,e)})}return rh(()=>{let{to:r}=e;return r===void 0?t?.value?t.value.$el??t.value:n?.value?n.value:i?.value?i.value:a?.value?a.value:r??(o.value||`body`):r===!1?fh:r===!0?o.value||`body`:r})}ph.tdkey=fh,ph.propTo={type:[String,Object,Boolean],default:void 0};var mh=new WeakSet;function hh(e){mh.add(e)}var gh=new Set;function _h(e,t){let n=`[naive/${e}]: ${t}`;gh.has(n)||(gh.add(n),console.error(n))}function vh(e,t){console.error(`[naive/${e}]: ${t}`)}function yh(e,t){throw Error(`[naive/${e}]: ${t}`)}function bh(e,...t){if(Array.isArray(e))e.forEach(e=>bh(e,...t));else return e(...t)}var xh=Vm(`n-config-provider`);function Sh(e={},t={defaultBordered:!0}){let n=(0,r.inject)(xh,null);return{inlineThemeDisabled:n?.inlineThemeDisabled,mergedRtlRef:n?.mergedRtlRef,mergedComponentPropsRef:n?.mergedComponentPropsRef,mergedBreakpointsRef:n?.mergedBreakpointsRef,mergedBorderedRef:(0,r.computed)(()=>{let{bordered:r}=e;return r===void 0?n?.mergedBorderedRef.value??t.defaultBordered??!0:r}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:(0,r.shallowRef)(`n`),namespaceRef:(0,r.computed)(()=>n?.mergedNamespaceRef.value)}}function Ch(e){let t=`.`,n=`__`,r=`--`,i;if(e){let i=e.blockPrefix;i&&(t=i),i=e.elementPrefix,i&&(n=i),i=e.modifierPrefix,i&&(r=i)}let a={install(e){i=e.c;let t=e.context;t.bem={},t.bem.b=null,t.bem.els=null}};function o(e){let n,r;return{before(e){n=e.bem.b,r=e.bem.els,e.bem.els=null},after(e){e.bem.b=n,e.bem.els=r},$({context:n,props:r}){return e=typeof e==`string`?e:e({context:n,props:r}),n.bem.b=e,`${r?.bPrefix||t}${n.bem.b}`}}}function s(e){let r;return{before(e){r=e.bem.els},after(e){e.bem.els=r},$({context:r,props:i}){return e=typeof e==`string`?e:e({context:r,props:i}),r.bem.els=e.split(`,`).map(e=>e.trim()),r.bem.els.map(e=>`${i?.bPrefix||t}${r.bem.b}${n}${e}`).join(`, `)}}}function c(e){return{$({context:i,props:a}){e=typeof e==`string`?e:e({context:i,props:a});let o=e.split(`,`).map(e=>e.trim());function s(e){return o.map(o=>`&${a?.bPrefix||t}${i.bem.b}${e===void 0?``:`${n}${e}`}${r}${o}`).join(`, `)}let c=i.bem.els;if(c!==null){if(process.env.NODE_ENV!==`production`&&c.length>=2)throw Error(`[css-render/plugin-bem]: m(${e}) is invalid, using modifier inside multiple elements is not allowed`);return s(c[0])}return s()}}}function l(e){return{$({context:i,props:a}){e=typeof e==`string`?e:e({context:i,props:a});let o=i.bem.els;if(process.env.NODE_ENV!==`production`&&o!==null&&o.length>=2)throw Error(`[css-render/plugin-bem]: notM(${e}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${a?.bPrefix||t}${i.bem.b}${o!==null&&o.length>0?`${n}${o[0]}`:``}${r}${e})`}}}return Object.assign(a,{cB:((...e)=>i(o(e[0]),e[1],e[2])),cE:((...e)=>i(s(e[0]),e[1],e[2])),cM:((...e)=>i(c(e[0]),e[1],e[2])),cNotM:((...e)=>i(l(e[0]),e[1],e[2]))}),a}function wh(e){let t=0;for(let n=0;n<e.length;++n)e[n]===`&`&&++t;return t}var Th=/\s*,(?![^(]*\))\s*/g,Eh=/\s+/g;function Dh(e,t){let n=[];return t.split(Th).forEach(t=>{let r=wh(t);if(!r){e.forEach(e=>{n.push((e&&e+` `)+t)});return}if(r===1){e.forEach(e=>{n.push(t.replace(`&`,e))});return}let i=[t];for(;r--;){let t=[];i.forEach(n=>{e.forEach(e=>{t.push(n.replace(`&`,e))})}),i=t}i.forEach(e=>n.push(e))}),n}function Oh(e,t){let n=[];return t.split(Th).forEach(t=>{e.forEach(e=>{n.push((e&&e+` `)+t)})}),n}function kh(e){let t=[``];return e.forEach(e=>{e&&=e.trim(),e&&(t=e.includes(`&`)?Dh(t,e):Oh(t,e))}),t.join(`, `).replace(Eh,` `)}function Ah(e){if(!e)return;let t=e.parentElement;t&&t.removeChild(e)}function jh(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function Mh(e){let t=document.createElement(`style`);return t.setAttribute(`cssr-id`,e),t}function Nh(e){return e?/^\s*@(s|m)/.test(e):!1}var Ph=/[A-Z]/g;function Fh(e){return e.replace(Ph,e=>`-`+e.toLowerCase())}function Ih(e,t=` `){return typeof e==`object`&&e?` {
68
- `+Object.entries(e).map(e=>t+` ${Fh(e[0])}: ${e[1]};`).join(`
67
+ `}},nc=ha.Multiply,rc=[1,0,0,0,1,0,0,0,1],ic=new ti(9),ac=Xs.Utils,oc=new B,sc=new ti([0,0,1,0,0,1,0,1,1,0,1,1]),G={precision:.9,isHidden:/(undefined|none|transparent)/i,canvas:Wr.document?Wr.document.createElement(`canvas`):{getContext:function(){}},alignments:{left:`start`,middle:`center`,right:`end`},matrix:new ha,group:{removeChild:function(e,t){if(e.children)for(let n=0;n<e.children.length;n++)G.group.removeChild(e.children[n],t);e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer)},render:function(e,t){if(!this._visible)return;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let n=this.parent,r=n._matrix&&n._matrix.manual||n._flagMatrix,i=this._matrix.manual||this._flagMatrix;(r||i)&&(this._renderer.matrix||(this._renderer.matrix=new ti(9)),this._matrix.toTransformArray(!0,ic),nc(ic,n._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof B||(this._renderer.scale=new B),this._scale instanceof B?(this._renderer.scale.x=this._scale.x,this._renderer.scale.y=this._scale.y):(this._renderer.scale.x=this._scale,this._renderer.scale.y=this._scale),/renderer/i.test(n._renderer.type)||(this._renderer.scale.x*=n._renderer.scale.x,this._renderer.scale.y*=n._renderer.scale.y),r&&(this._flagMatrix=!0)),this._mask&&(e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1),G[Xs.Utils.getRendererType(this._mask._renderer.type)].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)),this._flagOpacity=n._flagOpacity||this._flagOpacity,this._renderer.opacity=this._opacity*(n&&n._renderer?n._renderer.opacity:1);let a;if(this._flagSubtractions)for(a=0;a<this.subtractions.length;a++)G.group.removeChild(this.subtractions[a],e);for(a=0;a<this.children.length;a++){let n=this.children[a];G[Xs.Utils.getRendererType(n._renderer.type)].render.call(n,e,t)}return this._mask&&e.disable(e.STENCIL_TEST),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},path:{updateCanvas:function(e,t){let n,r,i,a,o,s,c,l,u,d,f,p,m,h,g=t._renderer.vertices,_=this.canvas,v=this.ctx,y=e.renderer.ratio,b=oc.copy(t._renderer.scale).multiply(y),x=t._stroke,S=t._linewidth,C=t._fill,w=t._renderer.opacity||t._opacity,T=t._cap,E=t._join,D=t._miter,O=t._renderer.closed,k=t.dashes,A=g.length,ee=A-1;_.width=Math.max(Math.ceil(t._renderer.rect.width*b.x),1),_.height=Math.max(Math.ceil(t._renderer.rect.height*b.y),1);let te=t._renderer.rect.centroid,ne=te.x,j=te.y;v.clearRect(0,0,_.width,_.height),C&&(typeof C==`string`?v.fillStyle=C:(G[Xs.Utils.getRendererType(C._renderer.type)].render.call(C,v,t),v.fillStyle=C._renderer.effect)),x&&(typeof x==`string`?v.strokeStyle=x:(G[Xs.Utils.getRendererType(x._renderer.type)].render.call(x,v,t),v.strokeStyle=x._renderer.effect),S&&(v.lineWidth=ii(t)),D&&(v.miterLimit=D),E&&(v.lineJoin=E),!O&&T&&(v.lineCap=T)),typeof w==`number`&&(v.globalAlpha=w),k&&k.length>0&&(v.lineDashOffset=k.offset||0,v.setLineDash(k));let M,re,ie,ae,N,P,oe,se;v.save(),v.scale(b.x,b.y),v.translate(ne,j),v.beginPath();for(let e=0;e<g.length;e++){let t=g[e];switch(p=t.x,m=t.y,t.command){case R.close:v.closePath();break;case R.arc:re=t.rx,ie=t.ry,ae=t.xAxisRotation,N=t.largeArcFlag,P=t.sweepFlag,n=O?ei(e-1,A):Math.max(e-1,0),r=g[n],oe=r.x,se=r.y,ac.renderSvgArcCommand(v,oe,se,re,ie,N,P,ae,p,m);break;case R.curve:n=O?ei(e-1,A):Math.max(e-1,0),r=g[n],l=r.controls&&r.controls.right||B.zero,u=t.controls&&t.controls.left||B.zero,r._relative?(s=l.x+r.x,c=l.y+r.y):(s=l.x,c=l.y),t._relative?(a=u.x+t.x,o=u.y+t.y):(a=u.x,o=u.y),v.bezierCurveTo(s,c,a,o,p,m),e>=ee&&O&&(i=M,d=t.controls&&t.controls.right||B.zero,f=i.controls&&i.controls.left||B.zero,t._relative?(s=d.x+t.x,c=d.y+t.y):(s=d.x,c=d.y),i._relative?(a=f.x+i.x,o=f.y+i.y):(a=f.x,o=f.y),p=i.x,m=i.y,v.bezierCurveTo(s,c,a,o,p,m));break;case R.line:v.lineTo(p,m);break;case R.move:M=t,v.moveTo(p,m)}}O&&v.closePath(),G.isHidden.test(C)||(h=C._renderer&&C._renderer.offset,h&&(v.save(),v.translate(-C._renderer.offset.x,-C._renderer.offset.y),v.scale(C._renderer.scale.x,C._renderer.scale.y)),v.fill(),h&&v.restore()),G.isHidden.test(x)||(h=x._renderer&&x._renderer.offset,h&&(v.save(),v.translate(-x._renderer.offset.x,-x._renderer.offset.y),v.scale(x._renderer.scale.x,x._renderer.scale.y),v.lineWidth=S/x._renderer.scale.x),v.stroke(),h&&v.restore()),v.restore()},getBoundingClientRect:function(e,t,n){let r=1/0,i=-1/0,a=1/0,o=-1/0,s,c;e.forEach(function(e){let t=e.x,n=e.y,s=e.controls,c,l,u,d,f,p;a=Math.min(n,a),r=Math.min(t,r),i=Math.max(t,i),o=Math.max(n,o),e.controls&&(f=s.left,p=s.right,f&&p&&(c=e._relative?f.x+t:f.x,l=e._relative?f.y+n:f.y,u=e._relative?p.x+t:p.x,d=e._relative?p.y+n:p.y,c&&l&&u&&d&&(a=Math.min(l,d,a),r=Math.min(c,u,r),i=Math.max(c,u,i),o=Math.max(l,d,o))))}),typeof t==`number`&&(a-=t,r-=t,i+=t,o+=t),s=i-r,c=o-a,n.top=a,n.left=r,n.right=i,n.bottom=o,n.width=s,n.height=c,n.centroid||={},n.centroid.x=-r,n.centroid.y=-a},render:function(e,t,n){if(!this._visible||!this._opacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=n||this.parent,i=t[Xs.Utils.getRendererType(this._renderer.type)],a=r._matrix.manual||r._flagMatrix,o=this._matrix.manual||this._flagMatrix,s=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Zi&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof ta&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Li&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Zi&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof ta&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Li&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagCap||this._flagJoin||this._flagMiter||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||o||s){this._renderer.matrix||(this._renderer.matrix=new ti(9)),this._matrix.toTransformArray(!0,ic),nc(ic,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof B||(this._renderer.scale=new B);let e,t;this._scale instanceof B?(e=this._scale.x*r._renderer.scale.x,t=this._scale.y*r._renderer.scale.y):(e=this._scale*r._renderer.scale.x,t=this._scale*r._renderer.scale.y),this._renderer.scale.x=e<0?-e:e,this._renderer.scale.y=t<0?-t:t,s&&(this._renderer.parent=r)}if(this._mask&&(e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1),G[Xs.Utils.getRendererType(this._mask._renderer.type)].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)),c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,G.path.getBoundingClientRect(this._renderer.vertices,this._linewidth,this._renderer.rect),G.updateTexture.call(G,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==i&&(e.useProgram(i),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(i.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(i.position),e.bufferData(e.ARRAY_BUFFER,sc,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(i,`u_resolution`),t.resolution.width,t.resolution.height),t.current=i),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(i,`u_resolution`),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);let l=this._renderer.rect;return e.uniformMatrix3fv(i.matrix,!1,this._renderer.matrix),e.uniform4f(i.rect,l.left,l.top,l.right,l.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},points:{updateCanvas:function(e,t){let n,r=this.canvas,i=this.ctx,a=e.renderer.ratio,o=t._stroke,s=t._linewidth,c=t._fill,l=t._renderer.opacity||t._opacity,u=t.dashes,d=t._size*a,f=t._closed,p=d;G.isHidden.test(o)||(p+=s),r.width=$r(p),r.height=r.width;let m=p/r.width,h=r.width/2,g=r.height/2;i.clearRect(0,0,r.width,r.height),c&&(typeof c==`string`?i.fillStyle=c:(G[Xs.Utils.getRendererType(c._renderer.type)].render.call(c,i,t),i.fillStyle=c._renderer.effect)),o&&(typeof o==`string`?i.strokeStyle=o:(G[Xs.Utils.getRendererType(o._renderer.type)].render.call(o,i,t),i.strokeStyle=o._renderer.effect),s&&(i.lineWidth=ii(t)/m)),typeof l==`number`&&(i.globalAlpha=l),u&&u.length>0&&(i.lineDashOffset=u.offset||0,i.setLineDash(u)),i.save(),i.translate(h,g),i.scale(G.precision,G.precision),i.beginPath(),i.arc(0,0,d/m*.5,0,Kr),i.restore(),f&&i.closePath(),G.isHidden.test(c)||(n=c._renderer&&c._renderer.offset,n&&(i.save(),i.translate(-c._renderer.offset.x,-c._renderer.offset.y),i.scale(c._renderer.scale.x,c._renderer.scale.y)),i.fill(),n&&i.restore()),G.isHidden.test(o)||(n=o._renderer&&o._renderer.offset,n&&(i.save(),i.translate(-o._renderer.offset.x,-o._renderer.offset.y),i.scale(o._renderer.scale.x,o._renderer.scale.y),i.lineWidth=s/o._renderer.scale.x),i.stroke(),n&&i.restore())},render:function(e,t,n){if(!this._visible||!this._opacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=this._size,i=n||this.parent,a=t[this._renderer.type],o=this._sizeAttenuation,s=this._stroke,c=this._linewidth,l=i._matrix.manual||i._flagMatrix,u=this._matrix.manual||this._flagMatrix,d=this._renderer.parent!==i,f=this._renderer.vertices,p=this._renderer.collection.length,m=this._flagVertices,h=this._flagFill||this._fill instanceof Zi&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof ta&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Li&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Zi&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof ta&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Li&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||i._flagOpacity||this._flagVisible||this._flagScale||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(l||u||d){this._renderer.matrix||(this._renderer.matrix=new ti(9)),this._matrix.toTransformArray(!0,ic),nc(ic,i._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof B||(this._renderer.scale=new B);let e,t;this._scale instanceof B?(e=this._scale.x*i._renderer.scale.x,t=this._scale.y*i._renderer.scale.y):(e=this._scale*i._renderer.scale.x,t=this._scale*i._renderer.scale.y),this._renderer.scale.x=e<0?-e:e,this._renderer.scale.y=t<0?-t:t,d&&(this._renderer.parent=i)}if(m){let t=this._renderer.positionBuffer;t&&e.deleteBuffer(t),this._renderer.positionBuffer=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,this._renderer.positionBuffer),e.vertexAttribPointer(a.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(a.position),e.bufferData(e.ARRAY_BUFFER,f,e.STATIC_DRAW)}return h?(this._renderer.opacity=this._opacity*i._renderer.opacity,G.updateTexture.call(G,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture?this:(G.isHidden.test(s)||(r+=c),r/=G.precision,o&&(r*=Math.max(this._renderer.scale.x,this._renderer.scale.y)),t.current!==a&&(e.useProgram(a),t.resolution.flagged||e.uniform2f(e.getUniformLocation(a,`u_resolution`),t.resolution.width,t.resolution.height),t.current=a),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(a,`u_resolution`),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture),e.uniformMatrix3fv(a.matrix,!1,this._renderer.matrix),e.uniform1f(a.size,r*t.resolution.ratio),e.drawArrays(e.POINTS,0,p),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset())}},text:{updateCanvas:function(e,t){let n=this.canvas,r=this.ctx,i=e.renderer.ratio,a=oc.copy(t._renderer.scale).multiply(i),o=t._stroke,s=t._linewidth,c=t._fill,l=t._renderer.opacity||t._opacity,u=t.dashes,d=t._decoration,f=t._direction;n.width=Math.max(Math.ceil(t._renderer.rect.width*a.x),1),n.height=Math.max(Math.ceil(t._renderer.rect.height*a.y),1);let p=t._renderer.rect.centroid,m=p.x,h=p.y,g,_,v,y,b,x,S,C,w,T,E,D=c._renderer&&c._renderer.offset&&o._renderer&&o._renderer.offset;if(r.clearRect(0,0,n.width,n.height),D||(r.font=[t._style,t._weight,t._size+`px/`+t._leading+`px`,t._family].join(` `)),r.textAlign=`center`,r.textBaseline=`middle`,r.textDirection=f,c&&(typeof c==`string`?r.fillStyle=c:(G[Xs.Utils.getRendererType(c._renderer.type)].render.call(c,r,t),r.fillStyle=c._renderer.effect)),o&&(typeof o==`string`?r.strokeStyle=o:(G[Xs.Utils.getRendererType(o._renderer.type)].render.call(o,r,t),r.strokeStyle=o._renderer.effect),s&&(r.lineWidth=ii(t))),typeof l==`number`&&(r.globalAlpha=l),u&&u.length>0&&(r.lineDashOffset=u.offset||0,r.setLineDash(u)),r.save(),r.scale(a.x,a.y),r.translate(m,h),G.isHidden.test(c)||(c._renderer&&c._renderer.offset?(x=c._renderer.scale.x,S=c._renderer.scale.y,r.save(),r.translate(-c._renderer.offset.x,-c._renderer.offset.y),r.scale(x,S),g=t._size/c._renderer.scale.y,_=t._leading/c._renderer.scale.y,r.font=[t._style,t._weight,g+`px/`,_+`px`,t._family].join(` `),v=c._renderer.offset.x/c._renderer.scale.x,y=c._renderer.offset.y/c._renderer.scale.y,r.fillText(t.value,v,y),r.restore()):r.fillText(t.value,0,0)),G.isHidden.test(o)||(o._renderer&&o._renderer.offset?(x=o._renderer.scale.x,S=o._renderer.scale.y,r.save(),r.translate(-o._renderer.offset.x,-o._renderer.offset.y),r.scale(x,S),g=t._size/o._renderer.scale.y,_=t._leading/o._renderer.scale.y,r.font=[t._style,t._weight,g+`px/`,_+`px`,t._family].join(` `),v=o._renderer.offset.x/o._renderer.scale.x,y=o._renderer.offset.y/o._renderer.scale.y,b=s/o._renderer.scale.x,r.lineWidth=b,r.strokeText(t.value,v,y),r.restore()):r.strokeText(t.value,0,0)),/(underline|strikethrough)/i.test(d)){let e=r.measureText(t.value);switch(d){case`underline`:w=e.actualBoundingBoxDescent,E=e.actualBoundingBoxDescent;break;case`strikethrough`:w=0,E=0}C=-e.width/2,T=e.width/2,r.lineWidth=Math.max(Math.floor(t._size/15),1),r.strokeStyle=r.fillStyle,r.beginPath(),r.moveTo(C,w),r.lineTo(T,E),r.stroke()}r.restore()},getBoundingClientRect:function(e,t){let n=G.ctx;n.font=[e._style,e._weight,e._size+`px/`+e._leading+`px`,e._family].join(` `),n.textAlign=`center`,n.textBaseline=Xs.Utils.baselines[e._baseline]||e._baseline;let r=n.measureText(e._value),i=r.width,a=1.15*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent);this._linewidth&&!G.isHidden.test(this._stroke)&&(i+=this._linewidth*2,a+=this._linewidth*2);let o=i/2,s=a/2;switch(G.alignments[e._alignment]||e._alignment){case G.alignments.left:e.direction===`ltr`?(t.left=0,t.right=i):(t.left=-i,t.right=0);break;case G.alignments.right:e.direction===`ltr`?(t.left=-i,t.right=0):(t.left=0,t.right=i);break;default:t.left=-o,t.right=o}switch(e._baseline){case`bottom`:t.top=-a,t.bottom=0;break;case`top`:t.top=0,t.bottom=a;break;case`baseline`:t.top=-s*1.5,t.bottom=s*.5;break;default:t.top=-s,t.bottom=s}t.width=i,t.height=a,t.centroid||={},t.centroid.x=o,t.centroid.y=s},render:function(e,t,n){if(!this._visible||!this._opacity)return this;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let r=n||this.parent,i=t[this._renderer.type],a=r._matrix.manual||r._flagMatrix,o=this._matrix.manual||this._flagMatrix,s=this._renderer.parent!==r,c=this._flagVertices||this._flagFill||this._fill instanceof Zi&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagEndPoints)||this._fill instanceof ta&&(this._fill._flagSpread||this._fill._flagStops||this._fill._flagRadius||this._fill._flagCenter||this._fill._flagFocal)||this._fill instanceof Li&&(this._fill._flagLoaded&&this._fill.loaded||this._fill._flagImage||this._fill._flagVideo||this._fill._flagRepeat||this._fill._flagOffset||this._fill._flagScale)||this._stroke instanceof Zi&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagEndPoints)||this._stroke instanceof ta&&(this._stroke._flagSpread||this._stroke._flagStops||this._stroke._flagRadius||this._stroke._flagCenter||this._stroke._flagFocal)||this._stroke instanceof Li&&(this._stroke._flagLoaded&&this._stroke.loaded||this._stroke._flagImage||this._stroke._flagVideo||this._stroke._flagRepeat||this._stroke._flagOffset||this._fill._flagScale)||this._flagStroke||this._flagLinewidth||this._flagOpacity||r._flagOpacity||this._flagVisible||this._flagScale||this._flagValue||this._flagFamily||this._flagSize||this._flagLeading||this._flagAlignment||this._flagBaseline||this._flagStyle||this._flagWeight||this._flagDecoration||this.dashes&&this.dashes.length>0||!this._renderer.texture;if(a||o||s){this._renderer.matrix||(this._renderer.matrix=new ti(9)),this._matrix.toTransformArray(!0,ic),nc(ic,r._renderer.matrix,this._renderer.matrix),this._renderer.scale instanceof B||(this._renderer.scale=new B);let e,t;this._scale instanceof B?(e=this._scale.x*r._renderer.scale.x,t=this._scale.y*r._renderer.scale.y):(e=this._scale*r._renderer.scale.x,t=this._scale*r._renderer.scale.y),this._renderer.scale.x=e<0?-e:e,this._renderer.scale.y=t<0?-t:t,s&&(this._renderer.parent=r)}if(this._mask&&(e.clear(e.STENCIL_BUFFER_BIT),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,0),e.stencilOp(e.KEEP,e.KEEP,e.REPLACE),e.colorMask(!1,!1,!1,!1),G[Xs.Utils.getRendererType(this._mask._renderer.type)].render.call(this._mask,e,t,this),e.stencilFunc(e.EQUAL,1,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP),e.colorMask(!0,!0,!0,!0)),c?(this._renderer.rect||(this._renderer.rect={}),this._renderer.opacity=this._opacity*r._renderer.opacity,G.text.getBoundingClientRect(this,this._renderer.rect),G.updateTexture.call(G,e,this)):(this._fill&&this._fill._update&&this._fill._update(),this._stroke&&this._stroke._update&&this._stroke._update()),this._clip&&!n||!this._renderer.texture)return this;t.current!==i&&(e.useProgram(i),e.bindBuffer(e.ARRAY_BUFFER,t.buffers.position),e.vertexAttribPointer(i.position,2,e.FLOAT,!1,0,0),e.enableVertexAttribArray(i.position),e.bufferData(e.ARRAY_BUFFER,sc,e.STATIC_DRAW),t.resolution.flagged||e.uniform2f(e.getUniformLocation(i,`u_resolution`),t.resolution.width,t.resolution.height),t.current=i),t.resolution.flagged&&e.uniform2f(e.getUniformLocation(i,`u_resolution`),t.resolution.width,t.resolution.height),e.bindTexture(e.TEXTURE_2D,this._renderer.texture);let l=this._renderer.rect;return e.uniformMatrix3fv(i.matrix,!1,this._renderer.matrix),e.uniform4f(i.rect,l.left,l.top,l.right,l.bottom),e.drawArrays(e.TRIANGLES,0,6),this._mask&&e.disable(e.STENCIL_TEST),H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},"linear-gradient":{render:function(e,t){if(e.canvas.getContext(`2d`)&&t){if(H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagEndPoints||this._flagStops||this._flagUnits){let n,r=this.left._x,i=this.left._y,a=this.right._x,o=this.right._y;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width,i=(i-.5)*n.height,a=(a-.5)*n.width,o=(o-.5)*n.height),this._renderer.effect=e.createLinearGradient(r,i,a,o);for(let e=0;e<this.stops.length;e++){let t=this.stops[e];this._renderer.effect.addColorStop(t._offset,t._color)}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},"radial-gradient":{render:function(e,t){if(e.canvas.getContext(`2d`)&&t){if(H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update(),!this._renderer.effect||this._flagCenter||this._flagFocal||this._flagRadius||this._flagStops||this._flagUnits){let n,r=this.center._x,i=this.center._y,a=this.focal._x,o=this.focal._y,s=this._radius;/objectBoundingBox/i.test(this._units)&&(n=t.getBoundingClientRect(!0),r=(r-.5)*n.width*.5,i=(i-.5)*n.height*.5,a=(a-.5)*n.width*.5,o=(o-.5)*n.height*.5,s*=Math.min(n.width,n.height)),this._renderer.effect=e.createRadialGradient(r,i,0,a,o,s);for(let e=0;e<this.stops.length;e++){let t=this.stops[e];this._renderer.effect.addColorStop(t._offset,t._color)}}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}}},texture:{render:function(e,t){if(!e.canvas.getContext(`2d`))return;H.isFunction(this._renderer.onBeforeRender)&&this._renderer.onBeforeRender(),this._update();let n=this.image;if((this._flagLoaded||this._flagImage||this._flagVideo||this._flagRepeat)&&this.loaded)this._renderer.effect=e.createPattern(n,this._repeat);else if(!this._renderer.effect)return this.flagReset();if((this._flagOffset||this._flagLoaded||this._flagScale)&&(this._renderer.offset instanceof B||(this._renderer.offset=new B),this._renderer.offset.x=-this._offset.x,this._renderer.offset.y=-this._offset.y,n&&(this._renderer.offset.x+=n.width/2,this._renderer.offset.y+=n.height/2,this._scale instanceof B?(this._renderer.offset.x*=this._scale.x,this._renderer.offset.y*=this._scale.y):(this._renderer.offset.x*=this._scale,this._renderer.offset.y*=this._scale))),this._flagScale||this._flagLoaded){this._renderer.scale instanceof B||(this._renderer.scale=new B);let e,t;this._scale instanceof B?(e=this._scale.x,t=this._scale.y):(e=this._scale,t=this._scale),this._renderer.scale.x=e<0?-e:e,this._renderer.scale.y=t<0?-t:t}return H.isFunction(this._renderer.onAfterRender)&&this._renderer.onAfterRender(),this.flagReset()}},updateTexture:function(e,t){let n=Xs.Utils.getRendererType(t._renderer.type);this[n].updateCanvas.call(G,e,t),this.canvas.width<=0||this.canvas.height<=0?(t._renderer.texture&&e.deleteTexture(t._renderer.texture),delete t._renderer.texture):(t._renderer.texture||(t._renderer.texture=e.createTexture()),e.bindTexture(e.TEXTURE_2D,t._renderer.texture),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,this.canvas),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR))},program:{create:function(e,t){let n,r,i;if(n=e.createProgram(),H.each(t,function(t){e.attachShader(n,t)}),e.linkProgram(n),r=e.getProgramParameter(n,e.LINK_STATUS),!r)throw i=e.getProgramInfoLog(n),e.deleteProgram(n),new wi(`unable to link program: `+i);return n}},extensions:{init:function(e){let t={},n=[`EXT_texture_filter_anisotropic`,`WEBGL_compressed_texture_s3tc`,`OES_texture_float_linear`,`WEBGL_multisampled_render_to_texture`];for(let r=0;r<n.length;r++){let i=n[r];t[i]=G.extensions.get(e,i)}return t},get:function(e,t){return e.getExtension(t)||e.getExtension(`MOZ_${t}`)||e.getExtension(`WEBKIT_${t}`)}},TextureRegistry:new Oi};G.ctx=G.canvas.getContext(`2d`);var cc=class extends z{constructor(e){super();let t,n,r,i;if(this.domElement=e.domElement||document.createElement(`canvas`),e.offscreenElement!==void 0&&(G.canvas=e.offscreenElement,G.ctx=G.canvas.getContext(`2d`)),this.scene=new gs,this.scene.parent=this,this._renderer={type:`renderer`,matrix:new ti(rc),scale:1,opacity:1},this._flagMatrix=!0,e=H.defaults(e||{},{antialias:!1,alpha:!0,premultipliedAlpha:!0,stencil:!0,preserveDrawingBuffer:!0,overdraw:!1}),this.overdraw=e.overdraw,t=this.ctx=this.domElement.getContext(`webgl`,e)||this.domElement.getContext(`experimental-webgl`,e),!this.ctx)throw new wi(`unable to create a webgl context. Try using another renderer.`);r=tc.create(t,tc.path.vertex,tc.types.vertex),i=tc.create(t,tc.path.fragment,tc.types.fragment),this.programs={current:null,buffers:{position:t.createBuffer()},resolution:{width:0,height:0,ratio:1,flagged:!1}},n=this.programs.path=G.program.create(t,[r,i]),this.programs.text=this.programs.path,t.extensions=G.extensions.init(t),t.renderer=this,n.position=t.getAttribLocation(n,`a_position`),n.matrix=t.getUniformLocation(n,`u_matrix`),n.rect=t.getUniformLocation(n,`u_rect`);let a=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,a),t.vertexAttribPointer(n.position,2,t.FLOAT,!1,0,0),t.enableVertexAttribArray(n.position),t.bufferData(t.ARRAY_BUFFER,sc,t.STATIC_DRAW),r=tc.create(t,tc.points.vertex,tc.types.vertex),i=tc.create(t,tc.points.fragment,tc.types.fragment),n=this.programs.points=G.program.create(t,[r,i]),n.position=t.getAttribLocation(n,`a_position`),n.matrix=t.getUniformLocation(n,`u_matrix`),n.size=t.getUniformLocation(n,`u_size`),t.enable(t.BLEND),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ONE_MINUS_SRC_ALPHA)}setSize(e,t,n){let r,i,a=this.ctx;return this.width=e,this.height=t,this.ratio=n===void 0?Di(a):n,this.domElement.width=e*this.ratio,this.domElement.height=t*this.ratio,H.isObject(this.domElement.style)&&H.extend(this.domElement.style,{width:e+`px`,height:t+`px`}),this._renderer.matrix[0]=this._renderer.matrix[4]=this._renderer.scale=this.ratio,this._flagMatrix=!0,r=e*this.ratio,i=t*this.ratio,a.viewport(0,0,r,i),this.programs.resolution.width=r,this.programs.resolution.height=i,this.programs.resolution.ratio=this.ratio,this.programs.resolution.flagged=!0,this.trigger(z.Types.resize,e,t,n)}render(){let e=this.ctx;return this.overdraw||e.clear(e.COLOR_BUFFER_BIT),G.group.render.call(this.scene,e,this.programs),this._flagMatrix=!1,this.programs.resolution.flagged=!0,this}};L(cc,`Utils`,G);var lc=H.extend({Error:wi,getRatio:Di,read:Is,xhr:Ls},H,Vr,Hr,Ur),K=class e{constructor(t){L(this,`_events`,new z),L(this,`type`,``),L(this,`renderer`,null),L(this,`scene`,null),L(this,`width`,0),L(this,`height`,0),L(this,`frameCount`,0),L(this,`timeDelta`,0),L(this,`playing`,!1);let n=H.defaults(t||{},{fullscreen:!1,fitted:!1,width:640,height:480,type:e.Types.svg,autostart:!1});if(H.each(n,function(e,t){/fullscreen/i.test(t)||/autostart/i.test(t)||(this[t]=e)},this),H.isElement(n.domElement)){let t=n.domElement.tagName.toLowerCase();/^(CanvasRenderer-canvas|WebGLRenderer-canvas|SVGRenderer-svg)$/.test(this.type+`-`+t)||(this.type=e.Types[t])}this.renderer=new e[this.type](this),this.setPlaying(n.autostart),this.frameCount=0,n.fullscreen?(this.fit=dc.bind(this),this.fit.domElement=window,this.fit.attached=!0,H.extend(document.body.style,{overflow:`hidden`,margin:0,padding:0,top:0,left:0,right:0,bottom:0,position:`fixed`}),H.extend(this.renderer.domElement.style,{display:`block`,top:0,left:0,right:0,bottom:0,position:`fixed`}),Si.bind(this.fit.domElement,`resize`,this.fit),this.fit()):n.fitted?(this.fit=fc.bind(this),H.extend(this.renderer.domElement.style,{display:`block`})):typeof n.width==`number`&&typeof n.height==`number`&&(this.renderer.setSize(n.width,n.height,this.ratio),this.width=n.width,this.height=n.height),this.renderer.bind(z.Types.resize,pc.bind(this)),this.scene=this.renderer.scene,e.Instances.push(this),n.autostart&&mc.init()}get _bound(){return this._events._bound}set _bound(e){this._events._bound=e}addEventListener(){return this._events.addEventListener?.apply(this,arguments)}on(){return this._events.addEventListener?.apply(this,arguments)}bind(){return this._events.addEventListener?.apply(this,arguments)}removeEventListener(){return this._events.removeEventListener?.apply(this,arguments)}off(){return this._events.removeEventListener?.apply(this,arguments)}unbind(){return this._events.removeEventListener?.apply(this,arguments)}dispatchEvent(){return this._events.dispatchEvent?.apply(this,arguments)}trigger(){return this._events.dispatchEvent?.apply(this,arguments)}listen(){return this._events.listen?.apply(this,arguments)}ignore(){return this._events.ignore?.apply(this,arguments)}appendTo(e){return e.appendChild(this.renderer.domElement),this.fit&&(this.fit.domElement!==window&&(this.fit.domElement=e,this.fit.attached=!1),this.update()),this}play(){return this.playing=!0,mc.init(),this.trigger(z.Types.play)}pause(){return this.playing=!1,this.trigger(z.Types.pause)}setPlaying(e){this.playing=e}release(e){let t,n,r;if(e===void 0)return this.release(this.scene);if(typeof e.unbind==`function`&&e.unbind(),typeof e.fill==`object`&&typeof e.fill.unbind==`function`&&e.fill.unbind(),typeof e.stroke==`object`&&typeof e.stroke.unbind==`function`&&e.stroke.unbind(),e.vertices){if(typeof e.vertices.unbind==`function`)try{e.vertices.unbind()}catch{}for(t=0;t<e.vertices.length;t++)n=e.vertices[t],typeof n.unbind==`function`&&n.unbind(),n.controls&&(n.controls.left&&typeof n.controls.left.unbind==`function`&&n.controls.left.unbind(),n.controls.right&&typeof n.controls.right.unbind==`function`&&n.controls.right.unbind())}if(e.children){for(t=0;t<e.children.length;t++)r=e.children[t],this.release(r);if(typeof e.children.unbind==`function`)try{e.children.unbind()}catch{}}if(e._renderer){if(e._renderer.elem&&e._renderer.elem.parentNode&&(e._renderer.elem.parentNode.removeChild(e._renderer.elem),delete e._renderer.elem),this.type===`WebGLRenderer`&&this.renderer.ctx){let t=this.renderer.ctx;e._renderer.texture&&(t.deleteTexture(e._renderer.texture),delete e._renderer.texture),e._renderer.positionBuffer&&(t.deleteBuffer(e._renderer.positionBuffer),delete e._renderer.positionBuffer),e._renderer.effect&&(e._renderer.effect=null)}this.type===`CanvasRenderer`&&e._renderer.context&&delete e._renderer.context}return e}getShapesAtPoint(e,t,n){return this.scene&&typeof this.scene.getShapesAtPoint==`function`?this.scene.getShapesAtPoint(e,t,n):[]}update(){let e=!!this._lastFrame,t=H.performance.now();e&&(this.timeDelta=parseFloat((t-this._lastFrame).toFixed(3))),this._lastFrame=t,this.fit&&this.fit.domElement&&!this.fit.attached&&(Si.bind(this.fit.domElement,`resize`,this.fit),this.fit.attached=!0,this.fit());let n=this.width,r=this.height,i=this.renderer;return(n!==i.width||r!==i.height)&&i.setSize(n,r,this.ratio),this.trigger(z.Types.update,this.frameCount,this.timeDelta),this.render()}render(){return this.renderer.render(),this.trigger(z.Types.render,this.frameCount++)}add(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.add(e),this}remove(e){return e instanceof Array||(e=Array.prototype.slice.call(arguments)),this.scene.remove(e),this}clear(){return this.scene.remove(this.scene.children),this}makeLine(e,t,n,r){let i=new ys(e,t,n,r);return this.scene.add(i),i}makeArrow(e,t,n,r,i){let a=typeof i==`number`?i:10,o=Math.atan2(r-t,n-e),s=new U([new V(e,t,void 0,void 0,void 0,void 0,R.move),new V(n,r,void 0,void 0,void 0,void 0,R.line),new V(n-a*Math.cos(o-Math.PI/4),r-a*Math.sin(o-Math.PI/4),void 0,void 0,void 0,void 0,R.line),new V(n,r,void 0,void 0,void 0,void 0,R.move),new V(n-a*Math.cos(o+Math.PI/4),r-a*Math.sin(o+Math.PI/4),void 0,void 0,void 0,void 0,R.line)],!1,!1,!0);return s.noFill(),s.cap=`round`,s.join=`round`,this.scene.add(s),s}makeRectangle(e,t,n,r){let i=new fo(e,t,n,r);return this.scene.add(i),i}makeRoundedRectangle(e,t,n,r,i){let a=new Uo(e,t,n,r,i);return this.scene.add(a),a}makeCircle(e,t,n,r){let i=new To(e,t,n,r);return this.scene.add(i),i}makeEllipse(e,t,n,r,i){let a=new Ao(e,t,n,r,i);return this.scene.add(a),a}makeStar(e,t,n,r,i){let a=new Yo(e,t,n,r,i);return this.scene.add(a),a}makeCurve(e){let t=arguments.length;if(!Array.isArray(e)){e=[];for(let n=0;n<t;n+=2){let t=arguments[n];if(typeof t!=`number`)break;let r=arguments[n+1];e.push(new V(t,r))}}let n=arguments[t-1],r=new U(e,!(typeof n==`boolean`&&n),!0),i=r.getBoundingClientRect();return r.center().translation.set(i.left+i.width/2,i.top+i.height/2),this.scene.add(r),r}makePolygon(e,t,n,r){let i=new Bo(e,t,n,r);return this.scene.add(i),i}makeArcSegment(e,t,n,r,i,a,o){let s=new bo(e,t,n,r,i,a,o);return this.scene.add(s),s}makePoints(e){let t=arguments.length,n=e;if(!Array.isArray(e)){n=[];for(let e=0;e<t;e+=2){let t=arguments[e];if(typeof t!=`number`)break;let r=arguments[e+1];n.push(new B(t,r))}}let r=new Fo(n);return this.scene.add(r),r}makePath(e){let t=arguments.length,n=e;if(!Array.isArray(e)){n=[];for(let e=0;e<t;e+=2){let t=arguments[e];if(typeof t!=`number`)break;let r=arguments[e+1];n.push(new V(t,r))}}let r=arguments[t-1],i=new U(n,!(typeof r==`boolean`&&r)),a=i.getBoundingClientRect();return typeof a.top==`number`&&typeof a.left==`number`&&typeof a.right==`number`&&typeof a.bottom==`number`&&i.center().translation.set(a.left+a.width/2,a.top+a.height/2),this.scene.add(i),i}makeText(e,t,n,r){let i=new ts(e,t,n,r);return this.add(i),i}makeLinearGradient(e,t,n,r){let i=new Zi(e,t,n,r,Array.prototype.slice.call(arguments,4));return this.add(i),i}makeRadialGradient(e,t,n){let r=new ta(e,t,n,Array.prototype.slice.call(arguments,3));return this.add(r),r}makeSprite(e,t,n,r,i,a,o){let s=new ho(e,t,n,r,i,a);return o&&s.play(),this.add(s),s}makeImage(e,t,n,r,i,a){let o=new zs(e,t,n,r,i,a);return this.add(o),o}makeImageSequence(e,t,n,r,i){let a=new os(e,t,n,r);return i&&a.play(),this.add(a),a}makeTexture(e,t){return new Li(e,t)}makeGroup(e){e instanceof Array||(e=Array.prototype.slice.call(arguments));let t=new gs;return this.scene.add(t),t.add(e),t}interpret(e,t,n){let r=e.tagName.toLowerCase();if(n=n===void 0||n,!(r in Is))return null;let i=Is[r].call(this,e);return n?this.add(t&&i instanceof gs?i.children:i):i.parent&&i.remove(),i}load(e,t){let n=new gs,r,i,a,o=function(e){for(Si.temp.innerHTML=e,i=0;i<Si.temp.children.length;i++)r=Si.temp.children[i],a=this.interpret(r,!1,!1),a!==null&&n.add(a);if(typeof t==`function`){let e=Si.temp.children.length<=1?Si.temp.children[0]:Si.temp.children;t(n,e)}}.bind(this);return/\.svg$/i.test(e)?(Ls(e,o),n):(o(e),n)}};L(K,`NextFrameId`,li.NextFrameId),L(K,`Types`,li.Types),L(K,`Version`,li.Version),L(K,`PublishDate`,li.PublishDate),L(K,`Identifier`,li.Identifier),L(K,`Resolution`,li.Resolution),L(K,`AutoCalculateImportedMatrices`,li.AutoCalculateImportedMatrices),L(K,`Instances`,li.Instances),L(K,`uniqueId`,li.uniqueId),L(K,`Anchor`,V),L(K,`Collection`,Ai),L(K,`Events`,z),L(K,`Group`,gs),L(K,`Matrix`,ha),L(K,`Path`,U),L(K,`Registry`,Oi),L(K,`Element`,Mi),L(K,`Shape`,_a),L(K,`Text`,ts),L(K,`Vector`,B),L(K,`Gradient`,Gi),L(K,`Image`,zs),L(K,`ImageSequence`,os),L(K,`LinearGradient`,Zi),L(K,`RadialGradient`,ta),L(K,`Sprite`,ho),L(K,`Stop`,Hi),L(K,`Texture`,Li),L(K,`ArcSegment`,bo),L(K,`Circle`,To),L(K,`Ellipse`,Ao),L(K,`Line`,ys),L(K,`Points`,Fo),L(K,`Polygon`,Bo),L(K,`Rectangle`,fo),L(K,`RoundedRectangle`,Uo),L(K,`Star`,Yo),L(K,`CanvasRenderer`,Xs),L(K,`SVGRenderer`,ec),L(K,`WebGLRenderer`,cc),L(K,`Commands`,R),L(K,`Utils`,lc);var uc=K;function dc(){let e=document.body.getBoundingClientRect(),t=this.width=e.width,n=this.height=e.height;this.renderer.setSize(t,n,this.ratio)}function fc(){let e=this.renderer.domElement.parentElement;if(!e){console.warn(`Two.js: Attempting to fit to parent, but no parent found.`);return}let t=e.getBoundingClientRect(),n=this.width=t.width,r=this.height=t.height;this.renderer.setSize(n,r,this.ratio)}function pc(e,t){this.width=e,this.height=t,this.trigger(z.Types.resize,e,t)}var mc=Si.getRequestAnimationFrame();function hc(){for(let e=0;e<uc.Instances.length;e++){let t=uc.Instances[e];t.playing&&t.update()}uc.NextFrameId=mc(hc)}mc.init=function(){hc(),mc.init=function(){}};var gc=class{x;y;constructor(e=0,t=0){this.x=e,this.y=t}},_c=class{width;angle;label;start=new gc;end=new gc;constructor(e=10,t=0,n=`A`){this.width=e,this.angle=t,this.label=n}},vc={line:{color:`#000`,size:5},previewLine:{color:`#000`,size:2},anchorPoint:{color:`#FF8000`,size:12,strokeSize:20},lineLabel:{color:`#FF8000`,size:22,rotation:-.5},angleLabel:{size:22,color:`#088c00`,rotation:-.5},colorSideLabel:{size:20,color:`#439227`}},yc={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function bc(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,yc,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`m289.94 256l95-95A24 24 0 0 0 351 127l-95 95l-95-95a24 24 0 0 0-34 34l95 95l-95 95a24 24 0 1 0 34 34l95-95l95 95a24 24 0 0 0 34-34Z`},null,-1)]])}var xc=(0,r.markRaw)({name:`ion-close`,render:bc}),Sc={class:`mr-3 flex flex-col gap-2`},Cc=[`onClick`],wc={class:`h-full p-2`},Tc=bt((0,r.defineComponent)({__name:`kozyrek-configurator-templates`,props:{settings:{},selectTemplateIndex:{}},emits:[`template:select`,`init-draw-template`,`remove-custom-template`],setup(e,{emit:t}){let n=e,i=(0,r.ref)(!1),a=(0,r.useTemplateRef)(`drawing-template-containers`),s=(0,r.useTemplateRef)(`drawing-custom-template-containers`),c=t,l=e=>{i.value=!0,c(`remove-custom-template`,e,()=>{i.value=!1})};return(0,r.onMounted)(()=>{n.settings.templates?.forEach((e,t)=>{let n=a.value?.at(t);n&&c(`init-draw-template`,n,e)}),n.settings.customTemplates?.forEach((e,t)=>{let n=s.value?.at(t);n&&c(`init-draw-template`,n,e)})}),(0,r.watch)(()=>[...n.settings.customTemplates],(e,t)=>{(0,r.nextTick)(()=>{e.forEach((e,n)=>{if(!t?.includes(e)){let t=s.value?.at(n);t&&c(`init-draw-template`,t,e)}}),t.length>e.length&&t.forEach((e,t)=>{let n=s.value?.at(t);n&&(n.innerHTML=``,c(`init-draw-template`,n,e))})})},{deep:!0}),(t,n)=>{let a=xc;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NScrollbar),{style:{width:`auto`},trigger:`none`,class:`max-h-[19rem] md:max-h-[40rem] w-auto`},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Sc,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.settings.allTemplates,(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`${t.id}-${n}`,class:`group relative`},[(0,r.createVNode)((0,r.unref)(o.NPopover),{trigger:`hover`,placement:`right`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`relative h-10 w-24 shrink-0 rounded-md border-2 border-solid border-slate-200`,{"!border-green-700":n===e.selectTemplateIndex}]),onClick:e=>c(`template:select`,n)},[(0,r.createElementVNode)(`div`,wc,[(0,r.createElementVNode)(`div`,{ref_for:!0,ref:t.isCustom&&t.id!==-1?`drawing-custom-template-containers`:`drawing-template-containers`,class:`kozyrek-preview h-full`},null,512)])],10,Cc)]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(t.label),1)]),_:2},1024),t.isCustom&&!t.isNewRec()?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,size:`tiny`,quaternary:``,loading:i.value,disabled:i.value,circle:``,class:`!absolute right-0.5 top-0.5 !hidden group-hover:!flex`,onClick:e=>l(n)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`loading`,`disabled`,`onClick`])):(0,r.createCommentVNode)(``,!0)]))),128))])]),_:1})}}}),[[`__scopeId`,`data-v-afccb364`]]),Ec={class:`flex gap-3 min-w-[20rem] relative`},Dc={class:`kozyrek-preview w-fill h-[18rem] grow touch-none overflow-hidden rounded-lg bg-gray-200 p-2`},Oc={ref:`drawing-container`,class:`size-full`},kc=(0,r.defineComponent)({__name:`kozyrek-configurator-preview`,props:{settings:{},value:{},selectTemplateIndex:{}},emits:[`pointer:move`,`pointer:up`,`template:select`,`remove-custom-template`],setup(e,{emit:t}){let{Points:n,Group:i,Line:a,Vector:o,Text:s,Anchor:c,Events:l,Path:u}=uc,d=e,f=t,p=(0,r.useTemplateRef)(`drawing-container`),m=[],h=[],g=[],_=null,v=.75,y=(0,r.computed)(()=>d.value.configuratorParams.linesAngles.map((e,t)=>new _c(d.value.configuratorParams.linesWidths[t],e,`A-${t+1}`))),b=(0,r.computed)(()=>d.value.configuratorParams.colorSide===`bottom`),x=(0,r.computed)(()=>d.value.configuratorParams.startTailType&&d.settings.startTailConfigs?.[d.value.configuratorParams.startTailType]?d.settings.startTailConfigs?.[d.value.configuratorParams.startTailType].points:[]),S=(0,r.computed)(()=>{let e=d.value.configuratorParams.endTailType!==void 0&&d.settings.endTailConfigs?.[d.value.configuratorParams.endTailType];return!e||!e.points?[]:e.points.map((e,t)=>Array.isArray(e)?new _c(e[0],e[1],`A-${t+1}`):new _c(e.width,e.angle,`A-${t+1}`))}),C=(e,t=!1)=>{e[0].start.x=0,e[0].start.y=0;let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[r-1]??new _c(0,n);n+=!t||r>1?a.angle:0;let o=(!t||r>0?i.angle:0)+n;if(e[r].end.x=i.width*Math.cos(o*Math.PI/180)+e[r].start.x,e[r].end.y=i.width*Math.sin(o*Math.PI/180)+e[r].start.y,r<e.length-1){let t=r+1;e[t].start.x=e[r].end.x,e[t].start.y=e[r].end.y}}return e},w=(e,t,n,r,i=!1)=>{let a=C([...n,...r]);t.length>0&&(a=[...C(t),...a]);let o=0,s=0,c=0,l=0;a.forEach(e=>{o=Math.min(o,e.start.x,e.end.x),s=Math.min(s,e.start.y,e.end.y),c=Math.max(c,e.start.x,e.end.x),l=Math.max(l,e.start.y,e.end.y)});let u,d;o===0&&s===0&&c===0&&l===0?(u=1,d=1):(u=e.width/Math.abs(c-o),d=(i?e.height:e.height-vc.colorSideLabel.size)/Math.abs(l-s));let f=Math.min(u,d);return o=o<0?-o*f:0,s=s<0?-s*f:0,[f,o,s]},T=e=>{let t=new n([e]);return t._size=vc.anchorPoint.size,t.fill=vc.anchorPoint.color,t.stroke=`transparent`,t._linewidth=vc.anchorPoint.strokeSize,g.push(t),t},E=(e,t)=>{if(g=[],d.settings.allowChangeFirstPoint){let n=e[0],r=new o(n.vertices[0].x,n.vertices[0].y);r.bind(l.Types.change,()=>{n.vertices[0].copy(r)});let i=T(r);t.add(i)}e.forEach((n,r)=>{let i=e[r+1],a=new o(n.vertices[1].x,n.vertices[1].y);a.bind(l.Types.change,()=>{n.vertices[1].copy(a),i!==void 0&&i.vertices[0].copy(a)});let s=T(a);t.add(s)})},D=e=>Math.PI/180*e,O=(e,t,n)=>{let r=t.vertices.length-1;e.position.x=t.vertices[r].x,e.position.y=t.vertices[r].y;let i=Math.atan2(t.vertices[r].y-t.vertices[0].y,t.vertices[r].x-t.vertices[0].x);e.rotation=D(n)+i},k=(e,t,n)=>{if(t.vertices[0]===void 0)return;e.position.x=t.vertices[0].x,e.position.y=t.vertices[0].y;let r=t.vertices.length-1,i=Math.atan2(t.vertices[r].y-t.vertices[0].y,t.vertices[r].x-t.vertices[0].x);e.rotation=D(n)+i},A=(e,t,n)=>{let r=new i;if(e.length===0)return r;let o=[];return[...e].reverse().forEach((e,t)=>{t!==0&&e.angle>0&&(e.angle*=-1),o.push(e)}),e=C(o,!0),k(r,t,e[0].angle),[t.vertices[0],t.vertices[1]].forEach(n=>{n.bind(l.Types.change,()=>{k(r,t,e[0].angle)})}),e.forEach(e=>{let t=e.start.x*n,i=e.end.x*n,o=e.start.y*n,s=e.end.y*n,c=new a(t,o,i,s);c.linewidth=vc.line.size,c.stroke=vc.line.color,r.add(c)}),r},ee=(e,t,n)=>{let r=new i;return e.length===0||(e=C(e,!0),O(r,t,e[0].angle),[t.vertices[0],t.vertices[1]].forEach(n=>{n.bind(l.Types.change,()=>{O(r,t,e[0].angle)})}),e.forEach(e=>{let t=e.start.x*n,i=e.end.x*n,o=e.start.y*n,s=e.end.y*n,c=new a(t,o,i,s);c.linewidth=vc.line.size,c.stroke=vc.line.color,r.add(c)})),r},te=(e,t,n,r)=>{let i=t.vertices[0].x+(t.vertices[1].x-t.vertices[0].x)/2-8*Math.sin(e.angle*Math.PI/180),a=t.vertices[0].y+(t.vertices[1].y-t.vertices[0].y)/2-8*Math.cos(e.angle*Math.PI/180),o=new s(e.label,i+10,a-10),c;o.size=vc.lineLabel.size,o.weight=600,o.fill=vc.lineLabel.color,o.id+=1,o.rotation=vc.lineLabel.rotation,r>0&&(c=new s(`${e.angle}°`,t.vertices[0].x+25,t.vertices[0].y-25),c.size=vc.angleLabel.size,c.weight=600,c.fill=vc.angleLabel.color,c.rotation=vc.angleLabel.rotation,c.id+=r,m.push(c),n.add(c)),n.add(o),j(o,t,0,c),j(o,t,1)},ne=()=>{let{size:e}=vc.colorSideLabel,t=b.value?e/2:e/2-e,n=b.value?e/2-e:e/2,r=new i;if(!_)return r;let a=Math.atan2(n-t,0),o=[new c(0,t,0,0,0,0,uc.Commands.move),new c(0,n,0,0,0,0,uc.Commands.line),new c(0-5*Math.cos(a-Math.PI/4),n-5*Math.sin(a-Math.PI/4),0,0,0,0,uc.Commands.line),new c(0,n,0,0,0,0,uc.Commands.move),new c(0-5*Math.cos(a+Math.PI/4),n-5*Math.sin(a+Math.PI/4),0,0,0,0,uc.Commands.line)],l=new u(o,!1,!1,!0);l.noFill(),l.cap=`round`,l.join=`round`,l.linewidth=e/7,l.stroke=vc.colorSideLabel.color,r.add(l);let d=new s(b.value?`Цвет снизу`:`Цвет сверху`,10,0);d.size=e,d.weight=600,d.fill=vc.colorSideLabel.color,d.alignment=`left`,r.add(d);let f=r.getBoundingClientRect();return r.position.x=(_.width-f.width)*v+10,r.position.y=b.value?_.height+f.height*2:f.height/2,r},j=(e,t,n,r)=>{t.vertices[n].bind(l.Types.change,()=>{let n=t.vertices.length-1,i=Math.atan2(t.vertices[0].y-t.vertices[n].y,t.vertices[0].x-t.vertices[n].x)*180/Math.PI,a=t.vertices[0].x+(t.vertices[n].x-t.vertices[0].x)/2-8*Math.sin(i*Math.PI/180),o=t.vertices[0].y+(t.vertices[n].y-t.vertices[0].y)/2-8*Math.cos(i*Math.PI/180);e.position.x=a+10,e.position.y=o-10,e.rotation=-.5,r&&(r.position.x=t.vertices[0].x+25,r.position.y=t.vertices[0].y-25)})},M=(e,t,n,r,o=!1)=>{if(e.clear(),n.length===0){e.update();return}let s=C(n),[c,l,u]=w(e,t,s,r,o),f=new i,p=[],g=[];o||(m=[],h=[]),s.forEach((e,t)=>{let n=e.start.x*c+l,r=e.end.x*c+l,i=e.start.y*c+u,s=e.end.y*c+u,d=new a(n,i,r,s);d.linewidth=o?vc.previewLine.size:vc.line.size,d.stroke=o?vc.previewLine.color:vc.line.color,h.push(d),p.push(d),f.add(d),!o&&e.label!==``&&te(e,d,f,t)});let _=p.at(-1),y=f.getBoundingClientRect();if(!o){let e=ne();g.push(e)}if(t.length>0){let e=A(t,p[0],c);f.add(e)}if(r.length>0&&_){let e=ee(r,_,c);f.add(e)}if(g.push(f),e.makeGroup(g),y=f.getBoundingClientRect(),f.position.x=0-y.left+(e.width-y.width)/(2*(o?1:v)),f.position.y=0-y.top+(e.height-y.height)/(2*(o?1:v)),e.update(),!o){let t=d.value.configuratorParams?.colorSide===`top`;f.position.y=f.position.y+vc.colorSideLabel.size*Number(t),E(p,f),e.update()}},re=(e,t)=>{if(e&&!t.isNewRec()){let n=new uc({width:e.scrollWidth,height:e.scrollHeight});n.appendTo(e),M(n,[],t.points,[],!0)}},ie=()=>{_&&M(_,x.value,y.value,S.value,!1)},ae=e=>180/Math.PI*e,N=(e,t)=>{let n=e[1].x-e[0].x,r=e[1].y-e[0].y,i=t[1].x-t[0].x,a=t[1].y-t[0].y,o=Math.atan2(n*a-r*i,n*i+r*a);return o=ae(o),Math.round(o)*-1},P=e=>{let t=h.map((t,n,r)=>{let i=r[n-1]??{vertices:[{x:-10,y:0},{x:0,y:0}]},a=F.multiplyByStep(Math.ceil(F.divideByStep(t._length/e,d.settings.lineWidthStep)),d.settings.lineWidthStep),o=m[n-1];a<(r.length>1?d.settings.minLineWidth:d.settings.stripMinWidth)&&(a=r.length>1?d.settings.minLineWidth:d.settings.stripMinWidth),a>d.settings.maxLineWidth&&(a=d.settings.maxLineWidth);let s=N(t.vertices,i.vertices);return o&&(o.value=`${s}°`),new _c(a,s,`A-${n+1}`)});f(`pointer:move`,t)},oe=e=>{let t=null,n,r=r=>{t=g.find(e=>e.renderer?.elem===r.target),[n]=w(e,x.value,y.value.map(e=>e),S.value)},i=r=>{if(t){let i=t.renderer?.elem;if(!i)return;let a=i.getBoundingClientRect();t.vertices[0].x-=a.x-(r instanceof MouseEvent?r.clientX:r.targetTouches[0].clientX)+vc.anchorPoint.size/2,t.vertices[0].y-=a.y-(r instanceof MouseEvent?r.clientY:r.targetTouches[0].clientY)+vc.anchorPoint.size/2,P(n),e.update()}},a=()=>{t&&f(`pointer:up`,y.value),t=null},o=p.value;o&&(o.addEventListener(`touchstart`,r,{passive:!0}),o.addEventListener(`touchend`,a,{passive:!0}),o.addEventListener(`mousedown`,r),o.addEventListener(`mouseup`,a),o.addEventListener(`mousemove`,i),o.addEventListener(`touchmove`,i,{passive:!0}))},se=(e,t)=>{f(`remove-custom-template`,e,t)};return(0,r.onMounted)(()=>{p.value&&(_=new uc({width:p.value.scrollWidth,height:p.value.scrollHeight,fullscreen:!1}).appendTo(p.value),_.scene.scale=v,_.update(),(0,r.watch)(()=>d.value,()=>{ie()},{deep:!0,immediate:!0}),oe(_))}),(0,r.onBeforeUnmount)(()=>{_&&=(_.clear(),null)}),(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ec,[(0,r.createVNode)(Tc,{"select-template-index":e.selectTemplateIndex,settings:e.settings,"onTemplate:select":n[0]||=e=>f(`template:select`,e),onInitDrawTemplate:re,onRemoveCustomTemplate:se},null,8,[`select-template-index`,`settings`]),(0,r.createElementVNode)(`div`,Dc,[(0,r.createElementVNode)(`div`,Oc,null,512)])]))}}),Ac=class extends t.Identity{label=``;points=[];isCustom=!1;id=-1;guid=``;constructor(e,t){super(),e?(this.label=e.label,this.points=e.points.map((e,t)=>(0,n.isArray)(e)?new _c(e[0],e[1],`A-${t+1}`):new _c(e.width,e.angle,`A-${t+1}`)),this.isCustom=e.isCustom):(this.label=`-- Новая конфигурация --`,this.points=[new _c(0,0,`A-1`)],this.isCustom=!0,this.id=t??this.id)}},jc=class extends Ac{isDefault;constructor(e){super(e),this.isDefault=e.isDefault??!1}},Mc=class{minLineWidth;maxLineWidth;lineWidthStep;minLineAngle;maxLineAngle;lineAngleStep;stripMinWidth;stripMaxWidth;stripMinLength;stripMaxLength;allowShowTable;showOnlyTemplates;templates;customTemplates=[];startTailConfigs;endTailConfigs;bendCountForExtended;extendedProductCatalog;allowChangeFirstPoint;allowSaveTemplates;userTemplatesPrefix;lengthStep;canSetDopProdaga;constructor(e){this.minLineWidth=e.minLineWidth,this.maxLineWidth=e.maxLineWidth,this.lineWidthStep=e.lineWidthStep,this.minLineAngle=e.minLineAngle,this.maxLineAngle=e.maxLineAngle,this.lineAngleStep=e.lineAngleStep,this.stripMinWidth=e.stripMinWidth,this.stripMaxWidth=e.stripMaxWidth,this.stripMinLength=e.stripMinLength,this.stripMaxLength=e.stripMaxLength,this.allowShowTable=e.allowShowTable,this.showOnlyTemplates=e.showOnlyTemplates,this.templates=e.templates.map(e=>new Ac(e)),this.templates.forEach((e,t)=>{e.id=t}),this.startTailConfigs=e.startTailConfigs?.map(e=>new jc(e))??[],this.endTailConfigs=e.endTailConfigs?.map(e=>new jc(e))??[],this.bendCountForExtended=e.bendCountForExtended,this.extendedProductCatalog=e.extendedProductCatalog,this.allowChangeFirstPoint=e.allowChangeFirstPoint,this.allowSaveTemplates=e.allowSaveTemplates,this.userTemplatesPrefix=e.userTemplatesPrefix,this.lengthStep=e.lengthStep,this.canSetDopProdaga=e.canSetDopProdaga,this.showOnlyTemplates||(this.customTemplates=e.customTemplates?Object.entries(e.customTemplates).filter(([,e])=>e.id!==-1).map(([e,t])=>{let n=new Ac(t);return n.isCustom=!0,n.id=+e,n}):[],this.customTemplates.some(e=>e.isCustom&&e.isNewRec())||this.customTemplates.push(new Ac({label:`-- Новая конфигурация --`,points:[new _c(this.stripMinWidth,0,`A-1`)],isCustom:!0,id:-1,guid:``})))}get allTemplates(){return[...this.templates,...this.customTemplates]}addCustomTemplate(e){if(!this.allowSaveTemplates)return;let t=this.customTemplates.findLast(e=>!e.isNewRec()),n=new Ac(e);n.isCustom=!0,n.id=t?t.id+1:0,this.customTemplates.splice(-1,0,n)}removeCustomTemplate(e){if(!this.allowSaveTemplates)return;let t=this.customTemplates.findIndex(t=>t.id===e);t!==-1&&this.customTemplates.splice(t,1)}},Nc={class:`flex flex-col gap-3`},Pc={class:`grid gap-5 md:grid-cols-5`},Fc=(0,r.defineComponent)({__name:`kozyrek-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.ref)(!1),l=(0,r.ref)(!1),u=(0,r.ref)(!1),d=(0,r.ref)(a.cartItem),f=(0,r.ref)(new Mc(a.settings)),p=(0,r.ref)({linesWidths:[...a.cartItem.configuratorParams.linesWidths],linesAngles:[...a.cartItem.configuratorParams.linesAngles]}),m=(0,r.ref)({quantity:{},marker:{},length:{}}),h=(0,r.ref)(0),g=(0,r.useTemplateRef)(`kozyrek-configurator-params-form`),_=(e=0)=>{let t=f.value.allTemplates?.at(e);t!==void 0&&(h.value=e,d.value.configuratorParams.linesWidths=t.points.map(e=>(0,n.isArray)(e)?e[0]:e.width),d.value.configuratorParams.linesAngles=t.points.map(e=>(0,n.isArray)(e)?e[1]:e.angle),C()),x(d.value.configuratorParams)},v=async()=>{let e=prompt(`Введите название шаблона:`);if(!e)return;u.value=!0;let t={label:e,points:d.value.configuratorParams.linesWidths.map((e,t)=>[e,d.value.configuratorParams.linesAngles[t]])};a.eventEmitter.emit(`configurator:create-template`,{category:a.cartItem.category,template:t,callback:e=>{e&&(f.value.addCustomTemplate(t),h.value=f.value.allTemplates.length-2),u.value=!1}})},y=async(e,t)=>{let n=f.value.allTemplates?.at(e);n&&n.isCustom&&a.eventEmitter.emit(`configurator:remove-template`,{category:a.cartItem.category,templateId:n.id,callback:e=>{e&&(f.value.removeCustomTemplate(n.id),_()),t?.()}})},b=()=>{f.value.showOnlyTemplates||f.value.allowSaveTemplates&&(h.value=f.value.allTemplates.length-1)},x=async e=>{d.value.product=new t.ClientProduct,g.value?.formReference?.validate(t=>{t||(C(),c.value=!0,a.eventEmitter.emit(`configurator:search-product`,{category:a.cartItem.category,params:e,validationFieldResultData:m.value,callback:e=>{e?d.value.product=e:m.value.product={showFeedback:!0,feedback:`Не удалось найти товар по указанным параметрам.`,validationStatus:`error`},c.value=!1}}))}).catch(n.noop)},S=async()=>{g.value?.formReference?.validate(e=>{if(!e){l.value=!0;let e=new t.OrderItemBase(d.value);f.value.startTailConfigs?.length||delete e.configuratorParams.startTailType,f.value.endTailConfigs?.length||delete e.configuratorParams.endTailType,s(`submit`,e,m.value,()=>{l.value=!1,(0,r.nextTick)(()=>{g.value?.formReference?.restoreValidation()})})}}).catch(n.noop)},C=()=>{let e={quantity:m.value.quantity,marker:m.value.marker};d.value.configuratorParams.linesWidths.forEach((t,n)=>{e[`lines_widths[${n+1}]`]={},e[`lines_angles[${n+1}]`]={}}),m.value=e},w=e=>{p.value.linesWidths=e.map(e=>e.width),p.value.linesAngles=e.map(e=>e.angle)},T=e=>{d.value.configuratorParams.linesWidths=p.value.linesWidths,d.value.configuratorParams.linesAngles=p.value.linesAngles,C(),b(),x(d.value.configuratorParams)},E=(e,t)=>{p.value.linesWidths=e,p.value.linesAngles=t},D=e=>{let t=d.value.configuratorParams.linesWidths.length>1?f.value.minLineWidth:f.value.stripMinWidth;d.value.configuratorParams.linesWidths.splice(e+1,0,t),d.value.configuratorParams.linesAngles.splice(e+1,0,0),p.value.linesWidths=[...d.value.configuratorParams.linesWidths],p.value.linesAngles=[...d.value.configuratorParams.linesAngles],C(),b(),x(d.value.configuratorParams)},O=e=>{d.value.configuratorParams.linesWidths.length<=1||(d.value.configuratorParams.linesWidths.splice(e,1),d.value.configuratorParams.linesAngles.splice(e,1),p.value.linesWidths=[...d.value.configuratorParams.linesWidths],p.value.linesAngles=[...d.value.configuratorParams.linesAngles],C(),b(),x(d.value.configuratorParams))};return(0,r.onMounted)(()=>{a.cartItem.isNewRec()?_():(C(),h.value=-1,x(d.value.configuratorParams))}),(0,r.watch)(()=>a.cartItem,e=>{d.value=new t.OrderItemBase(e),e.isNewRec()?_():(C(),h.value=-1,x(d.value.configuratorParams))}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Nc,[e.settings.allowShowTable?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-end`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,Pc,[(0,r.createVNode)(kc,{value:d.value,"select-template-index":h.value,settings:f.value,class:`h-fit col-span-3`,"onPointer:up":T,"onPointer:move":w,"onTemplate:select":_,onRemoveCustomTemplate:y},null,8,[`value`,`select-template-index`,`settings`]),(0,r.createVNode)(Tr,{ref:`kozyrek-configurator-params-form`,value:d.value,"onUpdate:value":n[1]||=e=>d.value=e,"preview-params":p.value,validation:m.value,settings:f.value,"is-submit-processing":l.value,"is-product-searching":c.value,"select-template-index":h.value,class:`col-span-2`,"onUpdate:params":n[2]||=e=>x(e),"onUpdate:preview":E,onSubmit:S,"onClick:saveTemplate":v,"onClick:addLine":D,"onClick:removeLine":O},null,8,[`value`,`preview-params`,`validation`,`settings`,`is-submit-processing`,`is-product-searching`,`select-template-index`])])])}}}),Ic={class:`flex flex-col items-center justify-between rounded-xl`},Lc={class:`img-preview relative flex justify-center`},Rc=bt((0,r.defineComponent)({__name:`mosquito-configurator-preview`,props:{configuratorParams:{},settings:{}},emits:[`open-instructions`],setup(e,{emit:t}){let i=e,a=(0,r.computed)(()=>{let{height:e}=i.configuratorParams;return(0,n.keys)(i.settings.crossbarCount).reverse().find(t=>e>=i.settings.crossbarCount[Number(t)])}),s=t;return(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ic,[(0,r.createElementVNode)(`div`,Lc,[n[1]||=(0,r.createElementVNode)(`div`,{class:`window`},null,-1),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`net`,`net-${e.configuratorParams.netType}`])},null,2),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`frame`,`frame-${e.configuratorParams.color}`])},null,2),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:(0,r.normalizeClass)([`frame-crossbar`,`frame-crossbar-${a.value}-${e.configuratorParams.color}`])},null,2)):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`mount`,`mount-${e.configuratorParams.mountType}-${e.configuratorParams.color}`])},null,2),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`cut-preview`,`cut-preview-${e.configuratorParams.mountType}-${e.configuratorParams.color}`])},null,2)]),(0,r.createVNode)(i,{type:`primary`,class:`block justify-self-center`,onClick:n[0]||=e=>s(`open-instructions`)},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Руководство по замеру `,-1)]]),_:1})])}}}),[[`__scopeId`,`data-v-2a790a20`]]),zc={key:0,class:`flex items-baseline gap-1`},Bc={key:0,class:`flex items-baseline gap-1`},Vc={key:1},Hc={class:`text-lg font-semibold`},Uc={key:2,class:`text-red-500 text-sm mb-2`},Wc={class:`flex gap-3`},Gc=(0,r.defineComponent)({__name:`mosquito-configurator-form`,props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:[`update:value`,`update:params`,`submit`,`click:instructions-toggle`,`click:show-preview-drawer`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.computed)(()=>oe.isPhoneDevice()),u=(0,r.useTemplateRef)(`form-reference`),d=(0,r.useTemplateRef)(`width-form-item-reference`),f=(0,r.useTemplateRef)(`height-form-item-reference`),p=(0,r.useTemplateRef)(`width-input-reference`),m=(0,r.ref)((0,n.cloneDeep)(s.value)),h=(0,r.computed)(()=>s.settings.widthOverlaps[m.value.configuratorParams.mountType]??0),g=(0,r.computed)(()=>s.settings.heightOverlaps[m.value.configuratorParams.mountType]??0),_=(0,r.computed)(()=>s.settings.maxWidths[m.value.configuratorParams.netType]),v=(0,r.computed)(()=>s.settings.maxHeights[m.value.configuratorParams.netType]),y=(0,r.computed)(()=>m.value.configuratorParams.width?m.value.configuratorParams.width+h.value:0),b=(0,r.computed)(()=>m.value.configuratorParams.height?m.value.configuratorParams.height+g.value:0),x=(0,r.ref)(s.settings.canSetDopProdaga??!1),S=(0,r.computed)(()=>({"configuratorParams.width":[I.required,I.min(s.settings.minWidth-h.value),I.max(_.value-h.value),I.step(1),De.serverValidation(s.validation.width.feedback)],"configuratorParams.height":[I.required,I.min(s.settings.minHeight-g.value),I.max(v.value-g.value),I.step(1),De.serverValidation(s.validation.height.feedback)],quantity:[I.required,I.min(1),I.step(1),De.serverValidation(s.validation.quantity.feedback)],marker:[De.serverValidation(s.validation.marker.feedback)]})),C=(0,r.computed)(()=>{let e=y.value,t=b.value,{quantity:n}=s.value,r=s.value.product?.costRub||0;if(!e||!t||!n||r===0)return null;let i=e*t/1e6;return F.formatMoney(r*n*i)}),w=(0,r.computed)(()=>{let e=y.value,t=b.value,n=!!(e&&e>=s.settings.minWidth&&e<=s.settings.maxWidths[m.value.configuratorParams.netType]),r=!!(t&&t>=s.settings.minHeight&&t<=s.settings.maxHeights[m.value.configuratorParams.netType]),i=!!(s.value.quantity&&s.value.quantity>0);return n&&r&&i}),E=(e,t)=>{let i=m.value.configuratorParams;e&&e in i&&(i[e]=t);let a={...i,width:y.value??0,height:b.value??0};e===`width`&&d.value?.validate().catch(n.noop),e===`height`&&f.value?.validate().catch(n.noop),(0,r.nextTick)(()=>{!d.value?.validationErrored&&!f.value?.validationErrored&&a.height&&a.width&&c(`update:params`,a),D(`configuratorParams`,a)})},D=(e,n)=>{let r=new t.OrderItemBase(s.value);r[e]=n,e===`configuratorParams`&&(r.product=new t.ClientProduct),c(`update:value`,r)};return(0,r.watch)(()=>s.value,e=>{let t=(0,n.cloneDeep)((0,r.toRaw)(e)),i=t.configuratorParams.mountType,a=s.settings.widthOverlaps[i]??0,o=s.settings.heightOverlaps[i]??0;t.configuratorParams.width&&t.configuratorParams.width>0&&(t.configuratorParams.width-=a),t.configuratorParams.height&&t.configuratorParams.height>0&&(t.configuratorParams.height-=o),m.value=t},{deep:!0,immediate:!0}),(0,r.onMounted)(()=>{p.value?.select()}),i({validate:u.value?.validate,formReference:u}),(t,n)=>{let i=o.NCheckbox;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:m.value,rules:S.value,class:`flex flex-col gap-2 px-4 md:max-w-96 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Тип сетки`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:m.value.configuratorParams.netType,"onUpdate:value":[n[0]||=e=>m.value.configuratorParams.netType=e,n[1]||=e=>E(`netType`,e)],options:e.settings.netType.map(t=>({label:e.settings.descriptions.net_type[t],value:t}))},null,8,[`value`,`options`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Цвет профиля`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:m.value.configuratorParams.color,"onUpdate:value":[n[2]||=e=>m.value.configuratorParams.color=e,n[3]||=e=>E(`color`,e)],options:e.settings.color.map(t=>({label:e.settings.descriptions.color[t],value:t}))},null,8,[`value`,`options`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Вид крепления`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:m.value.configuratorParams.mountType,"onUpdate:value":[n[4]||=e=>m.value.configuratorParams.mountType=e,n[5]||=e=>E(`mountType`,e)],options:e.settings.mountType.map(t=>({label:e.settings.descriptions.mount_type[t],value:t}))},null,8,[`value`,`options`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{ref:`width-form-item-reference`,path:`configuratorParams.width`,label:`Ширина светового проёма от ${e.settings.minWidth-h.value} ${_.value?` до `+(_.value-h.value):``} мм.`},{feedback:(0,r.withCtx)(()=>[!e.validation.width.showFeedback&&y.value>=e.settings.minWidth&&y.value<=e.settings.maxWidths[m.value.configuratorParams.netType]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,zc,[(0,r.createVNode)((0,r.unref)(o.NText),{type:`success`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(`Ширина готового изделия `+(0,r.toDisplayString)(y.value),1)]),_:1}),(0,r.createVNode)((0,r.unref)(o.NButton),{quaternary:``,type:`info`,size:`tiny`,onClick:n[10]||=e=>c(`click:instructions-toggle`)},{default:(0,r.withCtx)(()=>[...n[25]||=[(0,r.createElementVNode)(`span`,{class:`text-sm`},`Руководство`,-1)]]),_:1})])):(0,r.createCommentVNode)(``,!0)]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{ref:`width-input-reference`,value:m.value.configuratorParams.width,"onUpdate:value":[n[6]||=e=>m.value.configuratorParams.width=e,n[9]||=e=>E(`width`,e)],parse:(0,r.unref)(be),"show-button":!1,placeholder:`Введите высоту светового проёма`,class:`w-full`,onKeydown:n[7]||=e=>(0,r.unref)(ve)(e),onInput:n[8]||=t=>(0,r.unref)(xe)(e.validation,`width`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{ref:`height-form-item-reference`,path:`configuratorParams.height`,label:`Высота светового проёма от ${e.settings.minHeight-g.value} ${v.value?` до `+(v.value-g.value):``} мм.`},{feedback:(0,r.withCtx)(()=>[!e.validation.height.showFeedback&&b.value>=e.settings.minHeight&&b.value<=e.settings.maxHeights[m.value.configuratorParams.netType]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Bc,[(0,r.createVNode)((0,r.unref)(o.NText),{type:`success`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(`Высота готового изделия `+(0,r.toDisplayString)(b.value),1)]),_:1}),(0,r.createVNode)((0,r.unref)(o.NButton),{quaternary:``,type:`info`,size:`tiny`,onClick:n[15]||=e=>c(`click:instructions-toggle`)},{default:(0,r.withCtx)(()=>[...n[26]||=[(0,r.createElementVNode)(`span`,{class:`text-sm`},`Руководство`,-1)]]),_:1})])):(0,r.createCommentVNode)(``,!0)]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:m.value.configuratorParams.height,"onUpdate:value":[n[11]||=e=>m.value.configuratorParams.height=e,n[14]||=e=>E(`height`,e)],parse:(0,r.unref)(be),"show-button":!1,placeholder:`Введите высоту светового проёма`,class:`w-full`,onKeydown:n[12]||=e=>(0,r.unref)(ve)(e),onInput:n[13]||=t=>(0,r.unref)(xe)(e.validation,`height`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`quantity`,label:`Количество`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:m.value.quantity,"onUpdate:value":[n[16]||=e=>m.value.quantity=e,n[19]||=e=>D(`quantity`,e??0)],"show-button":!1,placeholder:`Введите количество`,class:`w-full`,onKeydown:n[17]||=e=>(0,r.unref)(ve)(e,!1),onInput:n[18]||=t=>(0,r.unref)(xe)(e.validation,`quantity`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:m.value.marker??null,placeholder:`Введите маркировку`,onInput:n[20]||=t=>(0,r.unref)(xe)(e.validation,`marker`),"onUpdate:value":n[21]||=e=>{m.value.marker=e??null,D(`marker`,e??null)},onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1}),x.value?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,checked:m.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[22]||=e=>{m.value.isAdditionalSale=e??!1,D(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[27]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(mr,{"is-product-searching":e.isProductSearching,product:m.value.product,validation:e.validation.product},null,8,[`is-product-searching`,`product`,`validation`]),C.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Vc,[n[28]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,Hc,(0,r.toDisplayString)(C.value)+` ₽`,1)])):(0,r.createCommentVNode)(``,!0),w.value?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Uc,` Пожалуйста, заполните все обязательные поля корректно. `)),(0,r.createElementVNode)(`div`,Wc,[(0,r.createVNode)((0,r.unref)(o.NButton),{loading:e.isSubmitProcessing,disabled:!w.value||m.value.product.isNewRec(),type:`primary`,class:`self-start`,onClick:n[23]||=t=>c(`submit`,e.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.value.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`]),l.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,type:`default`,onClick:n[24]||=e=>c(`click:show-preview-drawer`)},{default:(0,r.withCtx)(()=>[...n[29]||=[(0,r.createTextVNode)(` Предварительный просмотр `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0)])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>c(`submit`,m.value)]])}}}),Kc={class:`flex flex-col gap-6`},qc={class:`flex gap-4`},Jc={class:`flex flex-col gap-2`},Yc={class:`flex gap-4`},Xc={class:`flex flex-col gap-2`},Zc={class:`flex gap-4`},Qc={class:`flex flex-col gap-2`},$c=(0,r.defineComponent)({__name:`mosquito-configurator-measurement-instructions`,props:{heightOverlaps:{},widthOverlaps:{},show:{type:Boolean}},emits:[`update:show`],setup(e,{emit:t}){let n=oe.initRefDependingOnDeviceResolution(`small`,`small`,`medium`),i=oe.initRefDependingOnDeviceResolution(.98,.95,.8),a=(0,r.computed)(()=>window.innerWidth*i.value),s=t;return(t,i)=>{let c=o.NText;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NModal),{show:e.show,"show-icon":!1,size:(0,r.unref)(n),style:(0,r.normalizeStyle)(`width: ${a.value}px`),title:`Руководство по замеру`,"action-class":`grid grid-cols-2 !justify-between`,preset:`dialog`,onClose:i[0]||=e=>s(`update:show`,!1),onEsc:i[1]||=e=>s(`update:show`,!1),onMaskClick:i[2]||=e=>s(`update:show`,!1)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Kc,[(0,r.createVNode)(c,{type:`error`,class:`text-base font-medium`},{default:(0,r.withCtx)(()=>[...i[3]||=[(0,r.createTextVNode)(` Важно! Для того,что бы произвести замер, необходимо открыть оконную створку. `,-1)]]),_:1}),i[22]||=(0,r.createElementVNode)(`div`,{class:`grid gap-6 md:grid-cols-2`},[(0,r.createElementVNode)(`div`,{class:`flex items-start gap-4`},[(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/measurement-height.png`,alt:`measurement-height`,class:`w-[7.5rem]`}),(0,r.createElementVNode)(`div`,{class:`flex flex-col gap-2`},[(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Замер ширины`),(0,r.createElementVNode)(`span`,null,`Замерить по ширине световой проем оконной рамы. Размер учитывать c точностью до 1 мм`)])]),(0,r.createElementVNode)(`div`,{class:`flex items-start gap-4`},[(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/measurement-width.png`,alt:`measurement-height`,class:`w-[7.5rem]`}),(0,r.createElementVNode)(`div`,{class:`flex flex-col gap-2`},[(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Замер высоты`),(0,r.createElementVNode)(`span`,null,`Замерить по высоте световой проем оконной рамы. Размер учитывать с точностью до 1 мм`)])])],-1),(0,r.createElementVNode)(`div`,qc,[i[9]||=(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/mount.png`,alt:`measurement-height`,class:`w-[7.5rem]`},null,-1),(0,r.createElementVNode)(`div`,Jc,[i[8]||=(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Крепление на раме сетки`,-1),(0,r.createElementVNode)(`span`,null,[i[4]||=(0,r.createTextVNode)(` Расчетные размеры москитной сетки: `,-1),i[5]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Ширина светового проема +`+(0,r.toDisplayString)(e.widthOverlaps.frame)+` мм. Высота светового проема +`+(0,r.toDisplayString)(e.heightOverlaps.frame)+` мм. `,1),i[6]||=(0,r.createElementVNode)(`br`,null,null,-1),i[7]||=(0,r.createTextVNode)(` Крепления находятся на раме сетки. `,-1)])])]),(0,r.createElementVNode)(`div`,Yc,[i[15]||=(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/mount-z-plastic.png`,alt:`measurement-height`,class:`w-[7.5rem]`},null,-1),(0,r.createElementVNode)(`div`,Xc,[i[14]||=(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Z-Образное крепление пластик (верх+низ)`,-1),(0,r.createElementVNode)(`span`,null,[i[10]||=(0,r.createTextVNode)(` Расчетные размеры москитной сетки:`,-1),i[11]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Ширина светового проема +`+(0,r.toDisplayString)(e.widthOverlaps.external_plastic)+` мм. Высота светового проема +`+(0,r.toDisplayString)(e.heightOverlaps.external_plastic)+` мм. `,1),i[12]||=(0,r.createElementVNode)(`br`,null,null,-1),i[13]||=(0,r.createTextVNode)(` Крепления прикручиваются к раме окна c помощью шурупов. `,-1)])])]),(0,r.createElementVNode)(`div`,Zc,[i[21]||=(0,r.createElementVNode)(`img`,{src:`/img/configurators/mosquitto/measurement-instructions/mount-z-metal.png`,alt:`measurement-height`,class:`w-[7.5rem]`},null,-1),(0,r.createElementVNode)(`div`,Qc,[i[20]||=(0,r.createElementVNode)(`span`,{class:`text-lg font-bold`},`Z-Образное крепление металл (верх+низ)`,-1),(0,r.createElementVNode)(`span`,null,[i[16]||=(0,r.createTextVNode)(` Расчетные размеры москитной сетки: `,-1),i[17]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Ширина светового проема +`+(0,r.toDisplayString)(e.widthOverlaps.external_metal)+` мм. Высота светового проема +`+(0,r.toDisplayString)(e.heightOverlaps.external_metal)+` мм. `,1),i[18]||=(0,r.createElementVNode)(`br`,null,null,-1),i[19]||=(0,r.createTextVNode)(` Крепления прикручиваются к раме окна c помощью шурупов. `,-1)])])])])]),_:1},8,[`show`,`size`,`style`])}}}),el={class:`grid md:grid-cols-2`},tl=(0,r.defineComponent)({__name:`mosquito-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.computed)(()=>oe.isPhoneDevice()),l=(0,r.ref)(!1),u=(0,r.ref)(!1),d=(0,r.ref)(a.cartItem),f=(0,r.useTemplateRef)(`mosquito-configurator-form`),p=(0,r.ref)({width:{},height:{},quantity:{},marker:{}}),m=(0,r.ref)(!1),h=(0,r.ref)(!1),g=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,300)),_=(0,n.debounce)(async e=>{d.value.product=new t.ClientProduct,f.value?.formReference?.validate(t=>{t||(m.value=!0,a.eventEmitter.emit(`configurator:search-product`,{category:a.cartItem.category,params:e,validationFieldResultData:p.value,callback:e=>{e?d.value.product=e:p.value.product={showFeedback:!0,feedback:`Не удалось найти товар по указанным параметрам.`,validationStatus:`error`},m.value=!1}}))}).catch(n.noop)},g.value),v=()=>{h.value=!0,s(`submit`,d.value,p.value,()=>{h.value=!1})};return(0,r.watch)(()=>a.cartItem,e=>{d.value=e},{deep:!0}),(t,n)=>{let i=xc;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createVNode)($c,{show:u.value,"onUpdate:show":n[0]||=e=>u.value=e,"height-overlaps":e.settings.heightOverlaps,"width-overlaps":e.settings.widthOverlaps},null,8,[`show`,`height-overlaps`,`width-overlaps`]),(0,r.createElementVNode)(`div`,el,[c.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NDrawer),{key:1,show:l.value,"onUpdate:show":n[4]||=e=>l.value=e,"default-width":375,resizable:``},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NDrawerContent),null,{header:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NButton),{size:`small`,type:`primary`,class:`block justify-self-end`,onClick:n[2]||=e=>l.value=!1},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1})]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(Rc,{"configurator-params":d.value.configuratorParams,settings:e.settings,onOpenInstructions:n[3]||=e=>u.value=!0},null,8,[`configurator-params`,`settings`])]),_:1})]),_:1},8,[`show`])):((0,r.openBlock)(),(0,r.createBlock)(Rc,{key:0,"configurator-params":d.value.configuratorParams,settings:e.settings,onOpenInstructions:n[1]||=e=>u.value=!0},null,8,[`configurator-params`,`settings`])),(0,r.createVNode)(Gc,{ref:`mosquito-configurator-form`,value:d.value,"onUpdate:value":n[5]||=e=>d.value=e,validation:p.value,settings:e.settings,"is-product-searching":m.value,"is-submit-processing":h.value,"onUpdate:params":n[6]||=e=>(0,r.unref)(_)(e),onSubmit:n[7]||=e=>v(),"onClick:instructionsToggle":n[8]||=e=>u.value=!u.value,"onClick:showPreviewDrawer":n[9]||=e=>l.value=!0},null,8,[`value`,`validation`,`settings`,`is-product-searching`,`is-submit-processing`])])],64)}}}),nl=(0,r.defineComponent)({__name:`strip-configurator-line-item`,props:{value:{},index:{},path:{},settings:{},product:{default:void 0},addLineButtonDisabled:{type:Boolean,default:!1},removeLineButtonDisabled:{type:Boolean,default:!1},suggestionOption:{default:void 0},autoFocus:{type:Boolean,default:!1},isLastLine:{type:Boolean,default:!1},validation:{}},emits:[`update:value`,`click:add-line`,`click:remove-line`],setup(e,{expose:t,emit:n}){let i=e,a=n,s=(0,r.useTemplateRef)(`width-input-element`),c=(0,r.ref)(!1),l=(0,r.ref)(i.value),u=(0,r.useTemplateRef)(`form-item-reference`),d=(0,r.computed)(()=>!u.value?.validationErrored),f=e=>{l.value=e,a(`update:value`,e,i.index,c)},p=e=>{ve(e),(e.key===`Enter`||e.code===`Enter`)&&!i.isLastLine&&(e.preventDefault(),e.stopPropagation())},m=()=>{s.value?.select()};return(0,r.watch)(()=>i.value,e=>{l.value=e}),(0,r.onMounted)(()=>{i.autoFocus&&(0,r.nextTick)(()=>{m()})}),t({isValid:d,formItemReference:u}),(t,n)=>{let i=lr,s=or;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NFormItem),{ref:`form-item-reference`,path:e.path,label:`Полоса №${e.index+1}, мм`,class:`sc-hide-empty-feedback-message`},{feedback:(0,r.withCtx)(()=>[d.value?((0,r.openBlock)(),(0,r.createBlock)(mr,{key:0,"is-product-searching":c.value,product:e.product,validation:e.validation.product},null,8,[`is-product-searching`,`product`,`validation`])):(0,r.createCommentVNode)(``,!0)]),default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NDropdown),{trigger:`click`,options:e.suggestionOption,placement:`bottom-start`,size:`large`,onSelect:f},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{ref:`width-input-element`,value:l.value??null,class:`w-full`,"show-button":!1,parse:(0,r.unref)(be),placeholder:`Введите ширину`,onKeydown:p,onInput:n[0]||=t=>(0,r.unref)(xe)(e.validation,`linesWidths.${e.index}`),onFocus:(0,r.unref)(Se),"onUpdate:value":f},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`options`]),(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:e.addLineButtonDisabled,size:`medium`,class:`ml-2`,onClick:n[1]||=t=>a(`click:add-line`,e.index)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1},8,[`disabled`]),(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:e.removeLineButtonDisabled,size:`medium`,class:`ml-2`,onClick:n[2]||=t=>a(`click:remove-line`,e.index)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s)]),_:1},8,[`disabled`])]),_:1},8,[`path`,`label`])}}}),rl={class:`my-2 flex w-full flex-col`},il={key:1},al={class:`text-lg font-semibold`},ol={class:`flex gap-3`},sl=(0,r.defineComponent)({__name:`strip-configurator-form`,props:{value:{},settings:{},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:[`update:value`,`update:params`,`submit`,`click:add-line`,`click:remove-line`],setup(e,{expose:t,emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`form-reference`),l=(0,r.useTemplateRef)(`line-items-reference`),u=(0,r.ref)((0,n.cloneDeep)(a.value)),d=(0,r.computed)(()=>{let e={length:[I.required,I.min(a.settings.minLength),I.max(a.settings.maxLength),I.step(a.settings.lengthStep),De.serverValidation(a.validation.length.feedback)],quantity:[I.required,I.min(1),De.serverValidation(a.validation.quantity.feedback)],marker:[De.serverValidation(a.validation.marker.feedback)]};return(0,n.forEach)(u.value,(t,n)=>{e[`configuratorParams.linesWidths.${n}`]=[I.required,I.min(a.settings.minLineWidth),I.step(a.settings.lineWidthStep),De.serverValidation(a.validation[`linesWidths.${n}`]?.feedback)]}),e}),f=(0,r.ref)(a.settings.canSetDopProdaga??!1),p=(0,r.computed)(()=>a.value[0].configuratorParams.linesWidths.reduce((e,t)=>(e??0)+(t??0),0)),m=(0,r.computed)(()=>a.settings.width-p.value),h=(0,r.computed)(()=>!a.value.some(({product:e})=>!e||e.isNewRec())),g=(0,r.computed)(()=>a.isSubmitProcessing||!h.value||m.value<=0||u.value.length>=a.settings.maxLinesCount||a.value.some(e=>e.product.isNewRec())),_=(0,r.computed)(()=>{let[e]=u.value;return!h.value||m.value!==0||!e?.length||e.length>a.settings.maxLength||e.length<a.settings.minLength||e.quantity===0}),v=(0,r.computed)(()=>e=>m.value===0?void 0:[{label:`${(m.value>0?`Остаток +`:`Излишек `)+m.value} мм.`,key:m.value+e}]),y=(0,r.computed)(()=>{let{length:e}=a.value[0];if(!e||p.value!==a.settings.width)return null;let t=(0,n.reduce)(a.value,(e,t)=>e+(t.product?.costRub||0),0);return F.formatMoney(t*a.value[0].quantity*e)}),b=(e,t,i)=>{u.value[t].product.id=-1;let{configuratorParams:a}=u.value[t];a.linesWidths[t]=e,x(`configuratorParams`,a),l.value?.at(t)?.formItemReference?.validate().catch(n.noop),(0,r.nextTick)(()=>{l.value?.at(t)?.isValid&&s(`update:params`,a,t,i)})},x=(e,t)=>{u.value.forEach(n=>{n[e]=t}),s(`update:value`,u.value)};return(0,r.watch)(()=>a.value,e=>{u.value=(0,n.cloneDeep)(e)},{deep:!0}),t({validate:c.value?.validate,formReference:c}),(t,n)=>{let i=o.NCheckbox;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:u.value[0],rules:d.value,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(u.value,(t,i)=>((0,r.openBlock)(),(0,r.createBlock)(nl,{key:i,ref_for:!0,ref:`line-items-reference`,value:t.configuratorParams?.linesWidths.at(i)??null,"auto-focus":(t.configuratorParams?.linesWidths.at(i)??0)===0,index:i,path:`configuratorParams.linesWidths.${i}`,product:t.product,settings:e.settings,validation:e.validation,"suggestion-option":v.value(t.configuratorParams?.linesWidths.at(i)??0),"add-line-button-disabled":m.value<=0||e.value.length>=e.settings.maxLinesCount||e.value.some(e=>e.product.isNewRec()),"remove-line-button-disabled":u.value.length===1,"is-last-line":i===u.value.length-1&&m.value===0,"onUpdate:value":b,"onClick:addLine":n[0]||=e=>s(`click:add-line`,e),"onClick:removeLine":n[1]||=e=>s(`click:remove-line`,e)},null,8,[`value`,`auto-focus`,`index`,`path`,`product`,`settings`,`validation`,`suggestion-option`,`add-line-button-disabled`,`remove-line-button-disabled`,`is-last-line`]))),128)),(0,r.createElementVNode)(`div`,rl,[m.value<0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NText),{key:0,type:`error`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Сумма ширин всех полос должна быть равна `+(0,r.toDisplayString)(e.settings.width),1)]),_:1})):(0,r.createCommentVNode)(``,!0),h.value&&u.value.length===e.settings.maxLinesCount&&m.value>0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NText),{key:1,type:`error`},{default:(0,r.withCtx)(()=>[...n[15]||=[(0,r.createTextVNode)(` Остаток резки должен быть равен 0 `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,null,[n[16]||=(0,r.createTextVNode)(` Остаток для резки: `,-1),(0,r.createVNode)((0,r.unref)(o.NText),{type:m.value>=0?`Success`:`error`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(m.value),1)]),_:1},8,[`type`]),(0,r.createTextVNode)(` из `+(0,r.toDisplayString)(e.settings.width)+` мм `,1)])]),(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:g.value,type:`primary`,class:`self-center`,onClick:n[2]||=e=>s(`click:add-line`,u.value.length)},{default:(0,r.withCtx)(()=>[...n[17]||=[(0,r.createTextVNode)(` Добавить полосу `,-1)]]),_:1},8,[`disabled`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`length`,label:`Метраж ${e.settings.minLength?` от `+e.settings.minLength:``} ${e.settings.maxLength?` до `+e.settings.maxLength:``} м.`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value[0].length,"onUpdate:value":[n[3]||=e=>u.value[0].length=e,n[6]||=e=>x(`length`,e)],parse:(0,r.unref)(be),"show-button":!1,placeholder:`Введите метраж`,class:`w-full`,onKeydown:n[4]||=e=>(0,r.unref)(ve)(e,!1),onInput:n[5]||=t=>(0,r.unref)(xe)(e.validation,`length`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`quantity`,label:`Количество`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value[0].quantity,"onUpdate:value":[n[7]||=e=>u.value[0].quantity=e,n[10]||=e=>x(`quantity`,e)],"show-button":!1,placeholder:`Введите количество`,class:`w-full`,onKeydown:n[8]||=e=>(0,r.unref)(ve)(e,!1),onInput:n[9]||=t=>(0,r.unref)(xe)(e.validation,`quantity`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:u.value[0].marker??null,placeholder:`Введите маркировку`,onInput:n[11]||=t=>(0,r.unref)(xe)(e.validation,`marker`),"onUpdate:value":n[12]||=e=>{u.value[0].marker=e??null,x(`marker`,e??null)},onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1}),f.value?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,checked:u.value[0].isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[13]||=e=>{u.value[0].isAdditionalSale=e??!1,x(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[18]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),y.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,il,[n[19]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,al,(0,r.toDisplayString)(y.value)+` ₽`,1)])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,ol,[(0,r.createVNode)((0,r.unref)(o.NButton),{loading:e.isSubmitProcessing,disabled:_.value,type:`primary`,class:`self-start`,onClick:n[14]||=e=>s(`submit`,u.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(u.value[0].isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`])])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>s(`submit`,u.value)]])}}}),cl={class:`flex grow flex-col`},ll=[`src`],ul={class:`w-full`},dl=(0,r.defineComponent)({__name:`strip-configurator-preview`,props:{value:{},settings:{}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,cl,[(0,r.createElementVNode)(`img`,{src:`/img/configurators/strip/strip-`+e.value.length+`.png`,class:`w-full max-w-96 self-center py-5`,alt:`Штрипс`},null,8,ll),(0,r.createElementVNode)(`div`,ul,[(0,r.createTextVNode)(` Число полос можно указать от `+(0,r.toDisplayString)(e.settings.minLinesCount)+` до `+(0,r.toDisplayString)(e.settings.maxLinesCount)+`. `,1),n[0]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Минимальная ширина полосы `+(0,r.toDisplayString)(e.settings.minLineWidth)+` мм. `,1),n[1]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Ширина всех полос `+(0,r.toDisplayString)(e.settings.width)+` мм. `,1),n[2]||=(0,r.createElementVNode)(`br`,null,null,-1),(0,r.createTextVNode)(` Шаг ширины полосы - `+(0,r.toDisplayString)(e.settings.lineWidthStep)+` мм. `,1)])]))}}),fl={class:`flex flex-col gap-2`},pl={class:`flex grow flex-col px-5 md:w-104`},ml=(0,r.defineComponent)({__name:`strip-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`strip-configurator-form`),l=(0,r.ref)(a.cartItems),u=(0,r.ref)({width:{},length:{},quantity:{},marker:{}}),d=(0,r.ref)(!1),f=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,300)),p=(0,r.computed)(()=>l.value[0].configuratorParams?.linesWidths.reduce((e,t)=>(e??0)+(t??0),0)),m=e=>{e===void 0&&(e=l.value.length-1);let n=l.value.at(0);if(!n)return;n.configuratorParams.linesWidths=n.configuratorParams.linesWidths.toSpliced(e+1,0,null),l.value.forEach(e=>{e.configuratorParams.linesWidths=n.configuratorParams.linesWidths});let r=new t.OrderItemBase({quantity:n?.quantity??1,category:n?.category,length:n?.length??a.settings.minLength,marker:n?.marker,configuratorParams:{linesWidths:n?.configuratorParams.linesWidths}});l.value=l.value.toSpliced(e+1,0,r)},h=e=>{let t=l.value.at(0);t&&(t.configuratorParams.linesWidths=t.configuratorParams.linesWidths.toSpliced(e,1),l.value.forEach(e=>{e.configuratorParams.linesWidths=t.configuratorParams.linesWidths}),l.value=l.value.toSpliced(e,1),delete u[`linesWidths.${e}`],delete u[`linesWidths.${e}`])},g=(0,n.debounce)(async(e,n,r)=>{let i={linesWidths:e.linesWidths.at(n)};r.value=!0,u.value[`linesWidths.${n}`]={},l.value[n].product=new t.ClientProduct,a.eventEmitter.emit(`configurator:search-product`,{category:l.value[n].category,params:i,validationFieldResultData:u.value,callback:e=>{e?(l.value[n].product=e,n===l.value.length-1&&l.value.length<a.settings.maxLinesCount&&p.value&&p.value<a.settings.width&&m()):(l.value[n].product=new t.ClientProduct,u.value[`linesWidths.${n}`]={showFeedback:!0,feedback:`Не удалось найти товар`,validationStatus:`error`},r.value=!1),r.value=!1}})},f.value),_=async()=>{c.value?.formReference?.validate(e=>{if(!e){d.value=!0;let e=l.value.at(0);if(!e)return;s(`submit`,e,u.value,()=>{d.value=!1,(0,r.nextTick)(()=>{c.value?.formReference?.restoreValidation()})})}}).catch(n.noop)};return(0,r.watch)(()=>a.cartItems,e=>{l.value=e.map(e=>new t.OrderItemBase(e))}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,fl,[e.settings.allowShowTable?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-center`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,pl,[(0,r.createVNode)(dl,{value:l.value,"onUpdate:value":n[1]||=e=>l.value=e,settings:e.settings},null,8,[`value`,`settings`]),(0,r.createVNode)(sl,{ref:`strip-configurator-form`,value:l.value,"onUpdate:value":n[2]||=e=>l.value=e,validation:u.value,settings:e.settings,"is-submit-processing":d.value,"onUpdate:params":(0,r.unref)(g),onSubmit:_,"onClick:addLine":m,"onClick:removeLine":h},null,8,[`value`,`validation`,`settings`,`is-submit-processing`,`onUpdate:params`])])])}}}),hl={class:`flex flex-col gap-3`},gl=(0,r.defineComponent)({__name:`metal-for-doors-configurator-form`,props:{value:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:[`update:value`,`update:params`,`submit`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useTemplateRef)(`form-reference`),u=(0,r.useTemplateRef)(`first-input-element`),d=(0,r.ref)((0,n.cloneDeep)(s.value)),f=(0,r.computed)(()=>({"configuratorParams.width":[I.required,I.min(s.settings.minWidth),...s.settings.maxWidth?[I.max(s.settings.maxWidth)]:[],I.step(1),De.serverValidation(s.validation.width.feedback)],"configuratorParams.length":[I.required,I.min(s.settings.minLength),I.max(s.settings.maxLength),I.step(1),De.serverValidation(s.validation.length.feedback)],quantity:[I.required,I.min(1),I.step(1),De.serverValidation(s.validation.quantity.feedback)],marker:[De.serverValidation(s.validation.marker.feedback)]})),p=(0,r.ref)(s.settings.canSetDopProdaga??!1),m=()=>{c(`update:params`,d.value.configuratorParams),h(`configuratorParams`,d.value.configuratorParams)},h=(e,n)=>{let r=new t.OrderItemBase(s.value);r[e]=n,e===`configuratorParams`&&(r.product=new t.ClientProduct),c(`update:value`,r)},g=()=>{u.value?.select()};return(0,r.watch)(()=>s.value,e=>{d.value=(0,n.cloneDeep)(e)},{deep:!0}),(0,r.onMounted)(()=>{s.value.isNewRec()&&(0,r.nextTick)(()=>{g()})}),i({validate:l.value?.validate,formReference:l}),(t,n)=>{let i=o.NCheckbox;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:d.value,rules:f.value,disabled:e.isSubmitProcessing,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.width`,label:`Ширина, ${e.settings.minWidth?` от `+e.settings.minWidth:``}${e.settings.maxWidth?` до `+e.settings.maxWidth:``} мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{ref:`first-input-element`,value:d.value.configuratorParams.width,"onUpdate:value":[n[0]||=e=>d.value.configuratorParams.width=e,m],class:`w-full`,parse:(0,r.unref)(be),"show-button":!1,placeholder:`Введите ширину`,onKeydown:n[1]||=e=>(0,r.unref)(ve)(e),onInput:n[2]||=t=>(0,r.unref)(xe)(e.validation,`width`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.length`,label:`Длина, ${e.settings.minLength?` от `+e.settings.minLength:``}${e.settings.maxLength?` до `+e.settings.maxLength:``} мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:d.value.configuratorParams.length,"onUpdate:value":[n[3]||=e=>d.value.configuratorParams.length=e,m],placeholder:`Введите длину`,parse:(0,r.unref)(be),"show-button":!1,class:`w-full`,onKeydown:n[4]||=e=>(0,r.unref)(ve)(e),onInput:n[5]||=t=>(0,r.unref)(xe)(e.validation,`length`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`parse`,`onFocus`])]),_:1},8,[`label`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`quantity`,label:`Количество`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:e.value.quantity,placeholder:`Введите количество`,min:1,"show-button":!1,class:`w-full`,onKeydown:n[6]||=e=>(0,r.unref)(ve)(e,!1),onInput:n[7]||=t=>(0,r.unref)(xe)(e.validation,`quantity`),"onUpdate:value":n[8]||=e=>h(`quantity`,e??0),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1}),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:e.value.marker??null,placeholder:`Введите маркировку`,onInput:n[9]||=t=>(0,r.unref)(xe)(e.validation,`marker`),"onUpdate:value":n[10]||=e=>h(`marker`,e??null),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1}),p.value?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,checked:d.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[11]||=e=>{d.value.isAdditionalSale=e??!1,h(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[13]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(mr,{"is-product-searching":e.isProductSearching,product:e.value.product,validation:e.validation.product},null,8,[`is-product-searching`,`product`,`validation`]),(0,r.createElementVNode)(`div`,hl,[(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:e.value.product.isNewRec()||e.isProductSearching||e.isSubmitProcessing||e.value.length===0||e.value.width===0||e.value.quantity===0,type:`primary`,class:`self-start`,onClick:n[12]||=t=>c(`submit`,e.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.value.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`disabled`])])]),_:1},8,[`model`,`rules`,`disabled`])),[[(0,r.unref)(T),()=>c(`submit`,d.value)]])}}}),_l={class:`flex flex-col gap-2 w-72`},vl=(0,r.defineComponent)({__name:`metal-for-doors-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`metal-for-doors-configurator-form`),l=(0,r.ref)(a.cartItem),u=(0,r.ref)({width:{},length:{},quantity:{},marker:{}}),d=(0,r.ref)(!1),f=(0,r.ref)(!1),p=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,300)),m=(0,n.debounce)(async e=>{l.value.product=new t.ClientProduct,c.value?.formReference?.validate(t=>{t||(d.value=!0,a.eventEmitter.emit(`configurator:search-product`,{category:a.cartItem.category,params:e,validationFieldResultData:u.value,callback:e=>{e?l.value.product=e:u.value.product={showFeedback:!0,feedback:`Не удалось найти товар по указанным параметрам.`,validationStatus:`error`},d.value=!1}}))}).catch(n.noop)},p.value),h=async()=>{c.value?.formReference?.validate(e=>{e||(f.value=!0,s(`submit`,l.value,u.value,()=>{f.value=!1,(0,r.nextTick)(()=>{c.value?.formReference?.restoreValidation()})}))}).catch(n.noop)};return(0,r.watch)(()=>a.cartItem,e=>{l.value=new t.OrderItemBase(e)},{deep:!0}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,_l,[e.settings.allowShowTable?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-center`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[4]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(gl,{ref:`metal-for-doors-configurator-form`,value:l.value,"onUpdate:value":n[1]||=e=>l.value=e,validation:u.value,settings:e.settings,"is-submit-processing":f.value,"is-product-searching":d.value,"onUpdate:params":n[2]||=e=>(0,r.unref)(m)(e),onSubmit:n[3]||=e=>h()},null,8,[`value`,`validation`,`settings`,`is-submit-processing`,`is-product-searching`])])}}}),yl={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function bl(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,yl,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M256 112v288m144-144H112`},null,-1)]])}var xl=(0,r.markRaw)({name:`ion-add`,render:bl}),Sl={key:0,class:`-mt-1 text-sm text-gray-500`},Cl={class:`font-bold`},wl={class:`flex flex-col gap-3`},Tl={key:0,class:`mt-4 flex flex-col gap-1.5`},El={class:`flex flex-col gap-1 text-sm text-gray-700`},Dl={key:0},Ol={key:1},kl={"form-array-name":`items`,class:`flex flex-col gap-3`},Al={class:`grid grow grid-cols-1 items-start gap-2 sm:grid-cols-3`},jl={key:0,class:`flex flex-wrap items-end gap-2`},Ml={class:`whitespace-nowrap text-xl font-bold`},Nl={key:0,class:`whitespace-nowrap text-lg text-gray-500`},Pl={class:`font-bold`},Fl={class:`font-bold`},Il={class:`flex gap-3`},Ll=(0,r.defineComponent)({__name:`sandwich-configurator-form`,props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0}},emits:[`update:value`,`update:params`,`submit`,`add-item`,`remove-item`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useTemplateRef)(`form-reference`),u=(0,r.ref)((0,n.cloneDeep)(s.value)),d=(0,r.ref)({...s.validation}),f=e=>{delete d.value[e],l.value?.restoreValidation()};(0,r.watch)(()=>s.validation,e=>{d.value={...e},Object.values(e).some(e=>e?.feedback)&&(0,r.nextTick)(()=>l.value?.validate(n.noop).catch(n.noop))},{deep:!0});let p=(0,r.computed)(()=>s.value.category),m=(0,r.ref)(null),h=(0,r.ref)(null),g=(0,r.computed)(()=>p.value.products??[]),_=(0,r.computed)(()=>g.value.map(e=>({label:e.name,value:e.id}))),v=(e,t,n)=>{let r=e!=null&&e>0,i=t!=null&&t>0;return!r&&!i?null:r&&i?`от ${e} ${n} до ${t} ${n}`:r?`от ${e} ${n}`:`до ${t} ${n}`},y=(0,r.computed)(()=>v(s.settings.minWidth,m.value?.properties?.width,`мм`)),b=(0,r.computed)(()=>v(s.settings.minLength,m.value?.properties?.length,`мм`)),x=(0,r.ref)(null),S=(0,r.ref)(!1),C=(0,r.computed)(()=>{let e={marker:[De.serverValidation(d.value.marker?.feedback)]};return u.value.configuratorParams.items.forEach((t,n)=>{e[`configuratorParams.items.${n}.width`]=[I.required,I.min(s.settings.minWidth),...m.value?.properties?.width?[I.max(m.value.properties.width)]:[],I.step(1),De.serverValidation(d.value[`items.${n}.width`]?.feedback)],e[`configuratorParams.items.${n}.length`]=[I.required,I.min(s.settings.minLength),...m.value?.properties?.length?[I.max(m.value.properties.length)]:[],I.step(1),De.serverValidation(d.value[`items.${n}.length`]?.feedback)],e[`configuratorParams.items.${n}.count`]=[I.required,I.min(1),I.step(1),De.serverValidation(d.value[`items.${n}.count`]?.feedback)]}),e}),w=(0,r.ref)(s.settings.canSetDopProdaga??!1),E=(0,r.computed)(()=>u.value.configuratorParams.items.some(e=>!m.value||!e.width||e.width<s.settings.minWidth||e.width>(m.value.properties?.width??0)||e.length===0||e.length<s.settings.minLength||e.length>(m.value.properties?.length??0)||!e.count||e.count<1)),D=(0,r.computed)(()=>!m.value||E.value||u.value.configuratorParams.items.length===0),O=(0,r.ref)(null),k=(0,r.computed)(()=>O.value===null?``:F.formatMoney(O.value)),A=e=>{if(!e){m.value=null,h.value=null,u.value.product=new t.ClientProduct,x.value=null;return}let n=g.value.find(t=>t.id===e);n&&(m.value=n,h.value=e,u.value.product=n,N(`product`,u.value.product),u.value.configuratorParams.items.forEach(e=>{n.properties?.width&&e.width>n.properties.width&&(e.width=n.properties.width),n.properties?.length&&e.length>n.properties.length&&(e.length=n.properties.length)}),te())},ee=!1,te=()=>{ee=!0,x.value=null,O.value=null,u.value.configuratorParams.calculationId=``,u.value.quantity=0},ne=async()=>{!m.value||u.value.configuratorParams.items.length===0||E.value?te():l.value?.validate(e=>{e?te():(S.value=!0,!m.value||!p.value?(te(),S.value=!1):s.eventEmitter.emit(`configurator:calculate`,{category:p.value,params:{productId:m.value.id,items:u.value.configuratorParams.items},callback:e=>{e?(x.value=e,u.value.configuratorParams.calculationId=e.id,u.value.quantity=e.quantity,(0,r.nextTick)(()=>{N(`quantity`,e.quantity)})):(u.value.configuratorParams.calculationId=``,u.value.quantity=0,te()),N(`configuratorParams`,u.value.configuratorParams),j(),S.value=!1}}))}).catch(()=>{te(),S.value=!1})},j=()=>{if(!m.value?.costRub||!x.value){O.value=null;return}let e=x.value.quantity*m.value.costRub;O.value=F.roundMoney(e)},M=e=>{let t=u.value.configuratorParams.items[e];m.value&&(m.value.properties?.width&&t.width>m.value.properties.width&&(t.width=m.value.properties.width),m.value.properties?.length&&t.length>m.value.properties.length&&(t.length=m.value.properties.length)),N(`configuratorParams`,u.value.configuratorParams),te()},re=()=>{u.value.configuratorParams.calculationId=``,u.value.configuratorParams.items.push({width:0,length:0,count:1}),N(`configuratorParams`,u.value.configuratorParams),te(),c(`add-item`,u.value.configuratorParams.items.length)},ie=e=>{u.value.configuratorParams.items.splice(e,1),N(`configuratorParams`,u.value.configuratorParams),te(),c(`remove-item`,e)},ae=()=>{D.value||S.value||s.isSubmitProcessing||(x.value?c(`submit`,u.value):ne())},N=(e,n)=>{let r=new t.OrderItemBase(s.value);r[e]=n,c(`update:value`,r)};(0,r.watch)(()=>s.value,e=>{let t=(0,n.cloneDeep)((0,r.toRaw)(e));(!t.configuratorParams.items||t.configuratorParams.items.length===0)&&(t.configuratorParams.items=[{width:0,length:0,count:1}]),u.value=t,s.value.product&&!s.value.product.isNewRec()&&(m.value=s.value.product,h.value=s.value.product.id),s.value.product.isNewRec()&&(m.value=null,h.value=null),ee?ee=!1:P()},{deep:!0});let P=()=>{let{calculationId:e}=u.value.configuratorParams,t=u.value.quantity??0;e&&t>0&&u.value.product&&!u.value.product.isNewRec()&&(x.value={id:e,quantity:t,sheets:[]},j())};return(0,r.onMounted)(()=>{s.value.product&&!s.value.product.isNewRec()&&(m.value=s.value.product,h.value=s.value.product.id),P()}),i({validate:l.value?.validate,formReference:l}),(t,n)=>{let i=or,a=xl;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:u.value,rules:C.value,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Товар`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:h.value,"onUpdate:value":[n[0]||=e=>h.value=e,A],options:_.value,placeholder:`Выберите материал`,filterable:``},null,8,[`value`,`options`])]),_:1}),m.value?.costRub==null?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Sl,[(0,r.createElementVNode)(`span`,Cl,(0,r.toDisplayString)(m.value.code),1),(0,r.createTextVNode)(` — `+(0,r.toDisplayString)((0,r.unref)(F).formatMoney(m.value.costRub))+` `+(0,r.toDisplayString)(m.value.currency.symbol)+`/шт. `,1)])),(0,r.createElementVNode)(`div`,wl,[m.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Tl,[n[7]||=(0,r.createElementVNode)(`div`,{class:`w-full font-bold`},`Размеры изделий`,-1),(0,r.createElementVNode)(`div`,El,[y.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Dl,`Ширина `+(0,r.toDisplayString)(y.value)+`.`,1)):(0,r.createCommentVNode)(``,!0),b.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ol,`Длина `+(0,r.toDisplayString)(b.value)+`.`,1)):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,kl,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(u.value.configuratorParams.items,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:t,class:`flex grow gap-2`},[(0,r.createElementVNode)(`div`,Al,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.items.${t}.width`,label:`Ширина, мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value.configuratorParams.items[t].width,"onUpdate:value":[e=>u.value.configuratorParams.items[t].width=e,e=>M(t)],parse:(0,r.unref)(be),"show-button":!1,disabled:!m.value,placeholder:`Ширина`,class:`w-full`,onKeydown:n[1]||=e=>(0,r.unref)(ve)(e),onInput:e=>f(`items.${t}.width`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.items.${t}.length`,label:`Длина, мм`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value.configuratorParams.items[t].length,"onUpdate:value":[e=>u.value.configuratorParams.items[t].length=e,e=>M(t)],parse:(0,r.unref)(be),"show-button":!1,disabled:!m.value,placeholder:`Длина`,class:`w-full`,onKeydown:n[2]||=e=>(0,r.unref)(ve)(e),onInput:e=>f(`items.${t}.length`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`configuratorParams.items.${t}.count`,label:`Количество, шт`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:u.value.configuratorParams.items[t].count,"onUpdate:value":[e=>u.value.configuratorParams.items[t].count=e,e=>M(t)],parse:(0,r.unref)(be),"show-button":!1,disabled:!m.value,placeholder:`Количество`,class:`w-full`,onKeydown:n[3]||=e=>(0,r.unref)(ve)(e,!1),onInput:e=>f(`items.${t}.count`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`])]),(0,r.createVNode)((0,r.unref)(o.NButton),{disabled:!m.value||u.value.configuratorParams.items.length<=1,type:`error`,size:`medium`,class:`mt-5`,onClick:e=>ie(t)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1},8,[`disabled`,`onClick`])]))),128))]),m.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:1,disabled:E.value,type:`default`,class:`self-center`,onClick:re},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a),n[8]||=(0,r.createTextVNode)(` Добавить изделие `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0)]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`marker`,label:`Маркировка распила`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:u.value.marker??null,disabled:!m.value,placeholder:`Введите маркировку распила`,onInput:n[4]||=e=>f(`marker`),"onUpdate:value":n[5]||=e=>N(`marker`,e??null),onFocus:(0,r.unref)(Se)},null,8,[`value`,`disabled`,`onFocus`])]),_:1}),w.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NCheckbox),{key:1,checked:u.value.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[6]||=e=>{u.value.isAdditionalSale=e??!1,N(`isAdditionalSale`,e??!1)}},{default:(0,r.withCtx)(()=>[...n[9]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)((0,r.unref)(o.NSpin),{show:S.value,size:`small`,class:`grow`},{default:(0,r.withCtx)(()=>[x.value&&m.value&&O.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,jl,[(0,r.createElementVNode)(`div`,null,[n[10]||=(0,r.createTextVNode)(` Итого: `,-1),(0,r.createElementVNode)(`span`,Ml,(0,r.toDisplayString)(k.value)+` `+(0,r.toDisplayString)(m.value.currency.symbol),1)]),x.value.quantity&&m.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Nl,[(0,r.createElementVNode)(`span`,Pl,`(`+(0,r.toDisplayString)(x.value.quantity)+` шт.`,1),n[11]||=(0,r.createTextVNode)(` x `,-1),(0,r.createElementVNode)(`span`,Fl,(0,r.toDisplayString)((0,r.unref)(F).formatMoney(m.value.costRub))+` `+(0,r.toDisplayString)(m.value.currency.symbol)+`/шт.)`,1)])):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`show`]),(0,r.createElementVNode)(`div`,Il,[x.value&&!S.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,loading:e.isSubmitProcessing,disabled:D.value||S.value,type:`primary`,class:`self-start`,onClick:ae},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(u.value.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`])):((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:1,loading:S.value,disabled:D.value||S.value,type:`info`,class:`self-start`,onClick:ne},{default:(0,r.withCtx)(()=>[...n[12]||=[(0,r.createTextVNode)(` Рассчитать `,-1)]]),_:1},8,[`loading`,`disabled`]))])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),ae]])}}}),Rl={class:`flex flex-col gap-2`},zl={class:`w-104 flex grow flex-col px-5`},Bl=(0,r.defineComponent)({__name:`sandwich-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItem:{}},emits:[`submit`,`click:view-switch`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`sandwich-configurator-form`),l=(0,r.ref)(a.cartItem),u=(0,r.ref)({width:{},length:{},quantity:{},marker:{},product:{}}),d=(0,r.ref)(!1),f=async()=>{c.value?.formReference?.validate(e=>{if(!e){d.value=!0;let e=(0,n.cloneDeep)(l.value);`items`in e.configuratorParams&&delete e.configuratorParams.items,s(`submit`,e,u.value,()=>{d.value=!1,(0,r.nextTick)(()=>{c.value?.formReference?.restoreValidation()})})}}).catch(n.noop)},p=e=>{u.value[`items.${e}.width`]={},u.value[`items.${e}.length`]={},u.value[`items.${e}.count`]={}},m=e=>{delete u.value[`items.${e}.width`],delete u.value[`items.${e}.length`],delete u.value[`items.${e}.count`]};return(0,r.onMounted)(()=>{a.cartItem.configuratorParams.items.forEach((e,t)=>{u.value[`items.${t}.width`]={},u.value[`items.${t}.length`]={},u.value[`items.${t}.count`]={}})}),(0,r.watch)(()=>a.cartItem,e=>{l.value=new t.OrderItemBase(e)},{deep:!0}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Rl,[e.settings.allowShowTable&&l.value.isNewRec()?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-center`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,zl,[(0,r.createVNode)(Ll,{ref:`sandwich-configurator-form`,value:l.value,"onUpdate:value":n[1]||=e=>l.value=e,validation:u.value,settings:e.settings,"event-emitter":e.eventEmitter,"is-submit-processing":d.value,onSubmit:f,onAddItem:p,onRemoveItem:m},null,8,[`value`,`validation`,`settings`,`event-emitter`,`is-submit-processing`])])])}}}),Vl={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Hl(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Vl,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M416 128L192 384l-96-96`},null,-1)]])}var Ul=(0,r.markRaw)({name:`ion-checkmark`,render:Hl}),Wl={key:0,class:`-mt-1 text-sm text-gray-500`},Gl={class:`font-bold`},Kl={class:`flex flex-col gap-3`},ql={key:0,class:`mt-4 mb-3 flex flex-col gap-1.5`},Jl={class:`flex flex-col gap-1 text-sm text-gray-700`},Yl={key:0},Xl={key:1},Zl={"form-array-name":`items`,class:`flex flex-col gap-3`},Ql={class:`min-w-0 flex-1`},$l={class:`relative flex flex-col gap-3 lg:!flex-row lg:!items-start lg:!gap-6`},eu={class:`grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!flex-[2]`},tu={class:`grid grid-cols-1 gap-2 sm:grid-cols-2 lg:!grid-cols-[1fr_2fr] lg:!flex-[3]`},nu={key:0,class:`pointer-events-none absolute bottom-2 right-3 flex h-8 w-8 items-center justify-center`},ru={class:`mt-1 flex flex-col gap-y-1 text-sm text-gray-500 lg:!flex-row lg:!gap-6`},iu={key:0,class:`lg:!flex-[2]`},au={class:`font-bold`},ou={key:1,class:`lg:!flex-[3]`},su={class:`font-bold`},cu={key:1,class:`min-w-0 flex flex-col items-end gap-1 text-right text-sm text-gray-700 border-t border-gray-200 pt-2`},lu={key:0},uu={class:`font-bold`},du={key:1},fu={class:`font-bold`},pu={class:`flex flex-wrap items-center gap-3`},mu=(0,r.defineComponent)({__name:`sandwich-m2-configurator-form`,props:{value:{},eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{},settings:{},isProductSearching:{type:Boolean,default:!1},isSubmitProcessing:{type:Boolean,default:!1},validation:{default:void 0},itemStates:{default:()=>[]}},emits:[`submit`,`update:value`,`add-item`,`remove-item`,`item-reset`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useTemplateRef)(`form-reference`),u=(0,r.useTemplateRef)(`widthInputs`),d=s.value==null?[]:(0,n.cloneDeep)((0,r.toRaw)(s.value)),f=(0,r.ref)(d.map(e=>new t.OrderItemBase(e))),p=(0,r.computed)(()=>({items:f.value})),m=(0,r.ref)({...s.validation}),h=e=>{delete m.value[e],l.value?.restoreValidation()},g=(0,r.ref)(null),_=(0,r.ref)(null),v=(0,r.computed)(()=>f.value[0]?.category?.products??[]),y=(0,r.computed)(()=>v.value.map(e=>({label:e.name,value:e.id}))),b=(e,t,n)=>{let r=e!=null&&e>0,i=t!=null&&t>0;return!r&&!i?null:r&&i?`от ${e} ${n} до ${t} ${n}`:r?`от ${e} ${n}`:`до ${t} ${n}`},x=(0,r.computed)(()=>b(s.settings.minWidth,g.value?.properties?.width,`мм`)),S=(0,r.computed)(()=>b(s.settings.minLength,g.value?.properties?.length,`мм`)),C=(0,r.computed)(()=>{let e={};return f.value.forEach((t,n)=>{e[`items.${n}.configuratorParams.width`]=[I.required,I.min(s.settings.minWidth),...g.value?.properties?.width?[I.max(g.value.properties.width)]:[],I.step(1),De.serverValidation(m.value[`items.${n}.width`]?.feedback)],e[`items.${n}.configuratorParams.length`]=[I.required,I.min(s.settings.minLength),...g.value?.properties?.length?[I.max(g.value.properties.length)]:[],I.step(1),De.serverValidation(m.value[`items.${n}.length`]?.feedback)],e[`items.${n}.quantity`]=[I.required,I.min(1),I.step(1),De.serverValidation(m.value[`items.${n}.quantity`]?.feedback)],e[`items.${n}.marker`]=[De.serverValidation(m.value[`items.${n}.marker`]?.feedback)]}),e});(0,r.watch)(()=>s.validation,e=>{m.value={...e},Object.values(e).some(e=>e?.feedback)&&(0,r.nextTick)(()=>l.value?.validate(n.noop).catch(n.noop))},{deep:!0});let w=(0,r.ref)(s.settings.canSetDopProdaga??!1),E=(0,r.computed)(()=>{let e=g.value;return!e||f.value.some(t=>{let n=t.configuratorParams,r=e.properties?.width,i=e.properties?.length;return n.width===0||n.width<s.settings.minWidth||r!=null&&n.width>r||n.length===0||n.length<s.settings.minLength||i!=null&&n.length>i||t.quantity===0||t.quantity<1})}),D=(0,r.computed)(()=>!g.value||E.value||f.value.length===0),O=(0,r.computed)(()=>{let e=f.value[0];return e!=null&&!e.isNewRec()}),k=e=>s.itemStates[e]??`idle`,A=e=>k(e)===`success`,ee=e=>k(e)===`loading`,te=(0,r.computed)(()=>f.value.length===0||f.value.every((e,t)=>{let n=k(t);return n===`success`||n===`loading`})),ne=e=>e.width===0||e.length===0?0:e.width*e.length/1e6,j=e=>F.formatArea(ne(e)),M=e=>{let t=e.configuratorParams,n=ne(t),r=g.value?.costRub??0,i=e.quantity??0;return!n||!i?0:F.roundMoney(n*r*i)},re=(0,r.computed)(()=>(0,n.sum)(f.value.map(e=>{let t=e.configuratorParams;return!t.width||t.length===0||!e.quantity?0:t.width*t.length*e.quantity/1e6}))),ie=(0,r.computed)(()=>F.roundMoney((0,n.sum)(f.value.map(e=>M(e))))),ae=()=>new t.OrderItemBase({category:f.value[0]?.category,configurator:f.value[0]?.configurator,product:g.value??new t.ClientProduct,quantity:1,isAdditionalSale:f.value[0]?.isAdditionalSale,configuratorParams:{width:0,length:0}}),N=e=>{if(!e){g.value=null,_.value=null,f.value.forEach(e=>{e.product=new t.ClientProduct}),c(`update:value`,f.value);return}let n=v.value.find(t=>t.id===e);n&&(g.value=n,_.value=e,f.value.forEach((e,t)=>{e.product=n,n.properties?.width&&e.configuratorParams.width>n.properties.width&&(e.configuratorParams.width=n.properties.width),n.properties?.length&&e.configuratorParams.length>n.properties.length&&(e.configuratorParams.length=n.properties.length),c(`item-reset`,t)}),c(`update:value`,f.value))},P=e=>{let t=f.value[e],n=g.value;n&&(n.properties?.width&&t.configuratorParams.width>n.properties.width&&(t.configuratorParams.width=n.properties.width),n.properties?.length&&t.configuratorParams.length>n.properties.length&&(t.configuratorParams.length=n.properties.length)),c(`item-reset`,e),c(`update:value`,f.value)},oe=(e,t)=>{f.value[e].marker=t===null||t===``?void 0:t,c(`item-reset`,e),c(`update:value`,f.value)},se=e=>{f.value.forEach(t=>{t.isAdditionalSale=e}),c(`update:value`,f.value)},ce=()=>{f.value.push(ae()),c(`update:value`,f.value),c(`add-item`,f.value.length),(0,r.nextTick)(()=>{let e=f.value.length-1;u.value?.[e]?.focus(),u.value?.[e]?.select()})},le=e=>{f.value.splice(e,1),c(`update:value`,f.value),c(`remove-item`,e)};(0,r.watch)(()=>s.value,e=>{let i=(e==null?[]:(0,n.cloneDeep)((0,r.toRaw)(e))).map(e=>new t.OrderItemBase(e));f.value=i.length>0?i:[ae()];let a=f.value[0]?.product;a&&!a.isNewRec()?(g.value=a,_.value=a.id):(g.value=null,_.value=null)},{deep:!0});let ue=()=>{if(g.value!==null)return;let e=v.value[0]?.id;e!=null&&N(e)};return(0,r.watch)(v,()=>{ue()}),(0,r.onMounted)(()=>{f.value.length===0&&(f.value=[ae()]);let e=f.value[0]?.product;e&&!e.isNewRec()&&(g.value=e,_.value=e.id),ue()}),i({validate:l.value?.validate,formReference:l}),(t,n)=>{let i=Ul,a=or,s=xl;return(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{ref:`form-reference`,model:p.value,rules:C.value,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NFormItem),{required:!0,"show-feedback":!1,label:`Товар`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NSelect),{value:_.value,"onUpdate:value":[n[0]||=e=>_.value=e,N],options:y.value,placeholder:`Выберите материал`,filterable:``},null,8,[`value`,`options`])]),_:1}),g.value?.costRub==null?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Wl,[(0,r.createElementVNode)(`span`,Gl,(0,r.toDisplayString)(g.value.code),1),(0,r.createTextVNode)(` — `+(0,r.toDisplayString)((0,r.unref)(F).formatMoney(g.value.costRub))+` `+(0,r.toDisplayString)(g.value.currency.symbol)+`/м² `,1)])),(0,r.createElementVNode)(`div`,Kl,[g.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ql,[n[6]||=(0,r.createElementVNode)(`div`,{class:`w-full font-bold`},`Размеры изделий`,-1),(0,r.createElementVNode)(`div`,Jl,[x.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Yl,`Ширина `+(0,r.toDisplayString)(x.value)+`.`,1)):(0,r.createCommentVNode)(``,!0),S.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Xl,`Длина `+(0,r.toDisplayString)(S.value)+`.`,1)):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,Zl,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(p.value.items,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:t,class:(0,r.normalizeClass)([`flex min-w-0 items-start gap-2 border-b border-gray-100 last:border-0`,A(t)?`opacity-70`:``])},[(0,r.createElementVNode)(`div`,Ql,[(0,r.createElementVNode)(`div`,$l,[(0,r.createElementVNode)(`div`,eu,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`items.${t}.configuratorParams.width`,label:`Ширина, мм`,class:`min-w-0`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{ref_for:!0,ref:`widthInputs`,value:p.value.items[t].configuratorParams.width,"onUpdate:value":[e=>p.value.items[t].configuratorParams.width=e,e=>P(t)],parse:(0,r.unref)(be),"show-button":!1,disabled:!g.value||A(t)||ee(t),placeholder:`Ширина`,class:`w-full`,onKeydown:n[1]||=e=>(0,r.unref)(ve)(e),onInput:e=>h(`items.${t}.width`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`items.${t}.configuratorParams.length`,label:`Длина, мм`,class:`min-w-0`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:p.value.items[t].configuratorParams.length,"onUpdate:value":[e=>p.value.items[t].configuratorParams.length=e,e=>P(t)],parse:(0,r.unref)(be),"show-button":!1,disabled:!g.value||A(t)||ee(t),placeholder:`Длина`,class:`w-full`,onKeydown:n[2]||=e=>(0,r.unref)(ve)(e),onInput:e=>h(`items.${t}.length`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`])]),(0,r.createElementVNode)(`div`,tu,[(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`items.${t}.quantity`,label:`Количество, шт`,class:`min-w-0`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:p.value.items[t].quantity,"onUpdate:value":[e=>p.value.items[t].quantity=e,e=>P(t)],parse:(0,r.unref)(be),"show-button":!1,disabled:!g.value||A(t)||ee(t),placeholder:`Кол-во`,class:`w-full`,onKeydown:n[3]||=e=>(0,r.unref)(ve)(e,!1),onInput:e=>h(`items.${t}.quantity`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onUpdate:value`,`parse`,`disabled`,`onInput`,`onFocus`])]),_:2},1032,[`path`]),(0,r.createVNode)((0,r.unref)(o.NFormItem),{path:`items.${t}.marker`,label:`Маркировка`,class:`min-w-0`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:p.value.items[t].marker??null,disabled:!g.value||A(t)||ee(t),placeholder:`Маркировка`,class:`w-full`,onInput:e=>h(`items.${t}.marker`),"onUpdate:value":e=>oe(t,e??null),onFocus:(0,r.unref)(Se)},null,8,[`value`,`disabled`,`onInput`,`onUpdate:value`,`onFocus`])]),_:2},1032,[`path`])]),ee(t)||A(t)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,nu,[ee(t)?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSpin),{key:0,size:14})):A(t)?((0,r.openBlock)(),(0,r.createBlock)(i,{key:1,class:`text-green-600 text-xl`})):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,ru,[e.configuratorParams.width>0&&e.configuratorParams.length>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,iu,[n[7]||=(0,r.createTextVNode)(` Площадь (S) = `,-1),(0,r.createElementVNode)(`span`,au,(0,r.toDisplayString)(j(e.configuratorParams))+` м²`,1)])):(0,r.createCommentVNode)(``,!0),M(e)>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ou,[n[8]||=(0,r.createTextVNode)(` Итого: `,-1),(0,r.createElementVNode)(`span`,su,(0,r.toDisplayString)((0,r.unref)(F).formatMoney(M(e)))+` `+(0,r.toDisplayString)(g.value?.currency.symbol),1)])):(0,r.createCommentVNode)(``,!0)])]),O.value?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,disabled:ee(t)||p.value.items.length<=1,type:`error`,size:`medium`,class:`mt-5 shrink-0 lg:!ml-4`,onClick:e=>le(t)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`disabled`,`onClick`]))],2))),128))]),g.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,cu,[re.value>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,lu,[n[9]||=(0,r.createTextVNode)(` Общая площадь: `,-1),(0,r.createElementVNode)(`span`,uu,(0,r.toDisplayString)((0,r.unref)(F).formatArea(re.value))+` м²`,1)])):(0,r.createCommentVNode)(``,!0),ie.value>0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,du,[n[10]||=(0,r.createTextVNode)(` Итого: `,-1),(0,r.createElementVNode)(`span`,fu,(0,r.toDisplayString)((0,r.unref)(F).formatMoney(ie.value))+` `+(0,r.toDisplayString)(g.value.currency.symbol),1)])):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)]),w.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NCheckbox),{key:1,checked:f.value[0]?.isAdditionalSale??!1,"true-value":!0,"false-value":!1,"onUpdate:checked":n[4]||=e=>se(e??!1)},{default:(0,r.withCtx)(()=>[...n[11]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,pu,[g.value&&!O.value?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NButton),{key:0,disabled:E.value,type:`default`,onClick:ce},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s),n[12]||=(0,r.createTextVNode)(` Добавить изделие `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)((0,r.unref)(o.NButton),{loading:e.isSubmitProcessing,disabled:D.value||te.value,type:`primary`,class:`ml-auto`,onClick:n[5]||=e=>c(`submit`,f.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(f.value[0]?.isNewRec()?`В корзину`:`Изменить`),1)]),_:1},8,[`loading`,`disabled`])])]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>c(`submit`,f.value)]])}}}),hu={class:`flex flex-col gap-2`},gu={class:`min-w-56 max-w-3xl flex grow flex-col px-5`},_u=(0,r.defineComponent)({__name:`sandwich-m2-configurator`,props:{eventEmitter:{},showSlugs:{type:Boolean},showProperties:{type:Boolean},showProductCosts:{type:[Boolean,Function]},allowNameClick:{type:[Boolean,Function]},allowPriceClick:{type:[Boolean,Function]},showProductInfoButton:{type:[Boolean,Function]},showPriceHistory:{type:[Boolean,Function]},showCostDate:{type:[Boolean,Function]},isProductItemSelected:{type:Function},showProductAddToCartButton:{type:[Boolean,String,Function]},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function]},currencyRates:{},productContextButtonsConfig:{type:Function},settings:{},cartItems:{}},emits:[`click:view-switch`,`submit`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.useTemplateRef)(`sandwich-m2-configurator-form`),l=(0,r.ref)((a.cartItems??[]).map(e=>new t.OrderItemBase(e))),u=(0,r.ref)([]),d=(0,r.ref)({width:{},length:{},quantity:{},marker:{}}),f=[`width`,`length`,`quantity`,`marker`],p=e=>{f.forEach(t=>{d.value[`items.${e}.${t}`]={}})},m=e=>{f.forEach(t=>{delete d.value[`items.${e}.${t}`]})},h=(0,r.computed)(()=>u.value.includes(`loading`)),g=()=>({width:{},length:{},quantity:{},marker:{}}),_=(e,t)=>{let n=!1;return f.forEach(r=>{let i=`items.0.${r}`,a=e[r]?.feedback,o=e[i]?.feedback??a,s=`items.${t}.${r}`;o?(d.value[s]=e[i]??e[r],n=!0):d.value[s]={}}),n},v=(e,t,i)=>new Promise(a=>{let o=g(),l=!1,d=e=>{if(l)return;l=!0;let n=_(o,t),i=(e===void 0?!n:e)&&!n;u.value[t]=i?`success`:`error`,(0,r.nextTick)(()=>{c.value?.formReference?.restoreValidation()}),a(i)};u.value[t]=`loading`,s(`submit`,[(0,n.cloneDeep)(e)],o,d,{isFinalSuccessfulCompletion:i})}),y=async()=>{try{await c.value?.formReference?.validate()}catch{return}let e=l.value.map((e,t)=>t).filter(e=>{let t=u.value[e]??`idle`;return t!==`success`&&t!==`loading`}),t=!0;for(let n=0;n<e.length;n+=1){let r=e[n],i=l.value[r];if(!i)break;let a=n===e.length-1&&t;await v(i,r,a)||(t=!1)}},b=e=>{let t=e-1;u.value[t]=`idle`,p(t)},x=e=>{u.value.splice(e,1),m(e);for(let t=e;t<l.value.length;t+=1)p(t)},S=e=>{let t=u.value[e];(t===`success`||t===`error`)&&(u.value[e]=`idle`)};return(0,r.onMounted)(()=>{(a.cartItems??[]).forEach((e,t)=>{u.value[t]=`idle`,p(t)})}),(0,r.watch)(()=>a.cartItems,e=>{let n=(e??[]).map(e=>new t.OrderItemBase(e));l.value=n,u.value=n.map(()=>`idle`),n.forEach((e,t)=>{p(t)})},{deep:!0}),(t,n)=>{let i=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,hu,[e.settings.allowShowTable&&l.value[0]?.isNewRec()?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,type:`tertiary`,class:`self-center`,onClick:n[0]||=e=>s(`click:view-switch`)},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Показать в виде списка `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,gu,[(0,r.createVNode)(mu,{ref:`sandwich-m2-configurator-form`,value:l.value,"onUpdate:value":n[1]||=e=>l.value=e,validation:d.value,settings:e.settings,"event-emitter":e.eventEmitter,"is-submit-processing":h.value,"item-states":u.value,onSubmit:y,onAddItem:b,onRemoveItem:x,onItemReset:S},null,8,[`value`,`validation`,`settings`,`event-emitter`,`is-submit-processing`,`item-states`])])])}}}),vu={key:0,class:`flex justify-center p-4`},yu={key:1,class:`p-4 text-center text-red-500`},bu={key:2,class:`flex justify-center`},xu={class:`!bg-white p-4 m-2 rounded-md w-max`},Su={key:3,class:`p-4 text-center text-gray-500`},Cu=(0,r.defineComponent)({__name:`dynamic-configurator`,props:{eventEmitter:{},settings:{},editor:{},cartItem:{},cartItems:{},category:{}},setup(e){let i=e,a=(0,r.ref)(!1),s=(0,r.ref)(null),c=(0,r.ref)(i.cartItem??null),l=(0,r.ref)(i.cartItems??null),u=(0,r.ref)(i.editor===t.ConfiguratorsEnum.SandwichM2&&i.cartItem!=null?(e=>{let n=e.configuratorParams;return[new t.OrderItemBase({...e,quantity:e.quantity??1,marker:e.marker,configuratorParams:{width:n?.width??e.width??0,length:n?.length??e.length??0}})]})(i.cartItem):null),d=()=>{if(!i.settings){s.value=`Настройки конфигуратора не указаны в свойствах категории.`;return}let e={category:i.cartItem?.category??i.category,configurator:i.editor,quantity:1};switch(i.editor){case`kozyrek`:{let r=i.settings;c.value=new t.OrderItemBase({...e,configuratorParams:{length:r.stripMinLength,linesAngles:[],linesWidths:[],startTailType:(0,n.some)(r.startTailConfigs,e=>e.isDefault)?r.startTailConfigs?.findIndex(e=>e.isDefault):void 0,endTailType:(0,n.some)(r.endTailConfigs,e=>e.isDefault)?r.endTailConfigs?.findIndex(e=>e.isDefault):void 0,colorSide:`top`}});break}case`mosquitto`:{let n=i.settings;c.value=new t.OrderItemBase({...e,configuratorParams:{width:0,height:0,netType:n.netType[0]||``,color:n.color[0]||``,mountType:n.mountType[0]||``}});break}case`strip`:{let n=i.settings;l.value=[new t.OrderItemBase({...e,length:n.minLength,configuratorParams:{linesWidths:[0]}})];break}case`metal_for_doors`:{let n=i.settings;c.value=new t.OrderItemBase({...e,configuratorParams:{width:n.minWidth,length:n.minLength}});break}case`sandwich`:c.value=new t.OrderItemBase({...e,configuratorParams:{calculationId:``,items:[{width:0,length:0,count:1}]}});break;case`sandwich_m2`:u.value=[new t.OrderItemBase({...e,configuratorParams:{width:0,length:0}})];break;default:s.value=`Неподдерживаемый тип конфигуратора: ${i.editor}.`}c.value&&(c.value.marker=void 0)},f=(e,t,n)=>{i.eventEmitter.emit(`configurator:submit`,{cartItem:e,callback:e=>{n?.(),e&&d()},validation:t})},p=(e,t,n,r)=>{let a=e[0];if(!a){n?.();return}let o=r?.isFinalSuccessfulCompletion===!0;i.eventEmitter.emit(`configurator:submit`,{cartItem:a,callback:e=>{n?.(e),o&&e&&d()},validation:t,additionalParams:r})},m=()=>{i.category&&i.eventEmitter.emit(`configurator:click-view-switch`,{category:i.category})};return(0,r.onMounted)(()=>{!i.cartItem&&!i.cartItems&&d()}),(t,n)=>{let i=o.NSpin;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,vu,[(0,r.createVNode)(i,{size:`large`})])):s.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,yu,(0,r.toDisplayString)(s.value),1)):(0,r.createCommentVNode)(``,!0),e.settings!==null&&(c.value!==null||l.value!==null||u.value!==null)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,bu,[(0,r.createElementVNode)(`div`,xu,[e.editor===`kozyrek`?((0,r.openBlock)(),(0,r.createBlock)(Fc,{key:0,"event-emitter":e.eventEmitter,settings:e.settings,"cart-item":c.value,"onClick:viewSwitch":m,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-item`])):e.editor===`mosquitto`?((0,r.openBlock)(),(0,r.createBlock)(tl,{key:1,"event-emitter":e.eventEmitter,settings:e.settings,"cart-item":c.value,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-item`])):e.editor===`strip`?((0,r.openBlock)(),(0,r.createBlock)(ml,{key:2,"event-emitter":e.eventEmitter,settings:e.settings,"cart-items":l.value,"onClick:viewSwitch":m,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-items`])):e.editor===`metal_for_doors`?((0,r.openBlock)(),(0,r.createBlock)(vl,{key:3,"event-emitter":e.eventEmitter,settings:e.settings,"cart-item":c.value,"onClick:viewSwitch":m,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-item`])):e.editor===`sandwich`?((0,r.openBlock)(),(0,r.createBlock)(Bl,{key:4,"event-emitter":e.eventEmitter,settings:e.settings,"cart-item":c.value,"onClick:viewSwitch":m,onSubmit:f},null,8,[`event-emitter`,`settings`,`cart-item`])):e.editor===`sandwich_m2`?((0,r.openBlock)(),(0,r.createBlock)(_u,{key:5,"event-emitter":e.eventEmitter,settings:e.settings,"cart-items":u.value,"onClick:viewSwitch":m,onSubmit:p},null,8,[`event-emitter`,`settings`,`cart-items`])):(0,r.createCommentVNode)(``,!0)])])):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Su,` Конфигуратор "`+(0,r.toDisplayString)(e.editor)+`" не поддерживается. `,1))],64)}}});function wu(e){return Object.values(t.ConfiguratorsEnum).includes(e)}function Tu(e){return e.properties?.configurator!==t.ConfiguratorsEnum.Sandwich||e.properties.configuratorSettings!==void 0&&(0,n.isArray)(e.products)&&e.products.length>0}var Eu={key:0,class:`pt-0.5`},Du={key:0},Ou={key:1},ku={class:`flex flex-row gap-1`},Au={key:0},ju={class:`m-0 list-inside list-disc p-0 pl-1.5 text-xs text-gray-500`},Mu={class:`flex flex-col gap-2.5 sm:flex-row`},Nu={key:0,class:`header-extra`},Pu={class:`inline-flex`},Fu={class:`inline-flex`},Iu={class:`inline-flex`},Lu={class:`mt-2`},Ru={key:1,class:`flex flex-col`},zu=bt((0,r.defineComponent)({__name:`category-collapse-item`,props:{categoryItem:{},filteredItems:{},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function],default:!1},showCategoryRequiredButton:{type:[Boolean,String,Function],default:!1},showCategoryPinButton:{type:[Boolean,String,Function],default:!1},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function],default:!1},canShowConfigurator:{type:[Boolean,Function],default:!1},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showProductInfoButton:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){let i=e,a=(0,r.inject)(Tt,`medium`),s=ue(),c=(0,r.computed)(()=>i?.filteredItems?.[i.categoryItem.id]),l=(0,r.computed)(()=>(0,n.isArray)(i.categoryItem?.categories)&&i.categoryItem.categories?.length>0),d=(0,r.computed)(()=>(0,n.isArray)(i.categoryItem?.products)?i.categoryItem.products:[]),p=(0,r.computed)(()=>Object.entries(i.categoryItem.currencyRates??{}).map(([e,t])=>`${t} руб./${se(e)}`).join(`, `)),m=(0,r.computed)(()=>(0,n.isUndefined)(i.filteredItems)||c.value===`*`?d.value:d.value.filter(e=>{let t=c.value?.products;return(0,n.isArray)(t)&&t.includes(e.id)})),h=(0,r.computed)(()=>m.value.length>0),g=(0,r.computed)(()=>(0,n.isFunction)(i.showCategoryHideForClientButton)?i.showCategoryHideForClientButton(i.categoryItem):i.showCategoryHideForClientButton),_=(0,r.computed)(()=>(0,n.isFunction)(i.showCategoryPinButton)?i.showCategoryPinButton(i.categoryItem):i.showCategoryPinButton),v=(0,r.computed)(()=>(0,n.isFunction)(i.showCategoryRequiredButton)?i.showCategoryRequiredButton(i.categoryItem):i.showCategoryRequiredButton),y=(0,r.computed)(()=>{let e=E.value?.hidingComment,t=E.value?.isDisabled?`Скрыто для клиента${e?`. Причина: '${e}'`:``}`:`Видимо клиенту`;return g.value===`disabled`?`${t}. ${u}`:t}),b=(0,r.computed)(()=>{let e=E.value?.manager,t=e?`Категория закреплена за "${e.name??`-`}"`:`Закрепить`;return _.value===`disabled`?`${t}. ${u}`:t}),x=(0,r.computed)(()=>v.value===`disabled`?`${f}. ${u}`:f),S=(0,r.computed)(()=>(0,n.isFunction)(i.showCategoryEditButton)?i.showCategoryEditButton(i.categoryItem):i.showCategoryEditButton),C=(0,r.computed)(()=>i.categoryItem.properties?.configurator!==void 0&&wu(i.categoryItem.properties?.configurator)&&Tu(i.categoryItem)&&i.categoryItem.properties?.configuratorSettings!==void 0&&((0,n.isFunction)(i.canShowConfigurator)?i.canShowConfigurator():i.canShowConfigurator)),w=(0,r.computed)(()=>C.value&&((0,n.isFunction)(i.showConfigurator)?i.showConfigurator(i.categoryItem):i.showConfigurator)),T=(0,r.computed)(()=>(0,n.isNil)(i.categoryContextButtonsConfig)?[]:(0,n.isFunction)(i.categoryContextButtonsConfig)?i.categoryContextButtonsConfig(i.categoryItem):i.categoryContextButtonsConfig),E=(0,r.computed)(()=>new t.ClientCategory(i.categoryItem)),D=(0,r.ref)(!1),O=(0,r.ref)(!1),k=(0,r.computed)(()=>!(0,n.isUndefined)(i.isCategoryItemSelected)),A=(0,r.computed)(()=>(0,n.isFunction)(i.isCategoryItemSelected)?i.isCategoryItemSelected(i.categoryItem):i.isCategoryItemSelected===!0),ee=(0,r.computed)(()=>(0,n.isFunction)(i.isCategoryItemSelected)?i.isCategoryItemSelected(i.categoryItem)===`disabled`:i.isCategoryItemSelected===`disabled`),te=(0,r.computed)(()=>(0,n.isFunction)(i.isCategoryItemSelected)?i.isCategoryItemSelected(i.categoryItem)===`indeterminate`:i.isCategoryItemSelected===`indeterminate`),ne=(0,r.computed)(()=>ve.value&&oe.getDeviceTypeByResolution()===P.laptop?`auto`:`fixed`),j=(0,r.useTemplateRef)(`collapse-item-reference`),M=(0,r.computed)(()=>i.categoryItem.properties?.templateCost?.priceCoefficient),re=(0,r.computed)(()=>i.categoryItem.properties?.templateCost?.increasePercent),ie=(0,r.computed)(()=>Ae.isM2Category(i.categoryItem)?Ae.findReferenceProduct(i.categoryItem):void 0),ae=(0,r.computed)(()=>ie.value?Ae.calculateM2Cost(ie.value,M.value,re.value):void 0),N=(0,r.computed)(()=>`${ie.value?.currency?.symbol??``}/м²`),se=(e,t=`ru-RU`)=>0 .toLocaleString(t,{style:`currency`,currency:e,minimumFractionDigits:0,maximumFractionDigits:0}).replaceAll(/\d/g,``).trim(),ce=e=>{i.eventEmitter.emit(`category:checked`,{category:i.categoryItem,checked:e,target:j.value})},le=(e,t)=>{i.eventEmitter.emit(`category:header-click`,{categoryItem:i.categoryItem,expanded:t,isLoadingState:D,target:j.value})},de=()=>{i.eventEmitter.emit(`category:hide`,{category:i.categoryItem,target:j.value})},fe=()=>{i.eventEmitter.emit(`category:required`,{category:i.categoryItem,target:j.value})},pe=()=>{i.eventEmitter.emit(`category:attach`,{category:i.categoryItem,target:j.value})},me=()=>{i.eventEmitter.emit(`category:detach`,{category:i.categoryItem,target:j.value})},he=()=>{i.eventEmitter.emit(`category:edit`,{category:i.categoryItem,target:j.value})},ge=e=>{i.eventEmitter.emit(`category:context-select`,{category:i.categoryItem,key:e,target:j.value})},_e=()=>{i.eventEmitter.emit(`configurator:click-view-switch`,{category:i.categoryItem})},ve=(0,r.ref)(0),ye=(0,r.computed)(()=>ve.value&&d.value.length>0?rr(d.value,{eventEmitter:i.eventEmitter,showSlugs:i.showSlugs,showProperties:i.showProperties,showProductCosts:i.showProductCosts,allowNameClick:i.allowNameClick,allowPriceClick:i.allowPriceClick,showPriceHistory:i.showPriceHistory,showCostDate:i.showCostDate,showProductInfoButton:i.showProductInfoButton,showProductAddToCartButton:i.showProductAddToCartButton,isProductItemSelected:i.isProductItemSelected,showProductEditButton:i.showProductEditButton,showProductRequiredButton:i.showProductRequiredButton,currencyRates:i.categoryItem.currencyRates,productContextButtonsConfig:i.productContextButtonsConfig}):[]),be=(0,n.debounce)(()=>{ve.value=window.innerWidth},20);return(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,be),be.cancel()}),window.addEventListener(`resize`,be),be(),(t,i)=>{let u=o.NCheckbox,d=ot,f=o.NTooltip,j=rt,ie=o.NTag,P=et,oe=Ze,se=o.NButton,ue=Je,ve=Ge,be=He,xe=ze,Se=Ie,Ce=o.NDropdown,we=o.NDataTable,Te=o.NAlert,I=o.NSpin;return(0,r.openBlock)(),(0,r.createBlock)(xt,{ref:`collapse-item-reference`,name:e.categoryItem.id,"data-id":e.categoryItem.id,"onHeader:click":le},{"pre-arrow":(0,r.withCtx)(()=>[k.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Eu,[(0,r.createVNode)(u,{checked:A.value,indeterminate:te.value,disabled:ee.value,"onUpdate:checked":ce},null,8,[`checked`,`indeterminate`,`disabled`])])):(0,r.createCommentVNode)(``,!0),!g.value&&E.value?.isDisabled?((0,r.openBlock)(),(0,r.createBlock)(f,{key:1,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(d,{class:`pt-1.5`})]),default:(0,r.withCtx)(()=>[i[1]||=(0,r.createTextVNode)(` Категория скрыта для клиента `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0),E.value?.isFavorite??!1?((0,r.openBlock)(),(0,r.createBlock)(f,{key:2,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(j,{class:`pt-1.5`})]),default:(0,r.withCtx)(()=>[i[2]||=(0,r.createTextVNode)(` Избранная категория `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0)]),header:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"text-base font-semibold uppercase":!0,"text-gray-400 line-through":e.categoryItem.isHidden,"text-gray-400":E.value?.isDisabled})},[(0,r.createVNode)(f,{disabled:!e.categoryItem.isHidden,placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,null,(0,r.toDisplayString)(e.categoryItem.name),1)]),default:(0,r.withCtx)(()=>[i[3]||=(0,r.createTextVNode)(` Категория скрыта `,-1)]),_:1},8,[`disabled`])],2),(0,r.createElementVNode)(`div`,{class:`w-fit`,onClick:i[0]||=(0,r.withModifiers)((...e)=>(0,r.unref)(n.noop)&&(0,r.unref)(n.noop)(...e),[`prevent`,`stop`])},[e.categoryItem.properties?.templateCost?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[M.value||re.value||!(0,r.unref)(n.isNil)(ae.value)?((0,r.openBlock)(),(0,r.createBlock)(ie,{key:0,size:(0,r.unref)(a),round:``},{default:(0,r.withCtx)(()=>[M.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Du,(0,r.toDisplayString)(M.value?.name),1)):(0,r.createCommentVNode)(``,!0),re.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Ou,(0,r.toDisplayString)(re.value>0?`+`:``)+(0,r.toDisplayString)((0,r.unref)(F).formatPercent(re.value))+`%`,1)):(0,r.createCommentVNode)(``,!0),(0,r.unref)(n.isNil)(ae.value)?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:2,class:(0,r.normalizeClass)({"ml-1":M.value||re.value})},(0,r.toDisplayString)(ae.value.toFixed(2))+` `+(0,r.toDisplayString)(N.value),3))]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0)],64)):e.categoryItem.properties?.m2Price?((0,r.openBlock)(),(0,r.createBlock)(ie,{key:1,size:(0,r.unref)(a),round:``},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Установленная стоимость: `+(0,r.toDisplayString)(e.categoryItem.properties.m2Price)+` руб./м2 `,1)]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0),p.value?((0,r.openBlock)(),(0,r.createBlock)(ie,{key:2,size:(0,r.unref)(a),round:``},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Фиксированный курс: `+(0,r.toDisplayString)(p.value),1)]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0),_.value&&E.value?.manager?((0,r.openBlock)(),(0,r.createBlock)(ie,{key:3,size:(0,r.unref)(a),closable:_.value!==`disabled`,round:``,class:`align-bottom`,onClose:me},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(f,{placement:`bottom`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,ku,[(0,r.createVNode)(P),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(E.value?.manager?.name),1)])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Категория закреплена за "`+(0,r.toDisplayString)(E.value?.manager?.name)+`" `,1)]),_:1})]),_:1},8,[`size`,`closable`])):(0,r.createCommentVNode)(``,!0)])]),"sub-header":(0,r.withCtx)(()=>[e.showSlugs||e.showProperties?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Au,[(0,r.createElementVNode)(`ul`,ju,[e.showSlugs?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:0},(0,r.renderList)({id:e.categoryItem.id,slug:e.categoryItem.slug},(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:t},` (`+(0,r.toDisplayString)(t)+`): `+(0,r.toDisplayString)(e),1))),128)):(0,r.createCommentVNode)(``,!0),e.showProperties?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(e.categoryItem.properties,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:t},` (`+(0,r.toDisplayString)(t)+`): `+(0,r.toDisplayString)(e),1))),128)):(0,r.createCommentVNode)(``,!0)])])):(0,r.createCommentVNode)(``,!0)]),"header-extra":(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Mu,[t.$slots[`header-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Nu,[(0,r.renderSlot)(t.$slots,`header-extra`,{categoryItem:e.categoryItem},void 0,!0)])):(0,r.createCommentVNode)(``,!0),g.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:1,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(s)&&g.value!==`disabled`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Pu,[(0,r.createVNode)(se,{ghost:!0,disabled:g.value===`disabled`,size:(0,r.unref)(a),onClick:de},{default:(0,r.withCtx)(()=>[E.value?.isDisabled?((0,r.openBlock)(),(0,r.createBlock)(d,{key:1})):((0,r.openBlock)(),(0,r.createBlock)(oe,{key:0}))]),_:1},8,[`disabled`,`size`])])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(y.value),1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),_.value&&!E.value?.manager?((0,r.openBlock)(),(0,r.createBlock)(f,{key:2,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(s)&&_.value!==`disabled`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Fu,[(0,r.createVNode)(se,{ghost:!0,disabled:_.value===`disabled`,size:(0,r.unref)(a),onClick:pe},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(ue)]),_:1},8,[`disabled`,`size`])])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(b.value),1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),v.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:3,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(s)&&v.value!==`disabled`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Iu,[(0,r.createVNode)(se,{ghost:!0,disabled:v.value===`disabled`,size:(0,r.unref)(a),onClick:fe},{default:(0,r.withCtx)(()=>[E.value?.isRequired?((0,r.openBlock)(),(0,r.createBlock)(be,{key:1})):((0,r.openBlock)(),(0,r.createBlock)(ve,{key:0}))]),_:1},8,[`disabled`,`size`])])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(x.value),1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),S.value?((0,r.openBlock)(),(0,r.createBlock)(f,{key:4,placement:`bottom`,trigger:`hover`,disabled:!(0,r.unref)(s)},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(se,{ghost:!0,size:(0,r.unref)(a),type:`primary`,onClick:he},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(xe)]),_:1},8,[`size`])]),default:(0,r.withCtx)(()=>[i[4]||=(0,r.createTextVNode)(` Редактировать `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),T.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(Ce,{key:5,options:T.value,size:(0,r.unref)(a),trigger:`click`,onSelect:ge},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(se,{ghost:!0,size:(0,r.unref)(a),type:`primary`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Se)]),_:1},8,[`size`])]),_:1},8,[`options`,`size`])):(0,r.createCommentVNode)(``,!0)])]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`,{},()=>[(0,r.createElementVNode)(`div`,Lu,[l.value?((0,r.openBlock)(),(0,r.createBlock)(Hu,{key:0,"categories-items":e.categoryItem.categories??[],"has-products":h.value||D.value,"event-emitter":e.eventEmitter,"filtered-items":c.value?c.value?.categories??{}:void 0,"is-category-item-selected":e.isCategoryItemSelected,"show-slugs":e.showSlugs,"show-properties":e.showProperties,"allow-name-click":e.allowNameClick,"allow-price-click":e.allowPriceClick,"show-price-history":e.showPriceHistory,"show-cost-date":e.showCostDate,"show-product-info-button":e.showProductInfoButton,"show-category-required-button":e.showCategoryRequiredButton,"show-category-hide-for-client-button":e.showCategoryHideForClientButton,"show-category-pin-button":e.showCategoryPinButton,"show-category-edit-button":e.showCategoryEditButton,"category-context-buttons-config":e.categoryContextButtonsConfig,"is-product-item-selected":e.isProductItemSelected,"show-product-add-to-cart-button":e.showProductAddToCartButton,"show-product-costs":e.showProductCosts,"show-product-required-button":e.showProductRequiredButton,"show-product-edit-button":e.showProductEditButton,"product-context-buttons-config":e.productContextButtonsConfig,"show-configurator":e.showConfigurator,"can-show-configurator":e.canShowConfigurator},(0,r.createSlots)({_:2},[t.$slots[`header-extra`]?{name:`header-extra`,fn:(0,r.withCtx)(({categoryItem:e})=>[(0,r.renderSlot)(t.$slots,`header-extra`,{categoryItem:e},void 0,!0)]),key:`0`}:void 0]),1032,[`categories-items`,`has-products`,`event-emitter`,`filtered-items`,`is-category-item-selected`,`show-slugs`,`show-properties`,`allow-name-click`,`allow-price-click`,`show-price-history`,`show-cost-date`,`show-product-info-button`,`show-category-required-button`,`show-category-hide-for-client-button`,`show-category-pin-button`,`show-category-edit-button`,`category-context-buttons-config`,`is-product-item-selected`,`show-product-add-to-cart-button`,`show-product-costs`,`show-product-required-button`,`show-product-edit-button`,`product-context-buttons-config`,`show-configurator`,`can-show-configurator`])):(0,r.createCommentVNode)(``,!0)]),C.value&&w.value?((0,r.openBlock)(),(0,r.createBlock)(Cu,{key:0,"event-emitter":e.eventEmitter,settings:e.categoryItem.properties?.configuratorSettings,editor:e.categoryItem.properties?.configurator,category:e.categoryItem},null,8,[`event-emitter`,`settings`,`editor`,`category`])):h.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ru,[C.value?((0,r.openBlock)(),(0,r.createBlock)(se,{key:0,color:`#bdbdbd`,strong:``,class:`self-end p-2`,onClick:_e},{default:(0,r.withCtx)(()=>[...i[5]||=[(0,r.createTextVNode)(` Назад в Конфигуратор `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(we,{columns:ye.value,data:m.value,bordered:!0,loading:D.value,remote:!0,"row-key":e=>e.id,"table-layout":ne.value,class:`mt-2`},null,8,[`columns`,`data`,`loading`,`row-key`,`table-layout`])])):(0,r.createCommentVNode)(``,!0),!D.value&&!O.value&&!l.value&&!h.value?((0,r.openBlock)(),(0,r.createBlock)(Te,{key:2,"show-icon":!0,type:`warning`,title:`Категория пуста`,class:`mx-10`})):(0,r.createCommentVNode)(``,!0),O.value?((0,r.openBlock)(),(0,r.createBlock)(Te,{key:3,"show-icon":!0,type:`error`,title:`При получении данных произошла ошибка`,class:`mx-10`})):(0,r.createCommentVNode)(``,!0),D.value?((0,r.openBlock)(),(0,r.createBlock)(I,{key:4,size:(0,r.unref)(a),class:`w-full`},{description:(0,r.withCtx)(()=>[...i[6]||=[(0,r.createElementVNode)(`div`,null,`Выполняется загрузка данных ...`,-1)]]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0)],!0)]),_:3},8,[`name`,`data-id`])}}}),[[`__scopeId`,`data-v-955d9ea8`]]),Bu={class:`sc-collapse flex w-full flex-col`},Vu=(0,r.defineComponent)({__name:`collapse`,props:{defaultExpandedNames:{default:()=>[]},expandedNames:{default:()=>[]}},emits:[`on-item-header-click`],setup(e,{emit:t}){let n=e,i=t;return(0,r.provide)(`itemHeaderClickHandler`,(e,t)=>{i(`on-item-header-click`,e,t)}),(0,r.provide)(`defaultExpandedNames`,n.defaultExpandedNames),(0,r.provide)(`expandedNames`,n.expandedNames),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Bu,[(0,r.renderSlot)(e.$slots,`default`)]))}}),Hu=(0,r.defineComponent)({__name:`category-collapse`,props:{categoriesItems:{},hasProducts:{type:Boolean},loading:{type:Boolean,default:!1},client:{default:void 0},filteredItems:{default:void 0},isCategoryItemSelected:{type:[Boolean,String,Function],default:void 0},showCategoryHideForClientButton:{type:[Boolean,String,Function]},showCategoryRequiredButton:{type:[Boolean,String,Function]},showCategoryPinButton:{type:[Boolean,String,Function]},showCategoryEditButton:{type:[Boolean,String,Function],default:!1},categoryContextButtonsConfig:{type:Function,default:void 0},showConfigurator:{type:[Boolean,Function]},canShowConfigurator:{type:[Boolean,Function]},eventEmitter:{},showSlugs:{type:Boolean,default:!1},showProperties:{type:Boolean,default:!1},showProductCosts:{type:[Boolean,Function],default:!1},allowNameClick:{type:[Boolean,Function],default:!1},allowPriceClick:{type:[Boolean,Function],default:!1},showProductInfoButton:{type:[Boolean,Function],default:!1},showPriceHistory:{type:[Boolean,Function],default:!1},showCostDate:{type:[Boolean,Function],default:!1},isProductItemSelected:{type:Function,default:void 0},showProductAddToCartButton:{type:[Boolean,String,Function],default:!1},showProductRequiredButton:{type:[Boolean,String,Function]},showProductEditButton:{type:[Boolean,String,Function],default:!1},currencyRates:{},productContextButtonsConfig:{type:Function,default:void 0}},setup(e){let t=e,i=(0,r.inject)(Tt,`medium`),a=(0,r.computed)(()=>(0,n.isUndefined)(t.filteredItems)?t.categoriesItems:t.categoriesItems.filter(e=>!!t.filteredItems?.[e.id])),s=(e,t)=>{if((0,n.isUndefined)(t))return;let i=t[e.id];if(i===`*`)return;let a={};return a[e.id]=structuredClone((0,r.toRaw)(i)),a};return(t,n)=>{let c=o.NSpin,l=o.NAlert;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[a.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(Vu,{key:0},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(a.value,n=>((0,r.openBlock)(),(0,r.createBlock)(zu,{key:n.id,"category-item":n,"event-emitter":e.eventEmitter,"filtered-items":s(n,e.filteredItems),"is-category-item-selected":e.isCategoryItemSelected,"show-slugs":e.showSlugs,"show-properties":e.showProperties,"allow-name-click":e.allowNameClick,"allow-price-click":e.allowPriceClick,"show-price-history":e.showPriceHistory,"show-cost-date":e.showCostDate,"show-product-info-button":e.showProductInfoButton,"show-category-required-button":e.showCategoryRequiredButton,"show-category-hide-for-client-button":e.showCategoryHideForClientButton,"show-category-pin-button":e.showCategoryPinButton,"show-category-edit-button":e.showCategoryEditButton,"category-context-buttons-config":e.categoryContextButtonsConfig,"is-product-item-selected":e.isProductItemSelected,"show-product-add-to-cart-button":e.showProductAddToCartButton,"show-product-costs":e.showProductCosts,"show-product-required-button":e.showProductRequiredButton,"show-product-edit-button":e.showProductEditButton,"product-context-buttons-config":e.productContextButtonsConfig,"show-configurator":e.showConfigurator,"can-show-configurator":e.canShowConfigurator},(0,r.createSlots)({_:2},[t.$slots[`header-extra`]?{name:`header-extra`,fn:(0,r.withCtx)(({categoryItem:e})=>[(0,r.renderSlot)(t.$slots,`header-extra`,{categoryItem:e})]),key:`0`}:void 0]),1032,[`category-item`,`event-emitter`,`filtered-items`,`is-category-item-selected`,`show-slugs`,`show-properties`,`allow-name-click`,`allow-price-click`,`show-price-history`,`show-cost-date`,`show-product-info-button`,`show-category-required-button`,`show-category-hide-for-client-button`,`show-category-pin-button`,`show-category-edit-button`,`category-context-buttons-config`,`is-product-item-selected`,`show-product-add-to-cart-button`,`show-product-costs`,`show-product-required-button`,`show-product-edit-button`,`product-context-buttons-config`,`show-configurator`,`can-show-configurator`]))),128))]),_:3})):e.loading?((0,r.openBlock)(),(0,r.createBlock)(c,{key:1,size:(0,r.unref)(i),class:`w-full`},{description:(0,r.withCtx)(()=>[...n[0]||=[(0,r.createElementVNode)(`div`,null,`Выполняется загрузка данных ...`,-1)]]),_:1},8,[`size`])):(0,r.createCommentVNode)(``,!0),!e.hasProducts&&!e.loading&&e.categoriesItems.length>0&&a.value.length===0?((0,r.openBlock)(),(0,r.createBlock)(l,{key:2,"show-icon":!0,type:`warning`,title:`Товары не найдены`,class:`mx-10`})):(0,r.createCommentVNode)(``,!0)],64)}}}),Uu=(0,r.defineComponent)({__name:`reference-select`,props:{value:{default:void 0},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},referenceList:{default:()=>[]},showEmptyValue:{type:Boolean,default:!1},sortOptionsByLabel:{type:Boolean,default:!1},filterable:{type:Boolean,default:!1},maxTagCount:{default:void 0},disabledItem:{type:Function,default:void 0}},emits:[`update:value`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.computed)(()=>(0,n.isArray)(s.value)),u=new t.Reference,d=(0,r.computed)(()=>(0,n.isNil)(s.value)?l.value?[]:null:(0,n.isArray)(s.value)?s.value.filter(e=>!(0,n.isNil)(e)).map(e=>e.id):s.value.id),f=(0,r.computed)(()=>we.convertReferencesToSelectOptionsList(s.referenceList,s.sortOptionsByLabel,!1,s.showEmptyValue,void 0,s.disabledItem)),p=(0,r.computed)(()=>f.value.map(e=>({...e,class:s.wrapContent?`${e.class} consistent-menu-width`:e.class}))),m=e=>{if((0,n.isArray)(e)){let t=e.length>0?e.map(e=>f.value.find(t=>t.value===e)?.item).filter(e=>!(0,n.isNil)(e)):[];c(`update:value`,t)}else{let t=e===u.id||(0,n.isNil)(e)?void 0:f.value.find(t=>t.value===e)?.item;c(`update:value`,t)}},h=(0,r.useTemplateRef)(`select-component`);return i({focus:()=>h.value?.focus(),blur:()=>h.value?.blur()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSelect),{ref:`select-component`,value:d.value,clearable:s.clearable,"consistent-menu-width":e.consistentMenuWidth,disabled:e.disabled||f.value.length===0,filterable:e.filterable,"max-tag-count":e.maxTagCount,multiple:l.value,options:p.value,placeholder:``,class:`w-full`,"onUpdate:value":m},null,8,[`value`,`clearable`,`consistent-menu-width`,`disabled`,`filterable`,`max-tag-count`,`multiple`,`options`]))}}),Wu=(0,r.defineComponent)({__name:`set-client-price-form-item`,props:{value:{},clearable:{type:Boolean},feedback:{},validationStatus:{},disabled:{type:Boolean},catalogItem:{},calculationType:{},label:{},m2ReferenceProduct:{},disabledCoefficient:{type:Function},visibleCoefficient:{type:Function}},emits:[`update:value`],setup(e,{emit:i}){let a=e,s=i,c=()=>{let e=t.PriceCoefficient.getRetailPriceCoefficient();return(0,n.unset)(e,`isNewRec`),e},l=e=>!e||e.id===c().id,u=(0,r.computed)(()=>a.catalogItem?.type===`product`),d=(0,r.computed)(()=>!u.value&&!(0,n.isNil)(a.m2ReferenceProduct)),f=(0,r.computed)(()=>u.value?a.catalogItem:a.m2ReferenceProduct),p=(0,r.computed)(()=>!(0,n.isNil)(f.value)),m=(0,r.computed)(()=>`${f.value?.currency.symbol??``}${d.value?`/м²`:``}`),h=e=>d.value&&a.m2ReferenceProduct?Ae.toM2Cost(e,a.m2ReferenceProduct):e,g=(0,r.computed)(()=>f.value?h(f.value.retailCost??f.value.cost):void 0),_=(0,r.computed)(()=>(f.value?.priceCoefficients??[]).map(e=>({...e,cost:h(e.cost)}))),v=e=>e.id===c().id?g.value:_.value.find(t=>t.coefficient.id===e.id)?.cost,y=(0,r.computed)(()=>{let e=[...(0,t.useReferencesStore)().priceCoefficientsReference?.map(e=>structuredClone((0,r.toRaw)(e)))??[],c()].filter(e=>a.visibleCoefficient?.(e)??!0);return p.value&&e.forEach(e=>{let t=v(e);t?e.name+=` (${(0,n.round)(t,2)} ${m.value})`:e.name=``}),e.filter(e=>e.name!==``)}),b=(0,r.ref)(a.value.coefficient),x=(0,r.ref)(a.value?.value?.toString()??null),S=(0,r.ref)(null),C=(0,r.computed)(()=>_.value.find(e=>e.coefficient.slug===t.PriceCoefficientEnum.K0)),w=(0,r.ref)(void 0),T=e=>Number.parseFloat((e??``).replaceAll(/[\s\u00A0\u202F]/g,``).replace(`,`,`.`)),E=()=>{w.value=void 0;let e=T(x.value);if(e=Number.isNaN(e)?void 0:e,p.value){if(b.value||x.value){let t=c(),n=v(b.value??t)??0,r=n+(e??0)/100*n;S.value=F.formatMoney(r,f.value?.currency.precision),r>(g.value??r)&&(w.value={validationStatus:`warning`,feedback:`Устанавливается цена выше розничной цены`}),C.value&&r<(C.value?.cost??0)&&(w.value={validationStatus:`warning`,feedback:`Устанавливается цена ниже минимальной цены`})}else S.value=null}s(`update:value`,{value:Number.isNaN(e)?void 0:e,coefficient:l(b.value)?void 0:structuredClone((0,r.toRaw)(b.value))})},D=e=>{(0,n.isArray)(e)||(0,n.isNull)(e)||(b.value=e,x.value=null,!b.value&&x.value&&(b.value=c()),E())},O=()=>{b.value||=c(),E()},k=e=>{let t=T(e);if(p.value){if(Number.isNaN(t)){b.value=void 0,x.value=null,s(`update:value`,{value:void 0,coefficient:void 0});return}let e=0;if(t<=0)b.value=void 0,x.value=null;else if(C.value&&t<(C.value?.cost??0))b.value=C.value?.coefficient,e=(t-C.value.cost)*100/C.value.cost,w.value={validationStatus:`warning`,feedback:`Устанавливается цена ниже минимальной цены`};else if(t>(g.value??t)){b.value=c();let n=g.value??0;e=(t-n)*100/n,w.value={validationStatus:`warning`,feedback:`Устанавливается цена выше розничной цены`}}else{let r=_.value,i=(0,n.sortBy)(r,[e=>e.cost]),a=i.filter(e=>e.cost<=t).at(-1)??i.at(0);a&&(b.value=a.coefficient,e=(t-a.cost)*100/a.cost),w.value={validationStatus:void 0,feedback:void 0}}e=F.roundPercent(e),x.value=F.formatPercent(e,F.percentFractionDigits),s(`update:value`,{value:Number.isNaN(e)?void 0:e,coefficient:l(b.value)?void 0:structuredClone((0,r.toRaw)(b.value))})}else s(`update:value`,{value:Number.isNaN(t)?void 0:t,coefficient:void 0})};return(0,r.onMounted)(()=>{a.calculationType===t.CalculationTypeEnum.m2Cost?S.value=a.value?.value?.toString()??null:!a.value?.coefficient&&a.value?.value&&(b.value=c()),E()}),(i,a)=>{let s=o.NInput,c=o.NInputGroup;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NFormItem),{"show-label":!(0,r.unref)(n.isNil)(e.label),label:e.label,"show-feedback":!(0,r.unref)(n.isNil)(w.value?.feedback??e.feedback),feedback:w.value?.feedback??e.feedback,"validation-status":w.value?.validationStatus??e.validationStatus},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([{"sm:grid-cols-3":p.value},`grid w-full grid-cols-1 gap-2`])},[e.calculationType===(0,r.unref)(t.CalculationTypeEnum).m2Cost?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createBlock)(c,{key:0,class:(0,r.normalizeClass)([`w-full flex-row`,{"sm:col-span-2":p.value}])},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(Uu,{class:`w-full min-w-0 flex-1`,value:b.value,"reference-list":y.value,clearable:e.clearable,disabled:e.disabled,"consistent-menu-width":!1,"show-empty-value":!0,"disabled-item":e.disabledCoefficient,"onUpdate:value":D},null,8,[`value`,`reference-list`,`clearable`,`disabled`,`disabled-item`]),(0,r.createVNode)(s,{value:x.value,"onUpdate:value":[a[0]||=e=>x.value=e,O],clearable:e.clearable,disabled:e.disabled,placeholder:``,class:`w-full min-w-0 flex-1`},(0,r.createSlots)({suffix:(0,r.withCtx)(()=>[a[3]||=(0,r.createTextVNode)(`%`,-1)]),_:2},[x.value&&!x.value.startsWith(`-`)?{name:`prefix`,fn:(0,r.withCtx)(()=>[a[2]||=(0,r.createTextVNode)(` + `,-1)]),key:`0`}:void 0]),1032,[`value`,`clearable`,`disabled`])]),_:1},8,[`class`])),p.value||e.calculationType===(0,r.unref)(t.CalculationTypeEnum).m2Cost?((0,r.openBlock)(),(0,r.createBlock)(s,{key:1,value:S.value,"onUpdate:value":[a[1]||=e=>S.value=e,k],clearable:e.clearable,disabled:e.disabled,placeholder:d.value?`Стоимость за м²`:`Стоимость`,class:`w-full`},(0,r.createSlots)({_:2},[p.value?{name:`suffix`,fn:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(m.value),1)]),key:`0`}:void 0]),1032,[`value`,`clearable`,`disabled`,`placeholder`])):(0,r.createCommentVNode)(``,!0)],2)]),_:1},8,[`show-label`,`label`,`show-feedback`,`feedback`,`validation-status`])}}}),Gu={class:`text-sm`},Ku={class:`text-sm`},qu=(0,r.defineComponent)({__name:`add-product-to-cart-dialog`,emits:[`submit`],setup(e,{expose:i,emit:a}){let s=(0,r.useTemplateRef)(`form-reference`),c=(0,r.useTemplateRef)(`base-dialog-reference`),l=(0,r.ref)(!1),u=(0,r.ref)(null),d=(0,r.computed)(()=>u.value?.unit.isLinear&&u.value?.properties?.isLengthConfigurator),f=(0,r.computed)(()=>u.value?t.UnitsHelper.productIsMeasurable(u.value)||d.value?`шт.`:u.value.unit.name:`шт.`),p=(0,r.ref)(void 0),m=(0,r.ref)(void 0),h=(0,r.ref)(!0),g=(0,r.ref)(null),_=(0,r.computed)({get:()=>g.value?.quantity??null,set:e=>{g.value&&(g.value.quantity=e??0)}}),v=(0,r.computed)({get:()=>g.value?.length??null,set:e=>{g.value&&(g.value.length=e??void 0)}}),y=e=>{g.value&&(g.value.marker=e??void 0)},b=a,x=()=>({length:{},quantity:{},marker:{}}),S=(0,r.ref)(x()),C=(0,r.ref)(!1),w=(0,r.computed)(()=>{if(!u.value)return{};let e=t.UnitsHelper.getProductLengthMultiplicity(u.value),n=t.UnitsHelper.getProductMultiplicity(u.value),r=u.value?.properties?.minLength||e,i=u.value?.properties?.maxLength;return{length:[I.required,I.min(r??.1),I.max(i),I.step(e),De.serverValidation(S.value.length.feedback)],quantity:[I.required,I.min(n),I.step(n),De.serverValidation(S.value.quantity.feedback)],marker:[De.serverValidation(S.value.marker.feedback)]}}),E=(0,r.computed)(()=>u.value?u.value.properties?.lengthStep??(u.value.properties?.ignoreMinCountCheck?0:u.value.properties?.minCount??0):0),D=(0,r.computed)(()=>{if(!u.value)return``;let e=u.value?.properties?.minLength??(u.value?.properties?.ignoreMinCountCheck?0:u.value?.properties?.minCount),t=u.value?.properties?.maxLength;return e||t?`(${e?`от ${e}`:``}${e&&t?` `:``}${t?`до ${t}`:``} ${u.value?.unit.name})`:``}),O=e=>{if(!u.value?.properties?.isLengthConfigurator||!g.value||(0,n.isNil)(e)||E.value===0)return;let r=e/E.value,i=Math.round(r),a=t.UnitsHelper.getProductMultiplicity(u.value),o=Math.max(i,a);g.value.quantity=o},k=e=>{if(!u.value?.properties?.isLengthConfigurator||!g.value||(0,n.isNil)(e)||E.value===0)return;let r=F.multiplyByStep(e,E.value),i=u.value.properties?.minLength||t.UnitsHelper.getProductLengthMultiplicity(u.value),a=u.value.properties?.maxLength;i!==void 0&&r<i?g.value.length=i:a!==void 0&&r>a?g.value.length=a:g.value.length=r},A=async e=>{let i=(0,n.cloneDeep)(g.value);try{await s.value?.validate(a=>{if(!a){if(!u.value||!i)return;t.UnitsHelper.productIsMeasurable(u.value)||delete i.length,d.value&&E.value&&(i.length=E.value),C.value=!0,b(`submit`,i,S.value,()=>{C.value=!1,e(!1),(0,r.nextTick)(()=>{s.value?.validate(n.noop).catch(n.noop)})})}})}catch{}},ee=()=>{u.value=null,p.value=void 0,g.value=null,S.value=x()},te=()=>{l.value=!1};return i({show:(e,n)=>{if(ee(),l.value=!0,u.value=e,p.value=n?.cartItemData,m.value=n?.orderId,h.value=n?.canSetDopProdaga??!1,g.value=new t.OrderItemBase(n?.cartItemData??new t.OrderItemBase({product:e,quantity:t.UnitsHelper.productIsMeasurable(u.value)?1:e?.properties?.minCount??1,length:e?.properties?.minLength||(e?.properties?.ignoreMinCountCheck?0:e?.properties?.minCount)||0})),e?.properties?.isLengthConfigurator&&g.value&&E.value>0){let e=E.value,t=g.value.quantity||1;g.value.length=F.multiplyByStep(t,e)}},closeDialog:te}),(e,n)=>{let i=o.NFormItem,a=o.NInputGroupLabel,s=o.NInputGroup,b=o.NCheckbox;return(0,r.openBlock)(),(0,r.createBlock)(Dn,{ref:`base-dialog-reference`,show:l.value,title:`${p.value?`Изменение`:`Добавление`} товара ${u.value?.name} в ${m.value?` заказ №${m.value}`:`корзину`}`,"accept-button":{show:!0,text:p.value?`Изменить`:`Добавить`},processing:C.value,"modal-width":500,onAccept:A,onClosing:te},{default:(0,r.withCtx)(()=>[u.value&&g.value?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NForm),{key:0,ref:`form-reference`,model:g.value,rules:w.value,class:`flex flex-col gap-2 sc-hide-empty-feedback-message`},{default:(0,r.withCtx)(()=>[(0,r.unref)(t.UnitsHelper).productIsMeasurable(u.value)?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,path:`length`,label:`Метраж, ${D.value+u.value.unit.name}`},(0,r.createSlots)({default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:v.value,"onUpdate:value":[n[0]||=e=>v.value=e,O],parse:(0,r.unref)(be),step:(0,r.unref)(t.UnitsHelper).getProductLengthMultiplicity(u.value),"show-button":!1,placeholder:`Введите метраж`,class:`w-full`,onKeydown:n[1]||=e=>(0,r.unref)(ye)(e,`.`,!1),onInput:n[2]||=e=>(0,r.unref)(xe)(S.value,`length`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`parse`,`step`,`onFocus`])]),_:2},[!S.value.length.feedback&&(0,r.unref)(t.UnitsHelper).getProductLengthMultiplicity(u.value)!==1?{name:`feedback`,fn:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Gu,`Метраж должно быть кратно `+(0,r.toDisplayString)((0,r.unref)(t.UnitsHelper).getProductLengthMultiplicity(u.value)),1)]),key:`0`}:void 0]),1032,[`label`])):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(i,{path:`quantity`,label:`Количество, ${f.value}`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s,null,(0,r.createSlots)({default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInputNumber),{value:_.value,"onUpdate:value":[n[3]||=e=>_.value=e,k],parse:(0,r.unref)(be),step:(0,r.unref)(t.UnitsHelper).getProductMultiplicity(u.value),"show-button":(0,r.unref)(t.UnitsHelper).getProductMultiplicity(u.value)>1,"button-placement":`both`,placeholder:`Введите количество`,class:`w-full`,onKeydown:n[4]||=e=>(0,r.unref)(ye)(e,`.`,!1),onInput:n[5]||=e=>(0,r.unref)(xe)(S.value,`quantity`),onFocus:(0,r.unref)(Se)},null,8,[`value`,`parse`,`step`,`show-button`,`onFocus`]),d.value?((0,r.openBlock)(),(0,r.createBlock)(a,{key:0,class:`bg-orange-100 font-bold`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` x `+(0,r.toDisplayString)(E.value)+` `+(0,r.toDisplayString)(u.value.unit.name),1)]),_:1})):(0,r.createCommentVNode)(``,!0)]),_:2},[!S.value.quantity.feedback&&(0,r.unref)(t.UnitsHelper).getProductMultiplicity(u.value)!==1?{name:`feedback`,fn:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Ku,`Количество должно быть кратно `+(0,r.toDisplayString)((0,r.unref)(t.UnitsHelper).getProductMultiplicity(u.value)),1)]),key:`0`}:void 0]),1024)]),_:1},8,[`label`]),(0,r.unref)(t.UnitsHelper).productIsMeasurable(u.value)?((0,r.openBlock)(),(0,r.createBlock)(i,{key:1,path:`marker`,label:`Маркировка`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NInput),{value:g.value.marker??null,placeholder:`Введите маркировку`,onInput:n[6]||=e=>(0,r.unref)(xe)(S.value,`marker`),"onUpdate:value":n[7]||=e=>y(e),onFocus:(0,r.unref)(Se)},null,8,[`value`,`onFocus`])]),_:1})):(0,r.createCommentVNode)(``,!0),h.value?((0,r.openBlock)(),(0,r.createBlock)(b,{key:2,checked:g.value.isAdditionalSale,"onUpdate:checked":n[8]||=e=>g.value.isAdditionalSale=e,"true-value":!0,"false-value":!1},{default:(0,r.withCtx)(()=>[...n[9]||=[(0,r.createTextVNode)(` ДопПродажа `,-1)]]),_:1},8,[`checked`])):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`model`,`rules`])),[[(0,r.unref)(T),()=>c.value?.acceptHandler?.()]]):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`show`,`title`,`accept-button`,`processing`])}}}),Ju={class:`flex flex-row gap-1`},Yu={class:`sc-client-name flex flex-col gap-1 text-base`},Xu=[`href`],Zu={key:1,class:`text-sc-grey`},Qu={key:0,class:`text-sc-dark-grey sc-client-city text-sm`},$u={key:0},ed={key:1,class:`text-sm`},td=(0,r.defineComponent)({__name:`client-name-with-short-info`,props:{client:{},nameLink:{default:void 0},popoverPosition:{default:void 0},showCityAndRegion:{type:Boolean,default:!0},showSalesDirection:{type:Boolean,default:!1},showClientInfoIcon:{type:Boolean,default:!1}},emits:[`click:client-name`,`click:client-info`],setup(e,{emit:a}){let s=e,c=a,l=(0,r.computed)(()=>s.client.lastLoginAt?(0,i.format)(s.client.lastLoginAt,(0,t.useBaseConfigStore)().config.dateFormats.uiDateWithTime):``),u=e=>{(0,n.isNil)(s.nameLink)&&(e.preventDefault(),e.stopPropagation()),c(`click:client-name`,s.client,e)};return(t,i)=>{let a=Wt,s=o.NButton,c=o.NPopover;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ju,[e.showClientInfoIcon?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0,quaternary:``,size:`small`,onClick:i[0]||=n=>t.$emit(`click:client-info`,e.client)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1})):(0,r.createCommentVNode)(``,!0),(0,r.createVNode)(c,{disabled:(0,r.unref)(n.isNil)(e.popoverPosition),placement:e.popoverPosition},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Yu,[(0,r.createElementVNode)(`a`,{href:e.nameLink??`#`,class:`text-base no-underline`,onClick:i[1]||=e=>u(e)},[(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"line-through":!e.client.isActive})},(0,r.toDisplayString)(e.client.name),3),e.showSalesDirection&&e.client.salesDirection?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)({"line-through":!e.client.isActive})},` (`+(0,r.toDisplayString)(e.client.salesDirection.name)+`) `,3)):(0,r.createCommentVNode)(``,!0),e.client.isActive?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Zu,` [ Деактивирован ] `))],8,Xu),e.showCityAndRegion&&e.client.city?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Qu,` г. `+(0,r.toDisplayString)(e.client.city.name)+`, `+(0,r.toDisplayString)(e.client.city.region.name),1)):(0,r.createCommentVNode)(``,!0)])]),default:(0,r.withCtx)(()=>[e.client.alternativeName?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,$u,(0,r.toDisplayString)(e.client.alternativeName),1)):(0,r.createCommentVNode)(``,!0),l.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,ed,` Последний вход: `+(0,r.toDisplayString)(l.value),1)):(0,r.createCommentVNode)(``,!0),(0,r.renderSlot)(t.$slots,`popover-content`)]),_:3},8,[`disabled`,`placement`])])}}}),nd={class:`text-base`},rd=(0,r.defineComponent)({__name:`contragent-with-short-info`,props:{contragent:{}},setup(e){let t=e,n=(0,r.computed)(()=>_e.getFormatEntityName(t.contragent));return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,nd,(0,r.toDisplayString)(n.value),1))}}),id={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function ad(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,id,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.createElementVNode)(`path`,{d:`M3 7a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}),(0,r.createElementVNode)(`path`,{d:`m3 7l9 6l9-6`})],-1)]])}var od=(0,r.markRaw)({name:`tabler-mail`,render:ad}),sd=[`href`],cd=(0,r.defineComponent)({__name:`email`,props:{email:{default:``},showEmailIcon:{type:Boolean,default:!1}},setup(e){return(t,n)=>{let i=od;return(0,r.openBlock)(),(0,r.createElementBlock)(`span`,{class:(0,r.normalizeClass)({"flex flex-row items-center gap-1":e.showEmailIcon})},[e.showEmailIcon?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`a`,{href:`mailto:${e.email}`,class:`no-underline`},(0,r.toDisplayString)(e.email),9,sd)],2)}}}),ld={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function ud(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,ld,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M444 49.9C431.3 38.2 379.9.9 265.3.4c0 0-135.1-8.1-200.9 52.3C27.8 89.3 14.9 143 13.5 209.5s-3.1 191.1 117 224.9h.1l-.1 51.6s-.8 20.9 13 25.1c16.6 5.2 26.4-10.7 42.3-27.8c8.7-9.4 20.7-23.2 29.8-33.7c82.2 6.9 145.3-8.9 152.5-11.2c16.6-5.4 110.5-17.4 125.7-142c15.8-128.6-7.6-209.8-49.8-246.5M457.9 287c-12.9 104-89 110.6-103 115.1c-6 1.9-61.5 15.7-131.2 11.2c0 0-52 62.7-68.2 79c-5.3 5.3-11.1 4.8-11-5.7c0-6.9.4-85.7.4-85.7q-.15 0 0 0C43.1 372.7 49.1 266.6 50.2 211.1s11.6-101 42.6-131.6c55.7-50.5 170.4-43 170.4-43c96.9.4 143.3 29.6 154.1 39.4c35.7 30.6 53.9 103.8 40.6 211.1m-139-80.8c.4 8.6-12.5 9.2-12.9.6c-1.1-22-11.4-32.7-32.6-33.9c-8.6-.5-7.8-13.4.7-12.9c27.9 1.5 43.4 17.5 44.8 46.2m20.3 11.3c1-42.4-25.5-75.6-75.8-79.3c-8.5-.6-7.6-13.5.9-12.9c58 4.2 88.9 44.1 87.8 92.5c-.1 8.6-13.1 8.2-12.9-.3m47 13.4c.1 8.6-12.9 8.7-12.9.1c-.6-81.5-54.9-125.9-120.8-126.4c-8.5-.1-8.5-12.9 0-12.9c73.7.5 133 51.4 133.7 139.2M374.9 329v.2c-10.8 19-31 40-51.8 33.3l-.2-.3c-21.1-5.9-70.8-31.5-102.2-56.5c-16.2-12.8-31-27.9-42.4-42.4c-10.3-12.9-20.7-28.2-30.8-46.6c-21.3-38.5-26-55.7-26-55.7c-6.7-20.8 14.2-41 33.3-51.8h.2c9.2-4.8 18-3.2 23.9 3.9c0 0 12.4 14.8 17.7 22.1c5 6.8 11.7 17.7 15.2 23.8c6.1 10.9 2.3 22-3.7 26.6l-12 9.6c-6.1 4.9-5.3 14-5.3 14s17.8 67.3 84.3 84.3c0 0 9.1.8 14-5.3l9.6-12c4.6-6 15.7-9.8 26.6-3.7c14.7 8.3 33.4 21.2 45.8 32.9c7 5.7 8.6 14.4 3.8 23.6`},null,-1)]])}var dd=(0,r.markRaw)({name:`fa6-brands-viber`,render:ud}),fd={viewBox:`0 0 256 258`,width:`1.2em`,height:`1.2em`},pd=[`id`],md=[`id`],hd=[`fill`],gd=[`fill`];function _d(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,fd,[(0,r.createElementVNode)(`defs`,null,[(0,r.createElementVNode)(`linearGradient`,{id:e.idMap.SVGK3KZq49U,x1:`50%`,x2:`50%`,y1:`100%`,y2:`0%`},[...t[0]||=[(0,r.createElementVNode)(`stop`,{offset:`0%`,"stop-color":`#1faf38`},null,-1),(0,r.createElementVNode)(`stop`,{offset:`100%`,"stop-color":`#60d669`},null,-1)]],8,pd),(0,r.createElementVNode)(`linearGradient`,{id:e.idMap.SVGefMkoEOd,x1:`50%`,x2:`50%`,y1:`100%`,y2:`0%`},[...t[1]||=[(0,r.createElementVNode)(`stop`,{offset:`0%`,"stop-color":`#f9f9f9`},null,-1),(0,r.createElementVNode)(`stop`,{offset:`100%`,"stop-color":`#fff`},null,-1)]],8,md)]),(0,r.createElementVNode)(`path`,{fill:`url(#`+e.idMap.SVGK3KZq49U+`)`,d:`M5.463 127.456c-.006 21.677 5.658 42.843 16.428 61.499L4.433 252.697l65.232-17.104a123 123 0 0 0 58.8 14.97h.054c67.815 0 123.018-55.183 123.047-123.01c.013-32.867-12.775-63.773-36.009-87.025c-23.23-23.25-54.125-36.061-87.043-36.076c-67.823 0-123.022 55.18-123.05 123.004`},null,8,hd),(0,r.createElementVNode)(`path`,{fill:`url(#`+e.idMap.SVGefMkoEOd+`)`,d:`M1.07 127.416c-.007 22.457 5.86 44.38 17.014 63.704L0 257.147l67.571-17.717c18.618 10.151 39.58 15.503 60.91 15.511h.055c70.248 0 127.434-57.168 127.464-127.423c.012-34.048-13.236-66.065-37.3-90.15C194.633 13.286 162.633.014 128.536 0C58.276 0 1.099 57.16 1.071 127.416m40.24 60.376l-2.523-4.005c-10.606-16.864-16.204-36.352-16.196-56.363C22.614 69.029 70.138 21.52 128.576 21.52c28.3.012 54.896 11.044 74.9 31.06c20.003 20.018 31.01 46.628 31.003 74.93c-.026 58.395-47.551 105.91-105.943 105.91h-.042c-19.013-.01-37.66-5.116-53.922-14.765l-3.87-2.295l-40.098 10.513z`},null,8,gd),t[2]||=(0,r.createElementVNode)(`path`,{fill:`#fff`,d:`M96.678 74.148c-2.386-5.303-4.897-5.41-7.166-5.503c-1.858-.08-3.982-.074-6.104-.074c-2.124 0-5.575.799-8.492 3.984c-2.92 3.188-11.148 10.892-11.148 26.561s11.413 30.813 13.004 32.94c1.593 2.123 22.033 35.307 54.405 48.073c26.904 10.609 32.379 8.499 38.218 7.967c5.84-.53 18.844-7.702 21.497-15.139c2.655-7.436 2.655-13.81 1.859-15.142c-.796-1.327-2.92-2.124-6.105-3.716s-18.844-9.298-21.763-10.361c-2.92-1.062-5.043-1.592-7.167 1.597c-2.124 3.184-8.223 10.356-10.082 12.48c-1.857 2.129-3.716 2.394-6.9.801c-3.187-1.598-13.444-4.957-25.613-15.806c-9.468-8.442-15.86-18.867-17.718-22.056c-1.858-3.184-.199-4.91 1.398-6.497c1.431-1.427 3.186-3.719 4.78-5.578c1.588-1.86 2.118-3.187 3.18-5.311c1.063-2.126.531-3.986-.264-5.579c-.798-1.593-6.987-17.343-9.819-23.64`},null,-1)])}var vd=(0,r.markRaw)({name:`logos-whatsapp-icon`,render:_d,setup(){let e=()=>Math.random().toString(36).substr(2,10);return{idMap:{SVGK3KZq49U:`uicons-`+e(),SVGefMkoEOd:`uicons-`+e()}}}}),yd={viewBox:`0 0 256 256`,width:`1.2em`,height:`1.2em`},bd=[`id`],xd=[`fill`];function Sd(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,yd,[(0,r.createElementVNode)(`defs`,null,[(0,r.createElementVNode)(`linearGradient`,{id:e.idMap.SVG6DaOZcwt,x1:`50%`,x2:`50%`,y1:`0%`,y2:`100%`},[...t[0]||=[(0,r.createElementVNode)(`stop`,{offset:`0%`,"stop-color":`#2aabee`},null,-1),(0,r.createElementVNode)(`stop`,{offset:`100%`,"stop-color":`#229ed9`},null,-1)]],8,bd)]),(0,r.createElementVNode)(`path`,{fill:`url(#`+e.idMap.SVG6DaOZcwt+`)`,d:`M128 0C94.06 0 61.48 13.494 37.5 37.49A128.04 128.04 0 0 0 0 128c0 33.934 13.5 66.514 37.5 90.51C61.48 242.506 94.06 256 128 256s66.52-13.494 90.5-37.49c24-23.996 37.5-56.576 37.5-90.51s-13.5-66.514-37.5-90.51C194.52 13.494 161.94 0 128 0`},null,8,xd),t[1]||=(0,r.createElementVNode)(`path`,{fill:`#fff`,d:`M57.94 126.648q55.98-24.384 74.64-32.152c35.56-14.786 42.94-17.354 47.76-17.441c1.06-.017 3.42.245 4.96 1.49c1.28 1.05 1.64 2.47 1.82 3.467c.16.996.38 3.266.2 5.038c-1.92 20.24-10.26 69.356-14.5 92.026c-1.78 9.592-5.32 12.808-8.74 13.122c-7.44.684-13.08-4.912-20.28-9.63c-11.26-7.386-17.62-11.982-28.56-19.188c-12.64-8.328-4.44-12.906 2.76-20.386c1.88-1.958 34.64-31.748 35.26-34.45c.08-.338.16-1.598-.6-2.262c-.74-.666-1.84-.438-2.64-.258c-1.14.256-19.12 12.152-54 35.686c-5.1 3.508-9.72 5.218-13.88 5.128c-4.56-.098-13.36-2.584-19.9-4.708c-8-2.606-14.38-3.984-13.82-8.41c.28-2.304 3.46-4.662 9.52-7.072`},null,-1)])}var Cd=(0,r.markRaw)({name:`logos-telegram`,render:Sd,setup(){return{idMap:{SVG6DaOZcwt:`uicons-`+Math.random().toString(36).substr(2,10)}}}}),wd={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Td(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,wd,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M391 480c-19.52 0-46.94-7.06-88-30c-49.93-28-88.55-53.85-138.21-103.38C116.91 298.77 93.61 267.79 61 208.45c-36.84-67-30.56-102.12-23.54-117.13C45.82 73.38 58.16 62.65 74.11 52a176.3 176.3 0 0 1 28.64-15.2c1-.43 1.93-.84 2.76-1.21c4.95-2.23 12.45-5.6 21.95-2c6.34 2.38 12 7.25 20.86 16c18.17 17.92 43 57.83 52.16 77.43c6.15 13.21 10.22 21.93 10.23 31.71c0 11.45-5.76 20.28-12.75 29.81c-1.31 1.79-2.61 3.5-3.87 5.16c-7.61 10-9.28 12.89-8.18 18.05c2.23 10.37 18.86 41.24 46.19 68.51s57.31 42.85 67.72 45.07c5.38 1.15 8.33-.59 18.65-8.47c1.48-1.13 3-2.3 4.59-3.47c10.66-7.93 19.08-13.54 30.26-13.54h.06c9.73 0 18.06 4.22 31.86 11.18c18 9.08 59.11 33.59 77.14 51.78c8.77 8.84 13.66 14.48 16.05 20.81c3.6 9.53.21 17-2 22c-.37.83-.78 1.74-1.21 2.75a176.5 176.5 0 0 1-15.29 28.58c-10.63 15.9-21.4 28.21-39.38 36.58A67.4 67.4 0 0 1 391 480`},null,-1)]])}var Ed=(0,r.markRaw)({name:`ion-call`,render:Td}),Dd={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Od(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Dd,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5L15 13l5 2v4a2 2 0 0 1-2 2A16 16 0 0 1 3 6a2 2 0 0 1 2-2m10 3a2 2 0 0 1 2 2m-2-6a6 6 0 0 1 6 6`},null,-1)]])}var kd=(0,r.markRaw)({name:`tabler-phone-call`,render:Od}),Ad={key:0,class:`absolute left-0 top-0 flex w-full flex-row items-center justify-around text-center backdrop-blur-sm`},jd=[`href`],Md=[`href`],Nd=[`href`],Pd=[`href`],Fd=(0,r.defineComponent)({__name:`phone`,props:{defaultCountry:{},phone:{default:``},showPhoneIcon:{type:Boolean,default:!1}},setup(e){let t=e,i=(0,r.computed)(()=>{try{return t.phone?(0,s.parsePhoneNumberWithError)(t.phone,t.defaultCountry):void 0}catch{}return t.phone}),a=(0,r.computed)(()=>(0,n.isString)(i.value)?!1:i.value?.isValid()??!1),o=(0,r.computed)(()=>(0,n.isString)(i.value)?i.value:i.value?.format(`INTERNATIONAL`)??``),c=(0,r.computed)(()=>(0,n.isString)(i.value)?i.value:i.value?.format(`E.164`)??``),l=(0,r.ref)(!1);return(t,n)=>{let i=kd,s=Ed,u=Cd,d=vd,f=dd;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"border-xl relative inline-flex items-center rounded px-2":a.value&&l.value,"min-w-10":!0}),onClick:n[0]||=e=>l.value=!l.value,onFocusout:n[1]||=e=>l.value=!1,onMouseleave:n[2]||=e=>l.value=!1},[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)({"flex flex-row items-center gap-1":e.showPhoneIcon})},[e.showPhoneIcon?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0})):(0,r.createCommentVNode)(``,!0),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(o.value),1)],2),a.value&&l.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ad,[a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`tel:${c.value}`,class:`text-blue-600 hover:animate-pulse hover:text-blue-600`},[(0,r.createVNode)(s)],8,jd)):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:1,href:`https://t.me/${c.value}`,target:`_blank`,rel:`noopener noreferrer`,class:`hover:animate-pulse`},[(0,r.createVNode)(u)],8,Md)):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:2,href:`https://wa.me/${c.value.substring(1)}`,target:`_blank`,rel:`noopener noreferrer`,class:`hover:animate-pulse`},[(0,r.createVNode)(d)],8,Nd)):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:3,href:`viber://chat?number=${c.value}`,class:`text-purple-600 hover:animate-pulse hover:text-purple-600`},[(0,r.createVNode)(f)],8,Pd)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)],34)])}}}),Id={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function Ld(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Id,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`m20 8l-8 5l-8-5V6l8 5l8-5m0-2H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2`},null,-1)]])}var Rd=(0,r.markRaw)({name:`mdi-envelope`,render:Ld}),zd={class:`flex flex-col gap-1`},Bd={key:0,class:`mb-2 flex flex-col text-base`},Vd={key:0,class:`text-sc-dark-grey text-sm`},Hd={key:1,class:`whitespace-nowrap text-sm`},Ud={key:2,class:`whitespace-nowrap text-sm`},Wd={key:3,class:`absolute left-0 top-0 flex size-full items-center justify-around rounded-md text-center text-2xl backdrop-blur-sm`},Gd=[`href`],Kd=[`href`],qd=[`href`],Jd=[`href`],Yd=[`href`],Xd={key:0,class:`flex flex-col text-base`},Zd={key:0,class:`text-sc-dark-grey text-sm`},Qd={key:1,class:`mt-2 text-sm`},$d={key:0,class:`-mt-1`},ef=(0,r.defineComponent)({__name:`person-contacts-block`,props:{defaultCountry:{},contact:{},fullView:{type:Boolean,default:!0},classes:{default:``},styles:{default:void 0}},setup(e){let t=e,i=(0,r.computed)(()=>_e.getFormatEntityName(t.contact)),a=(0,r.computed)(()=>{try{return t.contact.phone?(0,s.parsePhoneNumberWithError)(t.contact.phone,t.defaultCountry):void 0}catch{}return t.contact.phone}),c=(0,r.computed)(()=>(0,n.isString)(a.value)?!1:a.value?.isValid()??!1),l=(0,r.computed)(()=>(0,n.isString)(a.value)?a.value:a.value?.format(`INTERNATIONAL`)??``),u=(0,r.computed)(()=>(0,n.isString)(a.value)?a.value:a.value?.format(`E.164`)??``),d=(0,r.computed)(()=>c.value||t.contact.email),f=(0,r.ref)(!1);return(t,n)=>{let a=Ed,s=Cd,p=vd,m=dd,h=Rd,g=o.NPopover;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,zd,[(0,r.createVNode)(g,{disabled:e.fullView,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)(`relative contact-btn px-3 py-2 rounded-md items-center inline-flex bg-gray-50 ${e.contact?.isPrimary?`ring-1 ring-inset ring-green-600 hover:ring-gray-200`:``} ${e.classes}`),style:(0,r.normalizeStyle)(e.styles),onMouseenter:n[0]||=e=>f.value=!0,onFocusin:n[1]||=e=>f.value=!0,onMouseleave:n[2]||=e=>f.value=!1,onFocusout:n[3]||=e=>f.value=!1},[(0,r.createElementVNode)(`div`,null,[e.fullView&&(e.contact.name||e.contact?.position)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Bd,[(0,r.createTextVNode)((0,r.toDisplayString)(i.value)+` `,1),e.contact?.position?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Vd,(0,r.toDisplayString)(e.contact?.position),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0),e.contact.phone?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Hd,(0,r.toDisplayString)(l.value),1)):(0,r.createCommentVNode)(``,!0),e.contact.email?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ud,(0,r.toDisplayString)(e.contact.email),1)):(0,r.createCommentVNode)(``,!0),d.value&&f.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Wd,[c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`tel:${u.value}`,class:`text-blue-600 hover:text-3xl hover:text-blue-600`},[(0,r.createVNode)(a)],8,Gd)):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:1,href:`https://t.me/${u.value}`,target:`_blank`,rel:`noopener noreferrer`,class:`hover:text-3xl`},[(0,r.createVNode)(s)],8,Kd)):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:2,href:`https://wa.me/${u.value.substring(1)}`,target:`_blank`,rel:`noopener noreferrer`,class:`hover:text-3xl`},[(0,r.createVNode)(p)],8,qd)):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:3,href:`viber://chat?number=${u.value}`,class:`text-purple-600 hover:text-3xl hover:text-purple-600`},[(0,r.createVNode)(m)],8,Jd)):(0,r.createCommentVNode)(``,!0),e.contact.email?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:4,href:`mailto:${e.contact.email}`,class:`hover:text-3xl`},[(0,r.createVNode)(h)],8,Yd)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)])],38)]),default:(0,r.withCtx)(()=>[e.contact.name?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Xd,[(0,r.createTextVNode)((0,r.toDisplayString)(i.value)+` `,1),e.contact?.position?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,Zd,(0,r.toDisplayString)(e.contact?.position),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0),e.contact?.comment?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Qd,[n[4]||=(0,r.createElementVNode)(`sup`,null,`**`,-1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.contact?.comment),1)])):(0,r.createCommentVNode)(``,!0)]),_:1},8,[`disabled`]),e.fullView&&e.contact?.comment?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,$d,[n[5]||=(0,r.createElementVNode)(`sup`,null,`**`,-1),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.contact?.comment),1)])):(0,r.createCommentVNode)(``,!0)])}}}),tf=class{minHeight;maxHeights;minWidth;maxWidths;netType;color;mountType;descriptions;crossbarCount;heightOverlaps;widthOverlaps;canSetDopProdaga;constructor(e){this.color=e.color,this.crossbarCount=e.crossbarCount,this.descriptions=(0,c.objectToSnake)(e.descriptions),this.maxHeights=e.maxHeights,this.maxWidths=e.maxWidths,this.minHeight=e.minHeight,this.minWidth=e.minWidth,this.mountType=e.mountType,this.netType=e.netType,this.heightOverlaps=(0,c.objectToSnake)(e.heightOverlaps),this.widthOverlaps=(0,c.objectToSnake)(e.widthOverlaps),this.canSetDopProdaga=e.canSetDopProdaga}};function nf(e){return e.properties?.configurator!==t.ConfiguratorsEnum.SandwichM2||e.properties.configuratorSettings!==void 0&&(0,n.isArray)(e.products)&&e.products.length>0}var rf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function af(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,rf,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M16 12a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2m-6 0a2 2 0 0 1 2-2a2 2 0 0 1 2 2a2 2 0 0 1-2 2a2 2 0 0 1-2-2`},null,-1)]])}var of=(0,r.markRaw)({name:`mdi-dots-horizontal`,render:af}),sf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function cf(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,sf,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M15.5 14h-.79l-.28-.27A6.47 6.47 0 0 0 16 9.5A6.5 6.5 0 0 0 9.5 3A6.5 6.5 0 0 0 3 9.5A6.5 6.5 0 0 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5l1.5-1.5zm-6 0C7 14 5 12 5 9.5S7 5 9.5 5S14 7 14 9.5S12 14 9.5 14M7 9h5v1H7z`},null,-1)]])}var lf=(0,r.markRaw)({name:`mdi-magnify-minus-outline`,render:cf}),uf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function df(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,uf,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`m15.5 14l5 5l-1.5 1.5l-5-5v-.79l-.27-.28A6.47 6.47 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27zm-6 0C12 14 14 12 14 9.5S12 5 9.5 5S5 7 5 9.5S7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2z`},null,-1)]])}var ff=(0,r.markRaw)({name:`mdi-magnify-plus-outline`,render:df}),pf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function mf(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,pf,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M8.59 16.58L13.17 12L8.59 7.41L10 6l6 6l-6 6z`},null,-1)]])}var hf=(0,r.markRaw)({name:`mdi-chevron-right`,render:mf}),gf={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function _f(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,gf,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M15.41 16.58L10.83 12l4.58-4.59L14 6l-6 6l6 6z`},null,-1)]])}var vf=(0,r.markRaw)({name:`mdi-chevron-left`,render:_f}),yf={heightMedium:`40px`,paddingMedium:`0 16px`,borderRadiusMedium:`10px`,fontSizeMedium:`14px`,iconSizeMedium:`18px`,iconMarginMedium:`8px`,border:`1px solid #d1d5db`,borderHover:`1px solid #9ca3af`,borderPressed:`1px solid #9ca3af`,borderFocus:`1px solid #9ca3af`},bf={heightSmall:`36px`,paddingSmall:`0 10px`,borderRadiusSmall:`8px`,iconSizeSmall:`18px`,border:`1px solid #d1d5db`,borderHover:`1px solid #9ca3af`,borderPressed:`1px solid #9ca3af`,borderFocus:`1px solid #9ca3af`},xf=`date-range.dialog.mode`,Sf=`date-range.dialog.scale`,Cf=`date-range.quick-periods`,wf=[`thisMonth`,`lastMonth`,`thisQuarter`,`lastQuarter`,`thisYear`,`lastYear`,`fromBeginningOfThisYear`],Tf=[`Янв`,`Фев`,`Мар`,`Апр`,`Май`,`Июн`,`Июл`,`Авг`,`Сен`,`Окт`,`Ноя`,`Дек`],Ef=[`Январь`,`Февраль`,`Март`,`Апрель`,`Май`,`Июнь`,`Июль`,`Август`,`Сентябрь`,`Октябрь`,`Ноябрь`,`Декабрь`],Df=[`Пн`,`Вт`,`Ср`,`Чт`,`Пт`,`Сб`,`Вс`],Of=new Date(2e3,0,1),kf=e=>(0,i.differenceInCalendarDays)(e,Of),Af=e=>(0,i.addDays)(Of,e),jf=(e,t,n)=>{let r=e??void 0,a=t??void 0;return r&&a&&r>a&&(n?.from?a=r:n?.to?r=a:[r,a]=[a,r]),{from:r?(0,i.startOfDay)(r):void 0,to:a?(0,i.endOfDay)(a):void 0}},Mf=e=>Object.entries(e).map(([e,t])=>({value:e,label:t.label,item:t})),Nf=(e,n)=>{let r=Object.entries(e).filter(([,e])=>e.group===n);return n===`other`?t.STANDARD_PERIOD_SECTIONS.map(e=>{let t=r.filter(([,t])=>t.section===e.key);return{type:`group`,key:e.key,label:e.label,children:Mf(Object.fromEntries(t))}}).filter(e=>e.children.length>0):[{type:`group`,key:n,children:Mf(Object.fromEntries(r))}]},Pf=(e,t)=>{let n=(0,r.ref)(null),i=(0,r.ref)(null),a=(0,r.ref)(!1),o=(0,r.ref)(null),s=(e,t)=>e<=t?[e,t]:[t,e],c=(0,r.computed)(()=>a.value&&i.value!==null&&o.value!==null?s(i.value,o.value):n.value===null?e.value:o.value===null?[n.value,n.value]:s(n.value,o.value)),l=(e,r)=>{n.value=null,t(...s(e,r))},u=e=>{n.value===null?(n.value=e,t(e,e)):l(n.value,e)},d=()=>{globalThis.removeEventListener(`pointerup`,d);let e=i.value;e!==null&&(i.value=null,a.value?(a.value=!1,o.value!==null&&l(e,o.value)):u(e))};return(0,r.onBeforeUnmount)(()=>{globalThis.removeEventListener(`pointerup`,d)}),{activeRange:c,cellPosition:e=>{let t=c.value;return!t||e<t[0]||e>t[1]?null:e===t[0]||e===t[1]?`bound`:`in-range`},pointerDownHandler:e=>{i.value=e,a.value=!1,globalThis.addEventListener(`pointerup`,d)},pointerEnterHandler:e=>{o.value=e,i.value!==null&&e!==i.value&&(a.value=!0)},pointerLeaveHandler:()=>{o.value=null},selectHandler:u}},Ff={class:`flex items-center justify-between gap-2`},If={class:`flex items-center gap-2`},Lf={class:`text-center font-semibold`},Rf={class:`grid grid-cols-7 gap-0.5 text-center text-xs text-gray-500`},zf={class:`grid grid-cols-7 gap-0.5`},Bf=[`disabled`,`onPointerdown`,`onPointerenter`,`onKeydown`],Vf=bt((0,r.defineComponent)({__name:`day-range-grid`,props:{from:{},to:{}},emits:[`select`],setup(e,{emit:t}){let a=e,s=t,c=(0,o.useThemeVars)(),l=(0,r.computed)(()=>({"--sc-primary-color":c.value.primaryColor,"--sc-primary-color-hover":c.value.primaryColorHover,"--sc-primary-color-suppl":c.value.primaryColorSuppl,"--sc-hover-color":c.value.hoverColor})),u=oe.initRefDependingOnDeviceResolution(1,2,3),d=(0,r.computed)(()=>[`grid-cols-1`,`grid-cols-2`,`grid-cols-3`][u.value-1]),f=e=>(0,i.subMonths)((0,i.startOfMonth)(e),+(u.value===3)),p=(0,r.ref)(f((e=>e&&(0,i.isValid)(e)?e:new Date)(a.from??a.to))),m=Pf((0,r.computed)(()=>{let{from:e,to:t}=a;return!e||!t||!(0,i.isValid)(e)||!(0,i.isValid)(t)?null:[kf(e),kf(t)]}),(e,t)=>{s(`select`,{from:(0,i.startOfDay)(Af(e)),to:(0,i.endOfDay)(Af(t))})}),h=e=>{let t=(0,i.subDays)(e,((0,i.getDay)(e)+6)%7);return(0,n.times)(42,n=>{let r=(0,i.addDays)(t,n);return{index:kf(r),day:r.getDate(),isCurrentMonth:(0,i.isSameMonth)(r,e),isToday:(0,i.isToday)(r)}})},g=(0,r.computed)(()=>(0,n.times)(u.value,e=>{let t=(0,i.addMonths)(p.value,e);return{key:`${t.getFullYear()}-${t.getMonth()}`,title:`${Ef[t.getMonth()]} ${t.getFullYear()}`,cells:h(t)}})),_=e=>{if(!e.isCurrentMonth)return[`sc-day--outside`];let t=e.isToday?[`sc-day--today`]:[],n=m.cellPosition(e.index);return n&&t.push(`sc-day--${n}`),t};return(0,r.watch)(()=>[a.from,a.to],()=>{let e=a.from??a.to;if(!e||!(0,i.isValid)(e))return;let t=`${e.getFullYear()}-${e.getMonth()}`;(0,n.some)(g.value,[`key`,t])||(p.value=f(e))}),(e,t)=>{let n=vf,a=o.NButton,s=hf;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:`flex select-none flex-col gap-3`,style:(0,r.normalizeStyle)(l.value),onPointerleave:t[2]||=(...e)=>(0,r.unref)(m).pointerLeaveHandler&&(0,r.unref)(m).pointerLeaveHandler(...e)},[(0,r.createElementVNode)(`div`,Ff,[(0,r.createVNode)(a,{size:`small`,"aria-label":`Предыдущий месяц`,"theme-overrides":(0,r.unref)(bf),onClick:t[0]||=e=>p.value=(0,r.unref)(i.subMonths)(p.value,1)},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(n)]),_:1},8,[`theme-overrides`]),t[3]||=(0,r.createElementVNode)(`span`,{class:`text-sm text-gray-600`},`Выберите диапазон на календаре`,-1),(0,r.createElementVNode)(`div`,If,[(0,r.renderSlot)(e.$slots,`actions`,{},void 0,!0),(0,r.createVNode)(a,{size:`small`,"aria-label":`Следующий месяц`,"theme-overrides":(0,r.unref)(bf),onClick:t[1]||=e=>p.value=(0,r.unref)(i.addMonths)(p.value,1)},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(s)]),_:1},8,[`theme-overrides`])])]),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`grid gap-3`,d.value])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(g.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:e.key,class:`flex flex-col gap-1`},[(0,r.createElementVNode)(`div`,Lf,(0,r.toDisplayString)(e.title),1),(0,r.createElementVNode)(`div`,Rf,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(Df),e=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:e},(0,r.toDisplayString)(e),1))),128))]),(0,r.createElementVNode)(`div`,zf,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.cells,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:e.index,type:`button`,class:(0,r.normalizeClass)([`sc-day h-7 rounded border-0 p-0 text-xs`,_(e)]),disabled:!e.isCurrentMonth,onPointerdown:(0,r.withModifiers)(t=>(0,r.unref)(m).pointerDownHandler(e.index),[`prevent`]),onPointerenter:t=>(0,r.unref)(m).pointerEnterHandler(e.index),onKeydown:[(0,r.withKeys)((0,r.withModifiers)(t=>(0,r.unref)(m).selectHandler(e.index),[`prevent`]),[`enter`]),(0,r.withKeys)((0,r.withModifiers)(t=>(0,r.unref)(m).selectHandler(e.index),[`prevent`]),[`space`])]},(0,r.toDisplayString)(e.day),43,Bf))),128))])]))),128))],2),t[4]||=(0,r.createStaticVNode)(`<div class="flex flex-wrap items-center gap-x-6 gap-y-1 text-xs text-gray-700" data-v-0a24c228><span class="flex items-center gap-2" data-v-0a24c228><i class="sc-legend sc-legend--bound" data-v-0a24c228></i>Дата начала</span><span class="flex items-center gap-2" data-v-0a24c228><i class="sc-legend sc-legend--in-range" data-v-0a24c228></i>Выбранный период</span><span class="flex items-center gap-2" data-v-0a24c228><i class="sc-legend sc-legend--bound" data-v-0a24c228></i>Дата окончания</span></div>`,1)],36)}}}),[[`__scopeId`,`data-v-0a24c228`]]),Hf={class:`flex items-center justify-between gap-2`},Uf={class:`flex items-center gap-2`},Wf={class:`text-center font-semibold`},Gf={class:`grid grid-cols-3 gap-2`},Kf=[`onPointerdown`,`onPointerenter`,`onKeydown`],qf=bt((0,r.defineComponent)({__name:`month-range-grid`,props:{from:{},to:{}},emits:[`select`],setup(e,{emit:t}){let n=e,a=t,s=(0,o.useThemeVars)(),c=(0,r.computed)(()=>({"--sc-primary-color":s.value.primaryColor,"--sc-primary-color-hover":s.value.primaryColorHover,"--sc-primary-color-suppl":s.value.primaryColorSuppl,"--sc-hover-color":s.value.hoverColor})),l=(0,r.ref)((e=>{let t=new Date().getFullYear();return e&&(0,i.isValid)(e)?e.getFullYear():t})(n.from??n.to)),u=oe.initRefDependingOnDeviceResolution(1,3,3),d=(0,r.computed)(()=>u.value===1?[l.value]:[l.value-1,l.value,l.value+1]),f=Pf((0,r.computed)(()=>{let{from:e,to:t}=n;return!e||!t||!(0,i.isValid)(e)||!(0,i.isValid)(t)?null:[e.getFullYear()*12+e.getMonth(),t.getFullYear()*12+t.getMonth()]}),(e,t)=>{a(`select`,{from:new Date(Math.floor(e/12),e%12,1),to:(0,i.endOfMonth)(new Date(Math.floor(t/12),t%12,1))})}),p=(e,t)=>{let n=f.cellPosition(e*12+t);return n?[`sc-month--${n}`]:[]};return(0,r.watch)(()=>[n.from,n.to],()=>{let e=n.from??n.to;if(!e||!(0,i.isValid)(e))return;let t=e.getFullYear();(t<l.value-1||t>l.value+1)&&(l.value=t)}),(e,t)=>{let n=vf,i=o.NButton,a=hf;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:`flex select-none flex-col gap-3`,style:(0,r.normalizeStyle)(c.value),onPointerleave:t[2]||=(...e)=>(0,r.unref)(f).pointerLeaveHandler&&(0,r.unref)(f).pointerLeaveHandler(...e)},[(0,r.createElementVNode)(`div`,Hf,[(0,r.createVNode)(i,{size:`small`,"aria-label":`Предыдущий год`,"theme-overrides":(0,r.unref)(bf),onClick:t[0]||=e=>--l.value},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(n)]),_:1},8,[`theme-overrides`]),t[3]||=(0,r.createElementVNode)(`span`,{class:`text-sm text-gray-600`},`Выберите диапазон месяцев`,-1),(0,r.createElementVNode)(`div`,Uf,[(0,r.renderSlot)(e.$slots,`actions`,{},void 0,!0),(0,r.createVNode)(i,{size:`small`,"aria-label":`Следующий год`,"theme-overrides":(0,r.unref)(bf),onClick:t[1]||=e=>l.value+=1},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`theme-overrides`])])]),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`grid gap-4 sm:gap-6`,d.value.length===1?`grid-cols-1`:`grid-cols-3`])},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(d.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:e,class:`flex flex-col gap-2`},[(0,r.createElementVNode)(`div`,Wf,(0,r.toDisplayString)(e),1),(0,r.createElementVNode)(`div`,Gf,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(Tf),(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`button`,{key:t,type:`button`,class:(0,r.normalizeClass)([`sc-month cursor-pointer rounded-lg px-1 py-2.5 text-sm`,p(e,n)]),onPointerdown:(0,r.withModifiers)(t=>(0,r.unref)(f).pointerDownHandler(e*12+n),[`prevent`]),onPointerenter:t=>(0,r.unref)(f).pointerEnterHandler(e*12+n),onKeydown:[(0,r.withKeys)((0,r.withModifiers)(t=>(0,r.unref)(f).selectHandler(e*12+n),[`prevent`]),[`enter`]),(0,r.withKeys)((0,r.withModifiers)(t=>(0,r.unref)(f).selectHandler(e*12+n),[`prevent`]),[`space`])]},(0,r.toDisplayString)(t),43,Kf))),128))])]))),128))],2)],36)}}}),[[`__scopeId`,`data-v-4b12bde5`]]),Jf={class:`sc-date-range-sidebar flex flex-col gap-1`},Yf={class:`flex items-center justify-center gap-1`},Xf={class:`min-w-12 text-center font-semibold`},Zf={class:`grid grid-flow-col grid-cols-2 grid-rows-6 gap-1`},Qf=(0,r.defineComponent)({__name:`month-year-sidebar`,props:{year:{},month:{}},emits:[`update:year`,`select-month`,`today`],setup(e,{emit:t}){let n=t;return(t,i)=>{let a=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Jf,[(0,r.createElementVNode)(`div`,Yf,[(0,r.createVNode)(a,{size:`small`,quaternary:``,onClick:i[0]||=t=>n(`update:year`,e.year-1)},{default:(0,r.withCtx)(()=>[...i[3]||=[(0,r.createTextVNode)(` ‹ `,-1)]]),_:1}),(0,r.createElementVNode)(`span`,Xf,(0,r.toDisplayString)(e.year),1),(0,r.createVNode)(a,{size:`small`,quaternary:``,onClick:i[1]||=t=>n(`update:year`,e.year+1)},{default:(0,r.withCtx)(()=>[...i[4]||=[(0,r.createTextVNode)(` › `,-1)]]),_:1})]),(0,r.createElementVNode)(`div`,Zf,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(Tf),(t,i)=>((0,r.openBlock)(),(0,r.createBlock)(a,{key:t,size:`small`,quaternary:``,type:i===e.month?`primary`:`default`,onClick:e=>n(`select-month`,i)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(t),1)]),_:2},1032,[`type`,`onClick`]))),128))]),(0,r.createVNode)(a,{size:`small`,text:``,type:`info`,onClick:i[2]||=e=>n(`today`)},{default:(0,r.withCtx)(()=>[...i[5]||=[(0,r.createTextVNode)(` Сегодня `,-1)]]),_:1})])}}}),$f=(0,r.defineComponent)({__name:`date-range-input`,props:{clearable:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},placeholder:{default:void 0},value:{default:null},dateFormat:{default:()=>(0,t.useBaseConfigStore)().config.dateFormats.uiDate}},emits:[`update:value`],setup(e,{emit:t}){let n=e,a=t,s=oe.initRefDependingOnDeviceResolution(!0,!1,!1),c=(0,r.ref)(null),l=(0,r.ref)(!1),u=(0,r.ref)(0),d=(0,r.ref)(n.value&&(0,i.isValid)(n.value)?n.value:new Date),f=(0,r.computed)(()=>{let e=n.value&&(0,i.isValid)(n.value)?n.value:d.value;return e.getFullYear()===d.value.getFullYear()?e.getMonth():null}),p=0,m=e=>{e.target?.closest?.(`.n-base-clear__clear`)&&(p=performance.now())},h=e=>{e&&performance.now()-p<300||(l.value=e,e&&(d.value=n.value&&(0,i.isValid)(n.value)?n.value:new Date))},g=e=>{a(`update:value`,e===null?null:new Date(e))},_=(e,t)=>{let o=new Date(e,t,1);if(d.value=o,n.value&&(0,i.isValid)(n.value)){let r=Math.min((0,i.getDate)(n.value),(0,i.getDaysInMonth)(o));a(`update:value`,new Date(e,t,r))}else u.value+=1,(0,r.nextTick)().then(()=>c.value?.focus())},v=(e,t)=>{d.value=(0,i.addYears)((0,i.addMonths)(d.value,e),t)},y=e=>{_(e,d.value.getMonth())},b=e=>{_(d.value.getFullYear(),e)},x=()=>{l.value=!1,a(`update:value`,new Date)};return(t,i)=>{let a=o.NButton,p=o.NDatePicker;return(0,r.openBlock)(),(0,r.createBlock)(p,{ref_key:`pickerReference`,ref:c,key:u.value,value:n.value?n.value.getTime():null,show:l.value,clearable:e.clearable,disabled:e.disabled,placeholder:e.placeholder,format:e.dateFormat,actions:[],"default-calendar-start-time":d.value.getTime(),type:`date`,class:`w-full min-w-0`,onMousedownCapture:m,"onUpdate:show":h,"onUpdate:value":g,onNextMonth:i[0]||=e=>v(1,0),onPrevMonth:i[1]||=e=>v(-1,0),onNextYear:i[2]||=e=>v(0,1),onPrevYear:i[3]||=e=>v(0,-1)},{footer:(0,r.withCtx)(()=>[(0,r.unref)(s)?((0,r.openBlock)(),(0,r.createBlock)(a,{key:1,size:`small`,text:``,type:`info`,onClick:x},{default:(0,r.withCtx)(()=>[...i[4]||=[(0,r.createTextVNode)(` Сегодня `,-1)]]),_:1})):((0,r.openBlock)(),(0,r.createBlock)(Qf,{key:0,year:d.value.getFullYear(),month:f.value,"onUpdate:year":y,onSelectMonth:b,onToday:x},null,8,[`year`,`month`]))]),_:1},8,[`value`,`show`,`clearable`,`disabled`,`placeholder`,`format`,`default-calendar-start-time`])}}}),ep={key:0,class:`text-gray-400`},tp=(0,r.defineComponent)({__name:`date-range-fields`,props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},from:{default:null},to:{default:null},placeholderFrom:{default:`Дата начала`},placeholderTo:{default:`Дата окончания`},dateFormat:{default:void 0}},emits:[`update:from`,`update:to`],setup(e,{emit:t}){let n=oe.initRefDependingOnDeviceResolution(!0,!1,!1),i=t;return(t,a)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)([`flex w-full min-w-0 gap-1`,(0,r.unref)(n)?`flex-col`:`flex-row items-center`])},[(0,r.createVNode)($f,{value:e.from,clearable:e.clearable,disabled:e.disabled?.from,placeholder:e.placeholderFrom,"date-format":e.dateFormat,class:`min-w-0 flex-1`,"onUpdate:value":a[0]||=e=>i(`update:from`,e)},null,8,[`value`,`clearable`,`disabled`,`placeholder`,`date-format`]),(0,r.unref)(n)?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,ep,` – `)),(0,r.createVNode)($f,{value:e.to,clearable:e.clearable,disabled:e.disabled?.to,placeholder:e.placeholderTo,"date-format":e.dateFormat,class:`min-w-0 flex-1`,"onUpdate:value":a[1]||=e=>i(`update:to`,e)},null,8,[`value`,`clearable`,`disabled`,`placeholder`,`date-format`])],2))}}),np={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function rp(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,np,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M7 11h2v2H7zm14-6v14c0 1.11-.89 2-2 2H5a2 2 0 0 1-2-2V5c0-1.1.9-2 2-2h1V1h2v2h8V1h2v2h1a2 2 0 0 1 2 2M5 7h14V5H5zm14 12V9H5v10zm-4-6v-2h2v2zm-4 0v-2h2v2zm-4 2h2v2H7zm8 2v-2h2v2zm-4 0v-2h2v2z`},null,-1)]])}var ip=(0,r.markRaw)({name:`mdi-calendar-month-outline`,render:rp}),ap={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function op(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,ap,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`m16 11.78l4.24-7.33l1.73 1l-5.23 9.05l-6.51-3.75L5.46 19H22v2H2V3h2v14.54L9.5 8z`},null,-1)]])}var sp=(0,r.markRaw)({name:`mdi-chart-line`,render:op}),cp={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function lp(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,cp,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M22 21H2V3h2v16h2v-9h4v9h2V6h4v13h2v-5h4z`},null,-1)]])}var up=(0,r.markRaw)({name:`mdi-chart-bar`,render:lp}),dp={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function fp(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,dp,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M5 3h1V1h2v2h8V1h2v2h1c1.11 0 2 .89 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2m0 16h14V9H5zM5 7h14V5H5zm12 4v2H7v-2z`},null,-1)]])}var pp=(0,r.markRaw)({name:`mdi-calendar-week-outline`,render:fp}),mp={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function hp(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,mp,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M19 3h-1V1h-2v2H8V1H6v2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2m0 16H5V9h14zm0-12H5V5h14M7 11h5v5H7`},null,-1)]])}var gp=(0,r.markRaw)({name:`mdi-calendar-today-outline`,render:hp}),_p={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function vp(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,_p,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`currentColor`,d:`M12 8a4 4 0 0 1 4 4a4 4 0 0 1-4 4a4 4 0 0 1-4-4a4 4 0 0 1 4-4m0 2a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2m-2 12c-.25 0-.46-.18-.5-.42l-.37-2.65c-.63-.25-1.17-.59-1.69-.99l-2.49 1.01c-.22.08-.49 0-.61-.22l-2-3.46a.493.493 0 0 1 .12-.64l2.11-1.66L4.5 12l.07-1l-2.11-1.63a.493.493 0 0 1-.12-.64l2-3.46c.12-.22.39-.31.61-.22l2.49 1c.52-.39 1.06-.73 1.69-.98l.37-2.65c.04-.24.25-.42.5-.42h4c.25 0 .46.18.5.42l.37 2.65c.63.25 1.17.59 1.69.98l2.49-1c.22-.09.49 0 .61.22l2 3.46c.13.22.07.49-.12.64L19.43 11l.07 1l-.07 1l2.11 1.63c.19.15.25.42.12.64l-2 3.46c-.12.22-.39.31-.61.22l-2.49-1c-.52.39-1.06.73-1.69.98l-.37 2.65c-.04.24-.25.42-.5.42zm1.25-18l-.37 2.61c-1.2.25-2.26.89-3.03 1.78L5.44 7.35l-.75 1.3L6.8 10.2a5.55 5.55 0 0 0 0 3.6l-2.12 1.56l.75 1.3l2.43-1.04c.77.88 1.82 1.52 3.01 1.76l.37 2.62h1.52l.37-2.61c1.19-.25 2.24-.89 3.01-1.77l2.43 1.04l.75-1.3l-2.12-1.55c.4-1.17.4-2.44 0-3.61l2.11-1.55l-.75-1.3l-2.41 1.04a5.42 5.42 0 0 0-3.03-1.77L12.75 4z`},null,-1)]])}var yp=(0,r.markRaw)({name:`mdi-cog-outline`,render:vp}),bp={class:`grid gap-x-6 gap-y-4 pr-3 sm:grid-cols-2`},xp={class:`font-medium`},Sp={key:0,class:`pt-1 text-xs text-gray-500`},Cp={class:`flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center`},wp={class:`flex items-center gap-3`},Tp={class:`text-sm text-gray-600`},Ep={class:`flex gap-2`},Dp=(0,r.defineComponent)({__name:`quick-periods-settings`,props:{show:{type:Boolean},selectedKeys:{}},emits:[`update:show`,`save`],setup(e,{emit:n}){let i=e,a=n,s=oe.initRefDependingOnDeviceResolution(`100%`,`90%`,`40rem`),c=t.DateTimeProvider.standardPeriods(),l=t.STANDARD_PERIOD_GROUPS.map(e=>({key:e.key,label:e.label,sections:Nf(c,e.key)})),u=(0,r.ref)([]),d=(0,r.computed)(()=>{let e=u.value.length;return`Выбрано: ${e} ${(0,t.pluralize)(e,[`период`,`периода`,`периодов`])}`}),f=()=>{a(`save`,[...u.value]),a(`update:show`,!1)};return(0,r.watch)(()=>i.show,e=>{e&&(u.value=[...i.selectedKeys])}),(t,n)=>{let i=o.NCheckbox,c=o.NCheckboxGroup,p=o.NScrollbar,m=o.NButton,h=o.NModal;return(0,r.openBlock)(),(0,r.createBlock)(h,{show:e.show,preset:`card`,title:`Настройка быстрого выбора`,closable:``,style:(0,r.normalizeStyle)({width:(0,r.unref)(s),maxWidth:`calc(100vw - 1rem)`}),class:`sc-date-range-dialog`,"onUpdate:show":n[4]||=e=>a(`update:show`,e)},{footer:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Cp,[(0,r.createElementVNode)(`div`,wp,[(0,r.createElementVNode)(`span`,Tp,(0,r.toDisplayString)(d.value),1),(0,r.createVNode)(m,{text:``,type:`info`,onClick:n[1]||=e=>u.value=[...(0,r.unref)(wf)]},{default:(0,r.withCtx)(()=>[...n[5]||=[(0,r.createTextVNode)(` По умолчанию `,-1)]]),_:1}),(0,r.createVNode)(m,{text:``,type:`info`,disabled:u.value.length===0,onClick:n[2]||=e=>u.value=[]},{default:(0,r.withCtx)(()=>[...n[6]||=[(0,r.createTextVNode)(` Снять все `,-1)]]),_:1},8,[`disabled`])]),(0,r.createElementVNode)(`div`,Ep,[(0,r.createVNode)(m,{type:`primary`,onClick:f},{default:(0,r.withCtx)(()=>[...n[7]||=[(0,r.createTextVNode)(` Сохранить `,-1)]]),_:1}),(0,r.createVNode)(m,{onClick:n[3]||=e=>a(`update:show`,!1)},{default:(0,r.withCtx)(()=>[...n[8]||=[(0,r.createTextVNode)(`Отмена`,-1)]]),_:1})])])]),default:(0,r.withCtx)(()=>[(0,r.createVNode)(p,{class:`max-h-[60vh]`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(c,{value:u.value,"onUpdate:value":n[0]||=e=>u.value=e},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,bp,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(l),e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:e.key,class:`flex flex-col gap-1.5`},[(0,r.createElementVNode)(`div`,xp,(0,r.toDisplayString)(e.label),1),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.sections,e=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e.key},[e.label?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Sp,(0,r.toDisplayString)(e.label),1)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.children,e=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:e.value,value:e.value,label:e.label},null,8,[`value`,`label`]))),128))],64))),128))]))),128))])]),_:1},8,[`value`])]),_:1})]),_:1},8,[`show`,`style`])}}}),Op={class:`flex flex-col gap-2`},kp={class:`flex items-center gap-2`},Ap={class:`flex gap-2 px-px pb-4 pt-px`},jp={key:0,class:`text-sm text-gray-500`},Mp=(0,r.defineComponent)({__name:`quick-periods`,props:{from:{},to:{}},emits:[`apply`,`preview`],setup(e,{emit:a}){let s=e,c=a,l=t.DateTimeProvider.standardPeriods(),u=(0,r.ref)((()=>{let e=Cf,r=t.PreferencesStorageProvider.getActualDataFromStorage(e);return((0,n.isArray)(r)?r:wf).filter(e=>(0,n.isString)(e)&&e in l)})()),d=(0,r.ref)(!1),f=(0,r.computed)(()=>Object.entries(l).filter(([e])=>u.value.includes(e)).map(([e,t])=>({value:e,label:t.label,item:t,group:t.group}))),p=(0,r.computed)(()=>{let e=s.from?kf(s.from):null,t=s.to?kf(s.to):null;if(e===null||t===null)return null;let n=f.value.find(n=>{let{from:r,to:i}=n.item;return!r||!i?!1:kf(r)===e&&kf(i)===t});return n?String(n.value):null}),m=e=>{u.value=e;let n=Cf;t.PreferencesStorageProvider.saveActualDataToStorage(n,e,(0,i.addYears)((0,i.startOfToday)(),1))};return(e,t)=>{let n=yp,i=o.NButton,a=gp,s=pp,l=up,h=sp,g=ip,_=o.NScrollbar;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Op,[(0,r.createElementVNode)(`div`,kp,[t[3]||=(0,r.createElementVNode)(`span`,{class:`text-sm font-medium text-gray-700`},`Быстрый выбор`,-1),(0,r.createVNode)(i,{size:`tiny`,quaternary:``,circle:``,"aria-label":`Настроить быстрый выбор`,onClick:t[0]||=e=>d.value=!0},{icon:(0,r.withCtx)(()=>[(0,r.createVNode)(n)]),_:1})]),(0,r.createVNode)(_,{"x-scrollable":``},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Ap,[f.value.length===0?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,jp,` Периоды не выбраны `)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(f.value,e=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:e.value,type:e.value===p.value?`primary`:`default`,ghost:e.value===p.value,"theme-overrides":(0,r.unref)(yf),class:`shrink-0`,onClick:t=>c(`apply`,e),onMouseenter:t=>c(`preview`,e),onMouseleave:t[1]||=e=>c(`preview`)},{icon:(0,r.withCtx)(()=>[e.group===`day`?((0,r.openBlock)(),(0,r.createBlock)(a,{key:0})):e.group===`week`||e.group===`decade`?((0,r.openBlock)(),(0,r.createBlock)(s,{key:1})):e.group===`quarter`||e.group===`halfYear`?((0,r.openBlock)(),(0,r.createBlock)(l,{key:2})):e.group===`other`?((0,r.openBlock)(),(0,r.createBlock)(h,{key:3})):((0,r.openBlock)(),(0,r.createBlock)(g,{key:4}))]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.label),1)]),_:2},1032,[`type`,`ghost`,`theme-overrides`,`onClick`,`onMouseenter`]))),128))])]),_:1}),(0,r.createVNode)(Dp,{show:d.value,"onUpdate:show":t[2]||=e=>d.value=e,"selected-keys":u.value,onSave:m},null,8,[`show`,`selected-keys`])])}}}),Np={class:`flex flex-col items-stretch gap-3 sm:flex-row`},Pp={class:`order-2 flex-1 rounded-lg border border-solid border-gray-200 p-2 shadow-sm`},Fp={class:`flex flex-col items-stretch pr-3`},Ip={key:0,class:`px-2 pb-0.5 pt-2 text-xs text-gray-400`},Lp={key:1,class:`order-2 w-44 shrink-0 rounded-lg border border-solid border-gray-200 p-1 shadow-sm`},Rp=(0,r.defineComponent)({__name:`standard-periods`,props:{activeKey:{},customPeriods:{}},emits:[`apply`,`preview`],setup(e,{emit:i}){let a=e,s=i,c=`custom`,l=oe.initRefDependingOnDeviceResolution(!0,!1,!1),u=t.DateTimeProvider.standardPeriods(),d=(0,r.ref)(t.STANDARD_PERIOD_GROUPS[0].key),f=(0,r.computed)(()=>{let e=t.STANDARD_PERIOD_GROUPS.map(e=>({key:e.key,value:e.key,label:e.label}));return(0,n.isEmpty)(a.customPeriods)||e.push({key:c,value:c,label:`Пользовательские`}),e}),p=(0,r.computed)(()=>d.value===c?[{type:`group`,key:c,children:Mf(a.customPeriods??{})}]:Nf(u,d.value));return(t,n)=>{let i=o.NButton,a=o.NScrollbar,c=o.NSelect,u=o.NMenu;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Np,[(0,r.createElementVNode)(`div`,Pp,[(0,r.createVNode)(a,{class:`max-h-96`},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Fp,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(p.value,t=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:t.key},[t.label?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Ip,(0,r.toDisplayString)(t.label),1)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(t.children,t=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:t.value,size:`small`,quaternary:``,type:t.value===e.activeKey?`primary`:`default`,class:`justify-start`,onClick:e=>s(`apply`,t),onMouseenter:e=>s(`preview`,t),onMouseleave:n[0]||=e=>s(`preview`)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(t.label),1)]),_:2},1032,[`type`,`onClick`,`onMouseenter`]))),128))],64))),128))])]),_:1})]),(0,r.unref)(l)?((0,r.openBlock)(),(0,r.createBlock)(c,{key:0,value:d.value,options:f.value,class:`order-1`,"onUpdate:value":n[1]||=e=>d.value=e},null,8,[`value`,`options`])):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Lp,[(0,r.createVNode)(u,{value:d.value,options:f.value,mode:`vertical`,"onUpdate:value":n[2]||=e=>d.value=e},null,8,[`value`,`options`])]))])}}}),zp={class:`flex flex-col gap-3`},Bp={class:`flex flex-col gap-1 sm:flex-row sm:items-center`},Vp={key:1,class:`overflow-x-auto rounded-lg border border-solid border-gray-200 p-2 shadow-sm sm:p-3`},Hp={class:`flex flex-col items-stretch justify-between gap-2 sm:flex-row sm:items-center`},Up={class:`flex gap-2`},Wp=(0,r.defineComponent)({__name:`date-range-dialog`,props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},show:{type:Boolean},dateRange:{default:void 0},customPeriods:{default:void 0},dateFormat:{default:void 0}},emits:[`update:show`,`select`],setup(e,{emit:n}){let a=e,s=n,c=oe.initRefDependingOnDeviceResolution(`100%`,`90%`,`48rem`),l=(0,r.ref)(`custom`),u=(0,r.ref)(`months`),d=(0,r.computed)(()=>u.value===`months`?`Показать по дням`:`Показать по месяцам`),f=()=>t.PreferencesStorageProvider.getActualDataFromStorage(`date-range.dialog.mode`)===`standard`?`standard`:`custom`,p=()=>t.PreferencesStorageProvider.getActualDataFromStorage(`date-range.dialog.scale`)===`days`?`days`:`months`,m=(e,n)=>{t.PreferencesStorageProvider.saveActualDataToStorage(e,n,(0,i.addYears)((0,i.startOfToday)(),1))},h=(0,r.ref)({}),g=(0,r.ref)(null),_=(0,r.ref)(null),v=(0,r.computed)(()=>g.value??h.value),y=(e,t)=>{let n=a.disabled?.from?h.value.from:e,r=a.disabled?.to?h.value.to:t;g.value=null,h.value=jf(n,r,a.disabled)},b=e=>{_.value=null,y(e,h.value.to)},x=e=>{_.value=null,y(h.value.from,e)},S=()=>{_.value=null,y(null,null)},C=e=>{_.value=null,y(e.from,e.to)},w=e=>{let t=e.item;y(t.from,t.to),_.value=String(e.value)},T=e=>{let t=e?.item;g.value=t?{from:t.from,to:t.to}:null},E=()=>{g.value=null,l.value=l.value===`custom`?`standard`:`custom`,m(xf,l.value)},D=()=>{u.value=u.value===`months`?`days`:`months`,m(Sf,u.value)},O=()=>{s(`select`,h.value),s(`update:show`,!1)};return(0,r.watch)(()=>a.show,e=>{e&&(l.value=f(),u.value=p(),_.value=null,g.value=null,h.value={...a.dateRange})}),(t,n)=>{let i=o.NButton,a=ff,f=lf,p=o.NTooltip,m=o.NModal;return(0,r.openBlock)(),(0,r.createBlock)(m,{show:e.show,preset:`card`,title:`Выберите период`,closable:``,style:(0,r.normalizeStyle)({width:(0,r.unref)(c),maxWidth:`calc(100vw - 1rem)`}),class:`sc-date-range-dialog`,"onUpdate:show":n[1]||=e=>s(`update:show`,e)},{footer:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,Hp,[(0,r.createVNode)(i,{text:``,type:`info`,onClick:E},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(l.value===`custom`?`Показать стандартные периоды`:`Показать произвольный период`),1)]),_:1}),(0,r.createElementVNode)(`div`,Up,[(0,r.createVNode)(i,{type:`primary`,onClick:O},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Выбрать `,-1)]]),_:1}),(0,r.createVNode)(i,{onClick:n[0]||=e=>s(`update:show`,!1)},{default:(0,r.withCtx)(()=>[...n[4]||=[(0,r.createTextVNode)(`Отмена`,-1)]]),_:1})])])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,zp,[l.value===`custom`?((0,r.openBlock)(),(0,r.createBlock)(Mp,{key:0,from:h.value.from,to:h.value.to,onApply:w,onPreview:T},null,8,[`from`,`to`])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,Bp,[(0,r.createVNode)(tp,{from:v.value.from,to:v.value.to,clearable:e.clearable,disabled:e.disabled,"date-format":e.dateFormat,class:`flex-1`,"onUpdate:from":b,"onUpdate:to":x},null,8,[`from`,`to`,`clearable`,`disabled`,`date-format`]),e.clearable?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,text:``,type:`info`,class:`sm:ml-2`,onClick:S},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Очистить период `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0)]),l.value===`custom`?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Vp,[((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(u.value===`months`?qf:Vf),{from:h.value.from,to:h.value.to,onSelect:C},{actions:(0,r.withCtx)(()=>[(0,r.createVNode)(p,{placement:`top`,trigger:`hover`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{size:`small`,"aria-label":d.value,"theme-overrides":(0,r.unref)(bf),onClick:D},{icon:(0,r.withCtx)(()=>[u.value===`months`?((0,r.openBlock)(),(0,r.createBlock)(a,{key:0})):((0,r.openBlock)(),(0,r.createBlock)(f,{key:1}))]),_:1},8,[`aria-label`,`theme-overrides`])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(d.value),1)]),_:1})]),_:1},40,[`from`,`to`]))])):((0,r.openBlock)(),(0,r.createBlock)(Rp,{key:2,"active-key":_.value,"custom-periods":e.customPeriods,onApply:w,onPreview:T},null,8,[`active-key`,`custom-periods`]))])]),_:1},8,[`show`,`style`])}}}),Gp={class:`flex w-full min-w-0 items-center gap-1`},Kp=(0,r.defineComponent)({__name:`date-range`,props:{clearable:{type:Boolean,default:!0},disabled:{default:()=>({from:!1,to:!1})},predefinedDateRanges:{default:void 0},dateRange:{default:void 0},useDefaultPredefinedDateRanges:{type:Boolean,default:!1},placeholderFrom:{default:`Дата начала`},placeholderTo:{default:`Дата окончания`},dateFormat:{default:void 0}},emits:[`update:date-range`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.ref)(!1),l=(0,r.computed)(()=>{let e={...a.useDefaultPredefinedDateRanges?t.DateTimeProvider.defaultDateRanges():{},...a.predefinedDateRanges};return(0,n.isEmpty)(e)?void 0:e}),u=(e,t)=>{s(`update:date-range`,jf(e,t,a.disabled))},d=e=>{u(e,a.dateRange?.to)},f=e=>{u(a.dateRange?.from,e)},p=e=>{u(e.from,e.to)};return(t,n)=>{let i=of,a=o.NButton;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Gp,[(0,r.createVNode)(tp,{from:e.dateRange?.from,to:e.dateRange?.to,clearable:e.clearable,disabled:e.disabled,"placeholder-from":e.placeholderFrom,"placeholder-to":e.placeholderTo,"date-format":e.dateFormat,class:`min-w-0 flex-1`,"onUpdate:from":d,"onUpdate:to":f},null,8,[`from`,`to`,`clearable`,`disabled`,`placeholder-from`,`placeholder-to`,`date-format`]),(0,r.createVNode)(a,{disabled:!!(e.disabled?.from&&e.disabled?.to),title:`Выбрать период`,"aria-label":`Выбрать период`,onClick:n[0]||=e=>c.value=!0},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1},8,[`disabled`]),(0,r.createVNode)(Wp,{show:c.value,"onUpdate:show":n[1]||=e=>c.value=e,"date-range":e.dateRange,clearable:e.clearable,disabled:e.disabled,"custom-periods":l.value,"date-format":e.dateFormat,onSelect:p},null,8,[`show`,`date-range`,`clearable`,`disabled`,`custom-periods`,`date-format`])])}}}),qp={class:`sc-lbl-date text-nowrap`},Jp=(0,r.defineComponent)({__name:`date-time-label`,props:{date:{},isTimeSecondary:{type:Boolean},isTimeOnSecondLine:{type:Boolean},isShowTime:{type:Boolean,default:!0}},setup(e){let n=e,a=(0,r.computed)(()=>(0,i.format)(n.date,(0,t.useBaseConfigStore)().config.dateFormats.uiDate)),o=(0,r.computed)(()=>(0,i.format)(n.date,`HH:mm`));return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{class:(0,r.normalizeClass)({"flex flex-col":e.isTimeOnSecondLine})},[(0,r.createElementVNode)(`span`,qp,(0,r.toDisplayString)(a.value),1),e.isShowTime?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)([{"text-sc-grey":e.isTimeSecondary,"ml-1":!e.isTimeOnSecondLine},`sc-lbl-time`])},(0,r.toDisplayString)(o.value),3)):(0,r.createCommentVNode)(``,!0)],2))}}),Yp=(0,r.defineComponent)({__name:`debt`,props:{debt:{default:0},showLabel:{type:Boolean,default:!1},wrapAsSmall:{type:Boolean,default:!1}},setup(e){let t=e,n=(0,r.computed)(()=>{let e=``;return(t.showLabel??!1)&&(t.debt>0?e=`Переплата: `:t.debt<0&&(e=`Задолженность: `)),e});return(t,i)=>e.debt===0?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)({"text-sm":e.wrapAsSmall})},[(0,r.createTextVNode)((0,r.toDisplayString)(n.value)+` `,1),(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"text-green-700":e.debt>0,"text-red-700":e.debt<0})},(0,r.toDisplayString)(e.debt)+` ₽ `,3)],2))}}),Xp={class:`flex flex-row gap-2.5`},Zp={class:`flex grow basis-0 flex-row flex-wrap justify-start justify-items-start gap-y-1 md:flex-nowrap`},Qp={class:`flex min-w-0 flex-col-reverse flex-wrap-reverse justify-end gap-1 sm:flex-row`},$p={class:`mb-0.5 sm:mb-0 sm:ml-3`},em=(0,r.defineComponent)({__name:`dialog-header`,props:{showCloseButton:{type:Boolean,default:!0}},emits:[`close`],setup(e){return(t,n)=>{let i=xc,a=o.NButton,s=o.NPopover;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,Xp,[(0,r.createElementVNode)(`div`,Zp,[(0,r.renderSlot)(t.$slots,`main`)]),(0,r.createElementVNode)(`div`,null,[(0,r.createElementVNode)(`div`,Qp,[(0,r.renderSlot)(t.$slots,`extra-buttons`),(0,r.createElementVNode)(`div`,$p,[e.showCloseButton?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(a,{size:`small`,type:`error`,onClick:n[0]||=e=>t.$emit(`close`)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i)]),_:1})]),default:(0,r.withCtx)(()=>[n[1]||=(0,r.createTextVNode)(` Закрыть `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0)])])])])}}}),tm={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function nm(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,tm,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`square`,"stroke-miterlimit":`10`,"stroke-width":`44`,d:`M465 127L241 384l-92-92m-9 93l-93-93m316-165L236 273`},null,-1)]])}var rm=(0,r.markRaw)({name:`ion-checkmark-done-sharp`,render:nm}),im={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function am(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,im,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M368 128h80m-384 0h240m64 256h80m-384 0h240m-96-128h240m-384 0h80`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`336`,cy:`128`,r:`32`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`176`,cy:`256`,r:`32`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1),(0,r.createElementVNode)(`circle`,{cx:`336`,cy:`384`,r:`32`,fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`},null,-1)]])}var om=(0,r.markRaw)({name:`ion-options-outline`,render:am}),sm={class:`flex flex-row gap-x-2.5 p-0 sm:p-1`},cm={class:`flex-auto`},lm={class:`sticky top-0 flex flex-none flex-col justify-start gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0`},um={class:`flex flex-none flex-col-reverse justify-end gap-y-1 sm:flex-row sm:justify-start sm:gap-x-1 sm:gap-y-0`},dm=(0,r.defineComponent)({__name:`inline-view`,props:{disabled:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!1},showApplyButton:{type:Boolean,default:!1},showCancelButton:{type:Boolean,default:!1}},emits:[`edit`,`apply`,`cancel`],setup(e,{emit:t}){let n=t,i=(0,r.ref)(!1),a=()=>{n(`edit`)},s=()=>{i.value=!1},c=()=>{i.value=!0,n(`apply`,s)},l=()=>{n(`cancel`,s)};return(t,n)=>{let s=om,u=o.NButton,d=o.NPopover,f=rm,p=xc;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,sm,[(0,r.createElementVNode)(`div`,cm,[(0,r.renderSlot)(t.$slots,`default`)]),(0,r.createElementVNode)(`div`,null,[(0,r.createElementVNode)(`div`,lm,[(0,r.createElementVNode)(`div`,um,[e.showEditButton?((0,r.openBlock)(),(0,r.createBlock)(d,{key:0,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(u,{disabled:e.disabled||i.value,type:`info`,ghost:``,size:`small`,onClick:a},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s)]),_:1},8,[`disabled`])]),default:(0,r.withCtx)(()=>[n[0]||=(0,r.createTextVNode)(` Редактировать данные `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0),e.showApplyButton?((0,r.openBlock)(),(0,r.createBlock)(d,{key:1,disabled:i.value,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(u,{disabled:e.disabled||i.value,type:`primary`,size:`small`,onClick:c},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(f)]),_:1},8,[`disabled`])]),default:(0,r.withCtx)(()=>[n[1]||=(0,r.createTextVNode)(` Сохранить изменения `,-1)]),_:1},8,[`disabled`])):(0,r.createCommentVNode)(``,!0),e.showCancelButton?((0,r.openBlock)(),(0,r.createBlock)(d,{key:2,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(u,{disabled:e.disabled||i.value,type:`error`,size:`small`,onClick:l},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(p)]),_:1},8,[`disabled`])]),default:(0,r.withCtx)(()=>[n[2]||=(0,r.createTextVNode)(` Отменить изменения `,-1)]),_:1})):(0,r.createCommentVNode)(``,!0)]),(0,r.renderSlot)(t.$slots,`extra-buttons`)])])])}}}),fm=(0,r.defineComponent)({__name:`inline-editable-item`,props:{disabled:{type:Boolean,default:!1},showEditor:{type:Boolean,default:!1},showEditButton:{type:Boolean,default:!0}},emits:[`editor:apply`,`editor:cancel`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.ref)(n.showEditor),o=e=>{i(`editor:apply`,t=>{a.value=!t,e()})},s=e=>{a.value=!1,e(),i(`editor:cancel`)};return(0,r.onMounted)(()=>{(0,r.watch)(()=>n.showEditor,e=>{a.value=e})}),(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[a.value?((0,r.openBlock)(),(0,r.createBlock)(dm,{key:1,disabled:e.disabled,"show-apply-button":!0,"show-cancel-button":!0,onApply:o,onCancel:s},{"extra-buttons":(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`extra-editor-buttons`)]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`editor`)]),_:3},8,[`disabled`])):((0,r.openBlock)(),(0,r.createBlock)(dm,{key:0,disabled:e.disabled,"show-edit-button":e.showEditButton,onEdit:n[0]||=e=>a.value=!0},{"extra-buttons":(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`extra-viewer-buttons`)]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`viewer`)]),_:3},8,[`disabled`,`show-edit-button`]))]))}}),pm={key:0,class:`whitespace-pre-line`},mm={key:1,class:`text-sc-dark-grey`},hm=(0,r.defineComponent)({__name:`comment-editor`,props:{disabled:{type:Boolean,default:!1},comment:{default:``}},emits:[`update:comment`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.ref)(n.comment);(0,r.watch)(()=>a.value,e=>{a.value=e});let s=e=>{i(`update:comment`,a.value,e)},c=()=>{a.value=n.comment};return(t,n)=>{let i=o.NInput;return(0,r.openBlock)(),(0,r.createBlock)(fm,{disabled:e.disabled,"onEditor:apply":s,"onEditor:cancel":c},{viewer:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,null,[e.comment?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,pm,(0,r.toDisplayString)(e.comment),1)):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,mm,` - Комментарий отсутствует - `))])]),editor:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{value:a.value,"onUpdate:value":n[0]||=e=>a.value=e,clearable:!0,type:`textarea`},null,8,[`value`])]),_:1},8,[`disabled`])}}}),gm={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function _m(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,gm,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M336 176h40a40 40 0 0 1 40 40v208a40 40 0 0 1-40 40H136a40 40 0 0 1-40-40V216a40 40 0 0 1 40-40h40`},null,-1),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`m176 272l80 80l80-80M256 48v288`},null,-1)]])}var vm=(0,r.markRaw)({name:`ion-download-outline`,render:_m}),ym=(0,r.defineComponent)({__name:`single-file-upload-selector`,props:{draggedAreaText:{},accept:{},isError:{type:Boolean}},emits:[`update:file`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.ref)([]),s=(0,r.computed)(()=>a.value.map(e=>(e.status=n.isError?`error`:`finished`,e))),c=e=>{a.value=e;let t={name:``,content:``};if(e.length===0){i(`update:file`,null);return}let n=e[0];t.name=n.name;let r=new FileReader;r.addEventListener(`load`,()=>{t.content=r.result??``,i(`update:file`,t)}),r.readAsDataURL(n.file)};return(t,n)=>{let i=vm;return(0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NUpload),{"file-list":s.value,"default-upload":!1,max:1,"show-retry-button":!1,action:``,accept:e.accept,"directory-dnd":``,class:`content-center`,"onUpdate:fileList":c},{default:(0,r.withCtx)(()=>[(0,r.createVNode)((0,r.unref)(o.NUploadDragger),null,{default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`dragged-area`,{},()=>[(0,r.createElementVNode)(`div`,null,[(0,r.createVNode)(i,{class:`text-2xl`}),(0,r.createElementVNode)(`div`,null,(0,r.toDisplayString)(e.draggedAreaText??`Перетащите в эту область файл, который необходимо загрузить.`),1)])])]),_:3})]),_:3},8,[`file-list`,`accept`])}}}),bm={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function xm(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,bm,[...t[0]||=[(0,r.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)]])}var Sm=(0,r.markRaw)({name:`ion-warning`,render:xm}),Cm=(0,r.defineComponent)({__name:`warning-icon`,props:{popoverText:{default:``},iconClass:{default:`text-sc-warning`}},setup(e){return(t,n)=>{let i=Sm,a=o.NPopover;return(0,r.openBlock)(),(0,r.createBlock)(a,{disabled:e.popoverText.length===0,placement:`bottom`},{trigger:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{class:(0,r.normalizeClass)(`ml-0.5 ${e.iconClass}`)},null,8,[`class`])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.popoverText),1)]),_:1},8,[`disabled`])}}}),wm=(0,r.defineComponent)({__name:`debounced-input`,props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:800},placeholder:{default:``}},emits:[`update:value`],setup(e,{emit:t}){let i=e,a=t,s=(0,r.ref)(i.value),c=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,i.debounceTime)),l=(0,n.debounce)(()=>a(`update:value`,s.value),c.value),u=e=>{s.value=e,l()};return(0,r.watch)(()=>i.value,e=>{s.value=e}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NInput),{value:s.value,"onUpdate:value":[n[0]||=e=>s.value=e,u],clearable:e.clearable,placeholder:e.placeholder},{prefix:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`prefix`)]),_:3},8,[`value`,`clearable`,`placeholder`]))}}),Tm=(0,r.defineComponent)({__name:`debounced-input-number`,props:{value:{default:void 0},clearable:{type:Boolean,default:!1},debounceTime:{default:500},placeholder:{default:``},min:{default:void 0},max:{default:void 0},step:{default:1},validator:{type:Function,default:void 0},parse:{type:Function,default:void 0},showButton:{type:Boolean,default:!0}},emits:[`update:value`,`keydown`,`input`,`focus`],setup(e,{expose:t,emit:i}){let a=e,s=i,c=(0,r.ref)(a.value),l=(0,r.computed)(()=>(0,r.inject)(`debounce-input-time`,a.debounceTime)),u=(0,n.debounce)(()=>s(`update:value`,c.value),l.value),d=e=>{c.value=e,u()};(0,r.watch)(()=>a.value,e=>{c.value=e});let f=(0,r.ref)(null);return t({focus:()=>f.value?.focus(),blur:()=>f.value?.blur(),select:()=>f.value?.select()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NInputNumber),{ref_key:`inputReference`,ref:f,value:c.value??null,clearable:e.clearable,parse:e.parse,"show-button":e.showButton,placeholder:e.placeholder,min:e.min,max:e.max,step:e.step,validator:e.validator,"onUpdate:value":d,onKeydown:n[0]||=e=>s(`keydown`,e),onInput:n[1]||=e=>s(`input`,e),onFocus:n[2]||=e=>s(`focus`,e)},{prefix:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`prefix`)]),_:3},8,[`value`,`clearable`,`parse`,`show-button`,`placeholder`,`min`,`max`,`step`,`validator`]))}}),Em=bt((0,r.defineComponent)({__name:`phone-input`,props:{value:{},debounceTime:{},disabled:{type:Boolean},placeholder:{},defaultCountry:{},preferredCountries:{},onlyCountries:{}},emits:[`update:value`],setup(e,{emit:t}){let i=e,a=t,o=(0,r.ref)((i.value??``).replaceAll(/\D*/g,``)),c=(0,n.debounce)(e=>a(`update:value`,e),i.debounceTime??0),u=e=>{let t=``;if((0,n.isString)(e))o.value=e,t=e.replaceAll(/(\s|\(|\)|-|_)*/g,``);else if((0,n.isObject)(e)){if(o.value=e.formatted,!e.valid)return;t=e instanceof s.PhoneNumber?e.format(`E.164`):`+${e.countryCallingCode}${e.nationalNumber}`}i.debounceTime?c(t):a(`update:value`,t)},d=e=>{let t=e.replaceAll(/\D*/g,``);try{let e=(0,s.parsePhoneNumberWithError)(`+${t}`);e.isValid()?o.value=e.format(`E.164`):e.getPossibleCountries().length>0&&(o.value=`+${t}`)}catch(e){if(e instanceof s.ParseError)o.value=t;else throw e}};return(0,r.watch)(()=>i.value,e=>{e?.replaceAll(/\D*/g,``)!==o.value?.replaceAll(/\D*/g,``)&&d(e)},{immediate:!0}),(0,r.onBeforeMount)(()=>d(o.value??``)),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(l.VueTelInput),{modelValue:o.value,"onUpdate:modelValue":[n[0]||=e=>o.value=e,u],"auto-default-country":!1,"auto-format":!0,"default-country":e.defaultCountry,disabled:e.disabled,"input-options":{placeholder:e.placeholder},"preferred-countries":e.preferredCountries,"only-countries":e.onlyCountries,mode:`international`,class:`tel-input`},null,8,[`modelValue`,`default-country`,`disabled`,`input-options`,`preferred-countries`,`only-countries`]))}}),[[`__scopeId`,`data-v-4f05dd7b`]]),Dm={class:`mb-7 grid grid-cols-2 gap-3.5 lg:grid-cols-4`},Om={class:`mb-2 text-[11.5px] font-semibold uppercase text-gray-500`},km=(0,r.defineComponent)({__name:`kpi-grid`,props:{items:{},isLoading:{type:Boolean}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Dm,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.items,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:t.label,class:`rounded-lg border border-solid border-gray-200 px-4 py-4`},[(0,r.createElementVNode)(`div`,Om,(0,r.toDisplayString)(t.label),1),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`text-[25px] font-bold`,t.valueClass])},(0,r.toDisplayString)(e.isLoading?`…`:t.value),3),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`mt-1.5 text-xs font-medium`,t.noteClass])},(0,r.toDisplayString)(t.note),3)]))),128))]))}}),Am={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function jm(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Am,[...t[0]||=[(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`,d:`M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6m-7 1l9-9m-5 0h5v5`},null,-1)]])}var Mm=(0,r.markRaw)({name:`tabler-external-link`,render:jm}),Nm={class:`flex flex-row gap-1 hover:underline hover:decoration-dashed`},Pm=[`href`],Fm=(0,r.defineComponent)({__name:`external-link`,props:{text:{},url:{},description:{}},setup(e){return(t,i)=>{let a=Mm,s=o.NTooltip;return(0,r.openBlock)(),(0,r.createBlock)(s,{disabled:(0,r.unref)(n.isUndefined)(e.description),placement:`top-start`},{trigger:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,Nm,[(0,r.createElementVNode)(`a`,{href:e.url,target:`_blank`,class:`no-underline`},(0,r.toDisplayString)(e.text),9,Pm),(0,r.createVNode)(a,{class:`mt-0.5 flex-none`})])]),default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.description),1)]),_:1},8,[`disabled`])}}}),Im={key:1,class:`h-24`},Lm={key:2,class:`flex flex-col gap-3`},Rm=(0,r.defineComponent)({__name:`compact-card-list`,props:{isLoading:{type:Boolean},isEmpty:{type:Boolean},emptyDescription:{},pagination:{}},emits:[`update:page`,`update:pageSize`],setup(e,{emit:t}){let n=t,i=[20,50,100];return(t,a)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSpin),{show:e.isLoading},{default:(0,r.withCtx)(()=>[!e.isLoading&&e.isEmpty?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NEmpty),{key:0,description:e.emptyDescription},null,8,[`description`])):e.isLoading&&e.isEmpty?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Im)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Lm,[(0,r.renderSlot)(t.$slots,`default`)])),e.pagination&&e.pagination.itemCount>0?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NPagination),{key:3,class:`mt-4 flex-wrap justify-center gap-y-2`,size:`small`,page:e.pagination.page,"page-size":e.pagination.pageSize,"item-count":e.pagination.itemCount,"page-slot":e.pagination.pageSlot,"page-sizes":i,"show-size-picker":!0,prefix:(0,r.unref)(Ce),"onUpdate:page":a[0]||=e=>n(`update:page`,e),"onUpdate:pageSize":a[1]||=e=>n(`update:pageSize`,e)},null,8,[`page`,`page-size`,`item-count`,`page-slot`,`prefix`])):(0,r.createCommentVNode)(``,!0)]),_:3},8,[`show`]))}}),zm={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Bm(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,zm,[...t[0]||=[(0,r.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),(0,r.createElementVNode)(`path`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`32`,d:`M336 256H176`},null,-1)]])}var Vm=(0,r.markRaw)({name:`ion-remove-circle-outline`,render:Bm});function Hm(e){return e}var Um=Hm(`n-internal-select-menu`),Wm=Hm(`n-internal-select-menu-body`),Gm=Hm(`n-drawer-body`),Km=Hm(`n-modal-body`),qm=Hm(`n-popover-body`);function Jm(e){return e.composedPath()[0]}var Ym={mousemoveoutside:new WeakMap,clickoutside:new WeakMap};function Xm(e,t,n){if(e===`mousemoveoutside`){let e=e=>{t.contains(Jm(e))||n(e)};return{mousemove:e,touchstart:e}}if(e===`clickoutside`){let e=!1,r=n=>{e=!t.contains(Jm(n))},i=r=>{e&&(t.contains(Jm(r))||n(r))};return{mousedown:r,mouseup:i,touchstart:r,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function Zm(e,t,n){let r=Ym[e],i=r.get(t);i===void 0&&r.set(t,i=new WeakMap);let a=i.get(n);return a===void 0&&i.set(n,a=Xm(e,t,n)),a}function Qm(e,t,n,r){if(e===`mousemoveoutside`||e===`clickoutside`){let i=Zm(e,t,n);return Object.keys(i).forEach(e=>{th(e,document,i[e],r)}),!0}return!1}function $m(e,t,n,r){if(e===`mousemoveoutside`||e===`clickoutside`){let i=Zm(e,t,n);return Object.keys(i).forEach(e=>{nh(e,document,i[e],r)}),!0}return!1}function eh(){if(typeof window>`u`)return{on:()=>{},off:()=>{}};let e=new WeakMap,t=new WeakMap;function n(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function i(e,t,n){let r=e[t];return e[t]=function(){return n.apply(e,arguments),r.apply(e,arguments)},e}function a(e,t){e[t]=Event.prototype[t]}let o=new WeakMap,s=Object.getOwnPropertyDescriptor(Event.prototype,`currentTarget`);function c(){return o.get(this)??null}function l(e,t){s!==void 0&&Object.defineProperty(e,"currentTarget",{configurable:!0,enumerable:!0,get:t??s.get})}let u={bubble:{},capture:{}},d={};function f(){let s=function(s){let{type:d,eventPhase:f,bubbles:p}=s,m=Jm(s);if(f===2)return;let h=f===1?`capture`:`bubble`,g=m,_=[];for(;g===null&&(g=window),_.push(g),g!==window;)g=g.parentNode||null;let v=u.capture[d],y=u.bubble[d];if(i(s,`stopPropagation`,n),i(s,`stopImmediatePropagation`,r),l(s,c),h===`capture`){if(v===void 0)return;for(let n=_.length-1;n>=0&&!e.has(s);--n){let e=_[n],r=v.get(e);if(r!==void 0){o.set(s,e);for(let e of r){if(t.has(s))break;e(s)}}if(n===0&&!p&&y!==void 0){let n=y.get(e);if(n!==void 0)for(let e of n){if(t.has(s))break;e(s)}}}}else if(h===`bubble`){if(y===void 0)return;for(let n=0;n<_.length&&!e.has(s);++n){let e=_[n],r=y.get(e);if(r!==void 0){o.set(s,e);for(let e of r){if(t.has(s))break;e(s)}}}}a(s,`stopPropagation`),a(s,`stopImmediatePropagation`),l(s)};return s.displayName=`evtdUnifiedHandler`,s}function p(){let e=function(e){let{type:t,eventPhase:n}=e;if(n!==2)return;let r=d[t];r!==void 0&&r.forEach(t=>t(e))};return e.displayName=`evtdUnifiedWindowEventHandler`,e}let m=f(),h=p();function g(e,t){let n=u[e];return n[t]===void 0&&(n[t]=new Map,window.addEventListener(t,m,e===`capture`)),n[t]}function _(e){return d[e]===void 0&&(d[e]=new Set,window.addEventListener(e,h)),d[e]}function v(e,t){let n=e.get(t);return n===void 0&&e.set(t,n=new Set),n}function y(e,t,n,r){let i=u[t][n];if(i!==void 0){let t=i.get(e);if(t!==void 0&&t.has(r))return!0}return!1}function b(e,t){let n=d[e];return!!(n!==void 0&&n.has(t))}function x(e,t,n,r){let i;if(i=typeof r==`object`&&r.once===!0?a=>{S(e,t,i,r),n(a)}:n,Qm(e,t,i,r))return;let a=v(g(r===!0||typeof r==`object`&&r.capture===!0?`capture`:`bubble`,e),t);if(a.has(i)||a.add(i),t===window){let t=_(e);t.has(i)||t.add(i)}}function S(e,t,n,r){if($m(e,t,n,r))return;let i=r===!0||typeof r==`object`&&r.capture===!0,a=i?`capture`:`bubble`,o=g(a,e),s=v(o,t);if(t===window&&!y(t,i?`bubble`:`capture`,e,n)&&b(e,n)){let t=d[e];t.delete(n),t.size===0&&(window.removeEventListener(e,h),d[e]=void 0)}s.has(n)&&s.delete(n),s.size===0&&o.delete(t),o.size===0&&(window.removeEventListener(e,m,a===`capture`),u[a][e]=void 0)}return{on:x,off:S}}var{on:th,off:nh}=eh();function rh(e){let t=(0,r.ref)(!!e.value);if(t.value)return(0,r.readonly)(t);let n=(0,r.watch)(e,e=>{e&&(t.value=!0,n())});return(0,r.readonly)(t)}function ih(e){let t=(0,r.computed)(e),n=(0,r.ref)(t.value);return(0,r.watch)(t,e=>{n.value=e}),typeof e==`function`?n:{__v_isRef:!0,get value(){return n.value},set value(t){e.set(t)}}}var ah=typeof window<`u`?document?.fonts?.ready:void 0,oh=!1;ah===void 0?oh=!0:ah.then(()=>{oh=!0});function sh(e){if(oh)return;let t=!1;(0,r.onMounted)(()=>{oh||ah?.then(()=>{t||e()})}),(0,r.onBeforeUnmount)(()=>{t=!0})}function ch(e,t){return(0,r.watch)(e,e=>{e!==void 0&&(t.value=e)}),(0,r.computed)(()=>e.value===void 0?t.value:e.value)}function lh(){let e=(0,r.ref)(!1);return(0,r.onMounted)(()=>{e.value=!0}),(0,r.readonly)(e)}function uh(e,t){return(0,r.computed)(()=>{for(let n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}var dh=(typeof window>`u`?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1)&&!window.MSStream;function fh(){return dh}var ph=`__disabled__`;function mh(e){let t=(0,r.inject)(Km,null),n=(0,r.inject)(Gm,null),i=(0,r.inject)(qm,null),a=(0,r.inject)(Wm,null),o=(0,r.ref)();if(typeof document<`u`){o.value=document.fullscreenElement;let e=()=>{o.value=document.fullscreenElement};(0,r.onMounted)(()=>{th(`fullscreenchange`,document,e)}),(0,r.onBeforeUnmount)(()=>{nh(`fullscreenchange`,document,e)})}return ih(()=>{let{to:r}=e;return r===void 0?t?.value?t.value.$el??t.value:n?.value?n.value:i?.value?i.value:a?.value?a.value:r??(o.value||`body`):r===!1?ph:r===!0?o.value||`body`:r})}mh.tdkey=ph,mh.propTo={type:[String,Object,Boolean],default:void 0};var hh=new WeakSet;function gh(e){hh.add(e)}var _h=new Set;function vh(e,t){let n=`[naive/${e}]: ${t}`;_h.has(n)||(_h.add(n),console.error(n))}function yh(e,t){console.error(`[naive/${e}]: ${t}`)}function bh(e,t){throw Error(`[naive/${e}]: ${t}`)}function xh(e,...t){if(Array.isArray(e))e.forEach(e=>xh(e,...t));else return e(...t)}var Sh=Hm(`n-config-provider`);function Ch(e={},t={defaultBordered:!0}){let n=(0,r.inject)(Sh,null);return{inlineThemeDisabled:n?.inlineThemeDisabled,mergedRtlRef:n?.mergedRtlRef,mergedComponentPropsRef:n?.mergedComponentPropsRef,mergedBreakpointsRef:n?.mergedBreakpointsRef,mergedBorderedRef:(0,r.computed)(()=>{let{bordered:r}=e;return r===void 0?n?.mergedBorderedRef.value??t.defaultBordered??!0:r}),mergedClsPrefixRef:n?n.mergedClsPrefixRef:(0,r.shallowRef)(`n`),namespaceRef:(0,r.computed)(()=>n?.mergedNamespaceRef.value)}}function wh(e){let t=`.`,n=`__`,r=`--`,i;if(e){let i=e.blockPrefix;i&&(t=i),i=e.elementPrefix,i&&(n=i),i=e.modifierPrefix,i&&(r=i)}let a={install(e){i=e.c;let t=e.context;t.bem={},t.bem.b=null,t.bem.els=null}};function o(e){let n,r;return{before(e){n=e.bem.b,r=e.bem.els,e.bem.els=null},after(e){e.bem.b=n,e.bem.els=r},$({context:n,props:r}){return e=typeof e==`string`?e:e({context:n,props:r}),n.bem.b=e,`${r?.bPrefix||t}${n.bem.b}`}}}function s(e){let r;return{before(e){r=e.bem.els},after(e){e.bem.els=r},$({context:r,props:i}){return e=typeof e==`string`?e:e({context:r,props:i}),r.bem.els=e.split(`,`).map(e=>e.trim()),r.bem.els.map(e=>`${i?.bPrefix||t}${r.bem.b}${n}${e}`).join(`, `)}}}function c(e){return{$({context:i,props:a}){e=typeof e==`string`?e:e({context:i,props:a});let o=e.split(`,`).map(e=>e.trim());function s(e){return o.map(o=>`&${a?.bPrefix||t}${i.bem.b}${e===void 0?``:`${n}${e}`}${r}${o}`).join(`, `)}let c=i.bem.els;if(c!==null){if(process.env.NODE_ENV!==`production`&&c.length>=2)throw Error(`[css-render/plugin-bem]: m(${e}) is invalid, using modifier inside multiple elements is not allowed`);return s(c[0])}return s()}}}function l(e){return{$({context:i,props:a}){e=typeof e==`string`?e:e({context:i,props:a});let o=i.bem.els;if(process.env.NODE_ENV!==`production`&&o!==null&&o.length>=2)throw Error(`[css-render/plugin-bem]: notM(${e}) is invalid, using modifier inside multiple elements is not allowed`);return`&:not(${a?.bPrefix||t}${i.bem.b}${o!==null&&o.length>0?`${n}${o[0]}`:``}${r}${e})`}}}return Object.assign(a,{cB:((...e)=>i(o(e[0]),e[1],e[2])),cE:((...e)=>i(s(e[0]),e[1],e[2])),cM:((...e)=>i(c(e[0]),e[1],e[2])),cNotM:((...e)=>i(l(e[0]),e[1],e[2]))}),a}function Th(e){let t=0;for(let n=0;n<e.length;++n)e[n]===`&`&&++t;return t}var Eh=/\s*,(?![^(]*\))\s*/g,Dh=/\s+/g;function Oh(e,t){let n=[];return t.split(Eh).forEach(t=>{let r=Th(t);if(!r){e.forEach(e=>{n.push((e&&e+` `)+t)});return}if(r===1){e.forEach(e=>{n.push(t.replace(`&`,e))});return}let i=[t];for(;r--;){let t=[];i.forEach(n=>{e.forEach(e=>{t.push(n.replace(`&`,e))})}),i=t}i.forEach(e=>n.push(e))}),n}function kh(e,t){let n=[];return t.split(Eh).forEach(t=>{e.forEach(e=>{n.push((e&&e+` `)+t)})}),n}function Ah(e){let t=[``];return e.forEach(e=>{e&&=e.trim(),e&&(t=e.includes(`&`)?Oh(t,e):kh(t,e))}),t.join(`, `).replace(Dh,` `)}function jh(e){if(!e)return;let t=e.parentElement;t&&t.removeChild(e)}function Mh(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function Nh(e){let t=document.createElement(`style`);return t.setAttribute(`cssr-id`,e),t}function Ph(e){return e?/^\s*@(s|m)/.test(e):!1}var Fh=/[A-Z]/g;function Ih(e){return e.replace(Fh,e=>`-`+e.toLowerCase())}function Lh(e,t=` `){return typeof e==`object`&&e?` {
68
+ `+Object.entries(e).map(e=>t+` ${Ih(e[0])}: ${e[1]};`).join(`
69
69
  `)+`
70
- `+t+`}`:`: ${e};`}function Lh(e,t,n){return typeof e==`function`?e({context:t.context,props:n}):e}function Rh(e,t,n,r){if(!t)return``;let i=Lh(t,n,r);if(!i)return``;if(typeof i==`string`)return`${e} {\n${i}\n}`;let a=Object.keys(i);if(a.length===0)return n.config.keepEmptyBlock?e+` {
70
+ `+t+`}`:`: ${e};`}function Rh(e,t,n){return typeof e==`function`?e({context:t.context,props:n}):e}function zh(e,t,n,r){if(!t)return``;let i=Rh(t,n,r);if(!i)return``;if(typeof i==`string`)return`${e} {\n${i}\n}`;let a=Object.keys(i);if(a.length===0)return n.config.keepEmptyBlock?e+` {
71
71
  }`:``;let o=e?[e+` {`]:[];return a.forEach(e=>{let t=i[e];e===`raw`?o.push(`
72
72
  `+t+`
73
- `):(e=Fh(e),t!=null&&o.push(` ${e}${Ih(t)}`))}),e&&o.push(`}`),o.join(`
74
- `)}function zh(e,t,n){e&&e.forEach(e=>{if(Array.isArray(e))zh(e,t,n);else if(typeof e==`function`){let r=e(t);Array.isArray(r)?zh(r,t,n):r&&n(r)}else e&&n(e)})}function Bh(e,t,n,r,i){let a=e.$,o=``;if(!a||typeof a==`string`)Nh(a)?o=a:t.push(a);else if(typeof a==`function`){let e=a({context:r.context,props:i});Nh(e)?o=e:t.push(e)}else if(a.before&&a.before(r.context),!a.$||typeof a.$==`string`)Nh(a.$)?o=a.$:t.push(a.$);else if(a.$){let e=a.$({context:r.context,props:i});Nh(e)?o=e:t.push(e)}let s=kh(t),c=Rh(s,e.props,r,i);o?n.push(`${o} {`):c.length&&n.push(c),e.children&&zh(e.children,{context:r.context,props:i},e=>{if(typeof e==`string`){let t=Rh(s,{raw:e},r,i);n.push(t)}else Bh(e,t,n,r,i)}),t.pop(),o&&n.push(`}`),a&&a.after&&a.after(r.context)}function Vh(e,t,n){let r=[];return Bh(e,[],r,t,n),r.join(`
73
+ `):(e=Ih(e),t!=null&&o.push(` ${e}${Lh(t)}`))}),e&&o.push(`}`),o.join(`
74
+ `)}function Bh(e,t,n){e&&e.forEach(e=>{if(Array.isArray(e))Bh(e,t,n);else if(typeof e==`function`){let r=e(t);Array.isArray(r)?Bh(r,t,n):r&&n(r)}else e&&n(e)})}function Vh(e,t,n,r,i){let a=e.$,o=``;if(!a||typeof a==`string`)Ph(a)?o=a:t.push(a);else if(typeof a==`function`){let e=a({context:r.context,props:i});Ph(e)?o=e:t.push(e)}else if(a.before&&a.before(r.context),!a.$||typeof a.$==`string`)Ph(a.$)?o=a.$:t.push(a.$);else if(a.$){let e=a.$({context:r.context,props:i});Ph(e)?o=e:t.push(e)}let s=Ah(t),c=zh(s,e.props,r,i);o?n.push(`${o} {`):c.length&&n.push(c),e.children&&Bh(e.children,{context:r.context,props:i},e=>{if(typeof e==`string`){let t=zh(s,{raw:e},r,i);n.push(t)}else Vh(e,t,n,r,i)}),t.pop(),o&&n.push(`}`),a&&a.after&&a.after(r.context)}function Hh(e,t,n){let r=[];return Vh(e,[],r,t,n),r.join(`
75
75
 
76
- `)}function Hh(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<`u`&&(window.__cssrContext={});function Uh(e,t,n,r){let{els:i}=t;if(n===void 0)i.forEach(Ah),t.els=[];else{let e=jh(n,r);e&&i.includes(e)&&(Ah(e),t.els=i.filter(t=>t!==e))}}function Wh(e,t){e.push(t)}function Gh(e,t,n,r,i,a,o,s,c){let l;if(n===void 0&&(l=t.render(r),n=Hh(l)),c){c.adapter(n,l??t.render(r));return}s===void 0&&(s=document.head);let u=jh(n,s);if(u!==null&&!a)return u;let d=u??Mh(n);if(l===void 0&&(l=t.render(r)),d.textContent=l,u!==null)return u;if(o){let e=s.querySelector(`meta[name="${o}"]`);if(e)return s.insertBefore(d,e),Wh(t.els,d),d}return i?s.insertBefore(d,s.querySelector(`style, link`)):s.appendChild(d),Wh(t.els,d),d}function Kh(e){return Vh(this,this.instance,e)}function qh(e={}){let{id:t,ssr:n,props:r,head:i=!1,force:a=!1,anchorMetaName:o,parent:s}=e;return Gh(this.instance,this,t,r,i,a,o,s,n)}function Jh(e={}){let{id:t,parent:n}=e;Uh(this.instance,this,t,n)}var Yh=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:Kh,mount:qh,unmount:Jh}},Xh=function(e,t,n,r){return Array.isArray(t)?Yh(e,{$:null},null,t):Array.isArray(n)?Yh(e,t,null,n):Array.isArray(r)?Yh(e,t,n,r):Yh(e,t,n,null)};function Zh(e={}){let t={c:((...e)=>Xh(t,...e)),use:(e,...n)=>e.install(t,...n),find:jh,context:{},config:e};return t}function Qh(e,t){if(e===void 0)return!1;if(t){let{context:{ids:n}}=t;return n.has(e)}return jh(e)!==null}var $h=`__`,eg=`--`,tg=Zh(),ng=Ch({blockPrefix:`.n-`,elementPrefix:$h,modifierPrefix:eg});tg.use(ng);var{c:q,find:rg}=tg,{cB:J,cE:Y,cM:X,cNotM:ig}=ng,ag=(...e)=>q(`>`,[J(...e)]);function og(e,t){return e+(t==="default"?``:t.replace(/^[a-z]/,e=>e.toUpperCase()))}var sg=`@css-render/vue3-ssr`;function cg(e,t){return`<style cssr-id="${e}">\n${t}\n</style>`}function lg(e,t,n){let{styles:r,ids:i}=n;i.has(e)||r!==null&&(i.add(e),r.push(cg(e,t)))}var ug=typeof document<`u`;function dg(){if(ug)return;let e=(0,r.inject)(sg,null);if(e!==null)return{adapter:(t,n)=>lg(t,n,e),context:e}}function fg(e,t,n,i){n||yh(`useThemeClass`,`cssVarsRef is not passed`);let a=(0,r.inject)(xh,null),o=a?.mergedThemeHashRef,s=a?.styleMountTarget,c=(0,r.ref)(``),l=dg(),u,d=`__${e}`,f=()=>{let e=d,r=t?t.value:void 0,a=o?.value;a&&(e+=`-${a}`),r&&(e+=`-${r}`);let{themeOverrides:f,builtinThemeOverrides:p}=i;f&&(e+=`-${Hh(JSON.stringify(f))}`),p&&(e+=`-${Hh(JSON.stringify(p))}`),c.value=e,u=()=>{let t=n.value,r=``;for(let e in t)r+=`${e}: ${t[e]};`;q(`.${e}`,r).mount({id:e,ssr:l,parent:s}),u=void 0}};return(0,r.watchEffect)(()=>{f()}),{themeClass:c,onRender:()=>{u?.()}}}var pg=Vm(`n-form-item`);function mg(e,{defaultSize:t=`medium`,mergedSize:n,mergedDisabled:i}={}){let a=(0,r.inject)(pg,null);(0,r.provide)(pg,null);let o=(0,r.computed)(n?()=>n(a):()=>{let{size:n}=e;if(n)return n;if(a){let{mergedSize:e}=a;if(e.value!==void 0)return e.value}return t}),s=(0,r.computed)(i?()=>i(a):()=>{let{disabled:t}=e;return t===void 0?a?a.disabled.value:!1:t}),c=(0,r.computed)(()=>{let{status:t}=e;return t||a?.mergedValidationStatus.value});return(0,r.onBeforeUnmount)(()=>{a&&a.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:s,mergedStatusRef:c,nTriggerFormBlur(){a&&a.handleContentBlur()},nTriggerFormChange(){a&&a.handleContentChange()},nTriggerFormFocus(){a&&a.handleContentFocus()},nTriggerFormInput(){a&&a.handleContentInput()}}}var hg={name:`en-US`,global:{undo:`Undo`,redo:`Redo`,confirm:`Confirm`,clear:`Clear`},Popconfirm:{positiveText:`Confirm`,negativeText:`Cancel`},Cascader:{placeholder:`Please Select`,loading:`Loading`,loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:`yyyy-MM-dd`,dateTimeFormat:`yyyy-MM-dd HH:mm:ss`},DatePicker:{yearFormat:`yyyy`,monthFormat:`MMM`,dayFormat:`eeeeee`,yearTypeFormat:`yyyy`,monthTypeFormat:`yyyy-MM`,dateFormat:`yyyy-MM-dd`,dateTimeFormat:`yyyy-MM-dd HH:mm:ss`,quarterFormat:`yyyy-qqq`,weekFormat:`YYYY-w`,clear:`Clear`,now:`Now`,confirm:`Confirm`,selectTime:`Select Time`,selectDate:`Select Date`,datePlaceholder:`Select Date`,datetimePlaceholder:`Select Date and Time`,monthPlaceholder:`Select Month`,yearPlaceholder:`Select Year`,quarterPlaceholder:`Select Quarter`,weekPlaceholder:`Select Week`,startDatePlaceholder:`Start Date`,endDatePlaceholder:`End Date`,startDatetimePlaceholder:`Start Date and Time`,endDatetimePlaceholder:`End Date and Time`,startMonthPlaceholder:`Start Month`,endMonthPlaceholder:`End Month`,monthBeforeYear:!0,firstDayOfWeek:6,today:`Today`},DataTable:{checkTableAll:`Select all in the table`,uncheckTableAll:`Unselect all in the table`,confirm:`Confirm`,clear:`Clear`},LegacyTransfer:{sourceTitle:`Source`,targetTitle:`Target`},Transfer:{selectAll:`Select all`,unselectAll:`Unselect all`,clearAll:`Clear`,total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:`No Data`},Select:{placeholder:`Please Select`},TimePicker:{placeholder:`Select Time`,positiveText:`OK`,negativeText:`Cancel`,now:`Now`,clear:`Clear`},Pagination:{goto:`Goto`,selectionSuffix:`page`},DynamicTags:{add:`Add`},Log:{loading:`Loading`},Input:{placeholder:`Please Input`},InputNumber:{placeholder:`Please Input`},DynamicInput:{create:`Create`},ThemeEditor:{title:`Theme Editor`,clearAllVars:`Clear All Variables`,clearSearch:`Clear Search`,filterCompName:`Filter Component Name`,filterVarName:`Filter Variable Name`,import:`Import`,export:`Export`,restore:`Reset to Default`},Image:{tipPrevious:`Previous picture (←)`,tipNext:`Next picture (→)`,tipCounterclockwise:`Counterclockwise`,tipClockwise:`Clockwise`,tipZoomOut:`Zoom out`,tipZoomIn:`Zoom in`,tipDownload:`Download`,tipClose:`Close (Esc)`,tipOriginalSize:`Zoom to original size`},Heatmap:{less:`less`,more:`more`,monthFormat:`MMM`,weekdayFormat:`eee`}};function gg(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function _g(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function vg(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?bg(s,e=>e.test(o)):yg(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function yg(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bg(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function xg(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Sg={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`}},Cg=(e,t,n)=>{let r,i=Sg[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},wg={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Tg=(e,t,n,r)=>wg[e],Eg={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:_g({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:_g({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:_g({values:{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`]},defaultWidth:`wide`}),day:_g({values:{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`]},defaultWidth:`wide`}),dayPeriod:_g({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})},Dg={ordinalNumber:xg({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:vg({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:vg({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:vg({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:vg({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:vg({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},Og={name:`en-US`,locale:{code:`en-US`,formatDistance:Cg,formatLong:{date:gg({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:gg({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:gg({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:Tg,localize:Eg,match:Dg,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function kg(e){let{mergedLocaleRef:t,mergedDateLocaleRef:n}=(0,r.inject)(xh,null)||{},i=(0,r.computed)(()=>t?.value?.[e]??hg[e]);return{dateLocaleRef:(0,r.computed)(()=>n?.value??Og),localeRef:i}}var Ag=`naive-ui-style`,jg={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:Mg,fontFamily:Ng,lineHeight:Pg}=jg,Fg=q(`body`,`
76
+ `)}function Uh(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<`u`&&(window.__cssrContext={});function Wh(e,t,n,r){let{els:i}=t;if(n===void 0)i.forEach(jh),t.els=[];else{let e=Mh(n,r);e&&i.includes(e)&&(jh(e),t.els=i.filter(t=>t!==e))}}function Gh(e,t){e.push(t)}function Kh(e,t,n,r,i,a,o,s,c){let l;if(n===void 0&&(l=t.render(r),n=Uh(l)),c){c.adapter(n,l??t.render(r));return}s===void 0&&(s=document.head);let u=Mh(n,s);if(u!==null&&!a)return u;let d=u??Nh(n);if(l===void 0&&(l=t.render(r)),d.textContent=l,u!==null)return u;if(o){let e=s.querySelector(`meta[name="${o}"]`);if(e)return s.insertBefore(d,e),Gh(t.els,d),d}return i?s.insertBefore(d,s.querySelector(`style, link`)):s.appendChild(d),Gh(t.els,d),d}function qh(e){return Hh(this,this.instance,e)}function Jh(e={}){let{id:t,ssr:n,props:r,head:i=!1,force:a=!1,anchorMetaName:o,parent:s}=e;return Kh(this.instance,this,t,r,i,a,o,s,n)}function Yh(e={}){let{id:t,parent:n}=e;Wh(this.instance,this,t,n)}var Xh=function(e,t,n,r){return{instance:e,$:t,props:n,children:r,els:[],render:qh,mount:Jh,unmount:Yh}},Zh=function(e,t,n,r){return Array.isArray(t)?Xh(e,{$:null},null,t):Array.isArray(n)?Xh(e,t,null,n):Array.isArray(r)?Xh(e,t,n,r):Xh(e,t,n,null)};function Qh(e={}){let t={c:((...e)=>Zh(t,...e)),use:(e,...n)=>e.install(t,...n),find:Mh,context:{},config:e};return t}function $h(e,t){if(e===void 0)return!1;if(t){let{context:{ids:n}}=t;return n.has(e)}return Mh(e)!==null}var eg=`__`,tg=`--`,ng=Qh(),rg=wh({blockPrefix:`.n-`,elementPrefix:eg,modifierPrefix:tg});ng.use(rg);var{c:q,find:ig}=ng,{cB:J,cE:Y,cM:X,cNotM:ag}=rg,og=(...e)=>q(`>`,[J(...e)]);function sg(e,t){return e+(t==="default"?``:t.replace(/^[a-z]/,e=>e.toUpperCase()))}var cg=`@css-render/vue3-ssr`;function lg(e,t){return`<style cssr-id="${e}">\n${t}\n</style>`}function ug(e,t,n){let{styles:r,ids:i}=n;i.has(e)||r!==null&&(i.add(e),r.push(lg(e,t)))}var dg=typeof document<`u`;function fg(){if(dg)return;let e=(0,r.inject)(cg,null);if(e!==null)return{adapter:(t,n)=>ug(t,n,e),context:e}}function pg(e,t,n,i){n||bh(`useThemeClass`,`cssVarsRef is not passed`);let a=(0,r.inject)(Sh,null),o=a?.mergedThemeHashRef,s=a?.styleMountTarget,c=(0,r.ref)(``),l=fg(),u,d=`__${e}`,f=()=>{let e=d,r=t?t.value:void 0,a=o?.value;a&&(e+=`-${a}`),r&&(e+=`-${r}`);let{themeOverrides:f,builtinThemeOverrides:p}=i;f&&(e+=`-${Uh(JSON.stringify(f))}`),p&&(e+=`-${Uh(JSON.stringify(p))}`),c.value=e,u=()=>{let t=n.value,r=``;for(let e in t)r+=`${e}: ${t[e]};`;q(`.${e}`,r).mount({id:e,ssr:l,parent:s}),u=void 0}};return(0,r.watchEffect)(()=>{f()}),{themeClass:c,onRender:()=>{u?.()}}}var mg=Hm(`n-form-item`);function hg(e,{defaultSize:t=`medium`,mergedSize:n,mergedDisabled:i}={}){let a=(0,r.inject)(mg,null);(0,r.provide)(mg,null);let o=(0,r.computed)(n?()=>n(a):()=>{let{size:n}=e;if(n)return n;if(a){let{mergedSize:e}=a;if(e.value!==void 0)return e.value}return t}),s=(0,r.computed)(i?()=>i(a):()=>{let{disabled:t}=e;return t===void 0?a?a.disabled.value:!1:t}),c=(0,r.computed)(()=>{let{status:t}=e;return t||a?.mergedValidationStatus.value});return(0,r.onBeforeUnmount)(()=>{a&&a.restoreValidation()}),{mergedSizeRef:o,mergedDisabledRef:s,mergedStatusRef:c,nTriggerFormBlur(){a&&a.handleContentBlur()},nTriggerFormChange(){a&&a.handleContentChange()},nTriggerFormFocus(){a&&a.handleContentFocus()},nTriggerFormInput(){a&&a.handleContentInput()}}}var gg={name:`en-US`,global:{undo:`Undo`,redo:`Redo`,confirm:`Confirm`,clear:`Clear`},Popconfirm:{positiveText:`Confirm`,negativeText:`Cancel`},Cascader:{placeholder:`Please Select`,loading:`Loading`,loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:`yyyy-MM-dd`,dateTimeFormat:`yyyy-MM-dd HH:mm:ss`},DatePicker:{yearFormat:`yyyy`,monthFormat:`MMM`,dayFormat:`eeeeee`,yearTypeFormat:`yyyy`,monthTypeFormat:`yyyy-MM`,dateFormat:`yyyy-MM-dd`,dateTimeFormat:`yyyy-MM-dd HH:mm:ss`,quarterFormat:`yyyy-qqq`,weekFormat:`YYYY-w`,clear:`Clear`,now:`Now`,confirm:`Confirm`,selectTime:`Select Time`,selectDate:`Select Date`,datePlaceholder:`Select Date`,datetimePlaceholder:`Select Date and Time`,monthPlaceholder:`Select Month`,yearPlaceholder:`Select Year`,quarterPlaceholder:`Select Quarter`,weekPlaceholder:`Select Week`,startDatePlaceholder:`Start Date`,endDatePlaceholder:`End Date`,startDatetimePlaceholder:`Start Date and Time`,endDatetimePlaceholder:`End Date and Time`,startMonthPlaceholder:`Start Month`,endMonthPlaceholder:`End Month`,monthBeforeYear:!0,firstDayOfWeek:6,today:`Today`},DataTable:{checkTableAll:`Select all in the table`,uncheckTableAll:`Unselect all in the table`,confirm:`Confirm`,clear:`Clear`},LegacyTransfer:{sourceTitle:`Source`,targetTitle:`Target`},Transfer:{selectAll:`Select all`,unselectAll:`Unselect all`,clearAll:`Clear`,total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:`No Data`},Select:{placeholder:`Please Select`},TimePicker:{placeholder:`Select Time`,positiveText:`OK`,negativeText:`Cancel`,now:`Now`,clear:`Clear`},Pagination:{goto:`Goto`,selectionSuffix:`page`},DynamicTags:{add:`Add`},Log:{loading:`Loading`},Input:{placeholder:`Please Input`},InputNumber:{placeholder:`Please Input`},DynamicInput:{create:`Create`},ThemeEditor:{title:`Theme Editor`,clearAllVars:`Clear All Variables`,clearSearch:`Clear Search`,filterCompName:`Filter Component Name`,filterVarName:`Filter Variable Name`,import:`Import`,export:`Export`,restore:`Reset to Default`},Image:{tipPrevious:`Previous picture (←)`,tipNext:`Next picture (→)`,tipCounterclockwise:`Counterclockwise`,tipClockwise:`Clockwise`,tipZoomOut:`Zoom out`,tipZoomIn:`Zoom in`,tipDownload:`Download`,tipClose:`Close (Esc)`,tipOriginalSize:`Zoom to original size`},Heatmap:{less:`less`,more:`more`,monthFormat:`MMM`,weekdayFormat:`eee`}};function _g(e){return(t={})=>{let n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}function vg(e){return(t,n)=>{let r=n?.context?String(n.context):`standalone`,i;if(r===`formatting`&&e.formattingValues){let t=e.defaultFormattingWidth||e.defaultWidth,r=n?.width?String(n.width):t;i=e.formattingValues[r]||e.formattingValues[t]}else{let t=e.defaultWidth,r=n?.width?String(n.width):e.defaultWidth;i=e.values[r]||e.values[t]}let a=e.argumentCallback?e.argumentCallback(t):t;return i[a]}}function yg(e){return(t,n={})=>{let r=n.width,i=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],a=t.match(i);if(!a)return null;let o=a[0],s=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(s)?xg(s,e=>e.test(o)):bg(s,e=>e.test(o)),l;l=e.valueCallback?e.valueCallback(c):c,l=n.valueCallback?n.valueCallback(l):l;let u=t.slice(o.length);return{value:l,rest:u}}}function bg(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function xg(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return n}function Sg(e){return(t,n={})=>{let r=t.match(e.matchPattern);if(!r)return null;let i=r[0],a=t.match(e.parsePattern);if(!a)return null;let o=e.valueCallback?e.valueCallback(a[0]):a[0];o=n.valueCallback?n.valueCallback(o):o;let s=t.slice(i.length);return{value:o,rest:s}}}var Cg={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`}},wg=(e,t,n)=>{let r,i=Cg[e];return r=typeof i==`string`?i:t===1?i.one:i.other.replace(`{{count}}`,t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?`in `+r:r+` ago`:r},Tg={lastWeek:`'last' eeee 'at' p`,yesterday:`'yesterday at' p`,today:`'today at' p`,tomorrow:`'tomorrow at' p`,nextWeek:`eeee 'at' p`,other:`P`},Eg=(e,t,n,r)=>Tg[e],Dg={ordinalNumber:(e,t)=>{let n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+`st`;case 2:return n+`nd`;case 3:return n+`rd`}return n+`th`},era:vg({values:{narrow:[`B`,`A`],abbreviated:[`BC`,`AD`],wide:[`Before Christ`,`Anno Domini`]},defaultWidth:`wide`}),quarter:vg({values:{narrow:[`1`,`2`,`3`,`4`],abbreviated:[`Q1`,`Q2`,`Q3`,`Q4`],wide:[`1st quarter`,`2nd quarter`,`3rd quarter`,`4th quarter`]},defaultWidth:`wide`,argumentCallback:e=>e-1}),month:vg({values:{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`]},defaultWidth:`wide`}),day:vg({values:{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`]},defaultWidth:`wide`}),dayPeriod:vg({values:{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`}},defaultWidth:`wide`,formattingValues:{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`}},defaultFormattingWidth:`wide`})},Og={ordinalNumber:Sg({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:e=>parseInt(e,10)}),era:yg({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:`any`}),quarter:yg({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:`wide`,parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:`any`,valueCallback:e=>e+1}),month:yg({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),day:yg({matchPatterns:{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},defaultMatchWidth:`wide`,parsePatterns:{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]},defaultParseWidth:`any`}),dayPeriod:yg({matchPatterns:{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},defaultMatchWidth:`any`,parsePatterns:{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}},defaultParseWidth:`any`})},kg={name:`en-US`,locale:{code:`en-US`,formatDistance:wg,formatLong:{date:_g({formats:{full:`EEEE, MMMM do, y`,long:`MMMM do, y`,medium:`MMM d, y`,short:`MM/dd/yyyy`},defaultWidth:`full`}),time:_g({formats:{full:`h:mm:ss a zzzz`,long:`h:mm:ss a z`,medium:`h:mm:ss a`,short:`h:mm a`},defaultWidth:`full`}),dateTime:_g({formats:{full:`{{date}} 'at' {{time}}`,long:`{{date}} 'at' {{time}}`,medium:`{{date}}, {{time}}`,short:`{{date}}, {{time}}`},defaultWidth:`full`})},formatRelative:Eg,localize:Dg,match:Og,options:{weekStartsOn:0,firstWeekContainsDate:1}}};function Ag(e){let{mergedLocaleRef:t,mergedDateLocaleRef:n}=(0,r.inject)(Sh,null)||{},i=(0,r.computed)(()=>t?.value?.[e]??gg[e]);return{dateLocaleRef:(0,r.computed)(()=>n?.value??kg),localeRef:i}}var jg=`naive-ui-style`,Mg={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:Ng,fontFamily:Pg,lineHeight:Fg}=Mg,Ig=q(`body`,`
77
77
  margin: 0;
78
- font-size: ${Mg};
79
- font-family: ${Ng};
80
- line-height: ${Pg};
78
+ font-size: ${Ng};
79
+ font-family: ${Pg};
80
+ line-height: ${Fg};
81
81
  -webkit-text-size-adjust: 100%;
82
82
  -webkit-tap-highlight-color: transparent;
83
83
  `,[q(`input`,`
84
84
  font-family: inherit;
85
85
  font-size: inherit;
86
- `)]);function Ig(e){return e}function Lg(e,t,i,a,o,s){let c=dg(),l=(0,r.inject)(xh,null);if(i){let e=()=>{let e=s?.value;i.mount({id:e===void 0?t:e+t,head:!0,props:{bPrefix:e?`.${e}-`:void 0},anchorMetaName:Ag,ssr:c,parent:l?.styleMountTarget}),l?.preflightStyleDisabled||Fg.mount({id:`n-global`,head:!0,anchorMetaName:Ag,ssr:c,parent:l?.styleMountTarget})};c?e():(0,r.onBeforeMount)(e)}return(0,r.computed)(()=>{let{theme:{common:t,self:r,peers:i={}}={},themeOverrides:s={},builtinThemeOverrides:c={}}=o,{common:u,peers:d}=s,{common:f=void 0,[e]:{common:p=void 0,self:m=void 0,peers:h={}}={}}=l?.mergedThemeRef.value||{},{common:g=void 0,[e]:_={}}=l?.mergedThemeOverridesRef.value||{},{common:v,peers:y={}}=_,b=(0,n.merge)({},t||p||f||a.common,g,v,u);return{common:b,self:(0,n.merge)((r||m||a.self)?.(b),c,_,s),peers:(0,n.merge)({},a.peers,h,i),peerOverrides:(0,n.merge)({},c.peers,y,d)}})}Lg.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};var Rg=new WeakMap;function zg(e){let t=(0,r.getCurrentInstance)();if(t){Rg.has(t)||Rg.set(t,{});let n=Rg.get(t);return n[e]||(n[e]=[])}return[]}function Z(e,t=1){let n=r.createVNode,i=!1;return typeof e==`function`&&(i=!0,(0,r.openBlock)(),n=r.createBlock,e=e()),(0,r.isVNode)(e)?i?(0,r.createBlock)(Bg(e)):Bg(e):Array.isArray(e)?i?(0,r.createElementBlock)(r.Fragment,null,e.map(e=>Z(()=>e)),-2):(0,r.createElementVNode)(r.Fragment,null,e.slice()):e==null||typeof e==`boolean`?n(r.Comment):n(r.Text,null,String(e),t)}function Bg(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:(0,r.cloneVNode)(e)}var Vg=e=>Array.isArray(e)?e.map(e=>Z(e)):[Z(e)],Hg=e=>e._n?e:(0,r.withCtx)((...t)=>Vg(e(...t))),Ug=e=>typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!(0,r.isVNode)(e)?e:{default:(0,r.withCtx)(()=>[Z(()=>e)])},Q=e=>(0,r.normalizeClass)(e)||null,Wg=r.defineComponent;Wg((e,{slots:t})=>{let n=t.default;return()=>((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.in,(e,t,r)=>{let i=n(e,t,r);return Array.isArray(i)?i.length===1?i[0]:Z(i):i}),128))},{props:[`in`]});var Gg=[],Kg=new WeakMap;function qg(){Gg.forEach(e=>e(...Kg.get(e))),Gg=[]}function Jg(e,...t){Kg.set(e,t),!Gg.includes(e)&&Gg.push(e)===1&&requestAnimationFrame(qg)}function Yg(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function Xg(e){return e.composedPath()[0]||null}function Zg(e){return typeof e==`string`?e.endsWith(`px`)?Number(e.slice(0,e.length-2)):Number(e):e}function Qg(e){if(e!=null)return typeof e==`number`?`${e}px`:e.endsWith(`px`)?e:`${e}px`}function $g(e,t){let n=e.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw Error(`[seemly/getMargin]:`+e+` is not a valid value.`)}return t===void 0?r:r[t]}var e_={aliceblue:`#F0F8FF`,antiquewhite:`#FAEBD7`,aqua:`#0FF`,aquamarine:`#7FFFD4`,azure:`#F0FFFF`,beige:`#F5F5DC`,bisque:`#FFE4C4`,black:`#000`,blanchedalmond:`#FFEBCD`,blue:`#00F`,blueviolet:`#8A2BE2`,brown:`#A52A2A`,burlywood:`#DEB887`,cadetblue:`#5F9EA0`,chartreuse:`#7FFF00`,chocolate:`#D2691E`,coral:`#FF7F50`,cornflowerblue:`#6495ED`,cornsilk:`#FFF8DC`,crimson:`#DC143C`,cyan:`#0FF`,darkblue:`#00008B`,darkcyan:`#008B8B`,darkgoldenrod:`#B8860B`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,darkgreen:`#006400`,darkkhaki:`#BDB76B`,darkmagenta:`#8B008B`,darkolivegreen:`#556B2F`,darkorange:`#FF8C00`,darkorchid:`#9932CC`,darkred:`#8B0000`,darksalmon:`#E9967A`,darkseagreen:`#8FBC8F`,darkslateblue:`#483D8B`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,darkturquoise:`#00CED1`,darkviolet:`#9400D3`,deeppink:`#FF1493`,deepskyblue:`#00BFFF`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1E90FF`,firebrick:`#B22222`,floralwhite:`#FFFAF0`,forestgreen:`#228B22`,fuchsia:`#F0F`,gainsboro:`#DCDCDC`,ghostwhite:`#F8F8FF`,gold:`#FFD700`,goldenrod:`#DAA520`,gray:`#808080`,grey:`#808080`,green:`#008000`,greenyellow:`#ADFF2F`,honeydew:`#F0FFF0`,hotpink:`#FF69B4`,indianred:`#CD5C5C`,indigo:`#4B0082`,ivory:`#FFFFF0`,khaki:`#F0E68C`,lavender:`#E6E6FA`,lavenderblush:`#FFF0F5`,lawngreen:`#7CFC00`,lemonchiffon:`#FFFACD`,lightblue:`#ADD8E6`,lightcoral:`#F08080`,lightcyan:`#E0FFFF`,lightgoldenrodyellow:`#FAFAD2`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,lightgreen:`#90EE90`,lightpink:`#FFB6C1`,lightsalmon:`#FFA07A`,lightseagreen:`#20B2AA`,lightskyblue:`#87CEFA`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#B0C4DE`,lightyellow:`#FFFFE0`,lime:`#0F0`,limegreen:`#32CD32`,linen:`#FAF0E6`,magenta:`#F0F`,maroon:`#800000`,mediumaquamarine:`#66CDAA`,mediumblue:`#0000CD`,mediumorchid:`#BA55D3`,mediumpurple:`#9370DB`,mediumseagreen:`#3CB371`,mediumslateblue:`#7B68EE`,mediumspringgreen:`#00FA9A`,mediumturquoise:`#48D1CC`,mediumvioletred:`#C71585`,midnightblue:`#191970`,mintcream:`#F5FFFA`,mistyrose:`#FFE4E1`,moccasin:`#FFE4B5`,navajowhite:`#FFDEAD`,navy:`#000080`,oldlace:`#FDF5E6`,olive:`#808000`,olivedrab:`#6B8E23`,orange:`#FFA500`,orangered:`#FF4500`,orchid:`#DA70D6`,palegoldenrod:`#EEE8AA`,palegreen:`#98FB98`,paleturquoise:`#AFEEEE`,palevioletred:`#DB7093`,papayawhip:`#FFEFD5`,peachpuff:`#FFDAB9`,peru:`#CD853F`,pink:`#FFC0CB`,plum:`#DDA0DD`,powderblue:`#B0E0E6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#F00`,rosybrown:`#BC8F8F`,royalblue:`#4169E1`,saddlebrown:`#8B4513`,salmon:`#FA8072`,sandybrown:`#F4A460`,seagreen:`#2E8B57`,seashell:`#FFF5EE`,sienna:`#A0522D`,silver:`#C0C0C0`,skyblue:`#87CEEB`,slateblue:`#6A5ACD`,slategray:`#708090`,slategrey:`#708090`,snow:`#FFFAFA`,springgreen:`#00FF7F`,steelblue:`#4682B4`,tan:`#D2B48C`,teal:`#008080`,thistle:`#D8BFD8`,tomato:`#FF6347`,turquoise:`#40E0D0`,violet:`#EE82EE`,wheat:`#F5DEB3`,white:`#FFF`,whitesmoke:`#F5F5F5`,yellow:`#FF0`,yellowgreen:`#9ACD32`,transparent:`#0000`};function t_(e,t,n){t/=100,n/=100;let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function n_(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0)*255,i(8)*255,i(4)*255]}var r_=`^\\s*`,i_=`\\s*$`,a_=`\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*`,o_=`\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*`,s_=`([0-9A-Fa-f])`,c_=`([0-9A-Fa-f]{2})`,l_=RegExp(`${r_}hsl\\s*\\(${o_},${a_},${a_}\\)${i_}`),u_=RegExp(`${r_}hsv\\s*\\(${o_},${a_},${a_}\\)${i_}`),d_=RegExp(`${r_}hsla\\s*\\(${o_},${a_},${a_},${o_}\\)${i_}`),f_=RegExp(`${r_}hsva\\s*\\(${o_},${a_},${a_},${o_}\\)${i_}`),p_=RegExp(`${r_}rgb\\s*\\(${o_},${o_},${o_}\\)${i_}`),m_=RegExp(`${r_}rgba\\s*\\(${o_},${o_},${o_},${o_}\\)${i_}`),h_=RegExp(`${r_}#${s_}${s_}${s_}${i_}`),g_=RegExp(`${r_}#${c_}${c_}${c_}${i_}`),__=RegExp(`${r_}#${s_}${s_}${s_}${s_}${i_}`),v_=RegExp(`${r_}#${c_}${c_}${c_}${c_}${i_}`);function y_(e){return parseInt(e,16)}function b_(e){try{let t;if(t=d_.exec(e))return[A_(t[1]),M_(t[5]),M_(t[9]),k_(t[13])];if(t=l_.exec(e))return[A_(t[1]),M_(t[5]),M_(t[9]),1];throw Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(e){throw e}}function x_(e){try{let t;if(t=f_.exec(e))return[A_(t[1]),M_(t[5]),M_(t[9]),k_(t[13])];if(t=u_.exec(e))return[A_(t[1]),M_(t[5]),M_(t[9]),1];throw Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(e){throw e}}function S_(e){try{let t;if(t=g_.exec(e))return[y_(t[1]),y_(t[2]),y_(t[3]),1];if(t=p_.exec(e))return[j_(t[1]),j_(t[5]),j_(t[9]),1];if(t=m_.exec(e))return[j_(t[1]),j_(t[5]),j_(t[9]),k_(t[13])];if(t=h_.exec(e))return[y_(t[1]+t[1]),y_(t[2]+t[2]),y_(t[3]+t[3]),1];if(t=v_.exec(e))return[y_(t[1]),y_(t[2]),y_(t[3]),k_(y_(t[4])/255)];if(t=__.exec(e))return[y_(t[1]+t[1]),y_(t[2]+t[2]),y_(t[3]+t[3]),k_(y_(t[4]+t[4])/255)];if(e in e_)return S_(e_[e]);if(l_.test(e)||d_.test(e)){let[t,n,r,i]=b_(e);return[...n_(t,n,r),i]}if(u_.test(e)||f_.test(e)){let[t,n,r,i]=x_(e);return[...t_(t,n,r),i]}throw Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(e){throw e}}function C_(e){return e>1?1:e<0?0:e}function w_(e,t,n,r){return`rgba(${j_(e)}, ${j_(t)}, ${j_(n)}, ${C_(r)})`}function T_(e,t,n,r,i){return j_((e*t*(1-r)+n*r)/i)}function E_(e,t){Array.isArray(e)||(e=S_(e)),Array.isArray(t)||(t=S_(t));let n=e[3],r=t[3],i=k_(n+r-n*r);return w_(T_(e[0],n,t[0],r,i),T_(e[1],n,t[1],r,i),T_(e[2],n,t[2],r,i),i)}function D_(e,t){let[n,r,i,a=1]=Array.isArray(e)?e:S_(e);return typeof t.alpha==`number`?w_(n,r,i,t.alpha):w_(n,r,i,a)}function O_(e,t){let[n,r,i,a=1]=Array.isArray(e)?e:S_(e),{lightness:o=1,alpha:s=1}=t;return N_([n*o,r*o,i*o,a*s])}function k_(e){let t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function A_(e){let t=Math.round(Number(e));return t>=360||t<0?0:t}function j_(e){let t=Math.round(Number(e));return t>255?255:t<0?0:t}function M_(e){let t=Math.round(Number(e));return t>100?100:t<0?0:t}function N_(e){let[t,n,r]=e;return 3 in e?`rgba(${j_(t)}, ${j_(n)}, ${j_(r)}, ${k_(e[3])})`:`rgba(${j_(t)}, ${j_(n)}, ${j_(r)}, 1)`}function P_(e=8){return Math.random().toString(16).slice(2,2+e)}function F_(e,t,n=`default`){let r=t[n];if(r===void 0)throw Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function I_(e,t=!0,n=[]){return e.forEach(e=>{if(e!==null){if(typeof e!=`object`)(typeof e==`string`||typeof e==`number`)&&n.push((0,r.createTextVNode)(String(e)));else if(Array.isArray(e))I_(e,t,n);else if(e.type===r.Fragment){if(e.children===null)return;Array.isArray(e.children)&&I_(e.children,t,n)}else(e.type!==r.Comment||!t)&&n.push(e)}}),n}function L_(e,t,n=`default`){let r=t[n];if(r===void 0)throw Error(`[vueuc/${e}]: slot[${n}] is empty.`);let i=I_(r());if(i.length===1)return i[0];throw Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}var R_=null;function z_(){if(R_===null&&(R_=document.getElementById(`v-binder-view-measurer`),R_===null)){R_=document.createElement(`div`),R_.id=`v-binder-view-measurer`;let{style:e}=R_;e.position=`fixed`,e.left=`0`,e.right=`0`,e.top=`0`,e.bottom=`0`,e.pointerEvents=`none`,e.visibility=`hidden`,document.body.appendChild(R_)}return R_.getBoundingClientRect()}function B_(e,t){let n=z_();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function V_(e){let t=e.getBoundingClientRect(),n=z_();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function H_(e){return e.nodeType===9?null:e.parentNode}function U_(e){if(e===null)return null;let t=H_(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){let{overflow:e,overflowX:n,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e+r+n))return t}return U_(t)}var W_=(0,r.defineComponent)({name:`Binder`,props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){(0,r.provide)(`VBinder`,(0,r.getCurrentInstance)()?.proxy);let t=(0,r.inject)(`VBinder`,null),n=(0,r.ref)(null),i=r=>{n.value=r,t&&e.syncTargetWithParent&&t.setTargetRef(r)},a=[],o=()=>{let e=n.value;for(;e=U_(e),e!==null;)a.push(e);for(let e of a)eh(`scroll`,e,d,!0)},s=()=>{for(let e of a)th(`scroll`,e,d,!0);a=[]},c=new Set,l=e=>{c.size===0&&o(),c.has(e)||c.add(e)},u=e=>{c.has(e)&&c.delete(e),c.size===0&&s()},d=()=>{Jg(f)},f=()=>{c.forEach(e=>e())},p=new Set,m=e=>{p.size===0&&eh(`resize`,window,g),p.has(e)||p.add(e)},h=e=>{p.has(e)&&p.delete(e),p.size===0&&th(`resize`,window,g)},g=()=>{p.forEach(e=>e())};return(0,r.onBeforeUnmount)(()=>{th(`resize`,window,g),s()}),{targetRef:n,setTargetRef:i,addScrollListener:l,removeScrollListener:u,addResizeListener:m,removeResizeListener:h}},render(){return F_(`binder`,this.$slots)}}),G_=(0,r.defineComponent)({name:`Target`,setup(){let{setTargetRef:e,syncTarget:t}=(0,r.inject)(`VBinder`);return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){let{syncTarget:e,setTargetDirective:t}=this;return e?(0,r.withDirectives)(L_(`follower`,this.$slots),[[t]]):L_(`follower`,this.$slots)}}),K_=`@@mmoContext`,q_={mounted(e,{value:t}){e[K_]={handler:void 0},typeof t==`function`&&(e[K_].handler=t,eh(`mousemoveoutside`,e,t))},updated(e,{value:t}){let n=e[K_];typeof t==`function`?n.handler?n.handler!==t&&(th(`mousemoveoutside`,e,n.handler),n.handler=t,eh(`mousemoveoutside`,e,t)):(e[K_].handler=t,eh(`mousemoveoutside`,e,t)):n.handler&&=(th(`mousemoveoutside`,e,n.handler),void 0)},unmounted(e){let{handler:t}=e[K_];t&&th(`mousemoveoutside`,e,t),e[K_].handler=void 0}},J_=`@@coContext`,Y_={mounted(e,{value:t,modifiers:n}){e[J_]={handler:void 0},typeof t==`function`&&(e[J_].handler=t,eh(`clickoutside`,e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){let r=e[J_];typeof t==`function`?r.handler?r.handler!==t&&(th(`clickoutside`,e,r.handler,{capture:n.capture}),r.handler=t,eh(`clickoutside`,e,t,{capture:n.capture})):(e[J_].handler=t,eh(`clickoutside`,e,t,{capture:n.capture})):r.handler&&=(th(`clickoutside`,e,r.handler,{capture:n.capture}),void 0)},unmounted(e,{modifiers:t}){let{handler:n}=e[J_];n&&th(`clickoutside`,e,n,{capture:t.capture}),e[J_].handler=void 0}};function X_(e,t){console.error(`[vdirs/${e}]: ${t}`)}var Z_=new class{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,t){let{elementZIndex:n}=this;if(t!==void 0){e.style.zIndex=`${t}`,n.delete(e);return}let{nextZIndex:r}=this;n.has(e)&&n.get(e)+1===this.nextZIndex||(e.style.zIndex=`${r}`,n.set(e,r),this.nextZIndex=r+1,this.squashState())}unregister(e,t){let{elementZIndex:n}=this;n.has(e)?n.delete(e):t===void 0&&X_(`z-index-manager/unregister-element`,`Element not found when unregistering.`),this.squashState()}squashState(){let{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){let e=Array.from(this.elementZIndex.entries());e.sort((e,t)=>e[1]-t[1]),this.nextZIndex=2e3,e.forEach(e=>{let t=e[0],n=this.nextZIndex++;`${n}`!==t.style.zIndex&&(t.style.zIndex=`${n}`)})}},Q_=`@@ziContext`,$_={mounted(e,t){let{value:n={}}=t,{zIndex:r,enabled:i}=n;e[Q_]={enabled:!!i,initialized:!1},i&&(Z_.ensureZIndex(e,r),e[Q_].initialized=!0)},updated(e,t){let{value:n={}}=t,{zIndex:r,enabled:i}=n,a=e[Q_].enabled;i&&!a&&(Z_.ensureZIndex(e,r),e[Q_].initialized=!0),e[Q_].enabled=!!i},unmounted(e,t){if(!e[Q_].initialized)return;let{value:n={}}=t,{zIndex:r}=n;Z_.unregister(e,r)}};function ev(e,t){console.error(`[vueuc/${e}]: ${t}`)}var{c:tv}=Zh(),nv=`vueuc-style`;function rv(e){return e&-e}var iv=class{constructor(e,t){this.l=e,this.min=t;let n=Array(e+1);for(let t=0;t<e+1;++t)n[t]=0;this.ft=n}add(e,t){if(t===0)return;let{l:n,ft:r}=this;for(e+=1;e<=n;)r[e]+=t,e+=rv(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;let{ft:t,min:n,l:r}=this;if(e>r)throw Error("[FinweckTree.sum]: `i` is larger than length.");let i=e*n;for(;e>0;)i+=t[e],e-=rv(e);return i}getBound(e){let t=0,n=this.l;for(;n>t;){let r=Math.floor((t+n)/2),i=this.sum(r);if(i>e)n=r;else if(i<e){if(t===r)return this.sum(t+1)<=e?t+1:r;t=r}else return r}return t}};function av(e){return typeof e==`string`?document.querySelector(e):e()??null}var ov=(0,r.defineComponent)({name:`LazyTeleport`,props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:nh((0,r.toRef)(e,`show`)),mergedTo:(0,r.computed)(()=>{let{to:t}=e;return t??`body`})}},render(){return this.showTeleport?this.disabled?F_(`lazy-teleport`,this.$slots):(0,r.h)(r.Teleport,{disabled:this.disabled,to:this.mergedTo},F_(`lazy-teleport`,this.$slots)):null}}),sv={top:`bottom`,bottom:`top`,left:`right`,right:`left`},cv={start:`end`,center:`center`,end:`start`},lv={top:`height`,bottom:`height`,left:`width`,right:`width`},uv={"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`},dv={"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`},fv={"bottom-start":`right`,"bottom-end":`left`,"top-start":`right`,"top-end":`left`,"right-start":`bottom`,"right-end":`top`,"left-start":`bottom`,"left-end":`top`},pv={top:!0,bottom:!1,left:!0,right:!1},mv={top:`end`,bottom:`start`,left:`end`,right:`start`};function hv(e,t,n,r,i,a){if(!i||a)return{placement:e,top:0,left:0};let[o,s]=e.split(`-`),c=s??`center`,l={top:0,left:0},u=(e,i,a)=>{let o=0,s=0,c=n[e]-t[i]-t[e];return c>0&&r&&(a?s=pv[i]?c:-c:o=pv[i]?c:-c),{left:o,top:s}},d=o===`left`||o===`right`;if(c!==`center`){let r=fv[e],i=sv[r],a=lv[r];if(n[a]>t[a]){if(t[r]+t[a]<n[a]){let e=(n[a]-t[a])/2;t[r]<e||t[i]<e?t[r]<t[i]?(c=cv[s],l=u(a,i,d)):l=u(a,r,d):c=`center`}}else n[a]<t[a]&&t[i]<0&&t[r]>t[i]&&(c=cv[s])}else{let e=o===`bottom`||o===`top`?`left`:`top`,r=sv[e],i=lv[e],a=(n[i]-t[i])/2;(t[e]<a||t[r]<a)&&(t[e]>t[r]?(c=mv[e],l=u(i,e,d)):(c=mv[r],l=u(i,r,d)))}let f=o;return t[o]<n[lv[o]]&&t[o]<t[sv[o]]&&(f=sv[o]),{placement:c===`center`?f:`${f}-${c}`,left:l.left,top:l.top}}function gv(e,t){return t?dv[e]:uv[e]}function _v(e,t,n,r,i,a){if(a)switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`top-end`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-50%)`};default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%) translateY(-100%)`}}switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:``};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-100%)`};case`top-end`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:``};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%)`};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateY(-100%) translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-50%) translateX(-100%)`};default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateX(-50%)`}}}var vv=tv([tv(`.v-binder-follower-container`,{position:`absolute`,left:`0`,right:`0`,top:`0`,height:`0`,pointerEvents:`none`,zIndex:`auto`}),tv(`.v-binder-follower-content`,{position:`absolute`,zIndex:`auto`},[tv(`> *`,{pointerEvents:`all`})])]),yv=(0,r.defineComponent)({name:`Follower`,inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:`bottom`},syncTrigger:{type:Array,default:[`resize`,`scroll`]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){let t=(0,r.inject)(`VBinder`),n=rh(()=>e.enabled===void 0?e.show:e.enabled),i=(0,r.ref)(null),a=(0,r.ref)(null),o=()=>{let{syncTrigger:n}=e;n.includes(`scroll`)&&t.addScrollListener(l),n.includes(`resize`)&&t.addResizeListener(l)},s=()=>{t.removeScrollListener(l),t.removeResizeListener(l)};(0,r.onMounted)(()=>{n.value&&(l(),o())});let c=dg();vv.mount({id:`vueuc/binder`,head:!0,anchorMetaName:nv,ssr:c}),(0,r.onBeforeUnmount)(()=>{s()}),oh(()=>{n.value&&l()});let l=()=>{if(!n.value)return;let r=i.value;if(r===null)return;let o=t.targetRef,{x:s,y:c,overlap:l}=e,u=s!==void 0&&c!==void 0?B_(s,c):V_(o);r.style.setProperty(`--v-target-width`,`${Math.round(u.width)}px`),r.style.setProperty(`--v-target-height`,`${Math.round(u.height)}px`);let{width:d,minWidth:f,placement:p,internalShift:m,flip:h}=e;r.setAttribute(`v-placement`,p),l?r.setAttribute(`v-overlap`,``):r.removeAttribute(`v-overlap`);let{style:g}=r;g.width=d===`target`?`${u.width}px`:d===void 0?``:d,g.minWidth=f===`target`?`${u.width}px`:f===void 0?``:f;let _=V_(r),v=V_(a.value),{left:y,top:b,placement:x}=hv(p,u,_,m,h,l),S=gv(x,l),{left:C,top:w,transform:T}=_v(x,v,u,b,y,l);r.setAttribute(`v-placement`,x),r.style.setProperty(`--v-offset-left`,`${Math.round(y)}px`),r.style.setProperty(`--v-offset-top`,`${Math.round(b)}px`),r.style.transform=`translateX(${C}) translateY(${w}) ${T}`,r.style.setProperty(`--v-transform-origin`,S),r.style.transformOrigin=S};(0,r.watch)(n,e=>{e?(o(),u()):s()});let u=()=>{(0,r.nextTick)().then(l).catch(e=>console.error(e))};[`placement`,`x`,`y`,`internalShift`,`flip`,`width`,`overlap`,`minWidth`].forEach(t=>{(0,r.watch)((0,r.toRef)(e,t),l)}),[`teleportDisabled`].forEach(t=>{(0,r.watch)((0,r.toRef)(e,t),u)}),(0,r.watch)((0,r.toRef)(e,`syncTrigger`),e=>{e.includes(`resize`)?t.addResizeListener(l):t.removeResizeListener(l),e.includes(`scroll`)?t.addScrollListener(l):t.removeScrollListener(l)});let d=ch();return{VBinder:t,mergedEnabled:n,offsetContainerRef:a,followerRef:i,mergedTo:rh(()=>{let{to:t}=e;if(t!==void 0)return t;d.value}),syncPosition:l}},render(){return(0,r.h)(ov,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e;let t=(0,r.h)(`div`,{class:[`v-binder-follower-container`,this.containerClass],ref:`offsetContainerRef`},[(0,r.h)(`div`,{class:`v-binder-follower-content`,ref:`followerRef`},(e=this.$slots).default?.call(e))]);return this.zindexable?(0,r.withDirectives)(t,[[$_,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):t}})}}),bv=[],xv=function(){return bv.some(function(e){return e.activeTargets.length>0})},Sv=function(){return bv.some(function(e){return e.skippedTargets.length>0})},Cv=`ResizeObserver loop completed with undelivered notifications.`,wv=function(){var e;typeof ErrorEvent==`function`?e=new ErrorEvent(`error`,{message:Cv}):(e=document.createEvent(`Event`),e.initEvent(`error`,!1,!1),e.message=Cv),window.dispatchEvent(e)},Tv;(function(e){e.BORDER_BOX=`border-box`,e.CONTENT_BOX=`content-box`,e.DEVICE_PIXEL_CONTENT_BOX=`device-pixel-content-box`})(Tv||={});var Ev=function(e){return Object.freeze(e)},Dv=function(){function e(e,t){this.inlineSize=e,this.blockSize=t,Ev(this)}return e}(),Ov=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ev(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),kv=function(e){return e instanceof SVGElement&&`getBBox`in e},Av=function(e){if(kv(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||e.getClientRects().length)},jv=function(e){if(e instanceof Element)return!0;var t=e?.ownerDocument?.defaultView;return!!(t&&e instanceof t.Element)},Mv=function(e){switch(e.tagName){case`INPUT`:if(e.type!==`image`)break;case`VIDEO`:case`AUDIO`:case`EMBED`:case`OBJECT`:case`CANVAS`:case`IFRAME`:case`IMG`:return!0}return!1},Nv=typeof window<`u`?window:{},Pv=new WeakMap,Fv=/auto|scroll/,Iv=/^tb|vertical/,Lv=/msie|trident/i.test(Nv.navigator&&Nv.navigator.userAgent),Rv=function(e){return parseFloat(e||`0`)},zv=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Dv((n?t:e)||0,(n?e:t)||0)},Bv=Ev({devicePixelContentBoxSize:zv(),borderBoxSize:zv(),contentBoxSize:zv(),contentRect:new Ov(0,0,0,0)}),Vv=function(e,t){if(t===void 0&&(t=!1),Pv.has(e)&&!t)return Pv.get(e);if(Av(e))return Pv.set(e,Bv),Bv;var n=getComputedStyle(e),r=kv(e)&&e.ownerSVGElement&&e.getBBox(),i=!Lv&&n.boxSizing===`border-box`,a=Iv.test(n.writingMode||``),o=!r&&Fv.test(n.overflowY||``),s=!r&&Fv.test(n.overflowX||``),c=r?0:Rv(n.paddingTop),l=r?0:Rv(n.paddingRight),u=r?0:Rv(n.paddingBottom),d=r?0:Rv(n.paddingLeft),f=r?0:Rv(n.borderTopWidth),p=r?0:Rv(n.borderRightWidth),m=r?0:Rv(n.borderBottomWidth),h=r?0:Rv(n.borderLeftWidth),g=d+l,_=c+u,v=h+p,y=f+m,b=s?e.offsetHeight-y-e.clientHeight:0,x=o?e.offsetWidth-v-e.clientWidth:0,S=i?g+v:0,C=i?_+y:0,w=r?r.width:Rv(n.width)-S-x,T=r?r.height:Rv(n.height)-C-b,E=w+g+x+v,D=T+_+b+y,O=Ev({devicePixelContentBoxSize:zv(Math.round(w*devicePixelRatio),Math.round(T*devicePixelRatio),a),borderBoxSize:zv(E,D,a),contentBoxSize:zv(w,T,a),contentRect:new Ov(d,c,w,T)});return Pv.set(e,O),O},Hv=function(e,t,n){var r=Vv(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case Tv.DEVICE_PIXEL_CONTENT_BOX:return o;case Tv.BORDER_BOX:return i;default:return a}},Uv=function(){function e(e){var t=Vv(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Ev([t.borderBoxSize]),this.contentBoxSize=Ev([t.contentBoxSize]),this.devicePixelContentBoxSize=Ev([t.devicePixelContentBoxSize])}return e}(),Wv=function(e){if(Av(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Gv=function(){var e=1/0,t=[];bv.forEach(function(n){if(n.activeTargets.length!==0){var r=[];n.activeTargets.forEach(function(t){var n=new Uv(t.target),i=Wv(t.target);r.push(n),t.lastReportedSize=Hv(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var i=r[n];i()}return e},Kv=function(e){bv.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(Wv(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},qv=function(){var e=0;for(Kv(e);xv();)e=Gv(),Kv(e);return Sv()&&wv(),e>0},Jv,Yv=[],Xv=function(){return Yv.splice(0).forEach(function(e){return e()})},Zv=function(e){if(!Jv){var t=0,n=document.createTextNode(``);new MutationObserver(function(){return Xv()}).observe(n,{characterData:!0}),Jv=function(){n.textContent=`${t?t--:t++}`}}Yv.push(e),Jv()},Qv=function(e){Zv(function(){requestAnimationFrame(e)})},$v=0,ey=function(){return!!$v},ty=250,ny={attributes:!0,characterData:!0,childList:!0,subtree:!0},ry=[`resize`,`load`,`transitionend`,`animationend`,`animationstart`,`animationiteration`,`keyup`,`keydown`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`blur`,`focus`],iy=function(e){return e===void 0&&(e=0),Date.now()+e},ay=!1,oy=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(e===void 0&&(e=ty),!ay){ay=!0;var n=iy(e);Qv(function(){var r=!1;try{r=qv()}finally{if(ay=!1,e=n-iy(),!ey())return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,ny)};document.body?t():Nv.addEventListener(`DOMContentLoaded`,t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),ry.forEach(function(t){return Nv.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||=(this.observer&&this.observer.disconnect(),ry.forEach(function(t){return Nv.removeEventListener(t,e.listener,!0)}),!0)},e}()),sy=function(e){!$v&&e>0&&oy.start(),$v+=e,!$v&&oy.stop()},cy=function(e){return!kv(e)&&!Mv(e)&&getComputedStyle(e).display===`inline`},ly=function(){function e(e,t){this.target=e,this.observedBox=t||Tv.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=Hv(this.target,this.observedBox,!0);return cy(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),uy=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),dy=new WeakMap,fy=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},py=function(){function e(){}return e.connect=function(e,t){var n=new uy(e,t);dy.set(e,n)},e.observe=function(e,t,n){var r=dy.get(e),i=r.observationTargets.length===0;fy(r.observationTargets,t)<0&&(i&&bv.push(r),r.observationTargets.push(new ly(t,n&&n.box)),sy(1),oy.schedule())},e.unobserve=function(e,t){var n=dy.get(e),r=fy(n.observationTargets,t),i=n.observationTargets.length===1;r>=0&&(i&&bv.splice(bv.indexOf(n),1),n.observationTargets.splice(r,1),sy(-1))},e.disconnect=function(e){var t=this,n=dy.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),my=function(){function e(e){if(arguments.length===0)throw TypeError(`Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.`);if(typeof e!=`function`)throw TypeError(`Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.`);py.connect(this,e)}return e.prototype.observe=function(e,t){if(arguments.length===0)throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!jv(e))throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element`);py.observe(this,e,t)},e.prototype.unobserve=function(e){if(arguments.length===0)throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!jv(e))throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element`);py.unobserve(this,e)},e.prototype.disconnect=function(){py.disconnect(this)},e.toString=function(){return`function ResizeObserver () { [polyfill code] }`},e}(),hy=new class{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<`u`&&window.ResizeObserver||my)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(let t of e){let e=this.elHandlersMap.get(t.target);e!==void 0&&e(t)}}registerHandler(e,t){this.elHandlersMap.set(e,t),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}},gy=(0,r.defineComponent)({name:`ResizeObserver`,props:{onResize:Function},setup(e){let t=!1,n=(0,r.getCurrentInstance)().proxy;function i(t){let{onResize:n}=e;n!==void 0&&n(t)}(0,r.onMounted)(()=>{let e=n.$el;e===void 0?ev(`resize-observer`,`$el does not exist.`):e.nextElementSibling!==e.nextSibling&&e.nodeType===3&&e.nodeValue!==``?ev(`resize-observer`,`$el can not be observed (it may be a text node).`):e.nextElementSibling!==null&&(hy.registerHandler(e.nextElementSibling,i),t=!0)}),(0,r.onBeforeUnmount)(()=>{t&&hy.unregisterHandler(n.$el.nextElementSibling)})},render(){return(0,r.renderSlot)(this.$slots,`default`)}}),_y;function vy(){return typeof document>`u`?!1:(_y===void 0&&(_y=`matchMedia`in window&&window.matchMedia(`(pointer:coarse)`).matches),_y)}var yy;function by(){return typeof document>`u`?1:(yy===void 0&&(yy=`chrome`in window?window.devicePixelRatio:1),yy)}var xy=`VVirtualListXScroll`;function Sy({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){let i=(0,r.ref)(0),a=(0,r.ref)(0),o=(0,r.computed)(()=>{let t=e.value;if(t.length===0)return null;let n=new iv(t.length,0);return t.forEach((e,t)=>{n.add(t,e.width)}),n}),s=rh(()=>{let e=o.value;return e===null?0:Math.max(e.getBound(a.value)-1,0)}),c=e=>{let t=o.value;return t===null?0:t.sum(e)},l=rh(()=>{let t=o.value;return t===null?0:Math.min(t.getBound(a.value+i.value)+1,e.value.length-1)});return(0,r.provide)(xy,{startIndexRef:s,endIndexRef:l,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:c}),{listWidthRef:i,scrollLeftRef:a}}var Cy=(0,r.defineComponent)({name:`VirtualListRow`,props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){let{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:i,renderColRef:a,renderItemWithColsRef:o}=(0,r.inject)(xy);return{startIndex:e,endIndex:t,columns:n,renderCol:a,renderItemWithCols:o,getLeft:i}},render(){let{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:i,getLeft:a,item:o}=this;if(i!=null)return i({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:o,getLeft:a});if(r!=null){let i=[];for(let s=e;s<=t;++s){let e=n[s];i.push(r({column:e,left:a(s),item:o}))}return i}return null}}),wy=tv(`.v-vl`,{maxHeight:`inherit`,height:`100%`,overflow:`auto`,minWidth:`1px`},[tv(`&:not(.v-vl--show-scrollbar)`,{scrollbarWidth:`none`},[tv(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,{width:0,height:0,display:`none`})])]),Ty=(0,r.defineComponent)({name:`VirtualList`,inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:`div`},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:`key`},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){let t=dg();wy.mount({id:`vueuc/virtual-list`,head:!0,anchorMetaName:nv,ssr:t}),(0,r.onMounted)(()=>{let{defaultScrollIndex:t,defaultScrollKey:n}=e;t==null?n!=null&&_({key:n}):_({index:t})});let n=!1,i=!1;(0,r.onActivated)(()=>{n=!1,i?_({top:m.value,left:s.value}):i=!0}),(0,r.onDeactivated)(()=>{n=!0,i||=!0});let a=rh(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let t=0;return e.columns.forEach(e=>{t+=e.width}),t}),o=(0,r.computed)(()=>{let t=new Map,{keyField:n}=e;return e.items.forEach((e,r)=>{t.set(e[n],r)}),t}),{scrollLeftRef:s,listWidthRef:c}=Sy({columnsRef:(0,r.toRef)(e,`columns`),renderColRef:(0,r.toRef)(e,`renderCol`),renderItemWithColsRef:(0,r.toRef)(e,`renderItemWithCols`)}),l=(0,r.ref)(null),u=(0,r.ref)(void 0),d=new Map,f=(0,r.computed)(()=>{let{items:t,itemSize:n,keyField:r}=e,i=new iv(t.length,n);return t.forEach((e,t)=>{let n=e[r],a=d.get(n);a!==void 0&&i.add(t,a)}),i}),p=(0,r.ref)(0),m=(0,r.ref)(0),h=rh(()=>Math.max(f.value.getBound(m.value-Zg(e.paddingTop))-1,0)),g=(0,r.computed)(()=>{let{value:t}=u;if(t===void 0)return[];let{items:n,itemSize:r}=e,i=h.value,a=Math.min(i+Math.ceil(t/r+1),n.length-1),o=[];for(let e=i;e<=a;++e)o.push(n[e]);return o}),_=(e,t)=>{if(typeof e==`number`){x(e,t,`auto`);return}let{left:n,top:r,index:i,key:a,position:s,behavior:c,debounce:l=!0}=e;if(n!==void 0||r!==void 0)x(n,r,c);else if(i!==void 0)b(i,c,l);else if(a!==void 0){let e=o.value.get(a);e!==void 0&&b(e,c,l)}else s===`bottom`?x(0,2**53-1,c):s===`top`&&x(0,0,c)},v,y=null;function b(t,n,r){let i=l.value;if(i==null)return;let{value:a}=f,o=a.sum(t)+Zg(e.paddingTop);if(!r)i.scrollTo({left:0,top:o,behavior:n});else{v=t,y!==null&&window.clearTimeout(y),y=window.setTimeout(()=>{v=void 0,y=null},16);let{scrollTop:e,offsetHeight:r}=i;if(o>e){let s=a.get(t);o+s<=e+r||i.scrollTo({left:0,top:o+s-r,behavior:n})}else i.scrollTo({left:0,top:o,behavior:n})}}function x(e,t,n){l.value?.scrollTo({left:e,top:t,behavior:n})}function S(t,r){if(n||e.ignoreItemResize||k(r.target))return;let{value:i}=f,a=o.value.get(t),s=i.get(a),c=r.borderBoxSize?.[0]?.blockSize??r.contentRect.height;if(c===s)return;c-e.itemSize===0?d.delete(t):d.set(t,c-e.itemSize);let u=c-s;if(u===0)return;i.add(a,u);let m=l.value;if(m!=null){if(v===void 0){let e=i.sum(a);m.scrollTop>e&&m.scrollBy(0,u)}else(a<v||a===v&&c+i.sum(a)>m.scrollTop+m.offsetHeight)&&m.scrollBy(0,u);O()}p.value++}let C=!vy(),w=!1;function T(t){var n;(n=e.onScroll)==null||n.call(e,t),(!C||!w)&&O()}function E(t){var n;if((n=e.onWheel)==null||n.call(e,t),C){let e=l.value;if(e!=null){if(t.deltaX===0&&(e.scrollTop===0&&t.deltaY<=0||e.scrollTop+e.offsetHeight>=e.scrollHeight&&t.deltaY>=0))return;t.preventDefault(),e.scrollTop+=t.deltaY/by(),e.scrollLeft+=t.deltaX/by(),O(),w=!0,Jg(()=>{w=!1})}}}function D(t){if(n||k(t.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(t.contentRect.height===u.value)return}else if(t.contentRect.height===u.value&&t.contentRect.width===c.value)return;u.value=t.contentRect.height,c.value=t.contentRect.width;let{onResize:r}=e;r!==void 0&&r(t)}function O(){let{value:e}=l;e!=null&&(m.value=e.scrollTop,s.value=e.scrollLeft)}function k(e){let t=e;for(;t!==null;){if(t.style.display===`none`)return!0;t=t.parentElement}return!1}return{listHeight:u,listStyle:{overflow:`auto`},keyToIndex:o,itemsStyle:(0,r.computed)(()=>{let{itemResizable:t}=e,n=Qg(f.value.sum());return p.value,[e.itemsStyle,{boxSizing:`content-box`,width:Qg(a.value),height:t?``:n,minHeight:t?n:``,paddingTop:Qg(e.paddingTop),paddingBottom:Qg(e.paddingBottom)}]}),visibleItemsStyle:(0,r.computed)(()=>(p.value,{transform:`translateY(${Qg(f.value.sum(h.value))})`})),viewportItems:g,listElRef:l,itemsElRef:(0,r.ref)(null),scrollTo:_,handleListResize:D,handleListScroll:T,handleListWheel:E,handleItemResize:S}},render(){let{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:i}=this;return(0,r.h)(gy,{onResize:this.handleListResize},{default:()=>{var a;return(0,r.h)(`div`,(0,r.mergeProps)(this.$attrs,{class:[`v-vl`,this.showScrollbar&&`v-vl--show-scrollbar`],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:`listElRef`}),[this.items.length===0?(a=this.$slots).empty?.call(a):(0,r.h)(`div`,{ref:`itemsElRef`,class:`v-vl-items`,style:this.itemsStyle},[(0,r.h)(i,Object.assign({class:`v-vl-visible-items`,style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{let{renderCol:i,renderItemWithCols:a}=this;return this.viewportItems.map(o=>{let s=o[t],c=n.get(s),l=i==null?void 0:(0,r.h)(Cy,{index:c,item:o}),u=a==null?void 0:(0,r.h)(Cy,{index:c,item:o}),d=this.$slots.default({item:o,renderedCols:l,renderedItemWithCols:u,index:c})[0];return e?(0,r.h)(gy,{key:s,onResize:e=>this.handleItemResize(s,e)},{default:()=>d}):(d.key=s,d)})}})])])}})}}),Ey=`v-hidden`,Dy=tv(`[v-hidden]`,{display:`none!important`}),Oy=(0,r.defineComponent)({name:`Overflow`,props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){let n=(0,r.ref)(null),i=(0,r.ref)(null);function a(r){let{value:a}=n,{getCounter:o,getTail:s}=e,c;if(c=o===void 0?i.value:o(),!a||!c)return;c.hasAttribute(Ey)&&c.removeAttribute(Ey);let{children:l}=a;if(r.showAllItemsBeforeCalculate)for(let e of l)e.hasAttribute(Ey)&&e.removeAttribute(Ey);let u=a.offsetWidth,d=[],f=t.tail?s?.():null,p=f?f.offsetWidth:0,m=!1,h=a.children.length-+!!t.tail;for(let t=0;t<h-1;++t){if(t<0)continue;let n=l[t];if(m){n.hasAttribute(Ey)||n.setAttribute(Ey,``);continue}n.hasAttribute(Ey)&&n.removeAttribute(Ey);let r=n.offsetWidth;if(p+=r,d[t]=r,p>u){let{updateCounter:n}=e;for(let r=t;r>=0;--r){let i=h-1-r;n===void 0?c.textContent=`${i}`:n(i);let a=c.offsetWidth;if(p-=d[r],p+a<=u||r===0){m=!0,t=r-1,f&&(t===-1?(f.style.maxWidth=`${u-a}px`,f.style.boxSizing=`border-box`):f.style.maxWidth=``);let{onUpdateCount:n}=e;n&&n(i);break}}}}let{onUpdateOverflow:g}=e;m?g!==void 0&&g(!0):(g!==void 0&&g(!1),c.setAttribute(Ey,``))}let o=dg();return Dy.mount({id:`vueuc/overflow`,head:!0,anchorMetaName:nv,ssr:o}),(0,r.onMounted)(()=>a({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:i,sync:a}},render(){let{$slots:e}=this;return(0,r.nextTick)(()=>this.sync({showAllItemsBeforeCalculate:!1})),(0,r.h)(`div`,{class:`v-overflow`,ref:`selfRef`},[(0,r.renderSlot)(e,`default`),e.counter?e.counter():(0,r.h)(`span`,{style:{display:`inline-block`},ref:`counterRef`}),e.tail?e.tail():null])}});function ky(e){return e instanceof HTMLElement}function Ay(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];if(ky(n)&&(My(n)||Ay(n)))return!0}return!1}function jy(e){for(let t=e.childNodes.length-1;t>=0;t--){let n=e.childNodes[t];if(ky(n)&&(My(n)||jy(n)))return!0}return!1}function My(e){if(!Ny(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Ny(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute(`tabIndex`)!==null)return!0;if(e.getAttribute(`disabled`))return!1;switch(e.nodeName){case`A`:return!!e.href&&e.rel!==`ignore`;case`INPUT`:return e.type!==`hidden`&&e.type!==`file`;case`SELECT`:case`TEXTAREA`:return!0;default:return!1}}var Py=[],Fy=(0,r.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(e){let t=P_(),n=(0,r.ref)(null),i=(0,r.ref)(null),a=!1,o=!1,s=typeof document>`u`?null:document.activeElement;function c(){return Py[Py.length-1]===t}function l(t){var n;t.code===`Escape`&&c()&&((n=e.onEsc)==null||n.call(e,t))}(0,r.onMounted)(()=>{(0,r.watch)(()=>e.active,e=>{e?(f(),eh(`keydown`,document,l)):(th(`keydown`,document,l),a&&p())},{immediate:!0})}),(0,r.onBeforeUnmount)(()=>{th(`keydown`,document,l),a&&p()});function u(e){if(!o&&c()){let t=d();if(t===null||t.contains(Xg(e)))return;m(`first`)}}function d(){let e=n.value;if(e===null)return null;let t=e;for(;t=t.nextSibling,!(t===null||t instanceof Element&&t.tagName===`DIV`););return t}function f(){var n;if(!e.disabled){if(Py.push(t),e.autoFocus){let{initialFocusTo:t}=e;t===void 0?m(`first`):(n=av(t))==null||n.focus({preventScroll:!0})}a=!0,document.addEventListener(`focus`,u,!0)}}function p(){var n;if(e.disabled||(document.removeEventListener(`focus`,u,!0),Py=Py.filter(e=>e!==t),c()))return;let{finalFocusTo:r}=e;r===void 0?e.returnFocusOnDeactivated&&s instanceof HTMLElement&&(o=!0,s.focus({preventScroll:!0}),o=!1):(n=av(r))==null||n.focus({preventScroll:!0})}function m(t){if(c()&&e.active){let e=n.value,r=i.value;if(e!==null&&r!==null){let n=d();if(n==null||n===r){o=!0,e.focus({preventScroll:!0}),o=!1;return}o=!0;let i=t===`first`?Ay(n):jy(n);o=!1,i||(o=!0,e.focus({preventScroll:!0}),o=!1)}}}function h(e){if(o)return;let t=d();t!==null&&(e.relatedTarget!==null&&t.contains(e.relatedTarget)?m(`last`):m(`first`))}function g(e){o||(e.relatedTarget!==null&&e.relatedTarget===n.value?m(`last`):m(`first`))}return{focusableStartRef:n,focusableEndRef:i,focusableStyle:`position: absolute; height: 0; width: 0;`,handleStartFocus:h,handleEndFocus:g}},render(){let{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();let{active:t,focusableStyle:n}=this;return(0,r.h)(r.Fragment,null,[(0,r.h)(`div`,{"aria-hidden":`true`,tabindex:t?`0`:`-1`,ref:`focusableStartRef`,style:n,onFocus:this.handleStartFocus}),e(),(0,r.h)(`div`,{"aria-hidden":`true`,style:n,ref:`focusableEndRef`,tabindex:t?`0`:`-1`,onFocus:this.handleEndFocus})])}});function Iy(e,t){t&&((0,r.onMounted)(()=>{let{value:n}=e;n&&hy.registerHandler(n,t)}),(0,r.watch)(e,(e,t)=>{t&&hy.unregisterHandler(t)},{deep:!1}),(0,r.onBeforeUnmount)(()=>{let{value:t}=e;t&&hy.unregisterHandler(t)}))}function Ly(e){return e.some(e=>!(0,r.isVNode)(e)||!(e.type===r.Comment||e.type===r.Fragment&&!Ly(e.children)))?e:null}function Ry(e,t){return e&&Ly(e())||t()}function zy(e,t){return t(e&&Ly(e())||null)}function By(e){return!(e&&Ly(e()))}function Vy(e,t,n){if(!t)return;let i=dg(),a=(0,r.computed)(()=>{let{value:n}=t;if(!n)return;let r=n[e];if(r)return r}),o=(0,r.inject)(xh,null),s=()=>{(0,r.watchEffect)(()=>{let{value:t}=n,r=`${t}${e}Rtl`;if(Qh(r,i))return;let{value:s}=a;s&&s.style.mount({id:r,head:!0,anchorMetaName:Ag,props:{bPrefix:t?`.${t}-`:void 0},ssr:i,parent:o?.styleMountTarget})})};return i?s():(0,r.onBeforeMount)(s),a}var Hy=(0,r.defineComponent)({props:{onFocus:Function,onBlur:Function},setup(e){return()=>(()=>{let t=zg(`d16ead82505dc285`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{style:`width: 0; height: 0`,tabindex:0,onFocus:t[0]||=t=>e.onFocus?.(t),onBlur:t[1]||=t=>e.onBlur?.(t)},null,32)})()}});function Uy(e,t,n){if(!t){process.env.NODE_ENV!==`production`&&yh(`use-style`,`No style is specified.`);return}let i=dg(),a=(0,r.inject)(xh,null),o=()=>{let r=n.value;t.mount({id:r===void 0?e:r+e,head:!0,anchorMetaName:Ag,props:{bPrefix:r?`.${r}-`:void 0},ssr:i,parent:a?.styleMountTarget}),a?.preflightStyleDisabled||Fg.mount({id:`n-global`,head:!0,anchorMetaName:Ag,ssr:i,parent:a?.styleMountTarget})};i?o():(0,r.onBeforeMount)(o)}var Wy=(0,r.defineComponent)({name:`BaseIconSwitchTransition`,setup(e,{slots:t}){let n=ch();return()=>((0,r.openBlock)(),(0,r.createBlock)(r.Transition,{name:`icon-switch-transition`,appear:n.value},Ug(t),1032,[`appear`]))}}),{cubicBezierEaseInOut:Gy}=jg;function Ky({originalTransform:e=``,left:t=0,top:n=0,transition:r=`all .3s ${Gy} !important`}={}){return[q(`&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to`,{transform:`${e} scale(0.75)`,left:t,top:n,opacity:0}),q(`&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from`,{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),q(`&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active`,{transformOrigin:`center`,position:`absolute`,left:t,top:n,transition:r})]}var qy=q([q(`@keyframes rotator`,`
86
+ `)]);function Lg(e){return e}function Rg(e,t,i,a,o,s){let c=fg(),l=(0,r.inject)(Sh,null);if(i){let e=()=>{let e=s?.value;i.mount({id:e===void 0?t:e+t,head:!0,props:{bPrefix:e?`.${e}-`:void 0},anchorMetaName:jg,ssr:c,parent:l?.styleMountTarget}),l?.preflightStyleDisabled||Ig.mount({id:`n-global`,head:!0,anchorMetaName:jg,ssr:c,parent:l?.styleMountTarget})};c?e():(0,r.onBeforeMount)(e)}return(0,r.computed)(()=>{let{theme:{common:t,self:r,peers:i={}}={},themeOverrides:s={},builtinThemeOverrides:c={}}=o,{common:u,peers:d}=s,{common:f=void 0,[e]:{common:p=void 0,self:m=void 0,peers:h={}}={}}=l?.mergedThemeRef.value||{},{common:g=void 0,[e]:_={}}=l?.mergedThemeOverridesRef.value||{},{common:v,peers:y={}}=_,b=(0,n.merge)({},t||p||f||a.common,g,v,u);return{common:b,self:(0,n.merge)((r||m||a.self)?.(b),c,_,s),peers:(0,n.merge)({},a.peers,h,i),peerOverrides:(0,n.merge)({},c.peers,y,d)}})}Rg.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};var zg=new WeakMap;function Bg(e){let t=(0,r.getCurrentInstance)();if(t){zg.has(t)||zg.set(t,{});let n=zg.get(t);return n[e]||(n[e]=[])}return[]}function Z(e,t=1){let n=r.createVNode,i=!1;return typeof e==`function`&&(i=!0,(0,r.openBlock)(),n=r.createBlock,e=e()),(0,r.isVNode)(e)?i?(0,r.createBlock)(Vg(e)):Vg(e):Array.isArray(e)?i?(0,r.createElementBlock)(r.Fragment,null,e.map(e=>Z(()=>e)),-2):(0,r.createElementVNode)(r.Fragment,null,e.slice()):e==null||typeof e==`boolean`?n(r.Comment):n(r.Text,null,String(e),t)}function Vg(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:(0,r.cloneVNode)(e)}var Hg=e=>Array.isArray(e)?e.map(e=>Z(e)):[Z(e)],Ug=e=>e._n?e:(0,r.withCtx)((...t)=>Hg(e(...t))),Wg=e=>typeof e==`function`||Object.prototype.toString.call(e)===`[object Object]`&&!(0,r.isVNode)(e)?e:{default:(0,r.withCtx)(()=>[Z(()=>e)])},Q=e=>(0,r.normalizeClass)(e)||null,Gg=r.defineComponent;Gg((e,{slots:t})=>{let n=t.default;return()=>((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.in,(e,t,r)=>{let i=n(e,t,r);return Array.isArray(i)?i.length===1?i[0]:Z(i):i}),128))},{props:[`in`]});var Kg=[],qg=new WeakMap;function Jg(){Kg.forEach(e=>e(...qg.get(e))),Kg=[]}function Yg(e,...t){qg.set(e,t),!Kg.includes(e)&&Kg.push(e)===1&&requestAnimationFrame(Jg)}function Xg(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function Zg(e){return e.composedPath()[0]||null}function Qg(e){return typeof e==`string`?e.endsWith(`px`)?Number(e.slice(0,e.length-2)):Number(e):e}function $g(e){if(e!=null)return typeof e==`number`?`${e}px`:e.endsWith(`px`)?e:`${e}px`}function e_(e,t){let n=e.trim().split(/\s+/g),r={top:n[0]};switch(n.length){case 1:r.right=n[0],r.bottom=n[0],r.left=n[0];break;case 2:r.right=n[1],r.left=n[1],r.bottom=n[0];break;case 3:r.right=n[1],r.bottom=n[2],r.left=n[1];break;case 4:r.right=n[1],r.bottom=n[2],r.left=n[3];break;default:throw Error(`[seemly/getMargin]:`+e+` is not a valid value.`)}return t===void 0?r:r[t]}var t_={aliceblue:`#F0F8FF`,antiquewhite:`#FAEBD7`,aqua:`#0FF`,aquamarine:`#7FFFD4`,azure:`#F0FFFF`,beige:`#F5F5DC`,bisque:`#FFE4C4`,black:`#000`,blanchedalmond:`#FFEBCD`,blue:`#00F`,blueviolet:`#8A2BE2`,brown:`#A52A2A`,burlywood:`#DEB887`,cadetblue:`#5F9EA0`,chartreuse:`#7FFF00`,chocolate:`#D2691E`,coral:`#FF7F50`,cornflowerblue:`#6495ED`,cornsilk:`#FFF8DC`,crimson:`#DC143C`,cyan:`#0FF`,darkblue:`#00008B`,darkcyan:`#008B8B`,darkgoldenrod:`#B8860B`,darkgray:`#A9A9A9`,darkgrey:`#A9A9A9`,darkgreen:`#006400`,darkkhaki:`#BDB76B`,darkmagenta:`#8B008B`,darkolivegreen:`#556B2F`,darkorange:`#FF8C00`,darkorchid:`#9932CC`,darkred:`#8B0000`,darksalmon:`#E9967A`,darkseagreen:`#8FBC8F`,darkslateblue:`#483D8B`,darkslategray:`#2F4F4F`,darkslategrey:`#2F4F4F`,darkturquoise:`#00CED1`,darkviolet:`#9400D3`,deeppink:`#FF1493`,deepskyblue:`#00BFFF`,dimgray:`#696969`,dimgrey:`#696969`,dodgerblue:`#1E90FF`,firebrick:`#B22222`,floralwhite:`#FFFAF0`,forestgreen:`#228B22`,fuchsia:`#F0F`,gainsboro:`#DCDCDC`,ghostwhite:`#F8F8FF`,gold:`#FFD700`,goldenrod:`#DAA520`,gray:`#808080`,grey:`#808080`,green:`#008000`,greenyellow:`#ADFF2F`,honeydew:`#F0FFF0`,hotpink:`#FF69B4`,indianred:`#CD5C5C`,indigo:`#4B0082`,ivory:`#FFFFF0`,khaki:`#F0E68C`,lavender:`#E6E6FA`,lavenderblush:`#FFF0F5`,lawngreen:`#7CFC00`,lemonchiffon:`#FFFACD`,lightblue:`#ADD8E6`,lightcoral:`#F08080`,lightcyan:`#E0FFFF`,lightgoldenrodyellow:`#FAFAD2`,lightgray:`#D3D3D3`,lightgrey:`#D3D3D3`,lightgreen:`#90EE90`,lightpink:`#FFB6C1`,lightsalmon:`#FFA07A`,lightseagreen:`#20B2AA`,lightskyblue:`#87CEFA`,lightslategray:`#778899`,lightslategrey:`#778899`,lightsteelblue:`#B0C4DE`,lightyellow:`#FFFFE0`,lime:`#0F0`,limegreen:`#32CD32`,linen:`#FAF0E6`,magenta:`#F0F`,maroon:`#800000`,mediumaquamarine:`#66CDAA`,mediumblue:`#0000CD`,mediumorchid:`#BA55D3`,mediumpurple:`#9370DB`,mediumseagreen:`#3CB371`,mediumslateblue:`#7B68EE`,mediumspringgreen:`#00FA9A`,mediumturquoise:`#48D1CC`,mediumvioletred:`#C71585`,midnightblue:`#191970`,mintcream:`#F5FFFA`,mistyrose:`#FFE4E1`,moccasin:`#FFE4B5`,navajowhite:`#FFDEAD`,navy:`#000080`,oldlace:`#FDF5E6`,olive:`#808000`,olivedrab:`#6B8E23`,orange:`#FFA500`,orangered:`#FF4500`,orchid:`#DA70D6`,palegoldenrod:`#EEE8AA`,palegreen:`#98FB98`,paleturquoise:`#AFEEEE`,palevioletred:`#DB7093`,papayawhip:`#FFEFD5`,peachpuff:`#FFDAB9`,peru:`#CD853F`,pink:`#FFC0CB`,plum:`#DDA0DD`,powderblue:`#B0E0E6`,purple:`#800080`,rebeccapurple:`#663399`,red:`#F00`,rosybrown:`#BC8F8F`,royalblue:`#4169E1`,saddlebrown:`#8B4513`,salmon:`#FA8072`,sandybrown:`#F4A460`,seagreen:`#2E8B57`,seashell:`#FFF5EE`,sienna:`#A0522D`,silver:`#C0C0C0`,skyblue:`#87CEEB`,slateblue:`#6A5ACD`,slategray:`#708090`,slategrey:`#708090`,snow:`#FFFAFA`,springgreen:`#00FF7F`,steelblue:`#4682B4`,tan:`#D2B48C`,teal:`#008080`,thistle:`#D8BFD8`,tomato:`#FF6347`,turquoise:`#40E0D0`,violet:`#EE82EE`,wheat:`#F5DEB3`,white:`#FFF`,whitesmoke:`#F5F5F5`,yellow:`#FF0`,yellowgreen:`#9ACD32`,transparent:`#0000`};function n_(e,t,n){t/=100,n/=100;let r=(r,i=(r+e/60)%6)=>n-n*t*Math.max(Math.min(i,4-i,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function r_(e,t,n){t/=100,n/=100;let r=t*Math.min(n,1-n),i=(t,i=(t+e/30)%12)=>n-r*Math.max(Math.min(i-3,9-i,1),-1);return[i(0)*255,i(8)*255,i(4)*255]}var i_=`^\\s*`,a_=`\\s*$`,o_=`\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*`,s_=`\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*`,c_=`([0-9A-Fa-f])`,l_=`([0-9A-Fa-f]{2})`,u_=RegExp(`${i_}hsl\\s*\\(${s_},${o_},${o_}\\)${a_}`),d_=RegExp(`${i_}hsv\\s*\\(${s_},${o_},${o_}\\)${a_}`),f_=RegExp(`${i_}hsla\\s*\\(${s_},${o_},${o_},${s_}\\)${a_}`),p_=RegExp(`${i_}hsva\\s*\\(${s_},${o_},${o_},${s_}\\)${a_}`),m_=RegExp(`${i_}rgb\\s*\\(${s_},${s_},${s_}\\)${a_}`),h_=RegExp(`${i_}rgba\\s*\\(${s_},${s_},${s_},${s_}\\)${a_}`),g_=RegExp(`${i_}#${c_}${c_}${c_}${a_}`),__=RegExp(`${i_}#${l_}${l_}${l_}${a_}`),v_=RegExp(`${i_}#${c_}${c_}${c_}${c_}${a_}`),y_=RegExp(`${i_}#${l_}${l_}${l_}${l_}${a_}`);function b_(e){return parseInt(e,16)}function x_(e){try{let t;if(t=f_.exec(e))return[j_(t[1]),N_(t[5]),N_(t[9]),A_(t[13])];if(t=u_.exec(e))return[j_(t[1]),N_(t[5]),N_(t[9]),1];throw Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(e){throw e}}function S_(e){try{let t;if(t=p_.exec(e))return[j_(t[1]),N_(t[5]),N_(t[9]),A_(t[13])];if(t=d_.exec(e))return[j_(t[1]),N_(t[5]),N_(t[9]),1];throw Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(e){throw e}}function C_(e){try{let t;if(t=__.exec(e))return[b_(t[1]),b_(t[2]),b_(t[3]),1];if(t=m_.exec(e))return[M_(t[1]),M_(t[5]),M_(t[9]),1];if(t=h_.exec(e))return[M_(t[1]),M_(t[5]),M_(t[9]),A_(t[13])];if(t=g_.exec(e))return[b_(t[1]+t[1]),b_(t[2]+t[2]),b_(t[3]+t[3]),1];if(t=y_.exec(e))return[b_(t[1]),b_(t[2]),b_(t[3]),A_(b_(t[4])/255)];if(t=v_.exec(e))return[b_(t[1]+t[1]),b_(t[2]+t[2]),b_(t[3]+t[3]),A_(b_(t[4]+t[4])/255)];if(e in t_)return C_(t_[e]);if(u_.test(e)||f_.test(e)){let[t,n,r,i]=x_(e);return[...r_(t,n,r),i]}if(d_.test(e)||p_.test(e)){let[t,n,r,i]=S_(e);return[...n_(t,n,r),i]}throw Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(e){throw e}}function w_(e){return e>1?1:e<0?0:e}function T_(e,t,n,r){return`rgba(${M_(e)}, ${M_(t)}, ${M_(n)}, ${w_(r)})`}function E_(e,t,n,r,i){return M_((e*t*(1-r)+n*r)/i)}function D_(e,t){Array.isArray(e)||(e=C_(e)),Array.isArray(t)||(t=C_(t));let n=e[3],r=t[3],i=A_(n+r-n*r);return T_(E_(e[0],n,t[0],r,i),E_(e[1],n,t[1],r,i),E_(e[2],n,t[2],r,i),i)}function O_(e,t){let[n,r,i,a=1]=Array.isArray(e)?e:C_(e);return typeof t.alpha==`number`?T_(n,r,i,t.alpha):T_(n,r,i,a)}function k_(e,t){let[n,r,i,a=1]=Array.isArray(e)?e:C_(e),{lightness:o=1,alpha:s=1}=t;return P_([n*o,r*o,i*o,a*s])}function A_(e){let t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function j_(e){let t=Math.round(Number(e));return t>=360||t<0?0:t}function M_(e){let t=Math.round(Number(e));return t>255?255:t<0?0:t}function N_(e){let t=Math.round(Number(e));return t>100?100:t<0?0:t}function P_(e){let[t,n,r]=e;return 3 in e?`rgba(${M_(t)}, ${M_(n)}, ${M_(r)}, ${A_(e[3])})`:`rgba(${M_(t)}, ${M_(n)}, ${M_(r)}, 1)`}function F_(e=8){return Math.random().toString(16).slice(2,2+e)}function I_(e,t,n=`default`){let r=t[n];if(r===void 0)throw Error(`[vueuc/${e}]: slot[${n}] is empty.`);return r()}function L_(e,t=!0,n=[]){return e.forEach(e=>{if(e!==null){if(typeof e!=`object`)(typeof e==`string`||typeof e==`number`)&&n.push((0,r.createTextVNode)(String(e)));else if(Array.isArray(e))L_(e,t,n);else if(e.type===r.Fragment){if(e.children===null)return;Array.isArray(e.children)&&L_(e.children,t,n)}else(e.type!==r.Comment||!t)&&n.push(e)}}),n}function R_(e,t,n=`default`){let r=t[n];if(r===void 0)throw Error(`[vueuc/${e}]: slot[${n}] is empty.`);let i=L_(r());if(i.length===1)return i[0];throw Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}var z_=null;function B_(){if(z_===null&&(z_=document.getElementById(`v-binder-view-measurer`),z_===null)){z_=document.createElement(`div`),z_.id=`v-binder-view-measurer`;let{style:e}=z_;e.position=`fixed`,e.left=`0`,e.right=`0`,e.top=`0`,e.bottom=`0`,e.pointerEvents=`none`,e.visibility=`hidden`,document.body.appendChild(z_)}return z_.getBoundingClientRect()}function V_(e,t){let n=B_();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function H_(e){let t=e.getBoundingClientRect(),n=B_();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function U_(e){return e.nodeType===9?null:e.parentNode}function W_(e){if(e===null)return null;let t=U_(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){let{overflow:e,overflowX:n,overflowY:r}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(e+r+n))return t}return W_(t)}var G_=(0,r.defineComponent)({name:`Binder`,props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){(0,r.provide)(`VBinder`,(0,r.getCurrentInstance)()?.proxy);let t=(0,r.inject)(`VBinder`,null),n=(0,r.ref)(null),i=r=>{n.value=r,t&&e.syncTargetWithParent&&t.setTargetRef(r)},a=[],o=()=>{let e=n.value;for(;e=W_(e),e!==null;)a.push(e);for(let e of a)th(`scroll`,e,d,!0)},s=()=>{for(let e of a)nh(`scroll`,e,d,!0);a=[]},c=new Set,l=e=>{c.size===0&&o(),c.has(e)||c.add(e)},u=e=>{c.has(e)&&c.delete(e),c.size===0&&s()},d=()=>{Yg(f)},f=()=>{c.forEach(e=>e())},p=new Set,m=e=>{p.size===0&&th(`resize`,window,g),p.has(e)||p.add(e)},h=e=>{p.has(e)&&p.delete(e),p.size===0&&nh(`resize`,window,g)},g=()=>{p.forEach(e=>e())};return(0,r.onBeforeUnmount)(()=>{nh(`resize`,window,g),s()}),{targetRef:n,setTargetRef:i,addScrollListener:l,removeScrollListener:u,addResizeListener:m,removeResizeListener:h}},render(){return I_(`binder`,this.$slots)}}),K_=(0,r.defineComponent)({name:`Target`,setup(){let{setTargetRef:e,syncTarget:t}=(0,r.inject)(`VBinder`);return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){let{syncTarget:e,setTargetDirective:t}=this;return e?(0,r.withDirectives)(R_(`follower`,this.$slots),[[t]]):R_(`follower`,this.$slots)}}),q_=`@@mmoContext`,J_={mounted(e,{value:t}){e[q_]={handler:void 0},typeof t==`function`&&(e[q_].handler=t,th(`mousemoveoutside`,e,t))},updated(e,{value:t}){let n=e[q_];typeof t==`function`?n.handler?n.handler!==t&&(nh(`mousemoveoutside`,e,n.handler),n.handler=t,th(`mousemoveoutside`,e,t)):(e[q_].handler=t,th(`mousemoveoutside`,e,t)):n.handler&&=(nh(`mousemoveoutside`,e,n.handler),void 0)},unmounted(e){let{handler:t}=e[q_];t&&nh(`mousemoveoutside`,e,t),e[q_].handler=void 0}},Y_=`@@coContext`,X_={mounted(e,{value:t,modifiers:n}){e[Y_]={handler:void 0},typeof t==`function`&&(e[Y_].handler=t,th(`clickoutside`,e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){let r=e[Y_];typeof t==`function`?r.handler?r.handler!==t&&(nh(`clickoutside`,e,r.handler,{capture:n.capture}),r.handler=t,th(`clickoutside`,e,t,{capture:n.capture})):(e[Y_].handler=t,th(`clickoutside`,e,t,{capture:n.capture})):r.handler&&=(nh(`clickoutside`,e,r.handler,{capture:n.capture}),void 0)},unmounted(e,{modifiers:t}){let{handler:n}=e[Y_];n&&nh(`clickoutside`,e,n,{capture:t.capture}),e[Y_].handler=void 0}};function Z_(e,t){console.error(`[vdirs/${e}]: ${t}`)}var Q_=new class{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(e,t){let{elementZIndex:n}=this;if(t!==void 0){e.style.zIndex=`${t}`,n.delete(e);return}let{nextZIndex:r}=this;n.has(e)&&n.get(e)+1===this.nextZIndex||(e.style.zIndex=`${r}`,n.set(e,r),this.nextZIndex=r+1,this.squashState())}unregister(e,t){let{elementZIndex:n}=this;n.has(e)?n.delete(e):t===void 0&&Z_(`z-index-manager/unregister-element`,`Element not found when unregistering.`),this.squashState()}squashState(){let{elementCount:e}=this;e||(this.nextZIndex=2e3),this.nextZIndex-e>2500&&this.rearrange()}rearrange(){let e=Array.from(this.elementZIndex.entries());e.sort((e,t)=>e[1]-t[1]),this.nextZIndex=2e3,e.forEach(e=>{let t=e[0],n=this.nextZIndex++;`${n}`!==t.style.zIndex&&(t.style.zIndex=`${n}`)})}},$_=`@@ziContext`,ev={mounted(e,t){let{value:n={}}=t,{zIndex:r,enabled:i}=n;e[$_]={enabled:!!i,initialized:!1},i&&(Q_.ensureZIndex(e,r),e[$_].initialized=!0)},updated(e,t){let{value:n={}}=t,{zIndex:r,enabled:i}=n,a=e[$_].enabled;i&&!a&&(Q_.ensureZIndex(e,r),e[$_].initialized=!0),e[$_].enabled=!!i},unmounted(e,t){if(!e[$_].initialized)return;let{value:n={}}=t,{zIndex:r}=n;Q_.unregister(e,r)}};function tv(e,t){console.error(`[vueuc/${e}]: ${t}`)}var{c:nv}=Qh(),rv=`vueuc-style`;function iv(e){return e&-e}var av=class{constructor(e,t){this.l=e,this.min=t;let n=Array(e+1);for(let t=0;t<e+1;++t)n[t]=0;this.ft=n}add(e,t){if(t===0)return;let{l:n,ft:r}=this;for(e+=1;e<=n;)r[e]+=t,e+=iv(e)}get(e){return this.sum(e+1)-this.sum(e)}sum(e){if(e===void 0&&(e=this.l),e<=0)return 0;let{ft:t,min:n,l:r}=this;if(e>r)throw Error("[FinweckTree.sum]: `i` is larger than length.");let i=e*n;for(;e>0;)i+=t[e],e-=iv(e);return i}getBound(e){let t=0,n=this.l;for(;n>t;){let r=Math.floor((t+n)/2),i=this.sum(r);if(i>e)n=r;else if(i<e){if(t===r)return this.sum(t+1)<=e?t+1:r;t=r}else return r}return t}};function ov(e){return typeof e==`string`?document.querySelector(e):e()??null}var sv=(0,r.defineComponent)({name:`LazyTeleport`,props:{to:{type:[String,Object],default:void 0},disabled:Boolean,show:{type:Boolean,required:!0}},setup(e){return{showTeleport:rh((0,r.toRef)(e,`show`)),mergedTo:(0,r.computed)(()=>{let{to:t}=e;return t??`body`})}},render(){return this.showTeleport?this.disabled?I_(`lazy-teleport`,this.$slots):(0,r.h)(r.Teleport,{disabled:this.disabled,to:this.mergedTo},I_(`lazy-teleport`,this.$slots)):null}}),cv={top:`bottom`,bottom:`top`,left:`right`,right:`left`},lv={start:`end`,center:`center`,end:`start`},uv={top:`height`,bottom:`height`,left:`width`,right:`width`},dv={"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`},fv={"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`},pv={"bottom-start":`right`,"bottom-end":`left`,"top-start":`right`,"top-end":`left`,"right-start":`bottom`,"right-end":`top`,"left-start":`bottom`,"left-end":`top`},mv={top:!0,bottom:!1,left:!0,right:!1},hv={top:`end`,bottom:`start`,left:`end`,right:`start`};function gv(e,t,n,r,i,a){if(!i||a)return{placement:e,top:0,left:0};let[o,s]=e.split(`-`),c=s??`center`,l={top:0,left:0},u=(e,i,a)=>{let o=0,s=0,c=n[e]-t[i]-t[e];return c>0&&r&&(a?s=mv[i]?c:-c:o=mv[i]?c:-c),{left:o,top:s}},d=o===`left`||o===`right`;if(c!==`center`){let r=pv[e],i=cv[r],a=uv[r];if(n[a]>t[a]){if(t[r]+t[a]<n[a]){let e=(n[a]-t[a])/2;t[r]<e||t[i]<e?t[r]<t[i]?(c=lv[s],l=u(a,i,d)):l=u(a,r,d):c=`center`}}else n[a]<t[a]&&t[i]<0&&t[r]>t[i]&&(c=lv[s])}else{let e=o===`bottom`||o===`top`?`left`:`top`,r=cv[e],i=uv[e],a=(n[i]-t[i])/2;(t[e]<a||t[r]<a)&&(t[e]>t[r]?(c=hv[e],l=u(i,e,d)):(c=hv[r],l=u(i,r,d)))}let f=o;return t[o]<n[uv[o]]&&t[o]<t[cv[o]]&&(f=cv[o]),{placement:c===`center`?f:`${f}-${c}`,left:l.left,top:l.top}}function _v(e,t){return t?fv[e]:dv[e]}function vv(e,t,n,r,i,a){if(a)switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`top-end`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%)`};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left)}px`,transform:``};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left+n.width)}px`,transform:`translateX(-100%) translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2)}px`,left:`${Math.round(n.left-t.left)}px`,transform:`translateY(-50%)`};default:return{top:`${Math.round(n.top-t.top+n.height)}px`,left:`${Math.round(n.left-t.left+n.width/2)}px`,transform:`translateX(-50%) translateY(-100%)`}}switch(e){case`bottom-start`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:``};case`bottom-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%)`};case`top-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-100%)`};case`top-end`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`right-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:``};case`right-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-100%)`};case`left-start`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%)`};case`left-end`:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateX(-100%) translateY(-100%)`};case`top`:return{top:`${Math.round(n.top-t.top+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateY(-100%) translateX(-50%)`};case`right`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+n.width+i)}px`,transform:`translateY(-50%)`};case`left`:return{top:`${Math.round(n.top-t.top+n.height/2+r)}px`,left:`${Math.round(n.left-t.left+i)}px`,transform:`translateY(-50%) translateX(-100%)`};default:return{top:`${Math.round(n.top-t.top+n.height+r)}px`,left:`${Math.round(n.left-t.left+n.width/2+i)}px`,transform:`translateX(-50%)`}}}var yv=nv([nv(`.v-binder-follower-container`,{position:`absolute`,left:`0`,right:`0`,top:`0`,height:`0`,pointerEvents:`none`,zIndex:`auto`}),nv(`.v-binder-follower-content`,{position:`absolute`,zIndex:`auto`},[nv(`> *`,{pointerEvents:`all`})])]),bv=(0,r.defineComponent)({name:`Follower`,inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:`bottom`},syncTrigger:{type:Array,default:[`resize`,`scroll`]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){let t=(0,r.inject)(`VBinder`),n=ih(()=>e.enabled===void 0?e.show:e.enabled),i=(0,r.ref)(null),a=(0,r.ref)(null),o=()=>{let{syncTrigger:n}=e;n.includes(`scroll`)&&t.addScrollListener(l),n.includes(`resize`)&&t.addResizeListener(l)},s=()=>{t.removeScrollListener(l),t.removeResizeListener(l)};(0,r.onMounted)(()=>{n.value&&(l(),o())});let c=fg();yv.mount({id:`vueuc/binder`,head:!0,anchorMetaName:rv,ssr:c}),(0,r.onBeforeUnmount)(()=>{s()}),sh(()=>{n.value&&l()});let l=()=>{if(!n.value)return;let r=i.value;if(r===null)return;let o=t.targetRef,{x:s,y:c,overlap:l}=e,u=s!==void 0&&c!==void 0?V_(s,c):H_(o);r.style.setProperty(`--v-target-width`,`${Math.round(u.width)}px`),r.style.setProperty(`--v-target-height`,`${Math.round(u.height)}px`);let{width:d,minWidth:f,placement:p,internalShift:m,flip:h}=e;r.setAttribute(`v-placement`,p),l?r.setAttribute(`v-overlap`,``):r.removeAttribute(`v-overlap`);let{style:g}=r;g.width=d===`target`?`${u.width}px`:d===void 0?``:d,g.minWidth=f===`target`?`${u.width}px`:f===void 0?``:f;let _=H_(r),v=H_(a.value),{left:y,top:b,placement:x}=gv(p,u,_,m,h,l),S=_v(x,l),{left:C,top:w,transform:T}=vv(x,v,u,b,y,l);r.setAttribute(`v-placement`,x),r.style.setProperty(`--v-offset-left`,`${Math.round(y)}px`),r.style.setProperty(`--v-offset-top`,`${Math.round(b)}px`),r.style.transform=`translateX(${C}) translateY(${w}) ${T}`,r.style.setProperty(`--v-transform-origin`,S),r.style.transformOrigin=S};(0,r.watch)(n,e=>{e?(o(),u()):s()});let u=()=>{(0,r.nextTick)().then(l).catch(e=>console.error(e))};[`placement`,`x`,`y`,`internalShift`,`flip`,`width`,`overlap`,`minWidth`].forEach(t=>{(0,r.watch)((0,r.toRef)(e,t),l)}),[`teleportDisabled`].forEach(t=>{(0,r.watch)((0,r.toRef)(e,t),u)}),(0,r.watch)((0,r.toRef)(e,`syncTrigger`),e=>{e.includes(`resize`)?t.addResizeListener(l):t.removeResizeListener(l),e.includes(`scroll`)?t.addScrollListener(l):t.removeScrollListener(l)});let d=lh();return{VBinder:t,mergedEnabled:n,offsetContainerRef:a,followerRef:i,mergedTo:ih(()=>{let{to:t}=e;if(t!==void 0)return t;d.value}),syncPosition:l}},render(){return(0,r.h)(sv,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e;let t=(0,r.h)(`div`,{class:[`v-binder-follower-container`,this.containerClass],ref:`offsetContainerRef`},[(0,r.h)(`div`,{class:`v-binder-follower-content`,ref:`followerRef`},(e=this.$slots).default?.call(e))]);return this.zindexable?(0,r.withDirectives)(t,[[ev,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):t}})}}),xv=[],Sv=function(){return xv.some(function(e){return e.activeTargets.length>0})},Cv=function(){return xv.some(function(e){return e.skippedTargets.length>0})},wv=`ResizeObserver loop completed with undelivered notifications.`,Tv=function(){var e;typeof ErrorEvent==`function`?e=new ErrorEvent(`error`,{message:wv}):(e=document.createEvent(`Event`),e.initEvent(`error`,!1,!1),e.message=wv),window.dispatchEvent(e)},Ev;(function(e){e.BORDER_BOX=`border-box`,e.CONTENT_BOX=`content-box`,e.DEVICE_PIXEL_CONTENT_BOX=`device-pixel-content-box`})(Ev||={});var Dv=function(e){return Object.freeze(e)},Ov=function(){function e(e,t){this.inlineSize=e,this.blockSize=t,Dv(this)}return e}(),kv=function(){function e(e,t,n,r){return this.x=e,this.y=t,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Dv(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Av=function(e){return e instanceof SVGElement&&`getBBox`in e},jv=function(e){if(Av(e)){var t=e.getBBox(),n=t.width,r=t.height;return!n&&!r}var i=e,a=i.offsetWidth,o=i.offsetHeight;return!(a||o||e.getClientRects().length)},Mv=function(e){if(e instanceof Element)return!0;var t=e?.ownerDocument?.defaultView;return!!(t&&e instanceof t.Element)},Nv=function(e){switch(e.tagName){case`INPUT`:if(e.type!==`image`)break;case`VIDEO`:case`AUDIO`:case`EMBED`:case`OBJECT`:case`CANVAS`:case`IFRAME`:case`IMG`:return!0}return!1},Pv=typeof window<`u`?window:{},Fv=new WeakMap,Iv=/auto|scroll/,Lv=/^tb|vertical/,Rv=/msie|trident/i.test(Pv.navigator&&Pv.navigator.userAgent),zv=function(e){return parseFloat(e||`0`)},Bv=function(e,t,n){return e===void 0&&(e=0),t===void 0&&(t=0),n===void 0&&(n=!1),new Ov((n?t:e)||0,(n?e:t)||0)},Vv=Dv({devicePixelContentBoxSize:Bv(),borderBoxSize:Bv(),contentBoxSize:Bv(),contentRect:new kv(0,0,0,0)}),Hv=function(e,t){if(t===void 0&&(t=!1),Fv.has(e)&&!t)return Fv.get(e);if(jv(e))return Fv.set(e,Vv),Vv;var n=getComputedStyle(e),r=Av(e)&&e.ownerSVGElement&&e.getBBox(),i=!Rv&&n.boxSizing===`border-box`,a=Lv.test(n.writingMode||``),o=!r&&Iv.test(n.overflowY||``),s=!r&&Iv.test(n.overflowX||``),c=r?0:zv(n.paddingTop),l=r?0:zv(n.paddingRight),u=r?0:zv(n.paddingBottom),d=r?0:zv(n.paddingLeft),f=r?0:zv(n.borderTopWidth),p=r?0:zv(n.borderRightWidth),m=r?0:zv(n.borderBottomWidth),h=r?0:zv(n.borderLeftWidth),g=d+l,_=c+u,v=h+p,y=f+m,b=s?e.offsetHeight-y-e.clientHeight:0,x=o?e.offsetWidth-v-e.clientWidth:0,S=i?g+v:0,C=i?_+y:0,w=r?r.width:zv(n.width)-S-x,T=r?r.height:zv(n.height)-C-b,E=w+g+x+v,D=T+_+b+y,O=Dv({devicePixelContentBoxSize:Bv(Math.round(w*devicePixelRatio),Math.round(T*devicePixelRatio),a),borderBoxSize:Bv(E,D,a),contentBoxSize:Bv(w,T,a),contentRect:new kv(d,c,w,T)});return Fv.set(e,O),O},Uv=function(e,t,n){var r=Hv(e,n),i=r.borderBoxSize,a=r.contentBoxSize,o=r.devicePixelContentBoxSize;switch(t){case Ev.DEVICE_PIXEL_CONTENT_BOX:return o;case Ev.BORDER_BOX:return i;default:return a}},Wv=function(){function e(e){var t=Hv(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Dv([t.borderBoxSize]),this.contentBoxSize=Dv([t.contentBoxSize]),this.devicePixelContentBoxSize=Dv([t.devicePixelContentBoxSize])}return e}(),Gv=function(e){if(jv(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Kv=function(){var e=1/0,t=[];xv.forEach(function(n){if(n.activeTargets.length!==0){var r=[];n.activeTargets.forEach(function(t){var n=new Wv(t.target),i=Gv(t.target);r.push(n),t.lastReportedSize=Uv(t.target,t.observedBox),i<e&&(e=i)}),t.push(function(){n.callback.call(n.observer,r,n.observer)}),n.activeTargets.splice(0,n.activeTargets.length)}});for(var n=0,r=t;n<r.length;n++){var i=r[n];i()}return e},qv=function(e){xv.forEach(function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach(function(n){n.isActive()&&(Gv(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))})})},Jv=function(){var e=0;for(qv(e);Sv();)e=Kv(),qv(e);return Cv()&&Tv(),e>0},Yv,Xv=[],Zv=function(){return Xv.splice(0).forEach(function(e){return e()})},Qv=function(e){if(!Yv){var t=0,n=document.createTextNode(``);new MutationObserver(function(){return Zv()}).observe(n,{characterData:!0}),Yv=function(){n.textContent=`${t?t--:t++}`}}Xv.push(e),Yv()},$v=function(e){Qv(function(){requestAnimationFrame(e)})},ey=0,ty=function(){return!!ey},ny=250,ry={attributes:!0,characterData:!0,childList:!0,subtree:!0},iy=[`resize`,`load`,`transitionend`,`animationend`,`animationstart`,`animationiteration`,`keyup`,`keydown`,`mouseup`,`mousedown`,`mouseover`,`mouseout`,`blur`,`focus`],ay=function(e){return e===void 0&&(e=0),Date.now()+e},oy=!1,sy=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(e===void 0&&(e=ny),!oy){oy=!0;var n=ay(e);$v(function(){var r=!1;try{r=Jv()}finally{if(oy=!1,e=n-ay(),!ty())return;r?t.run(1e3):e>0?t.run(e):t.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,ry)};document.body?t():Pv.addEventListener(`DOMContentLoaded`,t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),iy.forEach(function(t){return Pv.addEventListener(t,e.listener,!0)}))},e.prototype.stop=function(){var e=this;this.stopped||=(this.observer&&this.observer.disconnect(),iy.forEach(function(t){return Pv.removeEventListener(t,e.listener,!0)}),!0)},e}()),cy=function(e){!ey&&e>0&&sy.start(),ey+=e,!ey&&sy.stop()},ly=function(e){return!Av(e)&&!Nv(e)&&getComputedStyle(e).display===`inline`},uy=function(){function e(e,t){this.target=e,this.observedBox=t||Ev.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e=Uv(this.target,this.observedBox,!0);return ly(this.target)&&(this.lastReportedSize=e),this.lastReportedSize.inlineSize!==e.inlineSize||this.lastReportedSize.blockSize!==e.blockSize},e}(),dy=function(){function e(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t}return e}(),fy=new WeakMap,py=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},my=function(){function e(){}return e.connect=function(e,t){var n=new dy(e,t);fy.set(e,n)},e.observe=function(e,t,n){var r=fy.get(e),i=r.observationTargets.length===0;py(r.observationTargets,t)<0&&(i&&xv.push(r),r.observationTargets.push(new uy(t,n&&n.box)),cy(1),sy.schedule())},e.unobserve=function(e,t){var n=fy.get(e),r=py(n.observationTargets,t),i=n.observationTargets.length===1;r>=0&&(i&&xv.splice(xv.indexOf(n),1),n.observationTargets.splice(r,1),cy(-1))},e.disconnect=function(e){var t=this,n=fy.get(e);n.observationTargets.slice().forEach(function(n){return t.unobserve(e,n.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),hy=function(){function e(e){if(arguments.length===0)throw TypeError(`Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.`);if(typeof e!=`function`)throw TypeError(`Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.`);my.connect(this,e)}return e.prototype.observe=function(e,t){if(arguments.length===0)throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!Mv(e))throw TypeError(`Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element`);my.observe(this,e,t)},e.prototype.unobserve=function(e){if(arguments.length===0)throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.`);if(!Mv(e))throw TypeError(`Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element`);my.unobserve(this,e)},e.prototype.disconnect=function(){my.disconnect(this)},e.toString=function(){return`function ResizeObserver () { [polyfill code] }`},e}(),gy=new class{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<`u`&&window.ResizeObserver||hy)(this.handleResize),this.elHandlersMap=new Map}handleResize(e){for(let t of e){let e=this.elHandlersMap.get(t.target);e!==void 0&&e(t)}}registerHandler(e,t){this.elHandlersMap.set(e,t),this.observer.observe(e)}unregisterHandler(e){this.elHandlersMap.has(e)&&(this.elHandlersMap.delete(e),this.observer.unobserve(e))}},_y=(0,r.defineComponent)({name:`ResizeObserver`,props:{onResize:Function},setup(e){let t=!1,n=(0,r.getCurrentInstance)().proxy;function i(t){let{onResize:n}=e;n!==void 0&&n(t)}(0,r.onMounted)(()=>{let e=n.$el;e===void 0?tv(`resize-observer`,`$el does not exist.`):e.nextElementSibling!==e.nextSibling&&e.nodeType===3&&e.nodeValue!==``?tv(`resize-observer`,`$el can not be observed (it may be a text node).`):e.nextElementSibling!==null&&(gy.registerHandler(e.nextElementSibling,i),t=!0)}),(0,r.onBeforeUnmount)(()=>{t&&gy.unregisterHandler(n.$el.nextElementSibling)})},render(){return(0,r.renderSlot)(this.$slots,`default`)}}),vy;function yy(){return typeof document>`u`?!1:(vy===void 0&&(vy=`matchMedia`in window&&window.matchMedia(`(pointer:coarse)`).matches),vy)}var by;function xy(){return typeof document>`u`?1:(by===void 0&&(by=`chrome`in window?window.devicePixelRatio:1),by)}var Sy=`VVirtualListXScroll`;function Cy({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){let i=(0,r.ref)(0),a=(0,r.ref)(0),o=(0,r.computed)(()=>{let t=e.value;if(t.length===0)return null;let n=new av(t.length,0);return t.forEach((e,t)=>{n.add(t,e.width)}),n}),s=ih(()=>{let e=o.value;return e===null?0:Math.max(e.getBound(a.value)-1,0)}),c=e=>{let t=o.value;return t===null?0:t.sum(e)},l=ih(()=>{let t=o.value;return t===null?0:Math.min(t.getBound(a.value+i.value)+1,e.value.length-1)});return(0,r.provide)(Sy,{startIndexRef:s,endIndexRef:l,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:c}),{listWidthRef:i,scrollLeftRef:a}}var wy=(0,r.defineComponent)({name:`VirtualListRow`,props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){let{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:i,renderColRef:a,renderItemWithColsRef:o}=(0,r.inject)(Sy);return{startIndex:e,endIndex:t,columns:n,renderCol:a,renderItemWithCols:o,getLeft:i}},render(){let{startIndex:e,endIndex:t,columns:n,renderCol:r,renderItemWithCols:i,getLeft:a,item:o}=this;if(i!=null)return i({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:o,getLeft:a});if(r!=null){let i=[];for(let s=e;s<=t;++s){let e=n[s];i.push(r({column:e,left:a(s),item:o}))}return i}return null}}),Ty=nv(`.v-vl`,{maxHeight:`inherit`,height:`100%`,overflow:`auto`,minWidth:`1px`},[nv(`&:not(.v-vl--show-scrollbar)`,{scrollbarWidth:`none`},[nv(`&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb`,{width:0,height:0,display:`none`})])]),Ey=(0,r.defineComponent)({name:`VirtualList`,inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:`div`},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:`key`},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){let t=fg();Ty.mount({id:`vueuc/virtual-list`,head:!0,anchorMetaName:rv,ssr:t}),(0,r.onMounted)(()=>{let{defaultScrollIndex:t,defaultScrollKey:n}=e;t==null?n!=null&&_({key:n}):_({index:t})});let n=!1,i=!1;(0,r.onActivated)(()=>{n=!1,i?_({top:m.value,left:s.value}):i=!0}),(0,r.onDeactivated)(()=>{n=!0,i||=!0});let a=ih(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let t=0;return e.columns.forEach(e=>{t+=e.width}),t}),o=(0,r.computed)(()=>{let t=new Map,{keyField:n}=e;return e.items.forEach((e,r)=>{t.set(e[n],r)}),t}),{scrollLeftRef:s,listWidthRef:c}=Cy({columnsRef:(0,r.toRef)(e,`columns`),renderColRef:(0,r.toRef)(e,`renderCol`),renderItemWithColsRef:(0,r.toRef)(e,`renderItemWithCols`)}),l=(0,r.ref)(null),u=(0,r.ref)(void 0),d=new Map,f=(0,r.computed)(()=>{let{items:t,itemSize:n,keyField:r}=e,i=new av(t.length,n);return t.forEach((e,t)=>{let n=e[r],a=d.get(n);a!==void 0&&i.add(t,a)}),i}),p=(0,r.ref)(0),m=(0,r.ref)(0),h=ih(()=>Math.max(f.value.getBound(m.value-Qg(e.paddingTop))-1,0)),g=(0,r.computed)(()=>{let{value:t}=u;if(t===void 0)return[];let{items:n,itemSize:r}=e,i=h.value,a=Math.min(i+Math.ceil(t/r+1),n.length-1),o=[];for(let e=i;e<=a;++e)o.push(n[e]);return o}),_=(e,t)=>{if(typeof e==`number`){x(e,t,`auto`);return}let{left:n,top:r,index:i,key:a,position:s,behavior:c,debounce:l=!0}=e;if(n!==void 0||r!==void 0)x(n,r,c);else if(i!==void 0)b(i,c,l);else if(a!==void 0){let e=o.value.get(a);e!==void 0&&b(e,c,l)}else s===`bottom`?x(0,2**53-1,c):s===`top`&&x(0,0,c)},v,y=null;function b(t,n,r){let i=l.value;if(i==null)return;let{value:a}=f,o=a.sum(t)+Qg(e.paddingTop);if(!r)i.scrollTo({left:0,top:o,behavior:n});else{v=t,y!==null&&window.clearTimeout(y),y=window.setTimeout(()=>{v=void 0,y=null},16);let{scrollTop:e,offsetHeight:r}=i;if(o>e){let s=a.get(t);o+s<=e+r||i.scrollTo({left:0,top:o+s-r,behavior:n})}else i.scrollTo({left:0,top:o,behavior:n})}}function x(e,t,n){l.value?.scrollTo({left:e,top:t,behavior:n})}function S(t,r){if(n||e.ignoreItemResize||k(r.target))return;let{value:i}=f,a=o.value.get(t),s=i.get(a),c=r.borderBoxSize?.[0]?.blockSize??r.contentRect.height;if(c===s)return;c-e.itemSize===0?d.delete(t):d.set(t,c-e.itemSize);let u=c-s;if(u===0)return;i.add(a,u);let m=l.value;if(m!=null){if(v===void 0){let e=i.sum(a);m.scrollTop>e&&m.scrollBy(0,u)}else(a<v||a===v&&c+i.sum(a)>m.scrollTop+m.offsetHeight)&&m.scrollBy(0,u);O()}p.value++}let C=!yy(),w=!1;function T(t){var n;(n=e.onScroll)==null||n.call(e,t),(!C||!w)&&O()}function E(t){var n;if((n=e.onWheel)==null||n.call(e,t),C){let e=l.value;if(e!=null){if(t.deltaX===0&&(e.scrollTop===0&&t.deltaY<=0||e.scrollTop+e.offsetHeight>=e.scrollHeight&&t.deltaY>=0))return;t.preventDefault(),e.scrollTop+=t.deltaY/xy(),e.scrollLeft+=t.deltaX/xy(),O(),w=!0,Yg(()=>{w=!1})}}}function D(t){if(n||k(t.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(t.contentRect.height===u.value)return}else if(t.contentRect.height===u.value&&t.contentRect.width===c.value)return;u.value=t.contentRect.height,c.value=t.contentRect.width;let{onResize:r}=e;r!==void 0&&r(t)}function O(){let{value:e}=l;e!=null&&(m.value=e.scrollTop,s.value=e.scrollLeft)}function k(e){let t=e;for(;t!==null;){if(t.style.display===`none`)return!0;t=t.parentElement}return!1}return{listHeight:u,listStyle:{overflow:`auto`},keyToIndex:o,itemsStyle:(0,r.computed)(()=>{let{itemResizable:t}=e,n=$g(f.value.sum());return p.value,[e.itemsStyle,{boxSizing:`content-box`,width:$g(a.value),height:t?``:n,minHeight:t?n:``,paddingTop:$g(e.paddingTop),paddingBottom:$g(e.paddingBottom)}]}),visibleItemsStyle:(0,r.computed)(()=>(p.value,{transform:`translateY(${$g(f.value.sum(h.value))})`})),viewportItems:g,listElRef:l,itemsElRef:(0,r.ref)(null),scrollTo:_,handleListResize:D,handleListScroll:T,handleListWheel:E,handleItemResize:S}},render(){let{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:i}=this;return(0,r.h)(_y,{onResize:this.handleListResize},{default:()=>{var a;return(0,r.h)(`div`,(0,r.mergeProps)(this.$attrs,{class:[`v-vl`,this.showScrollbar&&`v-vl--show-scrollbar`],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:`listElRef`}),[this.items.length===0?(a=this.$slots).empty?.call(a):(0,r.h)(`div`,{ref:`itemsElRef`,class:`v-vl-items`,style:this.itemsStyle},[(0,r.h)(i,Object.assign({class:`v-vl-visible-items`,style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{let{renderCol:i,renderItemWithCols:a}=this;return this.viewportItems.map(o=>{let s=o[t],c=n.get(s),l=i==null?void 0:(0,r.h)(wy,{index:c,item:o}),u=a==null?void 0:(0,r.h)(wy,{index:c,item:o}),d=this.$slots.default({item:o,renderedCols:l,renderedItemWithCols:u,index:c})[0];return e?(0,r.h)(_y,{key:s,onResize:e=>this.handleItemResize(s,e)},{default:()=>d}):(d.key=s,d)})}})])])}})}}),Dy=`v-hidden`,Oy=nv(`[v-hidden]`,{display:`none!important`}),ky=(0,r.defineComponent)({name:`Overflow`,props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){let n=(0,r.ref)(null),i=(0,r.ref)(null);function a(r){let{value:a}=n,{getCounter:o,getTail:s}=e,c;if(c=o===void 0?i.value:o(),!a||!c)return;c.hasAttribute(Dy)&&c.removeAttribute(Dy);let{children:l}=a;if(r.showAllItemsBeforeCalculate)for(let e of l)e.hasAttribute(Dy)&&e.removeAttribute(Dy);let u=a.offsetWidth,d=[],f=t.tail?s?.():null,p=f?f.offsetWidth:0,m=!1,h=a.children.length-+!!t.tail;for(let t=0;t<h-1;++t){if(t<0)continue;let n=l[t];if(m){n.hasAttribute(Dy)||n.setAttribute(Dy,``);continue}n.hasAttribute(Dy)&&n.removeAttribute(Dy);let r=n.offsetWidth;if(p+=r,d[t]=r,p>u){let{updateCounter:n}=e;for(let r=t;r>=0;--r){let i=h-1-r;n===void 0?c.textContent=`${i}`:n(i);let a=c.offsetWidth;if(p-=d[r],p+a<=u||r===0){m=!0,t=r-1,f&&(t===-1?(f.style.maxWidth=`${u-a}px`,f.style.boxSizing=`border-box`):f.style.maxWidth=``);let{onUpdateCount:n}=e;n&&n(i);break}}}}let{onUpdateOverflow:g}=e;m?g!==void 0&&g(!0):(g!==void 0&&g(!1),c.setAttribute(Dy,``))}let o=fg();return Oy.mount({id:`vueuc/overflow`,head:!0,anchorMetaName:rv,ssr:o}),(0,r.onMounted)(()=>a({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:i,sync:a}},render(){let{$slots:e}=this;return(0,r.nextTick)(()=>this.sync({showAllItemsBeforeCalculate:!1})),(0,r.h)(`div`,{class:`v-overflow`,ref:`selfRef`},[(0,r.renderSlot)(e,`default`),e.counter?e.counter():(0,r.h)(`span`,{style:{display:`inline-block`},ref:`counterRef`}),e.tail?e.tail():null])}});function Ay(e){return e instanceof HTMLElement}function jy(e){for(let t=0;t<e.childNodes.length;t++){let n=e.childNodes[t];if(Ay(n)&&(Ny(n)||jy(n)))return!0}return!1}function My(e){for(let t=e.childNodes.length-1;t>=0;t--){let n=e.childNodes[t];if(Ay(n)&&(Ny(n)||My(n)))return!0}return!1}function Ny(e){if(!Py(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function Py(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute(`tabIndex`)!==null)return!0;if(e.getAttribute(`disabled`))return!1;switch(e.nodeName){case`A`:return!!e.href&&e.rel!==`ignore`;case`INPUT`:return e.type!==`hidden`&&e.type!==`file`;case`SELECT`:case`TEXTAREA`:return!0;default:return!1}}var Fy=[],Iy=(0,r.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(e){let t=F_(),n=(0,r.ref)(null),i=(0,r.ref)(null),a=!1,o=!1,s=typeof document>`u`?null:document.activeElement;function c(){return Fy[Fy.length-1]===t}function l(t){var n;t.code===`Escape`&&c()&&((n=e.onEsc)==null||n.call(e,t))}(0,r.onMounted)(()=>{(0,r.watch)(()=>e.active,e=>{e?(f(),th(`keydown`,document,l)):(nh(`keydown`,document,l),a&&p())},{immediate:!0})}),(0,r.onBeforeUnmount)(()=>{nh(`keydown`,document,l),a&&p()});function u(e){if(!o&&c()){let t=d();if(t===null||t.contains(Zg(e)))return;m(`first`)}}function d(){let e=n.value;if(e===null)return null;let t=e;for(;t=t.nextSibling,!(t===null||t instanceof Element&&t.tagName===`DIV`););return t}function f(){var n;if(!e.disabled){if(Fy.push(t),e.autoFocus){let{initialFocusTo:t}=e;t===void 0?m(`first`):(n=ov(t))==null||n.focus({preventScroll:!0})}a=!0,document.addEventListener(`focus`,u,!0)}}function p(){var n;if(e.disabled||(document.removeEventListener(`focus`,u,!0),Fy=Fy.filter(e=>e!==t),c()))return;let{finalFocusTo:r}=e;r===void 0?e.returnFocusOnDeactivated&&s instanceof HTMLElement&&(o=!0,s.focus({preventScroll:!0}),o=!1):(n=ov(r))==null||n.focus({preventScroll:!0})}function m(t){if(c()&&e.active){let e=n.value,r=i.value;if(e!==null&&r!==null){let n=d();if(n==null||n===r){o=!0,e.focus({preventScroll:!0}),o=!1;return}o=!0;let i=t===`first`?jy(n):My(n);o=!1,i||(o=!0,e.focus({preventScroll:!0}),o=!1)}}}function h(e){if(o)return;let t=d();t!==null&&(e.relatedTarget!==null&&t.contains(e.relatedTarget)?m(`last`):m(`first`))}function g(e){o||(e.relatedTarget!==null&&e.relatedTarget===n.value?m(`last`):m(`first`))}return{focusableStartRef:n,focusableEndRef:i,focusableStyle:`position: absolute; height: 0; width: 0;`,handleStartFocus:h,handleEndFocus:g}},render(){let{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();let{active:t,focusableStyle:n}=this;return(0,r.h)(r.Fragment,null,[(0,r.h)(`div`,{"aria-hidden":`true`,tabindex:t?`0`:`-1`,ref:`focusableStartRef`,style:n,onFocus:this.handleStartFocus}),e(),(0,r.h)(`div`,{"aria-hidden":`true`,style:n,ref:`focusableEndRef`,tabindex:t?`0`:`-1`,onFocus:this.handleEndFocus})])}});function Ly(e,t){t&&((0,r.onMounted)(()=>{let{value:n}=e;n&&gy.registerHandler(n,t)}),(0,r.watch)(e,(e,t)=>{t&&gy.unregisterHandler(t)},{deep:!1}),(0,r.onBeforeUnmount)(()=>{let{value:t}=e;t&&gy.unregisterHandler(t)}))}function Ry(e){return e.some(e=>!(0,r.isVNode)(e)||!(e.type===r.Comment||e.type===r.Fragment&&!Ry(e.children)))?e:null}function zy(e,t){return e&&Ry(e())||t()}function By(e,t){return t(e&&Ry(e())||null)}function Vy(e){return!(e&&Ry(e()))}function Hy(e,t,n){if(!t)return;let i=fg(),a=(0,r.computed)(()=>{let{value:n}=t;if(!n)return;let r=n[e];if(r)return r}),o=(0,r.inject)(Sh,null),s=()=>{(0,r.watchEffect)(()=>{let{value:t}=n,r=`${t}${e}Rtl`;if($h(r,i))return;let{value:s}=a;s&&s.style.mount({id:r,head:!0,anchorMetaName:jg,props:{bPrefix:t?`.${t}-`:void 0},ssr:i,parent:o?.styleMountTarget})})};return i?s():(0,r.onBeforeMount)(s),a}var Uy=(0,r.defineComponent)({props:{onFocus:Function,onBlur:Function},setup(e){return()=>(()=>{let t=Bg(`d16ead82505dc285`);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{style:`width: 0; height: 0`,tabindex:0,onFocus:t[0]||=t=>e.onFocus?.(t),onBlur:t[1]||=t=>e.onBlur?.(t)},null,32)})()}});function Wy(e,t,n){if(!t){process.env.NODE_ENV!==`production`&&bh(`use-style`,`No style is specified.`);return}let i=fg(),a=(0,r.inject)(Sh,null),o=()=>{let r=n.value;t.mount({id:r===void 0?e:r+e,head:!0,anchorMetaName:jg,props:{bPrefix:r?`.${r}-`:void 0},ssr:i,parent:a?.styleMountTarget}),a?.preflightStyleDisabled||Ig.mount({id:`n-global`,head:!0,anchorMetaName:jg,ssr:i,parent:a?.styleMountTarget})};i?o():(0,r.onBeforeMount)(o)}var Gy=(0,r.defineComponent)({name:`BaseIconSwitchTransition`,setup(e,{slots:t}){let n=lh();return()=>((0,r.openBlock)(),(0,r.createBlock)(r.Transition,{name:`icon-switch-transition`,appear:n.value},Wg(t),1032,[`appear`]))}}),{cubicBezierEaseInOut:Ky}=Mg;function qy({originalTransform:e=``,left:t=0,top:n=0,transition:r=`all .3s ${Ky} !important`}={}){return[q(`&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to`,{transform:`${e} scale(0.75)`,left:t,top:n,opacity:0}),q(`&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from`,{transform:`scale(1) ${e}`,left:t,top:n,opacity:1}),q(`&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active`,{transformOrigin:`center`,position:`absolute`,left:t,top:n,transition:r})]}var Jy=q([q(`@keyframes rotator`,`
87
87
  0% {
88
88
  -webkit-transform: rotate(0deg);
89
89
  transform: rotate(0deg);
@@ -100,17 +100,17 @@
100
100
  position: absolute;
101
101
  width: 100%;
102
102
  height: 100%;
103
- `,[Ky()]),Y(`placeholder`,`
103
+ `,[qy()]),Y(`placeholder`,`
104
104
  position: absolute;
105
105
  left: 50%;
106
106
  top: 50%;
107
107
  transform: translateX(-50%) translateY(-50%);
108
- `,[Ky({left:`50%`,top:`50%`,originalTransform:`translateX(-50%) translateY(-50%)`})]),Y(`container`,`
108
+ `,[qy({left:`50%`,top:`50%`,originalTransform:`translateX(-50%) translateY(-50%)`})]),Y(`container`,`
109
109
  animation: rotator 3s linear infinite both;
110
110
  `,[Y(`icon`,`
111
111
  height: 1em;
112
112
  width: 1em;
113
- `)])])]),Jy=[`viewBox`],Yy=[`values`,`dur`],Xy=[`stroke-width`,`cx`,`cy`,`r`,`stroke-dasharray`,`stroke-dashoffset`],Zy=[`values`,`dur`],Qy=[`values`,`dur`],$y=`1.6s`,eb={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0},scale:{type:Number,default:1},radius:{type:Number,default:100}},tb=(0,r.defineComponent)({name:`BaseLoading`,props:{clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},...eb},setup(e){Uy(`-base-loading`,qy,(0,r.toRef)(e,`clsPrefix`))},render(){let{clsPrefix:e,radius:t,strokeWidth:n,stroke:i,scale:a}=this,o=t/a;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${e}-base-loading`),role:`img`,"aria-label":`loading`},[(0,r.createVNode)(Wy,null,{default:()=>this.show?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`icon`,class:Q(`${e}-base-loading__transition-wrapper`)},[(0,r.createElementVNode)(`div`,{class:Q(`${e}-base-loading__container`)},[((0,r.openBlock)(),(0,r.createElementBlock)(`svg`,{class:Q(`${e}-base-loading__icon`),viewBox:`0 0 ${2*o} ${2*o}`,xmlns:`http://www.w3.org/2000/svg`,style:(0,r.normalizeStyle)({color:i})},[(0,r.createElementVNode)(`g`,null,[(0,r.createElementVNode)(`animateTransform`,{attributeName:`transform`,type:`rotate`,values:`0 ${o} ${o};270 ${o} ${o}`,begin:`0s`,dur:$y,fill:`freeze`,repeatCount:`indefinite`},null,8,Yy),(0,r.createElementVNode)(`circle`,{class:Q(`${e}-base-loading__icon`),fill:`none`,stroke:`currentColor`,"stroke-width":n,"stroke-linecap":`round`,cx:o,cy:o,r:t-n/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},[(0,r.createElementVNode)(`animateTransform`,{attributeName:`transform`,type:`rotate`,values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:`0s`,dur:$y,fill:`freeze`,repeatCount:`indefinite`},null,8,Zy),(0,r.createElementVNode)(`animate`,{attributeName:`stroke-dashoffset`,values:`${5.67*t};${1.42*t};${5.67*t}`,begin:`0s`,dur:$y,fill:`freeze`,repeatCount:`indefinite`},null,8,Qy)],10,Xy)])],14,Jy))],2)],2)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`placeholder`,class:Q(`${e}-base-loading__placeholder`)},[Z(()=>this.$slots.default?.())],2))},1024)],2)}});function nb(e){let t={isDeactivated:!1},n=!1;return(0,r.onActivated)(()=>{t.isDeactivated=!1,n?e():n=!0}),(0,r.onDeactivated)(()=>{t.isDeactivated=!0,n||=!0}),t}function rb(e){let{left:t,right:n,top:r,bottom:i}=$g(e);return`${r} ${t} ${i} ${n}`}var ib=(0,r.defineComponent)({render(){return this.$slots.default?.()}}),$={neutralBase:`#FFF`,neutralInvertBase:`#000`,neutralTextBase:`#000`,neutralPopover:`#fff`,neutralCard:`#fff`,neutralModal:`#fff`,neutralBody:`#fff`,alpha1:`0.82`,alpha2:`0.72`,alpha3:`0.38`,alpha4:`0.24`,alpha5:`0.18`,alphaClose:`0.6`,alphaDisabled:`0.5`,alphaDisabledInput:`0.02`,alphaPending:`0.05`,alphaTablePending:`0.02`,alphaPressed:`0.07`,alphaAvatar:`0.2`,alphaRail:`0.14`,alphaProgressRail:`.08`,alphaBorder:`0.12`,alphaDivider:`0.06`,alphaInput:`0`,alphaAction:`0.02`,alphaTab:`0.04`,alphaScrollbar:`0.25`,alphaScrollbarHover:`0.4`,alphaCode:`0.05`,alphaTag:`0.02`,primaryHover:`#36ad6a`,primaryDefault:`#18a058`,primaryActive:`#0c7a43`,primarySuppl:`#36ad6a`,infoHover:`#4098fc`,infoDefault:`#2080f0`,infoActive:`#1060c9`,infoSuppl:`#4098fc`,errorHover:`#de576d`,errorDefault:`#d03050`,errorActive:`#ab1f3f`,errorSuppl:`#de576d`,warningHover:`#fcb040`,warningDefault:`#f0a020`,warningActive:`#c97c10`,warningSuppl:`#fcb040`,successHover:`#36ad6a`,successDefault:`#18a058`,successActive:`#0c7a43`,successSuppl:`#36ad6a`},ab=S_($.neutralBase),ob=S_($.neutralInvertBase),sb=`rgba(${ob.slice(0,3).join(`, `)}, `;function cb(e){return`${sb+String(e)})`}function lb(e){let t=Array.from(ob);return t[3]=Number(e),E_(ab,t)}var ub={name:`common`,...jg,baseColor:$.neutralBase,primaryColor:$.primaryDefault,primaryColorHover:$.primaryHover,primaryColorPressed:$.primaryActive,primaryColorSuppl:$.primarySuppl,infoColor:$.infoDefault,infoColorHover:$.infoHover,infoColorPressed:$.infoActive,infoColorSuppl:$.infoSuppl,successColor:$.successDefault,successColorHover:$.successHover,successColorPressed:$.successActive,successColorSuppl:$.successSuppl,warningColor:$.warningDefault,warningColorHover:$.warningHover,warningColorPressed:$.warningActive,warningColorSuppl:$.warningSuppl,errorColor:$.errorDefault,errorColorHover:$.errorHover,errorColorPressed:$.errorActive,errorColorSuppl:$.errorSuppl,textColorBase:$.neutralTextBase,textColor1:`rgb(31, 34, 37)`,textColor2:`rgb(51, 54, 57)`,textColor3:`rgb(118, 124, 130)`,textColorDisabled:lb($.alpha4),placeholderColor:lb($.alpha4),placeholderColorDisabled:lb($.alpha5),iconColor:lb($.alpha4),iconColorHover:O_(lb($.alpha4),{lightness:.75}),iconColorPressed:O_(lb($.alpha4),{lightness:.9}),iconColorDisabled:lb($.alpha5),opacity1:$.alpha1,opacity2:$.alpha2,opacity3:$.alpha3,opacity4:$.alpha4,opacity5:$.alpha5,dividerColor:`rgb(239, 239, 245)`,borderColor:`rgb(224, 224, 230)`,closeIconColor:lb(Number($.alphaClose)),closeIconColorHover:lb(Number($.alphaClose)),closeIconColorPressed:lb(Number($.alphaClose)),closeColorHover:`rgba(0, 0, 0, .09)`,closeColorPressed:`rgba(0, 0, 0, .13)`,clearColor:lb($.alpha4),clearColorHover:O_(lb($.alpha4),{lightness:.75}),clearColorPressed:O_(lb($.alpha4),{lightness:.9}),scrollbarColor:cb($.alphaScrollbar),scrollbarColorHover:cb($.alphaScrollbarHover),scrollbarWidth:`5px`,scrollbarHeight:`5px`,scrollbarBorderRadius:`5px`,progressRailColor:lb($.alphaProgressRail),railColor:`rgb(219, 219, 223)`,popoverColor:$.neutralPopover,tableColor:$.neutralCard,cardColor:$.neutralCard,modalColor:$.neutralModal,bodyColor:$.neutralBody,tagColor:`#eee`,avatarColor:lb($.alphaAvatar),invertedColor:`rgb(0, 20, 40)`,inputColor:lb($.alphaInput),codeColor:`rgb(244, 244, 248)`,tabColor:`rgb(247, 247, 250)`,actionColor:`rgb(250, 250, 252)`,tableHeaderColor:`rgb(250, 250, 252)`,hoverColor:`rgb(243, 243, 245)`,tableColorHover:`rgba(0, 0, 100, 0.03)`,tableColorStriped:`rgba(0, 0, 100, 0.02)`,pressedColor:`rgb(237, 237, 239)`,opacityDisabled:$.alphaDisabled,inputColorDisabled:`rgb(250, 250, 252)`,buttonColor2:`rgba(46, 51, 56, .05)`,buttonColor2Hover:`rgba(46, 51, 56, .09)`,buttonColor2Pressed:`rgba(46, 51, 56, .13)`,boxShadow1:`0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)`,boxShadow2:`0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)`,boxShadow3:`0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)`},db={railInsetHorizontalBottom:`auto 2px 4px 2px`,railInsetHorizontalTop:`4px 2px auto 2px`,railInsetVerticalRight:`2px 4px 2px auto`,railInsetVerticalLeft:`2px auto 2px 4px`,railColor:`transparent`};function fb(e){let{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:i,scrollbarBorderRadius:a}=e;return{...db,height:r,width:i,borderRadius:a,color:t,colorHover:n}}var pb={name:`Scrollbar`,common:ub,self:fb},{cubicBezierEaseInOut:mb}=jg;function hb({name:e=`fade-in`,enterDuration:t=`0.2s`,leaveDuration:n=`0.2s`,enterCubicBezier:r=mb,leaveCubicBezier:i=mb}={}){return[q(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),q(`&.${e}-transition-leave-active`,{transition:`all ${n} ${i}!important`}),q(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),q(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}var gb=J(`scrollbar`,`
113
+ `)])])]),Yy=[`viewBox`],Xy=[`values`,`dur`],Zy=[`stroke-width`,`cx`,`cy`,`r`,`stroke-dasharray`,`stroke-dashoffset`],Qy=[`values`,`dur`],$y=[`values`,`dur`],eb=`1.6s`,tb={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0},scale:{type:Number,default:1},radius:{type:Number,default:100}},nb=(0,r.defineComponent)({name:`BaseLoading`,props:{clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},...tb},setup(e){Wy(`-base-loading`,Jy,(0,r.toRef)(e,`clsPrefix`))},render(){let{clsPrefix:e,radius:t,strokeWidth:n,stroke:i,scale:a}=this,o=t/a;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${e}-base-loading`),role:`img`,"aria-label":`loading`},[(0,r.createVNode)(Gy,null,{default:()=>this.show?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`icon`,class:Q(`${e}-base-loading__transition-wrapper`)},[(0,r.createElementVNode)(`div`,{class:Q(`${e}-base-loading__container`)},[((0,r.openBlock)(),(0,r.createElementBlock)(`svg`,{class:Q(`${e}-base-loading__icon`),viewBox:`0 0 ${2*o} ${2*o}`,xmlns:`http://www.w3.org/2000/svg`,style:(0,r.normalizeStyle)({color:i})},[(0,r.createElementVNode)(`g`,null,[(0,r.createElementVNode)(`animateTransform`,{attributeName:`transform`,type:`rotate`,values:`0 ${o} ${o};270 ${o} ${o}`,begin:`0s`,dur:eb,fill:`freeze`,repeatCount:`indefinite`},null,8,Xy),(0,r.createElementVNode)(`circle`,{class:Q(`${e}-base-loading__icon`),fill:`none`,stroke:`currentColor`,"stroke-width":n,"stroke-linecap":`round`,cx:o,cy:o,r:t-n/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},[(0,r.createElementVNode)(`animateTransform`,{attributeName:`transform`,type:`rotate`,values:`0 ${o} ${o};135 ${o} ${o};450 ${o} ${o}`,begin:`0s`,dur:eb,fill:`freeze`,repeatCount:`indefinite`},null,8,Qy),(0,r.createElementVNode)(`animate`,{attributeName:`stroke-dashoffset`,values:`${5.67*t};${1.42*t};${5.67*t}`,begin:`0s`,dur:eb,fill:`freeze`,repeatCount:`indefinite`},null,8,$y)],10,Zy)])],14,Yy))],2)],2)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`placeholder`,class:Q(`${e}-base-loading__placeholder`)},[Z(()=>this.$slots.default?.())],2))},1024)],2)}});function rb(e){let t={isDeactivated:!1},n=!1;return(0,r.onActivated)(()=>{t.isDeactivated=!1,n?e():n=!0}),(0,r.onDeactivated)(()=>{t.isDeactivated=!0,n||=!0}),t}function ib(e){let{left:t,right:n,top:r,bottom:i}=e_(e);return`${r} ${t} ${i} ${n}`}var ab=(0,r.defineComponent)({render(){return this.$slots.default?.()}}),$={neutralBase:`#FFF`,neutralInvertBase:`#000`,neutralTextBase:`#000`,neutralPopover:`#fff`,neutralCard:`#fff`,neutralModal:`#fff`,neutralBody:`#fff`,alpha1:`0.82`,alpha2:`0.72`,alpha3:`0.38`,alpha4:`0.24`,alpha5:`0.18`,alphaClose:`0.6`,alphaDisabled:`0.5`,alphaDisabledInput:`0.02`,alphaPending:`0.05`,alphaTablePending:`0.02`,alphaPressed:`0.07`,alphaAvatar:`0.2`,alphaRail:`0.14`,alphaProgressRail:`.08`,alphaBorder:`0.12`,alphaDivider:`0.06`,alphaInput:`0`,alphaAction:`0.02`,alphaTab:`0.04`,alphaScrollbar:`0.25`,alphaScrollbarHover:`0.4`,alphaCode:`0.05`,alphaTag:`0.02`,primaryHover:`#36ad6a`,primaryDefault:`#18a058`,primaryActive:`#0c7a43`,primarySuppl:`#36ad6a`,infoHover:`#4098fc`,infoDefault:`#2080f0`,infoActive:`#1060c9`,infoSuppl:`#4098fc`,errorHover:`#de576d`,errorDefault:`#d03050`,errorActive:`#ab1f3f`,errorSuppl:`#de576d`,warningHover:`#fcb040`,warningDefault:`#f0a020`,warningActive:`#c97c10`,warningSuppl:`#fcb040`,successHover:`#36ad6a`,successDefault:`#18a058`,successActive:`#0c7a43`,successSuppl:`#36ad6a`},ob=C_($.neutralBase),sb=C_($.neutralInvertBase),cb=`rgba(${sb.slice(0,3).join(`, `)}, `;function lb(e){return`${cb+String(e)})`}function ub(e){let t=Array.from(sb);return t[3]=Number(e),D_(ob,t)}var db={name:`common`,...Mg,baseColor:$.neutralBase,primaryColor:$.primaryDefault,primaryColorHover:$.primaryHover,primaryColorPressed:$.primaryActive,primaryColorSuppl:$.primarySuppl,infoColor:$.infoDefault,infoColorHover:$.infoHover,infoColorPressed:$.infoActive,infoColorSuppl:$.infoSuppl,successColor:$.successDefault,successColorHover:$.successHover,successColorPressed:$.successActive,successColorSuppl:$.successSuppl,warningColor:$.warningDefault,warningColorHover:$.warningHover,warningColorPressed:$.warningActive,warningColorSuppl:$.warningSuppl,errorColor:$.errorDefault,errorColorHover:$.errorHover,errorColorPressed:$.errorActive,errorColorSuppl:$.errorSuppl,textColorBase:$.neutralTextBase,textColor1:`rgb(31, 34, 37)`,textColor2:`rgb(51, 54, 57)`,textColor3:`rgb(118, 124, 130)`,textColorDisabled:ub($.alpha4),placeholderColor:ub($.alpha4),placeholderColorDisabled:ub($.alpha5),iconColor:ub($.alpha4),iconColorHover:k_(ub($.alpha4),{lightness:.75}),iconColorPressed:k_(ub($.alpha4),{lightness:.9}),iconColorDisabled:ub($.alpha5),opacity1:$.alpha1,opacity2:$.alpha2,opacity3:$.alpha3,opacity4:$.alpha4,opacity5:$.alpha5,dividerColor:`rgb(239, 239, 245)`,borderColor:`rgb(224, 224, 230)`,closeIconColor:ub(Number($.alphaClose)),closeIconColorHover:ub(Number($.alphaClose)),closeIconColorPressed:ub(Number($.alphaClose)),closeColorHover:`rgba(0, 0, 0, .09)`,closeColorPressed:`rgba(0, 0, 0, .13)`,clearColor:ub($.alpha4),clearColorHover:k_(ub($.alpha4),{lightness:.75}),clearColorPressed:k_(ub($.alpha4),{lightness:.9}),scrollbarColor:lb($.alphaScrollbar),scrollbarColorHover:lb($.alphaScrollbarHover),scrollbarWidth:`5px`,scrollbarHeight:`5px`,scrollbarBorderRadius:`5px`,progressRailColor:ub($.alphaProgressRail),railColor:`rgb(219, 219, 223)`,popoverColor:$.neutralPopover,tableColor:$.neutralCard,cardColor:$.neutralCard,modalColor:$.neutralModal,bodyColor:$.neutralBody,tagColor:`#eee`,avatarColor:ub($.alphaAvatar),invertedColor:`rgb(0, 20, 40)`,inputColor:ub($.alphaInput),codeColor:`rgb(244, 244, 248)`,tabColor:`rgb(247, 247, 250)`,actionColor:`rgb(250, 250, 252)`,tableHeaderColor:`rgb(250, 250, 252)`,hoverColor:`rgb(243, 243, 245)`,tableColorHover:`rgba(0, 0, 100, 0.03)`,tableColorStriped:`rgba(0, 0, 100, 0.02)`,pressedColor:`rgb(237, 237, 239)`,opacityDisabled:$.alphaDisabled,inputColorDisabled:`rgb(250, 250, 252)`,buttonColor2:`rgba(46, 51, 56, .05)`,buttonColor2Hover:`rgba(46, 51, 56, .09)`,buttonColor2Pressed:`rgba(46, 51, 56, .13)`,boxShadow1:`0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)`,boxShadow2:`0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)`,boxShadow3:`0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)`},fb={railInsetHorizontalBottom:`auto 2px 4px 2px`,railInsetHorizontalTop:`4px 2px auto 2px`,railInsetVerticalRight:`2px 4px 2px auto`,railInsetVerticalLeft:`2px auto 2px 4px`,railColor:`transparent`};function pb(e){let{scrollbarColor:t,scrollbarColorHover:n,scrollbarHeight:r,scrollbarWidth:i,scrollbarBorderRadius:a}=e;return{...fb,height:r,width:i,borderRadius:a,color:t,colorHover:n}}var mb={name:`Scrollbar`,common:db,self:pb},{cubicBezierEaseInOut:hb}=Mg;function gb({name:e=`fade-in`,enterDuration:t=`0.2s`,leaveDuration:n=`0.2s`,enterCubicBezier:r=hb,leaveCubicBezier:i=hb}={}){return[q(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),q(`&.${e}-transition-leave-active`,{transition:`all ${n} ${i}!important`}),q(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),q(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}var _b=J(`scrollbar`,`
114
114
  overflow: hidden;
115
115
  position: relative;
116
116
  z-index: auto;
@@ -175,7 +175,7 @@
175
175
  pointer-events: all;
176
176
  background-color: var(--n-scrollbar-color);
177
177
  transition: background-color .2s var(--n-scrollbar-bezier);
178
- `,[hb(),q(`&:hover`,`background-color: var(--n-scrollbar-color-hover);`)])])])])]),_b=[`onMousedown`],vb=[`onScroll`,`onWheel`],yb=[`onMousedown`],bb={...Lg.props,duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:`hover`},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,internalExposeWidthCssVar:Boolean,yPlacement:{type:String,default:`right`},xPlacement:{type:String,default:`bottom`}},xb=(0,r.defineComponent)({name:`Scrollbar`,props:bb,inheritAttrs:!1,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:i}=Sh(e),a=Vy(`Scrollbar`,i,t),o=(0,r.ref)(null),s=(0,r.ref)(null),c=(0,r.ref)(null),l=(0,r.ref)(null),u=(0,r.ref)(null),d=(0,r.ref)(null),f=(0,r.ref)(null),p=(0,r.ref)(null),m=(0,r.ref)(null),h=(0,r.ref)(null),g=(0,r.ref)(null),_=(0,r.ref)(0),v=(0,r.ref)(0),y=(0,r.ref)(!1),b=(0,r.ref)(!1),x=!1,S=!1,C,w,T=0,E=0,D=0,O=0,k=dh(),A=Lg(`Scrollbar`,`-scrollbar`,gb,pb,e,t),ee=(0,r.computed)(()=>{let{value:e}=p,{value:t}=d,{value:n}=h;return e===null||t===null||n===null?0:Math.min(e,n*e/t+Zg(A.value.self.width)*1.5)}),j=(0,r.computed)(()=>`${ee.value}px`),te=(0,r.computed)(()=>{let{value:e}=m,{value:t}=f,{value:n}=g;return e===null||t===null||n===null?0:n*e/t+Zg(A.value.self.height)*1.5}),ne=(0,r.computed)(()=>`${te.value}px`),M=(0,r.computed)(()=>{let{value:e}=p,{value:t}=_,{value:n}=d,{value:r}=h;if(e===null||n===null||r===null)return 0;{let i=n-e;return i?t/i*(r-ee.value):0}}),re=(0,r.computed)(()=>`${M.value}px`),ie=(0,r.computed)(()=>{let{value:e}=m,{value:t}=v,{value:n}=f,{value:r}=g;if(e===null||n===null||r===null)return 0;{let i=n-e;return i?t/i*(r-te.value):0}}),N=(0,r.computed)(()=>`${ie.value}px`),P=(0,r.computed)(()=>{let{value:e}=p,{value:t}=d;return e!==null&&t!==null&&t>e}),F=(0,r.computed)(()=>{let{value:e}=m,{value:t}=f;return e!==null&&t!==null&&t>e}),ae=(0,r.computed)(()=>{let{trigger:t}=e;return t===`none`||y.value}),oe=(0,r.computed)(()=>{let{trigger:t}=e;return t===`none`||b.value}),se=(0,r.computed)(()=>{let{container:t}=e;return t?t():s.value}),ce=(0,r.computed)(()=>{let{content:t}=e;return t?t():c.value}),le=(t,n)=>{if(!e.scrollable)return;if(typeof t==`number`){me(t,n??0,0,!1,`auto`);return}let{left:r,top:i,index:a,elSize:o,position:s,behavior:c,el:l,debounce:u=!0}=t;(r!==void 0||i!==void 0)&&me(r??0,i??0,0,!1,c),l===void 0?a!==void 0&&o!==void 0?me(0,a*o,o,u,c):s===`bottom`?me(0,2**53-1,0,!1,c):s===`top`&&me(0,0,0,!1,c):me(0,l.offsetTop,l.offsetHeight,u,c)},ue=nb(()=>{e.container||le({top:_.value,left:v.value})}),de=()=>{ue.isDeactivated||Te()},fe=t=>{if(ue.isDeactivated)return;let{onResize:n}=e;n&&n(t),Te()},pe=(t,n)=>{if(!e.scrollable)return;let{value:r}=se;r&&(typeof t==`object`?r.scrollBy(t):r.scrollBy(t,n||0))};function me(e,t,n,r,i){let{value:a}=se;if(a){if(r){let{scrollTop:r,offsetHeight:o}=a;if(t>r){t+n<=r+o||a.scrollTo({left:e,top:t+n-o,behavior:i});return}}a.scrollTo({left:e,top:t,behavior:i})}}function he(){be(),xe(),Te()}function ge(){_e()}function _e(){ve(),ye()}function ve(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{b.value=!1},e.duration)}function ye(){C!==void 0&&window.clearTimeout(C),C=window.setTimeout(()=>{y.value=!1},e.duration)}function be(){C!==void 0&&window.clearTimeout(C),y.value=!0}function xe(){w!==void 0&&window.clearTimeout(w),b.value=!0}function Se(t){let{onScroll:n}=e;n&&n(t),Ce()}function Ce(){let{value:e}=se;e&&(_.value=e.scrollTop,v.value=e.scrollLeft*(a?.value?-1:1))}function we(){let{value:e}=ce;e&&(d.value=e.offsetHeight,f.value=e.offsetWidth);let{value:t}=se;t&&(p.value=t.offsetHeight,m.value=t.offsetWidth);let{value:n}=u,{value:r}=l;n&&(g.value=n.offsetWidth),r&&(h.value=r.offsetHeight)}function I(){let{value:e}=se;e&&(_.value=e.scrollTop,v.value=e.scrollLeft*(a?.value?-1:1),p.value=e.offsetHeight,m.value=e.offsetWidth,d.value=e.scrollHeight,f.value=e.scrollWidth);let{value:t}=u,{value:n}=l;t&&(g.value=t.offsetWidth),n&&(h.value=n.offsetHeight)}function Te(){e.scrollable&&(e.useUnifiedContainer?I():(we(),Ce()))}function Ee(e){return!o.value?.contains(Xg(e))}function De(e){e.preventDefault(),e.stopPropagation(),S=!0,eh(`mousemove`,window,Oe,!0),eh(`mouseup`,window,ke,!0),E=v.value,D=a?.value?window.innerWidth-e.clientX:e.clientX}function Oe(t){if(!S)return;C!==void 0&&window.clearTimeout(C),w!==void 0&&window.clearTimeout(w);let{value:n}=m,{value:r}=f,{value:i}=te;if(n===null||r===null)return;let o=(a?.value?window.innerWidth-t.clientX-D:t.clientX-D)*(r-n)/(n-i),s=r-n,c=E+o;c=Math.min(s,c),c=Math.max(c,0);let{value:l}=se;if(l){l.scrollLeft=c*(a?.value?-1:1);let{internalOnUpdateScrollLeft:t}=e;t&&t(c)}}function ke(e){e.preventDefault(),e.stopPropagation(),th(`mousemove`,window,Oe,!0),th(`mouseup`,window,ke,!0),S=!1,Te(),Ee(e)&&_e()}function Ae(e){e.preventDefault(),e.stopPropagation(),x=!0,eh(`mousemove`,window,je,!0),eh(`mouseup`,window,Me,!0),T=_.value,O=e.clientY}function je(e){if(!x)return;C!==void 0&&window.clearTimeout(C),w!==void 0&&window.clearTimeout(w);let{value:t}=p,{value:n}=d,{value:r}=ee;if(t===null||n===null)return;let i=(e.clientY-O)*(n-t)/(t-r),a=n-t,o=T+i;o=Math.min(a,o),o=Math.max(o,0);let{value:s}=se;s&&(s.scrollTop=o)}function Me(e){e.preventDefault(),e.stopPropagation(),th(`mousemove`,window,je,!0),th(`mouseup`,window,Me,!0),x=!1,Te(),Ee(e)&&_e()}(0,r.watchEffect)(()=>{let{value:e}=F,{value:n}=P,{value:r}=t,{value:i}=u,{value:a}=l;i&&(e?i.classList.remove(`${r}-scrollbar-rail--disabled`):i.classList.add(`${r}-scrollbar-rail--disabled`)),a&&(n?a.classList.remove(`${r}-scrollbar-rail--disabled`):a.classList.add(`${r}-scrollbar-rail--disabled`))}),(0,r.onMounted)(()=>{e.container||Te()}),(0,r.onBeforeUnmount)(()=>{C!==void 0&&window.clearTimeout(C),w!==void 0&&window.clearTimeout(w),th(`mousemove`,window,je,!0),th(`mouseup`,window,Me,!0)});let Ne=(0,r.computed)(()=>{let{common:{cubicBezierEaseInOut:e},self:{color:t,colorHover:n,height:r,width:i,borderRadius:o,railInsetHorizontalTop:s,railInsetHorizontalBottom:c,railInsetVerticalRight:l,railInsetVerticalLeft:u,railColor:d}}=A.value,{top:f,right:p,bottom:m,left:h}=$g(s),{top:g,right:_,bottom:v,left:y}=$g(c),{top:b,right:x,bottom:S,left:C}=$g(a?.value?rb(l):l),{top:w,right:T,bottom:E,left:D}=$g(a?.value?rb(u):u);return{"--n-scrollbar-bezier":e,"--n-scrollbar-color":t,"--n-scrollbar-color-hover":n,"--n-scrollbar-border-radius":o,"--n-scrollbar-width":i,"--n-scrollbar-height":r,"--n-scrollbar-rail-top-horizontal-top":f,"--n-scrollbar-rail-right-horizontal-top":p,"--n-scrollbar-rail-bottom-horizontal-top":m,"--n-scrollbar-rail-left-horizontal-top":h,"--n-scrollbar-rail-top-horizontal-bottom":g,"--n-scrollbar-rail-right-horizontal-bottom":_,"--n-scrollbar-rail-bottom-horizontal-bottom":v,"--n-scrollbar-rail-left-horizontal-bottom":y,"--n-scrollbar-rail-top-vertical-right":b,"--n-scrollbar-rail-right-vertical-right":x,"--n-scrollbar-rail-bottom-vertical-right":S,"--n-scrollbar-rail-left-vertical-right":C,"--n-scrollbar-rail-top-vertical-left":w,"--n-scrollbar-rail-right-vertical-left":T,"--n-scrollbar-rail-bottom-vertical-left":E,"--n-scrollbar-rail-left-vertical-left":D,"--n-scrollbar-rail-color":d}}),Pe=n?fg(`scrollbar`,void 0,Ne,e):void 0;return{scrollTo:le,scrollBy:pe,sync:Te,syncUnifiedContainer:I,handleMouseEnterWrapper:he,handleMouseLeaveWrapper:ge,mergedClsPrefix:t,rtlEnabled:a,containerScrollTop:_,wrapperRef:o,containerRef:s,contentRef:c,yRailRef:l,xRailRef:u,needYBar:P,needXBar:F,yBarSizePx:j,xBarSizePx:ne,yBarTopPx:re,xBarLeftPx:N,isShowXBar:ae,isShowYBar:oe,isIos:k,handleScroll:Se,handleContentResize:de,handleContainerResize:fe,handleYScrollMouseDown:Ae,handleXScrollMouseDown:De,containerWidth:m,cssVars:n?void 0:Ne,themeClass:Pe?.themeClass,onRender:Pe?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,triggerDisplayManually:n,rtlEnabled:i,internalHoistYRail:a,yPlacement:o,xPlacement:s,xScrollable:c}=this;if(!this.scrollable)return e.default?.();let l=this.trigger===`none`,u=(e,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`yRailRef`,class:Q([`${t}-scrollbar-rail`,`${t}-scrollbar-rail--vertical`,`${t}-scrollbar-rail--vertical--${o}`,e]),"data-scrollbar-rail":!0,style:(0,r.normalizeStyle)([n||``,this.verticalRailStyle]),"aria-hidden":!0},[Z(()=>(0,r.h)(l?ib:r.Transition,l?null:{name:`fade-in-transition`},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:1,class:Q(`${t}-scrollbar-rail__scrollbar`),style:(0,r.normalizeStyle)({height:this.yBarSizePx,top:this.yBarTopPx}),onMousedown:this.handleYScrollMouseDown},null,46,_b)):null}))],6)),d=()=>(this.onRender?.(),(0,r.h)(`div`,(0,r.mergeProps)(this.$attrs,{role:`none`,ref:`wrapperRef`,class:[`${t}-scrollbar`,this.themeClass,i&&`${t}-scrollbar--rtl`],style:this.cssVars,onMouseenter:n?void 0:this.handleMouseEnterWrapper,onMouseleave:n?void 0:this.handleMouseLeaveWrapper}),[this.container?e.default?.():((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,role:`none`,ref:`containerRef`,class:Q([`${t}-scrollbar-container`,this.containerClass]),style:(0,r.normalizeStyle)([this.containerStyle,this.internalExposeWidthCssVar?{"--n-scrollbar-current-width":Qg(this.containerWidth)}:void 0]),onScroll:this.handleScroll,onWheel:this.onWheel},[((0,r.openBlock)(),(0,r.createBlock)(gy,{onResize:this.handleContentResize},{default:()=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`contentRef`,role:`none`,style:(0,r.normalizeStyle)([{width:this.xScrollable?`fit-content`:null},this.contentStyle]),class:Q([`${t}-scrollbar-content`,this.contentClass])},[Z(()=>e.default?.())],6))},1032,[`onResize`]))],46,vb)),a?null:u(void 0,void 0),c&&((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`xRailRef`,class:Q([`${t}-scrollbar-rail`,`${t}-scrollbar-rail--horizontal`,`${t}-scrollbar-rail--horizontal--${s}`]),style:(0,r.normalizeStyle)(this.horizontalRailStyle),"data-scrollbar-rail":!0,"aria-hidden":!0},[Z(()=>(0,r.h)(l?ib:r.Transition,l?null:{name:`fade-in-transition`},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:3,class:Q(`${t}-scrollbar-rail__scrollbar`),style:(0,r.normalizeStyle)({width:this.xBarSizePx,right:i?this.xBarLeftPx:void 0,left:i?void 0:this.xBarLeftPx}),onMousedown:this.handleXScrollMouseDown},null,46,yb)):null}))],6))])),f=this.container?d():((0,r.openBlock)(),(0,r.createBlock)(gy,{key:4,onResize:this.handleContainerResize},{default:d},1032,[`onResize`]));return a?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:5},[Z(()=>f),Z(()=>u(this.themeClass,this.cssVars))],64)):f}}),Sb=xb,Cb=J(`base-icon`,`
178
+ `,[gb(),q(`&:hover`,`background-color: var(--n-scrollbar-color-hover);`)])])])])]),vb=[`onMousedown`],yb=[`onScroll`,`onWheel`],bb=[`onMousedown`],xb={...Rg.props,duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:`hover`},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,internalExposeWidthCssVar:Boolean,yPlacement:{type:String,default:`right`},xPlacement:{type:String,default:`bottom`}},Sb=(0,r.defineComponent)({name:`Scrollbar`,props:xb,inheritAttrs:!1,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedRtlRef:i}=Ch(e),a=Hy(`Scrollbar`,i,t),o=(0,r.ref)(null),s=(0,r.ref)(null),c=(0,r.ref)(null),l=(0,r.ref)(null),u=(0,r.ref)(null),d=(0,r.ref)(null),f=(0,r.ref)(null),p=(0,r.ref)(null),m=(0,r.ref)(null),h=(0,r.ref)(null),g=(0,r.ref)(null),_=(0,r.ref)(0),v=(0,r.ref)(0),y=(0,r.ref)(!1),b=(0,r.ref)(!1),x=!1,S=!1,C,w,T=0,E=0,D=0,O=0,k=fh(),A=Rg(`Scrollbar`,`-scrollbar`,_b,mb,e,t),ee=(0,r.computed)(()=>{let{value:e}=p,{value:t}=d,{value:n}=h;return e===null||t===null||n===null?0:Math.min(e,n*e/t+Qg(A.value.self.width)*1.5)}),te=(0,r.computed)(()=>`${ee.value}px`),ne=(0,r.computed)(()=>{let{value:e}=m,{value:t}=f,{value:n}=g;return e===null||t===null||n===null?0:n*e/t+Qg(A.value.self.height)*1.5}),j=(0,r.computed)(()=>`${ne.value}px`),M=(0,r.computed)(()=>{let{value:e}=p,{value:t}=_,{value:n}=d,{value:r}=h;if(e===null||n===null||r===null)return 0;{let i=n-e;return i?t/i*(r-ee.value):0}}),re=(0,r.computed)(()=>`${M.value}px`),ie=(0,r.computed)(()=>{let{value:e}=m,{value:t}=v,{value:n}=f,{value:r}=g;if(e===null||n===null||r===null)return 0;{let i=n-e;return i?t/i*(r-ne.value):0}}),ae=(0,r.computed)(()=>`${ie.value}px`),N=(0,r.computed)(()=>{let{value:e}=p,{value:t}=d;return e!==null&&t!==null&&t>e}),P=(0,r.computed)(()=>{let{value:e}=m,{value:t}=f;return e!==null&&t!==null&&t>e}),oe=(0,r.computed)(()=>{let{trigger:t}=e;return t===`none`||y.value}),se=(0,r.computed)(()=>{let{trigger:t}=e;return t===`none`||b.value}),ce=(0,r.computed)(()=>{let{container:t}=e;return t?t():s.value}),le=(0,r.computed)(()=>{let{content:t}=e;return t?t():c.value}),ue=(t,n)=>{if(!e.scrollable)return;if(typeof t==`number`){he(t,n??0,0,!1,`auto`);return}let{left:r,top:i,index:a,elSize:o,position:s,behavior:c,el:l,debounce:u=!0}=t;(r!==void 0||i!==void 0)&&he(r??0,i??0,0,!1,c),l===void 0?a!==void 0&&o!==void 0?he(0,a*o,o,u,c):s===`bottom`?he(0,2**53-1,0,!1,c):s===`top`&&he(0,0,0,!1,c):he(0,l.offsetTop,l.offsetHeight,u,c)},de=rb(()=>{e.container||ue({top:_.value,left:v.value})}),fe=()=>{de.isDeactivated||I()},pe=t=>{if(de.isDeactivated)return;let{onResize:n}=e;n&&n(t),I()},me=(t,n)=>{if(!e.scrollable)return;let{value:r}=ce;r&&(typeof t==`object`?r.scrollBy(t):r.scrollBy(t,n||0))};function he(e,t,n,r,i){let{value:a}=ce;if(a){if(r){let{scrollTop:r,offsetHeight:o}=a;if(t>r){t+n<=r+o||a.scrollTo({left:e,top:t+n-o,behavior:i});return}}a.scrollTo({left:e,top:t,behavior:i})}}function ge(){xe(),Se(),I()}function _e(){ve()}function ve(){ye(),be()}function ye(){w!==void 0&&window.clearTimeout(w),w=window.setTimeout(()=>{b.value=!1},e.duration)}function be(){C!==void 0&&window.clearTimeout(C),C=window.setTimeout(()=>{y.value=!1},e.duration)}function xe(){C!==void 0&&window.clearTimeout(C),y.value=!0}function Se(){w!==void 0&&window.clearTimeout(w),b.value=!0}function F(t){let{onScroll:n}=e;n&&n(t),Ce()}function Ce(){let{value:e}=ce;e&&(_.value=e.scrollTop,v.value=e.scrollLeft*(a?.value?-1:1))}function we(){let{value:e}=le;e&&(d.value=e.offsetHeight,f.value=e.offsetWidth);let{value:t}=ce;t&&(p.value=t.offsetHeight,m.value=t.offsetWidth);let{value:n}=u,{value:r}=l;n&&(g.value=n.offsetWidth),r&&(h.value=r.offsetHeight)}function Te(){let{value:e}=ce;e&&(_.value=e.scrollTop,v.value=e.scrollLeft*(a?.value?-1:1),p.value=e.offsetHeight,m.value=e.offsetWidth,d.value=e.scrollHeight,f.value=e.scrollWidth);let{value:t}=u,{value:n}=l;t&&(g.value=t.offsetWidth),n&&(h.value=n.offsetHeight)}function I(){e.scrollable&&(e.useUnifiedContainer?Te():(we(),Ce()))}function Ee(e){return!o.value?.contains(Zg(e))}function De(e){e.preventDefault(),e.stopPropagation(),S=!0,th(`mousemove`,window,Oe,!0),th(`mouseup`,window,ke,!0),E=v.value,D=a?.value?window.innerWidth-e.clientX:e.clientX}function Oe(t){if(!S)return;C!==void 0&&window.clearTimeout(C),w!==void 0&&window.clearTimeout(w);let{value:n}=m,{value:r}=f,{value:i}=ne;if(n===null||r===null)return;let o=(a?.value?window.innerWidth-t.clientX-D:t.clientX-D)*(r-n)/(n-i),s=r-n,c=E+o;c=Math.min(s,c),c=Math.max(c,0);let{value:l}=ce;if(l){l.scrollLeft=c*(a?.value?-1:1);let{internalOnUpdateScrollLeft:t}=e;t&&t(c)}}function ke(e){e.preventDefault(),e.stopPropagation(),nh(`mousemove`,window,Oe,!0),nh(`mouseup`,window,ke,!0),S=!1,I(),Ee(e)&&ve()}function Ae(e){e.preventDefault(),e.stopPropagation(),x=!0,th(`mousemove`,window,je,!0),th(`mouseup`,window,Me,!0),T=_.value,O=e.clientY}function je(e){if(!x)return;C!==void 0&&window.clearTimeout(C),w!==void 0&&window.clearTimeout(w);let{value:t}=p,{value:n}=d,{value:r}=ee;if(t===null||n===null)return;let i=(e.clientY-O)*(n-t)/(t-r),a=n-t,o=T+i;o=Math.min(a,o),o=Math.max(o,0);let{value:s}=ce;s&&(s.scrollTop=o)}function Me(e){e.preventDefault(),e.stopPropagation(),nh(`mousemove`,window,je,!0),nh(`mouseup`,window,Me,!0),x=!1,I(),Ee(e)&&ve()}(0,r.watchEffect)(()=>{let{value:e}=P,{value:n}=N,{value:r}=t,{value:i}=u,{value:a}=l;i&&(e?i.classList.remove(`${r}-scrollbar-rail--disabled`):i.classList.add(`${r}-scrollbar-rail--disabled`)),a&&(n?a.classList.remove(`${r}-scrollbar-rail--disabled`):a.classList.add(`${r}-scrollbar-rail--disabled`))}),(0,r.onMounted)(()=>{e.container||I()}),(0,r.onBeforeUnmount)(()=>{C!==void 0&&window.clearTimeout(C),w!==void 0&&window.clearTimeout(w),nh(`mousemove`,window,je,!0),nh(`mouseup`,window,Me,!0)});let Ne=(0,r.computed)(()=>{let{common:{cubicBezierEaseInOut:e},self:{color:t,colorHover:n,height:r,width:i,borderRadius:o,railInsetHorizontalTop:s,railInsetHorizontalBottom:c,railInsetVerticalRight:l,railInsetVerticalLeft:u,railColor:d}}=A.value,{top:f,right:p,bottom:m,left:h}=e_(s),{top:g,right:_,bottom:v,left:y}=e_(c),{top:b,right:x,bottom:S,left:C}=e_(a?.value?ib(l):l),{top:w,right:T,bottom:E,left:D}=e_(a?.value?ib(u):u);return{"--n-scrollbar-bezier":e,"--n-scrollbar-color":t,"--n-scrollbar-color-hover":n,"--n-scrollbar-border-radius":o,"--n-scrollbar-width":i,"--n-scrollbar-height":r,"--n-scrollbar-rail-top-horizontal-top":f,"--n-scrollbar-rail-right-horizontal-top":p,"--n-scrollbar-rail-bottom-horizontal-top":m,"--n-scrollbar-rail-left-horizontal-top":h,"--n-scrollbar-rail-top-horizontal-bottom":g,"--n-scrollbar-rail-right-horizontal-bottom":_,"--n-scrollbar-rail-bottom-horizontal-bottom":v,"--n-scrollbar-rail-left-horizontal-bottom":y,"--n-scrollbar-rail-top-vertical-right":b,"--n-scrollbar-rail-right-vertical-right":x,"--n-scrollbar-rail-bottom-vertical-right":S,"--n-scrollbar-rail-left-vertical-right":C,"--n-scrollbar-rail-top-vertical-left":w,"--n-scrollbar-rail-right-vertical-left":T,"--n-scrollbar-rail-bottom-vertical-left":E,"--n-scrollbar-rail-left-vertical-left":D,"--n-scrollbar-rail-color":d}}),Pe=n?pg(`scrollbar`,void 0,Ne,e):void 0;return{scrollTo:ue,scrollBy:me,sync:I,syncUnifiedContainer:Te,handleMouseEnterWrapper:ge,handleMouseLeaveWrapper:_e,mergedClsPrefix:t,rtlEnabled:a,containerScrollTop:_,wrapperRef:o,containerRef:s,contentRef:c,yRailRef:l,xRailRef:u,needYBar:N,needXBar:P,yBarSizePx:te,xBarSizePx:j,yBarTopPx:re,xBarLeftPx:ae,isShowXBar:oe,isShowYBar:se,isIos:k,handleScroll:F,handleContentResize:fe,handleContainerResize:pe,handleYScrollMouseDown:Ae,handleXScrollMouseDown:De,containerWidth:m,cssVars:n?void 0:Ne,themeClass:Pe?.themeClass,onRender:Pe?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,triggerDisplayManually:n,rtlEnabled:i,internalHoistYRail:a,yPlacement:o,xPlacement:s,xScrollable:c}=this;if(!this.scrollable)return e.default?.();let l=this.trigger===`none`,u=(e,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`yRailRef`,class:Q([`${t}-scrollbar-rail`,`${t}-scrollbar-rail--vertical`,`${t}-scrollbar-rail--vertical--${o}`,e]),"data-scrollbar-rail":!0,style:(0,r.normalizeStyle)([n||``,this.verticalRailStyle]),"aria-hidden":!0},[Z(()=>(0,r.h)(l?ab:r.Transition,l?null:{name:`fade-in-transition`},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:1,class:Q(`${t}-scrollbar-rail__scrollbar`),style:(0,r.normalizeStyle)({height:this.yBarSizePx,top:this.yBarTopPx}),onMousedown:this.handleYScrollMouseDown},null,46,vb)):null}))],6)),d=()=>(this.onRender?.(),(0,r.h)(`div`,(0,r.mergeProps)(this.$attrs,{role:`none`,ref:`wrapperRef`,class:[`${t}-scrollbar`,this.themeClass,i&&`${t}-scrollbar--rtl`],style:this.cssVars,onMouseenter:n?void 0:this.handleMouseEnterWrapper,onMouseleave:n?void 0:this.handleMouseLeaveWrapper}),[this.container?e.default?.():((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,role:`none`,ref:`containerRef`,class:Q([`${t}-scrollbar-container`,this.containerClass]),style:(0,r.normalizeStyle)([this.containerStyle,this.internalExposeWidthCssVar?{"--n-scrollbar-current-width":$g(this.containerWidth)}:void 0]),onScroll:this.handleScroll,onWheel:this.onWheel},[((0,r.openBlock)(),(0,r.createBlock)(_y,{onResize:this.handleContentResize},{default:()=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`contentRef`,role:`none`,style:(0,r.normalizeStyle)([{width:this.xScrollable?`fit-content`:null},this.contentStyle]),class:Q([`${t}-scrollbar-content`,this.contentClass])},[Z(()=>e.default?.())],6))},1032,[`onResize`]))],46,yb)),a?null:u(void 0,void 0),c&&((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`xRailRef`,class:Q([`${t}-scrollbar-rail`,`${t}-scrollbar-rail--horizontal`,`${t}-scrollbar-rail--horizontal--${s}`]),style:(0,r.normalizeStyle)(this.horizontalRailStyle),"data-scrollbar-rail":!0,"aria-hidden":!0},[Z(()=>(0,r.h)(l?ab:r.Transition,l?null:{name:`fade-in-transition`},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:3,class:Q(`${t}-scrollbar-rail__scrollbar`),style:(0,r.normalizeStyle)({width:this.xBarSizePx,right:i?this.xBarLeftPx:void 0,left:i?void 0:this.xBarLeftPx}),onMousedown:this.handleXScrollMouseDown},null,46,bb)):null}))],6))])),f=this.container?d():((0,r.openBlock)(),(0,r.createBlock)(_y,{key:4,onResize:this.handleContainerResize},{default:d},1032,[`onResize`]));return a?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:5},[Z(()=>f),Z(()=>u(this.themeClass,this.cssVars))],64)):f}}),Cb=Sb,wb=J(`base-icon`,`
179
179
  height: 1em;
180
180
  width: 1em;
181
181
  line-height: 1em;
@@ -186,7 +186,7 @@
186
186
  `,[q(`svg`,`
187
187
  height: 1em;
188
188
  width: 1em;
189
- `)]),wb=[`onClick`,`onMousedown`,`onMouseup`,`role`,`aria-label`,`aria-hidden`,`aria-disabled`],Tb=(0,r.defineComponent)({name:`BaseIcon`,props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Uy(`-base-icon`,Cb,(0,r.toRef)(e,`clsPrefix`))},render(){return(0,r.openBlock)(),(0,r.createElementBlock)(`i`,{class:Q(`${this.clsPrefix}-base-icon`),onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},[Z(()=>this.$slots.default?.())],42,wb)}}),Eb=(0,r.defineComponent)({name:`Empty`,render(){return(()=>{let e=zg(`15c1a247ae156450`);return e[0]||=(0,r.createElementVNode)(`svg`,{viewBox:`0 0 28 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,r.createElementVNode)(`path`,{d:`M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z`,fill:`currentColor`}),(0,r.createElementVNode)(`path`,{d:`M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z`,fill:`currentColor`})],-1)})()}}),Db={iconSizeTiny:`28px`,iconSizeSmall:`34px`,iconSizeMedium:`40px`,iconSizeLarge:`46px`,iconSizeHuge:`52px`};function Ob(e){let{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c}=e;return{...Db,fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r}}var kb={name:`Empty`,common:ub,self:Ob},Ab=J(`empty`,`
189
+ `)]),Tb=[`onClick`,`onMousedown`,`onMouseup`,`role`,`aria-label`,`aria-hidden`,`aria-disabled`],Eb=(0,r.defineComponent)({name:`BaseIcon`,props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Wy(`-base-icon`,wb,(0,r.toRef)(e,`clsPrefix`))},render(){return(0,r.openBlock)(),(0,r.createElementBlock)(`i`,{class:Q(`${this.clsPrefix}-base-icon`),onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},[Z(()=>this.$slots.default?.())],42,Tb)}}),Db=(0,r.defineComponent)({name:`Empty`,render(){return(()=>{let e=Bg(`15c1a247ae156450`);return e[0]||=(0,r.createElementVNode)(`svg`,{viewBox:`0 0 28 28`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,r.createElementVNode)(`path`,{d:`M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z`,fill:`currentColor`}),(0,r.createElementVNode)(`path`,{d:`M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z`,fill:`currentColor`})],-1)})()}}),Ob={iconSizeTiny:`28px`,iconSizeSmall:`34px`,iconSizeMedium:`40px`,iconSizeLarge:`46px`,iconSizeHuge:`52px`};function kb(e){let{textColorDisabled:t,iconColor:n,textColor2:r,fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c}=e;return{...Ob,fontSizeTiny:i,fontSizeSmall:a,fontSizeMedium:o,fontSizeLarge:s,fontSizeHuge:c,textColor:t,iconColor:n,extraTextColor:r}}var Ab={name:`Empty`,common:db,self:kb},jb=J(`empty`,`
190
190
  display: flex;
191
191
  flex-direction: column;
192
192
  align-items: center;
@@ -209,7 +209,7 @@
209
209
  transition: color .3s var(--n-bezier);
210
210
  margin-top: 12px;
211
211
  color: var(--n-extra-text-color);
212
- `)]),jb={...Lg.props,description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:`medium`},renderIcon:Function},Mb=(0,r.defineComponent)({name:`Empty`,props:jb,slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:i}=Sh(e),a=Lg(`Empty`,`-empty`,Ab,kb,e,t),{localeRef:o}=kg(`Empty`),s=(0,r.computed)(()=>e.description??i?.value?.Empty?.description),c=(0,r.computed)(()=>i?.value?.Empty?.renderIcon||(()=>((0,r.openBlock)(),(0,r.createBlock)(Eb)))),l=(0,r.computed)(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{[og(`iconSize`,t)]:r,[og(`fontSize`,t)]:i,textColor:o,iconColor:s,extraTextColor:c}}=a.value;return{"--n-icon-size":r,"--n-font-size":i,"--n-bezier":n,"--n-text-color":o,"--n-icon-color":s,"--n-extra-text-color":c}}),u=n?fg(`empty`,(0,r.computed)(()=>{let t=``,{size:n}=e;return t+=n[0],t}),l,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:c,localizedDescription:(0,r.computed)(()=>s.value||o.value.description),cssVars:n?void 0:l,themeClass:u?.themeClass,onRender:u?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n?.(),(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q([`${t}-empty`,this.themeClass]),style:(0,r.normalizeStyle)(this.cssVars)},[this.showIcon?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:Q(`${t}-empty__icon`)},[e.icon?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>e.icon())],64)):((0,r.openBlock)(),(0,r.createBlock)(Tb,{key:1,clsPrefix:t},{default:this.mergedRenderIcon},1032,[`clsPrefix`]))],2)):Z(()=>null),this.showDescription?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:Q(`${t}-empty__description`)},[e.default?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>e.default())],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>this.localizedDescription)],64))],2)):Z(()=>null),e.extra?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:4,class:Q(`${t}-empty__extra`)},[Z(()=>e.extra())],2)):Z(()=>null)],6)}}),Nb={height:`calc(var(--n-option-height) * 7.6)`,paddingTiny:`4px 0`,paddingSmall:`4px 0`,paddingMedium:`4px 0`,paddingLarge:`4px 0`,paddingHuge:`4px 0`,optionPaddingTiny:`0 12px`,optionPaddingSmall:`0 12px`,optionPaddingMedium:`0 12px`,optionPaddingLarge:`0 12px`,optionPaddingHuge:`0 12px`,loadingSize:`18px`};function Pb(e){let{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:i,textColor2:a,primaryColorPressed:o,textColorDisabled:s,primaryColor:c,opacityDisabled:l,hoverColor:u,fontSizeTiny:d,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:m,fontSizeHuge:h,heightTiny:g,heightSmall:_,heightMedium:v,heightLarge:y,heightHuge:b}=e;return{...Nb,optionFontSizeTiny:d,optionFontSizeSmall:f,optionFontSizeMedium:p,optionFontSizeLarge:m,optionFontSizeHuge:h,optionHeightTiny:g,optionHeightSmall:_,optionHeightMedium:v,optionHeightLarge:y,optionHeightHuge:b,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:i,optionTextColor:a,optionTextColorPressed:o,optionTextColorDisabled:s,optionTextColorActive:c,optionOpacityDisabled:l,optionCheckColor:c,optionColorPending:u,optionColorActive:`rgba(0, 0, 0, 0)`,optionColorActivePending:u,actionTextColor:a,loadingColor:c}}var Fb=Ig({name:`InternalSelectMenu`,common:ub,peers:{Scrollbar:pb,Empty:kb},self:Pb});function Ib(e,...t){return typeof e==`function`?e(...t):typeof e==`string`?(0,r.createTextVNode)(e):typeof e==`number`?(0,r.createTextVNode)(String(e)):null}var Lb=(0,r.defineComponent)({name:`NBaseSelectGroupHeader`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){let{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:i}=(0,r.inject)(Hm);return{labelField:n,nodeProps:i,renderLabel:e,renderOption:t}},render(){let{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:i,tmNode:{rawNode:a}}=this,o=i?.(a),s=t?t(a,!1):Ib(a[this.labelField],a,!1),c=((0,r.openBlock)(),(0,r.createElementBlock)(`div`,(0,r.mergeProps)(o,{class:[`${e}-base-select-group-header`,o?.class]}),[Z(()=>s)],16));return a.render?a.render({node:c,option:a}):n?n({node:c,option:a,selected:!1}):c}});function Rb(e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?t[0]:t=>{e.forEach(e=>{e&&e(t)})}}var zb=(0,r.defineComponent)({name:`Checkmark`,render(){return(()=>{let e=zg(`3c84eac8ae4e1f96`);return e[0]||=(0,r.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`},[(0,r.createElementVNode)(`g`,{fill:`none`},[(0,r.createElementVNode)(`path`,{d:`M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z`,fill:`currentColor`})])],-1)})()}}),Bb=[`onClick`,`onMouseenter`,`onMousemove`];function Vb(e,t){return(0,r.openBlock)(),(0,r.createBlock)(r.Transition,{name:`fade-in-scale-up-transition`},{default:()=>e?((0,r.openBlock)(),(0,r.createBlock)(Tb,{key:1,clsPrefix:t,class:Q(`${t}-base-select-option__check`)},{default:()=>(0,r.h)(zb)},1032,[`clsPrefix`,`class`])):null},1024)}var Hb=(0,r.defineComponent)({name:`NBaseSelectOption`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){let{valueRef:t,pendingTmNodeRef:n,multipleRef:i,valueSetRef:a,renderLabelRef:o,renderOptionRef:s,labelFieldRef:c,valueFieldRef:l,showCheckmarkRef:u,nodePropsRef:d,handleOptionClick:f,handleOptionMouseEnter:p}=(0,r.inject)(Hm),m=rh(()=>{let{value:t}=n;return t?e.tmNode.key===t.key:!1});function h(t){let{tmNode:n}=e;n.disabled||f(t,n)}function g(t){let{tmNode:n}=e;n.disabled||p(t,n)}function _(t){let{tmNode:n}=e,{value:r}=m;n.disabled||r||p(t,n)}return{multiple:i,isGrouped:rh(()=>{let{tmNode:t}=e,{parent:n}=t;return n&&n.rawNode.type===`group`}),showCheckmark:u,nodeProps:d,isPending:m,isSelected:rh(()=>{let{value:n}=t,{value:r}=i;if(n===null)return!1;let o=e.tmNode.rawNode[l.value];if(r){let{value:e}=a;return e.has(o)}return n===o}),labelField:c,renderLabel:o,renderOption:s,handleMouseMove:_,handleMouseEnter:g,handleClick:h}},render(){let{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:i,isGrouped:a,showCheckmark:o,nodeProps:s,renderOption:c,renderLabel:l,handleClick:u,handleMouseEnter:d,handleMouseMove:f}=this,p=Vb(n,e),m=l?[l(t,n),o&&p]:[Ib(t[this.labelField],t,n),o&&p],h=s?.(t),g=((0,r.openBlock)(),(0,r.createElementBlock)(`div`,(0,r.mergeProps)(h,{class:[`${e}-base-select-option`,t.class,h?.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:a,[`${e}-base-select-option--pending`]:i,[`${e}-base-select-option--show-checkmark`]:o}],style:[h?.style||``,t.style||``],onClick:Rb([u,h?.onClick]),onMouseenter:Rb([d,h?.onMouseenter]),onMousemove:Rb([f,h?.onMousemove])}),[(0,r.createElementVNode)(`div`,{class:Q(`${e}-base-select-option__content`)},[Z(()=>m)],2)],16,Bb));return t.render?t.render({node:g,option:t,selected:n}):c?c({node:g,option:t,selected:n}):g}}),{cubicBezierEaseIn:Ub,cubicBezierEaseOut:Wb}=jg;function Gb({transformOrigin:e=`inherit`,duration:t=`.2s`,enterScale:n=`.9`,originalTransform:r=``,originalTransition:i=``}={}){return[q(`&.fade-in-scale-up-transition-leave-active`,{transformOrigin:e,transition:`opacity ${t} ${Ub}, transform ${t} ${Ub} ${i&&`,${i}`}`}),q(`&.fade-in-scale-up-transition-enter-active`,{transformOrigin:e,transition:`opacity ${t} ${Wb}, transform ${t} ${Wb} ${i&&`,${i}`}`}),q(`&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to`,{opacity:0,transform:`${r} scale(${n})`}),q(`&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to`,{opacity:1,transform:`${r} scale(1)`})]}var Kb=J(`base-select-menu`,`
212
+ `)]),Mb={...Rg.props,description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:`medium`},renderIcon:Function},Nb=(0,r.defineComponent)({name:`Empty`,props:Mb,slots:Object,setup(e){let{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:i}=Ch(e),a=Rg(`Empty`,`-empty`,jb,Ab,e,t),{localeRef:o}=Ag(`Empty`),s=(0,r.computed)(()=>e.description??i?.value?.Empty?.description),c=(0,r.computed)(()=>i?.value?.Empty?.renderIcon||(()=>((0,r.openBlock)(),(0,r.createBlock)(Db)))),l=(0,r.computed)(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{[sg(`iconSize`,t)]:r,[sg(`fontSize`,t)]:i,textColor:o,iconColor:s,extraTextColor:c}}=a.value;return{"--n-icon-size":r,"--n-font-size":i,"--n-bezier":n,"--n-text-color":o,"--n-icon-color":s,"--n-extra-text-color":c}}),u=n?pg(`empty`,(0,r.computed)(()=>{let t=``,{size:n}=e;return t+=n[0],t}),l,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:c,localizedDescription:(0,r.computed)(()=>s.value||o.value.description),cssVars:n?void 0:l,themeClass:u?.themeClass,onRender:u?.onRender}},render(){let{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n?.(),(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q([`${t}-empty`,this.themeClass]),style:(0,r.normalizeStyle)(this.cssVars)},[this.showIcon?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:Q(`${t}-empty__icon`)},[e.icon?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>e.icon())],64)):((0,r.openBlock)(),(0,r.createBlock)(Eb,{key:1,clsPrefix:t},{default:this.mergedRenderIcon},1032,[`clsPrefix`]))],2)):Z(()=>null),this.showDescription?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:Q(`${t}-empty__description`)},[e.default?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>e.default())],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>this.localizedDescription)],64))],2)):Z(()=>null),e.extra?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:4,class:Q(`${t}-empty__extra`)},[Z(()=>e.extra())],2)):Z(()=>null)],6)}}),Pb={height:`calc(var(--n-option-height) * 7.6)`,paddingTiny:`4px 0`,paddingSmall:`4px 0`,paddingMedium:`4px 0`,paddingLarge:`4px 0`,paddingHuge:`4px 0`,optionPaddingTiny:`0 12px`,optionPaddingSmall:`0 12px`,optionPaddingMedium:`0 12px`,optionPaddingLarge:`0 12px`,optionPaddingHuge:`0 12px`,loadingSize:`18px`};function Fb(e){let{borderRadius:t,popoverColor:n,textColor3:r,dividerColor:i,textColor2:a,primaryColorPressed:o,textColorDisabled:s,primaryColor:c,opacityDisabled:l,hoverColor:u,fontSizeTiny:d,fontSizeSmall:f,fontSizeMedium:p,fontSizeLarge:m,fontSizeHuge:h,heightTiny:g,heightSmall:_,heightMedium:v,heightLarge:y,heightHuge:b}=e;return{...Pb,optionFontSizeTiny:d,optionFontSizeSmall:f,optionFontSizeMedium:p,optionFontSizeLarge:m,optionFontSizeHuge:h,optionHeightTiny:g,optionHeightSmall:_,optionHeightMedium:v,optionHeightLarge:y,optionHeightHuge:b,borderRadius:t,color:n,groupHeaderTextColor:r,actionDividerColor:i,optionTextColor:a,optionTextColorPressed:o,optionTextColorDisabled:s,optionTextColorActive:c,optionOpacityDisabled:l,optionCheckColor:c,optionColorPending:u,optionColorActive:`rgba(0, 0, 0, 0)`,optionColorActivePending:u,actionTextColor:a,loadingColor:c}}var Ib=Lg({name:`InternalSelectMenu`,common:db,peers:{Scrollbar:mb,Empty:Ab},self:Fb});function Lb(e,...t){return typeof e==`function`?e(...t):typeof e==`string`?(0,r.createTextVNode)(e):typeof e==`number`?(0,r.createTextVNode)(String(e)):null}var Rb=(0,r.defineComponent)({name:`NBaseSelectGroupHeader`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){let{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:i}=(0,r.inject)(Um);return{labelField:n,nodeProps:i,renderLabel:e,renderOption:t}},render(){let{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:i,tmNode:{rawNode:a}}=this,o=i?.(a),s=t?t(a,!1):Lb(a[this.labelField],a,!1),c=((0,r.openBlock)(),(0,r.createElementBlock)(`div`,(0,r.mergeProps)(o,{class:[`${e}-base-select-group-header`,o?.class]}),[Z(()=>s)],16));return a.render?a.render({node:c,option:a}):n?n({node:c,option:a,selected:!1}):c}});function zb(e){let t=e.filter(e=>e!==void 0);if(t.length!==0)return t.length===1?t[0]:t=>{e.forEach(e=>{e&&e(t)})}}var Bb=(0,r.defineComponent)({name:`Checkmark`,render(){return(()=>{let e=Bg(`3c84eac8ae4e1f96`);return e[0]||=(0,r.createElementVNode)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 16 16`},[(0,r.createElementVNode)(`g`,{fill:`none`},[(0,r.createElementVNode)(`path`,{d:`M14.046 3.486a.75.75 0 0 1-.032 1.06l-7.93 7.474a.85.85 0 0 1-1.188-.022l-2.68-2.72a.75.75 0 1 1 1.068-1.053l2.234 2.267l7.468-7.038a.75.75 0 0 1 1.06.032z`,fill:`currentColor`})])],-1)})()}}),Vb=[`onClick`,`onMouseenter`,`onMousemove`];function Hb(e,t){return(0,r.openBlock)(),(0,r.createBlock)(r.Transition,{name:`fade-in-scale-up-transition`},{default:()=>e?((0,r.openBlock)(),(0,r.createBlock)(Eb,{key:1,clsPrefix:t,class:Q(`${t}-base-select-option__check`)},{default:()=>(0,r.h)(Bb)},1032,[`clsPrefix`,`class`])):null},1024)}var Ub=(0,r.defineComponent)({name:`NBaseSelectOption`,props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){let{valueRef:t,pendingTmNodeRef:n,multipleRef:i,valueSetRef:a,renderLabelRef:o,renderOptionRef:s,labelFieldRef:c,valueFieldRef:l,showCheckmarkRef:u,nodePropsRef:d,handleOptionClick:f,handleOptionMouseEnter:p}=(0,r.inject)(Um),m=ih(()=>{let{value:t}=n;return t?e.tmNode.key===t.key:!1});function h(t){let{tmNode:n}=e;n.disabled||f(t,n)}function g(t){let{tmNode:n}=e;n.disabled||p(t,n)}function _(t){let{tmNode:n}=e,{value:r}=m;n.disabled||r||p(t,n)}return{multiple:i,isGrouped:ih(()=>{let{tmNode:t}=e,{parent:n}=t;return n&&n.rawNode.type===`group`}),showCheckmark:u,nodeProps:d,isPending:m,isSelected:ih(()=>{let{value:n}=t,{value:r}=i;if(n===null)return!1;let o=e.tmNode.rawNode[l.value];if(r){let{value:e}=a;return e.has(o)}return n===o}),labelField:c,renderLabel:o,renderOption:s,handleMouseMove:_,handleMouseEnter:g,handleClick:h}},render(){let{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:i,isGrouped:a,showCheckmark:o,nodeProps:s,renderOption:c,renderLabel:l,handleClick:u,handleMouseEnter:d,handleMouseMove:f}=this,p=Hb(n,e),m=l?[l(t,n),o&&p]:[Lb(t[this.labelField],t,n),o&&p],h=s?.(t),g=((0,r.openBlock)(),(0,r.createElementBlock)(`div`,(0,r.mergeProps)(h,{class:[`${e}-base-select-option`,t.class,h?.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:a,[`${e}-base-select-option--pending`]:i,[`${e}-base-select-option--show-checkmark`]:o}],style:[h?.style||``,t.style||``],onClick:zb([u,h?.onClick]),onMouseenter:zb([d,h?.onMouseenter]),onMousemove:zb([f,h?.onMousemove])}),[(0,r.createElementVNode)(`div`,{class:Q(`${e}-base-select-option__content`)},[Z(()=>m)],2)],16,Vb));return t.render?t.render({node:g,option:t,selected:n}):c?c({node:g,option:t,selected:n}):g}}),{cubicBezierEaseIn:Wb,cubicBezierEaseOut:Gb}=Mg;function Kb({transformOrigin:e=`inherit`,duration:t=`.2s`,enterScale:n=`.9`,originalTransform:r=``,originalTransition:i=``}={}){return[q(`&.fade-in-scale-up-transition-leave-active`,{transformOrigin:e,transition:`opacity ${t} ${Wb}, transform ${t} ${Wb} ${i&&`,${i}`}`}),q(`&.fade-in-scale-up-transition-enter-active`,{transformOrigin:e,transition:`opacity ${t} ${Gb}, transform ${t} ${Gb} ${i&&`,${i}`}`}),q(`&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to`,{opacity:0,transform:`${r} scale(${n})`}),q(`&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to`,{opacity:1,transform:`${r} scale(1)`})]}var qb=J(`base-select-menu`,`
213
213
  line-height: 1.5;
214
214
  outline: none;
215
215
  z-index: 0;
@@ -305,7 +305,7 @@
305
305
  background-color: var(--n-option-color-active-pending);
306
306
  `)])]),X(`disabled`,`
307
307
  cursor: not-allowed;
308
- `,[ig(`selected`,`
308
+ `,[ag(`selected`,`
309
309
  color: var(--n-option-text-color-disabled);
310
310
  `),X(`selected`,`
311
311
  opacity: var(--n-option-opacity-disabled);
@@ -316,7 +316,7 @@
316
316
  top: calc(50% - 7px);
317
317
  color: var(--n-option-check-color);
318
318
  transition: color .3s var(--n-bezier);
319
- `,[Gb({enterScale:`0.5`})])])]);function qb(e){return Array.isArray(e)?e:[e]}var Jb={STOP:`STOP`};function Yb(e,t){let n=t(e);e.children!==void 0&&n!==Jb.STOP&&e.children.forEach(e=>Yb(e,t))}function Xb(e,t={}){let{preserveGroup:n=!1}=t,r=[],i=n?e=>{e.isLeaf||(r.push(e.key),a(e.children))}:e=>{e.isLeaf||(e.isGroup||r.push(e.key),a(e.children))};function a(e){e.forEach(i)}return a(e),r}function Zb(e,t){let{isLeaf:n}=e;return n===void 0?!t(e):n}function Qb(e){return e.children}function $b(e){return e.key}function ex(){return!1}function tx(e,t){let{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function nx(e){return e.disabled===!0}function rx(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function ix(e,t){if(e.isLeaf===!0){let n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function ax(e){return e==null?[]:Array.isArray(e)?e:e.checkedKeys??[]}function ox(e){return e==null||Array.isArray(e)?[]:e.indeterminateKeys??[]}function sx(e,t){let n=new Set(e);return t.forEach(e=>{n.has(e)||n.add(e)}),Array.from(n)}function cx(e,t){let n=new Set(e);return t.forEach(e=>{n.has(e)&&n.delete(e)}),Array.from(n)}function lx(e){return e?.type===`group`}function ux(e){let t=new Map;return e.forEach((e,n)=>{t.set(e.key,n)}),e=>t.get(e)??null}var dx=class extends Error{constructor(){super(),this.message=`SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded.`}};function fx(e,t,n,r){return gx(t.concat(e),n,r,!1)}function px(e,t){let n=new Set;return e.forEach(e=>{let r=t.treeNodeMap.get(e);if(r!==void 0){let e=r.parent;for(;e!==null&&!(e.disabled||n.has(e.key));)n.add(e.key),e=e.parent}}),n}function mx(e,t,n,r){let i=gx(t,n,r,!1),a=gx(e,n,r,!0),o=px(e,n),s=[];return i.forEach(e=>{(a.has(e)||o.has(e))&&s.push(e)}),s.forEach(e=>i.delete(e)),i}function hx(e,t){let{checkedKeys:n,keysToCheck:r,keysToUncheck:i,indeterminateKeys:a,cascade:o,leafOnly:s,checkStrategy:c,allowNotLoaded:l}=e;if(!o)return r===void 0?i===void 0?{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)}:{checkedKeys:cx(n,i),indeterminateKeys:Array.from(a)}:{checkedKeys:sx(n,r),indeterminateKeys:Array.from(a)};let{levelTreeNodeMap:u}=t,d;d=i===void 0?r===void 0?gx(n,t,l,!1):fx(r,n,t,l):mx(i,n,t,l);let f=c===`parent`,p=c===`child`||s,m=d,h=new Set,g=Math.max.apply(null,Array.from(u.keys()));for(let e=g;e>=0;--e){let t=e===0,n=u.get(e);for(let e of n){if(e.isLeaf)continue;let{key:n,shallowLoaded:r}=e;if(p&&r&&e.children.forEach(e=>{!e.disabled&&!e.isLeaf&&e.shallowLoaded&&m.has(e.key)&&m.delete(e.key)}),e.disabled||!r)continue;let i=!0,a=!1,o=!0;for(let t of e.children){let e=t.key;if(!t.disabled){if(o&&=!1,m.has(e))a=!0;else if(h.has(e)){a=!0,i=!1;break}else if(i=!1,a)break}}i&&!o?(f&&e.children.forEach(e=>{!e.disabled&&m.has(e.key)&&m.delete(e.key)}),m.add(n)):a&&h.add(n),t&&p&&m.has(n)&&m.delete(n)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(h)}}function gx(e,t,n,r){let{treeNodeMap:i,getChildren:a}=t,o=new Set,s=new Set(e);return e.forEach(e=>{let t=i.get(e);t!==void 0&&Yb(t,e=>{if(e.disabled)return Jb.STOP;let{key:t}=e;if(!o.has(t)&&(o.add(t),s.add(t),rx(e.rawNode,a))){if(r)return Jb.STOP;if(!n)throw new dx}})}),s}function _x(e,{includeGroup:t=!1,includeSelf:n=!0},r){let i=r.treeNodeMap,a=e==null?null:i.get(e)??null,o={keyPath:[],treeNodePath:[],treeNode:a};if(a?.ignored)return o.treeNode=null,o;for(;a;)!a.ignored&&(t||!a.isGroup)&&o.treeNodePath.push(a),a=a.parent;return o.treeNodePath.reverse(),n||o.treeNodePath.pop(),o.keyPath=o.treeNodePath.map(e=>e.key),o}function vx(e){if(e.length===0)return null;let t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function yx(e,t){let n=e.siblings,r=n.length,{index:i}=e;return t?n[(i+1)%r]:i===n.length-1?null:n[i+1]}function bx(e,t,{loop:n=!1,includeDisabled:r=!1}={}){let i=t===`prev`?xx:yx,a={reverse:t===`prev`},o=!1,s=null;function c(t){if(t!==null){if(t===e){if(!o)o=!0;else if(!e.disabled&&!e.isGroup){s=e;return}}else if((!t.disabled||r)&&!t.ignored&&!t.isGroup){s=t;return}if(t.isGroup){let e=Cx(t,a);e===null?c(i(t,n)):s=e}else{let e=i(t,!1);if(e!==null)c(e);else{let e=Sx(t);e?.isGroup?c(i(e,n)):n&&c(i(t,!0))}}}}return c(e),s}function xx(e,t){let n=e.siblings,r=n.length,{index:i}=e;return t?n[(i-1+r)%r]:i===0?null:n[i-1]}function Sx(e){return e.parent}function Cx(e,t={}){let{reverse:n=!1}=t,{children:r}=e;if(r){let{length:e}=r,i=n?e-1:0,a=n?-1:e,o=n?-1:1;for(let e=i;e!==a;e+=o){let n=r[e];if(!n.disabled&&!n.ignored){if(n.isGroup){let e=Cx(n,t);if(e!==null)return e}else return n}}}return null}var wx={getChild(){return this.ignored?null:Cx(this)},getParent(){let{parent:e}=this;return e?.isGroup?e.getParent():e},getNext(e={}){return bx(this,`next`,e)},getPrev(e={}){return bx(this,`prev`,e)}};function Tx(e,t){let n=t?new Set(t):void 0,r=[];function i(e){e.forEach(e=>{r.push(e),!(e.isLeaf||!e.children||e.ignored)&&(e.isGroup||n===void 0||n.has(e.key))&&i(e.children)})}return i(e),r}function Ex(e,t){let n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}function Dx(e,t,n,r,i,a=null,o=0){let s=[];return e.forEach((c,l)=>{var u;process.env.NODE_ENV!==`production`&&ix(c,i)&&console.error(`[treemate]: node`,c,`is invalid`);let d=Object.create(r);if(d.rawNode=c,d.siblings=s,d.level=o,d.index=l,d.isFirstChild=l===0,d.isLastChild=l+1===e.length,d.parent=a,!d.ignored){let e=i(c);Array.isArray(e)&&(d.children=Dx(e,t,n,r,i,d,o+1))}s.push(d),t.set(d.key,d),n.has(o)||n.set(o,[]),(u=n.get(o))==null||u.push(d)}),s}function Ox(e,t={}){let n=new Map,r=new Map,{getDisabled:i=nx,getIgnored:a=ex,getIsGroup:o=lx,getKey:s=$b}=t,c=t.getChildren??Qb,l=t.ignoreEmptyChildren?e=>{let t=c(e);return Array.isArray(t)?t.length?t:null:t}:c,u=Dx(e,n,r,Object.assign({get key(){return s(this.rawNode)},get disabled(){return i(this.rawNode)},get isGroup(){return o(this.rawNode)},get isLeaf(){return Zb(this.rawNode,l)},get shallowLoaded(){return tx(this.rawNode,l)},get ignored(){return a(this.rawNode)},contains(e){return Ex(this,e)}},wx),l);function d(e){if(e==null)return null;let t=n.get(e);return t&&!t.isGroup&&!t.ignored?t:null}function f(e){if(e==null)return null;let t=n.get(e);return t&&!t.ignored?t:null}function p(e,t){let n=f(e);return n?n.getPrev(t):null}function m(e,t){let n=f(e);return n?n.getNext(t):null}function h(e){let t=f(e);return t?t.getParent():null}function g(e){let t=f(e);return t?t.getChild():null}let _={treeNodes:u,treeNodeMap:n,levelTreeNodeMap:r,maxLevel:Math.max(...r.keys()),getChildren:l,getFlattenedNodes(e){return Tx(u,e)},getNode:d,getPrev:p,getNext:m,getParent:h,getChild:g,getFirstAvailableNode(){return vx(u)},getPath(e,t={}){return _x(e,t,_)},getCheckedKeys(e,t={}){let{cascade:n=!0,leafOnly:r=!1,checkStrategy:i=`all`,allowNotLoaded:a=!1}=t;return hx({checkedKeys:ax(e),indeterminateKeys:ox(e),cascade:n,leafOnly:r,checkStrategy:i,allowNotLoaded:a},_)},check(e,t,n={}){let{cascade:r=!0,leafOnly:i=!1,checkStrategy:a=`all`,allowNotLoaded:o=!1}=n;return hx({checkedKeys:ax(t),indeterminateKeys:ox(t),keysToCheck:e==null?[]:qb(e),cascade:r,leafOnly:i,checkStrategy:a,allowNotLoaded:o},_)},uncheck(e,t,n={}){let{cascade:r=!0,leafOnly:i=!1,checkStrategy:a=`all`,allowNotLoaded:o=!1}=n;return hx({checkedKeys:ax(t),indeterminateKeys:ox(t),keysToUncheck:e==null?[]:qb(e),cascade:r,leafOnly:i,checkStrategy:a,allowNotLoaded:o},_)},getNonLeafKeys(e={}){return Xb(u,e)}};return _}var kx=[`tabindex`,`onFocusin`,`onFocusout`,`onKeyup`,`onKeydown`,`onMousedown`,`onMouseenter`,`onMouseleave`],Ax=(0,r.defineComponent)({name:`InternalSelectMenu`,props:{...Lg.props,clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:`medium`},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,scrollbarProps:Object,onToggle:Function},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n,mergedComponentPropsRef:i}=Sh(e),a=Vy(`InternalSelectMenu`,n,t),o=Lg(`InternalSelectMenu`,`-internal-select-menu`,Kb,Fb,e,(0,r.toRef)(e,`clsPrefix`)),s=(0,r.ref)(null),c=(0,r.ref)(null),l=(0,r.ref)(null),u=(0,r.computed)(()=>e.treeMate.getFlattenedNodes()),d=(0,r.computed)(()=>ux(u.value)),f=(0,r.ref)(null);function p(){let{treeMate:t}=e,n=null,{value:r}=e;r===null?n=t.getFirstAvailableNode():(n=e.multiple?t.getNode((r||[])[(r||[]).length-1]):t.getNode(r),(!n||n.disabled)&&(n=t.getFirstAvailableNode())),te(n||null)}function m(){let{value:t}=f;t&&!e.treeMate.getNode(t.key)&&(f.value=null)}let h;(0,r.watch)(()=>e.show,t=>{t?h=(0,r.watch)(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?p():m(),(0,r.nextTick)(ne)):m()},{immediate:!0}):h?.()},{immediate:!0}),(0,r.onBeforeUnmount)(()=>{h?.()});let g=(0,r.computed)(()=>Zg(o.value.self[og(`optionHeight`,e.size)])),_=(0,r.computed)(()=>$g(o.value.self[og(`padding`,e.size)])),v=(0,r.computed)(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),y=(0,r.computed)(()=>{let e=u.value;return e&&e.length===0}),b=(0,r.computed)(()=>i?.value?.Select?.renderEmpty);function x(t){let{onToggle:n}=e;n&&n(t)}function S(t){let{onScroll:n}=e;n&&n(t)}function C(e){l.value?.sync(),S(e)}function w(){l.value?.sync()}function T(){let{value:e}=f;return e||null}function E(e,t){t.disabled||te(t,!1)}function D(e,t){t.disabled||x(t)}function O(t){Yg(t,`action`)||e.onKeyup?.(t)}function k(t){Yg(t,`action`)||e.onKeydown?.(t)}function A(t){e.onMousedown?.(t),!e.focusable&&t.preventDefault()}function ee(){let{value:e}=f;e&&te(e.getNext({loop:!0}),!0)}function j(){let{value:e}=f;e&&te(e.getPrev({loop:!0}),!0)}function te(e,t=!1){f.value=e,t&&ne()}function ne(){let t=f.value;if(!t)return;let n=d.value(t.key);n!==null&&(e.virtualScroll?c.value?.scrollTo({index:n}):l.value?.scrollTo({index:n,elSize:g.value}))}function M(t){s.value?.contains(t.target)&&e.onFocus?.(t)}function re(t){s.value?.contains(t.relatedTarget)||e.onBlur?.(t)}(0,r.provide)(Hm,{handleOptionMouseEnter:E,handleOptionClick:D,valueSetRef:v,pendingTmNodeRef:f,nodePropsRef:(0,r.toRef)(e,`nodeProps`),showCheckmarkRef:(0,r.toRef)(e,`showCheckmark`),multipleRef:(0,r.toRef)(e,`multiple`),valueRef:(0,r.toRef)(e,`value`),renderLabelRef:(0,r.toRef)(e,`renderLabel`),renderOptionRef:(0,r.toRef)(e,`renderOption`),labelFieldRef:(0,r.toRef)(e,`labelField`),valueFieldRef:(0,r.toRef)(e,`valueField`)}),(0,r.provide)(Um,s),(0,r.onMounted)(()=>{let{value:e}=l;e&&e.sync()});let ie=(0,r.computed)(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{height:r,borderRadius:i,color:a,groupHeaderTextColor:s,actionDividerColor:c,optionTextColorPressed:l,optionTextColor:u,optionTextColorDisabled:d,optionTextColorActive:f,optionOpacityDisabled:p,optionCheckColor:m,actionTextColor:h,optionColorPending:g,optionColorActive:_,loadingColor:v,loadingSize:y,optionColorActivePending:b,[og(`optionFontSize`,t)]:x,[og(`optionHeight`,t)]:S,[og(`optionPadding`,t)]:C}}=o.value;return{"--n-height":r,"--n-action-divider-color":c,"--n-action-text-color":h,"--n-bezier":n,"--n-border-radius":i,"--n-color":a,"--n-option-font-size":x,"--n-group-header-text-color":s,"--n-option-check-color":m,"--n-option-color-pending":g,"--n-option-color-active":_,"--n-option-color-active-pending":b,"--n-option-height":S,"--n-option-opacity-disabled":p,"--n-option-text-color":u,"--n-option-text-color-active":f,"--n-option-text-color-disabled":d,"--n-option-text-color-pressed":l,"--n-option-padding":C,"--n-option-padding-left":$g(C,`left`),"--n-option-padding-right":$g(C,`right`),"--n-loading-color":v,"--n-loading-size":y}}),{inlineThemeDisabled:N}=e,P=N?fg(`internal-select-menu`,(0,r.computed)(()=>e.size[0]),ie,e):void 0,F={selfRef:s,next:ee,prev:j,getPendingTmNode:T};return Iy(s,e.onResize),{mergedTheme:o,mergedClsPrefix:t,rtlEnabled:a,virtualListRef:c,scrollbarRef:l,itemSize:g,padding:_,flattenedNodes:u,empty:y,mergedRenderEmpty:b,virtualListContainer(){let{value:e}=c;return e?.listElRef},virtualListContent(){let{value:e}=c;return e?.itemsElRef},doScroll:S,handleFocusin:M,handleFocusout:re,handleKeyUp:O,handleKeyDown:k,handleMouseDown:A,handleVirtualListResize:w,handleVirtualListScroll:C,cssVars:N?void 0:ie,themeClass:P?.themeClass,onRender:P?.onRender,...F}},render(){let{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:i,themeClass:a,onRender:o}=this;return o?.(),(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`selfRef`,tabindex:this.focusable?0:-1,class:Q([`${n}-base-select-menu`,`${n}-base-select-menu--${this.size}-size`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,a,this.multiple&&`${n}-base-select-menu--multiple`]),style:(0,r.normalizeStyle)(this.cssVars),onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},[Z(()=>zy(e.header,e=>e&&((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${n}-base-select-menu__header`),"data-header":!0,key:`header`},[Z(()=>e)],2)))),this.loading?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:Q(`${n}-base-select-menu__loading`)},[((0,r.openBlock)(),(0,r.createBlock)(tb,{clsPrefix:n,strokeWidth:20},null,8,[`clsPrefix`]))],2)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[this.empty?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:1,class:Q(`${n}-base-select-menu__empty`),"data-empty":!0},[Z(()=>Ry(e.empty,()=>[this.mergedRenderEmpty?.()||((0,r.openBlock)(),(0,r.createBlock)(Mb,{theme:i.peers.Empty,themeOverrides:i.peerOverrides.Empty,size:this.size},null,8,[`theme`,`themeOverrides`,`size`]))]))],2)):((0,r.openBlock)(),(0,r.createBlock)(xb,(0,r.mergeProps)({key:0,ref:`scrollbarRef`,theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},this.scrollbarProps),{default:()=>t?((0,r.openBlock)(),(0,r.createBlock)(Ty,{key:1,ref:`virtualListRef`,class:Q(`${n}-virtual-list`),items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:e})=>e.isGroup?((0,r.openBlock)(),(0,r.createBlock)(Lb,{key:e.key,clsPrefix:n,tmNode:e},null,8,[`clsPrefix`,`tmNode`])):e.ignored?null:((0,r.openBlock)(),(0,r.createBlock)(Hb,{clsPrefix:n,key:e.key,tmNode:e},null,8,[`clsPrefix`,`tmNode`]))},1032,[`class`,`items`,`itemSize`,`paddingTop`,`paddingBottom`,`onResize`,`onScroll`])):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:4,class:Q(`${n}-base-select-menu-option-wrapper`),style:(0,r.normalizeStyle)({paddingTop:this.padding.top,paddingBottom:this.padding.bottom})},[Z(()=>this.flattenedNodes.map(e=>e.isGroup?((0,r.openBlock)(),(0,r.createBlock)(Lb,{key:e.key,clsPrefix:n,tmNode:e},null,8,[`clsPrefix`,`tmNode`])):((0,r.openBlock)(),(0,r.createBlock)(Hb,{clsPrefix:n,key:e.key,tmNode:e},null,8,[`clsPrefix`,`tmNode`]))))],6))},1040,[`theme`,`themeOverrides`,`scrollable`,`container`,`content`,`onScroll`]))],64)),Z(()=>zy(e.action,e=>e&&[((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${n}-base-select-menu__action`),"data-action":!0,key:`action`},[Z(()=>e)],2)),((0,r.openBlock)(),(0,r.createBlock)(Hy,{onFocus:this.onTabOut,key:`focus-detector`},null,8,[`onFocus`]))]))],46,kx)}});function jx(e){switch(typeof e){case`string`:return e||void 0;case`number`:return String(e);default:return}}function Mx(e,t=!0,n=[]){return e.forEach(e=>{if(e!==null){if(typeof e!=`object`)(typeof e==`string`||typeof e==`number`)&&n.push((0,r.createTextVNode)(String(e)));else if(Array.isArray(e))Mx(e,t,n);else if(e.type===r.Fragment){if(e.children===null)return;Array.isArray(e.children)&&Mx(e.children,t,n)}else{if(e.type===r.Comment&&t)return;n.push(e)}}}),n}function Nx(e,t=`default`,n=void 0){let r=e[t];if(!r)return vh(`getFirstSlotVNode`,`slot[${t}] is empty`),null;let i=Mx(r(n));return i.length===1?i[0]:(vh(`getFirstSlotVNode`,`slot[${t}] should have exactly one child`),null)}function Px(e,t=[],n){let r={};return t.forEach(t=>{r[t]=e[t]}),Object.assign(r,n)}var Fx=/^(\d|\.)+$/,Ix=/(\d|\.)+/;function Lx(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e==`number`){let r=(e+n)*t;return r===0?`0`:`${r}px`}if(typeof e==`string`){if(Fx.test(e)){let i=(Number(e)+n)*t;return r?i===0?`0`:`${i}px`:`${i}`}{let r=Ix.exec(e);return r?e.replace(Ix,String((Number(r[0])+n)*t)):e}}return e}var Rx;function zx(){return Rx===void 0&&(Rx=navigator.userAgent.includes(`Node.js`)||navigator.userAgent.includes(`jsdom`)),Rx}var Bx={space:`6px`,spaceArrow:`10px`,arrowOffset:`10px`,arrowOffsetVertical:`10px`,arrowHeight:`6px`,padding:`8px 14px`};function Vx(e){let{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:i,fontSize:a,dividerColor:o}=e;return{...Bx,fontSize:a,borderRadius:i,color:n,dividerColor:o,textColor:r,boxShadow:t}}var Hx=Ig({name:`Popover`,common:ub,peers:{Scrollbar:pb},self:Vx}),Ux={top:`bottom`,bottom:`top`,left:`right`,right:`left`},Wx=`var(--n-arrow-height) * 1.414`,Gx=q([J(`popover`,`
319
+ `,[Kb({enterScale:`0.5`})])])]);function Jb(e){return Array.isArray(e)?e:[e]}var Yb={STOP:`STOP`};function Xb(e,t){let n=t(e);e.children!==void 0&&n!==Yb.STOP&&e.children.forEach(e=>Xb(e,t))}function Zb(e,t={}){let{preserveGroup:n=!1}=t,r=[],i=n?e=>{e.isLeaf||(r.push(e.key),a(e.children))}:e=>{e.isLeaf||(e.isGroup||r.push(e.key),a(e.children))};function a(e){e.forEach(i)}return a(e),r}function Qb(e,t){let{isLeaf:n}=e;return n===void 0?!t(e):n}function $b(e){return e.children}function ex(e){return e.key}function tx(){return!1}function nx(e,t){let{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function rx(e){return e.disabled===!0}function ix(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function ax(e,t){if(e.isLeaf===!0){let n=t(e);if(Array.isArray(n)&&n.length>0)return!0}return!1}function ox(e){return e==null?[]:Array.isArray(e)?e:e.checkedKeys??[]}function sx(e){return e==null||Array.isArray(e)?[]:e.indeterminateKeys??[]}function cx(e,t){let n=new Set(e);return t.forEach(e=>{n.has(e)||n.add(e)}),Array.from(n)}function lx(e,t){let n=new Set(e);return t.forEach(e=>{n.has(e)&&n.delete(e)}),Array.from(n)}function ux(e){return e?.type===`group`}function dx(e){let t=new Map;return e.forEach((e,n)=>{t.set(e.key,n)}),e=>t.get(e)??null}var fx=class extends Error{constructor(){super(),this.message=`SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded.`}};function px(e,t,n,r){return _x(t.concat(e),n,r,!1)}function mx(e,t){let n=new Set;return e.forEach(e=>{let r=t.treeNodeMap.get(e);if(r!==void 0){let e=r.parent;for(;e!==null&&!(e.disabled||n.has(e.key));)n.add(e.key),e=e.parent}}),n}function hx(e,t,n,r){let i=_x(t,n,r,!1),a=_x(e,n,r,!0),o=mx(e,n),s=[];return i.forEach(e=>{(a.has(e)||o.has(e))&&s.push(e)}),s.forEach(e=>i.delete(e)),i}function gx(e,t){let{checkedKeys:n,keysToCheck:r,keysToUncheck:i,indeterminateKeys:a,cascade:o,leafOnly:s,checkStrategy:c,allowNotLoaded:l}=e;if(!o)return r===void 0?i===void 0?{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)}:{checkedKeys:lx(n,i),indeterminateKeys:Array.from(a)}:{checkedKeys:cx(n,r),indeterminateKeys:Array.from(a)};let{levelTreeNodeMap:u}=t,d;d=i===void 0?r===void 0?_x(n,t,l,!1):px(r,n,t,l):hx(i,n,t,l);let f=c===`parent`,p=c===`child`||s,m=d,h=new Set,g=Math.max.apply(null,Array.from(u.keys()));for(let e=g;e>=0;--e){let t=e===0,n=u.get(e);for(let e of n){if(e.isLeaf)continue;let{key:n,shallowLoaded:r}=e;if(p&&r&&e.children.forEach(e=>{!e.disabled&&!e.isLeaf&&e.shallowLoaded&&m.has(e.key)&&m.delete(e.key)}),e.disabled||!r)continue;let i=!0,a=!1,o=!0;for(let t of e.children){let e=t.key;if(!t.disabled){if(o&&=!1,m.has(e))a=!0;else if(h.has(e)){a=!0,i=!1;break}else if(i=!1,a)break}}i&&!o?(f&&e.children.forEach(e=>{!e.disabled&&m.has(e.key)&&m.delete(e.key)}),m.add(n)):a&&h.add(n),t&&p&&m.has(n)&&m.delete(n)}}return{checkedKeys:Array.from(m),indeterminateKeys:Array.from(h)}}function _x(e,t,n,r){let{treeNodeMap:i,getChildren:a}=t,o=new Set,s=new Set(e);return e.forEach(e=>{let t=i.get(e);t!==void 0&&Xb(t,e=>{if(e.disabled)return Yb.STOP;let{key:t}=e;if(!o.has(t)&&(o.add(t),s.add(t),ix(e.rawNode,a))){if(r)return Yb.STOP;if(!n)throw new fx}})}),s}function vx(e,{includeGroup:t=!1,includeSelf:n=!0},r){let i=r.treeNodeMap,a=e==null?null:i.get(e)??null,o={keyPath:[],treeNodePath:[],treeNode:a};if(a?.ignored)return o.treeNode=null,o;for(;a;)!a.ignored&&(t||!a.isGroup)&&o.treeNodePath.push(a),a=a.parent;return o.treeNodePath.reverse(),n||o.treeNodePath.pop(),o.keyPath=o.treeNodePath.map(e=>e.key),o}function yx(e){if(e.length===0)return null;let t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function bx(e,t){let n=e.siblings,r=n.length,{index:i}=e;return t?n[(i+1)%r]:i===n.length-1?null:n[i+1]}function xx(e,t,{loop:n=!1,includeDisabled:r=!1}={}){let i=t===`prev`?Sx:bx,a={reverse:t===`prev`},o=!1,s=null;function c(t){if(t!==null){if(t===e){if(!o)o=!0;else if(!e.disabled&&!e.isGroup){s=e;return}}else if((!t.disabled||r)&&!t.ignored&&!t.isGroup){s=t;return}if(t.isGroup){let e=wx(t,a);e===null?c(i(t,n)):s=e}else{let e=i(t,!1);if(e!==null)c(e);else{let e=Cx(t);e?.isGroup?c(i(e,n)):n&&c(i(t,!0))}}}}return c(e),s}function Sx(e,t){let n=e.siblings,r=n.length,{index:i}=e;return t?n[(i-1+r)%r]:i===0?null:n[i-1]}function Cx(e){return e.parent}function wx(e,t={}){let{reverse:n=!1}=t,{children:r}=e;if(r){let{length:e}=r,i=n?e-1:0,a=n?-1:e,o=n?-1:1;for(let e=i;e!==a;e+=o){let n=r[e];if(!n.disabled&&!n.ignored){if(n.isGroup){let e=wx(n,t);if(e!==null)return e}else return n}}}return null}var Tx={getChild(){return this.ignored?null:wx(this)},getParent(){let{parent:e}=this;return e?.isGroup?e.getParent():e},getNext(e={}){return xx(this,`next`,e)},getPrev(e={}){return xx(this,`prev`,e)}};function Ex(e,t){let n=t?new Set(t):void 0,r=[];function i(e){e.forEach(e=>{r.push(e),!(e.isLeaf||!e.children||e.ignored)&&(e.isGroup||n===void 0||n.has(e.key))&&i(e.children)})}return i(e),r}function Dx(e,t){let n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}function Ox(e,t,n,r,i,a=null,o=0){let s=[];return e.forEach((c,l)=>{var u;process.env.NODE_ENV!==`production`&&ax(c,i)&&console.error(`[treemate]: node`,c,`is invalid`);let d=Object.create(r);if(d.rawNode=c,d.siblings=s,d.level=o,d.index=l,d.isFirstChild=l===0,d.isLastChild=l+1===e.length,d.parent=a,!d.ignored){let e=i(c);Array.isArray(e)&&(d.children=Ox(e,t,n,r,i,d,o+1))}s.push(d),t.set(d.key,d),n.has(o)||n.set(o,[]),(u=n.get(o))==null||u.push(d)}),s}function kx(e,t={}){let n=new Map,r=new Map,{getDisabled:i=rx,getIgnored:a=tx,getIsGroup:o=ux,getKey:s=ex}=t,c=t.getChildren??$b,l=t.ignoreEmptyChildren?e=>{let t=c(e);return Array.isArray(t)?t.length?t:null:t}:c,u=Ox(e,n,r,Object.assign({get key(){return s(this.rawNode)},get disabled(){return i(this.rawNode)},get isGroup(){return o(this.rawNode)},get isLeaf(){return Qb(this.rawNode,l)},get shallowLoaded(){return nx(this.rawNode,l)},get ignored(){return a(this.rawNode)},contains(e){return Dx(this,e)}},Tx),l);function d(e){if(e==null)return null;let t=n.get(e);return t&&!t.isGroup&&!t.ignored?t:null}function f(e){if(e==null)return null;let t=n.get(e);return t&&!t.ignored?t:null}function p(e,t){let n=f(e);return n?n.getPrev(t):null}function m(e,t){let n=f(e);return n?n.getNext(t):null}function h(e){let t=f(e);return t?t.getParent():null}function g(e){let t=f(e);return t?t.getChild():null}let _={treeNodes:u,treeNodeMap:n,levelTreeNodeMap:r,maxLevel:Math.max(...r.keys()),getChildren:l,getFlattenedNodes(e){return Ex(u,e)},getNode:d,getPrev:p,getNext:m,getParent:h,getChild:g,getFirstAvailableNode(){return yx(u)},getPath(e,t={}){return vx(e,t,_)},getCheckedKeys(e,t={}){let{cascade:n=!0,leafOnly:r=!1,checkStrategy:i=`all`,allowNotLoaded:a=!1}=t;return gx({checkedKeys:ox(e),indeterminateKeys:sx(e),cascade:n,leafOnly:r,checkStrategy:i,allowNotLoaded:a},_)},check(e,t,n={}){let{cascade:r=!0,leafOnly:i=!1,checkStrategy:a=`all`,allowNotLoaded:o=!1}=n;return gx({checkedKeys:ox(t),indeterminateKeys:sx(t),keysToCheck:e==null?[]:Jb(e),cascade:r,leafOnly:i,checkStrategy:a,allowNotLoaded:o},_)},uncheck(e,t,n={}){let{cascade:r=!0,leafOnly:i=!1,checkStrategy:a=`all`,allowNotLoaded:o=!1}=n;return gx({checkedKeys:ox(t),indeterminateKeys:sx(t),keysToUncheck:e==null?[]:Jb(e),cascade:r,leafOnly:i,checkStrategy:a,allowNotLoaded:o},_)},getNonLeafKeys(e={}){return Zb(u,e)}};return _}var Ax=[`tabindex`,`onFocusin`,`onFocusout`,`onKeyup`,`onKeydown`,`onMousedown`,`onMouseenter`,`onMouseleave`],jx=(0,r.defineComponent)({name:`InternalSelectMenu`,props:{...Rg.props,clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:`medium`},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,scrollbarProps:Object,onToggle:Function},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n,mergedComponentPropsRef:i}=Ch(e),a=Hy(`InternalSelectMenu`,n,t),o=Rg(`InternalSelectMenu`,`-internal-select-menu`,qb,Ib,e,(0,r.toRef)(e,`clsPrefix`)),s=(0,r.ref)(null),c=(0,r.ref)(null),l=(0,r.ref)(null),u=(0,r.computed)(()=>e.treeMate.getFlattenedNodes()),d=(0,r.computed)(()=>dx(u.value)),f=(0,r.ref)(null);function p(){let{treeMate:t}=e,n=null,{value:r}=e;r===null?n=t.getFirstAvailableNode():(n=e.multiple?t.getNode((r||[])[(r||[]).length-1]):t.getNode(r),(!n||n.disabled)&&(n=t.getFirstAvailableNode())),ne(n||null)}function m(){let{value:t}=f;t&&!e.treeMate.getNode(t.key)&&(f.value=null)}let h;(0,r.watch)(()=>e.show,t=>{t?h=(0,r.watch)(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?p():m(),(0,r.nextTick)(j)):m()},{immediate:!0}):h?.()},{immediate:!0}),(0,r.onBeforeUnmount)(()=>{h?.()});let g=(0,r.computed)(()=>Qg(o.value.self[sg(`optionHeight`,e.size)])),_=(0,r.computed)(()=>e_(o.value.self[sg(`padding`,e.size)])),v=(0,r.computed)(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),y=(0,r.computed)(()=>{let e=u.value;return e&&e.length===0}),b=(0,r.computed)(()=>i?.value?.Select?.renderEmpty);function x(t){let{onToggle:n}=e;n&&n(t)}function S(t){let{onScroll:n}=e;n&&n(t)}function C(e){l.value?.sync(),S(e)}function w(){l.value?.sync()}function T(){let{value:e}=f;return e||null}function E(e,t){t.disabled||ne(t,!1)}function D(e,t){t.disabled||x(t)}function O(t){Xg(t,`action`)||e.onKeyup?.(t)}function k(t){Xg(t,`action`)||e.onKeydown?.(t)}function A(t){e.onMousedown?.(t),!e.focusable&&t.preventDefault()}function ee(){let{value:e}=f;e&&ne(e.getNext({loop:!0}),!0)}function te(){let{value:e}=f;e&&ne(e.getPrev({loop:!0}),!0)}function ne(e,t=!1){f.value=e,t&&j()}function j(){let t=f.value;if(!t)return;let n=d.value(t.key);n!==null&&(e.virtualScroll?c.value?.scrollTo({index:n}):l.value?.scrollTo({index:n,elSize:g.value}))}function M(t){s.value?.contains(t.target)&&e.onFocus?.(t)}function re(t){s.value?.contains(t.relatedTarget)||e.onBlur?.(t)}(0,r.provide)(Um,{handleOptionMouseEnter:E,handleOptionClick:D,valueSetRef:v,pendingTmNodeRef:f,nodePropsRef:(0,r.toRef)(e,`nodeProps`),showCheckmarkRef:(0,r.toRef)(e,`showCheckmark`),multipleRef:(0,r.toRef)(e,`multiple`),valueRef:(0,r.toRef)(e,`value`),renderLabelRef:(0,r.toRef)(e,`renderLabel`),renderOptionRef:(0,r.toRef)(e,`renderOption`),labelFieldRef:(0,r.toRef)(e,`labelField`),valueFieldRef:(0,r.toRef)(e,`valueField`)}),(0,r.provide)(Wm,s),(0,r.onMounted)(()=>{let{value:e}=l;e&&e.sync()});let ie=(0,r.computed)(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{height:r,borderRadius:i,color:a,groupHeaderTextColor:s,actionDividerColor:c,optionTextColorPressed:l,optionTextColor:u,optionTextColorDisabled:d,optionTextColorActive:f,optionOpacityDisabled:p,optionCheckColor:m,actionTextColor:h,optionColorPending:g,optionColorActive:_,loadingColor:v,loadingSize:y,optionColorActivePending:b,[sg(`optionFontSize`,t)]:x,[sg(`optionHeight`,t)]:S,[sg(`optionPadding`,t)]:C}}=o.value;return{"--n-height":r,"--n-action-divider-color":c,"--n-action-text-color":h,"--n-bezier":n,"--n-border-radius":i,"--n-color":a,"--n-option-font-size":x,"--n-group-header-text-color":s,"--n-option-check-color":m,"--n-option-color-pending":g,"--n-option-color-active":_,"--n-option-color-active-pending":b,"--n-option-height":S,"--n-option-opacity-disabled":p,"--n-option-text-color":u,"--n-option-text-color-active":f,"--n-option-text-color-disabled":d,"--n-option-text-color-pressed":l,"--n-option-padding":C,"--n-option-padding-left":e_(C,`left`),"--n-option-padding-right":e_(C,`right`),"--n-loading-color":v,"--n-loading-size":y}}),{inlineThemeDisabled:ae}=e,N=ae?pg(`internal-select-menu`,(0,r.computed)(()=>e.size[0]),ie,e):void 0,P={selfRef:s,next:ee,prev:te,getPendingTmNode:T};return Ly(s,e.onResize),{mergedTheme:o,mergedClsPrefix:t,rtlEnabled:a,virtualListRef:c,scrollbarRef:l,itemSize:g,padding:_,flattenedNodes:u,empty:y,mergedRenderEmpty:b,virtualListContainer(){let{value:e}=c;return e?.listElRef},virtualListContent(){let{value:e}=c;return e?.itemsElRef},doScroll:S,handleFocusin:M,handleFocusout:re,handleKeyUp:O,handleKeyDown:k,handleMouseDown:A,handleVirtualListResize:w,handleVirtualListScroll:C,cssVars:ae?void 0:ie,themeClass:N?.themeClass,onRender:N?.onRender,...P}},render(){let{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:i,themeClass:a,onRender:o}=this;return o?.(),(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`selfRef`,tabindex:this.focusable?0:-1,class:Q([`${n}-base-select-menu`,`${n}-base-select-menu--${this.size}-size`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,a,this.multiple&&`${n}-base-select-menu--multiple`]),style:(0,r.normalizeStyle)(this.cssVars),onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},[Z(()=>By(e.header,e=>e&&((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${n}-base-select-menu__header`),"data-header":!0,key:`header`},[Z(()=>e)],2)))),this.loading?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:Q(`${n}-base-select-menu__loading`)},[((0,r.openBlock)(),(0,r.createBlock)(nb,{clsPrefix:n,strokeWidth:20},null,8,[`clsPrefix`]))],2)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[this.empty?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:1,class:Q(`${n}-base-select-menu__empty`),"data-empty":!0},[Z(()=>zy(e.empty,()=>[this.mergedRenderEmpty?.()||((0,r.openBlock)(),(0,r.createBlock)(Nb,{theme:i.peers.Empty,themeOverrides:i.peerOverrides.Empty,size:this.size},null,8,[`theme`,`themeOverrides`,`size`]))]))],2)):((0,r.openBlock)(),(0,r.createBlock)(Sb,(0,r.mergeProps)({key:0,ref:`scrollbarRef`,theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},this.scrollbarProps),{default:()=>t?((0,r.openBlock)(),(0,r.createBlock)(Ey,{key:1,ref:`virtualListRef`,class:Q(`${n}-virtual-list`),items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:e})=>e.isGroup?((0,r.openBlock)(),(0,r.createBlock)(Rb,{key:e.key,clsPrefix:n,tmNode:e},null,8,[`clsPrefix`,`tmNode`])):e.ignored?null:((0,r.openBlock)(),(0,r.createBlock)(Ub,{clsPrefix:n,key:e.key,tmNode:e},null,8,[`clsPrefix`,`tmNode`]))},1032,[`class`,`items`,`itemSize`,`paddingTop`,`paddingBottom`,`onResize`,`onScroll`])):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:4,class:Q(`${n}-base-select-menu-option-wrapper`),style:(0,r.normalizeStyle)({paddingTop:this.padding.top,paddingBottom:this.padding.bottom})},[Z(()=>this.flattenedNodes.map(e=>e.isGroup?((0,r.openBlock)(),(0,r.createBlock)(Rb,{key:e.key,clsPrefix:n,tmNode:e},null,8,[`clsPrefix`,`tmNode`])):((0,r.openBlock)(),(0,r.createBlock)(Ub,{clsPrefix:n,key:e.key,tmNode:e},null,8,[`clsPrefix`,`tmNode`]))))],6))},1040,[`theme`,`themeOverrides`,`scrollable`,`container`,`content`,`onScroll`]))],64)),Z(()=>By(e.action,e=>e&&[((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${n}-base-select-menu__action`),"data-action":!0,key:`action`},[Z(()=>e)],2)),((0,r.openBlock)(),(0,r.createBlock)(Uy,{onFocus:this.onTabOut,key:`focus-detector`},null,8,[`onFocus`]))]))],46,Ax)}});function Mx(e){switch(typeof e){case`string`:return e||void 0;case`number`:return String(e);default:return}}function Nx(e,t=!0,n=[]){return e.forEach(e=>{if(e!==null){if(typeof e!=`object`)(typeof e==`string`||typeof e==`number`)&&n.push((0,r.createTextVNode)(String(e)));else if(Array.isArray(e))Nx(e,t,n);else if(e.type===r.Fragment){if(e.children===null)return;Array.isArray(e.children)&&Nx(e.children,t,n)}else{if(e.type===r.Comment&&t)return;n.push(e)}}}),n}function Px(e,t=`default`,n=void 0){let r=e[t];if(!r)return yh(`getFirstSlotVNode`,`slot[${t}] is empty`),null;let i=Nx(r(n));return i.length===1?i[0]:(yh(`getFirstSlotVNode`,`slot[${t}] should have exactly one child`),null)}function Fx(e,t=[],n){let r={};return t.forEach(t=>{r[t]=e[t]}),Object.assign(r,n)}var Ix=/^(\d|\.)+$/,Lx=/(\d|\.)+/;function Rx(e,{c:t=1,offset:n=0,attachPx:r=!0}={}){if(typeof e==`number`){let r=(e+n)*t;return r===0?`0`:`${r}px`}if(typeof e==`string`){if(Ix.test(e)){let i=(Number(e)+n)*t;return r?i===0?`0`:`${i}px`:`${i}`}{let r=Lx.exec(e);return r?e.replace(Lx,String((Number(r[0])+n)*t)):e}}return e}var zx;function Bx(){return zx===void 0&&(zx=navigator.userAgent.includes(`Node.js`)||navigator.userAgent.includes(`jsdom`)),zx}var Vx={space:`6px`,spaceArrow:`10px`,arrowOffset:`10px`,arrowOffsetVertical:`10px`,arrowHeight:`6px`,padding:`8px 14px`};function Hx(e){let{boxShadow2:t,popoverColor:n,textColor2:r,borderRadius:i,fontSize:a,dividerColor:o}=e;return{...Vx,fontSize:a,borderRadius:i,color:n,dividerColor:o,textColor:r,boxShadow:t}}var Ux=Lg({name:`Popover`,common:db,peers:{Scrollbar:mb},self:Hx}),Wx={top:`bottom`,bottom:`top`,left:`right`,right:`left`},Gx=`var(--n-arrow-height) * 1.414`,Kx=q([J(`popover`,`
320
320
  transition:
321
321
  box-shadow .3s var(--n-bezier),
322
322
  background-color .3s var(--n-bezier),
@@ -329,10 +329,10 @@
329
329
  `,[q(`>`,[J(`scrollbar`,`
330
330
  height: inherit;
331
331
  max-height: inherit;
332
- `)]),ig(`raw`,`
332
+ `)]),ag(`raw`,`
333
333
  background-color: var(--n-color);
334
334
  border-radius: var(--n-border-radius);
335
- `,[ig(`scrollable`,[ig(`show-header-or-footer`,`padding: var(--n-padding);`)])]),Y(`header`,`
335
+ `,[ag(`scrollable`,[ag(`show-header-or-footer`,`padding: var(--n-padding);`)])]),Y(`header`,`
336
336
  padding: var(--n-padding);
337
337
  border-bottom: 1px solid var(--n-divider-color);
338
338
  transition: border-color .3s var(--n-bezier);
@@ -352,8 +352,8 @@
352
352
  transition: background-color .3s var(--n-bezier);
353
353
  position: absolute;
354
354
  display: block;
355
- width: calc(${Wx});
356
- height: calc(${Wx});
355
+ width: calc(${Gx});
356
+ height: calc(${Gx});
357
357
  box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12);
358
358
  transform: rotate(45deg);
359
359
  background-color: var(--n-color);
@@ -378,61 +378,61 @@
378
378
  color .3s var(--n-bezier),
379
379
  opacity .15s var(--n-bezier-ease-in),
380
380
  transform .15s var(--n-bezier-ease-in);
381
- `)]),qx(`top-start`,`
382
- top: calc(${Wx} / -2);
383
- left: calc(${Kx(`top-start`)} - var(--v-offset-left));
384
- `),qx(`top`,`
385
- top: calc(${Wx} / -2);
386
- transform: translateX(calc(${Wx} / -2)) rotate(45deg);
381
+ `)]),Jx(`top-start`,`
382
+ top: calc(${Gx} / -2);
383
+ left: calc(${qx(`top-start`)} - var(--v-offset-left));
384
+ `),Jx(`top`,`
385
+ top: calc(${Gx} / -2);
386
+ transform: translateX(calc(${Gx} / -2)) rotate(45deg);
387
387
  left: 50%;
388
- `),qx(`top-end`,`
389
- top: calc(${Wx} / -2);
390
- right: calc(${Kx(`top-end`)} + var(--v-offset-left));
391
- `),qx(`bottom-start`,`
392
- bottom: calc(${Wx} / -2);
393
- left: calc(${Kx(`bottom-start`)} - var(--v-offset-left));
394
- `),qx(`bottom`,`
395
- bottom: calc(${Wx} / -2);
396
- transform: translateX(calc(${Wx} / -2)) rotate(45deg);
388
+ `),Jx(`top-end`,`
389
+ top: calc(${Gx} / -2);
390
+ right: calc(${qx(`top-end`)} + var(--v-offset-left));
391
+ `),Jx(`bottom-start`,`
392
+ bottom: calc(${Gx} / -2);
393
+ left: calc(${qx(`bottom-start`)} - var(--v-offset-left));
394
+ `),Jx(`bottom`,`
395
+ bottom: calc(${Gx} / -2);
396
+ transform: translateX(calc(${Gx} / -2)) rotate(45deg);
397
397
  left: 50%;
398
- `),qx(`bottom-end`,`
399
- bottom: calc(${Wx} / -2);
400
- right: calc(${Kx(`bottom-end`)} + var(--v-offset-left));
401
- `),qx(`left-start`,`
402
- left: calc(${Wx} / -2);
403
- top: calc(${Kx(`left-start`)} - var(--v-offset-top));
404
- `),qx(`left`,`
405
- left: calc(${Wx} / -2);
406
- transform: translateY(calc(${Wx} / -2)) rotate(45deg);
398
+ `),Jx(`bottom-end`,`
399
+ bottom: calc(${Gx} / -2);
400
+ right: calc(${qx(`bottom-end`)} + var(--v-offset-left));
401
+ `),Jx(`left-start`,`
402
+ left: calc(${Gx} / -2);
403
+ top: calc(${qx(`left-start`)} - var(--v-offset-top));
404
+ `),Jx(`left`,`
405
+ left: calc(${Gx} / -2);
406
+ transform: translateY(calc(${Gx} / -2)) rotate(45deg);
407
407
  top: 50%;
408
- `),qx(`left-end`,`
409
- left: calc(${Wx} / -2);
410
- bottom: calc(${Kx(`left-end`)} + var(--v-offset-top));
411
- `),qx(`right-start`,`
412
- right: calc(${Wx} / -2);
413
- top: calc(${Kx(`right-start`)} - var(--v-offset-top));
414
- `),qx(`right`,`
415
- right: calc(${Wx} / -2);
416
- transform: translateY(calc(${Wx} / -2)) rotate(45deg);
408
+ `),Jx(`left-end`,`
409
+ left: calc(${Gx} / -2);
410
+ bottom: calc(${qx(`left-end`)} + var(--v-offset-top));
411
+ `),Jx(`right-start`,`
412
+ right: calc(${Gx} / -2);
413
+ top: calc(${qx(`right-start`)} - var(--v-offset-top));
414
+ `),Jx(`right`,`
415
+ right: calc(${Gx} / -2);
416
+ transform: translateY(calc(${Gx} / -2)) rotate(45deg);
417
417
  top: 50%;
418
- `),qx(`right-end`,`
419
- right: calc(${Wx} / -2);
420
- bottom: calc(${Kx(`right-end`)} + var(--v-offset-top));
421
- `),...(0,n.map)({top:[`right-start`,`left-start`],right:[`top-end`,`bottom-end`],bottom:[`right-end`,`left-end`],left:[`top-start`,`bottom-start`]},(e,t)=>{let n=[`right`,`left`].includes(t),r=n?`width`:`height`;return e.map(e=>{let i=e.split(`-`)[1]===`end`,a=`calc((${`var(--v-target-${r}, 0px)`} - ${Wx}) / 2)`,o=Kx(e);return q(`[v-placement="${e}"] >`,[J(`popover-shared`,[X(`center-arrow`,[J(`popover-arrow`,`${t}: calc(max(${a}, ${o}) ${i?`+`:`-`} var(--v-offset-${n?`left`:`top`}));`)])])])})})]);function Kx(e){return[`top`,`bottom`].includes(e.split(`-`)[0])?`var(--n-arrow-offset)`:`var(--n-arrow-offset-vertical)`}function qx(e,t){let n=e.split(`-`)[0],r=[`top`,`bottom`].includes(n)?`height: var(--n-space-arrow);`:`width: var(--n-space-arrow);`;return q(`[v-placement="${e}"] >`,[J(`popover-shared`,`
422
- margin-${Ux[n]}: var(--n-space);
418
+ `),Jx(`right-end`,`
419
+ right: calc(${Gx} / -2);
420
+ bottom: calc(${qx(`right-end`)} + var(--v-offset-top));
421
+ `),...(0,n.map)({top:[`right-start`,`left-start`],right:[`top-end`,`bottom-end`],bottom:[`right-end`,`left-end`],left:[`top-start`,`bottom-start`]},(e,t)=>{let n=[`right`,`left`].includes(t),r=n?`width`:`height`;return e.map(e=>{let i=e.split(`-`)[1]===`end`,a=`calc((${`var(--v-target-${r}, 0px)`} - ${Gx}) / 2)`,o=qx(e);return q(`[v-placement="${e}"] >`,[J(`popover-shared`,[X(`center-arrow`,[J(`popover-arrow`,`${t}: calc(max(${a}, ${o}) ${i?`+`:`-`} var(--v-offset-${n?`left`:`top`}));`)])])])})})]);function qx(e){return[`top`,`bottom`].includes(e.split(`-`)[0])?`var(--n-arrow-offset)`:`var(--n-arrow-offset-vertical)`}function Jx(e,t){let n=e.split(`-`)[0],r=[`top`,`bottom`].includes(n)?`height: var(--n-space-arrow);`:`width: var(--n-space-arrow);`;return q(`[v-placement="${e}"] >`,[J(`popover-shared`,`
422
+ margin-${Wx[n]}: var(--n-space);
423
423
  `,[X(`show-arrow`,`
424
- margin-${Ux[n]}: var(--n-space-arrow);
424
+ margin-${Wx[n]}: var(--n-space-arrow);
425
425
  `),X(`overlap`,`
426
426
  margin: 0;
427
- `),ag(`popover-arrow-wrapper`,`
427
+ `),og(`popover-arrow-wrapper`,`
428
428
  right: 0;
429
429
  left: 0;
430
430
  top: 0;
431
431
  bottom: 0;
432
432
  ${n}: 100%;
433
- ${Ux[n]}: auto;
433
+ ${Wx[n]}: auto;
434
434
  ${r}
435
- `,[J(`popover-arrow`,t)])])])}var Jx={...Lg.props,to:ph.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number};function Yx({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:i,clsPrefix:a}){return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`__popover-arrow__`,style:(0,r.normalizeStyle)(i),class:Q([`${a}-popover-arrow-wrapper`,n])},[(0,r.createElementVNode)(`div`,{class:Q([`${a}-popover-arrow`,e]),style:(0,r.normalizeStyle)(t)},null,6)],6)}var Xx=(0,r.defineComponent)({name:`PopoverBody`,inheritAttrs:!1,props:Jx,setup(e,{slots:t,attrs:n}){let{namespaceRef:i,mergedClsPrefixRef:a,inlineThemeDisabled:o,mergedRtlRef:s}=Sh(e),c=Lg(`Popover`,`-popover`,Gx,Hx,e,a),l=Vy(`Popover`,s,a),u=(0,r.ref)(null),d=(0,r.inject)(`NPopover`),f=(0,r.ref)(null),p=(0,r.ref)(e.show),m=(0,r.ref)(!1);(0,r.watchEffect)(()=>{let{show:t}=e;t&&!zx()&&!e.internalDeactivateImmediately&&(m.value=!0)});let h=(0,r.computed)(()=>{let{trigger:t,onClickoutside:n}=e,i=[],{positionManuallyRef:{value:a}}=d;return a||(t===`click`&&!n&&i.push([Y_,C,void 0,{capture:!0}]),t===`hover`&&i.push([q_,S])),n&&i.push([Y_,C,void 0,{capture:!0}]),(e.displayDirective===`show`||e.animated&&m.value)&&i.push([r.vShow,e.show]),i}),g=(0,r.computed)(()=>{let{common:{cubicBezierEaseInOut:e,cubicBezierEaseIn:t,cubicBezierEaseOut:n},self:{space:r,spaceArrow:i,padding:a,fontSize:o,textColor:s,dividerColor:l,color:u,boxShadow:d,borderRadius:f,arrowHeight:p,arrowOffset:m,arrowOffsetVertical:h}}=c.value;return{"--n-box-shadow":d,"--n-bezier":e,"--n-bezier-ease-in":t,"--n-bezier-ease-out":n,"--n-font-size":o,"--n-text-color":s,"--n-color":u,"--n-divider-color":l,"--n-border-radius":f,"--n-arrow-height":p,"--n-arrow-offset":m,"--n-arrow-offset-vertical":h,"--n-padding":a,"--n-space":r,"--n-space-arrow":i}}),_=(0,r.computed)(()=>{let t=e.width===`trigger`?void 0:Lx(e.width),n=[];t&&n.push({width:t});let{maxWidth:r,minWidth:i}=e;return r&&n.push({maxWidth:Lx(r)}),i&&n.push({maxWidth:Lx(i)}),o||n.push(g.value),n}),v=o?fg(`popover`,void 0,g,e):void 0;d.setBodyInstance({syncPosition:y}),(0,r.onBeforeUnmount)(()=>{d.setBodyInstance(null)}),(0,r.watch)((0,r.toRef)(e,`show`),t=>{e.animated||(t?p.value=!0:p.value=!1)});function y(){u.value?.syncPosition()}function b(t){e.trigger===`hover`&&e.keepAliveOnHover&&e.show&&d.handleMouseEnter(t)}function x(t){e.trigger===`hover`&&e.keepAliveOnHover&&d.handleMouseLeave(t)}function S(t){e.trigger===`hover`&&!w().contains(Xg(t))&&d.handleMouseMoveOutside(t)}function C(t){(e.trigger===`click`&&!w().contains(Xg(t))||e.onClickoutside)&&d.handleClickOutside(t)}function w(){return d.getTriggerElement()}(0,r.provide)(Km,f),(0,r.provide)(Wm,null),(0,r.provide)(Gm,null);function T(){if(v?.onRender(),!(e.displayDirective===`show`||e.show||e.animated&&m.value))return null;let i,o=d.internalRenderBodyRef.value,{value:s}=a;if(o)i=o([`${s}-popover-shared`,l?.value&&`${s}-popover--rtl`,v?.themeClass.value,e.overlap&&`${s}-popover-shared--overlap`,e.showArrow&&`${s}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${s}-popover-shared--center-arrow`],f,_.value,b,x);else{let{value:a}=d.extraClassRef,{internalTrapFocus:o}=e,u=!By(t.header)||!By(t.footer),p=()=>{let n=u?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>zy(t.header,t=>t?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:Q([`${s}-popover__header`,e.headerClass]),style:(0,r.normalizeStyle)(e.headerStyle)},[Z(()=>t)],6)):null)),Z(()=>zy(t.default,n=>n?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:3,class:Q([`${s}-popover__content`,e.contentClass]),style:(0,r.normalizeStyle)(e.contentStyle)},[Z(()=>t.default?.())],6)):null)),Z(()=>zy(t.footer,t=>t?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:4,class:Q([`${s}-popover__footer`,e.footerClass]),style:(0,r.normalizeStyle)(e.footerStyle)},[Z(()=>t)],6)):null))],64)):e.scrollable?t.default?.():((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:5,class:Q([`${s}-popover__content`,e.contentClass]),style:(0,r.normalizeStyle)(e.contentStyle)},[Z(()=>t.default?.())],6));return[e.scrollable?((0,r.openBlock)(),(0,r.createBlock)(Sb,{key:6,themeOverrides:c.value.peerOverrides.Scrollbar,theme:c.value.peers.Scrollbar,contentClass:u?void 0:`${s}-popover__content ${e.contentClass??``}`,contentStyle:u?void 0:e.contentStyle},{default:()=>n},1032,[`themeOverrides`,`theme`,`contentClass`,`contentStyle`])):n,e.showArrow?Yx({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:s}):null]};i=(0,r.h)(`div`,(0,r.mergeProps)({class:[`${s}-popover`,`${s}-popover-shared`,l?.value&&`${s}-popover--rtl`,v?.themeClass.value,a.map(e=>`${s}-${e}`),{[`${s}-popover--scrollable`]:e.scrollable,[`${s}-popover--show-header-or-footer`]:u,[`${s}-popover--raw`]:e.raw,[`${s}-popover-shared--overlap`]:e.overlap,[`${s}-popover-shared--show-arrow`]:e.showArrow,[`${s}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:f,style:_.value,onKeydown:d.handleKeydown,onMouseenter:b,onMouseleave:x},n),o?((0,r.openBlock)(),(0,r.createBlock)(Fy,{key:7,active:e.show,autoFocus:!0},{default:p},1032,[`active`])):p())}return(0,r.withDirectives)(i,h.value)}return{displayed:m,namespace:i,isMounted:d.isMountedRef,zIndex:d.zIndexRef,followerRef:u,adjustedTo:ph(e),followerEnabled:p,renderContentNode:T}},render(){return(0,r.openBlock)(),(0,r.createBlock)(yv,{ref:`followerRef`,zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width===`trigger`?`target`:void 0,teleportDisabled:this.adjustedTo===ph.tdkey},{_:1,default:Hg(()=>this.animated?((0,r.openBlock)(),(0,r.createBlock)(r.Transition,{key:8,name:`popover-transition`,appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{this.internalOnAfterLeave?.(),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode},1032,[`appear`,`onEnter`,`onAfterLeave`])):this.renderContentNode())},8,[`zIndex`,`show`,`enabled`,`to`,`x`,`y`,`flip`,`placement`,`containerClass`,`overlap`,`width`,`teleportDisabled`])}}),Zx={key:1,style:{position:`fixed`,top:0,right:0,bottom:0,left:0}},Qx=Object.keys(Jx),$x={focus:[`onFocus`,`onBlur`],click:[`onClick`],hover:[`onMouseenter`,`onMouseleave`],manual:[],nested:[`onFocus`,`onBlur`,`onMouseenter`,`onMouseleave`,`onClick`]};function eS(e,t,n){$x[t].forEach(t=>{e.props=e.props?Object.assign({},e.props):{};let r=e.props[t],i=n[t];r?e.props[t]=(...e)=>{r(...e),i(...e)}:e.props[t]=i})}var tS={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:`hover`},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:`top`},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:`if`},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:ph.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},nS={...Lg.props,...tS,internalOnAfterLeave:Function,internalRenderBody:Function},rS=(0,r.defineComponent)({name:`Popover`,inheritAttrs:!1,props:nS,slots:Object,__popover__:!0,setup(e){process.env.NODE_ENV!==`production`&&(0,r.watchEffect)(()=>{e.maxWidth!==void 0&&_h(`popover`,"`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&_h(`popover`,"`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&_h(`popover`,"`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&_h(`popover`,"`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&_h(`popover`,"`on-show` is deprecated, please use `on-update:show` instead.")});let t=ch(),n=(0,r.ref)(null),i=(0,r.computed)(()=>e.show),a=(0,r.ref)(e.defaultShow),o=sh(i,a),s=rh(()=>!e.disabled&&o.value),c=()=>{if(e.disabled)return!0;let{getDisabled:t}=e;return!!t?.()},l=()=>!c()&&o.value,u=lh(e,[`arrow`,`showArrow`]),d=(0,r.computed)(()=>!e.overlap&&u.value),f=null,p=(0,r.ref)(null),m=(0,r.ref)(null),h=rh(()=>e.x!==void 0&&e.y!==void 0);function g(t){let{"onUpdate:show":n,onUpdateShow:r,onShow:i,onHide:o}=e;a.value=t,n&&bh(n,t),r&&bh(r,t),t&&i&&bh(i,!0),t&&o&&bh(o,!1)}function _(){f&&f.syncPosition()}function v(){let{value:e}=p;e&&(window.clearTimeout(e),p.value=null)}function y(){let{value:e}=m;e&&(window.clearTimeout(e),m.value=null)}function b(){let t=c();if(e.trigger===`focus`&&!t){if(l())return;g(!0)}}function x(){let t=c();if(e.trigger===`focus`&&!t){if(!l())return;g(!1)}}function S(){let t=c();if(e.trigger===`hover`&&!t){if(y(),p.value!==null||l())return;let t=()=>{g(!0),p.value=null},{delay:n}=e;n===0?t():p.value=window.setTimeout(t,n)}}function C(){let t=c();if(e.trigger===`hover`&&!t){if(v(),m.value!==null||!l())return;let t=()=>{g(!1),m.value=null},{duration:n}=e;n===0?t():m.value=window.setTimeout(t,n)}}function w(){C()}function T(t){l()&&(e.trigger===`click`&&(v(),y(),g(!1)),e.onClickoutside?.(t))}function E(){e.trigger===`click`&&!c()&&(v(),y(),g(!l()))}function D(t){e.internalTrapFocus&&t.key===`Escape`&&(v(),y(),g(!1))}function O(e){a.value=e}function k(){return n.value?.targetRef}function A(e){f=e}return(0,r.provide)(`NPopover`,{getTriggerElement:k,handleKeydown:D,handleMouseEnter:S,handleMouseLeave:C,handleClickOutside:T,handleMouseMoveOutside:w,setBodyInstance:A,positionManuallyRef:h,isMountedRef:t,zIndexRef:(0,r.toRef)(e,`zIndex`),extraClassRef:(0,r.toRef)(e,`internalExtraClass`),internalRenderBodyRef:(0,r.toRef)(e,`internalRenderBody`)}),(0,r.watchEffect)(()=>{o.value&&c()&&g(!1)}),{binderInstRef:n,positionManually:h,mergedShowConsideringDisabledProp:s,uncontrolledShow:a,mergedShowArrow:d,getMergedShow:l,setShow:O,handleClick:E,handleMouseEnter:S,handleMouseLeave:C,handleFocus:b,handleBlur:x,syncPosition:_}},render(){let{positionManually:e,$slots:t}=this,n,i=!1;if(!e&&(n=Nx(t,`trigger`),n)){n=(0,r.cloneVNode)(n),n=n.type===r.Text?(0,r.h)(`span`,[n]):n;let t={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(n.type?.__popover__)i=!0,n.props||(n.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),n.props.internalSyncTargetWithParent=!0,n.props.internalInheritedEventHandlers?n.props.internalInheritedEventHandlers=[t,...n.props.internalInheritedEventHandlers]:n.props.internalInheritedEventHandlers=[t];else{let{internalInheritedEventHandlers:r}=this,i=[t,...r];eS(n,r?`nested`:e?`manual`:this.trigger,{onBlur:e=>{i.forEach(t=>{t.onBlur(e)})},onFocus:e=>{i.forEach(t=>{t.onFocus(e)})},onClick:e=>{i.forEach(t=>{t.onClick(e)})},onMouseenter:e=>{i.forEach(t=>{t.onMouseenter(e)})},onMouseleave:e=>{i.forEach(t=>{t.onMouseleave(e)})}})}}return(0,r.openBlock)(),(0,r.createBlock)(W_,{ref:`binderInstRef`,syncTarget:!i,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;let t=this.getMergedShow();return[this.internalTrapFocus&&t?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Zx)),[[$_,{enabled:t,zIndex:this.zIndex}]]):null,e?null:(0,r.h)(G_,null,{default:()=>n}),(0,r.h)(Xx,Px(this.$props,Qx,{...this.$attrs,showArrow:this.mergedShowArrow,show:t}),{default:()=>this.$slots.default?.(),header:()=>this.$slots.header?.(),footer:()=>this.$slots.footer?.()})]}},1032,[`syncTarget`,`syncTargetWithParent`])}});function iS(e){return e.replace(/#|\(|\)|,|\s|\./g,`_`)}function aS(e,t){let i=(0,r.defineComponent)({render(){return t()}});return(0,r.defineComponent)({name:(0,n.upperFirst)(e),setup(){let t=(0,r.inject)(xh,null)?.mergedIconsRef;return()=>{let n=t?.value?.[e];return n?n():((0,r.openBlock)(),(0,r.createBlock)(i,{key:1}))}}})}var oS=aS(`close`,()=>(()=>{let e=zg(`6b30a2290cd08d4`);return e[0]||=(0,r.createElementVNode)(`svg`,{viewBox:`0 0 12 12`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0},[(0,r.createElementVNode)(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},[(0,r.createElementVNode)(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},[(0,r.createElementVNode)(`path`,{d:`M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z`})])])],-1)})()),sS=J(`base-close`,`
435
+ `,[J(`popover-arrow`,t)])])])}var Yx={...Rg.props,to:mh.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number};function Xx({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:i,clsPrefix:a}){return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`__popover-arrow__`,style:(0,r.normalizeStyle)(i),class:Q([`${a}-popover-arrow-wrapper`,n])},[(0,r.createElementVNode)(`div`,{class:Q([`${a}-popover-arrow`,e]),style:(0,r.normalizeStyle)(t)},null,6)],6)}var Zx=(0,r.defineComponent)({name:`PopoverBody`,inheritAttrs:!1,props:Yx,setup(e,{slots:t,attrs:n}){let{namespaceRef:i,mergedClsPrefixRef:a,inlineThemeDisabled:o,mergedRtlRef:s}=Ch(e),c=Rg(`Popover`,`-popover`,Kx,Ux,e,a),l=Hy(`Popover`,s,a),u=(0,r.ref)(null),d=(0,r.inject)(`NPopover`),f=(0,r.ref)(null),p=(0,r.ref)(e.show),m=(0,r.ref)(!1);(0,r.watchEffect)(()=>{let{show:t}=e;t&&!Bx()&&!e.internalDeactivateImmediately&&(m.value=!0)});let h=(0,r.computed)(()=>{let{trigger:t,onClickoutside:n}=e,i=[],{positionManuallyRef:{value:a}}=d;return a||(t===`click`&&!n&&i.push([X_,C,void 0,{capture:!0}]),t===`hover`&&i.push([J_,S])),n&&i.push([X_,C,void 0,{capture:!0}]),(e.displayDirective===`show`||e.animated&&m.value)&&i.push([r.vShow,e.show]),i}),g=(0,r.computed)(()=>{let{common:{cubicBezierEaseInOut:e,cubicBezierEaseIn:t,cubicBezierEaseOut:n},self:{space:r,spaceArrow:i,padding:a,fontSize:o,textColor:s,dividerColor:l,color:u,boxShadow:d,borderRadius:f,arrowHeight:p,arrowOffset:m,arrowOffsetVertical:h}}=c.value;return{"--n-box-shadow":d,"--n-bezier":e,"--n-bezier-ease-in":t,"--n-bezier-ease-out":n,"--n-font-size":o,"--n-text-color":s,"--n-color":u,"--n-divider-color":l,"--n-border-radius":f,"--n-arrow-height":p,"--n-arrow-offset":m,"--n-arrow-offset-vertical":h,"--n-padding":a,"--n-space":r,"--n-space-arrow":i}}),_=(0,r.computed)(()=>{let t=e.width===`trigger`?void 0:Rx(e.width),n=[];t&&n.push({width:t});let{maxWidth:r,minWidth:i}=e;return r&&n.push({maxWidth:Rx(r)}),i&&n.push({maxWidth:Rx(i)}),o||n.push(g.value),n}),v=o?pg(`popover`,void 0,g,e):void 0;d.setBodyInstance({syncPosition:y}),(0,r.onBeforeUnmount)(()=>{d.setBodyInstance(null)}),(0,r.watch)((0,r.toRef)(e,`show`),t=>{e.animated||(t?p.value=!0:p.value=!1)});function y(){u.value?.syncPosition()}function b(t){e.trigger===`hover`&&e.keepAliveOnHover&&e.show&&d.handleMouseEnter(t)}function x(t){e.trigger===`hover`&&e.keepAliveOnHover&&d.handleMouseLeave(t)}function S(t){e.trigger===`hover`&&!w().contains(Zg(t))&&d.handleMouseMoveOutside(t)}function C(t){(e.trigger===`click`&&!w().contains(Zg(t))||e.onClickoutside)&&d.handleClickOutside(t)}function w(){return d.getTriggerElement()}(0,r.provide)(qm,f),(0,r.provide)(Gm,null),(0,r.provide)(Km,null);function T(){if(v?.onRender(),!(e.displayDirective===`show`||e.show||e.animated&&m.value))return null;let i,o=d.internalRenderBodyRef.value,{value:s}=a;if(o)i=o([`${s}-popover-shared`,l?.value&&`${s}-popover--rtl`,v?.themeClass.value,e.overlap&&`${s}-popover-shared--overlap`,e.showArrow&&`${s}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${s}-popover-shared--center-arrow`],f,_.value,b,x);else{let{value:a}=d.extraClassRef,{internalTrapFocus:o}=e,u=!Vy(t.header)||!Vy(t.footer),p=()=>{let n=u?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>By(t.header,t=>t?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:Q([`${s}-popover__header`,e.headerClass]),style:(0,r.normalizeStyle)(e.headerStyle)},[Z(()=>t)],6)):null)),Z(()=>By(t.default,n=>n?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:3,class:Q([`${s}-popover__content`,e.contentClass]),style:(0,r.normalizeStyle)(e.contentStyle)},[Z(()=>t.default?.())],6)):null)),Z(()=>By(t.footer,t=>t?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:4,class:Q([`${s}-popover__footer`,e.footerClass]),style:(0,r.normalizeStyle)(e.footerStyle)},[Z(()=>t)],6)):null))],64)):e.scrollable?t.default?.():((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:5,class:Q([`${s}-popover__content`,e.contentClass]),style:(0,r.normalizeStyle)(e.contentStyle)},[Z(()=>t.default?.())],6));return[e.scrollable?((0,r.openBlock)(),(0,r.createBlock)(Cb,{key:6,themeOverrides:c.value.peerOverrides.Scrollbar,theme:c.value.peers.Scrollbar,contentClass:u?void 0:`${s}-popover__content ${e.contentClass??``}`,contentStyle:u?void 0:e.contentStyle},{default:()=>n},1032,[`themeOverrides`,`theme`,`contentClass`,`contentStyle`])):n,e.showArrow?Xx({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:s}):null]};i=(0,r.h)(`div`,(0,r.mergeProps)({class:[`${s}-popover`,`${s}-popover-shared`,l?.value&&`${s}-popover--rtl`,v?.themeClass.value,a.map(e=>`${s}-${e}`),{[`${s}-popover--scrollable`]:e.scrollable,[`${s}-popover--show-header-or-footer`]:u,[`${s}-popover--raw`]:e.raw,[`${s}-popover-shared--overlap`]:e.overlap,[`${s}-popover-shared--show-arrow`]:e.showArrow,[`${s}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:f,style:_.value,onKeydown:d.handleKeydown,onMouseenter:b,onMouseleave:x},n),o?((0,r.openBlock)(),(0,r.createBlock)(Iy,{key:7,active:e.show,autoFocus:!0},{default:p},1032,[`active`])):p())}return(0,r.withDirectives)(i,h.value)}return{displayed:m,namespace:i,isMounted:d.isMountedRef,zIndex:d.zIndexRef,followerRef:u,adjustedTo:mh(e),followerEnabled:p,renderContentNode:T}},render(){return(0,r.openBlock)(),(0,r.createBlock)(bv,{ref:`followerRef`,zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width===`trigger`?`target`:void 0,teleportDisabled:this.adjustedTo===mh.tdkey},{_:1,default:Ug(()=>this.animated?((0,r.openBlock)(),(0,r.createBlock)(r.Transition,{key:8,name:`popover-transition`,appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{this.internalOnAfterLeave?.(),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode},1032,[`appear`,`onEnter`,`onAfterLeave`])):this.renderContentNode())},8,[`zIndex`,`show`,`enabled`,`to`,`x`,`y`,`flip`,`placement`,`containerClass`,`overlap`,`width`,`teleportDisabled`])}}),Qx={key:1,style:{position:`fixed`,top:0,right:0,bottom:0,left:0}},$x=Object.keys(Yx),eS={focus:[`onFocus`,`onBlur`],click:[`onClick`],hover:[`onMouseenter`,`onMouseleave`],manual:[],nested:[`onFocus`,`onBlur`,`onMouseenter`,`onMouseleave`,`onClick`]};function tS(e,t,n){eS[t].forEach(t=>{e.props=e.props?Object.assign({},e.props):{};let r=e.props[t],i=n[t];r?e.props[t]=(...e)=>{r(...e),i(...e)}:e.props[t]=i})}var nS={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:`hover`},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:`top`},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:`if`},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:mh.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},rS={...Rg.props,...nS,internalOnAfterLeave:Function,internalRenderBody:Function},iS=(0,r.defineComponent)({name:`Popover`,inheritAttrs:!1,props:rS,slots:Object,__popover__:!0,setup(e){process.env.NODE_ENV!==`production`&&(0,r.watchEffect)(()=>{e.maxWidth!==void 0&&vh(`popover`,"`max-width` is deprecated, please use `style` instead."),e.minWidth!==void 0&&vh(`popover`,"`min-width` is deprecated, please use `style` instead."),e.arrow!==void 0&&vh(`popover`,"`arrow` is deprecated, please use `showArrow` instead."),e.onHide!==void 0&&vh(`popover`,"`on-hide` is deprecated, please use `on-update:show` instead."),e.onShow!==void 0&&vh(`popover`,"`on-show` is deprecated, please use `on-update:show` instead.")});let t=lh(),n=(0,r.ref)(null),i=(0,r.computed)(()=>e.show),a=(0,r.ref)(e.defaultShow),o=ch(i,a),s=ih(()=>!e.disabled&&o.value),c=()=>{if(e.disabled)return!0;let{getDisabled:t}=e;return!!t?.()},l=()=>!c()&&o.value,u=uh(e,[`arrow`,`showArrow`]),d=(0,r.computed)(()=>!e.overlap&&u.value),f=null,p=(0,r.ref)(null),m=(0,r.ref)(null),h=ih(()=>e.x!==void 0&&e.y!==void 0);function g(t){let{"onUpdate:show":n,onUpdateShow:r,onShow:i,onHide:o}=e;a.value=t,n&&xh(n,t),r&&xh(r,t),t&&i&&xh(i,!0),t&&o&&xh(o,!1)}function _(){f&&f.syncPosition()}function v(){let{value:e}=p;e&&(window.clearTimeout(e),p.value=null)}function y(){let{value:e}=m;e&&(window.clearTimeout(e),m.value=null)}function b(){let t=c();if(e.trigger===`focus`&&!t){if(l())return;g(!0)}}function x(){let t=c();if(e.trigger===`focus`&&!t){if(!l())return;g(!1)}}function S(){let t=c();if(e.trigger===`hover`&&!t){if(y(),p.value!==null||l())return;let t=()=>{g(!0),p.value=null},{delay:n}=e;n===0?t():p.value=window.setTimeout(t,n)}}function C(){let t=c();if(e.trigger===`hover`&&!t){if(v(),m.value!==null||!l())return;let t=()=>{g(!1),m.value=null},{duration:n}=e;n===0?t():m.value=window.setTimeout(t,n)}}function w(){C()}function T(t){l()&&(e.trigger===`click`&&(v(),y(),g(!1)),e.onClickoutside?.(t))}function E(){e.trigger===`click`&&!c()&&(v(),y(),g(!l()))}function D(t){e.internalTrapFocus&&t.key===`Escape`&&(v(),y(),g(!1))}function O(e){a.value=e}function k(){return n.value?.targetRef}function A(e){f=e}return(0,r.provide)(`NPopover`,{getTriggerElement:k,handleKeydown:D,handleMouseEnter:S,handleMouseLeave:C,handleClickOutside:T,handleMouseMoveOutside:w,setBodyInstance:A,positionManuallyRef:h,isMountedRef:t,zIndexRef:(0,r.toRef)(e,`zIndex`),extraClassRef:(0,r.toRef)(e,`internalExtraClass`),internalRenderBodyRef:(0,r.toRef)(e,`internalRenderBody`)}),(0,r.watchEffect)(()=>{o.value&&c()&&g(!1)}),{binderInstRef:n,positionManually:h,mergedShowConsideringDisabledProp:s,uncontrolledShow:a,mergedShowArrow:d,getMergedShow:l,setShow:O,handleClick:E,handleMouseEnter:S,handleMouseLeave:C,handleFocus:b,handleBlur:x,syncPosition:_}},render(){let{positionManually:e,$slots:t}=this,n,i=!1;if(!e&&(n=Px(t,`trigger`),n)){n=(0,r.cloneVNode)(n),n=n.type===r.Text?(0,r.h)(`span`,[n]):n;let t={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(n.type?.__popover__)i=!0,n.props||(n.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),n.props.internalSyncTargetWithParent=!0,n.props.internalInheritedEventHandlers?n.props.internalInheritedEventHandlers=[t,...n.props.internalInheritedEventHandlers]:n.props.internalInheritedEventHandlers=[t];else{let{internalInheritedEventHandlers:r}=this,i=[t,...r];tS(n,r?`nested`:e?`manual`:this.trigger,{onBlur:e=>{i.forEach(t=>{t.onBlur(e)})},onFocus:e=>{i.forEach(t=>{t.onFocus(e)})},onClick:e=>{i.forEach(t=>{t.onClick(e)})},onMouseenter:e=>{i.forEach(t=>{t.onMouseenter(e)})},onMouseleave:e=>{i.forEach(t=>{t.onMouseleave(e)})}})}}return(0,r.openBlock)(),(0,r.createBlock)(G_,{ref:`binderInstRef`,syncTarget:!i,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;let t=this.getMergedShow();return[this.internalTrapFocus&&t?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Qx)),[[ev,{enabled:t,zIndex:this.zIndex}]]):null,e?null:(0,r.h)(K_,null,{default:()=>n}),(0,r.h)(Zx,Fx(this.$props,$x,{...this.$attrs,showArrow:this.mergedShowArrow,show:t}),{default:()=>this.$slots.default?.(),header:()=>this.$slots.header?.(),footer:()=>this.$slots.footer?.()})]}},1032,[`syncTarget`,`syncTargetWithParent`])}});function aS(e){return e.replace(/#|\(|\)|,|\s|\./g,`_`)}function oS(e,t){let i=(0,r.defineComponent)({render(){return t()}});return(0,r.defineComponent)({name:(0,n.upperFirst)(e),setup(){let t=(0,r.inject)(Sh,null)?.mergedIconsRef;return()=>{let n=t?.value?.[e];return n?n():((0,r.openBlock)(),(0,r.createBlock)(i,{key:1}))}}})}var sS=oS(`close`,()=>(()=>{let e=Bg(`6b30a2290cd08d4`);return e[0]||=(0,r.createElementVNode)(`svg`,{viewBox:`0 0 12 12`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`,"aria-hidden":!0},[(0,r.createElementVNode)(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},[(0,r.createElementVNode)(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},[(0,r.createElementVNode)(`path`,{d:`M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z`})])])],-1)})()),cS=J(`base-close`,`
436
436
  display: flex;
437
437
  align-items: center;
438
438
  justify-content: center;
@@ -460,7 +460,7 @@
460
460
  transform: translateY(-50%) translateX(-50%);
461
461
  transition: inherit;
462
462
  border-radius: inherit;
463
- `),ig(`disabled`,[q(`&:hover`,`
463
+ `),ag(`disabled`,[q(`&:hover`,`
464
464
  color: var(--n-close-icon-color-hover);
465
465
  `),q(`&:hover::before`,`
466
466
  background-color: var(--n-close-color-hover);
@@ -476,7 +476,7 @@
476
476
  background-color: transparent;
477
477
  `),X(`round`,[q(`&::before`,`
478
478
  border-radius: 50%;
479
- `)])]),cS=(0,r.defineComponent)({name:`BaseClose`,props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Uy(`-base-close`,sS,(0,r.toRef)(e,`clsPrefix`)),()=>{let{clsPrefix:t,disabled:n,absolute:i,round:a,isButtonTag:o}=e,s=o?`button`:`div`;return(()=>{let c=zg(`b5bdc9fe09f5ae00`);return(0,r.openBlock)(),(0,r.createBlock)(s,{type:o?`button`:void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":`close`,role:o?void 0:`button`,disabled:n,class:Q([`${t}-base-close`,i&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,a&&`${t}-base-close--round`]),onMousedown:c[0]||=t=>{e.focusable||t.preventDefault()},onClick:e.onClick},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(),(0,r.createBlock)(Tb,{clsPrefix:t},{default:()=>((0,r.openBlock)(),(0,r.createBlock)(oS))},1032,[`clsPrefix`]))]),_:2},1032,[`type`,`tabindex`,`aria-disabled`,`role`,`disabled`,`class`,`onClick`])})()}}}),lS={closeIconSizeTiny:`12px`,closeIconSizeSmall:`12px`,closeIconSizeMedium:`14px`,closeIconSizeLarge:`14px`,closeSizeTiny:`16px`,closeSizeSmall:`16px`,closeSizeMedium:`18px`,closeSizeLarge:`18px`,padding:`0 7px`,closeMargin:`0 0 0 4px`};function uS(e){let{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:i,infoColor:a,successColor:o,warningColor:s,errorColor:c,baseColor:l,borderColor:u,opacityDisabled:d,tagColor:f,closeIconColor:p,closeIconColorHover:m,closeIconColorPressed:h,borderRadiusSmall:g,fontSizeMini:_,fontSizeTiny:v,fontSizeSmall:y,fontSizeMedium:b,heightMini:x,heightTiny:S,heightSmall:C,heightMedium:w,closeColorHover:T,closeColorPressed:E,buttonColor2Hover:D,buttonColor2Pressed:O,fontWeightStrong:k}=e;return{...lS,closeBorderRadius:g,heightTiny:x,heightSmall:S,heightMedium:C,heightLarge:w,borderRadius:g,opacityDisabled:d,fontSizeTiny:_,fontSizeSmall:v,fontSizeMedium:y,fontSizeLarge:b,fontWeightStrong:k,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:l,colorCheckable:`#0000`,colorHoverCheckable:D,colorPressedCheckable:O,colorChecked:i,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:t,color:f,colorBordered:`rgb(250, 250, 252)`,closeIconColor:p,closeIconColorHover:m,closeIconColorPressed:h,closeColorHover:T,closeColorPressed:E,borderPrimary:`1px solid ${D_(i,{alpha:.3})}`,textColorPrimary:i,colorPrimary:D_(i,{alpha:.12}),colorBorderedPrimary:D_(i,{alpha:.1}),closeIconColorPrimary:i,closeIconColorHoverPrimary:i,closeIconColorPressedPrimary:i,closeColorHoverPrimary:D_(i,{alpha:.12}),closeColorPressedPrimary:D_(i,{alpha:.18}),borderInfo:`1px solid ${D_(a,{alpha:.3})}`,textColorInfo:a,colorInfo:D_(a,{alpha:.12}),colorBorderedInfo:D_(a,{alpha:.1}),closeIconColorInfo:a,closeIconColorHoverInfo:a,closeIconColorPressedInfo:a,closeColorHoverInfo:D_(a,{alpha:.12}),closeColorPressedInfo:D_(a,{alpha:.18}),borderSuccess:`1px solid ${D_(o,{alpha:.3})}`,textColorSuccess:o,colorSuccess:D_(o,{alpha:.12}),colorBorderedSuccess:D_(o,{alpha:.1}),closeIconColorSuccess:o,closeIconColorHoverSuccess:o,closeIconColorPressedSuccess:o,closeColorHoverSuccess:D_(o,{alpha:.12}),closeColorPressedSuccess:D_(o,{alpha:.18}),borderWarning:`1px solid ${D_(s,{alpha:.35})}`,textColorWarning:s,colorWarning:D_(s,{alpha:.15}),colorBorderedWarning:D_(s,{alpha:.12}),closeIconColorWarning:s,closeIconColorHoverWarning:s,closeIconColorPressedWarning:s,closeColorHoverWarning:D_(s,{alpha:.12}),closeColorPressedWarning:D_(s,{alpha:.18}),borderError:`1px solid ${D_(c,{alpha:.23})}`,textColorError:c,colorError:D_(c,{alpha:.1}),colorBorderedError:D_(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:D_(c,{alpha:.12}),closeColorPressedError:D_(c,{alpha:.18})}}var dS={name:`Tag`,common:ub,self:uS},fS={color:Object,type:{type:String,default:`default`},round:Boolean,size:String,closable:Boolean,disabled:{type:Boolean,default:void 0}},pS=J(`tag`,`
479
+ `)])]),lS=(0,r.defineComponent)({name:`BaseClose`,props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Wy(`-base-close`,cS,(0,r.toRef)(e,`clsPrefix`)),()=>{let{clsPrefix:t,disabled:n,absolute:i,round:a,isButtonTag:o}=e,s=o?`button`:`div`;return(()=>{let c=Bg(`b5bdc9fe09f5ae00`);return(0,r.openBlock)(),(0,r.createBlock)(s,{type:o?`button`:void 0,tabindex:n||!e.focusable?-1:0,"aria-disabled":n,"aria-label":`close`,role:o?void 0:`button`,disabled:n,class:Q([`${t}-base-close`,i&&`${t}-base-close--absolute`,n&&`${t}-base-close--disabled`,a&&`${t}-base-close--round`]),onMousedown:c[0]||=t=>{e.focusable||t.preventDefault()},onClick:e.onClick},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(),(0,r.createBlock)(Eb,{clsPrefix:t},{default:()=>((0,r.openBlock)(),(0,r.createBlock)(sS))},1032,[`clsPrefix`]))]),_:2},1032,[`type`,`tabindex`,`aria-disabled`,`role`,`disabled`,`class`,`onClick`])})()}}}),uS={closeIconSizeTiny:`12px`,closeIconSizeSmall:`12px`,closeIconSizeMedium:`14px`,closeIconSizeLarge:`14px`,closeSizeTiny:`16px`,closeSizeSmall:`16px`,closeSizeMedium:`18px`,closeSizeLarge:`18px`,padding:`0 7px`,closeMargin:`0 0 0 4px`};function dS(e){let{textColor2:t,primaryColorHover:n,primaryColorPressed:r,primaryColor:i,infoColor:a,successColor:o,warningColor:s,errorColor:c,baseColor:l,borderColor:u,opacityDisabled:d,tagColor:f,closeIconColor:p,closeIconColorHover:m,closeIconColorPressed:h,borderRadiusSmall:g,fontSizeMini:_,fontSizeTiny:v,fontSizeSmall:y,fontSizeMedium:b,heightMini:x,heightTiny:S,heightSmall:C,heightMedium:w,closeColorHover:T,closeColorPressed:E,buttonColor2Hover:D,buttonColor2Pressed:O,fontWeightStrong:k}=e;return{...uS,closeBorderRadius:g,heightTiny:x,heightSmall:S,heightMedium:C,heightLarge:w,borderRadius:g,opacityDisabled:d,fontSizeTiny:_,fontSizeSmall:v,fontSizeMedium:y,fontSizeLarge:b,fontWeightStrong:k,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:l,colorCheckable:`#0000`,colorHoverCheckable:D,colorPressedCheckable:O,colorChecked:i,colorCheckedHover:n,colorCheckedPressed:r,border:`1px solid ${u}`,textColor:t,color:f,colorBordered:`rgb(250, 250, 252)`,closeIconColor:p,closeIconColorHover:m,closeIconColorPressed:h,closeColorHover:T,closeColorPressed:E,borderPrimary:`1px solid ${O_(i,{alpha:.3})}`,textColorPrimary:i,colorPrimary:O_(i,{alpha:.12}),colorBorderedPrimary:O_(i,{alpha:.1}),closeIconColorPrimary:i,closeIconColorHoverPrimary:i,closeIconColorPressedPrimary:i,closeColorHoverPrimary:O_(i,{alpha:.12}),closeColorPressedPrimary:O_(i,{alpha:.18}),borderInfo:`1px solid ${O_(a,{alpha:.3})}`,textColorInfo:a,colorInfo:O_(a,{alpha:.12}),colorBorderedInfo:O_(a,{alpha:.1}),closeIconColorInfo:a,closeIconColorHoverInfo:a,closeIconColorPressedInfo:a,closeColorHoverInfo:O_(a,{alpha:.12}),closeColorPressedInfo:O_(a,{alpha:.18}),borderSuccess:`1px solid ${O_(o,{alpha:.3})}`,textColorSuccess:o,colorSuccess:O_(o,{alpha:.12}),colorBorderedSuccess:O_(o,{alpha:.1}),closeIconColorSuccess:o,closeIconColorHoverSuccess:o,closeIconColorPressedSuccess:o,closeColorHoverSuccess:O_(o,{alpha:.12}),closeColorPressedSuccess:O_(o,{alpha:.18}),borderWarning:`1px solid ${O_(s,{alpha:.35})}`,textColorWarning:s,colorWarning:O_(s,{alpha:.15}),colorBorderedWarning:O_(s,{alpha:.12}),closeIconColorWarning:s,closeIconColorHoverWarning:s,closeIconColorPressedWarning:s,closeColorHoverWarning:O_(s,{alpha:.12}),closeColorPressedWarning:O_(s,{alpha:.18}),borderError:`1px solid ${O_(c,{alpha:.23})}`,textColorError:c,colorError:O_(c,{alpha:.1}),colorBorderedError:O_(c,{alpha:.08}),closeIconColorError:c,closeIconColorHoverError:c,closeIconColorPressedError:c,closeColorHoverError:O_(c,{alpha:.12}),closeColorPressedError:O_(c,{alpha:.18})}}var fS={name:`Tag`,common:db,self:dS},pS={color:Object,type:{type:String,default:`default`},round:Boolean,size:String,closable:Boolean,disabled:{type:Boolean,default:void 0}},mS=J(`tag`,`
480
480
  --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left);
481
481
  white-space: nowrap;
482
482
  position: relative;
@@ -543,10 +543,10 @@
543
543
  box-shadow: none;
544
544
  color: var(--n-text-color-checkable);
545
545
  background-color: var(--n-color-checkable);
546
- `,[ig(`disabled`,[q(`&:hover`,`background-color: var(--n-color-hover-checkable);`,[ig(`checked`,`color: var(--n-text-color-hover-checkable);`)]),q(`&:active`,`background-color: var(--n-color-pressed-checkable);`,[ig(`checked`,`color: var(--n-text-color-pressed-checkable);`)])]),X(`checked`,`
546
+ `,[ag(`disabled`,[q(`&:hover`,`background-color: var(--n-color-hover-checkable);`,[ag(`checked`,`color: var(--n-text-color-hover-checkable);`)]),q(`&:active`,`background-color: var(--n-color-pressed-checkable);`,[ag(`checked`,`color: var(--n-text-color-pressed-checkable);`)])]),X(`checked`,`
547
547
  color: var(--n-text-color-checked);
548
548
  background-color: var(--n-color-checked);
549
- `,[ig(`disabled`,[q(`&:hover`,`background-color: var(--n-color-checked-hover);`),q(`&:active`,`background-color: var(--n-color-checked-pressed);`)])])])]),mS=[`onClick`,`onMouseenter`,`onMouseleave`],hS={...Lg.props,...fS,bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function},gS=Vm(`n-tag`),_S=(0,r.defineComponent)({name:`Tag`,props:hS,slots:Object,setup(e){process.env.NODE_ENV!==`production`&&(0,r.watchEffect)(()=>{e.onCheckedChange!==void 0&&_h(`tag`,"`on-checked-change` is deprecated, please use `on-update:checked` instead")});let t=(0,r.ref)(null),{mergedBorderedRef:n,mergedClsPrefixRef:i,inlineThemeDisabled:a,mergedRtlRef:o,mergedComponentPropsRef:s}=Sh(e),c=(0,r.computed)(()=>e.size||s?.value?.Tag?.size||`medium`),l=Lg(`Tag`,`-tag`,pS,dS,e,i);(0,r.provide)(gS,{roundRef:(0,r.toRef)(e,`round`)});function u(){if(!e.disabled&&e.checkable){let{checked:t,onCheckedChange:n,onUpdateChecked:r,"onUpdate:checked":i}=e;r&&r(!t),i&&i(!t),n&&n(!t)}}function d(t){if(e.triggerClickOnClose||t.stopPropagation(),!e.disabled){let{onClose:n}=e;n&&bh(n,t)}}let f={setTextContent(e){let{value:n}=t;n&&(n.textContent=e)}},p=Vy(`Tag`,o,i),m=(0,r.computed)(()=>{let{type:t,color:{color:r,textColor:i}={}}=e,a=c.value,{common:{cubicBezierEaseInOut:o},self:{padding:s,closeMargin:u,borderRadius:d,opacityDisabled:f,textColorCheckable:p,textColorHoverCheckable:m,textColorPressedCheckable:h,textColorChecked:g,colorCheckable:_,colorHoverCheckable:v,colorPressedCheckable:y,colorChecked:b,colorCheckedHover:x,colorCheckedPressed:S,closeBorderRadius:C,fontWeightStrong:w,[og(`colorBordered`,t)]:T,[og(`closeSize`,a)]:E,[og(`closeIconSize`,a)]:D,[og(`fontSize`,a)]:O,[og(`height`,a)]:k,[og(`color`,t)]:A,[og(`textColor`,t)]:ee,[og(`border`,t)]:j,[og(`closeIconColor`,t)]:te,[og(`closeIconColorHover`,t)]:ne,[og(`closeIconColorPressed`,t)]:M,[og(`closeColorHover`,t)]:re,[og(`closeColorPressed`,t)]:ie}}=l.value,N=$g(u);return{"--n-font-weight-strong":w,"--n-avatar-size-override":`calc(${k} - 8px)`,"--n-bezier":o,"--n-border-radius":d,"--n-border":j,"--n-close-icon-size":D,"--n-close-color-pressed":ie,"--n-close-color-hover":re,"--n-close-border-radius":C,"--n-close-icon-color":te,"--n-close-icon-color-hover":ne,"--n-close-icon-color-pressed":M,"--n-close-icon-color-disabled":te,"--n-close-margin-top":N.top,"--n-close-margin-right":N.right,"--n-close-margin-bottom":N.bottom,"--n-close-margin-left":N.left,"--n-close-size":E,"--n-color":r||(n.value?T:A),"--n-color-checkable":_,"--n-color-checked":b,"--n-color-checked-hover":x,"--n-color-checked-pressed":S,"--n-color-hover-checkable":v,"--n-color-pressed-checkable":y,"--n-font-size":O,"--n-height":k,"--n-opacity-disabled":f,"--n-padding":s,"--n-text-color":i||ee,"--n-text-color-checkable":p,"--n-text-color-checked":g,"--n-text-color-hover-checkable":m,"--n-text-color-pressed-checkable":h}}),h=a?fg(`tag`,(0,r.computed)(()=>{let t=``,{type:r,color:{color:i,textColor:a}={}}=e;return t+=r[0],t+=c.value[0],i&&(t+=`a${iS(i)}`),a&&(t+=`b${iS(a)}`),n.value&&(t+=`c`),t}),m,e):void 0;return{...f,rtlEnabled:p,mergedClsPrefix:i,contentRef:t,mergedBordered:n,handleClick:u,handleCloseClick:d,cssVars:a?void 0:m,themeClass:h?.themeClass,onRender:h?.onRender}},render(){let{mergedClsPrefix:e,rtlEnabled:t,closable:n,color:{borderColor:i}={},round:a,onRender:o,$slots:s}=this;o?.();let c=zy(s.avatar,t=>t&&((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${e}-tag__avatar`)},[Z(()=>t)],2))),l=zy(s.icon,t=>t&&((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${e}-tag__icon`)},[Z(()=>t)],2)));return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q([`${e}-tag`,this.themeClass,{[`${e}-tag--rtl`]:t,[`${e}-tag--strong`]:this.strong,[`${e}-tag--disabled`]:this.disabled,[`${e}-tag--checkable`]:this.checkable,[`${e}-tag--checked`]:this.checkable&&this.checked,[`${e}-tag--round`]:a,[`${e}-tag--avatar`]:c,[`${e}-tag--icon`]:l,[`${e}-tag--closable`]:n}]),style:(0,r.normalizeStyle)(this.cssVars),onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},[Z(()=>l||c),(0,r.createElementVNode)(`span`,{class:Q(`${e}-tag__content`),ref:`contentRef`},[Z(()=>this.$slots.default?.())],2),!this.checkable&&n?((0,r.openBlock)(),(0,r.createBlock)(cS,{key:0,clsPrefix:e,class:Q(`${e}-tag__close`),disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0},null,8,[`clsPrefix`,`class`,`disabled`,`onClick`,`focusable`,`round`,`isButtonTag`])):Z(()=>null),!this.checkable&&this.mergedBordered?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:Q(`${e}-tag__border`),style:(0,r.normalizeStyle)({borderColor:i})},null,6)):Z(()=>null)],46,mS)}}),vS=(0,r.defineComponent)({name:`ChevronDown`,render(){return(()=>{let e=zg(`ae90ecf811a811ac`);return e[0]||=(0,r.createElementVNode)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,r.createElementVNode)(`path`,{d:`M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z`,fill:`currentColor`})],-1)})()}}),yS=aS(`clear`,()=>(()=>{let e=zg(`c93f8499adf26ca3`);return e[0]||=(0,r.createElementVNode)(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},[(0,r.createElementVNode)(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},[(0,r.createElementVNode)(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},[(0,r.createElementVNode)(`path`,{d:`M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z`})])])],-1)})()),bS=J(`base-clear`,`
549
+ `,[ag(`disabled`,[q(`&:hover`,`background-color: var(--n-color-checked-hover);`),q(`&:active`,`background-color: var(--n-color-checked-pressed);`)])])])]),hS=[`onClick`,`onMouseenter`,`onMouseleave`],gS={...Rg.props,...pS,bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function},_S=Hm(`n-tag`),vS=(0,r.defineComponent)({name:`Tag`,props:gS,slots:Object,setup(e){process.env.NODE_ENV!==`production`&&(0,r.watchEffect)(()=>{e.onCheckedChange!==void 0&&vh(`tag`,"`on-checked-change` is deprecated, please use `on-update:checked` instead")});let t=(0,r.ref)(null),{mergedBorderedRef:n,mergedClsPrefixRef:i,inlineThemeDisabled:a,mergedRtlRef:o,mergedComponentPropsRef:s}=Ch(e),c=(0,r.computed)(()=>e.size||s?.value?.Tag?.size||`medium`),l=Rg(`Tag`,`-tag`,mS,fS,e,i);(0,r.provide)(_S,{roundRef:(0,r.toRef)(e,`round`)});function u(){if(!e.disabled&&e.checkable){let{checked:t,onCheckedChange:n,onUpdateChecked:r,"onUpdate:checked":i}=e;r&&r(!t),i&&i(!t),n&&n(!t)}}function d(t){if(e.triggerClickOnClose||t.stopPropagation(),!e.disabled){let{onClose:n}=e;n&&xh(n,t)}}let f={setTextContent(e){let{value:n}=t;n&&(n.textContent=e)}},p=Hy(`Tag`,o,i),m=(0,r.computed)(()=>{let{type:t,color:{color:r,textColor:i}={}}=e,a=c.value,{common:{cubicBezierEaseInOut:o},self:{padding:s,closeMargin:u,borderRadius:d,opacityDisabled:f,textColorCheckable:p,textColorHoverCheckable:m,textColorPressedCheckable:h,textColorChecked:g,colorCheckable:_,colorHoverCheckable:v,colorPressedCheckable:y,colorChecked:b,colorCheckedHover:x,colorCheckedPressed:S,closeBorderRadius:C,fontWeightStrong:w,[sg(`colorBordered`,t)]:T,[sg(`closeSize`,a)]:E,[sg(`closeIconSize`,a)]:D,[sg(`fontSize`,a)]:O,[sg(`height`,a)]:k,[sg(`color`,t)]:A,[sg(`textColor`,t)]:ee,[sg(`border`,t)]:te,[sg(`closeIconColor`,t)]:ne,[sg(`closeIconColorHover`,t)]:j,[sg(`closeIconColorPressed`,t)]:M,[sg(`closeColorHover`,t)]:re,[sg(`closeColorPressed`,t)]:ie}}=l.value,ae=e_(u);return{"--n-font-weight-strong":w,"--n-avatar-size-override":`calc(${k} - 8px)`,"--n-bezier":o,"--n-border-radius":d,"--n-border":te,"--n-close-icon-size":D,"--n-close-color-pressed":ie,"--n-close-color-hover":re,"--n-close-border-radius":C,"--n-close-icon-color":ne,"--n-close-icon-color-hover":j,"--n-close-icon-color-pressed":M,"--n-close-icon-color-disabled":ne,"--n-close-margin-top":ae.top,"--n-close-margin-right":ae.right,"--n-close-margin-bottom":ae.bottom,"--n-close-margin-left":ae.left,"--n-close-size":E,"--n-color":r||(n.value?T:A),"--n-color-checkable":_,"--n-color-checked":b,"--n-color-checked-hover":x,"--n-color-checked-pressed":S,"--n-color-hover-checkable":v,"--n-color-pressed-checkable":y,"--n-font-size":O,"--n-height":k,"--n-opacity-disabled":f,"--n-padding":s,"--n-text-color":i||ee,"--n-text-color-checkable":p,"--n-text-color-checked":g,"--n-text-color-hover-checkable":m,"--n-text-color-pressed-checkable":h}}),h=a?pg(`tag`,(0,r.computed)(()=>{let t=``,{type:r,color:{color:i,textColor:a}={}}=e;return t+=r[0],t+=c.value[0],i&&(t+=`a${aS(i)}`),a&&(t+=`b${aS(a)}`),n.value&&(t+=`c`),t}),m,e):void 0;return{...f,rtlEnabled:p,mergedClsPrefix:i,contentRef:t,mergedBordered:n,handleClick:u,handleCloseClick:d,cssVars:a?void 0:m,themeClass:h?.themeClass,onRender:h?.onRender}},render(){let{mergedClsPrefix:e,rtlEnabled:t,closable:n,color:{borderColor:i}={},round:a,onRender:o,$slots:s}=this;o?.();let c=By(s.avatar,t=>t&&((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${e}-tag__avatar`)},[Z(()=>t)],2))),l=By(s.icon,t=>t&&((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${e}-tag__icon`)},[Z(()=>t)],2)));return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q([`${e}-tag`,this.themeClass,{[`${e}-tag--rtl`]:t,[`${e}-tag--strong`]:this.strong,[`${e}-tag--disabled`]:this.disabled,[`${e}-tag--checkable`]:this.checkable,[`${e}-tag--checked`]:this.checkable&&this.checked,[`${e}-tag--round`]:a,[`${e}-tag--avatar`]:c,[`${e}-tag--icon`]:l,[`${e}-tag--closable`]:n}]),style:(0,r.normalizeStyle)(this.cssVars),onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},[Z(()=>l||c),(0,r.createElementVNode)(`span`,{class:Q(`${e}-tag__content`),ref:`contentRef`},[Z(()=>this.$slots.default?.())],2),!this.checkable&&n?((0,r.openBlock)(),(0,r.createBlock)(lS,{key:0,clsPrefix:e,class:Q(`${e}-tag__close`),disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:a,isButtonTag:this.internalCloseIsButtonTag,absolute:!0},null,8,[`clsPrefix`,`class`,`disabled`,`onClick`,`focusable`,`round`,`isButtonTag`])):Z(()=>null),!this.checkable&&this.mergedBordered?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:Q(`${e}-tag__border`),style:(0,r.normalizeStyle)({borderColor:i})},null,6)):Z(()=>null)],46,hS)}}),yS=(0,r.defineComponent)({name:`ChevronDown`,render(){return(()=>{let e=Bg(`ae90ecf811a811ac`);return e[0]||=(0,r.createElementVNode)(`svg`,{viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`},[(0,r.createElementVNode)(`path`,{d:`M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z`,fill:`currentColor`})],-1)})()}}),bS=oS(`clear`,()=>(()=>{let e=Bg(`c93f8499adf26ca3`);return e[0]||=(0,r.createElementVNode)(`svg`,{viewBox:`0 0 16 16`,version:`1.1`,xmlns:`http://www.w3.org/2000/svg`},[(0,r.createElementVNode)(`g`,{stroke:`none`,"stroke-width":`1`,fill:`none`,"fill-rule":`evenodd`},[(0,r.createElementVNode)(`g`,{fill:`currentColor`,"fill-rule":`nonzero`},[(0,r.createElementVNode)(`path`,{d:`M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z`})])])],-1)})()),xS=J(`base-clear`,`
550
550
  flex-shrink: 0;
551
551
  height: 1em;
552
552
  width: 1em;
@@ -570,7 +570,7 @@
570
570
  left: 50%;
571
571
  top: 50%;
572
572
  transform: translateX(-50%) translateY(-50%);
573
- `,[Ky({originalTransform:`translateX(-50%) translateY(-50%)`,left:`50%`,top:`50%`})])])]),xS=[`onClick`,`onMousedown`],SS=(0,r.defineComponent)({name:`BaseClear`,props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Uy(`-base-clear`,bS,(0,r.toRef)(e,`clsPrefix`)),{handleMouseDown(e){e.preventDefault()}}},render(){let{clsPrefix:e}=this;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${e}-base-clear`)},[(0,r.createVNode)(Wy,null,{default:()=>this.show?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`dismiss`,class:Q(`${e}-base-clear__clear`),onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},[Z(()=>Ry(this.$slots.icon,()=>[((0,r.openBlock)(),(0,r.createBlock)(Tb,{clsPrefix:e},{default:()=>((0,r.openBlock)(),(0,r.createBlock)(yS))},1032,[`clsPrefix`]))]))],42,xS)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`icon`,class:Q(`${e}-base-clear__placeholder`)},[Z(()=>this.$slots.placeholder?.())],2))},1024)],2)}}),CS=(0,r.defineComponent)({name:`InternalSelectionSuffix`,props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:Boolean,onClear:Function},setup(e,{slots:t}){return()=>{let{clsPrefix:n}=e;return(0,r.openBlock)(),(0,r.createBlock)(tb,{clsPrefix:n,class:Q(`${n}-base-suffix`),strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?((0,r.openBlock)(),(0,r.createBlock)(SS,{key:1,clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>((0,r.openBlock)(),(0,r.createBlock)(Tb,{clsPrefix:n,class:Q(`${n}-base-suffix__arrow`)},{default:()=>Ry(t.default,()=>[((0,r.openBlock)(),(0,r.createBlock)(vS))])},1032,[`clsPrefix`,`class`]))},1032,[`clsPrefix`,`show`,`onClear`])):null},1032,[`clsPrefix`,`class`,`show`])}}}),wS={paddingSingle:`0 26px 0 12px`,paddingMultiple:`3px 26px 0 12px`,clearSize:`16px`,arrowSize:`16px`};function TS(e){let{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:i,inputColorDisabled:a,primaryColor:o,primaryColorHover:s,warningColor:c,warningColorHover:l,errorColor:u,errorColorHover:d,borderColor:f,iconColor:p,iconColorDisabled:m,clearColor:h,clearColorHover:g,clearColorPressed:_,placeholderColor:v,placeholderColorDisabled:y,fontSizeTiny:b,fontSizeSmall:x,fontSizeMedium:S,fontSizeLarge:C,heightTiny:w,heightSmall:T,heightMedium:E,heightLarge:D,fontWeight:O}=e;return{...wS,fontSizeTiny:b,fontSizeSmall:x,fontSizeMedium:S,fontSizeLarge:C,heightTiny:w,heightSmall:T,heightMedium:E,heightLarge:D,borderRadius:t,fontWeight:O,textColor:n,textColorDisabled:r,placeholderColor:v,placeholderColorDisabled:y,color:i,colorDisabled:a,colorActive:i,border:`1px solid ${f}`,borderHover:`1px solid ${s}`,borderActive:`1px solid ${o}`,borderFocus:`1px solid ${s}`,boxShadowHover:`none`,boxShadowActive:`0 0 0 2px ${D_(o,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${D_(o,{alpha:.2})}`,caretColor:o,arrowColor:p,arrowColorDisabled:m,loadingColor:o,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${l}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${l}`,boxShadowHoverWarning:`none`,boxShadowActiveWarning:`0 0 0 2px ${D_(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${D_(c,{alpha:.2})}`,colorActiveWarning:i,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${d}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${d}`,boxShadowHoverError:`none`,boxShadowActiveError:`0 0 0 2px ${D_(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${D_(u,{alpha:.2})}`,colorActiveError:i,caretColorError:u,clearColor:h,clearColorHover:g,clearColorPressed:_}}var ES=Ig({name:`InternalSelection`,common:ub,peers:{Popover:Hx},self:TS}),DS=q([J(`base-selection`,`
573
+ `,[qy({originalTransform:`translateX(-50%) translateY(-50%)`,left:`50%`,top:`50%`})])])]),SS=[`onClick`,`onMousedown`],CS=(0,r.defineComponent)({name:`BaseClear`,props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Wy(`-base-clear`,xS,(0,r.toRef)(e,`clsPrefix`)),{handleMouseDown(e){e.preventDefault()}}},render(){let{clsPrefix:e}=this;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${e}-base-clear`)},[(0,r.createVNode)(Gy,null,{default:()=>this.show?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`dismiss`,class:Q(`${e}-base-clear__clear`),onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},[Z(()=>zy(this.$slots.icon,()=>[((0,r.openBlock)(),(0,r.createBlock)(Eb,{clsPrefix:e},{default:()=>((0,r.openBlock)(),(0,r.createBlock)(bS))},1032,[`clsPrefix`]))]))],42,SS)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:`icon`,class:Q(`${e}-base-clear__placeholder`)},[Z(()=>this.$slots.placeholder?.())],2))},1024)],2)}}),wS=(0,r.defineComponent)({name:`InternalSelectionSuffix`,props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:Boolean,onClear:Function},setup(e,{slots:t}){return()=>{let{clsPrefix:n}=e;return(0,r.openBlock)(),(0,r.createBlock)(nb,{clsPrefix:n,class:Q(`${n}-base-suffix`),strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?((0,r.openBlock)(),(0,r.createBlock)(CS,{key:1,clsPrefix:n,show:e.showClear,onClear:e.onClear},{placeholder:()=>((0,r.openBlock)(),(0,r.createBlock)(Eb,{clsPrefix:n,class:Q(`${n}-base-suffix__arrow`)},{default:()=>zy(t.default,()=>[((0,r.openBlock)(),(0,r.createBlock)(yS))])},1032,[`clsPrefix`,`class`]))},1032,[`clsPrefix`,`show`,`onClear`])):null},1032,[`clsPrefix`,`class`,`show`])}}}),TS={paddingSingle:`0 26px 0 12px`,paddingMultiple:`3px 26px 0 12px`,clearSize:`16px`,arrowSize:`16px`};function ES(e){let{borderRadius:t,textColor2:n,textColorDisabled:r,inputColor:i,inputColorDisabled:a,primaryColor:o,primaryColorHover:s,warningColor:c,warningColorHover:l,errorColor:u,errorColorHover:d,borderColor:f,iconColor:p,iconColorDisabled:m,clearColor:h,clearColorHover:g,clearColorPressed:_,placeholderColor:v,placeholderColorDisabled:y,fontSizeTiny:b,fontSizeSmall:x,fontSizeMedium:S,fontSizeLarge:C,heightTiny:w,heightSmall:T,heightMedium:E,heightLarge:D,fontWeight:O}=e;return{...TS,fontSizeTiny:b,fontSizeSmall:x,fontSizeMedium:S,fontSizeLarge:C,heightTiny:w,heightSmall:T,heightMedium:E,heightLarge:D,borderRadius:t,fontWeight:O,textColor:n,textColorDisabled:r,placeholderColor:v,placeholderColorDisabled:y,color:i,colorDisabled:a,colorActive:i,border:`1px solid ${f}`,borderHover:`1px solid ${s}`,borderActive:`1px solid ${o}`,borderFocus:`1px solid ${s}`,boxShadowHover:`none`,boxShadowActive:`0 0 0 2px ${O_(o,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${O_(o,{alpha:.2})}`,caretColor:o,arrowColor:p,arrowColorDisabled:m,loadingColor:o,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${l}`,borderActiveWarning:`1px solid ${c}`,borderFocusWarning:`1px solid ${l}`,boxShadowHoverWarning:`none`,boxShadowActiveWarning:`0 0 0 2px ${O_(c,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${O_(c,{alpha:.2})}`,colorActiveWarning:i,caretColorWarning:c,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${d}`,borderActiveError:`1px solid ${u}`,borderFocusError:`1px solid ${d}`,boxShadowHoverError:`none`,boxShadowActiveError:`0 0 0 2px ${O_(u,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${O_(u,{alpha:.2})}`,colorActiveError:i,caretColorError:u,clearColor:h,clearColorHover:g,clearColorPressed:_}}var DS=Lg({name:`InternalSelection`,common:db,peers:{Popover:Ux},self:ES}),OS=q([J(`base-selection`,`
574
574
  --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left);
575
575
  --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left);
576
576
  position: relative;
@@ -687,7 +687,7 @@
687
687
  white-space: nowrap;
688
688
  `)]),Y(`render-label`,`
689
689
  color: var(--n-text-color);
690
- `)]),ig(`disabled`,[q(`&:hover`,[Y(`state-border`,`
690
+ `)]),ag(`disabled`,[q(`&:hover`,[Y(`state-border`,`
691
691
  box-shadow: var(--n-box-shadow-hover);
692
692
  border: var(--n-border-hover);
693
693
  `)]),X(`focus`,[Y(`state-border`,`
@@ -745,7 +745,7 @@
745
745
  user-select: none;
746
746
  -webkit-user-select: none;
747
747
  opacity: 0;
748
- `)]),[`warning`,`error`].map(e=>X(`${e}-status`,[Y(`state-border`,`border: var(--n-border-${e});`),ig(`disabled`,[q(`&:hover`,[Y(`state-border`,`
748
+ `)]),[`warning`,`error`].map(e=>X(`${e}-status`,[Y(`state-border`,`border: var(--n-border-${e});`),ag(`disabled`,[q(`&:hover`,[Y(`state-border`,`
749
749
  box-shadow: var(--n-box-shadow-hover-${e});
750
750
  border: var(--n-border-hover-${e});
751
751
  `)]),X(`active`,[Y(`state-border`,`
@@ -770,7 +770,7 @@
770
770
  line-height: 1.25;
771
771
  text-overflow: ellipsis;
772
772
  overflow: hidden;
773
- `)])])]),OS=[`disabled`,`value`,`autofocus`,`onBlur`,`onFocus`,`onKeydown`,`onInput`,`onCompositionstart`,`onCompositionend`],kS=[`tabindex`],AS=[`title`],jS=[`value`,`readonly`,`disabled`,`autofocus`,`onFocus`,`onBlur`,`onInput`,`onCompositionstart`,`onCompositionend`],MS=[`tabindex`],NS=[`onClick`,`onMouseenter`,`onMouseleave`,`onKeydown`,`onFocusin`,`onFocusout`,`onMousedown`],PS=(0,r.defineComponent)({name:`InternalSelection`,props:{...Lg.props,clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:``},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:`medium`},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n}=Sh(e),i=Vy(`InternalSelection`,n,t),a=(0,r.ref)(null),o=(0,r.ref)(null),s=(0,r.ref)(null),c=(0,r.ref)(null),l=(0,r.ref)(null),u=(0,r.ref)(null),d=(0,r.ref)(null),f=(0,r.ref)(null),p=(0,r.ref)(null),m=(0,r.ref)(null),h=(0,r.ref)(!1),g=(0,r.ref)(!1),_=(0,r.ref)(!1),v=Lg(`InternalSelection`,`-internal-selection`,DS,ES,e,(0,r.toRef)(e,`clsPrefix`)),y=(0,r.computed)(()=>e.clearable&&!e.disabled&&(_.value||e.active)),b=(0,r.computed)(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Ib(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=(0,r.computed)(()=>{let t=e.selectedOption;if(t)return t[e.labelField]}),S=(0,r.computed)(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function C(){let{value:t}=a;if(t){let{value:n}=o;n&&(n.style.width=`${t.offsetWidth}px`,e.maxTagCount!==`responsive`&&p.value?.sync({showAllItemsBeforeCalculate:!1}))}}function w(){let{value:e}=m;e&&(e.style.display=`none`)}function T(){let{value:e}=m;e&&(e.style.display=`inline-block`)}(0,r.watch)((0,r.toRef)(e,`active`),e=>{e||w()}),(0,r.watch)((0,r.toRef)(e,`pattern`),()=>{e.multiple&&(0,r.nextTick)(C)});function E(t){let{onFocus:n}=e;n&&n(t)}function D(t){let{onBlur:n}=e;n&&n(t)}function O(t){let{onDeleteOption:n}=e;n&&n(t)}function k(t){let{onClear:n}=e;n&&n(t)}function A(t){let{onPatternInput:n}=e;n&&n(t)}function ee(e){(!e.relatedTarget||!s.value?.contains(e.relatedTarget))&&E(e)}function j(e){s.value?.contains(e.relatedTarget)||D(e)}function te(e){k(e)}function ne(){_.value=!0}function M(){_.value=!1}function re(t){e.active&&e.filterable&&t.target!==o.value&&t.preventDefault()}function ie(e){O(e)}let N=(0,r.ref)(!1);function P(t){if(t.key===`Backspace`&&!N.value&&!e.pattern.length){let{selectedOptions:t}=e;t?.length&&ie(t[t.length-1])}}let F=null;function ae(t){let{value:n}=a;n&&(n.textContent=t.target.value,C()),e.ignoreComposition&&N.value?F=t:A(t)}function oe(){N.value=!0}function se(){N.value=!1,e.ignoreComposition&&A(F),F=null}function ce(t){g.value=!0,e.onPatternFocus?.(t)}function le(t){g.value=!1,e.onPatternBlur?.(t)}function ue(){if(e.filterable)g.value=!1,u.value?.blur(),o.value?.blur();else if(e.multiple){let{value:e}=c;e?.blur()}else{let{value:e}=l;e?.blur()}}function de(){e.filterable?(g.value=!1,u.value?.focus()):e.multiple?c.value?.focus():l.value?.focus()}function fe(){let{value:e}=o;e&&(T(),e.focus())}function pe(){let{value:e}=o;e&&e.blur()}function me(e){let{value:t}=d;t&&t.setTextContent(`+${e}`)}function he(){let{value:e}=f;return e}function ge(){return o.value}let _e=null;function ve(){_e!==null&&window.clearTimeout(_e)}function ye(){e.active||(ve(),_e=window.setTimeout(()=>{S.value&&(h.value=!0)},100))}function be(){ve()}function xe(e){e||(ve(),h.value=!1)}(0,r.watch)(S,e=>{e||(h.value=!1)}),(0,r.onMounted)(()=>{(0,r.watchEffect)(()=>{let t=u.value;t&&(e.disabled?t.removeAttribute(`tabindex`):t.tabIndex=g.value?-1:0)})}),Iy(s,e.onResize);let{inlineThemeDisabled:Se}=e,Ce=(0,r.computed)(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{fontWeight:r,borderRadius:i,color:a,placeholderColor:o,textColor:s,paddingSingle:c,paddingMultiple:l,caretColor:u,colorDisabled:d,textColorDisabled:f,placeholderColorDisabled:p,colorActive:m,boxShadowFocus:h,boxShadowActive:g,boxShadowHover:_,border:y,borderFocus:b,borderHover:x,borderActive:S,arrowColor:C,arrowColorDisabled:w,loadingColor:T,colorActiveWarning:E,boxShadowFocusWarning:D,boxShadowActiveWarning:O,boxShadowHoverWarning:k,borderWarning:A,borderFocusWarning:ee,borderHoverWarning:j,borderActiveWarning:te,colorActiveError:ne,boxShadowFocusError:M,boxShadowActiveError:re,boxShadowHoverError:ie,borderError:N,borderFocusError:P,borderHoverError:F,borderActiveError:ae,clearColor:oe,clearColorHover:se,clearColorPressed:ce,clearSize:le,arrowSize:ue,[og(`height`,t)]:de,[og(`fontSize`,t)]:fe}}=v.value,pe=$g(c),me=$g(l);return{"--n-bezier":n,"--n-border":y,"--n-border-active":S,"--n-border-focus":b,"--n-border-hover":x,"--n-border-radius":i,"--n-box-shadow-active":g,"--n-box-shadow-focus":h,"--n-box-shadow-hover":_,"--n-caret-color":u,"--n-color":a,"--n-color-active":m,"--n-color-disabled":d,"--n-font-size":fe,"--n-height":de,"--n-padding-single-top":pe.top,"--n-padding-multiple-top":me.top,"--n-padding-single-right":pe.right,"--n-padding-multiple-right":me.right,"--n-padding-single-left":pe.left,"--n-padding-multiple-left":me.left,"--n-padding-single-bottom":pe.bottom,"--n-padding-multiple-bottom":me.bottom,"--n-placeholder-color":o,"--n-placeholder-color-disabled":p,"--n-text-color":s,"--n-text-color-disabled":f,"--n-arrow-color":C,"--n-arrow-color-disabled":w,"--n-loading-color":T,"--n-color-active-warning":E,"--n-box-shadow-focus-warning":D,"--n-box-shadow-active-warning":O,"--n-box-shadow-hover-warning":k,"--n-border-warning":A,"--n-border-focus-warning":ee,"--n-border-hover-warning":j,"--n-border-active-warning":te,"--n-color-active-error":ne,"--n-box-shadow-focus-error":M,"--n-box-shadow-active-error":re,"--n-box-shadow-hover-error":ie,"--n-border-error":N,"--n-border-focus-error":P,"--n-border-hover-error":F,"--n-border-active-error":ae,"--n-clear-size":le,"--n-clear-color":oe,"--n-clear-color-hover":se,"--n-clear-color-pressed":ce,"--n-arrow-size":ue,"--n-font-weight":r}}),we=Se?fg(`internal-selection`,(0,r.computed)(()=>e.size[0]),Ce,e):void 0;return{mergedTheme:v,mergedClearable:y,mergedClsPrefix:t,rtlEnabled:i,patternInputFocused:g,filterablePlaceholder:b,label:x,selected:S,showTagsPanel:h,isComposing:N,counterRef:d,counterWrapperRef:f,patternInputMirrorRef:a,patternInputRef:o,selfRef:s,multipleElRef:c,singleElRef:l,patternInputWrapperRef:u,overflowRef:p,inputTagElRef:m,handleMouseDown:re,handleFocusin:ee,handleClear:te,handleMouseEnter:ne,handleMouseLeave:M,handleDeleteOption:ie,handlePatternKeyDown:P,handlePatternInputInput:ae,handlePatternInputBlur:le,handlePatternInputFocus:ce,handleMouseEnterCounter:ye,handleMouseLeaveCounter:be,handleFocusout:j,handleCompositionEnd:se,handleCompositionStart:oe,onPopoverUpdateShow:xe,focus:de,focusInput:fe,blur:ue,blurInput:pe,updateCounter:me,getCounter:he,getTail:ge,renderLabel:e.renderLabel,cssVars:Se?void 0:Ce,themeClass:we?.themeClass,onRender:we?.onRender}},render(){let{status:e,multiple:t,size:n,disabled:i,filterable:a,maxTagCount:o,bordered:s,clsPrefix:c,ellipsisTagPopoverProps:l,onRender:u,renderTag:d,renderLabel:f}=this;u?.();let p=o===`responsive`,m=typeof o==`number`,h=p||m,g=((0,r.openBlock)(),(0,r.createBlock)(ib,null,{default:()=>((0,r.openBlock)(),(0,r.createBlock)(CS,{clsPrefix:c,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>this.$slots.arrow?.()},1032,[`clsPrefix`,`loading`,`showArrow`,`showClear`,`onClear`]))},1024)),_;if(t){let{labelField:e}=this,t=t=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-tag-wrapper`),key:t.value},[d?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>d({option:t,handleClose:()=>{this.handleDeleteOption(t)}}))],64)):((0,r.openBlock)(),(0,r.createBlock)(_S,{key:1,size:n,closable:!t.disabled,disabled:i,onClose:()=>{this.handleDeleteOption(t)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(t,!0):Ib(t[e],t,!0)},1032,[`size`,`closable`,`disabled`,`onClose`]))],2)),s=()=>(m?this.selectedOptions.slice(0,o):this.selectedOptions).map(t),u=a?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-input-tag`),ref:`inputTagElRef`,key:`__input-tag__`},[(0,r.createElementVNode)(`input`,(0,r.mergeProps)(this.inputProps,{ref:`patternInputRef`,tabindex:-1,disabled:i,value:this.pattern,autofocus:this.autofocus,class:`${c}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd}),null,16,OS),(0,r.createElementVNode)(`span`,{ref:`patternInputMirrorRef`,class:Q(`${c}-base-selection-input-tag__mirror`)},[Z(()=>this.pattern)],2)],2)):null,v=p?()=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-tag-wrapper`),ref:`counterWrapperRef`},[((0,r.openBlock)(),(0,r.createBlock)(_S,{size:n,ref:`counterRef`,onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:i},null,8,[`size`,`onMouseenter`,`onMouseleave`,`disabled`]))],2)):void 0,y;if(m){let e=this.selectedOptions.length-o;e>0&&(y=(t=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-tag-wrapper`),key:`__counter__`},[((0,r.openBlock)(),(0,r.createBlock)(_S,{size:n,ref:`counterRef`,onMouseenter:this.handleMouseEnterCounter,disabled:i},{default:()=>`+${e}`},1032,[`size`,`onMouseenter`,`disabled`]))],2)))(y))}let b=p?a?((0,r.openBlock)(),(0,r.createBlock)(Oy,{key:3,ref:`overflowRef`,updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:`100%`,display:`flex`,overflow:`hidden`}},{default:s,counter:v,tail:()=>u},1032,[`updateCounter`,`getCounter`,`getTail`])):((0,r.openBlock)(),(0,r.createBlock)(Oy,{key:4,ref:`overflowRef`,updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:`100%`,display:`flex`,overflow:`hidden`}},{default:s,counter:v},1032,[`updateCounter`,`getCounter`])):m&&y?s().concat(y):s(),x=h?()=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-popover`)},[p?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>s())],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>this.selectedOptions.map(t))],64))],2)):void 0,S=h?{show:this.showTagsPanel,trigger:`hover`,overlap:!0,placement:`top`,width:`trigger`,onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover,...l}:null,C=!this.selected&&(!this.active||!this.pattern&&!this.isComposing)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:5,class:Q(`${c}-base-selection-placeholder ${c}-base-selection-overlay`)},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-placeholder__inner`)},[Z(()=>this.placeholder)],2)],2)):null,w=a?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:6,ref:`patternInputWrapperRef`,class:Q(`${c}-base-selection-tags`)},[Z(()=>b),p?Z(()=>null):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>u)],64)),Z(()=>g)],2)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:7,ref:`multipleElRef`,class:Q(`${c}-base-selection-tags`),tabindex:i?void 0:0},[Z(()=>b),Z(()=>g)],10,kS));_=(e=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:8},[h?((0,r.openBlock)(),(0,r.createBlock)(rS,(0,r.mergeProps)({key:0},S,{scrollable:!0,style:`max-height: calc(var(--v-target-height) * 6.6);`}),{trigger:()=>w,default:x},1040)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>w)],64)),Z(()=>C)],64)))(_)}else if(a){let e=this.pattern||this.isComposing,t=this.active?!e:!this.selected,n=!this.active&&this.selected;_=(e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:9,ref:`patternInputWrapperRef`,class:Q(`${c}-base-selection-label`),title:this.patternInputFocused?void 0:jx(this.label)},[(0,r.createElementVNode)(`input`,(0,r.mergeProps)(this.inputProps,{ref:`patternInputRef`,class:`${c}-base-selection-input`,value:this.active?this.pattern:``,placeholder:``,readonly:i,disabled:i,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd}),null,16,jS),n?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-label__render-label ${c}-base-selection-overlay`),key:`input`},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-overlay__wrapper`)},[d?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>d({option:this.selectedOption,handleClose:()=>{}}))],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[f?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>f(this.selectedOption,!0))],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>Ib(this.label,this.selectedOption,!0))],64))],64))],2)],2)):Z(()=>null),t?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-placeholder ${c}-base-selection-overlay`),key:`placeholder`},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-overlay__wrapper`)},[Z(()=>this.filterablePlaceholder)],2)],2)):Z(()=>null),Z(()=>g)],10,AS)))(_)}else _=(e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:10,ref:`singleElRef`,class:Q(`${c}-base-selection-label`),tabindex:this.disabled?void 0:0},[this.label===void 0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-placeholder ${c}-base-selection-overlay`),key:`placeholder`},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-placeholder__inner`)},[Z(()=>this.placeholder)],2)],2)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-input`),title:jx(this.label),key:`input`},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-input__content`)},[d?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>d({option:this.selectedOption,handleClose:()=>{}}))],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[f?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>f(this.selectedOption,!0))],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>Ib(this.label,this.selectedOption,!0))],64))],64))],2)],10,[`title`])),Z(()=>g)],10,MS)))(_);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`selfRef`,class:Q([`${c}-base-selection`,this.rtlEnabled&&`${c}-base-selection--rtl`,this.themeClass,e&&`${c}-base-selection--${e}-status`,{[`${c}-base-selection--active`]:this.active,[`${c}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${c}-base-selection--disabled`]:this.disabled,[`${c}-base-selection--multiple`]:this.multiple,[`${c}-base-selection--focus`]:this.focused}]),style:(0,r.normalizeStyle)(this.cssVars),onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},[Z(()=>_),s?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:Q(`${c}-base-selection__border`)},null,2)):Z(()=>null),s?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:Q(`${c}-base-selection__state-border`)},null,2)):Z(()=>null)],46,NS)}});function FS(e){return e.type===`group`}function IS(e){return e.type===`ignored`}function LS(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function RS(e,t){return{getIsGroup:FS,getIgnored:IS,getKey(t){return FS(t)?t.name||t.key||`key-required`:t[e]},getChildren(e){return e[t]}}}function zS(e,t,n,r){if(!t)return e;function i(e){if(!Array.isArray(e))return[];let a=[];for(let o of e)if(FS(o)){let e=i(o[r]);e.length&&a.push(Object.assign({},o,{[r]:e}))}else if(IS(o))continue;else t(n,o)&&a.push(o);return a}return i(e)}function BS(e,t,n){let r=new Map;return e.forEach(e=>{FS(e)?e[n].forEach(e=>{r.set(e[t],e)}):r.set(e[t],e)}),r}function VS(e){let{boxShadow2:t}=e;return{menuBoxShadow:t}}var HS=Ig({name:`Select`,common:ub,peers:{InternalSelection:ES,InternalSelectMenu:Fb},self:VS}),US=q([J(`select`,`
773
+ `)])])]),kS=[`disabled`,`value`,`autofocus`,`onBlur`,`onFocus`,`onKeydown`,`onInput`,`onCompositionstart`,`onCompositionend`],AS=[`tabindex`],jS=[`title`],MS=[`value`,`readonly`,`disabled`,`autofocus`,`onFocus`,`onBlur`,`onInput`,`onCompositionstart`,`onCompositionend`],NS=[`tabindex`],PS=[`onClick`,`onMouseenter`,`onMouseleave`,`onKeydown`,`onFocusin`,`onFocusout`,`onMousedown`],FS=(0,r.defineComponent)({name:`InternalSelection`,props:{...Rg.props,clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:``},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:`label`},valueField:{type:String,default:`value`},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:`medium`},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:n}=Ch(e),i=Hy(`InternalSelection`,n,t),a=(0,r.ref)(null),o=(0,r.ref)(null),s=(0,r.ref)(null),c=(0,r.ref)(null),l=(0,r.ref)(null),u=(0,r.ref)(null),d=(0,r.ref)(null),f=(0,r.ref)(null),p=(0,r.ref)(null),m=(0,r.ref)(null),h=(0,r.ref)(!1),g=(0,r.ref)(!1),_=(0,r.ref)(!1),v=Rg(`InternalSelection`,`-internal-selection`,OS,DS,e,(0,r.toRef)(e,`clsPrefix`)),y=(0,r.computed)(()=>e.clearable&&!e.disabled&&(_.value||e.active)),b=(0,r.computed)(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):Lb(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),x=(0,r.computed)(()=>{let t=e.selectedOption;if(t)return t[e.labelField]}),S=(0,r.computed)(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function C(){let{value:t}=a;if(t){let{value:n}=o;n&&(n.style.width=`${t.offsetWidth}px`,e.maxTagCount!==`responsive`&&p.value?.sync({showAllItemsBeforeCalculate:!1}))}}function w(){let{value:e}=m;e&&(e.style.display=`none`)}function T(){let{value:e}=m;e&&(e.style.display=`inline-block`)}(0,r.watch)((0,r.toRef)(e,`active`),e=>{e||w()}),(0,r.watch)((0,r.toRef)(e,`pattern`),()=>{e.multiple&&(0,r.nextTick)(C)});function E(t){let{onFocus:n}=e;n&&n(t)}function D(t){let{onBlur:n}=e;n&&n(t)}function O(t){let{onDeleteOption:n}=e;n&&n(t)}function k(t){let{onClear:n}=e;n&&n(t)}function A(t){let{onPatternInput:n}=e;n&&n(t)}function ee(e){(!e.relatedTarget||!s.value?.contains(e.relatedTarget))&&E(e)}function te(e){s.value?.contains(e.relatedTarget)||D(e)}function ne(e){k(e)}function j(){_.value=!0}function M(){_.value=!1}function re(t){e.active&&e.filterable&&t.target!==o.value&&t.preventDefault()}function ie(e){O(e)}let ae=(0,r.ref)(!1);function N(t){if(t.key===`Backspace`&&!ae.value&&!e.pattern.length){let{selectedOptions:t}=e;t?.length&&ie(t[t.length-1])}}let P=null;function oe(t){let{value:n}=a;n&&(n.textContent=t.target.value,C()),e.ignoreComposition&&ae.value?P=t:A(t)}function se(){ae.value=!0}function ce(){ae.value=!1,e.ignoreComposition&&A(P),P=null}function le(t){g.value=!0,e.onPatternFocus?.(t)}function ue(t){g.value=!1,e.onPatternBlur?.(t)}function de(){if(e.filterable)g.value=!1,u.value?.blur(),o.value?.blur();else if(e.multiple){let{value:e}=c;e?.blur()}else{let{value:e}=l;e?.blur()}}function fe(){e.filterable?(g.value=!1,u.value?.focus()):e.multiple?c.value?.focus():l.value?.focus()}function pe(){let{value:e}=o;e&&(T(),e.focus())}function me(){let{value:e}=o;e&&e.blur()}function he(e){let{value:t}=d;t&&t.setTextContent(`+${e}`)}function ge(){let{value:e}=f;return e}function _e(){return o.value}let ve=null;function ye(){ve!==null&&window.clearTimeout(ve)}function be(){e.active||(ye(),ve=window.setTimeout(()=>{S.value&&(h.value=!0)},100))}function xe(){ye()}function Se(e){e||(ye(),h.value=!1)}(0,r.watch)(S,e=>{e||(h.value=!1)}),(0,r.onMounted)(()=>{(0,r.watchEffect)(()=>{let t=u.value;t&&(e.disabled?t.removeAttribute(`tabindex`):t.tabIndex=g.value?-1:0)})}),Ly(s,e.onResize);let{inlineThemeDisabled:F}=e,Ce=(0,r.computed)(()=>{let{size:t}=e,{common:{cubicBezierEaseInOut:n},self:{fontWeight:r,borderRadius:i,color:a,placeholderColor:o,textColor:s,paddingSingle:c,paddingMultiple:l,caretColor:u,colorDisabled:d,textColorDisabled:f,placeholderColorDisabled:p,colorActive:m,boxShadowFocus:h,boxShadowActive:g,boxShadowHover:_,border:y,borderFocus:b,borderHover:x,borderActive:S,arrowColor:C,arrowColorDisabled:w,loadingColor:T,colorActiveWarning:E,boxShadowFocusWarning:D,boxShadowActiveWarning:O,boxShadowHoverWarning:k,borderWarning:A,borderFocusWarning:ee,borderHoverWarning:te,borderActiveWarning:ne,colorActiveError:j,boxShadowFocusError:M,boxShadowActiveError:re,boxShadowHoverError:ie,borderError:ae,borderFocusError:N,borderHoverError:P,borderActiveError:oe,clearColor:se,clearColorHover:ce,clearColorPressed:le,clearSize:ue,arrowSize:de,[sg(`height`,t)]:fe,[sg(`fontSize`,t)]:pe}}=v.value,me=e_(c),he=e_(l);return{"--n-bezier":n,"--n-border":y,"--n-border-active":S,"--n-border-focus":b,"--n-border-hover":x,"--n-border-radius":i,"--n-box-shadow-active":g,"--n-box-shadow-focus":h,"--n-box-shadow-hover":_,"--n-caret-color":u,"--n-color":a,"--n-color-active":m,"--n-color-disabled":d,"--n-font-size":pe,"--n-height":fe,"--n-padding-single-top":me.top,"--n-padding-multiple-top":he.top,"--n-padding-single-right":me.right,"--n-padding-multiple-right":he.right,"--n-padding-single-left":me.left,"--n-padding-multiple-left":he.left,"--n-padding-single-bottom":me.bottom,"--n-padding-multiple-bottom":he.bottom,"--n-placeholder-color":o,"--n-placeholder-color-disabled":p,"--n-text-color":s,"--n-text-color-disabled":f,"--n-arrow-color":C,"--n-arrow-color-disabled":w,"--n-loading-color":T,"--n-color-active-warning":E,"--n-box-shadow-focus-warning":D,"--n-box-shadow-active-warning":O,"--n-box-shadow-hover-warning":k,"--n-border-warning":A,"--n-border-focus-warning":ee,"--n-border-hover-warning":te,"--n-border-active-warning":ne,"--n-color-active-error":j,"--n-box-shadow-focus-error":M,"--n-box-shadow-active-error":re,"--n-box-shadow-hover-error":ie,"--n-border-error":ae,"--n-border-focus-error":N,"--n-border-hover-error":P,"--n-border-active-error":oe,"--n-clear-size":ue,"--n-clear-color":se,"--n-clear-color-hover":ce,"--n-clear-color-pressed":le,"--n-arrow-size":de,"--n-font-weight":r}}),we=F?pg(`internal-selection`,(0,r.computed)(()=>e.size[0]),Ce,e):void 0;return{mergedTheme:v,mergedClearable:y,mergedClsPrefix:t,rtlEnabled:i,patternInputFocused:g,filterablePlaceholder:b,label:x,selected:S,showTagsPanel:h,isComposing:ae,counterRef:d,counterWrapperRef:f,patternInputMirrorRef:a,patternInputRef:o,selfRef:s,multipleElRef:c,singleElRef:l,patternInputWrapperRef:u,overflowRef:p,inputTagElRef:m,handleMouseDown:re,handleFocusin:ee,handleClear:ne,handleMouseEnter:j,handleMouseLeave:M,handleDeleteOption:ie,handlePatternKeyDown:N,handlePatternInputInput:oe,handlePatternInputBlur:ue,handlePatternInputFocus:le,handleMouseEnterCounter:be,handleMouseLeaveCounter:xe,handleFocusout:te,handleCompositionEnd:ce,handleCompositionStart:se,onPopoverUpdateShow:Se,focus:fe,focusInput:pe,blur:de,blurInput:me,updateCounter:he,getCounter:ge,getTail:_e,renderLabel:e.renderLabel,cssVars:F?void 0:Ce,themeClass:we?.themeClass,onRender:we?.onRender}},render(){let{status:e,multiple:t,size:n,disabled:i,filterable:a,maxTagCount:o,bordered:s,clsPrefix:c,ellipsisTagPopoverProps:l,onRender:u,renderTag:d,renderLabel:f}=this;u?.();let p=o===`responsive`,m=typeof o==`number`,h=p||m,g=((0,r.openBlock)(),(0,r.createBlock)(ab,null,{default:()=>((0,r.openBlock)(),(0,r.createBlock)(wS,{clsPrefix:c,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>this.$slots.arrow?.()},1032,[`clsPrefix`,`loading`,`showArrow`,`showClear`,`onClear`]))},1024)),_;if(t){let{labelField:e}=this,t=t=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-tag-wrapper`),key:t.value},[d?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>d({option:t,handleClose:()=>{this.handleDeleteOption(t)}}))],64)):((0,r.openBlock)(),(0,r.createBlock)(vS,{key:1,size:n,closable:!t.disabled,disabled:i,onClose:()=>{this.handleDeleteOption(t)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>f?f(t,!0):Lb(t[e],t,!0)},1032,[`size`,`closable`,`disabled`,`onClose`]))],2)),s=()=>(m?this.selectedOptions.slice(0,o):this.selectedOptions).map(t),u=a?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-input-tag`),ref:`inputTagElRef`,key:`__input-tag__`},[(0,r.createElementVNode)(`input`,(0,r.mergeProps)(this.inputProps,{ref:`patternInputRef`,tabindex:-1,disabled:i,value:this.pattern,autofocus:this.autofocus,class:`${c}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd}),null,16,kS),(0,r.createElementVNode)(`span`,{ref:`patternInputMirrorRef`,class:Q(`${c}-base-selection-input-tag__mirror`)},[Z(()=>this.pattern)],2)],2)):null,v=p?()=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-tag-wrapper`),ref:`counterWrapperRef`},[((0,r.openBlock)(),(0,r.createBlock)(vS,{size:n,ref:`counterRef`,onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:i},null,8,[`size`,`onMouseenter`,`onMouseleave`,`disabled`]))],2)):void 0,y;if(m){let e=this.selectedOptions.length-o;e>0&&(y=(t=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-tag-wrapper`),key:`__counter__`},[((0,r.openBlock)(),(0,r.createBlock)(vS,{size:n,ref:`counterRef`,onMouseenter:this.handleMouseEnterCounter,disabled:i},{default:()=>`+${e}`},1032,[`size`,`onMouseenter`,`disabled`]))],2)))(y))}let b=p?a?((0,r.openBlock)(),(0,r.createBlock)(ky,{key:3,ref:`overflowRef`,updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:`100%`,display:`flex`,overflow:`hidden`}},{default:s,counter:v,tail:()=>u},1032,[`updateCounter`,`getCounter`,`getTail`])):((0,r.openBlock)(),(0,r.createBlock)(ky,{key:4,ref:`overflowRef`,updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:`100%`,display:`flex`,overflow:`hidden`}},{default:s,counter:v},1032,[`updateCounter`,`getCounter`])):m&&y?s().concat(y):s(),x=h?()=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-popover`)},[p?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>s())],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>this.selectedOptions.map(t))],64))],2)):void 0,S=h?{show:this.showTagsPanel,trigger:`hover`,overlap:!0,placement:`top`,width:`trigger`,onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover,...l}:null,C=!this.selected&&(!this.active||!this.pattern&&!this.isComposing)?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:5,class:Q(`${c}-base-selection-placeholder ${c}-base-selection-overlay`)},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-placeholder__inner`)},[Z(()=>this.placeholder)],2)],2)):null,w=a?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:6,ref:`patternInputWrapperRef`,class:Q(`${c}-base-selection-tags`)},[Z(()=>b),p?Z(()=>null):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>u)],64)),Z(()=>g)],2)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:7,ref:`multipleElRef`,class:Q(`${c}-base-selection-tags`),tabindex:i?void 0:0},[Z(()=>b),Z(()=>g)],10,AS));_=(e=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:8},[h?((0,r.openBlock)(),(0,r.createBlock)(iS,(0,r.mergeProps)({key:0},S,{scrollable:!0,style:`max-height: calc(var(--v-target-height) * 6.6);`}),{trigger:()=>w,default:x},1040)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>w)],64)),Z(()=>C)],64)))(_)}else if(a){let e=this.pattern||this.isComposing,t=this.active?!e:!this.selected,n=!this.active&&this.selected;_=(e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:9,ref:`patternInputWrapperRef`,class:Q(`${c}-base-selection-label`),title:this.patternInputFocused?void 0:Mx(this.label)},[(0,r.createElementVNode)(`input`,(0,r.mergeProps)(this.inputProps,{ref:`patternInputRef`,class:`${c}-base-selection-input`,value:this.active?this.pattern:``,placeholder:``,readonly:i,disabled:i,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd}),null,16,MS),n?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-label__render-label ${c}-base-selection-overlay`),key:`input`},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-overlay__wrapper`)},[d?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>d({option:this.selectedOption,handleClose:()=>{}}))],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[f?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>f(this.selectedOption,!0))],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>Lb(this.label,this.selectedOption,!0))],64))],64))],2)],2)):Z(()=>null),t?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-placeholder ${c}-base-selection-overlay`),key:`placeholder`},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-overlay__wrapper`)},[Z(()=>this.filterablePlaceholder)],2)],2)):Z(()=>null),Z(()=>g)],10,jS)))(_)}else _=(e=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:10,ref:`singleElRef`,class:Q(`${c}-base-selection-label`),tabindex:this.disabled?void 0:0},[this.label===void 0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-placeholder ${c}-base-selection-overlay`),key:`placeholder`},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-placeholder__inner`)},[Z(()=>this.placeholder)],2)],2)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${c}-base-selection-input`),title:Mx(this.label),key:`input`},[(0,r.createElementVNode)(`div`,{class:Q(`${c}-base-selection-input__content`)},[d?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>d({option:this.selectedOption,handleClose:()=>{}}))],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[f?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[Z(()=>f(this.selectedOption,!0))],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[Z(()=>Lb(this.label,this.selectedOption,!0))],64))],64))],2)],10,[`title`])),Z(()=>g)],10,NS)))(_);return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{ref:`selfRef`,class:Q([`${c}-base-selection`,this.rtlEnabled&&`${c}-base-selection--rtl`,this.themeClass,e&&`${c}-base-selection--${e}-status`,{[`${c}-base-selection--active`]:this.active,[`${c}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${c}-base-selection--disabled`]:this.disabled,[`${c}-base-selection--multiple`]:this.multiple,[`${c}-base-selection--focus`]:this.focused}]),style:(0,r.normalizeStyle)(this.cssVars),onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},[Z(()=>_),s?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:0,class:Q(`${c}-base-selection__border`)},null,2)):Z(()=>null),s?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:2,class:Q(`${c}-base-selection__state-border`)},null,2)):Z(()=>null)],46,PS)}});function IS(e){return e.type===`group`}function LS(e){return e.type===`ignored`}function RS(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function zS(e,t){return{getIsGroup:IS,getIgnored:LS,getKey(t){return IS(t)?t.name||t.key||`key-required`:t[e]},getChildren(e){return e[t]}}}function BS(e,t,n,r){if(!t)return e;function i(e){if(!Array.isArray(e))return[];let a=[];for(let o of e)if(IS(o)){let e=i(o[r]);e.length&&a.push(Object.assign({},o,{[r]:e}))}else if(LS(o))continue;else t(n,o)&&a.push(o);return a}return i(e)}function VS(e,t,n){let r=new Map;return e.forEach(e=>{IS(e)?e[n].forEach(e=>{r.set(e[t],e)}):r.set(e[t],e)}),r}function HS(e){let{boxShadow2:t}=e;return{menuBoxShadow:t}}var US=Lg({name:`Select`,common:db,peers:{InternalSelection:DS,InternalSelectMenu:Ib},self:HS}),WS=q([J(`select`,`
774
774
  z-index: auto;
775
775
  outline: none;
776
776
  width: 100%;
@@ -779,4 +779,4 @@
779
779
  `),J(`select-menu`,`
780
780
  margin: 4px 0;
781
781
  box-shadow: var(--n-menu-box-shadow);
782
- `,[Gb({originalTransition:`background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)`})])]),WS={...Lg.props,to:ph.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearCreatedOptionsOnClear:{type:Boolean,default:!0},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},scrollbarProps:Object,onChange:[Function,Array],items:Array},GS=(0,r.defineComponent)({name:`Select`,props:WS,slots:Object,setup(e){process.env.NODE_ENV!==`production`&&(0,r.watchEffect)(()=>{e.items!==void 0&&_h(`select`,"`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&_h(`select`,"`on-change` is deprecated, please use `on-update:value` instead.")});let{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:i,inlineThemeDisabled:a,mergedComponentPropsRef:o}=Sh(e),s=Lg(`Select`,`-select`,US,HS,e,t),c=(0,r.ref)(e.defaultValue),l=sh((0,r.toRef)(e,`value`),c),u=(0,r.ref)(!1),d=(0,r.ref)(``),f=lh(e,[`items`,`options`]),p=(0,r.ref)([]),m=(0,r.ref)([]),h=(0,r.computed)(()=>m.value.concat(p.value).concat(f.value)),g=(0,r.computed)(()=>{let{filter:t}=e;if(t)return t;let{labelField:n,valueField:r}=e;return(e,t)=>{if(!t)return!1;let i=t[n];if(typeof i==`string`)return LS(e,i);let a=t[r];return typeof a==`string`?LS(e,a):typeof a==`number`&&LS(e,String(a))}}),_=(0,r.computed)(()=>{if(e.remote)return f.value;{let{value:t}=h,{value:n}=d;return!n.length||!e.filterable?t:zS(t,g.value,n,e.childrenField)}}),v=(0,r.computed)(()=>{let{valueField:t,childrenField:n}=e,r=RS(t,n);return Ox(_.value,r)}),y=(0,r.computed)(()=>BS(h.value,e.valueField,e.childrenField)),b=(0,r.ref)(!1),x=sh((0,r.toRef)(e,`show`),b),S=(0,r.ref)(null),C=(0,r.ref)(null),w=(0,r.ref)(null),{localeRef:T}=kg(`Select`),E=(0,r.computed)(()=>e.placeholder??T.value.placeholder),D=[],O=(0,r.ref)(new Map),k=(0,r.computed)(()=>{let{fallbackOption:t}=e;if(t===void 0){let{labelField:t,valueField:n}=e;return e=>({[t]:String(e),[n]:e})}return t===!1?!1:e=>Object.assign(t(e),{value:e})});function A(t){let n=e.remote,{value:r}=O,{value:i}=y,{value:a}=k,o=[];return t.forEach(e=>{if(i.has(e))o.push(i.get(e));else if(n&&r.has(e))o.push(r.get(e));else if(a){let t=a(e);t&&o.push(t)}}),o}let ee=(0,r.computed)(()=>{if(e.multiple){let{value:e}=l;return Array.isArray(e)?A(e):[]}return null}),j=(0,r.computed)(()=>{let{value:t}=l;return!e.multiple&&!Array.isArray(t)?t===null?null:A([t])[0]||null:null}),te=mg(e,{mergedSize:t=>{let{size:n}=e;if(n)return n;let{mergedSize:r}=t||{};return r?.value?r.value:o?.value?.Select?.size||`medium`}}),{mergedSizeRef:ne,mergedDisabledRef:M,mergedStatusRef:re}=te;function ie(t,n){let{onChange:r,"onUpdate:value":i,onUpdateValue:a}=e,{nTriggerFormChange:o,nTriggerFormInput:s}=te;r&&bh(r,t,n),a&&bh(a,t,n),i&&bh(i,t,n),c.value=t,o(),s()}function N(t){let{onBlur:n}=e,{nTriggerFormBlur:r}=te;n&&bh(n,t),r()}function P(){let{onClear:t}=e;t&&bh(t)}function F(t){let{onFocus:n,showOnFocus:r}=e,{nTriggerFormFocus:i}=te;n&&bh(n,t),i(),r&&le()}function ae(t){let{onSearch:n}=e;n&&bh(n,t)}function oe(t){let{onScroll:n}=e;n&&bh(n,t)}function se(){let{remote:t,multiple:n}=e;if(t){let{value:t}=O;if(n){let{valueField:n}=e;ee.value?.forEach(e=>{t.set(e[n],e)})}else{let n=j.value;n&&t.set(n[e.valueField],n)}}}function ce(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&bh(n,t),r&&bh(r,t),b.value=t}function le(){M.value||(ce(!0),b.value=!0,e.filterable&&je())}function ue(){ce(!1)}function de(){d.value=``,m.value=D}let fe=(0,r.ref)(!1);function pe(){e.filterable&&(fe.value=!0)}function me(){e.filterable&&(fe.value=!1,x.value||de())}function he(){M.value||(x.value?e.filterable?je():ue():le())}function ge(e){w.value?.selfRef?.contains(e.relatedTarget)||(u.value=!1,N(e),ue())}function _e(e){F(e),u.value=!0}function ve(){u.value=!0}function ye(e){S.value?.$el.contains(e.relatedTarget)||(u.value=!1,N(e),ue())}function be(){S.value?.focus(),ue()}function xe(e){x.value&&(S.value?.$el.contains(Xg(e))||ue())}function Se(t){if(!Array.isArray(t))return[];if(k.value)return Array.from(t);{let{remote:n}=e,{value:r}=y;if(n){let{value:e}=O;return t.filter(t=>r.has(t)||e.has(t))}return t.filter(e=>r.has(e))}}function Ce(e){we(e.rawNode)}function we(t){if(M.value)return;let{tag:n,remote:r,clearFilterAfterSelect:i,valueField:a}=e;if(n&&!r){let{value:e}=m,t=e[0]||null;if(t){let e=p.value;e.length?e.push(t):p.value=[t],m.value=D}}if(r&&O.value.set(t[a],t),e.multiple){let e=Se(l.value),o=e.findIndex(e=>e===t[a]);if(~o){if(e.splice(o,1),n&&!r){let e=I(t[a]);~e&&(p.value.splice(e,1),i&&(d.value=``))}}else e.push(t[a]),i&&(d.value=``);ie(e,A(e))}else{if(n&&!r){let e=I(t[a]);~e?p.value=[p.value[e]]:p.value=D}Ae(),ue(),ie(t[a],t)}}function I(t){return p.value.findIndex(n=>n[e.valueField]===t)}function Te(t){x.value||le();let{value:n}=t.target;d.value=n;let{tag:r,remote:i}=e;if(ae(n),r&&!i){if(!n){m.value=D;return}let{onCreate:t}=e,r=t?t(n):{[e.labelField]:n,[e.valueField]:n},{valueField:i,labelField:a}=e;f.value.some(e=>e[i]===r[i]||e[a]===r[a])||p.value.some(e=>e[i]===r[i]||e[a]===r[a])?m.value=D:m.value=[r]}}function Ee(t){t.stopPropagation();let{multiple:n,tag:r,remote:i,clearCreatedOptionsOnClear:a}=e;!n&&e.filterable&&ue(),r&&!i&&a&&(p.value=D),P(),n?ie([],[]):ie(null,null)}function De(e){!Yg(e,`action`)&&!Yg(e,`empty`)&&!Yg(e,`header`)&&e.preventDefault()}function Oe(e){oe(e)}function ke(t){if(!e.keyboard)t.preventDefault();else switch(t.key){case` `:if(e.filterable)break;t.preventDefault();case`Enter`:if(!S.value?.isComposing){if(x.value){let t=w.value?.getPendingTmNode();t?Ce(t):e.filterable||(ue(),Ae())}else if(le(),e.tag&&fe.value){let t=m.value[0];if(t){let n=t[e.valueField],{value:r}=l;e.multiple&&Array.isArray(r)&&r.includes(n)||we(t)}}}t.preventDefault();break;case`ArrowUp`:if(t.preventDefault(),e.loading)return;x.value&&w.value?.prev();break;case`ArrowDown`:if(t.preventDefault(),e.loading)return;x.value?w.value?.next():le();break;case`Escape`:x.value&&(hh(t),ue()),S.value?.focus()}}function Ae(){S.value?.focus()}function je(){S.value?.focusInput()}function Me(){x.value&&C.value?.syncPosition()}se(),(0,r.watch)((0,r.toRef)(e,`options`),se);let Ne={focus:()=>{S.value?.focus()},focusInput:()=>{S.value?.focusInput()},blur:()=>{S.value?.blur()},blurInput:()=>{S.value?.blurInput()}},Pe=(0,r.computed)(()=>{let{self:{menuBoxShadow:e}}=s.value;return{"--n-menu-box-shadow":e}}),Fe=a?fg(`select`,void 0,Pe,e):void 0;return{...Ne,mergedStatus:re,mergedClsPrefix:t,mergedBordered:n,namespace:i,treeMate:v,isMounted:ch(),triggerRef:S,menuRef:w,pattern:d,uncontrolledShow:b,mergedShow:x,adjustedTo:ph(e),uncontrolledValue:c,mergedValue:l,followerRef:C,localizedPlaceholder:E,selectedOption:j,selectedOptions:ee,mergedSize:ne,mergedDisabled:M,focused:u,activeWithoutMenuOpen:fe,inlineThemeDisabled:a,onTriggerInputFocus:pe,onTriggerInputBlur:me,handleTriggerOrMenuResize:Me,handleMenuFocus:ve,handleMenuBlur:ye,handleMenuTabOut:be,handleTriggerClick:he,handleToggle:Ce,handleDeleteOption:we,handlePatternInput:Te,handleClear:Ee,handleTriggerBlur:ge,handleTriggerFocus:_e,handleKeydown:ke,handleMenuAfterLeave:de,handleMenuClickOutside:xe,handleMenuScroll:Oe,handleMenuKeydown:ke,handleMenuMousedown:De,mergedTheme:s,cssVars:a?void 0:Pe,themeClass:Fe?.themeClass,onRender:Fe?.onRender}},render(){return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${this.mergedClsPrefix}-select`)},[(0,r.createVNode)(W_,null,{_:1,default:Hg(()=>[((0,r.openBlock)(),(0,r.createBlock)(G_,null,{_:1,default:Hg(()=>((0,r.openBlock)(),(0,r.createBlock)(PS,{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},{_:1,arrow:Hg(()=>[this.$slots.arrow?.()])},8,`inlineThemeDisabled.status.inputProps.clsPrefix.showArrow.maxTagCount.ellipsisTagPopoverProps.bordered.active.pattern.placeholder.selectedOption.selectedOptions.multiple.renderTag.renderLabel.filterable.clearable.disabled.size.theme.labelField.valueField.themeOverrides.loading.focused.onClick.onDeleteOption.onPatternInput.onClear.onBlur.onFocus.onKeydown.onPatternBlur.onPatternFocus.onResize.ignoreComposition`.split(`.`))))})),((0,r.openBlock)(),(0,r.createBlock)(yv,{ref:`followerRef`,show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===ph.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?`target`:void 0,minWidth:`target`,placement:this.placement},{_:1,default:Hg(()=>((0,r.openBlock)(),(0,r.createBlock)(r.Transition,{name:`fade-in-scale-up-transition`,appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{_:1,default:Hg(()=>this.mergedShow||this.displayDirective===`show`?(this.onRender?.(),(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)(Ax,(0,r.mergeProps)(this.menuProps,{ref:`menuRef`,onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,this.menuProps?.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:[this.menuProps?.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,scrollbarProps:this.scrollbarProps}),{_:1,empty:Hg(()=>[this.$slots.empty?.()]),header:Hg(()=>[this.$slots.header?.()]),action:Hg(()=>[this.$slots.action?.()])},16,`onResize.inlineThemeDisabled.virtualScroll.class.clsPrefix.labelField.valueField.nodeProps.theme.themeOverrides.treeMate.multiple.size.renderOption.renderLabel.value.style.onToggle.onScroll.onFocus.onBlur.onKeydown.onTabOut.onMousedown.show.showCheckmark.resetMenuOnOptionsChange.scrollbarProps`.split(`.`))),this.displayDirective===`show`?[[r.vShow,this.mergedShow],[Y_,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[Y_,this.handleMenuClickOutside,void 0,{capture:!0}]])):null)},8,[`appear`,`onAfterLeave`])))},8,[`show`,`to`,`teleportDisabled`,`containerClass`,`width`,`placement`]))])})],2)}}),KS=(0,r.defineComponent)({__name:`searchable-reference-select`,props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:``}},emits:[`update:value`],setup(e,{expose:t,emit:i}){let a=e,o=i,s=(0,r.computed)(()=>(0,n.isArray)(a.value)),c=(0,r.computed)(()=>s.value?a.value.map(e=>e.id):a.value?a.value.id:null),l=(0,r.ref)(s.value?a.optionsListConverter(a.value):a.value?a.optionsListConverter([a.value]):[]);(0,r.watch)(()=>a.value,e=>{let t=((0,n.isArray)(e)?e:e?[e]:[]).filter(e=>!l.value.some(t=>t.value===e.id));t.length>0&&(l.value=[...a.optionsListConverter(t),...l.value])},{deep:1});let u=(0,r.computed)(()=>l.value.map(e=>({...e,class:a.wrapContent?`${e.class} consistent-menu-width`:e.class}))),d=(0,r.ref)(!1),f=(0,r.useTemplateRef)(`select-component`),p=e=>{e.length<a.minTermLength||(d.value=!0,a.searchDataHandler(e,d).then(e=>{if((0,n.isEmpty)(e))return;let t=s.value?a.value:a.value?[a.value]:[],r=e.filter(e=>!t.some(t=>t.id===e.id));l.value=a.optionsListConverter([...t,...r])}).finally(()=>{d.value=!1}))},m=``,h=(0,n.debounce)(()=>p(m),800),g=e=>{m=e,h()},_=e=>{if((0,n.isArray)(e)){let t=e.length>0?e.map(e=>(0,r.toRaw)(l.value.find(t=>t.value===e)?.item)):[];o(`update:value`,t)}else if(e>0){let t=(0,r.toRaw)(l.value.find(t=>t.value===e)?.item);o(`update:value`,t)}else o(`update:value`,null)};return t({focus:()=>f.value?.focusInput(),blur:()=>f.value?.blurInput()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(GS),{ref:`select-component`,"clear-filter-after-select":!0,clearable:e.clearable,"consistent-menu-width":e.consistentMenuWidth,disabled:e.disabled,filterable:!0,loading:d.value,multiple:s.value,options:u.value,placeholder:e.placeholder,remote:!0,value:c.value,"render-label":e.renderLabel,"render-tag":e.renderTag,onSearch:g,"onUpdate:value":_},null,8,[`clearable`,`consistent-menu-width`,`disabled`,`loading`,`multiple`,`options`,`placeholder`,`value`,`render-label`,`render-tag`]))}}),qS=(0,r.defineComponent)({__name:`searchable-product-select`,props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:``},searchType:{}},emits:[`update:value`],setup(e,{expose:n,emit:i}){let a=e,o=i,s=(0,r.useTemplateRef)(`select-component`),c=async e=>a.searchType===`categories`?t.HttpRequester.getInstance(t.ProductCategoryDataProvider).publicSimpleSearch(e):a.searchType===`products`?t.HttpRequester.getInstance(t.ProductDataProvider).publicSimpleSearch(e):new Promise(e=>{e([])}),l=e=>a.searchType===`categories`?Ce.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e?.isNewRec()?`-`:e.name):a.searchType===`products`?Ce.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e?.isNewRec()?`-`:`[${e.code}] ${e.name}`):[],u=(e,t)=>{if(a.renderLabel)return a.renderLabel(e,t);if(a.searchType===`products`){let t=e.item;return(0,r.h)(`div`,{},[(0,r.h)(`span`,{class:`text-sc-grey mr-2.5`},t.code),(0,r.h)(`span`,{},[t.name])])}if(a.searchType===`categories`){let t=e.item;return(0,r.h)(`div`,{},[t.name])}};return n({focus:()=>s.value?.focus(),blur:()=>s.value?.blur()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)(KS,{ref:`select-component`,value:e.value,clearable:e.clearable,disabled:e.disabled,placeholder:e.placeholder,"search-data-handler":c,"options-list-converter":l,"consistent-menu-width":e.consistentMenuWidth,"wrap-content":e.wrapContent,"min-term-length":e.minTermLength,"render-label":u,"render-tag":e.renderTag,"onUpdate:value":n[0]||=e=>o(`update:value`,e)},null,8,[`value`,`clearable`,`disabled`,`placeholder`,`consistent-menu-width`,`wrap-content`,`min-term-length`,`render-tag`]))}}),JS={class:`col-span-2 flex flex-row gap-2.5`},YS={class:`flex-1`},XS={class:`text-sc-grey`},ZS={class:`ml-2.5`},QS={key:0,class:`flex-none`},$S=(0,r.defineComponent)({__name:`products-list`,props:{value:{},searchType:{},minTermLength:{default:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3},disabled:{type:Boolean}},emits:[`update:value`],setup(e,{emit:t}){let i=e,a=t,s=(0,r.ref)(null),c=()=>structuredClone((0,r.toRaw)(i.value)),l=(0,r.ref)(c()),u=()=>{a(`update:value`,l.value.map(e=>(0,r.toRaw)(e)))},d=e=>{e&&(l.value=[...l.value.map(e=>(0,r.toRaw)(e)),...((0,n.isArray)(e)?e:[e]).filter(e=>!l.value.some(t=>t.id===e.id))],(0,r.nextTick)(()=>{s.value=null}),u())},f=e=>{e&&(l.value=l.value.map(t=>t.id===e.id?e:(0,r.toRaw)(t)),u())},p=e=>{l.value=l.value.filter(t=>t.id!==e.id),u()};return(0,r.watch)(()=>i.value,()=>{l.value=c()}),(t,n)=>{let i=o.NListItem,a=Bm,c=o.NButton,u=o.NList;return(0,r.openBlock)(),(0,r.createBlock)(u,{"show-divider":!1,hoverable:!0},{header:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`header`)]),footer:(0,r.withCtx)(()=>[(0,r.createVNode)(qS,{value:s.value,"onUpdate:value":[n[0]||=e=>s.value=e,d],clearable:!0,disabled:e.disabled,"min-term-length":e.minTermLength,"search-type":e.searchType,placeholder:`Введите название`},null,8,[`value`,`disabled`,`min-term-length`,`search-type`])]),default:(0,r.withCtx)(()=>[l.value.length===0?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,class:`text-center text-sm text-gray-600`},{default:(0,r.withCtx)(()=>[...n[1]||=[(0,r.createTextVNode)(` --- Список пуст --- `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(l.value,n=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:n.id},{suffix:(0,r.withCtx)(()=>[(0,r.createVNode)(c,{disabled:e.disabled,quaternary:``,type:`error`,onClick:e=>p(n)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`disabled`,`onClick`])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,JS,[(0,r.createElementVNode)(`span`,YS,[(0,r.createElementVNode)(`span`,XS,(0,r.toDisplayString)(n.code),1),(0,r.createElementVNode)(`span`,ZS,(0,r.toDisplayString)(n.name),1)]),t.$slots[`item-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,QS,[(0,r.renderSlot)(t.$slots,`item-extra`,{item:n,updateItemCallback:f})])):(0,r.createCommentVNode)(``,!0)])]),_:2},1024))),128))]),_:3})}}}),eC={class:`flex flex-col`},tC={class:`flex flex-col gap-1.5 text-base text-nowrap`},nC={class:`font-medium`},rC={class:`flex flex-col text-sc-dark-grey`},iC={key:0},aC={class:`font-medium`},oC={class:`font-medium`},sC={class:`font-medium`},cC={class:`font-medium`},lC={class:`font-medium`},uC={class:`font-medium`},dC={class:`font-medium`},fC={class:`font-medium`},pC={class:`font-medium`},mC={class:`font-medium`},hC={class:`flex flex-col gap-1.5 text-base text-nowrap`},gC={class:`font-medium`},_C={class:`flex flex-col text-sc-dark-grey`},vC={class:`font-medium`},yC={class:`font-medium`},bC={class:`flex flex-col gap-1.5 text-base text-nowrap`},xC={class:`font-medium`},SC={class:`text-sc-dark-grey`},CC={class:`font-medium`},wC={class:`text-xs`},TC={key:1,class:`text-base font-medium text-nowrap`},EC=yt((0,r.defineComponent)({__name:`order-item-params`,props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},updateQuantityOnInput:{type:Boolean,default:!0}},setup(e){let n=[t.ConfiguratorsEnum.Kozyrek,t.ConfiguratorsEnum.Mosquitto,t.ConfiguratorsEnum.Strip,t.ConfiguratorsEnum.MetalForDoors,t.ConfiguratorsEnum.Sandwich,t.ConfiguratorsEnum.SandwichM2],i=e,a=(0,r.ref)(!1),s=(0,r.computed)(()=>i.item),c=(0,r.computed)(()=>i.item.product.unit?.isLinear&&i.item.product.properties?.isLengthConfigurator),l=(0,r.computed)(()=>t.UnitsHelper.getProductLengthMultiplicity(i.item.product)),u=(0,r.computed)(()=>xe.multiplyByStep(i.item.quantity,l.value)),d=(0,r.computed)(()=>t.UnitsHelper.getProductMultiplicity(i.item.product)),f=(0,r.computed)(()=>d.value>1),p=(0,r.ref)({quantity:i.item.quantity});(0,r.watch)(()=>i.item,e=>{p.value={quantity:e.quantity}});let m=e=>{e!==null&&(p.value.quantity=e,i.eventEmitter?.emit(`order-item:edit-quantity`,{item:s.value,quantity:e,loaderRef:a}))},h=()=>{i.eventEmitter?.emit(`order-item:open-configurator`,{item:s.value})},g=()=>{i.eventEmitter?.emit(`order-item:edit`,{item:s.value})};return(i,s)=>{let _=o.NInputNumber;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,eC,[e.item.configurator&&e.item.configuratorParams&&n.includes(e.item.configurator)?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createElementVNode)(`div`,tC,[(0,r.createElementVNode)(`span`,null,[s[1]||=(0,r.createTextVNode)(` Количество: `,-1),(0,r.createElementVNode)(`span`,nC,(0,r.toDisplayString)(e.item.quantity)+` шт.`,1)]),(0,r.createElementVNode)(`div`,rC,[e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).Kozyrek?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,iC,[s[2]||=(0,r.createTextVNode)(` Длина: `,-1),(0,r.createElementVNode)(`span`,aC,(0,r.toDisplayString)(Math.round(e.item.length*1e3))+` мм.`,1)])):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).Mosquitto?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[(0,r.createElementVNode)(`span`,null,[s[3]||=(0,r.createTextVNode)(` Ширина: `,-1),(0,r.createElementVNode)(`span`,oC,(0,r.toDisplayString)(Math.round(e.item.width*1e3))+` мм.`,1)]),(0,r.createElementVNode)(`span`,null,[s[4]||=(0,r.createTextVNode)(` Высота: `,-1),(0,r.createElementVNode)(`span`,sC,(0,r.toDisplayString)(Math.round(e.item.height*1e3))+` мм.`,1)])],64)):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).Strip?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:2},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.item.configuratorParams.linesWidths,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:t},[(0,r.createTextVNode)(` Полоса №`+(0,r.toDisplayString)(Number(t)+1)+`: `,1),(0,r.createElementVNode)(`span`,cC,(0,r.toDisplayString)(e)+` мм.`,1)]))),128)),(0,r.createElementVNode)(`span`,null,[s[5]||=(0,r.createTextVNode)(` Метраж: `,-1),(0,r.createElementVNode)(`span`,lC,(0,r.toDisplayString)(e.item.length)+` м.`,1)])],64)):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).MetalForDoors?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:3},[(0,r.createElementVNode)(`span`,null,[s[6]||=(0,r.createTextVNode)(` Ширина: `,-1),(0,r.createElementVNode)(`span`,uC,(0,r.toDisplayString)(e.item.width)+` мм.`,1)]),(0,r.createElementVNode)(`span`,null,[s[7]||=(0,r.createTextVNode)(` Длина: `,-1),(0,r.createElementVNode)(`span`,dC,(0,r.toDisplayString)(Math.round(e.item.length*1e3))+` мм.`,1)])],64)):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).Sandwich?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:4},(0,r.renderList)(e.item.configuratorParams.items??[],(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:t},[(0,r.createTextVNode)(` Изделие №`+(0,r.toDisplayString)(Number(t)+1)+`: `,1),(0,r.createElementVNode)(`span`,fC,(0,r.toDisplayString)(e.width)+`×`+(0,r.toDisplayString)(e.length)+` мм, `+(0,r.toDisplayString)(e.count)+` шт.`,1)]))),128)):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).SandwichM2?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:5},[(0,r.createElementVNode)(`span`,null,[s[8]||=(0,r.createTextVNode)(` Ширина: `,-1),(0,r.createElementVNode)(`span`,pC,(0,r.toDisplayString)(Math.round(e.item.width*1e3))+` мм.`,1)]),(0,r.createElementVNode)(`span`,null,[s[9]||=(0,r.createTextVNode)(` Длина: `,-1),(0,r.createElementVNode)(`span`,mC,(0,r.toDisplayString)(Math.round(e.item.length*1e3))+` мм.`,1)])],64)):(0,r.createCommentVNode)(``,!0)])]),e.allowEdit?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`#`,class:`text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5`,onClick:(0,r.withModifiers)(h,[`prevent`])},` Изменить `)):(0,r.createCommentVNode)(``,!0)],64)):c.value&&l.value>0?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[(0,r.createElementVNode)(`div`,hC,[(0,r.createElementVNode)(`span`,null,[s[10]||=(0,r.createTextVNode)(` Количество: `,-1),(0,r.createElementVNode)(`span`,gC,(0,r.toDisplayString)(e.item.quantity)+` шт.`,1)]),(0,r.createElementVNode)(`div`,_C,[(0,r.createElementVNode)(`span`,null,[s[11]||=(0,r.createTextVNode)(` Длина: `,-1),(0,r.createElementVNode)(`span`,vC,(0,r.toDisplayString)(l.value)+` `+(0,r.toDisplayString)(e.item.product.unit.name),1)]),(0,r.createElementVNode)(`span`,null,[s[12]||=(0,r.createTextVNode)(` Всего: `,-1),(0,r.createElementVNode)(`span`,yC,(0,r.toDisplayString)(u.value)+` `+(0,r.toDisplayString)(e.item.product.unit.name),1)])])]),e.allowEdit?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`#`,class:`text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5`,onClick:(0,r.withModifiers)(g,[`prevent`])},` Изменить `)):(0,r.createCommentVNode)(``,!0)],64)):e.item.product.getIsMeasurable()?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:2},[(0,r.createElementVNode)(`div`,bC,[(0,r.createElementVNode)(`span`,null,[s[13]||=(0,r.createTextVNode)(` Количество: `,-1),(0,r.createElementVNode)(`span`,xC,(0,r.toDisplayString)(e.item.quantity)+` шт.`,1)]),(0,r.createElementVNode)(`span`,SC,[s[14]||=(0,r.createTextVNode)(` Метраж: `,-1),(0,r.createElementVNode)(`span`,CC,(0,r.toDisplayString)(e.item.length??e.item.width)+` `+(0,r.toDisplayString)(e.item.product.unit.name),1)])]),e.allowEdit?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`#`,class:`text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5`,onClick:(0,r.withModifiers)(g,[`prevent`])},` Изменить `)):(0,r.createCommentVNode)(``,!0)],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:3},[e.allowEdit?((0,r.openBlock)(),(0,r.createBlock)(_,{key:0,value:p.value.quantity,parse:(0,r.unref)(ve),min:d.value,step:d.value,"show-button":f.value,"button-placement":`both`,"update-value-on-input":e.updateQuantityOnInput,disabled:!!a.value,loading:a.value||void 0,placeholder:`Кол-во`,size:`small`,class:`min-w-16 grow`,onKeydown:s[0]||=e=>(0,r.unref)(_e)(e,`.`,!1),onFocus:(0,r.unref)(be),"onUpdate:value":m},{suffix:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,wC,(0,r.toDisplayString)(e.item.product.unit.name),1)]),_:1},8,[`value`,`parse`,`min`,`step`,`show-button`,`update-value-on-input`,`disabled`,`loading`,`onFocus`])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,TC,(0,r.toDisplayString)(e.item.quantity)+` `+(0,r.toDisplayString)(e.item.product.unit.name),1))],64))])}}}),[[`__scopeId`,`data-v-cdbe0119`]]),DC={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function OC(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,DC,[...t[0]||=[(0,r.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)]])}var kC=(0,r.markRaw)({name:`tabler-truck-filled`,render:OC}),AC={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function jC(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,AC,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.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`}),(0,r.createElementVNode)(`path`,{d:`M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4`})],-1)]])}var MC=(0,r.markRaw)({name:`tabler-truck-delivery`,render:jC}),NC={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function PC(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,NC,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.createElementVNode)(`path`,{d:`M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15`}),(0,r.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)]])}var FC=(0,r.markRaw)({name:`tabler-truck-loading`,render:PC}),IC={class:`flex flex-col gap-1`},LC={key:0,class:`flex flex-row gap-1 text-sm text-sc-grey`},RC={key:1,class:`text-base`},zC={class:`text-sc-dark-grey mr-1.5`},BC={key:0},VC={key:1},HC=(0,r.defineComponent)({__name:`order-delivery-label`,props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){let n=(0,r.computed)(()=>(0,t.useReferencesStore)().deliveryTypeReference?.find(e=>e.id===s.delivery.type)),a=(0,r.computed)(()=>(0,i.format)(s.delivery.date,`dd.MM.yyyy`)),o=(0,r.computed)(()=>s.delivery.address?.address?he.getFormatEntityName({name:s.delivery.address.address,deletedAt:s.delivery.address.deletedAt}):``),s=e;return(t,i)=>{let s=FC,c=MC,l=kC;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,IC,[e.showType?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,LC,[n.value?.slug===`self_delivery`?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0})):(0,r.createCommentVNode)(``,!0),n.value?.slug===`delivery`?((0,r.openBlock)(),(0,r.createBlock)(c,{key:1})):(0,r.createCommentVNode)(``,!0),n.value?.slug===`transport_company_delivery`?((0,r.openBlock)(),(0,r.createBlock)(l,{key:2})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,null,(0,r.toDisplayString)(n.value?.name),1)])):(0,r.createCommentVNode)(``,!0),e.showDetails?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,RC,[(0,r.createElementVNode)(`span`,zC,(0,r.toDisplayString)(a.value),1),e.delivery?.address?.address?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,BC,(0,r.toDisplayString)(o.value),1)):(0,r.createCommentVNode)(``,!0),e.delivery?.warehouse?.address?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,VC,` со склада `+(0,r.toDisplayString)(e.delivery.warehouse.address),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)])}}}),UC={class:`flex flex-col gap-2.5`},WC={class:`text-base`},GC=[`href`],KC={key:1,class:`text-sc-grey`},qC=(0,r.defineComponent)({__name:`order-common-info`,props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{},highlightSettings:{}},setup(e){let n=e,i=(0,r.computed)(()=>n.fields.includes(N.Id)?n.order.id:void 0),a=(0,r.computed)(()=>n.fields.includes(N.Status)?(0,t.useReferencesStore)().orderStatusReference?.find(e=>e.id===(n.order.status?.id??-1))?.name:void 0),o=(0,r.computed)(()=>k(n.order.status?.slug)),s=(0,r.computed)(()=>{let e=n.order.status?.slug;return!!e&&(n.highlightSettings?.statuses.includes(e)??!1)}),c=(0,r.computed)(()=>ie(n.order).filter(e=>[E.OnOrder,E.NotInStock].includes(e))),l=e=>n.highlightSettings?.markers.includes(e)??!1,u=(0,r.computed)(()=>n.fields.includes(N.CreatedAt)),d=(0,r.computed)(()=>n.fields.includes(N.ClientInfo)||n.fields.includes(N.ClientInfoShort)?n.order.client:void 0),f=(0,r.computed)(()=>n.fields.includes(N.DeliveryInfo)?n.order.delivery:void 0);return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,UC,[(0,r.createElementVNode)(`span`,WC,[i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:e.orderUrl.replace(`:id`,e.order.id.toString()),target:`_blank`,class:`text-sc-dark-grey`},` #`+(0,r.toDisplayString)(i.value),9,GC)):(0,r.createCommentVNode)(``,!0),u.value?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[n[0]||=(0,r.createTextVNode)(` от `,-1),(0,r.createVNode)(qp,{date:e.order.createdAt,"is-time-secondary":!0},null,8,[`date`])],64)):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:2},[n[1]||=(0,r.createTextVNode)(` - `,-1),s.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:`font-medium`,style:(0,r.normalizeStyle)({color:o.value.color})},(0,r.toDisplayString)(a.value),5)):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,KC,(0,r.toDisplayString)(a.value),1))],64)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(c.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e},[n[2]||=(0,r.createTextVNode)(` - `,-1),(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"font-medium":l(e),"text-sc-dark-grey":!l(e)}),style:(0,r.normalizeStyle)(l(e)?{color:(0,r.unref)(M)(e).color}:void 0)},(0,r.toDisplayString)((0,r.unref)(re)(e)),7)],64))),128))]),d.value?((0,r.openBlock)(),(0,r.createBlock)(ed,{key:0,client:d.value,class:`ml-3`},null,8,[`client`])):(0,r.createCommentVNode)(``,!0),f.value?((0,r.openBlock)(),(0,r.createBlock)(HC,{key:1,delivery:f.value,class:`ml-3`},null,8,[`delivery`])):(0,r.createCommentVNode)(``,!0)]))}}),JC=(0,r.defineComponent)({__name:`order-payment`,props:{payment:{}},setup(e){let n=e,i=(0,r.computed)(()=>(0,t.useReferencesStore)().paymentTypeReference?.find(e=>e.id===n.payment.type));return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,null,(0,r.toDisplayString)(i.value?.name??`-`),1))}}),YC=(0,r.defineComponent)({__name:`order-item-specification`,props:{src:{}},setup(e){let t=(0,r.useTemplateRef)(`image-reference`);return(n,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)(`a`,{class:`text-blue-500 hover:underline text-sm mt-1 block cursor-pointer`,onClick:i[0]||=e=>t.value?.showPreview()},` Спецификация `),(0,r.withDirectives)((0,r.createVNode)((0,r.unref)(o.NImage),{ref:`image-reference`,src:e.src,"previewed-img-props":{style:`max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;`}},null,8,[`src`]),[[r.vShow,!1]])],64))}}),XC=(0,r.defineComponent)({__name:`creator-user-type-tag`,props:{userType:{default:void 0},prefixText:{default:`Добавлено`},variant:{default:`info`},changedFields:{default:void 0}},setup(e){let n=e,i={quantity:`количество`,length:`длина`},a=(0,r.computed)(()=>n.variant===`danger`||n.changedFields?`bg-orange-500`:`bg-sky-500`),o=(0,r.computed)(()=>{let e={[t.UserTypeEnum.Manager]:`менеджером`,[t.UserTypeEnum.Operator]:`оператором`,[t.UserTypeEnum.Client]:`клиентом`,[t.UserTypeEnum.Admin]:`администратором`};if(n.changedFields){let t=n.changedFields.map(e=>i[e]??e).join(`, `);return`Было изменено${n.userType?` ${e[n.userType]??``}`:``}: ${t}`}let r=n.userType?` ${e[n.userType]??``}`:``;return`${n.prefixText}${r}`.trim()});return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`small`,{class:(0,r.normalizeClass)(`inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white no-underline opacity-100 ${a.value}`)},(0,r.toDisplayString)(o.value),3))}}),ZC={class:`flex flex-col gap-0.5`},QC={class:`text-gray-600`},$C=(0,r.defineComponent)({__name:`order-item-name`,props:{item:{},showCode:{type:Boolean,default:!1},inactive:{type:Boolean,default:void 0}},setup(e){let n=e,i=(0,r.inject)(t.currentOrderInjectionKey,null),a=(0,r.computed)(()=>{if(i!=null)return(0,r.toValue)(i)??void 0}),o=(0,r.computed)(()=>{let{item:e,inactive:t}=n;return t??(!!e.isRemoved||!!e.replacementId)}),s=(0,r.computed)(()=>{let{creator:e}=n.item;return!!e?.type&&(!a.value||a.value.creator.guid!==e.guid)}),c=(0,r.computed)(()=>`specificationImgUrl`in n.item?n.item.specificationImgUrl:void 0),l=(0,r.computed)(()=>`changedFields`in n.item?n.item.changedFields:[]),u=(0,r.computed)(()=>`replacement`in n.item?n.item.replacement?.creator?.type:void 0);return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ZC,[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)(o.value?`line-through opacity-50`:``)},[(0,r.createVNode)(er,{product:e.item.product,"show-additional-sale-icon":e.item.isAdditionalSale??!1,"show-code":e.showCode},null,8,[`product`,`show-additional-sale-icon`,`show-code`])],2),e.item.marker?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)(o.value?`line-through opacity-50`:``)},[n[0]||=(0,r.createTextVNode)(` Маркировка: `,-1),(0,r.createElementVNode)(`span`,QC,(0,r.toDisplayString)(e.item.marker),1)],2)):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:1,class:(0,r.normalizeClass)(o.value?`line-through opacity-50`:``)},[(0,r.createVNode)(YC,{src:c.value},null,8,[`src`])],2)):(0,r.createCommentVNode)(``,!0),s.value&&!o.value?((0,r.openBlock)(),(0,r.createBlock)(XC,{key:2,"user-type":e.item.creator.type,class:`mt-1 self-start`,"prefix-text":`Добавлено`},null,8,[`user-type`])):(0,r.createCommentVNode)(``,!0),e.item.isRemoved&&!e.item.replacementId&&l.value.length===0?((0,r.openBlock)(),(0,r.createBlock)(XC,{key:3,class:`mt-1 self-start`,"prefix-text":`Удалено`,variant:`danger`})):(0,r.createCommentVNode)(``,!0),e.item.replacementId&&l.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(XC,{key:4,"user-type":u.value,"changed-fields":l.value,class:`mt-1 self-start`},null,8,[`user-type`,`changed-fields`])):(0,r.createCommentVNode)(``,!0)]))}}),ew={class:`flex flex-row gap-1.5`},tw={class:`flex flex-1 flex-col gap-2.5`},nw={class:`flex items-start gap-1`},rw=(0,r.defineComponent)({__name:`order-product-info`,props:{product:{},index:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},updateQuantityOnInput:{type:Boolean,default:!0},inactive:{type:Boolean,default:!1},showActions:{type:Boolean,default:void 0}},setup(e){let t=e,n=(0,r.computed)(()=>t.inactive?`line-through opacity-50`:``);return(t,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ew,[(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)([`flex-none text-nowrap`,n.value])},(0,r.toDisplayString)(e.index+1)+`. `,3),(0,r.createElementVNode)(`div`,tw,[(0,r.createVNode)($C,{item:e.product,inactive:e.inactive,"show-code":``},null,8,[`item`,`inactive`]),(0,r.createElementVNode)(`div`,nw,[(0,r.createVNode)(EC,{item:e.product,"event-emitter":e.eventEmitter,"allow-edit":e.allowEdit,"update-quantity-on-input":e.updateQuantityOnInput,class:(0,r.normalizeClass)([`min-w-0 flex-1`,n.value])},null,8,[`item`,`event-emitter`,`allow-edit`,`update-quantity-on-input`,`class`]),e.showActions??e.allowEdit?(0,r.renderSlot)(t.$slots,`actions`,{},void 0,void 0,0):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`grid grid-flow-col grid-rows-2 gap-1 text-base`,n.value])},[i[0]||=(0,r.createElementVNode)(`span`,null,`Цена за ед.`,-1),(0,r.createVNode)(Bt,{product:e.product,"cost-field-name":`costOneRub`},null,8,[`product`]),i[1]||=(0,r.createElementVNode)(`span`,null,`Сумма`,-1),(0,r.createVNode)(Bt,{product:e.product,"cost-field-name":`cost`},null,8,[`product`])],2),(0,r.renderSlot)(t.$slots,`extra`)])]))}}),iw={class:`flex items-center gap-1.5`},aw={key:0,class:`h-1.5 w-1.5 shrink-0 rounded-full bg-current`},ow={key:0,class:`h-1.5 w-1.5 shrink-0 rounded-full bg-current`},sw=(0,r.defineComponent)({__name:`order-status-tag`,props:{status:{},statusDetail:{default:null},variant:{default:`filled`},size:{default:`medium`},showDot:{type:Boolean,default:!0}},setup(e){let t=e,n=(0,r.computed)(()=>k(t.status.slug)),i=(0,r.computed)(()=>A(t.status.slug)),a=(0,r.computed)(()=>t.statusDetail?`${t.status.name} (${t.statusDetail.name})`:t.status.name);return(t,s)=>{let c=o.NTag;return e.variant===`filled`?((0,r.openBlock)(),(0,r.createBlock)(c,{key:0,color:i.value,bordered:!1,size:e.size,round:``},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,iw,[e.showDot?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,aw)):(0,r.createCommentVNode)(``,!0),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(a.value),1)])]),_:1},8,[`color`,`size`])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:1,class:`inline-flex items-center gap-1.5 font-medium`,style:(0,r.normalizeStyle)({color:n.value.color})},[e.showDot?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,ow)):(0,r.createCommentVNode)(``,!0),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(a.value),1)],4))}}}),cw=(0,r.defineComponent)({__name:`order-color-swatch`,props:{colors:{}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{class:`inline-flex h-5 min-w-8 shrink-0 items-center justify-center rounded px-1.5 text-xs font-semibold leading-none`,style:(0,r.normalizeStyle)({backgroundColor:e.colors.backgroundColor,color:e.colors.textOnBackgroundColor,border:`1px solid ${e.colors.color}`})},` Аа `,4))}}),lw={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function uw(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,lw,[...t[0]||=[(0,r.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),(0,r.createElementVNode)(`path`,{fill:`currentColor`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`32`,d:`M80 112h352`},null,-1),(0,r.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)]])}var dw=(0,r.markRaw)({name:`ion-trash-outline`,render:uw}),fw={key:0,class:`!mb-3 !mt-0 text-base font-semibold`},pw={class:`mb-1 flex flex-wrap items-baseline justify-between gap-2`},mw={class:`flex items-baseline gap-2`},hw={class:`text-base font-bold text-sc-dark-grey`},gw={key:0,class:`text-sm text-sc-grey`},_w={key:0,class:`text-sm text-sc-dark-grey`},vw=yt((0,r.defineComponent)({__name:`order-items-list`,props:(0,r.mergeModels)({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},title:{default:`Список позиций`},groups:{default:void 0},extraColumns:{default:void 0},isItemInactive:{type:Function,default:void 0},isItemSelectable:{type:Function,default:void 0},isItemRemovable:{type:Function,default:void 0},updateQuantityOnInput:{type:Boolean,default:!0}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:[`update:selectedRowKeys`],setup(e){let t=e,i=(0,r.useModel)(e,`selectedRowKeys`),a=e=>(0,n.sortBy)(e,`ord`),s=(0,r.computed)(()=>a(t.products)),c=e=>t.isItemInactive?t.isItemInactive(e):!!e.isRemoved||!!e.replacementId,l=e=>t.isItemSelectable?t.isItemSelectable(e):!c(e),u=e=>t.isItemRemovable?t.isItemRemovable(e):!c(e),d=(e,t)=>{t?i.value.includes(e)||(i.value=[...i.value,e]):i.value=i.value.filter(t=>t!==e)},f=e=>t.selectable?{class:i.value.includes(e.id)?void 0:`opacity-60`}:{},p=(e,t)=>{let n=s.value,r=e.logicGroupId;if(!r)return 1;let i=n.at(t-1);if(t&&i&&i.logicGroupId===r)return 0;let a=n.slice(t),o=a.findIndex(e=>e.logicGroupId!==r);return o===-1?a.length:o},m=e=>u(e)?(0,r.h)(o.NButton,{quaternary:!0,size:`small`,type:`error`,onClick:()=>{t.eventEmitter?.emit(`order-item:delete`,{item:e})}},()=>(0,r.h)(dw)):null,h=(e,i)=>(t.extraColumns??[]).flatMap(t=>{let a=t.render?.(e,i);if((0,n.isNil)(a)||a===``||a===!1)return[];let o=(0,n.isFunction)(t.title)?t.title(t):t.title;return[(0,r.h)(`div`,{class:`flex flex-col items-start gap-1 text-sm`},[(0,r.h)(`span`,{class:`text-sc-dark-grey`},[o]),a])]}),g=(0,r.ref)(F.getDeviceTypeByResolution()),_=(0,r.ref)(window.innerWidth),v=(0,r.computed)(()=>!(0,n.isNil)(t.maxHeight)||!(0,n.isNil)(t.groups)),y=()=>{let e=[{title:`№ п.п.`,key:`id`,resizable:!0,width:64,render:(e,t)=>(0,r.h)(`span`,{class:`text-base text-nowrap${c(e)?` line-through opacity-50`:``}`},[t+1,`.`])},{title:`Артикул`,key:`codeNumber`,resizable:!0,width:_.value>=1536?156:120,render:e=>(0,r.h)(`span`,{class:`text-base${c(e)?` line-through opacity-50`:``}`},[e.product.code])},{title:`Наименование`,key:`name`,resizable:!0,minWidth:(0,n.isNil)(t.groups)?void 0:240,render:e=>(0,r.h)($C,{item:e,inactive:c(e)})},{title:`Кол-во`,key:`quantity`,resizable:!0,width:180,rowSpan:p,render:e=>(0,r.h)(EC,{class:c(e)?`line-through opacity-50`:``,item:e,eventEmitter:t.eventEmitter,allowEdit:t.allowEdit&&!c(e),updateQuantityOnInput:t.updateQuantityOnInput})},{title:`Цена за ед.`,key:`costOneRub`,resizable:!0,width:v.value?170:120,render:e=>(0,r.h)(`div`,{class:c(e)?`line-through opacity-50`:``},[(0,r.h)(Bt,{product:e,costFieldName:`costOne`,showQuantityUnit:!0})])},{title:`Сумма`,key:`cost`,resizable:!0,width:v.value?140:120,render:e=>(0,r.h)(`div`,{class:c(e)?`line-through opacity-50`:``},[(0,r.h)(Bt,{product:e,costFieldName:`cost`,showCurrency:!0})])},...t.extraColumns??[],...t.allowEdit?[{title:``,key:`delete`,width:44,rowSpan:p,render:e=>m(e)}]:[]],a=t.selectable?[{key:`checkbox`,title:``,className:`align-top`,width:`32`,cellProps:e=>({class:l(e)?`cursor-pointer`:void 0,onClick:()=>{l(e)&&d(e.id,!i.value.includes(e.id))}}),render:e=>(0,r.h)(o.NCheckbox,{checked:i.value.includes(e.id),disabled:!l(e)})}]:[];switch(g.value){case P.phone:case P.tablet:return[...a,{title:``,key:`items`,resizable:!0,render:(e,n)=>{let i=p(e,n)>0,a=t.allowEdit&&!c(e)&&i;return(0,r.h)(rw,{product:e,index:n,eventEmitter:t.eventEmitter,allowEdit:a,updateQuantityOnInput:t.updateQuantityOnInput,inactive:c(e),showActions:t.allowEdit&&i},{actions:()=>m(e),extra:()=>h(e,n)})}}];case P.laptop:return[...a,...e];default:return[...a,...e]}},b=(0,r.computed)(()=>y()),x=e=>{let t=e.width??e.minWidth;return(0,n.isNil)(t)?0:Number.parseFloat(String(t))||0},S=(0,r.computed)(()=>g.value===P.phone||g.value===P.tablet?void 0:(0,n.sumBy)(b.value,x)),C=()=>{g.value=F.getDeviceTypeByResolution(),_.value=window.innerWidth};return(0,r.onMounted)(()=>{C(),window.addEventListener(`resize`,C)}),(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,C)}),(t,n)=>{let i=o.NDataTable;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[e.title?((0,r.openBlock)(),(0,r.createElementBlock)(`h3`,fw,(0,r.toDisplayString)(e.title),1)):(0,r.createCommentVNode)(``,!0),e.groups?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(e.groups,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:t.name,class:`mb-6 last:mb-0`},[(0,r.createElementVNode)(`div`,pw,[(0,r.createElementVNode)(`div`,mw,[(0,r.createElementVNode)(`span`,hw,(0,r.toDisplayString)(t.name),1),t.description?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,gw,(0,r.toDisplayString)(t.description),1)):(0,r.createCommentVNode)(``,!0)]),t.summary?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,_w,(0,r.toDisplayString)(t.summary),1)):(0,r.createCommentVNode)(``,!0)]),(0,r.createVNode)(i,{columns:b.value,data:a(t.items),"row-key":e=>e.id,"row-props":f,"bottom-bordered":!1,bordered:!1,"max-height":e.maxHeight,"scroll-x":S.value,"table-layout":`fixed`},null,8,[`columns`,`data`,`row-key`,`max-height`,`scroll-x`])]))),128)):((0,r.openBlock)(),(0,r.createBlock)(i,{key:2,columns:b.value,data:s.value,"row-key":e=>e.id,"row-props":f,"bottom-bordered":!1,bordered:!1,"max-height":e.maxHeight},null,8,[`columns`,`data`,`row-key`,`max-height`]))],64)}}}),[[`__scopeId`,`data-v-76fe9dca`]]),yw={key:0,class:`text-sc-dark-grey my-2 text-center`},bw={key:1,class:`text-sc-dark-grey my-2`},xw=(0,r.defineComponent)({__name:`order-status-history`,props:{order:{}},setup(e){let n=e,a=(0,r.ref)(!1),s=(0,r.ref)([]),c=e=>{let{uiDateWithTime:n}=(0,t.useBaseConfigStore)().config.dateFormats;return(0,i.format)(e,n)},l=(e=!0)=>{e&&(a.value=!0),t.HttpRequester.getInstance(t.OrdersDataProvider).getOrderStatusHistory(n.order.id).then(e=>{s.value=e}).finally(()=>{e&&(a.value=!1)})};return(0,r.watch)(()=>n.order,()=>{l(!1)}),(0,r.onMounted)(()=>{l()}),(e,t)=>{let n=o.NSpin,i=o.NTimelineItem,l=o.NTimeline;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[t[1]||=(0,r.createElementVNode)(`h3`,{class:`!mb-3 !mt-0 text-base font-semibold`},`История статусов`,-1),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,yw,[(0,r.createVNode)(n,{size:`small`,class:`mb-1 align-middle`}),t[0]||=(0,r.createElementVNode)(`span`,{class:`ml-2`},`Загрузка истории ...`,-1)])):s.value.length===0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,bw,` История статусов отсутствует. `)):((0,r.openBlock)(),(0,r.createBlock)(l,{key:2},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value,(e,t)=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:t,color:(0,r.unref)(k)(e.status.slug).color,time:c(e.createdAt),content:e.user.name},{header:(0,r.withCtx)(()=>[(0,r.createVNode)(sw,{status:e.status,"status-detail":e.statusDetail,variant:t===0?`filled`:`text`,"show-dot":!1,size:`small`},null,8,[`status`,`status-detail`,`variant`])]),_:2},1032,[`color`,`time`,`content`]))),128))]),_:1}))])}}}),Sw={class:`text-base`},Cw=(0,r.defineComponent)({__name:`user-short-info`,props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)({"flex flex-col":e.showUserType&&e.extraInfoOnSecondLine})},[(0,r.createElementVNode)(`span`,Sw,(0,r.toDisplayString)(e.user.name),1),e.showUserType?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)([{"ml-1":!e.extraInfoOnSecondLine},`text-sc-grey`])},` [`+(0,r.toDisplayString)(e.user.type)+`] `,3)):(0,r.createCommentVNode)(``,!0)],2))}}),ww={class:`ml-4 grid grid-cols-3 gap-1.5 text-base`},Tw={class:`col-span-2`},Ew={class:`col-span-2`},Dw=(0,r.defineComponent)({__name:`order-details`,props:{order:{}},emits:[`click:client-name`],setup(e,{emit:t}){let n=t;return(t,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[i[11]||=(0,r.createElementVNode)(`h3`,null,`Детали заказа`,-1),(0,r.createElementVNode)(`div`,ww,[e.order.creator.id===e.order.client.id?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[i[1]||=(0,r.createElementVNode)(`span`,null,`Создал`,-1),(0,r.createVNode)(Cw,{user:e.order.creator,class:`col-span-2`},null,8,[`user`])],64)),i[10]||=(0,r.createElementVNode)(`span`,null,`Клиент`,-1),(0,r.createVNode)(ed,{client:e.order.client,class:`col-span-2`,"onClick:clientName":i[0]||=t=>n(`click:client-name`,e.order.client,t)},null,8,[`client`]),e.order.contragent?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[i[2]||=(0,r.createElementVNode)(`span`,null,`Контрагент`,-1),(0,r.createVNode)(nd,{contragent:e.order.contragent,class:`col-span-2`},null,8,[`contragent`])],64)):(0,r.createCommentVNode)(``,!0),e.order.image?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:2},[i[3]||=(0,r.createElementVNode)(`span`,null,`Графический файл клиента`,-1),i[4]||=(0,r.createElementVNode)(`a`,{class:`fancybox col-span-2`,href:`{{ order.image }}`},` Посмотреть `,-1)],64)):(0,r.createCommentVNode)(``,!0),e.order.barcode?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:3},[i[5]||=(0,r.createElementVNode)(`span`,null,`Штрих-код`,-1),(0,r.createElementVNode)(`span`,Tw,(0,r.toDisplayString)(e.order.barcode),1)],64)):(0,r.createCommentVNode)(``,!0),e.order.payment?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:4},[i[6]||=(0,r.createElementVNode)(`span`,null,`Оплата`,-1),(0,r.createVNode)(JC,{payment:e.order.payment,class:`col-span-2`},null,8,[`payment`])],64)):(0,r.createCommentVNode)(``,!0),e.order.delivery?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:5},[i[7]||=(0,r.createElementVNode)(`span`,null,`Доставка`,-1),(0,r.createVNode)(HC,{delivery:e.order.delivery,class:`col-span-2`},null,8,[`delivery`])],64)):(0,r.createCommentVNode)(``,!0),e.order.comment?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:6},[i[8]||=(0,r.createElementVNode)(`span`,null,`Комментарий`,-1),(0,r.createElementVNode)(`span`,Ew,(0,r.toDisplayString)(e.order.comment),1)],64)):(0,r.createCommentVNode)(``,!0),e.order.attachedUser?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:7},[i[9]||=(0,r.createElementVNode)(`span`,null,`Закреплен за`,-1),(0,r.createVNode)(Cw,{user:e.order.attachedUser,class:`col-span-2`},null,8,[`user`])],64)):(0,r.createCommentVNode)(``,!0)])]))}}),Ow={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function kw(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Ow,[...t[0]||=[(0,r.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),(0,r.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)]])}var Aw=(0,r.markRaw)({name:`ion-copy-outline`,render:kw}),jw={class:`flex flex-col items-stretch gap-1.5 text-base`},Mw=yt((0,r.defineComponent)({__name:`order-external-links`,props:{showErpLink:{type:Boolean,default:!1},order:{}},setup(e){let t=(0,r.computed)(()=>{let t=(e.order.invoices?.length??0)>0;return e.showErpLink&&!!e.order.erpOrderUrl||t||!!e.order.payment?.onlinePaymentLink});return(n,i)=>{let a=o.NButton,s=Aw;return t.value?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[i[2]||=(0,r.createElementVNode)(`h3`,{class:`!mb-3 !mt-0 text-base font-semibold`},`Внешние ссылки`,-1),(0,r.createElementVNode)(`div`,jw,[e.showErpLink&&e.order.erpOrderUrl?((0,r.openBlock)(),(0,r.createBlock)(a,{key:0,tag:`a`,href:e.order.erpOrderUrl,target:`_blank`,block:``,class:`sc-external-link-button`},{default:(0,r.withCtx)(()=>[...i[0]||=[(0,r.createTextVNode)(` Открыть в ERP `,-1)]]),_:1},8,[`href`])):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.order.invoices??[],(e,t)=>((0,r.openBlock)(),(0,r.createBlock)(a,{key:t,tag:`a`,href:e,block:``,class:`sc-external-link-button`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Скачать счет №`+(0,r.toDisplayString)(t+1),1)]),_:2},1032,[`href`]))),128)),e.order.payment?.onlinePaymentLink?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)(a,{key:1,block:``,class:`sc-external-link-button`,title:`Ссылка на оплату копируется в буфер обмена`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s,{class:`mr-1.5`}),i[1]||=(0,r.createTextVNode)(` Скопировать ссылку на оплату `,-1)]),_:1})),[[(0,r.unref)(y),e.order.payment.onlinePaymentLink]]):(0,r.createCommentVNode)(``,!0)])],64)):(0,r.createCommentVNode)(``,!0)}}}),[[`__scopeId`,`data-v-53afb2ef`]]),Nw={key:0},Pw={class:`text-sc-dark-grey my-2 text-center`},Fw={key:1,class:`text-sc-dark-grey my-2 text-center`},Iw={key:2},Lw={class:`text-sc-dark-grey mt-4 text-right font-bold`},Rw={class:`text-sc-primary`},zw={class:`mb-4 max-w-xs empty:hidden`},Bw=(0,r.defineComponent)({__name:`order-info`,props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:[`click:client-name`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.ref)(!1),l=(0,r.ref)();(0,r.provide)(t.currentOrderInjectionKey,(0,r.computed)(()=>l.value??null));let u=(e=!0)=>{`products`in a.order?l.value=new t.Order(a.order):(e&&(c.value=!0),t.HttpRequester.getInstance(t.OrdersDataProvider).getOrder(a.order.id).then(e=>{l.value=e}).finally(()=>{e&&(c.value=!1)}))},d=(0,r.computed)(()=>(l.value?.products??[]).filter(e=>!e.isRemoved&&!e.replacementId)),f=(0,r.computed)(()=>xe.formatMoney((0,n.sumBy)(d.value,`costRub`)));return(0,r.watch)(()=>a.order,()=>{u(!1)}),(0,r.onMounted)(()=>{u()}),(t,n)=>{let i=o.NSpin;return c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Nw,[(0,r.createElementVNode)(`div`,Pw,[(0,r.createVNode)(i,{size:`small`,class:`mb-2.5 align-middle`}),n[1]||=(0,r.createElementVNode)(`div`,null,[(0,r.createElementVNode)(`span`,null,`Загрузка данных ...`)],-1)])])):!l.value||l.value.products.length===0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Fw,` --- Не удалось загрузить данные о заказе --- `)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Iw,[(0,r.createVNode)(vw,{products:d.value,"event-emitter":e.eventEmitter,"allow-edit":e.allowEdit},null,8,[`products`,`event-emitter`,`allow-edit`]),(0,r.createElementVNode)(`div`,Lw,[n[2]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,Rw,(0,r.toDisplayString)(f.value)+` ₽`,1)]),(0,r.createVNode)(Dw,{order:l.value,"onClick:clientName":n[0]||=e=>s(`click:client-name`,l.value.client,e)},null,8,[`order`]),(0,r.createElementVNode)(`div`,zw,[(0,r.createVNode)(Mw,{order:l.value,"show-erp-link":``},null,8,[`order`])]),(0,r.createVNode)(xw,{order:l.value},null,8,[`order`])]))}}}),Vw=(0,r.defineComponent)({__name:`order-actions`,props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(e){let t=e,i=(0,r.inject)(wt,`small`),a=(0,r.computed)(()=>(0,n.isNil)(t.orderContextButtonsConfig)?[]:(0,n.isFunction)(t.orderContextButtonsConfig)?t.orderContextButtonsConfig(t.order):t.orderContextButtonsConfig),s=e=>{t.onOrderContextSelect?.(t.order,e)};return(e,t)=>{let n=Fe,c=o.NButton,l=o.NDropdown;return a.value?.length>0?((0,r.openBlock)(),(0,r.createBlock)(l,{key:0,options:a.value,size:(0,r.unref)(i),trigger:`click`,onSelect:s},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(c,{ghost:!0,size:(0,r.unref)(i),type:`primary`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(n)]),_:1},8,[`size`])]),_:1},8,[`options`,`size`])):(0,r.createCommentVNode)(``,!0)}}}),Hw=yt((0,r.defineComponent)({__name:`orders-list`,props:(0,r.mergeModels)({fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},highlightSettings:{default:void 0},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},isRowSelectable:{type:Function,default:void 0}},{checkedRowKeys:{default:()=>[]},checkedRowKeysModifiers:{}}),emits:(0,r.mergeModels)([`click:client-name`,`dblclick:row`,`update:pagination`,`update:sort`],[`update:checkedRowKeys`]),setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useModel)(e,`checkedRowKeys`),u=(e,t)=>{t?l.value.includes(e)||(l.value=[...l.value,e]):l.value=l.value.filter(t=>t!==e)},d=()=>(0,n.cloneDeep)(s.sort??[{field:`id`,direction:`desc`}]),f=(0,r.ref)(d()),p=(0,r.ref)([]),m=(0,r.ref)(!1),h=(0,r.ref)(700),g=()=>{let e=F.getDeviceTypeByResolution(),n=e===P.phone||e===P.tablet;if(s.stickyHeaderOnMobile||!n)return h.value*((0,t.useBaseConfigStore)().config.tableDefaultHeightCoefficient??.6)},_=(0,r.ref)(g()),v=(0,r.computed)(()=>s.highlightSettings?s.highlightSettings:{statuses:[],markers:s.useCellIndication?[...ne]:[]}),y=e=>{let t={onDblclick:()=>c(`dblclick:row`,e)},r=[];s.selectable&&l.value.length>0&&!l.value.includes(e.id)&&r.push(`opacity-60`);let i=v.value,a=new Set(ie(e).filter(e=>i.markers.includes(e))),o={},u=[E.NotInStock,E.OnOrder,E.LargeOrder].find(e=>a.has(e));if(u){let e=M(u);r.push(`order-id-marked`,u),o[`--sc-order-id-bg`]=e.backgroundColor,o[`--sc-order-id-text`]=e.textOnBackgroundColor}if(a.has(E.NextDayDelivery)){let e=M(E.NextDayDelivery);r.push(`delivery-date-marked`),o[`--sc-delivery-date-bg`]=e.backgroundColor,o[`--sc-delivery-date-text`]=e.textOnBackgroundColor}return e.status.slug&&i.statuses.includes(e.status.slug)&&(r.push(`order-status-highlighted`,e.status.slug),(0,n.assign)(o,ee(e.status.slug))),(0,n.isEmpty)(o)||(t.style=o),r.length>0&&(t.class=r.join(` `)),t},b=()=>{let e=[N.CreatedAt,N.Id,N.ClientInfo,N.ClientCity,N.DeliveryDate,N.PaymentType,N.SalesDirections,N.Status,...s.showAttachedUserColumn?[N.AttachedUser]:[],N.actions],t=s.fields.length>0?s.fields:e,i={title:`???`,key:`undefined`,render:()=>(0,r.h)(`span`,{},[`--- unknown ---`])},a={type:`expand`,expandable:(0,n.constant)(!0),renderExpand:e=>(0,r.h)(Bw,{order:e,class:`pl-10 pt-3 pb-10`,"onClick:client-name":()=>{c(`click:client-name`,e.client,null)}}),width:`30`},d=[{title:`Дата заказа`,key:N.CreatedAt,resizable:!0,width:100,render:e=>(0,r.h)(qp,{date:e.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:`text-base`})},{title:`№ заказа`,key:N.Id,resizable:!0,width:`calc(3.9em + 35px)`,className:`order-id`,render:e=>(0,r.h)(`a`,{href:s.orderUrl.replace(`:id`,e.id.toString()),class:`text-base`},e.id)},{title:`Дата доставки / самовывоза`,key:N.DeliveryDate,resizable:!0,width:`calc(6.6em + 35px)`,className:`delivery-date`,render:e=>(0,r.h)(qp,{date:e.delivery.date,isShowTime:!1,class:`text-base`})},{title:`Клиент`,key:N.ClientInfo,resizable:!0,minWidth:320,render:e=>(0,r.h)(ed,{client:e.client,"onClick:client-name":()=>{c(`click:client-name`,e.client,null)}})},{title:`Тип доставки`,key:N.DeliveryInfo,resizable:!0,minWidth:320,render:e=>(0,r.h)(HC,{delivery:e.delivery})},{title:`Клиент`,key:N.ClientInfoShort,resizable:!0,minWidth:320,render:e=>(0,r.h)(ed,{client:e.client,showCityAndRegion:!1,"onClick:client-name":()=>{c(`click:client-name`,e.client,null)}})},{title:`Город клиента`,key:N.ClientCity,resizable:!0,minWidth:90,width:120,render:e=>(0,r.h)(`span`,{class:`text-base`},e.client?.city.name??`—`)},{title:`Статус`,key:N.Status,resizable:!0,width:150,minWidth:115,className:`order-status`,render:e=>(0,r.h)(`span`,{class:`text-base`},[e.status.name])},{title:`Тип оплаты`,key:N.PaymentType,resizable:!0,width:115,minWidth:95,render:e=>e.payment?(0,r.h)(JC,{payment:e.payment}):(0,r.h)(`span`,{class:`text-base`},`—`)},{title:`Напр. продаж`,key:N.SalesDirections,resizable:!0,width:`calc(4.4em + 32px)`,render:e=>(0,r.h)(`span`,{class:`text-base`},[e.salesDirection?.name??``])},...s.showAttachedUserColumn?[{title:`Закреплено за`,key:N.AttachedUser,resizable:!0,minWidth:120,render:e=>(0,r.h)(`span`,{class:`text-base`},[e?.attachedUser?.name??``])}]:[]];s.orderContextButtonsConfig&&d.push({key:`actions`,title:``,className:`align-top`,width:50,render:e=>(0,r.h)(Vw,{order:e,orderContextButtonsConfig:s.orderContextButtonsConfig,onOrderContextSelect:s.onOrderContextSelect})}),s.enableSorting&&(d=d.map(e=>[N.Id,N.CreatedAt,N.DeliveryDate].includes(e.key)?{...e,sorter:!0,sortOrder:!1,...e.width===void 0?{}:{width:(0,n.isNumber)(e.width)?e.width+16:`calc(${e.width} + 16px)`}}:e));let f=s.selectable?[{key:`selection`,title:``,className:`align-top`,width:`32`,cellProps:e=>{let t=s.isRowSelectable?.(e)??!0;return{class:t?`cursor-pointer`:void 0,onClick:()=>{t&&u(e.id,!l.value.includes(e.id))}}},render:e=>s.isRowSelectable?.(e)??!0?(0,r.h)(o.NCheckbox,{checked:l.value.includes(e.id)}):null}]:[];switch(F.getDeviceTypeByResolution()){case P.phone:case P.tablet:return[...f,a,{key:`order`,title:`Заказ`,resizable:!0,render:e=>(0,r.h)(qC,{order:e,fields:t,orderUrl:s.orderUrl,highlightSettings:v.value})}];case P.laptop:{let e=s.showAttachedUserColumn?t:t.filter(e=>e!==N.AttachedUser);return[...f,a,...e.map(e=>d.find(t=>t.key===e)??i)]}default:return[i]}},x=(0,r.ref)(b()),S=(0,r.ref)(new t.TableDataPagination(s.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),C=(0,r.computed)(()=>({...S.value,prefix({itemCount:e}){return`Всего заказов: ${e}`}})),w=(0,r.ref)(null),T=(0,r.ref)(null),D=(0,r.ref)(null),O=(0,r.ref)(null),k=(0,r.ref)(null),A=()=>{k.value!==null&&(clearInterval(k.value),k.value=null)},j=()=>{A(),s.refreshInterval&&(k.value=setInterval(()=>{ae()},s.refreshInterval))},te=e=>{S.value.itemCount!==e.meta.total&&(S.value.itemCount=e.meta.total),S.value.page!==e.meta.currentPage&&(S.value.page=e.meta.currentPage),S.value.pageCount!==e.meta.lastPage&&(S.value.pageCount=e.meta.lastPage),S.value.pageSize!==e.meta.perPage&&(S.value.pageSize=e.meta.perPage),p.value=e.data},re=()=>{s.filters&&(T.value?.abort(),T.value=null,D.value?.abort(),D.value=null,O.value=null,w.value?.abort(),w.value=new AbortController,m.value=!0,t.HttpRequester.getInstance(t.OrdersDataProvider).getOrders(s.filters,f.value,{page:S.value.page,pageSize:S.value.pageSize},w.value.signal).then(e=>{te(e),m.value=!1}).catch(e=>{if(e?.name!==`CanceledError`)throw m.value=!1,e}))},ae=()=>{s.filters&&!m.value&&(T.value?.abort(),T.value=new AbortController,t.HttpRequester.getInstance(t.OrdersDataProvider).getOrders(s.filters,f.value,{page:S.value.page,pageSize:S.value.pageSize},T.value.signal).then(e=>{p.value=p.value.map(t=>e.data.find(e=>e.id===t.id)??t),S.value.itemCount!==e.meta.total&&(S.value.itemCount=e.meta.total),S.value.pageCount!==e.meta.lastPage&&(S.value.pageCount=e.meta.lastPage)}).catch(e=>{if(e?.name!==`CanceledError`)throw e}))},oe=e=>e.meta.total===S.value.itemCount&&(0,n.isEqual)((0,n.map)(e.data,`id`),(0,n.map)(p.value,`id`)),se=async()=>{if(!s.filters||m.value)return!1;T.value?.abort(),T.value=null,D.value?.abort(),D.value=new AbortController;let e;try{e=await t.HttpRequester.getInstance(t.OrdersDataProvider).getOrders(s.filters,f.value,{page:S.value.page,pageSize:S.value.pageSize},D.value.signal)}catch(e){if(e?.name===`CanceledError`)return!1;throw e}return oe(e)?(p.value=p.value.map(t=>e.data.find(e=>e.id===t.id)??t),O.value=null,!1):(O.value=e,!0)},ce=()=>O.value?(te(O.value),O.value=null,!0):!1,le=()=>{O.value=null},ue=e=>{S.value.page=e,re(),c(`update:pagination`,S.value)},de=e=>{S.value.pageSize=e,S.value.page=1,re(),c(`update:pagination`,S.value)},fe=e=>{if((0,n.isNull)(e))f.value=d();else{let[t]=f.value;t.field=e.columnKey.toString(),t.direction=e.order===`ascend`?`asc`:`desc`,f.value=[t]}x.value.forEach(t=>{if(Object.hasOwn(t,`sortOrder`)){let n=t;n.sortOrder=n.key===e?.columnKey&&e?.sorter&&e.order!==!1?e.order:!1}}),re(),c(`update:sort`,f.value)},pe=()=>{x.value=b(),h.value=window.innerHeight,_.value=g()};return(0,r.watch)(()=>s.filters,()=>{S.value.page=1,re(),j()}),(0,r.watch)(()=>s.sort,()=>{f.value=d(),S.value.page=1,re(),j()}),(0,r.onMounted)(()=>{pe(),window.addEventListener(`resize`,pe),(0,r.nextTick)(()=>{re(),j()})}),(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,pe),w.value?.abort(),T.value?.abort(),D.value?.abort(),A()}),i({reload:re,checkForUpdates:se,applyPendingUpdate:ce,discardPendingUpdate:le}),(t,n)=>{let i=o.NDataTable;return(0,r.openBlock)(),(0,r.createBlock)(i,{columns:x.value,data:p.value,"row-key":e=>e.id,"row-props":y,"scroll-x":e.tableMinWidth,pagination:C.value,loading:m.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":_.value,"pagination-behavior-on-filter":`first`,"onUpdate:page":ue,"onUpdate:pageSize":de,"onUpdate:sorter":fe},null,8,[`columns`,`data`,`row-key`,`scroll-x`,`pagination`,`loading`,`max-height`])}}}),[[`__scopeId`,`data-v-74073cd1`]]),Uw=(0,r.computed)(()=>(0,t.useReferencesStore)().deliveryTypeReference??[]),Ww=(0,r.computed)(()=>(0,t.useReferencesStore)().managersList??[]),Gw=(0,r.computed)(()=>(0,t.useReferencesStore)().opfReference??[]),Kw=(0,r.computed)(()=>(0,t.useReferencesStore)().partnerGroupsReference??[]),qw=(0,r.computed)(()=>(0,t.useReferencesStore)().priceCoefficientsReference??[]),Jw=(0,r.computed)(()=>(0,t.useReferencesStore)().productFilesTypesReference??[]),Yw=(0,r.computed)(()=>(0,t.useReferencesStore)().resourceTypesReference),Xw=(0,r.computed)(()=>(0,t.useReferencesStore)().salesDirectionsReference??[]),Zw=(0,r.computed)(()=>(0,t.useReferencesStore)().warehousesReference??[]),Qw=(0,r.computed)(()=>(0,t.useReferencesStore)().paymentTypeReference??[]),$w=(0,r.computed)(()=>(0,t.useReferencesStore)().orderStatusReference??[]),eT=(0,r.computed)(()=>(0,t.useReferencesStore)().orderStatusDetailReference??[]),tT=(0,r.computed)(()=>(0,t.useReferencesStore)().operatorReference??[]),nT=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList((0,t.useReferencesStore)().channelPrimaryInterestsReference??[],!0,!1,!0)),rT=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList((0,t.useReferencesStore)().sourcePrimaryInterestsReference??[],!0,!1,!0)),iT=e=>t.HttpRequester.getInstance(t.ReferenceDataProvider).searchCity(e),aT=e=>Ce.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e?.isNewRec()?`-`:`${e.name}, ${e?.region?.name}, ${e?.region?.country?.name}`,e=>e?.isNewRec()),oT=async e=>(0,n.map)(await t.HttpRequester.getInstance(t.ReferenceDataProvider).searchRegion(e),e=>new t.Region(e)),sT=e=>Ce.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e.isNewRec()?`-`:(0,n.join)((0,n.compact)([e.name,e.country.name]),`, `),e=>e.isNewRec()),cT=e=>t.HttpRequester.getInstance(t.ClientDataProvider).searchClient(e),lT=e=>Ce.convertReferencesToSelectOptionsList(e,!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?.isNewRec()),uT={class:`flex flex-col gap-4`},dT={class:`flex flex-wrap gap-2`},fT={class:`flex flex-col gap-1.5`},pT={class:`inline-flex items-center gap-2`},mT={class:`flex flex-col gap-1.5`},hT={class:`inline-flex items-center gap-2`},gT=(0,r.defineComponent)({__name:`order-highlight-settings`,props:{settings:{},statuses:{default:void 0}},emits:[`update:settings`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.computed)(()=>n.statuses??$w.value),s=e=>!!e&&n.settings.statuses.includes(e),c=(e,t)=>{if(!e)return;let r=n.settings.statuses.filter(t=>t!==e);i(`update:settings`,{...n.settings,statuses:t?[...r,e]:r})},l=(e,t)=>{let r=n.settings.markers.filter(t=>t!==e);i(`update:settings`,{...n.settings,markers:t?[...r,e]:r})},u=e=>{i(`update:settings`,{statuses:e?a.value.flatMap(e=>e.slug?[e.slug]:[]):[],markers:e?[...ne]:[]})};return(t,n)=>{let i=o.NButton,d=o.NCheckbox;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,uT,[(0,r.createElementVNode)(`div`,dT,[(0,r.createVNode)(i,{size:`small`,onClick:n[0]||=e=>u(!0)},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Выделять всё `,-1)]]),_:1}),(0,r.createVNode)(i,{size:`small`,onClick:n[1]||=e=>u(!1)},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Снять всё `,-1)]]),_:1})]),(0,r.createElementVNode)(`div`,fT,[n[4]||=(0,r.createElementVNode)(`div`,{class:`text-sm font-semibold`},`Статусы`,-1),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(a.value,e=>((0,r.openBlock)(),(0,r.createBlock)(d,{key:e.id,checked:s(e.slug),"onUpdate:checked":t=>c(e.slug,t)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,pT,[(0,r.createVNode)(cw,{colors:(0,r.unref)(k)(e.slug)},null,8,[`colors`]),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.name),1)])]),_:2},1032,[`checked`,`onUpdate:checked`]))),128))]),(0,r.createElementVNode)(`div`,mT,[n[5]||=(0,r.createElementVNode)(`div`,{class:`text-sm font-semibold`},`Маркеры`,-1),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(ne),t=>((0,r.openBlock)(),(0,r.createBlock)(d,{key:t,checked:e.settings.markers.includes(t),"onUpdate:checked":e=>l(t,e)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,hT,[(0,r.createVNode)(cw,{colors:(0,r.unref)(M)(t)},null,8,[`colors`]),(0,r.createTextVNode)(` `+(0,r.toDisplayString)((0,r.unref)(re)(t)),1)])]),_:2},1032,[`checked`,`onUpdate:checked`]))),128))])])}}}),_T=[`href`],vT={class:`text-sc-dark-grey`},yT=(0,r.defineComponent)({__name:`short-text-order-info`,props:{order:{},orderLink:{}},emits:[`click:order-id`],setup(e,{emit:a}){let o=e,s=a,c=(0,r.computed)(()=>(0,i.format)(o.order.createdAt,(0,t.useBaseConfigStore)().config.dateFormats.uiDateWithTime)),l=e=>{(0,n.isNil)(o.orderLink)&&(e.preventDefault(),e.stopPropagation()),s(`click:order-id`,o.order,e)};return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)(`span`,null,[n[1]||=(0,r.createTextVNode)(` #`,-1),(0,r.createElementVNode)(`a`,{href:e.orderLink??`#`,onClick:n[0]||=e=>l(e)},(0,r.toDisplayString)(e.order.id),9,_T),(0,r.createTextVNode)(` от `+(0,r.toDisplayString)(c.value),1)]),n[2]||=(0,r.createTextVNode)(`, `,-1),(0,r.createElementVNode)(`span`,vT,`автор: `+(0,r.toDisplayString)(e.order.creator.name)+` [`+(0,r.toDisplayString)(e.order.creator.type)+`]`,1)],64))}}),bT={class:`sc-page flex flex-col bg-inherit`},xT={class:`my-2 flex flex-row items-end`},ST={class:`sc-title grow`},CT={key:0,class:`sc-title-buttons flex-1 grow-0`},wT={class:`flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row`},TT={key:0,class:`sc-title-extra mt-2 sm:mt-4`},ET=(0,r.defineComponent)({__name:`page`,props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(e){let t=e,n=(0,r.computed)(()=>t.stickyHeaderOnMobile?`sticky z-10 bg-inherit`:`lg:sticky z-10 bg-inherit`);return(t,i)=>{let a=o.NH1;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,bT,[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)(e.stickyHeader?n.value:void 0),style:(0,r.normalizeStyle)(e.stickyHeader?{top:`${e.stickyTopOffset??0}px`}:void 0)},[(0,r.createElementVNode)(`div`,xT,[(0,r.createElementVNode)(`div`,ST,[(0,r.renderSlot)(t.$slots,`title`,{},()=>[(0,r.createVNode)(a,{class:`m-0 leading-none lg:mb-3 lg:leading-normal`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.title??``),1)]),_:1})])]),t.$slots[`title-buttons`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,CT,[(0,r.createElementVNode)(`div`,wT,[(0,r.renderSlot)(t.$slots,`title-buttons`)])])):(0,r.createCommentVNode)(``,!0)]),t.$slots[`title-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,TT,[(0,r.renderSlot)(t.$slots,`title-extra`)])):(0,r.createCommentVNode)(``,!0),(0,r.renderSlot)(t.$slots,`sticky-extra`)],6),(0,r.renderSlot)(t.$slots,`default`)])}}}),DT={class:`overflow-hidden transition-all duration-300`},OT={class:`text-lg font-medium leading-none`},kT=(0,r.defineComponent)({__name:`sliding-content-with-drawer`,props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:``}},emits:[`update:show-drawer`],setup(e,{emit:t}){let i=e,a=t,s=(0,r.ref)(0),c=(0,r.ref)(i.showDrawer),l=()=>{switch(F.getDeviceTypeByResolution()){case P.phone:return window.innerWidth*.8;case P.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},u=()=>{c.value?(0,n.isUndefined)(i.drawerWidth)?s.value=l():s.value=(0,n.isFunction)(i.drawerWidth)?i.drawerWidth():i.drawerWidth:s.value=0};return(0,r.watch)(()=>i.drawerWidth,()=>{u()}),(0,r.watch)(()=>c.value,()=>{u(),a(`update:show-drawer`,c.value)}),(0,r.watch)(()=>i.showDrawer,e=>{c.value=e}),(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,u)}),u(),window.addEventListener(`resize`,u),(t,n)=>{let i=o.NDrawerContent,a=o.NDrawer;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)(`div`,DT,[(0,r.createElementVNode)(`div`,{style:(0,r.normalizeStyle)(`margin-left: ${s.value}px;`),class:`w-full`},[(0,r.renderSlot)(t.$slots,`default`)],4)]),(0,r.createVNode)(a,{show:c.value,"onUpdate:show":n[0]||=e=>c.value=e,resizable:!0,width:s.value,placement:`left`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{closable:``},{header:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`drawer-header`,{},()=>[(0,r.createElementVNode)(`div`,OT,(0,r.toDisplayString)(e.title),1)])]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`drawer-content`)]),footer:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`drawer-footer`)]),_:3})]),_:3},8,[`show`,`width`])],64)}}}),AT={ref:`panel-component-ref`,class:`sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8`},jT={key:0},MT={class:`sc-page-preview-panel grow`},NT={key:1,class:`sc-page-preview-panel-extra flex-none`},PT=(0,r.defineComponent)({__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(e,{expose:t}){let n=(0,r.ref)(!1),i=()=>{n.value=!0},a=()=>{n.value=!1},s=(0,r.useTemplateRef)(`panel-component-ref`);return t({scrollToTopOfPanel:e=>{s.value?.scrollIntoView({behavior:`smooth`}),e&&(0,r.nextTick)(()=>{window.scrollTo({top:(s.value?.getBoundingClientRect()?.top??0)+window.pageYOffset+e,behavior:`smooth`})})},showPanel:i,closePanel:a}),(t,i)=>{let a=o.NButton;return(0,r.openBlock)(),(0,r.createBlock)(ET,{title:e.title,"sticky-header":e.stickyHeader,"sticky-top-offset":e.stickyTopOffset,"sticky-header-on-mobile":e.stickyHeaderOnMobile},(0,r.createSlots)({default:(0,r.withCtx)(()=>[(0,r.createVNode)(kT,{"show-drawer":n.value,"onUpdate:showDrawer":i[1]||=e=>n.value=e,title:e.panelTitle},(0,r.createSlots)({"drawer-content":(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`panel-content`)]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`)]),_:2},[t.$slots[`panel-header`]?{name:`drawer-header`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`panel-header`)]),key:`0`}:void 0,t.$slots[`panel-bottom`]?{name:`drawer-footer`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`panel-bottom`)]),key:`1`}:void 0]),1032,[`show-drawer`,`title`])]),_:2},[t.$slots.title?{name:`title`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`title`)]),key:`0`}:void 0,t.$slots[`title-buttons`]?{name:`title-buttons`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`title-buttons`)]),key:`1`}:void 0,t.$slots[`title-extra`]?{name:`title-extra`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`title-extra`)]),key:`2`}:void 0,t.$slots[`preview-panel`]||t.$slots[`preview-panel-extra`]||e.isShowPanelButtonVisible?{name:`sticky-extra`,fn:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,AT,[e.isShowPanelButtonVisible?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,jT,[(0,r.renderSlot)(t.$slots,`show-panel-button`,{onClickHandler:()=>{n.value=!0}},()=>[(0,r.createVNode)(a,{class:`flex-none sm:px-10 sm:py-4`,onClick:i[0]||=e=>n.value=!0},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.showPanelButtonText),1)]),_:1})])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,MT,[(0,r.renderSlot)(t.$slots,`preview-panel`)]),t.$slots[`preview-panel-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,NT,[(0,r.renderSlot)(t.$slots,`preview-panel-extra`)])):(0,r.createCommentVNode)(``,!0)],512)]),key:`3`}:void 0]),1032,[`title`,`sticky-header`,`sticky-top-offset`,`sticky-header-on-mobile`])}}}),FT=(0,r.defineComponent)({__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(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.computed)(()=>(0,n.isArray)(s.value)),u=(0,r.computed)(()=>(0,n.isArray)(s.value)?s.value.map(e=>e.id):s.value?.id??null),d=(0,r.computed)(()=>{let e=new t.Curator({id:-1,name:``,contacts:{},curatedDirection:new t.CuratedDirection({id:-1,name:``,guid:``}),guid:``}),n=s.showEmptyValue?[e]:[];return s.managerReferenceList.filter(e=>(e?.curatedDirections?.length??0)>0).forEach(e=>{(e?.curatedDirections??[]).forEach(r=>{n.push(new t.Curator({id:e.id,guid:e.guid,name:e.name,photo:e.photo,contacts:e.contacts??{},curatedDirection:r}))})}),n}),f=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList(d.value,!0,{key:`item.curatedDirection.id`,label:`item.curatedDirection.name`},!1,e=>{let t=(0,n.some)(l.value?s.value:[s.value],[`id`,e.id])?` (${e.curatedDirection.name}) `:``;return e.curatedDirection.isNewRec()?e.name:`${e.name}${t}`})),p=(0,r.computed)(()=>f.value.map(e=>({...e,class:s.wrapContent?`${e.class} consistent-menu-width`:e.class}))),m=(0,r.useTemplateRef)(`select-component`),h=e=>{if((0,n.isArray)(e)){let t=e.length>0?e.map(e=>d.value.find(t=>t.id===e)).filter(e=>!(0,n.isNil)(e)):[];c(`update:value`,t)}else{let t=e>0?d.value.find(t=>t.id===e):null;c(`update:value`,t??null)}};return(0,r.watch)(()=>s.value,()=>{m.value?.$forceUpdate?.()},{deep:!0}),i({focus:()=>m.value?.focusInput(),blur:()=>m.value?.blurInput()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSelect),{ref:`select-component`,value:u.value,clearable:e.clearable,disabled:f.value.length===0,"consistent-menu-width":e.consistentMenuWidth,multiple:l.value,options:p.value,placeholder:``,"onUpdate:value":h},null,8,[`value`,`clearable`,`disabled`,`consistent-menu-width`,`multiple`,`options`]))}}),IT=(0,r.defineComponent)({__name:`manager-operator-select`,props:{value:{default:null},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},operatorReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},groupByEmployeeType:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},maxTagCount:{default:void 0}},emits:[`update:value`],setup(e,{expose:t,emit:i}){let a=e,s=i,c=(0,r.computed)(()=>(0,n.isArray)(a.value)),l=(0,r.computed)(()=>(0,n.isArray)(a.value)?a.value.filter(e=>!(0,n.isNil)(e)).map(e=>e.id):a.value?.id??null),u=(0,r.computed)(()=>[...a.operatorReferenceList,...a.managerReferenceList]),d=(0,r.computed)(()=>{let e=[];a.operatorReferenceList.length>0&&e.push({type:`group`,label:`Операторы`,key:`operators`,children:a.operatorReferenceList.map(e=>({label:e.name,value:e.id,item:e}))});let t=a.managerReferenceList;if(a.showActualOnly){let e=(0,n.isArray)(a.value)?a.value.map(e=>e.id):[a.value?.id];t=t.filter(t=>t.isActive||e.includes(t.id))}let i=Ce.convertReferencesToSelectOptionsList(t,!0,{key:`item.salesDirection.id`,label:`item.salesDirection.name`},!1,e=>`${e.name}${e.isActive?``:` [Не активен]`}`);return e.length>0&&i.length>0&&e.push({key:`manager-operator-divider`,disabled:!0,render:()=>(0,r.h)(`div`,{class:`sc-manager-operator-select__divider`})}),e.push(...i),e}),f=e=>`${e.name}${`isActive`in e&&!e.isActive?` [Не активен]`:``}`,p=(0,r.computed)(()=>{let e=(0,n.isArray)(a.value)?a.value.map(e=>e.id):[a.value?.id],t=t=>a.showActualOnly?t.filter(t=>!(`isActive`in t)||t.isActive||e.includes(t.id)):t,r=[],i=t(a.managerReferenceList);i.length>0&&r.push({type:`group`,label:`Менеджеры`,key:`managers`,children:Ce.convertReferencesToSelectOptionsList(i,!0,!1,!1,f)});let o=t(a.operatorReferenceList);return o.length>0&&r.push({type:`group`,label:`Операторы`,key:`operators`,children:Ce.convertReferencesToSelectOptionsList(o,!0,!1,!1,f)}),r}),m=(0,r.computed)(()=>a.groupByEmployeeType?p.value:d.value),h=(0,r.computed)(()=>m.value.map(e=>({...e,class:a.wrapContent?`${e.class??``} consistent-menu-width`:e.class}))),g=(0,r.useTemplateRef)(`select-component`),_=e=>{if((0,n.isArray)(e)){let t=e.map(e=>u.value.find(t=>t.id===e)).filter(e=>!(0,n.isNil)(e));s(`update:value`,t)}else{let t=(0,n.isNil)(e)?null:u.value.find(t=>t.id===e)??null;s(`update:value`,t)}};return(0,r.watch)(()=>a.value,()=>{g.value?.$forceUpdate?.()},{deep:!0}),t({focus:()=>g.value?.focusInput(),blur:()=>g.value?.blurInput()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSelect),{ref:`select-component`,value:l.value,"clear-filter-after-select":!0,clearable:e.clearable,"consistent-menu-width":e.consistentMenuWidth,disabled:e.disabled||m.value.length===0,filterable:e.filterable,"max-tag-count":e.maxTagCount,multiple:c.value,options:h.value,placeholder:``,class:`w-full`,"onUpdate:value":_},null,8,[`value`,`clearable`,`consistent-menu-width`,`disabled`,`filterable`,`max-tag-count`,`multiple`,`options`]))}}),LT=(0,r.defineComponent)({__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(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.computed)(()=>(0,n.isArray)(s.value)),u=(0,r.computed)(()=>(0,n.isArray)(s.value)?s.value.map(e=>e.id):s.value?.id??null),d=(0,r.computed)(()=>s.showEmptyValue?[t.ManagerDataFactory.generateUndefinedManagerInstance(),...s.managerReferenceList]:s.managerReferenceList),f=(0,r.computed)(()=>{let e=d.value,r=s.disabledManagerReferenceList.map(e=>e.id);if(s.showActualOnly){let i=(0,n.isArray)(s.value)?s.value.map(e=>e.id):[s.value?.id];r=(0,n.union)(r,d.value.filter(e=>!e.isActive).map(e=>e.id)),e=e.filter(e=>(s.showEmptyValue?t.ManagerDataFactory.isUndefinedManagerInstance(e):!1)||e.isActive||i.includes(e.id))}return Ce.convertReferencesToSelectOptionsList(e,!0,s.groupBySalesDirection?{key:`item.salesDirection.id`,label:`item.salesDirection.name`}:!1,!1,e=>{let t=!s.groupBySalesDirection||s.groupBySalesDirection&&(0,n.some)(l.value?s.value:[s.value],[`id`,e.id])?` (${e.salesDirection.name}) `:``;return e.salesDirection.isNewRec()?e.name:`${e.name}${t}${e.isActive?``:` [Не активен]`}`},e=>r.includes(e.id)&&e.isActive)}),p=(0,r.computed)(()=>f.value.map(e=>({...e,class:s.wrapContent?`${e.class} consistent-menu-width`:e.class}))),m=(0,r.useTemplateRef)(`select-component`),h=e=>{if((0,n.isArray)(e)){let t=e.length>0?e.filter(e=>!(0,n.some)(s.disabledManagerReferenceList,[`id`,e])).map(e=>d.value.find(t=>t.id===e)).filter(e=>!(0,n.isNil)(e)):[];c(`update:value`,t)}else{let r=e>0&&!(0,n.some)(s.disabledManagerReferenceList,[`id`,e])?d.value.find(t=>t.id===e):new t.Manager;c(`update:value`,r??new t.Manager)}};return(0,r.watch)(()=>s.value,()=>{m.value?.$forceUpdate?.()},{deep:!0}),(0,r.watch)(()=>s.disabledManagerReferenceList,e=>{if(e.length>0&&s.value){if(l.value){let t=s.value;(0,n.some)(t,t=>(0,n.some)(e,[`id`,t.id]))&&c(`update:value`,t.filter(t=>!(0,n.some)(e,[`id`,t.id])))}else{let r=s.value;(0,n.some)(e,[`id`,r.id])&&c(`update:value`,new t.Manager)}}}),i({focus:()=>m.value?.focusInput(),blur:()=>m.value?.blurInput()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSelect),{ref:`select-component`,value:u.value,clearable:e.clearable,disabled:f.value.length===0,"consistent-menu-width":e.consistentMenuWidth,multiple:l.value,options:p.value,placeholder:``,"onUpdate:value":h},null,8,[`value`,`clearable`,`disabled`,`consistent-menu-width`,`multiple`,`options`]))}}),RT={class:`m-0.5 flex flex-col p-0.5`},zT={"data-testid":`address-line`},BT={key:0},VT={key:1},HT={key:2},UT={key:3},WT={"data-testid":`address-line`},GT={key:0},KT={key:1},qT={key:2},JT={key:3},YT={key:0,"data-testid":`address-quality-label`,class:`text-sc-warning text-xs`},XT=(0,r.defineComponent)({__name:`address-suggestion-label`,props:{addr:{},selected:{type:Boolean}},setup(e){let t=e,n=(0,r.computed)(()=>le.getLabel(t.addr.quality));return(t,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,RT,[(0,r.createElementVNode)(`span`,zT,[e.addr.postIndex?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,BT,(0,r.toDisplayString)(e.addr.postIndex)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.city?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,VT,(0,r.toDisplayString)(e.addr.city)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.locality?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,HT,(0,r.toDisplayString)(e.addr.locality)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.region?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,UT,(0,r.toDisplayString)(e.addr.region)+`, `,1)):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`span`,WT,[e.addr.street?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,GT,(0,r.toDisplayString)(e.addr.street)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.building?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,KT,(0,r.toDisplayString)(e.addr.building)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.buildingPart?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,qT,(0,r.toDisplayString)(e.addr.buildingPart)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.apartments?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,JT,(0,r.toDisplayString)(e.addr.apartments)+`, `,1)):(0,r.createCommentVNode)(``,!0)]),n.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,YT,(0,r.toDisplayString)(n.value),1)):(0,r.createCommentVNode)(``,!0)]))}}),ZT={clearable:!1,value:``,field:void 0,disabled:!1},QT=(0,r.defineComponent)({__name:`address-suggestion`,props:(0,r.mergeDefaults)({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},searchDataHandler:{type:Function}},{...ZT,minTermLength:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3,searchDataHandler:void 0,wrapContent:!0}),emits:[`select`,`update:value`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.ref)(s.value),u=(0,r.ref)(!1),d=(0,r.ref)([]),f=(0,r.computed)(()=>d.value.map(e=>({label:e[s.field??`addressString`]??`-`,value:e.id})));(0,r.watch)(()=>s.value,e=>{l.value=e}),(0,r.watch)(l,()=>{c(`update:value`,l.value)});let p=(0,n.debounce)(()=>m(),800),m=async()=>{!l.value||l.value.length<s.minTermLength||(u.value=!0,d.value=await(s.searchDataHandler?s.searchDataHandler(l.value,u):t.HttpRequester.getInstance(t.DataSuggestionProvider).searchAddresses(l.value)).finally(()=>{u.value=!1}))},h=(e,t)=>{let i=d.value.find(t=>t.id===e.value)||{};return(0,r.h)(XT,{addr:i,selected:t},{default:(0,n.constant)(`-`)})},g=e=>{p.cancel();let t=d.value.find(t=>t.id===e)||{};c(`select`,t)},_=(0,r.ref)(null);function v(){_.value.focus()}return i({focus:v}),(t,n)=>{let i=o.NAutoComplete;return(0,r.openBlock)(),(0,r.createBlock)(i,{ref_key:`autoCompleteElement`,ref:_,value:l.value,"onUpdate:value":[n[0]||=e=>l.value=e,(0,r.unref)(p)],class:(0,r.normalizeClass)(s.wrapContent?`consistent-menu-width`:void 0),clearable:e.clearable,disabled:e.disabled,loading:u.value,options:f.value,"render-label":h,to:!s.wrapContent&&void 0,placeholder:``,onSelect:g},null,8,[`value`,`class`,`clearable`,`disabled`,`loading`,`options`,`to`,`onUpdate:value`])}}}),$T={class:`m-0.5 flex flex-col p-0.5`},eE={class:`font-medium`},tE={class:`flex flex-row gap-1 text-xs font-light text-blue-800`},nE={key:0},rE={key:1},iE=(0,r.defineComponent)({__name:`bank-suggestion-label`,props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,$T,[(0,r.createElementVNode)(`span`,eE,(0,r.toDisplayString)(e.bank.name),1),(0,r.createElementVNode)(`span`,tE,[e.bank.bic?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,nE,` БИК: `+(0,r.toDisplayString)(e.bank.bic),1)):(0,r.createCommentVNode)(``,!0),e.bank.inn?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,rE,` ИНН: `+(0,r.toDisplayString)(e.bank.inn),1)):(0,r.createCommentVNode)(``,!0)])]))}}),aE=(0,r.defineComponent)({__name:`bank-suggestion`,props:(0,r.mergeDefaults)({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean}},{...ZT,minTermLength:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3,wrapContent:!0}),emits:[`select`,`update:value`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.ref)(s.value),u=(0,r.ref)(!1),d=(0,r.ref)([]),f=(0,r.computed)(()=>d.value.map(e=>({label:e[s.field??`_`]??`-`,value:e.id})));(0,r.watch)(()=>s.value,e=>{l.value=e}),(0,r.watch)(l,()=>{c(`update:value`,l.value)});let p=(0,n.debounce)(()=>m(),800),m=async()=>{if(!(!l.value||l.value.length<s.minTermLength)){u.value=!0;try{d.value=await t.HttpRequester.getInstance(t.DataSuggestionProvider).searchBank(l.value)}finally{u.value=!1}}},h=(e,t)=>{let i=d.value.find(t=>t.id===e.value)||{};return(0,r.h)(iE,{bank:i,selected:t},{default:(0,n.constant)(`-`)})},g=e=>{p.cancel();let t=d.value.find(t=>t.id===e)||{};c(`select`,t)},_=(0,r.ref)(null);function v(){_.value.focus()}return i({focus:v}),(t,n)=>{let i=o.NAutoComplete;return(0,r.openBlock)(),(0,r.createBlock)(i,{ref_key:`autoCompleteElement`,ref:_,value:l.value,"onUpdate:value":[n[0]||=e=>l.value=e,(0,r.unref)(p)],class:(0,r.normalizeClass)(s.wrapContent?`consistent-menu-width`:void 0),clearable:e.clearable,disabled:e.disabled,loading:u.value,options:f.value,"render-label":h,to:!s.wrapContent&&void 0,placeholder:``,onSelect:g},null,8,[`value`,`class`,`clearable`,`disabled`,`loading`,`options`,`to`,`onUpdate:value`])}}}),oE={class:`font-medium`},sE={key:0,"data-testid":`org-details`,class:`text-xs font-light`},cE={key:0,"data-testid":`org-inn`,class:`mr-2 whitespace-nowrap text-blue-800`},lE={key:1,class:`text-sc-dark-grey`},uE=(0,r.defineComponent)({__name:`org-suggestion-label`,props:{org:{},selected:{type:Boolean}},setup(e){let t=e,n=(0,r.computed)(()=>t.org.rawData?.state?.liquidationDate??!1),i=(0,r.computed)(()=>t.org.rawData?.address?.value??``);return(t,a)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)(`m-0.5 flex flex-col p-0.5 ${n.value?`line-through`:``}`)},[(0,r.createElementVNode)(`span`,oE,(0,r.toDisplayString)(e.org.name),1),e.org.inn||i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,sE,[e.org.inn?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,cE,(0,r.toDisplayString)(e.org.inn),1)):(0,r.createCommentVNode)(``,!0),i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,lE,(0,r.toDisplayString)(i.value),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)],2))}}),dE=(0,r.defineComponent)({__name:`org-suggestion`,props:(0,r.mergeDefaults)({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},allowSelectTerminated:{type:Boolean}},{...ZT,minTermLength:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3,wrapContent:!0}),emits:[`select`,`update:value`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.ref)(s.value),u=(0,r.ref)(!1),d=(0,r.ref)([]),f=e=>!!(e.rawData?.state?.liquidationDate??!1),p=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList(d.value,!1,!1,!1,e=>e[s.field??`_`]??`-`,e=>!s.allowSelectTerminated&&f(e)));(0,r.watch)(()=>s.value,e=>{l.value=e}),(0,r.watch)(l,()=>{c(`update:value`,l.value)});let m=(0,n.debounce)(()=>h(),800),h=async()=>{if(!(!l.value||l.value.length<s.minTermLength)){u.value=!0;try{d.value=await t.HttpRequester.getInstance(t.DataSuggestionProvider).searchOrganization(l.value)}finally{u.value=!1}}},g=(e,t)=>{let i=d.value.find(t=>t.id===e.value)||{};return(0,r.h)(uE,{org:i,selected:t},{default:(0,n.constant)(`-`)})},_=e=>{m.cancel();let t=d.value.find(t=>t.id===e)||{};(s.allowSelectTerminated||!f(t))&&c(`select`,t)},v=(0,r.ref)(null);function y(){v.value.focus()}return i({focus:y}),(t,n)=>{let i=o.NAutoComplete;return(0,r.openBlock)(),(0,r.createBlock)(i,{ref_key:`autoCompleteElement`,ref:v,value:l.value,"onUpdate:value":[n[0]||=e=>l.value=e,(0,r.unref)(m)],class:(0,r.normalizeClass)(s.wrapContent?`consistent-menu-width`:void 0),clearable:e.clearable,disabled:e.disabled,loading:u.value,options:p.value,"render-label":g,to:!s.wrapContent&&void 0,placeholder:``,onSelect:_},null,8,[`value`,`class`,`clearable`,`disabled`,`loading`,`options`,`to`,`onUpdate:value`])}}});e.ALL_ORDER_MARKERS=ne,e.AddressQualityLabelHelper=le,e.CATEGORY_REQUIRED_HINT=f,e.CommonValidators=we,e.ConfiguratorSettingsKozyrek=jc,e.ConfiguratorSettingsMosquito=ef,e.ContentHelper=fe,e.CurrencyHelper=pe,e.DEFAULT_ORDER_STATUS_COLORS=D,e.DateValidators=Te,e.EntityNameHelper=he,e.FileHelper=me,e.KozyrekLine=gc,e.KozyrekTailTemplate=Ac,e.KozyrekTemplate=kc,e.M2PriceHelper=ke,e.MODE_DISABLED_HINT=u,e.NumberHelper=xe,e.NumericValidators=I,e.ORDER_MARKER_COLORS=j,e.ORDER_MARKER_NAMES=te,e.ORDER_STATUS_COLORS=O,e.OrderMarkerEnum=E,e.OrdersTableFields=N,e.PRODUCT_REQUIRED_HINT=d,e.Point=hc,e.ScAddProductToCartDialog=Ku,e.ScAddressSuggestion=QT,e.ScAddressSuggestionLabel=XT,e.ScBankSuggestion=aE,e.ScBankSuggestionLabel=iE,e.ScBaseDialog=En,e.ScButtonWithConfirmAction=Ae,e.ScCategoryCollapse=Vu,e.ScChipGroup=Me,e.ScClientNameWithShortInfo=ed,e.ScCollapse=Bu,e.ScCollapseItem=bt,e.ScCommentEditor=mm,e.ScCompactCardList=Lm,e.ScConfiguratorsProductInfo=pr,e.ScContragentWithShortInfo=nd,e.ScCreatorUserTypeTag=XC,e.ScCuratorSelect=FT,e.ScDateRange=Gp,e.ScDateTimeLabel=qp,e.ScDebouncedInput=Cm,e.ScDebouncedInputNumber=wm,e.ScDebt=Jp,e.ScDialogHeader=$p,e.ScDynamicConfigurator=Su,e.ScEmail=sd,e.ScExternalLink=Pm,e.ScImageGallery=pn,e.ScInlineEditableItem=dm,e.ScInlineView=um,e.ScKozyrekConfigurator=Pc,e.ScKozyrekConfiguratorParamsForm=wr,e.ScKozyrekConfiguratorPreview=Oc,e.ScKozyrekConfiguratorTemplates=wc,e.ScKpiGrid=Om,e.ScLightGallery=un,e.ScManagerOperatorSelect=IT,e.ScManagerSelect=LT,e.ScMetalForDoorsConfigurator=_l,e.ScMetalForDoorsConfiguratorForm=hl,e.ScMosquitoConfigurator=el,e.ScMosquitoConfiguratorForm=Wc,e.ScMosquitoConfiguratorMeasurementInstructions=Qc,e.ScMosquitoConfiguratorPreview=Lc,e.ScOrderColorSwatch=cw,e.ScOrderCommonInfo=qC,e.ScOrderDeliveryLabel=HC,e.ScOrderDetails=Dw,e.ScOrderExternalLinks=Mw,e.ScOrderHighlightSettings=gT,e.ScOrderInfo=Bw,e.ScOrderItemParams=EC,e.ScOrderItemsList=vw,e.ScOrderPayment=JC,e.ScOrderProductInfo=rw,e.ScOrderStatusHistory=xw,e.ScOrderStatusTag=sw,e.ScOrdersList=Hw,e.ScOrgSuggestion=dE,e.ScOrgSuggestionLabel=uE,e.ScPage=ET,e.ScPageWithSlidingPanel=PT,e.ScPersonContactsBlock=$d,e.ScPhone=Pd,e.ScPhoneInput=Tm,e.ScProductInfoContent=Cn,e.ScProductInfoDialog=kn,e.ScProductInfoPopover=Mn,e.ScProductName=er,e.ScProductsList=$S,e.ScReferenceSelect=Hu,e.ScSandwichConfigurator=zl,e.ScSandwichConfiguratorForm=Il,e.ScSandwichM2Configurator=gu,e.ScSandwichM2ConfiguratorForm=pu,e.ScSearchableProductSelect=qS,e.ScSearchableReferenceSelect=KS,e.ScSetClientPriceFormItem=Uu,e.ScShortTextOrderInfo=yT,e.ScSingleFileUploadSelector=vm,e.ScSlidingContentWithDrawer=kT,e.ScStripConfigurator=pl,e.ScStripConfiguratorForm=ol,e.ScStripConfiguratorLineItem=tl,e.ScStripConfiguratorPreview=ul,e.ScUserShortInfo=Cw,e.ScWarningIcon=Sm,e.SelectOptionHelper=Ce,e.UiNotificationProvider=p,e.Validators=Ee,e.WindowResolutionEnum=P,e.WindowResolutionProvider=F,e.channelPrimaryInterestOptionsList=nT,e.componentSizeInjectionKey=wt,e.copyToClipboard=g,e.deliveryTypeReferenceList=Uw,e.getOrderMarkerColors=M,e.getOrderMarkerName=re,e.getOrderMarkers=ie,e.getOrderStatusColors=k,e.getOrderStatusCssVariables=ee,e.getOrderStatusTagColor=A,e.getProductInfoFiles=De,e.handleFloatInput=_e,e.handleIntegerInput=ge,e.hasProductInfo=Oe,e.isCanSandwichM2Show=tf,e.isCanSandwichShow=wu,e.isConfiguratorType=Cu,e.managersReferenceList=Ww,e.naiveUiTheme=Tt,e.operatorReferenceList=tT,e.opfReferenceList=Gw,e.orderStatusDetailReferenceList=eT,e.orderStatusReferenceList=$w,e.paginationItemsPrefix=Se,e.parse=ve,e.partnerGroupReferenceList=Kw,e.paymentTypeReferenceList=Qw,e.priceCoefficientsReferenceList=qw,e.productFilesTypesReferenceList=Jw,e.renderConfig=_c,e.resetInputValidation=ye,e.resourceReferencesList=Yw,e.salesDirectionsReferenceList=Xw,e.searchCityReferenceDataHandler=iT,e.searchCityReferenceLabelRenderer=aT,e.searchClientReferenceDataHandler=cT,e.searchClientReferenceLabelRenderer=lT,e.searchRegionReferenceDataHandler=oT,e.searchRegionReferenceLabelRenderer=sT,e.selectAllTextOnFocus=be,e.showAppVersion=de,e.sourcePrimaryInterestOptionsList=rT,e.useCompactLayout=oe,e.useHoverSupport=ce,e.vCopy=y,e.vFocusNext=T,e.warehousesReferenceList=Zw});
782
+ `,[Kb({originalTransition:`background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)`})])]),GS={...Rg.props,to:mh.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearCreatedOptionsOnClear:{type:Boolean,default:!0},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},scrollbarProps:Object,onChange:[Function,Array],items:Array},KS=(0,r.defineComponent)({name:`Select`,props:GS,slots:Object,setup(e){process.env.NODE_ENV!==`production`&&(0,r.watchEffect)(()=>{e.items!==void 0&&vh(`select`,"`items` is deprecated, please use `options` instead."),e.onChange!==void 0&&vh(`select`,"`on-change` is deprecated, please use `on-update:value` instead.")});let{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:i,inlineThemeDisabled:a,mergedComponentPropsRef:o}=Ch(e),s=Rg(`Select`,`-select`,WS,US,e,t),c=(0,r.ref)(e.defaultValue),l=ch((0,r.toRef)(e,`value`),c),u=(0,r.ref)(!1),d=(0,r.ref)(``),f=uh(e,[`items`,`options`]),p=(0,r.ref)([]),m=(0,r.ref)([]),h=(0,r.computed)(()=>m.value.concat(p.value).concat(f.value)),g=(0,r.computed)(()=>{let{filter:t}=e;if(t)return t;let{labelField:n,valueField:r}=e;return(e,t)=>{if(!t)return!1;let i=t[n];if(typeof i==`string`)return RS(e,i);let a=t[r];return typeof a==`string`?RS(e,a):typeof a==`number`&&RS(e,String(a))}}),_=(0,r.computed)(()=>{if(e.remote)return f.value;{let{value:t}=h,{value:n}=d;return!n.length||!e.filterable?t:BS(t,g.value,n,e.childrenField)}}),v=(0,r.computed)(()=>{let{valueField:t,childrenField:n}=e,r=zS(t,n);return kx(_.value,r)}),y=(0,r.computed)(()=>VS(h.value,e.valueField,e.childrenField)),b=(0,r.ref)(!1),x=ch((0,r.toRef)(e,`show`),b),S=(0,r.ref)(null),C=(0,r.ref)(null),w=(0,r.ref)(null),{localeRef:T}=Ag(`Select`),E=(0,r.computed)(()=>e.placeholder??T.value.placeholder),D=[],O=(0,r.ref)(new Map),k=(0,r.computed)(()=>{let{fallbackOption:t}=e;if(t===void 0){let{labelField:t,valueField:n}=e;return e=>({[t]:String(e),[n]:e})}return t===!1?!1:e=>Object.assign(t(e),{value:e})});function A(t){let n=e.remote,{value:r}=O,{value:i}=y,{value:a}=k,o=[];return t.forEach(e=>{if(i.has(e))o.push(i.get(e));else if(n&&r.has(e))o.push(r.get(e));else if(a){let t=a(e);t&&o.push(t)}}),o}let ee=(0,r.computed)(()=>{if(e.multiple){let{value:e}=l;return Array.isArray(e)?A(e):[]}return null}),te=(0,r.computed)(()=>{let{value:t}=l;return!e.multiple&&!Array.isArray(t)?t===null?null:A([t])[0]||null:null}),ne=hg(e,{mergedSize:t=>{let{size:n}=e;if(n)return n;let{mergedSize:r}=t||{};return r?.value?r.value:o?.value?.Select?.size||`medium`}}),{mergedSizeRef:j,mergedDisabledRef:M,mergedStatusRef:re}=ne;function ie(t,n){let{onChange:r,"onUpdate:value":i,onUpdateValue:a}=e,{nTriggerFormChange:o,nTriggerFormInput:s}=ne;r&&xh(r,t,n),a&&xh(a,t,n),i&&xh(i,t,n),c.value=t,o(),s()}function ae(t){let{onBlur:n}=e,{nTriggerFormBlur:r}=ne;n&&xh(n,t),r()}function N(){let{onClear:t}=e;t&&xh(t)}function P(t){let{onFocus:n,showOnFocus:r}=e,{nTriggerFormFocus:i}=ne;n&&xh(n,t),i(),r&&ue()}function oe(t){let{onSearch:n}=e;n&&xh(n,t)}function se(t){let{onScroll:n}=e;n&&xh(n,t)}function ce(){let{remote:t,multiple:n}=e;if(t){let{value:t}=O;if(n){let{valueField:n}=e;ee.value?.forEach(e=>{t.set(e[n],e)})}else{let n=te.value;n&&t.set(n[e.valueField],n)}}}function le(t){let{onUpdateShow:n,"onUpdate:show":r}=e;n&&xh(n,t),r&&xh(r,t),b.value=t}function ue(){M.value||(le(!0),b.value=!0,e.filterable&&je())}function de(){le(!1)}function fe(){d.value=``,m.value=D}let pe=(0,r.ref)(!1);function me(){e.filterable&&(pe.value=!0)}function he(){e.filterable&&(pe.value=!1,x.value||fe())}function ge(){M.value||(x.value?e.filterable?je():de():ue())}function _e(e){w.value?.selfRef?.contains(e.relatedTarget)||(u.value=!1,ae(e),de())}function ve(e){P(e),u.value=!0}function ye(){u.value=!0}function be(e){S.value?.$el.contains(e.relatedTarget)||(u.value=!1,ae(e),de())}function xe(){S.value?.focus(),de()}function Se(e){x.value&&(S.value?.$el.contains(Zg(e))||de())}function F(t){if(!Array.isArray(t))return[];if(k.value)return Array.from(t);{let{remote:n}=e,{value:r}=y;if(n){let{value:e}=O;return t.filter(t=>r.has(t)||e.has(t))}return t.filter(e=>r.has(e))}}function Ce(e){we(e.rawNode)}function we(t){if(M.value)return;let{tag:n,remote:r,clearFilterAfterSelect:i,valueField:a}=e;if(n&&!r){let{value:e}=m,t=e[0]||null;if(t){let e=p.value;e.length?e.push(t):p.value=[t],m.value=D}}if(r&&O.value.set(t[a],t),e.multiple){let e=F(l.value),o=e.findIndex(e=>e===t[a]);if(~o){if(e.splice(o,1),n&&!r){let e=Te(t[a]);~e&&(p.value.splice(e,1),i&&(d.value=``))}}else e.push(t[a]),i&&(d.value=``);ie(e,A(e))}else{if(n&&!r){let e=Te(t[a]);~e?p.value=[p.value[e]]:p.value=D}Ae(),de(),ie(t[a],t)}}function Te(t){return p.value.findIndex(n=>n[e.valueField]===t)}function I(t){x.value||ue();let{value:n}=t.target;d.value=n;let{tag:r,remote:i}=e;if(oe(n),r&&!i){if(!n){m.value=D;return}let{onCreate:t}=e,r=t?t(n):{[e.labelField]:n,[e.valueField]:n},{valueField:i,labelField:a}=e;f.value.some(e=>e[i]===r[i]||e[a]===r[a])||p.value.some(e=>e[i]===r[i]||e[a]===r[a])?m.value=D:m.value=[r]}}function Ee(t){t.stopPropagation();let{multiple:n,tag:r,remote:i,clearCreatedOptionsOnClear:a}=e;!n&&e.filterable&&de(),r&&!i&&a&&(p.value=D),N(),n?ie([],[]):ie(null,null)}function De(e){!Xg(e,`action`)&&!Xg(e,`empty`)&&!Xg(e,`header`)&&e.preventDefault()}function Oe(e){se(e)}function ke(t){if(!e.keyboard)t.preventDefault();else switch(t.key){case` `:if(e.filterable)break;t.preventDefault();case`Enter`:if(!S.value?.isComposing){if(x.value){let t=w.value?.getPendingTmNode();t?Ce(t):e.filterable||(de(),Ae())}else if(ue(),e.tag&&pe.value){let t=m.value[0];if(t){let n=t[e.valueField],{value:r}=l;e.multiple&&Array.isArray(r)&&r.includes(n)||we(t)}}}t.preventDefault();break;case`ArrowUp`:if(t.preventDefault(),e.loading)return;x.value&&w.value?.prev();break;case`ArrowDown`:if(t.preventDefault(),e.loading)return;x.value?w.value?.next():ue();break;case`Escape`:x.value&&(gh(t),de()),S.value?.focus()}}function Ae(){S.value?.focus()}function je(){S.value?.focusInput()}function Me(){x.value&&C.value?.syncPosition()}ce(),(0,r.watch)((0,r.toRef)(e,`options`),ce);let Ne={focus:()=>{S.value?.focus()},focusInput:()=>{S.value?.focusInput()},blur:()=>{S.value?.blur()},blurInput:()=>{S.value?.blurInput()}},Pe=(0,r.computed)(()=>{let{self:{menuBoxShadow:e}}=s.value;return{"--n-menu-box-shadow":e}}),Fe=a?pg(`select`,void 0,Pe,e):void 0;return{...Ne,mergedStatus:re,mergedClsPrefix:t,mergedBordered:n,namespace:i,treeMate:v,isMounted:lh(),triggerRef:S,menuRef:w,pattern:d,uncontrolledShow:b,mergedShow:x,adjustedTo:mh(e),uncontrolledValue:c,mergedValue:l,followerRef:C,localizedPlaceholder:E,selectedOption:te,selectedOptions:ee,mergedSize:j,mergedDisabled:M,focused:u,activeWithoutMenuOpen:pe,inlineThemeDisabled:a,onTriggerInputFocus:me,onTriggerInputBlur:he,handleTriggerOrMenuResize:Me,handleMenuFocus:ye,handleMenuBlur:be,handleMenuTabOut:xe,handleTriggerClick:ge,handleToggle:Ce,handleDeleteOption:we,handlePatternInput:I,handleClear:Ee,handleTriggerBlur:_e,handleTriggerFocus:ve,handleKeydown:ke,handleMenuAfterLeave:fe,handleMenuClickOutside:Se,handleMenuScroll:Oe,handleMenuKeydown:ke,handleMenuMousedown:De,mergedTheme:s,cssVars:a?void 0:Pe,themeClass:Fe?.themeClass,onRender:Fe?.onRender}},render(){return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:Q(`${this.mergedClsPrefix}-select`)},[(0,r.createVNode)(G_,null,{_:1,default:Ug(()=>[((0,r.openBlock)(),(0,r.createBlock)(K_,null,{_:1,default:Ug(()=>((0,r.openBlock)(),(0,r.createBlock)(FS,{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},{_:1,arrow:Ug(()=>[this.$slots.arrow?.()])},8,`inlineThemeDisabled.status.inputProps.clsPrefix.showArrow.maxTagCount.ellipsisTagPopoverProps.bordered.active.pattern.placeholder.selectedOption.selectedOptions.multiple.renderTag.renderLabel.filterable.clearable.disabled.size.theme.labelField.valueField.themeOverrides.loading.focused.onClick.onDeleteOption.onPatternInput.onClear.onBlur.onFocus.onKeydown.onPatternBlur.onPatternFocus.onResize.ignoreComposition`.split(`.`))))})),((0,r.openBlock)(),(0,r.createBlock)(bv,{ref:`followerRef`,show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===mh.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?`target`:void 0,minWidth:`target`,placement:this.placement},{_:1,default:Ug(()=>((0,r.openBlock)(),(0,r.createBlock)(r.Transition,{name:`fade-in-scale-up-transition`,appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{_:1,default:Ug(()=>this.mergedShow||this.displayDirective===`show`?(this.onRender?.(),(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)(jx,(0,r.mergeProps)(this.menuProps,{ref:`menuRef`,onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,this.menuProps?.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:[this.menuProps?.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,scrollbarProps:this.scrollbarProps}),{_:1,empty:Ug(()=>[this.$slots.empty?.()]),header:Ug(()=>[this.$slots.header?.()]),action:Ug(()=>[this.$slots.action?.()])},16,`onResize.inlineThemeDisabled.virtualScroll.class.clsPrefix.labelField.valueField.nodeProps.theme.themeOverrides.treeMate.multiple.size.renderOption.renderLabel.value.style.onToggle.onScroll.onFocus.onBlur.onKeydown.onTabOut.onMousedown.show.showCheckmark.resetMenuOnOptionsChange.scrollbarProps`.split(`.`))),this.displayDirective===`show`?[[r.vShow,this.mergedShow],[X_,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[X_,this.handleMenuClickOutside,void 0,{capture:!0}]])):null)},8,[`appear`,`onAfterLeave`])))},8,[`show`,`to`,`teleportDisabled`,`containerClass`,`width`,`placement`]))])})],2)}}),qS=(0,r.defineComponent)({__name:`searchable-reference-select`,props:{searchDataHandler:{},optionsListConverter:{},renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:``}},emits:[`update:value`],setup(e,{expose:t,emit:i}){let a=e,o=i,s=(0,r.computed)(()=>(0,n.isArray)(a.value)),c=(0,r.computed)(()=>s.value?a.value.map(e=>e.id):a.value?a.value.id:null),l=(0,r.ref)(s.value?a.optionsListConverter(a.value):a.value?a.optionsListConverter([a.value]):[]);(0,r.watch)(()=>a.value,e=>{let t=((0,n.isArray)(e)?e:e?[e]:[]).filter(e=>!l.value.some(t=>t.value===e.id));t.length>0&&(l.value=[...a.optionsListConverter(t),...l.value])},{deep:1});let u=(0,r.computed)(()=>l.value.map(e=>({...e,class:a.wrapContent?`${e.class} consistent-menu-width`:e.class}))),d=(0,r.ref)(!1),f=(0,r.useTemplateRef)(`select-component`),p=e=>{e.length<a.minTermLength||(d.value=!0,a.searchDataHandler(e,d).then(e=>{if((0,n.isEmpty)(e))return;let t=s.value?a.value:a.value?[a.value]:[],r=e.filter(e=>!t.some(t=>t.id===e.id));l.value=a.optionsListConverter([...t,...r])}).finally(()=>{d.value=!1}))},m=``,h=(0,n.debounce)(()=>p(m),800),g=e=>{m=e,h()},_=e=>{if((0,n.isArray)(e)){let t=e.length>0?e.map(e=>(0,r.toRaw)(l.value.find(t=>t.value===e)?.item)):[];o(`update:value`,t)}else if(e>0){let t=(0,r.toRaw)(l.value.find(t=>t.value===e)?.item);o(`update:value`,t)}else o(`update:value`,null)};return t({focus:()=>f.value?.focusInput(),blur:()=>f.value?.blurInput()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(KS),{ref:`select-component`,"clear-filter-after-select":!0,clearable:e.clearable,"consistent-menu-width":e.consistentMenuWidth,disabled:e.disabled,filterable:!0,loading:d.value,multiple:s.value,options:u.value,placeholder:e.placeholder,remote:!0,value:c.value,"render-label":e.renderLabel,"render-tag":e.renderTag,onSearch:g,"onUpdate:value":_},null,8,[`clearable`,`consistent-menu-width`,`disabled`,`loading`,`multiple`,`options`,`placeholder`,`value`,`render-label`,`render-tag`]))}}),JS=(0,r.defineComponent)({__name:`searchable-product-select`,props:{renderLabel:{},renderTag:{},value:{},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},minTermLength:{default:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3},consistentMenuWidth:{type:Boolean,default:!1},wrapContent:{type:Boolean,default:!1},placeholder:{default:``},searchType:{}},emits:[`update:value`],setup(e,{expose:n,emit:i}){let a=e,o=i,s=(0,r.useTemplateRef)(`select-component`),c=async e=>a.searchType===`categories`?t.HttpRequester.getInstance(t.ProductCategoryDataProvider).publicSimpleSearch(e):a.searchType===`products`?t.HttpRequester.getInstance(t.ProductDataProvider).publicSimpleSearch(e):new Promise(e=>{e([])}),l=e=>a.searchType===`categories`?we.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e?.isNewRec()?`-`:e.name):a.searchType===`products`?we.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e?.isNewRec()?`-`:`[${e.code}] ${e.name}`):[],u=(e,t)=>{if(a.renderLabel)return a.renderLabel(e,t);if(a.searchType===`products`){let t=e.item;return(0,r.h)(`div`,{},[(0,r.h)(`span`,{class:`text-sc-grey mr-2.5`},t.code),(0,r.h)(`span`,{},[t.name])])}if(a.searchType===`categories`){let t=e.item;return(0,r.h)(`div`,{},[t.name])}};return n({focus:()=>s.value?.focus(),blur:()=>s.value?.blur()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)(qS,{ref:`select-component`,value:e.value,clearable:e.clearable,disabled:e.disabled,placeholder:e.placeholder,"search-data-handler":c,"options-list-converter":l,"consistent-menu-width":e.consistentMenuWidth,"wrap-content":e.wrapContent,"min-term-length":e.minTermLength,"render-label":u,"render-tag":e.renderTag,"onUpdate:value":n[0]||=e=>o(`update:value`,e)},null,8,[`value`,`clearable`,`disabled`,`placeholder`,`consistent-menu-width`,`wrap-content`,`min-term-length`,`render-tag`]))}}),YS={class:`col-span-2 flex flex-row gap-2.5`},XS={class:`flex-1`},ZS={class:`text-sc-grey`},QS={class:`ml-2.5`},$S={key:0,class:`flex-none`},eC=(0,r.defineComponent)({__name:`products-list`,props:{value:{},searchType:{},minTermLength:{default:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3},disabled:{type:Boolean}},emits:[`update:value`],setup(e,{emit:t}){let i=e,a=t,s=(0,r.ref)(null),c=()=>structuredClone((0,r.toRaw)(i.value)),l=(0,r.ref)(c()),u=()=>{a(`update:value`,l.value.map(e=>(0,r.toRaw)(e)))},d=e=>{e&&(l.value=[...l.value.map(e=>(0,r.toRaw)(e)),...((0,n.isArray)(e)?e:[e]).filter(e=>!l.value.some(t=>t.id===e.id))],(0,r.nextTick)(()=>{s.value=null}),u())},f=e=>{e&&(l.value=l.value.map(t=>t.id===e.id?e:(0,r.toRaw)(t)),u())},p=e=>{l.value=l.value.filter(t=>t.id!==e.id),u()};return(0,r.watch)(()=>i.value,()=>{l.value=c()}),(t,n)=>{let i=o.NListItem,a=Vm,c=o.NButton,u=o.NList;return(0,r.openBlock)(),(0,r.createBlock)(u,{"show-divider":!1,hoverable:!0},{header:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`header`)]),footer:(0,r.withCtx)(()=>[(0,r.createVNode)(JS,{value:s.value,"onUpdate:value":[n[0]||=e=>s.value=e,d],clearable:!0,disabled:e.disabled,"min-term-length":e.minTermLength,"search-type":e.searchType,placeholder:`Введите название`},null,8,[`value`,`disabled`,`min-term-length`,`search-type`])]),default:(0,r.withCtx)(()=>[l.value.length===0?((0,r.openBlock)(),(0,r.createBlock)(i,{key:0,class:`text-center text-sm text-gray-600`},{default:(0,r.withCtx)(()=>[...n[1]||=[(0,r.createTextVNode)(` --- Список пуст --- `,-1)]]),_:1})):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(l.value,n=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:n.id},{suffix:(0,r.withCtx)(()=>[(0,r.createVNode)(c,{disabled:e.disabled,quaternary:``,type:`error`,onClick:e=>p(n)},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(a)]),_:1},8,[`disabled`,`onClick`])]),default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,YS,[(0,r.createElementVNode)(`span`,XS,[(0,r.createElementVNode)(`span`,ZS,(0,r.toDisplayString)(n.code),1),(0,r.createElementVNode)(`span`,QS,(0,r.toDisplayString)(n.name),1)]),t.$slots[`item-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,$S,[(0,r.renderSlot)(t.$slots,`item-extra`,{item:n,updateItemCallback:f})])):(0,r.createCommentVNode)(``,!0)])]),_:2},1024))),128))]),_:3})}}}),tC={class:`flex flex-col`},nC={class:`flex flex-col gap-1.5 text-base text-nowrap`},rC={class:`font-medium`},iC={class:`flex flex-col text-sc-dark-grey`},aC={key:0},oC={class:`font-medium`},sC={class:`font-medium`},cC={class:`font-medium`},lC={class:`font-medium`},uC={class:`font-medium`},dC={class:`font-medium`},fC={class:`font-medium`},pC={class:`font-medium`},mC={class:`font-medium`},hC={class:`font-medium`},gC={class:`flex flex-col gap-1.5 text-base text-nowrap`},_C={class:`font-medium`},vC={class:`flex flex-col text-sc-dark-grey`},yC={class:`font-medium`},bC={class:`font-medium`},xC={class:`flex flex-col gap-1.5 text-base text-nowrap`},SC={class:`font-medium`},CC={class:`text-sc-dark-grey`},wC={class:`font-medium`},TC={class:`text-xs`},EC={key:1,class:`text-base font-medium text-nowrap`},DC=bt((0,r.defineComponent)({__name:`order-item-params`,props:{item:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},updateQuantityOnInput:{type:Boolean,default:!0}},setup(e){let n=[t.ConfiguratorsEnum.Kozyrek,t.ConfiguratorsEnum.Mosquitto,t.ConfiguratorsEnum.Strip,t.ConfiguratorsEnum.MetalForDoors,t.ConfiguratorsEnum.Sandwich,t.ConfiguratorsEnum.SandwichM2],i=e,a=(0,r.ref)(!1),s=(0,r.computed)(()=>i.item),c=(0,r.computed)(()=>i.item.product.unit?.isLinear&&i.item.product.properties?.isLengthConfigurator),l=(0,r.computed)(()=>t.UnitsHelper.getProductLengthMultiplicity(i.item.product)),u=(0,r.computed)(()=>F.multiplyByStep(i.item.quantity,l.value)),d=(0,r.computed)(()=>t.UnitsHelper.getProductMultiplicity(i.item.product)),f=(0,r.computed)(()=>d.value>1),p=(0,r.ref)({quantity:i.item.quantity});(0,r.watch)(()=>i.item,e=>{p.value={quantity:e.quantity}});let m=e=>{e!==null&&(p.value.quantity=e,i.eventEmitter?.emit(`order-item:edit-quantity`,{item:s.value,quantity:e,loaderRef:a}))},h=()=>{i.eventEmitter?.emit(`order-item:open-configurator`,{item:s.value})},g=()=>{i.eventEmitter?.emit(`order-item:edit`,{item:s.value})};return(i,s)=>{let _=o.NInputNumber;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,tC,[e.item.configurator&&e.item.configuratorParams&&n.includes(e.item.configurator)?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[(0,r.createElementVNode)(`div`,nC,[(0,r.createElementVNode)(`span`,null,[s[1]||=(0,r.createTextVNode)(` Количество: `,-1),(0,r.createElementVNode)(`span`,rC,(0,r.toDisplayString)(e.item.quantity)+` шт.`,1)]),(0,r.createElementVNode)(`div`,iC,[e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).Kozyrek?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,aC,[s[2]||=(0,r.createTextVNode)(` Длина: `,-1),(0,r.createElementVNode)(`span`,oC,(0,r.toDisplayString)(Math.round(e.item.length*1e3))+` мм.`,1)])):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).Mosquitto?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[(0,r.createElementVNode)(`span`,null,[s[3]||=(0,r.createTextVNode)(` Ширина: `,-1),(0,r.createElementVNode)(`span`,sC,(0,r.toDisplayString)(Math.round(e.item.width*1e3))+` мм.`,1)]),(0,r.createElementVNode)(`span`,null,[s[4]||=(0,r.createTextVNode)(` Высота: `,-1),(0,r.createElementVNode)(`span`,cC,(0,r.toDisplayString)(Math.round(e.item.height*1e3))+` мм.`,1)])],64)):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).Strip?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:2},[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.item.configuratorParams.linesWidths,(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:t},[(0,r.createTextVNode)(` Полоса №`+(0,r.toDisplayString)(Number(t)+1)+`: `,1),(0,r.createElementVNode)(`span`,lC,(0,r.toDisplayString)(e)+` мм.`,1)]))),128)),(0,r.createElementVNode)(`span`,null,[s[5]||=(0,r.createTextVNode)(` Метраж: `,-1),(0,r.createElementVNode)(`span`,uC,(0,r.toDisplayString)(e.item.length)+` м.`,1)])],64)):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).MetalForDoors?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:3},[(0,r.createElementVNode)(`span`,null,[s[6]||=(0,r.createTextVNode)(` Ширина: `,-1),(0,r.createElementVNode)(`span`,dC,(0,r.toDisplayString)(e.item.width)+` мм.`,1)]),(0,r.createElementVNode)(`span`,null,[s[7]||=(0,r.createTextVNode)(` Длина: `,-1),(0,r.createElementVNode)(`span`,fC,(0,r.toDisplayString)(Math.round(e.item.length*1e3))+` мм.`,1)])],64)):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).Sandwich?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:4},(0,r.renderList)(e.item.configuratorParams.items??[],(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:t},[(0,r.createTextVNode)(` Изделие №`+(0,r.toDisplayString)(Number(t)+1)+`: `,1),(0,r.createElementVNode)(`span`,pC,(0,r.toDisplayString)(e.width)+`×`+(0,r.toDisplayString)(e.length)+` мм, `+(0,r.toDisplayString)(e.count)+` шт.`,1)]))),128)):(0,r.createCommentVNode)(``,!0),e.item.configurator===(0,r.unref)(t.ConfiguratorsEnum).SandwichM2?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:5},[(0,r.createElementVNode)(`span`,null,[s[8]||=(0,r.createTextVNode)(` Ширина: `,-1),(0,r.createElementVNode)(`span`,mC,(0,r.toDisplayString)(Math.round(e.item.width*1e3))+` мм.`,1)]),(0,r.createElementVNode)(`span`,null,[s[9]||=(0,r.createTextVNode)(` Длина: `,-1),(0,r.createElementVNode)(`span`,hC,(0,r.toDisplayString)(Math.round(e.item.length*1e3))+` мм.`,1)])],64)):(0,r.createCommentVNode)(``,!0)])]),e.allowEdit?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`#`,class:`text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5`,onClick:(0,r.withModifiers)(h,[`prevent`])},` Изменить `)):(0,r.createCommentVNode)(``,!0)],64)):c.value&&l.value>0?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[(0,r.createElementVNode)(`div`,gC,[(0,r.createElementVNode)(`span`,null,[s[10]||=(0,r.createTextVNode)(` Количество: `,-1),(0,r.createElementVNode)(`span`,_C,(0,r.toDisplayString)(e.item.quantity)+` шт.`,1)]),(0,r.createElementVNode)(`div`,vC,[(0,r.createElementVNode)(`span`,null,[s[11]||=(0,r.createTextVNode)(` Длина: `,-1),(0,r.createElementVNode)(`span`,yC,(0,r.toDisplayString)(l.value)+` `+(0,r.toDisplayString)(e.item.product.unit.name),1)]),(0,r.createElementVNode)(`span`,null,[s[12]||=(0,r.createTextVNode)(` Всего: `,-1),(0,r.createElementVNode)(`span`,bC,(0,r.toDisplayString)(u.value)+` `+(0,r.toDisplayString)(e.item.product.unit.name),1)])])]),e.allowEdit?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`#`,class:`text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5`,onClick:(0,r.withModifiers)(g,[`prevent`])},` Изменить `)):(0,r.createCommentVNode)(``,!0)],64)):e.item.product.getIsMeasurable()?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:2},[(0,r.createElementVNode)(`div`,xC,[(0,r.createElementVNode)(`span`,null,[s[13]||=(0,r.createTextVNode)(` Количество: `,-1),(0,r.createElementVNode)(`span`,SC,(0,r.toDisplayString)(e.item.quantity)+` шт.`,1)]),(0,r.createElementVNode)(`span`,CC,[s[14]||=(0,r.createTextVNode)(` Метраж: `,-1),(0,r.createElementVNode)(`span`,wC,(0,r.toDisplayString)(e.item.length??e.item.width)+` `+(0,r.toDisplayString)(e.item.product.unit.name),1)])]),e.allowEdit?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:`#`,class:`text-xs text-blue-500 hover:text-blue-700 self-start mt-2.5`,onClick:(0,r.withModifiers)(g,[`prevent`])},` Изменить `)):(0,r.createCommentVNode)(``,!0)],64)):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:3},[e.allowEdit?((0,r.openBlock)(),(0,r.createBlock)(_,{key:0,value:p.value.quantity,parse:(0,r.unref)(be),min:d.value,step:d.value,"show-button":f.value,"button-placement":`both`,"update-value-on-input":e.updateQuantityOnInput,disabled:!!a.value,loading:a.value||void 0,placeholder:`Кол-во`,size:`small`,class:`min-w-16 grow`,onKeydown:s[0]||=e=>(0,r.unref)(ye)(e,`.`,!1),onFocus:(0,r.unref)(Se),"onUpdate:value":m},{suffix:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,TC,(0,r.toDisplayString)(e.item.product.unit.name),1)]),_:1},8,[`value`,`parse`,`min`,`step`,`show-button`,`update-value-on-input`,`disabled`,`loading`,`onFocus`])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,EC,(0,r.toDisplayString)(e.item.quantity)+` `+(0,r.toDisplayString)(e.item.product.unit.name),1))],64))])}}}),[[`__scopeId`,`data-v-cdbe0119`]]),OC={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function kC(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,OC,[...t[0]||=[(0,r.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)]])}var AC=(0,r.markRaw)({name:`tabler-truck-filled`,render:kC}),jC={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function MC(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,jC,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.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`}),(0,r.createElementVNode)(`path`,{d:`M5 17H3v-4M2 5h11v12m-4 0h6m4 0h2v-6h-8m0-5h5l3 5M3 9h4`})],-1)]])}var NC=(0,r.markRaw)({name:`tabler-truck-delivery`,render:MC}),PC={viewBox:`0 0 24 24`,width:`1.2em`,height:`1.2em`};function FC(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,PC,[...t[0]||=[(0,r.createElementVNode)(`g`,{fill:`none`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"stroke-width":`2`},[(0,r.createElementVNode)(`path`,{d:`M2 3h1a2 2 0 0 1 2 2v10a2 2 0 0 0 2 2h15`}),(0,r.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)]])}var IC=(0,r.markRaw)({name:`tabler-truck-loading`,render:FC}),LC={class:`flex flex-col gap-1`},RC={key:0,class:`flex flex-row gap-1 text-sm text-sc-grey`},zC={key:1,class:`text-base`},BC={class:`text-sc-dark-grey mr-1.5`},VC={key:0},HC={key:1},UC=(0,r.defineComponent)({__name:`order-delivery-label`,props:{delivery:{},showType:{type:Boolean,default:!0},showDetails:{type:Boolean,default:!0}},setup(e){let n=(0,r.computed)(()=>(0,t.useReferencesStore)().deliveryTypeReference?.find(e=>e.id===s.delivery.type)),a=(0,r.computed)(()=>(0,i.format)(s.delivery.date,`dd.MM.yyyy`)),o=(0,r.computed)(()=>s.delivery.address?.address?_e.getFormatEntityName({name:s.delivery.address.address,deletedAt:s.delivery.address.deletedAt}):``),s=e;return(t,i)=>{let s=IC,c=NC,l=AC;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,LC,[e.showType?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,RC,[n.value?.slug===`self_delivery`?((0,r.openBlock)(),(0,r.createBlock)(s,{key:0})):(0,r.createCommentVNode)(``,!0),n.value?.slug===`delivery`?((0,r.openBlock)(),(0,r.createBlock)(c,{key:1})):(0,r.createCommentVNode)(``,!0),n.value?.slug===`transport_company_delivery`?((0,r.openBlock)(),(0,r.createBlock)(l,{key:2})):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`span`,null,(0,r.toDisplayString)(n.value?.name),1)])):(0,r.createCommentVNode)(``,!0),e.showDetails?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,zC,[(0,r.createElementVNode)(`span`,BC,(0,r.toDisplayString)(a.value),1),e.delivery?.address?.address?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,VC,(0,r.toDisplayString)(o.value),1)):(0,r.createCommentVNode)(``,!0),e.delivery?.warehouse?.address?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,HC,` со склада `+(0,r.toDisplayString)(e.delivery.warehouse.address),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)])}}}),WC={class:`flex flex-col gap-2.5`},GC={class:`text-base`},KC=[`href`],qC={key:1,class:`text-sc-grey`},JC=(0,r.defineComponent)({__name:`order-common-info`,props:{order:{},eventEmitter:{},allowEdit:{type:Boolean},fields:{},showAttachedUserColumn:{type:Boolean},orderContextButtonsConfig:{type:Function},onOrderContextSelect:{type:Function},orderUrl:{},highlightSettings:{}},setup(e){let n=e,i=(0,r.computed)(()=>n.fields.includes(N.Id)?n.order.id:void 0),a=(0,r.computed)(()=>n.fields.includes(N.Status)?(0,t.useReferencesStore)().orderStatusReference?.find(e=>e.id===(n.order.status?.id??-1))?.name:void 0),o=(0,r.computed)(()=>A(n.order.status?.slug)),s=(0,r.computed)(()=>{let e=n.order.status?.slug;return!!e&&(n.highlightSettings?.statuses.includes(e)??!1)}),c=(0,r.computed)(()=>ae(n.order).filter(e=>[E.OnOrder,E.NotInStock].includes(e))),l=e=>n.highlightSettings?.markers.includes(e)??!1,u=(0,r.computed)(()=>n.fields.includes(N.CreatedAt)),d=(0,r.computed)(()=>n.fields.includes(N.ClientInfo)||n.fields.includes(N.ClientInfoShort)?n.order.client:void 0),f=(0,r.computed)(()=>n.fields.includes(N.DeliveryInfo)?n.order.delivery:void 0);return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,WC,[(0,r.createElementVNode)(`span`,GC,[i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`a`,{key:0,href:e.orderUrl.replace(`:id`,e.order.id.toString()),target:`_blank`,class:`text-sc-dark-grey`},` #`+(0,r.toDisplayString)(i.value),9,KC)):(0,r.createCommentVNode)(``,!0),u.value?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[n[0]||=(0,r.createTextVNode)(` от `,-1),(0,r.createVNode)(Jp,{date:e.order.createdAt,"is-time-secondary":!0},null,8,[`date`])],64)):(0,r.createCommentVNode)(``,!0),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:2},[n[1]||=(0,r.createTextVNode)(` - `,-1),s.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:`font-medium`,style:(0,r.normalizeStyle)({color:o.value.color})},(0,r.toDisplayString)(a.value),5)):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,qC,(0,r.toDisplayString)(a.value),1))],64)):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(c.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:e},[n[2]||=(0,r.createTextVNode)(` - `,-1),(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)({"font-medium":l(e),"text-sc-dark-grey":!l(e)}),style:(0,r.normalizeStyle)(l(e)?{color:(0,r.unref)(re)(e).color}:void 0)},(0,r.toDisplayString)((0,r.unref)(ie)(e)),7)],64))),128))]),d.value?((0,r.openBlock)(),(0,r.createBlock)(td,{key:0,client:d.value,class:`ml-3`},null,8,[`client`])):(0,r.createCommentVNode)(``,!0),f.value?((0,r.openBlock)(),(0,r.createBlock)(UC,{key:1,delivery:f.value,class:`ml-3`},null,8,[`delivery`])):(0,r.createCommentVNode)(``,!0)]))}}),YC=(0,r.defineComponent)({__name:`order-payment`,props:{payment:{}},setup(e){let n=e,i=(0,r.computed)(()=>(0,t.useReferencesStore)().paymentTypeReference?.find(e=>e.id===n.payment.type));return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,null,(0,r.toDisplayString)(i.value?.name??`-`),1))}}),XC=(0,r.defineComponent)({__name:`order-item-specification`,props:{src:{}},setup(e){let t=(0,r.useTemplateRef)(`image-reference`);return(n,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)(`a`,{class:`text-blue-500 hover:underline text-sm mt-1 block cursor-pointer`,onClick:i[0]||=e=>t.value?.showPreview()},` Спецификация `),(0,r.withDirectives)((0,r.createVNode)((0,r.unref)(o.NImage),{ref:`image-reference`,src:e.src,"previewed-img-props":{style:`max-width: 80vw; max-height: 80vh; object-fit: contain; border: 12px solid white;`}},null,8,[`src`]),[[r.vShow,!1]])],64))}}),ZC=(0,r.defineComponent)({__name:`creator-user-type-tag`,props:{userType:{default:void 0},prefixText:{default:`Добавлено`},variant:{default:`info`},changedFields:{default:void 0}},setup(e){let n=e,i={quantity:`количество`,length:`длина`},a=(0,r.computed)(()=>n.variant===`danger`||n.changedFields?`bg-orange-500`:`bg-sky-500`),o=(0,r.computed)(()=>{let e={[t.UserTypeEnum.Manager]:`менеджером`,[t.UserTypeEnum.Operator]:`оператором`,[t.UserTypeEnum.Client]:`клиентом`,[t.UserTypeEnum.Admin]:`администратором`};if(n.changedFields){let t=n.changedFields.map(e=>i[e]??e).join(`, `);return`Было изменено${n.userType?` ${e[n.userType]??``}`:``}: ${t}`}let r=n.userType?` ${e[n.userType]??``}`:``;return`${n.prefixText}${r}`.trim()});return(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)(`small`,{class:(0,r.normalizeClass)(`inline-block py-[0.0625rem] px-1.5 text-xs font-bold text-center whitespace-nowrap rounded text-white no-underline opacity-100 ${a.value}`)},(0,r.toDisplayString)(o.value),3))}}),QC={class:`flex flex-col gap-0.5`},$C={class:`text-gray-600`},ew=(0,r.defineComponent)({__name:`order-item-name`,props:{item:{},showCode:{type:Boolean,default:!1},inactive:{type:Boolean,default:void 0}},setup(e){let n=e,i=(0,r.inject)(t.currentOrderInjectionKey,null),a=(0,r.computed)(()=>{if(i!=null)return(0,r.toValue)(i)??void 0}),o=(0,r.computed)(()=>{let{item:e,inactive:t}=n;return t??(!!e.isRemoved||!!e.replacementId)}),s=(0,r.computed)(()=>{let{creator:e}=n.item;return!!e?.type&&(!a.value||a.value.creator.guid!==e.guid)}),c=(0,r.computed)(()=>`specificationImgUrl`in n.item?n.item.specificationImgUrl:void 0),l=(0,r.computed)(()=>`changedFields`in n.item?n.item.changedFields:[]),u=(0,r.computed)(()=>`replacement`in n.item?n.item.replacement?.creator?.type:void 0);return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,QC,[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)(o.value?`line-through opacity-50`:``)},[(0,r.createVNode)(tr,{product:e.item.product,"show-additional-sale-icon":e.item.isAdditionalSale??!1,"show-code":e.showCode},null,8,[`product`,`show-additional-sale-icon`,`show-code`])],2),e.item.marker?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)(o.value?`line-through opacity-50`:``)},[n[0]||=(0,r.createTextVNode)(` Маркировка: `,-1),(0,r.createElementVNode)(`span`,$C,(0,r.toDisplayString)(e.item.marker),1)],2)):(0,r.createCommentVNode)(``,!0),c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:1,class:(0,r.normalizeClass)(o.value?`line-through opacity-50`:``)},[(0,r.createVNode)(XC,{src:c.value},null,8,[`src`])],2)):(0,r.createCommentVNode)(``,!0),s.value&&!o.value?((0,r.openBlock)(),(0,r.createBlock)(ZC,{key:2,"user-type":e.item.creator.type,class:`mt-1 self-start`,"prefix-text":`Добавлено`},null,8,[`user-type`])):(0,r.createCommentVNode)(``,!0),e.item.isRemoved&&!e.item.replacementId&&l.value.length===0?((0,r.openBlock)(),(0,r.createBlock)(ZC,{key:3,class:`mt-1 self-start`,"prefix-text":`Удалено`,variant:`danger`})):(0,r.createCommentVNode)(``,!0),e.item.replacementId&&l.value.length>0?((0,r.openBlock)(),(0,r.createBlock)(ZC,{key:4,"user-type":u.value,"changed-fields":l.value,class:`mt-1 self-start`},null,8,[`user-type`,`changed-fields`])):(0,r.createCommentVNode)(``,!0)]))}}),tw={class:`flex flex-row gap-1.5`},nw={class:`flex flex-1 flex-col gap-2.5`},rw={class:`flex items-start gap-1`},iw=(0,r.defineComponent)({__name:`order-product-info`,props:{product:{},index:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},updateQuantityOnInput:{type:Boolean,default:!0},inactive:{type:Boolean,default:!1},showActions:{type:Boolean,default:void 0}},setup(e){let t=e,n=(0,r.computed)(()=>t.inactive?`line-through opacity-50`:``);return(t,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,tw,[(0,r.createElementVNode)(`span`,{class:(0,r.normalizeClass)([`flex-none text-nowrap`,n.value])},(0,r.toDisplayString)(e.index+1)+`. `,3),(0,r.createElementVNode)(`div`,nw,[(0,r.createVNode)(ew,{item:e.product,inactive:e.inactive,"show-code":``},null,8,[`item`,`inactive`]),(0,r.createElementVNode)(`div`,rw,[(0,r.createVNode)(DC,{item:e.product,"event-emitter":e.eventEmitter,"allow-edit":e.allowEdit,"update-quantity-on-input":e.updateQuantityOnInput,class:(0,r.normalizeClass)([`min-w-0 flex-1`,n.value])},null,8,[`item`,`event-emitter`,`allow-edit`,`update-quantity-on-input`,`class`]),e.showActions??e.allowEdit?(0,r.renderSlot)(t.$slots,`actions`,{},void 0,void 0,0):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)([`grid grid-flow-col grid-rows-2 gap-1 text-base`,n.value])},[i[0]||=(0,r.createElementVNode)(`span`,null,`Цена за ед.`,-1),(0,r.createVNode)(Vt,{product:e.product,"cost-field-name":`costOneRub`},null,8,[`product`]),i[1]||=(0,r.createElementVNode)(`span`,null,`Сумма`,-1),(0,r.createVNode)(Vt,{product:e.product,"cost-field-name":`cost`},null,8,[`product`])],2),(0,r.renderSlot)(t.$slots,`extra`)])]))}}),aw={class:`flex items-center gap-1.5`},ow={key:0,class:`h-1.5 w-1.5 shrink-0 rounded-full bg-current`},sw=(0,r.defineComponent)({__name:`status-tag`,props:{tag:{},size:{default:`medium`},round:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},showDot:{type:Boolean,default:!1}},setup(e){let t=e,n=(0,r.computed)(()=>t.tag.colors?D(t.tag.colors):void 0);return(t,i)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NTag),{color:n.value,type:e.tag.type,size:e.size,bordered:e.bordered,round:e.round},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,aw,[e.showDot?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,ow)):(0,r.createCommentVNode)(``,!0),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.tag.label),1)])]),_:1},8,[`color`,`type`,`size`,`bordered`,`round`]))}}),cw={key:0,class:`h-1.5 w-1.5 shrink-0 rounded-full bg-current`},lw=(0,r.defineComponent)({__name:`order-status-tag`,props:{status:{},statusDetail:{default:null},variant:{default:`filled`},size:{default:`medium`},showDot:{type:Boolean,default:!0}},setup(e){let t=e,n=(0,r.computed)(()=>A(t.status.slug)),i=(0,r.computed)(()=>t.statusDetail?`${t.status.name} (${t.statusDetail.name})`:t.status.name),a=(0,r.computed)(()=>({label:i.value,colors:n.value}));return(t,o)=>e.variant===`filled`?((0,r.openBlock)(),(0,r.createBlock)(sw,{key:0,tag:a.value,size:e.size,"show-dot":e.showDot,round:``},null,8,[`tag`,`size`,`show-dot`])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:1,class:`inline-flex items-center gap-1.5 font-medium`,style:(0,r.normalizeStyle)({color:n.value.color})},[e.showDot?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,cw)):(0,r.createCommentVNode)(``,!0),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(i.value),1)],4))}}),uw=(0,r.defineComponent)({__name:`order-color-swatch`,props:{colors:{}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{class:`inline-flex h-5 min-w-8 shrink-0 items-center justify-center rounded px-1.5 text-xs font-semibold leading-none`,style:(0,r.normalizeStyle)({backgroundColor:e.colors.backgroundColor,color:e.colors.textOnBackgroundColor,border:`1px solid ${e.colors.color}`})},` Аа `,4))}}),dw={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function fw(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,dw,[...t[0]||=[(0,r.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),(0,r.createElementVNode)(`path`,{fill:`currentColor`,stroke:`currentColor`,"stroke-linecap":`round`,"stroke-miterlimit":`10`,"stroke-width":`32`,d:`M80 112h352`},null,-1),(0,r.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)]])}var pw=(0,r.markRaw)({name:`ion-trash-outline`,render:fw}),mw={key:0,class:`!mb-3 !mt-0 text-base font-semibold`},hw={class:`mb-1 flex flex-wrap items-baseline justify-between gap-2`},gw={class:`flex items-baseline gap-2`},_w={class:`text-base font-bold text-sc-dark-grey`},vw={key:0,class:`text-sm text-sc-grey`},yw={key:0,class:`text-sm text-sc-dark-grey`},bw=bt((0,r.defineComponent)({__name:`order-items-list`,props:(0,r.mergeModels)({products:{},maxHeight:{default:void 0},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1},selectable:{type:Boolean,default:!1},title:{default:`Список позиций`},groups:{default:void 0},extraColumns:{default:void 0},isItemInactive:{type:Function,default:void 0},isItemSelectable:{type:Function,default:void 0},isItemRemovable:{type:Function,default:void 0},updateQuantityOnInput:{type:Boolean,default:!0}},{selectedRowKeys:{default:()=>[]},selectedRowKeysModifiers:{}}),emits:[`update:selectedRowKeys`],setup(e){let t=e,i=(0,r.useModel)(e,`selectedRowKeys`),a=e=>(0,n.sortBy)(e,`ord`),s=(0,r.computed)(()=>a(t.products)),c=e=>t.isItemInactive?t.isItemInactive(e):!!e.isRemoved||!!e.replacementId,l=e=>t.isItemSelectable?t.isItemSelectable(e):!c(e),u=e=>t.isItemRemovable?t.isItemRemovable(e):!c(e),d=(e,t)=>{t?i.value.includes(e)||(i.value=[...i.value,e]):i.value=i.value.filter(t=>t!==e)},f=e=>t.selectable?{class:i.value.includes(e.id)?void 0:`opacity-60`}:{},p=(e,t)=>{let n=s.value,r=e.logicGroupId;if(!r)return 1;let i=n.at(t-1);if(t&&i&&i.logicGroupId===r)return 0;let a=n.slice(t),o=a.findIndex(e=>e.logicGroupId!==r);return o===-1?a.length:o},m=e=>u(e)?(0,r.h)(o.NButton,{quaternary:!0,size:`small`,type:`error`,onClick:()=>{t.eventEmitter?.emit(`order-item:delete`,{item:e})}},()=>(0,r.h)(pw)):null,h=(e,i)=>(t.extraColumns??[]).flatMap(t=>{let a=t.render?.(e,i);if((0,n.isNil)(a)||a===``||a===!1)return[];let o=(0,n.isFunction)(t.title)?t.title(t):t.title;return[(0,r.h)(`div`,{class:`flex flex-col items-start gap-1 text-sm`},[(0,r.h)(`span`,{class:`text-sc-dark-grey`},[o]),a])]}),g=(0,r.ref)(oe.getDeviceTypeByResolution()),_=(0,r.ref)(window.innerWidth),v=(0,r.computed)(()=>!(0,n.isNil)(t.maxHeight)||!(0,n.isNil)(t.groups)),y=()=>{let e=[{title:`№ п.п.`,key:`id`,resizable:!0,width:64,render:(e,t)=>(0,r.h)(`span`,{class:`text-base text-nowrap${c(e)?` line-through opacity-50`:``}`},[t+1,`.`])},{title:`Артикул`,key:`codeNumber`,resizable:!0,width:_.value>=1536?156:120,render:e=>(0,r.h)(`span`,{class:`text-base${c(e)?` line-through opacity-50`:``}`},[e.product.code])},{title:`Наименование`,key:`name`,resizable:!0,minWidth:(0,n.isNil)(t.groups)?void 0:240,render:e=>(0,r.h)(ew,{item:e,inactive:c(e)})},{title:`Кол-во`,key:`quantity`,resizable:!0,width:180,rowSpan:p,render:e=>(0,r.h)(DC,{class:c(e)?`line-through opacity-50`:``,item:e,eventEmitter:t.eventEmitter,allowEdit:t.allowEdit&&!c(e),updateQuantityOnInput:t.updateQuantityOnInput})},{title:`Цена за ед.`,key:`costOneRub`,resizable:!0,width:v.value?170:120,render:e=>(0,r.h)(`div`,{class:c(e)?`line-through opacity-50`:``},[(0,r.h)(Vt,{product:e,costFieldName:`costOne`,showQuantityUnit:!0})])},{title:`Сумма`,key:`cost`,resizable:!0,width:v.value?140:120,render:e=>(0,r.h)(`div`,{class:c(e)?`line-through opacity-50`:``},[(0,r.h)(Vt,{product:e,costFieldName:`cost`,showCurrency:!0})])},...t.extraColumns??[],...t.allowEdit?[{title:``,key:`delete`,width:44,rowSpan:p,render:e=>m(e)}]:[]],a=t.selectable?[{key:`checkbox`,title:``,className:`align-top`,width:`32`,cellProps:e=>({class:l(e)?`cursor-pointer`:void 0,onClick:()=>{l(e)&&d(e.id,!i.value.includes(e.id))}}),render:e=>(0,r.h)(o.NCheckbox,{checked:i.value.includes(e.id),disabled:!l(e)})}]:[];switch(g.value){case P.phone:case P.tablet:return[...a,{title:``,key:`items`,resizable:!0,render:(e,n)=>{let i=p(e,n)>0,a=t.allowEdit&&!c(e)&&i;return(0,r.h)(iw,{product:e,index:n,eventEmitter:t.eventEmitter,allowEdit:a,updateQuantityOnInput:t.updateQuantityOnInput,inactive:c(e),showActions:t.allowEdit&&i},{actions:()=>m(e),extra:()=>h(e,n)})}}];case P.laptop:return[...a,...e];default:return[...a,...e]}},b=(0,r.computed)(()=>y()),x=e=>{let t=e.width??e.minWidth;return(0,n.isNil)(t)?0:Number.parseFloat(String(t))||0},S=(0,r.computed)(()=>g.value===P.phone||g.value===P.tablet?void 0:(0,n.sumBy)(b.value,x)),C=()=>{g.value=oe.getDeviceTypeByResolution(),_.value=window.innerWidth};return(0,r.onMounted)(()=>{C(),window.addEventListener(`resize`,C)}),(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,C)}),(t,n)=>{let i=o.NDataTable;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[e.title?((0,r.openBlock)(),(0,r.createElementBlock)(`h3`,mw,(0,r.toDisplayString)(e.title),1)):(0,r.createCommentVNode)(``,!0),e.groups?((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,{key:1},(0,r.renderList)(e.groups,t=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:t.name,class:`mb-6 last:mb-0`},[(0,r.createElementVNode)(`div`,hw,[(0,r.createElementVNode)(`div`,gw,[(0,r.createElementVNode)(`span`,_w,(0,r.toDisplayString)(t.name),1),t.description?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,vw,(0,r.toDisplayString)(t.description),1)):(0,r.createCommentVNode)(``,!0)]),t.summary?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,yw,(0,r.toDisplayString)(t.summary),1)):(0,r.createCommentVNode)(``,!0)]),(0,r.createVNode)(i,{columns:b.value,data:a(t.items),"row-key":e=>e.id,"row-props":f,"bottom-bordered":!1,bordered:!1,"max-height":e.maxHeight,"scroll-x":S.value,"table-layout":`fixed`},null,8,[`columns`,`data`,`row-key`,`max-height`,`scroll-x`])]))),128)):((0,r.openBlock)(),(0,r.createBlock)(i,{key:2,columns:b.value,data:s.value,"row-key":e=>e.id,"row-props":f,"bottom-bordered":!1,bordered:!1,"max-height":e.maxHeight},null,8,[`columns`,`data`,`row-key`,`max-height`]))],64)}}}),[[`__scopeId`,`data-v-76fe9dca`]]),xw={key:0,class:`text-sc-dark-grey my-2 text-center`},Sw={key:1,class:`text-sc-dark-grey my-2`},Cw=(0,r.defineComponent)({__name:`order-status-history`,props:{order:{}},setup(e){let n=e,a=(0,r.ref)(!1),s=(0,r.ref)([]),c=e=>{let{uiDateWithTime:n}=(0,t.useBaseConfigStore)().config.dateFormats;return(0,i.format)(e,n)},l=(e=!0)=>{e&&(a.value=!0),t.HttpRequester.getInstance(t.OrdersDataProvider).getOrderStatusHistory(n.order.id).then(e=>{s.value=e}).finally(()=>{e&&(a.value=!1)})};return(0,r.watch)(()=>n.order,()=>{l(!1)}),(0,r.onMounted)(()=>{l()}),(e,t)=>{let n=o.NSpin,i=o.NTimelineItem,l=o.NTimeline;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[t[1]||=(0,r.createElementVNode)(`h3`,{class:`!mb-3 !mt-0 text-base font-semibold`},`История статусов`,-1),a.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,xw,[(0,r.createVNode)(n,{size:`small`,class:`mb-1 align-middle`}),t[0]||=(0,r.createElementVNode)(`span`,{class:`ml-2`},`Загрузка истории ...`,-1)])):s.value.length===0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Sw,` История статусов отсутствует. `)):((0,r.openBlock)(),(0,r.createBlock)(l,{key:2},{default:(0,r.withCtx)(()=>[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(s.value,(e,t)=>((0,r.openBlock)(),(0,r.createBlock)(i,{key:t,color:(0,r.unref)(A)(e.status.slug).color,time:c(e.createdAt),content:e.user.name},{header:(0,r.withCtx)(()=>[(0,r.createVNode)(lw,{status:e.status,"status-detail":e.statusDetail,variant:t===0?`filled`:`text`,"show-dot":!1,size:`small`},null,8,[`status`,`status-detail`,`variant`])]),_:2},1032,[`color`,`time`,`content`]))),128))]),_:1}))])}}}),ww={class:`text-base`},Tw=(0,r.defineComponent)({__name:`user-short-info`,props:{user:{},showUserType:{type:Boolean,default:!0},extraInfoOnSecondLine:{type:Boolean,default:!0}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)({"flex flex-col":e.showUserType&&e.extraInfoOnSecondLine})},[(0,r.createElementVNode)(`span`,ww,(0,r.toDisplayString)(e.user.name),1),e.showUserType?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,{key:0,class:(0,r.normalizeClass)([{"ml-1":!e.extraInfoOnSecondLine},`text-sc-grey`])},` [`+(0,r.toDisplayString)(e.user.type)+`] `,3)):(0,r.createCommentVNode)(``,!0)],2))}}),Ew={class:`ml-4 grid grid-cols-3 gap-1.5 text-base`},Dw={class:`col-span-2`},Ow={class:`col-span-2`},kw=(0,r.defineComponent)({__name:`order-details`,props:{order:{}},emits:[`click:client-name`],setup(e,{emit:t}){let n=t;return(t,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,null,[i[11]||=(0,r.createElementVNode)(`h3`,null,`Детали заказа`,-1),(0,r.createElementVNode)(`div`,Ew,[e.order.creator.id===e.order.client.id?(0,r.createCommentVNode)(``,!0):((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[i[1]||=(0,r.createElementVNode)(`span`,null,`Создал`,-1),(0,r.createVNode)(Tw,{user:e.order.creator,class:`col-span-2`},null,8,[`user`])],64)),i[10]||=(0,r.createElementVNode)(`span`,null,`Клиент`,-1),(0,r.createVNode)(td,{client:e.order.client,class:`col-span-2`,"onClick:clientName":i[0]||=t=>n(`click:client-name`,e.order.client,t)},null,8,[`client`]),e.order.contragent?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:1},[i[2]||=(0,r.createElementVNode)(`span`,null,`Контрагент`,-1),(0,r.createVNode)(rd,{contragent:e.order.contragent,class:`col-span-2`},null,8,[`contragent`])],64)):(0,r.createCommentVNode)(``,!0),e.order.image?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:2},[i[3]||=(0,r.createElementVNode)(`span`,null,`Графический файл клиента`,-1),i[4]||=(0,r.createElementVNode)(`a`,{class:`fancybox col-span-2`,href:`{{ order.image }}`},` Посмотреть `,-1)],64)):(0,r.createCommentVNode)(``,!0),e.order.barcode?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:3},[i[5]||=(0,r.createElementVNode)(`span`,null,`Штрих-код`,-1),(0,r.createElementVNode)(`span`,Dw,(0,r.toDisplayString)(e.order.barcode),1)],64)):(0,r.createCommentVNode)(``,!0),e.order.payment?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:4},[i[6]||=(0,r.createElementVNode)(`span`,null,`Оплата`,-1),(0,r.createVNode)(YC,{payment:e.order.payment,class:`col-span-2`},null,8,[`payment`])],64)):(0,r.createCommentVNode)(``,!0),e.order.delivery?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:5},[i[7]||=(0,r.createElementVNode)(`span`,null,`Доставка`,-1),(0,r.createVNode)(UC,{delivery:e.order.delivery,class:`col-span-2`},null,8,[`delivery`])],64)):(0,r.createCommentVNode)(``,!0),e.order.comment?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:6},[i[8]||=(0,r.createElementVNode)(`span`,null,`Комментарий`,-1),(0,r.createElementVNode)(`span`,Ow,(0,r.toDisplayString)(e.order.comment),1)],64)):(0,r.createCommentVNode)(``,!0),e.order.attachedUser?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:7},[i[9]||=(0,r.createElementVNode)(`span`,null,`Закреплен за`,-1),(0,r.createVNode)(Tw,{user:e.order.attachedUser,class:`col-span-2`},null,8,[`user`])],64)):(0,r.createCommentVNode)(``,!0)])]))}}),Aw={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function jw(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,Aw,[...t[0]||=[(0,r.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),(0,r.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)]])}var Mw=(0,r.markRaw)({name:`ion-copy-outline`,render:jw}),Nw={class:`flex flex-col items-stretch gap-1.5 text-base`},Pw=bt((0,r.defineComponent)({__name:`order-external-links`,props:{showErpLink:{type:Boolean,default:!1},order:{}},setup(e){let t=(0,r.computed)(()=>{let t=(e.order.invoices?.length??0)>0;return e.showErpLink&&!!e.order.erpOrderUrl||t||!!e.order.payment?.onlinePaymentLink});return(n,i)=>{let a=o.NButton,s=Mw;return t.value?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[i[2]||=(0,r.createElementVNode)(`h3`,{class:`!mb-3 !mt-0 text-base font-semibold`},`Внешние ссылки`,-1),(0,r.createElementVNode)(`div`,Nw,[e.showErpLink&&e.order.erpOrderUrl?((0,r.openBlock)(),(0,r.createBlock)(a,{key:0,tag:`a`,href:e.order.erpOrderUrl,target:`_blank`,block:``,class:`sc-external-link-button`},{default:(0,r.withCtx)(()=>[...i[0]||=[(0,r.createTextVNode)(` Открыть в ERP `,-1)]]),_:1},8,[`href`])):(0,r.createCommentVNode)(``,!0),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.order.invoices??[],(e,t)=>((0,r.openBlock)(),(0,r.createBlock)(a,{key:t,tag:`a`,href:e,block:``,class:`sc-external-link-button`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)(` Скачать счет №`+(0,r.toDisplayString)(t+1),1)]),_:2},1032,[`href`]))),128)),e.order.payment?.onlinePaymentLink?(0,r.withDirectives)(((0,r.openBlock)(),(0,r.createBlock)(a,{key:1,block:``,class:`sc-external-link-button`,title:`Ссылка на оплату копируется в буфер обмена`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(s,{class:`mr-1.5`}),i[1]||=(0,r.createTextVNode)(` Скопировать ссылку на оплату `,-1)]),_:1})),[[(0,r.unref)(y),e.order.payment.onlinePaymentLink]]):(0,r.createCommentVNode)(``,!0)])],64)):(0,r.createCommentVNode)(``,!0)}}}),[[`__scopeId`,`data-v-53afb2ef`]]),Fw={key:0},Iw={class:`text-sc-dark-grey my-2 text-center`},Lw={key:1,class:`text-sc-dark-grey my-2 text-center`},Rw={key:2},zw={class:`text-sc-dark-grey mt-4 text-right font-bold`},Bw={class:`text-sc-primary`},Vw={class:`mb-4 max-w-xs empty:hidden`},Hw=(0,r.defineComponent)({__name:`order-info`,props:{order:{},eventEmitter:{default:void 0},allowEdit:{type:Boolean,default:!1}},emits:[`click:client-name`],setup(e,{emit:i}){let a=e,s=i,c=(0,r.ref)(!1),l=(0,r.ref)();(0,r.provide)(t.currentOrderInjectionKey,(0,r.computed)(()=>l.value??null));let u=(e=!0)=>{`products`in a.order?l.value=new t.Order(a.order):(e&&(c.value=!0),t.HttpRequester.getInstance(t.OrdersDataProvider).getOrder(a.order.id).then(e=>{l.value=e}).finally(()=>{e&&(c.value=!1)}))},d=(0,r.computed)(()=>(l.value?.products??[]).filter(e=>!e.isRemoved&&!e.replacementId)),f=(0,r.computed)(()=>F.formatMoney((0,n.sumBy)(d.value,`costRub`)));return(0,r.watch)(()=>a.order,()=>{u(!1)}),(0,r.onMounted)(()=>{u()}),(t,n)=>{let i=o.NSpin;return c.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Fw,[(0,r.createElementVNode)(`div`,Iw,[(0,r.createVNode)(i,{size:`small`,class:`mb-2.5 align-middle`}),n[1]||=(0,r.createElementVNode)(`div`,null,[(0,r.createElementVNode)(`span`,null,`Загрузка данных ...`)],-1)])])):!l.value||l.value.products.length===0?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Lw,` --- Не удалось загрузить данные о заказе --- `)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Rw,[(0,r.createVNode)(bw,{products:d.value,"event-emitter":e.eventEmitter,"allow-edit":e.allowEdit},null,8,[`products`,`event-emitter`,`allow-edit`]),(0,r.createElementVNode)(`div`,zw,[n[2]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,Bw,(0,r.toDisplayString)(f.value)+` ₽`,1)]),(0,r.createVNode)(kw,{order:l.value,"onClick:clientName":n[0]||=e=>s(`click:client-name`,l.value.client,e)},null,8,[`order`]),(0,r.createElementVNode)(`div`,Vw,[(0,r.createVNode)(Pw,{order:l.value,"show-erp-link":``},null,8,[`order`])]),(0,r.createVNode)(Cw,{order:l.value},null,8,[`order`])]))}}}),Uw=(0,r.defineComponent)({__name:`order-actions`,props:{orderContextButtonsConfig:{type:Function,default:void 0},onOrderContextSelect:{type:Function,default:void 0},order:{}},setup(e){let t=e,i=(0,r.inject)(Tt,`small`),a=(0,r.computed)(()=>(0,n.isNil)(t.orderContextButtonsConfig)?[]:(0,n.isFunction)(t.orderContextButtonsConfig)?t.orderContextButtonsConfig(t.order):t.orderContextButtonsConfig),s=e=>{t.onOrderContextSelect?.(t.order,e)};return(e,t)=>{let n=Ie,c=o.NButton,l=o.NDropdown;return a.value?.length>0?((0,r.openBlock)(),(0,r.createBlock)(l,{key:0,options:a.value,size:(0,r.unref)(i),trigger:`click`,onSelect:s},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(c,{ghost:!0,size:(0,r.unref)(i),type:`primary`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(n)]),_:1},8,[`size`])]),_:1},8,[`options`,`size`])):(0,r.createCommentVNode)(``,!0)}}}),Ww=bt((0,r.defineComponent)({__name:`orders-list`,props:(0,r.mergeModels)({fields:{},showAttachedUserColumn:{type:Boolean,default:!1},orderContextButtonsConfig:{},onOrderContextSelect:{},orderUrl:{},tableMinWidth:{default:1/0},filters:{default:void 0},sort:{default:void 0},pagination:{default:void 0},useCellIndication:{type:Boolean,default:!1},highlightSettings:{default:void 0},enableSorting:{type:Boolean,default:!1},refreshInterval:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0},selectable:{type:Boolean,default:!1},isRowSelectable:{type:Function,default:void 0}},{checkedRowKeys:{default:()=>[]},checkedRowKeysModifiers:{}}),emits:(0,r.mergeModels)([`click:client-name`,`dblclick:row`,`update:pagination`,`update:sort`],[`update:checkedRowKeys`]),setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.useModel)(e,`checkedRowKeys`),u=(e,t)=>{t?l.value.includes(e)||(l.value=[...l.value,e]):l.value=l.value.filter(t=>t!==e)},d=()=>(0,n.cloneDeep)(s.sort??[{field:`id`,direction:`desc`}]),f=(0,r.ref)(d()),p=(0,r.ref)([]),m=(0,r.ref)(!1),h=(0,r.ref)(700),g=()=>{let e=oe.getDeviceTypeByResolution(),n=e===P.phone||e===P.tablet;if(s.stickyHeaderOnMobile||!n)return h.value*((0,t.useBaseConfigStore)().config.tableDefaultHeightCoefficient??.6)},_=(0,r.ref)(g()),v=(0,r.computed)(()=>s.highlightSettings?s.highlightSettings:{statuses:[],markers:s.useCellIndication?[...M]:[]}),y=e=>{let t={onDblclick:()=>c(`dblclick:row`,e)},r=[];s.selectable&&l.value.length>0&&!l.value.includes(e.id)&&r.push(`opacity-60`);let i=v.value,a=new Set(ae(e).filter(e=>i.markers.includes(e))),o={},u=[E.NotInStock,E.OnOrder,E.LargeOrder].find(e=>a.has(e));if(u){let e=re(u);r.push(`order-id-marked`,u),o[`--sc-order-id-bg`]=e.backgroundColor,o[`--sc-order-id-text`]=e.textOnBackgroundColor}if(a.has(E.NextDayDelivery)){let e=re(E.NextDayDelivery);r.push(`delivery-date-marked`),o[`--sc-delivery-date-bg`]=e.backgroundColor,o[`--sc-delivery-date-text`]=e.textOnBackgroundColor}return e.status.slug&&i.statuses.includes(e.status.slug)&&(r.push(`order-status-highlighted`,e.status.slug),(0,n.assign)(o,te(e.status.slug))),(0,n.isEmpty)(o)||(t.style=o),r.length>0&&(t.class=r.join(` `)),t},b=()=>{let e=[N.CreatedAt,N.Id,N.ClientInfo,N.ClientCity,N.DeliveryDate,N.PaymentType,N.SalesDirections,N.Status,...s.showAttachedUserColumn?[N.AttachedUser]:[],N.actions],t=s.fields.length>0?s.fields:e,i={title:`???`,key:`undefined`,render:()=>(0,r.h)(`span`,{},[`--- unknown ---`])},a={type:`expand`,expandable:(0,n.constant)(!0),renderExpand:e=>(0,r.h)(Hw,{order:e,class:`pl-10 pt-3 pb-10`,"onClick:client-name":()=>{c(`click:client-name`,e.client,null)}}),width:`30`},d=[{title:`Дата заказа`,key:N.CreatedAt,resizable:!0,width:100,render:e=>(0,r.h)(Jp,{date:e.createdAt,isTimeSecondary:!0,isTimeOnSecondLine:!0,class:`text-base`})},{title:`№ заказа`,key:N.Id,resizable:!0,width:`calc(3.9em + 35px)`,className:`order-id`,render:e=>(0,r.h)(`a`,{href:s.orderUrl.replace(`:id`,e.id.toString()),class:`text-base`},e.id)},{title:`Дата доставки / самовывоза`,key:N.DeliveryDate,resizable:!0,width:`calc(6.6em + 35px)`,className:`delivery-date`,render:e=>(0,r.h)(Jp,{date:e.delivery.date,isShowTime:!1,class:`text-base`})},{title:`Клиент`,key:N.ClientInfo,resizable:!0,minWidth:320,render:e=>(0,r.h)(td,{client:e.client,"onClick:client-name":()=>{c(`click:client-name`,e.client,null)}})},{title:`Тип доставки`,key:N.DeliveryInfo,resizable:!0,minWidth:320,render:e=>(0,r.h)(UC,{delivery:e.delivery})},{title:`Клиент`,key:N.ClientInfoShort,resizable:!0,minWidth:320,render:e=>(0,r.h)(td,{client:e.client,showCityAndRegion:!1,"onClick:client-name":()=>{c(`click:client-name`,e.client,null)}})},{title:`Город клиента`,key:N.ClientCity,resizable:!0,minWidth:90,width:120,render:e=>(0,r.h)(`span`,{class:`text-base`},e.client?.city.name??`—`)},{title:`Статус`,key:N.Status,resizable:!0,width:150,minWidth:115,className:`order-status`,render:e=>(0,r.h)(`span`,{class:`text-base`},[e.status.name])},{title:`Тип оплаты`,key:N.PaymentType,resizable:!0,width:115,minWidth:95,render:e=>e.payment?(0,r.h)(YC,{payment:e.payment}):(0,r.h)(`span`,{class:`text-base`},`—`)},{title:`Напр. продаж`,key:N.SalesDirections,resizable:!0,width:`calc(4.4em + 32px)`,render:e=>(0,r.h)(`span`,{class:`text-base`},[e.salesDirection?.name??``])},...s.showAttachedUserColumn?[{title:`Закреплено за`,key:N.AttachedUser,resizable:!0,minWidth:120,render:e=>(0,r.h)(`span`,{class:`text-base`},[e?.attachedUser?.name??``])}]:[]];s.orderContextButtonsConfig&&d.push({key:`actions`,title:``,className:`align-top`,width:50,render:e=>(0,r.h)(Uw,{order:e,orderContextButtonsConfig:s.orderContextButtonsConfig,onOrderContextSelect:s.onOrderContextSelect})}),s.enableSorting&&(d=d.map(e=>[N.Id,N.CreatedAt,N.DeliveryDate].includes(e.key)?{...e,sorter:!0,sortOrder:!1,...e.width===void 0?{}:{width:(0,n.isNumber)(e.width)?e.width+16:`calc(${e.width} + 16px)`}}:e));let f=s.selectable?[{key:`selection`,title:``,className:`align-top`,width:`32`,cellProps:e=>{let t=s.isRowSelectable?.(e)??!0;return{class:t?`cursor-pointer`:void 0,onClick:()=>{t&&u(e.id,!l.value.includes(e.id))}}},render:e=>s.isRowSelectable?.(e)??!0?(0,r.h)(o.NCheckbox,{checked:l.value.includes(e.id)}):null}]:[];switch(oe.getDeviceTypeByResolution()){case P.phone:case P.tablet:return[...f,a,{key:`order`,title:`Заказ`,resizable:!0,render:e=>(0,r.h)(JC,{order:e,fields:t,orderUrl:s.orderUrl,highlightSettings:v.value})}];case P.laptop:{let e=s.showAttachedUserColumn?t:t.filter(e=>e!==N.AttachedUser);return[...f,a,...e.map(e=>d.find(t=>t.key===e)??i)]}default:return[i]}},x=(0,r.ref)(b()),S=(0,r.ref)(new t.TableDataPagination(s.pagination??{page:1,pageSize:10,itemCount:0,pageCount:1,pageSlot:5,pageSizes:[10,15,25],showSizePicker:!0})),C=(0,r.computed)(()=>({...S.value,prefix({itemCount:e}){return`Всего заказов: ${e}`}})),w=(0,r.ref)(null),T=(0,r.ref)(null),D=(0,r.ref)(null),O=(0,r.ref)(null),k=(0,r.ref)(null),A=()=>{k.value!==null&&(clearInterval(k.value),k.value=null)},ee=()=>{A(),s.refreshInterval&&(k.value=setInterval(()=>{ie()},s.refreshInterval))},ne=e=>{S.value.itemCount!==e.meta.total&&(S.value.itemCount=e.meta.total),S.value.page!==e.meta.currentPage&&(S.value.page=e.meta.currentPage),S.value.pageCount!==e.meta.lastPage&&(S.value.pageCount=e.meta.lastPage),S.value.pageSize!==e.meta.perPage&&(S.value.pageSize=e.meta.perPage),p.value=e.data},j=()=>{s.filters&&(T.value?.abort(),T.value=null,D.value?.abort(),D.value=null,O.value=null,w.value?.abort(),w.value=new AbortController,m.value=!0,t.HttpRequester.getInstance(t.OrdersDataProvider).getOrders(s.filters,f.value,{page:S.value.page,pageSize:S.value.pageSize},w.value.signal).then(e=>{ne(e),m.value=!1}).catch(e=>{if(e?.name!==`CanceledError`)throw m.value=!1,e}))},ie=()=>{s.filters&&!m.value&&(T.value?.abort(),T.value=new AbortController,t.HttpRequester.getInstance(t.OrdersDataProvider).getOrders(s.filters,f.value,{page:S.value.page,pageSize:S.value.pageSize},T.value.signal).then(e=>{p.value=p.value.map(t=>e.data.find(e=>e.id===t.id)??t),S.value.itemCount!==e.meta.total&&(S.value.itemCount=e.meta.total),S.value.pageCount!==e.meta.lastPage&&(S.value.pageCount=e.meta.lastPage)}).catch(e=>{if(e?.name!==`CanceledError`)throw e}))},se=e=>e.meta.total===S.value.itemCount&&(0,n.isEqual)((0,n.map)(e.data,`id`),(0,n.map)(p.value,`id`)),ce=async()=>{if(!s.filters||m.value)return!1;T.value?.abort(),T.value=null,D.value?.abort(),D.value=new AbortController;let e;try{e=await t.HttpRequester.getInstance(t.OrdersDataProvider).getOrders(s.filters,f.value,{page:S.value.page,pageSize:S.value.pageSize},D.value.signal)}catch(e){if(e?.name===`CanceledError`)return!1;throw e}return se(e)?(p.value=p.value.map(t=>e.data.find(e=>e.id===t.id)??t),O.value=null,!1):(O.value=e,!0)},le=()=>O.value?(ne(O.value),O.value=null,!0):!1,ue=()=>{O.value=null},de=e=>{S.value.page=e,j(),c(`update:pagination`,S.value)},fe=e=>{S.value.pageSize=e,S.value.page=1,j(),c(`update:pagination`,S.value)},pe=e=>{if((0,n.isNull)(e))f.value=d();else{let[t]=f.value;t.field=e.columnKey.toString(),t.direction=e.order===`ascend`?`asc`:`desc`,f.value=[t]}x.value.forEach(t=>{if(Object.hasOwn(t,`sortOrder`)){let n=t;n.sortOrder=n.key===e?.columnKey&&e?.sorter&&e.order!==!1?e.order:!1}}),j(),c(`update:sort`,f.value)},me=()=>{x.value=b(),h.value=window.innerHeight,_.value=g()};return(0,r.watch)(()=>s.filters,()=>{S.value.page=1,j(),ee()}),(0,r.watch)(()=>s.sort,()=>{f.value=d(),S.value.page=1,j(),ee()}),(0,r.onMounted)(()=>{me(),window.addEventListener(`resize`,me),(0,r.nextTick)(()=>{j(),ee()})}),(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,me),w.value?.abort(),T.value?.abort(),D.value?.abort(),A()}),i({reload:j,checkForUpdates:ce,applyPendingUpdate:le,discardPendingUpdate:ue}),(t,n)=>{let i=o.NDataTable;return(0,r.openBlock)(),(0,r.createBlock)(i,{columns:x.value,data:p.value,"row-key":e=>e.id,"row-props":y,"scroll-x":e.tableMinWidth,pagination:C.value,loading:m.value,remote:!0,bordered:!1,"bottom-bordered":!1,"sticky-expanded-rows":!0,"max-height":_.value,"pagination-behavior-on-filter":`first`,"onUpdate:page":de,"onUpdate:pageSize":fe,"onUpdate:sorter":pe},null,8,[`columns`,`data`,`row-key`,`scroll-x`,`pagination`,`loading`,`max-height`])}}}),[[`__scopeId`,`data-v-74073cd1`]]),Gw=(0,r.computed)(()=>(0,t.useReferencesStore)().deliveryTypeReference??[]),Kw=(0,r.computed)(()=>(0,t.useReferencesStore)().managersList??[]),qw=(0,r.computed)(()=>(0,t.useReferencesStore)().opfReference??[]),Jw=(0,r.computed)(()=>(0,t.useReferencesStore)().partnerGroupsReference??[]),Yw=(0,r.computed)(()=>(0,t.useReferencesStore)().priceCoefficientsReference??[]),Xw=(0,r.computed)(()=>(0,t.useReferencesStore)().productFilesTypesReference??[]),Zw=(0,r.computed)(()=>(0,t.useReferencesStore)().resourceTypesReference),Qw=(0,r.computed)(()=>(0,t.useReferencesStore)().salesDirectionsReference??[]),$w=(0,r.computed)(()=>(0,t.useReferencesStore)().warehousesReference??[]),eT=(0,r.computed)(()=>(0,t.useReferencesStore)().paymentTypeReference??[]),tT=(0,r.computed)(()=>(0,t.useReferencesStore)().orderStatusReference??[]),nT=(0,r.computed)(()=>(0,t.useReferencesStore)().orderStatusDetailReference??[]),rT=(0,r.computed)(()=>(0,t.useReferencesStore)().operatorReference??[]),iT=(0,r.computed)(()=>we.convertReferencesToSelectOptionsList((0,t.useReferencesStore)().channelPrimaryInterestsReference??[],!0,!1,!0)),aT=(0,r.computed)(()=>we.convertReferencesToSelectOptionsList((0,t.useReferencesStore)().sourcePrimaryInterestsReference??[],!0,!1,!0)),oT=e=>t.HttpRequester.getInstance(t.ReferenceDataProvider).searchCity(e),sT=e=>we.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e?.isNewRec()?`-`:`${e.name}, ${e?.region?.name}, ${e?.region?.country?.name}`,e=>e?.isNewRec()),cT=async e=>(0,n.map)(await t.HttpRequester.getInstance(t.ReferenceDataProvider).searchRegion(e),e=>new t.Region(e)),lT=e=>we.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e.isNewRec()?`-`:(0,n.join)((0,n.compact)([e.name,e.country.name]),`, `),e=>e.isNewRec()),uT=e=>t.HttpRequester.getInstance(t.ClientDataProvider).searchClient(e),dT=e=>we.convertReferencesToSelectOptionsList(e,!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?.isNewRec()),fT={class:`flex flex-col gap-4`},pT={class:`flex flex-wrap gap-2`},mT={class:`flex flex-col gap-1.5`},hT={class:`inline-flex items-center gap-2`},gT={class:`flex flex-col gap-1.5`},_T={class:`inline-flex items-center gap-2`},vT=(0,r.defineComponent)({__name:`order-highlight-settings`,props:{settings:{},statuses:{default:void 0}},emits:[`update:settings`],setup(e,{emit:t}){let n=e,i=t,a=(0,r.computed)(()=>n.statuses??tT.value),s=e=>!!e&&n.settings.statuses.includes(e),c=(e,t)=>{if(!e)return;let r=n.settings.statuses.filter(t=>t!==e);i(`update:settings`,{...n.settings,statuses:t?[...r,e]:r})},l=(e,t)=>{let r=n.settings.markers.filter(t=>t!==e);i(`update:settings`,{...n.settings,markers:t?[...r,e]:r})},u=e=>{i(`update:settings`,{statuses:e?a.value.flatMap(e=>e.slug?[e.slug]:[]):[],markers:e?[...M]:[]})};return(t,n)=>{let i=o.NButton,d=o.NCheckbox;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,fT,[(0,r.createElementVNode)(`div`,pT,[(0,r.createVNode)(i,{size:`small`,onClick:n[0]||=e=>u(!0)},{default:(0,r.withCtx)(()=>[...n[2]||=[(0,r.createTextVNode)(` Выделять всё `,-1)]]),_:1}),(0,r.createVNode)(i,{size:`small`,onClick:n[1]||=e=>u(!1)},{default:(0,r.withCtx)(()=>[...n[3]||=[(0,r.createTextVNode)(` Снять всё `,-1)]]),_:1})]),(0,r.createElementVNode)(`div`,mT,[n[4]||=(0,r.createElementVNode)(`div`,{class:`text-sm font-semibold`},`Статусы`,-1),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(a.value,e=>((0,r.openBlock)(),(0,r.createBlock)(d,{key:e.id,checked:s(e.slug),"onUpdate:checked":t=>c(e.slug,t)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,hT,[(0,r.createVNode)(uw,{colors:(0,r.unref)(A)(e.slug)},null,8,[`colors`]),(0,r.createTextVNode)(` `+(0,r.toDisplayString)(e.name),1)])]),_:2},1032,[`checked`,`onUpdate:checked`]))),128))]),(0,r.createElementVNode)(`div`,gT,[n[5]||=(0,r.createElementVNode)(`div`,{class:`text-sm font-semibold`},`Маркеры`,-1),((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)((0,r.unref)(M),t=>((0,r.openBlock)(),(0,r.createBlock)(d,{key:t,checked:e.settings.markers.includes(t),"onUpdate:checked":e=>l(t,e)},{default:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`span`,_T,[(0,r.createVNode)(uw,{colors:(0,r.unref)(re)(t)},null,8,[`colors`]),(0,r.createTextVNode)(` `+(0,r.toDisplayString)((0,r.unref)(ie)(t)),1)])]),_:2},1032,[`checked`,`onUpdate:checked`]))),128))])])}}}),yT=[`href`],bT={class:`text-sc-dark-grey`},xT=(0,r.defineComponent)({__name:`short-text-order-info`,props:{order:{},orderLink:{}},emits:[`click:order-id`],setup(e,{emit:a}){let o=e,s=a,c=(0,r.computed)(()=>(0,i.format)(o.order.createdAt,(0,t.useBaseConfigStore)().config.dateFormats.uiDateWithTime)),l=e=>{(0,n.isNil)(o.orderLink)&&(e.preventDefault(),e.stopPropagation()),s(`click:order-id`,o.order,e)};return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)(`span`,null,[n[1]||=(0,r.createTextVNode)(` #`,-1),(0,r.createElementVNode)(`a`,{href:e.orderLink??`#`,onClick:n[0]||=e=>l(e)},(0,r.toDisplayString)(e.order.id),9,yT),(0,r.createTextVNode)(` от `+(0,r.toDisplayString)(c.value),1)]),n[2]||=(0,r.createTextVNode)(`, `,-1),(0,r.createElementVNode)(`span`,bT,`автор: `+(0,r.toDisplayString)(e.order.creator.name)+` [`+(0,r.toDisplayString)(e.order.creator.type)+`]`,1)],64))}}),ST={class:`sc-page flex flex-col bg-inherit`},CT={class:`my-2 flex flex-row items-end`},wT={class:`sc-title grow`},TT={key:0,class:`sc-title-buttons flex-1 grow-0`},ET={class:`flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row`},DT={key:0,class:`sc-title-extra mt-2 sm:mt-4`},OT=(0,r.defineComponent)({__name:`page`,props:{title:{default:void 0},stickyHeader:{type:Boolean},stickyTopOffset:{default:0},stickyHeaderOnMobile:{type:Boolean,default:!0}},setup(e){let t=e,n=(0,r.computed)(()=>t.stickyHeaderOnMobile?`sticky z-10 bg-inherit`:`lg:sticky z-10 bg-inherit`);return(t,i)=>{let a=o.NH1;return(0,r.openBlock)(),(0,r.createElementBlock)(`div`,ST,[(0,r.createElementVNode)(`div`,{class:(0,r.normalizeClass)(e.stickyHeader?n.value:void 0),style:(0,r.normalizeStyle)(e.stickyHeader?{top:`${e.stickyTopOffset??0}px`}:void 0)},[(0,r.createElementVNode)(`div`,CT,[(0,r.createElementVNode)(`div`,wT,[(0,r.renderSlot)(t.$slots,`title`,{},()=>[(0,r.createVNode)(a,{class:`m-0 leading-none lg:mb-3 lg:leading-normal`},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.title??``),1)]),_:1})])]),t.$slots[`title-buttons`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,TT,[(0,r.createElementVNode)(`div`,ET,[(0,r.renderSlot)(t.$slots,`title-buttons`)])])):(0,r.createCommentVNode)(``,!0)]),t.$slots[`title-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,DT,[(0,r.renderSlot)(t.$slots,`title-extra`)])):(0,r.createCommentVNode)(``,!0),(0,r.renderSlot)(t.$slots,`sticky-extra`)],6),(0,r.renderSlot)(t.$slots,`default`)])}}}),kT={class:`overflow-hidden transition-all duration-300`},AT={class:`text-lg font-medium leading-none`},jT=(0,r.defineComponent)({__name:`sliding-content-with-drawer`,props:{drawerWidth:{type:[Number,Function],default:void 0},showDrawer:{type:Boolean,default:!1},title:{default:``}},emits:[`update:show-drawer`],setup(e,{emit:t}){let i=e,a=t,s=(0,r.ref)(0),c=(0,r.ref)(i.showDrawer),l=()=>{switch(oe.getDeviceTypeByResolution()){case P.phone:return window.innerWidth*.8;case P.tablet:return window.innerWidth*.5;default:return window.innerWidth*.33}},u=()=>{c.value?(0,n.isUndefined)(i.drawerWidth)?s.value=l():s.value=(0,n.isFunction)(i.drawerWidth)?i.drawerWidth():i.drawerWidth:s.value=0};return(0,r.watch)(()=>i.drawerWidth,()=>{u()}),(0,r.watch)(()=>c.value,()=>{u(),a(`update:show-drawer`,c.value)}),(0,r.watch)(()=>i.showDrawer,e=>{c.value=e}),(0,r.onUnmounted)(()=>{window.removeEventListener(`resize`,u)}),u(),window.addEventListener(`resize`,u),(t,n)=>{let i=o.NDrawerContent,a=o.NDrawer;return(0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,null,[(0,r.createElementVNode)(`div`,kT,[(0,r.createElementVNode)(`div`,{style:(0,r.normalizeStyle)(`margin-left: ${s.value}px;`),class:`w-full`},[(0,r.renderSlot)(t.$slots,`default`)],4)]),(0,r.createVNode)(a,{show:c.value,"onUpdate:show":n[0]||=e=>c.value=e,resizable:!0,width:s.value,placement:`left`},{default:(0,r.withCtx)(()=>[(0,r.createVNode)(i,{closable:``},{header:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`drawer-header`,{},()=>[(0,r.createElementVNode)(`div`,AT,(0,r.toDisplayString)(e.title),1)])]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`drawer-content`)]),footer:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`drawer-footer`)]),_:3})]),_:3},8,[`show`,`width`])],64)}}}),MT={ref:`panel-component-ref`,class:`sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8`},NT={key:0},PT={class:`sc-page-preview-panel grow`},FT={key:1,class:`sc-page-preview-panel-extra flex-none`},IT=(0,r.defineComponent)({__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(e,{expose:t}){let n=(0,r.ref)(!1),i=()=>{n.value=!0},a=()=>{n.value=!1},s=(0,r.useTemplateRef)(`panel-component-ref`);return t({scrollToTopOfPanel:e=>{s.value?.scrollIntoView({behavior:`smooth`}),e&&(0,r.nextTick)(()=>{window.scrollTo({top:(s.value?.getBoundingClientRect()?.top??0)+window.pageYOffset+e,behavior:`smooth`})})},showPanel:i,closePanel:a}),(t,i)=>{let a=o.NButton;return(0,r.openBlock)(),(0,r.createBlock)(OT,{title:e.title,"sticky-header":e.stickyHeader,"sticky-top-offset":e.stickyTopOffset,"sticky-header-on-mobile":e.stickyHeaderOnMobile},(0,r.createSlots)({default:(0,r.withCtx)(()=>[(0,r.createVNode)(jT,{"show-drawer":n.value,"onUpdate:showDrawer":i[1]||=e=>n.value=e,title:e.panelTitle},(0,r.createSlots)({"drawer-content":(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`panel-content`)]),default:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`default`)]),_:2},[t.$slots[`panel-header`]?{name:`drawer-header`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`panel-header`)]),key:`0`}:void 0,t.$slots[`panel-bottom`]?{name:`drawer-footer`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`panel-bottom`)]),key:`1`}:void 0]),1032,[`show-drawer`,`title`])]),_:2},[t.$slots.title?{name:`title`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`title`)]),key:`0`}:void 0,t.$slots[`title-buttons`]?{name:`title-buttons`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`title-buttons`)]),key:`1`}:void 0,t.$slots[`title-extra`]?{name:`title-extra`,fn:(0,r.withCtx)(()=>[(0,r.renderSlot)(t.$slots,`title-extra`)]),key:`2`}:void 0,t.$slots[`preview-panel`]||t.$slots[`preview-panel-extra`]||e.isShowPanelButtonVisible?{name:`sticky-extra`,fn:(0,r.withCtx)(()=>[(0,r.createElementVNode)(`div`,MT,[e.isShowPanelButtonVisible?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,NT,[(0,r.renderSlot)(t.$slots,`show-panel-button`,{onClickHandler:()=>{n.value=!0}},()=>[(0,r.createVNode)(a,{class:`flex-none sm:px-10 sm:py-4`,onClick:i[0]||=e=>n.value=!0},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)(e.showPanelButtonText),1)]),_:1})])])):(0,r.createCommentVNode)(``,!0),(0,r.createElementVNode)(`div`,PT,[(0,r.renderSlot)(t.$slots,`preview-panel`)]),t.$slots[`preview-panel-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,FT,[(0,r.renderSlot)(t.$slots,`preview-panel-extra`)])):(0,r.createCommentVNode)(``,!0)],512)]),key:`3`}:void 0]),1032,[`title`,`sticky-header`,`sticky-top-offset`,`sticky-header-on-mobile`])}}}),LT=(0,r.defineComponent)({__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(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.computed)(()=>(0,n.isArray)(s.value)),u=(0,r.computed)(()=>(0,n.isArray)(s.value)?s.value.map(e=>e.id):s.value?.id??null),d=(0,r.computed)(()=>{let e=new t.Curator({id:-1,name:``,contacts:{},curatedDirection:new t.CuratedDirection({id:-1,name:``,guid:``}),guid:``}),n=s.showEmptyValue?[e]:[];return s.managerReferenceList.filter(e=>(e?.curatedDirections?.length??0)>0).forEach(e=>{(e?.curatedDirections??[]).forEach(r=>{n.push(new t.Curator({id:e.id,guid:e.guid,name:e.name,photo:e.photo,contacts:e.contacts??{},curatedDirection:r}))})}),n}),f=(0,r.computed)(()=>we.convertReferencesToSelectOptionsList(d.value,!0,{key:`item.curatedDirection.id`,label:`item.curatedDirection.name`},!1,e=>{let t=(0,n.some)(l.value?s.value:[s.value],[`id`,e.id])?` (${e.curatedDirection.name}) `:``;return e.curatedDirection.isNewRec()?e.name:`${e.name}${t}`})),p=(0,r.computed)(()=>f.value.map(e=>({...e,class:s.wrapContent?`${e.class} consistent-menu-width`:e.class}))),m=(0,r.useTemplateRef)(`select-component`),h=e=>{if((0,n.isArray)(e)){let t=e.length>0?e.map(e=>d.value.find(t=>t.id===e)).filter(e=>!(0,n.isNil)(e)):[];c(`update:value`,t)}else{let t=e>0?d.value.find(t=>t.id===e):null;c(`update:value`,t??null)}};return(0,r.watch)(()=>s.value,()=>{m.value?.$forceUpdate?.()},{deep:!0}),i({focus:()=>m.value?.focusInput(),blur:()=>m.value?.blurInput()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSelect),{ref:`select-component`,value:u.value,clearable:e.clearable,disabled:f.value.length===0,"consistent-menu-width":e.consistentMenuWidth,multiple:l.value,options:p.value,placeholder:``,"onUpdate:value":h},null,8,[`value`,`clearable`,`disabled`,`consistent-menu-width`,`multiple`,`options`]))}}),RT=(0,r.defineComponent)({__name:`manager-operator-select`,props:{value:{default:null},clearable:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},consistentMenuWidth:{type:Boolean,default:!0},wrapContent:{type:Boolean,default:!1},managerReferenceList:{default:()=>[]},operatorReferenceList:{default:()=>[]},showActualOnly:{type:Boolean,default:!1},groupByEmployeeType:{type:Boolean,default:!1},filterable:{type:Boolean,default:!0},maxTagCount:{default:void 0}},emits:[`update:value`],setup(e,{expose:t,emit:i}){let a=e,s=i,c=(0,r.computed)(()=>(0,n.isArray)(a.value)),l=(0,r.computed)(()=>(0,n.isArray)(a.value)?a.value.filter(e=>!(0,n.isNil)(e)).map(e=>e.id):a.value?.id??null),u=(0,r.computed)(()=>[...a.operatorReferenceList,...a.managerReferenceList]),d=(0,r.computed)(()=>{let e=[];a.operatorReferenceList.length>0&&e.push({type:`group`,label:`Операторы`,key:`operators`,children:a.operatorReferenceList.map(e=>({label:e.name,value:e.id,item:e}))});let t=a.managerReferenceList;if(a.showActualOnly){let e=(0,n.isArray)(a.value)?a.value.map(e=>e.id):[a.value?.id];t=t.filter(t=>t.isActive||e.includes(t.id))}let i=we.convertReferencesToSelectOptionsList(t,!0,{key:`item.salesDirection.id`,label:`item.salesDirection.name`},!1,e=>`${e.name}${e.isActive?``:` [Не активен]`}`);return e.length>0&&i.length>0&&e.push({key:`manager-operator-divider`,disabled:!0,render:()=>(0,r.h)(`div`,{class:`sc-manager-operator-select__divider`})}),e.push(...i),e}),f=e=>`${e.name}${`isActive`in e&&!e.isActive?` [Не активен]`:``}`,p=(0,r.computed)(()=>{let e=(0,n.isArray)(a.value)?a.value.map(e=>e.id):[a.value?.id],t=t=>a.showActualOnly?t.filter(t=>!(`isActive`in t)||t.isActive||e.includes(t.id)):t,r=[],i=t(a.managerReferenceList);i.length>0&&r.push({type:`group`,label:`Менеджеры`,key:`managers`,children:we.convertReferencesToSelectOptionsList(i,!0,!1,!1,f)});let o=t(a.operatorReferenceList);return o.length>0&&r.push({type:`group`,label:`Операторы`,key:`operators`,children:we.convertReferencesToSelectOptionsList(o,!0,!1,!1,f)}),r}),m=(0,r.computed)(()=>a.groupByEmployeeType?p.value:d.value),h=(0,r.computed)(()=>m.value.map(e=>({...e,class:a.wrapContent?`${e.class??``} consistent-menu-width`:e.class}))),g=(0,r.useTemplateRef)(`select-component`),_=e=>{if((0,n.isArray)(e)){let t=e.map(e=>u.value.find(t=>t.id===e)).filter(e=>!(0,n.isNil)(e));s(`update:value`,t)}else{let t=(0,n.isNil)(e)?null:u.value.find(t=>t.id===e)??null;s(`update:value`,t)}};return(0,r.watch)(()=>a.value,()=>{g.value?.$forceUpdate?.()},{deep:!0}),t({focus:()=>g.value?.focusInput(),blur:()=>g.value?.blurInput()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSelect),{ref:`select-component`,value:l.value,"clear-filter-after-select":!0,clearable:e.clearable,"consistent-menu-width":e.consistentMenuWidth,disabled:e.disabled||m.value.length===0,filterable:e.filterable,"max-tag-count":e.maxTagCount,multiple:c.value,options:h.value,placeholder:``,class:`w-full`,"onUpdate:value":_},null,8,[`value`,`clearable`,`consistent-menu-width`,`disabled`,`filterable`,`max-tag-count`,`multiple`,`options`]))}}),zT=(0,r.defineComponent)({__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(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.computed)(()=>(0,n.isArray)(s.value)),u=(0,r.computed)(()=>(0,n.isArray)(s.value)?s.value.map(e=>e.id):s.value?.id??null),d=(0,r.computed)(()=>s.showEmptyValue?[t.ManagerDataFactory.generateUndefinedManagerInstance(),...s.managerReferenceList]:s.managerReferenceList),f=(0,r.computed)(()=>{let e=d.value,r=s.disabledManagerReferenceList.map(e=>e.id);if(s.showActualOnly){let i=(0,n.isArray)(s.value)?s.value.map(e=>e.id):[s.value?.id];r=(0,n.union)(r,d.value.filter(e=>!e.isActive).map(e=>e.id)),e=e.filter(e=>(s.showEmptyValue?t.ManagerDataFactory.isUndefinedManagerInstance(e):!1)||e.isActive||i.includes(e.id))}return we.convertReferencesToSelectOptionsList(e,!0,s.groupBySalesDirection?{key:`item.salesDirection.id`,label:`item.salesDirection.name`}:!1,!1,e=>{let t=!s.groupBySalesDirection||s.groupBySalesDirection&&(0,n.some)(l.value?s.value:[s.value],[`id`,e.id])?` (${e.salesDirection.name}) `:``;return e.salesDirection.isNewRec()?e.name:`${e.name}${t}${e.isActive?``:` [Не активен]`}`},e=>r.includes(e.id)&&e.isActive)}),p=(0,r.computed)(()=>f.value.map(e=>({...e,class:s.wrapContent?`${e.class} consistent-menu-width`:e.class}))),m=(0,r.useTemplateRef)(`select-component`),h=e=>{if((0,n.isArray)(e)){let t=e.length>0?e.filter(e=>!(0,n.some)(s.disabledManagerReferenceList,[`id`,e])).map(e=>d.value.find(t=>t.id===e)).filter(e=>!(0,n.isNil)(e)):[];c(`update:value`,t)}else{let r=e>0&&!(0,n.some)(s.disabledManagerReferenceList,[`id`,e])?d.value.find(t=>t.id===e):new t.Manager;c(`update:value`,r??new t.Manager)}};return(0,r.watch)(()=>s.value,()=>{m.value?.$forceUpdate?.()},{deep:!0}),(0,r.watch)(()=>s.disabledManagerReferenceList,e=>{if(e.length>0&&s.value){if(l.value){let t=s.value;(0,n.some)(t,t=>(0,n.some)(e,[`id`,t.id]))&&c(`update:value`,t.filter(t=>!(0,n.some)(e,[`id`,t.id])))}else{let r=s.value;(0,n.some)(e,[`id`,r.id])&&c(`update:value`,new t.Manager)}}}),i({focus:()=>m.value?.focusInput(),blur:()=>m.value?.blurInput()}),(t,n)=>((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(o.NSelect),{ref:`select-component`,value:u.value,clearable:e.clearable,disabled:f.value.length===0,"consistent-menu-width":e.consistentMenuWidth,multiple:l.value,options:p.value,placeholder:``,"onUpdate:value":h},null,8,[`value`,`clearable`,`disabled`,`consistent-menu-width`,`multiple`,`options`]))}}),BT={class:`m-0.5 flex flex-col p-0.5`},VT={"data-testid":`address-line`},HT={key:0},UT={key:1},WT={key:2},GT={key:3},KT={"data-testid":`address-line`},qT={key:0},JT={key:1},YT={key:2},XT={key:3},ZT={key:0,"data-testid":`address-quality-label`,class:`text-sc-warning text-xs`},QT=(0,r.defineComponent)({__name:`address-suggestion-label`,props:{addr:{},selected:{type:Boolean}},setup(e){let t=e,n=(0,r.computed)(()=>de.getLabel(t.addr.quality));return(t,i)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,BT,[(0,r.createElementVNode)(`span`,VT,[e.addr.postIndex?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,HT,(0,r.toDisplayString)(e.addr.postIndex)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.city?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,UT,(0,r.toDisplayString)(e.addr.city)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.locality?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,WT,(0,r.toDisplayString)(e.addr.locality)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.region?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,GT,(0,r.toDisplayString)(e.addr.region)+`, `,1)):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`span`,KT,[e.addr.street?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,qT,(0,r.toDisplayString)(e.addr.street)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.building?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,JT,(0,r.toDisplayString)(e.addr.building)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.buildingPart?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,YT,(0,r.toDisplayString)(e.addr.buildingPart)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.apartments?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,XT,(0,r.toDisplayString)(e.addr.apartments)+`, `,1)):(0,r.createCommentVNode)(``,!0)]),n.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,ZT,(0,r.toDisplayString)(n.value),1)):(0,r.createCommentVNode)(``,!0)]))}}),$T={clearable:!1,value:``,field:void 0,disabled:!1},eE=(0,r.defineComponent)({__name:`address-suggestion`,props:(0,r.mergeDefaults)({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},searchDataHandler:{type:Function}},{...$T,minTermLength:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3,searchDataHandler:void 0,wrapContent:!0}),emits:[`select`,`update:value`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.ref)(s.value),u=(0,r.ref)(!1),d=(0,r.ref)([]),f=(0,r.computed)(()=>d.value.map(e=>({label:e[s.field??`addressString`]??`-`,value:e.id})));(0,r.watch)(()=>s.value,e=>{l.value=e}),(0,r.watch)(l,()=>{c(`update:value`,l.value)});let p=(0,n.debounce)(()=>m(),800),m=async()=>{!l.value||l.value.length<s.minTermLength||(u.value=!0,d.value=await(s.searchDataHandler?s.searchDataHandler(l.value,u):t.HttpRequester.getInstance(t.DataSuggestionProvider).searchAddresses(l.value)).finally(()=>{u.value=!1}))},h=(e,t)=>{let i=d.value.find(t=>t.id===e.value)||{};return(0,r.h)(QT,{addr:i,selected:t},{default:(0,n.constant)(`-`)})},g=e=>{p.cancel();let t=d.value.find(t=>t.id===e)||{};c(`select`,t)},_=(0,r.ref)(null);function v(){_.value.focus()}return i({focus:v}),(t,n)=>{let i=o.NAutoComplete;return(0,r.openBlock)(),(0,r.createBlock)(i,{ref_key:`autoCompleteElement`,ref:_,value:l.value,"onUpdate:value":[n[0]||=e=>l.value=e,(0,r.unref)(p)],class:(0,r.normalizeClass)(s.wrapContent?`consistent-menu-width`:void 0),clearable:e.clearable,disabled:e.disabled,loading:u.value,options:f.value,"render-label":h,to:!s.wrapContent&&void 0,placeholder:``,onSelect:g},null,8,[`value`,`class`,`clearable`,`disabled`,`loading`,`options`,`to`,`onUpdate:value`])}}}),tE={class:`m-0.5 flex flex-col p-0.5`},nE={class:`font-medium`},rE={class:`flex flex-row gap-1 text-xs font-light text-blue-800`},iE={key:0},aE={key:1},oE=(0,r.defineComponent)({__name:`bank-suggestion-label`,props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,tE,[(0,r.createElementVNode)(`span`,nE,(0,r.toDisplayString)(e.bank.name),1),(0,r.createElementVNode)(`span`,rE,[e.bank.bic?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,iE,` БИК: `+(0,r.toDisplayString)(e.bank.bic),1)):(0,r.createCommentVNode)(``,!0),e.bank.inn?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,aE,` ИНН: `+(0,r.toDisplayString)(e.bank.inn),1)):(0,r.createCommentVNode)(``,!0)])]))}}),sE=(0,r.defineComponent)({__name:`bank-suggestion`,props:(0,r.mergeDefaults)({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean}},{...$T,minTermLength:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3,wrapContent:!0}),emits:[`select`,`update:value`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.ref)(s.value),u=(0,r.ref)(!1),d=(0,r.ref)([]),f=(0,r.computed)(()=>d.value.map(e=>({label:e[s.field??`_`]??`-`,value:e.id})));(0,r.watch)(()=>s.value,e=>{l.value=e}),(0,r.watch)(l,()=>{c(`update:value`,l.value)});let p=(0,n.debounce)(()=>m(),800),m=async()=>{if(!(!l.value||l.value.length<s.minTermLength)){u.value=!0;try{d.value=await t.HttpRequester.getInstance(t.DataSuggestionProvider).searchBank(l.value)}finally{u.value=!1}}},h=(e,t)=>{let i=d.value.find(t=>t.id===e.value)||{};return(0,r.h)(oE,{bank:i,selected:t},{default:(0,n.constant)(`-`)})},g=e=>{p.cancel();let t=d.value.find(t=>t.id===e)||{};c(`select`,t)},_=(0,r.ref)(null);function v(){_.value.focus()}return i({focus:v}),(t,n)=>{let i=o.NAutoComplete;return(0,r.openBlock)(),(0,r.createBlock)(i,{ref_key:`autoCompleteElement`,ref:_,value:l.value,"onUpdate:value":[n[0]||=e=>l.value=e,(0,r.unref)(p)],class:(0,r.normalizeClass)(s.wrapContent?`consistent-menu-width`:void 0),clearable:e.clearable,disabled:e.disabled,loading:u.value,options:f.value,"render-label":h,to:!s.wrapContent&&void 0,placeholder:``,onSelect:g},null,8,[`value`,`class`,`clearable`,`disabled`,`loading`,`options`,`to`,`onUpdate:value`])}}}),cE={class:`font-medium`},lE={key:0,"data-testid":`org-details`,class:`text-xs font-light`},uE={key:0,"data-testid":`org-inn`,class:`mr-2 whitespace-nowrap text-blue-800`},dE={key:1,class:`text-sc-dark-grey`},fE=(0,r.defineComponent)({__name:`org-suggestion-label`,props:{org:{},selected:{type:Boolean}},setup(e){let t=e,n=(0,r.computed)(()=>t.org.rawData?.state?.liquidationDate??!1),i=(0,r.computed)(()=>t.org.rawData?.address?.value??``);return(t,a)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{class:(0,r.normalizeClass)(`m-0.5 flex flex-col p-0.5 ${n.value?`line-through`:``}`)},[(0,r.createElementVNode)(`span`,cE,(0,r.toDisplayString)(e.org.name),1),e.org.inn||i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,lE,[e.org.inn?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,uE,(0,r.toDisplayString)(e.org.inn),1)):(0,r.createCommentVNode)(``,!0),i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,dE,(0,r.toDisplayString)(i.value),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)],2))}}),pE=(0,r.defineComponent)({__name:`org-suggestion`,props:(0,r.mergeDefaults)({disabled:{type:Boolean},value:{},clearable:{type:Boolean},field:{},minTermLength:{},consistentMenuWidth:{type:Boolean},wrapContent:{type:Boolean},allowSelectTerminated:{type:Boolean}},{...$T,minTermLength:()=>(0,t.useBaseConfigStore)().getConfig()?.minLength?.searchTerm??3,wrapContent:!0}),emits:[`select`,`update:value`],setup(e,{expose:i,emit:a}){let s=e,c=a,l=(0,r.ref)(s.value),u=(0,r.ref)(!1),d=(0,r.ref)([]),f=e=>!!(e.rawData?.state?.liquidationDate??!1),p=(0,r.computed)(()=>we.convertReferencesToSelectOptionsList(d.value,!1,!1,!1,e=>e[s.field??`_`]??`-`,e=>!s.allowSelectTerminated&&f(e)));(0,r.watch)(()=>s.value,e=>{l.value=e}),(0,r.watch)(l,()=>{c(`update:value`,l.value)});let m=(0,n.debounce)(()=>h(),800),h=async()=>{if(!(!l.value||l.value.length<s.minTermLength)){u.value=!0;try{d.value=await t.HttpRequester.getInstance(t.DataSuggestionProvider).searchOrganization(l.value)}finally{u.value=!1}}},g=(e,t)=>{let i=d.value.find(t=>t.id===e.value)||{};return(0,r.h)(fE,{org:i,selected:t},{default:(0,n.constant)(`-`)})},_=e=>{m.cancel();let t=d.value.find(t=>t.id===e)||{};(s.allowSelectTerminated||!f(t))&&c(`select`,t)},v=(0,r.ref)(null);function y(){v.value.focus()}return i({focus:y}),(t,n)=>{let i=o.NAutoComplete;return(0,r.openBlock)(),(0,r.createBlock)(i,{ref_key:`autoCompleteElement`,ref:v,value:l.value,"onUpdate:value":[n[0]||=e=>l.value=e,(0,r.unref)(m)],class:(0,r.normalizeClass)(s.wrapContent?`consistent-menu-width`:void 0),clearable:e.clearable,disabled:e.disabled,loading:u.value,options:p.value,"render-label":g,to:!s.wrapContent&&void 0,placeholder:``,onSelect:_},null,8,[`value`,`class`,`clearable`,`disabled`,`loading`,`options`,`to`,`onUpdate:value`])}}});e.ALL_ORDER_MARKERS=M,e.AddressQualityLabelHelper=de,e.CATEGORY_REQUIRED_HINT=f,e.CommonValidators=Te,e.ConfiguratorSettingsKozyrek=Mc,e.ConfiguratorSettingsMosquito=tf,e.ContentHelper=me,e.CurrencyHelper=he,e.DEFAULT_ORDER_STATUS_COLORS=O,e.DateValidators=Ee,e.EntityNameHelper=_e,e.FileHelper=ge,e.KozyrekLine=_c,e.KozyrekTailTemplate=jc,e.KozyrekTemplate=Ac,e.M2PriceHelper=Ae,e.MODE_DISABLED_HINT=u,e.NumberHelper=F,e.NumericValidators=I,e.ORDER_MARKER_COLORS=ne,e.ORDER_MARKER_NAMES=j,e.ORDER_STATUS_COLORS=k,e.OrderMarkerEnum=E,e.OrdersTableFields=N,e.PRODUCT_REQUIRED_HINT=d,e.Point=gc,e.ScAddProductToCartDialog=qu,e.ScAddressSuggestion=eE,e.ScAddressSuggestionLabel=QT,e.ScBankSuggestion=sE,e.ScBankSuggestionLabel=oE,e.ScBaseDialog=Dn,e.ScButtonWithConfirmAction=je,e.ScCategoryCollapse=Hu,e.ScChipGroup=Ne,e.ScClientNameWithShortInfo=td,e.ScCollapse=Vu,e.ScCollapseItem=xt,e.ScCommentEditor=hm,e.ScCompactCardList=Rm,e.ScConfiguratorsProductInfo=mr,e.ScContragentWithShortInfo=rd,e.ScCreatorUserTypeTag=ZC,e.ScCuratorSelect=LT,e.ScDateRange=Kp,e.ScDateTimeLabel=Jp,e.ScDebouncedInput=wm,e.ScDebouncedInputNumber=Tm,e.ScDebt=Yp,e.ScDialogHeader=em,e.ScDynamicConfigurator=Cu,e.ScEmail=cd,e.ScExternalLink=Fm,e.ScImageGallery=mn,e.ScInlineEditableItem=fm,e.ScInlineView=dm,e.ScKozyrekConfigurator=Fc,e.ScKozyrekConfiguratorParamsForm=Tr,e.ScKozyrekConfiguratorPreview=kc,e.ScKozyrekConfiguratorTemplates=Tc,e.ScKpiGrid=km,e.ScLightGallery=dn,e.ScManagerOperatorSelect=RT,e.ScManagerSelect=zT,e.ScMetalForDoorsConfigurator=vl,e.ScMetalForDoorsConfiguratorForm=gl,e.ScMosquitoConfigurator=tl,e.ScMosquitoConfiguratorForm=Gc,e.ScMosquitoConfiguratorMeasurementInstructions=$c,e.ScMosquitoConfiguratorPreview=Rc,e.ScOrderColorSwatch=uw,e.ScOrderCommonInfo=JC,e.ScOrderDeliveryLabel=UC,e.ScOrderDetails=kw,e.ScOrderExternalLinks=Pw,e.ScOrderHighlightSettings=vT,e.ScOrderInfo=Hw,e.ScOrderItemParams=DC,e.ScOrderItemsList=bw,e.ScOrderPayment=YC,e.ScOrderProductInfo=iw,e.ScOrderStatusHistory=Cw,e.ScOrderStatusTag=lw,e.ScOrdersList=Ww,e.ScOrgSuggestion=pE,e.ScOrgSuggestionLabel=fE,e.ScPage=OT,e.ScPageWithSlidingPanel=IT,e.ScPersonContactsBlock=ef,e.ScPhone=Fd,e.ScPhoneInput=Em,e.ScProductInfoContent=wn,e.ScProductInfoDialog=An,e.ScProductInfoPopover=Nn,e.ScProductName=tr,e.ScProductsList=eC,e.ScReferenceSelect=Uu,e.ScSandwichConfigurator=Bl,e.ScSandwichConfiguratorForm=Ll,e.ScSandwichM2Configurator=_u,e.ScSandwichM2ConfiguratorForm=mu,e.ScSearchableProductSelect=JS,e.ScSearchableReferenceSelect=qS,e.ScSetClientPriceFormItem=Wu,e.ScShortTextOrderInfo=xT,e.ScSingleFileUploadSelector=ym,e.ScSlidingContentWithDrawer=jT,e.ScStatusTag=sw,e.ScStripConfigurator=ml,e.ScStripConfiguratorForm=sl,e.ScStripConfiguratorLineItem=nl,e.ScStripConfiguratorPreview=dl,e.ScUserShortInfo=Tw,e.ScWarningIcon=Cm,e.SelectOptionHelper=we,e.UiNotificationProvider=p,e.Validators=De,e.WindowResolutionEnum=P,e.WindowResolutionProvider=oe,e.channelPrimaryInterestOptionsList=iT,e.componentSizeInjectionKey=Tt,e.copyToClipboard=g,e.deliveryTypeReferenceList=Gw,e.getOrderMarkerColors=re,e.getOrderMarkerName=ie,e.getOrderMarkers=ae,e.getOrderStatusColors=A,e.getOrderStatusCssVariables=te,e.getOrderStatusTagColor=ee,e.getProductInfoFiles=Oe,e.getStatusTagColor=D,e.handleFloatInput=ye,e.handleIntegerInput=ve,e.hasProductInfo=ke,e.isCanSandwichM2Show=nf,e.isCanSandwichShow=Tu,e.isConfiguratorType=wu,e.managersReferenceList=Kw,e.naiveUiTheme=Et,e.operatorReferenceList=rT,e.opfReferenceList=qw,e.orderStatusDetailReferenceList=nT,e.orderStatusReferenceList=tT,e.paginationItemsPrefix=Ce,e.parse=be,e.partnerGroupReferenceList=Jw,e.paymentTypeReferenceList=eT,e.priceCoefficientsReferenceList=Yw,e.productFilesTypesReferenceList=Xw,e.renderConfig=vc,e.resetInputValidation=xe,e.resourceReferencesList=Zw,e.salesDirectionsReferenceList=Qw,e.searchCityReferenceDataHandler=oT,e.searchCityReferenceLabelRenderer=sT,e.searchClientReferenceDataHandler=uT,e.searchClientReferenceLabelRenderer=dT,e.searchRegionReferenceDataHandler=cT,e.searchRegionReferenceLabelRenderer=lT,e.selectAllTextOnFocus=Se,e.showAppVersion=pe,e.sourcePrimaryInterestOptionsList=aT,e.useCompactLayout=ce,e.useHoverSupport=ue,e.vCopy=y,e.vFocusNext=T,e.warehousesReferenceList=$w});