eservices-core 1.3.199 → 1.3.201

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,12 +1,12 @@
1
1
  (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.es-card-list{box-shadow:#959da533 0 8px 24px;border:1px solid #f1f1f1;border-radius:4px;background-color:#fff}.color-primary{color:var(--primary)}.color-gray{color:#ccc}.es-container-full{height:100%;width:100%}.es-cursor-pointer{cursor:pointer}.es-cursor-default{cursor:default}.es-flex{display:flex}.es-flex-column{display:flex;flex-direction:column}.es-flex-center{display:flex;align-items:center;justify-content:center}.es-flex-grow{flex-grow:1}.es-flex-justify-center{justify-content:center}.es-flex-justify-between{justify-content:space-between}.es-flex-align-center{align-items:center}.es-gap-1{gap:1px}.es-gap-2{gap:2px}.es-gap-3{gap:3px}.es-gap-4{gap:4px}.es-gap-5{gap:5px}.es-gap-6{gap:6px}.es-gap-7{gap:7px}.es-gap-8{gap:8px}.es-gap-9{gap:9px}.es-gap-10{gap:10px}.es-gap-15{gap:15px}.es-gap-20{gap:20px}.es-list-container,.es-overflow-auto{overflow:auto}.es-overflow-hidden{overflow:hidden}.es-padding-2{padding:2px}.es-padding-3{padding:3px}.es-padding-4{padding:4px}.es-padding-5{padding:5px}.es-padding-10{padding:10px}.es-padding-0{padding:0}.es-padding-7{padding:7px}.es-padding-15{padding:15px}.es-padding-20{padding:20px}.es-padding-v-5{padding:5px 0}.es-padding-h-5{padding:0 5px}.es-padding-is-5{padding-inline-start:5px}.es-padding-ie-5{padding-inline-end:5px}.es-position-relative{position:relative}.es-position-absolute{position:absolute}.es-position-absolute-full{position:absolute;left:0;top:0;width:100%;height:100%}.es-position-absolute-center{position:absolute;left:0;right:0;top:0;bottom:0;margin:auto}.es-radius-2{border-radius:2px}.es-radius-3{border-radius:3px}.es-radius-4{border-radius:4px}.es-radius-5{border-radius:5px}.es-radius-6{border-radius:6px}.es-radius-7{border-radius:7px}.es-radius-8{border-radius:8px}.es-radius-9{border-radius:9px}.es-radius-10{border-radius:10px}.es-radius-15{border-radius:15px}.es-radius-20{border-radius:20px}.es-text-xs{font-weight:400;font-size:10px;line-height:13px}.es-text-sm{font-weight:400;font-size:12px;line-height:16px}.es-text-md{font-size:14px;line-height:20px}.es-text-lg{font-size:16px;line-height:24px}.es-text-xl{font-size:18px;line-height:25px}.es-text-center{text-align:center}.es-text-bold{font-weight:700}.es-text-no-wrap{text-wrap:nowrap}.es-weight-600{font-weight:600}.es-zindex-0{z-index:0}.es-zindex-1{z-index:1}.es-zindex-2{z-index:2}.es-zindex-3{z-index:3}.es-zindex-4{z-index:4}.es-zindex-5{z-index:5}.es-grid{display:grid}.es-grid-center{display:grid;place-content:center}.es-margin-0{margin:0}.widget-table__head-cell[data-v-498c4f00]{padding:18px;text-align:start}.widget-table__head-label[data-v-498c4f00]{font-weight:600;font-size:14px;line-height:19px}.widget-filter-text[data-v-800b3803]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:20px 10px}.widget-filter-enum[data-v-cf143196]{box-shadow:0 2px 2px #00000040;background-color:#fff;padding:3px 0;max-height:400px;max-width:340px;min-width:180px;overflow:hidden auto}.widget-filter-enum-item[data-v-cf143196]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cf143196]:hover{background-color:#f1f1f1}[dir=rtl] .icon[data-v-8a72b45f]{transform:scaleX(-1)}.widget-spinner[data-v-0ef9ae88],.widget-spinner[data-v-0ef9ae88]:after{border-radius:50%;width:14px;height:14px}.widget-spinner[data-v-0ef9ae88]{font-size:2px;position:relative;text-indent:-9999em;border-top:1.1em solid rgba(255,255,255,.2);border-right:1.1em solid rgba(255,255,255,.2);border-bottom:1.1em solid rgba(255,255,255,.2);border-left:1.1em solid #ffffff;transform:translateZ(0);animation:spinnerAnimation-0ef9ae88 1.1s infinite linear}@keyframes spinnerAnimation-0ef9ae88{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.widget-button[data-v-450dc564]{position:relative}.widget-button-spinner[data-v-450dc564]{position:absolute;top:0;bottom:0;left:5px;margin:auto}.widget-multi-button-wrap[data-v-d43a76ce]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-d43a76ce]{grid-template-columns:1fr var(--button-size);background-color:var(--primary);grid-template-rows:var(--button-size);transition:var(--fast)}.widget-multi-button_active[data-v-d43a76ce]{grid-template-rows:calc(var(--button-size) * var(--04895bf1))}.widget-multi-button-body[data-v-d43a76ce]{min-width:80px}.widget-multi-button-body-label[data-v-d43a76ce]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-d43a76ce]:hover{background-color:#223296}.widget-multi-button-side[data-v-d43a76ce]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-d43a76ce]{transform:rotate(180deg)}.widget-multi-button-side[data-v-d43a76ce]:hover{background-color:#223296}tr[data-v-344a8cc1]{border:1px solid #F3F4FC;height:30px}th[data-v-344a8cc1],td[data-v-344a8cc1]{position:relative;padding:0 11px}th[data-v-344a8cc1]{text-align:left}p[data-v-344a8cc1]{margin:0;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.widget-list-head-cell[data-v-bf495d6a]{padding:0 0 0 10px;display:flex}.widget-list-head-cell[data-v-bf495d6a]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-bf495d6a]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-bf495d6a]{position:absolute;inset-inline-end:22px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-bf495d6a]{transform:rotate(180deg)}.head-cell-resize[data-v-bf495d6a]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-bf495d6a]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-bf495d6a]:after{content:"";margin:auto;width:1px;height:100%;display:block;background-color:#d2d2d2}.widget-list-head[data-v-ccffc6bd]{position:sticky;top:-1px;z-index:1}.test-block[data-v-ccffc6bd]{position:absolute;z-index:2;display:none;height:calc(100% + 1px);place-content:center;inset-block-start:-1px;padding-inline:10px;background-color:#e7f2ff;-webkit-user-select:none;user-select:none;white-space:nowrap}.widget-list-head th[data-v-ccffc6bd]{position:sticky;top:0;z-index:2;-webkit-user-select:none;user-select:none}.widget-head-cell[data-v-9db5d417]{display:flex;gap:4px}.widget-head-cell-order[data-v-9db5d417]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-9db5d417]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-9db5d417]{padding:7px}.widget-head-cell-order-icon[data-v-9db5d417]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-9db5d417]{transform:rotate(180deg)}.widget-filter-item-container[data-v-5b9128bc]{position:relative}.widget-filter-item-arrow[data-v-5b9128bc]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-5b9128bc]{font-weight:700}.widget-filter-item[data-v-5b9128bc]{display:grid;grid-template-columns:max-content max-content;align-items:center;cursor:pointer;padding:0 10px;color:#fff}.widget-filter-item-label[data-v-5b9128bc]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-5b9128bc]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-5b9128bc]{transition:.2s}.widget-table-panel-filter[data-v-f1534314]{justify-content:end;background-color:var(--color-primary)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  "use strict";var et=e=>{throw TypeError(e)};var tt=(e,t,n)=>t.has(e)||et("Cannot "+n);var nt=(e,t,n)=>(tt(e,t,"read from private field"),n?n.call(e):t.get(e)),rt=(e,t,n)=>t.has(e)?et("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),xe=(e,t,n,o)=>(tt(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);/*!
3
- * eservices-core v1.3.199
3
+ * eservices-core v1.3.201
4
4
  * (c) 2024 ESERVICES
5
5
  */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),D=require("jenesius-vue-form"),Ve=require("vue-router"),Zt=require("date-and-time"),Ie=require("debug"),re=require("jenesius-vue-modal"),I=class I extends Error{constructor(t,n=null){super(),this.message=t,this.details=n,this.id=I.ID++}static ParentFormNotFound(){return new I("Can't found parent form.")}static UndefinedNameOfCompositeFormController(t){return new I("Composite object name is undefined",t)}static EntityWithoutName(t){return new I("'Entity doesn't have a name",t)}static NotResolvedNameEventEmitter(t){return new I(`'${t}' is not a valid Event emitter name`)}static FormIsNotValidated(t){return new I("Form is not validated",t)}static ListWorkerIsRunningOrEnd(t){return new I("List data request is running or already done",t)}static ObjectIdNotNumber(t){return new I(`${t} (id) is not a number`)}static UndefinedErrorId(t,n){return I.ApiNotAvailable()}static ApiError(t){return new I("Request error",t)}static ApiNotAvailable(){return new I(`Sorry, we experience difficulties here.
6
- Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(t,n){return!t&&!n?I.ApiNotAvailable():new I(t||"Authorization Error",n)}static ApiResponseParseFailed(){return I.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new I("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new I(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new I("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new I("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new I(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new I(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,o){return new I(`Array already includes the element with value ${t}`,{array:n,table:o})}static MetadataEntityIsNotAvailable(t){return new I(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new I("The request took too long to complete. Try again later.")}};I.ID=0;let Z=I;const en="Please try again later or submit a feedback if problem doesn't go.";function tn(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return en}})}function Y(e,t={}){return t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Z.ApiNotAvailable()}).then(n=>tn(n).then(o=>{if(!n.ok)throw o;return o}))}class nn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,o)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),t[n]=o,!0)}),window._journal=this}get error(){return{add:(...t)=>{this.errors.push(t)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new nn;function ot(e){return{...e,createdEntities:e.createdEntites}}const ae=class ae{static async getStartConfig(t,n){return Y([ae.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return Y([ae.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ot)}static async runStep(t,n,o,i,a){return Y([ae.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:i,values:a})}).then(ot)}};ae.url="/close-api/views/process-wizard";let se=ae;var M=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(M||{});class rn{static invite(t,n,o){return Y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:o})})}static accept(t,n){return Y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!0})})}static decline(t,n){return Y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class on{static getRequiredDocuments(t,n,o){const i=new URLSearchParams({entity:t,primaryKey:n,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class ie{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${ie.url()}/calculator/${t}`)}static calculate(t,n){return Y(`/${ie.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,values:n})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Z.ApiNotAvailable()})}static parseMetadataField(t){function n(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return Y(`/${ie.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return Y(`/${ie.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function an(e){return e.statusName===M.Completed}function sn(e){return[M.FinalStepWithConfirmation,M.NextStepWithConfirmation].includes(e.statusName)}function ln(e){return e.statusName===M.ValidationError}function cn(e){return e.statusName===M.Undefined}function un(e,t,n){let o=null,i=[];const a=r.ref(!1),s=r.ref(null),u=r.computed(()=>g(i,s.value)),l=r.ref(null),c=r.reactive([]),f=r.computed(()=>c.map(v=>g(i,v)));function g(v,E){return v.find(C=>C.name===E)||null}async function d(v){var E;if(cn(v)){await n.onDisplayDataSet(v);return}if(!(sn(v)&&!await n.onDisplayDataSet(v))){if(ln(v))return void n.onValidation(v.validationResults);k(v),await r.nextTick();{const C=((E=g(i,s.value))==null?void 0:E.fields)||[];if([M.FinalStep,M.NextStep].includes(v.statusName)&&(!C.length||fn(C,n.presets)))return h(n.presets||{})}an(v)&&n.onCompleted(v)}}async function w(){try{await m(),await b()}catch(v){P("error")(v)}}function m(){return a.value="Loading process information.",se.getStartConfig(t,e).then(v=>(l.value={label:v.processTitle,info:v.processInfo,icon:v.processIcon},i=v.steps.map(E=>{const C=E.frontendEntity.rootObject,x=Object.fromEntries(E.frontendEntity.objectTypes.map(B=>[B.name,B.properties]));return{label:E.title,name:E.stepName,number:E.number,rootObjectName:C,objectTypes:x,fields:x[C],buttonCaption:E.buttonCaption}}))).finally(()=>{a.value=!1})}function k(v){return[M.FinalStepWithConfirmation,M.NextStepWithConfirmation,M.NextStep,M.Completed,M.FinalStep].includes(v.statusName)&&(o=v.token,s.value=v.nextStepName),v}function b(){return a.value="Starting process",se.startProcess(t,e).then(d).catch(P("error")).finally(()=>{a.value=null})}function h(v={}){const E=s.value;return!o||!E?Promise.reject("Not step or token."):(a.value="Waiting for result...",se.runStep(t,e,E,o,v).then(d).then(C=>(c.push(E),C)).catch(P("error")).finally(()=>{a.value=!1}))}return{initialize:w,loading:a,currentStepConfig:u,currentStepName:s,arrayPassedSteps:f,arrayProcessStepName:c,processInfo:l,next:h}}function fn(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(!D.utils.getPropFromObject(t,o.name))return!1}return!0}const dn={class:"widget-table__head-cell"},pn={class:"widget-table__head-label margin_0 text_overflow"},wt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",dn,[r.createElementVNode("span",pn,r.toDisplayString(t.label),1)]))}}),gn={class:"widget-table__head"},mn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>S.componentTableHeadCell||wt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.config,o=>r.renderSlot(t.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),U=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},hn=U(mn,[["__scopeId","data-v-498c4f00"]]);function Me(e){return Array.isArray(e)?Me(e[0]):typeof e!="string"?null:e}function me(e){return Me(e.name)}function yn(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let o;for(;(o=t.exec(e))!==null;)n.push(o[1]);return n}function vn(e,t){return yn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),D.utils.getPropFromObject(t,o))}),e}function $e(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function je(e,t){const n=me(e);if(typeof e.value=="string")return vn(e.value,t);let o=n?D.utils.getPropFromObject(t,n):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,t);if(e.value===null)return null;if(e.unitValue&&(o=$e(e.unitValue)(o)),e.unit&&(o=$e(e.unit)(o)),e.type)switch(e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=qe(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=_t(typeof o=="string"?o:null);break}case"money":{o=St(o);break}}return e.formatter&&(o=fe(e.formatter).exec(o,t)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const wn=1,bn=5e3,En="static-folder",bt="request-error",Et="Distinguisher",_={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core",VISIBLE_ITEM_PROVIDE_NAME:"visible-item-provider",EVENT_FORM_UPDATE:"form-update",EVENT_AFFECTED_ENTITY:"affected-entity",DEFAULT_ORDER_DIR:"asc",TABLE_MOCK_FIELD:"_A_MOCK_ID_FIELD",OBJECT_TYPE_NAME_FIELD:Et};function Ne(e){return[_.CORE_DEBUG_LABEL,e].join(":")}const kn={class:"widget-filter-text flex gap_20"},Tn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>n.values,s=>{if(typeof s!="string")return i.value="";i.value=s},{immediate:!0}),(s,u)=>{const l=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",kn,[r.createVNode(r.unref(D.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c)},null,8,["modelValue"]),r.createVNode(l,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(ee)("Apply")),1)]),_:1})])}}}),Cn=U(Tn,[["__scopeId","data-v-800b3803"]]),_n={class:"widget-filter-enum"},An=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,o=r.ref([]),i=Oe(n.fieldMetadata.entity),a=c=>(n.values||[]).includes(c),s=t;function u(c){const f=n.values||[];return f.includes(c)?s("update:values",f.filter(g=>g!==c)):s("update:values",[...f,c])}async function l(){var g;if(!((g=n.fieldMetadata)!=null&&g.entity)||!i.value)return;const c=i.value.fieldNameForLabel,f=i.value.fieldNameForIdentification;s("readProcess","start"),o.value=await ue(n.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>(s("readProcess","end"),d.map(w=>({label:w[c],value:w[f]}))))}return r.watch(()=>i.value,l,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",_n,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,g=>(r.openBlock(),r.createBlock(r.unref(D.FormField),{class:"widget-filter-enum-item",key:g.value,onClick:()=>u(g.value),type:"single-checkbox","model-value":a(g.value),label:g.label},null,8,["onClick","model-value","label"]))),128))]))}}),Sn=U(An,[["__scopeId","data-v-cf143196"]]),S={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:Cn,Entity:Sn}};function In(e){for(let t in e)S[t]=e[t]}const Nn={props:{name:String},setup(e,t){let n="unknown";try{n=t.slots.default()[0].children}catch{n=e.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>r.h(S.iconTag,{class:S.iconHandler?S.iconHandler(n):`icon icon-${n}`},S.iconHandlerText(n))}},ce=U(Nn,[["__scopeId","data-v-8a72b45f"]]),Rn=Ie(Ne("setup-list-row"));function On(e,t){const n=e.config.map(o=>Ln(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function Ln(e,t,n){const o=t.values;let i=je(e,o);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(f){a.onClick.push(()=>f(o,e,n))}function u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const l=[],c=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(D.FormField,{type:"single-checkbox",modelValue:t.selected})),s(it.bind(null,n,!0));break}case"select":{c.push(r.h(D.FormField,{type:"single-radio",modelValue:t.selected})),s(it.bind(null,n,!1));break}}if(e.onClick&&s(e.onClick),e.link)try{const f=e.link(o);if(f){const g=r.h(Ve.RouterLink,{to:f});c.push(g),u("widget-table-cell_link")}}catch(f){Rn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(o),target:"_blank"})),u("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(ce,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&c.push(r.h(ce,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(o)):u(e.class)),S.listCellHandler&&S.listCellHandler(e,o,{cellNodeChildren:c,addClass:u,addHandleClick:s,context:n}),l.push(r.h("td",a,c)),l}function it(e,t){e.emit("select",t)}function Ue(e,t){return()=>{try{return On(e,t)}catch(n){return console.warn(n),null}}}const xn={props:{values:Object,config:Object,selected:Boolean},setup:Ue},$n=["colspan"],at=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){const n=t,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=s=>n("close")),onSave:a[1]||(a[1]=s=>n("save",s))}),null,16,["values","new"]))],8,$n)],512))}}),Bn={class:"widget-table"},st="update:selectedRows",Fn="update:activeRow",kt=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1},useMockField:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:t}){const n=e,o=t,i=r.useSlots(),a=r.computed(()=>{var d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function s(d){return n.useMockField?gt(d):d}function u(d,w=!0){if(!n.selectedRows)return;if(!w)return o(st,n.selectedRows.includes(d)?[]:[d]);const m=[...n.selectedRows],k=m.indexOf(d);return k===-1?m.push(d):m.splice(k,1),o(st,m)}function l(d){o(Fn,d)}function c(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>n.shortcut?n.config.filter(d=>d.name?!!n.array.find(m=>![null,""].includes(je(d,m))):!0):n.config),g=r.computed(()=>n.useMockField?n.array.filter(gt):n.array);return(d,w)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Bn,[r.createElementVNode("thead",null,[r.createVNode(hn,{config:f.value,onOrder:w[0]||(w[0]=m=>d.$emit("order",m))},{default:r.withCtx(m=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||wt),r.normalizeProps(r.guardReactiveProps(m)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,(m,k)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k},[r.createVNode(xn,{config:f.value,values:m,selected:d.selectedRows.includes(s(m)),onSelect:b=>u(s(m),b),onActivate:b=>l(s(m)),class:r.normalizeClass(d.classCallback?d.classCallback(m):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===s(m)?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":d.config.length,values:m,onClose:w[1]||(w[1]=b=>o("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),d.activeRow===r.unref(_).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":f.value.length,onClose:w[2]||(w[2]=m=>o("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Dn=r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${t.color}`})},null,4))}}),de=U(Dn,[["__scopeId","data-v-0ef9ae88"]]),Pn={class:"widget-button"},Vn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",Pn,[t.wait?(r.openBlock(),r.createBlock(de,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Mn=U(Vn,[["__scopeId","data-v-450dc564"]]),jn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Un={class:"widget-multi-button-body grid"},Wn=["onClick"],qn={class:"widget-multi-button-side-wrap"},Gn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(s=>({"04895bf1":o.value}));const t=e,n=r.reactive({active:!1,wait:!1}),o=r.computed(()=>t.array.length+(t.label?1:0));function i(s){if(!(typeof s!="function"||n.wait))return n.wait=!0,Promise.resolve().then(s).finally(()=>{n.wait=!1})}function a(s=!n.active){n.active=s}return(s,u)=>(r.openBlock(),r.createElementBlock("div",jn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Un,[s.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=l=>a())},r.toDisplayString(s.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(l,c)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:c,onClick:f=>{i(l.callback),a(!1)}},r.toDisplayString(l.label),9,Wn))),128))]),r.createElementVNode("div",qn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=l=>a())},[n.wait?(r.openBlock(),r.createBlock(r.unref(de),{key:0,class:"widget-multi-button-side-spinner"})):s.array.length>1?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),zn=U(Gn,[["__scopeId","data-v-d43a76ce"]]),Hn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Xn={class:"text_md"},Jn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Hn,[r.createVNode(de,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Xn,r.toDisplayString(t.label),1)]))}}),Yn=["alt","src"],Kn=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const t=e,n=r.ref();return r.onMounted(()=>{n.value&&(n.value.src=t.src),n.value.onerror=function(){t.default&&(n.value.src=t.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:n,src:o.src||o.$props.default},null,8,Yn))}}),Qn={props:{config:Array,values:Object,selected:Boolean},setup:Ue},Zn=U(Qn,[["__scopeId","data-v-344a8cc1"]]),er=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),tr={class:"widget-list-head-cell"},nr=er(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),rr=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:t}){const n=e,o=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",tr,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(D.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(s=>o("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:a[1]||(a[1]=s=>o("order"))},r.toDisplayString(i.title||i.label),1))],4),i.name&&i.order.length&&i.order[0]===i.name?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),nr])]))}}),or=U(rr,[["__scopeId","data-v-bf495d6a"]]),ir=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,o=t,i=r.ref(),a=r.ref();r.onMounted(()=>{function c(m,k){let b=-1;do b++,k-=m[b];while(k>0&&b<m.length);return b}function f(m,k){let b=0;for(;k>0&&k>m[b]&&b<m.length;)k-=m[b],b++;return console.log(k,b),b>0?b:0}function g(m){try{a.value.style.insetInlineStart=m+"px"}catch(k){console.log(k)}}function d(m){try{a.value.style.width=m+"px",a.value.style.minWidth=m+"px",a.value.style.maxWidth=m+"px"}catch(k){console.log(k)}}function w(m){return m===null?!1:m.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(k){var O;function b(F){return F.screenX+E-B}const h=i.value,v=[...h.children].filter(F=>F.localName==="th"),E=((O=h.offsetParent)==null?void 0:O.scrollLeft)||0,C=v.map(F=>F.clientWidth),x=w(k.target),B=h.getBoundingClientRect().left,p=b(k),y=c(C,p),T=C.slice(0,y).reduce((F,V)=>F+V,0),A=p-T,N=h.offsetWidth,G=v[y].clientWidth;if(n.config[y].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",k.screenX),console.log("Widths",C),console.log("max width",N),console.log("Start Position",p),console.log("Position From",y),console.log("Start Position",y),console.log("Global offset (Отступ самой таблицы от края экрана)",B),console.log("Del",A),console.groupEnd(),a.value.innerText=v[y].textContent||"",a.value.style.display="grid",a.value.style.width=G+"px",a.value.style.cursor="grabbing",g(T),d(G),document.addEventListener("pointermove",W,{passive:!0}),document.addEventListener("pointerup",K);function K(F){if(console.group("END"),document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",K),x&&(n.config[y].width=a.value.style.width,n.config[y].minWidth=a.value.style.width,n.config[y].maxWidth=a.value.style.width,s(n.config)),!x){const V=F.screenX+E-B;console.log("ENP Position",V);const ve=f(C,V);if(console.log(y,"->",ve),ve!==y){const pe=n.config[y],Le=n.config;Le.splice(y,1),Le.splice(ve,0,pe),s(Le)}else{const pe=n.config[y].name;u(pe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function W(F){if(x){const pe=b(F)-p+G;d(pe);return}let V=F.screenX+E-B-A;V<0&&(V=0),V+G>N&&(V=N-G),g(V)}})});function s(c){o("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,f==="asc"?"desc":"asc"])}function l(c){o("update:order",c)}return(c,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.config,(g,d)=>(r.openBlock(),r.createBlock(or,r.mergeProps({key:g,ref_for:!0},g,{onOrder:w=>u(g.name),onSelect:f[0]||(f[0]=w=>o("select")),order:c.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),ar=U(ir,[["__scopeId","data-v-ccffc6bd"]]),sr={class:"widget-list"},lr={class:"widget-list-body position_relative"},cr=50,ur=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:t}){const n=e,o=t;function i(l,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],g=f.indexOf(l);g===-1?f.push(l):f==null||f.splice(g,1),s(f)}}function a(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){o("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+cr>c.scrollHeight&&o("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",sr,[r.createElementVNode("thead",null,[r.createVNode(ar,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>o("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>o("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",lr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(f,g)=>{var d;return r.openBlock(),r.createBlock(Zn,{key:g,class:"widget-list-row",values:f,config:l.config,selected:(d=l.selectedRows)==null?void 0:d.includes(f),onSelect:w=>i(f,w)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function We(){var a;const e=r.computed(()=>Object.keys(n).length===0||Object.values(n).includes(!0)),t=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!t)throw"Undefined instance. Please check it.";const n=r.reactive({});r.provide(_.VISIBLE_ITEM_PROVIDE_NAME,{show(s){n[s]=!0},hide(s){n[s]=!1},remove(s){delete n[s]}});const o=r.inject(_.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(t)},hide(){o==null||o.hide(t)},remove(){o==null||o.remove(t)}},visibleItems:n}}const fr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Oe(),o=Ke(),i=r.computed(()=>{var k,b;const d=l.value,w=c(d),m={type:w,disabled:!((k=u.value)!=null&&k.canSet),label:t.label};return d&&Object.assign(m,{suffix:w==="number"?d.valueUnit:void 0,required:s.includes(w||"")?!1:d.required,label:t.label||d.displayName}),Object.assign(m,((b=S.fieldParamsHandler)==null?void 0:b.call(S,d,u.value,m))||{}),m}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=o==null?void 0:o.value)==null?void 0:d.fields[t.name]}),l=r.computed(()=>{if(!n.value)return;const d=n.value.fieldsByName[t.name];if(d)return d});function c(d){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(d){if(d.type==="Reference"||d.type==="Owned")return d.referencedEntity;if(d.dataType==="Boolean")return"single-checkbox";if(d.dataType==="DateTime")return"date";if(d.dataType==="Integer"||d.dataType==="Decimal")return"number";if(d.dataType==="List")return d.aggregatedEntity;if(a.includes(d.presentationType))return"textarea";if(d.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var d;return((d=u.value)==null?void 0:d.canGet)===!0}),{controller:g}=We();return r.watch(()=>f.value,d=>d?g.show():g.hide(),{immediate:!0}),r.onUnmounted(()=>g.remove()),(d,w)=>f.value?(r.openBlock(),r.createBlock(r.unref(D.FormField),r.mergeProps({key:0},{...d.$attrs,...i.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function dr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||_.DEFAULT_ORDER_DIR}const pr=["fill"],gr=r.createElementVNode("path",{d:"M440-647 244-451q-12 12-28 11.5T188-452q-11-12-11.5-28t11.5-28l264-264q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l264 264q11 11 11 27.5T772-452q-12 12-28.5 12T715-452L520-647v447q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-447Z"},null,-1),mr=[gr],hr=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},mr,8,pr))}}),yr={class:"widget-fast-table-head-cell-td"},vr={class:"widget-head-cell-label"},wr={key:0,class:"widget-head-cell-order"},br=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const t=e,n=r.computed(()=>Me(t.name));return r.computed(()=>dr(t.order)),(o,i)=>{var a;return r.openBlock(),r.createElementBlock("td",yr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:i[0]||(i[0]=s=>o.$emit("order",o.name))},[r.createElementVNode("span",vr,r.toDisplayString(o.label),1),n.value===((a=o.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",wr,[r.createVNode(hr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${o.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),Tt=U(br,[["__scopeId","data-v-9db5d417"]]),Er=["fill"],kr=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),Tr=[kr],Cr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},Tr,8,Er))}}),_r={class:"widget-filter-item-popup"},Ar=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=S.tableFilterEntityBind,a=r.ref(),s=r.computed(()=>{const w=n.filterItem;return w.entity?"Entity":w.type?w.type:null});function u(w){l.value=w==="start"}const l=r.ref(!1),c=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),f=r.ref(!1);let g=null;function d(w=!f.value){f.value=w,!f.value&&g?(g(),g=null):a.value&&(g=D.utils.clickOutside(a.value,d.bind(null,!1)))}return(w,m)=>{var k;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:m[0]||(m[0]=()=>d())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(w.filterItem.label||"--"),3),l.value?(r.openBlock(),r.createBlock(de,{key:0})):(r.openBlock(),r.createBlock(Cr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",_r,[s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((k=r.unref(i))==null?void 0:k[s.value]),{key:0,"field-metadata":w.filterItem,values:w.values,"onUpdate:values":m[1]||(m[1]=b=>o("update:values",b)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),Ct=U(Ar,[["__scopeId","data-v-5b9128bc"]]),Sr={class:"widget-table-panel-filter flex"},Ir=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:t}){const n=e,o=t;function i(a,s){o("update:filters",{...n.filters,[a]:s})}return(a,s)=>(r.openBlock(),r.createElementBlock("div",Sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(Ct,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(me)(u)],"onUpdate:values":f=>i(r.unref(me)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Nr=U(Ir,[["__scopeId","data-v-f1534314"]]),Rr={class:"es-grid es-gap-15"},Or={key:0,class:"title-md color-primary margin-0"},Lr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},xr=r.createElementVNode("span",null,"Loading...",-1),$r={class:"widget-fast-table-tools es-flex es-gap-15"},Br={class:""},Fr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=Ve.useRouter(),o=r.ref([]),i=r.ref(null),a=r.ref(null),s=r.ref(null),u=D.Form.getParentForm();Oe(t.entity);const{state:l,update:c}=Ke(t.entity,{masterEntities:t.masterEntities||[]}),f=(t.actions||[]).map(p=>xt(p)),g=r.computed(()=>i.value?Jt(t.entity,i.value.config):[]),d=r.computed(()=>{var p;return((p=i.value)==null?void 0:p.displayItem)||Ye.inline}),w=r.computed(()=>{var p;return((p=i.value)==null?void 0:p.newItem)||d.value}),m=Te(async()=>{try{await b.call(),await c()}catch(p){const{message:y}=Ge(p);a.value=y}});u instanceof D.Form&&u.subscribe({read:m.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{k.call(),m.call()});const k=Te(async function(){const y=t.entity;i.value=await Nt(y,t.mark)}),b=Te(async function(){var T,A,N;const y=t.entity;a.value=null,k.promise&&await k.promise,o.value=(await ue(y,{customFilters:((T=i.value)==null?void 0:T.customFilters)||[],fields:At(g.value).join(" "),order:((A=i.value)==null?void 0:A.order)||[],filter:L.and(L(B.value),L(t.binding||{}),L(((N=i.value)==null?void 0:N.prefilters)||{}))})).map(ci)});async function h(p){var T;if(p===null)return s.value=null;const y=p==null?void 0:p.Id;if(!y&&((T=i.value)!=null&&T.linkNew))return n.push(i.value.linkNew);if(d.value==="form")return n.push(Je(t.entity,y));if(d.value==="inline")return s.value=p||_.LIST_ACTIVE_NEW;d.value==="modal"?(await re.promptModal("form",{entity:t.entity,id:y}),await b.call()):s.value=_.LIST_ACTIVE_NEW}const{controller:v}=We();r.watch(()=>l.value,p=>{p&&(p.canRead?v.show():v.hide())},{immediate:!0}),r.onUnmounted(()=>v.remove());const E=[{icon:"reload",label:"Reload",callback(){m.call()}}];let C=[he.on("affected-entity",p=>{p.name===t.entity&&b.call()}),he.on("display-entity",async p=>{p.name===t.entity&&(b.promise&&await b.promise,s.value=o.value.find(y=>y.Id===p.id)||null)})];r.onUnmounted(()=>C.map(p=>p()));function x(p){var K;function y(W){return Array.isArray(W)?y(W[0]):typeof W!="string"?null:W}const T=y(p);if(!T)return;const A=((K=i.value)==null?void 0:K.order)||[];(W=>{if(i.value)return i.value.order=W,!0})(A[0]!==T?[T,"asc"]:A[1]==="desc"?[]:[T,"desc"])&&b.call()}const B=r.ref({});return r.watch(()=>B.value,()=>b.call()),(p,y)=>{var N,G,K,W;const T=r.resolveComponent("widget-button"),A=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Rr,[(N=i.value)!=null&&N.label?(r.openBlock(),r.createElementBlock("p",Or,r.toDisplayString((G=i.value)==null?void 0:G.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(m).wait||r.unref(k).wait||r.unref(b).wait?(r.openBlock(),r.createElementBlock("div",Lr,[r.createVNode(r.unref(de),{color:"var(--color-primary)"}),xr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",$r,[w.value==="form"||(K=r.unref(l))!=null&&K.canCreate?(r.openBlock(),r.createBlock(T,{key:0,callback:h,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(" Add New ")]),_:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f).filter(O=>!!O.value),O=>{var F;return r.openBlock(),r.createBlock(T,{callback:(F=O.value)==null?void 0:F.callback,type:"primary"},{default:r.withCtx(()=>{var V;return[r.createTextVNode(r.toDisplayString((V=O.value)==null?void 0:V.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(E,O=>r.createVNode(T,{onClick:()=>O.callback,callback:O.callback},{default:r.withCtx(()=>[r.createVNode(ce,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(O.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",Br,[r.createVNode(Nr,{entity:p.entity,"filters-config":((W=i.value)==null?void 0:W.filters)||[],filters:B.value,"onUpdate:filters":y[0]||(y[0]=O=>B.value=O)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(kt),{config:g.value,array:o.value,"active-row":s.value,"onUpdate:activeRow":h,onOrder:x,class:"table"},{"head-cell":r.withCtx(O=>{var F;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.$slots["head-cell"]?p.$slots["head-cell"]:Tt),r.mergeProps({label:O.label},O,{onOrder:x,order:((F=i.value)==null?void 0:F.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var O;return[r.createVNode(A,{entity:p.entity,id:(O=s.value)==null?void 0:O.Id,"master-entities":p.masterEntities||void 0,binding:p.binding,onFormUpdate:y[1]||(y[1]=()=>{s.value=null,r.unref(b).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function _t(e){return qe(e,"YYYY/MM/DD HH:mm:ss")}function qe(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Zt.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function Te(e){function t(...o){if(n.wait)return Promise.reject("The process has already started.");n.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{n.wait=!1,n.promise=null});return n.promise=i,i}const n=r.reactive({wait:!1,call:t,promise:null});return n}function Ge(e){return typeof e=="string"?we(e):Dr(e)?we(e.message,e.children||e.details||[]):Pr(e)?we(e.title,[e.detail||""]):we(_.DEFAULT_ERROR_MESSAGE)}function Dr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Pr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function we(e,t=[]){return{message:e,children:t}}function P(e="error"){return function(t){const{message:n,children:o}=Ge(t);Qe.add(e,n,{children:o})}}function ue(e,t={}){return $().emit("entity:read",{...t,entity:e})}function ze(e,t){return $().emit("entity:update",{...t,entity:e})}function At(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function St(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(t,"0"),o[1].length>t&&(o[1]=o[1].substring(0,t)),o.join(".")}function Vr(e,t){const n=new Map;return e.forEach(o=>{var a;const i=t(o);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(o)}),n}function Mr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function jr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return _.DEFAULT_ERROR_MESSAGE}})}function j(e,t={}){return z.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=z.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(_.DEFAULT_ERROR_MESSAGE)}).then(n=>jr(n).then(o=>{if(!n.ok)throw o;return o}))}function Ur(e,t=1e3){let n=0;return(...o)=>{clearTimeout(n),n=window.setTimeout(()=>e(...o),t)}}function Wr(e,t){let n=!1;return(...o)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...o)}}const qr=Ie(Ne("pretty-value-field-by-entity"));function Gr(e,t,n){try{const o=Ae.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[t];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(o){return qr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,t,n),n}}const te=Ie(Ne("use-socket"));function $(){return Hr}function zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Hr=function(){let e=1,t,n;const o=new Set;let i=0;const a=new Set;function s(){if(t)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{t.close()},bn*2);const h=new Uint8Array(1);h[0]=wn,t.send(h)}setInterval(()=>{Array.from(o).forEach(h=>{b(h)&&(te("Handler for event %s requestId %d was expired",h.event,h.requestId),h.requestId?l({requestId:h.requestId,event:bt,data:{message:Z.RequestTookToLong().message}}):o.delete(h))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},_.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function l(h){const v=[...o.values()];te("Handlers array length is %d. Response event: %s. Request id: %d",o.size,h.event,h.requestId),v.forEach(E=>{const C=h.requestId;(E.requestId&&E.requestId===C||!E.requestId&&E.event===h.event)&&(te("Find appropriated handler: %d, event: %s",e,E.event),E.callback(h.data,h),E.once&&(o.delete(E),te("Handler was removed by *once* params was passed. %o",E)))})}function c(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),t=new WebSocket(n),t.onclose=function(h){te("Connection to server was stopped: %d %s",h.code,h.reason),Array.from(o).forEach(v=>{v.guaranteedAnswer&&v.serializeString&&a.add(v.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(h=>{f(h),a.delete(h)})},t.onerror=function(h){console.warn(h)},t.onmessage=h=>{var v;try{if(zr(h.data)){s();return}const E=JSON.parse(h.data);if(!It(E)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(E);return}(v=E==null?void 0:E.data)!=null&&v.refresh&&location.reload(),l(E)}catch(E){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(E)}}}function f(h){t.send(h)}function g(h,v){k({event:h,callback:v})}function d(h,v){k({event:h,callback:v,once:!0})}function w(){return t&&(t==null?void 0:t.readyState)===1}function m(h,v,E){const C=++e,x=JSON.stringify({requestId:C,event:h,data:v,contextId:z.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return w()?f(x):(a.add(x),te("Socket is not connected. Message was send to save-queue")),new Promise((B,p)=>{k({event:h,requestId:C,once:!0,guaranteedAnswer:!0,serializeString:x,callback:(y,T)=>{if(te("Promise was resolve with next data:",y),Xr(T))return void p(y);E&&E(y,T),B(y)},timeToLive:_.TIME_TO_LIVE_SOCKET_REQUEST})})}function k(h){const v={timeToLive:0,...h,created:new Date().getTime()};o.add(v)}function b(h){return h.timeToLive===0||typeof h.timeToLive!="number"?!1:new Date().getTime()-h.created>h.timeToLive}return{get socket(){return t},on:g,once:d,emit:m,initialization(h){n=h},getDevInfo:u}}(),Xr=e=>!!It(e)&&e.event===bt,It=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function Nt(e,t){return $().emit("list-setting:read",{entity:e,mark:t})}function Jr(e,t){return $().emit("metadata-field:treat",{entity:e,fieldName:t})}function Rt(e,t){return $().emit("entity:create",{...t,entity:e})}function Ot(e,t){return $().emit("entity:delete",{...t,entity:e})}function Yr(e,t){return $().emit("usage-context:read",{...t,entity:e})}function Lt(e={}){return $().emit("tool:read",e)}function Kr(){return $().emit("metadata-list:read",{})}function xt(e,t={},n={}){const o=r.inject(_.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var l;const u=((typeof e=="string"?(l=o==null?void 0:o.actions)==null?void 0:l.value:r.unref(e))||[]).find(c=>c.name===i);return u?{...u,...a}:null})}function Qr(e){return $().emit("history:read",e)}function Zr(e,t){return $().emit("entity:count",{...t,entity:e})}function eo(e){return`/${En}/${e}`}function fe(e){return{exec(t,n){switch(e.name){case"replace-boolean":return fe.replaceBoolean(t,e.values);case"replace-record-operation":return fe.replaceRecordOperation(t)}}}}fe.replaceBoolean=to;fe.replaceRecordOperation=no;function to(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function no(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function ro(e={}){return $().emit("tool:execute",e)}const oo=Ie(Ne("wrap-tool-response"));function $t(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=so),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=co),e.handleCloseForm===void 0&&(e.handleCloseForm=uo),e.handleValidationResult===void 0&&(e.handleValidationResult=lo),{...t,label:t.title,callback(){var i;const n=typeof e.values=="function"?e.values(t,e):e.values,o=()=>ro({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!io(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const l of e.handlers)await l(t,a,e);if(!a.success)throw e.handleValidationResult&&a.validationEffect&&((u=(s=a.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(t,a.validationEffect,e),new Error(a.message);return a.message&&Qe.add("info",a.message),Array.isArray(a.affectedEntities)&&e.handleAffectedEntity&&a.affectedEntities.forEach(l=>{var c;return(c=e.handleAffectedEntity)==null?void 0:c.call(e,t,l,e)}),t.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(t,e),a}).catch(P("error"));return(i=e.overrides)!=null&&i[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(o):!t.confirmation||!e.handleConfirmation?o():e.handleConfirmation(t,o)}}}function io(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function ao(e){const t="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?t:typeof e=="string"?e:t}async function so(e,t){const n=ao(e.confirmation);if(!re.getComponentFromStore(_.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await re.promptModal(_.MODAL_CONFIRM,{message:n}))return t()}function lo(e,t){const n=_.MODAL_VALIDATION_EFFECT;if(!re.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{re.pushModal(n,t)})}function co(e,t,n){var l;function o(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function i(c,f){c&&(oo("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&o(c)&&c.read(),c instanceof D.Form&&c.dependencies.forEach(g=>i(g,f)))}he.emit("affected-entity",t);const{router:a,form:s}=n,u=(l=t.primaryKey)==null?void 0:l.Id;if(a&&t&&t.name===e.redirectEntity){he.emit("display-entity",{id:u,name:t.name}),S.getEntityLink&&a.push(S.getEntityLink(t.name,u));return}i(s,t.name)}function uo(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let ne={};function ee(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=D.utils.getPropFromObject((this==null?void 0:this.vocabulary)||ne,e);if(typeof n=="string")return lt(n,t);const o=D.utils.getPropFromObject(ne==null?void 0:ne.root,e);return typeof o=="string"?lt(o,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function lt(e,t){return t.forEach((n,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),e}ee.setGlobalVocabulary=function(e){ne=e};ee.getScope=function(e){const t=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),ee.bind({vocabulary:D.utils.getPropFromObject(ne,t.toLowerCase())})};ee.setVocabulary=function(e){return typeof e=="string"&&(e=D.utils.getPropFromObject(ne,e)),ee.bind({vocabulary:e})};function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={exports:{}},R={},Fe={exports:{}},oe={};function Bt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function po(e,t,n){}function go(e,t,n){}var mo=/javascript\s*\:/img;function ho(e,t){return mo.test(t)?"":t}oe.whiteList=Bt();oe.getDefaultWhiteList=Bt;oe.onAttr=po;oe.onIgnoreAttr=go;oe.safeAttrValue=ho;var yo={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},ge=yo;function vo(e,t){e=ge.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,o=!1,i=0,a=0,s="";function u(){if(!o){var f=ge.trim(e.slice(i,a)),g=f.indexOf(":");if(g!==-1){var d=ge.trim(f.slice(0,g)),w=ge.trim(f.slice(g+1));if(d){var m=t(i,s.length,d,w,f);m&&(s+=m+"; ")}}}i=a+1}for(;a<n;a++){var l=e[a];if(l==="/"&&e[a+1]==="*"){var c=e.indexOf("*/",a+2);if(c===-1)break;a=c+1,i=a+1,o=!1}else l==="("?o=!0:l===")"?o=!1:l===";"?o||u():l===`
7
- `&&u()}return ge.trim(s)}var wo=vo,be=oe,bo=wo;function ct(e){return e==null}function Eo(e){var t={};for(var n in e)t[n]=e[n];return t}function Ft(e){e=Eo(e||{}),e.whiteList=e.whiteList||be.whiteList,e.onAttr=e.onAttr||be.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||be.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||be.safeAttrValue,this.options=e}Ft.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onAttr,a=n.onIgnoreAttr,s=n.safeAttrValue,u=bo(e,function(l,c,f,g,d){var w=o[f],m=!1;if(w===!0?m=w:typeof w=="function"?m=w(g):w instanceof RegExp&&(m=w.test(g)),m!==!0&&(m=!1),g=s(f,g),!!g){var k={position:c,sourcePosition:l,source:d,isWhite:m};if(m){var b=i(f,g,k);return ct(b)?f+":"+g:b}else{var b=a(f,g,k);if(!ct(b))return b}}});return u};var ko=Ft;(function(e,t){var n=oe,o=ko;function i(s,u){var l=new o(u);return l.process(s)}t=e.exports=i,t.FilterCSS=o;for(var a in n)t[a]=n[a];typeof window<"u"&&(window.filterCSS=e.exports)})(Fe,Fe.exports);var He=Fe.exports,Xe={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},To=He.FilterCSS,Co=He.getDefaultWhiteList,_e=Xe;function Dt(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Pt=new To;function _o(e,t,n){}function Ao(e,t,n){}function So(e,t,n){}function Io(e,t,n){}function Vt(e){return e.replace(Ro,"&lt;").replace(Oo,"&gt;")}function No(e,t,n,o){if(n=Gt(n),t==="href"||t==="src"){if(n=_e.trim(n),n==="#")return"#";if(!(n.substr(0,7)==="http://"||n.substr(0,8)==="https://"||n.substr(0,7)==="mailto:"||n.substr(0,4)==="tel:"||n.substr(0,11)==="data:image/"||n.substr(0,6)==="ftp://"||n.substr(0,2)==="./"||n.substr(0,3)==="../"||n[0]==="#"||n[0]==="/"))return""}else if(t==="background"){if(Ee.lastIndex=0,Ee.test(n))return""}else if(t==="style"){if(ut.lastIndex=0,ut.test(n)||(ft.lastIndex=0,ft.test(n)&&(Ee.lastIndex=0,Ee.test(n))))return"";o!==!1&&(o=o||Pt,n=o.process(n))}return n=zt(n),n}var Ro=/</g,Oo=/>/g,Lo=/"/g,xo=/&quot;/g,$o=/&#([a-zA-Z0-9]*);?/gim,Bo=/&colon;?/gim,Fo=/&newline;?/gim,Ee=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,ut=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ft=/u\s*r\s*l\s*\(.*/gi;function Mt(e){return e.replace(Lo,"&quot;")}function jt(e){return e.replace(xo,'"')}function Ut(e){return e.replace($o,function(n,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Wt(e){return e.replace(Bo,":").replace(Fo," ")}function qt(e){for(var t="",n=0,o=e.length;n<o;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return _e.trim(t)}function Gt(e){return e=jt(e),e=Ut(e),e=Wt(e),e=qt(e),e}function zt(e){return e=Mt(e),e=Vt(e),e}function Do(){return""}function Po(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function o(s){return n?!0:_e.indexOf(e,s)!==-1}var i=[],a=!1;return{onIgnoreTag:function(s,u,l){if(o(s))if(l.isClosing){var c="[/removed]",f=l.position+c.length;return i.push([a!==!1?a:l.position,f]),a=!1,c}else return a||(a=l.position),"[removed]";else return t(s,u,l)},remove:function(s){var u="",l=0;return _e.forEach(i,function(c){u+=s.slice(l,c[0]),l=c[1]}),u+=s.slice(l),u}}}function Vo(e){for(var t="",n=0;n<e.length;){var o=e.indexOf("<!--",n);if(o===-1){t+=e.slice(n);break}t+=e.slice(n,o);var i=e.indexOf("-->",o);if(i===-1)break;n=i+3}return t}function Mo(e){var t=e.split("");return t=t.filter(function(n){var o=n.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),t.join("")}R.whiteList=Dt();R.getDefaultWhiteList=Dt;R.onTag=_o;R.onIgnoreTag=Ao;R.onTagAttr=So;R.onIgnoreTagAttr=Io;R.safeAttrValue=No;R.escapeHtml=Vt;R.escapeQuote=Mt;R.unescapeQuote=jt;R.escapeHtmlEntities=Ut;R.escapeDangerHtml5Entities=Wt;R.clearNonPrintableCharacter=qt;R.friendlyAttrValue=Gt;R.escapeAttrValue=zt;R.onIgnoreTagStripAll=Do;R.StripTagBody=Po;R.stripCommentTag=Vo;R.stripBlankChar=Mo;R.attributeWrapSign='"';R.cssFilter=Pt;R.getDefaultCSSWhiteList=Co;var Re={},Q=Xe;function jo(e){var t=Q.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=Q.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function Uo(e){return e.slice(0,2)==="</"}function Wo(e,t,n){var o="",i=0,a=!1,s=!1,u=0,l=e.length,c="",f="";e:for(u=0;u<l;u++){var g=e.charAt(u);if(a===!1){if(g==="<"){a=u;continue}}else if(s===!1){if(g==="<"){o+=n(e.slice(i,u)),a=u,i=u;continue}if(g===">"||u===l-1){o+=n(e.slice(i,a)),f=e.slice(a,u+1),c=jo(f),o+=t(a,o.length,c,f,Uo(f)),i=u+1,a=!1;continue}if(g==='"'||g==="'")for(var d=1,w=e.charAt(u-d);w.trim()===""||w==="=";){if(w==="="){s=g;continue e}w=e.charAt(u-++d)}}else if(g===s){s=!1;continue}}return i<l&&(o+=n(e.substr(i))),o}var qo=/[^a-zA-Z0-9\\_:.-]/gim;function Go(e,t){var n=0,o=0,i=[],a=!1,s=e.length;function u(d,w){if(d=Q.trim(d),d=d.replace(qo,"").toLowerCase(),!(d.length<1)){var m=t(d,w||"");m&&i.push(m)}}for(var l=0;l<s;l++){var c=e.charAt(l),f,g;if(a===!1&&c==="="){a=e.slice(n,l),n=l+1,o=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Ho(e,l+1);continue}if(a!==!1&&l===o){if(g=e.indexOf(c,l+1),g===-1)break;f=Q.trim(e.slice(o+1,g)),u(a,f),a=!1,l=g,n=l+1;continue}if(/\s|\n|\t/.test(c))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(g=zo(e,l),g===-1){f=Q.trim(e.slice(n,l)),u(f),a=!1,n=l+1;continue}else{l=g-1;continue}else if(g=Xo(e,l-1),g===-1){f=Q.trim(e.slice(n,l)),f=dt(f),u(a,f),a=!1,n=l+1;continue}else continue}return n<e.length&&(a===!1?u(e.slice(n)):u(a,dt(Q.trim(e.slice(n))))),Q.trim(i.join(" "))}function zo(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Ho(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function Xo(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Jo(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function dt(e){return Jo(e)?e.substr(1,e.length-2):e}Re.parseTag=Wo;Re.parseAttr=Go;var Yo=He.FilterCSS,q=R,Ht=Re,Ko=Ht.parseTag,Qo=Ht.parseAttr,Ce=Xe;function ke(e){return e==null}function Zo(e){var t=Ce.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ce.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=Ce.trim(e.slice(0,-1))),{html:e,closing:n}}function ei(e){var t={};for(var n in e)t[n]=e[n];return t}function ti(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(o){return o.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Xt(e){e=ei(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=q.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ti(e.whiteList||e.allowList):e.whiteList=q.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":q.attributeWrapSign,e.onTag=e.onTag||q.onTag,e.onTagAttr=e.onTagAttr||q.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||q.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||q.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||q.safeAttrValue,e.escapeHtml=e.escapeHtml||q.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Yo(e.css))}Xt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onTag,a=n.onIgnoreTag,s=n.onTagAttr,u=n.onIgnoreTagAttr,l=n.safeAttrValue,c=n.escapeHtml,f=t.attributeWrapSign,g=t.cssFilter;n.stripBlankChar&&(e=q.stripBlankChar(e)),n.allowCommentTag||(e=q.stripCommentTag(e));var d=!1;n.stripIgnoreTagBody&&(d=q.StripTagBody(n.stripIgnoreTagBody,a),a=d.onIgnoreTag);var w=Ko(e,function(m,k,b,h,v){var E={sourcePosition:m,position:k,isClosing:v,isWhite:Object.prototype.hasOwnProperty.call(o,b)},C=i(b,h,E);if(!ke(C))return C;if(E.isWhite){if(E.isClosing)return"</"+b+">";var x=Zo(h),B=o[b],p=Qo(x.html,function(y,T){var A=Ce.indexOf(B,y)!==-1,N=s(b,y,T,A);return ke(N)?A?(T=l(b,y,T,g),T?y+"="+f+T+f:y):(N=u(b,y,T,A),ke(N)?void 0:N):N});return h="<"+b,p&&(h+=" "+p),x.closing&&(h+=" /"),h+=">",h}else return C=a(b,h,E),ke(C)?c(h):C},c);return d&&(w=d.remove(w)),w};var ni=Xt;(function(e,t){var n=R,o=Re,i=ni;function a(u,l){var c=new i(l);return c.process(u)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var u in n)t[u]=n[u];for(var l in o)t[l]=o[l]}(),typeof window<"u"&&(window.filterXSS=e.exports);function s(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}s()&&(self.filterXSS=e.exports)})(Be,Be.exports);var ri=Be.exports;const oi=fo(ri);function ii(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),oi(e)}function ai(e,t,n,o){let i=e+t/60+n/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function si(e,t){const n={dir:e<0?t==="long"?"W":"S":t==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${n.deg}° ${n.min}' ${n.sec}" ${n.dir}`}function Je(e,t){return`/forms/${e}/${t}`}function Jt(e,t,n){const o=ee.getScope(e.toLowerCase());return t.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>re.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{re.openModal("form",{entity:pt(i,a),id:a[me(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const s=i.name[0],u=a[s];return u?Je(pt(i,a),u):null},i.value=(a,s)=>s[i.name[1]]),li(i,i.type,i.presentation),S.listConvertCellConfigHandler&&S.listConvertCellConfigHandler(e,i),i))}function li(e,t,n){switch(t){case"DateTime":{e.type="dateWithTime";break}case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const pt=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function gt(e){return typeof e!="object"||e===null?null:e[_.TABLE_MOCK_FIELD]}function ci(e,t){return typeof e!="object"||e===null?(console.warn("cell data is not a valid object."),e):(typeof t=="string"||typeof t=="number"||typeof t=="function"?(typeof t=="function"&&(t=t(e)),e[_.TABLE_MOCK_FIELD]=t):e[_.TABLE_MOCK_FIELD]=e.Id,e)}var Ye=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(Ye||{});function ui(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function fi(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Yt(e,t){e()&&(await t(),await Yt(e,t))}function di(e,t,n={}){let o=!1;const i=r.ref(""),a=r.computed(()=>s.filter(p=>c(p,i.value))),s=r.reactive([]);let u=0;const l=r.ref(!1);let c=(n==null?void 0:n.filterSearchFn)||((p,y)=>fi(p,y));function f(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function g(){const p=C();return typeof p.limit!="number"&&(p.limit=100),p.offset=u,(n.request||ue)(e,p).then(T=>(u+=T.length,T))}function d(p,y){var A;return typeof p.Version=="number"?p.Version:(A=s.find(N=>N.Id===y))==null?void 0:A.Version}function w(p,y){const T=s.findIndex(A=>A.Id===p);if(T===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(T,1,y)}function m(p){const y=s.findIndex(T=>T.Id===p);if(y===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(y,1)}async function k(p,y){try{const T=C(),A=d(y,p);delete y.Version,await ze(e,{id:p,values:y,version:A,masterEntities:f()});const N=await ue(e,{fields:T.fields||"",id:p});w(p,N)}catch(T){P()(T)}}async function b(p,y={}){try{const T=C(),A=d(y,p);delete y.Version,await Ot(e,{id:p,version:A,masterEntities:f()}),m(p)}catch(T){P()(T)}}async function h(p){try{await Rt(e,{values:p,masterEntities:f()}),await x()}catch(y){P()(y)}}let v;async function E(){l.value=!0;try{v!=null&&v.signal&&!v.signal.aborted&&v.abort();let p=v=new AbortController,y=0;const A=C().limit||0;if(i.value&&!A){console.warn("Using textSearch assumes the use of limit.");return}await Yt(()=>(A>0?y<A:!0)&&!o&&!p.signal.aborted,async()=>{const N=await g();p.signal.aborted||(s.push(...N),y+=N.filter(G=>c(G,i.value)).length,(N.length<A||A===0)&&(o=!0))})}catch(p){P()(p)}l.value=!1}function C(){return typeof t=="function"?t():t}async function x(){try{u=0,o=!1,s.splice(0,s.length),await E()}catch(p){P()(p)}}function B(){if(v)return v.abort();l.value=!1}return{array:s,updateById:k,next:E,reload:x,wait:l,create:h,deleteById:b,textSearch:i,filteredArray:a,abort:B}}function pi(){function e(){return{organizations:z.organizations,currentContextId:z.contextId,person:z.person,context:z.context,contextType:z.contextType,userId:z.userId}}const t=r.reactive(e());return z.onupdateContext(()=>{Object.assign(t,e())}),t}function gi(e,t,n){return $().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function mi(e,t,n){return $().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function hi(e,t){return $().emit("communication-message:create",{communicationId:e,text:t})}function yi(e){return $().emit("communication-message:read",{communicationId:e})}function vi(e){const t=D.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>yi(e.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function wi(e,t){e.read=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ue(e.name,o)}).then(Ze).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(P())},e.save=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ze(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw P()(i),i})};function n(){return typeof t=="function"?t():t}}function Oe(e){if(!e)return r.inject(_.PROVIDE_NAME_METADATA);Ae.initEntity(e);const t=r.computed(()=>Ae.state[e]);return r.provide(_.PROVIDE_NAME_METADATA,t),t}function Ke(e,t={}){if(!e)return r.inject(_.PROVIDE_NAME_USAGE_CONTEXT);const n=r.ref(null);return r.provide(_.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Yr(e,bi(t||{}))}}}function bi(e){return typeof e=="function"?e():e}function Ei(e){if(!e)return r.inject(_.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),o=r.computed(()=>n.map(s=>$t(e,s))),i={actions:o,update:a};r.provide(_.PROVIDE_NAME_ACTIONS,i),e.router=Ve.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const s=e==null?void 0:e.form;return Lt({masterEntities:e==null?void 0:e.masterEntities,id:s==null?void 0:s.id,entity:s==null?void 0:s.name}).then(u=>n.splice(0,0,...u)).catch(P("error")).finally(()=>t.value=!1)}return{actions:o,update:a,loading:r.readonly(t)}}function ki(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function Ti(e,t={}){const n=r.reactive([]),o=l=>{const c=r.unref(e);if(l===void 0){n.length===0?c.forEach(a):c.forEach(s);return}i(l)?s(l):a(l)},i=l=>n.includes(l),a=l=>{t.handleSelect&&!t.handleSelect(l)||i(l)||n.push(l)},s=l=>{const c=n.findIndex(f=>f===l);c!==-1&&n.splice(c,1)},u=r.computed(()=>{const l=r.unref(e);return n.length===l.length&&l.length!==0});return[n,o,u,a,s]}function Ci(e){const t=r.ref(""),n=r.computed(()=>{const o=t.value.toLowerCase();return r.unref(e).filter(i=>t.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:t,searchArray:n}}const Qe=new class{constructor(){this.store=r.reactive([])}add(t,n,o={}){const i=_i(o),a=new De(t,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(t){const n=this.store.findIndex(o=>o.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function _i(e){function t(o){return!!o&&typeof o=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const Se=class Se{constructor(t,n,o,i,a){this.type=t,this.message=n,this.timeout=o,this.children=i,this.click=a,this.id=Se.cardId++}};Se.cardId=1;let De=Se;/*!
6
+ Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(t,n){return!t&&!n?I.ApiNotAvailable():new I(t||"Authorization Error",n)}static ApiResponseParseFailed(){return I.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new I("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new I(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new I("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new I("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new I(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new I(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,o){return new I(`Array already includes the element with value ${t}`,{array:n,table:o})}static MetadataEntityIsNotAvailable(t){return new I(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new I("The request took too long to complete. Try again later.")}};I.ID=0;let Z=I;const en="Please try again later or submit a feedback if problem doesn't go.";function tn(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return en}})}function Y(e,t={}){return t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw Z.ApiNotAvailable()}).then(n=>tn(n).then(o=>{if(!n.ok)throw o;return o}))}class nn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(t,n,o)=>(n!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(o)}`),t[n]=o,!0)}),window._journal=this}get error(){return{add:(...t)=>{this.errors.push(t)},clean:()=>{this.errors.splice(0,this.errors.length)},console:()=>{console.log(this.errors)}}}welcome(){console.log("The journal has been initialized. To get access check %c_journal in console.","background: blue; color: white")}}new nn;function ot(e){return{...e,createdEntities:e.createdEntites}}const ae=class ae{static async getStartConfig(t,n){return Y([ae.url,t,n].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(t,n){return Y([ae.url,t,n].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(ot)}static async runStep(t,n,o,i,a){return Y([ae.url,t,n].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:o,token:i,values:a})}).then(ot)}};ae.url="/close-api/views/process-wizard";let se=ae;var P=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(P||{});class rn{static invite(t,n,o){return Y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:t,personKey:n,relatedRoleCode:o})})}static accept(t,n){return Y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!0})})}static decline(t,n){return Y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class on{static getRequiredDocuments(t,n,o){const i=new URLSearchParams({entity:t,primaryKey:n,statusCode:o});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(a=>a.json())}}class ie{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${ie.url()}/calculator/${t}`)}static calculate(t,n){return Y(`/${ie.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:t,values:n})}).then(o=>{if(o&&o.status===1)return o;throw Array.isArray(o.notes)?new Error(o.notes[0]):Z.ApiNotAvailable()})}static parseMetadataField(t){function n(o){switch(o.type){case"ValueType":switch(o.dataType){case"Integer":return"number";default:return o.dataType}case"EntityReference":return o.dataType}}return{name:t.name,label:t.title,required:t.required,type:n(t)}}static createOnlinePayment(t,n){return Y(`/${ie.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return Y(`/${ie.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}function an(e){return e.statusName===P.Completed}function sn(e){return[P.FinalStepWithConfirmation,P.NextStepWithConfirmation].includes(e.statusName)}function ln(e){return e.statusName===P.ValidationError}function cn(e){return e.statusName===P.Undefined}function un(e,t,n){let o=null,i=[];const a=r.ref(!1),s=r.ref(null),u=r.computed(()=>g(i,s.value)),l=r.ref(null),c=r.reactive([]),f=r.computed(()=>c.map(y=>g(i,y)));function g(y,E){return y.find(C=>C.name===E)||null}async function d(y){var E;if(cn(y)){await n.onDisplayDataSet(y);return}if(!(sn(y)&&!await n.onDisplayDataSet(y))){if(ln(y))return void n.onValidation(y.validationResults);k(y),await r.nextTick();{const C=((E=g(i,s.value))==null?void 0:E.fields)||[];if([P.FinalStep,P.NextStep,P.FinalStepWithConfirmation,P.NextStepWithConfirmation].includes(y.statusName)&&(!C.length||fn(C,n.presets)))return h(n.presets||{})}an(y)&&n.onCompleted(y)}}async function w(){try{await m(),await b()}catch(y){V("error")(y)}}function m(){return a.value="Loading process information.",se.getStartConfig(t,e).then(y=>(l.value={label:y.processTitle,info:y.processInfo,icon:y.processIcon},i=y.steps.map(E=>{const C=E.frontendEntity.rootObject,x=Object.fromEntries(E.frontendEntity.objectTypes.map(B=>[B.name,B.properties]));return{label:E.title,name:E.stepName,number:E.number,rootObjectName:C,objectTypes:x,fields:x[C],buttonCaption:E.buttonCaption}}))).finally(()=>{a.value=!1})}function k(y){return[P.FinalStepWithConfirmation,P.NextStepWithConfirmation,P.NextStep,P.Completed,P.FinalStep].includes(y.statusName)?(o=y.token,s.value=y.nextStepName):console.log("Saving is not completed:",y),y}function b(){return a.value="Starting process",se.startProcess(t,e).then(d).catch(V("error")).finally(()=>{a.value=null})}function h(y={}){const E=s.value;return!o||!E?Promise.reject("Not step or token."):(a.value="Waiting for result...",se.runStep(t,e,E,o,y).then(d).then(C=>(c[c.length-1]!==E&&c.push(E),C)).catch(V("error")).finally(()=>{a.value=!1}))}return{initialize:w,loading:a,currentStepConfig:u,currentStepName:s,arrayPassedSteps:f,arrayProcessStepName:c,processInfo:l,next:h}}function fn(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(!D.utils.getPropFromObject(t,o.name))return!1}return!0}const dn={class:"widget-table__head-cell"},pn={class:"widget-table__head-label margin_0 text_overflow"},wt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("th",dn,[r.createElementVNode("span",pn,r.toDisplayString(t.label),1)]))}}),gn={class:"widget-table__head"},mn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>S.componentTableHeadCell||wt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(t.config,o=>r.renderSlot(t.$slots,"default",r.mergeProps({ref_for:!0},o),void 0,!0)),256))]))}}),U=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},hn=U(mn,[["__scopeId","data-v-498c4f00"]]);function Me(e){return Array.isArray(e)?Me(e[0]):typeof e!="string"?null:e}function me(e){return Me(e.name)}function vn(e){const t=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),n=[];let o;for(;(o=t.exec(e))!==null;)n.push(o[1]);return n}function yn(e,t){return vn(e).forEach(o=>{e=e.replace(new RegExp("\\$\\{"+o+"}","g"),D.utils.getPropFromObject(t,o))}),e}function $e(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function je(e,t){const n=me(e);if(typeof e.value=="string")return yn(e.value,t);let o=n?D.utils.getPropFromObject(t,n):null;if(o===void 0&&(o=null),typeof e.value=="function")return e.value(o,t);if(e.value===null)return null;if(e.unitValue&&(o=$e(e.unitValue)(o)),e.unit&&(o=$e(e.unit)(o)),e.type)switch(e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=qe(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=_t(typeof o=="string"?o:null);break}case"money":{o=St(o);break}}return e.formatter&&(o=fe(e.formatter).exec(o,t)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const wn=1,bn=5e3,En="static-folder",bt="request-error",Et="Distinguisher",_={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:1e3,PROVIDE_NAME_METADATA:"provide-metadata-config",PROVIDE_NAME_USAGE_CONTEXT:"provide-usage-context-config",PROVIDE_NAME_ACTIONS:"provide-actions",MODAL_VALIDATION_EFFECT:"validation-effect",MODAL_CONFIRM:"confirm",TIME_TO_LIVE_SOCKET_REQUEST:3e4,CORE_DEBUG_LABEL:"eservices-core",VISIBLE_ITEM_PROVIDE_NAME:"visible-item-provider",EVENT_FORM_UPDATE:"form-update",EVENT_AFFECTED_ENTITY:"affected-entity",DEFAULT_ORDER_DIR:"asc",TABLE_MOCK_FIELD:"_A_MOCK_ID_FIELD",OBJECT_TYPE_NAME_FIELD:Et};function Ne(e){return[_.CORE_DEBUG_LABEL,e].join(":")}const kn={class:"widget-filter-text flex gap_20"},Tn=r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=r.ref("");function a(){o("update:values",i.value)}return r.watch(()=>n.values,s=>{if(typeof s!="string")return i.value="";i.value=s},{immediate:!0}),(s,u)=>{const l=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",kn,[r.createVNode(r.unref(D.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":u[0]||(u[0]=c=>i.value=c)},null,8,["modelValue"]),r.createVNode(l,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(ee)("Apply")),1)]),_:1})])}}}),Cn=U(Tn,[["__scopeId","data-v-800b3803"]]),_n={class:"widget-filter-enum"},An=r.defineComponent({__name:"widget-filter-entity",props:{values:{},fieldMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,o=r.ref([]),i=Oe(n.fieldMetadata.entity),a=c=>(n.values||[]).includes(c),s=t;function u(c){const f=n.values||[];return f.includes(c)?s("update:values",f.filter(g=>g!==c)):s("update:values",[...f,c])}async function l(){var g;if(!((g=n.fieldMetadata)!=null&&g.entity)||!i.value)return;const c=i.value.fieldNameForLabel,f=i.value.fieldNameForIdentification;s("readProcess","start"),o.value=await ue(n.fieldMetadata.entity,{fields:[c,f].join(" "),order:[c,"asc"]}).then(d=>(s("readProcess","end"),d.map(w=>({label:w[c],value:w[f]}))))}return r.watch(()=>i.value,l,{immediate:!0}),(c,f)=>(r.openBlock(),r.createElementBlock("div",_n,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,g=>(r.openBlock(),r.createBlock(r.unref(D.FormField),{class:"widget-filter-enum-item",key:g.value,onClick:()=>u(g.value),type:"single-checkbox","model-value":a(g.value),label:g.label},null,8,["onClick","model-value","label"]))),128))]))}}),Sn=U(An,[["__scopeId","data-v-cf143196"]]),S={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",tableFilterEntityBind:{String:Cn,Entity:Sn}};function In(e){for(let t in e)S[t]=e[t]}const Nn={props:{name:String},setup(e,t){let n="unknown";try{n=t.slots.default()[0].children}catch{n=e.name}typeof n!="string"&&console.warn(`Name for Icon.vue is not string. ${n}`);try{n=n.replace(/\s+/g,"")}catch{}return()=>r.h(S.iconTag,{class:S.iconHandler?S.iconHandler(n):`icon icon-${n}`},S.iconHandlerText(n))}},ce=U(Nn,[["__scopeId","data-v-8a72b45f"]]),Rn=Ie(Ne("setup-list-row"));function On(e,t){const n=e.config.map(o=>Ln(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function Ln(e,t,n){const o=t.values;let i=je(e,o);const a={onClick:[],class:["widget-table__cell widget-table-cell"]};function s(f){a.onClick.push(()=>f(o,e,n))}function u(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}const l=[],c=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(u(`widget-table-cell_${e.type}`),e.type){case"multi-select":{c.push(r.h(D.FormField,{type:"single-checkbox",modelValue:t.selected})),s(it.bind(null,n,!0));break}case"select":{c.push(r.h(D.FormField,{type:"single-radio",modelValue:t.selected})),s(it.bind(null,n,!1));break}}if(e.onClick&&s(e.onClick),e.link)try{const f=e.link(o);if(f){const g=r.h(Ve.RouterLink,{to:f});c.push(g),u("widget-table-cell_link")}}catch(f){Rn("Can't add router link",f)}if(e.href&&(c.push(r.h("a",{href:e.href(o),target:"_blank"})),u("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&c.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&c.push(r.h(ce,{name:e.icon})),typeof e.icon=="function")){const f=e.icon(o);f!==null&&c.push(r.h(ce,{name:f}))}return e.class&&(typeof e.class=="function"?u(e.class(o)):u(e.class)),S.listCellHandler&&S.listCellHandler(e,o,{cellNodeChildren:c,addClass:u,addHandleClick:s,context:n}),l.push(r.h("td",a,c)),l}function it(e,t){e.emit("select",t)}function Ue(e,t){return()=>{try{return On(e,t)}catch(n){return console.warn(n),null}}}const xn={props:{values:Object,config:Object,selected:Boolean},setup:Ue},$n=["colspan"],at=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:t}){const n=t,o=r.ref();return r.onMounted(()=>{setTimeout(()=>{o.value&&o.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(i,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:o},[r.createElementVNode("td",{colspan:i.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(i.component),r.mergeProps(i.$attrs,{values:i.values,new:i.isNew,onClose:a[0]||(a[0]=s=>n("close")),onSave:a[1]||(a[1]=s=>n("save",s))}),null,16,["values","new"]))],8,$n)],512))}}),Bn={class:"widget-table"},st="update:selectedRows",Fn="update:activeRow",kt=r.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{},shortcut:{type:Boolean,default:!1},useMockField:{type:Boolean,default:!1}},emits:["save","order"],setup(e,{emit:t}){const n=e,o=t,i=r.useSlots(),a=r.computed(()=>{var d;return(d=i==null?void 0:i.default)==null?void 0:d.call(i)[0]});function s(d){return n.useMockField?gt(d):d}function u(d,w=!0){if(!n.selectedRows)return;if(!w)return o(st,n.selectedRows.includes(d)?[]:[d]);const m=[...n.selectedRows],k=m.indexOf(d);return k===-1?m.push(d):m.splice(k,1),o(st,m)}function l(d){o(Fn,d)}function c(d){o("save",d),o("update:activeRow",null)}const f=r.computed(()=>n.shortcut?n.config.filter(d=>d.name?!!n.array.find(m=>![null,""].includes(je(d,m))):!0):n.config),g=r.computed(()=>n.useMockField?n.array.filter(gt):n.array);return(d,w)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Bn,[r.createElementVNode("thead",null,[r.createVNode(hn,{config:f.value,onOrder:w[0]||(w[0]=m=>d.$emit("order",m))},{default:r.withCtx(m=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(d.$slots["head-cell"]||wt),r.normalizeProps(r.guardReactiveProps(m)),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(g.value,(m,k)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:k},[r.createVNode(xn,{config:f.value,values:m,selected:d.selectedRows.includes(s(m)),onSelect:b=>u(s(m),b),onActivate:b=>l(s(m)),class:r.normalizeClass(d.classCallback?d.classCallback(m):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&d.activeRow===s(m)?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":d.config.length,values:m,onClose:w[1]||(w[1]=b=>o("update:activeRow",null)),onSave:c,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),d.activeRow===r.unref(_).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(at,{key:0,component:a.value,"row-length":f.value.length,onClose:w[2]||(w[2]=m=>o("update:activeRow",null)),onSave:c,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Dn=r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${t.color}`})},null,4))}}),de=U(Dn,[["__scopeId","data-v-0ef9ae88"]]),Pn={class:"widget-button"},Vn=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",Pn,[t.wait?(r.openBlock(),r.createBlock(de,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Mn=U(Vn,[["__scopeId","data-v-450dc564"]]),jn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Un={class:"widget-multi-button-body grid"},Wn=["onClick"],qn={class:"widget-multi-button-side-wrap"},Gn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(s=>({"04895bf1":o.value}));const t=e,n=r.reactive({active:!1,wait:!1}),o=r.computed(()=>t.array.length+(t.label?1:0));function i(s){if(!(typeof s!="function"||n.wait))return n.wait=!0,Promise.resolve().then(s).finally(()=>{n.wait=!1})}function a(s=!n.active){n.active=s}return(s,u)=>(r.openBlock(),r.createElementBlock("div",jn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Un,[s.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:u[0]||(u[0]=l=>a())},r.toDisplayString(s.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(l,c)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:c,onClick:f=>{i(l.callback),a(!1)}},r.toDisplayString(l.label),9,Wn))),128))]),r.createElementVNode("div",qn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:u[1]||(u[1]=l=>a())},[n.wait?(r.openBlock(),r.createBlock(r.unref(de),{key:0,class:"widget-multi-button-side-spinner"})):s.array.length>1?(r.openBlock(),r.createBlock(r.unref(ce),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),zn=U(Gn,[["__scopeId","data-v-d43a76ce"]]),Hn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Xn={class:"text_md"},Jn=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Hn,[r.createVNode(de,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Xn,r.toDisplayString(t.label),1)]))}}),Yn=["alt","src"],Kn=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const t=e,n=r.ref();return r.onMounted(()=>{n.value&&(n.value.src=t.src),n.value.onerror=function(){t.default&&(n.value.src=t.default)}}),(o,i)=>(r.openBlock(),r.createElementBlock("img",{alt:o.alt,ref_key:"refImage",ref:n,src:o.src||o.$props.default},null,8,Yn))}}),Qn={props:{config:Array,values:Object,selected:Boolean},setup:Ue},Zn=U(Qn,[["__scopeId","data-v-344a8cc1"]]),er=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),tr={class:"widget-list-head-cell"},nr=er(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),rr=r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:t}){const n=e,o=t;return n.title&&console.warn(`For cell ${n.name} using title,it should be replaced with label.`),(i,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",tr,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":i.minWidth,"max-width":i.maxWidth,width:i.width})},[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(D.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(s=>o("select"),["stop","prevent"]))})):(r.openBlock(),r.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:a[1]||(a[1]=s=>o("order"))},r.toDisplayString(i.title||i.label),1))],4),i.name&&i.order.length&&i.order[0]===i.name?(r.openBlock(),r.createBlock(r.unref(ce),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":i.order.length>1&&i.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),nr])]))}}),or=U(rr,[["__scopeId","data-v-bf495d6a"]]),ir=r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:t}){const n=e,o=t,i=r.ref(),a=r.ref();r.onMounted(()=>{function c(m,k){let b=-1;do b++,k-=m[b];while(k>0&&b<m.length);return b}function f(m,k){let b=0;for(;k>0&&k>m[b]&&b<m.length;)k-=m[b],b++;return console.log(k,b),b>0?b:0}function g(m){try{a.value.style.insetInlineStart=m+"px"}catch(k){console.log(k)}}function d(m){try{a.value.style.width=m+"px",a.value.style.minWidth=m+"px",a.value.style.maxWidth=m+"px"}catch(k){console.log(k)}}function w(m){return m===null?!1:m.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(k){var O;function b(F){return F.screenX+E-B}const h=i.value,y=[...h.children].filter(F=>F.localName==="th"),E=((O=h.offsetParent)==null?void 0:O.scrollLeft)||0,C=y.map(F=>F.clientWidth),x=w(k.target),B=h.getBoundingClientRect().left,p=b(k),v=c(C,p),T=C.slice(0,v).reduce((F,M)=>F+M,0),A=p-T,N=h.offsetWidth,G=y[v].clientWidth;if(n.config[v].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",k.screenX),console.log("Widths",C),console.log("max width",N),console.log("Start Position",p),console.log("Position From",v),console.log("Start Position",v),console.log("Global offset (Отступ самой таблицы от края экрана)",B),console.log("Del",A),console.groupEnd(),a.value.innerText=y[v].textContent||"",a.value.style.display="grid",a.value.style.width=G+"px",a.value.style.cursor="grabbing",g(T),d(G),document.addEventListener("pointermove",W,{passive:!0}),document.addEventListener("pointerup",K);function K(F){if(console.group("END"),document.removeEventListener("pointermove",W),document.removeEventListener("pointerup",K),x&&(n.config[v].width=a.value.style.width,n.config[v].minWidth=a.value.style.width,n.config[v].maxWidth=a.value.style.width,s(n.config)),!x){const M=F.screenX+E-B;console.log("ENP Position",M);const ye=f(C,M);if(console.log(v,"->",ye),ye!==v){const pe=n.config[v],Le=n.config;Le.splice(v,1),Le.splice(ye,0,pe),s(Le)}else{const pe=n.config[v].name;u(pe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function W(F){if(x){const pe=b(F)-p+G;d(pe);return}let M=F.screenX+E-B-A;M<0&&(M=0),M+G>N&&(M=N-G),g(M)}})});function s(c){o("update:config",c)}function u(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(n.order.length===0||n.order[0]!==c)return void l([c]);const f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";l([c,f==="asc"?"desc":"asc"])}function l(c){o("update:order",c)}return(c,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.config,(g,d)=>(r.openBlock(),r.createBlock(or,r.mergeProps({key:g,ref_for:!0},g,{onOrder:w=>u(g.name),onSelect:f[0]||(f[0]=w=>o("select")),order:c.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),ar=U(ir,[["__scopeId","data-v-ccffc6bd"]]),sr={class:"widget-list"},lr={class:"widget-list-body position_relative"},cr=50,ur=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:t}){const n=e,o=t;function i(l,c=!0){if(n.selectedRows)if(!c)s(n.selectedRows.includes(l)?[]:[l]);else{const f=[...n.selectedRows],g=f.indexOf(l);g===-1?f.push(l):f==null||f.splice(g,1),s(f)}}function a(){var l;if(((l=n.selectedRows)==null?void 0:l.length)!==n.array.length)return s([...n.array]);s([])}function s(l){o("update:selectedRows",l)}function u(l){if(!l)return;const c=l.target;c.scrollTop+c.clientHeight+cr>c.scrollHeight&&o("scrollEnd")}return(l,c)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:u},[r.createElementVNode("table",sr,[r.createElementVNode("thead",null,[r.createVNode(ar,{onSelect:c[0]||(c[0]=f=>a()),"onUpdate:order":c[1]||(c[1]=f=>o("update:order",f)),"onUpdate:config":c[2]||(c[2]=f=>o("update:config",f)),config:l.config,order:l.order},null,8,["config","order"])]),r.createElementVNode("tbody",lr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(f,g)=>{var d;return r.openBlock(),r.createBlock(Zn,{key:g,class:"widget-list-row",values:f,config:l.config,selected:(d=l.selectedRows)==null?void 0:d.includes(f),onSelect:w=>i(f,w)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function We(){var a;const e=r.computed(()=>Object.keys(n).length===0||Object.values(n).includes(!0)),t=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!t)throw"Undefined instance. Please check it.";const n=r.reactive({});r.provide(_.VISIBLE_ITEM_PROVIDE_NAME,{show(s){n[s]=!0},hide(s){n[s]=!1},remove(s){delete n[s]}});const o=r.inject(_.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){o==null||o.show(t)},hide(){o==null||o.hide(t)},remove(){o==null||o.remove(t)}},visibleItems:n}}const fr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{}},setup(e){const t=e,n=Oe(),o=Ke(),i=r.computed(()=>{var k,b;const d=l.value,w=c(d),m={type:w,disabled:!((k=u.value)!=null&&k.canSet),label:t.label};return d&&Object.assign(m,{suffix:w==="number"?d.valueUnit:void 0,required:s.includes(w||"")?!1:d.required,label:t.label||d.displayName}),Object.assign(m,((b=S.fieldParamsHandler)==null?void 0:b.call(S,d,u.value,m))||{}),m}),a=["MultiText","MultiWideText"],s=["switch","single-checkbox","single-radio"],u=r.computed(()=>{var d;return(d=o==null?void 0:o.value)==null?void 0:d.fields[t.name]}),l=r.computed(()=>{if(!n.value)return;const d=n.value.fieldsByName[t.name];if(d)return d});function c(d){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(d){if(d.type==="Reference"||d.type==="Owned")return d.referencedEntity;if(d.dataType==="Boolean")return"single-checkbox";if(d.dataType==="DateTime")return"date";if(d.dataType==="Integer"||d.dataType==="Decimal")return"number";if(d.dataType==="List")return d.aggregatedEntity;if(a.includes(d.presentationType))return"textarea";if(d.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var d;return((d=u.value)==null?void 0:d.canGet)===!0}),{controller:g}=We();return r.watch(()=>f.value,d=>d?g.show():g.hide(),{immediate:!0}),r.onUnmounted(()=>g.remove()),(d,w)=>f.value?(r.openBlock(),r.createBlock(r.unref(D.FormField),r.mergeProps({key:0},{...d.$attrs,...i.value},{name:d.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function dr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||_.DEFAULT_ORDER_DIR}const pr=["fill"],gr=r.createElementVNode("path",{d:"M440-647 244-451q-12 12-28 11.5T188-452q-11-12-11.5-28t11.5-28l264-264q6-6 13-8.5t15-2.5q8 0 15 2.5t13 8.5l264 264q11 11 11 27.5T772-452q-12 12-28.5 12T715-452L520-647v447q0 17-11.5 28.5T480-160q-17 0-28.5-11.5T440-200v-447Z"},null,-1),mr=[gr],hr=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},mr,8,pr))}}),vr={class:"widget-fast-table-head-cell-td"},yr={class:"widget-head-cell-label"},wr={key:0,class:"widget-head-cell-order"},br=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{}},setup(e){const t=e,n=r.computed(()=>Me(t.name));return r.computed(()=>dr(t.order)),(o,i)=>{var a;return r.openBlock(),r.createElementBlock("td",vr,[r.createElementVNode("div",{class:"widget-head-cell",onClick:i[0]||(i[0]=s=>o.$emit("order",o.name))},[r.createElementVNode("span",yr,r.toDisplayString(o.label),1),n.value===((a=o.order)==null?void 0:a[0])?(r.openBlock(),r.createElementBlock("div",wr,[r.createVNode(hr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${o.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)])])}}}),Tt=U(br,[["__scopeId","data-v-9db5d417"]]),Er=["fill"],kr=r.createElementVNode("path",{d:"M480-361q-8 0-15-2.5t-13-8.5L268-556q-11-11-11-28t11-28q11-11 28-11t28 11l156 156 156-156q11-11 28-11t28 11q11 11 11 28t-11 28L508-372q-6 6-13 8.5t-15 2.5Z"},null,-1),Tr=[kr],Cr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:t.color},Tr,8,Er))}}),_r={class:"widget-filter-item-popup"},Ar=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=S.tableFilterEntityBind,a=r.ref(),s=r.computed(()=>{const w=n.filterItem;return w.entity?"Entity":w.type?w.type:null});function u(w){l.value=w==="start"}const l=r.ref(!1),c=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),f=r.ref(!1);let g=null;function d(w=!f.value){f.value=w,!f.value&&g?(g(),g=null):a.value&&(g=D.utils.clickOutside(a.value,d.bind(null,!1)))}return(w,m)=>{var k;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:"widget-filter-item",onClick:m[0]||(m[0]=()=>d())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":c.value}])},r.toDisplayString(w.filterItem.label||"--"),3),l.value?(r.openBlock(),r.createBlock(de,{key:0})):(r.openBlock(),r.createBlock(Cr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))]),r.withDirectives(r.createElementVNode("div",_r,[s.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((k=r.unref(i))==null?void 0:k[s.value]),{key:0,"field-metadata":w.filterItem,values:w.values,"onUpdate:values":m[1]||(m[1]=b=>o("update:values",b)),onReadProcess:u},null,40,["field-metadata","values"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.value]])],512)}}}),Ct=U(Ar,[["__scopeId","data-v-5b9128bc"]]),Sr={class:"widget-table-panel-filter flex"},Ir=r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:t}){const n=e,o=t;function i(a,s){o("update:filters",{...n.filters,[a]:s})}return(a,s)=>(r.openBlock(),r.createElementBlock("div",Sr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(u,l)=>{var c;return r.openBlock(),r.createBlock(Ct,{key:l,entity:a.entity,"filter-item":u,values:(c=a.filters)==null?void 0:c[r.unref(me)(u)],"onUpdate:values":f=>i(r.unref(me)(u),f)},null,8,["entity","filter-item","values","onUpdate:values"])}),128))]))}}),Nr=U(Ir,[["__scopeId","data-v-f1534314"]]),Rr={class:"es-grid es-gap-15"},Or={key:0,class:"title-md color-primary margin-0"},Lr={key:0,class:"widget-table-loader es-flex es-gap-10 es-flex-align-center es-padding-10 text-main"},xr=r.createElementVNode("span",null,"Loading...",-1),$r={class:"widget-fast-table-tools es-flex es-gap-15"},Br={class:""},Fr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{}},setup(e){const t=e,n=Ve.useRouter(),o=r.ref([]),i=r.ref(null),a=r.ref(null),s=r.ref(null),u=D.Form.getParentForm();Oe(t.entity);const{state:l,update:c}=Ke(t.entity,{masterEntities:t.masterEntities||[]}),f=(t.actions||[]).map(p=>xt(p)),g=r.computed(()=>i.value?Jt(t.entity,i.value.config):[]),d=r.computed(()=>{var p;return((p=i.value)==null?void 0:p.displayItem)||Ye.inline}),w=r.computed(()=>{var p;return((p=i.value)==null?void 0:p.newItem)||d.value}),m=Te(async()=>{try{await b.call(),await c()}catch(p){const{message:v}=Ge(p);a.value=v}});u instanceof D.Form&&u.subscribe({read:m.call.bind(null),name:t.entity,type:"table"}),r.onMounted(()=>{k.call(),m.call()});const k=Te(async function(){const v=t.entity;i.value=await Nt(v,t.mark)}),b=Te(async function(){var T,A,N;const v=t.entity;a.value=null,k.promise&&await k.promise,console.log(i.value),o.value=(await ue(v,{customFilters:((T=i.value)==null?void 0:T.customFilters)||[],fields:At(g.value).join(" "),order:((A=i.value)==null?void 0:A.order)||[],filter:L.and(L(B.value),L(t.binding||{}),L(((N=i.value)==null?void 0:N.prefilters)||{}))})).map(ci)});async function h(p){var T;if(p===null)return s.value=null;const v=p==null?void 0:p.Id;if(!v&&((T=i.value)!=null&&T.linkNew))return n.push(i.value.linkNew);if(d.value==="form")return n.push(Je(t.entity,v));if(d.value==="inline")return s.value=p||_.LIST_ACTIVE_NEW;d.value==="modal"?(await re.promptModal("form",{entity:t.entity,id:v}),await b.call()):s.value=_.LIST_ACTIVE_NEW}const{controller:y}=We();r.watch(()=>l.value,p=>{p&&(p.canRead?y.show():y.hide())},{immediate:!0}),r.onUnmounted(()=>y.remove());const E=[{icon:"reload",label:"Reload",callback(){m.call()}}];let C=[he.on("affected-entity",p=>{p.name===t.entity&&b.call()}),he.on("display-entity",async p=>{p.name===t.entity&&(b.promise&&await b.promise,s.value=o.value.find(v=>v.Id===p.id)||null)})];r.onUnmounted(()=>C.map(p=>p()));function x(p){var K;function v(W){return Array.isArray(W)?v(W[0]):typeof W!="string"?null:W}const T=v(p);if(!T)return;const A=((K=i.value)==null?void 0:K.order)||[];(W=>{if(i.value)return i.value.order=W,!0})(A[0]!==T?[T,"asc"]:A[1]==="desc"?[]:[T,"desc"])&&b.call()}const B=r.ref({});return r.watch(()=>B.value,()=>b.call()),(p,v)=>{var N,G,K,W;const T=r.resolveComponent("widget-button"),A=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Rr,[(N=i.value)!=null&&N.label?(r.openBlock(),r.createElementBlock("p",Or,r.toDisplayString((G=i.value)==null?void 0:G.label),1)):r.createCommentVNode("",!0),r.createVNode(r.Transition,{name:"slide-up"},{default:r.withCtx(()=>[r.unref(m).wait||r.unref(k).wait||r.unref(b).wait?(r.openBlock(),r.createElementBlock("div",Lr,[r.createVNode(r.unref(de),{color:"var(--color-primary)"}),xr])):r.createCommentVNode("",!0)]),_:1}),r.createElementVNode("div",$r,[w.value==="form"||(K=r.unref(l))!=null&&K.canCreate?(r.openBlock(),r.createBlock(T,{key:0,callback:h,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(" Add New ")]),_:1})):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(r.unref(f).filter(O=>!!O.value),O=>{var F;return r.openBlock(),r.createBlock(T,{callback:(F=O.value)==null?void 0:F.callback,type:"primary"},{default:r.withCtx(()=>{var M;return[r.createTextVNode(r.toDisplayString((M=O.value)==null?void 0:M.label),1)]}),_:2},1032,["callback"])}),256)),(r.openBlock(),r.createElementBlock(r.Fragment,null,r.renderList(E,O=>r.createVNode(T,{onClick:()=>O.callback,callback:O.callback},{default:r.withCtx(()=>[r.createVNode(ce,null,{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(O.icon),1)]),_:2},1024),r.createElementVNode("span",null,r.toDisplayString(O.label),1)]),_:2},1032,["onClick","callback"])),64))]),r.createElementVNode("div",Br,[r.createVNode(Nr,{entity:p.entity,"filters-config":((W=i.value)==null?void 0:W.filters)||[],filters:B.value,"onUpdate:filters":v[0]||(v[0]=O=>B.value=O)},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(kt),{config:g.value,array:o.value,"active-row":s.value,"onUpdate:activeRow":h,onOrder:x,class:"table"},{"head-cell":r.withCtx(O=>{var F;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.$slots["head-cell"]?p.$slots["head-cell"]:Tt),r.mergeProps({label:O.label},O,{onOrder:x,order:((F=i.value)==null?void 0:F.order)||[]}),null,16,["label","order"]))]}),default:r.withCtx(()=>{var O;return[r.createVNode(A,{entity:p.entity,id:(O=s.value)==null?void 0:O.Id,"master-entities":p.masterEntities||void 0,binding:p.binding,onFormUpdate:v[1]||(v[1]=()=>{s.value=null,r.unref(b).call()})},null,8,["entity","id","master-entities","binding"])]}),_:1},8,["config","array","active-row"])])])}}});function _t(e){return qe(e,"YYYY/MM/DD HH:mm:ss")}function qe(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return Zt.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function Te(e){function t(...o){if(n.wait)return Promise.reject("The process has already started.");n.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{n.wait=!1,n.promise=null});return n.promise=i,i}const n=r.reactive({wait:!1,call:t,promise:null});return n}function Ge(e){return typeof e=="string"?we(e):Dr(e)?we(e.message,e.children||e.details||[]):Pr(e)?we(e.title,[e.detail||""]):we(_.DEFAULT_ERROR_MESSAGE)}function Dr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Pr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function we(e,t=[]){return{message:e,children:t}}function V(e="error"){return function(t){const{message:n,children:o}=Ge(t);Qe.add(e,n,{children:o})}}function ue(e,t={}){return $().emit("entity:read",{...t,entity:e})}function ze(e,t){return $().emit("entity:update",{...t,entity:e})}function At(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function St(e,t=2){if(!(typeof e=="string"||typeof e=="number"))return"";let o=String(e).split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),o.length<2&&(o[1]=""),o[1]=o[1].padEnd(t,"0"),o[1].length>t&&(o[1]=o[1].substring(0,t)),o.join(".")}function Vr(e,t){const n=new Map;return e.forEach(o=>{var a;const i=t(o);n.has(i)||n.set(i,[]),(a=n.get(i))==null||a.push(o)}),n}function Mr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function jr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return _.DEFAULT_ERROR_MESSAGE}})}function j(e,t={}){return z.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=z.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(_.DEFAULT_ERROR_MESSAGE)}).then(n=>jr(n).then(o=>{if(!n.ok)throw o;return o}))}function Ur(e,t=1e3){let n=0;return(...o)=>{clearTimeout(n),n=window.setTimeout(()=>e(...o),t)}}function Wr(e,t){let n=!1;return(...o)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...o)}}const qr=Ie(Ne("pretty-value-field-by-entity"));function Gr(e,t,n){try{const o=Ae.get(e);if(!o)throw new Error("For entity metadata is not loaded");const i=o.fieldsByName[t];if(!i)throw new Error(`For entity ${e} can't found fieldMetadata for field ${t}`);return i.dataType==="DateTime"&&typeof n=="string"?new Date(n).toLocaleString():n}catch(o){return qr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,t,n),n}}const te=Ie(Ne("use-socket"));function $(){return Hr}function zr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Hr=function(){let e=1,t,n;const o=new Set;let i=0;const a=new Set;function s(){if(t)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{t.close()},bn*2);const h=new Uint8Array(1);h[0]=wn,t.send(h)}setInterval(()=>{Array.from(o).forEach(h=>{b(h)&&(te("Handler for event %s requestId %d was expired",h.event,h.requestId),h.requestId?l({requestId:h.requestId,event:bt,data:{message:Z.RequestTookToLong().message}}):o.delete(h))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&c()},_.DELAY_SOCKET_RECONNECT);function u(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function l(h){const y=[...o.values()];te("Handlers array length is %d. Response event: %s. Request id: %d",o.size,h.event,h.requestId),y.forEach(E=>{const C=h.requestId;(E.requestId&&E.requestId===C||!E.requestId&&E.event===h.event)&&(te("Find appropriated handler: %d, event: %s",e,E.event),E.callback(h.data,h),E.once&&(o.delete(E),te("Handler was removed by *once* params was passed. %o",E)))})}function c(){if(typeof n!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${n}`,"color: purple","color: black"),t=new WebSocket(n),t.onclose=function(h){te("Connection to server was stopped: %d %s",h.code,h.reason),Array.from(o).forEach(y=>{y.guaranteedAnswer&&y.serializeString&&a.add(y.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(h=>{f(h),a.delete(h)})},t.onerror=function(h){console.warn(h)},t.onmessage=h=>{var y;try{if(zr(h.data)){s();return}const E=JSON.parse(h.data);if(!It(E)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(E);return}(y=E==null?void 0:E.data)!=null&&y.refresh&&location.reload(),l(E)}catch(E){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(E)}}}function f(h){t.send(h)}function g(h,y){k({event:h,callback:y})}function d(h,y){k({event:h,callback:y,once:!0})}function w(){return t&&(t==null?void 0:t.readyState)===1}function m(h,y,E){const C=++e,x=JSON.stringify({requestId:C,event:h,data:y,contextId:z.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return w()?f(x):(a.add(x),te("Socket is not connected. Message was send to save-queue")),new Promise((B,p)=>{k({event:h,requestId:C,once:!0,guaranteedAnswer:!0,serializeString:x,callback:(v,T)=>{if(te("Promise was resolve with next data:",v),Xr(T))return void p(v);E&&E(v,T),B(v)},timeToLive:_.TIME_TO_LIVE_SOCKET_REQUEST})})}function k(h){const y={timeToLive:0,...h,created:new Date().getTime()};o.add(y)}function b(h){return h.timeToLive===0||typeof h.timeToLive!="number"?!1:new Date().getTime()-h.created>h.timeToLive}return{get socket(){return t},on:g,once:d,emit:m,initialization(h){n=h},getDevInfo:u}}(),Xr=e=>!!It(e)&&e.event===bt,It=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function Nt(e,t){return $().emit("list-setting:read",{entity:e,mark:t})}function Jr(e,t){return $().emit("metadata-field:treat",{entity:e,fieldName:t})}function Rt(e,t){return $().emit("entity:create",{...t,entity:e})}function Ot(e,t){return $().emit("entity:delete",{...t,entity:e})}function Yr(e,t){return $().emit("usage-context:read",{...t,entity:e})}function Lt(e={}){return $().emit("tool:read",e)}function Kr(){return $().emit("metadata-list:read",{})}function xt(e,t={},n={}){const o=r.inject(_.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var l;const u=((typeof e=="string"?(l=o==null?void 0:o.actions)==null?void 0:l.value:r.unref(e))||[]).find(c=>c.name===i);return u?{...u,...a}:null})}function Qr(e){return $().emit("history:read",e)}function Zr(e,t){return $().emit("entity:count",{...t,entity:e})}function eo(e){return`/${En}/${e}`}function fe(e){return{exec(t,n){switch(e.name){case"replace-boolean":return fe.replaceBoolean(t,e.values);case"replace-record-operation":return fe.replaceRecordOperation(t)}}}}fe.replaceBoolean=to;fe.replaceRecordOperation=no;function to(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function no(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function ro(e={}){return $().emit("tool:execute",e)}const oo=Ie(Ne("wrap-tool-response"));function $t(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=so),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=co),e.handleCloseForm===void 0&&(e.handleCloseForm=uo),e.handleValidationResult===void 0&&(e.handleValidationResult=lo),{...t,label:t.title,callback(){var i;const n=typeof e.values=="function"?e.values(t,e):e.values,o=()=>ro({name:t.name,values:n,usageContext:t.usageContext}).then(async a=>{var s,u;if(!io(a))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const l of e.handlers)await l(t,a,e);if(!a.success)throw e.handleValidationResult&&a.validationEffect&&((u=(s=a.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(t,a.validationEffect,e),new Error(a.message);return a.message&&Qe.add("info",a.message),Array.isArray(a.affectedEntities)&&e.handleAffectedEntity&&a.affectedEntities.forEach(l=>{var c;return(c=e.handleAffectedEntity)==null?void 0:c.call(e,t,l,e)}),t.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(t,e),a}).catch(V("error"));return(i=e.overrides)!=null&&i[t.name]?e.overrides[t.name](t,e):t.requireSave&&e.form&&e.form.changed?e.form.save().then(o):!t.confirmation||!e.handleConfirmation?o():e.handleConfirmation(t,o)}}}function io(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function ao(e){const t="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?t:typeof e=="string"?e:t}async function so(e,t){const n=ao(e.confirmation);if(!re.getComponentFromStore(_.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await re.promptModal(_.MODAL_CONFIRM,{message:n}))return t()}function lo(e,t){const n=_.MODAL_VALIDATION_EFFECT;if(!re.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{re.pushModal(n,t)})}function co(e,t,n){var l;function o(c){return c!==null&&typeof c=="object"&&typeof c.read=="function"}function i(c,f){c&&(oo("Affected Entity %s. Find form with name %s.",f,c.name),c.name===f&&o(c)&&c.read(),c instanceof D.Form&&c.dependencies.forEach(g=>i(g,f)))}he.emit("affected-entity",t);const{router:a,form:s}=n,u=(l=t.primaryKey)==null?void 0:l.Id;if(a&&t&&t.name===e.redirectEntity){he.emit("display-entity",{id:u,name:t.name}),S.getEntityLink&&a.push(S.getEntityLink(t.name,u));return}i(s,t.name)}function uo(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}let ne={};function ee(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=D.utils.getPropFromObject((this==null?void 0:this.vocabulary)||ne,e);if(typeof n=="string")return lt(n,t);const o=D.utils.getPropFromObject(ne==null?void 0:ne.root,e);return typeof o=="string"?lt(o,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function lt(e,t){return t.forEach((n,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),e}ee.setGlobalVocabulary=function(e){ne=e};ee.getScope=function(e){const t=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),ee.bind({vocabulary:D.utils.getPropFromObject(ne,t.toLowerCase())})};ee.setVocabulary=function(e){return typeof e=="string"&&(e=D.utils.getPropFromObject(ne,e)),ee.bind({vocabulary:e})};function fo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Be={exports:{}},R={},Fe={exports:{}},oe={};function Bt(){var e={};return e["align-content"]=!1,e["align-items"]=!1,e["align-self"]=!1,e["alignment-adjust"]=!1,e["alignment-baseline"]=!1,e.all=!1,e["anchor-point"]=!1,e.animation=!1,e["animation-delay"]=!1,e["animation-direction"]=!1,e["animation-duration"]=!1,e["animation-fill-mode"]=!1,e["animation-iteration-count"]=!1,e["animation-name"]=!1,e["animation-play-state"]=!1,e["animation-timing-function"]=!1,e.azimuth=!1,e["backface-visibility"]=!1,e.background=!0,e["background-attachment"]=!0,e["background-clip"]=!0,e["background-color"]=!0,e["background-image"]=!0,e["background-origin"]=!0,e["background-position"]=!0,e["background-repeat"]=!0,e["background-size"]=!0,e["baseline-shift"]=!1,e.binding=!1,e.bleed=!1,e["bookmark-label"]=!1,e["bookmark-level"]=!1,e["bookmark-state"]=!1,e.border=!0,e["border-bottom"]=!0,e["border-bottom-color"]=!0,e["border-bottom-left-radius"]=!0,e["border-bottom-right-radius"]=!0,e["border-bottom-style"]=!0,e["border-bottom-width"]=!0,e["border-collapse"]=!0,e["border-color"]=!0,e["border-image"]=!0,e["border-image-outset"]=!0,e["border-image-repeat"]=!0,e["border-image-slice"]=!0,e["border-image-source"]=!0,e["border-image-width"]=!0,e["border-left"]=!0,e["border-left-color"]=!0,e["border-left-style"]=!0,e["border-left-width"]=!0,e["border-radius"]=!0,e["border-right"]=!0,e["border-right-color"]=!0,e["border-right-style"]=!0,e["border-right-width"]=!0,e["border-spacing"]=!0,e["border-style"]=!0,e["border-top"]=!0,e["border-top-color"]=!0,e["border-top-left-radius"]=!0,e["border-top-right-radius"]=!0,e["border-top-style"]=!0,e["border-top-width"]=!0,e["border-width"]=!0,e.bottom=!1,e["box-decoration-break"]=!0,e["box-shadow"]=!0,e["box-sizing"]=!0,e["box-snap"]=!0,e["box-suppress"]=!0,e["break-after"]=!0,e["break-before"]=!0,e["break-inside"]=!0,e["caption-side"]=!1,e.chains=!1,e.clear=!0,e.clip=!1,e["clip-path"]=!1,e["clip-rule"]=!1,e.color=!0,e["color-interpolation-filters"]=!0,e["column-count"]=!1,e["column-fill"]=!1,e["column-gap"]=!1,e["column-rule"]=!1,e["column-rule-color"]=!1,e["column-rule-style"]=!1,e["column-rule-width"]=!1,e["column-span"]=!1,e["column-width"]=!1,e.columns=!1,e.contain=!1,e.content=!1,e["counter-increment"]=!1,e["counter-reset"]=!1,e["counter-set"]=!1,e.crop=!1,e.cue=!1,e["cue-after"]=!1,e["cue-before"]=!1,e.cursor=!1,e.direction=!1,e.display=!0,e["display-inside"]=!0,e["display-list"]=!0,e["display-outside"]=!0,e["dominant-baseline"]=!1,e.elevation=!1,e["empty-cells"]=!1,e.filter=!1,e.flex=!1,e["flex-basis"]=!1,e["flex-direction"]=!1,e["flex-flow"]=!1,e["flex-grow"]=!1,e["flex-shrink"]=!1,e["flex-wrap"]=!1,e.float=!1,e["float-offset"]=!1,e["flood-color"]=!1,e["flood-opacity"]=!1,e["flow-from"]=!1,e["flow-into"]=!1,e.font=!0,e["font-family"]=!0,e["font-feature-settings"]=!0,e["font-kerning"]=!0,e["font-language-override"]=!0,e["font-size"]=!0,e["font-size-adjust"]=!0,e["font-stretch"]=!0,e["font-style"]=!0,e["font-synthesis"]=!0,e["font-variant"]=!0,e["font-variant-alternates"]=!0,e["font-variant-caps"]=!0,e["font-variant-east-asian"]=!0,e["font-variant-ligatures"]=!0,e["font-variant-numeric"]=!0,e["font-variant-position"]=!0,e["font-weight"]=!0,e.grid=!1,e["grid-area"]=!1,e["grid-auto-columns"]=!1,e["grid-auto-flow"]=!1,e["grid-auto-rows"]=!1,e["grid-column"]=!1,e["grid-column-end"]=!1,e["grid-column-start"]=!1,e["grid-row"]=!1,e["grid-row-end"]=!1,e["grid-row-start"]=!1,e["grid-template"]=!1,e["grid-template-areas"]=!1,e["grid-template-columns"]=!1,e["grid-template-rows"]=!1,e["hanging-punctuation"]=!1,e.height=!0,e.hyphens=!1,e.icon=!1,e["image-orientation"]=!1,e["image-resolution"]=!1,e["ime-mode"]=!1,e["initial-letters"]=!1,e["inline-box-align"]=!1,e["justify-content"]=!1,e["justify-items"]=!1,e["justify-self"]=!1,e.left=!1,e["letter-spacing"]=!0,e["lighting-color"]=!0,e["line-box-contain"]=!1,e["line-break"]=!1,e["line-grid"]=!1,e["line-height"]=!1,e["line-snap"]=!1,e["line-stacking"]=!1,e["line-stacking-ruby"]=!1,e["line-stacking-shift"]=!1,e["line-stacking-strategy"]=!1,e["list-style"]=!0,e["list-style-image"]=!0,e["list-style-position"]=!0,e["list-style-type"]=!0,e.margin=!0,e["margin-bottom"]=!0,e["margin-left"]=!0,e["margin-right"]=!0,e["margin-top"]=!0,e["marker-offset"]=!1,e["marker-side"]=!1,e.marks=!1,e.mask=!1,e["mask-box"]=!1,e["mask-box-outset"]=!1,e["mask-box-repeat"]=!1,e["mask-box-slice"]=!1,e["mask-box-source"]=!1,e["mask-box-width"]=!1,e["mask-clip"]=!1,e["mask-image"]=!1,e["mask-origin"]=!1,e["mask-position"]=!1,e["mask-repeat"]=!1,e["mask-size"]=!1,e["mask-source-type"]=!1,e["mask-type"]=!1,e["max-height"]=!0,e["max-lines"]=!1,e["max-width"]=!0,e["min-height"]=!0,e["min-width"]=!0,e["move-to"]=!1,e["nav-down"]=!1,e["nav-index"]=!1,e["nav-left"]=!1,e["nav-right"]=!1,e["nav-up"]=!1,e["object-fit"]=!1,e["object-position"]=!1,e.opacity=!1,e.order=!1,e.orphans=!1,e.outline=!1,e["outline-color"]=!1,e["outline-offset"]=!1,e["outline-style"]=!1,e["outline-width"]=!1,e.overflow=!1,e["overflow-wrap"]=!1,e["overflow-x"]=!1,e["overflow-y"]=!1,e.padding=!0,e["padding-bottom"]=!0,e["padding-left"]=!0,e["padding-right"]=!0,e["padding-top"]=!0,e.page=!1,e["page-break-after"]=!1,e["page-break-before"]=!1,e["page-break-inside"]=!1,e["page-policy"]=!1,e.pause=!1,e["pause-after"]=!1,e["pause-before"]=!1,e.perspective=!1,e["perspective-origin"]=!1,e.pitch=!1,e["pitch-range"]=!1,e["play-during"]=!1,e.position=!1,e["presentation-level"]=!1,e.quotes=!1,e["region-fragment"]=!1,e.resize=!1,e.rest=!1,e["rest-after"]=!1,e["rest-before"]=!1,e.richness=!1,e.right=!1,e.rotation=!1,e["rotation-point"]=!1,e["ruby-align"]=!1,e["ruby-merge"]=!1,e["ruby-position"]=!1,e["shape-image-threshold"]=!1,e["shape-outside"]=!1,e["shape-margin"]=!1,e.size=!1,e.speak=!1,e["speak-as"]=!1,e["speak-header"]=!1,e["speak-numeral"]=!1,e["speak-punctuation"]=!1,e["speech-rate"]=!1,e.stress=!1,e["string-set"]=!1,e["tab-size"]=!1,e["table-layout"]=!1,e["text-align"]=!0,e["text-align-last"]=!0,e["text-combine-upright"]=!0,e["text-decoration"]=!0,e["text-decoration-color"]=!0,e["text-decoration-line"]=!0,e["text-decoration-skip"]=!0,e["text-decoration-style"]=!0,e["text-emphasis"]=!0,e["text-emphasis-color"]=!0,e["text-emphasis-position"]=!0,e["text-emphasis-style"]=!0,e["text-height"]=!0,e["text-indent"]=!0,e["text-justify"]=!0,e["text-orientation"]=!0,e["text-overflow"]=!0,e["text-shadow"]=!0,e["text-space-collapse"]=!0,e["text-transform"]=!0,e["text-underline-position"]=!0,e["text-wrap"]=!0,e.top=!1,e.transform=!1,e["transform-origin"]=!1,e["transform-style"]=!1,e.transition=!1,e["transition-delay"]=!1,e["transition-duration"]=!1,e["transition-property"]=!1,e["transition-timing-function"]=!1,e["unicode-bidi"]=!1,e["vertical-align"]=!1,e.visibility=!1,e["voice-balance"]=!1,e["voice-duration"]=!1,e["voice-family"]=!1,e["voice-pitch"]=!1,e["voice-range"]=!1,e["voice-rate"]=!1,e["voice-stress"]=!1,e["voice-volume"]=!1,e.volume=!1,e["white-space"]=!1,e.widows=!1,e.width=!0,e["will-change"]=!1,e["word-break"]=!0,e["word-spacing"]=!0,e["word-wrap"]=!0,e["wrap-flow"]=!1,e["wrap-through"]=!1,e["writing-mode"]=!1,e["z-index"]=!1,e}function po(e,t,n){}function go(e,t,n){}var mo=/javascript\s*\:/img;function ho(e,t){return mo.test(t)?"":t}oe.whiteList=Bt();oe.getDefaultWhiteList=Bt;oe.onAttr=po;oe.onIgnoreAttr=go;oe.safeAttrValue=ho;var vo={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(e){return String.prototype.trimRight?e.trimRight():e.replace(/(\s*$)/g,"")}},ge=vo;function yo(e,t){e=ge.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,o=!1,i=0,a=0,s="";function u(){if(!o){var f=ge.trim(e.slice(i,a)),g=f.indexOf(":");if(g!==-1){var d=ge.trim(f.slice(0,g)),w=ge.trim(f.slice(g+1));if(d){var m=t(i,s.length,d,w,f);m&&(s+=m+"; ")}}}i=a+1}for(;a<n;a++){var l=e[a];if(l==="/"&&e[a+1]==="*"){var c=e.indexOf("*/",a+2);if(c===-1)break;a=c+1,i=a+1,o=!1}else l==="("?o=!0:l===")"?o=!1:l===";"?o||u():l===`
7
+ `&&u()}return ge.trim(s)}var wo=yo,be=oe,bo=wo;function ct(e){return e==null}function Eo(e){var t={};for(var n in e)t[n]=e[n];return t}function Ft(e){e=Eo(e||{}),e.whiteList=e.whiteList||be.whiteList,e.onAttr=e.onAttr||be.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||be.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||be.safeAttrValue,this.options=e}Ft.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onAttr,a=n.onIgnoreAttr,s=n.safeAttrValue,u=bo(e,function(l,c,f,g,d){var w=o[f],m=!1;if(w===!0?m=w:typeof w=="function"?m=w(g):w instanceof RegExp&&(m=w.test(g)),m!==!0&&(m=!1),g=s(f,g),!!g){var k={position:c,sourcePosition:l,source:d,isWhite:m};if(m){var b=i(f,g,k);return ct(b)?f+":"+g:b}else{var b=a(f,g,k);if(!ct(b))return b}}});return u};var ko=Ft;(function(e,t){var n=oe,o=ko;function i(s,u){var l=new o(u);return l.process(s)}t=e.exports=i,t.FilterCSS=o;for(var a in n)t[a]=n[a];typeof window<"u"&&(window.filterCSS=e.exports)})(Fe,Fe.exports);var He=Fe.exports,Xe={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},To=He.FilterCSS,Co=He.getDefaultWhiteList,_e=Xe;function Dt(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Pt=new To;function _o(e,t,n){}function Ao(e,t,n){}function So(e,t,n){}function Io(e,t,n){}function Vt(e){return e.replace(Ro,"&lt;").replace(Oo,"&gt;")}function No(e,t,n,o){if(n=Gt(n),t==="href"||t==="src"){if(n=_e.trim(n),n==="#")return"#";if(!(n.substr(0,7)==="http://"||n.substr(0,8)==="https://"||n.substr(0,7)==="mailto:"||n.substr(0,4)==="tel:"||n.substr(0,11)==="data:image/"||n.substr(0,6)==="ftp://"||n.substr(0,2)==="./"||n.substr(0,3)==="../"||n[0]==="#"||n[0]==="/"))return""}else if(t==="background"){if(Ee.lastIndex=0,Ee.test(n))return""}else if(t==="style"){if(ut.lastIndex=0,ut.test(n)||(ft.lastIndex=0,ft.test(n)&&(Ee.lastIndex=0,Ee.test(n))))return"";o!==!1&&(o=o||Pt,n=o.process(n))}return n=zt(n),n}var Ro=/</g,Oo=/>/g,Lo=/"/g,xo=/&quot;/g,$o=/&#([a-zA-Z0-9]*);?/gim,Bo=/&colon;?/gim,Fo=/&newline;?/gim,Ee=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,ut=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,ft=/u\s*r\s*l\s*\(.*/gi;function Mt(e){return e.replace(Lo,"&quot;")}function jt(e){return e.replace(xo,'"')}function Ut(e){return e.replace($o,function(n,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Wt(e){return e.replace(Bo,":").replace(Fo," ")}function qt(e){for(var t="",n=0,o=e.length;n<o;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return _e.trim(t)}function Gt(e){return e=jt(e),e=Ut(e),e=Wt(e),e=qt(e),e}function zt(e){return e=Mt(e),e=Vt(e),e}function Do(){return""}function Po(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function o(s){return n?!0:_e.indexOf(e,s)!==-1}var i=[],a=!1;return{onIgnoreTag:function(s,u,l){if(o(s))if(l.isClosing){var c="[/removed]",f=l.position+c.length;return i.push([a!==!1?a:l.position,f]),a=!1,c}else return a||(a=l.position),"[removed]";else return t(s,u,l)},remove:function(s){var u="",l=0;return _e.forEach(i,function(c){u+=s.slice(l,c[0]),l=c[1]}),u+=s.slice(l),u}}}function Vo(e){for(var t="",n=0;n<e.length;){var o=e.indexOf("<!--",n);if(o===-1){t+=e.slice(n);break}t+=e.slice(n,o);var i=e.indexOf("-->",o);if(i===-1)break;n=i+3}return t}function Mo(e){var t=e.split("");return t=t.filter(function(n){var o=n.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),t.join("")}R.whiteList=Dt();R.getDefaultWhiteList=Dt;R.onTag=_o;R.onIgnoreTag=Ao;R.onTagAttr=So;R.onIgnoreTagAttr=Io;R.safeAttrValue=No;R.escapeHtml=Vt;R.escapeQuote=Mt;R.unescapeQuote=jt;R.escapeHtmlEntities=Ut;R.escapeDangerHtml5Entities=Wt;R.clearNonPrintableCharacter=qt;R.friendlyAttrValue=Gt;R.escapeAttrValue=zt;R.onIgnoreTagStripAll=Do;R.StripTagBody=Po;R.stripCommentTag=Vo;R.stripBlankChar=Mo;R.attributeWrapSign='"';R.cssFilter=Pt;R.getDefaultCSSWhiteList=Co;var Re={},Q=Xe;function jo(e){var t=Q.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=Q.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function Uo(e){return e.slice(0,2)==="</"}function Wo(e,t,n){var o="",i=0,a=!1,s=!1,u=0,l=e.length,c="",f="";e:for(u=0;u<l;u++){var g=e.charAt(u);if(a===!1){if(g==="<"){a=u;continue}}else if(s===!1){if(g==="<"){o+=n(e.slice(i,u)),a=u,i=u;continue}if(g===">"||u===l-1){o+=n(e.slice(i,a)),f=e.slice(a,u+1),c=jo(f),o+=t(a,o.length,c,f,Uo(f)),i=u+1,a=!1;continue}if(g==='"'||g==="'")for(var d=1,w=e.charAt(u-d);w.trim()===""||w==="=";){if(w==="="){s=g;continue e}w=e.charAt(u-++d)}}else if(g===s){s=!1;continue}}return i<l&&(o+=n(e.substr(i))),o}var qo=/[^a-zA-Z0-9\\_:.-]/gim;function Go(e,t){var n=0,o=0,i=[],a=!1,s=e.length;function u(d,w){if(d=Q.trim(d),d=d.replace(qo,"").toLowerCase(),!(d.length<1)){var m=t(d,w||"");m&&i.push(m)}}for(var l=0;l<s;l++){var c=e.charAt(l),f,g;if(a===!1&&c==="="){a=e.slice(n,l),n=l+1,o=e.charAt(n)==='"'||e.charAt(n)==="'"?n:Ho(e,l+1);continue}if(a!==!1&&l===o){if(g=e.indexOf(c,l+1),g===-1)break;f=Q.trim(e.slice(o+1,g)),u(a,f),a=!1,l=g,n=l+1;continue}if(/\s|\n|\t/.test(c))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(g=zo(e,l),g===-1){f=Q.trim(e.slice(n,l)),u(f),a=!1,n=l+1;continue}else{l=g-1;continue}else if(g=Xo(e,l-1),g===-1){f=Q.trim(e.slice(n,l)),f=dt(f),u(a,f),a=!1,n=l+1;continue}else continue}return n<e.length&&(a===!1?u(e.slice(n)):u(a,dt(Q.trim(e.slice(n))))),Q.trim(i.join(" "))}function zo(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Ho(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function Xo(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function Jo(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function dt(e){return Jo(e)?e.substr(1,e.length-2):e}Re.parseTag=Wo;Re.parseAttr=Go;var Yo=He.FilterCSS,q=R,Ht=Re,Ko=Ht.parseTag,Qo=Ht.parseAttr,Ce=Xe;function ke(e){return e==null}function Zo(e){var t=Ce.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ce.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=Ce.trim(e.slice(0,-1))),{html:e,closing:n}}function ei(e){var t={};for(var n in e)t[n]=e[n];return t}function ti(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(o){return o.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Xt(e){e=ei(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=q.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=ti(e.whiteList||e.allowList):e.whiteList=q.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":q.attributeWrapSign,e.onTag=e.onTag||q.onTag,e.onTagAttr=e.onTagAttr||q.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||q.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||q.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||q.safeAttrValue,e.escapeHtml=e.escapeHtml||q.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new Yo(e.css))}Xt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onTag,a=n.onIgnoreTag,s=n.onTagAttr,u=n.onIgnoreTagAttr,l=n.safeAttrValue,c=n.escapeHtml,f=t.attributeWrapSign,g=t.cssFilter;n.stripBlankChar&&(e=q.stripBlankChar(e)),n.allowCommentTag||(e=q.stripCommentTag(e));var d=!1;n.stripIgnoreTagBody&&(d=q.StripTagBody(n.stripIgnoreTagBody,a),a=d.onIgnoreTag);var w=Ko(e,function(m,k,b,h,y){var E={sourcePosition:m,position:k,isClosing:y,isWhite:Object.prototype.hasOwnProperty.call(o,b)},C=i(b,h,E);if(!ke(C))return C;if(E.isWhite){if(E.isClosing)return"</"+b+">";var x=Zo(h),B=o[b],p=Qo(x.html,function(v,T){var A=Ce.indexOf(B,v)!==-1,N=s(b,v,T,A);return ke(N)?A?(T=l(b,v,T,g),T?v+"="+f+T+f:v):(N=u(b,v,T,A),ke(N)?void 0:N):N});return h="<"+b,p&&(h+=" "+p),x.closing&&(h+=" /"),h+=">",h}else return C=a(b,h,E),ke(C)?c(h):C},c);return d&&(w=d.remove(w)),w};var ni=Xt;(function(e,t){var n=R,o=Re,i=ni;function a(u,l){var c=new i(l);return c.process(u)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var u in n)t[u]=n[u];for(var l in o)t[l]=o[l]}(),typeof window<"u"&&(window.filterXSS=e.exports);function s(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}s()&&(self.filterXSS=e.exports)})(Be,Be.exports);var ri=Be.exports;const oi=fo(ri);function ii(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),oi(e)}function ai(e,t,n,o){let i=e+t/60+n/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function si(e,t){const n={dir:e<0?t==="long"?"W":"S":t==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${n.deg}° ${n.min}' ${n.sec}" ${n.dir}`}function Je(e,t){return`/forms/${e}/${t}`}function Jt(e,t,n){const o=ee.getScope(e.toLowerCase());return t.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>re.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{re.openModal("form",{entity:pt(i,a),id:a[me(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const s=i.name[0],u=a[s];return u?Je(pt(i,a),u):null},i.value=(a,s)=>s[i.name[1]]),li(i,i.type,i.presentation),S.listConvertCellConfigHandler&&S.listConvertCellConfigHandler(e,i),i))}function li(e,t,n){switch(t){case"DateTime":{e.type="dateWithTime";break}case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const pt=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function gt(e){return typeof e!="object"||e===null?null:e[_.TABLE_MOCK_FIELD]}function ci(e,t){return typeof e!="object"||e===null?(console.warn("cell data is not a valid object."),e):(typeof t=="string"||typeof t=="number"||typeof t=="function"?(typeof t=="function"&&(t=t(e)),e[_.TABLE_MOCK_FIELD]=t):e[_.TABLE_MOCK_FIELD]=e.Id,e)}var Ye=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(Ye||{});function ui(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function fi(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function Yt(e,t){e()&&(await t(),await Yt(e,t))}function di(e,t,n={}){let o=!1;const i=r.ref(""),a=r.computed(()=>s.filter(p=>c(p,i.value))),s=r.reactive([]);let u=0;const l=r.ref(!1);let c=(n==null?void 0:n.filterSearchFn)||((p,v)=>fi(p,v));function f(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function g(){const p=C();return typeof p.limit!="number"&&(p.limit=100),p.offset=u,(n.request||ue)(e,p).then(T=>(u+=T.length,T))}function d(p,v){var A;return typeof p.Version=="number"?p.Version:(A=s.find(N=>N.Id===v))==null?void 0:A.Version}function w(p,v){const T=s.findIndex(A=>A.Id===p);if(T===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(T,1,v)}function m(p){const v=s.findIndex(T=>T.Id===p);if(v===-1)throw new Error(`Can't found item with Id ${p}`);s.splice(v,1)}async function k(p,v){try{const T=C(),A=d(v,p);delete v.Version,await ze(e,{id:p,values:v,version:A,masterEntities:f()});const N=await ue(e,{fields:T.fields||"",id:p});w(p,N)}catch(T){V()(T)}}async function b(p,v={}){try{const T=C(),A=d(v,p);delete v.Version,await Ot(e,{id:p,version:A,masterEntities:f()}),m(p)}catch(T){V()(T)}}async function h(p){try{await Rt(e,{values:p,masterEntities:f()}),await x()}catch(v){V()(v)}}let y;async function E(){l.value=!0;try{y!=null&&y.signal&&!y.signal.aborted&&y.abort();let p=y=new AbortController,v=0;const A=C().limit||0;if(i.value&&!A){console.warn("Using textSearch assumes the use of limit.");return}await Yt(()=>(A>0?v<A:!0)&&!o&&!p.signal.aborted,async()=>{const N=await g();p.signal.aborted||(s.push(...N),v+=N.filter(G=>c(G,i.value)).length,(N.length<A||A===0)&&(o=!0))})}catch(p){V()(p)}l.value=!1}function C(){return typeof t=="function"?t():t}async function x(){try{u=0,o=!1,s.splice(0,s.length),await E()}catch(p){V()(p)}}function B(){if(y)return y.abort();l.value=!1}return{array:s,updateById:k,next:E,reload:x,wait:l,create:h,deleteById:b,textSearch:i,filteredArray:a,abort:B}}function pi(){function e(){return{organizations:z.organizations,currentContextId:z.contextId,person:z.person,context:z.context,contextType:z.contextType,userId:z.userId}}const t=r.reactive(e());return z.onupdateContext(()=>{Object.assign(t,e())}),t}function gi(e,t,n){return $().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function mi(e,t,n){return $().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function hi(e,t){return $().emit("communication-message:create",{communicationId:e,text:t})}function vi(e){return $().emit("communication-message:read",{communicationId:e})}function yi(e){const t=D.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>vi(e.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function wi(e,t){e.read=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ue(e.name,o)}).then(Ze).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(V())},e.save=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw Z.EntityWithoutName(e);return ze(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw V()(i),i})};function n(){return typeof t=="function"?t():t}}function Oe(e){if(!e)return r.inject(_.PROVIDE_NAME_METADATA);Ae.initEntity(e);const t=r.computed(()=>Ae.state[e]);return r.provide(_.PROVIDE_NAME_METADATA,t),t}function Ke(e,t={}){if(!e)return r.inject(_.PROVIDE_NAME_USAGE_CONTEXT);const n=r.ref(null);return r.provide(_.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await Yr(e,bi(t||{}))}}}function bi(e){return typeof e=="function"?e():e}function Ei(e){if(!e)return r.inject(_.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),o=r.computed(()=>n.map(s=>$t(e,s))),i={actions:o,update:a};r.provide(_.PROVIDE_NAME_ACTIONS,i),e.router=Ve.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const s=e==null?void 0:e.form;return Lt({masterEntities:e==null?void 0:e.masterEntities,id:s==null?void 0:s.id,entity:s==null?void 0:s.name}).then(u=>n.splice(0,0,...u)).catch(V("error")).finally(()=>t.value=!1)}return{actions:o,update:a,loading:r.readonly(t)}}function ki(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function Ti(e,t={}){const n=r.reactive([]),o=l=>{const c=r.unref(e);if(l===void 0){n.length===0?c.forEach(a):c.forEach(s);return}i(l)?s(l):a(l)},i=l=>n.includes(l),a=l=>{t.handleSelect&&!t.handleSelect(l)||i(l)||n.push(l)},s=l=>{const c=n.findIndex(f=>f===l);c!==-1&&n.splice(c,1)},u=r.computed(()=>{const l=r.unref(e);return n.length===l.length&&l.length!==0});return[n,o,u,a,s]}function Ci(e){const t=r.ref(""),n=r.computed(()=>{const o=t.value.toLowerCase();return r.unref(e).filter(i=>t.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:t,searchArray:n}}const Qe=new class{constructor(){this.store=r.reactive([])}add(t,n,o={}){const i=_i(o),a=new De(t,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(t){const n=this.store.findIndex(o=>o.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function _i(e){function t(o){return!!o&&typeof o=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const Se=class Se{constructor(t,n,o,i,a){this.type=t,this.message=n,this.timeout=o,this.children=i,this.click=a,this.id=Se.cardId++}};Se.cardId=1;let De=Se;/*!
8
8
  * jenesius-event-emitter v1.0.2
9
9
  * (c) 2022 Jenesius
10
10
  * @license MIT
11
- */const mt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},ht=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},yt=function(e,t){const n=this.events[e];if(!n)return;const o=n.indexOf(t);o!==-1&&n.splice(o,1)},vt=function(){this.events={}};class J{constructor(){this.events={}}on(t,n){return mt.call(this,t,n)}emit(t,n){return ht.call(this,t,n)}off(t,n){return yt.call(this,t,n)}cleanEvents(){vt.call(this)}static on(t,n){return mt.call(J,t,n)}static emit(t,n){return ht.call(J,t,n)}static off(t,n){return yt.call(J,t,n)}static cleanEvents(){vt.call(J)}}J.events={};class Ai extends J{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return hi(this.id,t)}static checkAndGenerate(t,n,o){return mi(t,n,o).then(i=>i.length===0?gi(t,n,o):i[0])}}function Si(){return $().emit("client:read",{})}var le;const X=class X extends J{constructor(){super(...arguments);rt(this,le);this.type="front",this.organizations=[],xe(this,le,!1)}set language(n){localStorage.setItem(_.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(_.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextType(){var n;if(this.contextId)return((n=this.person)==null?void 0:n.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(n){xe(this,le,n),this.emit(X.EVENT_READY_UPDATE,n)}get ready(){return nt(this,le)}onReady(n){return this.on(X.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(X.EVENT_CONTEXT_UPDATE,n)}setCurrentContext(n){if(this.contextId===n)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(n),localStorage.setItem(_.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(n)),this.emit(X.EVENT_CONTEXT_UPDATE,n),console.log(`Current context id %c${n}`,"color: purple")}get context(){var n;return this.contextId?this.contextId===((n=this.person)==null?void 0:n.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const n=await this.loadCustomerData();this.person=n,this.organizations=n.organizations,this.userId=n.userId,this.restoreCurrentContext(),this.ready=!0}catch(n){P()(n)}}restoreCurrentContext(){const n=Number.parseInt(localStorage.getItem(_.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(n)&&this.validateContextId(Number(n)))this.setCurrentContext(n);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Si()}validateContextId(n){var o;try{return((o=this.person)==null?void 0:o.id)==n?!0:!!this.organizations.find(i=>i.id===n)}catch{return!1}}};le=new WeakMap,X.DEFAULT_LANGUAGE="en",X.EVENT_CONTEXT_UPDATE="event:context-update",X.EVENT_READY_UPDATE="event:ready-update";let Pe=X;function Ii(e){return $().emit("metadata:read",{entity:e})}const Ae=function(){const t=r.reactive({}),n=new Map;function o(u){return t[u]}async function i(u){if(n.has(u)&&await n.get(u),t[u])return;const l=await a(u);s(u,l)}function a(u){const l=Ii(u).finally(()=>{n.delete(u)});return n.set(u,l),l}function s(u,l){t[u]=l}return{state:t,initEntity:i,get:o}}();class Ni extends J{on(t,n){return super.on(t,n)}emit(t,n){console.log("[event-bus] emit",t,n),super.emit(t,n)}off(t,n){super.off(t,n)}}class H{static login(t){return j(S.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...t,AppName:S.applicationName})})}static parseProcessAnswer(t){if(t.statusCode>4)throw new Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startRegistrationProcess(t){return H.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return H.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return H.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return H.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return j(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return H.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return H.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return H.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return j(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(H.parseLoginProcessAnswer)}static parseLoginProcessAnswer(t){if(t.statusCode>3)throw Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startPasswordReset(t,n){return j(`${S.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:t})})}static confirmPhoneNumberByAccessRecovery(t,n,o,i){return j(`${S.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(t,n,o,i){return j(`${S.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static finishAccessRecovery(t,n,o){return j(`${S.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:o,ConfirmedPassword:o})})}}class Ri{static readHistoryById(t,n){return j(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Oi{static getConfiguration(){return j("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await j(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Li{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return j(`/open-api/internationalization/language/${t}`)}}class xi{static async upload(t,n){const o=new FormData;return o.append("file",t),j(`/close-api/files?entityName=${n}`,{method:"POST",body:o}).then(i=>(i.filename=t.name,i))}}var Kt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Kt||{}),Qt=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(Qt||{});function $i(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function L(e){return Object.keys(e).reduce((t,n)=>{const o=e[n];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&t.push(`@${n} in (${i})`),t}if($i(o)){let i=function(a){var s;return((s=a.match(/([^Z]*)/))==null?void 0:s[0])+"0000Z"};return o.start&&t.push(`@${n} ge ${i(o.start)}`),o.end&&t.push(`@${n} le ${i(o.end)}`),t}return typeof o=="number"||typeof o=="boolean"?(t.push(`@${n} eq ${o}`),t):typeof o=="string"?(o.length!==0&&t.push(`@${n} eq '${o}'`),t):(o===null&&t.push(L.is(n,o)),t)},[]).join(" and ")}function ye(e){return typeof e=="string"?`'${e}'`:`${e}`}L.includes=function(t,n){return`@${t} Contains ${ye(n)}`};L.beginWith=function(t,n){return`@${t} BeginWith ${ye(n)}`};L.notEq=function(t,n){return`@${t} nq ${ye(n)}`};L.eq=function(t,n){return Array.isArray(n)?L.in(t,n):`@${t} eq ${ye(n)}`};L.in=function(t,n){const o=n.map(ye).join(", ");return`@${t} in (${o})`};L.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":L.and(...n.map(o=>L.notEq(t,o)))};L.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(L.wrap).join(" and ")};L.wrap=function(t){return`(${t})`};L.is=function(t,n){return`@${t} is ${n}`};L.or=function(...t){return t.join(" or ")};function Ze(e){return Object.keys(e).reduce((t,n)=>{let o=e[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Ze(o)),t[i]=o,t},{})}const z=new Pe,he=new Ni;exports.ApplicationStatus=Qt;exports.Communication=Ai;exports.CoreError=Z;exports.DisplayListRow=Ye;exports.EventBus=he;exports.Filter=L;exports.Manager=z;exports.MetadataStore=Ae;exports.NotificationSystem=Qe;exports.OBJECT_TYPE_NAME_FIELD=Et;exports.RecordOperation=Kt;exports.WidgetButton=Mn;exports.WidgetFastTable=Fr;exports.WidgetFastTableHeadCell=Tt;exports.WidgetField=fr;exports.WidgetIcon=ce;exports.WidgetImage=Kn;exports.WidgetList=ur;exports.WidgetLoader=Jn;exports.WidgetMultiButton=zn;exports.WidgetSpinner=de;exports.WidgetTable=kt;exports.WidgetTablePanelFilterItem=Ct;exports.asyncProcess=Te;exports.authService=H;exports.billingService=ie;exports.catchUniversal=P;exports.config=In;exports.configuration=S;exports.constants=_;exports.convertDDToDMS=si;exports.convertDMSToDD=ai;exports.convertListConfig=Jt;exports.debounce=Ur;exports.documentsService=on;exports.fileService=xi;exports.formatter=fe;exports.getCellName=me;exports.getCellValue=je;exports.getEntityLink=Je;exports.getNamesFromListConfig=At;exports.getUnitValue=$e;exports.groupArrayByField=Vr;exports.historyService=Ri;exports.injectAction=xt;exports.internationalizationService=Li;exports.invitationService=rn;exports.openService=Oi;exports.parseError=Ge;exports.parseTextByMarkdown=ii;exports.prettyDate=qe;exports.prettyDateWithTime=_t;exports.prettyMoney=St;exports.prettyValueFieldByEntity=Gr;exports.processWizardService=se;exports.request=j;exports.setupListRow=Ue;exports.staticLink=eo;exports.t=ee;exports.throttle=Wr;exports.universalEntityCount=Zr;exports.universalEntityCreate=Rt;exports.universalEntityDelete=Ot;exports.universalEntityRead=ue;exports.universalEntityUpdate=ze;exports.universalHistoryRead=Qr;exports.universalListSettingRead=Nt;exports.universalMetadataFieldTreat=Jr;exports.universalMetadataListRead=Kr;exports.universalToolRead=Lt;exports.useActions=Ei;exports.useCommunication=vi;exports.useEnter=ki;exports.useFormEntity=wi;exports.useListActiveRow=ui;exports.useListEntity=di;exports.useListSearch=Ci;exports.useListSelect=Ti;exports.useManagerState=pi;exports.useMetadata=Oe;exports.useSocket=$;exports.useUsageContext=Ke;exports.useVisibleItem=We;exports.useWizard=un;exports.uuidv4=Mr;exports.valuesToUpperCase=Ze;exports.wrapToolResponse=$t;
11
+ */const mt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},ht=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},vt=function(e,t){const n=this.events[e];if(!n)return;const o=n.indexOf(t);o!==-1&&n.splice(o,1)},yt=function(){this.events={}};class J{constructor(){this.events={}}on(t,n){return mt.call(this,t,n)}emit(t,n){return ht.call(this,t,n)}off(t,n){return vt.call(this,t,n)}cleanEvents(){yt.call(this)}static on(t,n){return mt.call(J,t,n)}static emit(t,n){return ht.call(J,t,n)}static off(t,n){return vt.call(J,t,n)}static cleanEvents(){yt.call(J)}}J.events={};class Ai extends J{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return hi(this.id,t)}static checkAndGenerate(t,n,o){return mi(t,n,o).then(i=>i.length===0?gi(t,n,o):i[0])}}function Si(){return $().emit("client:read",{})}var le;const X=class X extends J{constructor(){super(...arguments);rt(this,le);this.type="front",this.organizations=[],xe(this,le,!1)}set language(n){localStorage.setItem(_.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(_.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextType(){var n;if(this.contextId)return((n=this.person)==null?void 0:n.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(n){xe(this,le,n),this.emit(X.EVENT_READY_UPDATE,n)}get ready(){return nt(this,le)}onReady(n){return this.on(X.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(X.EVENT_CONTEXT_UPDATE,n)}setCurrentContext(n){if(this.contextId===n)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(n),localStorage.setItem(_.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(n)),this.emit(X.EVENT_CONTEXT_UPDATE,n),console.log(`Current context id %c${n}`,"color: purple")}get context(){var n;return this.contextId?this.contextId===((n=this.person)==null?void 0:n.id)?this.person:this.organizations.find(o=>o.id===this.contextId)||null:null}async init(){try{const n=await this.loadCustomerData();this.person=n,this.organizations=n.organizations,this.userId=n.userId,this.restoreCurrentContext(),this.ready=!0}catch(n){V()(n)}}restoreCurrentContext(){const n=Number.parseInt(localStorage.getItem(_.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(n)&&this.validateContextId(Number(n)))this.setCurrentContext(n);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Si()}validateContextId(n){var o;try{return((o=this.person)==null?void 0:o.id)==n?!0:!!this.organizations.find(i=>i.id===n)}catch{return!1}}};le=new WeakMap,X.DEFAULT_LANGUAGE="en",X.EVENT_CONTEXT_UPDATE="event:context-update",X.EVENT_READY_UPDATE="event:ready-update";let Pe=X;function Ii(e){return $().emit("metadata:read",{entity:e})}const Ae=function(){const t=r.reactive({}),n=new Map;function o(u){return t[u]}async function i(u){if(n.has(u)&&await n.get(u),t[u])return;const l=await a(u);s(u,l)}function a(u){const l=Ii(u).finally(()=>{n.delete(u)});return n.set(u,l),l}function s(u,l){t[u]=l}return{state:t,initEntity:i,get:o,loadingFlags:n}}();class Ni extends J{on(t,n){return super.on(t,n)}emit(t,n){console.log("[event-bus] emit",t,n),super.emit(t,n)}off(t,n){super.off(t,n)}}class H{static login(t){return j(S.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...t,AppName:S.applicationName})})}static parseProcessAnswer(t){if(t.statusCode>4)throw new Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startRegistrationProcess(t){return H.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return H.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return H.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return H.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return j(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return H.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return H.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return H.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return j(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(H.parseLoginProcessAnswer)}static parseLoginProcessAnswer(t){if(t.statusCode>3)throw Error(t.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return t}static startPasswordReset(t,n){return j(`${S.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:n,AppName:t})})}static confirmPhoneNumberByAccessRecovery(t,n,o,i){return j(`${S.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static confirmEmailByAccessRecovery(t,n,o,i){return j(`${S.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Prefix:o,Code:i})})}static finishAccessRecovery(t,n,o){return j(`${S.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:o,ConfirmedPassword:o})})}}class Ri{static readHistoryById(t,n){return j(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Oi{static getConfiguration(){return j("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await j(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Li{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return j(`/open-api/internationalization/language/${t}`)}}class xi{static async upload(t,n){const o=new FormData;return o.append("file",t),j(`/close-api/files?entityName=${n}`,{method:"POST",body:o}).then(i=>(i.filename=t.name,i))}}var Kt=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(Kt||{}),Qt=(e=>(e.Approved="A",e.AwaitingFeedback="AF",e.AssignedForExam="AFE",e.Cancelled="C",e.Closed="CLS",e.Completed="CT",e.Draft="D",e.NotSatisfied="NSF",e.OnClarification="OC",e.Processing="P",e.Rejected="R",e.ReadyForExam="RFE",e.Submitted="S",e.SecurityCheck="SCK",e.Satisfied="SF",e.Withdrawn="W",e))(Qt||{});function $i(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function L(e){return Object.keys(e).reduce((t,n)=>{const o=e[n];if(Array.isArray(o)){const i=o.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return o.length&&t.push(`@${n} in (${i})`),t}if($i(o)){let i=function(a){var s;return((s=a.match(/([^Z]*)/))==null?void 0:s[0])+"0000Z"};return o.start&&t.push(`@${n} ge ${i(o.start)}`),o.end&&t.push(`@${n} le ${i(o.end)}`),t}return typeof o=="number"||typeof o=="boolean"?(t.push(`@${n} eq ${o}`),t):typeof o=="string"?(o.length!==0&&t.push(`@${n} eq '${o}'`),t):(o===null&&t.push(L.is(n,o)),t)},[]).join(" and ")}function ve(e){return typeof e=="string"?`'${e}'`:`${e}`}L.includes=function(t,n){return`@${t} Contains ${ve(n)}`};L.beginWith=function(t,n){return`@${t} BeginWith ${ve(n)}`};L.notEq=function(t,n){return`@${t} nq ${ve(n)}`};L.eq=function(t,n){return Array.isArray(n)?L.in(t,n):`@${t} eq ${ve(n)}`};L.in=function(t,n){const o=n.map(ve).join(", ");return`@${t} in (${o})`};L.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":L.and(...n.map(o=>L.notEq(t,o)))};L.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(L.wrap).join(" and ")};L.wrap=function(t){return`(${t})`};L.is=function(t,n){return`@${t} is ${n}`};L.or=function(...t){return t.join(" or ")};function Ze(e){return Object.keys(e).reduce((t,n)=>{let o=e[n];const i=n.charAt(0).toUpperCase()+n.slice(1);return typeof o=="object"&&!(o==null||Array.isArray(o))&&(o=Ze(o)),t[i]=o,t},{})}const z=new Pe,he=new Ni;exports.ApplicationStatus=Qt;exports.Communication=Ai;exports.CoreError=Z;exports.DisplayListRow=Ye;exports.EventBus=he;exports.Filter=L;exports.Manager=z;exports.MetadataStore=Ae;exports.NotificationSystem=Qe;exports.OBJECT_TYPE_NAME_FIELD=Et;exports.RecordOperation=Kt;exports.WidgetButton=Mn;exports.WidgetFastTable=Fr;exports.WidgetFastTableHeadCell=Tt;exports.WidgetField=fr;exports.WidgetIcon=ce;exports.WidgetImage=Kn;exports.WidgetList=ur;exports.WidgetLoader=Jn;exports.WidgetMultiButton=zn;exports.WidgetSpinner=de;exports.WidgetTable=kt;exports.WidgetTablePanelFilterItem=Ct;exports.asyncProcess=Te;exports.authService=H;exports.billingService=ie;exports.catchUniversal=V;exports.config=In;exports.configuration=S;exports.constants=_;exports.convertDDToDMS=si;exports.convertDMSToDD=ai;exports.convertListConfig=Jt;exports.debounce=Ur;exports.documentsService=on;exports.fileService=xi;exports.formatter=fe;exports.getCellName=me;exports.getCellValue=je;exports.getEntityLink=Je;exports.getNamesFromListConfig=At;exports.getUnitValue=$e;exports.groupArrayByField=Vr;exports.historyService=Ri;exports.injectAction=xt;exports.internationalizationService=Li;exports.invitationService=rn;exports.openService=Oi;exports.parseError=Ge;exports.parseTextByMarkdown=ii;exports.prettyDate=qe;exports.prettyDateWithTime=_t;exports.prettyMoney=St;exports.prettyValueFieldByEntity=Gr;exports.processWizardService=se;exports.request=j;exports.setupListRow=Ue;exports.staticLink=eo;exports.t=ee;exports.throttle=Wr;exports.universalEntityCount=Zr;exports.universalEntityCreate=Rt;exports.universalEntityDelete=Ot;exports.universalEntityRead=ue;exports.universalEntityUpdate=ze;exports.universalHistoryRead=Qr;exports.universalListSettingRead=Nt;exports.universalMetadataFieldTreat=Jr;exports.universalMetadataListRead=Kr;exports.universalToolRead=Lt;exports.useActions=Ei;exports.useCommunication=yi;exports.useEnter=ki;exports.useFormEntity=wi;exports.useListActiveRow=ui;exports.useListEntity=di;exports.useListSearch=Ci;exports.useListSelect=Ti;exports.useManagerState=pi;exports.useMetadata=Oe;exports.useSocket=$;exports.useUsageContext=Ke;exports.useVisibleItem=We;exports.useWizard=un;exports.uuidv4=Mr;exports.valuesToUpperCase=Ze;exports.wrapToolResponse=$t;
12
12
  //# sourceMappingURL=eservices-core.cjs.js.map