eservices-core 1.3.244 → 1.3.245

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,6 +1,6 @@
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}.justify-content-center{justify-content:center}.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{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}.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,.widget-table-cell_money{text-align:end}.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}.flex,.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}.gap-10{gap:10px}.gap-15{gap:15px}.gap-5{gap:5px}.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}.padding-bottom-10{padding-bottom:10px}.padding-10{padding:10px}.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-cd8043dd]{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-cd8043dd]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cd8043dd]: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-d131e64e]{display:flex;gap:4px}.widget-head-cell-order[data-v-d131e64e]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-d131e64e]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-d131e64e]{padding:7px}.widget-head-cell-order-icon[data-v-d131e64e]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-d131e64e]{transform:rotate(180deg)}.widget-filter-item-container[data-v-e52e165e]{position:relative}.widget-filter-item-arrow[data-v-e52e165e]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-e52e165e]{font-weight:700}.widget-filter-item[data-v-e52e165e]{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-e52e165e]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-e52e165e]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-e52e165e]{transition:.2s}.widget-table-panel-filter[data-v-89e1fa2d]{justify-content:end;background-color:var(--color-primary)}.widget-fast-table-tools[data-v-973a3749]{display:flex;gap:15px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  "use strict";var st=e=>{throw TypeError(e)};var lt=(e,t,n)=>t.has(e)||st("Cannot "+n);var Pe=(e,t,n)=>(lt(e,t,"read from private field"),n?n.call(e):t.get(e)),Ve=(e,t,n)=>t.has(e)?st("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ke=(e,t,n,o)=>(lt(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n);/*!
3
- * eservices-core v1.3.244
3
+ * eservices-core v1.3.245
4
4
  * (c) 2024 ESERVICES
5
5
  */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),R=require("jenesius-vue-form"),we=require("vue-router"),an=require("date-and-time"),Re=require("debug"),H=require("jenesius-vue-modal"),L=class L extends Error{constructor(t,n=null){super(),this.message=t,this.details=n,this.id=L.ID++}static ParentFormNotFound(){return new L("Can't found parent form.")}static UndefinedNameOfCompositeFormController(t){return new L("Composite object name is undefined",t)}static EntityWithoutName(t){return new L("'Entity doesn't have a name",t)}static NotResolvedNameEventEmitter(t){return new L(`'${t}' is not a valid Event emitter name`)}static FormIsNotValidated(t){return new L("Form is not validated",t)}static ListWorkerIsRunningOrEnd(t){return new L("List data request is running or already done",t)}static ObjectIdNotNumber(t){return new L(`${t} (id) is not a number`)}static UndefinedErrorId(t,n){return L.ApiNotAvailable()}static ApiError(t){return new L("Request error",t)}static ApiNotAvailable(){return new L(`Sorry, we experience difficulties here.
6
6
  Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(t,n){return!t&&!n?L.ApiNotAvailable():new L(t||"Authorization Error",n)}static ApiResponseParseFailed(){return L.ApiNotAvailable()}static MissingIdInValuesEntity(t){return new L("Object doesn't have id",t)}static ObjectWithIdNotFound(t,n){return new L(`Can't find object with id: ${t}`,n)}static ObjectWithoutConnectToPresentArray(t,n){return new L("Object is not found.",{object:t,array:n})}static EntityWithoutId(t){return new L("Entity doesn't have id.",t)}static NotFoundedTableIndex(t,n){return new L(`Can't find the element with tableIndex ${t}`,n)}static UndefinedError(t,n=[]){return new L(t,n)}static TableArrayAlreadyIncludeProvidedIndexValue(t,n,o){return new L(`Array already includes the element with value ${t}`,{array:n,table:o})}static MetadataEntityIsNotAvailable(t){return new L(`Metadata for the ${t} is not currently available.`)}static RequestTookToLong(){return new L("The request took too long to complete. Try again later.")}};L.ID=0;let J=L;const sn="Please try again later or submit a feedback if problem doesn't go.";function ln(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return sn}})}function ie(e,t={}){return t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.replace("/auth"):n).catch(()=>{throw J.ApiNotAvailable()}).then(n=>ln(n).then(o=>{if(!n.ok)throw o;return o}))}class cn{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 cn;class un{static invite(t,n,o){return ie("/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 ie("/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 ie("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:t,version:n,mark:!1})})}}class fn{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 oe{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${oe.url()}/calculator/${t}`)}static calculate(t,n){return ie(`/${oe.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]):J.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 ie(`/${oe.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return ie(`/${oe.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:t})})}}const dn={class:"widget-table__head-cell"},pn={key:1,class:"widget-table__head-label margin_0 text_overflow"},kt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{},type:{}},emits:["select"],setup(e,{emit:t}){const n=t;function o(){n("select")}return(i,a)=>(r.openBlock(),r.createElementBlock("th",dn,[i.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(R.FormField),{key:0,onClick:o})):(r.openBlock(),r.createElementBlock("span",pn,r.toDisplayString(i.label),1))]))}}),mn={class:"widget-table__head"},gn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>S.componentTableHeadCell||kt),(t,n)=>(r.openBlock(),r.createElementBlock("tr",mn,[(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))]))}}),j=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},hn=j(gn,[["__scopeId","data-v-498c4f00"]]);function ze(e){return Array.isArray(e)?ze(e[0]):typeof e!="string"?null:e}function se(e){return ze(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"),R.utils.getPropFromObject(t,o))}),e}function Ue(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Fe(e,t){const n=se(e);if(typeof e.value=="string")return vn(e.value,t);let o=n?R.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;switch(e.unitValue&&(o=Ue(e.unitValue)(o)),e.unit&&(o=Ue(e.unit)(o)),e.type){case"number":{typeof o=="number"&&(o=new Intl.NumberFormat().format(o));break}case"date":{o=Ne(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Rt(typeof o=="string"?o:null);break}case"money":{o=Ft(o);break}case"DateTime":{o=Ne(typeof o=="string"?o:null,e.format||S.dateTimeFormat);break}}return e.formatter&&(o=ce(e.formatter).exec(o,t)),typeof o=="boolean"&&(o=o?"✓":"—"),o}const wn=1,bn=5e3,En="static-folder",_t="request-error",Tt="EntityTypeName",Cn="REFERENCE_CHANGES",A={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",MODAL_LIST_DOWNLOAD:"list-download",MODAL_LIST_SETTINGS:"list-settings",MODAL_SIMPLE_TOOL_PARAMETERS:"SimpleToolParameters",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:Tt,FIELD_NAME_REFERENCE_CHANGES:Cn};function Be(e){return[A.CORE_DEBUG_LABEL,e].join(":")}const kn={class:"widget-filter-text flex gap_20"},_n=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,l=>{if(typeof l!="string")return i.value="";i.value=l},{immediate:!0}),(l,c)=>{const s=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",kn,[r.createVNode(r.unref(R.FormField),{type:"text",modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=u=>i.value=u)},null,8,["modelValue"]),r.createVNode(s,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(Q)("Apply")),1)]),_:1})])}}}),Tn=j(_n,[["__scopeId","data-v-800b3803"]]),An={class:"widget-filter-enum"},Sn={class:"flex gap-10 padding-10"},In=r.defineComponent({__name:"widget-filter-entity",props:{baseEntity:{},filters:{},values:{},filterMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:t}){const n=e,o=r.ref([]),i=De(n.filterMetadata.entity),a=d=>(n.values||[]).includes(d),l=t;function c(d){const p=n.values||[];return p.includes(d)?l("update:values",p.filter(h=>h!==d)):l("update:values",[...p,d])}const s=le(async()=>{o.value=await ne(n.baseEntity,{fields:n.filterMetadata.name.join(" "),order:[n.filterMetadata.name[1],"asc"],distinct:!0,filter:x(n.filters)}).then(d=>d.map(p=>({label:p[n.filterMetadata.name[1]],value:p[n.filterMetadata.name[0]]})))});function u(){l("update:values",[])}return r.watch(()=>s.loading,d=>{l("readProcess",d?"start":"end")},{immediate:!0}),r.watch(()=>i.value,()=>{s.loading||s.call()},{immediate:!0}),(d,p)=>{const h=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",An,[r.createElementVNode("div",Sn,[r.createVNode(h,{label:"Reload filter",loading:r.unref(s).loading||!1,icon:"reload",onClick:p[0]||(p[0]=()=>r.unref(s).call())},null,8,["loading"]),r.createVNode(h,{label:"Clear",onClick:u})]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,m=>(r.openBlock(),r.createBlock(r.unref(R.FormField),{class:"widget-filter-enum-item",key:m.value,onClick:()=>c(m.value),type:"single-checkbox","model-value":a(m.value),label:m.label},null,8,["onClick","model-value","label"]))),128))])}}}),Nn=j(In,[["__scopeId","data-v-cd8043dd"]]),pe=r.reactive({});function Ln(){ct(),setInterval(ct,50)}function At(){return pe}function ct(){const e={};Object.entries(localStorage).forEach(([t,n])=>{e[t]=!0,pe[t]!==n&&(pe[t]=n)}),Object.keys(pe).forEach(t=>{e[t]||delete pe[t]})}const S={getEntityLink(e,t){return`/forms/${e}/${t}`},iconHandlerText(){return""},iconTag:"i",dateTimeFormat:"DD/MM/YYYY HH:mm:ss",tableFilterEntityBind:{String:Tn,Entity:Nn},arrayListCellHandlers:[],arrayFieldParamsHandlers:[]};function On(e){Ln();for(let t in e)S[t]=e[t]}const Rn={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))}},me=j(Rn,[["__scopeId","data-v-8a72b45f"]]),Fn=Re(Be("setup-list-row"));function Bn(e,t){const n=e.config.map(o=>xn(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function xn(e,t,n){const o=t.values;let i=Fe(e,o);const a={onClick:[],title:e.hint,class:["widget-table__cell widget-table-cell"]};function l(d){a.onClick.push(()=>d(o,e,n))}function c(d){Array.isArray(d)?a.class.push(...d):a.class.push(d)}const s=[],u=[];if(e.hide&&e.hide(o))return[r.h("td")];if(e.type)switch(c(`widget-table-cell_${e.type}`),e.type){case"multi-select":{u.push(r.h(R.FormField,{type:"single-checkbox",modelValue:t.selected})),l(ut.bind(null,n,!0));break}case"select":{u.push(r.h(R.FormField,{type:"single-radio",modelValue:t.selected})),l(ut.bind(null,n,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const d=e.link(o);if(d){const p=r.h(we.RouterLink,{to:d});u.push(p),c("widget-table-cell_link")}}catch(d){Fn("Can't add router link",d)}if(e.href&&(u.push(r.h("a",{href:e.href(o),target:"_blank"})),c("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&u.push(r.h("p",{class:"widget-list-cell-text"},i)),e.icon&&(typeof e.icon=="string"&&u.push(r.h(me,{name:e.icon})),typeof e.icon=="function")){const d=e.icon(o);d!==null&&u.push(r.h(me,{name:d}))}return e.class&&(typeof e.class=="function"?c(e.class(o)):c(e.class)),S.listCellHandler&&(console.log("listCellHandler is deprecated. Please use coreUtils.addListCellHandler instead."),S.listCellHandler(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:n})),S.arrayListCellHandlers&&S.arrayListCellHandlers.forEach(d=>d(e,o,{cellNodeChildren:u,addClass:c,addHandleClick:l,context:n})),s.push(r.h("td",a,u)),s}function ut(e,t){e.emit("select",t)}function Xe(e,t){return()=>{try{return Bn(e,t)}catch(n){return console.warn(n),null}}}const Dn={props:{values:Object,config:Object,selected:Boolean},setup:Xe},$n=["colspan"],ft=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]=l=>n("close")),onSave:a[1]||(a[1]=l=>n("save",l))}),null,16,["values","new"]))],8,$n)],512))}}),Pn={class:"widget-table"},Me="update:selectedRows",Vn="update:activeRow",St=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 m;return(m=i==null?void 0:i.default)==null?void 0:m.call(i)[0]});function l(){const v=n.selectedRows.length!==0?[]:[...n.array];o(Me,v)}function c(m){return n.useMockField?vt(m):m}function s(m,v=!0){if(!n.selectedRows)return;if(!v)return o(Me,n.selectedRows.includes(m)?[]:[m]);const f=[...n.selectedRows],g=f.indexOf(m);return g===-1?f.push(m):f.splice(g,1),o(Me,f)}function u(m){o(Vn,m)}function d(m){o("save",m),o("update:activeRow",null)}const p=r.computed(()=>n.shortcut?n.config.filter(m=>m.name?!!n.array.find(f=>![null,""].includes(Fe(m,f))):!0):n.config),h=r.computed(()=>n.useMockField?n.array.filter(vt):n.array);return(m,v)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Pn,[r.createElementVNode("thead",null,[r.createVNode(hn,{config:p.value,onOrder:v[0]||(v[0]=f=>m.$emit("order",f))},{default:r.withCtx(f=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(m.$slots["head-cell"]||kt),r.mergeProps(f,{onSelect:l}),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(h.value,(f,g)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:g},[r.createVNode(Dn,{config:p.value,values:f,selected:m.selectedRows.includes(c(f)),onSelect:y=>s(c(f),y),onActivate:y=>u(c(f)),class:r.normalizeClass(m.classCallback?m.classCallback(f):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&m.activeRow===c(f)?(r.openBlock(),r.createBlock(ft,{key:0,component:a.value,"row-length":m.config.length,values:f,onClose:v[1]||(v[1]=y=>o("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),m.activeRow===r.unref(A).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(ft,{key:0,component:a.value,"row-length":p.value.length,onClose:v[2]||(v[2]=f=>o("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),Mn=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))}}),be=j(Mn,[["__scopeId","data-v-0ef9ae88"]]),jn={class:"widget-button"},Un=r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("button",jn,[t.wait?(r.openBlock(),r.createBlock(be,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(t.$slots,"default",{},void 0,!0)]))}}),Wn=j(Un,[["__scopeId","data-v-450dc564"]]),qn={class:"widget-multi-button-wrap position_relative cursor_pointer"},Hn={class:"widget-multi-button-body grid"},Gn=["onClick"],zn={class:"widget-multi-button-side-wrap"},Xn=r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(l=>({"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(l){if(!(typeof l!="function"||n.wait))return n.wait=!0,Promise.resolve().then(l).finally(()=>{n.wait=!1})}function a(l=!n.active){n.active=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",qn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",n.active?"widget-multi-button_active":null])},[r.createElementVNode("div",Hn,[l.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=s=>a())},r.toDisplayString(l.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(s,u)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:u,onClick:d=>{i(s.callback),a(!1)}},r.toDisplayString(s.label),9,Gn))),128))]),r.createElementVNode("div",zn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",n.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=s=>a())},[n.wait?(r.openBlock(),r.createBlock(r.unref(be),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(r.openBlock(),r.createBlock(r.unref(me),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),Kn=j(Xn,[["__scopeId","data-v-d43a76ce"]]),Yn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Jn={class:"text_md"},It=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(t,n)=>(r.openBlock(),r.createElementBlock("div",Yn,[r.createVNode(be,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Jn,r.toDisplayString(t.label),1)]))}}),Qn=["alt","src"],Zn=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,Qn))}}),er={props:{config:Array,values:Object,selected:Boolean},setup:Xe},tr=j(er,[["__scopeId","data-v-344a8cc1"]]),nr=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),rr={class:"widget-list-head-cell"},or=nr(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),ir=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",rr,[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(R.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(l=>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]=l=>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(me),{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),or])]))}}),ar=j(ir,[["__scopeId","data-v-bf495d6a"]]),sr=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 u(v,f){let g=-1;do g++,f-=v[g];while(f>0&&g<v.length);return g}function d(v,f){let g=0;for(;f>0&&f>v[g]&&g<v.length;)f-=v[g],g++;return console.log(f,g),g>0?g:0}function p(v){try{a.value.style.insetInlineStart=v+"px"}catch(f){console.log(f)}}function h(v){try{a.value.style.width=v+"px",a.value.style.minWidth=v+"px",a.value.style.maxWidth=v+"px"}catch(f){console.log(f)}}function m(v){return v===null?!1:v.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(f){var ue;function g(P){return P.screenX+b-I}const y=i.value,w=[...y.children].filter(P=>P.localName==="th"),b=((ue=y.offsetParent)==null?void 0:ue.scrollLeft)||0,T=w.map(P=>P.clientWidth),D=m(f.target),I=y.getBoundingClientRect().left,k=g(f),C=u(T,k),N=T.slice(0,C).reduce((P,U)=>P+U,0),E=k-N,_=y.offsetWidth,F=w[C].clientWidth;if(n.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",f.screenX),console.log("Widths",T),console.log("max width",_),console.log("Start Position",k),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",I),console.log("Del",E),console.groupEnd(),a.value.innerText=w[C].textContent||"",a.value.style.display="grid",a.value.style.width=F+"px",a.value.style.cursor="grabbing",p(N),h(F),document.addEventListener("pointermove",$,{passive:!0}),document.addEventListener("pointerup",Z);function Z(P){if(console.group("END"),document.removeEventListener("pointermove",$),document.removeEventListener("pointerup",Z),D&&(n.config[C].width=a.value.style.width,n.config[C].minWidth=a.value.style.width,n.config[C].maxWidth=a.value.style.width,l(n.config)),!D){const U=P.screenX+b-I;console.log("ENP Position",U);const Ce=d(T,U);if(console.log(C,"->",Ce),Ce!==C){const fe=n.config[C],$e=n.config;$e.splice(C,1),$e.splice(Ce,0,fe),l($e)}else{const fe=n.config[C].name;c(fe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function $(P){if(D){const fe=g(P)-k+F;h(fe);return}let U=P.screenX+b-I-E;U<0&&(U=0),U+F>_&&(U=_-F),p(U)}})});function l(u){o("update:config",u)}function c(u){if(!u)return;if(Array.isArray(u)){if(u.length<1)return;u=u[0]}if(n.order.length===0||n.order[0]!==u)return void s([u]);const d=n.order.length===1||n.order[1]==="asc"?"asc":"desc";s([u,d==="asc"?"desc":"asc"])}function s(u){o("update:order",u)}return(u,d)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.config,(p,h)=>(r.openBlock(),r.createBlock(ar,r.mergeProps({key:p,ref_for:!0},p,{onOrder:m=>c(p.name),onSelect:d[0]||(d[0]=m=>o("select")),order:u.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),lr=j(sr,[["__scopeId","data-v-ccffc6bd"]]),cr={class:"widget-list"},ur={class:"widget-list-body position_relative"},fr=50,dr=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(s,u=!0){if(n.selectedRows)if(!u)l(n.selectedRows.includes(s)?[]:[s]);else{const d=[...n.selectedRows],p=d.indexOf(s);p===-1?d.push(s):d==null||d.splice(p,1),l(d)}}function a(){var s;if(((s=n.selectedRows)==null?void 0:s.length)!==n.array.length)return l([...n.array]);l([])}function l(s){o("update:selectedRows",s)}function c(s){if(!s)return;const u=s.target;u.scrollTop+u.clientHeight+fr>u.scrollHeight&&o("scrollEnd")}return(s,u)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:c},[r.createElementVNode("table",cr,[r.createElementVNode("thead",null,[r.createVNode(lr,{onSelect:u[0]||(u[0]=d=>a()),"onUpdate:order":u[1]||(u[1]=d=>o("update:order",d)),"onUpdate:config":u[2]||(u[2]=d=>o("update:config",d)),config:s.config,order:s.order},null,8,["config","order"])]),r.createElementVNode("tbody",ur,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(d,p)=>{var h;return r.openBlock(),r.createBlock(tr,{key:p,class:"widget-list-row",values:d,config:s.config,selected:(h=s.selectedRows)==null?void 0:h.includes(d),onSelect:m=>i(d,m)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Ke(){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(A.VISIBLE_ITEM_PROVIDE_NAME,{show(l){n[l]=!0},hide(l){n[l]=!1},remove(l){delete n[l]}});const o=r.inject(A.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 pr=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{},usageContext:{type:Boolean,default:!0}},setup(e){const t=e,n=De(),o=rt(),i=r.computed(()=>{var f,g,y;const h=s.value,m=u(h),v={type:m,disabled:t.usageContext?!((f=c.value)!=null&&f.canSet):!1,label:t.label};return m==="Decimal"&&((y=(g=h==null?void 0:h.presentationType)==null?void 0:g.toLowerCase)==null?void 0:y.call(g))==="money"&&(v.money=!0),h&&Object.assign(v,{suffix:m==="number"?h.valueUnit:void 0,required:l.includes(m||"")?!1:h.required,label:t.label||h.displayName}),Array.isArray(S.arrayFieldParamsHandlers)&&S.arrayFieldParamsHandlers.forEach(w=>Object.assign(v,w(h,c.value,v))),v}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],c=r.computed(()=>{var h;return(h=o==null?void 0:o.value)==null?void 0:h.fields[t.name]}),s=r.computed(()=>{if(!n.value)return;const h=n.value.fieldsByName[t.name];if(h)return h});function u(h){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(h){if(h.type==="Reference"||h.type==="Owned")return h.referencedEntity;if(h.dataType==="Boolean")return"single-checkbox";if(h.dataType==="DateTime")return"date";if(h.dataType==="Integer"||h.dataType==="Decimal")return"number";if(h.dataType==="List")return h.aggregatedEntity;if(a.includes(h.presentationType))return"textarea";if(h.presentationType==="PhoneNumber")return"tel"}return"text"}const d=r.computed(()=>{var h;return t.usageContext?((h=c.value)==null?void 0:h.canGet)===!0:!0}),{controller:p}=Ke();return r.watch(()=>d.value,h=>h?p.show():p.hide(),{immediate:!0}),r.onUnmounted(()=>p.remove()),(h,m)=>d.value?(r.openBlock(),r.createBlock(r.unref(R.FormField),r.mergeProps({key:0},{...h.$attrs,...i.value},{name:h.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function mr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||A.DEFAULT_ORDER_DIR}const gr=["fill"],hr=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),yr=[hr],vr=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},yr,8,gr))}}),wr={class:"widget-fast-table-head-cell-td"},br={key:1,class:"widget-head-cell-label"},Er={key:2,class:"widget-head-cell-order"},Cr=r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{},type:{},isFullSelected:{type:Boolean}},emits:["select"],setup(e,{emit:t}){const n=e,o=r.computed(()=>ze(n.name));r.computed(()=>mr(n.order));const i=t;function a(){i("select")}return(l,c)=>{var s;return r.openBlock(),r.createElementBlock("td",wr,[r.createElementVNode("div",{class:r.normalizeClass(["widget-head-cell",[l.type==="multi-select"?"justify-content-center":""]]),onClick:c[0]||(c[0]=u=>l.$emit("order",l.name))},[l.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(R.FormField),{key:0,"model-value":l.isFullSelected,onClick:a,type:"single-checkbox"},null,8,["model-value"])):(r.openBlock(),r.createElementBlock("span",br,r.toDisplayString(l.label),1)),o.value===((s=l.order)==null?void 0:s[0])?(r.openBlock(),r.createElementBlock("div",Er,[r.createVNode(vr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${l.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)],2)])}}}),Nt=j(Cr,[["__scopeId","data-v-d131e64e"]]),kr=["fill"],_r=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=[_r],Ar=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,kr))}}),Sr={class:"widget-filter-item-popup"},Ir=r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filters:{},filterItem:{}},emits:["update:values"],setup(e,{emit:t}){const n=e,o=t,i=S.tableFilterEntityBind,a=r.ref(),l=r.computed(()=>{const m=n.filterItem;return m.entity?"Entity":m.type?m.type:null});function c(m){s.value=m==="start"}const s=r.ref(!1),u=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),d=r.ref(!1);let p=null;function h(m=!d.value){d.value=m,!d.value&&p?(p(),p=null):a.value&&(p=R.utils.clickOutside(a.value,h.bind(null,!1)))}return(m,v)=>{var f;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:r.normalizeClass(["widget-filter-item",{"widget-filter-item_active":u.value}]),onClick:v[0]||(v[0]=()=>h())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":u.value}])},r.toDisplayString(m.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(be,{key:0})):(r.openBlock(),r.createBlock(Ar,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":d.value})},null,8,["class"]))],2),r.withDirectives(r.createElementVNode("div",Sr,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((f=r.unref(i))==null?void 0:f[l.value]),{key:0,"filter-metadata":m.filterItem,values:m.values,filters:m.filters,"base-entity":m.entity,"onUpdate:values":v[1]||(v[1]=g=>o("update:values",g)),onReadProcess:c},null,40,["filter-metadata","values","filters","base-entity"])):r.createCommentVNode("",!0)],512),[[r.vShow,d.value]])],512)}}}),Lt=j(Ir,[["__scopeId","data-v-e52e165e"]]),Nr={class:"widget-table-panel-filter flex"},Lr=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,l){o("update:filters",{...n.filters,[a]:l})}return(a,l)=>(r.openBlock(),r.createElementBlock("div",Nr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(c,s)=>{var u;return r.openBlock(),r.createBlock(Lt,{key:s,entity:a.entity,"filter-item":c,values:(u=a.filters)==null?void 0:u[r.unref(se)(c)],filters:a.filters,"onUpdate:values":d=>i(r.unref(se)(c),d)},null,8,["entity","filter-item","values","filters","onUpdate:values"])}),128))]))}}),Or=j(Lr,[["__scopeId","data-v-89e1fa2d"]]),Rr={class:"widget-fast-table-tools"},Fr=r.defineComponent({__name:"widget-fast-table-tools",props:{tools:{},loading:{type:Boolean},selectedRows:{},metadata:{}},emits:["reload","export"],setup(e,{emit:t}){const n=e,o=we.useRouter(),i=t,a=[{name:"config",label:"Settings",icon:"list-settings",buttonStyle:"default",callback:()=>null},{name:"export",label:"Save as CSV",icon:"list-download",buttonStyle:"default",callback:()=>i("export")},{name:"reload",label:"Reload",icon:"reload",buttonStyle:"default",callback:()=>i("reload")}],l=a.map(p=>p.name),c=r.inject(A.PROVIDE_NAME_ACTIONS,[]),s=r.computed(()=>{var m;const p=((m=c==null?void 0:c.actions)==null?void 0:m.value)||[];return Array.isArray(n.tools)?n.tools.reduce((v,f)=>{if(f.name==="*")v.push(...a);else if(l.includes(f.name)){const g=a.find(y=>y.name===f.name);g&&v.push(g)}else if(f.name==="redirect"){const g={...f,label:f.label,callback:()=>o.push(f.to)};v.push(g)}else{const g=p.find(y=>y.name===f.name);g&&v.push({name:f.name,label:g.title,icon:f.icon,buttonStyle:f.buttonStyle,callback:()=>Promise.resolve().then(()=>{u[f.name]=!0}).then(()=>d(g)).finally(()=>{u[f.name]=!1})})}return v},[]):[]}),u=r.reactive({});function d(p){var v;const h=(v=p.action.parameters.find(f=>f.dataTypeName==="IntegerArray"))==null?void 0:v.name,m={};return h&&(m[h]=n.selectedRows.map(f=>{if(!(typeof f=="object"&&f!==null))return null;const g=n.metadata.fieldNameForIdentification;return g===void 0?null:f[g]})),p.callback(m)}return(p,h)=>{const m=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Rr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,v=>(r.openBlock(),r.createBlock(m,{label:v.label,title:v.name,icon:v.icon,type:v.buttonStyle,loading:v.name==="reload"?p.loading:u[v.name],onClick:v.callback},null,8,["label","title","icon","type","loading","onClick"]))),256)),r.renderSlot(p.$slots,"default",{},void 0,!0)])}}}),Br=j(Fr,[["__scopeId","data-v-973a3749"]]);class ge{constructor(t,n){this.data=n,this.entity=t}hasPrimaryKey(){return!!ge.getPrimaryKey(this.entity,this.data)}get primaryKey(){return ge.getPrimaryKey(this.entity,this.data)}static getPrimaryKey(t,n){const o=he.get(t);if(!o.fieldNameForIdentification)return null;try{return n[o.fieldNameForIdentification]}catch{return null}}}function xr(){const e=At();we.useRouter();const t=r.reactive({entity:null,mark:null,settings:null});function n(f){const g={...c.value,...f};o(g)}function o(f){{const g=f.prefilters;g&&(Object.keys(g).forEach(y=>{var w,b;Array.isArray(g[y])&&g[y].length===0&&t.settings&&!((b=(w=t.settings)==null?void 0:w.prefilters)!=null&&b[y])&&delete g[y]}),R.utils.isEmptyObject(g)&&delete f.prefilters)}localStorage.setItem(l(t.entity,t.mark),JSON.stringify(f))}function i(){return t.entity?JSON.parse(localStorage[l(t.entity,t.mark)]||"{}"):null}function a(f,g){t.entity=f,t.mark=g,u.call()}function l(f,g){return"list-configuration:"+f+(g?"-"+g:"")}const c=r.computed(()=>t.entity?JSON.parse(e[l(t.entity,t.mark)]||"{}"):null),s=r.computed(()=>t.settings?en(t.entity,t.settings.config):[]),u=le(async function(){if(!t.entity)return;const g=await xt(t.entity,t.mark);t.settings=Object.freeze(g)}),d=r.computed(()=>{var y;const f=c.value.prefilters||{};return{...((y=t.settings)==null?void 0:y.prefilters)||{},...f}}),p=r.computed(()=>{var f;return((f=t.settings)==null?void 0:f.filters)||[]}),h=r.computed(()=>{var f;return((f=t.settings)==null?void 0:f.label)||null}),m=r.computed(()=>{var f;return((f=t.settings)==null?void 0:f.tools)||[]}),v=r.computed(()=>!R.utils.isEmptyObject(c.value));return{state:t,get customFilters(){return t.settings.customFilters||[]},set:a,get:i,configuration:c,update:n,computedPrefilter:d,computedFiltersConfiguration:p,get prefilters(){var f,g;return(f=i())==null||f.prefilters,((g=i())==null?void 0:g.prefilters)||t.settings.prefilters||{}},get order(){var f;return((f=i())==null?void 0:f.order)||[]},clean(){localStorage.removeItem(l(t.entity,t.mark))},cellConfiguration:s,computedLabel:h,computedTools:m,computedHasLocalConfiguration:v}}const Dr={class:"es-grid es-gap-15"},$r={key:0,class:"title-md color-primary margin-0 widget-fast-table-label"},Pr={class:""},Vr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{},hideLabel:{type:Boolean}},setup(e,{expose:t}){const n=e,o=we.useRouter(),i=r.ref([]),a=r.ref(null),l=r.ref(null),c=R.Form.getParentForm(),s=r.ref([]),u=De(n.entity),{state:d,update:p}=rt(n.entity,{masterEntities:n.masterEntities||[]}),h=r.computed(()=>{var E;return((E=C.value)==null?void 0:E.displayItem)||nt.inline}),m=r.computed(()=>{var E;return((E=C.value)==null?void 0:E.newItem)||h.value}),v=le(async()=>{try{await f.call(),await p()}catch(E){const{message:_}=Ye(E);a.value=_}});c instanceof R.Form&&c.subscribe({read:v.call.bind(null),name:n.entity,type:"table"}),r.watch(()=>n.mark,()=>{I.set(n.entity,n.mark)});const f=le(async function(){const _=n.entity;a.value=null,s.value=[];const F=(await ne(_,{customFilters:I.customFilters,fields:Qe(k.value).join(" "),order:I.order,filter:x.and(x(I.prefilters),x(n.binding||{}))})).map(hi);i.value=F});async function g(E){if(E===null)return l.value=null;const _=new ge(n.entity,E),F=_.hasPrimaryKey()?_.primaryKey:null;if(h.value==="form")return F?o.push(tt(n.entity,F)):console.warn("Can't open form without primaryKey");if(h.value==="inline")return l.value=E||A.LIST_ACTIVE_NEW;h.value==="modal"?(await H.promptModal("form",{entity:n.entity,primaryKey:F,id:F}),await f.call()):l.value=A.LIST_ACTIVE_NEW}const{controller:y}=Ke();r.watch(()=>d.value,E=>{E&&(E.canRead?y.show():y.hide())},{immediate:!0});let w=[ye.on("affected-entity",E=>{E.name===n.entity&&f.call()}),ye.on("display-entity",async E=>{E.name===n.entity&&(f.promise&&await f.promise,l.value=i.value.find(_=>_.Id===E.id)||null)})];r.onUnmounted(()=>{w.map(E=>E()),y.remove()});function b(E){function _($){return Array.isArray($)?_($[0]):typeof $!="string"?null:$}const F=_(E);if(!F)return;const Z=I.order;T("order",Z[0]!==F?[F,"asc"]:Z[1]==="desc"?[]:[F,"desc"])}function T(E,_){I.update({[E]:_}),f.call()}const D=r.computed(()=>v.wait),I=xr(),k=I.cellConfiguration;I.set(n.entity,n.mark),r.watch(()=>I.state.settings,v.call);const C=r.computed(()=>I.state.settings);t({listSettings:C,array:i,config:k,activeRow:l});function N(){H.openModal(A.MODAL_LIST_DOWNLOAD,{})}return(E,_)=>{const F=r.resolveComponent("widget-button"),Z=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Dr,[r.unref(I).computedLabel.value&&!E.hideLabel?(r.openBlock(),r.createElementBlock("p",$r,r.toDisplayString(r.unref(I).computedLabel.value),1)):r.createCommentVNode("",!0),r.unref(u)?(r.openBlock(),r.createBlock(Br,{key:1,metadata:r.unref(u),tools:r.unref(I).computedTools.value,loading:D.value,"selected-rows":s.value||[],onReload:r.unref(v).call,onExport:N},{default:r.withCtx(()=>{var $;return[m.value==="form"||($=r.unref(d))!=null&&$.canCreate?(r.openBlock(),r.createBlock(F,{key:0,onClick:_[0]||(_[0]=()=>g(r.unref(A).LIST_ACTIVE_NEW)),type:"primary",label:"Add New"})):r.createCommentVNode("",!0),r.unref(I).computedHasLocalConfiguration.value?(r.openBlock(),r.createBlock(F,{key:1,onClick:r.unref(I).clean,type:"primary",label:"Clear all filters"},null,8,["onClick"])):r.createCommentVNode("",!0)]}),_:1},8,["metadata","tools","loading","selected-rows","onReload"])):r.createCommentVNode("",!0),r.createElementVNode("div",Pr,[r.createVNode(Or,{entity:E.entity,"filters-config":r.unref(I).computedFiltersConfiguration.value,filters:r.unref(I).computedPrefilter.value,"onUpdate:filters":_[1]||(_[1]=$=>T("prefilters",$))},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(St),{config:r.unref(k),array:i.value,"active-row":l.value,"onUpdate:activeRow":g,onOrder:b,class:"table",selectedRows:s.value,"onUpdate:selectedRows":_[3]||(_[3]=$=>s.value=$)},{"head-cell":r.withCtx($=>{var ue,P,U;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(E.$slots["head-cell"]?E.$slots["head-cell"]:Nt),r.mergeProps({label:$.label},$,{onOrder:b,order:r.unref(I).configuration.value.order||[],type:$.type,"is-full-selected":((ue=s.value)==null?void 0:ue.length)===((P=i.value)==null?void 0:P.length)&&((U=i.value)==null?void 0:U.length)>0}),null,16,["label","order","type","is-full-selected"]))]}),default:r.withCtx(()=>[r.createVNode(Z,{entity:E.entity,"primary-key":r.unref(ge).getPrimaryKey(n.entity,l.value),"master-entities":E.masterEntities||void 0,binding:E.binding,onFormUpdate:_[2]||(_[2]=()=>{l.value=null,r.unref(f).call()})},null,8,["entity","primary-key","master-entities","binding"])]),_:1},8,["config","array","active-row","selectedRows"])])])}}});function Ot(e,t={},n={}){const o=r.inject(A.PROVIDE_NAME_ACTIONS,null),i=typeof e=="string"?e:t,a=typeof t=="string"?n:t;return r.computed(()=>{var s;const c=((typeof e=="string"?(s=o==null?void 0:o.actions)==null?void 0:s.value:r.unref(e))||[]).find(u=>u.name===i);return c?{...c,...a}:null})}const Mr=r.defineComponent({__name:"widget-action",props:{name:{},overrideParams:{}},setup(e){const t=e,n=Ot(t.name,t.overrideParams||{}),o=r.computed(()=>{if(n.value)return le(n.value.callback)});return(i,a)=>{var c;const l=r.resolveComponent("widget-button");return r.unref(n)?(r.openBlock(),r.createBlock(l,{key:0,label:r.unref(n).label,loading:((c=o.value)==null?void 0:c.loading)||!1,onClick:a[0]||(a[0]=()=>{var s,u;return(u=(s=o.value)==null?void 0:s.call)==null?void 0:u.call(s,i.overrideParams||{})})},null,8,["label","loading"])):r.createCommentVNode("",!0)}}}),jr=r.defineComponent({__name:"modal-list-download",props:{settings:{}},setup(e){const t=e,n=r.computed(()=>o.finished?"Download CSV":`Download ${o.count} records.`),{state:o,downloadFile:i,reject:a,start:l}=nn(t.settings);return H.onBeforeModalClose(a),r.onMounted(l),r.watch(()=>o.finished,()=>{i(),H.popModal()}),(c,s)=>{const u=r.resolveComponent("widget-button"),d=r.resolveComponent("widget-modal-wrap");return r.openBlock(),r.createBlock(d,null,{footer:r.withCtx(()=>[r.createVNode(u,{onClick:s[0]||(s[0]=p=>{r.unref(i)(),r.unref(H.popModal)()})},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(n.value),1)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.createVNode(It,{label:"Loading"})])]),_:1})}}});function Rt(e){return Ne(e,"YYYY/MM/DD HH:mm:ss")}function Ne(e,t="YYYY/MM/DD"){if(!e)return"";try{const n=new Date(e);return an.format(n,t)}catch(n){return console.log(n),"Invalid date"}}function le(e){function t(...o){if(n.loading)return Promise.reject("The process has already started.");n.loading=!0,n.wait=!0;const i=Promise.resolve().then(()=>e(...o)).finally(()=>{n.wait=!1,n.loading=!1,n.promise=null});return n.promise=i,i}const n=r.reactive({wait:!1,loading:!1,call:t,promise:null});return n}function Ye(e){return typeof e=="string"?_e(e):Ur(e)?_e(e.message,e.children||e.details||[]):Wr(e)?_e(e.title,[e.detail||""]):_e(A.DEFAULT_ERROR_MESSAGE)}function Ur(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function Wr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function _e(e,t=[]){return{message:e,children:t}}function M(e="error"){return function(t){const{message:n,children:o}=Ye(t);ot.add(e,n,{children:o})}}function ne(e,t={}){const n=B();return qr(t)&&t.id&&(t.primaryKey=t.id,delete t.id),n.emit("entity:read",{entity:e,...t})}function qr(e){return!!(e.id||e.primaryKey)}function Je(e,t){return B().emit("entity:update",{...t,entity:e})}function Qe(e){return e.reduce((t,n)=>(n.name&&(typeof n.name=="string"?t.push(n.name):t.push(...n.name)),t),[])}function Ft(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 Hr(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 Gr(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function zr(e){return e.text().then(t=>{try{return JSON.parse(t)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function W(e,t={}){return G.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=G.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(A.DEFAULT_ERROR_MESSAGE)}).then(n=>zr(n).then(o=>{if(!n.ok)throw o;return o}))}function Xr(e,t=1e3){let n=0;return(...o)=>{clearTimeout(n),n=window.setTimeout(()=>e(...o),t)}}function Kr(e,t){let n=!1;return(...o)=>{if(!n)return n=!0,setTimeout(()=>n=!1,t),e(...o)}}const Yr=Re(Be("pretty-value-field-by-entity"));function Jr(e,t,n){try{const o=he.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 Yr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',o,e,t,n),n}}const ee=Re(Be("use-socket"));function B(){return Zr}function Qr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Zr=function(){let e=1,t,n;const o=new Set;let i=0;const a=new Set;function l(){if(t)i&&(clearTimeout(i),i=0);else return;i=setTimeout(()=>{t.close()},bn*2);const y=new Uint8Array(1);y[0]=wn,t.send(y)}setInterval(()=>{Array.from(o).forEach(y=>{g(y)&&(ee("Handler for event %s requestId %d was expired",y.event,y.requestId),y.requestId?s({requestId:y.requestId,event:_t,data:{message:J.RequestTookToLong().message}}):o.delete(y))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&u()},A.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function s(y){const w=[...o.values()];ee("Handlers array length is %d. Response event: %s. Request id: %d",o.size,y.event,y.requestId),w.forEach(b=>{const T=y.requestId;(b.requestId&&b.requestId===T||!b.requestId&&b.event===y.event)&&(ee("Find appropriated handler: %d, event: %s",e,b.event),b.callback(y.data,y),b.once&&(o.delete(b),ee("Handler was removed by *once* params was passed. %o",b)))})}function u(){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(y){ee("Connection to server was stopped: %d %s",y.code,y.reason),Array.from(o).forEach(w=>{w.guaranteedAnswer&&w.serializeString&&a.add(w.serializeString)})},t.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(y=>{d(y),a.delete(y)})},t.onerror=function(y){console.warn(y)},t.onmessage=y=>{var w;try{if(Qr(y.data)){l();return}const b=JSON.parse(y.data);if(!Bt(b)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(b);return}(w=b==null?void 0:b.data)!=null&&w.refresh&&location.reload(),s(b)}catch(b){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(b)}}}function d(y){t.send(y)}function p(y,w){f({event:y,callback:w})}function h(y,w){f({event:y,callback:w,once:!0})}function m(){return t&&(t==null?void 0:t.readyState)===1}function v(y,w,b){const T=++e,D=JSON.stringify({requestId:T,event:y,data:w,contextId:G.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return m()?d(D):(a.add(D),ee("Socket is not connected. Message was send to save-queue")),new Promise((I,k)=>{f({event:y,requestId:T,once:!0,guaranteedAnswer:!0,serializeString:D,callback:(C,N)=>{if(ee("Promise was resolve with next data:",C),eo(N))return void k(C);b&&b(C,N),I(C)},timeToLive:A.TIME_TO_LIVE_SOCKET_REQUEST})})}function f(y){const w={timeToLive:0,...y,created:new Date().getTime()};o.add(w)}function g(y){return y.timeToLive===0||typeof y.timeToLive!="number"?!1:new Date().getTime()-y.created>y.timeToLive}return{get socket(){return t},on:p,once:h,emit:v,initialization(y){n=y},getDevInfo:c}}(),eo=e=>!!Bt(e)&&e.event===_t,Bt=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function xt(e,t){return B().emit("list-setting:read",{entity:e,mark:t})}function to(e,t){return B().emit("metadata-field:treat",{entity:e,fieldName:t})}function Dt(e,t){return B().emit("entity:create",{...t,entity:e})}function $t(e,t){return B().emit("entity:delete",{...t,entity:e})}function no(e,t){return B().emit("usage-context:read",{...t,entity:e})}function Pt(e={}){return B().emit("tool:read",e)}function ro(){return B().emit("metadata-list:read",{})}function oo(e){return B().emit("history:read",e)}function io(e,t){return B().emit("entity:count",{...t,entity:e})}function ao(e){return`/${En}/${e}`}function ce(e){return{exec(t,n){switch(e.name){case"replace-boolean":return ce.replaceBoolean(t,e.values);case"replace-record-operation":return ce.replaceRecordOperation(t)}}}}ce.replaceBoolean=so;ce.replaceRecordOperation=lo;function so(e,t){return typeof e!="boolean"?"":e?t[1]:t[0]}function lo(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function co(e={}){return B().emit("tool:execute",e)}const uo=Re(Be("wrap-tool-response"));function Vt(e,t){return e.handleConfirmation===void 0&&(e.handleConfirmation=mo),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=ho),e.handleCloseForm===void 0&&(e.handleCloseForm=yo),e.handleValidationResult===void 0&&(e.handleValidationResult=go),{...t,label:t.title,async callback(n={}){var l;const o=typeof e.values=="function"?e.values(t,e):e.values;let i={};t.action.targetName==="Record"&&o.hasOwnProperty("Id")&&(i.Id=o.Id,delete o.Id);const a=()=>co({name:t.name,values:{...o,...n},primaryKeys:i,usageContext:t.usageContext}).then(async c=>{var s,u;if(!fo(c))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const d of e.handlers)await d(t,c,e);if(!c.success)throw e.handleValidationResult&&c.validationEffect&&((u=(s=c.validationEffect)==null?void 0:s.results)!=null&&u.length)&&e.handleValidationResult(t,c.validationEffect,e),new Error(c.message);return c.message&&ot.add("info",c.message),Array.isArray(c.affectedEntities)&&e.handleAffectedEntity&&c.affectedEntities.forEach(d=>{var p;return(p=e.handleAffectedEntity)==null?void 0:p.call(e,t,d,e)}),t.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(t,e),c}).catch(M("error"));if((l=e.overrides)!=null&&l[t.name])return e.overrides[t.name](t,e);if(t.paramDialog){const c=await vo(t,e);if(c===null)return;n=Object.assign(n,c||{})}return t.requireSave&&e.form&&e.form.changed?e.form.save().then(a):!t.confirmation||!e.handleConfirmation||t.paramDialog?a():e.handleConfirmation(t,a)}}}function fo(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function po(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 mo(e,t){const n=po(e.confirmation);if(!H.getComponentFromStore(A.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await H.promptModal(A.MODAL_CONFIRM,{message:n}))return t()}function go(e,t){const n=A.MODAL_VALIDATION_EFFECT;if(!H.getComponentFromStore(n))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{H.pushModal(n,t)})}function ho(e,t,n){var s;function o(u){return u!==null&&typeof u=="object"&&typeof u.read=="function"}function i(u,d){u&&(uo("Affected Entity %s. Find form with name %s.",d,u.name),u.name===d&&o(u)&&u.read(),u instanceof R.Form&&u.dependencies.forEach(p=>i(p,d)))}ye.emit("affected-entity",t);const{router:a,form:l}=n,c=(s=t.primaryKey)==null?void 0:s.Id;if(a&&t&&t.name===e.redirectEntity){ye.emit("display-entity",{id:c,name:t.name}),S.getEntityLink&&a.push(S.getEntityLink(t.name,c));return}i(l,t.name)}function yo(e,t){const{router:n}=t;n&&e.closeHostForm&&n.back()}function vo(e,t){var n;if((n=e.paramDialog)!=null&&n.name)return H.promptModal(e.paramDialog.name,{paramDialog:e.paramDialog,tool:e,options:t})}let te={};function Q(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=R.utils.getPropFromObject((this==null?void 0:this.vocabulary)||te,e);if(typeof n=="string")return dt(n,t);const o=R.utils.getPropFromObject(te==null?void 0:te.root,e);return typeof o=="string"?dt(o,t):(typeof n===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function dt(e,t){return t.forEach((n,o)=>{e=e.replaceAll(new RegExp(`\\{${o}}`,"g"),n)}),e}Q.setGlobalVocabulary=function(e){te=e};Q.getScope=function(e){const t=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),Q.bind({vocabulary:R.utils.getPropFromObject(te,t.toLowerCase())})};Q.setVocabulary=function(e){return typeof e=="string"&&(e=R.utils.getPropFromObject(te,e)),Q.bind({vocabulary:e})};function wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var We={exports:{}},O={},qe={exports:{}},re={};function Mt(){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 bo(e,t,n){}function Eo(e,t,n){}var Co=/javascript\s*\:/img;function ko(e,t){return Co.test(t)?"":t}re.whiteList=Mt();re.getDefaultWhiteList=Mt;re.onAttr=bo;re.onIgnoreAttr=Eo;re.safeAttrValue=ko;var _o={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,"")}},de=_o;function To(e,t){e=de.trimRight(e),e[e.length-1]!==";"&&(e+=";");var n=e.length,o=!1,i=0,a=0,l="";function c(){if(!o){var d=de.trim(e.slice(i,a)),p=d.indexOf(":");if(p!==-1){var h=de.trim(d.slice(0,p)),m=de.trim(d.slice(p+1));if(h){var v=t(i,l.length,h,m,d);v&&(l+=v+"; ")}}}i=a+1}for(;a<n;a++){var s=e[a];if(s==="/"&&e[a+1]==="*"){var u=e.indexOf("*/",a+2);if(u===-1)break;a=u+1,i=a+1,o=!1}else s==="("?o=!0:s===")"?o=!1:s===";"?o||c():s===`
@@ -9,5 +9,5 @@
9
9
  * jenesius-event-emitter v1.0.2
10
10
  * (c) 2022 Jenesius
11
11
  * @license MIT
12
- */const wt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},bt=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},Et=function(e,t){const n=this.events[e];if(!n)return;const o=n.indexOf(t);o!==-1&&n.splice(o,1)},Ct=function(){this.events={}};class K{constructor(){this.events={}}on(t,n){return wt.call(this,t,n)}emit(t,n){return bt.call(this,t,n)}off(t,n){return Et.call(this,t,n)}cleanEvents(){Ct.call(this)}static on(t,n){return wt.call(K,t,n)}static emit(t,n){return bt.call(K,t,n)}static off(t,n){return Et.call(K,t,n)}static cleanEvents(){Ct.call(K)}}K.events={};class Hi extends K{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return Si(this.id,t)}static checkAndGenerate(t,n,o){return Ai(t,n,o).then(i=>i.length===0?Ti(t,n,o):i[0])}}function Gi(){return B().emit("client:read",{})}class it extends Error{static ConstContextCannotBeChanged(){return new it("The current context is set to constant. In order to change it, you need to put Manager into a changeable state.")}}var ve,ae;const X=class X extends K{constructor(){super(...arguments);Ve(this,ve);Ve(this,ae);this.isConstContext=!1,this.type="front",this.organizations=[],ke(this,ae,!1)}set language(n){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextId(){return Pe(this,ve)}set contextId(n){if(this.isConstContext)throw it.ConstContextCannotBeChanged();ke(this,ve,n)}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){ke(this,ae,n),this.emit(X.EVENT_READY_UPDATE,n)}get ready(){return Pe(this,ae)}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=typeof n=="number"?n:Number(n),localStorage.setItem(A.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.customer=n,this.person=n,this.organizations=n.organizations,this.userId=n.userId,this.restoreCurrentContext(),this.ready=!0}catch(n){M()(n)}}restoreCurrentContext(){var o;if(typeof((o=this.customer)==null?void 0:o.constContextId)=="number")return this.isConstContext=!0,this.setCurrentContext(this.customer.constContextId);const n=Number.parseInt(localStorage.getItem(A.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 Gi()}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}}};ve=new WeakMap,ae=new WeakMap,X.DEFAULT_LANGUAGE="en",X.EVENT_CONTEXT_UPDATE="event:context-update",X.EVENT_READY_UPDATE="event:ready-update";let Ge=X;function zi(e){return B().emit("metadata:read",{entity:e})}const he=function(){const t=r.reactive({}),n=new Map;function o(c){return t[c]}async function i(c){if(n.has(c)&&await n.get(c),t[c])return;const s=await a(c);l(c,s)}function a(c){const s=zi(c).finally(()=>{n.delete(c)});return n.set(c,s),s}function l(c,s){t[c]=s}return{state:t,initEntity:i,get:o,loadingFlags:n}}();class Xi extends K{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 z{static login(t){return W(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 z.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return z.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return z.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return z.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return W(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return z.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return z.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return z.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return W(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(z.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 W(`${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 W(`${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 W(`${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,i){return W(`${S.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:o,ConfirmedPassword:i})})}}class Ki{static readHistoryById(t,n){return W(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Yi{static getConfiguration(){return W("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await W(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Ji{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return W(`/open-api/internationalization/language/${t}`)}}class Qi{static async upload(t,n){const o=new FormData;return o.append("file",t),W(`/close-api/files?entityName=${n}`,{method:"POST",body:o}).then(i=>(i.filename=t.name,i))}}var rn=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(rn||{}),on=(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))(on||{});function Zi(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function x(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(Zi(o)){let i=function(a){var l;return((l=a.match(/([^Z]*)/))==null?void 0:l[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(x.is(n,o)),t)},[]).join(" and ")}function Ee(e){return typeof e=="string"?`'${e}'`:`${e}`}x.includes=function(t,n){return`@${t} Contains ${Ee(n)}`};x.beginWith=function(t,n){return`@${t} BeginWith ${Ee(n)}`};x.notEq=function(t,n){return`@${t} nq ${Ee(n)}`};x.eq=function(t,n){return Array.isArray(n)?x.in(t,n):`@${t} eq ${Ee(n)}`};x.in=function(t,n){const o=n.map(Ee).join(", ");return`@${t} in (${o})`};x.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":x.and(...n.map(o=>x.notEq(t,o)))};x.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(x.wrap).join(" and ")};x.wrap=function(t){return`(${t})`};x.is=function(t,n){return`@${t} is ${n}`};x.or=function(...t){return t.join(" or ")};function at(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=at(o)),t[i]=o,t},{})}var V=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(V||{});const G=new Ge,ye=new Xi;exports.ApplicationStatus=on;exports.Communication=Hi;exports.CoreError=J;exports.DisplayListRow=nt;exports.EventBus=ye;exports.Filter=x;exports.Manager=G;exports.MetadataStore=he;exports.ModalListDownload=jr;exports.NotificationSystem=ot;exports.OBJECT_TYPE_NAME_FIELD=Tt;exports.RecordOperation=rn;exports.WidgetAction=Mr;exports.WidgetButton=Wn;exports.WidgetFastTable=Vr;exports.WidgetFastTableHeadCell=Nt;exports.WidgetField=pr;exports.WidgetIcon=me;exports.WidgetImage=Zn;exports.WidgetList=dr;exports.WidgetLoader=It;exports.WidgetMultiButton=Kn;exports.WidgetSpinner=be;exports.WidgetTable=St;exports.WidgetTablePanelFilterItem=Lt;exports.asyncProcess=le;exports.authService=z;exports.billingService=oe;exports.catchUniversal=M;exports.config=On;exports.configuration=S;exports.constants=A;exports.convertDDToDMS=mi;exports.convertDMSToDD=pi;exports.convertListConfig=en;exports.coreUtils=bi;exports.debounce=Xr;exports.documentsService=fn;exports.fileService=Qi;exports.formatter=ce;exports.getCellName=se;exports.getCellValue=Fe;exports.getEntityLink=tt;exports.getNamesFromListConfig=Qe;exports.getUnitValue=Ue;exports.groupArrayByField=Hr;exports.historyService=Ki;exports.injectAction=Ot;exports.internationalizationService=Ji;exports.invitationService=un;exports.openService=Yi;exports.parseError=Ye;exports.parseTextByMarkdown=di;exports.prettyDate=Ne;exports.prettyDateWithTime=Rt;exports.prettyMoney=Ft;exports.prettyValueFieldByEntity=Jr;exports.request=W;exports.setupListRow=Xe;exports.staticLink=ao;exports.t=Q;exports.throttle=Kr;exports.universalEntityCount=io;exports.universalEntityCreate=Dt;exports.universalEntityDelete=$t;exports.universalEntityRead=ne;exports.universalEntityUpdate=Je;exports.universalHistoryRead=oo;exports.universalListSettingRead=xt;exports.universalMetadataFieldTreat=to;exports.universalMetadataListRead=ro;exports.universalToolRead=Pt;exports.useActions=Ri;exports.useCommunication=Ni;exports.useEnter=Fi;exports.useFormEntity=Li;exports.useListActiveRow=Ei;exports.useListDownload=nn;exports.useListEntity=ki;exports.useListSearch=xi;exports.useListSelect=Bi;exports.useLocalStorage=At;exports.useManagerState=_i;exports.useMetadata=De;exports.useSocket=B;exports.useUsageContext=rt;exports.useVisibleItem=Ke;exports.useWizard=Mi;exports.uuidv4=Gr;exports.valuesToUpperCase=at;exports.wrapToolResponse=Vt;
12
+ */const wt=function(e,t){return e in this.events||(this.events[e]=[]),this.events[e].push(t),this.off.bind(this,e,t)},bt=function(e,t){e in this.events&&this.events[e].forEach(n=>n(t))},Et=function(e,t){const n=this.events[e];if(!n)return;const o=n.indexOf(t);o!==-1&&n.splice(o,1)},Ct=function(){this.events={}};class K{constructor(){this.events={}}on(t,n){return wt.call(this,t,n)}emit(t,n){return bt.call(this,t,n)}off(t,n){return Et.call(this,t,n)}cleanEvents(){Ct.call(this)}static on(t,n){return wt.call(K,t,n)}static emit(t,n){return bt.call(K,t,n)}static off(t,n){return Et.call(K,t,n)}static cleanEvents(){Ct.call(K)}}K.events={};class Hi extends K{constructor(t){super(),this.name="Communication",this.read=()=>{},this.id=t}sendMessage(t){return Si(this.id,t)}static checkAndGenerate(t,n,o){return Ai(t,n,o).then(i=>i.length===0?Ti(t,n,o):i[0])}}function Gi(){return B().emit("client:read",{})}class it extends Error{static ConstContextCannotBeChanged(){return new it("The current context is set to constant. In order to change it, you need to put Manager into a changeable state.")}}var ve,ae;const X=class X extends K{constructor(){super(...arguments);Ve(this,ve);Ve(this,ae);this.isConstContext=!1,this.type="front",this.organizations=[],ke(this,ae,!1)}set language(n){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextId(){return Pe(this,ve)}set contextId(n){if(this.isConstContext)throw it.ConstContextCannotBeChanged();ke(this,ve,n)}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){ke(this,ae,n),this.emit(X.EVENT_READY_UPDATE,n)}get ready(){return Pe(this,ae)}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=typeof n=="number"?n:Number(n),localStorage.setItem(A.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.customer=n,this.person=n,this.organizations=n.organizations,this.userId=n.userId,this.restoreCurrentContext(),this.ready=!0}catch(n){M()(n)}}restoreCurrentContext(){var o;if(typeof((o=this.customer)==null?void 0:o.constContextId)=="number")return this.setCurrentContext(this.customer.constContextId),this.isConstContext=!0;const n=Number.parseInt(localStorage.getItem(A.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 Gi()}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}}};ve=new WeakMap,ae=new WeakMap,X.DEFAULT_LANGUAGE="en",X.EVENT_CONTEXT_UPDATE="event:context-update",X.EVENT_READY_UPDATE="event:ready-update";let Ge=X;function zi(e){return B().emit("metadata:read",{entity:e})}const he=function(){const t=r.reactive({}),n=new Map;function o(c){return t[c]}async function i(c){if(n.has(c)&&await n.get(c),t[c])return;const s=await a(c);l(c,s)}function a(c){const s=zi(c).finally(()=>{n.delete(c)});return n.set(c,s),s}function l(c,s){t[c]=s}return{state:t,initEntity:i,get:o,loadingFlags:n}}();class Xi extends K{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 z{static login(t){return W(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 z.requestStepRegistrationProcess("StartRegistration",t)}static confirmPhoneRegistrationProcess(t){return z.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",t)}static confirmEmailRegistrationProcess(t){return z.requestStepRegistrationProcess("ConfirmEmailByRegistration",t)}static finishEmailRegistrationProcess(t){return z.requestStepRegistrationProcess("FinishRegistration",t)}static requestStepRegistrationProcess(t,n){return W(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)})}static startLoginProcess(t){return z.requestStepLoginProcess("StartLogin",t)}static loginWithPassword(t){return z.requestStepLoginProcess("LoginWithPassword",t)}static loginWithOtpCode(t){return z.requestStepLoginProcess("LoginWithOtpCode",t)}static requestStepLoginProcess(t,n){return W(`${S.identityServerURL}/api/Authenticate/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(n)}).then(z.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 W(`${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 W(`${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 W(`${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,i){return W(`${S.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:t,Token:n,Password:o,ConfirmedPassword:i})})}}class Ki{static readHistoryById(t,n){return W(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Yi{static getConfiguration(){return W("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await W(`/open-api/data/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Ji{static getDictionary(t){if(!t)throw new Error(`Can't get dictionary for ${t}.`);return W(`/open-api/internationalization/language/${t}`)}}class Qi{static async upload(t,n){const o=new FormData;return o.append("file",t),W(`/close-api/files?entityName=${n}`,{method:"POST",body:o}).then(i=>(i.filename=t.name,i))}}var rn=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(rn||{}),on=(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))(on||{});function Zi(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function x(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(Zi(o)){let i=function(a){var l;return((l=a.match(/([^Z]*)/))==null?void 0:l[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(x.is(n,o)),t)},[]).join(" and ")}function Ee(e){return typeof e=="string"?`'${e}'`:`${e}`}x.includes=function(t,n){return`@${t} Contains ${Ee(n)}`};x.beginWith=function(t,n){return`@${t} BeginWith ${Ee(n)}`};x.notEq=function(t,n){return`@${t} nq ${Ee(n)}`};x.eq=function(t,n){return Array.isArray(n)?x.in(t,n):`@${t} eq ${Ee(n)}`};x.in=function(t,n){const o=n.map(Ee).join(", ");return`@${t} in (${o})`};x.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":x.and(...n.map(o=>x.notEq(t,o)))};x.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(x.wrap).join(" and ")};x.wrap=function(t){return`(${t})`};x.is=function(t,n){return`@${t} is ${n}`};x.or=function(...t){return t.join(" or ")};function at(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=at(o)),t[i]=o,t},{})}var V=(e=>(e.Completed="Completed",e.FinalStep="FinalStep",e.NextStep="NextStep",e.FinalStepWithConfirmation="FinalStepWithConfirmation",e.NextStepWithConfirmation="NextStepWithConfirmation",e.ValidationError="ValidationError",e.Undefined="Undefined",e))(V||{});const G=new Ge,ye=new Xi;exports.ApplicationStatus=on;exports.Communication=Hi;exports.CoreError=J;exports.DisplayListRow=nt;exports.EventBus=ye;exports.Filter=x;exports.Manager=G;exports.MetadataStore=he;exports.ModalListDownload=jr;exports.NotificationSystem=ot;exports.OBJECT_TYPE_NAME_FIELD=Tt;exports.RecordOperation=rn;exports.WidgetAction=Mr;exports.WidgetButton=Wn;exports.WidgetFastTable=Vr;exports.WidgetFastTableHeadCell=Nt;exports.WidgetField=pr;exports.WidgetIcon=me;exports.WidgetImage=Zn;exports.WidgetList=dr;exports.WidgetLoader=It;exports.WidgetMultiButton=Kn;exports.WidgetSpinner=be;exports.WidgetTable=St;exports.WidgetTablePanelFilterItem=Lt;exports.asyncProcess=le;exports.authService=z;exports.billingService=oe;exports.catchUniversal=M;exports.config=On;exports.configuration=S;exports.constants=A;exports.convertDDToDMS=mi;exports.convertDMSToDD=pi;exports.convertListConfig=en;exports.coreUtils=bi;exports.debounce=Xr;exports.documentsService=fn;exports.fileService=Qi;exports.formatter=ce;exports.getCellName=se;exports.getCellValue=Fe;exports.getEntityLink=tt;exports.getNamesFromListConfig=Qe;exports.getUnitValue=Ue;exports.groupArrayByField=Hr;exports.historyService=Ki;exports.injectAction=Ot;exports.internationalizationService=Ji;exports.invitationService=un;exports.openService=Yi;exports.parseError=Ye;exports.parseTextByMarkdown=di;exports.prettyDate=Ne;exports.prettyDateWithTime=Rt;exports.prettyMoney=Ft;exports.prettyValueFieldByEntity=Jr;exports.request=W;exports.setupListRow=Xe;exports.staticLink=ao;exports.t=Q;exports.throttle=Kr;exports.universalEntityCount=io;exports.universalEntityCreate=Dt;exports.universalEntityDelete=$t;exports.universalEntityRead=ne;exports.universalEntityUpdate=Je;exports.universalHistoryRead=oo;exports.universalListSettingRead=xt;exports.universalMetadataFieldTreat=to;exports.universalMetadataListRead=ro;exports.universalToolRead=Pt;exports.useActions=Ri;exports.useCommunication=Ni;exports.useEnter=Fi;exports.useFormEntity=Li;exports.useListActiveRow=Ei;exports.useListDownload=nn;exports.useListEntity=ki;exports.useListSearch=xi;exports.useListSelect=Bi;exports.useLocalStorage=At;exports.useManagerState=_i;exports.useMetadata=De;exports.useSocket=B;exports.useUsageContext=rt;exports.useVisibleItem=Ke;exports.useWizard=Mi;exports.uuidv4=Gr;exports.valuesToUpperCase=at;exports.wrapToolResponse=Vt;
13
13
  //# sourceMappingURL=eservices-core.cjs.js.map
@@ -11,7 +11,7 @@ import Rn from "date-and-time";
11
11
  import tt from "debug";
12
12
  import { promptModal as vt, openModal as ut, onBeforeModalClose as Nn, popModal as kt, getComponentFromStore as qt, pushModal as $n } from "jenesius-vue-modal";
13
13
  /*!
14
- * eservices-core v1.3.244
14
+ * eservices-core v1.3.245
15
15
  * (c) 2024 ESERVICES
16
16
  */
17
17
  const $ = class $ extends Error {
@@ -3588,7 +3588,7 @@ const ne = class ne extends se {
3588
3588
  restoreCurrentContext() {
3589
3589
  var r;
3590
3590
  if (typeof ((r = this.customer) == null ? void 0 : r.constContextId) == "number")
3591
- return this.isConstContext = !0, this.setCurrentContext(this.customer.constContextId);
3591
+ return this.setCurrentContext(this.customer.constContextId), this.isConstContext = !0;
3592
3592
  const n = Number.parseInt(localStorage.getItem(O.LOCALSTORAGE_CURRENT_CONTEXT_KEY) || "");
3593
3593
  if (!Number.isNaN(n) && this.validateContextId(Number(n))) this.setCurrentContext(n);
3594
3594
  else {
@@ -1,6 +1,6 @@
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}.justify-content-center{justify-content:center}.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{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}.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,.widget-table-cell_money{text-align:end}.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}.flex,.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}.gap-10{gap:10px}.gap-15{gap:15px}.gap-5{gap:5px}.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}.padding-bottom-10{padding-bottom:10px}.padding-10{padding:10px}.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-cd8043dd]{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-cd8043dd]{padding:6px 11px;transition:.1s;cursor:pointer}.widget-filter-enum-item[data-v-cd8043dd]: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-d131e64e]{display:flex;gap:4px}.widget-head-cell-order[data-v-d131e64e]{display:flex;flex-direction:column;justify-content:center;gap:2px}.widget-head-cell-label[data-v-d131e64e]{cursor:pointer}.widget-fast-table-head-cell-td[data-v-d131e64e]{padding:7px}.widget-head-cell-order-icon[data-v-d131e64e]{transition:.1s;height:18px;width:18px}.widget-head-cell-order-icon_desc[data-v-d131e64e]{transform:rotate(180deg)}.widget-filter-item-container[data-v-e52e165e]{position:relative}.widget-filter-item-arrow[data-v-e52e165e]{transform:rotate(180deg)}.widget-filter-item-label_active[data-v-e52e165e]{font-weight:700}.widget-filter-item[data-v-e52e165e]{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-e52e165e]{-webkit-user-select:none;user-select:none;padding:4px 2px 4px 8px}.widget-filter-item-popup[data-v-e52e165e]{position:absolute;z-index:2;inset-block-start:100%;inset-inline-end:0}.widget-filter-item-arrow[data-v-e52e165e]{transition:.2s}.widget-table-panel-filter[data-v-89e1fa2d]{justify-content:end;background-color:var(--color-primary)}.widget-fast-table-tools[data-v-973a3749]{display:flex;gap:15px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
2
2
  (function(p,r){typeof exports=="object"&&typeof module<"u"?r(exports,require("vue"),require("jenesius-vue-form"),require("vue-router"),require("date-and-time"),require("debug"),require("jenesius-vue-modal")):typeof define=="function"&&define.amd?define(["exports","vue","jenesius-vue-form","vue-router","date-and-time","debug","jenesius-vue-modal"],r):(p=typeof globalThis<"u"?globalThis:p||self,r(p["eservices-core"]={},p.Vue,p.JenesiusVueForm,p.VueRouter,p.DateAndTime,p.Debug,p.JenesiusVueModal))})(this,function(p,r,S,Y,sn,_e,H){"use strict";var on=p=>{throw TypeError(p)};var an=(p,r,S)=>r.has(p)||on("Cannot "+S);var at=(p,r,S)=>(an(p,r,"read from private field"),S?S.call(p):r.get(p)),st=(p,r,S)=>r.has(p)?on("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(p):r.set(p,S),Pe=(p,r,S,Y)=>(an(p,r,"write to private field"),Y?Y.call(p,S):r.set(p,S),S);/*!
3
- * eservices-core v1.3.244
3
+ * eservices-core v1.3.245
4
4
  * (c) 2024 ESERVICES
5
5
  */var Ee,ue;const R=class R extends Error{constructor(n,t=null){super(),this.message=n,this.details=t,this.id=R.ID++}static ParentFormNotFound(){return new R("Can't found parent form.")}static UndefinedNameOfCompositeFormController(n){return new R("Composite object name is undefined",n)}static EntityWithoutName(n){return new R("'Entity doesn't have a name",n)}static NotResolvedNameEventEmitter(n){return new R(`'${n}' is not a valid Event emitter name`)}static FormIsNotValidated(n){return new R("Form is not validated",n)}static ListWorkerIsRunningOrEnd(n){return new R("List data request is running or already done",n)}static ObjectIdNotNumber(n){return new R(`${n} (id) is not a number`)}static UndefinedErrorId(n,t){return R.ApiNotAvailable()}static ApiError(n){return new R("Request error",n)}static ApiNotAvailable(){return new R(`Sorry, we experience difficulties here.
6
6
  Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(n,t){return!n&&!t?R.ApiNotAvailable():new R(n||"Authorization Error",t)}static ApiResponseParseFailed(){return R.ApiNotAvailable()}static MissingIdInValuesEntity(n){return new R("Object doesn't have id",n)}static ObjectWithIdNotFound(n,t){return new R(`Can't find object with id: ${n}`,t)}static ObjectWithoutConnectToPresentArray(n,t){return new R("Object is not found.",{object:n,array:t})}static EntityWithoutId(n){return new R("Entity doesn't have id.",n)}static NotFoundedTableIndex(n,t){return new R(`Can't find the element with tableIndex ${n}`,t)}static UndefinedError(n,t=[]){return new R(n,t)}static TableArrayAlreadyIncludeProvidedIndexValue(n,t,i){return new R(`Array already includes the element with value ${n}`,{array:t,table:i})}static MetadataEntityIsNotAvailable(n){return new R(`Metadata for the ${n} is not currently available.`)}static RequestTookToLong(){return new R("The request took too long to complete. Try again later.")}};R.ID=0;let Q=R;const ln="Please try again later or submit a feedback if problem doesn't go.";function cn(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return ln}})}function ae(e,n={}){return n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw Q.ApiNotAvailable()}).then(t=>cn(t).then(i=>{if(!t.ok)throw i;return i}))}class fn{constructor(){this.public=!1,this.errors=new Proxy([],{set:(n,t,i)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(i)}`),n[t]=i,!0)}),window._journal=this}get error(){return{add:(...n)=>{this.errors.push(n)},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 fn;class un{static invite(n,t,i){return ae("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:n,personKey:t,relatedRoleCode:i})})}static accept(n,t){return ae("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!0})})}static decline(n,t){return ae("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:n,version:t,mark:!1})})}}class dn{static getRequiredDocuments(n,t,i){const o=new URLSearchParams({entity:n,primaryKey:t,statusCode:i});return fetch(`/close-api/views/required-documents?${o.toString()}`).then(a=>a.json())}}class se{static url(){return"close-api/billing"}static getBillingMetadata(n){return fetch(`/${se.url()}/calculator/${n}`)}static calculate(n,t){return ae(`/${se.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:n,values:t})}).then(i=>{if(i&&i.status===1)return i;throw Array.isArray(i.notes)?new Error(i.notes[0]):Q.ApiNotAvailable()})}static parseMetadataField(n){function t(i){switch(i.type){case"ValueType":switch(i.dataType){case"Integer":return"number";default:return i.dataType}case"EntityReference":return i.dataType}}return{name:n.name,label:n.title,required:n.required,type:t(n)}}static createOnlinePayment(n,t){return ae(`/${se.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:n,returnURL:t})})}static applyOnlinePayment(n){return ae(`/${se.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:n})})}}const pn={class:"widget-table__head-cell"},mn={key:1,class:"widget-table__head-label margin_0 text_overflow"},lt=r.defineComponent({__name:"widget-table-head-cell",props:{label:{},type:{}},emits:["select"],setup(e,{emit:n}){const t=n;function i(){t("select")}return(o,a)=>(r.openBlock(),r.createElementBlock("th",pn,[o.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(S.FormField),{key:0,onClick:i})):(r.openBlock(),r.createElementBlock("span",mn,r.toDisplayString(o.label),1))]))}}),gn={class:"widget-table__head"},hn=r.defineComponent({__name:"widget-table-head",props:{config:{}},setup(e){return r.computed(()=>N.componentTableHeadCell||lt),(n,t)=>(r.openBlock(),r.createElementBlock("tr",gn,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(n.config,i=>r.renderSlot(n.$slots,"default",r.mergeProps({ref_for:!0},i),void 0,!0)),256))]))}}),U=(e,n)=>{const t=e.__vccOpts||e;for(const[i,o]of n)t[i]=o;return t},yn=U(hn,[["__scopeId","data-v-498c4f00"]]);function Ve(e){return Array.isArray(e)?Ve(e[0]):typeof e!="string"?null:e}function le(e){return Ve(e.name)}function wn(e){const n=new RegExp(/\$\{([a-zA-Z0-9.]+)}/,"g"),t=[];let i;for(;(i=n.exec(e))!==null;)t.push(i[1]);return t}function bn(e,n){return wn(e).forEach(i=>{e=e.replace(new RegExp("\\$\\{"+i+"}","g"),S.utils.getPropFromObject(n,i))}),e}function Me(e){return n=>typeof n=="string"||typeof n=="number"?`${n} ${e}`:""}function Te(e,n){const t=le(e);if(typeof e.value=="string")return bn(e.value,n);let i=t?S.utils.getPropFromObject(n,t):null;if(i===void 0&&(i=null),typeof e.value=="function")return e.value(i,n);if(e.value===null)return null;switch(e.unitValue&&(i=Me(e.unitValue)(i)),e.unit&&(i=Me(e.unit)(i)),e.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Se(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=Et(typeof i=="string"?i:null);break}case"money":{i=Ct(i);break}case"DateTime":{i=Se(typeof i=="string"?i:null,e.format||N.dateTimeFormat);break}}return e.formatter&&(i=fe(e.formatter).exec(i,n)),typeof i=="boolean"&&(i=i?"✓":"—"),i}const En=1,Cn=5e3,kn="static-folder",ct="request-error",ft="EntityTypeName",I={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",MODAL_LIST_DOWNLOAD:"list-download",MODAL_LIST_SETTINGS:"list-settings",MODAL_SIMPLE_TOOL_PARAMETERS:"SimpleToolParameters",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:ft,FIELD_NAME_REFERENCE_CHANGES:"REFERENCE_CHANGES"};function Ae(e){return[I.CORE_DEBUG_LABEL,e].join(":")}const _n={class:"widget-filter-text flex gap_20"},Tn=U(r.defineComponent({__name:"widget-filter-text",props:{values:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,i=n,o=r.ref("");function a(){i("update:values",o.value)}return r.watch(()=>t.values,l=>{if(typeof l!="string")return o.value="";o.value=l},{immediate:!0}),(l,c)=>{const s=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",_n,[r.createVNode(r.unref(S.FormField),{type:"text",modelValue:o.value,"onUpdate:modelValue":c[0]||(c[0]=f=>o.value=f)},null,8,["modelValue"]),r.createVNode(s,{onClick:a,type:"primary"},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(r.unref(Z)("Apply")),1)]),_:1})])}}}),[["__scopeId","data-v-800b3803"]]),An={class:"widget-filter-enum"},Sn={class:"flex gap-10 padding-10"},In=U(r.defineComponent({__name:"widget-filter-entity",props:{baseEntity:{},filters:{},values:{},filterMetadata:{}},emits:["update:values","readProcess"],setup(e,{emit:n}){const t=e,i=r.ref([]),o=Be(t.filterMetadata.entity),a=d=>(t.values||[]).includes(d),l=n;function c(d){const m=t.values||[];return m.includes(d)?l("update:values",m.filter(y=>y!==d)):l("update:values",[...m,d])}const s=ce(async()=>{i.value=await te(t.baseEntity,{fields:t.filterMetadata.name.join(" "),order:[t.filterMetadata.name[1],"asc"],distinct:!0,filter:F(t.filters)}).then(d=>d.map(m=>({label:m[t.filterMetadata.name[1]],value:m[t.filterMetadata.name[0]]})))});function f(){l("update:values",[])}return r.watch(()=>s.loading,d=>{l("readProcess",d?"start":"end")},{immediate:!0}),r.watch(()=>o.value,()=>{s.loading||s.call()},{immediate:!0}),(d,m)=>{const y=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",An,[r.createElementVNode("div",Sn,[r.createVNode(y,{label:"Reload filter",loading:r.unref(s).loading||!1,icon:"reload",onClick:m[0]||(m[0]=()=>r.unref(s).call())},null,8,["loading"]),r.createVNode(y,{label:"Clear",onClick:f})]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(i.value,g=>(r.openBlock(),r.createBlock(r.unref(S.FormField),{class:"widget-filter-enum-item",key:g.value,onClick:()=>c(g.value),type:"single-checkbox","model-value":a(g.value),label:g.label},null,8,["onClick","model-value","label"]))),128))])}}}),[["__scopeId","data-v-cd8043dd"]]),de=r.reactive({});function vn(){dt(),setInterval(dt,50)}function ut(){return de}function dt(){const e={};Object.entries(localStorage).forEach(([n,t])=>{e[n]=!0,de[n]!==t&&(de[n]=t)}),Object.keys(de).forEach(n=>{e[n]||delete de[n]})}const N={getEntityLink(e,n){return`/forms/${e}/${n}`},iconHandlerText(){return""},iconTag:"i",dateTimeFormat:"DD/MM/YYYY HH:mm:ss",tableFilterEntityBind:{String:Tn,Entity:In},arrayListCellHandlers:[],arrayFieldParamsHandlers:[]};function Nn(e){vn();for(let n in e)N[n]=e[n]}const pe=U({props:{name:String},setup(e,n){let t="unknown";try{t=n.slots.default()[0].children}catch{t=e.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>r.h(N.iconTag,{class:N.iconHandler?N.iconHandler(t):`icon icon-${t}`},N.iconHandlerText(t))}},[["__scopeId","data-v-8a72b45f"]]),Ln=_e(Ae("setup-list-row"));function On(e,n){const t=e.config.map(i=>Rn(i,e,n));return r.h("tr",{class:"widget-table__row widget-table-row"},t)}function Rn(e,n,t){const i=n.values;let o=Te(e,i);const a={onClick:[],title:e.hint,class:["widget-table__cell widget-table-cell"]};function l(d){a.onClick.push(()=>d(i,e,t))}function c(d){Array.isArray(d)?a.class.push(...d):a.class.push(d)}const s=[],f=[];if(e.hide&&e.hide(i))return[r.h("td")];if(e.type)switch(c(`widget-table-cell_${e.type}`),e.type){case"multi-select":{f.push(r.h(S.FormField,{type:"single-checkbox",modelValue:n.selected})),l(pt.bind(null,t,!0));break}case"select":{f.push(r.h(S.FormField,{type:"single-radio",modelValue:n.selected})),l(pt.bind(null,t,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const d=e.link(i);if(d){const m=r.h(Y.RouterLink,{to:d});f.push(m),c("widget-table-cell_link")}}catch(d){Ln("Can't add router link",d)}if(e.href&&(f.push(r.h("a",{href:e.href(i),target:"_blank"})),c("widget-table-cell_link")),(typeof o=="string"||typeof o=="number")&&f.push(r.h("p",{class:"widget-list-cell-text"},o)),e.icon&&(typeof e.icon=="string"&&f.push(r.h(pe,{name:e.icon})),typeof e.icon=="function")){const d=e.icon(i);d!==null&&f.push(r.h(pe,{name:d}))}return e.class&&(typeof e.class=="function"?c(e.class(i)):c(e.class)),N.listCellHandler&&(console.log("listCellHandler is deprecated. Please use coreUtils.addListCellHandler instead."),N.listCellHandler(e,i,{cellNodeChildren:f,addClass:c,addHandleClick:l,context:t})),N.arrayListCellHandlers&&N.arrayListCellHandlers.forEach(d=>d(e,i,{cellNodeChildren:f,addClass:c,addHandleClick:l,context:t})),s.push(r.h("td",a,f)),s}function pt(e,n){e.emit("select",n)}function xe(e,n){return()=>{try{return On(e,n)}catch(t){return console.warn(t),null}}}const $n={props:{values:Object,config:Object,selected:Boolean},setup:xe},Bn=["colspan"],mt=r.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(e,{emit:n}){const t=n,i=r.ref();return r.onMounted(()=>{setTimeout(()=>{i.value&&i.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(o,a)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:i},[r.createElementVNode("td",{colspan:o.rowLength},[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(o.component),r.mergeProps(o.$attrs,{values:o.values,new:o.isNew,onClose:a[0]||(a[0]=l=>t("close")),onSave:a[1]||(a[1]=l=>t("save",l))}),null,16,["values","new"]))],8,Bn)],512))}}),Dn={class:"widget-table"},Ue="update:selectedRows",Fn="update:activeRow",gt=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:n}){const t=e,i=n,o=r.useSlots(),a=r.computed(()=>{var g;return(g=o==null?void 0:o.default)==null?void 0:g.call(o)[0]});function l(){const b=t.selectedRows.length!==0?[]:[...t.array];i(Ue,b)}function c(g){return t.useMockField?Kt(g):g}function s(g,b=!0){if(!t.selectedRows)return;if(!b)return i(Ue,t.selectedRows.includes(g)?[]:[g]);const u=[...t.selectedRows],h=u.indexOf(g);return h===-1?u.push(g):u.splice(h,1),i(Ue,u)}function f(g){i(Fn,g)}function d(g){i("save",g),i("update:activeRow",null)}const m=r.computed(()=>t.shortcut?t.config.filter(g=>g.name?!!t.array.find(u=>![null,""].includes(Te(g,u))):!0):t.config),y=r.computed(()=>t.useMockField?t.array.filter(Kt):t.array);return(g,b)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Dn,[r.createElementVNode("thead",null,[r.createVNode(yn,{config:m.value,onOrder:b[0]||(b[0]=u=>g.$emit("order",u))},{default:r.withCtx(u=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(g.$slots["head-cell"]||lt),r.mergeProps(u,{onSelect:l}),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(y.value,(u,h)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:h},[r.createVNode($n,{config:m.value,values:u,selected:g.selectedRows.includes(c(u)),onSelect:w=>s(c(u),w),onActivate:w=>f(c(u)),class:r.normalizeClass(g.classCallback?g.classCallback(u):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&g.activeRow===c(u)?(r.openBlock(),r.createBlock(mt,{key:0,component:a.value,"row-length":g.config.length,values:u,onClose:b[1]||(b[1]=w=>i("update:activeRow",null)),onSave:d,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),g.activeRow===r.unref(I).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(mt,{key:0,component:a.value,"row-length":m.value.length,onClose:b[2]||(b[2]=u=>i("update:activeRow",null)),onSave:d,"is-new":!0},null,8,["component","row-length"])):r.createCommentVNode("",!0)])])]))}}),me=U(r.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",{class:"widget-spinner",style:r.normalizeStyle({"border-left":`1.1em solid ${n.color}`})},null,4))}}),[["__scopeId","data-v-0ef9ae88"]]),Pn={class:"widget-button"},Vn=U(r.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("button",Pn,[n.wait?(r.openBlock(),r.createBlock(me,{key:0,class:"widget-button-spinner"})):r.createCommentVNode("",!0),r.renderSlot(n.$slots,"default",{},void 0,!0)]))}}),[["__scopeId","data-v-450dc564"]]),Mn={class:"widget-multi-button-wrap position_relative cursor_pointer"},xn={class:"widget-multi-button-body grid"},Un=["onClick"],Wn={class:"widget-multi-button-side-wrap"},jn=U(r.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(e){r.useCssVars(l=>({"04895bf1":i.value}));const n=e,t=r.reactive({active:!1,wait:!1}),i=r.computed(()=>n.array.length+(n.label?1:0));function o(l){if(!(typeof l!="function"||t.wait))return t.wait=!0,Promise.resolve().then(l).finally(()=>{t.wait=!1})}function a(l=!t.active){t.active=l}return(l,c)=>(r.openBlock(),r.createElementBlock("div",Mn,[r.createElementVNode("div",{class:r.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[r.createElementVNode("div",xn,[l.label?(r.openBlock(),r.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:c[0]||(c[0]=s=>a())},r.toDisplayString(l.label),1)):r.createCommentVNode("",!0),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(l.array,(s,f)=>(r.openBlock(),r.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:f,onClick:d=>{o(s.callback),a(!1)}},r.toDisplayString(s.label),9,Un))),128))]),r.createElementVNode("div",Wn,[r.createElementVNode("div",{class:r.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:c[1]||(c[1]=s=>a())},[t.wait?(r.openBlock(),r.createBlock(r.unref(me),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(r.openBlock(),r.createBlock(r.unref(pe),{key:1,class:"widget-multi-button-side-icon"},{default:r.withCtx(()=>[r.createTextVNode("angle-small-down")]),_:1})):r.createCommentVNode("",!0)],2)])],2)]))}}),[["__scopeId","data-v-d43a76ce"]]),qn={class:"widget-loader flex flex-align_center gap_10 padding_15"},Hn={class:"text_md"},ht=r.defineComponent({__name:"widget-loader",props:{label:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("div",qn,[r.createVNode(me,{color:"var(--primary)",class:"padding_10"}),r.createElementVNode("span",Hn,r.toDisplayString(n.label),1)]))}}),Gn=["alt","src"],zn=r.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(e){const n=e,t=r.ref();return r.onMounted(()=>{t.value&&(t.value.src=n.src),t.value.onerror=function(){n.default&&(t.value.src=n.default)}}),(i,o)=>(r.openBlock(),r.createElementBlock("img",{alt:i.alt,ref_key:"refImage",ref:t,src:i.src||i.$props.default},null,8,Gn))}}),Xn=U({props:{config:Array,values:Object,selected:Boolean},setup:xe},[["__scopeId","data-v-344a8cc1"]]),Kn=e=>(r.pushScopeId("data-v-bf495d6a"),e=e(),r.popScopeId(),e),Jn={class:"widget-list-head-cell"},Yn=Kn(()=>r.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Qn=U(r.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(e,{emit:n}){const t=e,i=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(o,a)=>(r.openBlock(),r.createElementBlock("th",null,[r.createElementVNode("div",Jn,[r.createElementVNode("div",{class:"head-cell-content flex_grow",style:r.normalizeStyle({"min-width":o.minWidth,"max-width":o.maxWidth,width:o.width})},[o.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(S.FormField),{key:0,type:"single-checkbox",onClick:a[0]||(a[0]=r.withModifiers(l=>i("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]=l=>i("order"))},r.toDisplayString(o.title||o.label),1))],4),o.name&&o.order.length&&o.order[0]===o.name?(r.openBlock(),r.createBlock(r.unref(pe),{key:0,class:r.normalizeClass(["head-cell-order",{"head-cell-order_down":o.order.length>1&&o.order[1]==="desc"}])},{default:r.withCtx(()=>[r.createTextVNode("core-arrow-up")]),_:1},8,["class"])):r.createCommentVNode("",!0),Yn])]))}}),[["__scopeId","data-v-bf495d6a"]]),Zn=U(r.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(e,{emit:n}){const t=e,i=n,o=r.ref(),a=r.ref();r.onMounted(()=>{function f(b,u){let h=-1;do h++,u-=b[h];while(u>0&&h<b.length);return h}function d(b,u){let h=0;for(;u>0&&u>b[h]&&h<b.length;)u-=b[h],h++;return console.log(u,h),h>0?h:0}function m(b){try{a.value.style.insetInlineStart=b+"px"}catch(u){console.log(u)}}function y(b){try{a.value.style.width=b+"px",a.value.style.minWidth=b+"px",a.value.style.maxWidth=b+"px"}catch(u){console.log(u)}}function g(b){return b===null?!1:b.classList.contains("head-cell-resize")}o.value.addEventListener("pointerdown",function(u){var Ce;function h(x){return x.screenX+C-L}const w=o.value,E=[...w.children].filter(x=>x.localName==="th"),C=((Ce=w.offsetParent)==null?void 0:Ce.scrollLeft)||0,v=E.map(x=>x.clientWidth),P=g(u.target),L=w.getBoundingClientRect().left,T=h(u),_=f(v,T),O=v.slice(0,_).reduce((x,q)=>x+q,0),k=T-O,A=w.offsetWidth,D=E[_].clientWidth;if(t.config[_].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",u.screenX),console.log("Widths",v),console.log("max width",A),console.log("Start Position",T),console.log("Position From",_),console.log("Start Position",_),console.log("Global offset (Отступ самой таблицы от края экрана)",L),console.log("Del",k),console.groupEnd(),a.value.innerText=E[_].textContent||"",a.value.style.display="grid",a.value.style.width=D+"px",a.value.style.cursor="grabbing",m(O),y(D),document.addEventListener("pointermove",V,{passive:!0}),document.addEventListener("pointerup",oe);function oe(x){if(console.group("END"),document.removeEventListener("pointermove",V),document.removeEventListener("pointerup",oe),P&&(t.config[_].width=a.value.style.width,t.config[_].minWidth=a.value.style.width,t.config[_].maxWidth=a.value.style.width,l(t.config)),!P){const q=x.screenX+C-L;console.log("ENP Position",q);const Fe=d(v,q);if(console.log(_,"->",Fe),Fe!==_){const ke=t.config[_],ot=t.config;ot.splice(_,1),ot.splice(Fe,0,ke),l(ot)}else{const ke=t.config[_].name;c(ke)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function V(x){if(P){const ke=h(x)-T+D;y(ke);return}let q=x.screenX+C-L-k;q<0&&(q=0),q+D>A&&(q=A-D),m(q)}})});function l(f){i("update:config",f)}function c(f){if(!f)return;if(Array.isArray(f)){if(f.length<1)return;f=f[0]}if(t.order.length===0||t.order[0]!==f)return void s([f]);const d=t.order.length===1||t.order[1]==="asc"?"asc":"desc";s([f,d==="asc"?"desc":"asc"])}function s(f){i("update:order",f)}return(f,d)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:o},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(f.config,(m,y)=>(r.openBlock(),r.createBlock(Qn,r.mergeProps({key:m,ref_for:!0},m,{onOrder:g=>c(m.name),onSelect:d[0]||(d[0]=g=>i("select")),order:f.order}),null,16,["onOrder","order"]))),128)),r.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:a},"test",512)],512))}}),[["__scopeId","data-v-ccffc6bd"]]),er={class:"widget-list"},tr={class:"widget-list-body position_relative"},nr=50,rr=r.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(e,{emit:n}){const t=e,i=n;function o(s,f=!0){if(t.selectedRows)if(!f)l(t.selectedRows.includes(s)?[]:[s]);else{const d=[...t.selectedRows],m=d.indexOf(s);m===-1?d.push(s):d==null||d.splice(m,1),l(d)}}function a(){var s;if(((s=t.selectedRows)==null?void 0:s.length)!==t.array.length)return l([...t.array]);l([])}function l(s){i("update:selectedRows",s)}function c(s){if(!s)return;const f=s.target;f.scrollTop+f.clientHeight+nr>f.scrollHeight&&i("scrollEnd")}return(s,f)=>(r.openBlock(),r.createElementBlock("div",{class:"es-list-container",onScrollPassive:c},[r.createElementVNode("table",er,[r.createElementVNode("thead",null,[r.createVNode(Zn,{onSelect:f[0]||(f[0]=d=>a()),"onUpdate:order":f[1]||(f[1]=d=>i("update:order",d)),"onUpdate:config":f[2]||(f[2]=d=>i("update:config",d)),config:s.config,order:s.order},null,8,["config","order"])]),r.createElementVNode("tbody",tr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.array,(d,m)=>{var y;return r.openBlock(),r.createBlock(Xn,{key:m,class:"widget-list-row",values:d,config:s.config,selected:(y=s.selectedRows)==null?void 0:y.includes(d),onSelect:g=>o(d,g)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function We(){var a;const e=r.computed(()=>Object.keys(t).length===0||Object.values(t).includes(!0)),n=(a=r.getCurrentInstance())==null?void 0:a.uid;if(!n)throw"Undefined instance. Please check it.";const t=r.reactive({});r.provide(I.VISIBLE_ITEM_PROVIDE_NAME,{show(l){t[l]=!0},hide(l){t[l]=!1},remove(l){delete t[l]}});const i=r.inject(I.VISIBLE_ITEM_PROVIDE_NAME,{show(){},hide(){},remove(){}});return{visible:e,controller:{show(){i==null||i.show(n)},hide(){i==null||i.hide(n)},remove(){i==null||i.remove(n)}},visibleItems:t}}const ir=r.defineComponent({__name:"widget-field",props:{name:{},type:{},label:{},usageContext:{type:Boolean,default:!0}},setup(e){const n=e,t=Be(),i=Qe(),o=r.computed(()=>{var u,h,w;const y=s.value,g=f(y),b={type:g,disabled:n.usageContext?!((u=c.value)!=null&&u.canSet):!1,label:n.label};return g==="Decimal"&&((w=(h=y==null?void 0:y.presentationType)==null?void 0:h.toLowerCase)==null?void 0:w.call(h))==="money"&&(b.money=!0),y&&Object.assign(b,{suffix:g==="number"?y.valueUnit:void 0,required:l.includes(g||"")?!1:y.required,label:n.label||y.displayName}),Array.isArray(N.arrayFieldParamsHandlers)&&N.arrayFieldParamsHandlers.forEach(E=>Object.assign(b,E(y,c.value,b))),b}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],c=r.computed(()=>{var y;return(y=i==null?void 0:i.value)==null?void 0:y.fields[n.name]}),s=r.computed(()=>{if(!t.value)return;const y=t.value.fieldsByName[n.name];if(y)return y});function f(y){if(typeof n.type=="string"&&n.type.length!==0)return n.type;if(y){if(y.type==="Reference"||y.type==="Owned")return y.referencedEntity;if(y.dataType==="Boolean")return"single-checkbox";if(y.dataType==="DateTime")return"date";if(y.dataType==="Integer"||y.dataType==="Decimal")return"number";if(y.dataType==="List")return y.aggregatedEntity;if(a.includes(y.presentationType))return"textarea";if(y.presentationType==="PhoneNumber")return"tel"}return"text"}const d=r.computed(()=>{var y;return n.usageContext?((y=c.value)==null?void 0:y.canGet)===!0:!0}),{controller:m}=We();return r.watch(()=>d.value,y=>y?m.show():m.hide(),{immediate:!0}),r.onUnmounted(()=>m.remove()),(y,g)=>d.value?(r.openBlock(),r.createBlock(r.unref(S.FormField),r.mergeProps({key:0},{...y.$attrs,...o.value},{name:y.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function or(e){return Array.isArray(e)&&(e==null?void 0:e[1])||I.DEFAULT_ORDER_DIR}const ar=["fill"],sr=[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)],lr=r.defineComponent({__name:"widget-icon-arrow-up",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},sr,8,ar))}}),cr={class:"widget-fast-table-head-cell-td"},fr={key:1,class:"widget-head-cell-label"},ur={key:2,class:"widget-head-cell-order"},yt=U(r.defineComponent({__name:"widget-fast-table-head-cell",props:{label:{},name:{},order:{},type:{},isFullSelected:{type:Boolean}},emits:["select"],setup(e,{emit:n}){const t=e,i=r.computed(()=>Ve(t.name));r.computed(()=>or(t.order));const o=n;function a(){o("select")}return(l,c)=>{var s;return r.openBlock(),r.createElementBlock("td",cr,[r.createElementVNode("div",{class:r.normalizeClass(["widget-head-cell",[l.type==="multi-select"?"justify-content-center":""]]),onClick:c[0]||(c[0]=f=>l.$emit("order",l.name))},[l.type==="multi-select"?(r.openBlock(),r.createBlock(r.unref(S.FormField),{key:0,"model-value":l.isFullSelected,onClick:a,type:"single-checkbox"},null,8,["model-value"])):(r.openBlock(),r.createElementBlock("span",fr,r.toDisplayString(l.label),1)),i.value===((s=l.order)==null?void 0:s[0])?(r.openBlock(),r.createElementBlock("div",ur,[r.createVNode(lr,{color:"var(--color-primary)",class:r.normalizeClass(["widget-head-cell-order-icon",`widget-head-cell-order-icon_${l.order[1]==="desc"?"desc":"asc"}`])},null,8,["class"])])):r.createCommentVNode("",!0)],2)])}}}),[["__scopeId","data-v-d131e64e"]]),dr=["fill"],pr=[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)],mr=r.defineComponent({__name:"widget-icon-keyboard-arrow-down",props:{color:{}},setup(e){return(n,t)=>(r.openBlock(),r.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",height:"24px",viewBox:"0 -960 960 960",width:"24px",fill:n.color},pr,8,dr))}}),gr={class:"widget-filter-item-popup"},wt=U(r.defineComponent({__name:"widget-table-panel-filter-item",props:{entity:{},values:{},filters:{},filterItem:{}},emits:["update:values"],setup(e,{emit:n}){const t=e,i=n,o=N.tableFilterEntityBind,a=r.ref(),l=r.computed(()=>{const g=t.filterItem;return g.entity?"Entity":g.type?g.type:null});function c(g){s.value=g==="start"}const s=r.ref(!1),f=r.computed(()=>Array.isArray(t.values)||typeof t.values=="string"?t.values.length>0:!!t.values),d=r.ref(!1);let m=null;function y(g=!d.value){d.value=g,!d.value&&m?(m(),m=null):a.value&&(m=S.utils.clickOutside(a.value,y.bind(null,!1)))}return(g,b)=>{var u;return r.openBlock(),r.createElementBlock("div",{class:"widget-filter-item-container grid",ref_key:"refFilterItem",ref:a},[r.createElementVNode("div",{class:r.normalizeClass(["widget-filter-item",{"widget-filter-item_active":f.value}]),onClick:b[0]||(b[0]=()=>y())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":f.value}])},r.toDisplayString(g.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(me,{key:0})):(r.openBlock(),r.createBlock(mr,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":d.value})},null,8,["class"]))],2),r.withDirectives(r.createElementVNode("div",gr,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((u=r.unref(o))==null?void 0:u[l.value]),{key:0,"filter-metadata":g.filterItem,values:g.values,filters:g.filters,"base-entity":g.entity,"onUpdate:values":b[1]||(b[1]=h=>i("update:values",h)),onReadProcess:c},null,40,["filter-metadata","values","filters","base-entity"])):r.createCommentVNode("",!0)],512),[[r.vShow,d.value]])],512)}}}),[["__scopeId","data-v-e52e165e"]]),hr={class:"widget-table-panel-filter flex"},yr=U(r.defineComponent({__name:"widget-table-panel-filters",props:{filtersConfig:{},filters:{},entity:{}},emits:["update:filters"],setup(e,{emit:n}){const t=e,i=n;function o(a,l){i("update:filters",{...t.filters,[a]:l})}return(a,l)=>(r.openBlock(),r.createElementBlock("div",hr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(a.filtersConfig,(c,s)=>{var f;return r.openBlock(),r.createBlock(wt,{key:s,entity:a.entity,"filter-item":c,values:(f=a.filters)==null?void 0:f[r.unref(le)(c)],filters:a.filters,"onUpdate:values":d=>o(r.unref(le)(c),d)},null,8,["entity","filter-item","values","filters","onUpdate:values"])}),128))]))}}),[["__scopeId","data-v-89e1fa2d"]]),wr={class:"widget-fast-table-tools"},br=U(r.defineComponent({__name:"widget-fast-table-tools",props:{tools:{},loading:{type:Boolean},selectedRows:{},metadata:{}},emits:["reload","export"],setup(e,{emit:n}){const t=e,i=Y.useRouter(),o=n,a=[{name:"config",label:"Settings",icon:"list-settings",buttonStyle:"default",callback:()=>null},{name:"export",label:"Save as CSV",icon:"list-download",buttonStyle:"default",callback:()=>o("export")},{name:"reload",label:"Reload",icon:"reload",buttonStyle:"default",callback:()=>o("reload")}],l=a.map(m=>m.name),c=r.inject(I.PROVIDE_NAME_ACTIONS,[]),s=r.computed(()=>{var g;const m=((g=c==null?void 0:c.actions)==null?void 0:g.value)||[];return Array.isArray(t.tools)?t.tools.reduce((b,u)=>{if(u.name==="*")b.push(...a);else if(l.includes(u.name)){const h=a.find(w=>w.name===u.name);h&&b.push(h)}else if(u.name==="redirect"){const h={...u,label:u.label,callback:()=>i.push(u.to)};b.push(h)}else{const h=m.find(w=>w.name===u.name);h&&b.push({name:u.name,label:h.title,icon:u.icon,buttonStyle:u.buttonStyle,callback:()=>Promise.resolve().then(()=>{f[u.name]=!0}).then(()=>d(h)).finally(()=>{f[u.name]=!1})})}return b},[]):[]}),f=r.reactive({});function d(m){var b;const y=(b=m.action.parameters.find(u=>u.dataTypeName==="IntegerArray"))==null?void 0:b.name,g={};return y&&(g[y]=t.selectedRows.map(u=>{if(!(typeof u=="object"&&u!==null))return null;const h=t.metadata.fieldNameForIdentification;return h===void 0?null:u[h]})),m.callback(g)}return(m,y)=>{const g=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",wr,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(s.value,b=>(r.openBlock(),r.createBlock(g,{label:b.label,title:b.name,icon:b.icon,type:b.buttonStyle,loading:b.name==="reload"?m.loading:f[b.name],onClick:b.callback},null,8,["label","title","icon","type","loading","onClick"]))),256)),r.renderSlot(m.$slots,"default",{},void 0,!0)])}}}),[["__scopeId","data-v-973a3749"]]);class ge{constructor(n,t){this.data=t,this.entity=n}hasPrimaryKey(){return!!ge.getPrimaryKey(this.entity,this.data)}get primaryKey(){return ge.getPrimaryKey(this.entity,this.data)}static getPrimaryKey(n,t){const i=ye.get(n);if(!i.fieldNameForIdentification)return null;try{return t[i.fieldNameForIdentification]}catch{return null}}}function Er(){const e=ut();Y.useRouter();const n=r.reactive({entity:null,mark:null,settings:null});function t(u){const h={...c.value,...u};i(h)}function i(u){{const h=u.prefilters;h&&(Object.keys(h).forEach(w=>{var E,C;Array.isArray(h[w])&&h[w].length===0&&n.settings&&!((C=(E=n.settings)==null?void 0:E.prefilters)!=null&&C[w])&&delete h[w]}),S.utils.isEmptyObject(h)&&delete u.prefilters)}localStorage.setItem(l(n.entity,n.mark),JSON.stringify(u))}function o(){return n.entity?JSON.parse(localStorage[l(n.entity,n.mark)]||"{}"):null}function a(u,h){n.entity=u,n.mark=h,f.call()}function l(u,h){return"list-configuration:"+u+(h?"-"+h:"")}const c=r.computed(()=>n.entity?JSON.parse(e[l(n.entity,n.mark)]||"{}"):null),s=r.computed(()=>n.settings?zt(n.entity,n.settings.config):[]),f=ce(async function(){if(!n.entity)return;const h=await _t(n.entity,n.mark);n.settings=Object.freeze(h)}),d=r.computed(()=>{var w;const u=c.value.prefilters||{};return{...((w=n.settings)==null?void 0:w.prefilters)||{},...u}}),m=r.computed(()=>{var u;return((u=n.settings)==null?void 0:u.filters)||[]}),y=r.computed(()=>{var u;return((u=n.settings)==null?void 0:u.label)||null}),g=r.computed(()=>{var u;return((u=n.settings)==null?void 0:u.tools)||[]}),b=r.computed(()=>!S.utils.isEmptyObject(c.value));return{state:n,get customFilters(){return n.settings.customFilters||[]},set:a,get:o,configuration:c,update:t,computedPrefilter:d,computedFiltersConfiguration:m,get prefilters(){var u,h;return(u=o())==null||u.prefilters,((h=o())==null?void 0:h.prefilters)||n.settings.prefilters||{}},get order(){var u;return((u=o())==null?void 0:u.order)||[]},clean(){localStorage.removeItem(l(n.entity,n.mark))},cellConfiguration:s,computedLabel:y,computedTools:g,computedHasLocalConfiguration:b}}const Cr={class:"es-grid es-gap-15"},kr={key:0,class:"title-md color-primary margin-0 widget-fast-table-label"},_r={class:""},Tr=r.defineComponent({__name:"widget-fast-table",props:{entity:{},mark:{},masterEntities:{},binding:{},actions:{},hideLabel:{type:Boolean}},setup(e,{expose:n}){const t=e,i=Y.useRouter(),o=r.ref([]),a=r.ref(null),l=r.ref(null),c=S.Form.getParentForm(),s=r.ref([]),f=Be(t.entity),{state:d,update:m}=Qe(t.entity,{masterEntities:t.masterEntities||[]}),y=r.computed(()=>{var k;return((k=_.value)==null?void 0:k.displayItem)||Ye.inline}),g=r.computed(()=>{var k;return((k=_.value)==null?void 0:k.newItem)||y.value}),b=ce(async()=>{try{await u.call(),await m()}catch(k){const{message:A}=je(k);a.value=A}});c instanceof S.Form&&c.subscribe({read:b.call.bind(null),name:t.entity,type:"table"}),r.watch(()=>t.mark,()=>{L.set(t.entity,t.mark)});const u=ce(async function(){const A=t.entity;a.value=null,s.value=[];const D=(await te(A,{customFilters:L.customFilters,fields:He(T.value).join(" "),order:L.order,filter:F.and(F(L.prefilters),F(t.binding||{}))})).map(eo);o.value=D});async function h(k){if(k===null)return l.value=null;const A=new ge(t.entity,k),D=A.hasPrimaryKey()?A.primaryKey:null;if(y.value==="form")return D?i.push(Je(t.entity,D)):console.warn("Can't open form without primaryKey");if(y.value==="inline")return l.value=k||I.LIST_ACTIVE_NEW;y.value==="modal"?(await H.promptModal("form",{entity:t.entity,primaryKey:D,id:D}),await u.call()):l.value=I.LIST_ACTIVE_NEW}const{controller:w}=We();r.watch(()=>d.value,k=>{k&&(k.canRead?w.show():w.hide())},{immediate:!0});let E=[be.on("affected-entity",k=>{k.name===t.entity&&u.call()}),be.on("display-entity",async k=>{k.name===t.entity&&(u.promise&&await u.promise,l.value=o.value.find(A=>A.Id===k.id)||null)})];r.onUnmounted(()=>{E.map(k=>k()),w.remove()});function C(k){function A(V){return Array.isArray(V)?A(V[0]):typeof V!="string"?null:V}const D=A(k);if(!D)return;const oe=L.order;v("order",oe[0]!==D?[D,"asc"]:oe[1]==="desc"?[]:[D,"desc"])}function v(k,A){L.update({[k]:A}),u.call()}const P=r.computed(()=>b.wait),L=Er(),T=L.cellConfiguration;L.set(t.entity,t.mark),r.watch(()=>L.state.settings,b.call);const _=r.computed(()=>L.state.settings);n({listSettings:_,array:o,config:T,activeRow:l});function O(){H.openModal(I.MODAL_LIST_DOWNLOAD,{})}return(k,A)=>{const D=r.resolveComponent("widget-button"),oe=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",Cr,[r.unref(L).computedLabel.value&&!k.hideLabel?(r.openBlock(),r.createElementBlock("p",kr,r.toDisplayString(r.unref(L).computedLabel.value),1)):r.createCommentVNode("",!0),r.unref(f)?(r.openBlock(),r.createBlock(br,{key:1,metadata:r.unref(f),tools:r.unref(L).computedTools.value,loading:P.value,"selected-rows":s.value||[],onReload:r.unref(b).call,onExport:O},{default:r.withCtx(()=>{var V;return[g.value==="form"||(V=r.unref(d))!=null&&V.canCreate?(r.openBlock(),r.createBlock(D,{key:0,onClick:A[0]||(A[0]=()=>h(r.unref(I).LIST_ACTIVE_NEW)),type:"primary",label:"Add New"})):r.createCommentVNode("",!0),r.unref(L).computedHasLocalConfiguration.value?(r.openBlock(),r.createBlock(D,{key:1,onClick:r.unref(L).clean,type:"primary",label:"Clear all filters"},null,8,["onClick"])):r.createCommentVNode("",!0)]}),_:1},8,["metadata","tools","loading","selected-rows","onReload"])):r.createCommentVNode("",!0),r.createElementVNode("div",_r,[r.createVNode(yr,{entity:k.entity,"filters-config":r.unref(L).computedFiltersConfiguration.value,filters:r.unref(L).computedPrefilter.value,"onUpdate:filters":A[1]||(A[1]=V=>v("prefilters",V))},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(gt),{config:r.unref(T),array:o.value,"active-row":l.value,"onUpdate:activeRow":h,onOrder:C,class:"table",selectedRows:s.value,"onUpdate:selectedRows":A[3]||(A[3]=V=>s.value=V)},{"head-cell":r.withCtx(V=>{var Ce,x,q;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(k.$slots["head-cell"]?k.$slots["head-cell"]:yt),r.mergeProps({label:V.label},V,{onOrder:C,order:r.unref(L).configuration.value.order||[],type:V.type,"is-full-selected":((Ce=s.value)==null?void 0:Ce.length)===((x=o.value)==null?void 0:x.length)&&((q=o.value)==null?void 0:q.length)>0}),null,16,["label","order","type","is-full-selected"]))]}),default:r.withCtx(()=>[r.createVNode(oe,{entity:k.entity,"primary-key":r.unref(ge).getPrimaryKey(t.entity,l.value),"master-entities":k.masterEntities||void 0,binding:k.binding,onFormUpdate:A[2]||(A[2]=()=>{l.value=null,r.unref(u).call()})},null,8,["entity","primary-key","master-entities","binding"])]),_:1},8,["config","array","active-row","selectedRows"])])])}}});function bt(e,n={},t={}){const i=r.inject(I.PROVIDE_NAME_ACTIONS,null),o=typeof e=="string"?e:n,a=typeof n=="string"?t:n;return r.computed(()=>{var s;const c=((typeof e=="string"?(s=i==null?void 0:i.actions)==null?void 0:s.value:r.unref(e))||[]).find(f=>f.name===o);return c?{...c,...a}:null})}const Ar=r.defineComponent({__name:"widget-action",props:{name:{},overrideParams:{}},setup(e){const n=e,t=bt(n.name,n.overrideParams||{}),i=r.computed(()=>{if(t.value)return ce(t.value.callback)});return(o,a)=>{var c;const l=r.resolveComponent("widget-button");return r.unref(t)?(r.openBlock(),r.createBlock(l,{key:0,label:r.unref(t).label,loading:((c=i.value)==null?void 0:c.loading)||!1,onClick:a[0]||(a[0]=()=>{var s,f;return(f=(s=i.value)==null?void 0:s.call)==null?void 0:f.call(s,o.overrideParams||{})})},null,8,["label","loading"])):r.createCommentVNode("",!0)}}}),Sr=r.defineComponent({__name:"modal-list-download",props:{settings:{}},setup(e){const n=e,t=r.computed(()=>i.finished?"Download CSV":`Download ${i.count} records.`),{state:i,downloadFile:o,reject:a,start:l}=Yt(n.settings);return H.onBeforeModalClose(a),r.onMounted(l),r.watch(()=>i.finished,()=>{o(),H.popModal()}),(c,s)=>{const f=r.resolveComponent("widget-button"),d=r.resolveComponent("widget-modal-wrap");return r.openBlock(),r.createBlock(d,null,{footer:r.withCtx(()=>[r.createVNode(f,{onClick:s[0]||(s[0]=m=>{r.unref(o)(),r.unref(H.popModal)()})},{default:r.withCtx(()=>[r.createTextVNode(r.toDisplayString(t.value),1)]),_:1})]),default:r.withCtx(()=>[r.createElementVNode("div",null,[r.createVNode(ht,{label:"Loading"})])]),_:1})}}});function Et(e){return Se(e,"YYYY/MM/DD HH:mm:ss")}function Se(e,n="YYYY/MM/DD"){if(!e)return"";try{const t=new Date(e);return sn.format(t,n)}catch(t){return console.log(t),"Invalid date"}}function ce(e){function n(...i){if(t.loading)return Promise.reject("The process has already started.");t.loading=!0,t.wait=!0;const o=Promise.resolve().then(()=>e(...i)).finally(()=>{t.wait=!1,t.loading=!1,t.promise=null});return t.promise=o,o}const t=r.reactive({wait:!1,loading:!1,call:n,promise:null});return t}function je(e){return typeof e=="string"?Ie(e):Ir(e)?Ie(e.message,e.children||e.details||[]):vr(e)?Ie(e.title,[e.detail||""]):Ie(I.DEFAULT_ERROR_MESSAGE)}function Ir(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"message"))}function vr(e){return!!(typeof e=="object"&&e!==null&&Object.hasOwnProperty.call(e,"title"))}function Ie(e,n=[]){return{message:e,children:n}}function W(e="error"){return function(n){const{message:t,children:i}=je(n);et.add(e,t,{children:i})}}function te(e,n={}){const t=B();return Nr(n)&&n.id&&(n.primaryKey=n.id,delete n.id),t.emit("entity:read",{entity:e,...n})}function Nr(e){return!!(e.id||e.primaryKey)}function qe(e,n){return B().emit("entity:update",{...n,entity:e})}function He(e){return e.reduce((n,t)=>(t.name&&(typeof t.name=="string"?n.push(t.name):n.push(...t.name)),n),[])}function Ct(e,n=2){if(!(typeof e=="string"||typeof e=="number"))return"";let i=String(e).split(".");return i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),i.length<2&&(i[1]=""),i[1]=i[1].padEnd(n,"0"),i[1].length>n&&(i[1]=i[1].substring(0,n)),i.join(".")}function Lr(e,n){const t=new Map;return e.forEach(i=>{var a;const o=n(i);t.has(o)||t.set(o,[]),(a=t.get(o))==null||a.push(i)}),t}function Or(){return("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Rr(e){return e.text().then(n=>{try{return JSON.parse(n)}catch{return I.DEFAULT_ERROR_MESSAGE}})}function j(e,n={}){return z.isFront&&(n.headers||(n.headers={}),n.headers["Context-Id"]=z.contextId),n.redirect="manual",fetch(e,n).then(t=>t.type==="opaqueredirect"?void window.location.reload():t).catch(()=>{throw new Error(I.DEFAULT_ERROR_MESSAGE)}).then(t=>Rr(t).then(i=>{if(!t.ok)throw i;return i}))}function $r(e,n=1e3){let t=0;return(...i)=>{clearTimeout(t),t=window.setTimeout(()=>e(...i),n)}}function Br(e,n){let t=!1;return(...i)=>{if(!t)return t=!0,setTimeout(()=>t=!1,n),e(...i)}}const Dr=_e(Ae("pretty-value-field-by-entity"));function Fr(e,n,t){try{const i=ye.get(e);if(!i)throw new Error("For entity metadata is not loaded");const o=i.fieldsByName[n];if(!o)throw new Error(`For entity ${e} can't found fieldMetadata for field ${n}`);return o.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch(i){return Dr('Error by parse pretty value for entity %o "%s", field "%s" with value "%s"',i,e,n,t),t}}const ne=_e(Ae("use-socket"));function B(){return Vr}function Pr(e){return typeof e=="object"&&Object.prototype.toString.call(e)==="[object Blob]"}const Vr=function(){let e=1,n,t;const i=new Set;let o=0;const a=new Set;function l(){if(n)o&&(clearTimeout(o),o=0);else return;o=setTimeout(()=>{n.close()},Cn*2);const w=new Uint8Array(1);w[0]=En,n.send(w)}setInterval(()=>{Array.from(i).forEach(w=>{h(w)&&(ne("Handler for event %s requestId %d was expired",w.event,w.requestId),w.requestId?s({requestId:w.requestId,event:ct,data:{message:Q.RequestTookToLong().message}}):i.delete(w))})},1e3),setInterval(()=>{(!n||n.readyState===3)&&f()},I.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:a,requestId:e,handlers:i,socketInstance:n}}function s(w){const E=[...i.values()];ne("Handlers array length is %d. Response event: %s. Request id: %d",i.size,w.event,w.requestId),E.forEach(C=>{const v=w.requestId;(C.requestId&&C.requestId===v||!C.requestId&&C.event===w.event)&&(ne("Find appropriated handler: %d, event: %s",e,C.event),C.callback(w.data,w),C.once&&(i.delete(C),ne("Handler was removed by *once* params was passed. %o",C)))})}function f(){if(typeof t!="string"){console.log("Please initialize use-socket");return}console.log(`%cInitializing sockets: %c${t}`,"color: purple","color: black"),n=new WebSocket(t),n.onclose=function(w){ne("Connection to server was stopped: %d %s",w.code,w.reason),Array.from(i).forEach(E=>{E.guaranteedAnswer&&E.serializeString&&a.add(E.serializeString)})},n.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...a.values()].forEach(w=>{d(w),a.delete(w)})},n.onerror=function(w){console.warn(w)},n.onmessage=w=>{var E;try{if(Pr(w.data)){l();return}const C=JSON.parse(w.data);if(!kt(C)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(C);return}(E=C==null?void 0:C.data)!=null&&E.refresh&&location.reload(),s(C)}catch(C){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(C)}}}function d(w){n.send(w)}function m(w,E){u({event:w,callback:E})}function y(w,E){u({event:w,callback:E,once:!0})}function g(){return n&&(n==null?void 0:n.readyState)===1}function b(w,E,C){const v=++e,P=JSON.stringify({requestId:v,event:w,data:E,contextId:z.contextId,url:N.socketURLHandler?N.socketURLHandler():window.location.href});return g()?d(P):(a.add(P),ne("Socket is not connected. Message was send to save-queue")),new Promise((L,T)=>{u({event:w,requestId:v,once:!0,guaranteedAnswer:!0,serializeString:P,callback:(_,O)=>{if(ne("Promise was resolve with next data:",_),Mr(O))return void T(_);C&&C(_,O),L(_)},timeToLive:I.TIME_TO_LIVE_SOCKET_REQUEST})})}function u(w){const E={timeToLive:0,...w,created:new Date().getTime()};i.add(E)}function h(w){return w.timeToLive===0||typeof w.timeToLive!="number"?!1:new Date().getTime()-w.created>w.timeToLive}return{get socket(){return n},on:m,once:y,emit:b,initialization(w){t=w},getDevInfo:c}}(),Mr=e=>!!kt(e)&&e.event===ct,kt=e=>typeof e=="object"&&e!==null&&"event"in e&&typeof e.event=="string"&&"requestId"in e&&typeof e.requestId=="number"&&"data"in e;function _t(e,n){return B().emit("list-setting:read",{entity:e,mark:n})}function xr(e,n){return B().emit("metadata-field:treat",{entity:e,fieldName:n})}function Tt(e,n){return B().emit("entity:create",{...n,entity:e})}function At(e,n){return B().emit("entity:delete",{...n,entity:e})}function Ur(e,n){return B().emit("usage-context:read",{...n,entity:e})}function St(e={}){return B().emit("tool:read",e)}function Wr(){return B().emit("metadata-list:read",{})}function jr(e){return B().emit("history:read",e)}function qr(e,n){return B().emit("entity:count",{...n,entity:e})}function Hr(e){return`/${kn}/${e}`}function fe(e){return{exec(n,t){switch(e.name){case"replace-boolean":return fe.replaceBoolean(n,e.values);case"replace-record-operation":return fe.replaceRecordOperation(n)}}}}fe.replaceBoolean=Gr,fe.replaceRecordOperation=zr;function Gr(e,n){return typeof e!="boolean"?"":e?n[1]:n[0]}function zr(e){switch(e){case"A":case null:return"+";case"M":return"~";case"N":return"";case"D":return"✖";default:return"?"}}function Xr(e={}){return B().emit("tool:execute",e)}const Kr=_e(Ae("wrap-tool-response"));function It(e,n){return e.handleConfirmation===void 0&&(e.handleConfirmation=Qr),e.handleAffectedEntity===void 0&&(e.handleAffectedEntity=ei),e.handleCloseForm===void 0&&(e.handleCloseForm=ti),e.handleValidationResult===void 0&&(e.handleValidationResult=Zr),{...n,label:n.title,async callback(t={}){var l;const i=typeof e.values=="function"?e.values(n,e):e.values;let o={};n.action.targetName==="Record"&&i.hasOwnProperty("Id")&&(o.Id=i.Id,delete i.Id);const a=()=>Xr({name:n.name,values:{...i,...t},primaryKeys:o,usageContext:n.usageContext}).then(async c=>{var s,f;if(!Jr(c))throw new Error("It is impossible to process the result of calls.");if(Array.isArray(e.handlers))for await(const d of e.handlers)await d(n,c,e);if(!c.success)throw e.handleValidationResult&&c.validationEffect&&((f=(s=c.validationEffect)==null?void 0:s.results)!=null&&f.length)&&e.handleValidationResult(n,c.validationEffect,e),new Error(c.message);return c.message&&et.add("info",c.message),Array.isArray(c.affectedEntities)&&e.handleAffectedEntity&&c.affectedEntities.forEach(d=>{var m;return(m=e.handleAffectedEntity)==null?void 0:m.call(e,n,d,e)}),n.closeHostForm&&e.handleCloseForm&&e.handleCloseForm(n,e),c}).catch(W("error"));if((l=e.overrides)!=null&&l[n.name])return e.overrides[n.name](n,e);if(n.paramDialog){const c=await ni(n,e);if(c===null)return;t=Object.assign(t,c||{})}return n.requireSave&&e.form&&e.form.changed?e.form.save().then(a):!n.confirmation||!e.handleConfirmation||n.paramDialog?a():e.handleConfirmation(n,a)}}}function Jr(e){return!!(e&&typeof e=="object"&&"affectedEntities"in e&&"success"in e)}function Yr(e){const n="Are you sure?";return e===!0||typeof e=="string"&&e.toLowerCase()==="true"||e==="1"?n:typeof e=="string"?e:n}async function Qr(e,n){const t=Yr(e.confirmation);if(!H.getComponentFromStore(I.MODAL_CONFIRM))throw new Error("The 'confirm' modal window is not installed. It provided inside 'constants.MODAL_CONFIRM'");if(await H.promptModal(I.MODAL_CONFIRM,{message:t}))return n()}function Zr(e,n){const t=I.MODAL_VALIDATION_EFFECT;if(!H.getComponentFromStore(t))throw new Error("The 'validation-effect' modal window is not installed. It provided inside 'constants.MODAL_VALIDATION_EFFECT'");return new Promise(()=>{H.pushModal(t,n)})}function ei(e,n,t){var s;function i(f){return f!==null&&typeof f=="object"&&typeof f.read=="function"}function o(f,d){f&&(Kr("Affected Entity %s. Find form with name %s.",d,f.name),f.name===d&&i(f)&&f.read(),f instanceof S.Form&&f.dependencies.forEach(m=>o(m,d)))}be.emit("affected-entity",n);const{router:a,form:l}=t,c=(s=n.primaryKey)==null?void 0:s.Id;if(a&&n&&n.name===e.redirectEntity){be.emit("display-entity",{id:c,name:n.name}),N.getEntityLink&&a.push(N.getEntityLink(n.name,c));return}o(l,n.name)}function ti(e,n){const{router:t}=n;t&&e.closeHostForm&&t.back()}function ni(e,n){var t;if((t=e.paramDialog)!=null&&t.name)return H.promptModal(e.paramDialog.name,{paramDialog:e.paramDialog,tool:e,options:n})}let re={};function Z(e,...n){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let t=S.utils.getPropFromObject((this==null?void 0:this.vocabulary)||re,e);if(typeof t=="string")return vt(t,n);const i=S.utils.getPropFromObject(re==null?void 0:re.root,e);return typeof i=="string"?vt(i,n):(typeof t===void 0&&console.warn(`Translation for label "${e}" is not founded.`),e)}function vt(e,n){return n.forEach((t,i)=>{e=e.replaceAll(new RegExp(`\\{${i}}`,"g"),t)}),e}Z.setGlobalVocabulary=function(e){re=e},Z.getScope=function(e){const n=typeof e=="string"?e:"root";return typeof e!="string"&&console.warn(`SCOPE ${e} for translate is not string.`),Z.bind({vocabulary:S.utils.getPropFromObject(re,n.toLowerCase())})},Z.setVocabulary=function(e){return typeof e=="string"&&(e=S.utils.getPropFromObject(re,e)),Z.bind({vocabulary:e})};function ri(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ge={exports:{}},$={},ze={exports:{}},ie={};function Nt(){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 ii(e,n,t){}function oi(e,n,t){}var ai=/javascript\s*\:/img;function si(e,n){return ai.test(n)?"":n}ie.whiteList=Nt(),ie.getDefaultWhiteList=Nt,ie.onAttr=ii,ie.onIgnoreAttr=oi,ie.safeAttrValue=si;var li={indexOf:function(e,n){var t,i;if(Array.prototype.indexOf)return e.indexOf(n);for(t=0,i=e.length;t<i;t++)if(e[t]===n)return t;return-1},forEach:function(e,n,t){var i,o;if(Array.prototype.forEach)return e.forEach(n,t);for(i=0,o=e.length;i<o;i++)n.call(t,e[i],i,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,"")}},he=li;function ci(e,n){e=he.trimRight(e),e[e.length-1]!==";"&&(e+=";");var t=e.length,i=!1,o=0,a=0,l="";function c(){if(!i){var d=he.trim(e.slice(o,a)),m=d.indexOf(":");if(m!==-1){var y=he.trim(d.slice(0,m)),g=he.trim(d.slice(m+1));if(y){var b=n(o,l.length,y,g,d);b&&(l+=b+"; ")}}}o=a+1}for(;a<t;a++){var s=e[a];if(s==="/"&&e[a+1]==="*"){var f=e.indexOf("*/",a+2);if(f===-1)break;a=f+1,o=a+1,i=!1}else s==="("?i=!0:s===")"?i=!1:s===";"?i||c():s===`
@@ -9,5 +9,5 @@
9
9
  * jenesius-event-emitter v1.0.2
10
10
  * (c) 2022 Jenesius
11
11
  * @license MIT
12
- */const Qt=function(e,n){return e in this.events||(this.events[e]=[]),this.events[e].push(n),this.off.bind(this,e,n)},Zt=function(e,n){e in this.events&&this.events[e].forEach(t=>t(n))},en=function(e,n){const t=this.events[e];if(!t)return;const i=t.indexOf(n);i!==-1&&t.splice(i,1)},tn=function(){this.events={}};class J{constructor(){this.events={}}on(n,t){return Qt.call(this,n,t)}emit(n,t){return Zt.call(this,n,t)}off(n,t){return en.call(this,n,t)}cleanEvents(){tn.call(this)}static on(n,t){return Qt.call(J,n,t)}static emit(n,t){return Zt.call(J,n,t)}static off(n,t){return en.call(J,n,t)}static cleanEvents(){tn.call(J)}}J.events={};class Lo extends J{constructor(n){super(),this.name="Communication",this.read=()=>{},this.id=n}sendMessage(n){return uo(this.id,n)}static checkAndGenerate(n,t,i){return fo(n,t,i).then(o=>o.length===0?co(n,t,i):o[0])}}function Oo(){return B().emit("client:read",{})}class nt extends Error{static ConstContextCannotBeChanged(){return new nt("The current context is set to constant. In order to change it, you need to put Manager into a changeable state.")}}const K=class K extends J{constructor(){super(...arguments);st(this,Ee);st(this,ue);this.isConstContext=!1,this.type="front",this.organizations=[],Pe(this,ue,!1)}set language(t){localStorage.setItem(I.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(I.LOCALSTORAGE_LANGUAGE_KEY)||K.DEFAULT_LANGUAGE}get contextId(){return at(this,Ee)}set contextId(t){if(this.isConstContext)throw nt.ConstContextCannotBeChanged();Pe(this,Ee,t)}get contextType(){var t;if(this.contextId)return((t=this.person)==null?void 0:t.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(t){Pe(this,ue,t),this.emit(K.EVENT_READY_UPDATE,t)}get ready(){return at(this,ue)}onReady(t){return this.on(K.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(K.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=typeof t=="number"?t:Number(t),localStorage.setItem(I.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(K.EVENT_CONTEXT_UPDATE,t),console.log(`Current context id %c${t}`,"color: purple")}get context(){var t;return this.contextId?this.contextId===((t=this.person)==null?void 0:t.id)?this.person:this.organizations.find(i=>i.id===this.contextId)||null:null}async init(){try{const t=await this.loadCustomerData();this.customer=t,this.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){W()(t)}}restoreCurrentContext(){var i;if(typeof((i=this.customer)==null?void 0:i.constContextId)=="number")return this.isConstContext=!0,this.setCurrentContext(this.customer.constContextId);const t=Number.parseInt(localStorage.getItem(I.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(t)&&this.validateContextId(Number(t)))this.setCurrentContext(t);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Oo()}validateContextId(t){var i;try{return((i=this.person)==null?void 0:i.id)==t?!0:!!this.organizations.find(o=>o.id===t)}catch{return!1}}};Ee=new WeakMap,ue=new WeakMap,K.DEFAULT_LANGUAGE="en",K.EVENT_CONTEXT_UPDATE="event:context-update",K.EVENT_READY_UPDATE="event:ready-update";let rt=K;function Ro(e){return B().emit("metadata:read",{entity:e})}const ye=function(){const n=r.reactive({}),t=new Map;function i(c){return n[c]}async function o(c){if(t.has(c)&&await t.get(c),n[c])return;const s=await a(c);l(c,s)}function a(c){const s=Ro(c).finally(()=>{t.delete(c)});return t.set(c,s),s}function l(c,s){n[c]=s}return{state:n,initEntity:o,get:i,loadingFlags:t}}();class $o extends J{on(n,t){return super.on(n,t)}emit(n,t){console.log("[event-bus] emit",n,t),super.emit(n,t)}off(n,t){super.off(n,t)}}class X{static login(n){return j(N.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...n,AppName:N.applicationName})})}static parseProcessAnswer(n){if(n.statusCode>4)throw new Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startRegistrationProcess(n){return X.requestStepRegistrationProcess("StartRegistration",n)}static confirmPhoneRegistrationProcess(n){return X.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",n)}static confirmEmailRegistrationProcess(n){return X.requestStepRegistrationProcess("ConfirmEmailByRegistration",n)}static finishEmailRegistrationProcess(n){return X.requestStepRegistrationProcess("FinishRegistration",n)}static requestStepRegistrationProcess(n,t){return j(`${N.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(n){return X.requestStepLoginProcess("StartLogin",n)}static loginWithPassword(n){return X.requestStepLoginProcess("LoginWithPassword",n)}static loginWithOtpCode(n){return X.requestStepLoginProcess("LoginWithOtpCode",n)}static requestStepLoginProcess(n,t){return j(`${N.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(X.parseLoginProcessAnswer)}static parseLoginProcessAnswer(n){if(n.statusCode>3)throw Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startPasswordReset(n,t){return j(`${N.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:n})})}static confirmPhoneNumberByAccessRecovery(n,t,i,o){return j(`${N.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:i,Code:o})})}static confirmEmailByAccessRecovery(n,t,i,o){return j(`${N.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:i,Code:o})})}static finishAccessRecovery(n,t,i,o){return j(`${N.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Password:i,ConfirmedPassword:o})})}}class Bo{static readHistoryById(n,t){return j(`/close-api/audits/history/${n}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Do{static getConfiguration(){return j("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(n){return await j(`/open-api/data/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Fo{static getDictionary(n){if(!n)throw new Error(`Can't get dictionary for ${n}.`);return j(`/open-api/internationalization/language/${n}`)}}class Po{static async upload(n,t){const i=new FormData;return i.append("file",n),j(`/close-api/files?entityName=${t}`,{method:"POST",body:i}).then(o=>(o.filename=n.name,o))}}var nn=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(nn||{}),rn=(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))(rn||{});function Vo(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function F(e){return Object.keys(e).reduce((n,t)=>{const i=e[t];if(Array.isArray(i)){const o=i.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return i.length&&n.push(`@${t} in (${o})`),n}if(Vo(i)){let o=function(a){var l;return((l=a.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return i.start&&n.push(`@${t} ge ${o(i.start)}`),i.end&&n.push(`@${t} le ${o(i.end)}`),n}return typeof i=="number"||typeof i=="boolean"?(n.push(`@${t} eq ${i}`),n):typeof i=="string"?(i.length!==0&&n.push(`@${t} eq '${i}'`),n):(i===null&&n.push(F.is(t,i)),n)},[]).join(" and ")}function we(e){return typeof e=="string"?`'${e}'`:`${e}`}F.includes=function(n,t){return`@${n} Contains ${we(t)}`},F.beginWith=function(n,t){return`@${n} BeginWith ${we(t)}`},F.notEq=function(n,t){return`@${n} nq ${we(t)}`},F.eq=function(n,t){return Array.isArray(t)?F.in(n,t):`@${n} eq ${we(t)}`},F.in=function(n,t){const i=t.map(we).join(", ");return`@${n} in (${i})`},F.notIn=function(n,t){return!Array.isArray(t)||t.length===0?"":F.and(...t.map(i=>F.notEq(n,i)))},F.and=function(...n){return n.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(F.wrap).join(" and ")},F.wrap=function(n){return`(${n})`},F.is=function(n,t){return`@${n} is ${t}`},F.or=function(...n){return n.join(" or ")};function it(e){return Object.keys(e).reduce((n,t)=>{let i=e[t];const o=t.charAt(0).toUpperCase()+t.slice(1);return typeof i=="object"&&!(i==null||Array.isArray(i))&&(i=it(i)),n[o]=i,n},{})}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||{});const z=new rt,be=new $o;p.ApplicationStatus=rn,p.Communication=Lo,p.CoreError=Q,p.DisplayListRow=Ye,p.EventBus=be,p.Filter=F,p.Manager=z,p.MetadataStore=ye,p.ModalListDownload=Sr,p.NotificationSystem=et,p.OBJECT_TYPE_NAME_FIELD=ft,p.RecordOperation=nn,p.WidgetAction=Ar,p.WidgetButton=Vn,p.WidgetFastTable=Tr,p.WidgetFastTableHeadCell=yt,p.WidgetField=ir,p.WidgetIcon=pe,p.WidgetImage=zn,p.WidgetList=rr,p.WidgetLoader=ht,p.WidgetMultiButton=jn,p.WidgetSpinner=me,p.WidgetTable=gt,p.WidgetTablePanelFilterItem=wt,p.asyncProcess=ce,p.authService=X,p.billingService=se,p.catchUniversal=W,p.config=Nn,p.configuration=N,p.constants=I,p.convertDDToDMS=Qi,p.convertDMSToDD=Yi,p.convertListConfig=zt,p.coreUtils=io,p.debounce=$r,p.documentsService=dn,p.fileService=Po,p.formatter=fe,p.getCellName=le,p.getCellValue=Te,p.getEntityLink=Je,p.getNamesFromListConfig=He,p.getUnitValue=Me,p.groupArrayByField=Lr,p.historyService=Bo,p.injectAction=bt,p.internationalizationService=Fo,p.invitationService=un,p.openService=Do,p.parseError=je,p.parseTextByMarkdown=Ji,p.prettyDate=Se,p.prettyDateWithTime=Et,p.prettyMoney=Ct,p.prettyValueFieldByEntity=Fr,p.request=j,p.setupListRow=xe,p.staticLink=Hr,p.t=Z,p.throttle=Br,p.universalEntityCount=qr,p.universalEntityCreate=Tt,p.universalEntityDelete=At,p.universalEntityRead=te,p.universalEntityUpdate=qe,p.universalHistoryRead=jr,p.universalListSettingRead=_t,p.universalMetadataFieldTreat=xr,p.universalMetadataListRead=Wr,p.universalToolRead=St,p.useActions=yo,p.useCommunication=mo,p.useEnter=wo,p.useFormEntity=go,p.useListActiveRow=oo,p.useListDownload=Yt,p.useListEntity=so,p.useListSearch=Eo,p.useListSelect=bo,p.useLocalStorage=ut,p.useManagerState=lo,p.useMetadata=Be,p.useSocket=B,p.useUsageContext=Qe,p.useVisibleItem=We,p.useWizard=Ao,p.uuidv4=Or,p.valuesToUpperCase=it,p.wrapToolResponse=It,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
12
+ */const Qt=function(e,n){return e in this.events||(this.events[e]=[]),this.events[e].push(n),this.off.bind(this,e,n)},Zt=function(e,n){e in this.events&&this.events[e].forEach(t=>t(n))},en=function(e,n){const t=this.events[e];if(!t)return;const i=t.indexOf(n);i!==-1&&t.splice(i,1)},tn=function(){this.events={}};class J{constructor(){this.events={}}on(n,t){return Qt.call(this,n,t)}emit(n,t){return Zt.call(this,n,t)}off(n,t){return en.call(this,n,t)}cleanEvents(){tn.call(this)}static on(n,t){return Qt.call(J,n,t)}static emit(n,t){return Zt.call(J,n,t)}static off(n,t){return en.call(J,n,t)}static cleanEvents(){tn.call(J)}}J.events={};class Lo extends J{constructor(n){super(),this.name="Communication",this.read=()=>{},this.id=n}sendMessage(n){return uo(this.id,n)}static checkAndGenerate(n,t,i){return fo(n,t,i).then(o=>o.length===0?co(n,t,i):o[0])}}function Oo(){return B().emit("client:read",{})}class nt extends Error{static ConstContextCannotBeChanged(){return new nt("The current context is set to constant. In order to change it, you need to put Manager into a changeable state.")}}const K=class K extends J{constructor(){super(...arguments);st(this,Ee);st(this,ue);this.isConstContext=!1,this.type="front",this.organizations=[],Pe(this,ue,!1)}set language(t){localStorage.setItem(I.LOCALSTORAGE_LANGUAGE_KEY,t)}get language(){return localStorage.getItem(I.LOCALSTORAGE_LANGUAGE_KEY)||K.DEFAULT_LANGUAGE}get contextId(){return at(this,Ee)}set contextId(t){if(this.isConstContext)throw nt.ConstContextCannotBeChanged();Pe(this,Ee,t)}get contextType(){var t;if(this.contextId)return((t=this.person)==null?void 0:t.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(t){Pe(this,ue,t),this.emit(K.EVENT_READY_UPDATE,t)}get ready(){return at(this,ue)}onReady(t){return this.on(K.EVENT_READY_UPDATE,t)}onupdateContext(t){return this.on(K.EVENT_CONTEXT_UPDATE,t)}setCurrentContext(t){if(this.contextId===t)return console.warn("[application-manager] The current context has already been installed.");this.contextId=typeof t=="number"?t:Number(t),localStorage.setItem(I.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(t)),this.emit(K.EVENT_CONTEXT_UPDATE,t),console.log(`Current context id %c${t}`,"color: purple")}get context(){var t;return this.contextId?this.contextId===((t=this.person)==null?void 0:t.id)?this.person:this.organizations.find(i=>i.id===this.contextId)||null:null}async init(){try{const t=await this.loadCustomerData();this.customer=t,this.person=t,this.organizations=t.organizations,this.userId=t.userId,this.restoreCurrentContext(),this.ready=!0}catch(t){W()(t)}}restoreCurrentContext(){var i;if(typeof((i=this.customer)==null?void 0:i.constContextId)=="number")return this.setCurrentContext(this.customer.constContextId),this.isConstContext=!0;const t=Number.parseInt(localStorage.getItem(I.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(t)&&this.validateContextId(Number(t)))this.setCurrentContext(t);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return Oo()}validateContextId(t){var i;try{return((i=this.person)==null?void 0:i.id)==t?!0:!!this.organizations.find(o=>o.id===t)}catch{return!1}}};Ee=new WeakMap,ue=new WeakMap,K.DEFAULT_LANGUAGE="en",K.EVENT_CONTEXT_UPDATE="event:context-update",K.EVENT_READY_UPDATE="event:ready-update";let rt=K;function Ro(e){return B().emit("metadata:read",{entity:e})}const ye=function(){const n=r.reactive({}),t=new Map;function i(c){return n[c]}async function o(c){if(t.has(c)&&await t.get(c),n[c])return;const s=await a(c);l(c,s)}function a(c){const s=Ro(c).finally(()=>{t.delete(c)});return t.set(c,s),s}function l(c,s){n[c]=s}return{state:n,initEntity:o,get:i,loadingFlags:t}}();class $o extends J{on(n,t){return super.on(n,t)}emit(n,t){console.log("[event-bus] emit",n,t),super.emit(n,t)}off(n,t){super.off(n,t)}}class X{static login(n){return j(N.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...n,AppName:N.applicationName})})}static parseProcessAnswer(n){if(n.statusCode>4)throw new Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startRegistrationProcess(n){return X.requestStepRegistrationProcess("StartRegistration",n)}static confirmPhoneRegistrationProcess(n){return X.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",n)}static confirmEmailRegistrationProcess(n){return X.requestStepRegistrationProcess("ConfirmEmailByRegistration",n)}static finishEmailRegistrationProcess(n){return X.requestStepRegistrationProcess("FinishRegistration",n)}static requestStepRegistrationProcess(n,t){return j(`${N.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)})}static startLoginProcess(n){return X.requestStepLoginProcess("StartLogin",n)}static loginWithPassword(n){return X.requestStepLoginProcess("LoginWithPassword",n)}static loginWithOtpCode(n){return X.requestStepLoginProcess("LoginWithOtpCode",n)}static requestStepLoginProcess(n,t){return j(`${N.identityServerURL}/api/Authenticate/${n}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).then(X.parseLoginProcessAnswer)}static parseLoginProcessAnswer(n){if(n.statusCode>3)throw Error(n.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return n}static startPasswordReset(n,t){return j(`${N.identityServerURL}/api/Authenticate/StartAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({UserId:t,AppName:n})})}static confirmPhoneNumberByAccessRecovery(n,t,i,o){return j(`${N.identityServerURL}/api/Authenticate/ConfirmPhoneNumberByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:i,Code:o})})}static confirmEmailByAccessRecovery(n,t,i,o){return j(`${N.identityServerURL}/api/Authenticate/ConfirmEmailByAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Prefix:i,Code:o})})}static finishAccessRecovery(n,t,i,o){return j(`${N.identityServerURL}/api/Authenticate/FinishAccessRecovery`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({AppName:n,Token:t,Password:i,ConfirmedPassword:o})})}}class Bo{static readHistoryById(n,t){return j(`/close-api/audits/history/${n}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Do{static getConfiguration(){return j("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(n){return await j(`/open-api/data/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Fo{static getDictionary(n){if(!n)throw new Error(`Can't get dictionary for ${n}.`);return j(`/open-api/internationalization/language/${n}`)}}class Po{static async upload(n,t){const i=new FormData;return i.append("file",n),j(`/close-api/files?entityName=${t}`,{method:"POST",body:i}).then(o=>(o.filename=n.name,o))}}var nn=(e=>(e.Add="A",e.Delete="D",e.Modify="M",e.None="N",e))(nn||{}),rn=(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))(rn||{});function Vo(e){return typeof e!="object"||e===null?!1:!!(e.hasOwnProperty("start")||e.hasOwnProperty("end"))}function F(e){return Object.keys(e).reduce((n,t)=>{const i=e[t];if(Array.isArray(i)){const o=i.map(a=>typeof a=="string"?`'${a}'`:a).join(", ");return i.length&&n.push(`@${t} in (${o})`),n}if(Vo(i)){let o=function(a){var l;return((l=a.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return i.start&&n.push(`@${t} ge ${o(i.start)}`),i.end&&n.push(`@${t} le ${o(i.end)}`),n}return typeof i=="number"||typeof i=="boolean"?(n.push(`@${t} eq ${i}`),n):typeof i=="string"?(i.length!==0&&n.push(`@${t} eq '${i}'`),n):(i===null&&n.push(F.is(t,i)),n)},[]).join(" and ")}function we(e){return typeof e=="string"?`'${e}'`:`${e}`}F.includes=function(n,t){return`@${n} Contains ${we(t)}`},F.beginWith=function(n,t){return`@${n} BeginWith ${we(t)}`},F.notEq=function(n,t){return`@${n} nq ${we(t)}`},F.eq=function(n,t){return Array.isArray(t)?F.in(n,t):`@${n} eq ${we(t)}`},F.in=function(n,t){const i=t.map(we).join(", ");return`@${n} in (${i})`},F.notIn=function(n,t){return!Array.isArray(t)||t.length===0?"":F.and(...t.map(i=>F.notEq(n,i)))},F.and=function(...n){return n.filter(t=>typeof t!="string"||t.trim().length===0?!1:t).map(F.wrap).join(" and ")},F.wrap=function(n){return`(${n})`},F.is=function(n,t){return`@${n} is ${t}`},F.or=function(...n){return n.join(" or ")};function it(e){return Object.keys(e).reduce((n,t)=>{let i=e[t];const o=t.charAt(0).toUpperCase()+t.slice(1);return typeof i=="object"&&!(i==null||Array.isArray(i))&&(i=it(i)),n[o]=i,n},{})}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||{});const z=new rt,be=new $o;p.ApplicationStatus=rn,p.Communication=Lo,p.CoreError=Q,p.DisplayListRow=Ye,p.EventBus=be,p.Filter=F,p.Manager=z,p.MetadataStore=ye,p.ModalListDownload=Sr,p.NotificationSystem=et,p.OBJECT_TYPE_NAME_FIELD=ft,p.RecordOperation=nn,p.WidgetAction=Ar,p.WidgetButton=Vn,p.WidgetFastTable=Tr,p.WidgetFastTableHeadCell=yt,p.WidgetField=ir,p.WidgetIcon=pe,p.WidgetImage=zn,p.WidgetList=rr,p.WidgetLoader=ht,p.WidgetMultiButton=jn,p.WidgetSpinner=me,p.WidgetTable=gt,p.WidgetTablePanelFilterItem=wt,p.asyncProcess=ce,p.authService=X,p.billingService=se,p.catchUniversal=W,p.config=Nn,p.configuration=N,p.constants=I,p.convertDDToDMS=Qi,p.convertDMSToDD=Yi,p.convertListConfig=zt,p.coreUtils=io,p.debounce=$r,p.documentsService=dn,p.fileService=Po,p.formatter=fe,p.getCellName=le,p.getCellValue=Te,p.getEntityLink=Je,p.getNamesFromListConfig=He,p.getUnitValue=Me,p.groupArrayByField=Lr,p.historyService=Bo,p.injectAction=bt,p.internationalizationService=Fo,p.invitationService=un,p.openService=Do,p.parseError=je,p.parseTextByMarkdown=Ji,p.prettyDate=Se,p.prettyDateWithTime=Et,p.prettyMoney=Ct,p.prettyValueFieldByEntity=Fr,p.request=j,p.setupListRow=xe,p.staticLink=Hr,p.t=Z,p.throttle=Br,p.universalEntityCount=qr,p.universalEntityCreate=Tt,p.universalEntityDelete=At,p.universalEntityRead=te,p.universalEntityUpdate=qe,p.universalHistoryRead=jr,p.universalListSettingRead=_t,p.universalMetadataFieldTreat=xr,p.universalMetadataListRead=Wr,p.universalToolRead=St,p.useActions=yo,p.useCommunication=mo,p.useEnter=wo,p.useFormEntity=go,p.useListActiveRow=oo,p.useListDownload=Yt,p.useListEntity=so,p.useListSearch=Eo,p.useListSelect=bo,p.useLocalStorage=ut,p.useManagerState=lo,p.useMetadata=Be,p.useSocket=B,p.useUsageContext=Qe,p.useVisibleItem=We,p.useWizard=Ao,p.uuidv4=Or,p.valuesToUpperCase=it,p.wrapToolResponse=It,Object.defineProperty(p,Symbol.toStringTag,{value:"Module"})});
13
13
  //# sourceMappingURL=eservices-core.umd.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.3.244",
3
+ "version": "1.3.245",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {