eservices-core 1.3.37 → 1.3.38

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,11 +1,11 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{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-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{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-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]: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}.head-cell[data-v-4e1d87c8]{padding:0 15px 0 10px;display:flex}.head-cell[data-v-4e1d87c8]:hover{box-shadow:0 -1px #e7f2ff}.list-head-cell-label[data-v-4e1d87c8]{padding:5px 0;white-space:nowrap;cursor:pointer}.head-cell-order[data-v-4e1d87c8]{position:absolute;inset-inline-end:4px;inset-block:0 0;margin:auto;font-size:14px;height:14px}.head-cell-order_down[data-v-4e1d87c8]{transform:rotate(180deg)}.head-cell-resize[data-v-4e1d87c8]{padding:3px 10px;cursor:col-resize;transition:background-color .1s}.head-cell-resize[data-v-4e1d87c8]:hover{background-color:#f5f5f5}.head-cell-resize[data-v-4e1d87c8]: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}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode('*{--extra-fast:.1s;--fast:.2s;--medium:.3s;box-sizing:border-box;--primary: #3949ab }html,body,#app{height:100%}body{margin:0}ul{text-align:left}.flex{display:flex}.flex_column{display:flex;flex-direction:column}.flex_center{display:flex;align-items:center;justify-content:center}.flex_full,.flex_grow{flex-grow:1}.flex-align_center{align-items:center}.grid{display:grid}.grid-center{display:grid;place-content:center}.link{text-decoration:var(--link-decoration);color:var(--link-color)}.link_hover-underline:hover,.link_hover_underline:hover{text-decoration:underline}.link_full{position:absolute;height:100%;width:100%;left:0;top:0}.text_sm{font-weight:400;font-size:12px;line-height:16px}.text_md{font-size:14px;line-height:20px}.text_lg{font-size:16px;line-height:24px}.text_size_xxl{font-size:18px;line-height:25px}.text_bold{font-weight:600}.text_nowrap{white-space:nowrap}.text_right{text-align:right}.text_center{text-align:center}.text_size_sm{font-size:12px;line-height:130%}.text_size_md{font-size:14px;line-height:140%}.text_error{color:red}.text_overflow{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.title_sm{font-weight:600;font-size:16px;line-height:24px}.title_md{font-weight:600;font-size:24px;line-height:32px}.title_lg{font-weight:700;font-size:32px;line-height:48px}.title_xxl,.title_xl{font-weight:700;font-size:48px;line-height:64px}.cursor_pointer{cursor:pointer}.cursor_default{cursor:default}button{outline:none;-webkit-user-select:none;user-select:none;transition:background-color .2s}.button{display:flex;align-items:center;justify-content:center;outline:none}.button_main{background-color:var(--button-background);color:var(--button-color)}.button_main:focus{background-color:var(--button-background-active)}.button_main:active{background-color:var(--button-background-active)}.button_white{background-color:var(--white);color:var(--main)}.button_sm{height:30px;width:130px}.button_shadow{box-shadow:0 2px 4px #00000040}.button_lg{font-weight:600;font-size:16px;line-height:24px;padding:12px 0;height:50px;width:200px}.button_disabled{background-color:var(--gray-1)}.button_resolve{background-color:var(--main);color:var(--white);border-radius:2px}.button_reject{border:1px solid var(--color-dark);border-radius:2px}.button_md{height:30px;padding:0 10px;min-width:80px}.button_disabled{background-color:var(--button-disabled-background-color);cursor:pointer!important}.color_main,.color__text_main{color:var(--main)}.color__text_black{color:var(--black-1)}.color__text_gray{color:var(--text-gray)}.color__text_red,.color_red{color:var(--red)}.color__text_white{color:var(--white)}.background_orange{background-color:var(--orange)}.background_red{background-color:var(--red)}.color_dark{color:var(--dark)}.color_light{color:var(--light)}.move-vertical-enter-active,.move-vertical-leave-active{transition:transform .5s ease}.move-vertical-enter-from,.move-vertical-leave-to{transform:translateY(-10px)}.move-horizontal-enter-active,.move-horizontal-leave-active{transition:transform .5s}.move-horizontal-enter-from,.move-horizontal-leave-to{transform:translate(-40px)}.modal-vertical-enter-active,.modal-vertical-leave-active,.modal-default{transition:transform var(--medium)}.modal-vertical-enter-active .modal-default,.modal-vertical-leave-active .modal-default{transform:translateY(-100px)}.move-vertical-fast-enter-active,.move-vertical-fast-leave-active{transition:transform var(--fast) ease}.move-vertical-fast-enter-from,.move-vertical-fast-leave-to{transform:translateY(-20px)}.slide-up-enter-active,.slide-up-leave-active{transition:transform var(--fast) ease,opacity var(--fast)}.slide-up-enter-from,.slide-up-leave-to{transform:translateY(20px);opacity:0}.opacity-enter-active,.opacity-leave-active{transition:opacity var(--fast) ease}.opacity-enter-from,.opacity-leave-to{opacity:0}.list-move,.list-enter-active,.list-leave-active{transition:all .5s ease}.list-enter-from,.list-leave-to{opacity:0;transform:translate(30px)}.list-leave-active{position:absolute}.modal-default{background-color:var(--white);position:relative;z-index:1;width:auto;background:var(--white);border-radius:var(--border-radius)}.modal-default__head{background-color:var(--black-1);text-align:center;padding:5px 0;border-radius:6px 6px 0 0}.modal-default__body{gap:20px;padding:0 15px}.modal-default__foot{padding:30px 0;display:flex;justify-content:center}.hint-tooltip{display:block;z-index:222;margin:auto;pointer-events:none;box-shadow:0 0 0 9999px #00000080}.tooltip-help-circle-in,.tooltip-help-circle-out{border-radius:50%}.tooltip-help-undefined{border-radius:50px}.tooltip-card{position:fixed;z-index:315;display:flex;flex-direction:column;width:480px;height:fit-content;margin:auto;border-radius:10px;background-color:var(--hint-background);cursor:default}.tooltip-card__foot{display:flex;justify-content:space-between;align-items:center;background-color:var(--hint-background-navigation);border-radius:10px;padding:20px}.tooltip-card__foot-current{font-weight:600;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body{position:relative;display:flex;flex-direction:column;gap:8px;padding:20px 20px 10px}.tooltip-card__body-title{font-weight:700;font-size:20px;line-height:24px;color:var(--white)}.tooltip-card__body-text{font-size:16px;line-height:24px;color:var(--white)}.tooltip-card__foot-button_back{background-color:var(--main-1)}.tooltip-card__foot-button_next{background-color:var(--hint)}.tooltip-card__body-close{position:absolute;right:22px;top:12px;width:20px;height:16px;opacity:.3;cursor:pointer}.tooltip-card__body-close:hover{opacity:1}.tooltip-card__body-close:before,.tooltip-card__body-close:after{position:absolute;left:15px;content:" ";height:21px;width:2px;background-color:#fff}.tooltip-card__body-close:before{transform:rotate(45deg)}.tooltip-card__body-close:after{transform:rotate(-45deg)}.tooltip-card-container-wrap{pointer-events:none;position:absolute;left:0;top:0;z-index:123132;height:100%;width:100%}.tooltip-card-container-wrap>div{height:100%;width:100%;display:flex;justify-content:center;align-items:center}.tester-box-tooltip{pointer-events:all}.position_relative{position:relative}.position_absolute{position:absolute}.gap_5{gap:5px}.gap_10{gap:10px}.gap_15{gap:15px}.gap_20{gap:20px}.margin-0,.margin_0{margin:0}.widget-input{background-color:var(--input-background);border:var(--input-border);border-radius:var(--input-border-radius);color:var(--input-color)}.widget-input:disabled{background-color:var(--input-background-disabled);border:var(--input-border-disabled)}.widget-input[error=true]{border:var(--input-border-error)}.widget-input::placeholder{color:var(--input-placeholder-color)}.widget-input:disabled::placeholder{color:var(--input-placeholder-color-disabled)}.input_error{border:1px solid red!important}.input_size_md{height:var(--input-height)}.input-title{font-size:12px;line-height:16px;color:#667085;margin:4px 0}.widget-table{border-collapse:collapse}.widget-table_mini p{margin:0}.list-cell-link>a{position:absolute;left:0;top:0;z-index:1;height:100%;width:100%;cursor:pointer}.list-cell-link>p{font-weight:500}.widget-table__cell{padding:0 20px;font-weight:400;font-size:14px;line-height:19px;color:#4f4f4f}.widget-table-cell_use{cursor:pointer}.widget-table-cell_select{width:min-content}.table-cell-toggle{--border-color: black;position:relative;display:grid;place-content:center;border:1px solid var(--border-color);height:15px;aspect-ratio:1 / 1;border-radius:50%}.table-cell-toggle_active:after{content:"";border-radius:50%;background-color:var(--border-color);height:9px;aspect-ratio:1/1}.widget-table-cell_number{text-align:right}.overflow_auto{overflow:auto}.overflow_hidden{overflow:hidden}.padding_5{padding:5px}.padding_10{padding:10px}.padding_0{padding:0}.padding_15{padding:15px}.padding_20{padding:20px}.es-list-container{overflow:auto}.radius_5{border-radius:5px}.radius_10{border-radius:10px}.radius_15{border-radius:15px}.radius_20{border-radius:20px}.widget-table__head-cell[data-v-25198f4a]{padding:18px;text-align:start}.widget-table__head-label[data-v-25198f4a]{font-weight:600;font-size:14px;line-height:19px}[dir=rtl] .icon[data-v-e287c8d9]{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-a8d711d1]{--button-size: 40px;max-height:var(--button-size);z-index:1;width:fit-content}.widget-multi-button[data-v-a8d711d1]{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-a8d711d1]{grid-template-rows:calc(var(--button-size) * var(--7025434e))}.widget-multi-button-body[data-v-a8d711d1]{min-width:80px}.widget-multi-button-body-label[data-v-a8d711d1]{padding:10px 10px 10px 20px;color:#fff;transition:background-color var(--fast)}.widget-multi-button-body-label[data-v-a8d711d1]:hover{background-color:#223296}.widget-multi-button-side[data-v-a8d711d1]{height:var(--button-size);transition:transform var(--fast),background-color var(--fast);color:#fff}.widget-multi-button-side_active[data-v-a8d711d1]{transform:rotate(180deg)}.widget-multi-button-side[data-v-a8d711d1]: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}')),document.head.appendChild(t)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
2
2
  "use strict";/*!
3
- * eservices-core v1.3.37
3
+ * eservices-core v1.3.38
4
4
  * (c) 2023 ESERVICES
5
- */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),N=require("jenesius-vue-form"),Nt=require("vue-router"),Be=require("debug"),Ot=require("date-and-time");function $t(n,e){return!!n&&n===e||"password is not equal"}function st(n){return Number(n.replace(/[^0-9.]/g,""))}function It(n,e=null){let r=String(st(n)).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length>1&&e!==null&&r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Rt=Object.freeze(Object.defineProperty({__proto__:null,numeric:st,prettyNumeric:It,validPassword:$t},Symbol.toStringTag,{value:"Module"})),Lt={inputs:Rt};function Ce(n,e){if(typeof n!="object"||n===null)return;if(e in n)return n[e];let t=e.indexOf(".");if(t>-1){const r=e.substring(0,t);return r in n?Ce(n[r],e.substr(t+1)):void 0}return n[e]}function Te(n,e){if(!n)return console.warn("Element is not provided.");function t(i,s){return i==s.target||i.contains(s.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function at(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const ct=class E extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=E.ID++}static ParentFormNotFound(){return new E("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new E("Composite object name is undefined",e)}static EntityWithoutName(e){return new E("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new E(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new E("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new E("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new E(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return E.ApiNotAvailable()}static ApiError(e){return new E("Request error",e)}static ApiNotAvailable(){return new E(`Sorry, we experience difficulties here.
6
- Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?E.ApiNotAvailable():new E(e||"Authorization Error",t)}static ApiResponseParseFailed(){return E.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new E("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new E(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new E("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new E("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new E(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new E(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new E(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new E(`Metadata for the ${e} is not currently available.`)}};ct.ID=0;let x=ct;const Pt="Please try again later or submit a feedback if problem doesn't go.";class lt{static getClientData(){return y("/close-api/client-content")}static getNavigation(){return y("/close-api/client/navigation")}}const Dt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const l=new xt(e,t,i,r||[],s);return this.store.push(l),i&&setTimeout(this.remove.bind(this,l.id),i*1e3),l}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}removeChild(e,t){throw new Error("Removing children error.")}},ut=class dt{constructor(e,t,r,i,s){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=s,this.id=dt.cardId++}};ut.cardId=1;let xt=ut;/*!
5
+ */Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),A=require("jenesius-vue-form"),Nt=require("vue-router"),Be=require("debug"),Ot=require("date-and-time");function It(n,e){return!!n&&n===e||"password is not equal"}function st(n){return Number(n.replace(/[^0-9.]/g,""))}function $t(n,e=null){let r=String(st(n)).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length>1&&e!==null&&r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Lt=Object.freeze(Object.defineProperty({__proto__:null,numeric:st,prettyNumeric:$t,validPassword:It},Symbol.toStringTag,{value:"Module"})),Rt={inputs:Lt};function Se(n,e){if(typeof n!="object"||n===null)return;if(e in n)return n[e];let t=e.indexOf(".");if(t>-1){const r=e.substring(0,t);return r in n?Se(n[r],e.substr(t+1)):void 0}return n[e]}function Ce(n,e){if(!n)return console.warn("Element is not provided.");function t(i,s){return i==s.target||i.contains(s.target)}const r=i=>{t(n,i)||(e(),window.removeEventListener("click",r))};window.addEventListener("click",r)}function at(n){return n.reduce((e,t)=>e.then(r=>t==null?void 0:t(r)),Promise.resolve())}const ct=class v extends Error{constructor(e,t=null){super(),this.message=e,this.details=t,this.id=v.ID++}static ParentFormNotFound(){return new v("Can't found parent form.")}static UndefinedNameOfCompositeFormController(e){return new v("Composite object name is undefined",e)}static EntityWithoutName(e){return new v("'Entity doesn't have a name",e)}static NotResolvedNameEventEmitter(e){return new v(`'${e}' is not a valid Event emitter name`)}static FormIsNotValidated(e){return new v("Form is not validated",e)}static ListWorkerIsRunningOrEnd(e){return new v("List data request is running or already done",e)}static ObjectIdNotNumber(e){return new v(`${e} (id) is not a number`)}static UndefinedErrorId(e,t){return v.ApiNotAvailable()}static ApiError(e){return new v("Request error",e)}static ApiNotAvailable(){return new v(`Sorry, we experience difficulties here.
6
+ Please try again later or submit a feedback if problem doesn't go.`)}static AuthServiceError(e,t){return!e&&!t?v.ApiNotAvailable():new v(e||"Authorization Error",t)}static ApiResponseParseFailed(){return v.ApiNotAvailable()}static MissingIdInValuesEntity(e){return new v("Object doesn't have id",e)}static ObjectWithIdNotFound(e,t){return new v(`Can't find object with id: ${e}`,t)}static ObjectWithoutConnectToPresentArray(e,t){return new v("Object is not found.",{object:e,array:t})}static EntityWithoutId(e){return new v("Entity doesn't have id.",e)}static NotFoundedTableIndex(e,t){return new v(`Can't find the element with tableIndex ${e}`,t)}static UndefinedError(e,t=[]){return new v(e,t)}static TableArrayAlreadyIncludeProvidedIndexValue(e,t,r){return new v(`Array already includes the element with value ${e}`,{array:t,table:r})}static MetadataEntityIsNotAvailable(e){return new v(`Metadata for the ${e} is not currently available.`)}};ct.ID=0;let B=ct;const Pt="Please try again later or submit a feedback if problem doesn't go.";class lt{static getClientData(){return h("/close-api/client-content")}static getNavigation(){return h("/close-api/client/navigation")}}const Dt=new class{constructor(){this.store=o.reactive([])}add(e,t,{children:r,timeout:i=10,click:s=()=>{}}={}){const l=new xt(e,t,i,r||[],s);return this.store.push(l),i&&setTimeout(this.remove.bind(this,l.id),i*1e3),l}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}removeChild(e,t){throw new Error("Removing children error.")}},ut=class dt{constructor(e,t,r,i,s){this.type=e,this.msg=t,this.timeout=r,this.children=i,this.click=s,this.id=dt.cardId++}};ut.cardId=1;let xt=ut;/*!
7
7
  * jenesius-event-emitter v1.0.2
8
8
  * (c) 2022 Jenesius
9
9
  * @license MIT
10
- */const Je=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},He=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},Xe=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},Ze=function(){this.events={}};class R{constructor(){this.events={}}on(e,t){return Je.call(this,e,t)}emit(e,t){return He.call(this,e,t)}off(e,t){return Xe.call(this,e,t)}cleanEvents(){Ze.call(this)}static on(e,t){return Je.call(R,e,t)}static emit(e,t){return He.call(R,e,t)}static off(e,t){return Xe.call(R,e,t)}static cleanEvents(){Ze.call(R)}}R.events={};var ft=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ue=(n,e,t)=>(ft(n,e,"read from private field"),t?t.call(n):e.get(n)),Re=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Le=(n,e,t,r)=>(ft(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ee,de,fe;const z=class k extends R{constructor(){super(...arguments),Re(this,ee,void 0),Re(this,de,"front"),this.organizations=[],Re(this,fe,!1)}set language(e){localStorage.setItem(k.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(k.LOCALSTORAGE_LANGUAGE_KEY)||k.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(k.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Le(this,ee,e)}get router(){if(!ue(this,ee))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ue(this,ee)}set type(e){Le(this,de,e)}get type(){return ue(this,de)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Le(this,fe,e),this.emit(k.EVENT_READY_UPDATE,e)}get ready(){return ue(this,fe)}onReady(e){return this.on(k.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(k.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(k.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(k.CURRENT_CONTEXT_KEY,String(e)),this.emit(k.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const t=Number.parseInt(localStorage.getItem(k.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Dt.add("error",x.ApiNotAvailable().message)}}loadCustomerData(){return lt.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};ee=new WeakMap;de=new WeakMap;fe=new WeakMap;z.DEFAULT_LANGUAGE="en";z.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";z.EVENT_CONTEXT_UPDATE="event:context-update";z.EVENT_READY_UPDATE="event:ready-update";z.EVENT_DATA_UPDATE="event:data-update";z.CURRENT_CONTEXT_KEY="CurrentContext";let Bt=z;const Qe=new Bt;function Vt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Pt}})}function y(n,e={}){return Qe.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Qe.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw x.ApiNotAvailable()}).then(t=>Vt(t).then(r=>{if(!t.ok)throw r;return r}))}class be{constructor(){}static parseNamesFromListConfig(e){let t=be.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let l in i)typeof i[l]=="boolean"?s+=` ${l} `:s+=` ${l} { ${r(i[l])} }`;return s}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const s=i.indexOf("."),l=i.substring(s+1),a=i.substring(0,s);a in r||(r[a]={}),t(r[a],l)}else r[i]=!0;return r}return e.reduce(t,{})}}class Ut{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},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")}}const pt=new Ut;function ht(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ve(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ve(r)),e[i]=r,e},{})}function Ft(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Mt={Request:y,clickOutside:Te,getPropFromObject:Ce,runPromiseQueue:at,GraphQL:be,firstChapterToLowerCase:ht,valuesToUpperCase:Ve,prettyMoney:Ft},Wt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:be,Journal:pt,Request:y,clickOutside:Te,default:Mt,firstChapterToLowerCase:ht,getPropFromObject:Ce,runPromiseQueue:at,valuesToUpperCase:Ve},Symbol.toStringTag,{value:"Module"}));function gt(n,e=""){for(let t in n){if(typeof n[t]=="object"){gt(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const U={};function jt(n){for(let e in n)U[e]=n[e];n.styles&&gt(n.styles),pt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=U}const qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Gt{static readHistoryById(e,t){return y(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(s=>{if(!s.changes)return s;const l=s.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...s,changes:l}});return{...r,history:i}})}}class zt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return y(`/open-api/internationalization/language/${e}`)}}let q={};function X(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=N.utils.getPropFromObject((this==null?void 0:this.vocabulary)||q,n);if(typeof t=="string")return et(t,e);const r=N.utils.getPropFromObject(q==null?void 0:q.root,n);return typeof r=="string"?et(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function et(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}X.setGlobalVocabulary=function(n){q=n};X.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),X.bind({vocabulary:N.utils.getPropFromObject(q,e.toLowerCase())})};X.setVocabulary=function(n){return typeof n=="string"&&(n=N.utils.getPropFromObject(q,n)),X.bind({vocabulary:n})};const Kt=function(){let n=!1;const e=[];function t(){return n}function r(c,u){t()&&console[c](...u),e.push(u)}function i(...c){r("log",c)}function s(...c){r("warn",c)}function l(...c){r("error",c)}function a(c=!0){n=c}return{info:i,warn:s,history:e,display:a,error:l}}();function Yt(){return Kt}class C{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw x.AuthServiceError(e.title,t)}static login(e){return y(U.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:U.applicationName})}).catch(C.parseError)}static registration(e){return e.AppName=U.applicationName,y(U.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(C.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw x.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return C.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return C.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return C.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return C.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return y(`${U.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(C.parseError)}static startLoginProcess(e){return C.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return C.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return C.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return y(`${U.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(C.parseError).then(C.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw x.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Jt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Ht="masterId",Xt="masterEntity";function we(n,e){if(!Array.isArray(e))return;if(Jt(e))return t(e);e.forEach(t);function t(r){n.append(Xt,r[0]),n.append(Ht,r[1].toString())}}class oe{static async anonymousGetList(e){return await y(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,s)=>r.append(i,s),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const l=(Array.isArray(i)?[i]:Object.entries(i)).map(([a,c="desc"])=>`@${a} ${c}`).join(",");t("order",l)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=oe.getSearchParamsForEntityListRead(t||{});return await y(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=oe.getSearchParamsForEntityListRead(t||{});return y(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return we(i,r==null?void 0:r.masterEntities),y(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,i={}){return y(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const i=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return y(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const s=new URLSearchParams;return we(s,i==null?void 0:i.masterEntities),y(`/close-api/data/entities/${e}/id/${t}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,t,r){const i=typeof t=="number"?{Id:t}:t;return oe.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return y(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const yt=class te{static async create(e){return y(te.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const t=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return y(te.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return y(`${te.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return y(`${te.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};yt.url="/close-api/communications";let Zt=yt;class Qt{static async getDefaultView(e){return y("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function tt(n){return{...n,createdEntities:n.createdEntites}}const mt=class pe{static async getStartConfig(e,t){return y([pe.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return y([pe.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(e,t,r,i,s){return y([pe.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(tt)}};mt.url="/close-api/views/process-wizard";let he=mt;const en={class:"widget-table__head"},tn={class:"widget-table__head-label margin_0 text_overflow"},nn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",en,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",tn,o.toDisplayString(r.label),1)]))),128))]))}});const F=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},rn=F(nn,[["__scopeId","data-v-25198f4a"]]);function on(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Et(n,e){const t=on(n);let r=t?N.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function Ue(n){return["eservices-core",n].join(":")}function wt(n){return Fe(n,"YYYY/MM/DD HH:mm:ss")}function Fe(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Ot.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const sn={props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},ke=F(sn,[["__scopeId","data-v-e287c8d9"]]),an=Be(Ue("setup-list-row"));function cn(n,e){const t=n.config.map(r=>ln(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function ln(n,e,t){const r=e.values;let i=Et(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function l(g){s.onClick.push(()=>g(r))}function a(g){Array.isArray(g)?s.class.push(...g):s.class.push(g)}const c=[],u=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Fe(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=wt(typeof i=="string"?i:null);break}case"money":{i=_t(i);break}case"multi-select":{u.push(o.h(N.FormField,{type:"single-checkbox",modelValue:e.selected})),l(nt.bind(null,t,!0));break}case"select":{u.push(o.h(N.FormField,{type:"single-radio",modelValue:e.selected})),l(nt.bind(null,t,!1));break}}if(n.onClick&&l(n.onClick),n.link)try{const g=n.link(r);if(g){const w=o.h(Nt.RouterLink,{to:g});u.push(w),a("widget-table-cell_link")}}catch(g){an("Can't add router link",g)}return n.href&&(u.push(o.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&u.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&u.push(o.h(ke,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),c.push(o.h("td",s,u)),c}function nt(n,e){n.emit("select",e)}function vt(n,e){return()=>{try{return cn(n,e)}catch(t){return console.warn(t),null}}}const un={props:{values:Object,config:Object,selected:Boolean},setup:vt},dn=["colspan"],rt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,dn)],512))}}),A={LIST_ACTIVE_NEW:"list-active-new",DEFAULT_ERROR_MESSAGE:"Please try again later or submit a feedback if problem doesn't go.",LOCALSTORAGE_CURRENT_CONTEXT_KEY:"CurrentContext",LOCALSTORAGE_LANGUAGE_KEY:"CurrentLanguage",DELAY_SOCKET_RECONNECT:100,PROVIDE_NAME_METADATA:"provide-metadata-config"},fn={class:"widget-table"},it="update:selectedRows",pn=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=o.useSlots(),i=o.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function s(a,c=!0){if(!t.selectedRows)return;if(!c)return e(it,t.selectedRows.includes(a)?[]:[a]);const u=[...t.selectedRows],g=u.indexOf(a);return g===-1?u.push(a):u.splice(g,1),e(it,u)}function l(a){e("save",a),e("update:activeRow",null)}return(a,c)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",fn,[o.createVNode(rn,{config:a.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(u,g)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:g},[o.createVNode(un,{config:a.config,values:u,selected:a.selectedRows.includes(u),onSelect:w=>s(u,w),class:o.normalizeClass(a.classCallback?a.classCallback(u):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===u?(o.openBlock(),o.createBlock(rt,{key:0,component:i.value,"row-length":a.config.length,values:u,onClose:c[0]||(c[0]=w=>e("update:activeRow",null)),onSave:l,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),a.activeRow===o.unref(A).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(rt,{key:0,component:i.value,"row-length":a.config.length,onClose:c[1]||(c[1]=u=>e("update:activeRow",null)),onSave:l,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),hn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const Ae=F(hn,[["__scopeId","data-v-0ef9ae88"]]),gn={class:"widget-button"},yn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",gn,[e.wait?(o.openBlock(),o.createBlock(Ae,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const mn=F(yn,[["__scopeId","data-v-450dc564"]]),En={class:"widget-multi-button-wrap position_relative cursor_pointer"},wn={class:"widget-multi-button-body grid"},vn=["onClick"],_n={class:"widget-multi-button-side-wrap"},Sn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(l=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(l){if(!(typeof l!="function"||t.wait))return t.wait=!0,Promise.resolve().then(l).finally(()=>{t.wait=!1})}function s(l=!t.active){t.active=l}return(l,a)=>(o.openBlock(),o.createElementBlock("div",En,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",wn,[l.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=c=>s())},o.toDisplayString(l.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(c,u)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:u,onClick:g=>{i(c.callback),s(!1)}},o.toDisplayString(c.label),9,vn))),128))]),o.createElementVNode("div",_n,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=c=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Ae),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(o.openBlock(),o.createBlock(o.unref(ke),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const Cn=F(Sn,[["__scopeId","data-v-a8d711d1"]]),Tn={class:"widget-loader flex flex-align_center gap_10 padding_15"},bn={class:"text_md"},kn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Tn,[o.createVNode(Ae,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",bn,o.toDisplayString(e.label),1)]))}}),An=["alt","src"],Nn=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,An))}}),On={props:{config:Array,values:Object,selected:Boolean},setup:vt};const $n=F(On,[["__scopeId","data-v-344a8cc1"]]),In=n=>(o.pushScopeId("data-v-4e1d87c8"),n=n(),o.popScopeId(),n),Rn={class:"head-cell"},Ln=In(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Pn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",Rn,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(N.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ke),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),Ln])]))}});const Dn=F(Pn,[["__scopeId","data-v-4e1d87c8"]]),xn=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function c(f,p){let h=-1;do h++,p-=f[h];while(p>0&&h<f.length);return h}function u(f,p){let h=0;for(;p>0&&p>f[h]&&h<f.length;)p-=f[h],h++;return console.log(p,h),h>0?h:0}function g(f){try{i.value.style.insetInlineStart=f+"px"}catch(p){console.log(p)}}function w(f){try{i.value.style.width=f+"px",i.value.style.minWidth=f+"px",i.value.style.maxWidth=f+"px"}catch(p){console.log(p)}}function d(f){return f===null?!1:f.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(p){var Ye;function h(b){return b.screenX+v-L}const _=r.value,m=[..._.children].filter(b=>b.localName==="th"),v=((Ye=_.offsetParent)==null?void 0:Ye.scrollLeft)||0,T=m.map(b=>b.clientWidth),V=d(p.target),L=_.getBoundingClientRect().left,ce=h(p),S=c(T,ce),qe=T.slice(0,S).reduce((b,I)=>b+I,0),Ge=ce-qe,$e=_.offsetWidth,Z=m[S].clientWidth;if(t.config[S].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",p.screenX),console.log("Widths",T),console.log("max width",$e),console.log("Start Position",ce),console.log("Position From",S),console.log("Start Position",S),console.log("Global offset (Отступ самой таблицы от края экрана)",L),console.log("Del",Ge),console.groupEnd(),i.value.innerText=m[S].textContent||"",i.value.style.display="grid",i.value.style.width=Z+"px",i.value.style.cursor="grabbing",g(qe),w(Z),document.addEventListener("pointermove",Ke,{passive:!0}),document.addEventListener("pointerup",ze);function ze(b){if(console.group("END"),document.removeEventListener("pointermove",Ke),document.removeEventListener("pointerup",ze),V&&(t.config[S].width=i.value.style.width,t.config[S].minWidth=i.value.style.width,t.config[S].maxWidth=i.value.style.width,s(t.config)),!V){const I=b.screenX+v-L;console.log("ENP Position",I);const le=u(T,I);if(console.log(S,"->",le),le!==S){const Q=t.config[S],Ie=t.config;Ie.splice(S,1),Ie.splice(le,0,Q),s(Ie)}else{const Q=t.config[S].name;l(Q)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ke(b){if(V){const Q=h(b)-ce+Z;w(Q);return}let I=b.screenX+v-L-Ge;I<0&&(I=0),I+Z>$e&&(I=$e-Z),g(I)}})});function s(c){e("update:config",c)}function l(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void a([c]);const u=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([c,u==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,u)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.config,(g,w)=>(o.openBlock(),o.createBlock(Dn,o.mergeProps({key:g},g,{onOrder:d=>l(g.name),onSelect:u[0]||(u[0]=d=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const Bn=F(xn,[["__scopeId","data-v-ccffc6bd"]]),Vn={class:"widget-list"},Un={class:"widget-list-body position_relative"},Fn=50,Mn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(a,c=!0){if(t.selectedRows)if(!c)s(t.selectedRows.includes(a)?[]:[a]);else{const u=[...t.selectedRows],g=u.indexOf(a);g===-1?u.push(a):u==null||u.splice(g,1),s(u)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return s([...t.array]);s([])}function s(a){e("update:selectedRows",a)}function l(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Fn>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:l},[o.createElementVNode("table",Vn,[o.createElementVNode("thead",null,[o.createVNode(Bn,{onSelect:c[0]||(c[0]=u=>i()),"onUpdate:order":c[1]||(c[1]=u=>e("update:order",u)),"onUpdate:config":c[2]||(c[2]=u=>e("update:config",u)),config:a.config,order:a.order},null,8,["config","order"])]),o.createElementVNode("tbody",Un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(u,g)=>{var w;return o.openBlock(),o.createBlock($n,{key:g,class:"widget-list-row",values:u,config:a.config,selected:(w=a.selectedRows)==null?void 0:w.includes(u),onSelect:d=>r(u,d)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Wn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function ve(n){return typeof n=="string"?Pe(n):jn(n)?Pe(n.message):Pe(A.DEFAULT_ERROR_MESSAGE)}function jn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Pe(n){return{message:n}}function G(n="error"){return function(e){const{message:t}=ve(e);Se.add(n,t)}}function _e(n,e){return B().emit("entity:read",{...e,entity:n})}function Me(n,e){return B().emit("entity:update",{...e,entity:n})}function qn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function _t(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function We(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=We(r)),e[i]=r,e},{})}function Gn(n,e){const t=new Map;return n.forEach(r=>{var s;const i=e(r);t.has(i)||t.set(i,[]),(s=t.get(i))==null||s.push(r)}),t}function zn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Kn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return A.DEFAULT_ERROR_MESSAGE}})}function J(n,e={}){return O.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=O.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(A.DEFAULT_ERROR_MESSAGE)}).then(t=>Kn(t).then(r=>{if(!t.ok)throw r;return r}))}function Yn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function St(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Jn=Be(Ue("pretty-value-field-by-entity"));function Hn(n,e,t){try{const r=De.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch{return Jn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}function Xn(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const K=Be(Ue("use-socket"));function B(){return Zn}const Zn=function(){let n=1,e;const t=new Set,r=new Set;function i(){return{safeQueue:r,requestId:n,handlers:t}}function s(d){const f=[...t.values()];K("Handlers array length is %d. Response event: %s. Request id: %d",t.size,d.event,d.requestId),f.forEach(p=>{const h=d.requestId;(p.requestId&&p.requestId===h||!p.requestId&&p.event===d.event)&&(K("Find appropriated handler: %d, event: %s",n,p.event),p.callback(d.data,d),p.once&&(t.delete(p),K("Handler was removed by *once* params was passed. %o",p)))})}const l=St(d=>{console.log(`%cInitializing sockets: %c${d}`,"color: purple","color: black"),e=new WebSocket(d),e.onclose=function(f){K("Connection to server was stopped: %d %s",f.code,f.reason),l(d)},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(f=>{a(f),r.delete(f)})},e.onerror=function(f){console.warn(f)},e.onmessage=f=>{var p;try{const h=JSON.parse(f.data);if(!Ct(h)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(h);return}(p=h==null?void 0:h.data)!=null&&p.refresh&&location.reload(),s(h)}catch(h){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(h)}}},A.DELAY_SOCKET_RECONNECT);function a(d){e.send(d)}function c(d,f){t.add({event:d,callback:f})}function u(d,f){t.add({event:d,callback:f,once:!0})}function g(){return e&&(e==null?void 0:e.readyState)===1}function w(d,f,p){const h=++n,_=JSON.stringify({requestId:h,event:d,data:f,contextId:O.contextId,url:window.location.href});return g()?a(_):(r.add(_),K("Socket is not connected. Message was send to save-queue. %s")),new Promise((m,v)=>{t.add({event:d,requestId:h,once:!0,callback:(T,V)=>{if(K("Promise was resolve with next data:",T),Qn(V))return void v(T);p&&p(T,V),m(T)}})})}return{get socket(){return e},on:c,once:u,emit:w,initialization:l,getDevInfo:i}}(),Qn=n=>!!Ct(n)&&n.event==="request-error",Ct=n=>!!n&&typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function er(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const d=g();return i.value=!0,typeof d.limit!="number"&&(d.limit=100),d.offset=r,_e(n,d).then(f=>(r+=f.length,f)).finally(()=>{i.value=!1})}function l(d,f){var h;const p=d.Version||((h=t.find(_=>_.Id===f))==null?void 0:h.Version);if(p===void 0)throw new Error("Object without version.");return p}function a(d,f){const p=t.findIndex(h=>h.Id===d);if(p===-1)throw new Error(`Can't found item with Id ${d}`);t.splice(p,1,f)}async function c(d,f){try{const p=g(),h=l(f,d);delete f.Version,await Me(n,{id:d,values:f,version:h});const _=await _e(n,{fields:p.fields||"",id:d});a(d,_)}catch(p){G()(p)}}async function u(){try{const d=await s();t.push(...d)}catch(d){G()(d)}}function g(){return typeof e=="function"?e():e}async function w(){try{r=0;const d=await s();t.splice(0,t.length,...d)}catch(d){G()(d)}}return{array:t,updateById:c,next:u,reload:w,wait:i}}function tr(){function n(){return{organizations:O.organizations,currentContextId:O.contextId,person:O.person,context:O.context,contextType:O.contextType,userId:O.userId}}const e=o.reactive(n());return O.onupdateContext(()=>{Object.assign(e,n())}),e}function nr(n,e,t){return B().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function rr(n,e,t){return B().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function ir(n,e){return B().emit("communication-message:create",{communicationId:n,text:e})}function or(n){return B().emit("communication-message:read",{communicationId:n})}function sr(n){const e=N.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>or(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function ar(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw x.EntityWithoutName(n);return _e(n.name,r)}).then(We).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(G())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw x.EntityWithoutName(n);return Me(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw G()(i),i})};function t(){return typeof e=="function"?e():e}}function cr(n,e){return B().emit("metadata:read",{...e,entity:n})}class se{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[se.getKey(e,t)]=r}get(e,t={}){return this.state[se.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return cr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:lr(t.masterEntities)};return JSON.stringify(r)}}function lr(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:ur(n)?[n]:n}function ur(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function dr(n,e={}){if(!n)return o.inject(A.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?De.getByKey(t.value):null);o.provide(A.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=se.getKey(n,ot(e||{}))}const s=function(){return i(),De.update(n,ot(e||{}))};return i(),{state:r,update:s}}function ot(n){return typeof n=="function"?n():n}const Se=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=fr(r),s=new pr(e,t,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function fr(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const Tt=class bt{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=bt.cardId++}};Tt.cardId=1;let pr=Tt;class hr extends R{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ir(this.id,e)}static checkAndGenerate(e,t,r){return rr(e,t,r).then(i=>i.length===0?nr(e,t,r):i[0])}}function gr(){return B().emit("client:read",{})}var kt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},yr=(n,e,t)=>(kt(n,e,"read from private field"),t?t.call(n):e.get(n)),mr=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Er=(n,e,t,r)=>(kt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ge;const Ne=class Y extends R{constructor(){super(...arguments),this.type="front",this.organizations=[],mr(this,ge,!1)}set language(e){localStorage.setItem(A.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(A.LOCALSTORAGE_LANGUAGE_KEY)||Y.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Er(this,ge,e),this.emit(Y.EVENT_READY_UPDATE,e)}get ready(){return yr(this,ge)}onReady(e){return this.on(Y.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(Y.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(Y.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){G()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(A.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return gr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};ge=new WeakMap;Ne.DEFAULT_LANGUAGE="en";Ne.EVENT_CONTEXT_UPDATE="event:context-update";Ne.EVENT_READY_UPDATE="event:ready-update";let wr=Ne;function vr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function $(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(vr(r)){let i=function(s){var l;return((l=s.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push($.is(t,r)),e)},[]).join(" and ")}function ae(n){return typeof n=="string"?`'${n}'`:`${n}`}$.includes=function(e,t){return`@${e} Contains ${ae(t)}`};$.beginWith=function(e,t){return`@${e} BeginWith ${ae(t)}`};$.notEq=function(e,t){return`@${e} nq ${ae(t)}`};$.eq=function(e,t){return Array.isArray(t)?$.in(e,t):`@${e} eq ${ae(t)}`};$.in=function(e,t){const r=t.map(ae).join(", ");return`@${e} in (${r})`};$.and=function(...e){return e.join(" and ")};$.is=function(e,t){return`@${e} is ${t}`};$.or=function(...e){return e.join(" or ")};const O=new wr,De=new se;class _r{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await J(this.url+`/${e}?${i.toString()}`,{method:"GET"})}static getById(e,t,r=[]){const i=new URLSearchParams;return we(i,r),t&&i.append("id",t),J([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return J(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return J(`/open-api/metadata/${e}/list-fields/${t}`)}}class Sr{static async upload(e,t){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${t}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class Cr{static invite(e,t,r){return y("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:t,relatedRoleCode:r})})}static accept(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!0})})}static decline(e,t){return y("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class je{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return y(je.url+e,{method:"POST",body:JSON.stringify(t)})}}class Tr{static getConfiguration(){return y("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class br{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return we(i,r),J([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function kr(n,e="images"){return`/static-folder/${e}/${n}`}class Ar{static getRequiredDocuments(e,t,r){const i=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class H{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${H.url()}/calculator/${e}`)}static calculate(e,t){return y(`/${H.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:t})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):x.ApiNotAvailable()})}static parseMetadataField(e){function t(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:t(e)}}static createOnlinePayment(e,t){return y(`/${H.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return y(`/${H.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class Nr{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return y(i)}}var At=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},P=(n,e,t)=>(At(n,e,"read from private field"),t?t.call(n):e.get(n)),M=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},W=(n,e,t,r)=>(At(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ye,ne,me,Ee,re,ie,xe;const j="_______LIST_______ROW_______INDEX________NAME_______",Oe=class D extends R{constructor(e){super(),this.LIST_ROW_KEY=1,M(this,ye,void 0),this.array=[],M(this,ne,[]),M(this,me,[]),M(this,Ee,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(D.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(D.EVENT_FILTERS_UPDATE,t),!0)})),M(this,re,!1),M(this,ie,(...t)=>Promise),M(this,xe,()=>{}),W(this,ye,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&W(this,ne,e.config)}set config(e){W(this,ne,e.map(N.utils.copyObject)),this.emitUpdateConfig()}get config(){return P(this,ne)}emitUpdateConfig(){this.emit(D.EVENT_CONFIG_UPDATE,this.config)}get order(){return P(this,me)}set order(e){W(this,me,e),this.emit(D.EVENT_ORDER_UPDATE,this.order)}get filters(){return P(this,Ee)}set filters(e){$r(P(this,Ee),e)}set wait(e){W(this,re,e),this.emit(N.Form.EVENT_WAIT,P(this,re))}get wait(){return P(this,re)}get primaryKeys(){return P(this,ye)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[j]===e)}indexByKey(e){return this.array.findIndex(t=>t[j]===e)}static getKey(e){return e[j]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,j)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(D.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(D.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(D.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[j]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,j)}set read(e){W(this,ie,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=P(this,ie).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){W(this,ie,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>P(this,xe).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[j]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=D.getCellName(e),i=(()=>{let s=r?Ce(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};ye=new WeakMap;ne=new WeakMap;me=new WeakMap;Ee=new WeakMap;re=new WeakMap;ie=new WeakMap;xe=new WeakMap;Oe.EVENT_DATA="list-data: update";Oe.EVENT_CONFIG_UPDATE="list-config:update";Oe.EVENT_ORDER_UPDATE="list-order:update";Oe.EVENT_FILTERS_UPDATE="list-filters:update";function Or(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function $r(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function Ir(n){const e=o.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const c=e.findIndex(u=>u===a);c!==-1&&e.splice(c,1)}function s(a){const c=o.unref(n);if(a===void 0){e.length===0?c.forEach(r):c.forEach(i);return}t(a)?i(a):r(a)}const l=o.computed(()=>{const a=o.unref(n);return e.length===a.length&&a.length!==0});return[e,s,l,r,i]}function Rr(n){return n.statusName==="Completed"}function Lr(n){return n.statusName==="FinalStepWithConfirmation"}function Pr(n){return n.statusName==="ValidationError"}function Dr(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],l=null;const a=o.ref(null);function c(){a.value=s.find(m=>m.name===l)||null}function u(){var m;return l?((m=s.find(v=>v.name===l))==null?void 0:m.fields)||[]:[]}function g(m){if(c(),Pr(m))return void t.onValidation(m.validationResults);if((m.statusName==="FinalStep"||m.statusName==="NextStep")&&(!u().length||xr(u(),t.presets)))return _(t.presets||{});Rr(m)&&t.onCompleted(m),Lr(m)&&t.onConfirmation(m)}async function w(){try{await d(),await h()}catch(m){const{message:v}=ve(m);Se.add("error",v)}}function d(){return i.wait="Loading process information.",he.getStartConfig(e,n).then(m=>{s=m.steps.map(v=>({label:v.title,name:v.stepName,number:v.number,fields:v.frontendEntity.objectTypes.reduce((T,V)=>(V.properties.forEach(L=>{T.push({name:L.name,label:L.title,type:L.refEntityName||L.dataType})}),T),[])}))}).then(m=>(i.wait=!1,m))}function f(m){return l=m.nextStepName,r=m.token,m}function p(m){const v=ve(m);Se.add("error",v.message)}function h(){return i.wait="Starting process",he.startProcess(e,n).then(f).then(g).catch(p).finally(()=>{i.wait=null})}function _(m={}){return!r||!l?Promise.reject("Not step or token."):(i.wait="Expect the result",he.runStep(e,n,l,r,m).then(f).then(g).catch(p).finally(()=>{i.wait=!1}))}return{initialize:w,state:i,currentStepConfig:o.readonly(a),next:_}}function xr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!N.utils.getPropFromObject(e,r.name))return!1}return!0}const Br="close-api/proxy/Equipment/Search";class Vr{static search(e,t,r,i,s){const l=new URLSearchParams;l.append("pattern",e||""),t&&l.append("categoryId",t),r&&l.append("useType",String(r)),i&&l.append("statusCode",i),s&&(l.append("limit",String(s.limit)),l.append("offset",String(s.offset)));const a=`/${Br}?${l.toString()}`;return y(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Ur={clickOutside:Te,staticLink:kr},Fr={usage:Lt,utils:Wt,config:jt,types:qt};exports.Communication=hr;exports.CoreError=x;exports.Filter=$;exports.Manager=O;exports.NotificationSystem=Se;exports.WidgetButton=mn;exports.WidgetIcon=ke;exports.WidgetImage=Nn;exports.WidgetList=Mn;exports.WidgetLoader=kn;exports.WidgetMultiButton=Cn;exports.WidgetSpinner=Ae;exports.WidgetTable=pn;exports.actionService=br;exports.asyncProcess=Wn;exports.authService=C;exports.billingService=H;exports.catchUniversal=G;exports.clickOutside=Te;exports.clientService=lt;exports.communicationService=Zt;exports.configurationService=Nr;exports.constants=A;exports.dataService=oe;exports.debounce=Yn;exports.default=Fr;exports.documentsService=Ar;exports.equipmentService=Vr;exports.fileService=Sr;exports.getCellValue=Et;exports.getNamesFromListConfig=qn;exports.groupArrayByField=Gn;exports.historyService=Gt;exports.internationalizationService=zt;exports.invitationService=Cr;exports.metadataService=_r;exports.openService=Tr;exports.parseError=ve;exports.prettyDate=Fe;exports.prettyDateWithTime=wt;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=Hn;exports.processWizardService=he;exports.request=J;exports.ruleValidationService=je;exports.t=X;exports.throttle=St;exports.universalEntityRead=_e;exports.universalEntityUpdate=Me;exports.useCommunication=sr;exports.useFormEntity=ar;exports.useListActiveRow=Xn;exports.useListEntity=er;exports.useListSearch=Or;exports.useListSelect=Ir;exports.useLogger=Yt;exports.useManagerState=tr;exports.useMetadata=dr;exports.useSocket=B;exports.useWizard=Dr;exports.utils=Ur;exports.uuidv4=zn;exports.valuesToUpperCase=We;exports.viewService=Qt;
10
+ */const Je=function(n,e){return n in this.events||(this.events[n]=[]),this.events[n].push(e),this.off.bind(this,n,e)},He=function(n,e){n in this.events&&this.events[n].forEach(t=>t(e))},Xe=function(n,e){const t=this.events[n];if(!t)return;const r=t.indexOf(e);r!==-1&&t.splice(r,1)},Qe=function(){this.events={}};class R{constructor(){this.events={}}on(e,t){return Je.call(this,e,t)}emit(e,t){return He.call(this,e,t)}off(e,t){return Xe.call(this,e,t)}cleanEvents(){Qe.call(this)}static on(e,t){return Je.call(R,e,t)}static emit(e,t){return He.call(R,e,t)}static off(e,t){return Xe.call(R,e,t)}static cleanEvents(){Qe.call(R)}}R.events={};var ft=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},ue=(n,e,t)=>(ft(n,e,"read from private field"),t?t.call(n):e.get(n)),Le=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Re=(n,e,t,r)=>(ft(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),te,de,fe;const Y=class k extends R{constructor(){super(...arguments),Le(this,te,void 0),Le(this,de,"front"),this.organizations=[],Le(this,fe,!1)}set language(e){localStorage.setItem(k.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(k.LOCALSTORAGE_LANGUAGE_KEY)||k.DEFAULT_LANGUAGE}checkLanguageInStorage(){return!!localStorage.getItem(k.LOCALSTORAGE_LANGUAGE_KEY)}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}set router(e){Re(this,te,e)}get router(){if(!ue(this,te))throw new Error("Router was not founded. Please set router: Manager.router = router: VueRouter");return ue(this,te)}set type(e){Re(this,de,e)}get type(){return ue(this,de)}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Re(this,fe,e),this.emit(k.EVENT_READY_UPDATE,e)}get ready(){return ue(this,fe)}onReady(e){return this.on(k.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(k.EVENT_CONTEXT_UPDATE,e)}onupdateData(e){return this.on(k.EVENT_DATA_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.log("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(k.CURRENT_CONTEXT_KEY,String(e)),this.emit(k.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.user=e.user,this.ready=!0;const t=Number.parseInt(localStorage.getItem(k.CURRENT_CONTEXT_KEY)||"");!Number.isNaN(t)&&this.validateContextId(Number(t))?this.setCurrentContext(t):this.setCurrentContext(Number(e.id))}catch{Dt.add("error",B.ApiNotAvailable().message)}}loadCustomerData(){return lt.getClientData()}async updateFullClientData(){return this.init()}validateContextId(e){var t;return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}getListKeyById(e){return console.log("DEPRECATED"),`list-information-${e}`}getListInformationFromLocalStorage(e){console.log("DEPRECATED");const t=localStorage.getItem(this.getListKeyById(e));return t&&JSON.parse(t)}setListInformationToLocalStorage(e,t){console.log("DEPRECATED"),localStorage.setItem(this.getListKeyById(e),JSON.stringify(t))}};te=new WeakMap;de=new WeakMap;fe=new WeakMap;Y.DEFAULT_LANGUAGE="en";Y.LOCALSTORAGE_LANGUAGE_KEY="CurrentLanguage";Y.EVENT_CONTEXT_UPDATE="event:context-update";Y.EVENT_READY_UPDATE="event:ready-update";Y.EVENT_DATA_UPDATE="event:data-update";Y.CURRENT_CONTEXT_KEY="CurrentContext";let Bt=Y;const Ze=new Bt;function Vt(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return Pt}})}function h(n,e={}){return Ze.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=Ze.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw B.ApiNotAvailable()}).then(t=>Vt(t).then(r=>{if(!t.ok)throw r;return r}))}class be{constructor(){}static parseNamesFromListConfig(e){let t=be.parseFieldsToGraphQL(e.reduce((i,s)=>(s.name&&i.push(s.name),i),[]));function r(i){let s="";for(let l in i)typeof i[l]=="boolean"?s+=` ${l} `:s+=` ${l} { ${r(i[l])} }`;return s}return r(t)}static parseSortFromListConfig(e){let t={};for(let r in e)t[r]=e[r]?"ASC":"DESC";return t}static parseFieldsToGraphQL(e){function t(r,i){if(i.includes(".")){const s=i.indexOf("."),l=i.substring(s+1),a=i.substring(0,s);a in r||(r[a]={}),t(r[a],l)}else r[i]=!0;return r}return e.reduce(t,{})}}class Ut{constructor(){this.public=!1,this.errors=new Proxy([],{set:(e,t,r)=>(t!=="length"&&this.public&&console.log(`Journal [Error] ${JSON.stringify(r)}`),e[t]=r,!0)}),window._journal=this}get error(){return{add:(...e)=>{this.errors.push(e)},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")}}const pt=new Ut;function ht(n){return n&&n[0].toLowerCase()+n.slice(1)}function Ve(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=Ve(r)),e[i]=r,e},{})}function Mt(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}const Ft={Request:h,clickOutside:Ce,getPropFromObject:Se,runPromiseQueue:at,GraphQL:be,firstChapterToLowerCase:ht,valuesToUpperCase:Ve,prettyMoney:Mt},Wt=Object.freeze(Object.defineProperty({__proto__:null,GraphQL:be,Journal:pt,Request:h,clickOutside:Ce,default:Ft,firstChapterToLowerCase:ht,getPropFromObject:Se,runPromiseQueue:at,valuesToUpperCase:Ve},Symbol.toStringTag,{value:"Module"}));function gt(n,e=""){for(let t in n){if(typeof n[t]=="object"){gt(n[t],(e.length?`${e}-`:"")+t);continue}let r="--"+((e.length?`${e}-`:"")+t).replace(/([A-Z])/g,i=>`-${i}`.toLowerCase());document.documentElement.style.setProperty(r,n[t])}}const U={};function jt(n){for(let e in n)U[e]=n[e];n.styles&&gt(n.styles),pt.welcome(),console.log("The config has been initialized. To get access check %c_config in console.","background: purple; color: white"),window._config=U}const qt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));class Gt{static readHistoryById(e,t){return h(`/close-api/audits/history/${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{const i=r.history.map(s=>{if(!s.changes)return s;const l=s.changes.map(a=>({...a,oldValue:a.originalValue,name:a.fieldName}));return{...s,changes:l}});return{...r,history:i}})}}class zt{static getDictionary(e){if(!e)throw new Error(`Can't get dictionary for ${e}.`);return h(`/open-api/internationalization/language/${e}`)}}let z={};function Q(n,...e){if(typeof n!="string")return console.trace(`Label is not provided for translation: ${n}`),"undefined";let t=A.utils.getPropFromObject((this==null?void 0:this.vocabulary)||z,n);if(typeof t=="string")return et(t,e);const r=A.utils.getPropFromObject(z==null?void 0:z.root,n);return typeof r=="string"?et(r,e):(typeof t===void 0&&console.warn(`Translation for label "${n}" is not founded.`),n)}function et(n,e){return e.forEach((t,r)=>{n=n.replaceAll(new RegExp(`\\{${r}}`,"g"),t)}),n}Q.setGlobalVocabulary=function(n){z=n};Q.getScope=function(n){const e=typeof n=="string"?n:"root";return typeof n!="string"&&console.warn(`SCOPE ${n} for translate is not string.`),Q.bind({vocabulary:A.utils.getPropFromObject(z,e.toLowerCase())})};Q.setVocabulary=function(n){return typeof n=="string"&&(n=A.utils.getPropFromObject(z,n)),Q.bind({vocabulary:n})};const Kt=function(){let n=!1;const e=[];function t(){return n}function r(c,u){t()&&console[c](...u),e.push(u)}function i(...c){r("log",c)}function s(...c){r("warn",c)}function l(...c){r("error",c)}function a(c=!0){n=c}return{info:i,warn:s,history:e,display:a,error:l}}();function Yt(){return Kt}class S{static parseError(e){let t=e.errors?Object.values(e.errors).map(r=>r[0]):null;throw B.AuthServiceError(e.title,t)}static login(e){return h(U.identityServerURL+"/api/Authenticate/Login",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({...e,AppName:U.applicationName})}).catch(S.parseError)}static registration(e){return e.AppName=U.applicationName,h(U.identityServerURL+"/api/Authenticate/Registration",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(e)}).catch(S.parseError)}static parseProcessAnswer(e){if(e.statusCode>4)throw B.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}static startRegistrationProcess(e){return S.requestStepRegistrationProcess("StartRegistration",e)}static confirmPhoneRegistrationProcess(e){return S.requestStepRegistrationProcess("ConfirmPhoneNumberByRegistration",e)}static confirmEmailRegistrationProcess(e){return S.requestStepRegistrationProcess("ConfirmEmailByRegistration",e)}static finishEmailRegistrationProcess(e){return S.requestStepRegistrationProcess("FinishRegistration",e)}static requestStepRegistrationProcess(e,t){return h(`${U.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(S.parseError)}static startLoginProcess(e){return S.requestStepLoginProcess("StartLogin",e)}static loginWithPassword(e){return S.requestStepLoginProcess("LoginWithPassword",e)}static loginWithOtpCode(e){return S.requestStepLoginProcess("LoginWithOtpCode",e)}static requestStepLoginProcess(e,t){return h(`${U.identityServerURL}/api/Authenticate/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(t)}).catch(S.parseError).then(S.parseLoginProcessAnswer)}static parseLoginProcessAnswer(e){if(e.statusCode>3)throw B.UndefinedError(e.statusName.replace(/([A-Z][a-z])/g," $1").replace(/(\d)/g," $1"));return e}}function Jt(n){return Array.isArray(n)&&n.length===2&&typeof n[0]=="string"&&typeof n[1]=="number"}const Ht="masterId",Xt="masterEntity";function we(n,e){if(!Array.isArray(e))return;if(Jt(e))return t(e);e.forEach(t);function t(r){n.append(Xt,r[0]),n.append(Ht,r[1].toString())}}class se{static async anonymousGetList(e){return await h(`/open-api/data/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getSearchParamsForEntityListRead(e){const t=(i,s)=>r.append(i,s),r=new URLSearchParams;if(e.fields){const i=e.fields;typeof i=="string"?t("fields",i):Array.isArray(i)?t("fields",i.join(" ")):typeof i=="object"&&t("fields",Object.keys(i).join(" "))}if(e.order){let i=e.order;const l=(Array.isArray(i)?[i]:Object.entries(i)).map(([a,c="desc"])=>`@${a} ${c}`).join(",");t("order",l)}return e.limit&&t("limit",e.limit.toString()),e.offset&&t("offset",e.offset.toString()),e.filter&&t("filter",e.filter.toString()),e.useUsageContext&&r.append("useUsageContext",e.useUsageContext.toString()),r}static async getList(e,t){const r=se.getSearchParamsForEntityListRead(t||{});return await h(`/close-api/data/${e}?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static getCount(e,t){const r=se.getSearchParamsForEntityListRead(t||{});return h(`/close-api/data/entities/${e}/count?${r.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static create(e,t,r){const i=new URLSearchParams;return we(i,r==null?void 0:r.masterEntities),h(`/close-api/data/${e}?${i.toString()}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:t})})}static update(e,t,r,i={}){return h(`/close-api/data/entities/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r})})}static readById(e,t,r={}){const i=new URLSearchParams;if(r.fields){let s=r.fields;typeof s=="string"&&(s=[s]),i.append("fields",s.join(" "))}return h(`/close-api/data/entities/${e}/id/${t}?${i.toString()}`,{method:"GET",headers:{"Content-Type":"application/json"}})}static updateById(e,t,r,i){const s=new URLSearchParams;return we(s,i==null?void 0:i.masterEntities),h(`/close-api/data/entities/${e}/id/${t}?${s.toString()}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({values:r,version:i==null?void 0:i.version})})}static removeById(e,t,r){const i=typeof t=="number"?{Id:t}:t;return se.removeByKeys(e,i,r)}static removeByKeys(e,t,r){return h(`/close-api/data/entities/${e}`,{method:"delete",headers:{"Content-Type":"application/json"},body:JSON.stringify({keys:t,version:r})})}}const yt=class ne{static async create(e){return h(ne.url,{method:"post",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}})}static async read(e){const t=new URLSearchParams({targetCode:String(e.targetCode),entityName:e.entity.name,entityCatalogId:e.entity.catalogId});return h(ne.url+"?"+t.toString(),{method:"get"})}static async readMessages(e){return h(`${ne.url}/${e}/messages`,{method:"get"})}static async createMessage(e){return h(`${ne.url}/${e.talkId}/messages`,{method:"post",body:JSON.stringify({text:e.text}),headers:{"Content-Type":"application/json"}})}};yt.url="/close-api/communications";let Qt=yt;class Zt{static async getDefaultView(e){return h("/close-api/views/"+e,{method:"GET",headers:{"Content-Type":"application/json"}})}}function tt(n){return{...n,createdEntities:n.createdEntites}}const mt=class pe{static async getStartConfig(e,t){return h([pe.url,e,t].join("/"),{method:"GET",headers:{"Content-Type":"application/json"}})}static async startProcess(e,t){return h([pe.url,e,t].join("/"),{method:"POST",headers:{"Content-Type":"application/json"}}).then(tt)}static async runStep(e,t,r,i,s){return h([pe.url,e,t].join("/"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({stepName:r,token:i,values:s})}).then(tt)}};mt.url="/close-api/views/process-wizard";let he=mt;const en={class:"widget-table__head"},tn={class:"widget-table__head-label margin_0 text_overflow"},nn=o.defineComponent({__name:"widget-table-head",props:{config:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("tr",en,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(e.config,(r,i)=>(o.openBlock(),o.createElementBlock("th",{class:"widget-table__head-cell",key:i},[o.createElementVNode("p",tn,o.toDisplayString(r.label),1)]))),128))]))}});const M=(n,e)=>{const t=n.__vccOpts||n;for(const[r,i]of e)t[r]=i;return t},rn=M(nn,[["__scopeId","data-v-25198f4a"]]);function on(n){return typeof n.name=="string"?n.name:Array.isArray(n.name)?n.name[0]:null}function Et(n,e){const t=on(n);let r=t?A.utils.getPropFromObject(e,t):null;return r===void 0&&(r=null),n.value?n.value(r,e):r}function Ue(n){return["eservices-core",n].join(":")}function wt(n){return Me(n,"YYYY/MM/DD HH:mm:ss")}function Me(n,e="YYYY/MM/DD"){if(!n)return"";try{const t=new Date(n);return Ot.format(t,e)}catch(t){return console.log(t),"Invalid date"}}const sn={props:{name:String},setup(n,e){let t="unknown";try{t=e.slots.default()[0].children}catch{t=n.name}typeof t!="string"&&console.warn(`Name for Icon.vue is not string. ${t}`);try{t=t.replace(/\s+/g,"")}catch{}return()=>o.h("i",{class:`icon icon-${t}`})}},ke=M(sn,[["__scopeId","data-v-e287c8d9"]]),an=Be(Ue("setup-list-row"));function cn(n,e){const t=n.config.map(r=>ln(r,n,e));return o.h("tr",{class:"widget-table__row widget-table-row"},t)}function ln(n,e,t){const r=e.values;let i=Et(n,r);const s={onClick:[],class:["widget-table__cell widget-table-cell"]};function l(p){s.onClick.push(()=>p(r))}function a(p){Array.isArray(p)?s.class.push(...p):s.class.push(p)}const c=[],u=[];if(n.hide&&n.hide(r))return[o.h("td")];if(n.type)switch(a(`widget-table-cell_${n.type}`),n.type){case"number":{typeof i=="number"&&(i=new Intl.NumberFormat().format(i));break}case"date":{i=Me(typeof i=="string"?i:null);break}case"dateTime":case"dateWithTime":{i=wt(typeof i=="string"?i:null);break}case"money":{i=_t(i);break}case"multi-select":{u.push(o.h(A.FormField,{type:"single-checkbox",modelValue:e.selected})),l(nt.bind(null,t,!0));break}case"select":{u.push(o.h(A.FormField,{type:"single-radio",modelValue:e.selected})),l(nt.bind(null,t,!1));break}}if(n.onClick&&l(n.onClick),n.link)try{const p=n.link(r);if(p){const _=o.h(Nt.RouterLink,{to:p});u.push(_),a("widget-table-cell_link")}}catch(p){an("Can't add router link",p)}return n.href&&(u.push(o.h("a",{href:n.href(r),target:"_blank"})),a("widget-table-cell_link")),(typeof i=="string"||typeof i=="number")&&u.push(o.h("p",{class:"widget-list-cell-text"},i)),n.icon&&u.push(o.h(ke,{name:n.icon})),n.class&&(typeof n.class=="function"?a(n.class(r)):a(n.class)),c.push(o.h("td",s,u)),c}function nt(n,e){n.emit("select",e)}function vt(n,e){return()=>{try{return cn(n,e)}catch(t){return console.warn(t),null}}}const un={props:{values:Object,config:Object,selected:Boolean},setup:vt},dn=["colspan"],rt=o.defineComponent({__name:"widget-table-form",props:{rowLength:{},component:{},values:{},isNew:{type:Boolean}},emits:["save","close"],setup(n,{emit:e}){const t=o.ref();return o.onMounted(()=>{setTimeout(()=>{t.value&&t.value.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},250)}),(r,i)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-table-form",ref_key:"refTableForm",ref:t},[o.createElementVNode("td",{colspan:r.rowLength},[(o.openBlock(),o.createBlock(o.resolveDynamicComponent(r.component),o.mergeProps(r.$attrs,{values:r.values,new:r.isNew,onClose:i[0]||(i[0]=s=>e("close")),onSave:i[1]||(i[1]=s=>e("save",s))}),null,16,["values","new"]))],8,dn)],512))}}),C={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:100,PROVIDE_NAME_METADATA:"provide-metadata-config",TIME_TO_LIVE_SOCKET_REQUEST:1e4},fn={class:"widget-table"},it="update:selectedRows",pn=o.defineComponent({__name:"widget-table",props:{array:{},config:{},activeRow:{default:null},selectedRows:{default:()=>[]},classCallback:{}},emits:["update:activeRow","save"],setup(n,{emit:e}){const t=n,r=o.useSlots(),i=o.computed(()=>{var a;return(a=r==null?void 0:r.default)==null?void 0:a.call(r)[0]});function s(a,c=!0){if(!t.selectedRows)return;if(!c)return e(it,t.selectedRows.includes(a)?[]:[a]);const u=[...t.selectedRows],p=u.indexOf(a);return p===-1?u.push(a):u.splice(p,1),e(it,u)}function l(a){e("save",a),e("update:activeRow",null)}return(a,c)=>(o.openBlock(),o.createElementBlock("div",null,[o.createElementVNode("table",fn,[o.createVNode(rn,{config:a.config},null,8,["config"]),o.createElementVNode("tbody",null,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(u,p)=>(o.openBlock(),o.createElementBlock(o.Fragment,{key:p},[o.createVNode(un,{config:a.config,values:u,selected:a.selectedRows.includes(u),onSelect:_=>s(u,_),class:o.normalizeClass(a.classCallback?a.classCallback(u):"")},null,8,["config","values","selected","onSelect","class"]),i.value&&a.activeRow===u?(o.openBlock(),o.createBlock(rt,{key:0,component:i.value,"row-length":a.config.length,values:u,onClose:c[0]||(c[0]=_=>e("update:activeRow",null)),onSave:l,"is-new":!1},null,8,["component","row-length","values"])):o.createCommentVNode("",!0)],64))),128)),a.activeRow===o.unref(C).LIST_ACTIVE_NEW?(o.openBlock(),o.createBlock(rt,{key:0,component:i.value,"row-length":a.config.length,onClose:c[1]||(c[1]=u=>e("update:activeRow",null)),onSave:l,"is-new":!0},null,8,["component","row-length"])):o.createCommentVNode("",!0)])])]))}}),hn=o.defineComponent({__name:"widget-spinner",props:{color:{default:"#fff"}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",{class:"widget-spinner",style:o.normalizeStyle({"border-left":`1.1em solid ${e.color}`})},null,4))}});const Ae=M(hn,[["__scopeId","data-v-0ef9ae88"]]),gn={class:"widget-button"},yn=o.defineComponent({__name:"widget-button",props:{wait:{type:Boolean}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("button",gn,[e.wait?(o.openBlock(),o.createBlock(Ae,{key:0,class:"widget-button-spinner"})):o.createCommentVNode("",!0),o.renderSlot(e.$slots,"default",{},void 0,!0)]))}});const mn=M(yn,[["__scopeId","data-v-450dc564"]]),En={class:"widget-multi-button-wrap position_relative cursor_pointer"},wn={class:"widget-multi-button-body grid"},vn=["onClick"],_n={class:"widget-multi-button-side-wrap"},Tn=o.defineComponent({__name:"widget-multi-button",props:{label:{},array:{default:()=>[]}},setup(n){const e=n;o.useCssVars(l=>({"7025434e":r.value}));const t=o.reactive({active:!1,wait:!1}),r=o.computed(()=>e.array.length+(e.label?1:0));function i(l){if(!(typeof l!="function"||t.wait))return t.wait=!0,Promise.resolve().then(l).finally(()=>{t.wait=!1})}function s(l=!t.active){t.active=l}return(l,a)=>(o.openBlock(),o.createElementBlock("div",En,[o.createElementVNode("div",{class:o.normalizeClass(["overflow_hidden radius_20 widget-multi-button grid",t.active?"widget-multi-button_active":null])},[o.createElementVNode("div",wn,[l.label?(o.openBlock(),o.createElementBlock("p",{key:0,class:"text_md margin_0 text_nowrap widget-multi-button-body-label",onClick:a[0]||(a[0]=c=>s())},o.toDisplayString(l.label),1)):o.createCommentVNode("",!0),(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(l.array,(c,u)=>(o.openBlock(),o.createElementBlock("p",{class:"text_md margin_0 text_nowrap widget-multi-button-body-label",key:u,onClick:p=>{i(c.callback),s(!1)}},o.toDisplayString(c.label),9,vn))),128))]),o.createElementVNode("div",_n,[o.createElementVNode("div",{class:o.normalizeClass(["grid-center widget-multi-button-side",t.active?"widget-multi-button-side_active":null]),onClick:a[1]||(a[1]=c=>s())},[t.wait?(o.openBlock(),o.createBlock(o.unref(Ae),{key:0,class:"widget-multi-button-side-spinner"})):l.array.length>1?(o.openBlock(),o.createBlock(o.unref(ke),{key:1,class:"widget-multi-button-side-icon"},{default:o.withCtx(()=>[o.createTextVNode("angle-small-down")]),_:1})):o.createCommentVNode("",!0)],2)])],2)]))}});const Sn=M(Tn,[["__scopeId","data-v-a8d711d1"]]),Cn={class:"widget-loader flex flex-align_center gap_10 padding_15"},bn={class:"text_md"},kn=o.defineComponent({__name:"widget-loader",props:{label:{}},setup(n){return(e,t)=>(o.openBlock(),o.createElementBlock("div",Cn,[o.createVNode(Ae,{color:"var(--primary)",class:"padding_10"}),o.createElementVNode("span",bn,o.toDisplayString(e.label),1)]))}}),An=["alt","src"],Nn=o.defineComponent({__name:"widget-image",props:{src:{},alt:{},default:{}},setup(n){const e=n,t=o.ref();return o.onMounted(()=>{t.value&&(t.value.src=e.src),t.value.onerror=function(){e.default&&(t.value.src=e.default)}}),(r,i)=>(o.openBlock(),o.createElementBlock("img",{alt:r.alt,ref_key:"refImage",ref:t,src:r.src||r.$props.default},null,8,An))}}),On={props:{config:Array,values:Object,selected:Boolean},setup:vt};const In=M(On,[["__scopeId","data-v-344a8cc1"]]),$n=n=>(o.pushScopeId("data-v-bf495d6a"),n=n(),o.popScopeId(),n),Ln={class:"widget-list-head-cell"},Rn=$n(()=>o.createElementVNode("div",{class:"head-cell-resize"},null,-1)),Pn=o.defineComponent({__name:"widget-list-head-cell",props:{title:{},label:{},name:{},type:{},minWidth:{},maxWidth:{},width:{},order:{}},emits:["select","order"],setup(n,{emit:e}){const t=n;return t.title&&console.warn(`For cell ${t.name} using title,it should be replaced with label.`),(r,i)=>(o.openBlock(),o.createElementBlock("th",null,[o.createElementVNode("div",Ln,[o.createElementVNode("div",{class:"head-cell-content flex_grow",style:o.normalizeStyle({"min-width":r.minWidth,"max-width":r.maxWidth,width:r.width})},[r.type==="multi-select"?(o.openBlock(),o.createBlock(o.unref(A.FormField),{key:0,type:"single-checkbox",onClick:i[0]||(i[0]=o.withModifiers(s=>e("select"),["stop","prevent"]))})):(o.openBlock(),o.createElementBlock("p",{key:1,class:"widget-list-head-label head-cell-label list-head-cell-label text_md margin-0",onClick:i[1]||(i[1]=s=>e("order"))},o.toDisplayString(r.title||r.label),1))],4),r.name&&r.order.length&&r.order[0]===r.name?(o.openBlock(),o.createBlock(o.unref(ke),{key:0,class:o.normalizeClass(["head-cell-order",{"head-cell-order_down":r.order.length>1&&r.order[1]==="desc"}])},{default:o.withCtx(()=>[o.createTextVNode("core-arrow-up")]),_:1},8,["class"])):o.createCommentVNode("",!0),Rn])]))}});const Dn=M(Pn,[["__scopeId","data-v-bf495d6a"]]),xn=o.defineComponent({__name:"widget-list-head",props:{config:{},order:{}},emits:["update:config","update:order","select"],setup(n,{emit:e}){const t=n,r=o.ref(),i=o.ref();o.onMounted(()=>{function c(g,E){let d=-1;do d++,E-=g[d];while(E>0&&d<g.length);return d}function u(g,E){let d=0;for(;E>0&&E>g[d]&&d<g.length;)E-=g[d],d++;return console.log(E,d),d>0?d:0}function p(g){try{i.value.style.insetInlineStart=g+"px"}catch(E){console.log(E)}}function _(g){try{i.value.style.width=g+"px",i.value.style.minWidth=g+"px",i.value.style.maxWidth=g+"px"}catch(E){console.log(E)}}function y(g){return g===null?!1:g.classList.contains("head-cell-resize")}r.value.addEventListener("pointerdown",function(E){var Ye;function d(b){return b.screenX+w-N}const m=r.value,f=[...m.children].filter(b=>b.localName==="th"),w=((Ye=m.offsetParent)==null?void 0:Ye.scrollLeft)||0,$=f.map(b=>b.clientWidth),F=y(E.target),N=m.getBoundingClientRect().left,P=d(E),T=c($,P),qe=$.slice(0,T).reduce((b,L)=>b+L,0),Ge=P-qe,Ie=m.offsetWidth,Z=f[T].clientWidth;if(t.config[T].type==="multi-select")return;console.group("START"),console.log(),console.log("Start screenX",E.screenX),console.log("Widths",$),console.log("max width",Ie),console.log("Start Position",P),console.log("Position From",T),console.log("Start Position",T),console.log("Global offset (Отступ самой таблицы от края экрана)",N),console.log("Del",Ge),console.groupEnd(),i.value.innerText=f[T].textContent||"",i.value.style.display="grid",i.value.style.width=Z+"px",i.value.style.cursor="grabbing",p(qe),_(Z),document.addEventListener("pointermove",Ke,{passive:!0}),document.addEventListener("pointerup",ze);function ze(b){if(console.group("END"),document.removeEventListener("pointermove",Ke),document.removeEventListener("pointerup",ze),F&&(t.config[T].width=i.value.style.width,t.config[T].minWidth=i.value.style.width,t.config[T].maxWidth=i.value.style.width,s(t.config)),!F){const L=b.screenX+w-N;console.log("ENP Position",L);const le=u($,L);if(console.log(T,"->",le),le!==T){const ee=t.config[T],$e=t.config;$e.splice(T,1),$e.splice(le,0,ee),s($e)}else{const ee=t.config[T].name;l(ee)}}i.value.style.display="none",document.body.style.cursor="unset",console.groupEnd()}function Ke(b){if(F){const ee=d(b)-P+Z;_(ee);return}let L=b.screenX+w-N-Ge;L<0&&(L=0),L+Z>Ie&&(L=Ie-Z),p(L)}})});function s(c){e("update:config",c)}function l(c){if(!c)return;if(Array.isArray(c)){if(c.length<1)return;c=c[0]}if(t.order.length===0||t.order[0]!==c)return void a([c]);const u=t.order.length===1||t.order[1]==="asc"?"asc":"desc";a([c,u==="asc"?"desc":"asc"])}function a(c){e("update:order",c)}return(c,u)=>(o.openBlock(),o.createElementBlock("tr",{class:"widget-list-head",ref_key:"refHead",ref:r},[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(c.config,(p,_)=>(o.openBlock(),o.createBlock(Dn,o.mergeProps({key:p},p,{onOrder:y=>l(p.name),onSelect:u[0]||(u[0]=y=>e("select")),order:c.order}),null,16,["onOrder","order"]))),128)),o.createElementVNode("div",{class:"test-block text_md",ref_key:"refDisplayPosition",ref:i},"test",512)],512))}});const Bn=M(xn,[["__scopeId","data-v-ccffc6bd"]]),Vn={class:"widget-list"},Un={class:"widget-list-body position_relative"},Mn=50,Fn=o.defineComponent({__name:"widget-list",props:{array:{},config:{default:()=>[]},selectedRows:{default:()=>[]},order:{default:()=>[]}},emits:["scrollEnd","update:selectedRows","update:order","update:config"],setup(n,{emit:e}){const t=n;function r(a,c=!0){if(t.selectedRows)if(!c)s(t.selectedRows.includes(a)?[]:[a]);else{const u=[...t.selectedRows],p=u.indexOf(a);p===-1?u.push(a):u==null||u.splice(p,1),s(u)}}function i(){var a;if(((a=t.selectedRows)==null?void 0:a.length)!==t.array.length)return s([...t.array]);s([])}function s(a){e("update:selectedRows",a)}function l(a){if(!a)return;const c=a.target;c.scrollTop+c.clientHeight+Mn>c.scrollHeight&&e("scrollEnd")}return(a,c)=>(o.openBlock(),o.createElementBlock("div",{class:"es-list-container",onScrollPassive:l},[o.createElementVNode("table",Vn,[o.createElementVNode("thead",null,[o.createVNode(Bn,{onSelect:c[0]||(c[0]=u=>i()),"onUpdate:order":c[1]||(c[1]=u=>e("update:order",u)),"onUpdate:config":c[2]||(c[2]=u=>e("update:config",u)),config:a.config,order:a.order},null,8,["config","order"])]),o.createElementVNode("tbody",Un,[(o.openBlock(!0),o.createElementBlock(o.Fragment,null,o.renderList(a.array,(u,p)=>{var _;return o.openBlock(),o.createBlock(In,{key:p,class:"widget-list-row",values:u,config:a.config,selected:(_=a.selectedRows)==null?void 0:_.includes(u),onSelect:y=>r(u,y)},null,8,["values","config","selected","onSelect"])}),128))])])],32))}});function Wn(n){function e(...r){return t.wait?Promise.reject("The process has already started."):(t.wait=!0,Promise.resolve().then(()=>n(...r)).finally(()=>{t.wait=!1}))}const t=o.reactive({wait:!1,call:e});return t}function ve(n){return typeof n=="string"?Pe(n):jn(n)?Pe(n.message):Pe(C.DEFAULT_ERROR_MESSAGE)}function jn(n){return!!(typeof n=="object"&&n!==null&&Object.hasOwnProperty.call(n,"message"))}function Pe(n){return{message:n}}function K(n="error"){return function(e){const{message:t}=ve(e);Te.add(n,t)}}function _e(n,e={}){return V().emit("entity:read",{...e,entity:n})}function Fe(n,e){return V().emit("entity:update",{...e,entity:n})}function qn(n){return n.reduce((e,t)=>(t.name&&(typeof t.name=="string"?e.push(t.name):e.push(...t.name)),e),[])}function _t(n,e=2){if(!(typeof n=="string"||typeof n=="number"))return"";let r=String(n).split(".");return r[0]=r[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),r.length<2&&(r[1]=""),r[1]=r[1].padEnd(e,"0"),r[1].length>e&&(r[1]=r[1].substring(0,e)),r.join(".")}function We(n){return Object.keys(n).reduce((e,t)=>{let r=n[t];const i=t.charAt(0).toUpperCase()+t.slice(1);return typeof r=="object"&&!(r==null||Array.isArray(r))&&(r=We(r)),e[i]=r,e},{})}function Gn(n,e){const t=new Map;return n.forEach(r=>{var s;const i=e(r);t.has(i)||t.set(i,[]),(s=t.get(i))==null||s.push(r)}),t}function zn(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,n=>(n^crypto.getRandomValues(new Uint8Array(1))[0]&15>>n/4).toString(16))}function Kn(n){return n.text().then(e=>{try{return JSON.parse(e)}catch{return C.DEFAULT_ERROR_MESSAGE}})}function H(n,e={}){return O.isFront&&(e.headers||(e.headers={}),e.headers["Context-Id"]=O.contextId),e.redirect="manual",fetch(n,e).then(t=>t.type==="opaqueredirect"?void window.location.replace("/auth"):t).catch(()=>{throw new Error(C.DEFAULT_ERROR_MESSAGE)}).then(t=>Kn(t).then(r=>{if(!t.ok)throw r;return r}))}function Yn(n,e=1e3){let t=0;return(...r)=>{clearTimeout(t),t=setTimeout(()=>n(...r),e)}}function Tt(n,e){let t=!1;return(...r)=>{if(!t)return t=!0,setTimeout(()=>t=!1,e),n(...r)}}const Jn=Be(Ue("pretty-value-field-by-entity"));function Hn(n,e,t){try{const r=De.get(n);if(!r)throw new Error("For entity metadata is not loaded");const i=r.fieldsByName[e];if(!i)throw new Error(`For entity ${n} can't found fieldMetadata for field ${e}`);return i.dataType==="DateTime"&&typeof t=="string"?new Date(t).toLocaleString():t}catch{return Jn('Error by parse pretty value for entity "%s", field "%s" with value "%s"',n,e,t),""}}function Xn(){const n=o.ref(null);function e(t){n.value=t}return{activeRow:n,activateRow:e}}const W=Be(Ue("use-socket"));function V(){return Qn}const Qn=function(){let n=1,e;const t=new Set,r=new Set;setInterval(()=>{Array.from(t).forEach(d=>{E(d)&&(W("Handler for event %s requestId %d was expired",d.event,d.requestId),t.delete(d))})},1e3);function i(){return{safeQueue:r,requestId:n,handlers:t}}function s(d){const m=[...t.values()];W("Handlers array length is %d. Response event: %s. Request id: %d",t.size,d.event,d.requestId),m.forEach(f=>{const w=d.requestId;(f.requestId&&f.requestId===w||!f.requestId&&f.event===d.event)&&(W("Find appropriated handler: %d, event: %s",n,f.event),f.callback(d.data,d),f.once&&(t.delete(f),W("Handler was removed by *once* params was passed. %o",f)))})}function l(d){console.log(`%cInitializing sockets: %c${d}`,"color: purple","color: black"),e=new WebSocket(d),e.onclose=function(m){W("Connection to server was stopped: %d %s",m.code,m.reason),a(d)},e.onopen=function(){console.log("Socket was %cconnected.","color: green"),[...r.values()].forEach(m=>{c(m),r.delete(m)})},e.onerror=function(m){console.warn(m)},e.onmessage=m=>{var f;try{const w=JSON.parse(m.data);if(!St(w)){console.warn("Data is %cnot correct %csocket answer.","color: red","color: black"),console.log(w);return}(f=w==null?void 0:w.data)!=null&&f.refresh&&location.reload(),s(w)}catch(w){console.warn("Socket handle %conmessage%c error.","color: red","color: black"),console.log(w)}}}const a=Tt(l,C.DELAY_SOCKET_RECONNECT);function c(d){e.send(d)}function u(d,m){g({event:d,callback:m})}function p(d,m){g({event:d,callback:m,once:!0})}function _(){return e&&(e==null?void 0:e.readyState)===1}function y(d,m,f){const w=++n,$=JSON.stringify({requestId:w,event:d,data:m,contextId:O.contextId,url:window.location.href});return _()?c($):(r.add($),W("Socket is not connected. Message was send to save-queue")),new Promise((F,N)=>{g({event:d,requestId:w,once:!0,callback:(P,T)=>{if(W("Promise was resolve with next data:",P),Zn(T))return void N(P);f&&f(P,T),F(P)},timeToLive:C.TIME_TO_LIVE_SOCKET_REQUEST})})}function g(d){const m={timeToLive:0,...d,created:new Date().getTime()};t.add(m)}function E(d){return d.timeToLive===0||typeof d.timeToLive!="number"?!1:(new Date().getTime()-d.created)/1e3>d.timeToLive}return{get socket(){return e},on:u,once:p,emit:y,initialization:a,getDevInfo:i}}(),Zn=n=>!!St(n)&&n.event==="request-error",St=n=>typeof n=="object"&&n!==null&&"event"in n&&typeof n.event=="string"&&"requestId"in n&&typeof n.requestId=="number"&&"data"in n;function er(n,e){const t=o.reactive([]);let r=0;const i=o.ref(!1);function s(){if(i.value)return Promise.reject("The process has already started.");const y=p();return i.value=!0,typeof y.limit!="number"&&(y.limit=100),y.offset=r,_e(n,y).then(g=>(r+=g.length,g)).finally(()=>{i.value=!1})}function l(y,g){var d;const E=y.Version||((d=t.find(m=>m.Id===g))==null?void 0:d.Version);if(E===void 0)throw new Error("Object without version.");return E}function a(y,g){const E=t.findIndex(d=>d.Id===y);if(E===-1)throw new Error(`Can't found item with Id ${y}`);t.splice(E,1,g)}async function c(y,g){try{const E=p(),d=l(g,y);delete g.Version,await Fe(n,{id:y,values:g,version:d});const m=await _e(n,{fields:E.fields||"",id:y});a(y,m)}catch(E){K()(E)}}async function u(){try{const y=await s();t.push(...y)}catch(y){K()(y)}}function p(){return typeof e=="function"?e():e}async function _(){try{r=0;const y=await s();t.splice(0,t.length,...y)}catch(y){K()(y)}}return{array:t,updateById:c,next:u,reload:_,wait:i}}function tr(){function n(){return{organizations:O.organizations,currentContextId:O.contextId,person:O.person,context:O.context,contextType:O.contextType,userId:O.userId}}const e=o.reactive(n());return O.onupdateContext(()=>{Object.assign(e,n())}),e}function nr(n,e,t){return V().emit("communication:create",{entityName:n,entityCatalogId:e,targetCode:t})}function rr(n,e,t){return V().emit("communication:read",{entityName:n,entityCatalogId:e,targetCode:t})}function ir(n,e){return V().emit("communication-message:create",{communicationId:n,text:e})}function or(n){return V().emit("communication-message:read",{communicationId:n})}function sr(n){const e=A.Form.getParentForm(),t=o.reactive([]);return e&&e.subscribe(n),n.read=()=>or(n.id).then(r=>(t.splice(0,t.length,...r),r)),{array:t}}function ar(n,e){n.read=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw B.EntityWithoutName(n);return _e(n.name,r)}).then(We).then(i=>(i.hasOwnProperty("Version")&&(n.version=i.Version),n.setValues(i),i)).catch(K())},n.save=()=>{const r=t();return Promise.resolve().then(()=>{if(!n.name)throw B.EntityWithoutName(n);return Fe(n.name,{id:r.id,values:n.changes,version:n.version})}).then(i=>{n.version=i.version}).catch(i=>{throw K()(i),i})};function t(){return typeof e=="function"?e():e}}function cr(n,e){return V().emit("metadata:read",{...e,entity:n})}class ae{constructor(){this.state=o.reactive({})}set(e,t,r){this.state[ae.getKey(e,t)]=r}get(e,t={}){return this.state[ae.getKey(e,t)]}getByKey(e){return this.state[e]}update(e,t){return cr(e,t).then(this.set.bind(this,e,t))}static getKey(e,t){const r={entity:e,entityId:t.id,masterEntities:lr(t.masterEntities)};return JSON.stringify(r)}}function lr(n){return!n||!Array.isArray(n)?[]:n.length===0?[]:ur(n)?[n]:n}function ur(n){return!!n&&Array.isArray(n)&&typeof n[0]=="string"&&typeof n[1]=="number"}function dr(n,e={}){if(!n)return o.inject(C.PROVIDE_NAME_METADATA);const t=o.ref(null),r=o.computed(()=>t.value?De.getByKey(t.value):null);o.provide(C.PROVIDE_NAME_METADATA,r);function i(){if(!n)throw new Error("Entity is not provided for metadata.");t.value=ae.getKey(n,ot(e||{}))}const s=function(){return i(),De.update(n,ot(e||{}))};return i(),{state:r,update:s}}function ot(n){return typeof n=="function"?n():n}const Te=new class{constructor(){this.store=o.reactive([])}add(e,t,r={}){const i=fr(r),s=new pr(e,t,i.timeout,i.children,i.click);return this.store.push(s),i.timeout&&setTimeout(this.remove.bind(this,s.id),i.timeout*1e3),s}remove(e){const t=this.store.findIndex(r=>r.id===e);if(t===-1)return!1;this.store.splice(t,1)}};function fr(n){function e(r){return!!r&&typeof r=="object"}const t={timeout:10,click:()=>null,children:[]};return e(n)?{timeout:n.timeout||t.timeout,click:n.click||t.click,children:n.children||t.children}:t}const Ct=class bt{constructor(e,t,r,i,s){this.type=e,this.message=t,this.timeout=r,this.children=i,this.click=s,this.id=bt.cardId++}};Ct.cardId=1;let pr=Ct;class hr extends R{constructor(e){super(),this.name="Communication",this.read=()=>{},this.id=e}sendMessage(e){return ir(this.id,e)}static checkAndGenerate(e,t,r){return rr(e,t,r).then(i=>i.length===0?nr(e,t,r):i[0])}}function gr(){return V().emit("client:read",{})}var kt=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},yr=(n,e,t)=>(kt(n,e,"read from private field"),t?t.call(n):e.get(n)),mr=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},Er=(n,e,t,r)=>(kt(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ge;const Ne=class J extends R{constructor(){super(...arguments),this.type="front",this.organizations=[],mr(this,ge,!1)}set language(e){localStorage.setItem(C.LOCALSTORAGE_LANGUAGE_KEY,e)}get language(){return localStorage.getItem(C.LOCALSTORAGE_LANGUAGE_KEY)||J.DEFAULT_LANGUAGE}get contextType(){var e;if(this.contextId)return((e=this.person)==null?void 0:e.id)===this.contextId?"person":"organization"}get isBack(){return this.type==="back"}get isFront(){return this.type==="front"}set ready(e){Er(this,ge,e),this.emit(J.EVENT_READY_UPDATE,e)}get ready(){return yr(this,ge)}onReady(e){return this.on(J.EVENT_READY_UPDATE,e)}onupdateContext(e){return this.on(J.EVENT_CONTEXT_UPDATE,e)}setCurrentContext(e){if(this.contextId===e)return console.warn("[application-manager] The current context has already been installed.");this.contextId=Number(e),localStorage.setItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY,String(e)),this.emit(J.EVENT_CONTEXT_UPDATE,e),console.log(`Current context id %c${e}`,"color: purple")}get context(){var e;return this.contextId?this.contextId===((e=this.person)==null?void 0:e.id)?this.person:this.organizations.find(t=>t.id===this.contextId)||null:null}async init(){try{const e=await this.loadCustomerData();this.person=e,this.organizations=e.organizations,this.userId=e.userId,this.restoreCurrentContext(),this.ready=!0}catch(e){K()(e)}}restoreCurrentContext(){const e=Number.parseInt(localStorage.getItem(C.LOCALSTORAGE_CURRENT_CONTEXT_KEY)||"");if(!Number.isNaN(e)&&this.validateContextId(Number(e)))this.setCurrentContext(e);else{if(!this.person)return console.warn("Make sure you call ID recovery after saving user data");this.setCurrentContext(this.person.id)}}loadCustomerData(){return gr()}validateContextId(e){var t;try{return((t=this.person)==null?void 0:t.id)==e?!0:!!this.organizations.find(r=>r.id===e)}catch{return!1}}};ge=new WeakMap;Ne.DEFAULT_LANGUAGE="en";Ne.EVENT_CONTEXT_UPDATE="event:context-update";Ne.EVENT_READY_UPDATE="event:ready-update";let wr=Ne;function vr(n){return typeof n!="object"||n===null?!1:!!(n.hasOwnProperty("start")||n.hasOwnProperty("end"))}function I(n){return Object.keys(n).reduce((e,t)=>{const r=n[t];if(Array.isArray(r)){const i=r.map(s=>typeof s=="string"?`'${s}'`:s).join(", ");return r.length&&e.push(`@${t} in (${i})`),e}if(vr(r)){let i=function(s){var l;return((l=s.match(/([^Z]*)/))==null?void 0:l[0])+"0000Z"};return r.start&&e.push(`@${t} ge ${i(r.start)}`),r.end&&e.push(`@${t} le ${i(r.end)}`),e}return typeof r=="number"?(e.push(`@${t} eq ${r}`),e):typeof r=="string"?(r.length!==0&&e.push(`@${t} eq '${r}'`),e):(r===null&&e.push(I.is(t,r)),e)},[]).join(" and ")}function ce(n){return typeof n=="string"?`'${n}'`:`${n}`}I.includes=function(e,t){return`@${e} Contains ${ce(t)}`};I.beginWith=function(e,t){return`@${e} BeginWith ${ce(t)}`};I.notEq=function(e,t){return`@${e} nq ${ce(t)}`};I.eq=function(e,t){return Array.isArray(t)?I.in(e,t):`@${e} eq ${ce(t)}`};I.in=function(e,t){const r=t.map(ce).join(", ");return`@${e} in (${r})`};I.and=function(...e){return e.join(" and ")};I.is=function(e,t){return`@${e} is ${t}`};I.or=function(...e){return e.join(" or ")};const O=new wr,De=new ae;class _r{static get url(){return"/close-api/metadata"}static async get(e,t,r){console.warn("GETTING METADATA BY DEPRECATED METHOD."),console.trace();const i=new URLSearchParams;return t&&i.append("criteria",t),r&&i.append("id",String(r)),await H(this.url+`/${e}?${i.toString()}`,{method:"GET"})}static getById(e,t,r=[]){const i=new URLSearchParams;return we(i,r),t&&i.append("id",t),H([this.url,e].join("/")+`?${i.toString()}`)}static getFieldInformation(e,t){return H(`/open-api/metadata/${e}/fields/${t}`)}static getTreatmentListField(e,t){return H(`/open-api/metadata/${e}/list-fields/${t}`)}}class Tr{static async upload(e,t){const r=new FormData;r.append("file",e);const i=`/close-api/files?entityName=${t}`;return await fetch(i,{method:"POST",body:r}).then(s=>s.json()).then(s=>(s.filename=e.name,s))}}class Sr{static invite(e,t,r){return h("/close-api/accounts/invitePerson",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({organizationId:e,personKey:t,relatedRoleCode:r})})}static accept(e,t){return h("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!0})})}static decline(e,t){return h("/close-api/accounts/markInvite",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({invitationId:e,version:t,mark:!1})})}}class je{static get url(){return"/close-api/rules-validation/"}static validate(e,t){return h(je.url+e,{method:"POST",body:JSON.stringify(t)})}}class Cr{static getConfiguration(){return h("/open-api/webserver-configuration",{method:"GET",headers:{"Content-Type":"application/json"}})}}class br{static url(){return"/close-api/actions"}static async get({criterion:e}){const t=new URLSearchParams;return e&&t.append("criterion",e),await fetch(this.url()+`?${t.toString()}`,{method:"GET"}).then(r=>r.json())}static getById(e,t,r=[]){const i=new URLSearchParams;return we(i,r),H([this.url(),e,t].join("/")+`?${i.toString()}`,{method:"GET"})}}function kr(n,e="images"){return`/static-folder/${e}/${n}`}class Ar{static getRequiredDocuments(e,t,r){const i=new URLSearchParams({entity:e,primaryKey:t,statusCode:r});return fetch(`/close-api/views/required-documents?${i.toString()}`).then(s=>s.json())}}class X{static url(){return"close-api/billing"}static getBillingMetadata(e){return fetch(`/${X.url()}/calculator/${e}`)}static calculate(e,t){return h(`/${X.url()}/calculator`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({entity:e,values:t})}).then(r=>{if(r&&r.status===1)return r;throw Array.isArray(r.notes)?new Error(r.notes[0]):B.ApiNotAvailable()})}static parseMetadataField(e){function t(r){switch(r.type){case"ValueType":switch(r.dataType){case"Integer":return"number";default:return r.dataType}case"EntityReference":return r.dataType}}return{name:e.name,label:e.title,required:e.required,type:t(e)}}static createOnlinePayment(e,t){return h(`/${X.url()}/online-payment`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({paymentId:e,returnURL:t})})}static applyOnlinePayment(e){return h(`/${X.url()}/online-payment`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({response:e})})}}class Nr{static getListSettings(e,t){const r=new URLSearchParams;r.set("entity",e),t&&r.set("mark",t);const i=`/close-api/views/list/configs?${r.toString()}`;return h(i)}}var At=(n,e,t)=>{if(!e.has(n))throw TypeError("Cannot "+t)},D=(n,e,t)=>(At(n,e,"read from private field"),t?t.call(n):e.get(n)),j=(n,e,t)=>{if(e.has(n))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(n):e.set(n,t)},q=(n,e,t,r)=>(At(n,e,"write to private field"),r?r.call(n,t):e.set(n,t),t),ye,re,me,Ee,ie,oe,xe;const G="_______LIST_______ROW_______INDEX________NAME_______",Oe=class x extends R{constructor(e){super(),this.LIST_ROW_KEY=1,j(this,ye,void 0),this.array=[],j(this,re,[]),j(this,me,[]),j(this,Ee,new Proxy({},{set:(t,r,i,s)=>(t[r]=i,this.emit(x.EVENT_FILTERS_UPDATE,t),!0),deleteProperty:(t,r)=>(delete t[r],this.emit(x.EVENT_FILTERS_UPDATE,t),!0)})),j(this,ie,!1),j(this,oe,(...t)=>Promise),j(this,xe,()=>{}),q(this,ye,e.primaryKeys||[]),this.name=e.name||void 0,e.config&&q(this,re,e.config)}set config(e){q(this,re,e.map(A.utils.copyObject)),this.emitUpdateConfig()}get config(){return D(this,re)}emitUpdateConfig(){this.emit(x.EVENT_CONFIG_UPDATE,this.config)}get order(){return D(this,me)}set order(e){q(this,me,e),this.emit(x.EVENT_ORDER_UPDATE,this.order)}get filters(){return D(this,Ee)}set filters(e){Ir(D(this,Ee),e)}set wait(e){q(this,ie,e),this.emit(A.Form.EVENT_WAIT,D(this,ie))}get wait(){return D(this,ie)}get primaryKeys(){return D(this,ye)}at(e){return this.array[e%this.array.length]}atByKey(e){return this.array.find(t=>t[G]===e)}indexByKey(e){return this.array.findIndex(t=>t[G]===e)}static getKey(e){return e[G]}static hasKey(e){return typeof e!="object"||e===null?!1:Object.prototype.hasOwnProperty.call(e,G)}add(...e){const t=this.wrapArray(e);this.array.push(...t),this.emit(x.EVENT_DATA,this.array)}set(e){this.array=[],this.add(...e)}removeByKey(e){const t=this.indexByKey(e);t!==-1&&(this.array.splice(t,1),this.emit(x.EVENT_DATA,this.array))}updateByKey(e,t){const r=this.atByKey(e);r&&(Object.assign(r,t),this.emit(x.EVENT_DATA,this.array))}wrapArray(e){return e.map(this.wrapItem.bind(this))}wrapItem(e){return this.isWrapped(e)?e:{...e,[G]:this.LIST_ROW_KEY++}}isWrapped(e){return Object.prototype.hasOwnProperty.call(e,G)}set read(e){q(this,oe,e)}get read(){return(...e)=>Promise.resolve().then(()=>{const t=D(this,oe).call(this,...e);return this.wait=!0,t}).finally(()=>this.wait=!1)}set save(e){q(this,oe,e)}get save(){return()=>Promise.resolve().then(()=>this.wait=!0).then(()=>D(this,xe).call(this)).finally(()=>this.wait=!1)}static GetFieldNames(e){return e.reduce((t,r)=>(r.name&&(typeof r.name=="string"?t.push(r.name):t.push(...r.name)),t),[])}static mergeWithKey(e,t){return{...e,[G]:t}}static getCellName(e){return typeof e.name=="string"?e.name:Array.isArray(e.name)?e.name[0]:null}static getCellInfo(e,t){const r=x.getCellName(e),i=(()=>{let s=r?Se(t,r):null;return s===void 0&&(s=null),e.value?e.value(s,t):s})();return{name:r,value:i}}};ye=new WeakMap;re=new WeakMap;me=new WeakMap;Ee=new WeakMap;ie=new WeakMap;oe=new WeakMap;xe=new WeakMap;Oe.EVENT_DATA="list-data: update";Oe.EVENT_CONFIG_UPDATE="list-config:update";Oe.EVENT_ORDER_UPDATE="list-order:update";Oe.EVENT_FILTERS_UPDATE="list-filters:update";function Or(n){const e=o.ref(""),t=o.computed(()=>{const r=e.value.toLowerCase();return o.unref(n).filter(i=>e.value.length?Object.values(i).join().toLowerCase().includes(r):!0)});return{search:e,searchArray:t}}function Ir(n,e){Object.keys(n).forEach(t=>delete n[t]),Object.entries(e).forEach(([t,r])=>{n[t]=r})}function $r(n){const e=o.reactive([]);function t(a){return e.includes(a)}function r(a){t(a)||e.push(a)}function i(a){const c=e.findIndex(u=>u===a);c!==-1&&e.splice(c,1)}function s(a){const c=o.unref(n);if(a===void 0){e.length===0?c.forEach(r):c.forEach(i);return}t(a)?i(a):r(a)}const l=o.computed(()=>{const a=o.unref(n);return e.length===a.length&&a.length!==0});return[e,s,l,r,i]}function Lr(n){return n.statusName==="Completed"}function Rr(n){return n.statusName==="FinalStepWithConfirmation"}function Pr(n){return n.statusName==="ValidationError"}function Dr(n,e,t){let r=null;const i=o.reactive({wait:null});let s=[],l=null;const a=o.ref(null);function c(){a.value=s.find(f=>f.name===l)||null}function u(){var f;return l?((f=s.find(w=>w.name===l))==null?void 0:f.fields)||[]:[]}function p(f){if(c(),Pr(f))return void t.onValidation(f.validationResults);if((f.statusName==="FinalStep"||f.statusName==="NextStep")&&(!u().length||xr(u(),t.presets)))return m(t.presets||{});Lr(f)&&t.onCompleted(f),Rr(f)&&t.onConfirmation(f)}async function _(){try{await y(),await d()}catch(f){const{message:w}=ve(f);Te.add("error",w)}}function y(){return i.wait="Loading process information.",he.getStartConfig(e,n).then(f=>{s=f.steps.map(w=>({label:w.title,name:w.stepName,number:w.number,fields:w.frontendEntity.objectTypes.reduce(($,F)=>(F.properties.forEach(N=>{$.push({name:N.name,label:N.title,type:N.refEntityName||N.dataType})}),$),[])}))}).then(f=>(i.wait=!1,f))}function g(f){return l=f.nextStepName,r=f.token,f}function E(f){const w=ve(f);Te.add("error",w.message)}function d(){return i.wait="Starting process",he.startProcess(e,n).then(g).then(p).catch(E).finally(()=>{i.wait=null})}function m(f={}){return!r||!l?Promise.reject("Not step or token."):(i.wait="Expect the result",he.runStep(e,n,l,r,f).then(g).then(p).catch(E).finally(()=>{i.wait=!1}))}return{initialize:_,state:i,currentStepConfig:o.readonly(a),next:m}}function xr(n,e){for(let t=0;t<n.length;t++){const r=n[t];if(!A.utils.getPropFromObject(e,r.name))return!1}return!0}const Br="close-api/proxy/Equipment/Search";class Vr{static search(e,t,r,i,s){const l=new URLSearchParams;l.append("pattern",e||""),t&&l.append("categoryId",t),r&&l.append("useType",String(r)),i&&l.append("statusCode",i),s&&(l.append("limit",String(s.limit)),l.append("offset",String(s.offset)));const a=`/${Br}?${l.toString()}`;return h(a,{method:"GET",headers:{"Content-Type":"application/json"}})}}const Ur={clickOutside:Ce,staticLink:kr},Mr={usage:Rt,utils:Wt,config:jt,types:qt};exports.Communication=hr;exports.CoreError=B;exports.Filter=I;exports.Manager=O;exports.NotificationSystem=Te;exports.WidgetButton=mn;exports.WidgetIcon=ke;exports.WidgetImage=Nn;exports.WidgetList=Fn;exports.WidgetLoader=kn;exports.WidgetMultiButton=Sn;exports.WidgetSpinner=Ae;exports.WidgetTable=pn;exports.actionService=br;exports.asyncProcess=Wn;exports.authService=S;exports.billingService=X;exports.catchUniversal=K;exports.clickOutside=Ce;exports.clientService=lt;exports.communicationService=Qt;exports.configurationService=Nr;exports.constants=C;exports.dataService=se;exports.debounce=Yn;exports.default=Mr;exports.documentsService=Ar;exports.equipmentService=Vr;exports.fileService=Tr;exports.getCellValue=Et;exports.getNamesFromListConfig=qn;exports.groupArrayByField=Gn;exports.historyService=Gt;exports.internationalizationService=zt;exports.invitationService=Sr;exports.metadataService=_r;exports.openService=Cr;exports.parseError=ve;exports.prettyDate=Me;exports.prettyDateWithTime=wt;exports.prettyMoney=_t;exports.prettyValueFieldByEntity=Hn;exports.processWizardService=he;exports.request=H;exports.ruleValidationService=je;exports.t=Q;exports.throttle=Tt;exports.universalEntityRead=_e;exports.universalEntityUpdate=Fe;exports.useCommunication=sr;exports.useFormEntity=ar;exports.useListActiveRow=Xn;exports.useListEntity=er;exports.useListSearch=Or;exports.useListSelect=$r;exports.useLogger=Yt;exports.useManagerState=tr;exports.useMetadata=dr;exports.useSocket=V;exports.useWizard=Dr;exports.utils=Ur;exports.uuidv4=zn;exports.valuesToUpperCase=We;exports.viewService=Zt;
11
11
  //# sourceMappingURL=eservices-core.cjs.js.map