eservices-core 1.3.240 → 1.3.241

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,13 +1,13 @@
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: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-c5ee1c36]{display:flex;gap:15px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
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),Ce=(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.240
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: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-b20a18f4]{display:flex;gap:15px}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
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.241
4
4
  * (c) 2024 ESERVICES
5
- */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),O=require("jenesius-vue-form"),Re=require("vue-router"),an=require("date-and-time"),Oe=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
- 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 oe(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 oe("/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 oe("/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 oe("/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 re{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${re.url()}/calculator/${t}`)}static calculate(t,n){return oe(`/${re.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 oe(`/${re.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return oe(`/${re.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(O.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 ae(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"),O.utils.getPropFromObject(t,o))}),e}function Ue(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Fe(e,t){const n=ae(e);if(typeof e.value=="string")return vn(e.value,t);let o=n?O.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=Ie(typeof o=="string"?o:null);break}case"dateTime":case"dateWithTime":{o=Ot(typeof o=="string"?o:null);break}case"money":{o=Ft(o);break}case"DateTime":{o=Ie(typeof o=="string"?o:null,e.format||S.dateTimeFormat);break}}return e.formatter&&(o=le(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",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:Tt,FIELD_NAME_REFERENCE_CHANGES:Cn};function Be(e){return[I.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(O.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=xe(n.filterMetadata.entity),a=f=>(n.values||[]).includes(f),l=t;function c(f){const g=n.values||[];return g.includes(f)?l("update:values",g.filter(m=>m!==f)):l("update:values",[...g,f])}const s=se(async()=>{o.value=await te(n.baseEntity,{fields:n.filterMetadata.name.join(" "),order:[n.filterMetadata.name[1],"asc"],distinct:!0,filter:B(n.filters)}).then(f=>f.map(g=>({label:g[n.filterMetadata.name[1]],value:g[n.filterMetadata.name[0]]})))});function u(){l("update:values",[])}return r.watch(()=>s.loading,f=>{l("readProcess",f?"start":"end")},{immediate:!0}),r.watch(()=>i.value,()=>{s.loading||s.call()},{immediate:!0}),(f,g)=>{const m=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",An,[r.createElementVNode("div",Sn,[r.createVNode(m,{label:"Reload filter",loading:r.unref(s).loading||!1,icon:"reload",onClick:g[0]||(g[0]=()=>r.unref(s).call())},null,8,["loading"]),r.createVNode(m,{label:"Clear",onClick:u})]),(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(o.value,p=>(r.openBlock(),r.createBlock(r.unref(O.FormField),{class:"widget-filter-enum-item",key:p.value,onClick:()=>c(p.value),type:"single-checkbox","model-value":a(p.value),label:p.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 Rn(e){Ln();for(let t in e)S[t]=e[t]}const On={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(On,[["__scopeId","data-v-8a72b45f"]]),Fn=Oe(Be("setup-list-row"));function Bn(e,t){const n=e.config.map(o=>$n(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function $n(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(f){a.onClick.push(()=>f(o,e,n))}function c(f){Array.isArray(f)?a.class.push(...f):a.class.push(f)}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(O.FormField,{type:"single-checkbox",modelValue:t.selected})),l(ut.bind(null,n,!0));break}case"select":{u.push(r.h(O.FormField,{type:"single-radio",modelValue:t.selected})),l(ut.bind(null,n,!1));break}}if(e.onClick&&l(e.onClick),e.link)try{const f=e.link(o);if(f){const g=r.h(Re.RouterLink,{to:f});u.push(g),c("widget-table-cell_link")}}catch(f){Fn("Can't add router link",f)}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 f=e.icon(o);f!==null&&u.push(r.h(me,{name:f}))}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(f=>f(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 xn={props:{values:Object,config:Object,selected:Boolean},setup:Xe},Dn=["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,Dn)],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 p;return(p=i==null?void 0:i.default)==null?void 0:p.call(i)[0]});function l(){const v=n.selectedRows.length!==0?[]:[...n.array];o(Me,v)}function c(p){return n.useMockField?vt(p):p}function s(p,v=!0){if(!n.selectedRows)return;if(!v)return o(Me,n.selectedRows.includes(p)?[]:[p]);const d=[...n.selectedRows],y=d.indexOf(p);return y===-1?d.push(p):d.splice(y,1),o(Me,d)}function u(p){o(Vn,p)}function f(p){o("save",p),o("update:activeRow",null)}const g=r.computed(()=>n.shortcut?n.config.filter(p=>p.name?!!n.array.find(d=>![null,""].includes(Fe(p,d))):!0):n.config),m=r.computed(()=>n.useMockField?n.array.filter(vt):n.array);return(p,v)=>(r.openBlock(),r.createElementBlock("div",null,[r.createElementVNode("table",Pn,[r.createElementVNode("thead",null,[r.createVNode(hn,{config:g.value,onOrder:v[0]||(v[0]=d=>p.$emit("order",d))},{default:r.withCtx(d=>[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(p.$slots["head-cell"]||kt),r.mergeProps(d,{onSelect:l}),null,16))]),_:1},8,["config"])]),r.createElementVNode("tbody",null,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(m.value,(d,y)=>(r.openBlock(),r.createElementBlock(r.Fragment,{key:y},[r.createVNode(xn,{config:g.value,values:d,selected:p.selectedRows.includes(c(d)),onSelect:h=>s(c(d),h),onActivate:h=>u(c(d)),class:r.normalizeClass(p.classCallback?p.classCallback(d):"")},null,8,["config","values","selected","onSelect","onActivate","class"]),a.value&&p.activeRow===c(d)?(r.openBlock(),r.createBlock(ft,{key:0,component:a.value,"row-length":p.config.length,values:d,onClose:v[1]||(v[1]=h=>o("update:activeRow",null)),onSave:f,"is-new":!1},null,8,["component","row-length","values"])):r.createCommentVNode("",!0)],64))),128)),p.activeRow===r.unref(I).LIST_ACTIVE_NEW?(r.openBlock(),r.createBlock(ft,{key:0,component:a.value,"row-length":g.value.length,onClose:v[2]||(v[2]=d=>o("update:activeRow",null)),onSave:f,"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))}}),we=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(we,{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:f=>{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(we),{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(we,{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(O.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,d){let y=-1;do y++,d-=v[y];while(d>0&&y<v.length);return y}function f(v,d){let y=0;for(;d>0&&d>v[y]&&y<v.length;)d-=v[y],y++;return console.log(d,y),y>0?y:0}function g(v){try{a.value.style.insetInlineStart=v+"px"}catch(d){console.log(d)}}function m(v){try{a.value.style.width=v+"px",a.value.style.minWidth=v+"px",a.value.style.maxWidth=v+"px"}catch(d){console.log(d)}}function p(v){return v===null?!1:v.classList.contains("head-cell-resize")}i.value.addEventListener("pointerdown",function(d){var ue;function y(P){return P.screenX+E-N}const h=i.value,w=[...h.children].filter(P=>P.localName==="th"),E=((ue=h.offsetParent)==null?void 0:ue.scrollLeft)||0,T=w.map(P=>P.clientWidth),$=p(d.target),N=h.getBoundingClientRect().left,k=y(d),C=u(T,k),b=T.slice(0,C).reduce((P,G)=>P+G,0),_=k-b,A=h.offsetWidth,D=w[C].clientWidth;if(n.config[C].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",d.screenX),console.log("Widths",T),console.log("max width",A),console.log("Start Position",k),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",_),console.groupEnd(),a.value.innerText=w[C].textContent||"",a.value.style.display="grid",a.value.style.width=D+"px",a.value.style.cursor="grabbing",g(b),m(D),document.addEventListener("pointermove",ce,{passive:!0}),document.addEventListener("pointerup",x);function x(P){if(console.group("END"),document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",x),$&&(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)),!$){const G=P.screenX+E-N;console.log("ENP Position",G);const Ee=f(T,G);if(console.log(C,"->",Ee),Ee!==C){const fe=n.config[C],De=n.config;De.splice(C,1),De.splice(Ee,0,fe),l(De)}else{const fe=n.config[C].name;c(fe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ce(P){if($){const fe=y(P)-k+D;m(fe);return}let G=P.screenX+E-N-_;G<0&&(G=0),G+D>A&&(G=A-D),g(G)}})});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 f=n.order.length===1||n.order[1]==="asc"?"asc":"desc";s([u,f==="asc"?"desc":"asc"])}function s(u){o("update:order",u)}return(u,f)=>(r.openBlock(),r.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:i},[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(u.config,(g,m)=>(r.openBlock(),r.createBlock(ar,r.mergeProps({key:g,ref_for:!0},g,{onOrder:p=>c(g.name),onSelect:f[0]||(f[0]=p=>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 f=[...n.selectedRows],g=f.indexOf(s);g===-1?f.push(s):f==null||f.splice(g,1),l(f)}}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]=f=>a()),"onUpdate:order":u[1]||(u[1]=f=>o("update:order",f)),"onUpdate:config":u[2]||(u[2]=f=>o("update:config",f)),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,(f,g)=>{var m;return r.openBlock(),r.createBlock(tr,{key:g,class:"widget-list-row",values:f,config:s.config,selected:(m=s.selectedRows)==null?void 0:m.includes(f),onSelect:p=>i(f,p)},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(I.VISIBLE_ITEM_PROVIDE_NAME,{show(l){n[l]=!0},hide(l){n[l]=!1},remove(l){delete n[l]}});const o=r.inject(I.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:{}},setup(e){const t=e,n=xe(),o=rt(),i=r.computed(()=>{var d,y,h;const m=s.value,p=u(m),v={type:p,disabled:!((d=c.value)!=null&&d.canSet),label:t.label};return p==="Decimal"&&((h=(y=m==null?void 0:m.presentationType)==null?void 0:y.toLowerCase)==null?void 0:h.call(y))==="money"&&(v.money=!0),m&&Object.assign(v,{suffix:p==="number"?m.valueUnit:void 0,required:l.includes(p||"")?!1:m.required,label:t.label||m.displayName}),Array.isArray(S.arrayFieldParamsHandlers)&&S.arrayFieldParamsHandlers.forEach(w=>Object.assign(v,w(m,c.value,v))),v}),a=["MultiText","MultiWideText"],l=["switch","single-checkbox","single-radio"],c=r.computed(()=>{var m;return(m=o==null?void 0:o.value)==null?void 0:m.fields[t.name]}),s=r.computed(()=>{if(!n.value)return;const m=n.value.fieldsByName[t.name];if(m)return m});function u(m){if(typeof t.type=="string"&&t.type.length!==0)return t.type;if(m){if(m.type==="Reference"||m.type==="Owned")return m.referencedEntity;if(m.dataType==="Boolean")return"single-checkbox";if(m.dataType==="DateTime")return"date";if(m.dataType==="Integer"||m.dataType==="Decimal")return"number";if(m.dataType==="List")return m.aggregatedEntity;if(a.includes(m.presentationType))return"textarea";if(m.presentationType==="PhoneNumber")return"tel"}return"text"}const f=r.computed(()=>{var m;return((m=c.value)==null?void 0:m.canGet)===!0}),{controller:g}=Ke();return r.watch(()=>f.value,m=>m?g.show():g.hide(),{immediate:!0}),r.onUnmounted(()=>g.remove()),(m,p)=>f.value?(r.openBlock(),r.createBlock(r.unref(O.FormField),r.mergeProps({key:0},{...m.$attrs,...i.value},{name:m.name}),null,16,["name"])):r.createCommentVNode("",!0)}});function mr(e){return Array.isArray(e)&&(e==null?void 0:e[1])||I.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(O.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 p=n.filterItem;return p.entity?"Entity":p.type?p.type:null});function c(p){s.value=p==="start"}const s=r.ref(!1),u=r.computed(()=>Array.isArray(n.values)||typeof n.values=="string"?n.values.length>0:!!n.values),f=r.ref(!1);let g=null;function m(p=!f.value){f.value=p,!f.value&&g?(g(),g=null):a.value&&(g=O.utils.clickOutside(a.value,m.bind(null,!1)))}return(p,v)=>{var d;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]=()=>m())},[r.createElementVNode("span",{class:r.normalizeClass(["widget-filter-item-label",{"widget-filter-item-label_active":u.value}])},r.toDisplayString(p.filterItem.label||"--"),3),s.value?(r.openBlock(),r.createBlock(we,{key:0})):(r.openBlock(),r.createBlock(Ar,{key:1,color:"white",class:r.normalizeClass({"widget-filter-item-arrow":f.value})},null,8,["class"]))],2),r.withDirectives(r.createElementVNode("div",Sr,[l.value?(r.openBlock(),r.createBlock(r.resolveDynamicComponent((d=r.unref(i))==null?void 0:d[l.value]),{key:0,"filter-metadata":p.filterItem,values:p.values,filters:p.filters,"base-entity":p.entity,"onUpdate:values":v[1]||(v[1]=y=>o("update:values",y)),onReadProcess:c},null,40,["filter-metadata","values","filters","base-entity"])):r.createCommentVNode("",!0)],512),[[r.vShow,f.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(ae)(c)],filters:a.filters,"onUpdate:values":f=>i(r.unref(ae)(c),f)},null,8,["entity","filter-item","values","filters","onUpdate:values"])}),128))]))}}),Rr=j(Lr,[["__scopeId","data-v-89e1fa2d"]]),Or={class:"widget-fast-table-tools"},Fr=r.defineComponent({__name:"widget-fast-table-tools",props:{tools:{},loading:{type:Boolean},selectedRows:{},metadata:{}},emits:["reload"],setup(e,{emit:t}){const n=e,o=t,i=[{name:"config",label:"Settings",icon:"list-settings",buttonStyle:"default",callback:()=>null},{name:"export",label:"Save as CSV",icon:"list-download",buttonStyle:"default",callback:()=>null},{name:"reload",label:"Reload",icon:"reload",buttonStyle:"default",callback:()=>o("reload")}],a=i.map(f=>f.name),l=r.inject(I.PROVIDE_NAME_ACTIONS,[]),c=r.computed(()=>{var m;const f=((m=l==null?void 0:l.actions)==null?void 0:m.value)||[];return Array.isArray(n.tools)?n.tools.reduce((p,v)=>{if(v.name==="*")p.push(...i);else if(a.includes(v.name)){const d=i.find(y=>y.name===v.name);d&&p.push(d)}else{const d=f.find(y=>y.name===v.name);d&&p.push({name:v.name,label:d.title,icon:v.icon,buttonStyle:v.buttonStyle,callback:()=>Promise.resolve().then(()=>{s[v.name]=!0}).then(()=>u(d)).finally(()=>{s[v.name]=!1})})}return p},[]):[]}),s=r.reactive({});function u(f){var p;const g=(p=f.action.parameters.find(v=>v.dataTypeName==="IntegerArray"))==null?void 0:p.name,m={};return g&&(m[g]=n.selectedRows.map(v=>{if(!(typeof v=="object"&&v!==null))return null;const d=n.metadata.fieldNameForIdentification;return d===void 0?null:v[d]})),f.callback(m)}return(f,g)=>{const m=r.resolveComponent("widget-button");return r.openBlock(),r.createElementBlock("div",Or,[(r.openBlock(!0),r.createElementBlock(r.Fragment,null,r.renderList(c.value,p=>(r.openBlock(),r.createBlock(m,{label:p.label,title:p.name,icon:p.icon,type:p.buttonStyle,loading:p.name==="reload"?f.loading:s[p.name],onClick:p.callback},null,8,["label","title","icon","type","loading","onClick"]))),256)),r.renderSlot(f.$slots,"default",{},void 0,!0)])}}}),Br=j(Fr,[["__scopeId","data-v-c5ee1c36"]]);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 $r(){const e=At();Re.useRouter();const t=r.reactive({entity:null,mark:null,settings:null});function n(d){const y={...c.value,...d};o(y)}function o(d){{const y=d.prefilters;y&&(Object.keys(y).forEach(h=>{var w,E;Array.isArray(y[h])&&y[h].length===0&&t.settings&&!((E=(w=t.settings)==null?void 0:w.prefilters)!=null&&E[h])&&delete y[h]}),O.utils.isEmptyObject(y)&&delete d.prefilters)}localStorage.setItem(l(t.entity,t.mark),JSON.stringify(d))}function i(){return t.entity?JSON.parse(localStorage[l(t.entity,t.mark)]||"{}"):null}function a(d,y){t.entity=d,t.mark=y,u.call()}function l(d,y){return"list-configuration:"+d+(y?"-"+y:"")}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=se(async function(){if(!t.entity)return;const y=await $t(t.entity,t.mark);t.settings=Object.freeze(y)}),f=r.computed(()=>{var h;const d=c.value.prefilters||{};return{...((h=t.settings)==null?void 0:h.prefilters)||{},...d}}),g=r.computed(()=>{var d;return((d=t.settings)==null?void 0:d.filters)||[]}),m=r.computed(()=>{var d;return((d=t.settings)==null?void 0:d.label)||null}),p=r.computed(()=>{var d;return((d=t.settings)==null?void 0:d.tools)||[]}),v=r.computed(()=>!O.utils.isEmptyObject(c.value));return{state:t,get customFilters(){return t.settings.customFilters||[]},set:a,get:i,configuration:c,update:n,computedPrefilter:f,computedFiltersConfiguration:g,get prefilters(){var d,y;return(d=i())==null||d.prefilters,((y=i())==null?void 0:y.prefilters)||t.settings.prefilters||{}},get order(){var d;return((d=i())==null?void 0:d.order)||[]},clean(){localStorage.removeItem(l(t.entity,t.mark))},cellConfiguration:s,computedLabel:m,computedTools:p,computedHasLocalConfiguration:v}}const xr={class:"es-grid es-gap-15"},Dr={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=Re.useRouter(),i=r.ref([]),a=r.ref(null),l=r.ref(null),c=O.Form.getParentForm(),s=r.ref([]),u=xe(n.entity),{state:f,update:g}=rt(n.entity,{masterEntities:n.masterEntities||[]}),m=r.computed(()=>{var b;return((b=C.value)==null?void 0:b.displayItem)||nt.inline}),p=r.computed(()=>{var b;return((b=C.value)==null?void 0:b.newItem)||m.value}),v=se(async()=>{try{await d.call(),await g()}catch(b){const{message:_}=Ye(b);a.value=_}});c instanceof O.Form&&c.subscribe({read:v.call.bind(null),name:n.entity,type:"table"}),r.watch(()=>n.mark,()=>{N.set(n.entity,n.mark)});const d=se(async function(){const _=n.entity;a.value=null,s.value=[];const A=(await te(_,{customFilters:N.customFilters,fields:Qe(k.value).join(" "),order:N.order,filter:B.and(B(N.prefilters),B(n.binding||{}))})).map(hi);i.value=A});async function y(b){var D;if(b===null)return l.value=null;const _=new ge(n.entity,b),A=_.hasPrimaryKey()?_.primaryKey:null;if(!A&&((D=C.value)!=null&&D.linkNew))return o.push(C.value.linkNew);if(m.value==="form")return A?o.push(tt(n.entity,A)):console.warn("Can't open form without primaryKey");if(m.value==="inline")return l.value=b||I.LIST_ACTIVE_NEW;m.value==="modal"?(await H.promptModal("form",{entity:n.entity,primaryKey:A,id:A}),await d.call()):l.value=I.LIST_ACTIVE_NEW}const{controller:h}=Ke();r.watch(()=>f.value,b=>{b&&(b.canRead?h.show():h.hide())},{immediate:!0}),r.onUnmounted(()=>h.remove());let w=[ye.on("affected-entity",b=>{b.name===n.entity&&d.call()}),ye.on("display-entity",async b=>{b.name===n.entity&&(d.promise&&await d.promise,l.value=i.value.find(_=>_.Id===b.id)||null)})];r.onUnmounted(()=>w.map(b=>b()));function E(b){function _(x){return Array.isArray(x)?_(x[0]):typeof x!="string"?null:x}const A=_(b);if(!A)return;const D=N.order;T("order",D[0]!==A?[A,"asc"]:D[1]==="desc"?[]:[A,"desc"])}function T(b,_){N.update({[b]:_}),d.call()}const $=r.computed(()=>v.wait||d.wait),N=$r(),k=N.cellConfiguration;N.set(n.entity,n.mark),r.watch(()=>N.state.settings,b=>{d.call()});const C=r.computed(()=>N.state.settings);return t({listSettings:C,array:i,config:k,activeRow:l}),(b,_)=>{const A=r.resolveComponent("widget-button"),D=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",xr,[r.unref(N).computedLabel.value&&!b.hideLabel?(r.openBlock(),r.createElementBlock("p",Dr,r.toDisplayString(r.unref(N).computedLabel.value),1)):r.createCommentVNode("",!0),r.unref(u)?(r.openBlock(),r.createBlock(Br,{key:1,metadata:r.unref(u),tools:r.unref(N).computedTools.value,loading:$.value,"selected-rows":s.value||[],onReload:r.unref(v).call},{default:r.withCtx(()=>{var x;return[p.value==="form"||(x=r.unref(f))!=null&&x.canCreate?(r.openBlock(),r.createBlock(A,{key:0,onClick:_[0]||(_[0]=()=>y(r.unref(I).LIST_ACTIVE_NEW)),type:"primary",label:"Add New"})):r.createCommentVNode("",!0),r.unref(N).computedHasLocalConfiguration.value?(r.openBlock(),r.createBlock(A,{key:1,onClick:r.unref(N).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(Rr,{entity:b.entity,"filters-config":r.unref(N).computedFiltersConfiguration.value,filters:r.unref(N).computedPrefilter.value,"onUpdate:filters":_[1]||(_[1]=x=>T("prefilters",x))},null,8,["entity","filters-config","filters"]),r.createVNode(r.unref(St),{config:r.unref(k),array:i.value,"active-row":l.value,"onUpdate:activeRow":y,onOrder:E,class:"table",selectedRows:s.value,"onUpdate:selectedRows":_[3]||(_[3]=x=>s.value=x)},{"head-cell":r.withCtx(x=>{var ce,ue,P;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(b.$slots["head-cell"]?b.$slots["head-cell"]:Nt),r.mergeProps({label:x.label},x,{onOrder:E,order:r.unref(N).configuration.value.order||[],type:x.type,"is-full-selected":((ce=s.value)==null?void 0:ce.length)===((ue=i.value)==null?void 0:ue.length)&&((P=i.value)==null?void 0:P.length)>0}),null,16,["label","order","type","is-full-selected"]))]}),default:r.withCtx(()=>[r.createVNode(D,{entity:b.entity,"primary-key":r.unref(ge).getPrimaryKey(n.entity,l.value),"master-entities":b.masterEntities||void 0,binding:b.binding,onFormUpdate:_[2]||(_[2]=()=>{l.value=null,r.unref(d).call()})},null,8,["entity","primary-key","master-entities","binding"])]),_:1},8,["config","array","active-row","selectedRows"])])])}}});function Rt(e,t={},n={}){const o=r.inject(I.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=Rt(t.name,t.overrideParams||{}),o=r.computed(()=>{if(n.value)return se(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"),f=r.resolveComponent("widget-modal-wrap");return r.openBlock(),r.createBlock(f,null,{footer:r.withCtx(()=>[r.createVNode(u,{onClick:s[0]||(s[0]=g=>{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 Ot(e){return Ie(e,"YYYY/MM/DD HH:mm:ss")}function Ie(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 se(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"?ke(e):Ur(e)?ke(e.message,e.children||e.details||[]):Wr(e)?ke(e.title,[e.detail||""]):ke(I.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 ke(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 te(e,t={}){const n=F();return qr(t)&&t.id&&(t.primaryKey=t.id,delete t.id),n.emit("entity:read",{...t,entity:e})}function qr(e){return!!(e.id||e.primaryKey)}function Je(e,t){return F().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 I.DEFAULT_ERROR_MESSAGE}})}function U(e,t={}){return q.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=q.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(I.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=Oe(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 Z=Oe(Be("use-socket"));function F(){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 h=new Uint8Array(1);h[0]=wn,t.send(h)}setInterval(()=>{Array.from(o).forEach(h=>{y(h)&&(Z("Handler for event %s requestId %d was expired",h.event,h.requestId),h.requestId?s({requestId:h.requestId,event:_t,data:{message:J.RequestTookToLong().message}}):o.delete(h))})},1e3),setInterval(()=>{(!t||t.readyState===3)&&u()},I.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function s(h){const w=[...o.values()];Z("Handlers array length is %d. Response event: %s. Request id: %d",o.size,h.event,h.requestId),w.forEach(E=>{const T=h.requestId;(E.requestId&&E.requestId===T||!E.requestId&&E.event===h.event)&&(Z("Find appropriated handler: %d, event: %s",e,E.event),E.callback(h.data,h),E.once&&(o.delete(E),Z("Handler was removed by *once* params was passed. %o",E)))})}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(h){Z("Connection to server was stopped: %d %s",h.code,h.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(h=>{f(h),a.delete(h)})},t.onerror=function(h){console.warn(h)},t.onmessage=h=>{var w;try{if(Qr(h.data)){l();return}const E=JSON.parse(h.data);if(!Bt(E)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(E);return}(w=E==null?void 0:E.data)!=null&&w.refresh&&location.reload(),s(E)}catch(E){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(E)}}}function f(h){t.send(h)}function g(h,w){d({event:h,callback:w})}function m(h,w){d({event:h,callback:w,once:!0})}function p(){return t&&(t==null?void 0:t.readyState)===1}function v(h,w,E){const T=++e,$=JSON.stringify({requestId:T,event:h,data:w,contextId:q.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return p()?f($):(a.add($),Z("Socket is not connected. Message was send to save-queue")),new Promise((N,k)=>{d({event:h,requestId:T,once:!0,guaranteedAnswer:!0,serializeString:$,callback:(C,b)=>{if(Z("Promise was resolve with next data:",C),eo(b))return void k(C);E&&E(C,b),N(C)},timeToLive:I.TIME_TO_LIVE_SOCKET_REQUEST})})}function d(h){const w={timeToLive:0,...h,created:new Date().getTime()};o.add(w)}function y(h){return h.timeToLive===0||typeof h.timeToLive!="number"?!1:new Date().getTime()-h.created>h.timeToLive}return{get socket(){return t},on:g,once:m,emit:v,initialization(h){n=h},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 $t(e,t){return F().emit("list-setting:read",{entity:e,mark:t})}function to(e,t){return F().emit("metadata-field:treat",{entity:e,fieldName:t})}function xt(e,t){return F().emit("entity:create",{...t,entity:e})}function Dt(e,t){return F().emit("entity:delete",{...t,entity:e})}function no(e,t){return F().emit("usage-context:read",{...t,entity:e})}function Pt(e={}){return F().emit("tool:read",e)}function ro(){return F().emit("metadata-list:read",{})}function oo(e){return F().emit("history:read",e)}function io(e,t){return F().emit("entity:count",{...t,entity:e})}function ao(e){return`/${En}/${e}`}function le(e){return{exec(t,n){switch(e.name){case"replace-boolean":return le.replaceBoolean(t,e.values);case"replace-record-operation":return le.replaceRecordOperation(t)}}}}le.replaceBoolean=so;le.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 F().emit("tool:execute",e)}const uo=Oe(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 f of e.handlers)await f(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(f=>{var g;return(g=e.handleAffectedEntity)==null?void 0:g.call(e,t,f,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(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:n}))return t()}function go(e,t){const n=I.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,f){u&&(uo("Affected Entity %s. Find form with name %s.",f,u.name),u.name===f&&o(u)&&u.read(),u instanceof O.Form&&u.dependencies.forEach(g=>i(g,f)))}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 ee={};function Q(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=O.utils.getPropFromObject((this==null?void 0:this.vocabulary)||ee,e);if(typeof n=="string")return dt(n,t);const o=O.utils.getPropFromObject(ee==null?void 0:ee.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){ee=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:O.utils.getPropFromObject(ee,t.toLowerCase())})};Q.setVocabulary=function(e){return typeof e=="string"&&(e=O.utils.getPropFromObject(ee,e)),Q.bind({vocabulary:e})};function wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var We={exports:{}},R={},qe={exports:{}},ne={};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}ne.whiteList=Mt();ne.getDefaultWhiteList=Mt;ne.onAttr=bo;ne.onIgnoreAttr=Eo;ne.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 f=de.trim(e.slice(i,a)),g=f.indexOf(":");if(g!==-1){var m=de.trim(f.slice(0,g)),p=de.trim(f.slice(g+1));if(m){var v=t(i,l.length,m,p,f);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===`
7
- `&&c()}return de.trim(l)}var Ao=To,_e=ne,So=Ao;function pt(e){return e==null}function Io(e){var t={};for(var n in e)t[n]=e[n];return t}function jt(e){e=Io(e||{}),e.whiteList=e.whiteList||_e.whiteList,e.onAttr=e.onAttr||_e.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||_e.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||_e.safeAttrValue,this.options=e}jt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onAttr,a=n.onIgnoreAttr,l=n.safeAttrValue,c=So(e,function(s,u,f,g,m){var p=o[f],v=!1;if(p===!0?v=p:typeof p=="function"?v=p(g):p instanceof RegExp&&(v=p.test(g)),v!==!0&&(v=!1),g=l(f,g),!!g){var d={position:u,sourcePosition:s,source:m,isWhite:v};if(v){var y=i(f,g,d);return pt(y)?f+":"+g:y}else{var y=a(f,g,d);if(!pt(y))return y}}});return c};var No=jt;(function(e,t){var n=ne,o=No;function i(l,c){var s=new o(c);return s.process(l)}t=e.exports=i,t.FilterCSS=o;for(var a in n)t[a]=n[a];typeof window<"u"&&(window.filterCSS=e.exports)})(qe,qe.exports);var Ze=qe.exports,et={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},Lo=Ze.FilterCSS,Ro=Ze.getDefaultWhiteList,Ne=et;function Ut(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Wt=new Lo;function Oo(e,t,n){}function Fo(e,t,n){}function Bo(e,t,n){}function $o(e,t,n){}function qt(e){return e.replace(Do,"&lt;").replace(Po,"&gt;")}function xo(e,t,n,o){if(n=Yt(n),t==="href"||t==="src"){if(n=Ne.trim(n),n==="#")return"#";if(!(n.substr(0,7)==="http://"||n.substr(0,8)==="https://"||n.substr(0,7)==="mailto:"||n.substr(0,4)==="tel:"||n.substr(0,11)==="data:image/"||n.substr(0,6)==="ftp://"||n.substr(0,2)==="./"||n.substr(0,3)==="../"||n[0]==="#"||n[0]==="/"))return""}else if(t==="background"){if(Te.lastIndex=0,Te.test(n))return""}else if(t==="style"){if(mt.lastIndex=0,mt.test(n)||(gt.lastIndex=0,gt.test(n)&&(Te.lastIndex=0,Te.test(n))))return"";o!==!1&&(o=o||Wt,n=o.process(n))}return n=Jt(n),n}var Do=/</g,Po=/>/g,Vo=/"/g,Mo=/&quot;/g,jo=/&#([a-zA-Z0-9]*);?/gim,Uo=/&colon;?/gim,Wo=/&newline;?/gim,Te=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,mt=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,gt=/u\s*r\s*l\s*\(.*/gi;function Ht(e){return e.replace(Vo,"&quot;")}function Gt(e){return e.replace(Mo,'"')}function zt(e){return e.replace(jo,function(n,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Xt(e){return e.replace(Uo,":").replace(Wo," ")}function Kt(e){for(var t="",n=0,o=e.length;n<o;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return Ne.trim(t)}function Yt(e){return e=Gt(e),e=zt(e),e=Xt(e),e=Kt(e),e}function Jt(e){return e=Ht(e),e=qt(e),e}function qo(){return""}function Ho(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function o(l){return n?!0:Ne.indexOf(e,l)!==-1}var i=[],a=!1;return{onIgnoreTag:function(l,c,s){if(o(l))if(s.isClosing){var u="[/removed]",f=s.position+u.length;return i.push([a!==!1?a:s.position,f]),a=!1,u}else return a||(a=s.position),"[removed]";else return t(l,c,s)},remove:function(l){var c="",s=0;return Ne.forEach(i,function(u){c+=l.slice(s,u[0]),s=u[1]}),c+=l.slice(s),c}}}function Go(e){for(var t="",n=0;n<e.length;){var o=e.indexOf("<!--",n);if(o===-1){t+=e.slice(n);break}t+=e.slice(n,o);var i=e.indexOf("-->",o);if(i===-1)break;n=i+3}return t}function zo(e){var t=e.split("");return t=t.filter(function(n){var o=n.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),t.join("")}R.whiteList=Ut();R.getDefaultWhiteList=Ut;R.onTag=Oo;R.onIgnoreTag=Fo;R.onTagAttr=Bo;R.onIgnoreTagAttr=$o;R.safeAttrValue=xo;R.escapeHtml=qt;R.escapeQuote=Ht;R.unescapeQuote=Gt;R.escapeHtmlEntities=zt;R.escapeDangerHtml5Entities=Xt;R.clearNonPrintableCharacter=Kt;R.friendlyAttrValue=Yt;R.escapeAttrValue=Jt;R.onIgnoreTagStripAll=qo;R.StripTagBody=Ho;R.stripCommentTag=Go;R.stripBlankChar=zo;R.attributeWrapSign='"';R.cssFilter=Wt;R.getDefaultCSSWhiteList=Ro;var $e={},Y=et;function Xo(e){var t=Y.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=Y.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function Ko(e){return e.slice(0,2)==="</"}function Yo(e,t,n){var o="",i=0,a=!1,l=!1,c=0,s=e.length,u="",f="";e:for(c=0;c<s;c++){var g=e.charAt(c);if(a===!1){if(g==="<"){a=c;continue}}else if(l===!1){if(g==="<"){o+=n(e.slice(i,c)),a=c,i=c;continue}if(g===">"||c===s-1){o+=n(e.slice(i,a)),f=e.slice(a,c+1),u=Xo(f),o+=t(a,o.length,u,f,Ko(f)),i=c+1,a=!1;continue}if(g==='"'||g==="'")for(var m=1,p=e.charAt(c-m);p.trim()===""||p==="=";){if(p==="="){l=g;continue e}p=e.charAt(c-++m)}}else if(g===l){l=!1;continue}}return i<s&&(o+=n(e.substr(i))),o}var Jo=/[^a-zA-Z0-9\\_:.-]/gim;function Qo(e,t){var n=0,o=0,i=[],a=!1,l=e.length;function c(m,p){if(m=Y.trim(m),m=m.replace(Jo,"").toLowerCase(),!(m.length<1)){var v=t(m,p||"");v&&i.push(v)}}for(var s=0;s<l;s++){var u=e.charAt(s),f,g;if(a===!1&&u==="="){a=e.slice(n,s),n=s+1,o=e.charAt(n)==='"'||e.charAt(n)==="'"?n:ei(e,s+1);continue}if(a!==!1&&s===o){if(g=e.indexOf(u,s+1),g===-1)break;f=Y.trim(e.slice(o+1,g)),c(a,f),a=!1,s=g,n=s+1;continue}if(/\s|\n|\t/.test(u))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(g=Zo(e,s),g===-1){f=Y.trim(e.slice(n,s)),c(f),a=!1,n=s+1;continue}else{s=g-1;continue}else if(g=ti(e,s-1),g===-1){f=Y.trim(e.slice(n,s)),f=ht(f),c(a,f),a=!1,n=s+1;continue}else continue}return n<e.length&&(a===!1?c(e.slice(n)):c(a,ht(Y.trim(e.slice(n))))),Y.trim(i.join(" "))}function Zo(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function ei(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function ti(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function ni(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ht(e){return ni(e)?e.substr(1,e.length-2):e}$e.parseTag=Yo;$e.parseAttr=Qo;var ri=Ze.FilterCSS,W=R,Qt=$e,oi=Qt.parseTag,ii=Qt.parseAttr,Se=et;function Ae(e){return e==null}function ai(e){var t=Se.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=Se.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=Se.trim(e.slice(0,-1))),{html:e,closing:n}}function si(e){var t={};for(var n in e)t[n]=e[n];return t}function li(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(o){return o.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Zt(e){e=si(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=W.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=li(e.whiteList||e.allowList):e.whiteList=W.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":W.attributeWrapSign,e.onTag=e.onTag||W.onTag,e.onTagAttr=e.onTagAttr||W.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||W.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||W.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||W.safeAttrValue,e.escapeHtml=e.escapeHtml||W.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new ri(e.css))}Zt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onTag,a=n.onIgnoreTag,l=n.onTagAttr,c=n.onIgnoreTagAttr,s=n.safeAttrValue,u=n.escapeHtml,f=t.attributeWrapSign,g=t.cssFilter;n.stripBlankChar&&(e=W.stripBlankChar(e)),n.allowCommentTag||(e=W.stripCommentTag(e));var m=!1;n.stripIgnoreTagBody&&(m=W.StripTagBody(n.stripIgnoreTagBody,a),a=m.onIgnoreTag);var p=oi(e,function(v,d,y,h,w){var E={sourcePosition:v,position:d,isClosing:w,isWhite:Object.prototype.hasOwnProperty.call(o,y)},T=i(y,h,E);if(!Ae(T))return T;if(E.isWhite){if(E.isClosing)return"</"+y+">";var $=ai(h),N=o[y],k=ii($.html,function(C,b){var _=Se.indexOf(N,C)!==-1,A=l(y,C,b,_);return Ae(A)?_?(b=s(y,C,b,g),b?C+"="+f+b+f:C):(A=c(y,C,b,_),Ae(A)?void 0:A):A});return h="<"+y,k&&(h+=" "+k),$.closing&&(h+=" /"),h+=">",h}else return T=a(y,h,E),Ae(T)?u(h):T},u);return m&&(p=m.remove(p)),p};var ci=Zt;(function(e,t){var n=R,o=$e,i=ci;function a(c,s){var u=new i(s);return u.process(c)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var c in n)t[c]=n[c];for(var s in o)t[s]=o[s]}(),typeof window<"u"&&(window.filterXSS=e.exports);function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(We,We.exports);var ui=We.exports;const fi=wo(ui);function di(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),fi(e)}function pi(e,t,n,o){let i=e+t/60+n/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function mi(e,t){const n={dir:e<0?t==="long"?"W":"S":t==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${n.deg}° ${n.min}' ${n.sec}" ${n.dir}`}function tt(e,t){return`/forms/${e}/${t}`}function en(e,t,n){const o=Q.getScope(e.toLowerCase());return t.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>H.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history",i.hint="Open the History"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{H.openModal("form",{entity:yt(i,a),id:a[ae(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const l=i.name[0],c=a[l];return c?tt(yt(i,a),c):null},i.value=(a,l)=>l[i.name[1]]),gi(i,i.type,i.presentation),S.listConvertCellConfigHandler&&S.listConvertCellConfigHandler(e,i),i))}function gi(e,t,n){switch(t){case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const yt=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function vt(e){return typeof e!="object"||e===null?null:e[I.TABLE_MOCK_FIELD]}function hi(e,t){return typeof e!="object"||e===null?(console.warn("cell data is not a valid object."),e):(typeof t=="string"||typeof t=="number"||typeof t=="function"?(typeof t=="function"&&(t=t(e)),e[I.TABLE_MOCK_FIELD]=t):e[I.TABLE_MOCK_FIELD]=e.Id,e)}function yi(e){if(!Array.isArray(S.arrayListCellHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");S.arrayListCellHandlers.push(e)}function vi(e,t){const n=ae(e);return n?O.utils.getPropFromObject(t,n):null}function wi(e){if(!Array.isArray(S.arrayFieldParamsHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");S.arrayFieldParamsHandlers.push(e)}const bi={addListCellHandler:yi,getCellModelValue:vi,addFieldParamsHandler:wi};var nt=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(nt||{});function Ei(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function Ci(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function tn(e,t){e()&&(await t(),await tn(e,t))}function ki(e,t,n={}){let o=!1;const i=r.ref(""),a=r.computed(()=>l.filter(k=>u(k,i.value))),l=r.reactive([]);let c=0;const s=r.ref(!1);let u=(n==null?void 0:n.filterSearchFn)||((k,C)=>Ci(k,C));function f(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function g(){const k=T();return typeof k.limit!="number"&&(k.limit=100),k.offset=c,(n.request||te)(e,k).then(b=>(c+=b.length,b))}function m(k,C){var _;return typeof k.Version=="number"?k.Version:(_=l.find(A=>A.Id===C))==null?void 0:_.Version}function p(k,C){const b=l.findIndex(_=>_.Id===k);if(b===-1)throw new Error(`Can't found item with Id ${k}`);l.splice(b,1,C)}function v(k){const C=l.findIndex(b=>b.Id===k);if(C===-1)throw new Error(`Can't found item with Id ${k}`);l.splice(C,1)}async function d(k,C){try{const b=T(),_=m(C,k);delete C.Version,await Je(e,{id:k,values:C,version:_,masterEntities:f()});const A=await te(e,{fields:b.fields||"",id:k});p(k,A)}catch(b){M()(b)}}async function y(k,C={}){try{const b=T(),_=m(C,k);delete C.Version,await Dt(e,{id:k,version:_,masterEntities:f()}),v(k)}catch(b){M()(b)}}async function h(k){try{await xt(e,{values:k,masterEntities:f()}),await $()}catch(C){M()(C)}}let w;async function E(){s.value=!0;try{w!=null&&w.signal&&!w.signal.aborted&&w.abort();let k=w=new AbortController,C=0;const _=T().limit||0;if(i.value&&!_){console.warn("Using textSearch assumes the use of limit.");return}await tn(()=>(_>0?C<_:!0)&&!o&&!k.signal.aborted,async()=>{const A=await g();k.signal.aborted||(l.push(...A),C+=A.filter(D=>u(D,i.value)).length,(A.length<_||_===0)&&(o=!0))})}catch(k){M()(k)}s.value=!1}function T(){return typeof t=="function"?t():t}async function $(){try{c=0,o=!1,l.splice(0,l.length),await E()}catch(k){M()(k)}}function N(){if(w)return w.abort();s.value=!1}return{array:l,updateById:d,next:E,reload:$,wait:s,create:h,deleteById:y,textSearch:i,filteredArray:a,abort:N}}function _i(){function e(){return{organizations:q.organizations,currentContextId:q.contextId,person:q.person,context:q.context,contextType:q.contextType,userId:q.userId}}const t=r.reactive(e());return q.onupdateContext(()=>{Object.assign(t,e())}),t}function Ti(e,t,n){return F().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function Ai(e,t,n){return F().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function Si(e,t){return F().emit("communication-message:create",{communicationId:e,text:t})}function Ii(e){return F().emit("communication-message:read",{communicationId:e})}function Ni(e){const t=O.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>Ii(e.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function Li(e,t){e.read=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw J.EntityWithoutName(e);return te(e.name,o)}).then(at).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(M())},e.save=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw J.EntityWithoutName(e);return Je(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw M()(i),i})};function n(){return typeof t=="function"?t():t}}function xe(e){if(!e)return r.inject(I.PROVIDE_NAME_METADATA);he.initEntity(e);const t=r.computed(()=>he.state[e]);return r.provide(I.PROVIDE_NAME_METADATA,t),t}function rt(e,t={}){if(!e)return r.inject(I.PROVIDE_NAME_USAGE_CONTEXT);const n=r.ref(null);return r.provide(I.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await no(e,Ri(t||{}))}}}function Ri(e){return typeof e=="function"?e():e}function Oi(e){if(!e)return r.inject(I.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),o=r.computed(()=>n.map(l=>Vt(e,l))),i={actions:o,update:a};r.provide(I.PROVIDE_NAME_ACTIONS,i),e.router=Re.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const l=e==null?void 0:e.form;return Pt({masterEntities:e==null?void 0:e.masterEntities,id:l==null?void 0:l.id,entity:l==null?void 0:l.name}).then(c=>n.splice(0,0,...c)).catch(M("error")).finally(()=>t.value=!1)}return{actions:o,update:a,loading:r.readonly(t)}}function Fi(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function Bi(e,t={}){const n=r.reactive([]),o=s=>{const u=r.unref(e);if(s===void 0){n.length===0?u.forEach(a):u.forEach(l);return}i(s)?l(s):a(s)},i=s=>n.includes(s),a=s=>{t.handleSelect&&!t.handleSelect(s)||i(s)||n.push(s)},l=s=>{const u=n.findIndex(f=>f===s);u!==-1&&n.splice(u,1)},c=r.computed(()=>{const s=r.unref(e);return n.length===s.length&&s.length!==0});return[n,o,c,a,l]}function $i(e){const t=r.ref(""),n=r.computed(()=>{const o=t.value.toLowerCase();return r.unref(e).filter(i=>t.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:t,searchArray:n}}class je{static async getStartConfig(t,n){return F().emit("wizard:configuration",{process:t,entity:n})}static async startProcess(t,n){return F().emit("wizard:start",{process:t,entity:n})}static async runStep(t,n,o,i,a){return F().emit("wizard:step",{process:t,entity:n,stepName:o,token:i,values:a})}}function xi(e){return e.statusName===V.Completed}function Di(e){return[V.FinalStepWithConfirmation,V.NextStepWithConfirmation].includes(e.statusName)}function Pi(e){return e.statusName===V.ValidationError}function Vi(e){return e.statusName===V.Undefined}function Mi(e,t,n){let o=null,i=[];const a=r.ref(!1),l=r.ref(null),c=r.computed(()=>g(i,l.value)),s=r.ref(null),u=r.reactive([]),f=r.computed(()=>u.map(w=>g(i,w)));function g(w,E){return w.find(T=>T.name===E)||null}async function m(w){var E;if(Vi(w)){await n.onDisplayDataSet(w);return}if(!(Di(w)&&!await n.onDisplayDataSet(w))){if(Pi(w))return void n.onValidation(w.validationResults);d(w),await r.nextTick();{const T=((E=g(i,l.value))==null?void 0:E.fields)||[];if([V.FinalStep,V.NextStep,V.FinalStepWithConfirmation,V.NextStepWithConfirmation].includes(w.statusName)&&(!T.length||ji(T,n.presets)))return h(n.presets||{})}xi(w)&&n.onCompleted(w)}}async function p(){try{await v(),await y()}catch(w){M("error")(w)}}function v(){return a.value="Loading process information.",je.getStartConfig(t,e).then(w=>(s.value={label:w.processTitle,info:w.processInfo,icon:w.processIcon},i=w.steps.map(E=>{const T=E.frontendEntity.rootObject,$=Object.fromEntries(E.frontendEntity.objectTypes.map(N=>[N.name,N.properties]));return{label:E.title,name:E.stepName,number:E.number,rootObjectName:T,objectTypes:$,fields:$[T],buttonCaption:E.buttonCaption}}))).finally(()=>{a.value=!1})}function d(w){return[V.FinalStepWithConfirmation,V.NextStepWithConfirmation,V.NextStep,V.Completed,V.FinalStep].includes(w.statusName)?(o=w.token,l.value=w.nextStepName):console.log("Saving is not completed:",w),w}function y(){return a.value="Starting process",je.startProcess(t,e).then(m).catch(M("error")).finally(()=>{a.value=null})}function h(w={}){const E=l.value;return!o||!E?Promise.reject("Not step or token."):(a.value="Waiting for result...",je.runStep(t,e,E,o,w).then(m).then(T=>(u[u.length-1]!==E&&u.push(E),T)).catch(M("error")).finally(()=>{a.value=!1}))}return{initialize:p,loading:a,currentStepConfig:c,currentStepName:l,arrayPassedSteps:f,arrayProcessStepName:u,processInfo:s,next:h}}function ji(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(!O.utils.getPropFromObject(t,o.name))return!1}return!0}function Ui(e,t){const n=typeof e=="string"?e:e.name,o=Object.assign({},typeof e=="string"?{}:e.arguments,t||{});return{name:n,arguments:o}}function Wi(e){return e.limit||(e.limit=150),e}function nn(e,t={}){const{limit:n}=Wi(t),{prefilters:o,order:i}=e;if(!e.entity)throw new Error("-");if(!e.config)throw new Error("-");const a=e.entity,l=e.config,c=e.customFilters||[],s=[l.map(d=>f(d.label)).join(",")],u=r.reactive({count:0,rejected:!1,finished:!1,offset:0});function f(d){d===null&&(d=""),d===void 0&&(d="-");let y=typeof d!="string"?String(d):d;return y=y.replace(/"/g,'""'),y.search(/("|,|\n)/g)>=0&&(y='"'+y+'"'),y}function g(){return te(a,{fields:Qe(l).join(" "),limit:n,offset:u.offset,order:i,filter:B(o||{}),customFilters:c.map(d=>{var y;return Ui(d,(y=t.customFiltersData)==null?void 0:y[typeof d=="string"?d:d.name])})}).then(d=>(u.offset+=n,d))}function m(){const d="data:text/csv;charset=utf-8,"+s.join(`\r
8
- `),y=encodeURI(d),h=document.createElement("a");h.setAttribute("href",y),h.setAttribute("download",`${a}.csv`),document.body.appendChild(h),h.click()}function p(){u.rejected=!0}async function v(){return g().then(d=>{const y=d.map(h=>l.map(w=>f(Fe(w,h))).join(","));return s.push(...y),u.count=s.length,d.length}).then(d=>{if(d!==n&&(u.finished=!0),d===n&&!u.rejected)return v()})}return{downloadFile:m,reject:p,state:u,start:v}}const ot=new class{constructor(){this.store=r.reactive([])}add(t,n,o={}){const i=qi(o),a=new He(t,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(t){const n=this.store.findIndex(o=>o.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function qi(e){function t(o){return!!o&&typeof o=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const Le=class Le{constructor(t,n,o,i,a){this.type=t,this.message=n,this.timeout=o,this.children=i,this.click=a,this.id=Le.cardId++}};Le.cardId=1;let He=Le;/*!
5
+ */Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),O=require("jenesius-vue-form"),we=require("vue-router"),an=require("date-and-time"),Oe=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
+ 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 oe(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 oe("/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 oe("/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 oe("/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 re{static url(){return"close-api/billing"}static getBillingMetadata(t){return fetch(`/${re.url()}/calculator/${t}`)}static calculate(t,n){return oe(`/${re.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 oe(`/${re.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:t,returnURL:n})})}static applyOnlinePayment(t){return oe(`/${re.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(O.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 ae(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"),O.utils.getPropFromObject(t,o))}),e}function Ue(e){return t=>typeof t=="string"||typeof t=="number"?`${t} ${e}`:""}function Fe(e,t){const n=ae(e);if(typeof e.value=="string")return vn(e.value,t);let o=n?O.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=Ot(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=le(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",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:Tt,FIELD_NAME_REFERENCE_CHANGES:Cn};function Be(e){return[I.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(O.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=xe(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=se(async()=>{o.value=await te(n.baseEntity,{fields:n.filterMetadata.name.join(" "),order:[n.filterMetadata.name[1],"asc"],distinct:!0,filter:B(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(O.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 Rn(e){Ln();for(let t in e)S[t]=e[t]}const On={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(On,[["__scopeId","data-v-8a72b45f"]]),Fn=Oe(Be("setup-list-row"));function Bn(e,t){const n=e.config.map(o=>$n(o,e,t));return r.h("tr",{class:"widget-table__row widget-table-row"},n)}function $n(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(O.FormField,{type:"single-checkbox",modelValue:t.selected})),l(ut.bind(null,n,!0));break}case"select":{u.push(r.h(O.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 xn={props:{values:Object,config:Object,selected:Boolean},setup:Xe},Dn=["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,Dn)],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(xn,{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(I).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(O.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+E-N}const y=i.value,w=[...y.children].filter(P=>P.localName==="th"),E=((ue=y.offsetParent)==null?void 0:ue.scrollLeft)||0,T=w.map(P=>P.clientWidth),$=m(f.target),N=y.getBoundingClientRect().left,k=g(f),C=u(T,k),b=T.slice(0,C).reduce((P,G)=>P+G,0),_=k-b,A=y.offsetWidth,D=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",A),console.log("Start Position",k),console.log("Position From",C),console.log("Start Position",C),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",_),console.groupEnd(),a.value.innerText=w[C].textContent||"",a.value.style.display="grid",a.value.style.width=D+"px",a.value.style.cursor="grabbing",p(b),h(D),document.addEventListener("pointermove",ce,{passive:!0}),document.addEventListener("pointerup",x);function x(P){if(console.group("END"),document.removeEventListener("pointermove",ce),document.removeEventListener("pointerup",x),$&&(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)),!$){const G=P.screenX+E-N;console.log("ENP Position",G);const Ce=d(T,G);if(console.log(C,"->",Ce),Ce!==C){const fe=n.config[C],De=n.config;De.splice(C,1),De.splice(Ce,0,fe),l(De)}else{const fe=n.config[C].name;c(fe)}}a.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function ce(P){if($){const fe=g(P)-k+D;h(fe);return}let G=P.screenX+E-N-_;G<0&&(G=0),G+D>A&&(G=A-D),p(G)}})});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(I.VISIBLE_ITEM_PROVIDE_NAME,{show(l){n[l]=!0},hide(l){n[l]=!1},remove(l){delete n[l]}});const o=r.inject(I.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:{}},setup(e){const t=e,n=xe(),o=rt(),i=r.computed(()=>{var f,g,y;const h=s.value,m=u(h),v={type:m,disabled:!((f=c.value)!=null&&f.canSet),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((h=c.value)==null?void 0:h.canGet)===!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(O.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])||I.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(O.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=O.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(ae)(c)],filters:a.filters,"onUpdate:values":d=>i(r.unref(ae)(c),d)},null,8,["entity","filter-item","values","filters","onUpdate:values"])}),128))]))}}),Rr=j(Lr,[["__scopeId","data-v-89e1fa2d"]]),Or={class:"widget-fast-table-tools"},Fr=r.defineComponent({__name:"widget-fast-table-tools",props:{tools:{},loading:{type:Boolean},selectedRows:{},metadata:{}},emits:["reload"],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:()=>null},{name:"reload",label:"Reload",icon:"reload",buttonStyle:"default",callback:()=>i("reload")}],l=a.map(p=>p.name),c=r.inject(I.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",Or,[(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-b20a18f4"]]);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 $r(){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,E;Array.isArray(g[y])&&g[y].length===0&&t.settings&&!((E=(w=t.settings)==null?void 0:w.prefilters)!=null&&E[y])&&delete g[y]}),O.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=se(async function(){if(!t.entity)return;const g=await $t(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(()=>!O.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 xr={class:"es-grid es-gap-15"},Dr={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=O.Form.getParentForm(),s=r.ref([]),u=xe(n.entity),{state:d,update:p}=rt(n.entity,{masterEntities:n.masterEntities||[]}),h=r.computed(()=>{var b;return((b=C.value)==null?void 0:b.displayItem)||nt.inline}),m=r.computed(()=>{var b;return((b=C.value)==null?void 0:b.newItem)||h.value}),v=se(async()=>{try{await f.call(),await p()}catch(b){const{message:_}=Ye(b);a.value=_}});c instanceof O.Form&&c.subscribe({read:v.call.bind(null),name:n.entity,type:"table"}),r.watch(()=>n.mark,()=>{N.set(n.entity,n.mark)});const f=se(async function(){const _=n.entity;a.value=null,s.value=[];const A=(await te(_,{customFilters:N.customFilters,fields:Qe(k.value).join(" "),order:N.order,filter:B.and(B(N.prefilters),B(n.binding||{}))})).map(hi);i.value=A});async function g(b){var D;if(b===null)return l.value=null;const _=new ge(n.entity,b),A=_.hasPrimaryKey()?_.primaryKey:null;if(!A&&((D=C.value)!=null&&D.linkNew))return o.push(C.value.linkNew);if(h.value==="form")return A?o.push(tt(n.entity,A)):console.warn("Can't open form without primaryKey");if(h.value==="inline")return l.value=b||I.LIST_ACTIVE_NEW;h.value==="modal"?(await H.promptModal("form",{entity:n.entity,primaryKey:A,id:A}),await f.call()):l.value=I.LIST_ACTIVE_NEW}const{controller:y}=Ke();r.watch(()=>d.value,b=>{b&&(b.canRead?y.show():y.hide())},{immediate:!0}),r.onUnmounted(()=>y.remove());let w=[ye.on("affected-entity",b=>{b.name===n.entity&&f.call()}),ye.on("display-entity",async b=>{b.name===n.entity&&(f.promise&&await f.promise,l.value=i.value.find(_=>_.Id===b.id)||null)})];r.onUnmounted(()=>w.map(b=>b()));function E(b){function _(x){return Array.isArray(x)?_(x[0]):typeof x!="string"?null:x}const A=_(b);if(!A)return;const D=N.order;T("order",D[0]!==A?[A,"asc"]:D[1]==="desc"?[]:[A,"desc"])}function T(b,_){N.update({[b]:_}),f.call()}const $=r.computed(()=>v.wait||f.wait),N=$r(),k=N.cellConfiguration;N.set(n.entity,n.mark),r.watch(()=>N.state.settings,b=>{f.call()});const C=r.computed(()=>N.state.settings);return t({listSettings:C,array:i,config:k,activeRow:l}),(b,_)=>{const A=r.resolveComponent("widget-button"),D=r.resolveComponent("widget-fast-table-form");return r.openBlock(),r.createElementBlock("div",xr,[r.unref(N).computedLabel.value&&!b.hideLabel?(r.openBlock(),r.createElementBlock("p",Dr,r.toDisplayString(r.unref(N).computedLabel.value),1)):r.createCommentVNode("",!0),r.unref(u)?(r.openBlock(),r.createBlock(Br,{key:1,metadata:r.unref(u),tools:r.unref(N).computedTools.value,loading:$.value,"selected-rows":s.value||[],onReload:r.unref(v).call},{default:r.withCtx(()=>{var x;return[m.value==="form"||(x=r.unref(d))!=null&&x.canCreate?(r.openBlock(),r.createBlock(A,{key:0,onClick:_[0]||(_[0]=()=>g(r.unref(I).LIST_ACTIVE_NEW)),type:"primary",label:"Add New"})):r.createCommentVNode("",!0),r.unref(N).computedHasLocalConfiguration.value?(r.openBlock(),r.createBlock(A,{key:1,onClick:r.unref(N).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(Rr,{entity:b.entity,"filters-config":r.unref(N).computedFiltersConfiguration.value,filters:r.unref(N).computedPrefilter.value,"onUpdate:filters":_[1]||(_[1]=x=>T("prefilters",x))},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:E,class:"table",selectedRows:s.value,"onUpdate:selectedRows":_[3]||(_[3]=x=>s.value=x)},{"head-cell":r.withCtx(x=>{var ce,ue,P;return[(r.openBlock(),r.createBlock(r.resolveDynamicComponent(b.$slots["head-cell"]?b.$slots["head-cell"]:Nt),r.mergeProps({label:x.label},x,{onOrder:E,order:r.unref(N).configuration.value.order||[],type:x.type,"is-full-selected":((ce=s.value)==null?void 0:ce.length)===((ue=i.value)==null?void 0:ue.length)&&((P=i.value)==null?void 0:P.length)>0}),null,16,["label","order","type","is-full-selected"]))]}),default:r.withCtx(()=>[r.createVNode(D,{entity:b.entity,"primary-key":r.unref(ge).getPrimaryKey(n.entity,l.value),"master-entities":b.masterEntities||void 0,binding:b.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 Rt(e,t={},n={}){const o=r.inject(I.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=Rt(t.name,t.overrideParams||{}),o=r.computed(()=>{if(n.value)return se(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 Ot(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 se(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(I.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 te(e,t={}){const n=F();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 F().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 I.DEFAULT_ERROR_MESSAGE}})}function U(e,t={}){return q.isFront&&(t.headers||(t.headers={}),t.headers["Context-Id"]=q.contextId),t.redirect="manual",fetch(e,t).then(n=>n.type==="opaqueredirect"?void window.location.reload():n).catch(()=>{throw new Error(I.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=Oe(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 Z=Oe(Be("use-socket"));function F(){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)&&(Z("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()},I.DELAY_SOCKET_RECONNECT);function c(){return{safeQueue:a,requestId:e,handlers:o,socketInstance:t}}function s(y){const w=[...o.values()];Z("Handlers array length is %d. Response event: %s. Request id: %d",o.size,y.event,y.requestId),w.forEach(E=>{const T=y.requestId;(E.requestId&&E.requestId===T||!E.requestId&&E.event===y.event)&&(Z("Find appropriated handler: %d, event: %s",e,E.event),E.callback(y.data,y),E.once&&(o.delete(E),Z("Handler was removed by *once* params was passed. %o",E)))})}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){Z("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 E=JSON.parse(y.data);if(!Bt(E)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(E);return}(w=E==null?void 0:E.data)!=null&&w.refresh&&location.reload(),s(E)}catch(E){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(E)}}}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,E){const T=++e,$=JSON.stringify({requestId:T,event:y,data:w,contextId:q.contextId,url:S.socketURLHandler?S.socketURLHandler():window.location.href});return m()?d($):(a.add($),Z("Socket is not connected. Message was send to save-queue")),new Promise((N,k)=>{f({event:y,requestId:T,once:!0,guaranteedAnswer:!0,serializeString:$,callback:(C,b)=>{if(Z("Promise was resolve with next data:",C),eo(b))return void k(C);E&&E(C,b),N(C)},timeToLive:I.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 $t(e,t){return F().emit("list-setting:read",{entity:e,mark:t})}function to(e,t){return F().emit("metadata-field:treat",{entity:e,fieldName:t})}function xt(e,t){return F().emit("entity:create",{...t,entity:e})}function Dt(e,t){return F().emit("entity:delete",{...t,entity:e})}function no(e,t){return F().emit("usage-context:read",{...t,entity:e})}function Pt(e={}){return F().emit("tool:read",e)}function ro(){return F().emit("metadata-list:read",{})}function oo(e){return F().emit("history:read",e)}function io(e,t){return F().emit("entity:count",{...t,entity:e})}function ao(e){return`/${En}/${e}`}function le(e){return{exec(t,n){switch(e.name){case"replace-boolean":return le.replaceBoolean(t,e.values);case"replace-record-operation":return le.replaceRecordOperation(t)}}}}le.replaceBoolean=so;le.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 F().emit("tool:execute",e)}const uo=Oe(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(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:n}))return t()}function go(e,t){const n=I.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 O.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 ee={};function Q(e,...t){if(typeof e!="string")return console.trace(`Label is not provided for translation: ${e}`),"undefined";let n=O.utils.getPropFromObject((this==null?void 0:this.vocabulary)||ee,e);if(typeof n=="string")return dt(n,t);const o=O.utils.getPropFromObject(ee==null?void 0:ee.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){ee=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:O.utils.getPropFromObject(ee,t.toLowerCase())})};Q.setVocabulary=function(e){return typeof e=="string"&&(e=O.utils.getPropFromObject(ee,e)),Q.bind({vocabulary:e})};function wo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var We={exports:{}},R={},qe={exports:{}},ne={};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}ne.whiteList=Mt();ne.getDefaultWhiteList=Mt;ne.onAttr=bo;ne.onIgnoreAttr=Eo;ne.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===`
7
+ `&&c()}return de.trim(l)}var Ao=To,Te=ne,So=Ao;function pt(e){return e==null}function Io(e){var t={};for(var n in e)t[n]=e[n];return t}function jt(e){e=Io(e||{}),e.whiteList=e.whiteList||Te.whiteList,e.onAttr=e.onAttr||Te.onAttr,e.onIgnoreAttr=e.onIgnoreAttr||Te.onIgnoreAttr,e.safeAttrValue=e.safeAttrValue||Te.safeAttrValue,this.options=e}jt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onAttr,a=n.onIgnoreAttr,l=n.safeAttrValue,c=So(e,function(s,u,d,p,h){var m=o[d],v=!1;if(m===!0?v=m:typeof m=="function"?v=m(p):m instanceof RegExp&&(v=m.test(p)),v!==!0&&(v=!1),p=l(d,p),!!p){var f={position:u,sourcePosition:s,source:h,isWhite:v};if(v){var g=i(d,p,f);return pt(g)?d+":"+p:g}else{var g=a(d,p,f);if(!pt(g))return g}}});return c};var No=jt;(function(e,t){var n=ne,o=No;function i(l,c){var s=new o(c);return s.process(l)}t=e.exports=i,t.FilterCSS=o;for(var a in n)t[a]=n[a];typeof window<"u"&&(window.filterCSS=e.exports)})(qe,qe.exports);var Ze=qe.exports,et={indexOf:function(e,t){var n,o;if(Array.prototype.indexOf)return e.indexOf(t);for(n=0,o=e.length;n<o;n++)if(e[n]===t)return n;return-1},forEach:function(e,t,n){var o,i;if(Array.prototype.forEach)return e.forEach(t,n);for(o=0,i=e.length;o<i;o++)t.call(n,e[o],o,e)},trim:function(e){return String.prototype.trim?e.trim():e.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(e){var t=/\s|\n|\t/,n=t.exec(e);return n?n.index:-1}},Lo=Ze.FilterCSS,Ro=Ze.getDefaultWhiteList,Le=et;function Ut(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height","loading"],ins:["datetime"],kbd:[],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var Wt=new Lo;function Oo(e,t,n){}function Fo(e,t,n){}function Bo(e,t,n){}function $o(e,t,n){}function qt(e){return e.replace(Do,"&lt;").replace(Po,"&gt;")}function xo(e,t,n,o){if(n=Yt(n),t==="href"||t==="src"){if(n=Le.trim(n),n==="#")return"#";if(!(n.substr(0,7)==="http://"||n.substr(0,8)==="https://"||n.substr(0,7)==="mailto:"||n.substr(0,4)==="tel:"||n.substr(0,11)==="data:image/"||n.substr(0,6)==="ftp://"||n.substr(0,2)==="./"||n.substr(0,3)==="../"||n[0]==="#"||n[0]==="/"))return""}else if(t==="background"){if(Ae.lastIndex=0,Ae.test(n))return""}else if(t==="style"){if(mt.lastIndex=0,mt.test(n)||(gt.lastIndex=0,gt.test(n)&&(Ae.lastIndex=0,Ae.test(n))))return"";o!==!1&&(o=o||Wt,n=o.process(n))}return n=Jt(n),n}var Do=/</g,Po=/>/g,Vo=/"/g,Mo=/&quot;/g,jo=/&#([a-zA-Z0-9]*);?/gim,Uo=/&colon;?/gim,Wo=/&newline;?/gim,Ae=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,mt=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,gt=/u\s*r\s*l\s*\(.*/gi;function Ht(e){return e.replace(Vo,"&quot;")}function Gt(e){return e.replace(Mo,'"')}function zt(e){return e.replace(jo,function(n,o){return o[0]==="x"||o[0]==="X"?String.fromCharCode(parseInt(o.substr(1),16)):String.fromCharCode(parseInt(o,10))})}function Xt(e){return e.replace(Uo,":").replace(Wo," ")}function Kt(e){for(var t="",n=0,o=e.length;n<o;n++)t+=e.charCodeAt(n)<32?" ":e.charAt(n);return Le.trim(t)}function Yt(e){return e=Gt(e),e=zt(e),e=Xt(e),e=Kt(e),e}function Jt(e){return e=Ht(e),e=qt(e),e}function qo(){return""}function Ho(e,t){typeof t!="function"&&(t=function(){});var n=!Array.isArray(e);function o(l){return n?!0:Le.indexOf(e,l)!==-1}var i=[],a=!1;return{onIgnoreTag:function(l,c,s){if(o(l))if(s.isClosing){var u="[/removed]",d=s.position+u.length;return i.push([a!==!1?a:s.position,d]),a=!1,u}else return a||(a=s.position),"[removed]";else return t(l,c,s)},remove:function(l){var c="",s=0;return Le.forEach(i,function(u){c+=l.slice(s,u[0]),s=u[1]}),c+=l.slice(s),c}}}function Go(e){for(var t="",n=0;n<e.length;){var o=e.indexOf("<!--",n);if(o===-1){t+=e.slice(n);break}t+=e.slice(n,o);var i=e.indexOf("-->",o);if(i===-1)break;n=i+3}return t}function zo(e){var t=e.split("");return t=t.filter(function(n){var o=n.charCodeAt(0);return o===127?!1:o<=31?o===10||o===13:!0}),t.join("")}R.whiteList=Ut();R.getDefaultWhiteList=Ut;R.onTag=Oo;R.onIgnoreTag=Fo;R.onTagAttr=Bo;R.onIgnoreTagAttr=$o;R.safeAttrValue=xo;R.escapeHtml=qt;R.escapeQuote=Ht;R.unescapeQuote=Gt;R.escapeHtmlEntities=zt;R.escapeDangerHtml5Entities=Xt;R.clearNonPrintableCharacter=Kt;R.friendlyAttrValue=Yt;R.escapeAttrValue=Jt;R.onIgnoreTagStripAll=qo;R.StripTagBody=Ho;R.stripCommentTag=Go;R.stripBlankChar=zo;R.attributeWrapSign='"';R.cssFilter=Wt;R.getDefaultCSSWhiteList=Ro;var $e={},Y=et;function Xo(e){var t=Y.spaceIndex(e),n;return t===-1?n=e.slice(1,-1):n=e.slice(1,t+1),n=Y.trim(n).toLowerCase(),n.slice(0,1)==="/"&&(n=n.slice(1)),n.slice(-1)==="/"&&(n=n.slice(0,-1)),n}function Ko(e){return e.slice(0,2)==="</"}function Yo(e,t,n){var o="",i=0,a=!1,l=!1,c=0,s=e.length,u="",d="";e:for(c=0;c<s;c++){var p=e.charAt(c);if(a===!1){if(p==="<"){a=c;continue}}else if(l===!1){if(p==="<"){o+=n(e.slice(i,c)),a=c,i=c;continue}if(p===">"||c===s-1){o+=n(e.slice(i,a)),d=e.slice(a,c+1),u=Xo(d),o+=t(a,o.length,u,d,Ko(d)),i=c+1,a=!1;continue}if(p==='"'||p==="'")for(var h=1,m=e.charAt(c-h);m.trim()===""||m==="=";){if(m==="="){l=p;continue e}m=e.charAt(c-++h)}}else if(p===l){l=!1;continue}}return i<s&&(o+=n(e.substr(i))),o}var Jo=/[^a-zA-Z0-9\\_:.-]/gim;function Qo(e,t){var n=0,o=0,i=[],a=!1,l=e.length;function c(h,m){if(h=Y.trim(h),h=h.replace(Jo,"").toLowerCase(),!(h.length<1)){var v=t(h,m||"");v&&i.push(v)}}for(var s=0;s<l;s++){var u=e.charAt(s),d,p;if(a===!1&&u==="="){a=e.slice(n,s),n=s+1,o=e.charAt(n)==='"'||e.charAt(n)==="'"?n:ei(e,s+1);continue}if(a!==!1&&s===o){if(p=e.indexOf(u,s+1),p===-1)break;d=Y.trim(e.slice(o+1,p)),c(a,d),a=!1,s=p,n=s+1;continue}if(/\s|\n|\t/.test(u))if(e=e.replace(/\s|\n|\t/g," "),a===!1)if(p=Zo(e,s),p===-1){d=Y.trim(e.slice(n,s)),c(d),a=!1,n=s+1;continue}else{s=p-1;continue}else if(p=ti(e,s-1),p===-1){d=Y.trim(e.slice(n,s)),d=ht(d),c(a,d),a=!1,n=s+1;continue}else continue}return n<e.length&&(a===!1?c(e.slice(n)):c(a,ht(Y.trim(e.slice(n))))),Y.trim(i.join(" "))}function Zo(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="="?t:-1}}function ei(e,t){for(;t<e.length;t++){var n=e[t];if(n!==" ")return n==="'"||n==='"'?t:-1}}function ti(e,t){for(;t>0;t--){var n=e[t];if(n!==" ")return n==="="?t:-1}}function ni(e){return e[0]==='"'&&e[e.length-1]==='"'||e[0]==="'"&&e[e.length-1]==="'"}function ht(e){return ni(e)?e.substr(1,e.length-2):e}$e.parseTag=Yo;$e.parseAttr=Qo;var ri=Ze.FilterCSS,W=R,Qt=$e,oi=Qt.parseTag,ii=Qt.parseAttr,Ie=et;function Se(e){return e==null}function ai(e){var t=Ie.spaceIndex(e);if(t===-1)return{html:"",closing:e[e.length-2]==="/"};e=Ie.trim(e.slice(t+1,-1));var n=e[e.length-1]==="/";return n&&(e=Ie.trim(e.slice(0,-1))),{html:e,closing:n}}function si(e){var t={};for(var n in e)t[n]=e[n];return t}function li(e){var t={};for(var n in e)Array.isArray(e[n])?t[n.toLowerCase()]=e[n].map(function(o){return o.toLowerCase()}):t[n.toLowerCase()]=e[n];return t}function Zt(e){e=si(e||{}),e.stripIgnoreTag&&(e.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),e.onIgnoreTag=W.onIgnoreTagStripAll),e.whiteList||e.allowList?e.whiteList=li(e.whiteList||e.allowList):e.whiteList=W.whiteList,this.attributeWrapSign=e.singleQuotedAttributeValue===!0?"'":W.attributeWrapSign,e.onTag=e.onTag||W.onTag,e.onTagAttr=e.onTagAttr||W.onTagAttr,e.onIgnoreTag=e.onIgnoreTag||W.onIgnoreTag,e.onIgnoreTagAttr=e.onIgnoreTagAttr||W.onIgnoreTagAttr,e.safeAttrValue=e.safeAttrValue||W.safeAttrValue,e.escapeHtml=e.escapeHtml||W.escapeHtml,this.options=e,e.css===!1?this.cssFilter=!1:(e.css=e.css||{},this.cssFilter=new ri(e.css))}Zt.prototype.process=function(e){if(e=e||"",e=e.toString(),!e)return"";var t=this,n=t.options,o=n.whiteList,i=n.onTag,a=n.onIgnoreTag,l=n.onTagAttr,c=n.onIgnoreTagAttr,s=n.safeAttrValue,u=n.escapeHtml,d=t.attributeWrapSign,p=t.cssFilter;n.stripBlankChar&&(e=W.stripBlankChar(e)),n.allowCommentTag||(e=W.stripCommentTag(e));var h=!1;n.stripIgnoreTagBody&&(h=W.StripTagBody(n.stripIgnoreTagBody,a),a=h.onIgnoreTag);var m=oi(e,function(v,f,g,y,w){var E={sourcePosition:v,position:f,isClosing:w,isWhite:Object.prototype.hasOwnProperty.call(o,g)},T=i(g,y,E);if(!Se(T))return T;if(E.isWhite){if(E.isClosing)return"</"+g+">";var $=ai(y),N=o[g],k=ii($.html,function(C,b){var _=Ie.indexOf(N,C)!==-1,A=l(g,C,b,_);return Se(A)?_?(b=s(g,C,b,p),b?C+"="+d+b+d:C):(A=c(g,C,b,_),Se(A)?void 0:A):A});return y="<"+g,k&&(y+=" "+k),$.closing&&(y+=" /"),y+=">",y}else return T=a(g,y,E),Se(T)?u(y):T},u);return h&&(m=h.remove(m)),m};var ci=Zt;(function(e,t){var n=R,o=$e,i=ci;function a(c,s){var u=new i(s);return u.process(c)}t=e.exports=a,t.filterXSS=a,t.FilterXSS=i,function(){for(var c in n)t[c]=n[c];for(var s in o)t[s]=o[s]}(),typeof window<"u"&&(window.filterXSS=e.exports);function l(){return typeof self<"u"&&typeof DedicatedWorkerGlobalScope<"u"&&self instanceof DedicatedWorkerGlobalScope}l()&&(self.filterXSS=e.exports)})(We,We.exports);var ui=We.exports;const fi=wo(ui);function di(e){return e=e.replace(/\*\*([^*]+)\*\*/g,"<b>$1</b>"),e=e.replace(/\[icon:([^\]]+)]/g,"<widget-icon>$1</widget-icon>"),e=e.replace(/\[(.*)]\((.*)\)/g,'<router-link to = "$2">$1</router-link>'),fi(e)}function pi(e,t,n,o){let i=e+t/60+n/3600;return(o=="S"||o=="W")&&(i=i*-1),i}function mi(e,t){const n={dir:e<0?t==="long"?"W":"S":t==="long"?"E":"N",deg:0|(e<0?e=-e:e),min:0|(e+=1e-9)%1*60,sec:(0|e*60%1*6e3)/100};return`${n.deg}° ${n.min}' ${n.sec}" ${n.dir}`}function tt(e,t){return`/forms/${e}/${t}`}function en(e,t,n){const o=Q.getScope(e.toLowerCase());return t.map(i=>(typeof i.label=="string"&&(i.label=o(i.label)),i.type==="history"&&(i.onClick=a=>H.openModal("modal-history",{id:a.Id,entity:e}),i.icon="history",i.class="widget-list-cell-history",i.hint="Open the History"),(i.entity||i.useObjectTypeName)&&Array.isArray(i.name)&&i.name.length>1&&(i.modal===!0?(i.onClick=a=>{H.openModal("form",{entity:yt(i,a),id:a[ae(i)]})},i.class="widget-table-cell_link cursor_pointer"):i.link=a=>{if(typeof a!="object"||a==null)return null;const l=i.name[0],c=a[l];return c?tt(yt(i,a),c):null},i.value=(a,l)=>l[i.name[1]]),gi(i,i.type,i.presentation),S.listConvertCellConfigHandler&&S.listConvertCellConfigHandler(e,i),i))}function gi(e,t,n){switch(t){case"Decimal":{n==="Money"&&(e.type="money");break}}return e}const yt=(e,t)=>e.useObjectTypeName?t[e.name[2]]:e.entity?e.entity:null;function vt(e){return typeof e!="object"||e===null?null:e[I.TABLE_MOCK_FIELD]}function hi(e,t){return typeof e!="object"||e===null?(console.warn("cell data is not a valid object."),e):(typeof t=="string"||typeof t=="number"||typeof t=="function"?(typeof t=="function"&&(t=t(e)),e[I.TABLE_MOCK_FIELD]=t):e[I.TABLE_MOCK_FIELD]=e.Id,e)}function yi(e){if(!Array.isArray(S.arrayListCellHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");S.arrayListCellHandlers.push(e)}function vi(e,t){const n=ae(e);return n?O.utils.getPropFromObject(t,n):null}function wi(e){if(!Array.isArray(S.arrayFieldParamsHandlers))throw new Error("Configuration has mistake: arrayListCellHandlers is not an array");S.arrayFieldParamsHandlers.push(e)}const bi={addListCellHandler:yi,getCellModelValue:vi,addFieldParamsHandler:wi};var nt=(e=>(e.form="form",e.inline="inline",e.modal="modal",e))(nt||{});function Ei(){const e=r.ref(null);function t(n){e.value=n}return{activeRow:e,activateRow:t}}function Ci(e,t){return typeof e!="object"||e===null?!1:Object.values(e).join().toLowerCase().includes(t)}async function tn(e,t){e()&&(await t(),await tn(e,t))}function ki(e,t,n={}){let o=!1;const i=r.ref(""),a=r.computed(()=>l.filter(k=>u(k,i.value))),l=r.reactive([]);let c=0;const s=r.ref(!1);let u=(n==null?void 0:n.filterSearchFn)||((k,C)=>Ci(k,C));function d(){return n.masterEntities?typeof n.masterEntities=="function"?n.masterEntities():n.masterEntities:[]}function p(){const k=T();return typeof k.limit!="number"&&(k.limit=100),k.offset=c,(n.request||te)(e,k).then(b=>(c+=b.length,b))}function h(k,C){var _;return typeof k.Version=="number"?k.Version:(_=l.find(A=>A.Id===C))==null?void 0:_.Version}function m(k,C){const b=l.findIndex(_=>_.Id===k);if(b===-1)throw new Error(`Can't found item with Id ${k}`);l.splice(b,1,C)}function v(k){const C=l.findIndex(b=>b.Id===k);if(C===-1)throw new Error(`Can't found item with Id ${k}`);l.splice(C,1)}async function f(k,C){try{const b=T(),_=h(C,k);delete C.Version,await Je(e,{id:k,values:C,version:_,masterEntities:d()});const A=await te(e,{fields:b.fields||"",id:k});m(k,A)}catch(b){M()(b)}}async function g(k,C={}){try{const b=T(),_=h(C,k);delete C.Version,await Dt(e,{id:k,version:_,masterEntities:d()}),v(k)}catch(b){M()(b)}}async function y(k){try{await xt(e,{values:k,masterEntities:d()}),await $()}catch(C){M()(C)}}let w;async function E(){s.value=!0;try{w!=null&&w.signal&&!w.signal.aborted&&w.abort();let k=w=new AbortController,C=0;const _=T().limit||0;if(i.value&&!_){console.warn("Using textSearch assumes the use of limit.");return}await tn(()=>(_>0?C<_:!0)&&!o&&!k.signal.aborted,async()=>{const A=await p();k.signal.aborted||(l.push(...A),C+=A.filter(D=>u(D,i.value)).length,(A.length<_||_===0)&&(o=!0))})}catch(k){M()(k)}s.value=!1}function T(){return typeof t=="function"?t():t}async function $(){try{c=0,o=!1,l.splice(0,l.length),await E()}catch(k){M()(k)}}function N(){if(w)return w.abort();s.value=!1}return{array:l,updateById:f,next:E,reload:$,wait:s,create:y,deleteById:g,textSearch:i,filteredArray:a,abort:N}}function _i(){function e(){return{organizations:q.organizations,currentContextId:q.contextId,person:q.person,context:q.context,contextType:q.contextType,userId:q.userId}}const t=r.reactive(e());return q.onupdateContext(()=>{Object.assign(t,e())}),t}function Ti(e,t,n){return F().emit("communication:create",{entityName:e,entityCatalogId:t,targetCode:n})}function Ai(e,t,n){return F().emit("communication:read",{entityName:e,entityCatalogId:t,targetCode:n})}function Si(e,t){return F().emit("communication-message:create",{communicationId:e,text:t})}function Ii(e){return F().emit("communication-message:read",{communicationId:e})}function Ni(e){const t=O.Form.getParentForm(),n=r.reactive([]);return t&&t.subscribe(e),e.read=()=>Ii(e.id).then(o=>(n.splice(0,n.length,...o),o)),{array:n}}function Li(e,t){e.read=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw J.EntityWithoutName(e);return te(e.name,o)}).then(at).then(i=>(i.hasOwnProperty("Version")&&(e.version=i.Version),e.setValues(i),i)).catch(M())},e.save=()=>{const o=n();return Promise.resolve().then(()=>{if(!e.name)throw J.EntityWithoutName(e);return Je(e.name,{id:o.id,values:e.changes,version:e.version})}).then(i=>{e.version=i.version}).catch(i=>{throw M()(i),i})};function n(){return typeof t=="function"?t():t}}function xe(e){if(!e)return r.inject(I.PROVIDE_NAME_METADATA);he.initEntity(e);const t=r.computed(()=>he.state[e]);return r.provide(I.PROVIDE_NAME_METADATA,t),t}function rt(e,t={}){if(!e)return r.inject(I.PROVIDE_NAME_USAGE_CONTEXT);const n=r.ref(null);return r.provide(I.PROVIDE_NAME_USAGE_CONTEXT,n),{state:n,update:async function(){n.value=await no(e,Ri(t||{}))}}}function Ri(e){return typeof e=="function"?e():e}function Oi(e){if(!e)return r.inject(I.PROVIDE_NAME_ACTIONS);const t=r.ref(!1),n=r.reactive([]),o=r.computed(()=>n.map(l=>Vt(e,l))),i={actions:o,update:a};r.provide(I.PROVIDE_NAME_ACTIONS,i),e.router=we.useRouter();function a(){if(t.value)return;t.value=!0,n.splice(0,n.length);const l=e==null?void 0:e.form;return Pt({masterEntities:e==null?void 0:e.masterEntities,id:l==null?void 0:l.id,entity:l==null?void 0:l.name}).then(c=>n.splice(0,0,...c)).catch(M("error")).finally(()=>t.value=!1)}return{actions:o,update:a,loading:r.readonly(t)}}function Fi(e){function t(n){n.key==="Enter"&&e()}r.onMounted(()=>{document.addEventListener("keypress",t)}),r.onUnmounted(()=>{document.removeEventListener("keypress",t)})}function Bi(e,t={}){const n=r.reactive([]),o=s=>{const u=r.unref(e);if(s===void 0){n.length===0?u.forEach(a):u.forEach(l);return}i(s)?l(s):a(s)},i=s=>n.includes(s),a=s=>{t.handleSelect&&!t.handleSelect(s)||i(s)||n.push(s)},l=s=>{const u=n.findIndex(d=>d===s);u!==-1&&n.splice(u,1)},c=r.computed(()=>{const s=r.unref(e);return n.length===s.length&&s.length!==0});return[n,o,c,a,l]}function $i(e){const t=r.ref(""),n=r.computed(()=>{const o=t.value.toLowerCase();return r.unref(e).filter(i=>t.value.length?Object.values(i).join().toLowerCase().includes(o):!0)});return{search:t,searchArray:n}}class je{static async getStartConfig(t,n){return F().emit("wizard:configuration",{process:t,entity:n})}static async startProcess(t,n){return F().emit("wizard:start",{process:t,entity:n})}static async runStep(t,n,o,i,a){return F().emit("wizard:step",{process:t,entity:n,stepName:o,token:i,values:a})}}function xi(e){return e.statusName===V.Completed}function Di(e){return[V.FinalStepWithConfirmation,V.NextStepWithConfirmation].includes(e.statusName)}function Pi(e){return e.statusName===V.ValidationError}function Vi(e){return e.statusName===V.Undefined}function Mi(e,t,n){let o=null,i=[];const a=r.ref(!1),l=r.ref(null),c=r.computed(()=>p(i,l.value)),s=r.ref(null),u=r.reactive([]),d=r.computed(()=>u.map(w=>p(i,w)));function p(w,E){return w.find(T=>T.name===E)||null}async function h(w){var E;if(Vi(w)){await n.onDisplayDataSet(w);return}if(!(Di(w)&&!await n.onDisplayDataSet(w))){if(Pi(w))return void n.onValidation(w.validationResults);f(w),await r.nextTick();{const T=((E=p(i,l.value))==null?void 0:E.fields)||[];if([V.FinalStep,V.NextStep,V.FinalStepWithConfirmation,V.NextStepWithConfirmation].includes(w.statusName)&&(!T.length||ji(T,n.presets)))return y(n.presets||{})}xi(w)&&n.onCompleted(w)}}async function m(){try{await v(),await g()}catch(w){M("error")(w)}}function v(){return a.value="Loading process information.",je.getStartConfig(t,e).then(w=>(s.value={label:w.processTitle,info:w.processInfo,icon:w.processIcon},i=w.steps.map(E=>{const T=E.frontendEntity.rootObject,$=Object.fromEntries(E.frontendEntity.objectTypes.map(N=>[N.name,N.properties]));return{label:E.title,name:E.stepName,number:E.number,rootObjectName:T,objectTypes:$,fields:$[T],buttonCaption:E.buttonCaption}}))).finally(()=>{a.value=!1})}function f(w){return[V.FinalStepWithConfirmation,V.NextStepWithConfirmation,V.NextStep,V.Completed,V.FinalStep].includes(w.statusName)?(o=w.token,l.value=w.nextStepName):console.log("Saving is not completed:",w),w}function g(){return a.value="Starting process",je.startProcess(t,e).then(h).catch(M("error")).finally(()=>{a.value=null})}function y(w={}){const E=l.value;return!o||!E?Promise.reject("Not step or token."):(a.value="Waiting for result...",je.runStep(t,e,E,o,w).then(h).then(T=>(u[u.length-1]!==E&&u.push(E),T)).catch(M("error")).finally(()=>{a.value=!1}))}return{initialize:m,loading:a,currentStepConfig:c,currentStepName:l,arrayPassedSteps:d,arrayProcessStepName:u,processInfo:s,next:y}}function ji(e,t){for(let n=0;n<e.length;n++){const o=e[n];if(!O.utils.getPropFromObject(t,o.name))return!1}return!0}function Ui(e,t){const n=typeof e=="string"?e:e.name,o=Object.assign({},typeof e=="string"?{}:e.arguments,t||{});return{name:n,arguments:o}}function Wi(e){return e.limit||(e.limit=150),e}function nn(e,t={}){const{limit:n}=Wi(t),{prefilters:o,order:i}=e;if(!e.entity)throw new Error("-");if(!e.config)throw new Error("-");const a=e.entity,l=e.config,c=e.customFilters||[],s=[l.map(f=>d(f.label)).join(",")],u=r.reactive({count:0,rejected:!1,finished:!1,offset:0});function d(f){f===null&&(f=""),f===void 0&&(f="-");let g=typeof f!="string"?String(f):f;return g=g.replace(/"/g,'""'),g.search(/("|,|\n)/g)>=0&&(g='"'+g+'"'),g}function p(){return te(a,{fields:Qe(l).join(" "),limit:n,offset:u.offset,order:i,filter:B(o||{}),customFilters:c.map(f=>{var g;return Ui(f,(g=t.customFiltersData)==null?void 0:g[typeof f=="string"?f:f.name])})}).then(f=>(u.offset+=n,f))}function h(){const f="data:text/csv;charset=utf-8,"+s.join(`\r
8
+ `),g=encodeURI(f),y=document.createElement("a");y.setAttribute("href",g),y.setAttribute("download",`${a}.csv`),document.body.appendChild(y),y.click()}function m(){u.rejected=!0}async function v(){return p().then(f=>{const g=f.map(y=>l.map(w=>d(Fe(w,y))).join(","));return s.push(...g),u.count=s.length,f.length}).then(f=>{if(f!==n&&(u.finished=!0),f===n&&!u.rejected)return v()})}return{downloadFile:h,reject:m,state:u,start:v}}const ot=new class{constructor(){this.store=r.reactive([])}add(t,n,o={}){const i=qi(o),a=new He(t,n,i.timeout,i.children,i.click);return this.store.push(a),i.timeout&&setTimeout(this.remove.bind(this,a.id),i.timeout*1e3),a}remove(t){const n=this.store.findIndex(o=>o.id===t);if(n===-1)return!1;this.store.splice(n,1)}};function qi(e){function t(o){return!!o&&typeof o=="object"}const n={timeout:10,click:()=>null,children:[]};return t(e)?{timeout:e.timeout||n.timeout,click:e.click||n.click,children:e.children||n.children}:n}const Re=class Re{constructor(t,n,o,i,a){this.type=t,this.message=n,this.timeout=o,this.children=i,this.click=a,this.id=Re.cardId++}};Re.cardId=1;let He=Re;/*!
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 F().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,ie;const X=class X extends K{constructor(){super(...arguments);Ve(this,ve);Ve(this,ie);this.isConstContext=!1,this.type="front",this.organizations=[],Ce(this,ie,!1)}set language(n){localStorage.setItem(I.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(I.LOCALSTORAGE_LANGUAGE_KEY)||X.DEFAULT_LANGUAGE}get contextId(){return Pe(this,ve)}set contextId(n){if(this.isConstContext)throw it.ConstContextCannotBeChanged();Ce(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){Ce(this,ie,n),this.emit(X.EVENT_READY_UPDATE,n)}get ready(){return Pe(this,ie)}onReady(n){return this.on(X.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(X.EVENT_CONTEXT_UPDATE,n)}setCurrentContext(n){if(this.contextId===n)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(n),localStorage.setItem(I.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((o=this.customer)!=null&&o.constContextId)return this.isConstContext=!0,this.setCurrentContext(this.customer.constContextId);const n=Number.parseInt(localStorage.getItem(I.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,ie=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 F().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 U(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 U(`${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 U(`${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 U(`${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 U(`${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 U(`${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 U(`${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 U(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Yi{static getConfiguration(){return U("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await U(`/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 U(`/open-api/internationalization/language/${t}`)}}class Qi{static async upload(t,n){const o=new FormData;return o.append("file",t),U(`/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 B(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(B.is(n,o)),t)},[]).join(" and ")}function be(e){return typeof e=="string"?`'${e}'`:`${e}`}B.includes=function(t,n){return`@${t} Contains ${be(n)}`};B.beginWith=function(t,n){return`@${t} BeginWith ${be(n)}`};B.notEq=function(t,n){return`@${t} nq ${be(n)}`};B.eq=function(t,n){return Array.isArray(n)?B.in(t,n):`@${t} eq ${be(n)}`};B.in=function(t,n){const o=n.map(be).join(", ");return`@${t} in (${o})`};B.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":B.and(...n.map(o=>B.notEq(t,o)))};B.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(B.wrap).join(" and ")};B.wrap=function(t){return`(${t})`};B.is=function(t,n){return`@${t} is ${n}`};B.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 q=new Ge,ye=new Xi;exports.ApplicationStatus=on;exports.Communication=Hi;exports.CoreError=J;exports.DisplayListRow=nt;exports.EventBus=ye;exports.Filter=B;exports.Manager=q;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=we;exports.WidgetTable=St;exports.WidgetTablePanelFilterItem=Lt;exports.asyncProcess=se;exports.authService=z;exports.billingService=re;exports.catchUniversal=M;exports.config=Rn;exports.configuration=S;exports.constants=I;exports.convertDDToDMS=mi;exports.convertDMSToDD=pi;exports.convertListConfig=en;exports.coreUtils=bi;exports.debounce=Xr;exports.documentsService=fn;exports.fileService=Qi;exports.formatter=le;exports.getCellName=ae;exports.getCellValue=Fe;exports.getEntityLink=tt;exports.getNamesFromListConfig=Qe;exports.getUnitValue=Ue;exports.groupArrayByField=Hr;exports.historyService=Ki;exports.injectAction=Rt;exports.internationalizationService=Ji;exports.invitationService=un;exports.openService=Yi;exports.parseError=Ye;exports.parseTextByMarkdown=di;exports.prettyDate=Ie;exports.prettyDateWithTime=Ot;exports.prettyMoney=Ft;exports.prettyValueFieldByEntity=Jr;exports.request=U;exports.setupListRow=Xe;exports.staticLink=ao;exports.t=Q;exports.throttle=Kr;exports.universalEntityCount=io;exports.universalEntityCreate=xt;exports.universalEntityDelete=Dt;exports.universalEntityRead=te;exports.universalEntityUpdate=Je;exports.universalHistoryRead=oo;exports.universalListSettingRead=$t;exports.universalMetadataFieldTreat=to;exports.universalMetadataListRead=ro;exports.universalToolRead=Pt;exports.useActions=Oi;exports.useCommunication=Ni;exports.useEnter=Fi;exports.useFormEntity=Li;exports.useListActiveRow=Ei;exports.useListDownload=nn;exports.useListEntity=ki;exports.useListSearch=$i;exports.useListSelect=Bi;exports.useLocalStorage=At;exports.useManagerState=_i;exports.useMetadata=xe;exports.useSocket=F;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 F().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,ie;const X=class X extends K{constructor(){super(...arguments);Ve(this,ve);Ve(this,ie);this.isConstContext=!1,this.type="front",this.organizations=[],ke(this,ie,!1)}set language(n){localStorage.setItem(I.LOCALSTORAGE_LANGUAGE_KEY,n)}get language(){return localStorage.getItem(I.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,ie,n),this.emit(X.EVENT_READY_UPDATE,n)}get ready(){return Pe(this,ie)}onReady(n){return this.on(X.EVENT_READY_UPDATE,n)}onupdateContext(n){return this.on(X.EVENT_CONTEXT_UPDATE,n)}setCurrentContext(n){if(this.contextId===n)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(n),localStorage.setItem(I.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((o=this.customer)!=null&&o.constContextId)return this.isConstContext=!0,this.setCurrentContext(this.customer.constContextId);const n=Number.parseInt(localStorage.getItem(I.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,ie=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 F().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 U(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 U(`${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 U(`${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 U(`${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 U(`${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 U(`${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 U(`${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 U(`/close-api/audits/history/${t}/${n}`,{method:"GET",headers:{"Content-Type":"application/json"}})}}class Yi{static getConfiguration(){return U("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}static async getList(t){return await U(`/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 U(`/open-api/internationalization/language/${t}`)}}class Qi{static async upload(t,n){const o=new FormData;return o.append("file",t),U(`/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 B(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(B.is(n,o)),t)},[]).join(" and ")}function Ee(e){return typeof e=="string"?`'${e}'`:`${e}`}B.includes=function(t,n){return`@${t} Contains ${Ee(n)}`};B.beginWith=function(t,n){return`@${t} BeginWith ${Ee(n)}`};B.notEq=function(t,n){return`@${t} nq ${Ee(n)}`};B.eq=function(t,n){return Array.isArray(n)?B.in(t,n):`@${t} eq ${Ee(n)}`};B.in=function(t,n){const o=n.map(Ee).join(", ");return`@${t} in (${o})`};B.notIn=function(t,n){return!Array.isArray(n)||n.length===0?"":B.and(...n.map(o=>B.notEq(t,o)))};B.and=function(...t){return t.filter(n=>typeof n!="string"||n.trim().length===0?!1:n).map(B.wrap).join(" and ")};B.wrap=function(t){return`(${t})`};B.is=function(t,n){return`@${t} is ${n}`};B.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 q=new Ge,ye=new Xi;exports.ApplicationStatus=on;exports.Communication=Hi;exports.CoreError=J;exports.DisplayListRow=nt;exports.EventBus=ye;exports.Filter=B;exports.Manager=q;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=se;exports.authService=z;exports.billingService=re;exports.catchUniversal=M;exports.config=Rn;exports.configuration=S;exports.constants=I;exports.convertDDToDMS=mi;exports.convertDMSToDD=pi;exports.convertListConfig=en;exports.coreUtils=bi;exports.debounce=Xr;exports.documentsService=fn;exports.fileService=Qi;exports.formatter=le;exports.getCellName=ae;exports.getCellValue=Fe;exports.getEntityLink=tt;exports.getNamesFromListConfig=Qe;exports.getUnitValue=Ue;exports.groupArrayByField=Hr;exports.historyService=Ki;exports.injectAction=Rt;exports.internationalizationService=Ji;exports.invitationService=un;exports.openService=Yi;exports.parseError=Ye;exports.parseTextByMarkdown=di;exports.prettyDate=Ne;exports.prettyDateWithTime=Ot;exports.prettyMoney=Ft;exports.prettyValueFieldByEntity=Jr;exports.request=U;exports.setupListRow=Xe;exports.staticLink=ao;exports.t=Q;exports.throttle=Kr;exports.universalEntityCount=io;exports.universalEntityCreate=xt;exports.universalEntityDelete=Dt;exports.universalEntityRead=te;exports.universalEntityUpdate=Je;exports.universalHistoryRead=oo;exports.universalListSettingRead=$t;exports.universalMetadataFieldTreat=to;exports.universalMetadataListRead=ro;exports.universalToolRead=Pt;exports.useActions=Oi;exports.useCommunication=Ni;exports.useEnter=Fi;exports.useFormEntity=Li;exports.useListActiveRow=Ei;exports.useListDownload=nn;exports.useListEntity=ki;exports.useListSearch=$i;exports.useListSelect=Bi;exports.useLocalStorage=At;exports.useManagerState=_i;exports.useMetadata=xe;exports.useSocket=F;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