@snabcentr/vue-ui-lib 6.0.3 → 6.0.5
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
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+`">
|
|
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(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=(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`,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: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`])}}}),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:`
|
|
5
5
|
precision mediump float;
|
|
6
6
|
attribute vec2 a_position;
|
|
7
7
|
|
|
@@ -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:`flex items-baseline gap-3`},vw={key:0,class:`text-sm text-sc-dark-grey`},yw=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,n=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:n.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)(n.name),1),n.description?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,gw,(0,r.toDisplayString)(n.description),1)):(0,r.createCommentVNode)(``,!0)]),n.summary||t.$slots[`group-actions`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,_w,[n.summary?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,vw,(0,r.toDisplayString)(n.summary),1)):(0,r.createCommentVNode)(``,!0),(0,r.renderSlot)(t.$slots,`group-actions`,{group:n},void 0,!0)])):(0,r.createCommentVNode)(``,!0)]),(0,r.createVNode)(i,{columns:b.value,data:a(n.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-9168f88d`]]),bw={key:0,class:`text-sc-dark-grey my-2 text-center`},xw={key:1,class:`text-sc-dark-grey my-2`},Sw=(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`,bw,[(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`,xw,` История статусов отсутствует. `)):((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}))])}}}),Cw={class:`text-base`},ww=(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`,Cw,(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))}}),Tw={class:`ml-4 grid grid-cols-3 gap-1.5 text-base`},Ew={class:`col-span-2`},Dw={class:`col-span-2`},Ow=(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`,Tw,[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)(ww,{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`,Ew,(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`,Dw,(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)(ww,{user:e.order.attachedUser,class:`col-span-2`},null,8,[`user`])],64)):(0,r.createCommentVNode)(``,!0)])]))}}),kw={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Aw(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,kw,[...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 jw=(0,r.markRaw)({name:`ion-copy-outline`,render:Aw}),Mw={class:`flex flex-col items-stretch gap-1.5 text-base`},Nw=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=jw;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`,Mw,[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`]]),Pw={key:0},Fw={class:`text-sc-dark-grey my-2 text-center`},Iw={key:1,class:`text-sc-dark-grey my-2 text-center`},Lw={key:2},Rw={class:`text-sc-dark-grey mt-4 text-right font-bold`},zw={class:`text-sc-primary`},Bw={class:`mb-4 max-w-xs empty:hidden`},Vw=(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`,Pw,[(0,r.createElementVNode)(`div`,Fw,[(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`,Iw,` --- Не удалось загрузить данные о заказе --- `)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Lw,[(0,r.createVNode)(yw,{products:d.value,"event-emitter":e.eventEmitter,"allow-edit":e.allowEdit},null,8,[`products`,`event-emitter`,`allow-edit`]),(0,r.createElementVNode)(`div`,Rw,[n[2]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,zw,(0,r.toDisplayString)(f.value)+` ₽`,1)]),(0,r.createVNode)(Ow,{order:l.value,"onClick:clientName":n[0]||=e=>s(`click:client-name`,l.value.client,e)},null,8,[`order`]),(0,r.createElementVNode)(`div`,Bw,[(0,r.createVNode)(Nw,{order:l.value,"show-erp-link":``},null,8,[`order`])]),(0,r.createVNode)(Sw,{order:l.value},null,8,[`order`])]))}}}),Hw=(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)}}}),Uw=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)(Vw,{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:75,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:120,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:80,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)(Hw,{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:e.width+16}}: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-ee3efccb`]]),Ww=(0,r.computed)(()=>(0,t.useReferencesStore)().deliveryTypeReference??[]),Gw=(0,r.computed)(()=>(0,t.useReferencesStore)().managersList??[]),Kw=(0,r.computed)(()=>(0,t.useReferencesStore)().opfReference??[]),qw=(0,r.computed)(()=>(0,t.useReferencesStore)().partnerGroupsReference??[]),Jw=(0,r.computed)(()=>(0,t.useReferencesStore)().priceCoefficientsReference??[]),Yw=(0,r.computed)(()=>(0,t.useReferencesStore)().productFilesTypesReference??[]),Xw=(0,r.computed)(()=>(0,t.useReferencesStore)().resourceTypesReference),Zw=(0,r.computed)(()=>(0,t.useReferencesStore)().salesDirectionsReference??[]),Qw=(0,r.computed)(()=>(0,t.useReferencesStore)().warehousesReference??[]),$w=(0,r.computed)(()=>(0,t.useReferencesStore)().paymentTypeReference??[]),eT=(0,r.computed)(()=>(0,t.useReferencesStore)().orderStatusReference??[]),tT=(0,r.computed)(()=>(0,t.useReferencesStore)().orderStatusDetailReference??[]),nT=(0,r.computed)(()=>(0,t.useReferencesStore)().operatorReference??[]),rT=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList((0,t.useReferencesStore)().channelPrimaryInterestsReference??[],!0,!1,!0)),iT=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList((0,t.useReferencesStore)().sourcePrimaryInterestsReference??[],!0,!1,!0)),aT=e=>t.HttpRequester.getInstance(t.ReferenceDataProvider).searchCity(e),oT=e=>Ce.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e?.isNewRec()?`-`:`${e.name}, ${e?.region?.name}, ${e?.region?.country?.name}`,e=>e?.isNewRec()),sT=async e=>(0,n.map)(await t.HttpRequester.getInstance(t.ReferenceDataProvider).searchRegion(e),e=>new t.Region(e)),cT=e=>Ce.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e.isNewRec()?`-`:(0,n.join)((0,n.compact)([e.name,e.country.name]),`, `),e=>e.isNewRec()),lT=e=>t.HttpRequester.getInstance(t.ClientDataProvider).searchClient(e),uT=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()),dT={class:`flex flex-col gap-4`},fT={class:`flex flex-wrap gap-2`},pT={class:`flex flex-col gap-1.5`},mT={class:`inline-flex items-center gap-2`},hT={class:`flex flex-col gap-1.5`},gT={class:`inline-flex items-center gap-2`},_T=(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??eT.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`,dT,[(0,r.createElementVNode)(`div`,fT,[(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`,pT,[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`,mT,[(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`,hT,[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`,gT,[(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))])])}}}),vT=[`href`],yT={class:`text-sc-dark-grey`},bT=(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,vT),(0,r.createTextVNode)(` от `+(0,r.toDisplayString)(c.value),1)]),n[2]||=(0,r.createTextVNode)(`, `,-1),(0,r.createElementVNode)(`span`,yT,`автор: `+(0,r.toDisplayString)(e.order.creator.name)+` [`+(0,r.toDisplayString)(e.order.creator.type)+`]`,1)],64))}}),xT={class:`sc-page flex flex-col bg-inherit`},ST={class:`my-2 flex flex-row items-end`},CT={class:`sc-title grow`},wT={key:0,class:`sc-title-buttons flex-1 grow-0`},TT={class:`flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row`},ET={key:0,class:`sc-title-extra mt-2 sm:mt-4`},DT=(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`,xT,[(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`,ST,[(0,r.createElementVNode)(`div`,CT,[(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`,wT,[(0,r.createElementVNode)(`div`,TT,[(0,r.renderSlot)(t.$slots,`title-buttons`)])])):(0,r.createCommentVNode)(``,!0)]),t.$slots[`title-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ET,[(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`)])}}}),OT={class:`overflow-hidden transition-all duration-300`},kT={class:`text-lg font-medium leading-none`},AT=(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`,OT,[(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`,kT,(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)}}}),jT={ref:`panel-component-ref`,class:`sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8`},MT={key:0},NT={class:`sc-page-preview-panel grow`},PT={key:1,class:`sc-page-preview-panel-extra flex-none`},FT=(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)(DT,{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)(AT,{"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`,jT,[e.isShowPanelButtonVisible?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,MT,[(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`,NT,[(0,r.renderSlot)(t.$slots,`preview-panel`)]),t.$slots[`preview-panel-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,PT,[(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`])}}}),IT=(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`]))}}),LT=(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`]))}}),RT=(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`]))}}),zT={class:`m-0.5 flex flex-col p-0.5`},BT={"data-testid":`address-line`},VT={key:0},HT={key:1},UT={key:2},WT={key:3},GT={"data-testid":`address-line`},KT={key:0},qT={key:1},JT={key:2},YT={key:3},XT={key:0,"data-testid":`address-quality-label`,class:`text-sc-warning text-xs`},ZT=(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`,zT,[(0,r.createElementVNode)(`span`,BT,[e.addr.postIndex?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,VT,(0,r.toDisplayString)(e.addr.postIndex)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.city?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,HT,(0,r.toDisplayString)(e.addr.city)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.locality?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,UT,(0,r.toDisplayString)(e.addr.locality)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.region?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,WT,(0,r.toDisplayString)(e.addr.region)+`, `,1)):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`span`,GT,[e.addr.street?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,KT,(0,r.toDisplayString)(e.addr.street)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.building?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,qT,(0,r.toDisplayString)(e.addr.building)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.buildingPart?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,JT,(0,r.toDisplayString)(e.addr.buildingPart)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.apartments?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,YT,(0,r.toDisplayString)(e.addr.apartments)+`, `,1)):(0,r.createCommentVNode)(``,!0)]),n.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,XT,(0,r.toDisplayString)(n.value),1)):(0,r.createCommentVNode)(``,!0)]))}}),QT={clearable:!1,value:``,field:void 0,disabled:!1},$T=(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}},{...QT,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)(ZT,{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`])}}}),eE={class:`m-0.5 flex flex-col p-0.5`},tE={class:`font-medium`},nE={class:`flex flex-row gap-1 text-xs font-light text-blue-800`},rE={key:0},iE={key:1},aE=(0,r.defineComponent)({__name:`bank-suggestion-label`,props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,eE,[(0,r.createElementVNode)(`span`,tE,(0,r.toDisplayString)(e.bank.name),1),(0,r.createElementVNode)(`span`,nE,[e.bank.bic?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,rE,` БИК: `+(0,r.toDisplayString)(e.bank.bic),1)):(0,r.createCommentVNode)(``,!0),e.bank.inn?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,iE,` ИНН: `+(0,r.toDisplayString)(e.bank.inn),1)):(0,r.createCommentVNode)(``,!0)])]))}}),oE=(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}},{...QT,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)(aE,{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`])}}}),sE={class:`font-medium`},cE={key:0,"data-testid":`org-details`,class:`text-xs font-light`},lE={key:0,"data-testid":`org-inn`,class:`mr-2 whitespace-nowrap text-blue-800`},uE={key:1,class:`text-sc-dark-grey`},dE=(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`,sE,(0,r.toDisplayString)(e.org.name),1),e.org.inn||i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,cE,[e.org.inn?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,lE,(0,r.toDisplayString)(e.org.inn),1)):(0,r.createCommentVNode)(``,!0),i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,uE,(0,r.toDisplayString)(i.value),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)],2))}}),fE=(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}},{...QT,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)(dE,{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=$T,e.ScAddressSuggestionLabel=ZT,e.ScBankSuggestion=oE,e.ScBankSuggestionLabel=aE,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=IT,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=LT,e.ScManagerSelect=RT,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=Ow,e.ScOrderExternalLinks=Nw,e.ScOrderHighlightSettings=_T,e.ScOrderInfo=Vw,e.ScOrderItemParams=EC,e.ScOrderItemsList=yw,e.ScOrderPayment=JC,e.ScOrderProductInfo=rw,e.ScOrderStatusHistory=Sw,e.ScOrderStatusTag=sw,e.ScOrdersList=Uw,e.ScOrgSuggestion=fE,e.ScOrgSuggestionLabel=dE,e.ScPage=DT,e.ScPageWithSlidingPanel=FT,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=bT,e.ScSingleFileUploadSelector=vm,e.ScSlidingContentWithDrawer=AT,e.ScStripConfigurator=pl,e.ScStripConfiguratorForm=ol,e.ScStripConfiguratorLineItem=tl,e.ScStripConfiguratorPreview=ul,e.ScUserShortInfo=ww,e.ScWarningIcon=Sm,e.SelectOptionHelper=Ce,e.UiNotificationProvider=p,e.Validators=Ee,e.WindowResolutionEnum=P,e.WindowResolutionProvider=F,e.channelPrimaryInterestOptionsList=rT,e.componentSizeInjectionKey=wt,e.copyToClipboard=g,e.deliveryTypeReferenceList=Ww,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=Gw,e.naiveUiTheme=Tt,e.operatorReferenceList=nT,e.opfReferenceList=Kw,e.orderStatusDetailReferenceList=tT,e.orderStatusReferenceList=eT,e.paginationItemsPrefix=Se,e.parse=ve,e.partnerGroupReferenceList=qw,e.paymentTypeReferenceList=$w,e.priceCoefficientsReferenceList=Jw,e.productFilesTypesReferenceList=Yw,e.renderConfig=_c,e.resetInputValidation=ye,e.resourceReferencesList=Xw,e.salesDirectionsReferenceList=Zw,e.searchCityReferenceDataHandler=aT,e.searchCityReferenceLabelRenderer=oT,e.searchClientReferenceDataHandler=lT,e.searchClientReferenceLabelRenderer=uT,e.searchRegionReferenceDataHandler=sT,e.searchRegionReferenceLabelRenderer=cT,e.selectAllTextOnFocus=be,e.showAppVersion=de,e.sourcePrimaryInterestOptionsList=iT,e.useCompactLayout=oe,e.useHoverSupport=ce,e.vCopy=y,e.vFocusNext=T,e.warehousesReferenceList=Qw});
|
|
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:`flex items-baseline gap-3`},vw={key:0,class:`text-sm text-sc-dark-grey`},yw=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,n=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,{key:n.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)(n.name),1),n.description?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,gw,(0,r.toDisplayString)(n.description),1)):(0,r.createCommentVNode)(``,!0)]),n.summary||t.$slots[`group-actions`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,_w,[n.summary?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,vw,(0,r.toDisplayString)(n.summary),1)):(0,r.createCommentVNode)(``,!0),(0,r.renderSlot)(t.$slots,`group-actions`,{group:n},void 0,!0)])):(0,r.createCommentVNode)(``,!0)]),(0,r.createVNode)(i,{columns:b.value,data:a(n.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-9168f88d`]]),bw={key:0,class:`text-sc-dark-grey my-2 text-center`},xw={key:1,class:`text-sc-dark-grey my-2`},Sw=(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`,bw,[(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`,xw,` История статусов отсутствует. `)):((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}))])}}}),Cw={class:`text-base`},ww=(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`,Cw,(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))}}),Tw={class:`ml-4 grid grid-cols-3 gap-1.5 text-base`},Ew={class:`col-span-2`},Dw={class:`col-span-2`},Ow=(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`,Tw,[i[9]||=(0,r.createElementVNode)(`span`,null,`Создал`,-1),(0,r.createVNode)(ww,{user:e.order.creator,class:`col-span-2`},null,8,[`user`]),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:0},[i[1]||=(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:1},[i[2]||=(0,r.createElementVNode)(`span`,null,`Графический файл клиента`,-1),i[3]||=(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:2},[i[4]||=(0,r.createElementVNode)(`span`,null,`Штрих-код`,-1),(0,r.createElementVNode)(`span`,Ew,(0,r.toDisplayString)(e.order.barcode),1)],64)):(0,r.createCommentVNode)(``,!0),e.order.payment?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:3},[i[5]||=(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:4},[i[6]||=(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:5},[i[7]||=(0,r.createElementVNode)(`span`,null,`Комментарий`,-1),(0,r.createElementVNode)(`span`,Dw,(0,r.toDisplayString)(e.order.comment),1)],64)):(0,r.createCommentVNode)(``,!0),e.order.attachedUser?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:6},[i[8]||=(0,r.createElementVNode)(`span`,null,`Закреплен за`,-1),(0,r.createVNode)(ww,{user:e.order.attachedUser,class:`col-span-2`},null,8,[`user`])],64)):(0,r.createCommentVNode)(``,!0)])]))}}),kw={viewBox:`0 0 512 512`,width:`1.2em`,height:`1.2em`};function Aw(e,t){return(0,r.openBlock)(),(0,r.createElementBlock)(`svg`,kw,[...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 jw=(0,r.markRaw)({name:`ion-copy-outline`,render:Aw}),Mw={class:`flex flex-col items-stretch gap-1.5 text-base`},Nw=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=jw;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`,Mw,[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`]]),Pw={key:0},Fw={class:`text-sc-dark-grey my-2 text-center`},Iw={key:1,class:`text-sc-dark-grey my-2 text-center`},Lw={key:2},Rw={class:`text-sc-dark-grey mt-4 text-right font-bold`},zw={class:`text-sc-primary`},Bw={class:`mb-4 max-w-xs empty:hidden`},Vw=(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`,Pw,[(0,r.createElementVNode)(`div`,Fw,[(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`,Iw,` --- Не удалось загрузить данные о заказе --- `)):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,Lw,[(0,r.createVNode)(yw,{products:d.value,"event-emitter":e.eventEmitter,"allow-edit":e.allowEdit},null,8,[`products`,`event-emitter`,`allow-edit`]),(0,r.createElementVNode)(`div`,Rw,[n[2]||=(0,r.createTextVNode)(` ИТОГО: `,-1),(0,r.createElementVNode)(`span`,zw,(0,r.toDisplayString)(f.value)+` ₽`,1)]),(0,r.createVNode)(Ow,{order:l.value,"onClick:clientName":n[0]||=e=>s(`click:client-name`,l.value.client,e)},null,8,[`order`]),(0,r.createElementVNode)(`div`,Bw,[(0,r.createVNode)(Nw,{order:l.value,"show-erp-link":``},null,8,[`order`])]),(0,r.createVNode)(Sw,{order:l.value},null,8,[`order`])]))}}}),Hw=(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)}}}),Uw=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)(Vw,{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:75,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:120,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:80,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)(Hw,{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:e.width+16}}: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-ee3efccb`]]),Ww=(0,r.computed)(()=>(0,t.useReferencesStore)().deliveryTypeReference??[]),Gw=(0,r.computed)(()=>(0,t.useReferencesStore)().managersList??[]),Kw=(0,r.computed)(()=>(0,t.useReferencesStore)().opfReference??[]),qw=(0,r.computed)(()=>(0,t.useReferencesStore)().partnerGroupsReference??[]),Jw=(0,r.computed)(()=>(0,t.useReferencesStore)().priceCoefficientsReference??[]),Yw=(0,r.computed)(()=>(0,t.useReferencesStore)().productFilesTypesReference??[]),Xw=(0,r.computed)(()=>(0,t.useReferencesStore)().resourceTypesReference),Zw=(0,r.computed)(()=>(0,t.useReferencesStore)().salesDirectionsReference??[]),Qw=(0,r.computed)(()=>(0,t.useReferencesStore)().warehousesReference??[]),$w=(0,r.computed)(()=>(0,t.useReferencesStore)().paymentTypeReference??[]),eT=(0,r.computed)(()=>(0,t.useReferencesStore)().orderStatusReference??[]),tT=(0,r.computed)(()=>(0,t.useReferencesStore)().orderStatusDetailReference??[]),nT=(0,r.computed)(()=>(0,t.useReferencesStore)().operatorReference??[]),rT=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList((0,t.useReferencesStore)().channelPrimaryInterestsReference??[],!0,!1,!0)),iT=(0,r.computed)(()=>Ce.convertReferencesToSelectOptionsList((0,t.useReferencesStore)().sourcePrimaryInterestsReference??[],!0,!1,!0)),aT=e=>t.HttpRequester.getInstance(t.ReferenceDataProvider).searchCity(e),oT=e=>Ce.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e?.isNewRec()?`-`:`${e.name}, ${e?.region?.name}, ${e?.region?.country?.name}`,e=>e?.isNewRec()),sT=async e=>(0,n.map)(await t.HttpRequester.getInstance(t.ReferenceDataProvider).searchRegion(e),e=>new t.Region(e)),cT=e=>Ce.convertReferencesToSelectOptionsList(e,!0,!1,!1,e=>e.isNewRec()?`-`:(0,n.join)((0,n.compact)([e.name,e.country.name]),`, `),e=>e.isNewRec()),lT=e=>t.HttpRequester.getInstance(t.ClientDataProvider).searchClient(e),uT=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()),dT={class:`flex flex-col gap-4`},fT={class:`flex flex-wrap gap-2`},pT={class:`flex flex-col gap-1.5`},mT={class:`inline-flex items-center gap-2`},hT={class:`flex flex-col gap-1.5`},gT={class:`inline-flex items-center gap-2`},_T=(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??eT.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`,dT,[(0,r.createElementVNode)(`div`,fT,[(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`,pT,[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`,mT,[(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`,hT,[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`,gT,[(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))])])}}}),vT=[`href`],yT={class:`text-sc-dark-grey`},bT=(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,vT),(0,r.createTextVNode)(` от `+(0,r.toDisplayString)(c.value),1)]),n[2]||=(0,r.createTextVNode)(`, `,-1),(0,r.createElementVNode)(`span`,yT,`автор: `+(0,r.toDisplayString)(e.order.creator.name)+` [`+(0,r.toDisplayString)(e.order.creator.type)+`]`,1)],64))}}),xT={class:`sc-page flex flex-col bg-inherit`},ST={class:`my-2 flex flex-row items-end`},CT={class:`sc-title grow`},wT={key:0,class:`sc-title-buttons flex-1 grow-0`},TT={class:`flex flex-col justify-end gap-1 sm:mt-0 sm:flex-row`},ET={key:0,class:`sc-title-extra mt-2 sm:mt-4`},DT=(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`,xT,[(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`,ST,[(0,r.createElementVNode)(`div`,CT,[(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`,wT,[(0,r.createElementVNode)(`div`,TT,[(0,r.renderSlot)(t.$slots,`title-buttons`)])])):(0,r.createCommentVNode)(``,!0)]),t.$slots[`title-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,ET,[(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`)])}}}),OT={class:`overflow-hidden transition-all duration-300`},kT={class:`text-lg font-medium leading-none`},AT=(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`,OT,[(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`,kT,(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)}}}),jT={ref:`panel-component-ref`,class:`sc-page-panel flex flex-row gap-2.5 bg-inherit sm:gap-8`},MT={key:0},NT={class:`sc-page-preview-panel grow`},PT={key:1,class:`sc-page-preview-panel-extra flex-none`},FT=(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)(DT,{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)(AT,{"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`,jT,[e.isShowPanelButtonVisible?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,MT,[(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`,NT,[(0,r.renderSlot)(t.$slots,`preview-panel`)]),t.$slots[`preview-panel-extra`]?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,PT,[(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`])}}}),IT=(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`]))}}),LT=(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`]))}}),RT=(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`]))}}),zT={class:`m-0.5 flex flex-col p-0.5`},BT={"data-testid":`address-line`},VT={key:0},HT={key:1},UT={key:2},WT={key:3},GT={"data-testid":`address-line`},KT={key:0},qT={key:1},JT={key:2},YT={key:3},XT={key:0,"data-testid":`address-quality-label`,class:`text-sc-warning text-xs`},ZT=(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`,zT,[(0,r.createElementVNode)(`span`,BT,[e.addr.postIndex?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,VT,(0,r.toDisplayString)(e.addr.postIndex)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.city?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,HT,(0,r.toDisplayString)(e.addr.city)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.locality?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,UT,(0,r.toDisplayString)(e.addr.locality)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.region?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,WT,(0,r.toDisplayString)(e.addr.region)+`, `,1)):(0,r.createCommentVNode)(``,!0)]),(0,r.createElementVNode)(`span`,GT,[e.addr.street?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,KT,(0,r.toDisplayString)(e.addr.street)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.building?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,qT,(0,r.toDisplayString)(e.addr.building)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.buildingPart?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,JT,(0,r.toDisplayString)(e.addr.buildingPart)+`, `,1)):(0,r.createCommentVNode)(``,!0),e.addr.apartments?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,YT,(0,r.toDisplayString)(e.addr.apartments)+`, `,1)):(0,r.createCommentVNode)(``,!0)]),n.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,XT,(0,r.toDisplayString)(n.value),1)):(0,r.createCommentVNode)(``,!0)]))}}),QT={clearable:!1,value:``,field:void 0,disabled:!1},$T=(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}},{...QT,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)(ZT,{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`])}}}),eE={class:`m-0.5 flex flex-col p-0.5`},tE={class:`font-medium`},nE={class:`flex flex-row gap-1 text-xs font-light text-blue-800`},rE={key:0},iE={key:1},aE=(0,r.defineComponent)({__name:`bank-suggestion-label`,props:{bank:{},selected:{type:Boolean}},setup(e){return(t,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`div`,eE,[(0,r.createElementVNode)(`span`,tE,(0,r.toDisplayString)(e.bank.name),1),(0,r.createElementVNode)(`span`,nE,[e.bank.bic?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,rE,` БИК: `+(0,r.toDisplayString)(e.bank.bic),1)):(0,r.createCommentVNode)(``,!0),e.bank.inn?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,iE,` ИНН: `+(0,r.toDisplayString)(e.bank.inn),1)):(0,r.createCommentVNode)(``,!0)])]))}}),oE=(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}},{...QT,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)(aE,{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`])}}}),sE={class:`font-medium`},cE={key:0,"data-testid":`org-details`,class:`text-xs font-light`},lE={key:0,"data-testid":`org-inn`,class:`mr-2 whitespace-nowrap text-blue-800`},uE={key:1,class:`text-sc-dark-grey`},dE=(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`,sE,(0,r.toDisplayString)(e.org.name),1),e.org.inn||i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`div`,cE,[e.org.inn?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,lE,(0,r.toDisplayString)(e.org.inn),1)):(0,r.createCommentVNode)(``,!0),i.value?((0,r.openBlock)(),(0,r.createElementBlock)(`span`,uE,(0,r.toDisplayString)(i.value),1)):(0,r.createCommentVNode)(``,!0)])):(0,r.createCommentVNode)(``,!0)],2))}}),fE=(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}},{...QT,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)(dE,{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=$T,e.ScAddressSuggestionLabel=ZT,e.ScBankSuggestion=oE,e.ScBankSuggestionLabel=aE,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=IT,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=LT,e.ScManagerSelect=RT,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=Ow,e.ScOrderExternalLinks=Nw,e.ScOrderHighlightSettings=_T,e.ScOrderInfo=Vw,e.ScOrderItemParams=EC,e.ScOrderItemsList=yw,e.ScOrderPayment=JC,e.ScOrderProductInfo=rw,e.ScOrderStatusHistory=Sw,e.ScOrderStatusTag=sw,e.ScOrdersList=Uw,e.ScOrgSuggestion=fE,e.ScOrgSuggestionLabel=dE,e.ScPage=DT,e.ScPageWithSlidingPanel=FT,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=bT,e.ScSingleFileUploadSelector=vm,e.ScSlidingContentWithDrawer=AT,e.ScStripConfigurator=pl,e.ScStripConfiguratorForm=ol,e.ScStripConfiguratorLineItem=tl,e.ScStripConfiguratorPreview=ul,e.ScUserShortInfo=ww,e.ScWarningIcon=Sm,e.SelectOptionHelper=Ce,e.UiNotificationProvider=p,e.Validators=Ee,e.WindowResolutionEnum=P,e.WindowResolutionProvider=F,e.channelPrimaryInterestOptionsList=rT,e.componentSizeInjectionKey=wt,e.copyToClipboard=g,e.deliveryTypeReferenceList=Ww,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=Gw,e.naiveUiTheme=Tt,e.operatorReferenceList=nT,e.opfReferenceList=Kw,e.orderStatusDetailReferenceList=tT,e.orderStatusReferenceList=eT,e.paginationItemsPrefix=Se,e.parse=ve,e.partnerGroupReferenceList=qw,e.paymentTypeReferenceList=$w,e.priceCoefficientsReferenceList=Jw,e.productFilesTypesReferenceList=Yw,e.renderConfig=_c,e.resetInputValidation=ye,e.resourceReferencesList=Xw,e.salesDirectionsReferenceList=Zw,e.searchCityReferenceDataHandler=aT,e.searchCityReferenceLabelRenderer=oT,e.searchClientReferenceDataHandler=lT,e.searchClientReferenceLabelRenderer=uT,e.searchRegionReferenceDataHandler=sT,e.searchRegionReferenceLabelRenderer=cT,e.selectAllTextOnFocus=be,e.showAppVersion=de,e.sourcePrimaryInterestOptionsList=iT,e.useCompactLayout=oe,e.useHoverSupport=ce,e.vCopy=y,e.vFocusNext=T,e.warehousesReferenceList=Qw});
|