@ibiz-template/vue3-components 0.7.41-alpha.61 → 0.7.41-alpha.62
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.
- package/dist/ibiz-markdown-editor-D-5gnej5.js +1 -0
- package/dist/{index-B3bLnxuY.js → index-DFk7mzuZ.js} +2 -2
- package/dist/index.min.css +1 -1
- package/dist/index.system.min.js +1 -1
- package/dist/{wang-editor-CA-ztFOO.js → wang-editor-BdJ2v_6e.js} +1 -1
- package/dist/{xlsx-util-CrgXlRhs.js → xlsx-util-C4If0XV-.js} +1 -1
- package/es/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.css +1 -1
- package/es/control/tree/tree.css +1 -1
- package/es/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.mjs +4 -1
- package/es/editor/markdown/ibiz-markdown-editor/render-util.mjs +9 -0
- package/lib/control/form/form-detail/form-mdctrl/form-mdctrl-repeater/repeater-grid/repeater-grid.css +1 -1
- package/lib/control/tree/tree.css +1 -1
- package/lib/editor/markdown/ibiz-markdown-editor/ibiz-markdown-editor.cjs +4 -1
- package/lib/editor/markdown/ibiz-markdown-editor/render-util.cjs +9 -0
- package/package.json +5 -5
- package/dist/ibiz-markdown-editor-uRNoNVHw.js +0 -1
|
@@ -5,7 +5,7 @@ System.register(["vue","@ibiz-template/vue3-util","@ibiz-template/core","@ibiz-t
|
|
|
5
5
|
* @author owenm <owen23355@gmail.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
*/
|
|
8
|
-
function Wm(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,n)}return a}function Ym(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Wm(Object(a),!0).forEach(function(t){Xm(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Wm(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function Km(e){return Km="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Km(e)}function Xm(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function $m(){return $m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},$m.apply(this,arguments)}function Jm(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function Qm(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var Zm=Qm(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ev=Qm(/Edge/i),tv=Qm(/firefox/i),av=Qm(/safari/i)&&!Qm(/chrome/i)&&!Qm(/android/i),nv=Qm(/iP(ad|od|hone)/i),iv=Qm(/chrome/i)&&Qm(/android/i),ov={capture:!1,passive:!1};function sv(e,t,a){e.addEventListener(t,a,!Zm&&ov)}function lv(e,t,a){e.removeEventListener(t,a,!Zm&&ov)}function rv(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function cv(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function dv(e,t,a,n){if(e){a=a||document;do{if(null!=t&&(">"===t[0]?e.parentNode===a&&rv(e,t):rv(e,t))||n&&e===a)return e;if(e===a)break}while(e=cv(e))}return null}var uv,hv=/\s+/g;function pv(e,t,a){if(e&&t)if(e.classList)e.classList[a?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(hv," ").replace(" "+t+" "," ");e.className=(n+(a?" "+t:"")).replace(hv," ")}}function mv(e,t,a){var n=e&&e.style;if(n){if(void 0===a)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(a=e.currentStyle),void 0===t?a:a[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=a+("string"==typeof a?"":"px")}}function vv(e,t){var a="";if("string"==typeof e)a=e;else do{var n=mv(e,"transform");n&&"none"!==n&&(a=n+" "+a)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(a)}function gv(e,t,a){if(e){var n=e.getElementsByTagName(t),i=0,o=n.length;if(a)for(;i<o;i++)a(n[i],i);return n}return[]}function bv(){var e=document.scrollingElement;return e||document.documentElement}function fv(e,t,a,n,i){if(e.getBoundingClientRect||e===window){var o,s,l,r,c,d,u;if(e!==window&&e.parentNode&&e!==bv()?(s=(o=e.getBoundingClientRect()).top,l=o.left,r=o.bottom,c=o.right,d=o.height,u=o.width):(s=0,l=0,r=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||a)&&e!==window&&(i=i||e.parentNode,!Zm))do{if(i&&i.getBoundingClientRect&&("none"!==mv(i,"transform")||a&&"static"!==mv(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(mv(i,"border-top-width")),l-=h.left+parseInt(mv(i,"border-left-width")),r=s+o.height,c=l+o.width;break}}while(i=i.parentNode);if(n&&e!==window){var p=vv(i||e),m=p&&p.a,v=p&&p.d;p&&(r=(s/=v)+(d/=v),c=(l/=m)+(u/=m))}return{top:s,left:l,bottom:r,right:c,width:u,height:d}}}function wv(e,t,a){for(var n=Sv(e,!0),i=fv(e)[t];n;){if(!(i>=fv(n)[a]))return n;if(n===bv())break;n=Sv(n,!1)}return!1}function yv(e,t,a,n){for(var i=0,o=0,s=e.children;o<s.length;){if("none"!==s[o].style.display&&s[o]!==kg.ghost&&(n||s[o]!==kg.dragged)&&dv(s[o],a.draggable,e,!1)){if(i===t)return s[o];i++}o++}return null}function Cv(e,t){for(var a=e.lastElementChild;a&&(a===kg.ghost||"none"===mv(a,"display")||t&&!rv(a,t));)a=a.previousElementSibling;return a||null}function Iv(e,t){var a=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===kg.clone||t&&!rv(e,t)||a++;return a}function xv(e){var t=0,a=0,n=bv();if(e)do{var i=vv(e),o=i.a,s=i.d;t+=e.scrollLeft*o,a+=e.scrollTop*s}while(e!==n&&(e=e.parentNode));return[t,a]}function Sv(e,t){if(!e||!e.getBoundingClientRect)return bv();var a=e,n=!1;do{if(a.clientWidth<a.scrollWidth||a.clientHeight<a.scrollHeight){var i=mv(a);if(a.clientWidth<a.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||a.clientHeight<a.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!a.getBoundingClientRect||a===document.body)return bv();if(n||t)return a;n=!0}}}while(a=a.parentNode);return bv()}function Ev(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function Dv(e,t){return function(){if(!uv){var a=arguments;1===a.length?e.call(this,a[0]):e.apply(this,a),uv=setTimeout(function(){uv=void 0},t)}}}function Pv(e,t,a){e.scrollLeft+=t,e.scrollTop+=a}function kv(e){var t=window.Polymer,a=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):a?a(e).clone(!0)[0]:e.cloneNode(!0)}function zv(e,t,a){var n={};return Array.from(e.children).forEach(function(i){var o,s,l,r;if(dv(i,t.draggable,e,!1)&&!i.animated&&i!==a){var c=fv(i);n.left=Math.min(null!==(o=n.left)&&void 0!==o?o:1/0,c.left),n.top=Math.min(null!==(s=n.top)&&void 0!==s?s:1/0,c.top),n.right=Math.max(null!==(l=n.right)&&void 0!==l?l:-1/0,c.right),n.bottom=Math.max(null!==(r=n.bottom)&&void 0!==r?r:-1/0,c.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Tv="Sortable"+(new Date).getTime();function Av(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(e){if("none"!==mv(e,"display")&&e!==kg.ghost){t.push({target:e,rect:fv(e)});var a=Ym({},t[t.length-1].rect);if(e.thisAnimationDuration){var n=vv(e,!0);n&&(a.top-=n.f,a.left-=n.e)}e.fromRect=a}})},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var a in e)if(e.hasOwnProperty(a))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[a][n])return Number(a);return-1}(t,{target:e}),1)},animateAll:function(a){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof a&&a());var i=!1,o=0;t.forEach(function(e){var t=0,a=e.target,s=a.fromRect,l=fv(a),r=a.prevFromRect,c=a.prevToRect,d=e.rect,u=vv(a,!0);u&&(l.top-=u.f,l.left-=u.e),a.toRect=l,a.thisAnimationDuration&&Ev(r,l)&&!Ev(s,l)&&(d.top-l.top)/(d.left-l.left)===(s.top-l.top)/(s.left-l.left)&&(t=function(e,t,a,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))*n.animation}(d,r,c,n.options)),Ev(l,s)||(a.prevFromRect=s,a.prevToRect=l,t||(t=n.options.animation),n.animate(a,d,l,t)),t&&(i=!0,o=Math.max(o,t),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout(function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null},t),a.thisAnimationDuration=t)}),clearTimeout(e),i?e=setTimeout(function(){"function"==typeof a&&a()},o):"function"==typeof a&&a(),t=[]},animate:function(e,t,a,n){if(n){mv(e,"transition",""),mv(e,"transform","");var i=vv(this.el),o=i&&i.a,s=i&&i.d,l=(t.left-a.left)/(o||1),r=(t.top-a.top)/(s||1);e.animatingX=!!l,e.animatingY=!!r,mv(e,"transform","translate3d("+l+"px,"+r+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),mv(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),mv(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){mv(e,"transition",""),mv(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},n)}}}}var Ov=[],Mv={initializeByDefault:!0},Nv={mount:function(e){for(var t in Mv)Mv.hasOwnProperty(t)&&!(t in e)&&(e[t]=Mv[t]);Ov.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Ov.push(e)},pluginEvent:function(e,t,a){var n=this;this.eventCanceled=!1,a.cancel=function(){n.eventCanceled=!0};var i=e+"Global";Ov.forEach(function(n){t[n.pluginName]&&(t[n.pluginName][i]&&t[n.pluginName][i](Ym({sortable:t},a)),t.options[n.pluginName]&&t[n.pluginName][e]&&t[n.pluginName][e](Ym({sortable:t},a)))})},initializePlugins:function(e,t,a,n){for(var i in Ov.forEach(function(n){var i=n.pluginName;if(e.options[i]||n.initializeByDefault){var o=new n(e,t,e.options);o.sortable=e,o.options=e.options,e[i]=o,$m(a,o.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var o=this.modifyOption(e,i,e.options[i]);void 0!==o&&(e.options[i]=o)}},getEventProperties:function(e,t){var a={};return Ov.forEach(function(n){"function"==typeof n.eventProperties&&$m(a,n.eventProperties.call(t[n.pluginName],e))}),a},modifyOption:function(e,t,a){var n;return Ov.forEach(function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(n=i.optionListeners[t].call(e[i.pluginName],a))}),n}};var Bv=["evt"],Lv=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=a.evt,i=Jm(a,Bv);Nv.pluginEvent.bind(kg)(e,t,Ym({dragEl:_v,parentEl:jv,ghostEl:Vv,rootEl:Fv,nextEl:Uv,lastDownEl:Hv,cloneEl:qv,cloneHidden:Gv,dragStarted:ig,putSortable:Jv,activeSortable:kg.active,originalEvent:n,oldIndex:Wv,oldDraggableIndex:Kv,newIndex:Yv,newDraggableIndex:Xv,hideGhostForTarget:Sg,unhideGhostForTarget:Eg,cloneNowHidden:function(){Gv=!0},cloneNowShown:function(){Gv=!1},dispatchSortableEvent:function(e){Rv({sortable:t,name:e,originalEvent:n})}},i))};function Rv(e){!function(e){var t=e.sortable,a=e.rootEl,n=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,l=e.fromEl,r=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t=t||a&&a[Tv]){var v,g=t.options,b="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||Zm||ev?(v=document.createEvent("Event")).initEvent(n,!0,!0):v=new CustomEvent(n,{bubbles:!0,cancelable:!0}),v.to=s||a,v.from=l||a,v.item=i||a,v.clone=o,v.oldIndex=r,v.newIndex=c,v.oldDraggableIndex=d,v.newDraggableIndex=u,v.originalEvent=h,v.pullMode=p?p.lastPutMode:void 0;var f=Ym(Ym({},m),Nv.getEventProperties(n,t));for(var w in f)v[w]=f[w];a&&a.dispatchEvent(v),g[b]&&g[b].call(t,v)}}(Ym({putSortable:Jv,cloneEl:qv,targetEl:_v,rootEl:Fv,oldIndex:Wv,oldDraggableIndex:Kv,newIndex:Yv,newDraggableIndex:Xv},e))}var _v,jv,Vv,Fv,Uv,Hv,qv,Gv,Wv,Yv,Kv,Xv,$v,Jv,Qv,Zv,eg,tg,ag,ng,ig,og,sg,lg,rg,cg=!1,dg=!1,ug=[],hg=!1,pg=!1,mg=[],vg=!1,gg=[],bg="undefined"!=typeof document,fg=nv,wg=ev||Zm?"cssFloat":"float",yg=bg&&!iv&&!nv&&"draggable"in document.createElement("div"),Cg=function(){if(bg){if(Zm)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Ig=function(e,t){var a=mv(e),n=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),i=yv(e,0,t),o=yv(e,1,t),s=i&&mv(i),l=o&&mv(o),r=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+fv(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+fv(o).width;if("flex"===a.display)return"column"===a.flexDirection||"column-reverse"===a.flexDirection?"vertical":"horizontal";if("grid"===a.display)return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!o||"both"!==l.clear&&l.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||r>=n&&"none"===a[wg]||o&&"none"===a[wg]&&r+c>n)?"vertical":"horizontal"},xg=function(e){function t(e,a){return function(n,i,o,s){var l=n.options.group.name&&i.options.group.name&&n.options.group.name===i.options.group.name;if(null==e&&(a||l))return!0;if(null==e||!1===e)return!1;if(a&&"clone"===e)return e;if("function"==typeof e)return t(e(n,i,o,s),a)(n,i,o,s);var r=(a?n:i).options.group.name;return!0===e||"string"==typeof e&&e===r||e.join&&e.indexOf(r)>-1}}var a={},n=e.group;n&&"object"==Km(n)||(n={name:n}),a.name=n.name,a.checkPull=t(n.pull,!0),a.checkPut=t(n.put),a.revertClone=n.revertClone,e.group=a},Sg=function(){!Cg&&Vv&&mv(Vv,"display","none")},Eg=function(){!Cg&&Vv&&mv(Vv,"display","")};bg&&!iv&&document.addEventListener("click",function(e){if(dg)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),dg=!1,!1},!0);var Dg=function(e){if(_v){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,o=e.clientY,ug.some(function(e){var t=e[Tv].options.emptyInsertThreshold;if(t&&!Cv(e)){var a=fv(e),n=i>=a.left-t&&i<=a.right+t,l=o>=a.top-t&&o<=a.bottom+t;return n&&l?s=e:void 0}}),s);if(t){var a={};for(var n in e)e.hasOwnProperty(n)&&(a[n]=e[n]);a.target=a.rootEl=t,a.preventDefault=void 0,a.stopPropagation=void 0,t[Tv]._onDragOver(a)}}var i,o,s},Pg=function(e){_v&&_v.parentNode[Tv]._isOutsideThisEl(e.target)};function kg(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$m({},t),e[Tv]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ig(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==kg.supportPointer&&"PointerEvent"in window&&(!av||nv),emptyInsertThreshold:5};for(var n in Nv.initializePlugins(this,e,a),a)!(n in t)&&(t[n]=a[n]);for(var i in xg(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&yg,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?sv(e,"pointerdown",this._onTapStart):(sv(e,"mousedown",this._onTapStart),sv(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(sv(e,"dragover",this),sv(e,"dragenter",this)),ug.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$m(this,Av())}function zg(e,t,a,n,i,o,s,l){var r,c,d=e[Tv],u=d.options.onMove;return!window.CustomEvent||Zm||ev?(r=document.createEvent("Event")).initEvent("move",!0,!0):r=new CustomEvent("move",{bubbles:!0,cancelable:!0}),r.to=t,r.from=e,r.dragged=a,r.draggedRect=n,r.related=i||t,r.relatedRect=o||fv(t),r.willInsertAfter=l,r.originalEvent=s,e.dispatchEvent(r),u&&(c=u.call(d,r,s)),c}function Tg(e){e.draggable=!1}function Ag(){vg=!1}function Og(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,a=t.length,n=0;a--;)n+=t.charCodeAt(a);return n.toString(36)}function Mg(e){return setTimeout(e,0)}function Ng(e){return clearTimeout(e)}kg.prototype={constructor:kg,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(og=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,_v):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,a=this.el,n=this.options,i=n.preventOnFilter,o=e.type,s=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(s||e).target,r=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=n.filter;if(function(e){gg.length=0;var t=e.getElementsByTagName("input"),a=t.length;for(;a--;){var n=t[a];n.checked&&gg.push(n)}}(a),!_v&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||n.disabled)&&!r.isContentEditable&&(this.nativeDraggable||!av||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=dv(l,n.draggable,a,!1))&&l.animated||Hv===l)){if(Wv=Iv(l),Kv=Iv(l,n.draggable),"function"==typeof c){if(c.call(this,e,l,this))return Rv({sortable:t,rootEl:r,name:"filter",targetEl:l,toEl:a,fromEl:a}),Lv("filter",t,{evt:e}),void(i&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(n){if(n=dv(r,n.trim(),a,!1))return Rv({sortable:t,rootEl:n,name:"filter",targetEl:l,fromEl:a,toEl:a}),Lv("filter",t,{evt:e}),!0})))return void(i&&e.preventDefault());n.handle&&!dv(r,n.handle,a,!1)||this._prepareDragStart(e,s,l)}}},_prepareDragStart:function(e,t,a){var n,i=this,o=i.el,s=i.options,l=o.ownerDocument;if(a&&!_v&&a.parentNode===o){var r=fv(a);if(Fv=o,jv=(_v=a).parentNode,Uv=_v.nextSibling,Hv=a,$v=s.group,kg.dragged=_v,Qv={target:_v,clientX:(t||e).clientX,clientY:(t||e).clientY},ag=Qv.clientX-r.left,ng=Qv.clientY-r.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,_v.style["will-change"]="all",n=function(){Lv("delayEnded",i,{evt:e}),kg.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!tv&&i.nativeDraggable&&(_v.draggable=!0),i._triggerDragStart(e,t),Rv({sortable:i,name:"choose",originalEvent:e}),pv(_v,s.chosenClass,!0))},s.ignore.split(",").forEach(function(e){gv(_v,e.trim(),Tg)}),sv(l,"dragover",Dg),sv(l,"mousemove",Dg),sv(l,"touchmove",Dg),s.supportPointer?(sv(l,"pointerup",i._onDrop),!this.nativeDraggable&&sv(l,"pointercancel",i._onDrop)):(sv(l,"mouseup",i._onDrop),sv(l,"touchend",i._onDrop),sv(l,"touchcancel",i._onDrop)),tv&&this.nativeDraggable&&(this.options.touchStartThreshold=4,_v.draggable=!0),Lv("delayStart",this,{evt:e}),!s.delay||s.delayOnTouchOnly&&!t||this.nativeDraggable&&(ev||Zm))n();else{if(kg.eventCanceled)return void this._onDrop();s.supportPointer?(sv(l,"pointerup",i._disableDelayedDrag),sv(l,"pointercancel",i._disableDelayedDrag)):(sv(l,"mouseup",i._disableDelayedDrag),sv(l,"touchend",i._disableDelayedDrag),sv(l,"touchcancel",i._disableDelayedDrag)),sv(l,"mousemove",i._delayedDragTouchMoveHandler),sv(l,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&sv(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(n,s.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){_v&&Tg(_v),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;lv(e,"mouseup",this._disableDelayedDrag),lv(e,"touchend",this._disableDelayedDrag),lv(e,"touchcancel",this._disableDelayedDrag),lv(e,"pointerup",this._disableDelayedDrag),lv(e,"pointercancel",this._disableDelayedDrag),lv(e,"mousemove",this._delayedDragTouchMoveHandler),lv(e,"touchmove",this._delayedDragTouchMoveHandler),lv(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?sv(document,"pointermove",this._onTouchMove):sv(document,t?"touchmove":"mousemove",this._onTouchMove):(sv(_v,"dragend",this),sv(Fv,"dragstart",this._onDragStart));try{document.selection?Mg(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(cg=!1,Fv&&_v){Lv("dragStarted",this,{evt:t}),this.nativeDraggable&&sv(document,"dragover",Pg);var a=this.options;!e&&pv(_v,a.dragClass,!1),pv(_v,a.ghostClass,!0),kg.active=this,e&&this._appendGhost(),Rv({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Zv){this._lastX=Zv.clientX,this._lastY=Zv.clientY,Sg();for(var e=document.elementFromPoint(Zv.clientX,Zv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Zv.clientX,Zv.clientY))!==t;)t=e;if(_v.parentNode[Tv]._isOutsideThisEl(e),t)do{if(t[Tv]){if(t[Tv]._onDragOver({clientX:Zv.clientX,clientY:Zv.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=cv(t));Eg()}},_onTouchMove:function(e){if(Qv){var t=this.options,a=t.fallbackTolerance,n=t.fallbackOffset,i=e.touches?e.touches[0]:e,o=Vv&&vv(Vv,!0),s=Vv&&o&&o.a,l=Vv&&o&&o.d,r=fg&&rg&&xv(rg),c=(i.clientX-Qv.clientX+n.x)/(s||1)+(r?r[0]-mg[0]:0)/(s||1),d=(i.clientY-Qv.clientY+n.y)/(l||1)+(r?r[1]-mg[1]:0)/(l||1);if(!kg.active&&!cg){if(a&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<a)return;this._onDragStart(e,!0)}if(Vv){o?(o.e+=c-(eg||0),o.f+=d-(tg||0)):o={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");mv(Vv,"webkitTransform",u),mv(Vv,"mozTransform",u),mv(Vv,"msTransform",u),mv(Vv,"transform",u),eg=c,tg=d,Zv=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Vv){var e=this.options.fallbackOnBody?document.body:Fv,t=fv(_v,!0,fg,!0,e),a=this.options;if(fg){for(rg=e;"static"===mv(rg,"position")&&"none"===mv(rg,"transform")&&rg!==document;)rg=rg.parentNode;rg!==document.body&&rg!==document.documentElement?(rg===document&&(rg=bv()),t.top+=rg.scrollTop,t.left+=rg.scrollLeft):rg=bv(),mg=xv(rg)}pv(Vv=_v.cloneNode(!0),a.ghostClass,!1),pv(Vv,a.fallbackClass,!0),pv(Vv,a.dragClass,!0),mv(Vv,"transition",""),mv(Vv,"transform",""),mv(Vv,"box-sizing","border-box"),mv(Vv,"margin",0),mv(Vv,"top",t.top),mv(Vv,"left",t.left),mv(Vv,"width",t.width),mv(Vv,"height",t.height),mv(Vv,"opacity","0.8"),mv(Vv,"position",fg?"absolute":"fixed"),mv(Vv,"zIndex","100000"),mv(Vv,"pointerEvents","none"),kg.ghost=Vv,e.appendChild(Vv),mv(Vv,"transform-origin",ag/parseInt(Vv.style.width)*100+"% "+ng/parseInt(Vv.style.height)*100+"%")}},_onDragStart:function(e,t){var a=this,n=e.dataTransfer,i=a.options;Lv("dragStart",this,{evt:e}),kg.eventCanceled?this._onDrop():(Lv("setupClone",this),kg.eventCanceled||((qv=kv(_v)).removeAttribute("id"),qv.draggable=!1,qv.style["will-change"]="",this._hideClone(),pv(qv,this.options.chosenClass,!1),kg.clone=qv),a.cloneId=Mg(function(){Lv("clone",a),kg.eventCanceled||(a.options.removeCloneOnHide||Fv.insertBefore(qv,_v),a._hideClone(),Rv({sortable:a,name:"clone"}))}),!t&&pv(_v,i.dragClass,!0),t?(dg=!0,a._loopId=setInterval(a._emulateDragOver,50)):(lv(document,"mouseup",a._onDrop),lv(document,"touchend",a._onDrop),lv(document,"touchcancel",a._onDrop),n&&(n.effectAllowed="move",i.setData&&i.setData.call(a,n,_v)),sv(document,"drop",a),mv(_v,"transform","translateZ(0)")),cg=!0,a._dragStartId=Mg(a._dragStarted.bind(a,t,e)),sv(document,"selectstart",a),ig=!0,window.getSelection().removeAllRanges(),av&&mv(document.body,"user-select","none"))},_onDragOver:function(e){var t,a,n,i,o=this.el,s=e.target,l=this.options,r=l.group,c=kg.active,d=$v===r,u=l.sort,h=Jv||c,p=this,m=!1;if(!vg){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=dv(s,l.draggable,o,!0),z("dragOver"),kg.eventCanceled)return m;if(_v.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return A(!1);if(dg=!1,c&&!l.disabled&&(d?u||(n=jv!==Fv):Jv===this||(this.lastPutMode=$v.checkPull(this,c,_v,e))&&r.checkPut(this,c,_v,e))){if(i="vertical"===this._getDirection(e,s),t=fv(_v),z("dragOverValid"),kg.eventCanceled)return m;if(n)return jv=Fv,T(),this._hideClone(),z("revert"),kg.eventCanceled||(Uv?Fv.insertBefore(_v,Uv):Fv.appendChild(_v)),A(!0);var v=Cv(o,l.draggable);if(!v||function(e,t,a){var n=fv(Cv(a.el,a.options.draggable)),i=zv(a.el,a.options,Vv),o=10;return t?e.clientX>i.right+o||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>i.bottom+o||e.clientX>n.right&&e.clientY>n.top}(e,i,this)&&!v.animated){if(v===_v)return A(!1);if(v&&o===e.target&&(s=v),s&&(a=fv(s)),!1!==zg(Fv,o,_v,t,s,a,e,!!s))return T(),v&&v.nextSibling?o.insertBefore(_v,v.nextSibling):o.appendChild(_v),jv=o,O(),A(!0)}else if(v&&function(e,t,a){var n=fv(yv(a.el,0,a.options,!0)),i=zv(a.el,a.options,Vv),o=10;return t?e.clientX<i.left-o||e.clientY<n.top&&e.clientX<n.right:e.clientY<i.top-o||e.clientY<n.bottom&&e.clientX<n.left}(e,i,this)){var g=yv(o,0,l,!0);if(g===_v)return A(!1);if(a=fv(s=g),!1!==zg(Fv,o,_v,t,s,a,e,!1))return T(),o.insertBefore(_v,g),jv=o,O(),A(!0)}else if(s.parentNode===o){a=fv(s);var b,f,w,y=_v.parentNode!==o,C=!function(e,t,a){var n=a?e.left:e.top,i=a?e.right:e.bottom,o=a?e.width:e.height,s=a?t.left:t.top,l=a?t.right:t.bottom,r=a?t.width:t.height;return n===s||i===l||n+o/2===s+r/2}(_v.animated&&_v.toRect||t,s.animated&&s.toRect||a,i),I=i?"top":"left",x=wv(s,"top","top")||wv(_v,"top","top"),S=x?x.scrollTop:void 0;if(og!==s&&(f=a[I],hg=!1,pg=!C&&l.invertSwap||y),b=function(e,t,a,n,i,o,s,l){var r=n?e.clientY:e.clientX,c=n?a.height:a.width,d=n?a.top:a.left,u=n?a.bottom:a.right,h=!1;if(!s)if(l&&lg<c*i){if(!hg&&(1===sg?r>d+c*o/2:r<u-c*o/2)&&(hg=!0),hg)h=!0;else if(1===sg?r<d+lg:r>u-lg)return-sg}else if(r>d+c*(1-i)/2&&r<u-c*(1-i)/2)return function(e){return Iv(_v)<Iv(e)?1:-1}(t);if((h=h||s)&&(r<d+c*o/2||r>u-c*o/2))return r>d+c/2?1:-1;return 0}(e,s,a,i,C?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,pg,og===s),0!==b){var E=Iv(_v);do{E-=b,w=jv.children[E]}while(w&&("none"===mv(w,"display")||w===Vv))}if(0===b||w===s)return A(!1);og=s,sg=b;var D=s.nextElementSibling,P=!1,k=zg(Fv,o,_v,t,s,a,e,P=1===b);if(!1!==k)return 1!==k&&-1!==k||(P=1===k),vg=!0,setTimeout(Ag,30),T(),P&&!D?o.appendChild(_v):s.parentNode.insertBefore(_v,P?D:s),x&&Pv(x,0,S-x.scrollTop),jv=_v.parentNode,void 0===f||pg||(lg=Math.abs(f-fv(s)[I])),O(),A(!0)}if(o.contains(_v))return A(!1)}return!1}function z(l,r){Lv(l,p,Ym({evt:e,isOwner:d,axis:i?"vertical":"horizontal",revert:n,dragRect:t,targetRect:a,canSort:u,fromSortable:h,target:s,completed:A,onMove:function(a,n){return zg(Fv,o,_v,t,a,fv(a),e,n)},changed:O},r))}function T(){z("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function A(t){return z("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(p),p!==h&&(pv(_v,Jv?Jv.options.ghostClass:c.options.ghostClass,!1),pv(_v,l.ghostClass,!0)),Jv!==p&&p!==kg.active?Jv=p:p===kg.active&&Jv&&(Jv=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){z("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===_v&&!_v.animated||s===o&&!s.animated)&&(og=null),l.dragoverBubble||e.rootEl||s===document||(_v.parentNode[Tv]._isOutsideThisEl(e.target),!t&&Dg(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function O(){Yv=Iv(_v),Xv=Iv(_v,l.draggable),Rv({sortable:p,name:"change",toEl:o,newIndex:Yv,newDraggableIndex:Xv,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){lv(document,"mousemove",this._onTouchMove),lv(document,"touchmove",this._onTouchMove),lv(document,"pointermove",this._onTouchMove),lv(document,"dragover",Dg),lv(document,"mousemove",Dg),lv(document,"touchmove",Dg)},_offUpEvents:function(){var e=this.el.ownerDocument;lv(e,"mouseup",this._onDrop),lv(e,"touchend",this._onDrop),lv(e,"pointerup",this._onDrop),lv(e,"pointercancel",this._onDrop),lv(e,"touchcancel",this._onDrop),lv(document,"selectstart",this)},_onDrop:function(e){var t=this.el,a=this.options;Yv=Iv(_v),Xv=Iv(_v,a.draggable),Lv("drop",this,{evt:e}),jv=_v&&_v.parentNode,Yv=Iv(_v),Xv=Iv(_v,a.draggable),kg.eventCanceled||(cg=!1,pg=!1,hg=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ng(this.cloneId),Ng(this._dragStartId),this.nativeDraggable&&(lv(document,"drop",this),lv(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),av&&mv(document.body,"user-select",""),mv(_v,"transform",""),e&&(ig&&(e.cancelable&&e.preventDefault(),!a.dropBubble&&e.stopPropagation()),Vv&&Vv.parentNode&&Vv.parentNode.removeChild(Vv),(Fv===jv||Jv&&"clone"!==Jv.lastPutMode)&&qv&&qv.parentNode&&qv.parentNode.removeChild(qv),_v&&(this.nativeDraggable&&lv(_v,"dragend",this),Tg(_v),_v.style["will-change"]="",ig&&!cg&&pv(_v,Jv?Jv.options.ghostClass:this.options.ghostClass,!1),pv(_v,this.options.chosenClass,!1),Rv({sortable:this,name:"unchoose",toEl:jv,newIndex:null,newDraggableIndex:null,originalEvent:e}),Fv!==jv?(Yv>=0&&(Rv({rootEl:jv,name:"add",toEl:jv,fromEl:Fv,originalEvent:e}),Rv({sortable:this,name:"remove",toEl:jv,originalEvent:e}),Rv({rootEl:jv,name:"sort",toEl:jv,fromEl:Fv,originalEvent:e}),Rv({sortable:this,name:"sort",toEl:jv,originalEvent:e})),Jv&&Jv.save()):Yv!==Wv&&Yv>=0&&(Rv({sortable:this,name:"update",toEl:jv,originalEvent:e}),Rv({sortable:this,name:"sort",toEl:jv,originalEvent:e})),kg.active&&(null!=Yv&&-1!==Yv||(Yv=Wv,Xv=Kv),Rv({sortable:this,name:"end",toEl:jv,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Lv("nulling",this),Fv=_v=jv=Vv=Uv=qv=Hv=Gv=Qv=Zv=ig=Yv=Xv=Wv=Kv=og=sg=Jv=$v=kg.dragged=kg.ghost=kg.clone=kg.active=null,gg.forEach(function(e){e.checked=!0}),gg.length=eg=tg=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":_v&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],a=this.el.children,n=0,i=a.length,o=this.options;n<i;n++)dv(e=a[n],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||Og(e));return t},sort:function(e,t){var a={},n=this.el;this.toArray().forEach(function(e,t){var i=n.children[t];dv(i,this.options.draggable,n,!1)&&(a[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){a[e]&&(n.removeChild(a[e]),n.appendChild(a[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return dv(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var a=this.options;if(void 0===t)return a[e];var n=Nv.modifyOption(this,e,t);a[e]=void 0!==n?n:t,"group"===e&&xg(a)},destroy:function(){Lv("destroy",this);var e=this.el;e[Tv]=null,lv(e,"mousedown",this._onTapStart),lv(e,"touchstart",this._onTapStart),lv(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(lv(e,"dragover",this),lv(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),ug.splice(ug.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Gv){if(Lv("hideClone",this),kg.eventCanceled)return;mv(qv,"display","none"),this.options.removeCloneOnHide&&qv.parentNode&&qv.parentNode.removeChild(qv),Gv=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(Gv){if(Lv("showClone",this),kg.eventCanceled)return;_v.parentNode!=Fv||this.options.group.revertClone?Uv?Fv.insertBefore(qv,Uv):Fv.appendChild(qv):Fv.insertBefore(qv,_v),this.options.group.revertClone&&this.animate(_v,qv),mv(qv,"display",""),Gv=!1}}else this._hideClone()}},bg&&sv(document,"touchmove",function(e){(kg.active||cg)&&e.cancelable&&e.preventDefault()}),kg.utils={on:sv,off:lv,css:mv,find:gv,is:function(e,t){return!!dv(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);return e},throttle:Dv,closest:dv,toggleClass:pv,clone:kv,index:Iv,nextTick:Mg,cancelNextTick:Ng,detectDirection:Ig,getChild:yv,expando:Tv},kg.get=function(e){return e[Tv]},kg.mount=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(kg.utils=Ym(Ym({},kg.utils),e.utils)),Nv.mount(e)})},kg.create=function(e,t){return new kg(e,t)},kg.version="1.15.6";var Bg,Lg,Rg,_g,jg,Vg,Fg=[],Ug=!1;function Hg(){Fg.forEach(function(e){clearInterval(e.pid)}),Fg=[]}function qg(){clearInterval(Vg)}var Gg=Dv(function(e,t,a,n){if(t.scroll){var i,o=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,l=t.scrollSensitivity,r=t.scrollSpeed,c=bv(),d=!1;Lg!==a&&(Lg=a,Hg(),Bg=t.scroll,i=t.scrollFn,!0===Bg&&(Bg=Sv(a,!0)));var u=0,h=Bg;do{var p=h,m=fv(p),v=m.top,g=m.bottom,b=m.left,f=m.right,w=m.width,y=m.height,C=void 0,I=void 0,x=p.scrollWidth,S=p.scrollHeight,E=mv(p),D=p.scrollLeft,P=p.scrollTop;p===c?(C=w<x&&("auto"===E.overflowX||"scroll"===E.overflowX||"visible"===E.overflowX),I=y<S&&("auto"===E.overflowY||"scroll"===E.overflowY||"visible"===E.overflowY)):(C=w<x&&("auto"===E.overflowX||"scroll"===E.overflowX),I=y<S&&("auto"===E.overflowY||"scroll"===E.overflowY));var k=C&&(Math.abs(f-o)<=l&&D+w<x)-(Math.abs(b-o)<=l&&!!D),z=I&&(Math.abs(g-s)<=l&&P+y<S)-(Math.abs(v-s)<=l&&!!P);if(!Fg[u])for(var T=0;T<=u;T++)Fg[T]||(Fg[T]={});Fg[u].vx==k&&Fg[u].vy==z&&Fg[u].el===p||(Fg[u].el=p,Fg[u].vx=k,Fg[u].vy=z,clearInterval(Fg[u].pid),0==k&&0==z||(d=!0,Fg[u].pid=setInterval(function(){n&&0===this.layer&&kg.active._onTouchMove(jg);var t=Fg[this.layer].vy?Fg[this.layer].vy*r:0,a=Fg[this.layer].vx?Fg[this.layer].vx*r:0;"function"==typeof i&&"continue"!==i.call(kg.dragged.parentNode[Tv],a,t,e,jg,Fg[this.layer].el)||Pv(Fg[this.layer].el,a,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&h!==c&&(h=Sv(h,!1)));Ug=d}},30),Wg=function(e){var t=e.originalEvent,a=e.putSortable,n=e.dragEl,i=e.activeSortable,o=e.dispatchSortableEvent,s=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var r=a||i;s();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);l(),r&&!r.el.contains(d)&&(o("spill"),this.onSpill({dragEl:n,putSortable:a}))}};function Yg(){}function Kg(){}function Xg(e,t){let a=[],n=1;const i=o([]),s=e=>{n=1,a=null!=e?e:[],i.value=a.slice(0,t)};s(e);return{renderItems:i,loadMore:()=>{if(i.value.length>=a.length)return;n+=1;const e=(n-1)*t,o=n*t;i.value.push(...a.slice(e,o))},updateTotalItems:s}}function $g(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}Yg.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,a=e.putSortable;this.sortable.captureAnimationState(),a&&a.captureAnimationState();var n=yv(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(t,n):this.sortable.el.appendChild(t),this.sortable.animateAll(),a&&a.animateAll()},drop:Wg},$m(Yg,{pluginName:"revertOnSpill"}),Kg.prototype={onSpill:function(e){var t=e.dragEl,a=e.putSortable||this.sortable;a.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),a.animateAll()},drop:Wg},$m(Kg,{pluginName:"removeOnSpill"}),kg.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?sv(document,"dragover",this._handleAutoScroll):this.options.supportPointer?sv(document,"pointermove",this._handleFallbackAutoScroll):t.touches?sv(document,"touchmove",this._handleFallbackAutoScroll):sv(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?lv(document,"dragover",this._handleAutoScroll):(lv(document,"pointermove",this._handleFallbackAutoScroll),lv(document,"touchmove",this._handleFallbackAutoScroll),lv(document,"mousemove",this._handleFallbackAutoScroll)),qg(),Hg(),clearTimeout(uv),uv=void 0},nulling:function(){jg=Lg=Bg=Ug=Vg=Rg=_g=null,Fg.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var a=this,n=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,o=document.elementFromPoint(n,i);if(jg=e,t||this.options.forceAutoScrollFallback||ev||Zm||av){Gg(e,this.options,o,t);var s=Sv(o,!0);!Ug||Vg&&n===Rg&&i===_g||(Vg&&qg(),Vg=setInterval(function(){var o=Sv(document.elementFromPoint(n,i),!0);o!==s&&(s=o,Hg()),Gg(e,a.options,o,t)},10),Rg=n,_g=i)}else{if(!this.options.bubbleScroll||Sv(o,!0)===bv())return void Hg();Gg(e,this.options,Sv(o,!1),!1)}}},$m(e,{pluginName:"scroll",initializeByDefault:!0})}),kg.mount(Kg,Yg);const Jg=a({name:"IBizRepeaterGrid",props:{controller:{type:gn,required:!0}},emits:{change:e=>!0},setup(e,{emit:t}){var a,s;const l=B("repeater-grid"),r=[],d=o(),p=o(go()),m=(null==(a=e.controller.model.ctrlParams)?void 0:a.chunkSize)?Number(null==(s=e.controller.model.ctrlParams)?void 0:s.chunkSize):100,{renderItems:v,loadMore:g,updateTotalItems:b}=Xg(e.controller.value,m);qt(e.controller.repeatedForm,e=>{var t;"FORMITEM"===e.detailType&&"HIDDEN"!==(null==(t=e.editor)?void 0:t.editorType)&&r.push(e)},{childrenFields:["deformPages","deformTabPages","deformDetails"]});const f=pe(),w=u([]),y=async(a={})=>{const n=new bn(e.controller.repeatedForm,e.controller.context,e.controller.params,f);n.state.isSimple=!0,await n.created(),n.setSimpleData(a),w.push(n),e.controller.setRepeaterController("".concat(w.length-1),n),n.evt.on("onFormDataChange",a=>{const i=a.data[0];((a,n)=>{const i=[...e.controller.value];i[n]=a,t("change",i)})(i instanceof ma?i.clone():{...i},w.indexOf(n))})};let C;c(()=>e.controller.value,e=>{e&&e.length>0&&(e.forEach((e,t)=>{const a=w[t];if(a){const t=e||{};Object.keys(a.data).find(e=>t[e]!==a.data[e])&&a.setSimpleData(t)}else y(e)}),e.length<w.length&&w.forEach((t,a)=>{a>=e.length&&(t.state.isLoaded=!1)})),b(e||[])},{immediate:!0,deep:!0});c(()=>d.value,()=>{e.controller.enableSort&&(d.value?(()=>{var t,a;const n=null==(a=null==(t=d.value)?void 0:t.$el)?void 0:a.querySelector(".el-table__body-wrapper tbody");n&&e.controller.enableSort&&(C=kg.create(n,{animation:150,handle:".".concat(l.e("drag-icon")),ghostClass:"".concat(l.e("sortable-ghost")),onEnd({newIndex:t,oldIndex:a}){e.controller.dragChange(a,t),p.value=go()}}))})():null==C||C.destroy())}),h(()=>null==C?void 0:C.destroy());return{ns:l,tableRef:d,tableKey:p,formItems:r,renderItems:v,formControllers:w,renderRemoveBtn:t=>{let a;return e.controller.enableDelete?ibiz.config.form.mdCtrlConfirmBeforeRemove?n(i("el-popconfirm"),{title:Tt(ibiz.i18n.t("control.form.repeaterGrid.promptInformation")),"confirm-button-text":ibiz.i18n.t("app.confirm"),"cancel-button-text":ibiz.i18n.t("app.cancel"),onConfirm:()=>e.controller.remove(t)},{reference:()=>{let e;return n(i("el-button"),{text:!0,type:"danger",class:[l.be("index","remove")]},$g(e=ibiz.i18n.t("app.delete"))?e:{default:()=>[e]})}}):n(i("el-button"),{text:!0,type:"danger",class:[l.be("index","remove")],onClick:()=>e.controller.remove(t)},$g(a=ibiz.i18n.t("app.delete"))?a:{default:()=>[a]}):null},loadMore:g}},render(){var e;let t;const a=null==(e=this.controller.model.layoutPos)?void 0:e.height,o=a?{height:a}:{};return n("div",{class:this.ns.b()},[this.controller.enableCreate&&n(i("el-button"),{class:this.ns.e("add-btn"),onClick:()=>{this.controller.create()}},$g(t=ibiz.i18n.t("app.add"))?t:{default:()=>[t]}),n(i("el-table"),y({ref:"tableRef",key:this.tableKey,"show-header":!0,class:this.ns.e("table"),data:this.renderItems,"cell-class-name":({columnIndex:e})=>(this.controller.enableSort?1===e:0===e)?this.ns.b("index"):""},o),{default:()=>[this.controller.enableSort&&n(i("el-table-column"),{width:26,type:"default"},{default:()=>n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:this.ns.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])])}),n(i("el-table-column"),{type:"index",width:66,align:"center"},{default:e=>{const{$index:t}=e;return this.controller.enableDelete?[this.renderRemoveBtn(t),n("span",{class:this.ns.be("index","text")},[t+1])]:n("span",null,[t+1])}}),this.formItems.length>0&&this.formItems.map(e=>{const t=e.labelWidth;let a="width",o="";return"number"==typeof t&&(1===t&&(a="min-width"),o="".concat(t,"px")),n(i("el-table-column"),y({label:e.caption,prop:e.id},{[a]:o},{align:"center"}),{default:t=>{const{$index:a}=t,o=k(this.formControllers[a]);if(!o||!o.state.isLoaded)return n("div",null,[ibiz.i18n.t("control.form.repeaterGrid.absentOrLoad")]);const s=o.formItems.find(t=>t.name===e.id);let r=null;if(s.editorProvider){const e=i(s.editorProvider.formEditor);r=l(e,{value:s.value,data:s.data,controller:s.editor,disabled:s.state.disabled,readonly:s.state.readonly,onChange:(e,t)=>{s.setDataValue(e,t)}})}else r=n(i("not-supported-editor"),{modelData:e.editor},null);return n(i("iBizGridEditItem"),{error:s.state.error,required:s.state.required},$g(r)?r:{default:()=>[r]})}})})],append:()=>[a&&b(n("div",{"infinite-scroll-distance":20},null),[[C("infinite-scroll"),()=>this.loadMore()]])]})])}});const Qg=a({name:"IBizRepeaterGrid2",props:{controller:{type:gn,required:!0}},emits:{change:e=>!0},setup(e,{emit:t}){var a,s;const l=B("repeater-grid2"),r=[],d=o(),p=o(go()),m=(null==(a=e.controller.model.ctrlParams)?void 0:a.chunkSize)?Number(null==(s=e.controller.model.ctrlParams)?void 0:s.chunkSize):100,{renderItems:v,loadMore:g,updateTotalItems:b}=Xg(e.controller.value,m);qt(e.controller.repeatedForm,e=>{var t;"FORMITEM"===e.detailType&&"HIDDEN"!==(null==(t=e.editor)?void 0:t.editorType)&&r.push(e)},{childrenFields:["deformPages","deformTabPages","deformDetails"]});const f=pe(),w=u([]),y=async(a={})=>{const n=new bn(e.controller.repeatedForm,e.controller.context,e.controller.params,f);n.state.isSimple=!0,await n.created(),n.setSimpleData(a),w.push(n),e.controller.setRepeaterController("".concat(w.length-1),n),n.evt.on("onFormDataChange",a=>{const i=a.data[0];((a,n)=>{const i=[...e.controller.value||[]];i[n]=a,t("change",i)})(i instanceof ma?i.clone():{...i},w.indexOf(n))})};let C;c(()=>e.controller.value,e=>{e&&e.length>0&&e.forEach((e,t)=>{const a=w[t];if(a){const t=e||{};Object.keys(a.data).find(e=>t[e]!==a.data[e])&&a.setSimpleData(t)}else y(e)}),b(e||[])},{immediate:!0,deep:!0});c(()=>d.value,()=>{e.controller.enableSort&&(d.value?(()=>{var t,a;const n=null==(a=null==(t=d.value)?void 0:t.$el)?void 0:a.querySelector(".el-table__body-wrapper tbody");n&&e.controller.enableSort&&(C=kg.create(n,{animation:150,handle:".".concat(l.e("drag-icon")),ghostClass:"".concat(l.e("sortable-ghost")),onEnd({newIndex:t,oldIndex:a}){e.controller.dragChange(a,t),p.value=go()}}))})():null==C||C.destroy())}),h(()=>null==C?void 0:C.destroy());return{ns:l,tableRef:d,tableKey:p,formItems:r,renderItems:v,formControllers:w,renderRemoveBtn:t=>ibiz.config.form.mdCtrlConfirmBeforeRemove?n(i("el-popconfirm"),{title:ibiz.i18n.t("control.form.repeaterGrid.promptInformation"),"confirm-button-text":ibiz.i18n.t("app.confirm"),"cancel-button-text":ibiz.i18n.t("app.cancel"),onConfirm:()=>{e.controller.remove(t),w.splice(t,1)}},{reference:()=>n("ion-icon",{name:"remove-outline",title:ibiz.i18n.t("app.delete"),class:l.b("remove-btn")},null)}):n("ion-icon",{name:"remove-outline",title:ibiz.i18n.t("app.delete"),class:l.b("remove-btn"),onClick:()=>{e.controller.remove(t),w.splice(t,1)}},null),loadMore:g}},render(){var e;const t=null==(e=this.controller.model.layoutPos)?void 0:e.height,a=t?{height:t}:{},o=0===this.renderItems.length;return n("div",{class:this.ns.b()},[n(i("el-table"),y({ref:"tableRef",key:this.tableKey,"show-header":!0,class:this.ns.e("table"),data:o&&this.controller.enableCreate?[{}]:this.renderItems,"cell-class-name":({columnIndex:e})=>(this.controller.enableSort?1===e:0===e)?this.ns.b("index"):""},a),{default:()=>[this.controller.enableSort&&n(i("el-table-column"),{width:26,type:"default"},{default:()=>o?"":n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:this.ns.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])])}),n(i("el-table-column"),{type:"index",width:66,align:"center"},{default:e=>{if(o)return"";const{$index:t}=e;return n("span",null,[t+1])}}),this.formItems.length>0&&this.formItems.map(e=>{const t=e.labelWidth;let a="width",r="";return"number"==typeof t&&(1===t&&(a="min-width"),r="".concat(t,"px")),n(i("el-table-column"),y({label:e.caption,prop:e.id},{[a]:r},{align:"center"}),{default:t=>{if(o)return"";const{$index:a}=t,r=k(this.formControllers[a]);if(!r||!r.state.isLoaded)return n("div",null,[ibiz.i18n.t("control.form.repeaterGrid.absentOrLoad")]);const c=r.formItems.find(t=>t.name===e.id);let d=null;if(c.editorProvider){const e=i(c.editorProvider.formEditor);d=l(e,{value:c.value,data:c.data,controller:c.editor,disabled:c.state.disabled,readonly:c.state.readonly,onChange:(e,t)=>{c.setDataValue(e,t)}})}else d=n(i("not-supported-editor"),{modelData:e.editor},null);return n(i("iBizGridEditItem"),{error:c.state.error,required:c.state.required},"function"==typeof(u=d)||"[object Object]"===Object.prototype.toString.call(u)&&!s(u)?d:{default:()=>[d]});var u}})}),(this.controller.enableCreate||this.controller.enableDelete)&&n(i("el-table-column"),{width:80,align:"center"},{default:e=>{const{$index:t}=e;return n("div",{class:this.ns.b("action-group")},[this.controller.enableCreate&&n("ion-icon",{name:"add-outline",title:ibiz.i18n.t("app.add"),class:this.ns.b("add-btn"),onClick:()=>{this.controller.create(o?0:t+1)}},null),this.controller.enableDelete&&!o&&this.renderRemoveBtn(t)])}})],append:()=>[t&&b(n("div",{"infinite-scroll-distance":20},null),[[C("infinite-scroll"),()=>this.loadMore()]])]})])}}),Zg=a({name:"IBizFormMDCtrlRepeater",props:{controller:{type:gn,required:!0}},setup:e=>({ns:B("form-mdctrl-repeater"),onDataChange:t=>{e.controller.setValue(t)}}),render(){var e;const t=[this.ns.b()];switch(this.controller.repeaterStyle){case"MultiForm":return n(Gm,{class:t,onChange:this.onDataChange,controller:this.controller},null);case"Grid":const a=null==(e=this.controller.model.ctrlParams)?void 0:e.gridStyle;return n("style2"===a?Qg:Jg,{class:t,controller:this.controller,onChange:this.onDataChange},null);case"SingleForm":return n(qm,{class:t,data:this.controller.value,controller:this.controller,onChange:this.onDataChange},null);default:return n("div",{class:t},[ibiz.i18n.t("control.form.formMDctrlRepeater.noSupportStyle",{repeaterStyle:this.controller.repeaterStyle})])}}});var eb=Object.defineProperty,tb=(e,t,a)=>(((e,t,a)=>{t in e?eb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ab{constructor(){tb(this,"component","IBizFormMDCtrl")}async createController(e,t,a){let n;switch(e.contentType){case"LIST":case"GRID":case"DATAVIEW":n=new vn(e,t,a);break;case"FORM":n=new mn(e,t,a);break;case"REPEATER":n=new gn(e,t,a);break;default:throw new Gt(e,"".concat(ibiz.i18n.t("control.form.formMDctrl.errorMessage",{contentType:e.contentType})))}return await n.init(),n}}function nb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const ib=a({name:"IBizMDCtrlContainer",components:{draggable:is},props:{enableCreate:{type:Boolean,required:!0},enableDelete:{type:Boolean,required:!0},items:{type:Object,required:!0},userStyle:{type:String},enableSort:{type:Boolean,required:!1}},emits:{addClick:()=>!0,removeClick:(e,t)=>!0,dragChange:(e,t)=>!0},setup(e,{emit:t,slots:a}){const o=B("mdctrl-container"),s=o.be("item","icon-drag"),l=r(()=>e.enableCreate||e.enableDelete),c=r(()=>[...e.items]),d=()=>n("div",{class:[s]},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])])]),u=()=>{let e;return n(i("el-button"),{class:[o.be("item-actions","create"),o.be("item-actions","btn")],onClick:()=>t("addClick")},nb(e=ibiz.i18n.t("app.add"))?e:{default:()=>[e]})},h=(a,s)=>{let l;return e.enableDelete?ibiz.config.form.mdCtrlConfirmBeforeRemove?n(i("el-popconfirm"),{title:Tt(ibiz.i18n.t("control.form.mdCtrlContainer.promptInformation")),"confirm-button-text":ibiz.i18n.t("app.confirm"),"cancel-button-text":ibiz.i18n.t("app.cancel"),onConfirm:()=>t("removeClick",a,s)},{reference:()=>{let e;return n(i("el-button"),{type:"danger",class:[o.be("item-actions","remove"),o.be("item-actions","btn")]},nb(e=ibiz.i18n.t("app.delete"))?e:{default:()=>[e]})}}):n(i("el-button"),{type:"danger",class:[o.be("item-actions","remove"),o.be("item-actions","btn")],onClick:()=>t("removeClick",a,s)},nb(l=ibiz.i18n.t("app.delete"))?l:{default:()=>[l]}):null};return{ns:o,showActions:l,dragClssName:s,dragItems:c,renderDragBtn:d,renderAddBtn:u,renderDefaultItem:(t,i)=>{const s=a.item?a.item({data:t,index:i}):n("div",null,[ibiz.i18n.t("control.form.mdCtrlContainer.noSlot")]);return n("div",{class:o.b("item")},[n("div",{class:o.be("item","left")},[e.enableSort&&d()]),s,h(t,i),e.enableCreate&&n("div",{class:o.be("item","right")},[0===i&&u()])])},renderRemoveBtn:h,renderStyle2AddBtn:()=>n(i("el-button"),{class:[o.be("style2-item-actions","create"),o.be("style2-item-actions","btn")],title:ibiz.i18n.t("app.add"),onClick:()=>t("addClick")},{default:()=>[n("ion-icon",{name:"add-outline"},null),ibiz.i18n.t("app.add")]}),renderStyle2RemoveBtn:(a,s)=>{let l;return e.enableDelete?ibiz.config.form.mdCtrlConfirmBeforeRemove?n(i("el-popconfirm"),{title:Tt(ibiz.i18n.t("control.form.mdCtrlContainer.promptInformation")),"confirm-button-text":ibiz.i18n.t("app.confirm"),"cancel-button-text":ibiz.i18n.t("app.cancel"),onConfirm:()=>t("removeClick",a,s)},{reference:()=>n(i("el-button"),{type:"danger",class:[o.be("style2-item-actions","remove"),o.be("style2-item-actions","btn")],title:ibiz.i18n.t("app.delete")},{default:()=>[n("ion-icon",{name:"trash-outline"},null)]})}):n(i("el-button"),{type:"danger",class:[o.be("item-actions","remove"),o.be("item-actions","btn")],onClick:()=>t("removeClick",a,s)},nb(l=ibiz.i18n.t("app.delete"))?l:{default:()=>[l]}):null},handleDragChange:e=>{const{moved:a}=e,n=a.oldIndex,i=a.newIndex;t("dragChange",n,i)}}},render(){var e,t;if("STYLE2"===this.userStyle)return n("div",{class:[this.ns.b(),this.ns.b("style2")]},[(null==(e=this.items)?void 0:e.length)?n("div",{class:this.ns.e("item-container")},[this.showActions&&this.enableCreate&&this.renderStyle2AddBtn(),this.items.map((e,t)=>{const a=this.$slots.item?this.$slots.item({data:e,index:t}):n("div",null,[ibiz.i18n.t("control.form.mdCtrlContainer.noSlot")]);return n("div",{class:this.ns.b("item")},[a,this.showActions&&n("div",{class:this.ns.b("style2-item-actions")},[this.renderStyle2RemoveBtn(e,t)])])})]):n("div",{class:this.ns.b("no-data")},[this.enableCreate&&n("div",{class:this.ns.b("style2-item-actions")},[this.renderStyle2AddBtn()])])]);let a;return(null==(t=this.items)?void 0:t.length)&&(a=this.enableSort?n(is,{itemKey:"id",ref:"container",list:this.dragItems,class:[this.ns.e("drag")],handle:".".concat(this.dragClssName),onChange:this.handleDragChange,chosenClass:this.ns.is("drag-chosen",!0)},{item:({element:e,index:t})=>this.renderDefaultItem(e,t)}):this.items.map((e,t)=>this.renderDefaultItem(e,t))),n("div",{class:this.ns.b()},[a||n("div",{class:this.ns.b("no-data")},[this.enableCreate&&n("div",{class:this.ns.b("item-actions")},[this.renderAddBtn()])])])}}),ob=a({name:"IBizMDCtrlContainer2",components:{draggable:is},props:{controller:{type:mn,required:!0},items:{type:Array,default:()=>[]}},setup(e){const t=B("mdctrl-container2"),a=o("");c(()=>e.items,()=>{var t;a.value||(a.value=(null==(t=e.items[0])?void 0:t.id)||"")},{immediate:!0});const n=o(""),i=o(),s=o(!1),l=o(!1),r=o(!0);let u;const p=()=>{if(i.value){const e=i.value.$el;e&&(s.value=e.scrollLeft>0,l.value=e.scrollLeft<e.scrollWidth-e.offsetWidth,r.value=e.offsetWidth>e.scrollWidth)}};d(()=>{i.value&&i.value.$el&&(u=new ResizeObserver(e=>{e.forEach(()=>{p()})}),u.observe(i.value.$el))}),h(()=>{u&&u.disconnect()});return{ns:t,currentItem:a,draggingKey:n,container:i,isShowLeftArrow:s,isShowRightArrow:l,isShowBorder:r,handleSelect:(e,t)=>{e.stopPropagation(),a.value=t.id},handleAdd:t=>{var n;t.stopPropagation(),e.controller.create(),a.value=(null==(n=e.items[e.items.length-1])?void 0:n.id)||""},handleRemove:async(t,n)=>{var i;t.stopPropagation(),await e.controller.remove(n.id),a.value===n.id&&(a.value=(null==(i=e.items[0])?void 0:i.id)||""),p()},handleArrowClick:(e,a)=>{if(e.stopPropagation(),i.value){const e=i.value.$el;if(e){const n=Array.from(e.children||[]).find(e=>e.classList.contains(t.b("header-item")));if(n){const t=n.offsetWidth;"right"===a&&(e.scrollLeft+=t),"left"===a&&(e.scrollLeft-=t)}p()}}},handleDragStart:e=>{n.value=e.id},handleDragEnd:()=>{n.value="",e.controller.updateData(),p()}}},render(){return n("div",{class:this.ns.b()},[n("div",{class:[this.ns.b("header")]},[n(is,{ref:"container",class:[this.ns.b("header-content")],list:this.items,ghostClass:this.ns.bm("header-item","ghost"),itemKey:"id"},{item:({element:e})=>n("div",{class:[this.ns.b("header-item"),this.draggingKey&&this.ns.bm("header-item","dragging"),this.draggingKey===e.id&&this.ns.bm("header-item","drag"),this.currentItem===e.id&&this.ns.bm("header-item","active")],onDragstart:()=>{this.handleDragStart(e)},onDragend:()=>{this.handleDragEnd()},onClick:t=>{this.handleSelect(t,e)}},[n("div",{class:this.ns.be("header-item","drag-icon")},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])])]),n("div",{class:this.ns.be("header-item","text")},[e.title]),this.controller.enableDelete&&n("div",{class:this.ns.be("header-item","btn"),title:Tt(ibiz.i18n.t("app.delete")),onClick:t=>{this.handleRemove(t,e)}},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M4.002 3.403V1a1 1 0 0 1 1-1h6.003a1 1 0 0 1 1 1v2.403h3.396a.6.6 0 1 1 0 1.2h-1.395V15a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4.603H.6a.6.6 0 1 1 0-1.2h3.4zm8.804 1.205H3.2V14.8h9.605V4.608zM5.202 1.2v2.155h5.603V1.2H5.202zm.6 6.417a.6.6 0 0 1 1.201 0v4.758a.6.6 0 0 1-1.2 0V7.617zm3.202 0a.6.6 0 0 1 1.2 0v4.758a.6.6 0 0 1-1.2 0V7.617z"},null)])])])]),footer:()=>[this.controller.enableCreate&&n("div",{class:[this.ns.b("header-item"),!this.isShowBorder&&this.ns.bm("header-item","hidden-border")],onClick:e=>{this.handleAdd(e)}},[n("div",{class:this.ns.be("header-item","icon")},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M8.578 7.383V1.602a.601.601 0 1 0-1.2 0v5.781H1.6a.601.601 0 0 0 0 1.203h5.777v5.812a.601.601 0 1 0 1.2 0V8.586H14.4a.601.601 0 0 0 0-1.203H8.578z"},null)])])]),n("div",{class:this.ns.be("header-item","text")},[ibiz.i18n.t("app.add")])]),this.isShowLeftArrow&&n("div",{class:this.ns.b("header-left-arrow"),onClick:e=>{this.handleArrowClick(e,"left")}},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.028 10.976l5.951-5.952a.6.6 0 0 1 1.024.425V11.4a.6.6 0 0 1-.6.6H7.452a.6.6 0 0 1-.424-1.024z",transform:"scale(-1 1) rotate(-45 0 32.15)"},null)])])]),this.isShowRightArrow&&n("div",{class:this.ns.b("header-right-arrow"),onClick:e=>{this.handleArrowClick(e,"right")}},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M3.028 10.976l5.951-5.952a.6.6 0 0 1 1.024.425V11.4a.6.6 0 0 1-.6.6H3.452a.6.6 0 0 1-.424-1.024z",transform:"rotate(-45 6.003 8)"},null)])])])]})]),n("div",{class:this.ns.b("content")},[this.items.map(e=>{var t,a;return n("div",{key:e.id,class:this.ns.b("content-item"),style:{display:e.id!==this.currentItem?"none":""}},[null==(a=(t=this.$slots).item)?void 0:a.call(t,{data:e})])})])])}}),sb=e("K",ie(Vm,function(e){e.component(Vm.name,Vm),e.component(Fm.name,Fm),e.component(Hm.name,Hm),e.component(Zg.name,Zg),e.component(ib.name,ib),e.component(ob.name,ob),nn("MDCTRL",()=>new ab)}));const lb=a({name:"IBizFormRawItem",props:{modelData:{type:Object,required:!0},controller:{type:wn,required:!0}},setup(e){var t;const a=B("form-raw-item"),l=e.controller,d=o(""),u=r(()=>!(!e.controller.form.controlParams||"hover"!==e.controller.form.controlParams.editmode)),h="DESIGN"===(null==(t=l.context)?void 0:t.srfrunmode);return c(()=>l.data,async e=>{if(e){const t=l.model.rawItem;if(!t)return;let a="";const n={...e};"RAW"===t.contentType?a=t.caption:"HTML"===t.contentType&&(a=t.content),a&&t.templateMode&&(a=await ibiz.util.hbs.render(a.replaceAll("//n","\n"),Object.assign(n,{data:{...e}}))),d.value=a}},{immediate:!0}),{ns:a,content:d,showFormDefaultContent:u,isDesignPreview:h,renderPreviewContent:()=>{var t;let o;switch(null==(t=e.modelData.rawItem)?void 0:t.contentType){case"RAW":{const t=e.modelData.rawItem.caption||"";return n("div",{class:a.be("preview-content","raw")},[t])}case"HTML":{const t=e.modelData.rawItem.content||"";return n("div",{class:a.be("preview-content","html"),innerHTML:t},null)}case"IMAGE":return n("div",{class:a.be("preview-content","image")},[n("svg",{width:"56px",height:"56px",viewBox:"0 0 56 56",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[n("g",{transform:"translate(4.000000, 0.000000)",fill:"#8c8c8c","fill-rule":"nonzero"},[n("rect",{opacity:"0",x:"0",y:"0",width:"48",height:"48"},null),n("path",{d:"M43.5,7.5 L4.5,7.5 C3.6703125,7.5 3,8.1703125 3,9 L3,39 C3,39.8296875 3.6703125,40.5 4.5,40.5 L43.5,40.5 C44.3296875,40.5 45,39.8296875 45,39 L45,9 C45,8.1703125 44.3296875,7.5 43.5,7.5 Z M15.84375,14.25 C17.4984375,14.25 18.84375,15.5953125 18.84375,17.25 C18.84375,18.9046875 17.4984375,20.25 15.84375,20.25 C14.1890625,20.25 12.84375,18.9046875 12.84375,17.25 C12.84375,15.5953125 14.1890625,14.25 15.84375,14.25 Z M39.9328125,34.7390625 C39.8671875,34.7953125 39.778125,34.828125 39.6890625,34.828125 L8.30625,34.828125 C8.1,34.828125 7.93125,34.659375 7.93125,34.453125 C7.93125,34.3640625 7.9640625,34.2796875 8.0203125,34.209375 L16.003125,24.740625 C16.134375,24.58125 16.3734375,24.5625 16.5328125,24.69375 C16.546875,24.7078125 16.565625,24.721875 16.5796875,24.740625 L21.2390625,30.271875 L28.65,21.4828125 C28.78125,21.3234375 29.0203125,21.3046875 29.1796875,21.4359375 C29.19375,21.45 29.2125,21.4640625 29.2265625,21.4828125 L39.9890625,34.2140625 C40.1109375,34.36875 40.0921875,34.6078125 39.9328125,34.7390625 Z"},null)])])])]);case"VIDEO":return n("div",{class:a.be("preview-content","video")},[n("svg",{width:"56px",height:"56px",viewBox:"0 0 56 56",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[n("g",{transform:"translate(4.000000, 4.000000)","fill-rule":"nonzero"},[n("rect",{opacity:"0",x:"0",y:"0",width:"48",height:"48"},null),n("rect",{"stroke-width":"2",x:"5",y:"5",width:"38",height:"38",rx:"2",stroke:"#1890FF"},null),n("path",{d:"M19.842,16.7706563 L30.3061875,22.4005313 C31.4090625,22.993875 31.822125,24.369 31.2287812,25.4717812 C30.9959833,25.9045408 30.6289074,26.2499678 30.1828125,26.4560625 L19.7187188,31.290375 C18.5818125,31.8156563 17.2343438,31.3198125 16.7090625,30.1828125 C16.571335,29.8846905 16.5,29.560211 16.5,29.2318125 L16.5,18.767625 C16.5,17.5153125 17.5153125,16.5 18.767625,16.5 C19.142625,16.5 19.5118125,16.593 19.842,16.7706563 Z",fill:"#1890FF"},null)])])])]);case"PLACEHOLDER":return null;case"DIVIDER":return n(i("el-divider"),{class:a.be("preview-content","divider")},"function"==typeof(l=o=ibiz.i18n.t("control.form.formRawItem.dividerText"))||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?o:{default:()=>[o]});case"INFO":return n(i("el-alert"),{class:a.be("preview-content","info"),title:ibiz.i18n.t("control.form.formRawItem.infoText"),type:"info",closable:!1,"show-icon":!0},null);case"WARNING":return n(i("el-alert"),{class:a.be("preview-content","warning"),title:ibiz.i18n.t("control.form.formRawItem.warningText"),type:"warning",closable:!1,"show-icon":!0},null);case"ERROR":return n(i("el-alert"),{class:a.be("preview-content","error"),title:ibiz.i18n.t("control.form.formRawItem.errorText"),type:"error",closable:!1,"show-icon":!0},null);default:return n("div",{class:a.be("preview-content","default")},[ibiz.i18n.t("control.form.formRawItem.defaultText")])}var l}}},render(){var e;return this.controller.state.visible?this.isDesignPreview?n("div",{class:this.ns.b()},[n("div",{class:this.ns.b("preview-content")},[this.renderPreviewContent()])]):n(i("iBizRawItem"),{class:[this.ns.b(),...this.controller.containerClass,this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("form-text",["TEXT","RAW"].includes((null==(e=this.modelData.rawItem)?void 0:e.contentType)||""))],rawItem:this.modelData,content:this.content,onClick:e=>this.controller.onClick(e)},null):null}});var rb=Object.defineProperty,cb=(e,t,a)=>(((e,t,a)=>{t in e?rb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class db{constructor(){cb(this,"component","IBizFormRawItem")}async createController(e,t,a){const n=new wn(e,t,a);return await n.init(),n}}const ub=e("L",ie(lb,function(e){e.component(lb.name,lb),nn("RAWITEM",()=>new db)}));function hb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const pb=a({name:"IBizFormTabPanel",props:{modelData:{type:Object,required:!0},controller:{type:yn,required:!0}},setup(e){const t=B("form-tab-panel");he(e.controller);const a=o(!1),i=(t,a)=>{const n=e.controller.form.details[t];n&&n.onClick(a)};return{ns:t,popoverVisible:a,onTabClick:(t,a)=>{e.controller.onTabChange(t.props.name),i(t.props.name,a)},renderAllTabContent:()=>{var o;return n("div",{class:t.be("tab-panel-container-style2","content")},[null==(o=e.modelData.deformTabPages)?void 0:o.map(o=>n("div",{class:[t.be("tab-panel-container-style2","tab-item-content"),t.is("active",o.id===e.controller.state.activeTab)],onClick:t=>((t,n)=>{e.controller.selectTab(t),a.value=!1,i(t,n)})(o.codeName,t),title:o.caption},[o.caption]))])}}},render(){var e,t;let a;const o="STYLE2"===this.modelData.detailStyle,s=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],l=e=>n("span",{class:[this.ns.b("tab-item-content"),...e.labelClass]},[e.model.sysImage&&n(i("iBizIcon"),{icon:e.model.sysImage},null),e.model.showCaption&&e.model.caption]),r=b(n(i("el-tabs"),{class:[this.ns.b(),this.ns.m(this.modelData.codeName),this.modelData.detailStyle?this.ns.m(this.modelData.detailStyle.toLowerCase()):"",...this.controller.containerClass],"model-value":this.controller.state.activeTab,onTabClick:this.onTabClick},hb(a=s.map(e=>{const t=e.props;if(!t||!t.controller)return e;const a=t.controller;return a.state.visible||a.state.keepAlive?n(i("el-tab-pane"),{class:this.ns.b("tab-item"),label:a.model.caption,name:a.model.id,lazy:!0},{default:()=>e,label:()=>{let e;const t=a.model.counterId?this.controller.state.counterData[a.model.counterId]:void 0;return a.model.counterId?n(i("el-badge"),{class:[this.ns.e("badge"),this.ns.is("no-counter",!t&&0!==t||1===a.model.counterMode&&t<=0)],"data-value":t,value:t,hidden:!t&&0!==t||1===a.model.counterMode&&t<=0,max:99},hb(e=l(a))?e:{default:()=>[e]}):l(a)}}):null}))?a:{default:()=>[a]}),[[C("loading"),this.controller.state.loading&&!o]]);return"STYLE2"===this.modelData.detailStyle?b(n("div",{class:this.ns.b("tab-panel-container-style2")},[r,n(i("el-popover"),{trigger:"click",placement:"top-end",visible:this.popoverVisible,"onUpdate:visible":e=>this.popoverVisible=e,"popper-class":this.ns.be("tab-panel-container-style2","popover")},{reference:()=>n("div",{class:this.ns.be("tab-panel-container-style2","select")},[n("div",{class:this.ns.bem("tab-panel-container-style2","select","title")},[ibiz.i18n.t("control.form.formTabPnel.all")]),n("ion-icon",{name:"caret-down-outline"},null)]),default:()=>this.renderAllTabContent()})]),[[C("loading"),this.controller.state.loading]]):r}});var mb=Object.defineProperty,vb=(e,t,a)=>(((e,t,a)=>{t in e?mb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class gb{constructor(){vb(this,"component","IBizFormTabPanel")}async createController(e,t,a){const n=new yn(e,t,a);return await n.init(),n}}const bb=e("M",ie(pb,function(e){e.component(pb.name,pb),nn("TABPANEL",()=>new gb)}));function fb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const wb=a({name:"IBizFormTabPage",props:{modelData:{type:Object,required:!0},controller:{type:Cn,required:!0}},setup(e){const t=B("form-tab-page");return he(e.controller),{ns:t}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[];return b(n(i("iBizRow"),{class:[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],layout:this.modelData.layout,onClick:e=>this.controller.onClick(e)},fb(a=o.map(e=>{const t=e.props;if(!t||!t.controller)return e;const a=t.controller;return n(i("iBizCol"),{layoutPos:a.model.layoutPos,state:a.state},fb(e)?e:{default:()=>[e]})}))?a:{default:()=>[a]}),[[C("loading"),this.controller.state.loading]])}});var yb=Object.defineProperty,Cb=(e,t,a)=>(((e,t,a)=>{t in e?yb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ib{constructor(){Cb(this,"component","IBizFormTabPage")}async createController(e,t,a){const n=new Cn(e,t,a);return await n.init(),n}}const xb=e("N",ie(wb,function(e){e.component(wb.name,wb),nn("TABPAGE",()=>new Ib)}));var Sb=Object.defineProperty,Eb=(e,t,a)=>(((e,t,a)=>{t in e?Sb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Db{constructor(){Eb(this,"component","IBizFormButtonList")}async createController(e,t,a){const n=new In(e,t,a);return await n.init(),n}}const Pb=a({name:"IBizFormButtonList",props:{modelData:{type:Object,required:!0},controller:{type:In,required:!0}},setup(e){var t;const a=B("form-button-list"),n=e.controller,i="DESIGN"===(null==(t=n.context)?void 0:t.srfrunmode);return{ns:a,handleClick:async(e,t)=>{null==t||t.stopPropagation(),i||n.handleClick(e,t)}}},render(){const{state:e}=this.controller;return e.visible?n(i("iBizButtonList"),{class:[this.ns.b(),...this.controller.containerClass],model:this.modelData,disabled:e.disabled,buttonsState:e.buttonsState,onClick:this.handleClick},null):null}}),kb=e("O",ie(Pb,function(e){e.component(Pb.name,Pb),nn("BUTTONLIST",()=>new Db)})),zb=a({name:"IBizFormIFrame",props:{modelData:{type:Object,required:!0},controller:{type:xn,required:!0}},setup(e){const t=e.controller,a=B("form-iframe");he(t);const n=o(!0);return{ns:a,url:r(()=>t.calcIFrameUrl()),loading:n,onLoad:()=>{n.value=!1}}},render(){return this.controller.state.visible&&this.url?b(n("div",{class:this.ns.b()},[n("iframe",{class:this.ns.e("iframe"),src:this.url,frameborder:"0",onLoad:()=>this.onLoad(),onError:()=>this.onLoad()},null)]),[[C("loading"),this.loading]]):null}});var Tb=Object.defineProperty,Ab=(e,t,a)=>(((e,t,a)=>{t in e?Tb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ob{constructor(){Ab(this,"component","IBizFormIFrame")}async createController(e,t,a){const n=new xn(e,t,a);return await n.init(),n}}const Mb=e("P",ie(zb,function(e){e.component(zb.name,zb),nn("IFRAME",()=>new Ob)}));var Nb=Object.defineProperty,Bb=(e,t,a)=>(((e,t,a)=>{t in e?Nb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Lb{constructor(){Bb(this,"component","IBizEditFormControl")}}const Rb=a({name:"IBizEditFormControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},isSimple:{type:Boolean,required:!1},data:{type:Object,required:!1},loadDefault:{type:Boolean,default:!0},simpleDataIndex:{type:Number,required:!1},mdCtrlFormIndex:{type:Number,required:!1}},setup(e){const t=ne((...e)=>new bn(...e),{excludePropsKeys:["data"]}),a=B("control-edit-form"),n=o(""),i=o([]),s=o();e.isSimple&&((e.simpleDataIndex||0===e.simpleDataIndex)&&t.setSimpleDataIndex(e.simpleDataIndex),t.evt.on("onMounted",()=>{t.setSimpleData(e.data||{})}),c(()=>e.data,e=>{const a=e||{},n=t.data instanceof ma?t.data.getOrigin():t.data;let i=!1;i=!!(n&&Object.keys(n)&&a&&Object.keys(a)&&Object.keys(n).length!==Object.keys(a).length)||!!Object.keys(n).find(e=>a[e]!==n[e]),i&&t.setSimpleData(a)},{deep:!0})),(e.mdCtrlFormIndex||0===e.mdCtrlFormIndex)&&t.setMdCtrlFormIndex(e.mdCtrlFormIndex),t.evt.on("onCreated",()=>{Object.keys(t.details).forEach(e=>{const a=t.details[e];a.state=u(a.state)}),i.value=t.anchorData});const l=_o(e=>{t.filterDetail(e)},300,{leading:!0});return{c:t,ns:a,filter:n,anchorList:i,anchorTargetRef:s,handleInput:l,calcNavBarConfig:()=>{const{navBarPos:e,navBarSysCss:a,navBarWidth:n,navBarStyle:i,navbarHeight:o}=t.model;return{navBarPos:e,navBarSysCss:a,navBarWidth:n,navBarStyle:i,navbarHeight:o}}}},render(){const{showFormNavBar:e,enableItemFilter:t}=this.c.model,a=n("div",{class:[this.ns.b(),this.ns.is("item-filter",t)]},[t&&n(i("el-input"),{clearable:!0,modelValue:this.filter,"onUpdate:modelValue":e=>this.filter=e,onInput:this.handleInput,class:this.ns.e("quick-search"),placeholder:ibiz.i18n.t("app.search")},null),n(i("iBizFormControl"),{ref:"anchorTargetRef",controller:this.c},{...this.$slots})]);return e?n(i("iBizAnchorContainer"),{anchorList:this.anchorList.filter(e=>e.pageId===this.c.state.activeTab),anchorTargetEle:this.anchorTargetRef,navBarConfig:this.calcNavBarConfig()},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]}):a;var o}}),_b=e("Q",ie(Rb,function(e){e.component(Rb.name,Rb),Ha(qa.FORM,()=>new Lb)}));const jb=a({name:"IBizFormControl",props:{controller:{type:Object,required:!0}},setup(e,{slots:t}){const a=B("control-form"),o=e.controller;ue(o);const s={form:o},r=t=>{var a;const n={};return null==(a=t.controlAttributes)||a.forEach(t=>{t.attrName&&t.attrValue&&(n[t.attrName]=Ua.execSingleLine(t.attrValue,{...e.controller.getEventArgs(),data:e.controller.data}))}),n},c=(e,a=!1)=>{const{hidden:s,userTag:d}=e;if(s||!a&&o.model.enableAdvanceSearch&&"permanent"!==d)return;const u=e.id;if(t[u])return D(t,u,{model:e,data:o.state.data,value:o.state.data[u],controller:o.details[u]});const h={};"FORMITEM"===e.detailType&&t["".concat(u,"_editor")]&&(h.default=(...e)=>t["".concat(u,"_editor")](...e));const p=Aa(e);p.length&&(h.default=()=>p.map(e=>c(e)));const m=o.providers[u];if(!m)return n("div",null,[ibiz.i18n.t("control.form.noSupportDetailType",{detailType:e.detailType})]);const v=i(m.component);return l(v,{modelData:e,controller:o.details[u],key:e.id,attrs:r(e)},h)},d=e=>{const{modelData:t}=e;return(t instanceof Array?t:[t]).map(e=>c(e))};return d.props=["modelData"],s.FormDetail=d,{ns:a,c:o,FormDetail:d,slotProps:s,renderByDetailType:c}},render(){const{state:e,model:t,controlPanel:a}=this.c,{isCreated:o}=e,l={};if(o)if(this.$slots.default)l.default=()=>this.$slots.default({...this.slotProps});else{const e=t.controlType===qa.SEARCHFORM?"searchform":"form";l[a?e:"default"]=()=>n(i("iBizFormPage"),{modelData:this.c.model,controller:this.c},{default:()=>{var e;return[null==(e=this.c.model.deformPages)?void 0:e.map(e=>this.renderByDetailType(e,!0))]}})}return n(i("iBizControlBase"),{class:this.ns.b(),controller:this.c},"function"==typeof(r=l)||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?l:{default:()=>[l]});var r}}),Vb=e("R",ie(jb,function(e){e.component(jb.name,jb),e.use(zm),e.use(Im),e.use(im),e.use(Nm),e.use(jm),e.use(sb),e.use(ub),e.use(bb),e.use(xb),e.use(kb),e.use(Mb)}));function Fb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Ub=a({name:"IBizExportExcel",props:{mode:{type:String,required:!1},size:{type:String,required:!1},item:{type:Object,required:!0},btnContent:{type:Function,required:!0},controller:{type:Object,required:!0}},emits:["exportExcel"],setup(e,{emit:t}){const a=B("export-excel"),n=o(1),i=o(9999),s=o(1e3),l=e.controller.xdataControl;d(()=>{l&&l.evt.on("onMounted",()=>{var e;s.value=(null==(e=l.dataExport)?void 0:e.maxRowCount)||1e3})});return{ns:a,maxRowCount:s,endPage:i,startPage:n,onCommand:(e,a)=>{e&&t("exportExcel",a,{type:e,startPage:n.value,endPage:i.value})}}},render(){return"menu"===this.$props.mode?n(i("el-sub-menu"),{index:this.$props.item.id,class:this.ns.b("submenu"),"popper-class":this.ns.b("submenu-popper")},{title:()=>{let e;return n(i("el-button"),{title:Tt(this.item.tooltip),size:this.$props.size,type:Pl(this.item.buttonStyle),class:this.ns.b("submenu-button")},Fb(e=this.btnContent(this.item))?e:{default:()=>[e]})},default:()=>{let e,t,a,o;return[n(i("el-menu-item"),{class:this.ns.b("menu-item"),onClick:e=>this.onCommand("maxRowCount",e)},Fb(e=ibiz.i18n.t("control.toolbar.exportExcel.exportAll",{maxRowCount:this.maxRowCount}))?e:{default:()=>[e]}),n(i("el-menu-item"),{class:this.ns.b("menu-item"),onClick:e=>this.onCommand("activatedPage",e)},Fb(t=ibiz.i18n.t("control.toolbar.exportExcel.expCurrentPage"))?t:{default:()=>[t]}),n(i("el-menu-item"),{class:this.ns.b("menu-item"),onClick:e=>this.onCommand("selectedRows",e)},Fb(a=ibiz.i18n.t("control.toolbar.exportExcel.expCurrentSelect"))?a:{default:()=>[a]}),n(i("el-menu-item"),{class:[this.ns.b("menu-item"),this.ns.e("custom")]},{default:()=>[n(i("el-input"),{type:"number",modelValue:this.startPage,"onUpdate:modelValue":e=>this.startPage=e,size:"small",maxlength:"4",onClick:e=>{e.stopPropagation()},onChange:e=>{this.startPage=e}},null),n("span",{class:"item-text",onClick:e=>{e.stopPropagation()}},[p("-")]),n(i("el-input"),{modelValue:this.endPage,"onUpdate:modelValue":e=>this.endPage=e,size:"small",type:"number",maxlength:"4",onClick:e=>{e.stopPropagation()}},null),n("span",{class:"item-text",onClick:e=>{e.stopPropagation()}},[ibiz.i18n.t("control.toolbar.exportExcel.page")]),n(i("el-button"),{onClick:e=>this.onCommand("customPage",e),size:"small"},Fb(o=ibiz.i18n.t("control.toolbar.exportExcel.export"))?o:{default:()=>[o]})]})]}}):n(i("el-dropdown"),{trigger:"click",size:this.$props.size,onCommand:this.onCommand,"popper-class":this.ns.b()},{default:()=>{let e;return n(i("el-button"),{size:this.$props.size,class:this.ns.e("button"),title:Tt(this.item.tooltip),type:Pl(this.item.buttonStyle)},Fb(e=this.btnContent(this.item))?e:{default:()=>[e]})},dropdown:()=>{let e,t,a,o;return n(i("el-dropdown-menu"),null,{default:()=>[n(i("el-dropdown-item"),{command:"maxRowCount"},Fb(e=ibiz.i18n.t("control.toolbar.exportExcel.exportAll",{maxRowCount:this.maxRowCount}))?e:{default:()=>[e]}),n(i("el-dropdown-item"),{command:"activatedPage"},Fb(t=ibiz.i18n.t("control.toolbar.exportExcel.expCurrentPage"))?t:{default:()=>[t]}),n(i("el-dropdown-item"),{command:"selectedRows"},Fb(a=ibiz.i18n.t("control.toolbar.exportExcel.expCurrentSelect"))?a:{default:()=>[a]}),n(i("el-dropdown-item"),{class:this.ns.e("custom"),command:""},{default:()=>[n(i("el-input"),{type:"number",modelValue:this.startPage,"onUpdate:modelValue":e=>this.startPage=e,size:"small",maxlength:"4",onClick:e=>{e.stopPropagation()},onChange:e=>{this.startPage=e}},null),n("span",{class:"item-text",onClick:e=>{e.stopPropagation()}},[p("-")]),n(i("el-input"),{modelValue:this.endPage,"onUpdate:modelValue":e=>this.endPage=e,size:"small",type:"number",maxlength:"4",onClick:e=>{e.stopPropagation()}},null),n("span",{class:"item-text",onClick:e=>{e.stopPropagation()}},[ibiz.i18n.t("control.toolbar.exportExcel.page")]),n(i("el-button"),{onClick:e=>this.onCommand("customPage",e),size:"small"},Fb(o=ibiz.i18n.t("control.toolbar.exportExcel.export"))?o:{default:()=>[o]})]})]})}})}}),Hb=a({name:"IBizShortCutButton",props:{mode:{type:String,required:!1},size:{type:String,required:!1},item:{type:Object,required:!0},controller:{type:Object,required:!0}},emits:["click"],setup(e,{emit:t}){var a;const n=B("short-cut-button"),i=B("toolbar-item"),o=null==(a=e.item.buttonStyle)?void 0:a.toLowerCase();return{ns:n,ns2:i,buttonState:r(()=>e.controller.state.buttonsState[e.item.id]),buttonType:o,isShortCut:r(()=>e.controller.view.state.isShortCut),onClick:e=>{t("click",e)}}},render(){return n("div",{class:[this.ns.b(),this.ns.is("short-cut",this.isShortCut)]},[n(i("el-button"),{title:Tt(this.isShortCut?"".concat(ibiz.i18n.t("app.cancel")).concat(this.item.tooltip):this.item.tooltip),size:this.size,type:Pl(this.item.buttonStyle),loading:this.buttonState.loading,disabled:this.buttonState.disabled,onClick:this.onClick},{default:()=>[this.item.showIcon&&this.item.sysImage&&n("span",{class:[this.ns2.b("icon"),this.ns.e("icon")]},[n(i("iBizIcon"),{icon:this.item.sysImage},null)]),this.item.showCaption&&n("span",{class:this.ns2.b("text")},[this.isShortCut?"".concat(ibiz.i18n.t("app.cancel")).concat(this.item.caption):this.item.caption])]})])}});function qb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Gb=(e,t)=>{const a=t&&e.counterId?t.counterData[e.counterId]:void 0,o=e.sysImage,s=[],l=B("toolbar-item");return e.showIcon&&o&&s.push(n("span",{class:l.b("icon")},[n(i("iBizIcon"),{icon:o},null)])),e.showCaption&&e.caption&&s.push(n("span",{class:l.b("text")},[e.caption])),a&&s.push(n(i("iBizBadge"),{class:l.b("counter"),value:a,counterMode:e.counterMode},null)),s},Wb=e=>{var t;return null==(t=null==e?void 0:e.sysCss)?void 0:t.cssName},Yb=a({name:"IBizToolbarControl",props:{modelData:{type:Object,required:!0},runMode:{type:String,default:"RUNTIME"},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},manualCalcButtonState:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){var a;const s=ne((...e)=>new Sn(...e)),r=B("control-".concat(s.model.controlType.toLowerCase())),c=B("control-".concat(s.model.controlType.toLowerCase(),"-actions")),d=o("default"),u=null==(a=s.model.toolbarStyle)?void 0:a.toLowerCase(),h=async(a,n,i)=>{"RUNTIME"===e.runMode?await s.onItemClick(a,n,i):t("click",a)},m=async(a,n,i)=>{if("RUNTIME"===e.runMode){const e={};Object.assign(e,{...a,itemType:a.detailType}),await h(e,n,i)}else t("click",a)},v=(e,t)=>{var a,o;let c;const u=t.uiactionId,h=null==(a=s.state.buttonsState[t.id])?void 0:a.visible,p=s.itemProviders[t.id];if(!h)return null;if(p){const a=i(p.component);return l(a,{key:t.id,class:[r.e("item")],item:e,controller:s})}const v=null==(o=t.buttonStyle)?void 0:o.toLowerCase();return"exportexcel"===u||"gridview_exportaction"===u?n(Ub,{class:[r.e("menu-exportexcel"),r.em("item",v),Wb(t)],mode:"menu",item:t,btnContent:e=>Gb(e,s.state),size:d.value,controller:s,onExportExcel:(e,a)=>{m(t,e,a)}},null):n(i("el-menu-item"),{class:[r.is("loading",s.state.buttonsState[t.id].loading),r.em("item",v),Wb(t)],index:"menuitem".concat(t.id),disabled:s.state.buttonsState[t.id].disabled,title:Tt(t.caption)},{default:()=>[n(i("el-button"),{loading:s.state.buttonsState[t.id].loading,onClick:e=>{t.uiactionId&&m(t,e)}},qb(c=Gb(t,s.state))?c:{default:()=>[c]})]})},g=(e,t)=>{if(s.state.buttonsState[e.id].visible){let a;return n(i("el-button"),{size:d.value,class:Wb(e),type:t||Pl(e.buttonStyle),title:Tt(e.tooltip||e.caption),loading:s.state.buttonsState[e.id].loading,disabled:s.state.buttonsState[e.id].disabled,onClick:t=>m(e,t)},qb(a=Gb(e,s.state))?a:{default:()=>[a]})}return null},b=e=>{if(s.state.buttonsState[e.id].visible){let t;const a=s.state.buttonsState[e.id].disabled;return n(i("el-dropdown-item"),{class:[c.be("dropdown-popper","dropdown-item"),c.is("disabled",a),r.em("item",Pl(e.buttonStyle))]},qb(t=g(e))?t:{default:()=>[t]})}return null},f=(e,t)=>{const a=e[t];return a?s.state.buttonsState[a.id].visible?t:f(e,t+1):-1},w=(e,t=!1)=>{const{groupExtractMode:a}=e;switch(a){case"ITEMS":return((e,t)=>{const{uiactionGroup:a}=e;if(a&&a.uiactionGroupDetails){const{uiactionGroupDetails:o}=a,l=o.length>0,d=e.buttonStyle||"";if(t){const t=s.state.buttonsState[e.id].disabled||-1===o.findIndex(e=>{var t;return!1===(null==(t=s.state.buttonsState[e.id])?void 0:t.disabled)});return n(i("el-sub-menu"),{class:[r.b("submenu"),r.be("submenu","groupdetails"),r.em("item",d.toLowerCase()),Wb(e)],index:e.id,disabled:t,title:Tt(e.tooltip),"popper-class":[r.b("submenu-popper"),r.em("submenu-popper","groupdetails"),r.bm("submenu-popper",u),r.em("submenu-popper",d.toLowerCase()),r.bm("submenu-popper",Wb(e)),Wb(e)]},{default:()=>o.map(t=>v(e,t)),title:()=>v(e,e)})}return n(i("el-dropdown"),{"popper-class":[c.b("dropdown-popper"),c.bm("dropdown-popper",u),c.em("dropdown-popper",d.toLowerCase()),c.bm("dropdown-popper",Wb(e))]},{default:()=>g(e),dropdown:()=>{let e;return l&&n(i("el-dropdown-menu"),null,qb(e=o.map(e=>b(e)))?e:{default:()=>[e]})}})}return null})(e,t);case"ITEMX":return((e,t)=>{const{uiactionGroup:a}=e;if(a&&a.uiactionGroupDetails){const{uiactionGroupDetails:o}=a,l=f(o,0);if(-1!==l){const a=o[l],d=o.slice(l+1).filter(e=>!!s.state.buttonsState[e.id].visible),h=d.length>0;let p=e.buttonStyle||"";return t?(p=a.buttonStyle||"",n(i("el-sub-menu"),{class:[r.b("submenu"),r.be("submenu","groupdetails"),r.em("item",p.toLowerCase()),Wb(a)],index:a.id,disabled:s.state.buttonsState[a.id].disabled,title:Tt(a.tooltip),"popper-class":[r.b("submenu-popper"),r.be("submenu-popper","groupdetails"),r.bm("submenu-popper",u),r.em("submenu-popper",p.toLowerCase()),r.bm("submenu-popper",Wb(a)),Wb(a)]},{default:()=>d.map(t=>v(e,t)),title:()=>v(e,a)})):n(i("el-dropdown"),{"split-button":h,type:Pl(p),"popper-class":[c.b("dropdown-popper"),c.bm("dropdown-popper",u),c.em("dropdown-popper",p.toLowerCase()),c.bm("dropdown-popper",Wb(e))]},{default:()=>g(a,Pl(p)),dropdown:()=>{let e;return h&&n(i("el-dropdown-menu"),null,qb(e=d.map(e=>b(e)))?e:{default:()=>[e]})}})}}return null})(e,t);default:return((e,t)=>{const{uiactionGroup:a}=e;if(a&&a.uiactionGroupDetails){const{uiactionGroupDetails:i}=a;return t?i.map(t=>v(e,t)):i.map(e=>n("div",{class:[c.e("item-deuiaction"),r.em("item",Pl(e.buttonStyle))]},[g(e)]))}return null})(e,t)}},y=e=>{const t=e.detoolbarItems||[],a=s.state.buttonsState[e.id].visible,o=s.state.buttonsState[e.id].disabled;if(!a)return null;const c=-1!==t.findIndex(e=>{var t;return null==(t=s.state.buttonsState[e.id])?void 0:t.loading}),p=-1!==t.findIndex(e=>{var t;return!0===(null==(t=s.state.buttonsState[e.id])?void 0:t.visible)}),m=o||-1===t.findIndex(e=>{var t;return!1===(null==(t=s.state.buttonsState[e.id])?void 0:t.disabled)});if(e.uiactionGroup&&e.uiactionGroup.uiactionGroupDetails&&e.uiactionGroup.uiactionGroupDetails.length>0)return w(e,!0);if(!p)return null;const v=e.buttonStyle||"";return n(i("el-sub-menu"),{class:[r.b("submenu"),r.em("item",v.toLowerCase()),Wb(e)],index:e.id,disabled:m,title:Tt(e.tooltip),"popper-class":[r.b("submenu-popper"),r.bm("submenu-popper",u),r.em("submenu-popper",v.toLowerCase()),r.bm("submenu-popper",Wb(e)),Wb(e)]},{default:()=>t.map(t=>{var a,o;const c=t.uiactionId,u=null==(a=s.state.buttonsState[t.id])?void 0:a.visible,p=s.itemProviders[t.id];if(!u)return null;if(p){const a=i(p.component);return l(a,{key:t.id,class:[r.e("item")],item:e,controller:s})}if("SEPERATOR"!==t.itemType){if("RAWITEM"===t.itemType)return n(i("el-menu-item"),{index:"menuitem".concat(t.id),title:Tt(t.tooltip)},{default:()=>[n(i("iBizRawItem"),{rawItem:t,content:t.rawItem.content,class:r.b("submenu-rawitem"),onClick:e=>h(t,e)},null)]});if("DEUIACTION"===t.itemType){let e;const a=null==(o=t.buttonStyle)?void 0:o.toLowerCase();return"exportexcel"===c||"gridview_exportaction"===c?n(Ub,{class:[r.e("menu-exportexcel"),r.em("item",a),Wb(t)],mode:"menu",item:t,btnContent:e=>Gb(e,s.state),size:d.value,controller:s,onExportExcel:(e,a)=>{h(t,e,a)}},null):n(i("el-menu-item"),{class:[r.is("loading",s.state.buttonsState[t.id].loading),r.em("item",a),Wb(t)],index:"menuitem".concat(t.id),disabled:s.state.buttonsState[t.id].disabled,title:Tt(t.tooltip),onClick:e=>h(t,e)},{default:()=>[n(i("el-button"),{loading:s.state.buttonsState[t.id].loading},qb(e=Gb(t,s.state))?e:{default:()=>[e]})]})}return"ITEMS"===t.itemType?y(t):null}}),title:()=>{let t;return n(i("el-button"),{loading:c,disabled:m,type:Pl(v)},qb(t=Gb(e,s.state))?t:{default:()=>[t]})}})};return{c:s,btnSize:d,ns:r,toolbarStyle:u,handleClick:h,renderExtraButtons:e=>e.map(e=>{let t;return n("div",{key:e.id,class:[r.e("item")]},[n(i("el-button"),{title:Tt(e.tooltip),size:d.value,onClick:t=>h(e,t)},qb(t=Gb(e,s.state))?t:{default:()=>[t]})])}),renderToolbarItem:e=>{var t,a;const o=e.id,u=null==(t=s.state.buttonsState[o])?void 0:t.visible,m=s.itemProviders[o];if(!u)return null;if(m){const t=i(m.component);return l(t,{key:o,class:[r.e("item")],item:e,controller:s})}if("SEPERATOR"===e.itemType)return s.state.hideSeparator.includes(o)?null:n("div",{key:o,class:[r.e("item"),r.e("item-separator")]},[p("|")]);if("RAWITEM"===e.itemType)return n("div",{key:o,class:[r.e("item"),r.e("item-rawitem")]},[n(i("iBizRawItem"),{rawItem:e,content:e.rawItem.content,onClick:t=>h(e,t)},null)]);if("DEUIACTION"===e.itemType){let t;const a=e.uiactionId,l=e.buttonStyle;return"exportexcel"===a||"gridview_exportaction"===a?n(Ub,{class:[r.e("item"),r.e("item-deuiaction"),r.em("item",null==l?void 0:l.toLowerCase()),Wb(e)],item:e,btnContent:e=>Gb(e,s.state),size:d.value,controller:s,onExportExcel:(t,a)=>{h(e,t,a)}},null):"shortcut"===a?n(Hb,{key:o,class:[r.e("item"),r.e("item-deuiaction"),r.em("item",null==l?void 0:l.toLowerCase()),Wb(e)],item:e,controller:s,size:d.value,onClick:t=>h(e,t)},null):n("div",{key:o,class:[r.e("item"),r.e("item-deuiaction"),r.em("item",null==l?void 0:l.toLowerCase()),Wb(e),r.is("loading",s.state.buttonsState[o].loading)]},[n(i("el-button"),{size:d.value,title:Tt(e.tooltip),type:Pl(l),loading:s.state.buttonsState[o].loading,disabled:s.state.buttonsState[o].disabled,onClick:t=>h(e,t)},qb(t=Gb(e,s.state))?t:{default:()=>[t]})])}if("ITEMS"===e.itemType){let t;const o=e,s=o.buttonStyle||"";if(o.groupExtractMode&&o.uiactionGroup){const t="extract-mode-".concat((null==(a=o.groupExtractMode)?void 0:a.toLowerCase())||"item");return n("div",{class:[c.b(),c.e(t),c.em("item",s.toLowerCase()),Wb(e)]},[w(e)])}return n(i("el-menu"),{mode:"horizontal",class:[r.e("menu"),r.em("menu",s.toLowerCase()),Wb(e)],ellipsis:!1,"menu-trigger":"hover"},qb(t=y(e))?t:{default:()=>[t]})}return null}}},render(){var e,t,a;const{state:o}=this.c;let s=null;return o.isCreated&&(s=[(null==(e=o.extraButtons.before)?void 0:e.length)>0&&this.renderExtraButtons(o.extraButtons.before),null==(t=this.modelData.detoolbarItems)?void 0:t.map((e,t)=>{var a;const n=this.renderToolbarItem(e);return(null==(a=o.extraButtons[t])?void 0:a.length)?[n,this.renderExtraButtons(o.extraButtons[t])]:n}),(null==(a=o.extraButtons.after)?void 0:a.length)>0&&this.renderExtraButtons(o.extraButtons.after)]),n(i("iBizControlBase"),{controller:this.c,class:[this.ns.m(o.viewMode.toLowerCase()),this.ns.m(this.toolbarStyle)]},qb(s)?s:{default:()=>[s]})}});var Kb=Object.defineProperty,Xb=(e,t,a)=>(((e,t,a)=>{t in e?Kb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class $b{constructor(){Xb(this,"component","IBizToolbarControl")}}const Jb=e("S",ie(Yb,function(e){e.component(Yb.name,Yb),Ha(qa.TOOLBAR,()=>new $b)})),Qb=a({name:"IBizCaptionBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},data:{type:Object}},setup(){const e=ne((...e)=>new En(...e)),t=B("control-".concat(e.model.controlType.toLowerCase()));e.setBrowserTabTitle(),x(()=>{e.setBrowserTabTitle()});const a=r(()=>void 0!==e.state.totalx);return{c:e,ns:t,showTotal:a}},render(){return n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b()]},{default:()=>[n("div",{class:[this.ns.b("caption"),this.ns.is("show-icon",!!this.c.model.sysImage)]},[this.c.model.sysImage&&n(i("iBizIcon"),{class:[this.ns.be("caption","icon")],icon:this.c.model.sysImage},null),n("div",{class:[this.ns.be("caption","content")]},[this.c.state.caption]),this.showTotal&&n("div",{class:[this.ns.be("caption","total")]},[ibiz.i18n.t("control.captionBar.total",{total:this.c.state.totalx,invisibleNum:this.c.state.totalx-this.c.state.total})])])]})}});var Zb=Object.defineProperty,ef=(e,t,a)=>(((e,t,a)=>{t in e?Zb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class tf{constructor(){ef(this,"component","IBizCaptionBarControl")}}const af=e("T",ie(Qb,function(e){e.component(Qb.name,Qb),Ha(qa.CAPTIONBAR,()=>new tf)}));function nf(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const of=a({name:"IBizDataViewControl",components:{draggable:is},props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0},isSimple:{type:Boolean,required:!1},data:{type:Array,required:!1},loadDefault:{type:Boolean,default:!0}},setup(e){const t=ne((...e)=>new Dn(...e)),a=B("control-".concat(t.model.controlType.toLowerCase()));ue(t);const s=r(()=>[a.is("enable-page",!0===t.model.enablePagingBar)]),d=o(!1),u=r(()=>!0===t.model.enablePagingBar||(2!==t.model.pagingMode||(t.state.items.length>=t.state.total||t.state.isLoading||t.state.total<=t.state.size))),h=r(()=>{var e,a;return(null==(a=null==(e=t.model.controlParam)?void 0:e.ctrlParams)?void 0:a.CARDSTYLE)||t.controlParams.cardstyle||"default"}),p=r(()=>!t.state.enableGroup&&(2===t.model.pagingMode||3===t.model.pagingMode)),m=o(),v=o(go());c(()=>t.state.curPage,()=>{var e,a;if(1===t.state.curPage&&(2===t.model.pagingMode||3===t.model.pagingMode)){v.value=go();const t=null==(a=null==(e=m.value)?void 0:e.ElInfiniteScroll)?void 0:a.containerEl;t&&(t.lastScrollTop=0,t.scrollTop=0)}});const g=()=>{e.data&&(t.state.items=e.data.map(e=>new ma(e)),t.afterLoad({},t.state.items))};t.evt.on("onCreated",async()=>{e.isSimple&&(g(),t.state.isSimple=!0,t.state.isLoaded=!0)});const f=e=>{let a=!!t.state.selectedData.find(t=>t.srfkey===e.srfkey);return"DEDATAVIEW"===t.view.model.viewType&&1===t.state.mdctrlActiveMode&&!0===t.state.singleSelect&&(a=!1),a};c(()=>e.data,()=>{e.isSimple&&g()},{deep:!0});const{onPageChange:w,onPageRefresh:y,onPageSizeChange:I}=ul(t),x=(e,a)=>(a.stopPropagation(),t.onRowClick(e)),S=(e,a)=>(a.stopPropagation(),t.onDbRowClick(e));let E=null;const D=(e,a)=>{e.moved&&t.onDragChange({from:a,to:a,fromIndex:e.moved.oldIndex,toIndex:e.moved.newIndex}),e.added&&(E={to:a,toIndex:e.added.newIndex}),e.removed&&(E&&(E.from=a,E.fromIndex=e.removed.oldIndex,t.onDragChange(E)),E=null)},P=e=>n(i("el-card"),{shadow:"hover",class:[a.b("item"),a.be("item","new")],title:ibiz.i18n.t("app.newlyBuild"),"body-style":{width:t.model.cardWidth?"".concat(t.model.cardWidth,"px"):"auto",height:t.model.cardHeight?"".concat(t.model.cardHeight,"px"):"auto"},onClick:a=>{t.onClickNew(a,null==e?void 0:e.key)}},{default:()=>[n("ion-icon",{name:"add-outline"},null)]}),k=(e,a)=>{const{context:o,params:s}=t;return n(i("iBizControlShell"),{data:e,modelData:a,context:o,params:s,onClick:t=>x(e,t),onDblclick:t=>S(e,t)},null)},z=e=>n(i("iBizActionToolbar"),{class:a.bem("item-content","bottom","actions"),"action-details":t.getOptItemModel(),"actions-state":t.state.uaState[e.srfkey],zIndex:t.state.zIndex,onActionClick:(a,n)=>t.onActionClick(a,e,n)},null),T=e=>{const i=t.getOptItemModel();return n("div",{class:a.b("item-content")},[n("div",{class:a.be("item-content","top")},[n("div",{class:a.bem("item-content","top","title")},[e.srfmajortext]),n("div",{class:a.bem("item-content","top","description")},[e.content])]),i.length?n("div",{class:a.be("item-content","bottom")},[z(e)]):null])},A=o=>{const s=a.cssVarBlock({"item-bg-color":"".concat(o.bgcolor||""),"text-color":"".concat(o.fontcolor||""),"hover-bg-color":"".concat(o.hovercolor||""),"active-bg-color":"".concat(o.activecolor||"")}),l=e.modelData.itemLayoutPanel;return n(i("el-card"),{shadow:"hover",class:[a.b("item"),a.is("active",f(o))],style:s,"body-style":{width:t.model.cardWidth?"".concat(t.model.cardWidth,"px"):"auto",height:t.model.cardHeight?"".concat(t.model.cardHeight,"px"):"auto"},onClick:e=>x(o,e),onDblclick:e=>S(o,e)},{default:()=>[n("div",{class:a.be("item","content")},[t.state.draggable&&!t.state.readonly&&n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:a.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])]),"style2"===h.value&&!t.state.singleSelect&&n(i("el-checkbox"),{size:"large",class:a.bem("item","content","checkbox"),modelValue:f(o),onClick:e=>e.stopPropagation(),onChange:()=>(e=>{const a=t.state.selectedData,n=a.findIndex(t=>t.srfkey===e.srfkey);-1===n?a.push(e):a.splice(n,1),t.setSelection(a)})(o)},null),l?k(o,l):T(o)])]})},O=(e,o,s=!0)=>{const{cardColXS:l,cardColSM:r,cardColMD:c,cardColLG:d}=t.model;return l||r||c||d?n(is,{itemKey:"srfkey",modelValue:e,group:t.model.id,handle:".".concat(a.e("drag-icon")),class:["el-row",a.e("layout-row")],disabled:s||t.state.updating||t.state.readonly,onChange:e=>D(e,null==o?void 0:o.key)},{item:({element:e})=>n(i("el-col"),{xs:l,sm:r,md:c,lg:d,class:a.e("layout-col")},{default:()=>[n("div",{class:a.b("scroll-item")},[A(e)])]}),footer:()=>{if(t.enableNew&&!t.state.readonly)return n(i("el-col"),{xs:l,sm:r,md:c,lg:d,class:a.e("layout-col")},{default:()=>[n("div",{class:a.b("scroll-item")},[P(o)])]})}}):n(is,{itemKey:"srfkey",modelValue:e,group:t.model.id,class:[a.e("layout-flex"),a.em("layout-flex","draggable")],disabled:s||t.state.updating||t.state.readonly,onChange:e=>D(e,null==o?void 0:o.key)},{item:({element:e})=>n("div",{class:a.b("scroll-item")},[A(e)]),footer:()=>{if(t.enableNew&&!t.state.readonly)return n("div",{class:a.b("scroll-item")},[P(o)])}})},M=()=>t.state.enableGroup?n("div",{class:a.b("group-content")},[t.state.groups.map(e=>(e=>{const{groupSysCss:o}=t.model;return n("div",{class:[a.be("group-content","item"),null==o?void 0:o.cssName,a.is("collapse",t.state.collapseKeys.includes(e.key.toString()))]},[n("div",{class:a.be("group-content","item-header")},[n("span",{class:a.be("group-content","item-title")},[e.caption]),n("span",{class:a.be("group-content","item-action")},[t.model.groupUIActionGroup&&e.groupActionGroupState&&n(i("iBizActionToolbar"),{zIndex:t.state.zIndex,class:a.be("group-content","header-actions"),"action-details":t.model.groupUIActionGroup.uiactionGroupDetails,"actions-state":e.groupActionGroupState,onActionClick:(a,n)=>{t.onGroupToolbarClick(a,n,e)}},null)])]),e.children.length>0?O(e.children,e,!t.state.draggable):n("div",{class:a.bem("group-content","item","empty")},[ibiz.i18n.t("app.noData")])])})(e))]):O(d.value?t.state.items.slice(0,t.state.size):t.state.items,void 0,!t.enableEditOrder),N=()=>{var e;null==(e=m.value)||e.scrollTo({top:0,behavior:"smooth"})};t.evt.on("onScrollToTop",()=>{N()});const L=()=>{d.value=!0,N()},R=()=>{d.value=!1},_=()=>n("div",{class:a.e("collapse-expand-icon")},[n("i",{class:"fa fa-angle-double-up",title:ibiz.i18n.t("control.common.collapseData"),onClick:L,"aria-hidden":"true"},null)]),j=()=>n("div",{class:a.e("collapse-expand-icon")},[n("i",{class:"fa fa-angle-double-down",title:ibiz.i18n.t("control.common.expandData"),onClick:R,"aria-hidden":"true"},null)]),V=()=>{var e;const o=null==(e=t.model.controls)?void 0:e.find(e=>e.name==="".concat(t.model.name,"_batchtoolbar"));if(o)return n("div",{class:[a.e("batchtoolbar"),a.is("show",t.showBatchToolbar)]},[n(i("iBizToolbarControl"),{modelData:o,context:t.context,params:t.params},null)])},F=()=>{var e;const{isLoaded:o}=t.state;if(!o)return;const s=null==(e=t.model.controls)?void 0:e.find(e=>e.name==="".concat(t.model.name,"_quicktoolbar"));if(s)return n(i("iBizToolbarControl"),{modelData:s,context:t.context,params:t.params,class:a.e("quicktoolbar")},null);const l={};return ce(t)&&Object.assign(l,{customRender:()=>n(de,{controller:t},null)}),n(i("iBizNoData"),{class:a.e("content"),text:t.model.emptyText,emptyTextLanguageRes:t.model.emptyTextLanguageRes,hideNoDataImage:t.state.hideNoDataImage},nf(l)?l:{default:()=>[l]})},U=()=>{let e=null;const i=!(t.state.items.length>=t.state.total||t.state.total<=t.state.size);return p.value&&(2===t.model.pagingMode&&(d.value?e=j():t.state.items.length>t.state.size&&(e=_())),3===t.model.pagingMode&&(d.value?e=j():i?e=n("div",{class:a.e("load-more")},[n("i",{class:"fa fa-angle-double-down",title:ibiz.i18n.t("control.common.loadMore"),onClick:()=>t.loadMore(),"aria-hidden":"true"},null)]):t.state.isCreated&&t.state.items.length>t.state.size&&(e=_()))),e},H=()=>{const{enableNavView:e,showNavIcon:i,showNavView:o}=t.state;if(e&&i)return n("ion-icon",o?{name:"eye-off-outline",class:a.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.hiddenNav"),onClick:()=>t.onShowNavViewChange()}:{name:"eye-outline",class:a.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.showNav"),onClick:()=>t.onShowNavViewChange()},null)},q=()=>{if(!t.state.noSort)return n(i("iBizSortBar"),{onSortChange:(e,a)=>{t.setSort(e.key,a),t.load({isInitialLoad:2===t.model.pagingMode||3===t.model.pagingMode})},sortItems:t.state.sortItems},null)},G=()=>[t.state.items.length>0?b(n("div",{class:a.e("content"),ref:"infiniteScroll","infinite-scroll-distance":10,"infinite-scroll-disabled":u.value,key:v.value},[M()]),[[C("infinite-scroll"),()=>t.loadMore()]]):F(),V(),H(),U()],W=()=>{if(t.state.enablePagingBar&&1===t.model.pagingMode)return n(i("iBizPagination"),{class:a.e("pagination"),total:t.state.total,curPage:t.state.curPage,size:t.state.size,totalPages:t.state.totalPages,onChange:w,onPageSizeChange:I,onPageRefresh:y},null)},Y=()=>({sortbar:()=>q(),searchbar:()=>(()=>{const e=Pn(t.view.model,"searchbar");if(!e)return;const a=e.name||e.id,n=t.view.providers[a];return l(i((null==n?void 0:n.component)||"IBizControlShell"),{context:t.view.context,params:t.view.params,modelData:e,...t.view.slotProps[a]||{},provider:n})})(),dataview:()=>n("div",{class:a.e("layout-content")},[G()]),pagingbar:()=>W()});return{c:t,ns:a,classNames:s,infiniteScroll:m,renderLayoutByStyle:()=>"userstyle"===h.value?Y():(()=>{if(t.state.isCreated)return[q(),...G(),W()]})()}},render(){let e;return n(i("iBizControlNavigation"),{controller:this.c},{default:()=>[n(i("iBizControlBase"),{class:[this.ns.is("enable-page",!!this.c.state.enablePagingBar)],controller:this.c},nf(e=this.renderLayoutByStyle())?e:{default:()=>[e]})]})}});var sf=Object.defineProperty,lf=(e,t,a)=>(((e,t,a)=>{t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class rf{constructor(){lf(this,"component","IBizDataViewControl")}}e("V",rf);const cf=e("U",ie(of,function(e){e.component(of.name,of),Ha(qa.DATAVIEW,()=>new rf)}));function df(e,t){const a=t.state.items.find(t=>t._id===e);return a||t.state.items.find(t=>t._uuid===e)}function uf(e){switch(e){case"inner":return"inner";case"before":return"prev";case"after":return"next";default:throw new Vt(ibiz.i18n.t("control.tree.noSupported",{dropType:e}))}}const hf=a({name:"IBizTreeControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0},navigational:{type:Boolean,default:void 0},defaultExpandedKeys:{type:Array},loadDefault:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!0},isSimple:{type:Boolean,default:!1},data:{type:Array,required:!1}},setup(e){const a=ne((...e)=>new zn(...e));!function(e,t){t.defaultExpandedKeys&&(e.state.defaultExpandedKeys=t.defaultExpandedKeys);const a=()=>{t.data&&t.data.find(e=>!0===e.isRoot)&&(e.state.rootNodes=t.data,e.state.items=t.data)};e.evt.on("onCreated",async()=>{t.isSimple&&(a(),e.state.isLoaded=!0)}),c(()=>t.data,()=>{t.isSimple&&a()},{deep:!0})}(a,e);const s=o(!1),l=o("default");a.evt.on("onCreated",()=>{a.controlParams.cascadeselect&&(s.value=!0),a.controlParams.menushowmode&&(l.value=a.controlParams.menushowmode)}),h(()=>{var e;null==(e=a.counter)||e.offChange(fn)});const u=B("control-".concat(a.model.controlType.toLowerCase())),p=o(null),m=o(null),v=o(""),b=o(null),f=o(null),w=o(null),y=o(),C=o(null),I=o(null),x=o(null),S=o("".concat(go(),"-").concat(go())),E=o(null),D=o(null),P=o(null);a.evt.on("onNewTreeNode",async e=>{var t;const{nodeModel:a,defaultValue:n,parentNodeData:i}=e,{appId:o,appDataEntityId:s}=a,l=await ibiz.hub.getAppDataEntity(s,o),r=function(e){if(e.controlRenders){const t=e.controlRenders.find(e=>"newnoderender"===(e.id||"").split("_")[0]);if(!t)return;if("LAYOUTPANEL_MODEL"===t.renderType&&t.layoutPanelModel)return Ua.execScriptFn({},t.layoutPanelModel,{isAsync:!1});if("LAYOUTPANEL"===t.renderType&&t.layoutPanel)return t.layoutPanel}}(a);if(r&&(D.value=new Tn(l,{}),P.value=r||null),x.value=n,f.value=null,w.value=null,E.value&&(null==(t=p.value)||t.remove(E.value),E.value=null),i&&p.value){const e={};Object.assign(e,{_id:S.value,_text:"",_leaf:!0}),p.value.append(e,i),E.value=e}I.value=a}),c(()=>b.value,e=>{e&&e.$el.getElementsByTagName("input")[0].focus()}),a.evt.on("onSelectionChange",async()=>{var e;p.value&&(a.state.singleSelect?p.value.setCurrentKey(null==(e=a.state.selectedData[0])?void 0:e._id):p.value.setCheckedKeys(a.state.selectedData.map(e=>e._id)))});const k=()=>{var e;const t=null==(e=p.value)?void 0:e.getCurrentKey();if(!t||t===f.value)return;const n=df(t,a),i=a.getNodeModel(n._nodeId);(null==i?void 0:i.allowEditText)&&(f.value=t)},z=async()=>{var e;if(f.value)if(w.value){const e=df(f.value,a);await a.modifyNodeText(e,w.value),f.value=null,w.value=null}else f.value=null;if(I.value){const t=D.value&&Object.values(D.value).some(e=>!!e);if(P.value&&t){const{textAppDEFieldId:e,id:t}=I.value,n={_nodeId:t,_text:[D.value[e]],_deData:{}};Object.assign(n._deData,D.value),x.value&&Object.keys(x.value).forEach(e=>{n._deData[e]||Object.assign(n._deData,{[e]:x.value[e]})}),await a.createDeNodeData([n])}else if(C.value){const{textAppDEFieldId:e,id:t}=I.value,n=C.value,i={_deData:{}};Object.assign(i,{_nodeId:t,_text:n}),x.value&&Object.assign(i._deData,x.value),Object.assign(i._deData,{[e]:n}),await a.createDeNodeData([i])}I.value=null,C.value=null,x.value=null,D.value=null,P.value=null,y.value=null,E.value&&(null==(e=p.value)||e.remove(E.value)),E.value=null}},T=async()=>{var e;f.value&&(f.value=null,w.value=null),I.value&&(I.value=null,C.value=null,x.value=null,D.value=null,P.value=null,y.value=null,E.value&&(null==(e=p.value)||e.remove(E.value)),E.value=null)},A=e=>{e.stopPropagation(),"Enter"!==e.code&&13!==e.keyCode||z(),"Escape"!==e.code&&27!==e.keyCode||T()},O=e=>{if(!e)return;const{panelItemEventName:t}=e;t===An.ENTER&&z()},M=e=>{"Escape"!==e.code&&27!==e.keyCode||T()},{updateUI:N,triggerNodeExpand:L}=function(e,t){const a=()=>{const t=e.value;if(!t)throw new Vt(ibiz.i18n.t("control.tree.noFoundInstance"));return t},n=()=>{var a;const i=e.value;i?(Object.values(i.store.nodesMap).forEach(e=>{const a=t.state.expandedKeys.includes(e.data._id);a!==e.expanded&&(a?e.expand():e.collapse())}),t.state.singleSelect?e.value.setCurrentKey((null==(a=t.state.selectedData[0])?void 0:a._id)||void 0):i.setCheckedKeys(t.state.selectedData.map(e=>e._id))):setTimeout(()=>{n()},200)},i=_o(n,500);return{getTreeInstance:a,updateUI:i,triggerNodeExpand:e=>{const t=a().store.nodesMap[e];if(t)return t.expanded?(t.collapse(),!1):(t.expand(),!0)}}}(p,a),{addLoadMoreNode:R}=function(e,t){const a=e=>({_id:"".concat(e,"_load_more"),_text:ibiz.i18n.t("control.common.loadMore"),_leaf:!0,_disableSelect:!0,_load_more:!0});return{toLoadMoreNode:a,addLoadMoreNode:(n,i)=>{if(!e.value||!n||!i)return;const o=a(n);e.value.getNode(o)&&e.value.remove(o);const s=t.getLoadMoreInfoItems(n);s&&s.some(e=>e.curPage<e.totalPage-1)&&e.value.append(o,i)}}}(p,a),_=e=>e.map(e=>({_id:e._id,_uuid:e._uuid,_leaf:e._leaf,_text:e._text,_disableSelect:e._disableSelect}));a.evt.on("onAfterRefreshParent",e=>{if(p.value){const{parentNode:t,children:a}=e,n=_(a);p.value.updateKeyChildren(t._id,n),N(),g(()=>{R(t._id,t)})}}),a.evt.on("onAfterNodeDrop",e=>{e.isChangedParent&&(v.value=go())}),a.evt.on("onUpdateUI",()=>{N()});const j=r(()=>a.state.isLoaded?a.model.rootVisible?a.state.rootNodes:a.state.rootNodes.reduce((e,t)=>t._children?e.concat(t._children):e,[]):[]);c(j,(e,t)=>{e!==t&&(v.value=go())}),c(()=>a.state.expandedKeys,()=>{N()},{deep:!0});let V=!1;const F=r(()=>!(!0!==a.context.srfreadonly&&"true"!==a.context.srfreadonly));let U;a.evt.on("onMounted",()=>{if(Object.values(a.contextMenus).length>0){(()=>t.import("@imengyu/vue3-context-menu"))().then(e=>{U=e.default,U.default&&!U.showContextMenu&&(U=U.default)})}});const H=i("IBizRawItem"),q=i("IBizIcon"),G=(e,t,i,o)=>{const s=[];return e.forEach(e=>{var l,r;if("SEPERATOR"===e.itemType)return void s.push({divided:"self"});const c=o[e.id];if(c&&!c.visible)return;let d={};if(e.showCaption&&e.caption&&(d.label=e.caption),e.sysImage&&e.showIcon&&(d.icon=n(q,{icon:e.sysImage},null)),"DEUIACTION"===e.itemType){d.disabled=c.disabled,d.clickClose=!0;const{uiactionId:n}=e;n&&(d.onClick=()=>{a.doUIAction(n,t,i,e.appId)})}else if("RAWITEM"===e.itemType){const{rawItem:t}=e;t&&(d.label=n(H,{rawItem:e},null))}else if("ITEMS"===e.itemType){const c=e;if((null==(l=c.detoolbarItems)?void 0:l.length)&&(d.children=G(c.detoolbarItems,t,i,o)),c.uiactionGroup&&c.groupExtractMode){const e=null==(r=c.uiactionGroup.uiactionGroupDetails)?void 0:r.filter(e=>o[e.id].visible).map(e=>{const s=o[e.id],{sysImage:l}=e;return{label:e.showCaption?e.caption:void 0,icon:e.showIcon?n(q,{icon:l},null):void 0,disabled:s.disabled,clickableWhenHasChildren:!0,onClick:()=>{U.closeContextMenu(),a.doUIAction(e.uiactionId,t,i,e.appId)}}});switch(c.groupExtractMode){case"ITEMS":d.children=e;break;case"ITEMX":e&&(d=e[0],d.children=e.slice(1));break;default:d=void 0,e&&s.push(...e)}}}d&&s.push(d)}),s},W=_o(()=>{a.load()},500),Y=e=>{"F2"!==e.code&&"Enter"!==e.code||k()},K=()=>{var e;const t=null==(e=y.value)?void 0:e.$el.querySelector(".is-focus");P.value&&!t&&z()};d(()=>{var e;document.addEventListener("mouseup",K.bind(this)),null==(e=m.value)||e.$el.addEventListener("keydown",Y)}),h(()=>{var e;document.removeEventListener("mouseup",K.bind(this)),null==(e=m.value)||e.$el.removeEventListener("keydown",Y)});return{c:a,ns:u,treeRef:p,treeviewRef:m,treeNodeTextInputRef:b,treeData:j,treeRefreshKey:v,editingNodeKey:f,editingNodeText:w,cascadeSelect:s,newNodeKey:S,newNodeData:E,findNodeData:df,onCheck:(e,t)=>{const{checkedNodes:n}=t;a.setSelection(n)},onNodeClick:(t,n,i)=>{var o,s;if(i.stopPropagation(),!t._disableSelect&&!V){if((null==(o=p.value)?void 0:o.getCurrentKey())!==t._id||F.value||k(),null==(s=p.value)||s.setCurrentKey(t._id),a.state.navigational){const e=a.getNodeModel(t._nodeId);if(!(null==e?void 0:e.navAppViewId)){const e=L(t._id);a.onExpandChange(t,e)}}e.isSimple?p.value.setCurrentKey(null==n?void 0:n._id):a.onTreeNodeClick(t,i),V=!0,setTimeout(()=>{V=!1},200)}},onNodeDbClick:(e,t)=>{t.stopPropagation(),e._disableSelect||a.onDbTreeNodeClick(e)},onNodeContextmenu:async(e,t)=>{var n;t.preventDefault(),t.stopPropagation();let i=ibiz.config.tree.contextMenuRightClickInvoke;if((null==(n=a.controlParams)?void 0:n.contextmenurightclickinvoke)&&(i=Object.is(a.controlParams.contextmenurightclickinvoke,"true")),!i)return;const o=a.getNodeModel(e._nodeId);if(!(null==o?void 0:o.decontextMenu))return;const s=a.contextMenus[o.decontextMenu.id];if(!s.model.detoolbarItems)return;await s.calcButtonState(e._deData||(e.srfkey?e:void 0),o.appDataEntityId,{view:a.view,ctrl:a});const l=s.state.buttonsState,r=G(s.model.detoolbarItems,e,t,l);r.length&&U.showContextMenu({x:t.x,y:t.y,customClass:u.b("context-menu"),items:r})},loadData:async(t,n)=>{if(e.isSimple){let i=[];if(0===t.level){const e=a.state.items.find(e=>e.isRoot);e&&(i=[e])}else i=function(e,t,a){const{detreeNodeRSs:n}=t,i=[];if(!n||0===n.length)return i;const o=n.filter(t=>{var n;const i=e.state.items.find(e=>e._uuid===a.data._uuid);return!!i&&t.parentDETreeNodeId===(null==(n=i._nodeId)?void 0:n.toLowerCase())});return o.sort((e,t)=>e.ordervalue-t.ordervalue),o.forEach(t=>{const a=e.state.items.filter(e=>{var a;return(null==(a=e._nodeId)?void 0:a.toLowerCase())===t.childDETreeNodeId});a.length&&a.forEach(e=>{const t=jo(e);t._id=go(),i.push(t)})}),i}(a,e.modelData,t);return t._children=i,n(_(i)),void N()}let i;if(0===t.level)i=j.value,ibiz.log.debug("初始加载");else{const e=df(t.data._uuid,a);e._children?(ibiz.log.debug("节点展开加载-本地",e),i=e._children):(ibiz.log.debug("节点展开加载-远程",e),i=await a.loadNodes(e))}ibiz.log.debug("给树返回值",i),n(_(i)),N(),g(()=>{var e,n,i;R(0===t.level?null==(n=null==(e=a.state.rootNodes)?void 0:e[0])?void 0:n._id:null==(i=t.data)?void 0:i._id,t)})},renderContextMenu:(e,t)=>{var o,s;if(!(null==(s=null==(o=null==e?void 0:e.decontextMenu)?void 0:o.detoolbarItems)?void 0:s.length))return;const r=a.contextMenuInfos[e.id];return r.clickTBUIActionItem&&r.onlyOneActionItem?null:n(i("iBizContextMenuControl"),{class:u.bem("node","buttons",l.value),modelData:e.decontextMenu,groupLevelKeys:[50,100],nodeModel:e,nodeData:t,context:a.context,actionCallBack:(e,n)=>a.doUIAction(e.uiactionId,t,n,e.appId)},null)},renderCounter:e=>{if(e.counterId){const t=a.state.counterData[e.counterId];return n(i("iBizBadge"),{value:t,class:u.e("counter"),counterMode:e.counterMode},null)}},updateNodeExpand:(t,n)=>{const i=df(t._uuid,a);if(!i)throw new Vt(ibiz.i18n.t("control.common.noFoundNode",{id:t._uuid}));if(e.isSimple){const e=jo(i);e._id=t._id,a.onExpandChange(e,n)}else a.onExpandChange(i,n)},onInput:e=>{a.state.query=e,W()},allowDrop:(e,t,n)=>{var i;if(null==(i=t.data)?void 0:i._load_more)return!1;const o=df(e.data._uuid,a),s=df(t.data._uuid,a);return a.calcAllowDrop(o,s,n)},allowDrag:e=>{var t;if(null==(t=e.data)?void 0:t._load_more)return!1;const n=df(e.data._uuid,a);return a.calcAllowDrag(n)},handleDrop:(e,t,n)=>{const i=uf(n),o=df(e.data._uuid,a),s=df(t.data._uuid,a);a.onNodeDrop(o,s,i)},onNodeTextEditBlur:z,renderNewNode:()=>{var e,t,o,s;return I.value?P.value?n(i("iBizControlShell"),{class:[u.b("new-node"),null==(e=I.value.sysCss)?void 0:e.cssName],ref:y,data:D.value,modelData:P.value,context:a.context,params:a.params,onMouseup:e=>e.stopPropagation(),onPanelItemEvent:O,onKeydown:M},null):n("div",{class:[u.b("new-node"),null==(t=I.value.sysCss)?void 0:t.cssName],onClick:e=>{e.preventDefault(),e.stopPropagation()}},[(null==(o=I.value)?void 0:o.sysImage)?n(q,{class:u.be("node","icon"),icon:null==(s=I.value)?void 0:s.sysImage},null):null,n(i("el-input"),{modelValue:C.value,"onUpdate:modelValue":e=>C.value=e,ref:"treeNodeTextInputRef",class:u.b("editing-node"),onBlur:()=>{z()},onKeydown:e=>{A(e)}},null)]):null},handleEditKeyDown:A,handleLoadMore:async(e,t)=>{var n,i;if(e.stopPropagation(),!t)return;if(0===t.level)return void await a.loadNodes(void 0,!0);const o=df(null==(n=t.data)?void 0:n._uuid,a);if(!o)return;await a.loadNodes(o,!0);const s=_(o._children||[]);null==(i=p.value)||i.updateKeyChildren(o._id,s),N(),g(()=>{R(o._id,o)})}}},render(){const e={searchbar:()=>this.c.enableQuickSearch?n(i("el-input"),{"model-value":this.c.state.query,class:this.ns.b("quick-search"),placeholder:this.c.state.placeHolder,onInput:this.onInput},{prefix:()=>n("ion-icon",{class:this.ns.e("search-icon"),name:"search"},null)}):null},t=this.c.controlPanel?"tree":"default";return e[t]=()=>{if(this.c.state.isLoaded&&this.treeRefreshKey)return[n(i("el-tree"),y({ref:"treeRef",class:this.ns.b("tree"),key:this.treeRefreshKey,"node-key":"_id","highlight-current":!0,"expand-on-click-node":!1,"auto-expand-parent":!1,"show-checkbox":!this.c.state.singleSelect,"check-strictly":!this.cascadeSelect&&this.checkStrictly,"default-expanded-keys":this.c.state.expandedKeys,props:{label:"_text",children:"_children",isLeaf:"_leaf",disabled:"_disableSelect",class:e=>(null==e?void 0:e._load_more)?this.ns.is("load-more",!0):""},lazy:!0,load:this.loadData,onCheck:this.onCheck,onNodeExpand:e=>{this.updateNodeExpand(e,!0)},onNodeCollapse:e=>{this.updateNodeExpand(e,!1)},draggable:!0,"allow-drop":this.allowDrop,"allow-drag":this.allowDrag,onNodeDrop:this.handleDrop},this.$attrs),{default:({data:e,node:t})=>{var a,o;if(e._load_more)return n("div",{class:this.ns.b("node"),onClick:e=>{this.handleLoadMore(e,null==t?void 0:t.parent)}},[e._text]);if(this.newNodeKey===e._id)return this.renderNewNode();const s=this.findNodeData(e._uuid,this.c);if(!s)return null;const l=this.c.getNodeModel(s._nodeId);if(this.editingNodeKey===s._id)return n("div",{class:[this.ns.b("node"),null==(a=l.sysCss)?void 0:a.cssName]},[n(i("el-input"),{modelValue:this.editingNodeText,"onUpdate:modelValue":e=>this.editingNodeText=e,ref:"treeNodeTextInputRef",class:this.ns.b("editing-node"),onBlur:()=>{this.onNodeTextEditBlur()},onKeydown:e=>{this.handleEditKeyDown(e)}},null)]);const r=function(e){if(e.controlRenders){const t=e.controlRenders.filter(e=>"newnoderender"!==(e.id||"").split("_")[0]);return kn({controlRenders:t})}}(l);let c;return c=r?n(i("iBizControlShell"),{data:s,modelData:r,context:this.c.context,params:this.c.params},null):[s._icon?n(i("iBizIcon"),{class:this.ns.be("node","icon"),icon:s._icon},null):null,s._textHtml?n("span",{class:this.ns.be("node","label"),innerHTML:s._textHtml},null):n("span",{class:this.ns.be("node","label")},[s._text])],n("div",{class:[this.ns.b("node"),s._disableSelect?this.ns.bm("node","disabled"):"",null==(o=l.sysCss)?void 0:o.cssName],title:s._text,onDblclick:e=>this.onNodeDbClick(s,e),onClick:t=>this.onNodeClick(s,e,t),onContextmenu:e=>this.onNodeContextmenu(s,e)},[c,this.renderCounter(l),this.renderContextMenu(l,s)])}}),!this.newNodeData&&this.renderNewNode(),this.c.state.enableNavView&&this.c.state.showNavIcon?this.c.state.showNavView?n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.hiddenNav"),name:"eye-off-outline",onClick:()=>this.c.onShowNavViewChange()},null):n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.showNav"),name:"eye-outline",onClick:()=>this.c.onShowNavViewChange()},null):null]},n(i("iBizControlNavigation"),{controller:this.c},{default:()=>{return[b(n(i("iBizControlBase"),{ref:"treeviewRef",controller:this.c},(t=e,"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]})),[[C("loading"),this.c.state.isLoading]])];var t}})}});var pf=Object.defineProperty,mf=(e,t,a)=>(((e,t,a)=>{t in e?pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class vf{constructor(){mf(this,"component","IBizTreeControl")}}const gf=e("W",ie(hf,function(e){e.component(hf.name,hf),Ha(qa.TREEVIEW,()=>new vf)})),bf=a({name:"IBizPickupViewPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},singleSelect:{type:Boolean,default:!0},noLoadDefault:{type:Boolean,default:!1}},setup(){const e=ne((...e)=>new On(...e)),t=B("control-".concat(e.model.controlType.toLowerCase()));return{c:e,ns:t,onCreated:t=>{e.setEmbedView(t.view)}}},render(){return n(i("iBizControlBase"),{controller:this.c},{default:()=>[this.c.state.isCreated&&(this.$slots.default?this.$slots.default({context:this.c.state.context,params:this.c.state.params,state:{singleSelect:this.c.state.singleSelect,noLoadDefault:this.noLoadDefault},onCreated:this.onCreated}):l(i("IBizViewShell"),{context:this.c.state.context,params:this.c.state.params,viewId:this.c.model.embeddedAppDEViewId,state:{singleSelect:this.c.state.singleSelect,noLoadDefault:this.noLoadDefault},onCreated:this.onCreated}))]})}});var ff=Object.defineProperty,wf=(e,t,a)=>(((e,t,a)=>{t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class yf{constructor(){wf(this,"component","IBizPickupViewPanelControl")}}const Cf=e("X",ie(bf,function(e){e.component(bf.name,bf),Ha(qa.PICKUP_VIEW_PANEL,()=>new yf)}));const If=a({name:"IBizTabExpPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},defaultTabName:{type:String,required:!1}},setup(){var e;const t=ne((...e)=>new Mn(...e)),a=B("control-".concat(t.model.controlType.toLowerCase())),n=(null==(e=t.view.model.tabLayout)?void 0:e.toLowerCase())||"top",i=us();let o="";return t.routeDepth&&(o=me(i,t.routeDepth)),c(()=>i.fullPath,(e,a)=>{if(e!==a){const e=t.routeDepth;if(e){if(me(i,t.routeDepth)===o){const a=Y(i),{srfnav:n}=a.pathNodes[e-1];n&&t.state.activeName&&t.state.activeName!==n&&(t.state.activeName=n,t.handleTabChange())}}}},{immediate:!0}),{c:t,ns:a,tabPosition:n,handleTabChange:()=>{t.handleTabChange()}}},render(){let e;const{isCreated:t,tabPages:a,counterData:o}=this.c.state;return n(i("iBizControlBase"),{controller:this.c},{default:()=>{return[t&&n(i("el-tabs"),{modelValue:this.c.state.activeName,"onUpdate:modelValue":e=>this.c.state.activeName=e,tabPosition:this.tabPosition,onTabChange:this.handleTabChange},(l=e=a.map(e=>{const t=e.counterId?o[e.counterId]:void 0;return n(i("el-tab-pane"),{class:[this.ns.e("tab-item")],label:e.caption,name:e.tabTag},{label:()=>n("span",{class:[...e.class]},[this.c.isShowIcon&&n(i("iBizIcon"),{icon:e.sysImage},null),this.c.isShowCaption&&e.caption,!Po(t)&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:t},null)])})}),"function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?e:{default:()=>[e]}))];var l}})}});var xf=Object.defineProperty,Sf=(e,t,a)=>(((e,t,a)=>{t in e?xf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ef{constructor(){Sf(this,"component","IBizTabExpPanelControl")}}const Df=e("Y",ie(If,function(e){e.component(If.name,If),Ha(qa.TAB_EXP_PANEL,()=>new Ef)}));function Pf(e,t){const a=B("exp-bar"),o=_o(()=>{e.load()},500),s=t=>{e.state.query=t,o()};return{renderTitle:()=>{const{model:o}=e;if(!o.showTitleBar)return null;let s=o.title;return o.titleLanguageRes&&(s=ibiz.i18n.t(o.titleLanguageRes.lanResTag,o.title)),n("div",{class:[t.b("caption"),a.b("caption")]},[o.sysImage&&n(i("iBizIcon"),{class:[a.be("caption","icon")],icon:o.sysImage},null),s&&n("span",{class:[t.be("caption","text")]},[s])])},renderSearchBar:()=>{var o,r;const{model:c}=e;if(!c.enableSearch)return null;const d=null==(r=null==(o=e.view.model.viewLayoutPanel)?void 0:o.controls)?void 0:r.find(e=>"searchbar"===e.id);if(d){const t={context:e.context,params:e.params},a=i("IBizControlShell");return l(a,{modelData:d,...t})}return n(i("el-input"),{"model-value":e.state.query,class:[t.b("quick-search"),a.b("quick-search")],placeholder:e.state.placeHolder,onInput:s},{prefix:()=>n("ion-icon",{class:t.e("search-icon"),name:"search"},null)})}}}function kf(e){const t=e.view.modal.routeDepth;if(t){const a=us();let n;ve(({currentKey:i,fullPath:o})=>{if(n){if(n===i){const n=Y(a),{srfnav:i}=n.pathNodes[t-1];e.onRouterChange({srfnav:i||"",path:o})}}else n=i},t)}}const zf=a({name:"IBizTreeExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},noNeedNavView:{type:Boolean,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Nn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);kf(e);const i=r(()=>e.view.model.viewType&&!["DEMPICKUPVIEW2","DEPICKUPVIEW2"].includes(e.view.model.viewType));return{c:e,ns:t,navigational:i,renderTitle:a,renderSearchBar:n}},render(){const{state:e,XDataModel:t}=this.c,{isCreated:a}=e,o={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(a&&t){const e=this.c.controlPanel?t.name:"default";o[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,navigational:this.navigational,mdctrlActiveMode:1,loadDefault:!1,"default-expanded-keys":this.c.defaultExpandedKeys},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(l=o)||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?o:{default:()=>[o]});var l}});var Tf=Object.defineProperty,Af=(e,t,a)=>(((e,t,a)=>{t in e?Tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Of{constructor(){Af(this,"component","IBizTreeExpBarControl")}}const Mf=e("Z",ie(zf,function(e){e.component(zf.name,zf),Ha(qa.TREE_EXP_BAR,()=>new Of)}));const Nf=a({name:"IBizListExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Bn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{isCreated:e}=this.c.state,{XDataModel:t}=this.c,a={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(e&&t){const e=this.c.controlPanel?t.name:"default";a[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}});var Bf=Object.defineProperty,Lf=(e,t,a)=>(((e,t,a)=>{t in e?Bf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Rf{constructor(){Lf(this,"component","IBizListExpBarControl")}}const _f=e("_",ie(Nf,function(e){e.component(Nf.name,Nf),Ha(qa.LIST_EXPBAR,()=>new Rf)}));const jf=a({name:"IBizGridExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Bn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{isCreated:e}=this.c.state,{XDataModel:t}=this.c,a={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(e&&t){const e=this.c.controlPanel?t.name:"default";a[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}});var Vf=Object.defineProperty,Ff=(e,t,a)=>(((e,t,a)=>{t in e?Vf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Uf{constructor(){Ff(this,"component","IBizGridExpBarControl")}}const Hf=e("$",ie(jf,function(e){e.component(jf.name,jf),Ha(qa.GRID_EXPBAR,()=>new Uf)}));const qf=a({name:"IBizDataViewExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Bn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{isCreated:e}=this.c.state,{XDataModel:t}=this.c,a={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(e&&t){const e=this.c.controlPanel?t.name:"default";a[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}});var Gf=Object.defineProperty,Wf=(e,t,a)=>(((e,t,a)=>{t in e?Gf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Yf{constructor(){Wf(this,"component","IBizDataViewExpBarControl")}}const Kf=e("a0",ie(qf,function(e){e.component(qf.name,qf),Ha(qa.DATA_VIEW_EXPBAR,()=>new Yf)}));const Xf=a({name:"IBizCalendarExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Ln(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{state:e,XDataModel:t}=this.c,{isCreated:a}=e,o={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(a&&t){const e=this.c.controlPanel?t.name:"default";o[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(l=o)||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?o:{default:()=>[o]});var l}});var $f=Object.defineProperty,Jf=(e,t,a)=>(((e,t,a)=>{t in e?$f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Qf{constructor(){Jf(this,"component","IBizCalendarExpBarControl")}}const Zf=e("a1",ie(Xf,function(e){e.component(Xf.name,Xf),Ha(qa.CALENDAR_EXPBAR,()=>new Qf)}));const ew=a({name:"IBizChartExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Rn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{isCreated:e}=this.c.state,{XDataModel:t}=this.c,a={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(e&&t){const e=this.c.controlPanel?t.name:"default";a[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}});var tw=Object.defineProperty,aw=(e,t,a)=>(((e,t,a)=>{t in e?tw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class nw{constructor(){aw(this,"component","IBizChartExpBarControl")}}const iw=e("a2",ie(ew,function(e){e.component(ew.name,ew),Ha(qa.CHART_EXPBAR,()=>new nw)})),ow=a({name:"IBizSearchBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){var e;const t=ne((...e)=>new _n(...e)),a=o({}),s=e=>{a.value=e};t.evt.on("onCreated",()=>{t.counter&&t.counter.onChange(s,!0)}),h(()=>{var e;null==(e=t.counter)||e.offChange(s)}),t.setStorageKeyFn(ge(t.context,"SEARCH_BAR_SELECTED_GROUP",t.view.modal.routeDepth,"@","".concat(t.view.model.codeName,"@").concat(t.model.codeName)));const l=B("control-".concat(t.model.controlType.toLowerCase()));let c=!1;const d=()=>{c=!0,t.onSearch()},u=r(()=>t.model.quickSearchWidth?l.cssVarBlock({"quick-search-width":"".concat(t.model.quickSearchWidth,"px")}):{});if(t.model.enableGroup&&t.model.searchBarGroups&&(null==(e=t.model.searchBarGroups)?void 0:e.length)>0){const e=t.model.searchBarGroups.find(e=>e.defaultGroup);t.state.selectedGroupItem=e||t.model.searchBarGroups[0]}const p=o();let m;return{c:t,ns:l,cssVars:u,filterButtonRef:p,counterData:a,onClear:()=>{!0===c&&(c=!1,t.onSearch())},onSearch:d,onKeydown:e=>{"Enter"===e.code&&d()},onGroupClick:e=>{t.state.selectedGroupItem=e,t.evt.emit("onTabChange",{data:[e]}),d()},triggerFilter:()=>{m?m.dismiss():(async()=>{m=ibiz.overlay.createPopover(()=>n(i("iBizFilterTreeControl"),{filterControllers:t.filterControllers,filterNodes:t.state.filterNodes,parent:"search-bar",filterMode:t.state.filterMode,customCond:t.state.customCond,context:t.context,params:t.params,schemaEntityMap:t.schemaEntityMap,onCustomCondChange:e=>{t.state.customCond=e},onConfirm:(e,a)=>{t.state.filterMode=e,t.state.customCond=a,t.onSearch(),m&&m.dismiss()},onCancel:()=>{t.resetFilter(),t.state.customCond=""}},null),void 0,{placement:"bottom-end",autoClose:!0}),m.present(p.value.$el),await m.onWillDismiss(),m=void 0})()},handleSave:()=>{t.handleSave()},renderAdvancedSearch:()=>t.state.advancedQuickSearch?n(i("iBizQuickSearchSelect"),{controller:t},null):null}},render(){return n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b()],style:this.cssVars},{default:()=>{var e;return[this.c.model.enableGroup&&(this.c.isBackendSearchGroup?n(i("iBizSearchGroups"),{controller:this.c,counterData:this.counterData},null):n("div",{class:this.ns.b("quick-group")},[null==(e=this.c.model.searchBarGroups)?void 0:e.map(e=>{var t;return this.c.calcCountVisible(e)?n("span",{class:[this.ns.b("quick-group-item"),this.ns.is("selected",(null==(t=this.c.state.selectedGroupItem)?void 0:t.id)===e.id)],onClick:()=>this.onGroupClick(e)},[e.caption,e.counterId&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:this.counterData[e.counterId],counterMode:e.counterMode},null)]):null})])),this.c.model.enableGroup&&this.c.isBackendSearchGroup&&n(i("el-button"),{class:this.ns.b("save"),title:Tt(ibiz.i18n.t("control.searchBar.saveGroup")),onClick:this.handleSave},{default:()=>[n("ion-icon",{name:"save-outline"},null)]}),this.c.model.enableQuickSearch&&n(i("el-input"),{modelValue:this.c.state.query,"onUpdate:modelValue":e=>this.c.state.query=e,class:[this.ns.b("quick-search"),this.ns.is("advanced-quick-search",this.c.state.advancedQuickSearch)],placeholder:this.c.state.quickSearchPlaceHolder,clearable:!0,onKeydown:this.onKeydown,onClear:this.onClear,"suffix-icon":n("ion-icon",{onClick:this.onSearch,class:this.ns.e("search-icon"),name:"search"},null)},{prepend:()=>this.renderAdvancedSearch()}),this.c.enableFilter&&n(i("el-button"),{ref:"filterButtonRef",type:"primary",title:Tt(ibiz.i18n.t("control.searchBar.filter")),class:this.ns.b("filter"),onClick:()=>this.triggerFilter()},{default:()=>[n(i("iBizIcon"),{icon:{cssClass:"funnel-outline"}},null)]})]}})}});var sw=Object.defineProperty,lw=(e,t,a)=>(((e,t,a)=>{t in e?sw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class rw{constructor(){lw(this,"component","IBizSearchBarControl")}}function cw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const dw=[{valueOP:Oa.EQ,label:"等于(=)"},{valueOP:Oa.NOT_EQ,label:"不等于(<>)"},{valueOP:Oa.GT,label:"大于(>)"},{valueOP:Oa.GT_AND_EQ,label:"大于等于(>=)"},{valueOP:Oa.LT,label:"小于(<)"},{valueOP:Oa.LT_AND_EQ,label:"小于等于(<=)"},{valueOP:Oa.IS_NULL,label:"值为空(Nil)"},{valueOP:Oa.IS_NOT_NULL,label:"值不为空(NotNil)"},{valueOP:Oa.IN,label:"值在范围中(In)"},{valueOP:Oa.NOT_IN,label:"值不在范围中(NotIn)"},{valueOP:Oa.LIKE,label:"文本包含(%)"},{valueOP:Oa.LIFT_LIKE,label:"文本左包含(%#)"},{valueOP:Oa.RIGHT_LIKE,label:"文本右包含(#%)"},{valueOP:Oa.EXISTS,label:"存在(EXISTS)"},{valueOP:Oa.NOT_EXISTS,label:"不存在(NOTEXISTS)"}],uw=[Oa.IS_NULL,Oa.IS_NOT_NULL,Oa.EXISTS,Oa.NOT_EXISTS],hw=a({name:"IBizFilterTreeControl",props:{filterControllers:{type:Array,required:!0},filterNodes:{type:Array,required:!0},parent:{type:String,required:!0},filterMode:{type:String,default:"default"},customCond:{type:String,default:""},context:{type:Object},params:{type:Object},schemaEntityMap:{type:Object,default:()=>new Map}},emits:["confirm","cancel","change","customCondChange"],setup(e,{emit:t}){const a=B("filter-tree"),s=r(()=>"search-bar"===e.parent),d=r(()=>e.filterNodes),u=t=>{if("ITEMS"===t.nodeType&&t.simple){const a=t.children[0];return e.filterControllers.find(e=>{if("SIMPLE_ITEMS"===e.type){const n=e;if(n.fieldName===t.field&&n.valueOP===t.valueOP&&n.subFieldName===a.field&&n.subValueOP===a.valueOP)return!0}return!1})}const{field:a,valueOP:n}=t;return e.filterControllers.find(e=>"SIMPLE_ITEMS"!==e.type&&(e.fieldName===a&&(!e.valueOP||e.valueOP===n)))},h=[];e.filterControllers.forEach(e=>{let t=h.find(t=>t.name===e.key);e.hidden||(void 0===t&&(t={name:e.key,fieldName:e.fieldName,label:e.label,valueOPs:[]},"SIMPLE_ITEMS"===e.type&&(t.simpleFilterC=e),h.push(t)),e.valueOP?t.valueOPs.push(e.valueOP):t.valueOPs=dw.map(e=>e.valueOP))});const m=o([]);h.forEach(async t=>{var a,n;const i=e.filterControllers.find(e=>e.key===t.name);i&&m.value.push({appDEFieldId:t.fieldName,caption:t.label,valueOPs:t.valueOPs,appDataEntityId:e.schemaEntityMap.get(t.fieldName),appDataEntityFullTag:null==(a=i.appDataEntity)?void 0:a.defullTag,appCodeListId:null==(n=i.model.editor)?void 0:n.appCodeListId})});const v=o(),g=o(e.filterMode||"default"),b=o(""),f=e=>{b.value=e,t("customCondChange",b.value)};c(()=>e.customCond,()=>{b.value=e.customCond},{immediate:!0});const w=(e,t,a=h)=>{const n=a.find(e=>e.name===t);n?(bo(e),n.simpleFilterC?n.simpleFilterC.addSimpleFilterNode(e):(e.nodeType="FIELD",e.field=n.fieldName)):ibiz.log.error("allFields找不到属性标识为".concat(t,"的"))},y=e=>{e.children.push({nodeType:"FIELD",field:null,valueOP:null,value:null})},C=(e,t)=>{if(t.noEditor||e.valueOP&&uw.includes(e.valueOP))return null;let o=null;if(t.editorProvider){const{data:a,value:n}=t.calcEditorProps(e),s=i(t.editorProvider.formEditor);o=l(s,{key:t.editor.model.id,value:n,controller:t.editor,disabled:e.disabled,data:a,onChange:(a,n)=>{t.onEditorChange(e,a,n)}})}else o=n(i("not-supported-editor"),{modelData:t.model.editor},null);return n("div",{class:a.e("editor")},[o])},I=(e,t)=>{if(e.hidden)return;let o=h;t&&(o=t.allFields);const s=((e,t=h)=>{if(!e)return;const a=t.find(t=>t.name===e);return a?a.valueOPs:void 0})(e.field,o);let l=null;if(e.field&&e.valueOP)if(t){const a=t.getSubFilterController(e.field,e.valueOP);l=C(e,a)}else{const t=u(e);t&&!["EXISTS","NOTEXISTS"].includes(t.valueOP)&&(l=C(e,t))}return n("div",{class:a.b("item")},[n(i("el-select"),{disabled:e.disabled,"model-value":e.field,teleported:!1,class:a.e("field-select"),onChange:t=>{w(e,t,o)}},{default:()=>[null==o?void 0:o.map(e=>n(i("el-option"),{key:e.name,value:e.name,label:e.label},null))]}),s&&s.length>0&&n(i("iBizFilterModeSelect"),{disabled:e.disabled,class:a.e("mode-select"),value:e.valueOP,modes:s,onChange:t=>{((e,t)=>{e.valueOP=t,e.value=null,["EXISTS","NOTEXISTS"].includes(t)?Object.assign(e,{nodeType:"ITEMS",children:[{nodeType:"FIELD",field:null,valueOP:null,value:null}]}):Object.assign(e,{nodeType:"FIELD",children:void 0})})(e,t)}},null),l])};let x=e=>n("div",null,null);const S=(t,o,l)=>{if(!t.hidden)return"ITEMS"===t.nodeType?x(t):n("div",{class:a.b("group")},[n("div",{class:a.be("group","actions")},[n(i("el-button"),{text:!0,type:"primary",onClick:()=>{"pql"!==g.value?(e=>{e.children.push({nodeType:"GROUP",logicType:"AND",children:[{nodeType:"FIELD",field:null,valueOP:null,value:null}]})})(t):g.value="default"}},{default:()=>["pql"===g.value?"切换组":"添加组"]}),n(i("el-button"),{text:!0,onClick:()=>{"pql"!==g.value?y(t):g.value="default"}},{default:()=>["pql"===g.value?"切换项":"添加项"]}),l&&s.value&&n(i("el-button"),{text:!0,onClick:()=>{g.value="pql"}},{default:()=>[p("添加PQL")]}),n(i("el-select"),{"model-value":t.logicType,teleported:!1,class:a.be("group","logic-type"),onChange:e=>{g.value="default",((e,t)=>{e.logicType=t})(t,e)}},{default:()=>[n(i("el-option"),{key:"AND",value:"AND",label:"AND"},null),n(i("el-option"),{key:"OR",value:"OR",label:"OR"},null)]})]),"pql"===g.value&&n("div",{class:a.be("group","editor")},[n(i("iBizPqlEditor"),{ref:"pqlEditor",value:b.value,fields:m.value,context:e.context,params:e.params,onChange:f},null)]),"pql"!==g.value&&n("div",{class:a.be("group","list")},[t.children.length>0&&t.children.map((e,s)=>{const l="FIELD"===e.nodeType?I(e,o):S(e,o);return l?n("div",{class:a.be("group","list-item")},[n("div",{class:a.be("group","list-item-left")},[t.logicType]),l,n(i("iBizIcon"),{class:a.be("group","list-item-right"),onClick:()=>{t.children.splice(s,1)},icon:{cssClass:"trash"}},null)]):null})])])};x=e=>{let t;const o=u(e);if(o){if(e.simple){let t;const s=e.children[0];if(!s)return;return[n(i("el-select"),{disabled:s.disabled,"model-value":o.key,teleported:!1,class:a.e("field-select"),onChange:t=>{w(e,t)}},cw(t=h.map(e=>n(i("el-option"),{key:e.name,value:e.name,label:e.label},null)))?t:{default:()=>[t]}),n(i("iBizFilterModeSelect"),{disabled:!0,class:a.e("mode-select"),value:s.valueOP,modes:[s.valueOP]},null),C(s,o)]}return n("div",{class:(a.b("group"),a.bm("group","items"))},[n("div",{class:a.be("group","actions")},[I(e),n(i("el-button"),{text:!0,onClick:()=>{y(e)}},cw(t=ibiz.i18n.t("control.searchBar.filterTree.addItem"))?t:{default:()=>[t]})]),n("div",{class:a.be("group","list")},[e.children.length>0&&e.children.map((t,s)=>{const l="FIELD"===t.nodeType?I(t,o):S(t,o);return n("div",{class:a.be("group","list-item")},[n("div",{class:a.be("group","list-item-left")},[p("AND")]),l,n(i("iBizIcon"),{class:a.be("group","list-item-right"),onClick:()=>{e.children.splice(s,1)},icon:{cssClass:"trash"}},null)])})])])}};return{ns:a,renderFilterGroup:S,renderFilterItem:I,onConfirm:()=>{var e,a;if("pql"!==g.value)t("confirm",g.value,b.value);else if(v.value){(null==(a=(e=v.value).verify)?void 0:a.call(e))&&t("confirm",g.value,b.value)}},onCancel:()=>{t("cancel")},isInSearchBar:s,UiFilterNodes:d,pqlEditor:v}},render(){let e;return n("div",{class:[this.ns.b()]},[this.UiFilterNodes.length>0&&this.UiFilterNodes.map(e=>"FIELD"===e.nodeType?this.renderFilterItem(e):this.renderFilterGroup(e,void 0,!0)),n("div",{class:this.ns.b("footer")},[n(i("el-button"),{onClick:()=>{this.onConfirm()}},{default:()=>[this.isInSearchBar?ibiz.i18n.t("app.search"):ibiz.i18n.t("control.common.determine")]}),n(i("el-button"),{onClick:()=>{this.onCancel()}},cw(e=ibiz.i18n.t("app.reset"))?e:{default:()=>[e]})])])}});const pw=[{valueOP:Oa.EQ,label:"等于(=)"},{valueOP:Oa.NOT_EQ,label:"不等于(<>)"},{valueOP:Oa.GT,label:"大于(>)"},{valueOP:Oa.GT_AND_EQ,label:"大于等于(>=)"},{valueOP:Oa.LT,label:"小于(<)"},{valueOP:Oa.LT_AND_EQ,label:"小于等于(<=)"},{valueOP:Oa.IS_NULL,label:"值为空(Nil)"},{valueOP:Oa.IS_NOT_NULL,label:"值不为空(NotNil)"},{valueOP:Oa.IN,label:"值在范围中(In)"},{valueOP:Oa.NOT_IN,label:"值不在范围中(NotIn)"},{valueOP:Oa.LIKE,label:"文本包含(%)"},{valueOP:Oa.LIFT_LIKE,label:"文本左包含(%#)"},{valueOP:Oa.RIGHT_LIKE,label:"文本右包含(#%)"},{valueOP:Oa.EXISTS,label:"存在(EXISTS)"},{valueOP:Oa.NOT_EXISTS,label:"不存在(NOTEXISTS)"}],mw=a({name:"IBizFilterModeSelect",props:{value:String,modes:Array,disabled:Boolean},emits:{change:e=>!0},setup:(e,{emit:t})=>({availableModes:r(()=>{var t;return(null==(t=e.modes)?void 0:t.length)?pw.filter(t=>e.modes.includes(t.valueOP)):pw}),onChange:e=>{t("change",e)}}),render(){let e;return n(i("el-select"),{"model-value":this.value,disabled:this.disabled,teleported:!1,onChange:e=>{this.onChange(e)}},"function"==typeof(t=e=this.availableModes.map(e=>n(i("el-option"),{key:e.valueOP,value:e.valueOP,label:e.label},null)))||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]});var t}});function vw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const gw=a({name:"IBizSearchGroups",components:{draggable:is},props:{controller:{type:Object,required:!0},counterData:{type:Object,default:()=>{}}},setup(e){const t=B("search-groups"),a=e.controller,i=o(!1),{newDialogVisible:s,newForm:l,newFormRef:c,newFormRules:d,handleNewFormSubmit:h,handleNewFormCancel:p}=function(e){const t=o(!1),a=u({caption:""}),n=o(),i=u({caption:[{required:!0,message:ibiz.i18n.t("control.searchBar.searchGroups.groupValueRule"),trigger:"blur"}]}),s=()=>{n.value&&n.value.resetFields(),t.value=!1};return{newDialogVisible:t,newForm:a,newFormRef:n,newFormRules:i,handleNewFormSubmit:async()=>{n.value&&await n.value.validate(async(t,n)=>{if(t){if(e.state.searchBarGroups.find(e=>e.caption===a.caption))return void ibiz.message.error(ibiz.i18n.t("control.searchBar.searchGroups.errorMessage"));await e.service.create(a.caption),s(),await e.initSearBarGroups(),ibiz.message.success("".concat(ibiz.i18n.t("control.common.newSuccCreated"),"!"))}})},handleNewFormCancel:s}}(a),{editDialogVisible:m,editForm:v,editFormRef:g,editFormRules:b,handleEditFormSubmit:f,handleEditFormCancel:w}=function(e){const t=o(!1),a=u({caption:""}),n=o(),i=u({caption:[{required:!0,message:ibiz.i18n.t("control.searchBar.searchGroups.groupValueRule"),trigger:"blur"}]});return{editDialogVisible:t,editForm:a,editFormRef:n,editFormRules:i,handleEditFormSubmit:async()=>{n.value&&await n.value.validate(async(n,i)=>{if(n){if(e.currentEditGroup&&(await e.service.update(e.currentEditGroup.id,{caption:a.caption})).ok){const t=e.state.searchBarGroups.findIndex(t=>t.id===e.currentEditGroup.id);-1!==t&&(e.state.searchBarGroups[t].caption=a.caption)}ibiz.message.success("".concat(ibiz.i18n.t("control.common.updateSuccess"),"!")),t.value=!1}})},handleEditFormCancel:()=>{t.value=!1}}}(a),y=a.model.quickGroupCount||4,C=r(()=>a.state.searchBarGroups.filter(e=>e.show).slice(0,y)),I=r(()=>a.state.searchBarGroups.filter(e=>e.show).slice(y)),x=r(()=>!!a.state.selectedSearchGroupItem&&I.value.includes(a.state.selectedSearchGroupItem));return{ns:t,c:a,showGroups:C,hiddenGroups:I,onGroupClick:e=>{a.handleGroupClick(e)},newDialogVisible:s,editDialogVisible:m,manageDialogVisible:i,newGroup:()=>{s.value=!0},manageGroup:()=>{i.value=!0},newForm:l,newFormRef:c,newFormRules:d,handleNewFormSubmit:h,handleNewFormCancel:p,editForm:v,editFormRef:g,editFormRules:b,handleEditFormSubmit:f,handleEditFormCancel:w,editGroup:e=>{m.value=!0,a.currentEditGroup=e,v.caption=e.caption||e.name},removeGroup:e=>{Co({title:ibiz.i18n.t("control.searchBar.searchGroups.delTitle"),message:()=>n("div",{class:t.b("remove-dialog")},[n("div",{class:t.b("remove-dialog-content"),innerHTML:ibiz.i18n.t("control.searchBar.searchGroups.confirmDelPrompt",{itemName:e.caption||e.name})},null),n("div",{class:t.b("remove-dialog-tip")},[ibiz.i18n.t("control.searchBar.searchGroups.unrecoverablePrompt")])]),showCancelButton:!0,confirmButtonText:ibiz.i18n.t("control.common.determine"),confirmButtonClass:t.b("remove-confirm-btn"),cancelButtonText:ibiz.i18n.t("app.cancel"),cancelButtonClass:t.b("remove-cancel-btn")}).then(async()=>{if(e.id){if((await a.service.remove(e.id)).ok){const t=a.state.searchBarGroups.findIndex(t=>t.name===e.name);-1!==t&&a.state.searchBarGroups.splice(t,1)}ibiz.message.success("".concat(ibiz.i18n.t("control.common.deleteSuccess"),"!")),await a.initSearBarGroups()}}).catch(()=>{})},isActiveMore:x,onDragChange:async e=>{if(a.state.searchBarGroups.forEach((e,t)=>{e.order=100*(t+1)}),e.moved){const t=e.moved.newIndex,n=e.moved.oldIndex,i=Math.min(t,n),o=Math.max(t,n)+1,s=a.state.searchBarGroups.slice(i,o);if(s.length>0){const e=async()=>{await a.service.updateBatch(s)},t=s.filter(e=>!e.saved);if(t.length){const n=await a.service.createBatch(t);if(n.ok&&n.data&&n.data[0]){const i=n.data[0];i.length>0&&i.forEach(e=>{const t=s.find(t=>t.name===e.name);t&&Wt(t,e)}),await e(),t.forEach(e=>{const t=a.state.searchBarGroups.find(t=>t.name===e.name);t&&(t.saved=!0)})}}else await e()}}},editLinkTitle:e=>e.saved?e.noEdit?ibiz.i18n.t("control.searchBar.searchGroups.noEditPrompt"):"":ibiz.i18n.t("control.searchBar.searchGroups.savePrompt")}},render(){var e;return n("div",{class:this.ns.b()},[null==(e=this.showGroups)?void 0:e.map(e=>{var t;return this.c.calcCountVisible(e)?n("span",{class:[this.ns.b("quick-group-item"),this.ns.is("selected",(null==(t=this.c.state.selectedSearchGroupItem)?void 0:t.name)===e.name)],onClick:()=>this.onGroupClick(e)},[e.caption||e.name,e.counterId&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:this.counterData[e.counterId],counterMode:e.counterMode},null)]):null}),n(i("el-dropdown"),{"popper-class":this.ns.b("dropdown")},{default:()=>{var e;return n("div",{class:[this.ns.b("more"),this.ns.is("selected",this.isActiveMore)]},[this.isActiveMore?null==(e=this.c.state.selectedSearchGroupItem)?void 0:e.caption:this.c.model.groupMoreText||ibiz.i18n.t("app.more"),n("ion-icon",{name:"chevron-down-outline"},null)])},dropdown:()=>n(i("el-dropdown-menu"),null,{default:()=>[this.hiddenGroups.map(e=>n(i("el-dropdown-item"),{onClick:()=>this.onGroupClick(e)},{default:()=>{var t;return[n("ion-icon",{name:"list-outline"},null),n("span",{class:this.ns.b("item-caption")},[e.caption||e.name]),(null==(t=this.c.state.selectedSearchGroupItem)?void 0:t.name)===e.name&&n("ion-icon",{name:"checkmark-outline"},null)]}})),n(i("el-dropdown-item"),{divided:this.hiddenGroups.length>0,onClick:this.newGroup},{default:()=>[n("ion-icon",{name:"add-outline"},null),n("span",{class:this.ns.b("item-caption")},[ibiz.i18n.t("control.searchBar.searchGroups.newGroup")])]}),n(i("el-dropdown-item"),{onClick:this.manageGroup},{default:()=>[n("ion-icon",{name:"settings-outline"},null),n("span",{class:this.ns.b("item-caption")},[ibiz.i18n.t("control.searchBar.searchGroups.groupManage")])]})]})}),n(i("el-dialog"),{modelValue:this.newDialogVisible,"onUpdate:modelValue":e=>this.newDialogVisible=e,title:Tt(ibiz.i18n.t("control.searchBar.searchGroups.newGroup")),"modal-class":this.ns.b("new-dialog")},{default:()=>n(i("el-form"),{ref:"newFormRef",model:this.newForm,"label-position":"top",rules:this.newFormRules},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("control.searchBar.searchGroups.groupName"),prop:"caption"},{default:()=>[n(i("el-input"),{modelValue:this.newForm.caption,"onUpdate:modelValue":e=>this.newForm.caption=e,placeholder:ibiz.i18n.t("control.searchBar.searchGroups.enterPrompt")},null)]})]}),footer:()=>{let e,t;return n("div",{class:this.ns.b("new-dialog-footer")},[n(i("el-button"),{class:this.ns.b("cancel-btn"),onClick:this.handleNewFormCancel},vw(e=ibiz.i18n.t("control.searchBar.searchGroups.dialogCancel"))?e:{default:()=>[e]}),n(i("el-button"),{type:"primary",onClick:this.handleNewFormSubmit},vw(t=ibiz.i18n.t("control.searchBar.searchGroups.dialogDetermine"))?t:{default:()=>[t]})])}}),n(i("el-dialog"),{modelValue:this.editDialogVisible,"onUpdate:modelValue":e=>this.editDialogVisible=e,title:Tt(ibiz.i18n.t("control.searchBar.searchGroups.editGroup")),"modal-class":this.ns.b("edit-dialog")},{default:()=>n(i("el-form"),{ref:"editFormRef",model:this.editForm,"label-position":"top",rules:this.editFormRules},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("control.searchBar.searchGroups.groupName"),prop:"caption"},{default:()=>[n(i("el-input"),{modelValue:this.editForm.caption,"onUpdate:modelValue":e=>this.editForm.caption=e,placeholder:ibiz.i18n.t("control.searchBar.searchGroups.enterPrompt")},null)]})]}),footer:()=>{let e,t;return n("div",{class:this.ns.b("edit-dialog-footer")},[n(i("el-button"),{class:this.ns.b("cancel-btn"),onClick:this.handleEditFormCancel},vw(e=ibiz.i18n.t("control.searchBar.searchGroups.dialogCancel"))?e:{default:()=>[e]}),n(i("el-button"),{type:"primary",onClick:this.handleEditFormSubmit},vw(t=ibiz.i18n.t("control.searchBar.searchGroups.dialogDetermine"))?t:{default:()=>[t]})])}}),n(i("el-dialog"),{modelValue:this.manageDialogVisible,"onUpdate:modelValue":e=>this.manageDialogVisible=e,title:Tt(ibiz.i18n.t("control.searchBar.searchGroups.groupManage")),"modal-class":this.ns.b("manage-dialog")},{default:()=>[n("div",{class:this.ns.b("manage-dialog-content")},[n("div",{class:this.ns.b("content-top")},[n("div",{class:this.ns.b("content-top-left")},[n("ion-icon",{name:"alert-circle-outline"},null),ibiz.i18n.t("control.searchBar.searchGroups.manageTips")]),n("div",{class:this.ns.b("content-top-right")},[n(i("el-button"),{onClick:()=>{this.newDialogVisible=!0}},{default:()=>[n("ion-icon",{name:"add-outline"},null),ibiz.i18n.t("control.searchBar.searchGroups.newGroup")]})])]),n("div",{class:this.ns.b("content-bottom")},[n("div",{class:this.ns.b("table-header")},[n("div",{class:this.ns.b("name")},[ibiz.i18n.t("control.searchBar.searchGroups.name")]),n("div",{class:this.ns.b("show")},[ibiz.i18n.t("control.searchBar.searchGroups.show")]),n("div",{class:this.ns.b("action")},[ibiz.i18n.t("control.searchBar.searchGroups.operate")])]),n(is,{class:this.ns.b("table-body"),modelValue:this.c.state.searchBarGroups,"onUpdate:modelValue":e=>this.c.state.searchBarGroups=e,group:this.c.model.id,itemKey:"id",sort:!0,"force-fallback":!0,animation:500,"ghost-class":this.ns.b("table-row-ghost"),onChange:e=>this.onDragChange(e)},{item:({element:e})=>{let t,a;return n("div",{class:this.ns.b("table-row")},[n("div",{class:this.ns.b("name")},[e.caption||e.name]),n("div",{class:this.ns.b("show")},[n(i("el-switch"),{modelValue:e.show,"onUpdate:modelValue":t=>e.show=t},null)]),n("div",{class:this.ns.b("action")},[n(i("el-link"),{type:"primary",disabled:!e.saved||e.noEdit,title:Tt(this.editLinkTitle(e)),onClick:()=>this.editGroup(e)},vw(t=ibiz.i18n.t("app.edit"))?t:{default:()=>[t]}),n(i("el-link"),{type:"danger",disabled:!e.saved||"SYSTEM"===e.ownerType,title:Tt(e.saved&&"SYSTEM"!==e.ownerType?"":ibiz.i18n.t("control.searchBar.searchGroups.savePrompt")),onClick:()=>this.removeGroup(e)},vw(a=ibiz.i18n.t("app.delete"))?a:{default:()=>[a]})])])}})])])]})])}});const bw=a({name:"IBizQuickSearchSelect",props:{controller:{type:_n,required:!0}},setup:e=>({ns:B("quick-search-select"),onItemClick:t=>{const a=t.fieldName,{quickSearchFieldNames:n}=e.controller.state,i=n.indexOf(a);if(-1===i)n.push(a);else{if(n.length<=1)return;n.splice(i,1)}e.controller.calcQuickSearchPlaceHolder()}}),render(){const{state:e}=this.controller;return n(i("el-dropdown"),{onCommand:this.onItemClick,trigger:"click","hide-on-click":!1,class:[this.ns.b()],"popper-class":[this.ns.b("popover")]},{default:()=>n("div",{title:ibiz.i18n.t("control.searchBar.quickSearchSelect.searchField"),class:this.ns.e("icon")},[n("ion-icon",{name:"settings-outline"},null)]),dropdown:()=>{let t;return n(i("el-dropdown-menu"),null,"function"==typeof(a=t=e.quickSearchItems.map(t=>{const a=e.quickSearchFieldNames.includes(t.fieldName);return n(i("el-dropdown-item"),{class:[this.ns.be("popover","item"),a&&this.ns.bem("popover","item","selected")],command:t},{default:()=>[t.label]})}))||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?t:{default:()=>[t]});var a}})}}),fw=e("a3",ie(ow,function(e){e.component(ow.name,ow),e.component(hw.name,hw),e.component(mw.name,mw),e.component(gw.name,gw),e.component(bw.name,bw),Ha(qa.SEARCHBAR,()=>new rw)}));var ww=Object.defineProperty,yw=(e,t,a)=>(((e,t,a)=>{t in e?ww(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Cw{constructor(){yw(this,"component","IBizChartControl")}}const Iw=e("a4",{install(e){e.component("IBizChartControl",E({loader:()=>t.import("./chart-B_uQaEfA.js"),loadingComponent:be,delay:0})),Ha(qa.CHART,()=>new Cw)}});function xw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Sw=a({name:"IBizWizardPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){const e=ne((...e)=>new jn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase()));return{c:e,ns:t}},render(){var e,t,a,o,s;const{activeFormTag:r,buttonsState:c}=this.c.state;let d=null,u=null,h=null;if(r&&this.c.activeWizardForm){if(this.c.providers[r]){const t=i(this.c.providers[r].component),a=null==(e=this.c.model.deeditForms)?void 0:e.find(e=>{var t;return r===(null==(t=e.dewizardForm)?void 0:t.formTag)});u=l(t,{class:this.ns.e("form"),modelData:a,context:Object.assign(this.c.context,{srfsilent:!0}),params:this.c.params,key:r,onMounted:e=>this.c.onFormMounted(r,e),onSaveSuccess:e=>this.c.onFormSaved(e)})}const{dewizard:p}=this.c.model;h=p&&n("div",{key:"".concat(r,"footer"),class:this.ns.b("footer")},[(null==(t=c["".concat(r,"@PREV")])?void 0:t.visible)&&n(i("el-button"),{onClick:()=>{this.c.onPrevClick()}},{default:()=>[p.prevCaption?p.prevCaption:ibiz.i18n.t("control.common.retreat")]}),(null==(a=c["".concat(r,"@NEXT")])?void 0:a.visible)&&n(i("el-button"),{onClick:()=>{this.c.onNextClick()}},{default:()=>[p.nextCaption?p.nextCaption:ibiz.i18n.t("control.common.forward")]}),(null==(o=c["".concat(r,"@FINISH")])?void 0:o.visible)&&n(i("el-button"),{onClick:()=>{this.c.onFinishClick()}},{default:()=>[p.finishCaption?p.finishCaption:ibiz.i18n.t("app.complete")]})]);const{dewizardSteps:m}=p;if(this.c.model.showStepBar&&m&&m.length>0){let e,t=this.c.steps.indexOf(this.c.stepTags["".concat(this.c.model.name,"_form_").concat(null==(s=this.c.state.activeFormTag)?void 0:s.toLowerCase())]);-1===t&&(t=0),d=n(i("el-steps"),{class:this.ns.b("header"),"align-center":!0,"finish-status":"success",active:t},xw(e=m.map(e=>{const t={title:()=>{var t;return n("span",{class:[this.ns.bm("header","title"),null==(t=e.titleSysCss)?void 0:t.cssName]},[Tt(e.title)])}};return e.sysImage&&Object.assign(t,{icon:()=>n($,{class:this.ns.bm("header","step-icon"),icon:e.sysImage},null)}),n(i("el-step"),null,xw(t)?t:{default:()=>[t]})}))?e:{default:()=>[e]})}}return n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b(),this.ns.is("header",this.c.model.showStepBar)]},{default:()=>[d,u,h]})}});var Ew=Object.defineProperty,Dw=(e,t,a)=>(((e,t,a)=>{t in e?Ew(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Pw{constructor(){Dw(this,"component","IBizWizardPanelControl")}}const kw=e("a5",ie(Sw,function(e){e.component(Sw.name,Sw),Ha(qa.WIZARD_PANEL,()=>new Pw)}));var zw=Object.defineProperty,Tw=(e,t,a)=>(((e,t,a)=>{t in e?zw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Aw extends Vn{constructor(){super(...arguments),Tw(this,"counter"),Tw(this,"router")}get navPos(){var e;return null==(e=this.view.layoutPanel)?void 0:e.panelItems.nav_pos}get viewNavPos(){var e;return null==(e=this.view.layoutPanel)?void 0:e.panelItems.view_nav_pos}get form(){var e;return null==(e=this.view)?void 0:e.getController("form")}get isCreate(){return this.getData()[0].srfuf!==Qa.UPDATE}getData(){var e;return(null==(e=this.form)?void 0:e.getData())||[{}]}setRouter(e){this.router=e}get routeDepth(){return this.view.modal.routeDepth}initState(){super.initState(),this.state.drBarItems=[],this.state.srfnav="",this.state.selectedItem="",this.state.hideEditItem=!!this.model.hideEditItem}async onCreated(){await super.onCreated(),this.initDRBarItems(),await this.initCounter()}calcItemStateByCounter(e,t=!0){if(this.state.activated&&(this.state.drBarItems.forEach(e=>{var t;if(null==(t=e.children)?void 0:t.length)e.children.forEach(e=>{const t=Fn(e,this.counter);void 0!==t&&(e.visible=t)}),e.visible=e.children.some(e=>e.visible);else{const t=Fn(e,this.counter);void 0!==t&&(e.visible=t)}}),this.state.selectedItem&&t)){const{visible:e,defaultVisibleItem:t}=this.getItemVisibleState(this.state.selectedItem);!e&&t&&this.handleSelectChange(t.tag)}}getItemVisibleState(e){let t,a=!0;return this.state.drBarItems.forEach(n=>{if(n.children){t||(t=n.children.find(e=>e.visible));const i=n.children.find(t=>t.tag===e);i&&(a=!!i.visible)}else!t&&n.visible&&(t=n),n.tag===e&&(a=!!n.visible)}),{visible:a,defaultVisibleItem:t}}async calcPermitted(e){var t;let a=!0;const n=(null==(t=this.getData())?void 0:t.length)?this.getData()[0]:void 0,i=await Un(e,this.context,this.params,this.model.appDataEntityId,this.model.appId,n);void 0!==i&&(a=i),e.visible=a}async calcDrBarItemsState(){await Promise.all(this.state.drBarItems.map(async e=>{var t;(null==(t=e.children)?void 0:t.length)?(await Promise.all(e.children.map(async e=>{await this.calcPermitted(e)})),e.visible=e.children.some(e=>e.visible)):await this.calcPermitted(e)})),this.calcItemStateByCounter({},!1),this.state.isCalculatedPermission=!0}async onMounted(){await super.onMounted(),this.form?(this.form.evt.on("onLoadSuccess",async e=>{const t=e.data[0];this.view.state.srfactiveviewdata=t,Object.prototype.hasOwnProperty.call(t,"srfreadonly")&&(t.srfreadonly?this.view.context.srfreadonly=!0:Po(this.view.context.srfreadonly)&&(this.view.context.srfreadonly=!1)),await this.calcDrBarItemsState(),this.handleFormChange(),this.doDefaultSelect()}),this.form.evt.on("onLoadDraftSuccess",()=>{this.handleFormChange()}),this.form.evt.on("onSaveSuccess",()=>{this.handleFormChange()})):await this.calcDrBarItemsState(),this.form&&this.form.state.isLoaded&&this.doDefaultSelect()}handleFormChange(){const e=this.isCreate;this.setDRBarItemsState(this.state.drBarItems,e)}setDRBarItemsState(e,t){e.forEach(e=>{e.tag!==this.model.uniqueTag&&(e.disabled=t),e.children&&this.setDRBarItemsState(e.children,t)})}initDRBarItems(){var e;const{dedrctrlItems:t,dedrbarGroups:a}=this.model,n=[];if(!this.state.hideEditItem){const{editItemCaption:t,editItemCapLanguageRes:a,editItemSysImage:i,uniqueTag:o}=this.model;let s=t;a&&(s=ibiz.i18n.t(a.lanResTag,t)),n.push({tag:o,caption:s,disabled:!1,sysImage:i,fullPath:null==(e=this.router)?void 0:e.currentRoute.value.fullPath}),this.state.defaultItem=o,this.state.selectedItem=n[0].tag}const i=e=>{let t=e.caption;e.capLanguageRes&&(t=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption));const{enableMode:a,testAppDELogicId:n,testScriptCode:i,counterMode:o}=e;return{tag:e.id,caption:t,sysImage:e.sysImage,disabled:!1,counterId:e.counterId,visible:!1,dataAccessAction:e.dataAccessAction||void 0,enableMode:a,testAppDELogicId:n,testScriptCode:i,counterMode:o}};a&&t&&(1===a.length?t.forEach(e=>{n.push(i(e))}):a.forEach(e=>{var a;const o=t.filter(t=>t.dedrbarGroupId===e.id);if(o.length>1||"true"===(null==(a=this.controlParams)?void 0:a.singleitemgroup)&&1===o.length){let t=e.caption;e.capLanguageRes&&(t=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption)),n.push({tag:e.id,caption:t,sysImage:e.sysImage,visible:!1,children:o.map(e=>i(e))})}else 1===o.length&&n.push(i(o[0]))})),this.state.drBarItems=n}handleSelectChange(e=this.state.selectedItem||this.state.defaultItem,t=!1){var a,n;if(this.state.selectedItem===e)return;const i=null==(a=this.model.dedrctrlItems)?void 0:a.find(t=>t.id===e);i?(this.setVisible("navPos"),this.openNavPosView(i,t)):(this.setVisible("form"),this.routeDepth&&(null==(n=this.state.drBarItems[0])?void 0:n.fullPath)&&this.router.push(this.state.drBarItems[0].fullPath)),this.state.selectedItem=e}setVisible(e){var t;if(this.state.hideEditItem)return;const a=null==(t=this.view.layoutPanel)?void 0:t.panelItems.view_form;"form"===e?(a&&(a.state.visible=!0,a.state.keepAlive=!0),this.viewNavPos&&(this.viewNavPos.state.visible=!1,this.viewNavPos.state.keepAlive=!0)):(a&&(a.state.visible=!1,a.state.keepAlive=!0),this.viewNavPos&&(this.viewNavPos.state.visible=!0,this.viewNavPos.state.keepAlive=!0))}prepareParams(e){const{navigateContexts:t,navigateParams:a}=e,n={navContexts:t,navParams:a},i={context:this.context,params:this.params,data:this.getData()[0]},{resultContext:o,resultParams:s}=Na(n,i);return{context:Object.assign(this.context.clone(),o),params:{...this.params,...s}}}async openNavPosView(e,t=!1){var a;if(!e.appViewId)return;const{context:n,params:i}=this.prepareParams(e);n.currentSrfNav=e.id,this.state.srfnav=e.id,null==(a=this.navPos)||a.openView({key:e.id,context:n,params:i,viewId:e.appViewId,isRoutePushed:t})}doDefaultSelect(){var e,t;const a=null==(e=this.view.layoutPanel)?void 0:e.panelItems.view_form;if(a&&(a.state.visible=!1,a.state.keepAlive=!1),!this.state.hideEditItem&&!this.state.srfnav)return void this.setVisible("form");if(this.isCreate)return void(this.state.defaultItem=this.model.uniqueTag);const{drBarItems:n}=this.state;let i=(null==(t=n[0].children)?void 0:t[0].tag)||n[0].tag;if(this.routeDepth&&this.state.srfnav&&(i=this.state.srfnav),i){const e=!!this.routeDepth&&Hn(this.routeDepth),{visible:t,defaultVisibleItem:a}=this.getItemVisibleState(i);!t&&a?(i=a.tag,this.handleSelectChange(i)):this.handleSelectChange(i,e),this.state.defaultItem=i}}async initCounter(){if(this.state.isCounterDisabled)return;const{appCounterRefs:e}=this.model,t=null==e?void 0:e[0];t&&(this.counter=await qn.getCounterByRef(t,this.context,{...this.params}),this.calcItemStateByCounter=this.calcItemStateByCounter.bind(this),this.counter.onChange(this.calcItemStateByCounter))}async onDestroyed(){await super.onDestroyed(),this.counter&&(this.counter.offChange(this.calcItemStateByCounter),this.counter.destroy())}setActive(e){this.handleSelectChange(e)}}e("a7",Aw);const Ow=a({name:"IBizDrBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},showMode:{type:String,default:"vertical"},hideEditItem:{type:Boolean,default:void 0}},setup(e){const t=ne((...e)=>new Aw(...e)),a=B("control-".concat(t.model.controlType.toLowerCase())),s=hs(),l=o({}),r=e=>{l.value=e};t.evt.on("onCreated",()=>{t.counter&&t.counter.onChange(r,!0)}),h(()=>{var e;null==(e=t.counter)||e.offChange(r)}),t.setRouter(s);const d=us();let u="";const p=[];c(()=>t.state.isCreated,(a,n)=>{if("horizontal"!==e.showMode){const{drBarItems:e}=t.state;e.forEach(e=>{p.push(e.tag)})}}),t.routeDepth&&(u=me(d,t.routeDepth)),d&&c(()=>d.fullPath,(e,a)=>{if(e!==a){const e=t.routeDepth;if(e){if(me(d,t.routeDepth)===u){const a=Y(d),{srfnav:n}=a.pathNodes[e-1];t.handleSelectChange(n)}}}},{immediate:!0});const m=o=>{if(o.visible){if(o.children){let s="";if("horizontal"===e.showMode&&o.tag!==t.state.selectedItem){const e=o.children.find(e=>e.tag===t.state.selectedItem);e&&(s="-".concat(e.caption))}return n(i("el-sub-menu"),{class:a.b("group"),index:o.tag,disabled:o.disabled},{default:()=>o.children.map(e=>m(e)),title:()=>[n(i("iBizIcon"),{class:a.e("icon"),icon:o.sysImage},null),n("span",null,[o.caption,s])]})}return n(i("el-menu-item"),{class:a.e("item"),index:o.tag,disabled:o.disabled},{default:()=>[n(i("iBizIcon"),{class:a.e("icon"),icon:o.sysImage},null),n("span",null,[o.caption]),o.counterId&&null!=l.value[o.counterId]&&n(i("iBizBadge"),{class:a.e("counter"),value:l.value[o.counterId],counterMode:o.counterMode},null)]})}};return{c:t,ns:a,handleSelect:e=>{t.handleSelectChange(e);const a=t.state.drBarItems.find(t=>t.tag===e);a&&t.evt.emit("onTabChange",{data:a})},renderMenuItems:m,opens:p}},render(){const{isCreated:e,drBarItems:t,selectedItem:a,isCalculatedPermission:o}=this.c.state;return n(i("iBizControlBase"),{controller:this.c,class:this.ns.b()},{default:()=>[e&&o&&n(i("el-menu"),{class:this.ns.e("menu"),mode:this.showMode,"default-active":a,onSelect:this.handleSelect,"default-openeds":this.opens},{default:()=>t.map(e=>this.renderMenuItems(e))})]})}});var Mw=Object.defineProperty,Nw=(e,t,a)=>(((e,t,a)=>{t in e?Mw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Bw{constructor(){Nw(this,"component","IBizDrBarControl")}}const Lw=e("a6",ie(Ow,function(e){e.component(Ow.name,Ow),Ha(qa.DRBAR,()=>new Bw)}));var Rw=Object.defineProperty,_w=(e,t,a)=>(((e,t,a)=>{t in e?Rw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class jw extends Vn{constructor(){super(...arguments),_w(this,"counter"),_w(this,"srfCachePos",!1),_w(this,"srfCacheKeyTempl",""),_w(this,"router")}get navPos(){var e;return null==(e=this.view.layoutPanel)?void 0:e.panelItems.nav_pos}get form(){var e;return null==(e=this.view)?void 0:e.getController("form")}get routeDepth(){return this.view.modal.routeDepth}get storageTag(){if(this.srfCacheKeyTempl)return this.srfCacheKeyTempl;const e=this.context.srfuserid;return"".concat(e,"_").concat(this.view.model.codeName,"_").concat(this.model.codeName)}get enableAnchor(){return this.controlParams.enablenavbar?"true"===this.controlParams.enablenavbar:ibiz.config.drtab.enableNavbar}get navbarpos(){var e;return(null==(e=this.controlParams.navbarpos)?void 0:e.toLowerCase())||ibiz.config.drtab.navbarPos.toLowerCase()}get navbarwidth(){return this.controlParams.navbarwidth||ibiz.config.drtab.navbarWidth}setRouter(e){this.router=e}getData(){var e;return(null==(e=this.form)?void 0:e.getData())||[{}]}initState(){super.initState(),this.state.drTabPages=[],this.state.showMore=!1,this.state.hideEditItem=!!this.model.hideEditItem}async onCreated(){await super.onCreated(),await this.initCounter(),this.srfCacheKeyTempl=this.controlParams.srfcachekeytempl||"",this.controlParams.showmore&&(this.state.showMore="true"===this.controlParams.showmore),this.controlParams.srfcachepos&&(this.srfCachePos="true"===this.controlParams.srfcachepos.toLowerCase())}calcItemStateByCounter(){if(this.state.activated&&(this.state.drTabPages.forEach(e=>{const t=Fn(e,this.counter);void 0!==t&&(e.hidden=!t)}),this.state.activeName)){const{visible:e,defaultVisibleItem:t}=this.getItemVisibleState(this.state.activeName);!e&&t&&(this.state.activeName=t.tag,this.handleTabChange())}}getItemVisibleState(e){let t,a=!0;return this.state.drTabPages.forEach(n=>{t||n.hidden||(t=n),n.tag===e&&(a=!n.hidden)}),{visible:a,defaultVisibleItem:t}}async calcPermitted(e){var t;let a=!0;const n=(null==(t=this.getData())?void 0:t.length)?this.getData()[0]:void 0,i=await Un(e,this.context,this.params,this.model.appDataEntityId,this.model.appId,n);void 0!==i&&(a=i),e.hidden=!a}async calcDrTabPagesState(){await Promise.all(this.state.drTabPages.map(async e=>{await this.calcPermitted(e)})),this.calcItemStateByCounter(),this.state.isCalculatedPermission=!0}async onMounted(){await super.onMounted(),this.form&&(this.form.evt.on("onLoadSuccess",async e=>{const t=e.data[0];this.view.state.srfactiveviewdata=t,Object.prototype.hasOwnProperty.call(t,"srfreadonly")&&(t.srfreadonly?this.view.context.srfreadonly=!0:Po(this.view.context.srfreadonly)&&(this.view.context.srfreadonly=!1)),await this.calcDrTabPagesState(),this.handleFormChange(),this.doDefaultSelect()}),this.form.evt.on("onLoadDraftSuccess",()=>{this.handleFormChange()}),this.form.evt.on("onSaveSuccess",()=>{this.handleFormChange()})),this.initDRTabPages(),this.form||await this.calcDrTabPagesState(),this.form&&this.form.state.isLoaded&&this.doDefaultSelect()}doDefaultSelect(){var e;const t=null==(e=this.view.layoutPanel)?void 0:e.panelItems.view_form;t&&(t.state.visible=!1,t.state.keepAlive=!1),this.state.hideEditItem||this.state.activeName!==this.model.uniqueTag||this.setVisible("form")}handleFormChange(){const e=this.getData()[0].srfuf!==Qa.UPDATE;this.setDRTabPagesState(this.state.drTabPages,e)}setDRTabPagesState(e,t){e.forEach(e=>{e.tag!==this.model.uniqueTag&&(e.disabled=t)})}initDRTabPages(){const{editItemCaption:e,editItemCapLanguageRes:t,editItemSysImage:a,uniqueTag:n,dedrtabPages:i}=this.model,o=[];let s=e;if(t&&(s=ibiz.i18n.t(t.lanResTag,e)),this.state.hideEditItem||o.push({caption:s,tag:n,hidden:!!this.state.hideEditItem,disabled:!1,sysImage:a,fullPath:this.routeDepth?me(this.router.currentRoute.value,this.routeDepth):""}),null==i||i.forEach(e=>{let t=e.caption;e.capLanguageRes&&(t=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption));const{enableMode:a,dataAccessAction:n,testAppDELogicId:i,testScriptCode:s,counterMode:l}=e;o.push({tag:e.id,caption:t,sysImage:e.sysImage,hidden:!1,disabled:!1,counterId:e.counterId,dataAccessAction:n,enableMode:a,testAppDELogicId:i,testScriptCode:s,counterMode:l})}),this.state.drTabPages=o,this.state.defaultName=o[0].tag,this.view.state.srfnav)this.state.activeName=this.view.state.srfnav;else if(this.state.activeName=o[0].tag,this.srfCachePos&&localStorage.getItem(this.storageTag)){const e=localStorage.getItem(this.storageTag);this.state.activeName=e}const l=!!this.routeDepth&&Hn(this.routeDepth);this.handleTabChange(l)}handleTabChange(e=!1){var t;const{activeName:a}=this.state,n=null==(t=this.model.dedrtabPages)?void 0:t.find(e=>e.id===a);this.srfCachePos&&a&&localStorage.setItem("".concat(this.storageTag),a),n?(this.setVisible("navPos"),this.openNavPosView(n,e)):(this.setVisible("form"),this.routeDepth&&this.state.drTabPages[0]&&this.router.push(this.state.drTabPages[0].fullPath))}setVisible(e){var t;if(this.state.hideEditItem)return;const a=null==(t=this.view.layoutPanel)?void 0:t.panelItems.view_form;"form"===e?(a&&(a.state.visible=!0,a.state.keepAlive=!0),this.navPos&&(this.navPos.state.visible=!1,this.navPos.state.keepAlive=!0)):(a&&(a.state.visible=!1,a.state.keepAlive=!0),this.navPos&&(this.navPos.state.visible=!0,this.navPos.state.keepAlive=!0))}prepareParams(e){const{navigateContexts:t,navigateParams:a}=e,n={navContexts:t,navParams:a},i={context:this.context,params:this.params,data:this.getData()[0]},{resultContext:o,resultParams:s}=Na(n,i);return{context:Object.assign(this.context.clone(),o,{currentSrfNav:e.id}),params:{...this.params,...s}}}async openNavPosView(e,t=!1,a){var n;const{context:i,params:o}=this.prepareParams(e);e.appViewId&&(null==(n=this.navPos)||n.openView({key:a||e.id,context:i,params:o,viewId:e.appViewId,isRoutePushed:t}))}async initCounter(){if(this.state.isCounterDisabled)return;const{appCounterRefs:e}=this.model,t=null==e?void 0:e[0];t&&(this.counter=await qn.getCounterByRef(t,this.context,{...this.params}),this.calcItemStateByCounter=this.calcItemStateByCounter.bind(this),this.counter.onChange(this.calcItemStateByCounter))}async refresh(){var e;const{activeName:t}=this.state,a=null==(e=this.model.dedrtabPages)?void 0:e.find(e=>e.id===t);a?(this.setVisible("navPos"),this.openNavPosView(a,!1,go())):(this.setVisible("form"),this.routeDepth&&this.state.drTabPages[0]&&this.router.push(this.state.drTabPages[0].fullPath))}async onDestroyed(){await super.onDestroyed(),this.counter&&(this.counter.offChange(this.calcItemStateByCounter),this.counter.destroy())}setActive(e){this.state.activeName=e,this.handleTabChange()}}function Vw(e,t,a){let n=null,i=0;const s=o([]),l=o([]),r=(e,t={})=>{let a=0;const n=document.createElement("span"),i=document.createElement("span");return i.innerHTML=e,Object.assign(i.style,t),Object.assign(n.style,{width:"auto",position:"absolute",left:"-9999px"}),n.appendChild(i),document.body.appendChild(n),a=n.offsetWidth,document.body.removeChild(n),a};function d(){const{drTabPages:n,showMore:i}=e.state;if(!t.value||!i||0===n.length)return s.value=n,void(l.value=[]);const o=t.value.$el.offsetWidth;let c=0;s.value=[],l.value=[],n.forEach((e,t)=>{if(!e.hidden){const n=e.caption||"",i=e.counterId?a.value[e.counterId]:void 0,d="var(--".concat(yl,"-font-size-regular)");if(null!=i&&(i||0===i)&&!(1===e.counterMode&&i<=0)){const e={marginLeft:"var(--".concat(yl,"-spacing-tight)"),minWidth:"20px",fontSize:d},t=r(String(i),e);c+=t}const u={padding:"0 var(--".concat(yl,0===t?"-spacing-base) 0 0":"-spacing-base)"),fontSize:d},h=r(n,u);c+=h;const p={padding:"0 0 0 var(--".concat(yl,"-spacing-base)"),fontSize:d},m=r("".concat(ibiz.i18n.t("app.more")," ^"),p);c+m>o?l.value.push(e):s.value.push(e)}})}c(()=>e.state.drTabPages,()=>{d()},{deep:!0});const u=P(()=>{t.value&&(()=>{if(window.ResizeObserver){const e=t.value.$el;e&&(n=new ResizeObserver(e=>{const t=e[0].contentRect.width;t!==i&&(d(),i=t)}),n.observe(e))}})()});return h(()=>{n&&n.disconnect(),u()}),{visibleItems:s,moreItems:l}}e("a9",jw);const Fw=a({name:"FlowDrtab",props:{pagesstate:{type:Array,default:()=>[]},drtabpages:{type:Array,default:()=>[]},context:{type:Object,default:()=>{}},params:{type:Object,default:()=>{}},counterData:{type:Array,default:()=>{}},showHeader:{type:Boolean,default:!0},activeTab:{type:Object,default:()=>{}},controller:{type:Object,default:()=>{}}},setup(e){const t=B("flow-drtab"),a=go(),i=e.controller,s=o(""),l=o([]),d=o(),u=o(200),h=[],p=o(0),m=o(),v=o(0),b=o(),f=o();d.value=i.navbarpos,u.value=i.navbarwidth;const w=r(()=>e.pagesstate.filter(t=>e.drtabpages.find(e=>e.id===t.tag)&&!t.hidden).length),y=r(()=>e.pagesstate?e.pagesstate.map(t=>{const a=e.drtabpages.find(e=>e.id===t.tag);return"".concat(null==a?void 0:a.appViewId,"_").concat(t.tag)}):[]),C=()=>{if(s.value){const e=document.getElementById("".concat(s.value));e&&e.scrollIntoView()}},I=()=>{const e=document.getElementById("navbar_".concat(s.value));e&&m.value&&!((e,t)=>{const a=t.getBoundingClientRect(),n=e.getBoundingClientRect();return n.top>=a.top&&n.bottom<=a.bottom&&n.left>=a.left&&n.right<=a.right})(e,m.value)&&e.scrollIntoView({behavior:"smooth"})},S=new IntersectionObserver(e=>{e.forEach(e=>{var t,a;if(e.isIntersecting){if(e.target&&e.target.id)if(h.length>0){(null==(t=y.value)?void 0:t.findIndex(t=>t===e.target.id))<(null==(a=y.value)?void 0:a.findIndex(e=>e===h[0]))?h.unshift(e.target.id):h.push(e.target.id)}else h.push(e.target.id)}else if(e.target&&e.target.id){const t=h.indexOf(e.target.id);t>=0&&h.splice(t,1)}}),h.sort((e,t)=>{var a,n;return(null==(a=y.value)?void 0:a.findIndex(t=>t===e))-(null==(n=y.value)?void 0:n.findIndex(e=>e===t))}),w.value===v.value&&i.enableAnchor&&(h.length>0&&(s.value=h[0]),f.value?(clearTimeout(b.value),b.value=setTimeout(()=>{s.value=f.value,I(),f.value=""},200)):I())});c(()=>e.activeTab,(t,a)=>{if(t&&t.tag!==(null==a?void 0:a.tag)){const a=e.drtabpages.find(e=>e.id===t.tag);s.value="".concat(null==a?void 0:a.appViewId,"_").concat(t.tag),t.tag!==e.drtabpages[0].id&&C()}},{deep:!0,immediate:!0}),c(()=>e.drtabpages,e=>{e&&Promise.all(e.map(async e=>{const t=await ibiz.hub.getAppView(e.appViewId);return{id:e.id,height:null==t?void 0:t.height,width:null==t?void 0:t.width}})).then(e=>{l.value=e})},{deep:!0,immediate:!0}),x(()=>{g(()=>{const e=document.getElementById("".concat(a));e&&(e.scrollTop=p.value)})});return{c:i,ns:t,uuid:a,navbarpos:d,onViewMounted:t=>{const a=e.drtabpages.find(e=>e.id===t.tag);v.value+=1,v.value!==w.value||s.value||(s.value="".concat(null==a?void 0:a.appViewId,"_").concat(e.pagesstate[0].tag));const n=document.getElementById("".concat(null==a?void 0:a.appViewId,"_").concat(t.tag));n&&S.observe(n),v.value===w.value&&e.activeTab&&e.activeTab.tag!==e.drtabpages[0].id&&g(()=>{C()})},navBarWidth:u,calcStyle:e=>{const t=l.value.find(t=>t.id===e);if(t)return{height:t.height?"".concat(t.height,"px"):"100%",width:t.width?"".concat(t.width,"px"):"100%"}},renderAnchorBar:()=>{if(i.enableAnchor)return n("div",{class:[t.e("anchor-bar"),t.is(d.value,!0)],style:{width:"".concat(u.value,"px")}},[n("div",{class:[t.e("anchor-items"),t.is(d.value)],ref:e=>{m.value=e}},[e.pagesstate.map(a=>{const i=e.drtabpages.find(e=>e.id===a.tag);return!i||a.hidden?null:n("div",{class:[t.e("anchor-item"),t.is("active","".concat(null==i?void 0:i.appViewId,"_").concat(a.tag)===s.value)],id:"navbar_".concat(i.appViewId,"_").concat(a.tag),onClick:()=>(t=>{const a=e.drtabpages.find(e=>e.id===t.tag);f.value="".concat(null==a?void 0:a.appViewId,"_").concat(t.tag);const n=document.getElementById("".concat(null==a?void 0:a.appViewId,"_").concat(t.tag));n&&(n.scrollIntoView({behavior:"smooth"}),h.includes(f.value)&&(s.value=f.value))})(a)},[a.caption])})])])},handleScroll:()=>{const e=document.getElementById("".concat(a));e&&(p.value=e.scrollTop)}}},render(){var e,t;const a=this.pagesstate.map(e=>{const t=e.counterId?this.counterData[e.counterId]:void 0,a=i("IBizViewShell"),o=this.drtabpages.find(t=>t.id===e.tag);return!o||e.hidden?null:n("div",{id:"".concat(o.appViewId,"_").concat(e.tag),class:this.ns.e("tab-item")},[this.showHeader&&n("div",{class:this.ns.em("tab-item","label")},[e.sysImage&&n(i("iBizIcon"),{class:this.ns.be("label","icon"),icon:e.sysImage},null),n("span",{class:this.ns.be("label","text")},[e.caption]),!Po(t)&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:t,counterMode:e.counterMode},null)]),n("div",{class:this.ns.em("tab-item","tab-view"),style:this.calcStyle(e.tag)},[l(a,{context:this.context,params:this.params,viewId:o.appViewId,onMounted:()=>this.onViewMounted(e)})])])});return n("div",{class:[this.ns.b(),this.ns.m(this.navbarpos),this.ns.is("left",null==(e=this.navbarpos)?void 0:e.includes("left")),this.ns.is("right",null==(t=this.navbarpos)?void 0:t.includes("right")),this.ns.is("enable-anchor",this.c.enableAnchor)],onScroll:this.handleScroll,id:this.uuid},[this.renderAnchorBar(),n("div",{class:this.ns.e("container"),style:{"--navbarwidth":"".concat(this.navBarWidth,"px")}},[a])])}}),Uw=a({name:"IBizDrTabControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},hideEditItem:{type:Boolean,default:void 0}},setup(){var e;const t=ne((...e)=>new jw(...e)),a=B("control-".concat(t.model.controlType.toLowerCase())),s=hs(),l=o(),d=o({}),{visibleItems:u,moreItems:p}=Vw(t,l,d),m=e=>{d.value=e},v=(null==(e=t.view.model.tabLayout)?void 0:e.toLowerCase())||"top";t.evt.on("onCreated",()=>{t.counter&&t.counter.onChange(m,!0)});const g=r(()=>t.state.drTabPages.find(e=>e.tag===t.state.activeName));h(()=>{var e;null==(e=t.counter)||e.offChange(m)}),t.setRouter(s);const b=()=>{const{activeName:e}=t.state,a=t.state.drTabPages.find(t=>t.tag===e);a&&t.evt.emit("onTabChange",{data:a})},f=e=>{t.state.activeName=e,t.handleTabChange(),b()},w=us();let y="";t.routeDepth&&(y=me(w,t.routeDepth)),w&&c(()=>w.fullPath,(e,a)=>{if(e!==a){const e=t.routeDepth;if(e){if(me(w,t.routeDepth)===y){const a=Y(w),{srfnav:n}=a.pathNodes[e-1],i=!!t.routeDepth&&Hn(t.routeDepth);if(n&&t.state.activeName&&t.state.activeName!==n)t.state.activeName=n,t.handleTabChange(i);else if(!n){const e=!!t.routeDepth&&!Hn(t.routeDepth);(t.state.activeName!==t.state.defaultName||e)&&(t.state.activeName=t.state.defaultName,t.handleTabChange(i))}}}}},{immediate:!0});return{c:t,ns:a,activeTab:g,controlRef:l,counterData:d,visibleItems:u,moreItems:p,tabPosition:v,onTabChange:f,handleTabChange:()=>{t.handleTabChange(),b()},renderDropdownList:()=>n(i("el-dropdown"),{trigger:"click",class:a.b("dropdown-list"),"popper-class":a.be("dropdown-list","popper"),onCommand:f},{default:()=>{var e,t,o;return n("div",{class:a.be("dropdown-list","trigger")},[(null==(e=g.value)?void 0:e.sysImage)&&n(i("iBizIcon"),{icon:g.value.sysImage},null),n("div",{class:"caption"},[null==(t=g.value)?void 0:t.caption,(null==(o=g.value)?void 0:o.counterId)&&n(i("iBizBadge"),{value:d.value[g.value.counterId],counterMode:g.value.counterMode},null)]),n("ion-icon",{name:"chevron-down-outline"},null)])},dropdown:()=>n("div",{class:a.bem("dropdown-list","popper","content")},[t.state.drTabPages.map(e=>e.hidden?null:n(i("el-dropdown-item"),{class:[a.bem("dropdown-list","popper","item"),a.is("active",e.tag===t.state.activeName)],command:e.tag,disabled:e.disabled},{default:()=>[e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),n("span",{class:"caption"},[e.caption]),e.counterId&&n(i("iBizBadge"),{value:d.value[e.counterId],counterMode:e.counterMode},null),e.tag===t.state.activeName&&n("ion-icon",{name:"checkmark-outline"},null)]}))])})}},render(){const{isCreated:e,isCalculatedPermission:t}=this.c.state;if("flow_noheader"===this.tabPosition||"flow"===this.tabPosition)return n(Fw,{pagesstate:this.visibleItems,drtabpages:this.modelData.dedrtabPages,context:this.c.context,params:this.c.params,showHeader:"flow"===this.tabPosition,counterData:this.counterData,activeTab:this.activeTab,controller:this.c},null);const a=this.moreItems.find(e=>e.tag===this.c.state.activeName)||{},o=n(i("el-dropdown"),{trigger:"click",class:this.ns.b("more-dropdown"),"popper-class":this.ns.b("more-dropdown-popper")},{default:()=>n("div",{class:this.ns.be("more-dropdown","link"),onClick:e=>e.stopPropagation()},[n("span",null,[ibiz.i18n.t("app.more"),p(" ")]),n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.978 11.997l-.005.006L2.3 6.33l.83-.831 4.848 4.848L12.826 5.5l.83.83-5.673 5.673-.005-.006z"},null)])])]),dropdown:()=>n(i("el-dropdown-menu"),null,{default:()=>this.moreItems.map(e=>n(i("el-dropdown-item"),{class:[this.c.state.activeName===e.tag?this.ns.be("more-dropdown-popper","active"):""],onClick:()=>this.onTabChange(e.tag)},{default:()=>[n("span",{class:[this.ns.be("more-dropdown-popper","label")]},[n("span",{class:this.ns.bem("more-dropdown-popper","label","text"),title:Tt(e.caption||"")},[e.caption||""]),e.counterId&&null!=this.counterData[e.counterId]&&n(i("iBizBadge"),{class:this.ns.bem("more-dropdown-popper","label","counter"),value:this.counterData[e.counterId],counterMode:e.counterMode},null)])]}))})});return n(i("iBizControlBase"),{ref:"controlRef",controller:this.c,class:[this.ns.b(),this.moreItems.length>0?this.ns.b("more"):""]},{default:()=>[e&&t&&"top_dropdownlist"===this.tabPosition?this.renderDropdownList():n(i("el-tabs"),{modelValue:this.c.state.activeName,"onUpdate:modelValue":e=>this.c.state.activeName=e,tabPosition:this.tabPosition,onTabChange:this.handleTabChange},{default:()=>[this.visibleItems.map(e=>{const t=e.counterId?this.counterData[e.counterId]:void 0;return e.hidden?null:n(i("el-tab-pane"),{class:this.ns.e("tab-item"),label:e.caption+t,disabled:e.disabled,name:e.tag},{label:()=>n("span",{class:this.ns.b("label")},[e.sysImage&&n(i("iBizIcon"),{class:this.ns.be("label","icon"),icon:e.sysImage},null),n("span",{class:this.ns.be("label","text")},[e.caption]),!Po(t)&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:t,counterMode:e.counterMode},null)])})}),this.moreItems.length>0&&n(i("el-tab-pane"),{label:"",name:a.tag},{label:()=>o})]})]})}});var Hw=Object.defineProperty,qw=(e,t,a)=>(((e,t,a)=>{t in e?Hw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Gw{constructor(){qw(this,"component","IBizDrTabControl")}}const Ww=e("a8",ie(Uw,function(e){e.component(Uw.name,Uw),Ha(qa.DRTAB,()=>new Gw)}));function Yw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Kw={};function Xw(e,t,a){var o;const s=t.providers[e.id],r={modelData:e,controller:t.portlets[e.id]};if(!s)return n("div",null,[e.portletType,ibiz.i18n.t("app.noSupport")]);const c=i(s.component);if("CONTAINER"===e.portletType){const a=e;return l(c,{...r,key:e.id,id:e.id},{default:()=>{var e;return null==(e=a.controls)?void 0:e.map(e=>Xw(e,t))}})}return l(c,{...r,key:(null==(o=Kw[e.id])?void 0:o.refreshtag)?Kw[e.id].refreshtag:e.id,id:e.id})}const $w=a({name:"IBizDashboardControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){const e=ne((...e)=>new Gn(...e));ue(e);const t=I().proxy,a=o([]),n=o([]),i=o(),s=B("control-".concat(e.model.controlType.toLowerCase()));e.evt.on("onInitPortlets",()=>{Object.values(e.portlets).forEach(e=>{z(e.state)||(e.state=u(e.state))}),n.value=e.enableAnchorCtrls}),e.evt.on("onItemModelReset",async n=>{if(2!==e.model.customizeMode)return;const{name:i}=n,o=a.value.findIndex(e=>e.id===i);if(-1!==o){const n=ibiz.hub.getApp(e.model.appId),s=await e.loadDynaPortletById("".concat(n.model.codeName,".").concat(i));s&&(Kw[s.id]={refreshtag:Uo()},a.value.splice(o,1,s),t.$forceUpdate())}});return{c:e,ns:s,customModelDatas:a,anchorList:n,dashboardRef:i,calcNavBarConfig:()=>{const{navBarPos:t,navBarSysCss:a,navBarWidth:n,navBarStyle:i,navbarHeight:o}=e.model;return{navBarPos:t,navBarSysCss:a,navBarWidth:n,navBarStyle:i,navbarHeight:o}},handleCustomModelChange:n=>{const i=n.model,o=e.model.controls;i&&i.length>0?i.forEach(e=>{"FILTER"===e.portletType&&(Kw[e.id]={refreshtag:Uo()})}):o&&o.length>0&&o.forEach(e=>{"FILTER"===e.portletType&&(Kw[e.id]={refreshtag:Uo()})}),a.value=i,t.$forceUpdate()}}},render(){const{state:e,model:t}=this.c,a=()=>n(i("iBizRow"),{ref:"dashboardRef",class:[this.ns.b()],layout:t.layout},{default:()=>{var e;return[null==(e=t.controls)?void 0:e.map(e=>{var t;let a;return n(i("iBizCol"),{layoutPos:e.layoutPos,state:null==(t=this.c.portlets[e.id])?void 0:t.state},Yw(a=Xw(e,this.c))?a:{default:()=>[a]})})]}}),o=()=>{const e={default:()=>a()};return this.customModelDatas.forEach(t=>{e[t.codeName]=()=>Xw(t,this.c)}),e};let s=null;if(t.enableCustomized){let e;s=n(i("iBizCustomDashboardContainer"),{modelData:this.modelData,dashboard:this.c,onChanged:this.handleCustomModelChange},Yw(e=o())?e:{default:()=>[e]})}else if(t.showDashboardNavBar){let e;s=n(i("iBizAnchorContainer"),{anchorList:this.anchorList.map(e=>({id:e.id,title:e.title})),anchorTargetEle:this.dashboardRef,navBarConfig:this.calcNavBarConfig()},Yw(e=a())?e:{default:()=>[e]})}else s=a();return n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b()]},{default:()=>[e.isCreated&&s]})}});function Jw(e,t){var a;const{layoutRowH:n,layoutColNum:i}=t,o=ibiz.hub.getApp(e.model.appId),s=(e,t)=>{const{controls:a,layout:i}=e,o=(null==a?void 0:a.filter(e=>!!e.layoutPos))||[],l=[],r=[];if("TABLE_24COL"===(null==i?void 0:i.layout)||"TABLE_12COL"===(null==i?void 0:i.layout))o.forEach(a=>{var i;const{height:o}=a.layoutPos,{span:c,offset:d}=function(e){const{layout:t,colXS:a,colSM:n,colMD:i,colLG:o,colXSOffset:s,colSMOffset:l,colMDOffset:r,colLGOffset:c}=e,d=o||i||n||a,u=c||r||l||s,h="TABLE_24COL"===t?24:12;return{span:d&&-1!==d?d/h:1,offset:u&&-1!==u?u/h:0}}(a.layoutPos),u=c*t.w,h=d*t.w;let p=o?o/n:3;if("CONTAINER"===a.portletType&&(null==(i=a.controls)?void 0:i.length)){const e=s(a,{w:u,x:h});p=e.reduce((e,t)=>Math.max(e,t.y+t.h),-1/0),r.push(...e)}l.push({w:u,x:h,h:p,y:0,model:a,parentId:e.codeName})});else if("FLEX"===(null==i?void 0:i.layout)){const a=function(e,t){const{dir:a,align:n,valign:i}=t.layout,o=[],s=(null==a?void 0:a.includes("reverse"))?e.toReversed():e;if(null==a?void 0:a.includes("row")){const e=parseFloat((t.w/s.length).toFixed(1));let i=0,l=0,r=0;s.forEach(e=>{const{grow:t,width:a}=e.layoutPos;t||!a?l++:(r++,i+=parseFloat((a/100).toFixed(1)))});const c=i>e*r?e*r:i,d=t.w-c,u=l>0?d/l:0;s.forEach(e=>{const{grow:t,width:a}=e.layoutPos;o.push({x:0,model:e,w:t||!a?u:parseFloat((a/100).toFixed(1))})});const h=o.reduce((e,t)=>e+t.w,0),p=t.w-h;switch(n){case"flex-start":"row-reverse"===a&&(o[0].x=p);break;case"flex-end":"row"===a&&(o[0].x=p);break;case"center":p&&(o[0].x=p/2);break;case"space-between":if(p&&o.length>1){const e=p/(o.length-1);o.forEach((t,a)=>{0!==a&&(t.x=e)})}break;case"space-around":if(p){const e=p/(2*o.length);o.forEach((t,a)=>{t.x=0===a?e:2*e})}}}return(null==a?void 0:a.includes("column"))&&s.forEach(e=>{const{width:a}=e.layoutPos;let n=0,s=t.w;a&&(s=a/100>1&&a/100<t.w?a/100:t.w);const l=t.w-s;switch(i){case"flex-end":n=l;break;case"center":l&&(n=(t.w-s)/2)}o.push({x:n,w:s,model:e})}),o}(o,{...t,layout:i});a.forEach(t=>{var a;const{x:i,w:o,model:c}=t,{height:d}=c.layoutPos;let u=d?d/n:3;if("CONTAINER"===c.portletType&&(null==(a=c.controls)?void 0:a.length)){const e=s(c,{w:o,x:i});u=e.reduce((e,t)=>Math.max(e,t.y+t.h),-1/0),r.push(...e)}l.push({w:o,x:i,h:u,y:0,model:c,parentId:e.codeName})})}!function(e,t){let a=0,n=0,i=0;e.forEach(e=>{a+e.x+e.w>t.w&&(n+=i,a=0,i=0),e.x=a+e.x,e.y=n,a+=e.x+e.w-a,i=Math.max(i,e.h)}),e.forEach(e=>{e.x+=t.x})}(l,t),l.forEach(e=>{if("CONTAINER"===e.model.portletType){r.filter(t=>t.parentId===e.model.codeName).forEach(t=>{t.x+=e.x,t.y+=e.y})}});const c=l.filter(e=>!["CONTAINER","RAWITEM"].includes(e.model.portletType));return c.push(...r),c},l=[];if(null==(a=e.model.controls)?void 0:a.length){s(e.model,{x:0,w:i}).forEach(e=>{const{x:t,y:a,w:n,h:i,model:s}=e;l.push({x:t,y:a,w:n,h:i,i:s.codeName,appName:o.model.name,portletName:s.title,portletImage:s.sysImage,portletCodeName:s.codeName,appCodeName:s.appDataEntityId||o.model.pkgcodeName})})}return l}function Qw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Zw=a({name:"IBizDashboardDesign",props:{dashboard:{type:Object,required:!0},customDashboard:{type:Object,required:!0},isShowDesign:{type:Boolean,required:!0}},emits:["saved","reset"],setup(e,{emit:t}){const a=B("dashboard-design"),n=e.dashboard,i=e.customDashboard,s=o([]),l=o([]),d=o([]),u=o(""),p=o(ko(i.customModelData)),m=o(ko(i.portletConfig)),v=o({}),g=o({}),b=o(null),f=o(!1),w=e=>{const t=[];return e.forEach(e=>{let a=t.find(t=>Object.is(e.type,t.type));a||(a={},Object.assign(a,{type:e.type,name:Object.is(e.type,"app")?ibiz.i18n.t("control.dashboard.dashboardDesign.global"):e.appName,children:[]}),t.push(a)),((e,t)=>{let a=e.find(e=>Object.is(t.groupCodeName,e.type));a||(a={},Object.assign(a,{type:t.groupCodeName,name:t.groupName,children:[]}),e.push(a)),a.children.find(e=>Object.is(e.portletCodeName,t.portletCodeName))||a.children.push(t)})(a.children,e)}),t},y=async()=>{const t=[],a=ibiz.hub.getApp(n.model.appId);if(2===n.model.customizeMode){const e=await n.loadAllDynaPortlet();null==e||e.forEach(e=>{const n={type:"app",dynamodelFlag:1,portletId:e.psappportletid,portletCodeName:e.codename,portletName:e.psappportletname,groupCodeName:e.groupcodename||"Ungroup",groupName:e.groupname||ibiz.i18n.t("control.dashboard.dashboardDesign.unGroup"),appCodeName:a.model.pkgcodeName,appName:a.model.name};t.push(n)})}else if(a.model.appPortletCats&&a.model.appPortlets){const n=i.model.appDataEntityId,o=e.dashboard.controlParams.categorytag,s=e.dashboard.controlParams.portletnametag;a.model.appPortlets.forEach(e=>{var i;if(!n&&!e.enableAppDashboard)return;if(n&&!e.enableDEDashboard)return;const l=null==(i=a.model.appPortletCats)?void 0:i.find(t=>{var a;return t.codeName===(null==(a=e.appPortletCat)?void 0:a.codeName)});if(o){const e=new RegExp(o);if(!l||l&&l.codeName&&!e.test(l.codeName))return}if(s){const t=new RegExp(s);if(e.codeName&&!t.test(e.codeName))return}const r={type:"app",portletCodeName:e.codeName,portletName:e.name,portletImage:e.control.sysImage,groupCodeName:(null==l?void 0:l.codeName)||"",groupName:(null==l?void 0:l.name)||"",appCodeName:e.appDataEntityId||a.model.pkgcodeName,appName:a.model.name};t.push(r)})}const o=(e=>{const t=[];return e.forEach(e=>{var a;Object.is(e.type,"app")&&t.push(e);const n=(null==(a=i.model)?void 0:a.appDataEntityId)||"app";Object.is(e.appCodeName,n)&&t.push(e)}),t})(t);s.value=o,l.value=w(o).reverse(),d.value=(e=>{const t=[];return e.forEach(e=>{const a=t.find(t=>Object.is(t.value,e.groupCodeName));a?a.children.find(t=>Object.is(t.portletCodeName,e.portletCodeName))||a.children.push(e):t.push({name:e.groupName,value:e.groupCodeName,children:[e]})}),t})(o)},C=r(()=>{let e=[];return u.value?e=[u.value]:d.value.forEach((t,a)=>{e.push(t.value+a)}),e}),I=e=>{const t=ibiz.hub.getApp(n.model.appId);if(t.model.appPortlets){const a=t.model.appPortlets.find(t=>{var a;return(null==(a=t.control)?void 0:a.codeName)===e});if(a)return a.control}},x=async e=>{if(e.dynamodelFlag){if(e.portletModel)return e.portletModel;return await n.loadDynaPortletById(e.portletId)}return I(e.portletCodeName)},S=async t=>{const a=await(async e=>{const t=[];if(e.length>0)for(let a=0;a<e.length;a++){const n=await x(e[a]);n&&t.push(n)}return t})(t);return await(async t=>{(null==t?void 0:t.length)&&await Promise.all(t.map(async t=>{const a=await Wn(t);if(a){v.value[t.id]=a;const n=await a.createController(t,e.dashboard);g.value[t.id]=n}}))})(a),await(async()=>{const e=m.value||{};Object.keys(e).forEach(t=>{const a=g.value[t];a&&(a.config=e[t],a.state.title=a.config.srftitle,Object.assign(a.params,a.config))})})(),a};c(()=>e.isShowDesign,async e=>{if(e)try{f.value=!0,await y();const e=await i.loadCustomModelData();let t=ko(e.model);t.length||(t=Jw(n,i));const a=await S(t);p.value=t,p.value.forEach((e,t)=>{e.dynamodelFlag&&(e.portletModel=a[t])}),m.value=ko(e.config)}catch(e){ibiz.log.error(e)}finally{f.value=!1}},{immediate:!0});const E=o(0),D=r(()=>"calc((100% - 10px) / ".concat(i.layoutColNum,") ").concat(i.layoutRowH+10,"px"));return h(async()=>{const e=Object.values(g.value);await Promise.all(e.map(async e=>{await e.destroyed()}))}),{ns:a,customC:i,portlets:s,list:l,groups:d,filterVal:u,defaultOpens:C,layoutModel:p,isLoading:f,onReset:async()=>{const e=await i.resetCustomModelData();p.value=e.model,m.value=e.config,t("reset")},onSave:async()=>{const e=await i.saveCustomModelData(p.value);t("saved",{model:e.model,config:e.config})},removeItem:async e=>{const t=p.value.indexOf(e);if(-1!==t){p.value.splice(t,1);const a=await x(e);if(a){const e=g.value[a.id];await e.destroyed()}}},addLayoutItem:async e=>{const t=await S([e]),a=b.value;a&&(E.value=a.scrollHeight+3*i.layoutRowH);let o=0;for(const e of p.value)e.y>o&&(o=e.y);const s={w:4,h:3,x:0,y:o+3,i:e.portletCodeName,...e};if(e.dynamodelFlag){const a=n.dynaPortletMap.get(e.portletId);a&&Object.assign(s,{controlmodeldigest:a.controlmodeldigest}),Object.assign(s,{portletModel:t[0]})}if(p.value.push(s),a){const e=setInterval(()=>{a.scrollHeight>=E.value&&(a.scrollTo({top:a.scrollHeight,behavior:"smooth"}),clearInterval(e))},50)}},handleColNumberChange:e=>{i.layoutColNum=e},handleRolHChange:e=>{i.layoutRowH=e},isDisabled:e=>!!p.value.find(t=>t.i===e.portletCodeName),providers:v,portletControllers:g,maskSize:D,designPanel:b,getPortletModelByCodeName:I}},render(){let e,t,a,o;const s=e=>n(i("el-menu-item"),{key:e.portletCodeName,index:e.portletCodeName,tag:e.portletCodeName,disabled:this.isDisabled(e)},{default:()=>[n("span",null,[n("ion-icon",{icon:e.portletImage},null),e.portletName]),n("ion-icon",{title:Tt(ibiz.i18n.t("control.dashboard.dashboardDesign.add")),name:"arrow-forward-outline",onClick:()=>this.addLayoutItem(e)},null)]}),r=e=>{const t=e.dynamodelFlag?e.portletModel:this.getPortletModelByCodeName(e.portletCodeName);if(!t)return null;const a=this.providers[t.id],o=this.portletControllers[t.id],s={modelData:t,controller:o};if(!a||!o)return n("div",null,[t.portletType,ibiz.i18n.t("app.noSupport")]);const r=i(a.component);return l(r,{...s,key:t.id})};return n("div",{class:this.ns.b()},[n("div",{class:this.ns.b("header")},[n("span",null,[ibiz.i18n.t("control.dashboard.dashboardDesign.customPortal")]),n("span",{class:this.ns.b("header-utils")},[n("div",{class:this.ns.be("header-utils","col-num")},[ibiz.i18n.t("control.dashboard.dashboardDesign.colNum"),p(":"),n(i("el-input-number"),{modelValue:this.customC.layoutColNum,"onUpdate:modelValue":e=>this.customC.layoutColNum=e,onChange:this.handleColNumberChange},null)]),n("div",{class:this.ns.be("header-utils","row-h")},[ibiz.i18n.t("control.dashboard.dashboardDesign.cellHeight"),p(":"),n(i("el-input-number"),{modelValue:this.customC.layoutRowH,"onUpdate:modelValue":e=>this.customC.layoutRowH=e,onChange:this.handleRolHChange},null)]),n(i("el-button"),{class:this.ns.be("header-utils","reset"),style:{display:this.customC.multiMode?"none":"inline-flex"},onClick:this.onReset},Qw(e=ibiz.i18n.t("control.dashboard.dashboardDesign.restoreDefault"))?e:{default:()=>[e]}),n(i("el-button"),{class:this.ns.be("header-utils","save"),onClick:this.onSave},Qw(t=ibiz.i18n.t("control.dashboard.dashboardDesign.save"))?t:{default:()=>[t]})])]),n("div",{class:this.ns.b("content")},[n("div",{class:this.ns.b("tree")},[n(i("el-select"),{modelValue:this.filterVal,"onUpdate:modelValue":e=>this.filterVal=e,clearable:!0,class:this.ns.b("tree-filter")},Qw(a=this.groups.map(e=>n(i("el-option"),{key:e.value,value:e.value,label:e.name},null)))?a:{default:()=>[a]}),n("div",{class:this.ns.b("tree-content")},[(()=>{let e,t;return this.filterVal?n(i("el-menu"),{"default-openeds":this.defaultOpens,class:this.ns.is("filter",!0),key:this.filterVal},Qw(e=this.groups.map(e=>e.value===this.filterVal?n(i("el-sub-menu"),{key:e.value,index:e.value},{title:()=>e.name,default:()=>e.children.map(e=>s(e))}):null))?e:{default:()=>[e]}):n(i("el-menu"),{class:this.ns.is("no-filter",!0),"default-openeds":this.defaultOpens,key:"default"},Qw(t=this.groups.map((e,t)=>n(i("el-sub-menu"),{key:e.value+t,index:e.value+t},{title:()=>e.name,default:()=>e.children.map(e=>s(e))})))?t:{default:()=>[t]})})()])]),b(n("div",{ref:"designPanel",class:this.ns.b("scroll-box")},[n("div",{class:this.ns.b("panel")},[n("div",{class:this.ns.b("grid-layout-mask"),style:{backgroundSize:this.maskSize}},null),n(i("grid-layout"),{class:this.ns.b("grid-layout"),layout:this.layoutModel,"col-num":this.customC.layoutColNum,"row-height":this.customC.layoutRowH,"is-draggable":!0,"is-resizable":!0,"is-mirrored":!1,"vertical-compact":!0,margin:[10,10],"use-css-transforms":!0,style:{maxHeight:"100%"}},Qw(o=this.layoutModel.map(e=>n(i("grid-item"),{x:e.x,y:e.y,w:e.w,h:e.h,i:e.i,key:e.i},{default:()=>[n(i("el-card"),{class:this.ns.b("grid-layout-item")},{default:()=>[n("ion-icon",{name:"close-outline",title:ibiz.i18n.t("app.delete"),onClick:()=>this.removeItem(e),class:this.ns.b("grid-layout-item-icon")},null),n("div",{class:this.ns.b("grid-layout-item-content")},[r(e)])]})]})))?o:{default:()=>[o]})])]),[[C("loading"),this.isLoading]])])])}}),ey=a({name:"IBizCustomDashboardContainer",props:{modelData:{type:Object,required:!0},dashboard:{type:Object,required:!0}},setup(e,{emit:t}){const a=B("custom-dashboard-container"),n=new Yn(e.modelData,e.dashboard);e.dashboard.setCustomDashboard(n);const i=u(n),s=o(!1),l=o(!1),r=o(!1),c=o(!1),h=async t=>{if(t.dynamodelFlag){if(t.portletModel)return t.portletModel;return await e.dashboard.loadDynaPortletById(t.portletId)}return(t=>{const a=ibiz.hub.getApp(e.dashboard.model.appId);if(a.model.appPortlets){const e=a.model.appPortlets.find(e=>{var a;return(null==(a=e.control)?void 0:a.codeName)===t});if(e)return e.control}})(t.portletCodeName)},p=async e=>{const t=[];if(e.length>0)for(let a=0;a<e.length;a++){const n=await h(e[a]);n&&t.push(n)}return t},m=async t=>{var a,n;const i=null==(a=e.dashboard.model.controls)?void 0:a.filter(e=>"FILTER"===e.portletType),o=null==(n=e.dashboard.model.controls)?void 0:n.filter(e=>"FILTER"!==e.portletType);t.model&&t.model.length>0?await e.dashboard.initPortlets(t.model):i&&i.length>0&&(await e.dashboard.initPortlets(i),await e.dashboard.initPortlets(o||[])),await e.dashboard.initPortletsConfig(t.config)};return d(async()=>{var a;c.value="BIREPORTDASHBOARD"===(null==(a=e.dashboard.model)?void 0:a.dashboardStyle);const n=await i.loadCustomModelData(),o=await p(n.model);t("changed",{model:o}),await m({model:o,config:n.config}),s.value=!0,e.dashboard.evt.on("onConfigChange",async e=>{const{name:t,config:a}=e;i.saveCustomModelData(i.customModelData,{[t]:a})}),e.dashboard.evt.on("onSavePortlet",async a=>{const n=await p(a.model);await m({model:n,config:a.config}),e.dashboard.refresh(),t("changed",{model:n})})}),{ns:a,customC:i,isShowDesign:l,isInited:s,showTypeDir:r,showFilter:c,openDesign:()=>{l.value=!0},onSaved:async e=>{l.value=!1;const a=await p(e.model);await m({model:a,config:e.config}),t("changed",{model:a})},onReset:async()=>{s.value=!1,l.value=!1,await e.dashboard.resetPortlets(),await g(),s.value=!0},clickCollapse:e=>{r.value="left"===e},openFilterDesign:()=>{e.dashboard.openFilterDesignPage()}}},render(){var e,t;return b(n("div",{class:[this.ns.b()]},[this.customC.showDesignBtn?n("div",{class:this.ns.b("build-btn")},[this.showTypeDir?n("div",null,[this.showFilter?n(i("el-button"),{class:this.ns.b("deisgn-btn"),title:ibiz.i18n.t("control.dashboard.customDashboardContainer.newFilter"),onClick:this.openFilterDesign},{default:()=>[n("ion-icon",{name:"filter-outline"},null)]}):null,n(i("el-button"),{class:this.ns.b("deisgn-btn"),title:Tt(ibiz.i18n.t("control.dashboard.customDashboardContainer.portalCustomPrompt")),onClick:this.openDesign},{default:()=>[n("ion-icon",{name:"build-outline"},null)]}),n(i("el-button"),{class:this.ns.b("forward-btn"),onClick:()=>this.clickCollapse("right")},{default:()=>[n("ion-icon",{name:"chevron-forward-outline"},null)]})]):n(i("el-button"),{class:this.ns.b("back-btn"),onClick:()=>this.clickCollapse("left")},{default:()=>[n("ion-icon",{name:"chevron-back-outline"},null)]})]):null,n(i("el-drawer"),{modelValue:this.isShowDesign,"onUpdate:modelValue":e=>this.isShowDesign=e,"with-header":!1,size:"80%","modal-class":"custom-dashboard-drawer"},{default:()=>[this.isShowDesign&&n(i("iBizDashboardDesign"),{dashboard:this.dashboard,"custom-dashboard":this.customC,"is-show-design":this.isShowDesign,onSaved:this.onSaved,onReset:this.onReset},null)]}),this.isInited&&(0===this.customC.customModelData.length?null==(t=(e=this.$slots).default)?void 0:t.call(e):this.customC.customModelData.map(e=>{var t,a;const i={position:"absolute",height:"".concat(e.h*this.customC.layoutRowH,"px"),width:"calc(100% / ".concat(this.customC.layoutColNum," * ").concat(e.w,")"),top:"".concat(e.y*this.customC.layoutRowH,"px"),left:"calc(100% / ".concat(this.customC.layoutColNum," * ").concat(e.x,")")};return n("div",{style:i},[null==(a=(t=this.$slots)[e.portletCodeName])?void 0:a.call(t)])}))]),[[C("loading"),!this.isInited]])}});var ty=Object.defineProperty,ay=(e,t,a)=>(((e,t,a)=>{t in e?ty(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ny{constructor(){ay(this,"component","IBizDashboardControl")}}function iy(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const oy=e("ac",a({name:"IBizContainerPortlet",props:{modelData:{type:Object,required:!0},controller:{type:Kn,required:!0}},setup(e){var t;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase()))}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{layout:this.modelData.layout},iy(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},iy(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]}),l=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:l},iy(s)?s:{default:()=>[s]})}}));var sy=Object.defineProperty,ly=(e,t,a)=>(((e,t,a)=>{t in e?sy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ry{constructor(){ly(this,"component","IBizContainerPortlet")}async createController(e,t,a){const n=new Kn(e,t,a);return await n.init(),n}}const cy=e("ab",ie(oy,function(e){e.component(oy.name,oy),Xn("CONTAINER",()=>new ry)})),dy=e("ad",a({name:"IBizPortletLayout",props:{controller:{type:$n,required:!0},linkAction:{type:Object}},setup(e){var t;const a=B("portlet-layout"),o="portlet-".concat(null==(t=e.controller.model.portletType)?void 0:t.toLowerCase()),s=e.controller,l=e.controller.dashboard.state.zIndex,c=r(()=>{const e=[a.em("toolbar","".concat(o,"-").concat(s.model.id))],{codeName:t}=s.dashboard.view.model;return e.push(a.em("toolbar",t)),e}),d=r(()=>s.model.showTitleBar&&(s.model.title||s.model.sysImage)||s.model.uiactionGroup),u=s.dashboard.model.controlRenders,h=null==u?void 0:u.find(e=>"dashboard_".concat(e.id)==="".concat(s.model.name,"_header")),p=null==u?void 0:u.find(e=>"dashboard_".concat(e.id)==="".concat(s.model.name,"_header_caption")),m=null==u?void 0:u.find(e=>"dashboard_".concat(e.id)==="".concat(s.model.name,"_header_bg")),v=null==u?void 0:u.find(e=>"dashboard_".concat(e.id)==="".concat(s.model.name,"_header_action"));return{c:s,ns:a,zIndex:l,popperClass:c,portletType:o,isShowHeader:d,header:h,headerCaption:p,headerBg:m,headerAction:v,renderContent:e=>{if("LAYOUTPANEL_MODEL"===e.renderType&&e.layoutPanelModel){const t=Ua.execScriptFn({params:s.params,context:s.context},e.layoutPanelModel,{isAsync:!1});return n("div",{class:a.b("header-render"),innerHTML:t},null)}if("LAYOUTPANEL"===e.renderType&&e.layoutPanel)return n(i("iBizControlShell"),{class:a.b("header-render"),params:s.params,context:s.context,modelData:e.layoutPanel},null)},openLink:t=>{e.linkAction&&e.controller.onActionClick(e.linkAction,t)},clickPorlet:(e,t)=>{e.stopPropagation(),s.dashboard.view.evt.emit("onPorletClick",{data:{tag:s.model.codeName,position:t}})},onActionClick:async(t,a)=>{await e.controller.onActionClick(t,a)}}},render(){var e,t;const{model:a,state:o}=this.controller,s=!!(this.header||this.headerCaption||this.headerBg||this.headerAction);return n("div",{class:[this.ns.b(),this.ns.is("no-header",!this.isShowHeader),this.ns.is("hight-light",o.hightLight)]},[this.isShowHeader?this.header?n("div",{key:"header",class:[this.ns.b("header"),this.ns.is("custom",s)]},[this.renderContent(this.header)]):n("div",{key:"header",class:[this.ns.b("header"),this.ns.is("custom",s)]},[this.headerBg&&n("div",{class:this.ns.be("header","bg")},[this.renderContent(this.headerBg)]),n("div",{class:this.ns.be("header","left"),onClick:e=>this.clickPorlet(e,"title")},[a.showTitleBar&&(this.headerCaption?this.renderContent(this.headerCaption):n("div",{class:[this.ns.e("caption"),this.ns.is("link",!!this.linkAction)],onClick:this.openLink},[n(i("iBizIcon"),{class:this.ns.e("caption-icon"),icon:a.sysImage},null),n("span",{class:this.ns.e("caption-text"),title:Tt(o.title)},[o.title])]))]),n("div",{class:this.ns.be("header","right")},[this.headerAction?this.renderContent(this.headerAction):"ACTIONBAR"!==a.portletType&&a.uiactionGroup&&n(i("iBizActionToolbar"),{zIndex:this.zIndex,class:this.ns.e("toolbar"),"action-details":a.uiactionGroup.uiactionGroupDetails,"actions-state":o.actionGroupState,mode:"ITEMS"===a.actionGroupExtractMode?"dropdown":"buttons",popperClass:this.popperClass,onActionClick:this.onActionClick},null)])]):null,n("div",{key:"content",class:this.ns.b("content"),onClick:e=>this.clickPorlet(e,"content")},[null==(t=(e=this.$slots).default)?void 0:t.call(e)])])}}));const uy=e("af",a({name:"IBizViewPortlet",props:{modelData:{type:Object,required:!0},controller:{type:Jn,required:!0}},setup(e){var t;const a=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),n=e.modelData.portletAppView;let i;return d(()=>{const t=e.controller.model.timer;t&&t>0&&(i=setInterval(()=>{e.controller.refresh()},t))}),m(()=>{clearInterval(i)}),{ns:a,view:n}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:a,params:o}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,class:t},"function"==typeof(r=e=l(i("IBizViewShell"),{context:a,params:o,modelData:this.view}))||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?e:{default:()=>[e]});var r}}));var hy=Object.defineProperty,py=(e,t,a)=>(((e,t,a)=>{t in e?hy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class my{constructor(){py(this,"component","IBizViewPortlet")}async createController(e,t,a){const n=new Jn(e,t,a);return await n.init(),n}}const vy=e("ae",ie(uy,function(e){e.component(uy.name,uy),Xn("VIEW",()=>new my)}));function gy(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const by=a({name:"IBizAppMenuPortletControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},collapse:Boolean,currentPath:String},setup(){var e;const t=ne((...e)=>new Ga(...e)),a=B("control-".concat(t.model.controlType.toLowerCase(),"-portlet")),s=o(""),l=o([]);null==(e=t.model.appMenuItems)||e.forEach(e=>{"MENUITEM"===e.itemType&&l.value.push(e.id)});const r=async(e,a)=>{await t.onClickMenuItem(e,a)},c=e=>t.state.menuItemsState[e.id].visible?n("div",{class:[a.b("item"),a.is("disabled",!e.appFuncId)],title:Tt(e.tooltip||e.caption),onClick:t=>{e.appFuncId&&r(e.id,t)}},[n(i("iBizIcon"),{class:a.be("item","icon"),icon:e.sysImage},null),n("span",{class:a.be("item","label")},[e.caption])]):null;return{c:t,ns:a,defaultActive:s,defaultOpens:l,onClick:r,renderGroup:e=>t.state.menuItemsState[e.id].visible?e.appMenuItems?n(i("el-collapse-item"),{class:a.b("group"),name:e.id,title:Tt(e.caption)},{default:()=>{var t;return[null==(t=e.appMenuItems)?void 0:t.map(e=>c(e))]}}):c(e):null,renderItem:c}},render(){var e;const{state:t,model:a}=this.c;let o=null;if(t.isCreated&&(null==(e=a.appMenuItems)?void 0:e.length)){let e;o=n(i("el-collapse"),{class:this.ns.e("content"),modelValue:this.defaultOpens,"onUpdate:modelValue":e=>this.defaultOpens=e},gy(e=a.appMenuItems.map(e=>"MENUITEM"!==e.itemType?null:this.renderGroup(e)))?e:{default:()=>[e]})}return n(i("iBizControlBase"),{class:[this.ns.b()],controller:this.c},gy(o)?o:{default:()=>[o]})}}),fy=e("ah",a({name:"IBizMenuPortlet",props:{modelData:{type:Object,required:!0},controller:{type:Qn,required:!0}},setup(e){var t,a;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),menu:null==(a=e.modelData.controls)?void 0:a.find(e=>e.controlType===qa.APP_MENU)}},render(){const e=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:t,params:a}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,class:e},{default:()=>[this.menu&&n(i("iBizAppMenuPortletControl"),{modelData:this.menu,context:t,params:a},null)]})}}));var wy=Object.defineProperty,yy=(e,t,a)=>(((e,t,a)=>{t in e?wy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Cy{constructor(){yy(this,"component","IBizMenuPortlet")}async createController(e,t,a){const n=new Qn(e,t,a);return await n.init(),n}}const Iy=e("ag",ie(fy,function(e){e.component(fy.name,fy),e.component(by.name,by),Xn("APPMENU",()=>new Cy)}));const xy=e("aj",a({name:"IBizChartPortlet",props:{modelData:{type:Object,required:!0},controller:{type:Zn,required:!0}},setup(e){var t,a;const n=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),i=null==(a=e.modelData.controls)?void 0:a.find(e=>e.controlType===qa.CHART);let o;return d(()=>{const t=e.controller.model.timer;t&&t>0&&(o=setInterval(()=>{e.controller.refresh()},t))}),m(()=>{clearInterval(o)}),{ns:n,chart:i}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:a,params:o}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,class:t},"function"==typeof(r=e=l(i("IBizControlShell"),{context:a,params:o,modelData:this.chart}))||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?e:{default:()=>[e]});var r}}));var Sy=Object.defineProperty,Ey=(e,t,a)=>(((e,t,a)=>{t in e?Sy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Dy{constructor(){Ey(this,"component","IBizChartPortlet")}async createController(e,t,a){const n=new Zn(e,t,a);return await n.init(),n}}const Py=e("ai",ie(xy,function(e){e.component(xy.name,xy),Xn("CHART",()=>new Dy)}));const ky=e("al",a({name:"IBizRawItemPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ei,required:!0}},setup(e){var t;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),rawItem:e.modelData}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:t},"function"==typeof(a=e=l(i("iBizRawItem"),{rawItem:this.rawItem}))||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?e:{default:()=>[e]});var a}}));var zy=Object.defineProperty,Ty=(e,t,a)=>(((e,t,a)=>{t in e?zy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ay{constructor(){Ty(this,"component","IBizRawItemPortlet")}async createController(e,t,a){const n=new ei(e,t,a);return await n.init(),n}}const Oy=e("ak",ie(ky,function(e){e.component(ky.name,ky),Xn("RAWITEM",()=>new Ay)}));const My=e("an",a({name:"IBizListPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ti,required:!0}},setup(e){var t,a;const n=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),i=null==(a=e.modelData.controls)?void 0:a.find(e=>e.controlType===qa.LIST);let o;return d(()=>{const t=e.controller.model.timer;t&&t>0&&(o=setInterval(()=>{e.controller.refresh()},t))}),m(()=>{clearInterval(o)}),{ns:n,list:i}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:a,params:o}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,class:t},"function"==typeof(r=e=l(i("IBizControlShell"),{context:a,params:o,modelData:this.list}))||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?e:{default:()=>[e]});var r}}));var Ny=Object.defineProperty,By=(e,t,a)=>(((e,t,a)=>{t in e?Ny(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ly{constructor(){By(this,"component","IBizListPortlet")}async createController(e,t,a){const n=new ti(e,t,a);return await n.init(),n}}const Ry=e("am",ie(My,function(e){e.component(My.name,My),Xn("LIST",()=>new Ly)})),_y=e("ap",a({name:"IBizHtmlPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ai,required:!0}},setup(e){var t;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase()))}},render(){const e=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:e},{default:()=>[n("iframe",{src:this.modelData.pageUrl},null)]})}}));var jy=Object.defineProperty,Vy=(e,t,a)=>(((e,t,a)=>{t in e?jy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Fy{constructor(){Vy(this,"component","IBizHtmlPortlet")}async createController(e,t,a){const n=new ai(e,t,a);return await n.init(),n}}const Uy=e("ao",ie(_y,function(e){e.component(_y.name,_y),Xn("HTML",()=>new Fy)})),Hy=e("ar",a({name:"IBizActionBarPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ni,required:!0}},setup(e){var t;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),zIndex:e.controller.dashboard.state.zIndex,onActionClick:async(t,a)=>{await e.controller.onActionClick(t,a)}}},render(){const e=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:e},{default:()=>[this.modelData.uiactionGroup&&n(i("iBizActionToolbar"),{zIndex:this.zIndex,"action-details":this.modelData.uiactionGroup.uiactionGroupDetails,"actions-state":this.controller.state.actionGroupState,onActionClick:this.onActionClick},null)]})}}));var qy=Object.defineProperty,Gy=(e,t,a)=>(((e,t,a)=>{t in e?qy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Wy{constructor(){Gy(this,"component","IBizActionBarPortlet")}async createController(e,t,a){const n=new ni(e,t,a);return await n.init(),n}}const Yy=e("aq",ie(Hy,function(e){e.component(Hy.name,Hy),Xn("ACTIONBAR",()=>new Wy)}));const Ky=e("at",a({name:"IBizReportPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ii,required:!0}},setup(e){var t,a;const n=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),i=null==(a=e.modelData.controls)?void 0:a.find(e=>e.controlType===qa.REPORT_PANEL),o=r(()=>{const{uiactionGroupDetails:t=[]}=e.controller.model.uiactionGroup||{};return t.find(e=>e.uiactionId&&e.uiactionId.startsWith("bi_report_view"))});let s;return d(()=>{const t=e.controller.model.timer;t&&t>0&&(s=setInterval(()=>{e.controller.refresh()},t))}),m(()=>{clearInterval(s)}),{ns:n,report:i,linkAction:o}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:a,params:o}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,linkAction:this.linkAction,class:t},"function"==typeof(r=e=l(i("IBizControlShell"),{context:a,params:o,modelData:this.report}))||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?e:{default:()=>[e]});var r}}));var Xy=Object.defineProperty,$y=(e,t,a)=>(((e,t,a)=>{t in e?Xy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Jy{constructor(){$y(this,"component","IBizReportPortlet")}async createController(e,t,a){const n=new ii(e,t,a);return await n.init(),n}}const Qy=e("as",ie(Ky,function(e){e.component(Ky.name,Ky),Xn("REPORT",()=>new Jy)}));const Zy=a({name:"IBizFilterPortletItem",props:{context:{type:Object,required:!0},params:{type:Object,required:!0},field:{type:Object,required:!0},filterNode:{type:Object}},emits:["change"],setup(e,{emit:t}){const a=B("filter-portlet-item"),d=o(void 0),u=o(void 0),h=o({value:null,valueOP:null,nodeType:"FIELD",field:e.field.appDEFieldId}),p=r(()=>ibiz.util.jsonSchema.getValueOPsByDataType(e.field.type)),m=async t=>{const a=ibiz.util.jsonSchema.getMockEditor(e.context,e.field,t);a&&(d.value=await Ma(a),d.value&&(u.value=await d.value.createController(a,{context:e.context,params:e.params})))};c(()=>e.filterNode,()=>{(async()=>{e.filterNode&&(h.value={...e.filterNode}),m(p.value[0].valueOP)})()},{immediate:!0});const v=e=>{h.value.value=e,t("change",h.value)},g=()=>{if(u.value){const e=i(d.value.formEditor);return l(e,{value:h.value.value,controller:u.value,onChange:(e,t)=>{v(e)}})}};return{ns:a,renderContent:()=>{let e;return n("div",{class:a.e("content")},[n("div",{class:a.em("content","option")},[n(i("el-select"),{"model-value":h.value.valueOP,onChange:e=>{(e=>{h.value.valueOP=e,v(null),m(e)})(e)}},(t=e=p.value.map(e=>n(i("el-option"),{key:e.valueOP,value:e.valueOP,label:e.label},null)),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))]),n("div",{class:a.em("content","editor")},[g()])]);var t}}},render(){return n("div",{class:this.ns.b()},[n("div",{class:this.ns.e("header")},[n("span",{class:this.ns.em("header","caption")},[this.field.caption])]),this.renderContent()])}});function eC(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const tC=e("av",a({name:"IBizFilterPortlet",props:{modelData:{type:Object,required:!0},controller:{type:oi,required:!0}},setup(e){var t;const a=e.controller,n=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase()));return{ns:n,handleReset:()=>{a.resetFilter()},handleSearch:()=>{a.search()},renderFilter:()=>{if(!a.state.filterNode)return;return(a.state.filterNode.children||[]).map((e,t)=>((e,t)=>{const n=a.jsonSchemaFields.find(t=>t.appDEFieldId===e.field);if(n)return l(Zy,{field:n,filterNode:e,context:a.context,params:a.params,onChange:e=>{a.state.filterNode.children[t]=e}})})(e,t))}}},render(){let e,t;const a=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:a},{default:()=>[n("div",{class:this.ns.e("left")},[this.renderFilter()]),n("div",{class:this.ns.e("right")},[n(i("el-button"),{onClick:this.handleReset},eC(e=ibiz.i18n.t("app.reset"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:this.handleSearch},eC(t=ibiz.i18n.t("app.search"))?t:{default:()=>[t]})])]})}}));var aC=Object.defineProperty,nC=(e,t,a)=>(((e,t,a)=>{t in e?aC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class iC{constructor(){nC(this,"component","IBizFilterPortlet")}async createController(e,t,a){const n=new oi(e,t,a);return await n.init(),n}}function oC(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const sC=a({name:"IBizFilterPortletDesign",props:{context:{type:Object,required:!0},viewParams:{type:Object,required:!0},filter:{type:Object},items:{type:Array,default:()=>[]},dashboardStyle:{type:String},dismiss:{type:Function,required:!0}},emits:["lisTSelect","formChange"],setup(e){const t=B("filter-portlet-design"),a=o(!1),s=o(!1),l=o(),r=u({title:[{required:!0,message:ibiz.i18n.t("control.dashboard.filterPortletDesign.ctrlTitleError"),trigger:"blur"}]}),c=u({title:"",selectAll:!0,items:[]}),d=o({}),h=o();let m=[],v=[];const g=o({}),f=o([]),w=new Map,y=new Map,I=o([]),x=async t=>{t&&(w.has(t)||(s.value=!0,f.value=await ibiz.util.jsonSchema.getEntitySchemaFields(t,e.context,e.viewParams),s.value=!1,w.set(t,f.value)),f.value=w.get(t))},S=()=>{I.value=si(h.value.id,e.context,e.items,"BIREPORTDASHBOARD"===e.dashboardStyle||"BIREPORTDASHBOARD2"===e.dashboardStyle)};(async()=>{var t;if(v=(()=>{let t=[];const a=ibiz.hub.getApp(e.context.srfappid);return m=a.model.appPortlets||[],m.length>0&&(t=m.filter(e=>{if(e.control)return"PORTLET"===e.control.controlType&&"FILTER"===e.control.portletType})),t})(),e.items&&(c.items=e.items.map(e=>e.id)),e.filter){const a=v.find(t=>t.id===e.filter.model.id);if(a){h.value=Yt(a.control),c.title=e.filter.config.srftitle,g.value=a.portletParams||{};"all"===e.filter.filterConfig.scope||(c.selectAll=!1,c.items=(null==(t=e.filter.filterConfig.scopedata)?void 0:t.split(","))||[]),d.value=e.filter.searchConds}}!h.value&&v.length>0&&(h.value=Yt(v[0].control),c.title=h.value.title||"",g.value=v[0].portletParams||{}),h.value&&(await x(h.value.appDataEntityId),S()),a.value=!0})();const E=e=>{d.value=e,y.set(h.value.appDataEntityId,e)},D=t=>{t&&e.items&&(c.items=e.items.map(e=>e.id))},P=()=>{e.dismiss({ok:!1})},k=()=>{l.value&&l.value.validate(t=>{if(t){const t={config:(()=>{const e={};if(c.selectAll)e.scope="all";else{e.scope="custom";const t=[];I.value.forEach(e=>{c.items.includes(e.id)&&t.push(e.id)}),e.scopedata=t.join(",")}return Object.keys(g.value).length>0&&(e.scopetag=g.value.filtergroup),e})(),model:Object.assign(h.value,{title:c.title}),searchconds:d.value};e.dismiss({ok:!0,data:[t]})}})},z=()=>v.length?n("ul",{class:[t.b("left-list")]},[v.map(a=>{var i;const o=a.control,s=a.portletParams||{};let l=!1;return e.filter&&e.filter.id!==o.id&&(l=!0),n("li",{class:[t.be("left-list","item"),t.is("disabled",l),t.is("actvie",o.id===(null==(i=h.value)?void 0:i.id))],title:o.title,onClick:()=>((e,t,a)=>{a||(h.value=Yt(e),c.title=e.title||"",g.value=t,x(e.appDataEntityId),y.has(e.appDataEntityId)?d.value=y.get(e.appDataEntityId):d.value={},S())})(o,s,l)},[o.title])})]):n(i("iBizNoData"),{text:ibiz.i18n.t("control.common.currentNoData")},null),T=()=>{let e;if(!I.value)return;const a=I.value.length>0&&1===c.items.length;return n(i("el-checkbox-group"),{class:[t.b("checkbox"),t.is("only-add",a)],modelValue:c.items,"onUpdate:modelValue":e=>c.items=e,disabled:c.selectAll},oC(e=I.value.map(e=>n(i("el-checkbox"),{label:e.id,disabled:a&&c.items.includes(e.id)},{default:()=>[e.title]})))?e:{default:()=>[e]})};return{ns:t,loaded:a,formRef:l,renderRightContent:()=>n("div",{class:[t.b("right-content")]},[n("div",{class:[t.be("right-content","title")]},[ibiz.i18n.t("control.dashboard.filterPortletDesign.baseSet")]),h.value?n(i("el-form"),{ref:"formRef",model:c,rules:r,"label-width":"auto",class:t.b("right-form")},{default:()=>[n(i("el-form-item"),{required:!0,label:ibiz.i18n.t("control.dashboard.filterPortletDesign.ctrlTitle"),prop:"title"},{default:()=>[n(i("el-input"),{modelValue:c.title,"onUpdate:modelValue":e=>c.title=e,maxlength:32,placeholder:ibiz.i18n.t("control.dashboard.filterPortletDesign.ctrlPlaceholder")},{suffix:()=>n("div",null,[c.title.length,p(" / "),32])})]}),n(i("el-form-item"),{class:t.be("right-form","checks"),label:ibiz.i18n.t("control.dashboard.filterPortletDesign.checkTitle"),required:!0,props:"items"},{default:()=>[n(i("el-switch"),{title:ibiz.i18n.t("control.dashboard.filterPortletDesign.selectAll"),modelValue:c.selectAll,"onUpdate:modelValue":e=>c.selectAll=e,onChange:D},null),T()]})]}):null]),renderLeftContent:()=>{const a=e.filter?ibiz.i18n.t("app.edit"):ibiz.i18n.t("app.newlyBuild");return n("div",{class:[t.b("left-content")]},[n("div",{class:t.be("left-content","title")},["".concat(a," ").concat(ibiz.i18n.t("control.dashboard.filterPortletDesign.filterTitle"))]),z()])},renderCondition:()=>b(n(i("iBizCustomFilterCondition"),{class:t.b("condition"),context:e.context,params:e.viewParams,value:d.value,schemaFields:f.value,onChange:E},null),[[C("loading"),s.value]]),renderFooter:()=>{let e,a;return n("div",{class:t.b("footer")},[n(i("el-button"),{onClick:P,title:ibiz.i18n.t("app.cancel")},oC(e=ibiz.i18n.t("app.cancel"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:k,title:ibiz.i18n.t("app.confirm")},oC(a=ibiz.i18n.t("app.confirm"))?a:{default:()=>[a]})])}}},render(){if(this.loaded)return n("div",{class:[this.ns.b()]},[n("div",{class:[this.ns.e("layout-left")]},[this.renderLeftContent()]),n("div",{class:[this.ns.e("layout-right")]},[this.renderRightContent(),this.renderCondition(),this.renderFooter()])])}}),lC=e("au",ie(tC,function(e){e.component(tC.name,tC),e.component(sC.name,sC),Xn("FILTER",()=>new iC)})),rC=e("aa",ie($w,function(e){e.component($w.name,$w),e.component(Zw.name,Zw),e.component(ey.name,ey),Ha(qa.DASHBOARD,()=>new ny),e.component(dy.name,dy),e.use(cy),e.use(vy),e.use(Iy),e.use(Py),e.use(Oy),e.use(Ry),e.use(Uy),e.use(Yy),e.use(Qy),e.use(lC)})),cC="__epPropKey",dC=["#2196F3","#4CAF50","#3F51B5","#FF9800","#673AB7","#757575"],uC=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,hC=/^(rgb|rgba|RGB|RGBA)/,pC=(e,t,a,n="~")=>{var i,o;let s="";return e&&(null==(i=as(e))?void 0:i.isValid())&&(s=as(e).format(a)),t&&(null==(o=as(t))?void 0:o.isValid())&&(s="".concat(s," ").concat(n," ").concat(as(t).format(a))),s},mC=(e,t)=>{let a=e.get(t);const n=e.size;return t&&!a&&n<dC.length&&(a=dC[n],e.set(t,a)),a||dC[0]},vC=e=>{if(!e)return console.error("getRgbValue: Missing parameters!"),!1;const t=(e=>{const t=uC.test(e),a=hC.test(e),n=e;return t||a||e?n:(console.error("Color: Invalid color!"),"")})(e);if(!t)return!1;const a=uC.test(t),n=hC.test(t),i=t.toLowerCase();return a?(e=>{const t=e.replace("#","");return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]})(i):n?(e=>e.replace(/rgb\(|rgba\(|\)/g,"").split(",").slice(0,3).map(function(e){return parseInt(e,10)}))(i):void 0},gC=(e,t)=>{const a=t;if(!e)return console.error("fade: Missing parameters!"),!1;const n=vC(e);if(!n)return!1;return(e=>{if(!e)return console.error("getColorFromRgbValue: Missing parameters!"),!1;const t=e.length;if(3!==t&&4!==t)return console.error("getColorFromRgbValue: Value is illegal!"),!1;let a=3===t?"rgb(":"rgba(";return a+="".concat(e.join(","),")"),a})([...n,a/100])},bC=(e,t)=>{const a=new Date(e),n=t?new Date(t):new Date;return a.getDate()===n.getDate()&&a.getMonth()===n.getMonth()&&a.getFullYear()===n.getFullYear()};function fC(e,t,a){const n=as(a),i=as(e),o=as(t);return!!(n.isValid()&&i.isValid()&&o.isValid())&&(n.isSame(i,"day")||n.isSame(o,"day")||i.isBefore(n,"day")&&o.isAfter(n,"day"))}function wC(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const yC=(e,t,a)=>{const n=new Date(e),i=new Date(t),o=new Date(a);return n.setHours(0,0,0,0),i.setHours(0,0,0,0),o.setHours(0,0,0,0),n>=i&&n<=o},CC=(e,t)=>{const a=new Date(e),n=new Date(t);return a.getTime()>n.getTime()},IC=(e,t,a,n,i,o,s)=>{let l=ko(o),r=!0;const c=n.find(e=>t.id===e.id),d=l.findIndex(e=>t.id===e.id);switch(i?-1===d?l.push(c):(Object.assign(t,{isSelectedEvent:!1}),r=!1,l.splice(d,1)):-1===d?l=[c]:(Object.assign(t,{isSelectedEvent:!1}),r=!1,l=[]),e){case"eventClick":s("eventClick",{location:a,data:l});break;case"eventDblClick":s("eventDblClick",{location:a,data:l})}return{eventName:e,tempSelectedData:l,isSelectedEvent:r}},xC=(e,t)=>{if(!qo(e)||qo(a=e)&&a[cC])return e;var a;const{values:n,required:i,default:o,type:s,validator:l}=e,r=n||l?a=>{let i=!1,s=[];if(n&&(s=Array.from(n),wC(e,"default")&&s.push(o),i||(i=s.includes(a))),l&&(i||(i=l(a))),!i&&s.length>0){const e=[...new Set(s)].map(e=>JSON.stringify(e)).join(", ");T("Invalid prop: validation failed".concat(t?' for prop "'.concat(t,'"'):"",". Expected one of [").concat(e,"], got value ").concat(JSON.stringify(a),"."))}return i}:void 0,c={type:s,required:!!i,validator:r,[cC]:!0};return wC(e,"default")&&(c.default=o),c},SC=e=>Ho(Object.entries(e).map(([e,t])=>[e,xC(t,e)]));function EC(e,t,a){const n=ibiz.overlay.createPopover(t=>l(e,{modal:t}),void 0,{width:"auto",height:"auto",noArrow:!0,...a});return null==n||n.present(t),n}function DC(e,t){t.style.left="".concat(e.clientX+20,"px"),t.style.top="".concat(e.clientY+20,"px")}const PC=()=>{var e;const t=document.createElement("div");return t.style="position: fixed; height: 2px; width: 2px; z-index: -1;",null==(e=document.body)||e.appendChild(t),t},kC=e=>{document.body.removeChild(e)},zC="update:modelValue",TC="change",AC="input",OC="eventClick",MC="eventDblClick",NC="eventContextmenu",BC=SC({calendarTitle:{type:String},showDetail:{type:Boolean,default:!1},modelValue:{type:Date},range:{type:Array,validator:e=>Wo(e)&&2===e.length&&e.every(e=>Go(e))},viewType:{type:String,default:"DAY"},events:{type:Array,default:[]},legends:{type:Array,default:[]},multiple:{type:Boolean},selectedData:{type:Object}}),LC={[zC]:e=>Go(e),[AC]:e=>Go(e),[TC]:e=>Go(e),[OC]:e=>e,[MC]:e=>e,[NC]:e=>e},RC=SC({selectedDay:{type:Object},events:{type:Array,default:[]},legends:{type:Array,default:[]},multiple:{type:Boolean},selectedData:{type:Object},showDetail:{type:Boolean,default:!1}}),_C={pick:e=>qo(e),eventClick:e=>e,eventDblClick:e=>e,eventContextmenu:e=>e},jC=SC({showDetail:{type:Boolean,default:!1},selectedDay:{type:Object},events:{type:Array,default:[]},legends:{type:Array,default:[]},multiple:{type:Boolean},selectedData:{type:Object}}),VC={pick:e=>qo(e),eventClick:e=>e,eventDblClick:e=>e,eventContextmenu:e=>e},FC=SC({selectedDay:{type:Object,default:()=>new Date},events:{type:Array,default:[]}}),UC=a({name:"CalendarDaily",props:RC,emits:_C,setup(e,{emit:t,slots:a}){const s=B("calendar-daily"),{drawData:l,curTimeTop:u,curTimeVal:p,resizableHand:v,events:g,curTimeTimer:b,calendarDaily:f,selectedData:w,handleEventClick:y,handleEventDblClick:C,handleDrag:I,handleDragStart:x,handleCurTime:S,initDrawData:E,eventContextmenu:D,contentMousemove:P,eventMouseenter:k,eventMouseleave:z}=((e,t,a)=>{const n=o([]),i=o(),s=o(0),l=o("00:00"),c=o(),d=o(),u=r(()=>e.legends||[]),h=r(()=>!0===e.multiple),p=o([]);let v=0,g=0;const b=r(()=>f(e.events,null==e?void 0:e.selectedDay,u.value,d.value)),f=(e,t,a,n)=>{const i=[],o=new Map;let s=0;n&&(s=parseInt(window.getComputedStyle(n).width,10)),e.sort((e,t)=>{const a=new Date(e.beginTime).getTime()-new Date(t.beginTime).getTime();let n;return n=0===a?new Date(e.endTime).getTime()-new Date(t.endTime).getTime():a,n});const l=[];return e.forEach(e=>{const n=a.find(t=>Object.is(t.id,e.itemType));if(n&&n.isShow&&e&&e.beginTime&&fC(e.beginTime,e.endTime,t)){const t={...e,targetLegend:n};p.value.find(t=>t.id===e.id)?Object.assign(t,{isSelectedEvent:!0}):Object.assign(t,{isSelectedEvent:!1}),!e.endTime&&e.beginTime&&Object.assign(t,{endTime:e.beginTime}),l.push(t)}}),l.forEach((e,a)=>{const{targetLegend:n}=e,r={};Object.assign(r,e),Object.assign(r,{zIndex:a+1});const c=l.length,d=(s-90)/c,u=Number((100/c).toFixed(3));let h="".concat(u,"%"),p="".concat(a*u,"%");d<100&&(h="100px",p="".concat(100*a,"px")),Object.assign(r,{width:h,styleLeft:p});let m="auto",v=60;const g=pC(e.beginTime,e.endTime,"YYYY-MM-DD HH:mm:ss");if(bC(e.beginTime,e.endTime))m=w(e.beginTime,e.endTime),v=y(new Date(e.beginTime)).styleTop;else if(bC(e.beginTime,t)&&!bC(e.endTime,t)){const a=new Date(t);a.setHours(23,59,59,0),m=w(e.beginTime,a),v=y(new Date(e.beginTime)).styleTop}else if(bC(e.endTime,t)&&!bC(e.beginTime,t)){const a=new Date(t);a.setHours(0,0,0,0),m=w(a,e.endTime),v=y(new Date(a)).styleTop}else{const e=new Date(t),a=new Date(e.setHours(0,0,0,0)),n=new Date(e.setHours(23,59,59,59));m=w(a,n),v=y(new Date(a)).styleTop}if(Object.assign(r,{height:m,styleTop:v,timeRange:g}),!(null==e?void 0:e.bkColor)){const t=n&&n.bkcolor||mC(o,e.itemType);Object.assign(r,{bkColor:t})}if(r.bkColor){const e=gC(r.bkColor,10);Object.assign(r,{bkColorFade:e})}if(!(null==e?void 0:e.color)){const e=n&&n.color;Object.assign(r,{color:e})}if((null==r?void 0:r.height)&&(null==r?void 0:r.height)>10){const e="1px solid #FFF";Object.assign(r,{border:e})}else Object.assign(r,{border:"none"});i.push(r)}),o.clear(),i},w=(e,t)=>{let a=1;if(bC(e,t)){const n=new Date(t).getTime()-new Date(e).getTime();a=Math.floor(n/6e4)}return a<30&&(a="auto"),a},y=e=>{const t=e.getHours(),a=e.getMinutes(),n=String(t).padStart(2,"0"),i=String(a).padStart(2,"0");let o,s;return 0===t&&0===a?(o=0,s="00:00"):(o=60*t+a,s="".concat(n,":").concat(i)),{styleTop:o,timeVal:s}},C=PC();let I=null,x="";return m(()=>{kC(C)}),{drawData:n,curTimeTimer:i,curTimeTop:s,curTimeVal:l,events:b,resizableHand:c,calendarDaily:d,selectedData:p,handleCurTime:()=>{const{styleTop:e,timeVal:t}=y(new Date);s.value=e,l.value=t},handleDrag:e=>{const t=e.clientY-v+g;t<320&&(c.value.style.height="".concat(t,"px"))},handleDragStart:e=>{v=e.clientY,g=parseInt(window.getComputedStyle(c.value).height,10)},handleEventClick:(a,n)=>{const i=IC("eventClick",a,n,e.events,h.value,p.value,t),{tempSelectedData:o,isSelectedEvent:s}=i;s||Object.assign(a,{isSelectedEvent:s}),p.value=o},handleEventDblClick:(a,n)=>{const i=IC("eventDblClick",a,n,e.events,h.value,p.value,t),{tempSelectedData:o,isSelectedEvent:s}=i;s||Object.assign(a,{isSelectedEvent:s}),p.value=o},eventContextmenu:async(e,a)=>{t("eventContextmenu",{evt:a,data:[e]})},initDrawData:()=>{const e=[];for(let t=1;t<24;t++){const a=String(t).padStart(2,"0"),n="".concat(a,":00");e.push(n)}return e},contentMousemove:e=>{"content"===x&&I&&C&&DC(e,C)},eventMouseenter:(t,n,i)=>{if(!e.showDetail||I)return;const o="content"===i;x=i,I=EC(n,o?C:t.target,{placement:o?"right-start":"bottom",modalClass:a.e("event-popover")})},eventMouseleave:e=>{null==I||I.dismiss(),I=null,x=""}}})(e,t,s);c(()=>e.selectedData,()=>{if(e.selectedData&&e.selectedData.length>0){const t=e.selectedData.length>w.value.length?e.selectedData:w.value;w.value=t}else w.value=[]},{immediate:!0,deep:!0}),d(()=>{S(),l.value=E(),b.value=setInterval(()=>S(),1e3)}),h(()=>{const e=b.value;e&&(clearInterval(e),b.value=null)});const T=(t,i,o,l,r,c,d)=>{var u;let h="".concat(l.text||"");"header"===t&&l.timeRange&&(h="".concat(h," ").concat(l.timeRange||"")),h=Tt(h)||"",e.showDetail&&(h="");const p=(e=>{var t;const i={...e,color:"",bkColor:""};return n("div",{class:[s.em("event-popover","body")]},[n("div",{class:[s.em("event-popover","scroll")]},[(null==a?void 0:a.event)?null==(t=a.event)?void 0:t.call(a,{data:i}):n("div",{class:[s.em("event-popover","content")]},["".concat(e.text||""," ").concat(e.timeRange||"")])])])})(l);return n("div",{key:r,class:[s.em(d,"event-box")],style:i},[n("button",{class:[s.em(d,"event-content"),l.isSelectedEvent?"is-selected-event":"",l.classname],onClick:()=>{y(l,"head")},onDblclick:()=>{C(l,"head")},onContextmenu:e=>D(l,e),onMouseenter:e=>k(e,p,t),onMouseleave:z,style:o,title:h},[a[c]?null==(u=a[c])?void 0:u.call(a,{data:l}):n("div",{class:[s.em(d,"event-summary"),l.classname]},[l.icon&&n("span",{class:[l.icon,s.em(d,"event-icon")],style:{color:l.bkColor}},null),l.text&&n("span",{class:[s.em(d,"event-name")]},[l.text])]),"header"===t&&l.isSelectedEvent?n("span",{class:["fa fa-check",s.em(d,"check")]},null):""])])};return{ns:s,calendarDaily:f,renderHeader:()=>n("div",{class:[s.e("calendar-daily__head")],ref:e=>{v.value=e}},[n("div",{class:s.e("allday-info")},[ibiz.i18n.t("control.calendar.calendardaily.tip")]),n("div",{class:s.em("allday-info","work-items")},[n("div",{class:s.em("allday-info","work-items-scroll")},[n("div",{class:s.em("allday-info","work-items-body")},[g.value.length>0?g.value.map((e,t)=>{const a={background:e.bkColorFade};return T("header",{},a,e,t,"head-event","allday-info")}):n(i("iBizNoData"),{hideNoDataImage:!0},null)])])]),n("div",{class:s.e("resizable-handle"),draggable:"true",onDrag:e=>I(e),onDragstart:e=>x(e)},[n("div",{class:s.e("allday-resize-line")},null)])]),renderContent:()=>n("div",{class:[s.e("scroll-area")],onMousemove:P},[n("div",{class:s.e("time-pane")},[n("div",{class:s.em("time-pane","time-labels")},[l.value.map(e=>n("div",{key:e,class:[s.em("time-pane","time-label")]},[e]))]),n("div",{class:s.em("time-pane","time-columns")},[l.value.map((e,t)=>n("div",{key:e,class:[s.em("time-pane","time-column"),t===l.value.length-1&&s.em("time-pane","time-column-last")]},null)),n("div",{class:s.em("time-pane","event-timed-container")},[n("div",{class:s.em("time-pane","container-scroll")},[g.value.map((e,t)=>{const a={top:"".concat(e.styleTop,"px"),left:"".concat(e.styleLeft),height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"".concat(e.width),"z-index":e.zIndex};"number"==typeof e.height&&Object.assign(a,{"min-height":"".concat(e.height,"px")});const n={background:e.bkColorFade,"border-left":"3px solid ".concat(e.bkColor)};return T("content",a,n,e,t,"","time-pane")})])])]),bC(null==e?void 0:e.selectedDay,new Date)?n("div",{class:s.em("time-pane","current-time"),style:{top:"".concat(u.value,"px")}},[n("div",{class:s.em("time-pane","current-time-label")},[p.value])]):""])])}},render(){return n("div",{ref:e=>{this.calendarDaily=e},class:this.ns.b()},[this.renderHeader(),this.renderContent()])}}),HC=ie(UC,function(e){e.component(UC.name,UC)}),qC=(e,t,a)=>{const n=o([]),i=o(),s=o(1),l=o("00:00"),d=o(),u=o(),h=o(),p=r(()=>!0===e.multiple),v=o([]),b=o([]),f=o([]),w=o([]),y=o(!0);let C=0,I=0;const x=(e,t)=>{const a=new Date(e),n=new Date(t),i=[];a.setHours(0,0,0,0),n.setHours(0,0,0,0);for(let e=new Date(a);e<=n;e.setDate(e.getDate()+1))i.push(new Date(e));return i},S=(e,t,a,n,i)=>{const o={},{targetLegend:s}=e;Object.assign(o,e),Object.assign(o,{zIndex:i+1});const l=Number((100/n).toFixed(3)),r="".concat(l,"%"),c="".concat(i*l,"%");Object.assign(o,{width:r,styleLeft:c});let d="auto",u=60;const h=pC(e.beginTime,e.endTime,"YYYY-MM-DD HH:mm:ss");if(bC(e.beginTime,e.endTime)){d=D(e.beginTime,e.endTime);u=z(new Date(e.beginTime)).styleTop}else if(bC(e.beginTime,t.date)&&!bC(e.endTime,t.date)){const a=new Date(t.date);a.setHours(23,59,59,0),d=D(e.beginTime,a);u=z(new Date(e.beginTime)).styleTop}else if(bC(e.endTime,t.date)&&!bC(e.beginTime,t.date)){const a=new Date(t.date);a.setHours(0,0,0,0),d=D(a,e.endTime);u=z(new Date(a)).styleTop}else{const e=new Date(t.date),a=new Date(e.setHours(0,0,0,0)),n=new Date(e.setHours(23,59,59,59));d=D(a,n);u=z(new Date(a)).styleTop}if(Object.assign(o,{height:d,styleTop:u,timeRange:h}),!(null==e?void 0:e.bkColor)){const t=s&&s.bkcolor||mC(a,e.itemType);Object.assign(o,{bkColor:t})}if(o.bkColor){const e=gC(o.bkColor,10);Object.assign(o,{bkColorFade:e})}if(!(null==e?void 0:e.color)){const e=s&&s.color;Object.assign(o,{color:e})}if((null==o?void 0:o.height)&&(null==o?void 0:o.height)>10){const e="1px solid #FFF";Object.assign(o,{border:e})}else Object.assign(o,{border:"none"});return o},E=()=>{const t=e.events,a=null==e?void 0:e.selectedDay,n=new Map,{firstDay:i,lastDay:o}=(e=>{const t=new Date(e),a=t.getDay(),n=new Date(t);n.setDate(t.getDate()-a);const i=new Date(n);return i.setDate(n.getDate()+6),n.setHours(0,0,0,0),i.setHours(23,59,59,0),{firstDay:n,lastDay:i}})(a),s=[],l=[],r=[],c=[];w.value=[];for(let e=0;e<7;e++){const t=e,n=i.getDate()+t,o=new Date(i.getFullYear(),i.getMonth(),n),d=o.getDate(),u={date:o,day:d,caption:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map(e=>ibiz.i18n.t("control.calendar.calendarweek.weeks.".concat(e)))[e],isActivate:bC(o,a)};w.value.push(u),s.push([]),l.push([]),r.push([]),c.push([])}t.forEach(e=>{const t=h.value.find(t=>Object.is(t.id,e.itemType));if(t&&t.isShow&&e.beginTime){const a={targetLegend:t};Object.assign(a,e);if(v.value.find(t=>t.id===e.id)?Object.assign(a,{isSelectedEvent:!0}):Object.assign(a,{isSelectedEvent:!1}),!e.endTime&&e.beginTime&&Object.assign(a,{endTime:e.beginTime}),yC(a.beginTime,i,o)&&yC(a.endTime,i,o)||yC(a.beginTime,i,o)&&!yC(a.endTime,i,o)||yC(a.endTime,i,o)&&!yC(a.beginTime,i,o)||!yC(e.endTime,i,o)&&!yC(e.beginTime,i,o)&&CC(i,e.beginTime)&&CC(e.endTime,i)){x(i,o).forEach(e=>{const t=new Date(e).getDay();l[t].push({...a})})}if(yC(a.beginTime,i,o)&&yC(a.endTime,i,o)){x(a.beginTime,a.endTime).forEach(e=>{const t=new Date(e).getDay();s[t].push(a)})}else if(yC(a.beginTime,i,o)&&!yC(a.endTime,i,o)){x(a.beginTime,o).forEach(e=>{const t=new Date(e).getDay();s[t].push(a)})}else if(yC(a.endTime,i,o)&&!yC(a.beginTime,i,o)){x(i,a.endTime).forEach(e=>{const t=new Date(e).getDay();s[t].push(a)})}else if(!yC(e.endTime,i,o)&&!yC(e.beginTime,i,o)&&CC(i,e.beginTime)&&CC(e.endTime,i)){x(i,o).forEach(e=>{const t=new Date(e).getDay();s[t].push(a)})}}}),s.forEach(e=>{e.sort((e,t)=>{const a=e,n=t,i=new Date(a.beginTime).getTime()-new Date(n.beginTime).getTime();let o;return o=0===i?new Date(a.endTime).getTime()-new Date(n.endTime).getTime():i,o})}),l.forEach(e=>{e.sort((e,t)=>{const a=e,n=t,i=new Date(a.beginTime).getTime()-new Date(n.beginTime).getTime();let o;return o=0===i?new Date(a.endTime).getTime()-new Date(n.endTime).getTime():i,o})}),s.forEach((e,t)=>{e.forEach((e,a)=>{if(e.targetLegend){const i=s[t].length,o=w.value[t];r[t].push(S(e,o,n,i,a))}})}),l.forEach((e,t)=>{e.forEach((e,a)=>{if(e.targetLegend){const l=s[t].length,r=w.value[t],d=S(e,r,n,l,a);c[t].push(((e,t,a,n,i,o,s)=>{const l={};Object.assign(l,e),Object.assign(l,{width:0,styleLeft:0});let r=0,c=0;if(yC(e.beginTime,a,n)&&yC(e.endTime,a,n)){const t=P(e.beginTime,e.endTime,a,n),i=k(e.beginTime,a,n);r="".concat(t,"%"),c="".concat(i,"%")}else if(yC(e.beginTime,a,n)&&!yC(e.endTime,a,n)){const t=P(e.beginTime,n,a,n),i=k(e.beginTime,a,n);r="".concat(t,"%"),c="".concat(i,"%")}else if(yC(e.endTime,a,n)&&!yC(e.beginTime,a,n)){const t=P(a,e.endTime,a,n);r="".concat(t,"%"),c="".concat(0,"%")}else if(!yC(e.endTime,a,n)&&!yC(e.beginTime,a,n)&&CC(a,e.beginTime)&&CC(e.endTime,a)){const e=P(a,n,a,n);r="".concat(e,"%"),c="".concat(0,"%")}Object.assign(l,{width:r,styleLeft:c});let d=!1;(yC(e.beginTime,a,n)&&bC(e.beginTime,t.date)||0===s)&&(d=!0);const u=new Date(t.date);return fC(e.beginTime,e.endTime,u)||(d=!1),Object.assign(l,{isShow:d}),l})(d,r,i,o,0,0,t))}})}),n.clear(),b.value=r,f.value=c},D=(e,t)=>{let a=1;if(bC(e,t)){const n=new Date(t).getTime()-new Date(e).getTime();a=Math.floor(n/6e4)}return a<30&&(a="auto"),a},P=(e,t,a,n)=>{let i="0";if(yC(e,a,n)&&yC(t,a,n)){const a=Number((100/24).toFixed(3));i=((new Date(t).getTime()-new Date(e).getTime())/36e5*a).toFixed(3)}return i},k=(e,t,a)=>{let n="0";if(yC(e,t,a)){n=((new Date(e).getHours()+new Date(e).getMinutes()/60)*Number((100/24).toFixed(3))).toFixed(3)}return n},z=e=>{const t=e.getHours(),a=e.getMinutes(),n=String(t).padStart(2,"0"),i=String(a).padStart(2,"0");let o,s;if(0===t&&0===a)o=1,s="00:00";else{o=60*t+a,s="".concat(n,":").concat(i)}return{styleTop:o,timeVal:s}},T=o(),A=o(0),O=o(0),M=o(!1),N=o(0),B=o(1),L=o(1),R=o(!1),_=e=>{if(M.value){const t=e.clientY-N.value;A.value+=t,N.value=e.clientY,T.value&&(T.value.scrollTop=B.value*(A.value/L.value))}e.preventDefault(),e.stopPropagation()},j=e=>{M.value=!1,e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",j)},V=()=>{B.value=0,L.value=0,R.value=!1,O.value=0,g(()=>{T.value&&(B.value=T.value.scrollHeight,L.value=T.value.clientHeight,B.value>L.value&&(R.value=!0),O.value=L.value*(L.value/B.value))})};c(()=>T.value,()=>{V()},{immediate:!0,deep:!0});const F=PC();let U=null,H="";return m(()=>{kC(F)}),{drawData:n,curTimeTimer:i,curTimeTop:s,curTimeVal:l,rows:b,resizableHand:d,calendarWeek:u,selectedData:v,weekDays:w,legends:h,rowsHeader:f,popVisible:y,headerEventRef:T,thumbHeight:O,realHeight:B,scrollTop:A,isScroll:R,handleCurTime:()=>{const{styleTop:e,timeVal:t}=z(new Date);s.value=e,l.value=t},handleDrag:e=>{const t=e.clientY-C+I;t<320&&(d.value.style.height="".concat(t,"px"))},handleDragStart:e=>{C=e.clientY,I=parseInt(window.getComputedStyle(d.value).height,10)},handleDragEnd:()=>{V()},handleEventClick:(a,n)=>{y.value=!1;const i=IC("eventClick",a,n,e.events,p.value,v.value,t),{tempSelectedData:o,isSelectedEvent:s}=i;s||Object.assign(a,{isSelectedEvent:s}),v.value=o,E()},handleEventDblClick:(a,n)=>{y.value=!1;const i=IC("eventDblClick",a,n,e.events,p.value,v.value,t),{tempSelectedData:o,isSelectedEvent:s}=i;s||Object.assign(a,{isSelectedEvent:s}),v.value=o,E()},initDrawData:()=>{const e=[];for(let t=1;t<24;t++){const a=String(t).padStart(2,"0"),n="".concat(a,":00");e.push(n)}return e},handleUIEvents:E,onScrollbarMouseDown:e=>{N.value=e.clientY,M.value=!0,e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",_),document.addEventListener("mouseup",j)},onHeaderEventScroll:e=>{var t,a,n;const i=(null==(t=e.target)?void 0:t.scrollTop)||0;B.value=null==(a=e.target)?void 0:a.scrollHeight,L.value=null==(n=e.target)?void 0:n.clientHeight;const o=i/B.value;A.value=o*L.value,O.value=L.value*(L.value/B.value)},initHeaderEventScroll:V,eventContextmenu:async(e,a)=>{t("eventContextmenu",{evt:a,data:[e]})},contentMousemove:e=>{"content"===H&&U&&F&&DC(e,F)},eventMouseenter:(t,n,i)=>{if(!e.showDetail||U)return;const o="content"===i;H=i,U=EC(n,o?F:t.target,{placement:o?"right-start":"bottom",modalClass:a.e("event-popover")})},eventMouseleave:e=>{null==U||U.dismiss(),U=null,H=""}}},GC=a({name:"CalendarWeek",props:jC,emits:VC,setup(e,{emit:t,slots:a}){const i=B("calendar-week"),{drawData:o,resizableHand:s,rows:l,weekDays:r,curTimeTimer:u,calendarWeek:p,selectedData:m,legends:v,rowsHeader:g,headerEventRef:b,thumbHeight:f,scrollTop:w,realHeight:y,isScroll:C,handleEventClick:I,handleEventDblClick:x,handleDrag:S,handleDragStart:E,handleDragEnd:D,handleCurTime:P,initDrawData:k,handleUIEvents:z,onScrollbarMouseDown:T,onHeaderEventScroll:A,initHeaderEventScroll:O,eventContextmenu:M,contentMousemove:N,eventMouseenter:L,eventMouseleave:R}=qC(e,t,i);c(()=>e.selectedData,()=>{if(e.selectedData&&e.selectedData.length>0){const t=e.selectedData.length>m.value.length?e.selectedData:m.value;m.value=t}else m.value=[]},{immediate:!0,deep:!0}),c(()=>e.legends,()=>{v.value=e.legends||[],z()},{immediate:!0,deep:!0}),c(()=>e.events,()=>{z(),O()},{immediate:!0,deep:!0}),d(()=>{P(),o.value=k(),u.value=setInterval(()=>P(),1e3)}),h(()=>{const e=u.value;e&&(clearInterval(e),u.value=null)});const _=(t,o,s,l,r,c,d)=>{var u;let h="".concat(l.text||"");"header"===t&&l.timeRange&&(h="".concat(h," ").concat(l.timeRange||"")),h=Tt(h)||"",e.showDetail&&(h="");const p=(e=>{var t;const o={...e,color:"",bkColor:""};return n("div",{class:[i.em("event-popover","body")]},[n("div",{class:[i.em("event-popover","scroll")]},[(null==a?void 0:a.event)?null==(t=a.event)?void 0:t.call(a,{data:o}):n("div",{class:[i.em("event-popover","content")]},["".concat(e.text||""," ").concat(e.timeRange||"")])])])})(l);return n("div",{key:r,class:[i.em(d,"event-box")],style:o},[n("button",{class:[i.em(d,"event-content"),i.is("selected-event",!!l.isSelectedEvent),l.classname],onClick:()=>{I(l,"head")},onDblclick:()=>{x(l,"head")},onContextmenu:e=>M(l,e),onMouseenter:e=>L(e,p,t),onMouseleave:R,style:s,title:h},[a[c]?null==(u=a[c])?void 0:u.call(a,{data:l}):n("div",{class:[i.em(d,"event-summary"),l.classname]},[l.icon&&n("span",{class:[l.icon,i.em(d,"event-icon")],style:{color:l.bkColor}},null),l.text&&n("span",{class:[i.em(d,"event-name")]},[l.text])]),"header"===t&&l.isSelectedEvent?n("span",{class:["fa fa-check",i.em(d,"check")]},null):""])])};return{ns:i,thumbHeight:f,calendarWeek:p,scrollTop:w,realHeight:y,headerEventRef:b,renderHeader:()=>n("div",{class:[i.e("header")],ref:e=>{s.value=e}},[n("div",{class:[i.em("header","dates")]},[n("div",{class:[i.em("header","date-cell-first")]},null),r.value.map(e=>n("div",{class:[i.em("header","date-cell")]},[n("div",{class:[i.em("header","date-week")]},[e.caption]),n("div",{class:[i.em("header","date-day"),e.isActivate?"is-today":""]},[e.day])]))]),n("div",{class:[i.em("header","events")]},[n("div",{class:[i.em("header","event-cell-first")]},[ibiz.i18n.t("control.calendar.calendardaily.tip")]),n("div",{class:i.em("header","event-container"),ref:e=>{b.value=e},onScroll:A},[n("div",{class:i.em("header","container-scroll")},[g.value.map(e=>n("div",{class:[i.em("header","event-cell")]},[e.map((e,t)=>{const a={top:"".concat(Number(26*t)+2,"px"),left:"".concat(e.styleLeft),width:"".concat(null==e?void 0:e.width)},n={background:e.bkColorFade};return e.isShow?_("header",a,n,e,t,"head-event","header"):""})]))]),C.value&&n("div",{class:i.b("scroll-bar")},[n("div",{class:i.be("scroll-bar","thumb"),onMousedown:T},null)])])]),n("div",{class:i.em("header","resizable-handle"),draggable:"true",onDrag:e=>S(e),onDragstart:e=>E(e),onDragend:()=>D()},[n("div",{class:i.em("header","resize-line")},null)])]),renderContent:()=>n("div",{class:[i.e("scroll-area")],onMousemove:N},[n("div",{class:i.e("time-pane")},[n("div",{class:i.em("time-pane","time-labels")},[o.value.map(e=>n("div",{key:e,class:[i.em("time-pane","time-label")]},[e]))]),l.value.map(e=>n("div",{class:i.em("time-pane","time-columns")},[o.value.map((e,t)=>n("div",{key:e,class:[i.em("time-pane","time-column"),t===o.value.length-1&&i.em("time-pane","time-column-last")]},null)),n("div",{class:i.em("time-pane","event-timed-container")},[n("div",{class:i.em("time-pane","container-scroll")},[e.map((e,t)=>{const a={top:"".concat(e.styleTop,"px"),left:"".concat(e.styleLeft),height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"".concat(e.width),"min-height":"".concat(e.height&&e.height>30?e.height:30,"px"),"z-index":e.zIndex};"number"==typeof e.height&&Object.assign(a,{"min-height":"".concat(e.height,"px")});const n={background:e.bkColorFade,"border-left":"3px solid ".concat(e.bkColor)};return _("content",a,n,e,t,"","time-pane")})])])]))])])}},render(){return n("div",{ref:e=>{this.calendarWeek=e},class:this.ns.b(),style:{["".concat(this.ns.cssVarBlockName("header-event-scroll-bar-thumb-height"))]:"".concat(this.thumbHeight,"px"),["".concat(this.ns.cssVarBlockName("header-event-scroll-bar-thumb-top"))]:"".concat(this.scrollTop,"px"),["".concat(this.ns.cssVarBlockName("header-event-scroll-real-height"))]:"".concat(this.realHeight,"px")}},[this.renderHeader(),this.renderContent()])}}),WC=ie(GC,function(e){e.component(GC.name,GC)});const YC=a({name:"CalendarUser",props:FC,emits:{eventClick:e=>e,eventDblClick:e=>e},setup(e,{emit:t,slots:a}){const s=B("calendar-user"),l=o([]),r=o([]);r.value=function(){const e=[];for(let t=0;t<24;t++)e.push({time:t,text:"".concat(t,":00")});return e}();const d=o(""),u=o(),h=o(),m=o(0),v=o(0),g=o(!1),b=o(0),f=o(1),w=o(1),y=o(!1);c(()=>e.selectedDay,()=>{e.selectedDay&&(l.value=function(e){const t=[],a=e.getDay();let n;if(0===a){const t=e.getTime()-5184e5;n=new Date(t)}else{const t=e.getTime()-24*(a-1)*60*60*1e3;n=new Date(t)}const i=[ibiz.i18n.t("control.calendar.calendarUser.weeks.monday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.tuesday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.wednesday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.thursday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.friday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.saturday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.sunday")];for(let e=0;e<7;e++){const a=24*e*60*60*1e3;t.push({text:i[e],date:as(new Date(n.getTime()+a)).format("MM/DD")})}return t}(new Date(e.selectedDay)))},{immediate:!0,deep:!0});const C=()=>{t("eventClick",{data:[]})},I=(t,o)=>{const l=function(e,t,a){const n=e.filter(e=>as(new Date(e.beginTime)).format("MM/DD")===t.date)||[];return a?n.filter(e=>new Date(e.beginTime).getHours()===a.time):n}(e.events,t,o);return 0===(r=l).length?n("div",{class:s.e("black"),onClick:C},null):r.length>1?[null==(c=a.event)?void 0:c.call(a,{data:r[0]}),n(i("el-popover"),{"popper-class":s.e("custom-user-popover"),trigger:"click",ref:e=>{e&&r[0].id===d.value&&(u.value=e)},onShow:()=>{d.value=r[0].id}},{reference:()=>n("span",{class:s.b("more")},["+".concat(r.length-1," ").concat(ibiz.i18n.t("app.more"),"...")]),default:()=>r.map(e=>{var t;return null==(t=a.event)?void 0:t.call(a,{data:e})})})]:r.map(e=>{var t;return null==(t=a.event)?void 0:t.call(a,{data:e})});var r,c},x=e=>{if(g.value){const t=e.clientY-b.value;m.value+=t,b.value=e.clientY,h.value&&(h.value.scrollTop=f.value*(m.value/w.value))}e.preventDefault(),e.stopPropagation()},S=e=>{g.value=!1,e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S)},E=e=>{b.value=e.clientY,g.value=!0,e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",x),document.addEventListener("mouseup",S)},D=e=>{var t,a,n;const i=(null==(t=e.target)?void 0:t.scrollTop)||0;f.value=null==(a=e.target)?void 0:a.scrollHeight,w.value=null==(n=e.target)?void 0:n.clientHeight;const o=i/f.value;m.value=o*w.value};return c(()=>h.value,()=>{h.value&&(f.value=h.value.scrollHeight,w.value=h.value.clientHeight,f.value>w.value&&(y.value=!0),v.value=w.value*(w.value/f.value))},{immediate:!0,deep:!0}),{ns:s,renderWeekHeader:()=>n("div",{class:s.b("header")},[n("div",{class:s.be("header","time-item")},[n("div",{class:[s.e("cell"),s.be("header","time-text"),s.be("header","top")]},null),l.value.map(e=>n("div",{class:[s.be("header","week-day"),s.e("cell"),s.be("header","top")]},[e.text,e.date]))]),n("div",{class:s.be("header","time-item")},[n("div",{class:[s.e("cell"),s.be("header","time-text")]},[p("全天")]),l.value.map(e=>n("div",{class:[s.be("header","week-item"),s.e("cell")]},[I(e)]))])]),renderWeekContent:()=>n("div",{class:s.b("content"),style:{["--".concat(s.namespace,"-calendar-user-scroll-bar-thumb-height")]:"".concat(v.value,"px"),["--".concat(s.namespace,"-calendar-user-scroll-bar-thumb-top")]:"".concat(m.value,"px")}},[n("div",{class:s.be("content","wrapping"),ref:e=>{h.value=e},onScroll:D},[r.value.map(e=>n("div",{class:s.be("content","time-item")},[n("div",{class:[s.be("content","time-text"),s.e("cell")]},[e.text]),l.value.map(t=>n("div",{class:[s.be("content","week-item"),s.e("cell")]},[I(t,e)]))]))]),y.value&&n("div",{class:s.b("scroll-bar")},[n("div",{class:s.be("scroll-bar","thumb"),onMousedown:E},null)])])}},render(){return n("div",{class:this.ns.b()},[this.renderWeekHeader(),this.renderWeekContent()])}}),KC=ie(YC,function(e){e.component(YC.name,YC)});const XC=a({name:"CustomCalendar",props:BC,emits:LC,setup(e,{emit:t,slots:a}){const s=B("custom-calendar"),{date:l,events:d,shortcuts:u,viewType:h,validatedRange:p,realSelectedDay:m,curWeek:v,legends:g,multiple:b,selectedData:f,pickDay:w,handleEVentClick:y,handleEVentDblClick:C,handleEventContextmenu:I,selectDate:x,selectLegend:S}=((e,t)=>{const{lang:a}=Eo(),n=o(),i=as().locale(a.value),s=o(),l=r(()=>e.viewType),d=o([]),u=new Map,h=r(()=>!0===e.multiple),p=r(()=>e.selectedData);c(()=>e.legends,t=>{const a=[];t&&e.legends.forEach(e=>{const t={};if(Object.assign(t,e),Object.assign(t,{isShow:!0}),e&&!e.bkcolor){const a=mC(u,e.id);Object.assign(t,{bkcolor:a})}a.push(t)}),d.value=a},{immediate:!0,deep:!0});const m=(e,t)=>{const a=e.startOf("week"),n=t.endOf("week"),i=a.get("month"),o=n.get("month");let s;return s=i===o?[[a,n]]:(i+1)%12===o?((e,t)=>{const a=e.endOf("month"),n=t.startOf("month"),i=a.isSame(n,"week");return[[e,a],[(i?n.add(1,"week"):n).startOf("week"),t]]})(a,n):i+2===o||(i+1)%11===o?((e,t)=>{const a=e.endOf("month"),n=e.add(1,"month").startOf("month"),i=a.isSame(n,"week")?n.add(1,"week"):n,o=i.endOf("month"),s=t.startOf("month"),l=o.isSame(s,"week")?s.add(1,"week"):s;return[[e,a],[i.startOf("week"),o],[l.startOf("week"),t]]})(a,n):[],s},v=r(()=>{if(!e.range)return[];let t=[];const n=e.range.map(e=>as(e).locale(a.value)),[i,o]=n;return i.isAfter(o)&&(t=[]),i.isSame(o,"month")||i.add(1,"month").month()!==o.month()&&(t=[]),t=m(i,o),t}),g=r(()=>{let t;return t=e.modelValue?as(e.modelValue).locale(a.value):s.value||(v.value.length?v.value[0][0]:i),t}),b=r({get(){let t=g.value;return e.modelValue||(t=n.value),s.value=t,t},set(e){if(!e)return;const a=as(e);n.value=a;const i=a.toDate();t(AC,i),t(TC,i),t(zC,i)}}),f=r(()=>{if(e.events.length>0)return e.events.map(e=>{const t={};return Object.assign(t,e),Object.assign(t,{deData:e.deData,beginTime:e.beginTime,endTime:e.endTime,id:e.id,classname:e.classname,text:e.text,content:e.content,tips:e.tips,icon:e.icon,color:e.color,bkColor:e.bkColor,itemType:e.itemType}),t})}),w=r(()=>g.value.subtract(1,"month").date(1)),y=r(()=>g.value.add(1,"month").date(1)),C=r(()=>g.value.subtract(1,"year").date(1)),I=r(()=>g.value.add(1,"year").date(1)),x=e=>{b.value=e},S=r(()=>{const e="".concat(g.value.format("M"));return"".concat(g.value.year()," ").concat(ibiz.i18n.t("control.calendar.year")," ").concat(e," ").concat(ibiz.i18n.t("control.calendar.month"))}),E=[{text:ibiz.i18n.t("control.calendar.today"),value:new Date},{text:ibiz.i18n.t("control.calendar.calendardaily.tomorrow"),value:()=>{const e=new Date;return e.setTime(e.getTime()+864e5),e}},{text:ibiz.i18n.t("control.calendar.calendardaily.nextweek"),value:()=>{const e=new Date;return e.setTime(e.getTime()+6048e5),e}}],D=r(()=>{let e="";if(b.value){const t=b.value.day();e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map(e=>ibiz.i18n.t("control.calendar.calendardaily.weeks.".concat(e)))[t]}return e});return{date:g,viewType:l,i18nDate:S,events:f,shortcuts:E,validatedRange:v,realSelectedDay:b,curWeek:D,legends:d,multiple:h,selectedData:p,calculateValidatedDateRange:m,pickDay:x,selectDate:e=>{const t={"prev-month":w.value,"next-month":y.value,"prev-year":C.value,"next-year":I.value,today:i}[e];t.isSame(g.value,"day")||x(t)},handleEVentClick:e=>{t("eventClick",e)},handleEVentDblClick:e=>{t("eventDblClick",e)},handleEventContextmenu:e=>{t("eventContextmenu",e)},selectLegend:e=>{const t=d.value.find(t=>e.id===t.id);t&&Object.assign(t,{isShow:!e.isShow})}}})(e,t),E=()=>{const e=function(e){let t,a;const n=e.getDay();return 0===n?(t=as(new Date(e.getTime()-5184e5)).format("YYYY-MM-DD"),a=as(e).format("YYYY-MM-DD")):(t=as(new Date(e.getTime()-864e5*(n-1))).format("YYYY-MM-DD"),a=as(new Date(e.getTime()+864e5*(7-n))).format("YYYY-MM-DD")),[t,a]}(new Date(m.value));return n("div",{class:[s.e("calendar-user")]},[n("div",{class:[s.e("calendar-user-header")]},[n("div",{class:s.em("calendar-user-header","left")},[e.map(e=>as(new Date(e)).format("YYYY-MM-DD")).join(" ~ ")]),n("div",{class:s.em("calendar-user-header","right")},[n(i("el-date-picker"),{type:"week",clearable:!1,"popper-class":s.em("calendar-user-header","date-picker"),modelValue:m.value,"onUpdate:modelValue":e=>m.value=e,class:s.em("calendar-user-header","date-range"),placeholder:ibiz.i18n.t("control.calendar.calendarUser.selectWeekRange"),format:ibiz.i18n.t("control.calendar.calendarUser.weekFormat")},null)])]),n(KC,{"selected-day":m.value,events:d.value,onEventClick:e=>y(e),onEventDblClick:e=>C(e)},a)])};return{ns:s,date:l,validatedRange:p,pickDay:w,selectDate:x,renderContent:()=>{switch(h.value){case"DAY":return n("div",{class:[s.e("calendar-week")]},[(null==a?void 0:a.header)?n("div",{class:[s.em("calendar-month","header")]},[null==(t=null==a?void 0:a.header)?void 0:t.call(a,{date:as(m.value).format("YYYY-MM-DD"),legends:g.value})]):n("div",{class:[s.em("calendar-week","header")]},[n("div",{class:s.em("calendar-week","header-top")},[n("div",{class:s.em("calendar-week","title")},[e.calendarTitle||ibiz.i18n.t("control.calendar.title")]),n("div",{class:s.em("calendar-week","legend")},[g.value.length>1&&g.value.map(e=>n("div",{class:s.em("calendar-week","legend-item"),onClick:()=>S(e)},[n("div",{class:s.em("calendar-week","legend-item-tip"),style:{background:e.isShow?e.bkcolor:"var(".concat(s.cssVarName("color-disabled-bg"),")")}},null),n("div",{class:s.em("calendar-week","legend-item-text"),title:Tt(e.name)},[e.name])]))]),n("div",{class:s.em("calendar-week","select-time")},[n(i("el-date-picker"),{modelValue:m.value,"onUpdate:modelValue":e=>m.value=e,type:"date",placeholder:ibiz.i18n.t("control.calendar.calendardaily.selectdate"),shortcuts:u},null)])]),n("div",{class:s.em("calendar-week","text-secondary")},[v.value])]),n(HC,{"selected-day":m.value,controller:e.controller,showDetail:e.showDetail,events:d.value,legends:g.value,multiple:b.value,selectedData:f.value,onEventClick:e=>y(e),onEventDblClick:e=>C(e),onEventContextmenu:e=>I(e)},a)]);case"WEEK":return(()=>{var t;return n("div",{class:[s.e("calendar-week")]},[(null==a?void 0:a.header)?n("div",{class:[s.em("calendar-month","header")]},[null==(t=null==a?void 0:a.header)?void 0:t.call(a,{date:as(m.value).format("YYYY-MM-DD"),legends:g.value})]):n("div",{class:[s.em("calendar-week","header")]},[n("div",{class:s.em("calendar-week","header-top")},[n("div",{class:s.em("calendar-week","title")},[e.calendarTitle||ibiz.i18n.t("control.calendar.title")]),n("div",{class:s.em("calendar-week","legend")},[g.value.length>1&&g.value.map(e=>n("div",{class:s.em("calendar-week","legend-item"),onClick:()=>S(e)},[n("div",{class:s.em("calendar-week","legend-item-tip"),style:{background:e.isShow?e.bkcolor:"var(".concat(s.cssVarName("color-disabled-bg"),")")}},null),n("div",{class:s.em("calendar-week","legend-item-text"),title:Tt(e.name)},[e.name])]))]),n("div",{class:s.em("calendar-week","select-time")},[n(i("el-date-picker"),{modelValue:m.value,"onUpdate:modelValue":e=>m.value=e,type:"date",placeholder:"选择日期",shortcuts:u},null)])])]),n(WC,{"selected-day":m.value,showDetail:e.showDetail,events:d.value,legends:g.value,multiple:b.value,selectedData:f.value,onEventClick:e=>y(e),onEventDblClick:e=>C(e),onEventContextmenu:e=>I(e)},a)])})();case"USER":return E();default:return null}var t}}},render(){return n("div",{class:[this.ns.b()]},[this.renderContent()])}}),$C=ie(XC,function(e){e.component(XC.name,XC)}),JC=e=>{const{date:t,beginTime:a,endTime:n,unit:i="day"}=e;return!!(a&&as(t).isSame(a,i)||n&&as(t).isSame(n,i)||a&&n&&as(t).isAfter(a,i)&&as(t).isBefore(n,i))};function QC(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const ZC=a({name:"IBizCalendarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},isSimple:{type:Boolean,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new li(...e)),a=B("control-".concat(e.model.controlType.toLowerCase())),{UIStore:s}=G(),{getFontColor:l,getBkColor:d,getActBdrColors:u}=function(e){const t=e=>{const t=document.documentElement;return getComputedStyle(t).getPropertyValue(e)},a=[t("".concat(e.cssVarName("color-primary"))),"#2196F3","#4CAF50","#3F51B5","#FF9800","#673AB7","#757575"],n=a.map(()=>t("".concat(e.cssVarName("color-black"))));return{getFontColor:()=>t("".concat(e.cssVarName("color-primary-text"))),getBkColor:e=>a[e]||a[0],getActBdrColors:a=>n[a]||t("".concat(e.cssVarName("color-primary")))}}(a),h=o(),p=o(),m=o("daterange"===e.controlParams.showmode),v=o("expand"===e.controlParams.showmode),g=o(),b=r(()=>{if("TIMELINE"!==e.model.calendarStyle||e.state.isLoading)return!0;return!Object.values(e.loadMoreItems).some(e=>e.curPage<e.totalPage)}),f=o([]),w=["DAY","WEEK","MONTH"],y=()=>{f.value=e.state.legends.map((t,a)=>{const n={...t,isShow:!0};return e.model.calendarStyle&&w.includes(e.model.calendarStyle)?(t.bkcolor||Object.assign(n,{bkcolor:d(a),actBdrColor:u(a)}),t.color||Object.assign(n,{color:l()}),n):n})};c(()=>e.state.legends,()=>{y()},{deep:!0}),c(()=>s.theme,()=>{y()});const C=o("");e.evt.on("onActive",()=>{p.value&&(p.value.hide(),p.value=void 0)});const I=e=>{const t=e.getDay();let a;return a=0===t?e.getTime()-5184e5:e.getTime()-24*(t-1)*60*60*1e3,as(new Date(a)).format("YYYY-MM-DD")};c(()=>e.state.selectedDate,(t,a)=>{((t,a)=>{if("WEEK"===e.model.calendarStyle||"USER"===e.model.calendarStyle)return I(t)===I(a);if("DAY"===e.model.calendarStyle)return as(t).format("YYYY-MM-DD")===as(a).format("YYYY-MM-DD");if("MONTH"===e.model.calendarStyle)return as(a).format("YYYY-MM")===as(t).format("YYYY-MM");return"TIMELINE"===e.model.calendarStyle&&as(t).isSame(as(a),"millisecond")})(t,a)||e.load()});let x;const S=i("IBizRawItem"),E=i("IBizIcon");e.evt.on("onMounted",()=>{if(Object.values(e.contextMenus).length>0){(()=>t.import("@imengyu/vue3-context-menu"))().then(e=>{x=e.default,x.default&&!x.showContextMenu&&(x=x.default)})}});const D=(t,a,i,o)=>{const s=[];return t.forEach(t=>{var l,r;if("SEPERATOR"===t.itemType)return void s.push({divided:"self"});const c=o[t.id];if(c&&!c.visible)return;let d={};if(t.showCaption&&t.caption&&(d.label=t.caption),t.sysImage&&t.showIcon&&(d.icon=n(E,{icon:t.sysImage},null)),"DEUIACTION"===t.itemType){d.disabled=c.disabled,d.clickClose=!0;const{uiactionId:n}=t;n&&(d.onClick=()=>{e.doUIAction(n,a,i,t.appId)})}else if("RAWITEM"===t.itemType){const{rawItem:e}=t;e&&(d.label=n(S,{rawItem:t},null))}else if("ITEMS"===t.itemType){const c=t;if((null==(l=c.detoolbarItems)?void 0:l.length)&&(d.children=D(c.detoolbarItems,a,i,o)),c.uiactionGroup&&c.groupExtractMode){const t=null==(r=c.uiactionGroup.uiactionGroupDetails)?void 0:r.filter(e=>o[e.id].visible).map(t=>{const s=o[t.id],{sysImage:l}=t;return{label:t.showCaption?t.caption:void 0,icon:t.showIcon?n(E,{icon:l},null):void 0,disabled:s.disabled,clickableWhenHasChildren:!0,onClick:()=>{x.closeContextMenu(),e.doUIAction(t.uiactionId,a,i,t.appId)}}});switch(c.groupExtractMode){case"ITEMS":d.children=t;break;case"ITEMX":t&&(d=t[0],d.children=t.slice(1));break;default:d=void 0,t&&s.push(...t)}}}d&&s.push(d)}),s};return{c:e,ns:a,curPopover:p,calendarRef:h,legendItems:f,popoverValue:C,showDateList:v,showDateRange:m,infiniteScroll:g,disabledLodeMore:b,selectDate:e=>{h.value&&h.value.selectDate(e)},calcItemStyle:e=>{const t=f.value.find(t=>t.id===e.itemType);return{color:e.color,backgroundColor:e.bkColor,["".concat(a.cssVarBlockName("item-color"))]:e.color,["".concat(a.cssVarBlockName("item-active-border-color"))]:null==t?void 0:t.actBdrColor}},handleScrollLoad:async()=>{if(!g.value||b.value)return;const t=g.value.scrollTop;g.value.scrollHeight-t-g.value.clientHeight<10&&await e.load({isLoadMore:!0})},monthLegendClick:e=>{Object.assign(e,{isShow:!e.isShow})},calcCalendarItems:t=>{const a=(e=>{const t=as(e),a=t.startOf("week"),n=t.endOf("week"),i=[];let o=a;for(;o.isBefore(n)||o.isSame(n,"day");)i.push(o),o=o.add(1,"day");return i})(t),n=e.state.items.filter(e=>{const n=f.value.find(t=>t.id===e.itemType);return!(n&&!n.isShow)&&(m.value?a.some(t=>JC({beginTime:e.beginTime,endTime:e.endTime,date:t})):as(t).isSame(e.beginTime,"day"))});return m.value&&n.sort((e,t)=>{let a=0;return a=as(e.beginTime).isSame(t.beginTime,"day")?as(e.endTime).isAfter(t.endTime)?-1:1:as(e.beginTime).isAfter(t.beginTime)?1:-1,a}),n.map(e=>{const t=f.value.find(t=>Object.is(t.id,e.itemType));return t?(e.bkColor||Object.assign(e,{bkColor:t.bkcolor}),e.color||Object.assign(e,{color:t.color}),e):e})},onNodeContextmenu:async(t,n)=>{n.preventDefault(),n.stopPropagation();const{sysCalendarItems:i}=e.model,o=null==i?void 0:i.find(e=>e.id===t.itemType);if(!(null==o?void 0:o.decontextMenu))return;const s=e.contextMenus[o.decontextMenu.id];if(!s.model.detoolbarItems)return;await s.calcButtonState(t.deData||(t.deData?t:void 0),o.appDataEntityId,{view:e.view,ctrl:e});const l=s.state.buttonsState,r=D(s.model.detoolbarItems,t,n,l);r.length&&x.showContextMenu({x:n.x,y:n.y,customClass:a.b("context-menu"),items:r,zIndex:9999})}}},render(){const e=(e,t,a)=>{const{context:o,params:s}=this.c,l=this.c.state.selectedData.findIndex(t=>t.deData.srfkey===e.deData.srfkey),r=[this.ns.b("item"),this.ns.is("active",-1!==l),this.ns.is("begin-time",a&&as(a).isSame(e.beginTime,"day")),this.ns.is("hidden",this.showDateRange&&!JC({beginTime:e.beginTime,endTime:e.endTime,date:a})),this.ns.is("no-begin-time",this.showDateRange&&!e.beginTime),this.ns.is("no-end-time",this.showDateRange&&!e.endTime),this.ns.is("end-time",a&&as(a).isSame(e.endTime,"day"))],c=this.calcItemStyle(e);return n(i("iBizControlShell"),{class:r,data:e.deData,modelData:t,context:o,params:s,style:c,onClick:t=>(t.stopPropagation(),this.c.onRowClick(e)),onDblclick:t=>(t.stopPropagation(),this.c.onDbRowClick(e)),onContextmenu:t=>this.onNodeContextmenu(e,t)},null)},t=(e,t)=>{const a=this.c.state.selectedData.findIndex(t=>t.deData.srfkey===e.deData.srfkey),i=[this.ns.b("item"),this.ns.be("item","default"),this.ns.is("active",-1!==a),this.ns.is("begin-time",t&&as(t).isSame(e.beginTime,"day")),this.ns.is("hidden",this.showDateRange&&!JC({beginTime:e.beginTime,endTime:e.endTime,date:t})),this.ns.is("no-begin-time",this.showDateRange&&!e.beginTime),this.ns.is("no-end-time",this.showDateRange&&!e.endTime),this.ns.is("end-time",t&&as(t).isSame(e.endTime,"day"))],o=this.calcItemStyle(e);return n("div",{class:i,key:e.deData.srfkey,style:o,title:Tt(e.tips||e.text),onClick:()=>this.c.onRowClick(e),onDblclick:()=>this.c.onDbRowClick(e),onContextmenu:t=>this.onNodeContextmenu(e,t)},[this.showDateRange?t&&(as(t).isSame(e.beginTime,"day")||0===as(t).day()||!e.beginTime&&as(t).isSame(e.endTime,"day"))?e.text:"":e.text])},a=(a,n)=>{var i;const o=(null==(i=this.c.model.sysCalendarItems)?void 0:i.find(e=>a.itemType===e.itemType)).layoutPanel;return o?e(a,o,n):t(a,n)},o=(e,t)=>e.length>1&&!this.showDateRange&&!this.showDateList?[a(e[0],t),n(i("el-popover"),{trigger:"click",ref:t=>{t&&e[0].id===this.popoverValue&&(this.curPopover=t)},onShow:()=>{this.popoverValue=e[0].id}},{reference:()=>n("span",{class:this.ns.b("more")},["+".concat(e.length-1," ").concat(ibiz.i18n.t("app.more"),"...")]),default:()=>e.map(e=>a(e,t))})]:e.map(e=>a(e,t)),s=e=>{const t=this.calcCalendarItems(e);return o(t,e)},l=()=>n("div",{class:[this.ns.b("content"),this.ns.is("show-date-range",this.showDateRange)]},[n(i("el-calendar"),{modelValue:this.c.state.selectedDate,"onUpdate:modelValue":e=>this.c.state.selectedDate=e,ref:"calendarRef"},{header:({date:e})=>{let t,a,o,s,l;return[n("span",{class:this.ns.b("content-title")},[e]),n("div",{class:this.ns.b("legend")},[this.legendItems&&this.legendItems.length>1&&this.legendItems.map(e=>{var t;let a=e.name;const i=null==(t=this.c.model.sysCalendarItems)?void 0:t.find(t=>t.id===e.id);return(null==i?void 0:i.nameLanguageRes)&&(a=ibiz.i18n.t(i.nameLanguageRes.lanResTag,i.name)),n("div",{class:[this.ns.be("legend","item")],onClick:()=>this.monthLegendClick(e)},[n("div",{class:this.ns.bem("legend","item","tip"),style:{background:e.isShow?null==e?void 0:e.bkcolor:"var(".concat(this.ns.cssVarName("color-disabled-bg"),")"),color:null==e?void 0:e.color}},null),n("div",{class:this.ns.bem("legend","item","text")},[a])])})]),n("div",{class:this.ns.b("content-header")},[n(i("el-date-picker"),{modelValue:this.c.state.selectedDate,"onUpdate:modelValue":e=>this.c.state.selectedDate=e,type:"month"},null),n(i("el-button-group"),null,{default:()=>[n(i("el-button"),{onClick:()=>{this.selectDate("prev-year")}},QC(t=ibiz.i18n.t("control.calendar.lastYear"))?t:{default:()=>[t]}),n(i("el-button"),{onClick:()=>{this.selectDate("prev-month")}},QC(a=ibiz.i18n.t("control.calendar.lastMonth"))?a:{default:()=>[a]}),n(i("el-button"),{onClick:()=>{this.selectDate("today")}},QC(o=ibiz.i18n.t("control.calendar.today"))?o:{default:()=>[o]}),n(i("el-button"),{onClick:()=>{this.selectDate("next-month")}},QC(s=ibiz.i18n.t("control.calendar.nextMonth"))?s:{default:()=>[s]}),n(i("el-button"),{onClick:()=>{this.selectDate("next-year")}},QC(l=ibiz.i18n.t("control.calendar.nextYear"))?l:{default:()=>[l]})]})])]},"date-cell":({data:e})=>{const{date:t}=e;return n("div",{class:this.ns.b("day")},[n("p",{class:this.ns.b("date-text")},[t.getDate()]),n("div",{class:this.ns.b("items")},[s(t)])])}})]),r=()=>{const{isLoaded:e}=this.c.state,t={};return ce(this.c)&&Object.assign(t,{customRender:()=>n(de,{controller:this.c},null)}),e&&n(i("iBizNoData"),{text:this.c.model.emptyText,emptyTextLanguageRes:this.c.model.emptyTextLanguageRes,hideNoDataImage:this.c.state.hideNoDataImage},QC(t)?t:{default:()=>[t]})},c=()=>{const a={},{sysCalendarItems:i}=this.c.model;return a.event=({data:a})=>{const n=null==i?void 0:i.find(e=>e.id===a.itemType);return n&&n.layoutPanel?e(a,n.layoutPanel):t(a)},n("div",{class:this.ns.b("content")},[n($C,{modelValue:this.c.state.selectedDate,"onUpdate:modelValue":e=>this.c.state.selectedDate=e,showDetail:this.c.state.showDetail,calendarTitle:this.c.state.calendarTitle,ref:"calendarRef",viewType:this.c.model.calendarStyle,events:this.c.state.items,legends:this.legendItems,multiple:!this.c.state.singleSelect,selectedData:this.c.state.selectedData,onEventClick:e=>{const{data:t}=e,a=t[0];a&&this.c.onRowClick(a)},onEventDblClick:e=>{const{data:t}=e,a=t[0];a&&this.c.onDbRowClick(a)},onEventContextmenu:e=>{const{data:t,evt:a}=e,n=t[0];n&&a&&this.onNodeContextmenu(n,a)}},QC(a)?a:{default:()=>[a]})])},d=()=>n("div",{ref:"infiniteScroll",class:this.ns.b("timeline-content"),onScroll:_o(this.handleScrollLoad,300)},[n(i("el-timeline"),null,{default:()=>[this.c.state.items.length>0?this.c.state.items.map(a=>{var o;const s=null==(o=this.c.model.sysCalendarItems)?void 0:o.find(e=>a.itemType===e.itemType),l=a[this.c.groupTimeField],r=l?as(l).format(this.c.timelineCaptionFormat):l;return n(i("el-timeline-item"),{key:a.id,placement:"top",color:a.bkColor,timestamp:r},{default:()=>[(null==s?void 0:s.layoutPanel)?e(a,s.layoutPanel):t(a)]})}):r()]})]),u=()=>{switch(this.c.model.calendarStyle){case"TIMELINE":return d();case"WEEK":case"DAY":case"USER":return c();default:return l()}};return n(i("iBizControlNavigation"),{controller:this.c},{default:()=>{var e;return[n(i("iBizControlBase"),{controller:this.c,class:this.ns.e(null==(e=this.c.model.calendarStyle)?void 0:e.toLowerCase())},{default:()=>[u(),this.c.state.enableNavView&&this.c.state.showNavIcon?this.c.state.showNavView?n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.hiddenNav"),name:"eye-off-outline",onClick:()=>this.c.onShowNavViewChange()},null):n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.showNav"),name:"eye-outline",onClick:()=>this.c.onShowNavViewChange()},null):null]})]}})}});var eI=Object.defineProperty,tI=(e,t,a)=>(((e,t,a)=>{t in e?eI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class aI{constructor(){tI(this,"component","IBizCalendarControl")}}const nI=e("aw",ie(ZC,function(e){e.use($C),e.component(ZC.name,ZC),Ha(qa.CALENDAR,()=>new aI)}));function iI(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const oI=a({name:"IBizSwimlaneKanban",components:{draggable:is},props:{controller:{type:Object,required:!0}},setup(e){var t,a;const s=B("swimlane-kanban"),l=e.controller,{zIndex:c}=G(),u=o(!1),h={zIndex:c.increment()},v=o(!0),g=o(),b=o();let f=Ut;d(()=>{f=Nt(window,"resize",()=>{u.value=l.getFullscreen()})}),m(()=>{f!==Ut&&f()});const w=r(()=>!l.state.draggable||0===l.draggableMode||l.state.updating||l.state.readonly),y=r(()=>{const{groupWidth:e,cardWidth:t}=l.model;return e||t||320}),C=r(()=>l.state.batching?l.state.selectGroupKey:""),I=null==(t=l.model.controls)?void 0:t.find(e=>e.name==="".concat(l.model.name,"_quicktoolbar")||e.name==="".concat(l.model.name,"_groupquicktoolbar")),x=null==(a=l.model.controls)?void 0:a.find(e=>e.name==="".concat(l.model.name,"_batchtoolbar"));let S=null;const E=()=>{const e=b.value;u.value=l.onFullScreen(e)},D=()=>{v.value=!v.value,l.state.swimlanes.forEach(e=>{e.isExpand=v.value})},P=e=>{let t;const a=l.model.groupUIActionGroup&&e.groupActionGroupState||x;return!1===e.isExpand?null:C.value===e.key?n("div",{class:[s.em("cell","right"),s.em("header","actions")]},[n(i("el-button"),{text:!0,onClick:()=>l.closeBatch()},iI(t=ibiz.i18n.t("app.complete"))?t:{default:()=>[t]})]):n("div",{class:[s.em("cell","right"),s.em("header","actions")]},[n(i("el-button"),{text:!0,circle:!0,class:s.em("header","action"),onClick:()=>{e.isExpand=!1}},{default:()=>[n("ion-icon",{name:"chevron-back-outline",title:ibiz.i18n.t("control.kanban.collapsed")},null)]}),a&&n(i("el-dropdown"),{trigger:"click",teleported:!1,style:h,class:[s.em("header","action"),s.is("visible",e.key===g.value)],"popper-class":s.em("header","popper"),onVisibleChange:t=>((e,t)=>{g.value=e?t:void 0})(t,e.key)},{default:()=>n(i("el-button"),{text:!0,circle:!0},{default:()=>[n("ion-icon",{title:Tt(ibiz.i18n.t("app.more")),name:"ellipsis-horizontal"},null)]}),dropdown:()=>n("div",{class:s.em("header","toolbar")},[l.model.groupUIActionGroup&&n(i("iBizActionToolbar"),{zIndex:l.state.zIndex,actionDetails:l.model.groupUIActionGroup.uiactionGroupDetails,actionsState:e.groupActionGroupState,onActionClick:(t,a)=>{l.onGroupToolbarClick(t,a,e)}},null),x&&n(i("el-button"),{size:"small",onClick:()=>{l.openBatch(e.key)}},{default:()=>[n("ion-icon",{name:"checkmark-sharp"},null),ibiz.i18n.t("control.kanban.natchOperation")]})])})])},k=(e,t)=>{const{context:a,params:o}=l,{itemLayoutPanel:r}=l.model;if(r)return n(i("iBizControlShell"),{data:t,params:o,context:a,class:s.e("panel-item"),modelData:r},null)},z=(e,t,a)=>{const o=l.getOptItemModel();return n("div",{class:s.e("default-item")},[n("div",{class:s.em("default-item","header")},[t.srfmajortext]),n("div",{class:s.em("default-item","content")},[t.content]),o.length?n("div",{class:s.em("default-item","footer")},[n(i("iBizActionToolbar"),{zIndex:l.state.zIndex,class:s.em("default-item","actions"),"action-details":o,"actions-state":l.state.uaState[t.srfkey],onActionClick:(n,i)=>l.onGroupActionClick(n,t,i,a,e)},null)]):null])},T=(e,t)=>{const{swimlaneAppDEFieldId:a}=l.model,o=t.children.filter(t=>t[a]===e.key);return n("div",{class:s.em("cell","toolbar")},[l.enableNew&&!l.state.readonly&&n(i("el-button"),{text:!0,class:s.em("cell","action"),onClick:a=>{l.onClickNew(a,t.key,e)}},{default:()=>[n("ion-icon",{name:"add-outline"},null),ibiz.i18n.t("app.newlyBuild")]}),I&&0===o.length&&n(i("iBizControlShell"),{class:s.e("quicktoolbar"),modelData:{...I,name:"".concat(I.name,"_").concat(t.key)},context:l.context,params:l.params},null)])},A=e=>{let t;if(!x||C.value!==e.key)return;const a=e.selectedData||[],o=a.length===e.children.length,r=a.length>0&&a.length<e.children.length;return n("div",{class:s.e("batch")},[n(i("iBizControlShell"),{modelData:{...x,name:"".concat(x.name,"_").concat(e.key)},class:s.em("batch","toolbar"),context:l.context,params:l.params},null),n("div",{class:s.em("batch","check")},[n(i("el-checkbox"),{"model-value":o,indeterminate:r,onChange:()=>((e,t)=>{const a=e.selectedData||[];t?a.forEach(e=>{l.onRowClick(e)}):e.children.filter(e=>!a.includes(e)).forEach(e=>{l.onRowClick(e)})})(e,o)},iI(t=ibiz.i18n.t("control.kanban.selectAll"))?t:{default:()=>[t]}),n("span",{class:s.em("batch","info"),innerHTML:ibiz.i18n.t("control.kanban.selectedDataCount",{length:a.length})},null)])])},O=(e,t,a)=>{const{swimlaneAppDEFieldId:o}=l.model;return n("div",{class:[s.e("cell"),s.em("body","cell"),s.is("collapsed",!1===a.isExpand)]},[0===e&&A(a),!1!==a.isExpand?n("div",{class:s.em("cell","content")},[t.isExpand?[n(is,{itemKey:"srfkey",disabled:w.value,modelValue:a.children,handle:".".concat(s.e("drag-icon")),class:s.em("cell","draggable"),group:(r=a.key,c=t.key,1===l.draggableMode?r.toString():2===l.draggableMode?c||"custom":l.model.id),onChange:e=>((e,t,a)=>{e.moved&&l.onDragChange({from:t,to:t,fromIndex:e.moved.oldIndex,toIndex:e.moved.newIndex,fromLane:a,toLane:a}),e.added&&(S={to:t,toLane:a,toIndex:e.added.newIndex}),e.removed&&(S&&(Object.assign(S,{from:t,fromLane:a,fromIndex:e.removed.oldIndex}),l.onDragChange(S)),S=null)})(e,a.key,t.key)},{item:({element:e})=>{return o&&e[o]===t.key?n(i("el-card"),{shadow:"hover",class:[s.e("card"),s.is("selected",(r=e,-1!==l.state.selectedData.findIndex(e=>e.srfkey===r.srfkey))),s.is("disabled",l.state.draggable&&l.state.updating)],onClick:()=>l.onRowClick(e),onDblclick:()=>l.onDbRowClick(e)},{default:()=>[n("div",{class:s.em("card","content")},[l.state.draggable&&!l.state.readonly&&0!==l.draggableMode&&n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:s.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])]),l.model.itemLayoutPanel?k(0,e):z(t,e,a)])]}):null;var r}}),T(t,a)]:n("div",{class:s.em("cell","left")},[n("span",{class:s.em("cell","description")},["".concat(a.children.filter(e=>o&&e[o]===t.key).length," 个").concat(a.caption)])])]):null]);var r,c};return{ns:s,swimlaneKanban:b,width:y,renderHeader:()=>n("div",{class:s.e("header")},[n("div",{class:s.em("header","row")},[n("div",{class:[s.e("cell"),s.em("header","cell")]},[n("div",{class:s.em("cell","content")},[n("div",{class:s.em("cell","left")},[n("ion-icon",{onClick:D,class:s.em("cell","expand-icon"),title:v.value?ibiz.i18n.t("control.kanban.allCollapsed"):ibiz.i18n.t("control.kanban.allExpand"),name:v.value?"chevron-collapse-outline":"chevron-expand-outline"},null),n("div",{class:s.em("cell","caption")},[ibiz.i18n.t("control.kanban.lane")])]),n("div",{class:s.em("cell","right")},[l.enableGroupHidden&&n(i("iBizKanbanSetting"),{buttonStyle:{circle:!0,type:"text"},controller:e.controller},null),l.enableFullScreen&&n(i("el-button"),{type:"text",circle:!0,onClick:E,title:u.value?ibiz.i18n.t("app.cancelFullscreen"):ibiz.i18n.t("app.fullscreen")},{default:()=>[n("ion-icon",{name:u.value?"contract-outline":"expand-outline"},null)]})])])]),l.state.groups.map(e=>{if(!e.hidden)return(e=>n("div",{class:[s.e("cell"),s.em("header","cell"),s.is("collapsed",!1===e.isExpand)]},[n("div",{class:s.em("cell","content")},[n("div",{class:s.em("cell","left")},[n("div",{class:s.em("cell","caption")},[e.caption,n("span",{class:s.em("cell","separator")},[p("·")]),e.children.length]),!1===e.isExpand&&n(i("el-button"),{text:!0,circle:!0,onClick:()=>{e.isExpand=!0}},{default:()=>[n("ion-icon",{title:ibiz.i18n.t("control.kanban.expand"),name:"chevron-forward-outline"},null)]})]),P(e)])]))(e)})])]),renderBody:()=>n("div",{class:s.e("body")},[l.state.swimlanes.map((e,t)=>n("div",{class:[s.em("body","row"),s.is("expand",e.isExpand)]},[n("div",{class:[s.e("cell"),s.em("body","cell")]},[n("div",{class:s.em("cell","content")},[n("div",{class:s.em("cell","left")},[n("ion-icon",{class:s.em("cell","expand-icon"),name:e.isExpand?"chevron-down-outline":"chevron-forward-outline",onClick:()=>{e.isExpand=!e.isExpand}},null),n("div",{class:s.em("cell","caption")},[e.caption])]),n("div",{class:s.em("cell","right")},[n("span",{class:s.em("cell","description")},["".concat(e.count," 个").concat(l.laneDescription)])])])]),l.state.groups.map(a=>{if(!a.hidden)return O(t,e,a)})]))])}},render(){var e;return n("div",{ref:"swimlaneKanban",class:[this.ns.b(),this.ns.e(null==(e=this.controller.model.groupStyle)?void 0:e.toLowerCase())],style:{"--ibiz-swimlane-kanban-width":"".concat(this.width,"px")}},[n("div",{class:this.ns.e("table")},[this.renderHeader(),this.renderBody()])])}});function sI(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const lI=a({name:"IBizKanbanControl",components:{draggable:is},props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0},isSimple:{type:Boolean,required:!1},data:{type:Array,required:!1},loadDefault:{type:Boolean,default:!0}},setup(e){var t,a,s;const l=ne((...e)=>new ri(...e));ue(l);const u=B("control-".concat(l.model.controlType.toLowerCase())),h=o(),v=o(!1),{onPageChange:g,onPageRefresh:b,onPageSizeChange:f}=ul(l),w=()=>{e.data&&(l.state.items=e.data.map(e=>new ma(e)),l.afterLoad({},l.state.items))};l.evt.on("onCreated",async()=>{e.isSimple&&(w(),l.state.isSimple=!0,l.state.isLoaded=!0)}),c(()=>e.data,()=>{e.isSimple&&w()},{deep:!0});const y=r(()=>l.state.batching?l.state.selectGroupKey:""),C=null==(t=l.model.controls)?void 0:t.find(e=>e.name==="".concat(l.model.name,"_quicktoolbar")||e.name==="".concat(l.model.name,"_groupquicktoolbar")),I=null==(a=l.model.controls)?void 0:a.find(e=>e.name==="".concat(l.model.name,"_batchtoolbar")),x=(null==(s=l.model.groupSysCss)?void 0:s.cssName)||"",S=o({});let E=Ut;const D={};switch(l.model.groupLayout){case"ROW":D.width="".concat(l.model.groupWidth||300,"px"),D.height="100%";break;case"COLUMN":D.width="100%",D.height="".concat(l.model.groupHeight||500,"px")}const P=e=>{e.stopPropagation()},k=(e,t)=>{P(t);const a=String(e.key);S.value[a]=!S.value[a]};d(()=>{E=Nt(window,"resize",()=>{v.value=l.getFullscreen()})}),m(()=>{E!==Ut&&E()});const z=(e,t)=>{const{context:a,params:o}=l;return n(i("iBizControlShell"),{data:e,class:u.e("panel-item"),modelData:t,context:a,params:o},null)},T=(e,t)=>n(i("iBizActionToolbar"),{zIndex:l.state.zIndex,class:u.bem("item","bottom","actions"),"action-details":l.getOptItemModel(),"actions-state":l.state.uaState[e.srfkey],onActionClick:(a,n)=>l.onGroupActionClick(a,e,n,t)},null),A=e=>{if(C)return n(i("iBizControlShell"),{class:u.e("quicktoolbar"),modelData:{...C,name:"".concat(C.name,"_").concat(e.key)},context:l.context,params:l.params},null)},O=e=>{if(I)return n("div",{class:u.be("batch","toolbar")},[n(i("iBizControlShell"),{modelData:{...I,name:"".concat(I.name,"_").concat(e.key)},context:l.context,params:l.params},null)])},M=e=>{let t;const a=e.selectedData||[],o=a.length===e.children.length,s=a.length>0&&a.length<e.children.length;return n("div",{class:u.be("batch","check")},[n(i("el-checkbox"),{"model-value":o,indeterminate:s,onChange:()=>((e,t)=>{const a=e.selectedData||[];t?a.forEach(e=>{l.onRowClick(e)}):e.children.filter(e=>!a.includes(e)).forEach(e=>{l.onRowClick(e)})})(e,o)},sI(t=ibiz.i18n.t("control.kanban.selectAll"))?t:{default:()=>[t]}),n("span",{class:u.be("batch","info"),innerHTML:ibiz.i18n.t("control.kanban.selectedDataCount",{length:a.length})},null)])},N=e=>{if(y.value===e.key)return n("div",{class:u.b("batch")},[O(e),M(e)])},L=(e,t)=>{const a=l.getOptItemModel();return n("div",{class:u.e("default-item")},[n("div",{class:u.be("item","top")},[n("div",{class:u.bem("item","top","title")},[e.srfmajortext]),n("div",{class:u.bem("item","top","description")},[e.content])]),a.length?n("div",{class:u.be("item","bottom")},[T(e,t)]):null])},R=(t,a)=>{const o=l.state.selectedData.findIndex(e=>e.srfkey===t.srfkey),s=[u.b("item"),u.is("selected",-1!==o),u.is("disabled",l.state.draggable&&l.state.updating)],r={};l.model.cardWidth&&(r.width="".concat(l.model.cardWidth,"px")),l.model.cardHeight&&(r.height="".concat(l.model.cardHeight,"px"));const c=e.modelData.itemLayoutPanel;return n(i("el-card"),{shadow:"hover",class:s,"body-style":r,onClick:e=>((e,t)=>(P(t),l.onRowClick(e)))(t,e),onDblclick:e=>((e,t)=>(P(t),l.onDbRowClick(e)))(t,e)},{default:()=>[n("div",{class:u.be("item","content")},[l.state.draggable&&!l.state.readonly&&n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:u.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])]),c?z(t,c):L(t,a)])]})},_=()=>{if(!l.state.isLoaded)return;const e={};return ce(l)&&Object.assign(e,{customRender:()=>n(de,{controller:l},null)}),n(i("iBizNoData"),{text:l.model.emptyText,emptyTextLanguageRes:l.model.emptyTextLanguageRes},sI(e)?e:{default:()=>[e]})};let j=null;const V=e=>{const t=l.model.groupUIActionGroup&&e.groupActionGroupState||I;if(y.value===e.key){let e;return n("span",{class:u.be("group","header-right"),onClick:e=>P(e)},[n(i("el-button"),{text:!0,onClick:()=>l.closeBatch()},sI(e=ibiz.i18n.t("app.complete"))?e:{default:()=>[e]})])}return n("span",{class:u.be("group","header-right"),onClick:e=>P(e)},[l.enableNew&&!l.state.readonly&&n(i("el-button"),{class:u.be("group","header-new"),text:!0,circle:!0,onClick:t=>{((e,t)=>{P(e),l.onClickNew(e,t)})(t,e.key)}},{default:()=>[n("ion-icon",{name:"add-outline",title:ibiz.i18n.t("app.newlyBuild")},null)]}),t&&n(i("el-dropdown"),{class:u.be("group","header-actions"),trigger:"click",teleported:!1,"popper-class":u.e("popover")},{default:()=>n("span",{title:ibiz.i18n.t("app.more")},[p("···")]),dropdown:()=>n("div",{class:u.be("group","actions-dropdown")},[l.model.groupUIActionGroup&&e.groupActionGroupState&&n(i("iBizActionToolbar"),{direction:"vertical",actionDetails:l.model.groupUIActionGroup.uiactionGroupDetails,actionsState:e.groupActionGroupState,onActionClick:(t,a)=>{l.onGroupToolbarClick(t,a,e)}},null),I&&n(i("el-button"),{size:"small",onClick:()=>{l.openBatch(e.key)}},{default:()=>[n("ion-icon",{name:"checkmark-sharp"},null),ibiz.i18n.t("control.kanban.natchOperation")]})])})])};return{c:l,ns:u,isFull:v,kanban:h,renderGroup:e=>{const t=S.value[String(e.key)],a="COLUMN"===l.model.groupLayout,i={...D};return t&&(i.height="50px"),!t||a?n("div",{class:[u.b("group"),u.is("collapse",t),x],style:i},[n("div",{class:u.be("group","header"),style:{borderTopColor:e.color||"transparent"},onClick:t=>k(e,t)},[n("div",{class:u.be("group","header-left")},[n("ion-icon",{name:"caret-down-sharp"},null),n("span",{class:[u.be("group","header-caption"),u.is("badge",!!e.color)],style:{backgroundColor:e.color}},["".concat(e.caption).concat(e.children.length?" · ".concat(e.children.length):"")])]),V(e)]),N(e),n("div",{class:[u.be("group","list"),u.is("empty",!e.children.length)]},[n(is,{itemKey:"srfkey",group:l.model.id,modelValue:e.children,class:u.be("group","draggable"),handle:".".concat(u.e("drag-icon")),disabled:!l.state.draggable||l.state.updating||l.state.readonly,onChange:t=>((e,t)=>{e.moved&&l.onDragChange({from:t,to:t,fromIndex:e.moved.oldIndex,toIndex:e.moved.newIndex}),e.added&&(j={to:t,toIndex:e.added.newIndex}),e.removed&&(j&&(j.from=t,j.fromIndex=e.removed.oldIndex,l.onDragChange(j)),j=null)})(t,e.key)},{item:({element:t})=>R(t,e),header:()=>e.children.length?null:n("div",{class:u.be("group","list")},[_()])}),A(e)])]):n("div",{class:[u.b("group"),u.is("collapse",t),x]},[n("div",{class:u.be("group","header"),style:{borderTopColor:e.color||"transparent"},onClick:t=>k(e,t)},[n("span",{class:[u.be("group","header-caption"),u.is("badge",!!e.color)],style:{backgroundColor:e.color}},["".concat(e.caption).concat(e.children.length?" · ".concat(e.children.length):"")]),n("ion-icon",{name:"caret-forward-sharp"},null)])])},onFullScreen:()=>{const e=h.value.$el;v.value=l.onFullScreen(e)},onPageChange:g,onPageRefresh:b,onPageSizeChange:f}},render(){var e;const{groups:t,isCreated:a}=this.c.state,{swimlaneAppDEFieldId:o}=this.c.model;return a?n(i("iBizControlBase"),{ref:"kanban",controller:this.c,class:[this.ns.m(null==(e=this.modelData.groupLayout)?void 0:e.toLowerCase()),this.ns.is("full",this.isFull),this.ns.is("swimlane",!!o),this.ns.is("enable-page",this.c.state.enablePagingBar)]},{default:()=>[n("div",{class:this.ns.e("content")},[o?n(oI,{controller:this.c},null):[n("div",{class:this.ns.b("group-container")},[t.length>0&&t.map(e=>e.hidden?null:this.renderGroup(e))]),t.length>0&&n("div",{class:this.ns.b("toolbar")},[this.c.enableGroupHidden&&n(i("iBizKanbanSetting"),{controller:this.c},null),this.c.enableFullScreen&&n(i("el-button"),{type:"info",onClick:this.onFullScreen,title:this.isFull?ibiz.i18n.t("app.cancelFullscreen"):ibiz.i18n.t("app.fullscreen")},{default:()=>[n("ion-icon",{name:this.isFull?"contract-outline":"expand-outline"},null)]})])]]),this.c.state.enablePagingBar&&n(i("iBizPagination"),{size:this.c.state.size,total:this.c.state.total,curPage:this.c.state.curPage,totalPages:this.c.state.totalPages,onChange:this.onPageChange,onPageRefresh:this.onPageRefresh,onPageSizeChange:this.onPageSizeChange},null)]}):null}});var rI=Object.defineProperty,cI=(e,t,a)=>(((e,t,a)=>{t in e?rI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class dI{constructor(){cI(this,"component","IBizKanbanControl")}}const uI=e("ax",ie(lI,function(e){e.component(lI.name,lI),Ha(qa.KANBAN,()=>new dI)}));function hI(e,t){let a;const s=o(!1),l=o(!1),r=o(),c=u({}),d=async t=>{var n;const i=(t=>{if(!e.value)throw new Vt(ibiz.i18n.t("control.common.citeErrMessage"));const a=e.value.$el;let n=".el-table__row";t.data._uuid&&(n+='[class*="id-'.concat(t.data._uuid,'"]'));const i=a.querySelector(n);if(!i)throw new Vt(ibiz.i18n.t("control.common.noDomErrMessage"));return i})(t);if(l.value=(null==(n=i.parentNode)?void 0:n.lastElementChild)===i,!a)throw new Vt(ibiz.i18n.t("control.common.noPopErrMessage"));const o=a.$el,{x:d,y:u}=await es(i,o,{placement:"bottom"});Object.assign(c,{top:"".concat(u,"px"),left:"".concat(d,"px")}),r.value=t,setTimeout(()=>{s.value=!0},200)},h=async()=>{r.value&&t.switchRowEdit(r.value,!1,!0)},p=async()=>{r.value&&t.switchRowEdit(r.value,!1,!1)};return t.evt.on("onRowEditChange",e=>{e.row.showRowEdit?setTimeout(()=>{d(e.row)},0):(r.value=void 0,s.value=!1,Object.assign(c,{top:void 0,left:void 0}))}),{renderPopover:()=>[n("div",{class:"row-edit-popover__placeholder",style:{display:l.value?"block":"none"}},null),n(i("iBizRowEditPopover"),{ref:e=>{a=e},style:c,show:s.value,onConfirm:h,onCancel:p},null)]}}function pI(e,t){var a;const n={};return null==(a=e.controlAttributes)||a.forEach(e=>{e.attrName&&e.attrValue&&(n[e.attrName]=Ua.execSingleLine(e.attrValue,{...t}))}),n}const mI=a({name:"IBizTreeGridExControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){const e=ne((...e)=>new ci(...e));ue(e);const t=B("control-".concat(e.model.controlType.toLowerCase())),a=r(()=>{const t=[];return e.state.columnStates.forEach(a=>{var n,i;if(a.hidden)return;const o=(null==(n=e.fieldColumns[a.key])?void 0:n.model)||(null==(i=e.uaColumns[a.key])?void 0:i.model);o&&t.push(o)}),t}),l=(e,t=!1)=>e.map(e=>{const a={id:e._id,_uuid:e._uuid,hasChildren:!e._leaf,_deData:e._deData};return t||e._leaf||void 0===e._children||(a.children=l(e._children)),a}),c=o(go()),d=r(()=>e.state.isLoaded?e.model.rootVisible?e.state.rootNodes:e.state.rootNodes.reduce((e,t)=>t._children?e.concat(t._children):e,[]):[]),u=r(()=>(c.value=go(),0===d.value.length?[]:l(d.value,!0)));e.evt.on("onAfterRefreshParent",()=>{c.value=go()});const h=o(),{renderPopover:p}=hI(h,e);P(()=>{if(h.value){const t=h.value.store.states.treeData.value,a=e.state.expandedKeys;Object.keys(t).forEach(n=>{if(a.includes(n)!==t[n].expanded){const t=l([e.getNodeData(n)])[0];h.value.store.loadOrToggle(t)}})}});return{c:e,ns:t,tableRef:h,elTableData:u,renderColumns:a,tableRefreshKey:c,loadData:async(t,a,n)=>{let i;const o=e.getNodeData(t.id);i=o._children?o._children:await e.loadNodes(o),n(l(i))},onRowClick:async(t,a,n)=>{const i=e.getNodeData(t.id);if("row"===e.editShowMode&&e.model.enableEdit){const a=e.state.rows[i._uuid];if(!a||!0===a.showRowEdit)throw new Vt(ibiz.i18n.t("control.treeGridEx.noFoundMessage",{id:t.id}));await e.switchRowEdit(a,!0)}else e.onTreeNodeClick(i,n)},renderNoData:()=>{const{isLoaded:t}=e.state,a={};return ce(e)&&Object.assign(a,{customRender:()=>n(de,{controller:e},null)}),t&&n(i("iBizNoData"),{text:e.model.emptyText,emptyTextLanguageRes:e.model.emptyTextLanguageRes},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o},renderPopover:p,onExpandChange:(t,a)=>{const n=e.getNodeData(t._uuid);if(!n)throw new Vt(ibiz.i18n.t("control.common.noFoundNode",{id:t._uuid}));e.onExpandChange(n,a)},handleRowClassName:function({row:t}){const a=e.getNodeData(t.id);if(!a)return"";let n="";e.state.selectedData.length>0&&e.state.selectedData.forEach(e=>{e===a&&(n="current-row")});const i=e.getRowState(a._uuid);return(null==i?void 0:i.showRowEdit)&&(n+=" editing-row"),n+=" id-".concat(a._uuid),n}}},render(){const e=(e,t)=>{var a,o,s;if(this.$slots[e.id])return D(this.$slots,e.id,{model:e,data:this.c.state.items});const{codeName:r,width:c}=e,d=this.c.columns[r],u=this.c.state.columnStates.find(e=>e.key===r),h=d.isAdaptiveColumn||!this.c.hasAdaptiveColumn&&t===this.renderColumns.length-1?"min-width":"width";let p="default";const m=null==(a=this.c.controlParams.expandiconcolumn)?void 0:a.toLowerCase(),v=this.c.state.columnStates.find(e=>m&&e.key.toLowerCase()===m);return v&&!v.hidden&&(p=(null==r?void 0:r.toLowerCase())===m?"default":""),n(i("el-table-column"),y({type:p,prop:r,label:e.caption},{[h]:c},{fixed:u.fixed,sortable:!!e.enableSort&&"custom",align:(null==(o=e.align)?void 0:o.toLowerCase())||"center","label-class-name":null==(s=d.model.headerSysCss)?void 0:s.cssName}),{header:({column:e})=>n(i("iBizGridColumnHeader"),{key:e.property,controller:d},null),default:({row:e})=>{const t=this.c.getRowState(e.id);if(t){const e=i(this.c.providers[r].component),a=t.data,n=this.c.getNodeModel(a._nodeId);return l(e,{controller:d,row:t,key:t.data._uuid+r,attrs:pI(n,{...this.c.getEventArgs(),data:t.data})})}return null}})};return n(i("iBizControlNavigation"),{controller:this.c},{default:()=>[n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b()]},{default:()=>[this.c.state.isLoaded&&n(i("el-table"),y({ref:"tableRef",key:this.tableRefreshKey,class:this.ns.e("table"),border:!0,"row-key":"id",data:this.elTableData,"tree-props":{children:"children",hasChildren:"hasChildren"},lazy:!0,onRowClick:this.onRowClick,onExpandChange:this.onExpandChange,"row-class-name":this.handleRowClassName,load:this.loadData},pI(this.c.model,{...this.c.getEventArgs()})),{empty:this.renderNoData,default:()=>[this.renderColumns.map((t,a)=>e(t,a))],append:()=>this.renderPopover()})]})]})}});var vI=Object.defineProperty,gI=(e,t,a)=>(((e,t,a)=>{t in e?vI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class bI{constructor(){gI(this,"component","IBizTreeGridExControl")}}const fI=a({name:"IBizTreeGridExFieldColumn",props:{controller:{type:ui,required:!0},row:{type:di,required:!0}},setup(e){const t=B("tree-grid-ex-field-column"),a=e.controller.treeGrid.state.zIndex,n=r(()=>"DE"!==e.row.data._nodeType&&e.controller.isFirstShowColumn?e.row.data._text:e.row.data[e.controller.name]),i=r(()=>e.controller.nodeColumnControllerMap.get(e.row.data._nodeId)),s=o(""),l=r(()=>{var t,a;const o=i.value;if(o){if(o.nodeEditItem)return;if(o.codeList)return s.value;let i=o.formatValue(n.value);return e.controller.treeGrid.emptyHiddenUnit?i&&(i+=o.unitName||(null==(t=o.nodeColumn)?void 0:t.unitName)||""):i+=o.unitName||(null==(a=o.nodeColumn)?void 0:a.unitName)||"",i}return n.value}),c=r(()=>{if("ellipsis"===e.controller.treeGrid.overflowMode&&zo(n.value)&&""!==n.value)return l.value}),d=r(()=>n.value&&i.value&&(i.value.isLinkColumn||i.value.hasClickAction));return{ns:t,zIndex:a,tooltip:c,showText:l,clickable:d,nodeColumn:i,fieldValue:n,onTextClick:t=>{var a;null==(a=i.value)||a.onTextClick(e.row,t)},onActionClick:async(t,a)=>{var n;await(null==(n=i.value)?void 0:n.onActionClick(t,e.row,a))},onInfoTextChange:e=>{s.value=e}}},render(){var e,t,a,o;let s,l=null;return l=(null==(e=this.nodeColumn)?void 0:e.nodeEditItem)?n(i("iBizTreeGridExEditColumn"),{controller:this.nodeColumn,row:this.row},null):(null==(t=this.nodeColumn)?void 0:t.codeList)?n(i("iBizCodeList"),{class:this.ns.e("text"),codeListItems:this.nodeColumn.codeListItems,codeList:this.nodeColumn.codeList,value:this.fieldValue,onClick:this.onTextClick,onInfoTextChange:this.onInfoTextChange,title:Tt(this.tooltip)},null):n("span",{class:this.ns.e("text"),title:Tt(this.tooltip),onClick:this.onTextClick},[this.showText]),this.$slots.actions?s=this.$slots.actions():this.row.columnActionsStates[this.controller.name]&&(s=n(i("iBizActionToolbar"),{zIndex:this.zIndex,class:this.ns.e("toolbar"),"action-details":null==(a=this.nodeColumn)?void 0:a.nodeColumn.deuiactionGroup.uiactionGroupDetails,"actions-state":this.row.columnActionsStates[this.controller.name],groupLevelKeys:[50,100],onActionClick:this.onActionClick},null)),n("div",{class:[this.ns.b(),this.clickable&&this.ns.m("clickable"),this.ns.m(this.controller.treeGrid.overflowMode),null==(o=this.controller.model.cellSysCss)?void 0:o.cssName,this.ns.is("has-action",!!s)]},[n("div",{class:this.ns.b("text-container")},[l]),n("div",{class:this.ns.b("toolbar-container")},[s])])}});var wI=Object.defineProperty,yI=(e,t,a)=>(((e,t,a)=>{t in e?wI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class CI{constructor(){yI(this,"component","IBizTreeGridExFieldColumn")}async createController(e,t){const a=new ui(e,t);return await a.init(),a}}const II=ie(fI,function(e){e.component(fI.name,fI),hi("DEFGRIDCOLUMN",()=>new CI)});const xI=a({name:"IBizTreeGridExEditColumn",props:{controller:{type:pi,required:!0},row:{type:di,required:!0}},setup(e){const t=r(()=>e.row.data[e.controller.name]),a=B("tree-grid-ex-edit-column"),n=o(),i=e.controller,{gridEditItemProps:s,editorProps:l}=(()=>{switch(i.treeGrid.editShowMode){case"cell":return function(e,t){const a=e.controller,n=r(()=>e.row.editColStates[a.name].disabled),i=r(()=>e.row.editColStates[a.name].readonly),o=r(()=>!!e.row.errors[a.name]),s=r(()=>e.row.editColStates[a.name].editable),l=t=>{e.row.editColStates[a.name].editable=t},c=r(()=>!n.value&&!i.value&&!o.value),d=r(()=>o.value||c.value&&s.value),h=r(()=>!d.value),p=r(()=>!o.value),m=r(()=>c.value&&!s.value),v=r(()=>c.value);let g;return{gridEditItemProps:u({showEditMask:m,stopPropagation:v,onMaskClick:()=>{l(!0),g=le(t,async e=>{l(!1),g.stop()})}}),editorProps:u({autoFocus:p,disabled:!1,readonly:h,onBlur:()=>{ibiz.log.debug("".concat(a.name,"属性编辑器blur事件")),l(!1),"cell-blur"===a.treeGrid.editSaveMode&&a.treeGrid.save(e.row.data)},onFocus:()=>{g&&g.stop(),ibiz.log.debug("".concat(a.name,"属性编辑器focus事件"))}})}}(e,n);case"row":return function(e){const t=e.controller,a=r(()=>e.row.editColStates[t.name].disabled),n=r(()=>e.row.editColStates[t.name].readonly),i=r(()=>e.row.editColStates[t.name].editable),o=r(()=>n.value||!i.value),s=r(()=>i.value&&a.value),l=r(()=>i.value);return{gridEditItemProps:u({stopPropagation:l}),editorProps:u({disabled:s,readonly:o})}}(e);case"all":return function(e){const t=e.controller,a=r(()=>e.row.editColStates[t.name].disabled),n=r(()=>e.row.editColStates[t.name].readonly),i=r(()=>e.controller.treeGrid.state.rowEditOpen),o=r(()=>n.value||!i.value),s=r(()=>i.value&&a.value),l=r(()=>i.value);return{gridEditItemProps:u({stopPropagation:l}),editorProps:u({disabled:s,readonly:o,onBlur:()=>{"cell-blur"===t.treeGrid.editSaveMode&&t.treeGrid.save(e.row.data)}})}}(e);default:throw new Vt(ibiz.i18n.t("control.common.noSupportItem",{name:i.treeGrid.editShowMode}))}})(),c=o(void 0),d=r(()=>{if(l.readonly)return Po(c.value)?i.formatValue(t.value):c.value});return{ns:a,fieldValue:t,componentRef:n,tooltip:d,rowDataChange:async(t,a,n=!1)=>{ibiz.log.debug("".concat(i.name,"值变更"),t),await i.setRowValue(e.row,t,a,n)},onInfoTextChange:e=>{c.value=e},gridEditItemProps:s,editorProps:l}},render(){return n(i("iBizGridEditItem"),{ref:"componentRef",required:!this.controller.nodeEditItem.allowEmpty,overflowMode:this.controller.treeGrid.overflowMode,class:[this.ns,this.ns.m(this.controller.treeGrid.overflowMode)],...this.gridEditItemProps},{default:()=>[this.controller.editorProvider&&l(i(this.controller.editorProvider.gridEditor),{class:this.ns.e("editor"),value:this.fieldValue,data:this.row.data,controller:this.controller.editor,overflowMode:this.controller.treeGrid.overflowMode,onChange:this.rowDataChange,onInfoTextChange:this.onInfoTextChange,title:this.tooltip,...this.editorProps})]})}}),SI=a({name:"IBizTreeGridExUAColumn",props:{controller:{type:mi,required:!0},row:{type:di,required:!0}},setup:e=>({ns:B("tree-grid-ex-ua-column"),onStopPropagation:e=>{e.stopPropagation()},onActionClick:async(t,a)=>{await e.controller.onActionClick(t,e.row,a)}}),render(){var e,t;const a=this.controller.getUIActionGroup(this.row);return n("div",{class:[this.ns.b(),null==(e=this.controller.model.cellSysCss)?void 0:e.cssName],onDblclick:this.onStopPropagation,onClick:this.onStopPropagation},[(null==(t=null==a?void 0:a.uiactionGroupDetails)?void 0:t.length)&&n(i("iBizActionToolbar"),{"action-details":a.uiactionGroupDetails,"actions-state":this.row.columnActionsStates[this.controller.model.codeName],onActionClick:this.onActionClick},null)])}});var EI=Object.defineProperty,DI=(e,t,a)=>(((e,t,a)=>{t in e?EI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class PI{constructor(){DI(this,"component","IBizTreeGridExUAColumn")}async createController(e,t){const a=new mi(e,t);return await a.init(),a}}const kI=ie(SI,function(e){e.component(SI.name,SI),hi("UAGRIDCOLUMN",()=>new PI)}),zI=e("ay",ie(mI,function(e){e.component(mI.name,mI),e.component(xI.name,xI),Ha(qa.TREE_GRIDEX,()=>new bI),e.use(II),e.use(kI)}));function TI(e,t){var a;const n={};return null==(a=e.controlAttributes)||a.forEach(e=>{e.attrName&&e.attrValue&&(n[e.attrName]=Ua.execSingleLine(e.attrValue,{...t}))}),n}const AI=a({name:"IBizTreeGridControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0},rowEditOpen:{type:Boolean,default:void 0},isSimple:{type:Boolean,required:!1},data:{type:Array,required:!1},loadDefault:{type:Boolean,default:!0}},setup(e,{slots:t}){const a=ne((...e)=>new vi(...e));ue(a);const o=B("control-grid"),l=B("control-".concat(a.model.controlType.toLowerCase())),{tableRef:r,onRowClick:d,onDbRowClick:u,onSortChange:h,onSelectionChange:m,handleRowClassName:v,handleHeaderCellClassName:b}=Dp(a),{onPageChange:f,onPageRefresh:w,onPageSizeChange:y}=Pp(a),{tableData:C,defaultSort:I,renderColumns:x,summaryMethod:S,headerDragend:E}=kp(a,e,r),{renderPopover:P}=Ap(r,a),{headerCssVars:k}=zp(r,o),z=e=>{r.value&&a.state.expandRowKeys.length&&(a.state.expandRowKeys.forEach(t=>{const a=e.find(e=>e.srfkey===t);a&&g(()=>{r.value.store.loadOrToggle(a)})}),(()=>{const{expandRowKeys:e,selectedData:t,singleSelect:n}=a.state,i=r.value;if(!i||!t.length)return;const o=i.store.states.treeData.value,s=Object.keys(o).filter(e=>o[e].loaded);if(e.length===s.length&&e.sort().every((e,t)=>e===s.sort()[t])){const e=[],a=t.map(e=>e.srfkey);qt({children:i.store.states.data.value},t=>{a.includes(t.srfkey)&&e.push(t)}),g(()=>{n?i.setCurrentRow(e[0]):i.store.states.selection.value=e})}})())};c(()=>r.value,()=>{z(a.state.treeGirdData)});return{c:a,ns:o,ns2:l,tableRef:r,tableData:C,defaultSort:I,renderColumns:x,headerCssVars:k,loadData:async(e,t,n)=>{const i=a.state.items.map(e=>a.getTreeGridDataItem(e)).filter(t=>e[a.treeGridValueField]===t[a.treeGridParentField]);e.children=i,n(i),z(i)},onRowClick:d,renderColumn:(e,n)=>t[e.id]?D(t,e.id,{model:e,data:a.state.items}):Bp(a,e,x.value,n),onDbRowClick:u,onSortChange:h,onPageChange:f,renderNoData:()=>{var e;const{isLoaded:t}=a.state;if(t){const t=null==(e=a.model.controls)?void 0:e.find(e=>e.name==="".concat(a.model.name,"_quicktoolbar"));if(t)return n(i("iBizToolbarControl"),{modelData:t,context:a.context,params:a.params,class:o.b("quick-toolbar")},null);const r={};return ce(a)&&Object.assign(r,{customRender:()=>n(de,{controller:a},null)}),n(i("iBizNoData"),{text:a.model.emptyText,emptyTextLanguageRes:a.model.emptyTextLanguageRes},"function"==typeof(l=r)||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?r:{default:()=>[r]})}var l;return null},onPageRefresh:w,summaryMethod:S,headerDragend:E,renderPopover:P,onPageSizeChange:y,onSelectionChange:m,handleRowClassName:v,renderBatchToolBar:()=>{var e;const t=null==(e=a.model.controls)?void 0:e.find(e=>e.name==="".concat(a.model.name,"_batchtoolbar"));if(t&&!a.state.singleSelect)return n("div",{class:[o.b("batch-toolbar"),o.is("show",a.showBatchToolbar)]},[n("div",{class:o.b("batch-toolbar-content")},[n("div",{class:o.b("batch-toolbar-text")},[ibiz.i18n.t("control.common.itemsSelected",{length:a.state.selectedData.length})]),n("div",{class:o.b("batch-toolbar-separator")},[p("|")]),n(i("iBizToolbarControl"),{modelData:t,context:a.context,params:a.params,class:o.b("batch-toolbar-items")},null)])])},handleHeaderCellClassName:b}},render(){const e=this.c.state,{hideHeader:t,enablePagingBar:a}=this.c.model;return n(i("iBizControlNavigation"),{controller:this.c},{default:()=>[n(i("iBizControlBase"),{class:[this.ns.b(),this.ns2.b(),this.ns.is("show-header",!t),this.ns.is("enable-page",a),this.ns.is("enable-group",this.c.model.enableGroup),this.ns.is("enable-customized",this.c.model.enableCustomized)],controller:this.c,style:this.headerCssVars},{default:()=>{var o;return[this.c.state.isLoaded&&n(i("el-table"),y({lazy:!0,border:!0,ref:"tableRef","row-key":"srfkey",load:this.loadData,"tooltip-effect":"light","show-header":!t,class:this.ns.e("table"),key:this.c.state.tableKey,onRowClick:this.onRowClick,"default-sort":this.defaultSort,"show-summary":this.c.enableAgg,onSortChange:this.onSortChange,onRowDblclick:this.onDbRowClick,"summary-method":this.summaryMethod,onHeaderDragend:this.headerDragend,"row-class-name":this.handleRowClassName,onSelectionChange:this.onSelectionChange,"highlight-current-row":e.singleSelect,onExpandChange:(e,t)=>this.c.expandChange(e,t),"header-cell-class-name":this.handleHeaderCellClassName,"tree-props":{children:"children",hasChildren:"hasChildren"},data:this.c.state.showTreeGrid?e.treeGirdData:this.tableData},this.$attrs,TI(this.c.model,{...this.c.getEventArgs()})),{empty:this.renderNoData,default:()=>[!e.singleSelect&&n(i("el-table-column"),{width:"55",type:"selection","reserve-selection":!0,"class-name":this.ns.e("selection")},null),e.isCreated&&this.renderColumns.map((e,t)=>this.renderColumn(e,t))],append:()=>this.renderPopover()}),a&&n(i("iBizPagination"),{total:e.total,curPage:e.curPage,size:e.size,totalPages:e.totalPages,onChange:this.onPageChange,onPageSizeChange:this.onPageSizeChange,onPageRefresh:this.onPageRefresh,popperClass:"".concat((null==(o=this.c.model.sysCss)?void 0:o.cssName)||"default","--popper")},null),this.c.model.enableCustomized&&!t&&n("div",{class:this.ns.b("setting-box")},[n(i("iBizGridSetting"),{columnStates:e.columnStates,controller:this.c},null)]),this.renderBatchToolBar()]}})]})}});var OI=Object.defineProperty,MI=(e,t,a)=>(((e,t,a)=>{t in e?OI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class NI{constructor(){MI(this,"component","IBizTreeGridControl")}}const BI=e("az",ie(AI,function(e){e.component(AI.name,AI),Ha(qa.TREEGRID,()=>new NI)})),LI=a({name:"IBizMEditViewPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})}},setup(){const e=ne((...e)=>new gi(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),a=o(null),n=o(0);let i=null;return d(()=>{a.value&&(i=new MutationObserver(()=>{const t=a.value.scrollHeight;t!==n.value&&e.state.isNeedScroll&&(n.value=t,a.value.scrollTop=t)}),i.observe(a.value,{childList:!0,attributes:!0,characterData:!0,subtree:!0}))}),h(()=>{i&&i.disconnect()}),{c:e,ns:t,panelContent:a,handleDelete:t=>{e.handleDelete(t)},onTabChange:t=>{e.state.activeTab=t,e.onTabChange(t)},handleTabDelete:(t,a)=>{a.stopPropagation(),e.handleDelete(t)}}},render(){const e=i("IBizViewShell"),t=()=>n(i("el-tabs"),{class:this.ns.b("tabs"),addable:!0,modelValue:this.c.state.activeTab,"onUpdate:modelValue":e=>this.c.state.activeTab=e,onTabChange:this.onTabChange,onTabAdd:()=>this.c.handleAdd()},{addIcon:()=>n(i("el-button"),null,{default:()=>[n("ion-icon",{name:"add"},null),ibiz.i18n.t("app.add")]}),default:()=>this.c.state.panelUiItems.map(t=>n(i("el-tab-pane"),{key:t.id+t.srfmajortext,name:t.id},{label:()=>n("div",{class:this.ns.b("tab-label")},[n("span",null,[t.srfmajortext]),n("ion-icon",{name:"close-outline",onClick:e=>this.handleTabDelete(t,e)},null)]),default:()=>this.c.state.activeTab===t.id&&l(e,{context:t.context,params:t.params,viewId:this.c.model.embeddedAppViewId,onDataChange:e=>this.c.onViewDataChange(e,t.id),onCreated:e=>this.c.onViewCreated(e,t.id)})}))}),a=()=>this.c.state.panelUiItems.map(t=>n("div",{class:this.ns.b("item"),key:t.id},[[l(e,{context:t.context,params:t.params,viewId:this.c.model.embeddedAppViewId,onDataChange:e=>this.c.onViewDataChange(e,t.id),onCreated:e=>this.c.onViewCreated(e,t.id)}),n("div",{class:this.ns.b("close")},[n("ion-icon",{name:"close-outline",onClick:()=>this.handleDelete(t)},null)])]])),o=()=>{if(this.c.model.embeddedAppViewId)return Object.is(this.c.model.panelStyle,"TAB_TOP")?t():a()};return n(i("iBizControlBase"),{controller:this.c},{default:()=>[n("div",{class:this.ns.b("content"),ref:"panelContent"},[this.c.state.panelUiItems.length>0?o():null])]})}});var RI=Object.defineProperty,_I=(e,t,a)=>(((e,t,a)=>{t in e?RI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class jI{constructor(){_I(this,"component","IBizMEditViewPanelControl")}}const VI=e("aA",ie(LI,function(e){e.component(LI.name,LI),Ha(qa.MULTI_EDIT_VIEWPANEL,()=>new jI)})),FI=a({name:"IBizMapControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},isSimple:{type:Boolean,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new bi(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),a=o(),n=e.model.mapStyle,i=r(()=>({strAreaCode:e.state.strAreaCode,defaultAreaCode:e.state.defaultAreaCode,jsonBaseUrl:e.state.jsonBaseUrl}));return{c:e,ns:t,mapRef:a,mapOpts:i,mapStyle:n}},render(){const{state:e}=this.c;if(!e.isCreated)return;let t;return e.isLoaded&&(t="USER"===this.mapStyle?n(i("iBizMapChartUser"),{areaData:e.areaData,pointData:e.pointData,options:this.mapOpts,class:this.ns.e("map"),controller:this.c},null):n(i("iBizMapChart"),{controller:this.c,areaData:e.areaData,pointData:e.pointData,options:this.mapOpts,class:this.ns.e("map"),onPointClick:e=>{this.c.onPointClick(e)},onAreaClick:e=>{this.c.onAreaClick(e,"","")}},null)),n(i("iBizControlNavigation"),{controller:this.c},{default:()=>[n(i("iBizControlBase"),{controller:this.c},{default:()=>[t,this.c.state.enableNavView&&this.c.state.showNavIcon?this.c.state.showNavView?n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.hiddenNav"),name:"eye-off-outline",onClick:()=>this.c.onShowNavViewChange()},null):n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.showNav"),name:"eye-outline",onClick:()=>this.c.onShowNavViewChange()},null):null]})]})}});var UI=Object.defineProperty,HI=(e,t,a)=>(((e,t,a)=>{t in e?UI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class qI{constructor(){HI(this,"component","IBizMapControl")}}const GI=e("aB",{install(e){e.component(FI.name,FI),Ha(qa.MAP,()=>new qI)}});const WI=a({name:"IBizReportPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},noLoadDefault:{type:Boolean,default:!1}},setup(){const e=ne((...e)=>new fi(...e)),t=B("control-".concat(e.model.controlType.toLowerCase()));return{c:e,ns:t,renderContent:()=>{var t;switch(null==(t=e.model.appDEReport)?void 0:t.reportType){case"USER":return n(i("iBizUserReportPanel"),{controller:e},null);case"USER2":return n(i("iBizUser2ReportPanel"),{controller:e},null);case"SYSBIREPORT":case"DESYSBIREPORTS":case"SYSBICUBE":case"DESYSBICUBES":case"ALLSYSBICUBES":case"SYSBICUBEREPORTS":case"ALLSYSBIREPORTS":return e.isBIReportDesign?n(i("iBizBIReportPanel"),{controller:e},null):n(i("iBizBIReport"),{controller:e},null);default:return n("div",null,[ibiz.i18n.t("control.reportPanel.unrealized")])}}}},render(){let e;var t;if(this.c.state.isCreated)return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(t=e=this.renderContent())||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]})}});var YI=Object.defineProperty,KI=(e,t,a)=>(((e,t,a)=>{t in e?YI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class XI{constructor(){KI(this,"component","IBizReportPanelControl")}}const $I=a({name:"IBizUserReportPanel",props:{controller:{type:Object}},setup(e){const t=e.controller;return{c:t,ns:B("user-report-panel"),generator:t&&t.generator}},render(){if(!this.c)return;const e=this.c.state;return n("div",{class:this.ns.e("container")},[n(i("iBizRelationshipDesign"),{data:e.data,context:this.c.context,params:this.c.params,config:this.generator&&this.generator.config.CONFIG,pluginConfig:this.generator&&this.generator.config.PLUGINCONFIG,nodeLegendConfig:this.generator&&this.generator.config.NODELEGENDCONFIG,edgeLegendConfig:this.generator&&this.generator.config.EDGELEGENDCONFIG,hooks:this.generator&&this.generator.config.HOOKS,showLoading:!0,onInit:e=>{this.generator&&this.generator.init(e)}},null)])}}),JI=ie($I,function(e){e.component($I.name,$I)}),QI=a({name:"IBizUser2ReportPanel",props:{controller:{type:Object}},setup(e){const t=e.controller,a=B("user2-report-panel"),n=t&&t.generator;return{c:t,ns:a,generator:n,handleClick:async e=>{let a=e.target.getAttribute("click"),n=e.target.getAttribute("params");if(!a||!t||!n)return;a=a.replaceAll("`",""),n=n.replaceAll("`",'"');const i=/\(([^)]+)\)/.exec(a);i&&i[1]&&fa.exec(i[1],{context:t.context,params:t.params,data:[JSON.parse(n)],view:t.view},t.context.srfappid)}}},render(){if(!this.c)return;const e=this.c.state;return e.isLoaded?n("div",{class:this.ns.e("container"),innerHTML:e.data,onClick:e=>{this.handleClick(e)}},null):n("div",{class:this.ns.e("empty")},[ibiz.i18n.t("control.common.currentNoData")])}}),ZI=ie(QI,function(e){e.component(QI.name,QI)}),ex=a({name:"IBizBIReportPanel",props:{controller:{type:Object}},setup(e){const t=e.controller;return{c:t,ns:B("bi-report-panel"),generator:t&&t.generator}},render(){if(this.c)return n("div",{class:this.ns.e("container")},[n(i("iBizBIReportContent"),{mode:"CONTENT",context:this.c.context,viewParams:this.c.params,config:this.generator&&this.generator.config,onInit:e=>{this.generator&&this.generator.init(e)},onReportChartChange:e=>{this.generator&&this.generator.init(e)}},null)])}}),tx=ie(ex,function(e){e.component(ex.name,ex)}),ax=a({name:"IBizBINumberReport",props:{model:{type:Object,required:!0},data:{type:Array,required:!0}},setup(e){const t=B("bi-number-report"),a=o({visible:!1,yoy:0,qoq:0,currentTotal:0,yoyTotal:0,qoqTotal:0});(()=>{var t,n;const i=null==(n=null==(t=e.model.measure)?void 0:t.measureTag)?void 0:n.toLowerCase();i&&(e.data.forEach(e=>{e&&"PoP1"===e.srfperiodtype?a.value.qoqTotal=Number.isNaN(Number(e[i]))?0:Number(e[i]):e&&"YoY1"===e.srfperiodtype?a.value.yoyTotal=Number.isNaN(Number(e[i]))?0:Number(e[i]):e&&e[i]&&(a.value.currentTotal=Number.isNaN(Number(e[i]))?0:Number(e[i]))}),a.value.qoq=a.value.currentTotal-a.value.qoqTotal,a.value.yoy=a.value.currentTotal-a.value.yoyTotal)})();const i=r(()=>{const t={},{number_fontstyle:a,number_fontsize:n,number_fontcolor:i}=e.model;return a&&(a.includes("bold")?t.fontWeight="bold":t.fontStyle=a),n&&(t.fontSize="".concat(n,"px")),i&&(t.color=i),t}),s=()=>n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor",style:"transform: rotate(180deg);"},[n("g",{id:"aft1.Base基础/1.icon图标/5.navigation/caret-down","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M5.02 8.233l5.952-5.952a.6.6 0 0 1 1.025.424v5.952a.6.6 0 0 1-.6.6H5.445a.6.6 0 0 1-.424-1.024z",id:"aft路径",transform:"rotate(45 7.997 5.257)"},null)])]);return{ns:t,style:i,uiState:a,handleFormat:t=>{var a;const n=null==(a=e.model.measure)?void 0:a.jsonFormat;return n?ibiz.util.text.format(String(t),n):t},renderUpDownResult:(e,a)=>{if(0===e)return 0===a?n("span",null,[p("-")]):n("div",{class:t.e("up")},[s(),n("span",null,[p("100%")])]);const i=a-e,o=(Math.abs(i)/e*100).toFixed(0);return i<0?n("div",{class:t.e("down")},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aft1.Base基础/1.icon图标/5.navigation/caret-down","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M5.02 8.233l5.952-5.952a.6.6 0 0 1 1.025.424v5.952a.6.6 0 0 1-.6.6H5.445a.6.6 0 0 1-.424-1.024z",id:"aft路径",transform:"rotate(45 7.997 5.257)"},null)])]),n("span",null,[o,p("%")])]):0===i?n("span",null,[p("-")]):n("div",{class:t.e("up")},[s(),n("span",null,[o,p("%")])])}}},render(){var e,t,a,i;return n("div",{class:this.ns.b()},[n("div",{class:this.ns.e("content")},[n("div",{class:this.ns.em("content","number")},[n("span",{class:this.ns.em("content","number-text"),style:this.style},[this.handleFormat(this.uiState.currentTotal)])]),n("div",{class:this.ns.em("content","compare")},[1===this.model.number_yoy_show&&n("div",{class:this.ns.em("content","yoy")},[n("div",{class:this.ns.em("content","compare-number")},[n("span",null,[p("同比")]),n("span",{class:[this.ns.em("content","yoy-yoyTotal"),this.ns.is("show",null==(e=this.model.number_yoy_value)?void 0:e.includes("orgin"))]},[this.uiState.yoyTotal]),n("span",{class:[this.ns.em("content","yoy-value"),this.ns.is("show",null==(t=this.model.number_yoy_value)?void 0:t.includes("difference"))]},[p("("),this.uiState.yoy>0?"+":"",this.uiState.yoy,p(")")])]),n("div",{class:this.ns.em("content","icon")},[this.renderUpDownResult(this.uiState.yoyTotal,this.uiState.currentTotal)])]),1===this.model.number_qoq_show&&n("div",{class:this.ns.em("content","qoq")},[n("div",{class:this.ns.em("content","compare-number")},[n("span",null,[p("环比")]),n("span",{class:[this.ns.em("content","qoq-qoqTotal"),this.ns.is("show",null==(a=this.model.number_qoq_value)?void 0:a.includes("orgin"))]},[this.uiState.qoqTotal]),n("span",{class:[this.ns.em("content","qoq-value"),this.ns.is("show",null==(i=this.model.number_qoq_value)?void 0:i.includes("difference"))]},[p("("),this.uiState.qoq>0?"+":"",this.uiState.qoq,p(")")])]),n("div",{class:this.ns.em("content","icon")},[this.renderUpDownResult(this.uiState.qoqTotal,this.uiState.currentTotal)])])])])])}}),nx=a({name:"IBizBIReport",props:{controller:{type:Object,required:!0}},setup(e){const t=e.controller;return{c:t,ns:B("bi-report"),reportType:t.generator.reportType}},render(){if(this.c.state.biReport)return n("div",{class:this.ns.b()},["NUMBER"===this.reportType?n(ax,{model:this.c.state.biReport.model,data:this.c.state.biReport.data},null):n(i("iBizControlShell"),{isSimple:!0,context:this.c.context,data:this.c.state.biReport.data,modelData:this.c.state.biReport.model,style:this.c.state.biReport.options.vars,class:this.c.state.biReport.options.classList},null)])}}),ix=ie(nx,e=>{e.component(nx.name,nx)}),ox=e("aC",ie(WI,function(e){e.use(ix),e.use(JI),e.use(ZI),e.use(tx),e.component(WI.name,WI),Ha(qa.REPORT_PANEL,()=>new XI)}));const sx=a({name:"IBizGanttControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},loadDefault:{type:Boolean,default:!0},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0}},setup(e){var a;const u=ne((...e)=>new wi(...e)),h=o(),p=o(!1),m=B("control-".concat(u.model.controlType.toLowerCase()));let v=null,b=null;const f=o(!1),w=i("IBizRawItem"),y=i("IBizIcon");let C=!1,x=!1;const S=[],E=null==(a=I())?void 0:a.appContext.app;d(()=>{t.import("@ibiz-template-plugin/gantt").then(e=>{const t=e.default;null==E||E.use(t),p.value=!0}),u.evt.on("onToggleRowExpansion",e=>{const{row:t,expand:a}=e;h.value&&(a?h.value.setExpand(t):h.value.setCollapse(t))})});const D=e=>{const t=document.documentElement;return getComputedStyle(t).getPropertyValue(e)},{UIStore:P}=G(),k=o({});c(()=>P.theme,()=>{var e,t;k.value={primaryColor:(null==(e=u.state.ganttStyle)?void 0:e.primaryColor)||D("--ibiz-color-primary"),textColor:(null==(t=u.state.ganttStyle)?void 0:t.textColor)||D("--ibiz-color-text-3"),headerBgColor:"rgba(".concat(D("--ibiz-grey-1"),", 1)"),bgColor:D("--ibiz-color-bg-1"),weekendColor:D("--ibiz-color-fill-2"),todayColor:D("--ibiz-color-primary-light-active"),borderColor:D("--ibiz-color-tertiary-light-active")}},{immediate:!0});const z=r(()=>!!u.state.isLoaded&&u.state.isLoading),T=r(()=>u.state.isLoaded?u.model.rootVisible?u.state.rootNodes:u.state.rootNodes.reduce((e,t)=>t._children?e.concat(t._children):e,[]):[]),A=r(()=>{const e=[];return u.state.columnStates.forEach(t=>{var a;const n=null==(a=u.columns[t.key])?void 0:a.model;!t.hidden&&n&&e.push(n)}),e}),O=r(()=>ibiz.i18n.getLang().toLowerCase()),M=r(()=>{var e;const t=null==(e=u.controlParams.expandiconcolumn)?void 0:e.toLowerCase(),a=u.state.columnStates.find(e=>t&&e.key.toLowerCase()===t);if(a&&!a.hidden)return a.key});c([()=>h.value,()=>u.state.selectedData],([e,t])=>{!x&&e&&g(()=>{var e,a;u.state.singleSelect?t[0]?null==(e=h.value)||e.setSelected(t[0]):null==(a=h.value)||a.setSelected():(S.length=0,S.push(...t),t.forEach(e=>{var t;return null==(t=h.value)?void 0:t.setChecked(e,!0)}))})});let N=!1;const L=[],R=(e,t)=>{e.forEach(e=>e.parentElement!==t&&(null==t?void 0:t.append(e)))},_=()=>{var e;const t=null==(e=h.value)?void 0:e.getElementRefs().rootRef.value,a=Object.values((()=>{var e;const t={},a=null==(e=document.querySelector(".el-popover"))?void 0:e.parentElement;return a&&Object.assign(t,{elPopover:a}),t})()).filter(e=>e&&e.parentElement===document.body);L.push(...a),R(a,t)},j=(e,t)=>{C||f.value?f.value=!1:(x=!0,u.onTreeNodeClick(e,t),C=!0,setTimeout(()=>{C=!1,x=!1},200))},V=e=>{u.onDbTreeNodeClick(e)};u.evt.on("onNewRow",e=>{var t;const a=e.row.data;null==(t=h.value)||t.setExpand(a)});const F=(e,t,a,i)=>{const o=[];return e.forEach(e=>{var s;if("SEPERATOR"===e.itemType)return void o.push({divided:"self"});const l=i[e.id];if(l&&!l.visible)return;const r={};if(e.showCaption&&e.caption&&(r.label=e.caption),e.sysImage&&e.showIcon&&(r.icon=n(y,{icon:e.sysImage},null)),"DEUIACTION"===e.itemType){r.disabled=l.disabled,r.clickClose=!0;const{uiactionId:n}=e;n&&(r.onClick=()=>{u.doUIAction(n,t,a,e.appId)})}else if("RAWITEM"===e.itemType){const{rawItem:t}=e;t&&(r.label=n(w,{rawItem:e},null))}else"ITEMS"===e.itemType&&(null==(s=e.detoolbarItems)?void 0:s.length)&&(r.children=F(e.detoolbarItems,t,a,i));o.push(r)}),o};let U;u.evt.on("onMounted",()=>{if(Object.values(u.contextMenus).length>0){(()=>t.import("@imengyu/vue3-context-menu"))().then(e=>{U=e.default,U.default&&!U.showContextMenu&&(U=U.default)})}});const H=(e,t)=>l(Z,{data:t,modelData:e,context:u.context,params:u.params}),q=(e,t)=>{var a;if(v)return;const i=N&&(null==(a=h.value)?void 0:a.getElementRefs().rootRef.value),o=(e=>{var t;let a;const n=u.getNodeModel(e);return null==(t=null==n?void 0:n.controlRenders)||t.forEach(e=>{"LAYOUTPANEL"===e.renderType&&"nodelinkrender"!==(e.id||"").split("_")[0]&&(a=e.layoutPanel)}),a})(e._nodeId),s=o?H(o,e._deData):(r=e,n("div",{class:m.em("slider","container")},[n("div",{class:m.em("slider","container-title")},[n("div",{class:"number"},[r._icon&&n(y,{class:"icon",icon:r._icon},null),r._snDataItemValue]),n("div",{class:"caption"},[r._text])])]));var r;v=ibiz.overlay.createPopover(e=>l(s,{modal:e}),void 0,{width:"auto",height:"auto",noArrow:!0,placement:"bottom",modalClass:m.e("slider-popover"),appendTo:i}),null==v||v.present(t.target.children[0])},W=()=>{null==v||v.dismiss(),v=null},Y=()=>n(i("x-gantt-slider"),{"allow-link":!1,"resize-mode":"dragonly",move:u.state.sliderDraggable,"resize-left":u.state.sliderDraggable,"resize-right":u.state.sliderDraggable},{content:({row:e,left:t})=>{const{sysCss:a}=u.getNodeModel(e._nodeId),i=(null==a?void 0:a.cssName)||"",o=t<0?"".concat(-t,"px"):"",s=null==e?void 0:e._text;return n("div",{class:[m.e("slider"),i],onClick:t=>j(e,t),onDblclick:()=>V(e),onContextmenu:t=>(async(e,t)=>{t.stopPropagation(),t.preventDefault();const a=u.getNodeModel(e._nodeId);if(!(null==a?void 0:a.decontextMenu))return;const n=u.contextMenus[a.decontextMenu.id];if(!n.model.detoolbarItems)return;await n.calcButtonState(e._deData||(e.srfkey?e:void 0),a.appDataEntityId,{view:u.view,ctrl:u});const i=n.state.buttonsState,o=F(n.model.detoolbarItems,e,t,i);o.length&&U.showContextMenu({x:t.x,y:t.y,customClass:m.b("context-menu"),items:o})})(e,t),onMouseenter:t=>q(e,t),onMouseleave:W},[n("div",{class:m.em("slider","caption"),style:{marginLeft:o},title:s,innerHTML:s},null)])}}),K=async(e,t,a)=>{var n;const i=(e=>{var t;let a;const n=u.getNodeModel(e);return null==(t=null==n?void 0:n.controlRenders)||t.find(e=>"LAYOUTPANEL"===e.renderType&&"nodelinkrender"===(e.id||"").split("_")[0]&&(a=e.layoutPanel,!0)),a})(e._nodeId);if(b||!i)return;const o=N&&(null==(n=h.value)?void 0:n.getElementRefs().rootRef.value),s=H(i,t);b=ibiz.overlay.createPopover(e=>l(s,{modal:e}),void 0,{width:"auto",height:"auto",noArrow:!0,autoClose:!0,modalClass:m.e("link-path-popover"),appendTo:o}),null==b||b.present(a.currentTarget),await b.onWillDismiss(),b=null};return{c:u,ns:m,ganttRef:h,isInited:p,data:T,locale:O,columns:A,onCheck:(e,t)=>{if(x=!0,e)S.push(t);else{const e=S.findIndex(e=>e._id===t._id);e>-1&&S.splice(e,1)}u.setSelection(S),setTimeout(()=>{x=!1},200)},loading:z,expandColumnName:M,ganttStyle:k,onNodeClick:j,onNodeDbClick:V,onNodeExpand:e=>{u.onExpandChange(e,!0),e&&!e._children&&u.refreshNodeChildren(e)},onNodeCollapse:e=>{u.onExpandChange(e,!1)},renderContent:()=>[...A.value.map((e,t)=>(e=>{const{caption:t,codeName:a,width:o,headerSysCss:s,align:r}=e,c=u.columns[a],d=u.state.columnStates.find(e=>e.key===a);let h=30;return d&&d.columnWidth?h=d.columnWidth>30?d.columnWidth:30:o&&o>30&&(h=o),n(i("x-gantt-column"),{label:t,prop:a,width:h,center:"center"===(null==r?void 0:r.toLowerCase())},{title:()=>n("div",{class:null==s?void 0:s.cssName},[t]),default:({row:e})=>{const t=u.getRowState(e._id);if(t){const e=i(u.providers[a].component);return l(e,{controller:c,row:t,key:t.data._uuid+a})}return null}})})(e)),Y()],renderSetting:()=>!u.controlParams.enablecustomized||u.controlParams.enablecustomized&&"false"===u.controlParams.enablecustomized?null:n("div",{class:m.e("setting"),onClick:()=>(async()=>{let e=0;u.controlParams.limitsize&&(e=Number(u.controlParams.limitsize));const t=await ibiz.overlay.modal(t=>{const a=i("IBizGanttSetting"),n={modal:t,columnStates:u.state.columnStates,limitsize:e};return u.state.mustShowColumns&&(n.mustShowColumns=u.state.mustShowColumns),l(a,n)},void 0,{width:"auto",height:"auto"});t.ok&&t.data&&t.data.length>0&&u.setColumnVisible(t.data)})(),title:Tt(ibiz.i18n.t("control.gantt.hideControl"))},[n("svg",{class:m.em("setting","icon"),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M11.405 13.975l3.398-5.889L11.405 2.2H4.607L1.208 8.087l3.399 5.889h6.798zm1.023-12.4l3.43 5.938c.205.356.205.793 0 1.149l-3.43 5.938a1.147 1.147 0 0 1-.993.574H4.577c-.41 0-.789-.218-.994-.573L.153 8.66a1.153 1.153 0 0 1 0-1.147l3.43-5.94c.205-.356.584-.575.994-.575h6.858c.409 0 .788.22.993.576zM8.006 9.879c.988 0 1.792-.804 1.792-1.792s-.804-1.792-1.792-1.792-1.792.804-1.792 1.792.804 1.792 1.792 1.792zm0-4.784a2.993 2.993 0 1 1-.002 5.985 2.993 2.993 0 0 1 .002-5.985z"},null)])])]),onSliderMove:e=>{var t;const a=null==(t=e[0])?void 0:t.row,n={begin:a._beginDataItemValue?as(a._beginDataItemValue).format("YYYY-MM-DD HH:mm:ss"):void 0,end:a._endDataItemValue?as(a._endDataItemValue).format("YYYY-MM-DD HH:mm:ss"):void 0};f.value=!0,u.modifyNodeTime(a,n)},renderNoData:()=>{const{isLoaded:e}=u.state,t={};return ce(u)&&Object.assign(t,{customRender:()=>n(de,{controller:u},null)}),e&&n(i("iBizNoData"),{text:u.model.emptyText,emptyTextLanguageRes:u.model.emptyTextLanguageRes},"function"==typeof(a=t)||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?t:{default:()=>[t]});var a},allowDrop:(e,t,a)=>{const n=df(e._uuid,u),i=df(t._uuid,u);return u.calcAllowDrop(n,i,a)},allowDrag:e=>{const t=df(e._uuid,u);return u.calcAllowDrag(t)},handleDrop:(e,t,a)=>{const n=df(e._uuid,u),i=df(t._uuid,u),o=uf(a);u.onNodeDrop(n,i,o)},onHeaderDragend:(e,t)=>{const a=u.state.columnStates.filter(e=>{var t;const a=null==(t=u.columns[e.key])?void 0:t.model;return!e.hidden&&a});a&&a[e]&&(a[e].columnWidth=t,u.saveColumnState())},handleClickLink:(e,t)=>{if(e&&t){const a=u.state.links.find(t=>t._uuid===e.id);a&&K(a._fromData,a._deData,t)}},handleFullscreenChange:e=>{N=e,e?_():(()=>{const e=L.filter(e=>!!e);L.length=0,R(e,document.body)})()}}},render(){var e;return this.isInited?b(n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b(),(null==(e=this.data)?void 0:e.length)?"":this.ns.m("empty")]},{default:()=>[n(i("x-gantt"),{ref:"ganttRef","data-id":"_id",data:this.data,links:this.c.state.links,"row-height":46,"expand-all":!1,headerDrag:!0,"start-key":"_beginDataItemValue","end-key":"_endDataItemValue",children:"_children",leaf:"_leaf","expand-key":"_defaultExpand","link-props":{fromKey:"_from",toKey:"_to",linkKey:"_uuid"},locale:this.locale,unit:this.c.state.unit,draggable:{level:"all",draggable:!1,draggableStateKey:"_draggable"},"allow-drop":this.allowDrop,"allow-drag":this.allowDrag,onNodeDrop:this.handleDrop,expandColumnName:this.expandColumnName,showCheckbox:!this.c.state.singleSelect,onNodeExpand:this.onNodeExpand,onNodeCollapse:this.onNodeCollapse,onRowClick:this.onNodeClick,onRowDblClick:this.onNodeDbClick,onRowChecked:this.onCheck,onHeaderDragend:this.onHeaderDragend,onMoveSlider:this.onSliderMove,onClickLink:this.handleClickLink,onFullscreenChange:this.handleFullscreenChange,primaryColor:this.ganttStyle.primaryColor,headerStyle:{textColor:this.ganttStyle.textColor,bgColor:this.ganttStyle.headerBgColor},borderColor:this.ganttStyle.borderColor,enableDateCompletion:!0,bodyStyle:{todayColor:this.ganttStyle.todayColor,weekendColor:this.ganttStyle.headerBgColor,bgColor:this.ganttStyle.bgColor,selectColor:this.ganttStyle.headerBgColor}},{default:()=>this.renderContent(),empty:()=>this.renderNoData(),setting:()=>this.renderSetting()})]}),[[C("loading"),this.loading]]):null}});var lx=Object.defineProperty,rx=(e,t,a)=>(((e,t,a)=>{t in e?lx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class cx{constructor(){rx(this,"component","IBizGanttControl")}}const dx=e("aD",ie(sx,function(e){e.component(sx.name,sx),Ha(qa.GANTT,()=>new cx)}));const ux=a({name:"IBizContextMenuControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},mode:{type:String,default:"buttons"},groupLevelKeys:{type:Object,default:[50]},nodeData:{type:Object,required:!0},nodeModel:{type:Object,required:!0},actionCallBack:{type:Function}},setup(e,{emit:t}){const a=ne((...e)=>new yi(...e)),s=B("context-menu"),l=e.modelData.detoolbarItems,r=o([]),d=o([]),u=o(),{popoverVisible:h,setPopoverVisible:p}=L(u,e=>e.ref),m=o(),{popoverid:v,setPopoverZIndex:g}=fe(),b=e=>{Array.isArray(e)&&e.forEach(e=>{e.capLanguageRes&&e.capLanguageRes.lanResTag&&(e.caption=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption)),e.tooltipLanguageRes&&e.tooltipLanguageRes.lanResTag&&(e.tooltip=ibiz.i18n.t(e.tooltipLanguageRes.lanResTag,e.tooltip)),b(e.detoolbarItems)})};l&&(b(l),l.forEach(t=>{t.actionLevel&&-1===e.groupLevelKeys.findIndex(e=>e===t.actionLevel)?r.value.push(t):d.value.push(t)}));const f=e=>{var t;const{actionLevel:n}=e;return[s.e("item"),"".concat(null==(t=null==e?void 0:e.sysCss)?void 0:t.cssName),s.em("item","level-".concat(n)),s.is("disabled",a.state.buttonsState[e.id].disabled)]};c(()=>e.nodeData,async(t,n)=>{t!==n&&await a.calcButtonState(t._deData||(t.srfkey?t:void 0),e.nodeModel.appDataEntityId)}),a.evt.on("onCreated",async()=>{await a.calcButtonState(e.nodeData._deData||(e.nodeData.srfkey?e.nodeData:void 0),e.nodeModel.appDataEntityId)});const w=async(a,n)=>{n.stopPropagation(),a.uiactionId?(e.actionCallBack&&await e.actionCallBack(a,n),"buttons"===e.mode?p(!1):m.value&&m.value.handleClose(),e.actionCallBack||t("action-click",a,n)):p(!1)},y=e=>n(i("el-divider"),{class:s.e("separator"),"border-style":"double",direction:e?"vertical":"horizontal"},null),C=(e,t=!0)=>a.state.buttonsState[e.id].visible?[e.addSeparator&&y(t),n(i("el-button"),{text:!0,size:"small",title:Tt(e.tooltip),class:f(e),disabled:a.state.buttonsState[e.id].disabled,onClick:t=>w(e,t)},{default:()=>[n("div",{class:s.e("action-content")},[e.showIcon&&e.sysImage&&n("div",{class:s.e("action-content-icon")},[n(i("iBizIcon"),{icon:e.sysImage},null)]),e.showCaption?n("div",{class:s.e("action-content-caption")},[e.caption]):""])]})]:null,I=(e,t=!0)=>e.map(e=>{var o;return(null==(o=a.state.buttonsState[e.id])?void 0:o.visible)?"SEPERATOR"===e.itemType?y(t):"DEUIACTION"===e.itemType?C(e,t):"ITEMS"===e.itemType?((e,t=!0)=>{var o,l,r;const{groupExtractMode:c,uiactionGroup:d}=e;let u=e;if(d&&"ITEM"===c)return null==(o=null==d?void 0:d.uiactionGroupDetails)?void 0:o.map(e=>C(e,t));const h=null==(r=null==(l=e.uiactionGroup)?void 0:l.uiactionGroupDetails)?void 0:r.filter(e=>a.state.buttonsState[e.id].visible);return d&&"ITEMX"===c&&h&&(u=h[0]),u?n(i("el-popover"),{placement:"right-start","popper-class":s.e("popover"),teleported:!1,"popper-options":{modifiers:[{name:"offset",options:{offset:[0,4]}}]}},{reference:()=>n(i("el-button"),{text:!0,size:"small",onClick:e=>w(u,e),title:Tt(u.tooltip),class:f(u),disabled:a.state.buttonsState[u.id].disabled},{default:()=>[n("div",{class:s.e("action-content")},[u.showIcon&&u.sysImage&&n("div",{class:s.e("action-content-icon")},[n(i("iBizIcon"),{icon:u.sysImage},null)]),u.showCaption?n("div",{class:[s.e("action-content-caption"),s.e("action-content-group-caption")]},[u.caption]):"",n("ion-icon",{class:s.e("action-content-group-icon"),name:"chevron-forward-outline"},null)])]}),default:()=>d?null==h?void 0:h.map((e,a)=>"ITEMX"===c&&0===a?null:C(e,t)):I(e.detoolbarItems||[],t)}):void 0})(e,t):null:null});return{c:a,ns:s,popoverid:v,expandDetails:r,groupDetails:d,groupButtonRef:u,dropdownRef:m,popoverVisible:h,handleClick:w,renderActions:I,renderActionButton:C,calcActionItemClass:f,setPopoverZIndex:g,actionDetails:l}},render(){const e=this.actionDetails||[],t=()=>{let e;if(0===this.groupDetails.length)return null;if(!(-1!==this.groupDetails.findIndex(e=>!0===this.c.state.buttonsState[e.id].visible)))return null;const t=-1===this.groupDetails.findIndex(e=>!1===this.c.state.buttonsState[e.id].disabled);return[n(i("el-button"),{size:"small",text:!0,disabled:t,ref:"groupButtonRef",class:[this.ns.e("item"),this.ns.is("expand",this.popoverVisible)],onClick:()=>{this.popoverVisible=!this.popoverVisible}},{icon:()=>n("ion-icon",{class:this.ns.e("icon"),name:"ellipsis-vertical"},null)}),n(i("el-popover"),{placement:"bottom-start","virtual-ref":this.groupButtonRef,visible:this.popoverVisible,"popper-class":[this.popoverid,this.ns.e("popover"),this.ns.e("transfer")],"virtual-triggering":!0,transition:"none","onBefore-enter":()=>this.setPopoverZIndex("--".concat(this.ns.namespace,"-context-menu-transfer-zindex"))},(a=e=this.renderActions(this.groupDetails,!1),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?e:{default:()=>[e]}))];var a};if(this.c.state.buttonsState.visible)return"buttons"===this.mode?n("div",{class:[this.ns.b(),this.ns.m("buttons")],onClick:e=>e.stopPropagation()},[this.renderActions(this.expandDetails),t()]):n(i("el-dropdown"),{ref:"dropdownRef",onCommand:e=>this.handleClick(e,new MouseEvent("click")),"onVisible-change":()=>this.setPopoverZIndex("--".concat(this.ns.namespace,"-context-menu-transfer-zindex")),"popper-class":[this.popoverid,this.ns.e("transfer")],class:[this.ns.b(),this.ns.m("dropdown")]},{default:()=>n("span",{class:this.ns.e("caption")},[n("ion-icon",{class:this.ns.e("caption-icon"),name:"ibiz-arrow-down"},null)]),dropdown:()=>n(i("el-dropdown-menu"),null,{default:()=>[e.length>0&&e.map(e=>{var t;return(null==(t=this.c.state.buttonsState[e.id])?void 0:t.visible)?n(i("el-dropdown-item"),{class:[this.ns.e("item"),this.ns.is("disabled",!1)],title:Tt(e.tooltip),disabled:this.c.state.buttonsState[e.id].disabled,command:e},{default:()=>[e.showIcon&&e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),e.showCaption?e.caption:""]}):null})]})})}});var hx=Object.defineProperty,px=(e,t,a)=>(((e,t,a)=>{t in e?hx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class mx{constructor(){px(this,"component","IBizContextMenuControl")}}const vx=e("aE",ie(ux,function(e){e.component(ux.name,ux),Ha(qa.CONTEXT_MENU,()=>new mx)})),gx=a({name:"IBizViewPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){var e;const t=ne((...e)=>new Ci(...e)),a=B("control-".concat(null==(e=t.model.controlType)?void 0:e.toLowerCase()));return{c:t,ns:a,onCreated:e=>{e&&e.view&&t.setEmbedView(e.view)}}},render(){return n(i("iBizControlBase"),{controller:this.c},{default:()=>[this.c.state.isCreated&&(this.$slots.default?this.$slots.default({context:this.c.context,params:this.c.params,onCreated:this.onCreated}):l(i("IBizViewShell"),{context:this.c.context,params:this.c.params,viewId:this.c.model.embeddedAppDEViewId,onCreated:this.onCreated}))]})}});var bx=Object.defineProperty,fx=(e,t,a)=>(((e,t,a)=>{t in e?bx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class wx{constructor(){fx(this,"component","IBizViewPanelControl")}}const yx=e("aF",ie(gx,function(e){e.component(gx.name,gx),Ha(qa.VIEWPANEL,()=>new wx)}));var Cx=Object.defineProperty,Ix=(e,t,a)=>(((e,t,a)=>{t in e?Cx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class xx extends Ii{constructor(){super(...arguments),Ix(this,"rawItemParams",{})}async onInit(){await super.onInit(),this.handleRawItemParams()}handleRawItemParams(){var e;const t=null==(e=this.model.rawItem)?void 0:e.rawItemParams;Array.isArray(t)&&t.forEach(e=>{const t=e.key,a=e.value;t&&a&&(this.rawItemParams[t.toLowerCase()]=a)})}}const Sx=a({name:"IBizAuthUserinfo",props:{modelData:{type:Object,required:!0},controller:{type:xx,required:!0}},setup(e){var t;const a=B("user-info"),n=e.controller,{srfusername:i=ibiz.i18n.t("panelComponent.authUserinfo.visitor"),loginname:o}=(null==(t=ibiz.appData)?void 0:t.context)||{},s=hs(),l=A("ctx",void 0),c=r(()=>(null==l?void 0:l.view)&&l.view.model.mainMenuAlign||"LEFT"),d=r(()=>{const{strictly:e}=n.rawItemParams;return(!e||"true"!==e)&&n.panel.view.state.isCollapse}),u=r(()=>{const{readonly:e}=n.rawItemParams;return"true"===e});return{ns:a,c:n,onClick:()=>{ibiz.hub.controller.logout()},srfusername:i,loginname:o,router:s,menuAlign:c,isCollapse:d,isReadonly:u}},render(){return n("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("left","LEFT"===this.menuAlign),this.ns.is("top","TOP"===this.menuAlign),this.ns.is("collapse",this.isCollapse),this.ns.is("readonly",this.isReadonly)]},[n(i("el-dropdown"),{disabled:this.isReadonly},{default:()=>n("div",{class:[this.ns.b("info"),this.ns.is("collapse",this.isCollapse)]},[n("div",{class:this.ns.b("label")},[n(i("el-avatar"),{class:this.ns.b("avatar"),src:"./assets/images/user-avatar.png"},null),n("div",{class:[this.ns.b("name"),this.ns.is("collapse",this.isCollapse)]},[n("div",{class:this.ns.be("name","user-name")},[this.srfusername]),"LEFT"===this.menuAlign&&this.loginname&&n("div",{class:this.ns.be("name","person-name")},[this.loginname])])]),n("ion-icon",{class:[this.ns.e("down"),this.ns.is("collapse",this.isCollapse)],name:"chevron-down-outline"},null)]),dropdown:()=>n(i("el-dropdown-menu"),null,{default:()=>[n(i("el-dropdown-item"),null,{default:()=>[n("ion-icon",{name:"log-out-outline",class:this.ns.e("icon")},null),n("span",{onClick:this.onClick},[ibiz.i18n.t("app.logout")])]})]})})])}});var Ex=Object.defineProperty,Dx=(e,t,a)=>(((e,t,a)=>{t in e?Ex(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Px{constructor(){Dx(this,"component","IBizAuthUserinfo")}async createController(e,t,a){const n=new xx(e,t,a);return await n.init(),n}}const kx=e("aH",ie(Sx,function(e){e.component(Sx.name,Sx),xi("RAWITEM_AUTH_USERINFO",()=>new Px)}));var zx=Object.defineProperty,Tx=(e,t,a)=>(((e,t,a)=>{t in e?zx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Ax extends Si{constructor(){super(...arguments),Tx(this,"currentKey",""),Tx(this,"cacheKeys",["RouterShell"]),Tx(this,"navViewMsgs",{}),Tx(this,"operateSort",[])}}e("aI",Ax);var Ox=Object.defineProperty,Mx=(e,t,a)=>(((e,t,a)=>{t in e?Ox(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Nx extends Ii{constructor(){super(...arguments),Mx(this,"viewModals",{}),Mx(this,"router"),Mx(this,"autoGoLast",!0),Mx(this,"noCache",!1),Mx(this,"rawItemParams",{}),Mx(this,"currentKey","")}createState(){var e;return new Ax(null==(e=this.parent)?void 0:e.state)}setRouter(e){this.router=e}get routeDepth(){return this.panel.view.modal.routeDepth}get navTabs(){return this.panel.panelItems.nav_tabs}get navBreadcrumb(){return this.panel.panelItems.nav_breadcrumb}get appmenu(){return this.panel.getController("appmenu")}async onInit(){await super.onInit(),this.handleRawItemParams(),this.noCache="NO_CACHE"===this.rawItemParams.expcache}changeView(e){var t;const a=this.state.navViewMsgs[e];(null==a?void 0:a.fullPath)&&(null==(t=this.router)||t.push(a.fullPath))}onRouteChange({currentKey:e,fullPath:t}){if(this.state.currentKey!==e){if(this.state.cacheKeys.includes(e)&&this.router&&this.router.currentRoute.value.matched.length===this.routeDepth+1){const a=this.state.navViewMsgs[e].fullPath;if(a!==t)return void setTimeout(()=>{this.router.replace({path:a})},0)}this.state.currentKey=e,this.navTabs&&(this.navTabs.state.currentKey=e)}if(""===e)return;this.currentKey=e;const a=this.state.operateSort.indexOf(e);-1!==a&&this.state.operateSort.splice(a,1),this.state.operateSort.push(e),this.state.cacheKeys.includes(e)||(this.state.cacheKeys.push(e),this.routeDepth&&(this.viewModals[e]=new ca({mode:da.ROUTE,viewUsage:1,routeDepth:this.routeDepth+1,dismiss:t=>{this.dismiss(e,t)}}))),this.state.navViewMsgs[e]?this.state.navViewMsgs[e].fullPath=t:(ibiz.log.debug("维护导航视图信息",e,t),this.state.navViewMsgs[e]={key:e,fullPath:t},R.active(e))}onViewCreated(e){const{view:t}=e,a=this.state.currentKey,n="".concat(t.model.codeName,"-").concat(t.id);this.navTabs&&(this.navTabs.updateViewInfo(a,{viewKey:n,caption:t.model.caption,sysImage:t.model.sysImage}),t.evt.on("onViewInfoChange",({caption:e,dataInfo:t})=>{this.navTabs.updateViewInfo(a,{viewKey:n,caption:e,dataInfo:t})})),this.navBreadcrumb&&(this.navBreadcrumb.updateViewInfo(a,{viewName:t.model.codeName,caption:t.model.caption}),t.evt.on("onViewInfoChange",({caption:e,dataInfo:n})=>{this.navBreadcrumb.updateViewInfo(a,{viewName:t.model.codeName,caption:e,dataInfo:n})}),t.evt.on("onActivated",()=>{const e=t.state.srfactiveviewdata,n={viewName:t.model.codeName,caption:t.model.caption};e&&e.srfkey&&Object.assign(n,{dataInfo:e.srfmajortext||""}),this.navBreadcrumb.updateViewInfo(a,n)}))}removeCache(e){const t=this.state.cacheKeys.indexOf(e);if(-1!==t){this.state.cacheKeys.splice(t,1),delete this.viewModals[e],delete this.state.navViewMsgs[e];const a=this.state.operateSort.indexOf(e);-1!==a&&this.state.operateSort.splice(a,1)}}clearCache(){this.state.cacheKeys=[],this.viewModals={}}async closeViewByKeys(e){this.autoGoLast=!1;for(let t=0;t<e.length;t++){const a=e[t],n=this.viewModals[a];await n.dismiss()}this.goLast(),this.autoGoLast=!0}dismiss(e,t){R.close(e,t),this.navTabs&&this.navTabs.removeCache(e),this.navBreadcrumb&&this.navBreadcrumb.removeCache(e),this.removeCache(e),this.autoGoLast&&this.goLast()}goLast(){const e=this.state.operateSort.pop();if(e){if(this.state.currentKey===e)return void this.state.operateSort.push(e);const t=this.state.navViewMsgs[e].fullPath;this.router.push(t)}else{const e=this.router.currentRoute.value,{appContext:t}=e.params;let a="/".concat(t);for(let t=1;t<=this.routeDepth;t++)a+="/".concat(e.params["view".concat(t)],"/").concat(ibiz.env.routePlaceholder);this.router.push(a),ibiz.util.setBrowserTitle("")}}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}}e("aJ",Nx);const Bx=a({name:"IBizNavPosIndex",props:{modelData:{type:Object,required:!0},controller:{type:Nx,required:!0}},setup(e){var t;const a=e.controller,n=B("nav-pos-index"),i=hs();if(a.setRouter(i),a.routeDepth&&(ve(e=>{a.onRouteChange(e)},a.routeDepth+1),"APPINDEXVIEW"===a.panel.view.model.viewType&&!a.navTabs)){const e=us();let n="";null==(t=a.appmenu)||t.evt.on("onClick",()=>{n=e.fullPath}),i.beforeEach((e,t,i)=>{t.fullPath===n&&a.clearCache(),i()})}return{ns:n,onViewCreated:e=>{a.onViewCreated(e)},c:a}},render(){const{state:e,viewModals:t}=this.c,{currentKey:a,cacheKeys:o}=e;if(a)return n("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("no-nav",ibiz.config.view.disableHomeTabs)]},[this.c.routeDepth?n(i("iBizRouterView"),{manualKey:a,modal:t[a],onCreated:this.onViewCreated},{default:({Component:e})=>this.c.noCache?e?n(e,null,null):null:n(i("keepAlive"),{include:o,max:30,isKey:!0},{default:()=>[e&&n(e,null,null)]})}):n("div",null,[ibiz.i18n.t("panelComponent.navPosIndex.noSupportPrompt")])])}});var Lx=Object.defineProperty,Rx=(e,t,a)=>(((e,t,a)=>{t in e?Lx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class _x{constructor(){Rx(this,"component","IBizNavPosIndex")}async createController(e,t,a){const n=new Nx(e,t,a);return await n.init(),n}}const jx=e("aK",ie(Bx,function(e){e.component(Bx.name,Bx),xi("RAWITEM_NAV_POS_INDEX",()=>new _x)}));var Vx=Object.defineProperty,Fx=(e,t,a)=>(((e,t,a)=>{t in e?Vx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Ux extends Si{constructor(){super(...arguments),Fx(this,"currentKey",""),Fx(this,"tabItems",[]),Fx(this,"activeTab","")}}class Hx extends Ii{createState(){var e;return new Ux(null==(e=this.parent)?void 0:e.state)}get routeDepth(){return this.panel.view.modal.routeDepth}get navPos(){return this.panel.panelItems.nav_pos_index}findTabItem(e){return this.state.tabItems.find(t=>t.key===e)}findTabItemByViewKey(e){return this.state.tabItems.find(t=>t.viewKey===e)}onTabClick(e){var t;null==(t=this.navPos)||t.changeView(e)}updateViewInfo(e,t){const a=t.viewKey?this.findTabItemByViewKey(t.viewKey):this.findTabItem(e);a?(Object.assign(a,To(Po,t)),this.refreshItemUI(e)):(this.state.tabItems.push({key:e,...t}),this.state.activeTab=this.state.currentKey)}removeCache(e){const t=this.state.tabItems.findIndex(t=>t.key===e);-1!==t&&this.state.tabItems.splice(t,1)}onTabRemove(e){var t;null==(t=this.navPos)||t.closeViewByKeys([e])}removeOther(){var e;const t=this.state.currentKey,a=[];this.state.tabItems.forEach(e=>{e.key!==t&&a.push(e.key)}),a.length>0&&(null==(e=this.navPos)||e.closeViewByKeys(a))}removeAll(){var e;const t=this.state.tabItems.map(e=>e.key);t.length>0&&(null==(e=this.navPos)||e.closeViewByKeys(t))}refreshItemUI(e){const t={key:"exampleItem",caption:""};this.state.tabItems.push(t),this.state.activeTab=t.key,g(()=>{this.state.tabItems.pop(),this.state.activeTab=e})}}function qx(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Gx=a({name:"IBizNavTabs",props:{modelData:{type:Object,required:!0},controller:{type:Hx,required:!0}},setup(e){const t=B("nav-tabs"),a=e.controller,{state:n}=e.controller,i=[{text:ibiz.i18n.t("panelComponent.navTabs.closeAll"),value:"closeAll"},{text:ibiz.i18n.t("panelComponent.navTabs.closeOther"),value:"closeOther"}];return c(()=>a.state.currentKey,(e,t)=>{if(e!==t){a.findTabItem(e)&&(n.activeTab=e)}}),{ns:t,actions:i,changePage:e=>{n.currentKey!==e.paneName&&a.onTabClick(e.paneName)},onTabRemove:e=>{a.onTabRemove(e)},handleCommand:e=>{"closeAll"===e.value?a.removeAll():"closeOther"===e.value&&a.removeOther()}}},render(){let e;const{state:t}=this.controller;if(!ibiz.config.view.disableHomeTabs)return n("div",{class:[this.ns.b(),...this.controller.containerClass]},[n("div",{class:this.ns.e("left")},[n(i("el-tabs"),{type:"card",modelValue:t.activeTab,"onUpdate:modelValue":e=>t.activeTab=e,closable:!0,onTabClick:this.changePage,onTabRemove:this.onTabRemove},qx(e=t.tabItems.map(e=>{let t=e.caption;return e.dataInfo&&(t+=" - ".concat(e.dataInfo)),n(i("el-tab-pane"),{name:e.key,key:e.key,label:t},{label:()=>n("div",{class:this.ns.em("left","content")},[n(i("iBizIcon"),{class:this.ns.em("left","icon"),icon:e.sysImage},null),n("div",{class:this.ns.em("left","caption"),title:Tt(t)},[t])])})}))?e:{default:()=>[e]})]),n("div",{class:this.ns.e("right")},[n(i("el-dropdown"),{onCommand:this.handleCommand},{default:()=>n(i("el-button"),{size:"small",type:"primary"},{default:()=>[ibiz.i18n.t("app.more"),n("ion-icon",{name:"arrow-down"},null)]}),dropdown:()=>{let e;return n(i("el-dropdown-menu"),null,qx(e=this.actions.map(e=>n(i("el-dropdown-item"),{command:e},{default:()=>[e.text]})))?e:{default:()=>[e]})}})])])}});var Wx=Object.defineProperty,Yx=(e,t,a)=>(((e,t,a)=>{t in e?Wx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Kx{constructor(){Yx(this,"component","IBizNavTabs")}async createController(e,t,a){const n=new Hx(e,t,a);return await n.init(),n}}const Xx=ie(Gx,function(e){e.component(Gx.name,Gx),xi("RAWITEM_NAV_TABS",()=>new Kx)});var $x=Object.defineProperty,Jx=(e,t,a)=>(((e,t,a)=>{t in e?$x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Qx extends Si{constructor(){super(...arguments),Jx(this,"breadcrumbItems",[]),Jx(this,"menuTag","")}}function Zx(e){const t=ibiz.hub.getAppSourceModel(e.srfappid);if(t.getDefaultPSAppIndexView){return t.getDefaultPSAppIndexView.path.split("/").pop().replace(".json","")}return ibiz.hub.defaultAppIndexViewName}function eS(e){const t=ibiz.hub.getApp(e.srfappid).model.caption;return{viewName:Zx(e),fullPath:"/",type:"default",caption:t}}function tS(e){var t;return e.length>1&&(null==(t=e[1].params)?void 0:t.srfmenuitem)||""}async function aS(e,t,a){var n;if(!e)return;const i=t.allAppMenuItems.find(t=>t.id===e);if(i){const t=ibiz.hub.getApp(a.srfappid).getAppFunc(i.appFuncId),o=(null==(n=t.appViewId)?void 0:n.split(".").pop())||"",s=await ibiz.hub.config.view.get(o);return{tag:e,viewName:o,viewConfig:s,appFunc:t,menuItem:i}}}var nS=Object.defineProperty,iS=(e,t,a)=>(((e,t,a)=>{t in e?nS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class oS{constructor(e,t){this.navMode=e,this.context=t,iS(this,"chache",[])}add(e){this.chache.push(e),this.chache=this.chache.filter(e=>!e.isEmbed&&!e.isModal),"store"===this.navMode&&localStorage.setItem("breadcrumb",JSON.stringify(this.chache))}remove(e){const t=this.chache.findIndex(t=>t.fullPath===e);return-1!==t&&this.chache.splice(t,1),ko(this.chache)}removeAfter(e){if(0===this.chache.length)return[];const t=this.chache.findIndex(t=>t.fullPath===e);if(-1!==t){const e=this.chache.splice(t+1,this.chache.length);return"store"===this.navMode&&localStorage.setItem("breadcrumb",JSON.stringify(this.chache)),e}return[]}update(e){if(!this.chache.length&&"store"===this.navMode){const e=localStorage.getItem("breadcrumb");e&&(this.chache=JSON.parse(e))}const t=this.chache.findIndex(t=>t.fullPath&&t.fullPath===e.fullPath||t.viewName.toLowerCase()===e.viewName.toLowerCase());-1!==t&&(Object.assign(this.chache[t],To(Po,e)),this.chache=this.chache.filter(e=>!e.isEmbed&&!e.isModal),"store"===this.navMode&&localStorage.setItem("breadcrumb",JSON.stringify(this.chache)))}getItem(e){const{viewName:t="",fullPath:a=""}=e,n=Zx(this.context);if(t===n)return eS(this.context);const i=this.chache.find(e=>a&&e.fullPath===a||t&&e.viewName.toLowerCase()===t.toLowerCase());return i?ko(i):void 0}getChache(){if("store"===this.navMode){const e=localStorage.getItem("breadcrumb");return e?JSON.parse(e):[]}return"router"===this.navMode?ko(this.chache.filter(e=>!e.isEmbed)):ko(this.chache)}setChache(e){this.chache=ko(e),this.chache=this.chache.filter(e=>!e.isEmbed&&!e.isModal),"store"===this.navMode&&localStorage.setItem("breadcrumb",JSON.stringify(this.chache))}}var sS=Object.defineProperty,lS=(e,t,a)=>(((e,t,a)=>{t in e?sS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class rS extends Ii{constructor(){super(...arguments),lS(this,"separator","/"),lS(this,"navMode","router"),lS(this,"showHome",!0),lS(this,"service"),lS(this,"rawItemParams",{})}createState(){var e;return new Qx(null==(e=this.parent)?void 0:e.state)}get appmenu(){return this.panel.view.getController("appmenu")}get navPos(){return this.panel.panelItems.nav_pos_index}async onInit(){await super.onInit(),this.handleRawItemParams(),this.navMode=this.rawItemParams.navmode||"router",this.separator=this.rawItemParams.separator||"/",this.showHome="true"===this.rawItemParams.showhome,this.service=new oS(this.navMode,this.panel.context)}onCreated(e){"menu"===this.navMode&&this.setBreadcrumbByMenu(e),"store"===this.navMode&&this.setBreadcrumbByStore(e)}onRouteChange(e){if("router"!==this.navMode){if("store"===this.navMode){const{currentRoute:t}=e,a=Y(t.value),n=t.value.fullPath,i=function(e){var t;const{currentRoute:a}=e;return(null==(t=Y(a.value).pathNodes.pop())?void 0:t.viewName)||""}(e),o=tS(a.pathNodes),s=this.service.getItem({fullPath:n,viewName:i}),l=Zx(this.panel.context);if(s){if(s.viewName===l)return this.service.setChache([{...eS(this.panel.context),fullPath:n}]),void this.resetBreadcrumbs();this.service.update({...s,fullPath:n});this.service.removeAfter(n).forEach(e=>{var t;null==(t=this.navPos)||t.removeCache(e.fullPath)}),this.resetBreadcrumbs()}else this.state.menuTag!==o?this.setBreadcrumbByRouter(e):this.service.add({viewName:i,fullPath:n,type:"default"});this.state.menuTag=o}}else this.setBreadcrumbByRouter(e)}resetBreadcrumbs(){this.state.breadcrumbItems=this.service.getChache()}updateViewInfo(e,t){"menu"!==this.navMode&&(this.service.update({fullPath:e,type:"default",...t}),this.resetBreadcrumbs())}removeCache(e){this.service.remove(e)}async setBreadcrumbByRouter(e){const{currentRoute:t}=e,a=Y(t.value),{appContext:n={},pathNodes:i}=a,o=tS(i);let s=!1;const l=await aS(o,this.appmenu,this.panel.context),r=a.pathNodes.map(async(e,t)=>{this.appmenu&&l&&l.viewName===e.viewName&&(s=!0);const a=K({appContext:n,pathNodes:i.slice(0,t+1)}),o={viewName:e.viewName,fullPath:a,type:"default"},r=this.service.getItem({viewName:e.viewName});r&&(r.fullPath||(r.fullPath=a),Object.assign(o,r));const c=function(e,t){if(e===Ei.ROUTE_MODAL_TAG)return{viewName:e,fullPath:"",isModal:!0};const a=ibiz.appUtil.viewCacheCenter.get(e),n=Zx(t);if(a){let e=!1;a.parentView&&a.parentView.model.codeName!==n&&"APPINDEXVIEW"!==a.parentView.model.viewType&&(e=!0);const t=a.state.srfactiveviewdata,i={viewName:a.model.codeName,caption:a.model.caption,isEmbed:e};return t&&t.srfkey&&Object.assign(i,{dataInfo:t.srfmajortext||""}),i}}(e.viewName,this.panel.context);return c&&Object.assign(o,To(Po,c)),o}),c=await Promise.all(r);if(!s&&l){this.state.menuTag=l.tag;const e={viewName:l.viewName,caption:l.menuItem.caption,fullPath:"",type:"menuItem",menuTag:l.tag};c.splice(1,0,e)}this.service.setChache(c),this.resetBreadcrumbs()}setBreadcrumbByMenu(e){const{currentRoute:t}=e;let a;if(Y(t.value).pathNodes.some((e,t)=>{if(0===t)return!1;const{viewName:n}=e,i=(o=n,s=this.panel.context.srfappid,(ibiz.hub.getApp(s).model.appFuncs||[]).find(e=>{const{appViewId:t=""}=e,a=t.split(".").pop();return(null==a?void 0:a.toLowerCase())===o.toLowerCase()}));var o,s;return i&&(a=i),a}),this.appmenu){if(a){const e=function(e,t){const a=[],n=t=>t.find(t=>(t.appFuncId&&t.appFuncId===e.id||!!(t.appMenuItems&&t.appMenuItems.length>0&&n(t.appMenuItems)))&&(a.unshift(t),!0));return n(t),a}(a,this.appmenu.model.appMenuItems||[]),t=e.map(e=>({caption:e.caption,fullPath:"",type:"default",viewName:e.id}));t.unshift(eS(this.panel.context)),this.service.setChache(t),this.resetBreadcrumbs()}else this.service.setChache([eS(this.panel.context)]),this.resetBreadcrumbs();this.appmenu.evt.on("onClick",e=>{const{event:t}=e,a=t.map(e=>{const t=this.appmenu.allAppMenuItems.find(t=>t.id===e);if(t)return{caption:t.caption,fullPath:"",viewName:t.id}});a.unshift(eS(this.panel.context)),this.service.setChache(a),this.resetBreadcrumbs()})}}setBreadcrumbByStore(e){0===this.service.getChache().length?this.setBreadcrumbByRouter(e):this.resetBreadcrumbs(),this.appmenu&&this.appmenu.evt.on("onClick",async e=>{const{eventArg:t}=e,a=await aS(t,this.appmenu,this.panel.context);if(a){const{viewName:e,appFunc:t,viewConfig:n}=a;if("INDEXVIEWTAB"!==t.openMode||n&&n.openMode&&"INDEXVIEWTAB"!==n.openMode)return;const i=this.service.getItem({viewName:e}),o=[];i?o.push(i):o.push({viewName:e,fullPath:"",type:"default"}),o.unshift(eS(this.panel.context)),this.service.setChache(o),this.resetBreadcrumbs()}})}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}openMenuItemView(e,t){this.appmenu&&this.appmenu.onClickMenuItem(e.menuTag,t)}}function cS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const dS=a({name:"IBizNavBreadcrumb",props:{modelData:{type:Object,required:!0},controller:{type:rS,required:!0}},setup(e){const t=B("nav-breadcrumb"),a=e.controller,n=us(),i=hs();a.onCreated(i),c(()=>n.fullPath,()=>{a.onRouteChange(i)},{immediate:!0});const o=r(()=>{const{breadcrumbItems:e}=a.state;let t=e.filter(e=>e.caption);const n=Zx(a.panel.context);return a.showHome||(t=t.filter(e=>e.viewName!==n)),t});return{ns:t,c:a,items:o,onClick:(e,t)=>{"menuItem"===t.type&&(e.stopPropagation(),a.openMenuItemView(t,e))}}},render(){let e;return n("div",{class:[this.ns.b(),...this.controller.containerClass,this.ns.m(this.c.navMode)]},[n(i("el-breadcrumb"),{separator:this.c.separator},cS(e=this.items.map(e=>{let t=e.caption;return e.dataInfo&&(t+=" - ".concat(e.dataInfo)),n(i("el-breadcrumb-item"),{class:this.ns.is("link","menuItem"===e.type),to:e.fullPath,onClick:t=>this.onClick(t,e)},cS(t)?t:{default:()=>[t]})}))?e:{default:()=>[e]})])}});var uS=Object.defineProperty,hS=(e,t,a)=>(((e,t,a)=>{t in e?uS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class pS{constructor(){hS(this,"component","IBizNavBreadcrumb")}async createController(e,t,a){const n=new rS(e,t,a);return await n.init(),n}}const mS=ie(dS,function(e){e.component(dS.name,dS),xi("RAWITEM_NAV_BREADCRUMB",()=>new pS)});var vS=Object.defineProperty,gS=(e,t,a)=>(((e,t,a)=>{t in e?vS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class bS extends Si{constructor(){super(...arguments),gS(this,"loading",!1),gS(this,"uiActionState")}}class fS extends Ii{createState(){var e;return new bS(null==(e=this.parent)?void 0:e.state)}get data(){return this.dataParent.data}constructor(e,t,a){super(e,t,a),this.state.uiActionState=this.createUIActionState()}async onInit(){await super.onInit(),this.updateButtonState()}createUIActionState(){const{uiactionId:e,name:t}=this.model;return new Di(t,this.panel.context.srfappid,e)}async dataChangeNotify(e){await this.updateButtonState(),super.dataChangeNotify(e)}async panelStateNotify(e){await this.updateButtonState(),super.panelStateNotify(e)}async updateButtonState(){await this.state.uiActionState.update(this.panel.context,this.data,this.panel.model.appDataEntityId)}async onActionClick(e){const{uiactionId:t,actionType:a}=this.model;"NONE"!==a&&(e.stopPropagation(),e.preventDefault(),await fa.execAndResolved(t,{context:this.panel.context,params:{panelDataParent:this.dataParent.model.id,...this.panel.params},data:[this.data],view:this.panel.view,event:e,noWaitRoute:!0,ctrl:this.panel},this.model.appId))}calcItemVisible(e){!1!==this.state.uiActionState.visible?super.calcItemVisible(e):this.state.visible=!1}calcItemDisabled(e){!0!==this.state.uiActionState.disabled?super.calcItemDisabled(e):this.state.disabled=!0}}e("aM",fS);const wS=a({name:"IBizPanelButton",props:{modelData:{type:Object,required:!0},controller:{type:fS,required:!0}},setup(e){const t=B("panel-button"),{caption:a,captionItemName:n,renderMode:i,showCaption:s,sysImage:l,codeName:c,itemStyle:d,tooltip:u,buttonCssStyle:h,buttonStyle:p}=e.modelData,{panel:m,state:v}=e.controller,g=o("");h&&(g.value=h);const b=r(()=>n&&m.data?m.data[n.toLowerCase()]:a);let f=!1;Object.is(i,"LINK")&&(f=!0);return{ns:t,isText:f,captionText:b,buttonType:r(()=>Object.is(i,"LINK")?"text":Pl(p)),showCaption:s,sysImage:l,codeName:c,state:v,tooltip:u,handleButtonClick:async t=>{try{v.loading=!0,await e.controller.onActionClick(t),e.controller.onClick(t)}finally{v.loading=!1}},buttonCssStyle:h,tempStyle:g,itemStyle:d}},render(){return this.state.visible?n("div",{class:[this.ns.b(),this.ns.m(this.codeName),this.ns.is("loading",this.state.loading),this.itemStyle&&this.ns.m(this.itemStyle.toLowerCase()),...this.controller.containerClass],style:this.tempStyle},[n(i("el-button"),{type:this.buttonType,text:this.isText,"data-id":this.modelData.id,title:Tt(this.tooltip),disabled:this.state.disabled,loading:this.state.loading,onClick:this.handleButtonClick},{default:()=>[n("div",{class:this.ns.b("content")},[n(i("iBizIcon"),{class:this.ns.bm("content","icon"),icon:this.sysImage},null),this.showCaption?n("span",{class:this.ns.bm("content","caption")},[this.captionText]):""])]})]):null}});var yS=Object.defineProperty,CS=(e,t,a)=>(((e,t,a)=>{t in e?yS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class IS{constructor(){CS(this,"component","IBizPanelButton")}async createController(e,t,a){const n=new fS(e,t,a);return await n.init(),n}}const xS=e("aL",ie(wS,function(e){e.component(wS.name,wS),xi("BUTTON",()=>new IS)}));var SS=Object.defineProperty,ES=(e,t,a)=>(((e,t,a)=>{t in e?SS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class DS extends Si{constructor(){super(...arguments),ES(this,"caption",""),ES(this,"caption2",""),ES(this,"subCaption",""),ES(this,"subCaption2",""),ES(this,"icon",""),ES(this,"icon2",""),ES(this,"isSvg",!1)}}var PS=Object.defineProperty,kS=(e,t,a)=>(((e,t,a)=>{t in e?PS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class zS extends Ii{constructor(){super(...arguments),kS(this,"captionSplit","|"),kS(this,"rawItemParams",{})}createState(){var e;return new DS(null==(e=this.parent)?void 0:e.state)}async onInit(){if(await super.onInit(),this.handleRawItemParams(),"APPINDEXVIEW"!==this.panel.view.model.viewType){const e=this.panel.view.model,t=ibiz.hub.getApp(e.appId);return void(t&&(this.state.caption=ibiz.env.AppTitle||t.model.caption||""))}const e=this.panel.view.model;e.title&&!document.title&&(document.title=e.title),this.model.sysImage&&this.model.sysImage.rawContent?this.state.icon=this.model.sysImage.rawContent:e.appIconPath&&(this.state.icon=e.appIconPath),e.sysImage&&e.sysImage.rawContent?this.state.icon2=e.sysImage.rawContent:e.appIconPath2&&(this.state.icon2=e.appIconPath2),e.caption&&(this.state.caption=e.caption.split(this.captionSplit)[0],this.state.caption2=e.caption.split(this.captionSplit)[1]||e.caption.split(this.captionSplit)[0]),e.subCaption&&(this.state.subCaption=e.subCaption.split(this.captionSplit)[0],this.state.subCaption2=e.subCaption.split(this.captionSplit)[1]||e.subCaption.split(this.captionSplit)[0]),(this.state.icon.endsWith(".svg")||this.state.icon2.endsWith(".svg"))&&(this.state.isSvg=!0);ibiz.hub.getApp().model.appId===e.appId&&ibiz.env.AppTitle&&(this.state.caption=ibiz.env.AppTitle)}handleRawItemParams(){var e;const t=null==(e=this.model.rawItem)?void 0:e.rawItemParams;Array.isArray(t)&&t.forEach(e=>{const t=e.key,a=e.value;t&&a&&(this.rawItemParams[t.toLowerCase()]=a)})}}e("aO",zS);const TS=a({name:"IBizPanelAppTitle",props:{modelData:{type:Object,required:!0},controller:{type:zS,required:!0}},setup(e){const t=B("panel-app-title"),a=e.controller,n=us(),i=hs(),o=A("ctx",void 0),s=r(()=>(null==o?void 0:o.view)&&o.view.model.mainMenuAlign||"LEFT"),l=r(()=>"LEFT"===s.value),c=r(()=>{const{strictly:e}=a.rawItemParams;return(!e||"true"!==e)&&a.panel.view.state.isCollapse}),d=r(()=>"STYLE2"===a.model.itemStyle);return{ns:t,c:a,menuAlign:s,showImgOnly:l,handleClick:async t=>{if("APPLOGINVIEW"!==a.panel.view.model.viewType){if(null==o?void 0:o.view){const e=Y(n);e.pathNodes=e.pathNodes.slice(0,1);const t=K(e);i.push({path:t}),setTimeout(()=>{window.location.reload()})}e.controller.onClick(t)}},isCollapse:c,showIcon:d}},render(){const{icon:e,icon2:t,caption:a,caption2:o,subCaption:s,subCaption2:l}=this.c.state;let r=null,c=null;const d=n("span",{class:this.ns.e("title")},[a]);if("APPINDEXVIEW"!==this.c.panel.view.model.viewType)c=d;else{if("LEFT"===this.menuAlign)if(this.isCollapse){const a=t||e;r=a?n("div",{class:this.ns.e("collpase-icon")},[n(i("iBizIcon"),{class:this.ns.e("logo"),icon:{rawContent:a}},null)]):n("div",{class:this.ns.e("collapse-title")},[n("div",{class:this.ns.e("caption2")},[o]),n("div",{class:this.ns.e("subCaption2")},[l])])}else if(this.showIcon&&e){let t=n("g",{id:"app-caption-panel",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},[n("text",{id:"app-caption","font-family":"Poppins-Bold, Poppins","font-size":"22","font-weight":"bold"},[n("tspan",{x:"0",y:"52"},[a])])]);s&&(t=n("g",{id:"app-caption-panel",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},[n("text",{id:"app-caption","font-family":"Poppins-Bold, Poppins","font-size":"22","font-weight":"bold"},[n("tspan",{x:"8",y:"39"},[a])]),n("text",{id:"app-subcaption","font-family":"PingFangSC-Semibold, PingFang SC","font-size":"14","font-weight":"bold"},[n("tspan",{x:"8",y:"66"},[s])])])),r=n("span",{class:this.ns.e("logo")},[n(i("iBizIcon"),{class:this.ns.em("logo","expand"),icon:{rawContent:e}},null),n("svg",{width:"166px",height:"80px",viewBox:"0 0 166 90",version:"1.1"},[t])])}else r=n("span",{class:this.ns.e("logo")},[n("svg",{width:"256px",height:"80px",viewBox:"0 0 256 80",version:"1.1"},[n("g",{id:"app-caption-panel",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},[n("text",{id:"app-caption","font-family":"Poppins-Bold, Poppins","font-size":"22","font-weight":"bold"},[n("tspan",{x:"20.961",y:"40"},[a])]),n("text",{id:"app-subcaption","font-family":"PingFangSC-Semibold, PingFang SC","font-size":"18","font-weight":"bold"},[n("tspan",{x:"96",y:"69"},[s])])])])]);else"TOP"===this.menuAlign&&e&&(r=n(i("iBizIcon"),{class:this.ns.e("logo"),icon:{rawContent:e}},null));c="LEFT"===this.menuAlign?r:[r,d]}return n("div",{class:[this.ns.b(),this.ns.is("only-img",this.showImgOnly),this.ns.is("collapse",this.isCollapse),this.ns.is("only-title","APPINDEXVIEW"!==this.c.panel.view.model.viewType),...this.controller.containerClass],onClick:this.handleClick},[c])}});var AS=Object.defineProperty,OS=(e,t,a)=>(((e,t,a)=>{t in e?AS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class MS{constructor(){OS(this,"component","IBizPanelAppTitle")}async createController(e,t,a){const n=new zS(e,t,a);return await n.init(),n}}const NS=e("aN",ie(TS,function(e){e.component(TS.name,TS),xi("RAWITEM_APP_APPTITLE",()=>new MS),xi("CTRLPOS_APP_APPTITLE",()=>new MS)}));function BS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const LS=a({name:"IBizPanelAppHeader",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("panel-app-header"),{showCaption:a,titleBarCloseMode:n,id:i}=e.modelData,s=0!==n,l=o(2===n),c=r(()=>"TOP"===e.controller.panel.view.model.mainMenuAlign?"horizontal":"vertical"),d=r(()=>{let n=[t.b(),t.m(c.value),t.m(i)];return!0===a&&(n=[...n,...e.controller.containerClass,a&&t.m("show-header"),s&&t.m("collapsible"),t.is("collapse",s&&l.value),t.is("hidden",!e.controller.state.visible)]),n});return{ns:t,isCollapse:l,classArr:d,changeCollapse:()=>{s&&(l.value=!l.value)}}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},BS(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},BS(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr},[s])}});var RS=Object.defineProperty,_S=(e,t,a)=>(((e,t,a)=>{t in e?RS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class jS{constructor(){_S(this,"component","IBizPanelAppHeader")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const VS=ie(LS,function(e){e.component(LS.name,LS),xi("CONTAINER_AppHeader",()=>new jS)});function FS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const US=a({name:"IBizPanelViewHeader",props:{modelData:{type:Object,required:!0},controller:{type:Pi,required:!0}},setup(e){const t=B("panel-view-header"),{showCaption:a,titleBarCloseMode:n,id:i}=e.modelData,s=0!==n,l=o(2===n),c=r(()=>{let n=[t.b(),t.m(i)];return!0===a&&(n=[...n,...e.controller.containerClass,a&&t.m("show-header"),s&&t.m("collapsible"),t.is("collapse",s&&l.value),t.is("hidden",!e.controller.state.visible)]),n});return{ns:t,isCollapse:l,classArr:c,changeCollapse:()=>{s&&(l.value=!l.value)}}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},FS(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},FS(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return b(n("div",{class:this.classArr},[s]),[[C("loading"),this.controller.state.loading]])}});var HS=Object.defineProperty,qS=(e,t,a)=>(((e,t,a)=>{t in e?HS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class GS{constructor(){qS(this,"component","IBizPanelViewHeader")}async createController(e,t,a){const n=new Pi(e,t,a);return await n.init(),n}}const WS=ie(US,function(e){e.component(US.name,US),xi("CONTAINER_ViewHeader",()=>new GS)});function YS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const KS=a({name:"IBizPanelExpHeader",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("panel-exp-header"),{showCaption:a,titleBarCloseMode:n,id:i}=e.modelData,s=0!==n,l=o(2===n),c=r(()=>{let n=[t.b(),t.m(i)];return!0===a&&(n=[...n,...e.controller.containerClass,a&&t.m("show-header"),s&&t.m("collapsible"),t.is("collapse",s&&l.value),t.is("hidden",!e.controller.state.visible)]),n});return{ns:t,isCollapse:l,classArr:c,changeCollapse:()=>{s&&(l.value=!l.value)}}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},YS(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},YS(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr},[s])}});var XS=Object.defineProperty,$S=(e,t,a)=>(((e,t,a)=>{t in e?XS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class JS{constructor(){$S(this,"component","IBizPanelExpHeader")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const QS=ie(KS,function(e){e.component(KS.name,KS),xi("CONTAINER_Exp_Header",()=>new JS)});function ZS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const eE=a({name:"IBizPanelViewContent",props:{modelData:{type:Object,required:!0},controller:{type:Pi,required:!0}},setup(e){const t=B("panel-view-content"),{showCaption:a,titleBarCloseMode:n,id:i}=e.modelData,s=0!==n,l=o(2===n),c=r(()=>{let n=[t.b(),t.m(i)];const{view:o}=e.controller.panel;return o.model.viewType&&n.push(t.m(o.model.viewType.toLowerCase())),n.push(t.is("no-caption",!o.model.showCaptionBar)),!0===a&&(n=[...n,...e.controller.containerClass,t.is("collapse",s&&l.value),t.is("hidden",!e.controller.state.visible)]),n});return{ns:t,isCollapse:l,classArr:c,changeCollapse:()=>{s&&(l.value=!l.value)}}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{layout:this.modelData.layout},ZS(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},ZS(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return b(n("div",{class:this.classArr},[s]),[[C("loading"),this.controller.state.loading]])}});var tE=Object.defineProperty,aE=(e,t,a)=>(((e,t,a)=>{t in e?tE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class nE{constructor(){aE(this,"component","IBizPanelViewContent")}async createController(e,t,a){const n=new Pi(e,t,a);return await n.init(),n}}const iE=ie(eE,function(e){e.component(eE.name,eE),xi("CONTAINER_VIEWCONTENT",()=>new nE)});var oE=Object.defineProperty,sE=(e,t,a)=>(((e,t,a)=>{t in e?oE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class lE extends ki{constructor(){super(...arguments),sE(this,"activeTab","")}}class rE extends Pi{createState(){var e;return new lE(null==(e=this.parent)?void 0:e.state)}async onInit(){var e;await super.onInit(),this.state.activeTab=(null==(e=this.model.panelTabPages)?void 0:e[0].id)||""}onTabChange(e){this.state.activeTab=e}}const cE=a({name:"IBizPanelTabPanel",props:{modelData:{type:Object,required:!0},controller:{type:rE,required:!0}},setup(e){const t=B("panel-tab-panel"),{state:a}=e.controller,n=r(()=>{const{id:a}=e.modelData,n=[t.b(),t.m(a)];return n.push(...e.controller.containerClass),n});return{ns:t,state:a,classArr:n,onTabClick:(t,a)=>{e.controller.onTabChange(t.props.name)}}},render(){var e,t;let a;if(!this.controller.state.visible)return;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[];return n(i("el-tabs"),{class:[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],"model-value":this.state.activeTab,onTabClick:this.onTabClick},"function"==typeof(l=a=o.map(e=>{const t=e.props;if(!t||!t.controller)return e;const a=t.controller;return a.state.visible||a.state.keepAlive?n(i("el-tab-pane"),{class:this.ns.b("tab-item"),label:a.model.caption,name:a.model.id,lazy:!0},{default:()=>[this.state.activeTab===a.model.id&&e]}):null}))||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?a:{default:()=>[a]});var l}});var dE=Object.defineProperty,uE=(e,t,a)=>(((e,t,a)=>{t in e?dE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class hE{constructor(){uE(this,"component","IBizPanelTabPanel")}async createController(e,t,a){const n=new rE(e,t,a);return await n.init(),n}}const pE=e("aP",ie(cE,function(e){e.component(cE.name,cE),xi("TABPANEL",()=>new hE)}));var mE=Object.defineProperty,vE=(e,t,a)=>(((e,t,a)=>{t in e?mE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class gE extends Pi{constructor(){super(...arguments),vE(this,"splitMode","horizontal"),vE(this,"splitValue",.5),vE(this,"lastSplitValue",null)}initSplitValue(e,t){"PX"===t&&(this.splitValue="".concat(e,"px")),"PERCENTAGE"===t&&(this.splitValue=e/100),this.state.splitValue=this.splitValue}async onInit(){await super.onInit();const{predefinedType:e,panelItems:t}=this.model;if(this.splitMode="CONTAINER_V_SPLIT"===e?"vertical":"horizontal",Array.isArray(t)&&t.length){const e=t[0].layoutPos;if(e){if("horizontal"===this.splitMode){const{width:t,widthMode:a}=e;null!=t&&null!=a&&this.initSplitValue(t,a)}if("vertical"===this.splitMode){const{height:t,heightMode:a}=e;null!=t&&null!=a&&this.initSplitValue(t,a)}}}}hiddenPanel(e){this.state.isHiddenTrigger||(this.lastSplitValue=this.state.splitValue),"left"!==e&&"top"!==e||(this.state.splitValue=0),"right"!==e&&"bottom"!==e||(this.state.splitValue=1),this.state.isHiddenTrigger=!0}showPanel(){null!=this.lastSplitValue&&(this.state.splitValue=this.lastSplitValue,this.state.isHiddenTrigger=!1,this.lastSplitValue=null)}}e("aQ",gE);const bE=a({name:"IBizSplitContainer",props:{modelData:{type:Object,required:!0},controller:{type:gE,required:!0}},setup(e){const t=B("split-container"),{id:a}=e.modelData,n=r(()=>{let n=[t.b(),t.m(a)];return n=[...n,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible),t.is("hidden-trigger",e.controller.state.isHiddenTrigger)],n});return{ns:t,classArr:n}},render(){var e,t;const a=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[];return b(n("div",{class:this.classArr},[n(i("iBizSplit"),{modelValue:this.controller.state.splitValue,"onUpdate:modelValue":e=>this.controller.state.splitValue=e,mode:this.controller.splitMode},{left:()=>a[0],right:()=>a[1],top:()=>a[0],bottom:()=>a[1]})]),[[C("loading"),this.controller.state.loading]])}});var fE=Object.defineProperty,wE=(e,t,a)=>(((e,t,a)=>{t in e?fE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class yE{constructor(){wE(this,"component","IBizSplitContainer")}async createController(e,t,a){const n=new gE(e,t,a);return await n.init(),n}}const CE=e("aR",ie(bE,function(e){e.component(bE.name,bE),xi("CONTAINER_CONTAINER_H_SPLIT",()=>new yE),xi("CONTAINER_CONTAINER_V_SPLIT",()=>new yE)}));var IE=Object.defineProperty,xE=(e,t,a)=>(((e,t,a)=>{t in e?IE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class SE extends Ii{constructor(){super(...arguments),xE(this,"rawItemParams",{})}async onInit(){await super.onInit(),this.handleRawItemParams()}handleRawItemParams(){var e;const t=null==(e=this.model.rawItem)?void 0:e.rawItemParams;Array.isArray(t)&&t.forEach(e=>{const t=e.key,a=e.value;t&&a&&(this.rawItemParams[t.toLowerCase()]=a)})}}const EE=a({name:"IBizPanelIndexViewSearch",props:{modelData:{type:Object,required:!0},controller:{type:SE,required:!0}},setup(e){const t=B("panel-index-view-search"),a=e.controller,n=o(""),i=_o(()=>{},500),s=A("ctx",void 0),l=r(()=>(null==s?void 0:s.view)&&s.view.model.mainMenuAlign||"LEFT"),c=r(()=>{const{strictly:e}=a.rawItemParams;return(!e||"true"!==e)&&a.panel.view.state.isCollapse}),d=r(()=>{const{placeholder:e}=a.rawItemParams;return e||ibiz.i18n.t("component.indexSearch.placeholder")}),u=r(()=>{const{id:a}=e.modelData,n=[t.b(),t.m(a),t.is("collapse",c.value)];return n.push(...e.controller.containerClass),n}),h=async()=>{const t=e.modelData.id,i=a.panel.view.getController("appmenu");if(i){const e=i.allAppMenuItems.find(e=>e.id===t);if(e){const t=a.panel.context.clone(),i=a.panel.params;t.srfappid=e.appId||ibiz.env.appId,await ibiz.commands.execute(zi.TAG,e.appFuncId,t,{...i,srfquery:n.value},{})}}};return{ns:t,classArr:u,isCollapse:c,curPlaceholder:d,onInput:e=>{n.value=e,i()},onSearch:h,c:a,query:n,menuAlign:l,onEnter:e=>{"Enter"===e.key&&h()}}},render(){if(this.controller.state.visible)return n("div",{class:this.classArr},["LEFT"===this.menuAlign&&!this.isCollapse&&n(i("el-input"),{"model-value":this.query,class:this.ns.b("search"),placeholder:this.curPlaceholder,onInput:this.onInput,onKeyup:this.onEnter},{prefix:()=>n("ion-icon",{class:this.ns.e("search-icon"),name:"search"},null)})])}});var DE=Object.defineProperty,PE=(e,t,a)=>(((e,t,a)=>{t in e?DE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class kE{constructor(){PE(this,"component","IBizPanelIndexViewSearch")}async createController(e,t,a){const n=new SE(e,t,a);return await n.init(),n}}const zE=e("aS",ie(EE,function(e){e.component(EE.name,EE),xi("RAWITEM_INDEX_VIEW_SEARCH",()=>new kE)}));class TE extends Si{}class AE extends Ii{createState(){var e;return new TE(null==(e=this.parent)?void 0:e.state)}}function OE(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const ME=a({name:"IBizPanelAppLoginView",props:{modelData:{type:Object,required:!0},controller:{type:AE,required:!0}},setup(e){const t=B("panel-app-login-view"),{id:a}=e.modelData,n=r(()=>{let n=[t.b(),t.m(a)];return n=[...n,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible)],n}),i=r(()=>{let e={};const a=window.location.pathname;if(a){const t=a.lastIndexOf("/");if(-1!==t){const n=a.substring(0,t+1);e={"header-url":"url('".concat(n,"assets/images/login-header.png')"),"avatar-url":"url('".concat(n,"assets/images/login-avatar.png')")}}}return t.cssVarBlock(e)});return{ns:t,classArr:n,cssVars:i}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},OE(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},OE(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr,style:this.cssVars,onClick:e=>this.controller.onClick(e)},[this.controller.model.cssStyle?n("style",{type:"text/css"},[this.controller.model.cssStyle]):null,s])}});var NE=Object.defineProperty,BE=(e,t,a)=>(((e,t,a)=>{t in e?NE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class LE{constructor(){BE(this,"component","IBizPanelAppLoginView")}async createController(e,t,a){const n=new AE(e,t,a);return await n.init(),n}}const RE=ie(ME,function(e){e.component(ME.name,ME),xi("CONTAINER_APPLOGINVIEW",()=>new LE)});class _E extends Si{}class jE extends Ii{createState(){var e;return new _E(null==(e=this.parent)?void 0:e.state)}}const VE=a({name:"IBizPanelRememberMe",props:{modelData:{type:Object,required:!0},controller:{type:jE,required:!0}},setup(e){const t=B("panel-remember-me"),{id:a}=e.modelData,n=e.controller,i=r(()=>{let n=[t.b(),t.m(a)];return n=[...n,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible)],n}),o=r({get:()=>n.panel.state.data.isRemember,set:e=>{n.panel.state.data.isRemember=e}});return{ns:t,classArr:i,c:n,isRemember:o}},render(){return n("div",{class:this.classArr},[n(i("el-checkbox"),{modelValue:this.isRemember,"onUpdate:modelValue":e=>this.isRemember=e,label:ibiz.i18n.t("app.rememberMe")},null)])}});var FE=Object.defineProperty,UE=(e,t,a)=>(((e,t,a)=>{t in e?FE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class HE{constructor(){UE(this,"component","IBizPanelRememberMe")}async createController(e,t,a){const n=new jE(e,t,a);return await n.init(),n}}const qE=ie(VE,function(e){e.component(VE.name,VE),xi("CONTAINER_REMEMBER_ME",()=>new HE),xi("FIELD_AUTH_REMEMBERME",()=>new HE)});function GE(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const WE=a({name:"IBizIndexActions",props:{modelData:{type:Object,required:!0},controller:{type:we,required:!0}},setup(e){const t=B("index-actions"),{id:a}=e.modelData,n=r(()=>e.controller.panel.view.state.isCollapse),i=r(()=>{let i=[t.b(),t.m(a)];return i=[...i,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible),t.is("collapse",n.value)],i});return{ns:t,classArr:i,isCollapse:n}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},GE(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},GE(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr,onClick:e=>this.controller.onClick(e)},[this.controller.model.cssStyle?n("style",{type:"text/css"},[this.controller.model.cssStyle]):null,s])}});var YE=Object.defineProperty,KE=(e,t,a)=>(((e,t,a)=>{t in e?YE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class XE{constructor(){KE(this,"component","IBizIndexActions")}async createController(e,t,a){const n=new we(e,t,a);return await n.init(),n}}const $E=e("aT",ie(WE,function(e){e.component(WE.name,WE),xi("CONTAINER_INDEX_ACTIONS",()=>new XE)})),JE={10:"未开始",20:"执行中",30:"已执行",40:"执行失败"},QE={10:"info",20:"",30:"success",40:"danger"},ZE=a({name:"IBizAsyncAction",props:{action:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0},setup(e,{emit:t}){const a=B("async-action"),n=r(()=>qo(e.action.actionresult)),i=r(()=>!e.action.actiontype||n.value);return{ns:a,showErrorInfo:r(()=>e.action.actiontype&&Lo(e.action.actionresult)),clickable:i,actionstate:r(()=>{if(n.value){const t=e.action.actionresult;return t.total-t.success>0?40:30}return e.action.actionstate}),progressText:r(()=>e.action.completionrate?"(".concat(e.action.completionrate,"%)"):""),onClick:async a=>{if(e.provider.onClick){await e.provider.onClick(e.action,a)&&t("close")}}}},render(){const{asyncacitonname:e,begintime:t,stepinfo:a="进行中"}=this.action;return n("div",{class:[this.ns.b(),this.clickable?this.ns.m("clickable"):""],onClick:this.onClick},[n("div",{class:this.ns.b("left")},[n("ion-icon",{name:"list-outline"},null)]),n("div",{class:this.ns.b("center")},[n("div",{class:this.ns.e("caption")},[e]),this.showErrorInfo&&n("div",{title:Tt(this.action.actionresult),class:this.ns.e("error-info")},[this.action.actionresult]),20===this.actionstate?n("div",{class:this.ns.e("progress")},[a,this.progressText]):n("div",{class:this.ns.e("begin-time")},[t])]),n("div",{class:this.ns.b("right")},[n(i("el-tag"),{type:QE[this.actionstate]},{default:()=>[JE[this.actionstate]]})]),20===this.actionstate&&!!this.action.completionrate&&n("div",{class:this.ns.b("loading-warp")},[n("div",{class:this.ns.be("loading-warp","inner"),style:"width:".concat(this.action.completionrate,"%;")},null)])])}}),eD=a({name:"IBizAsyncActionTab",props:{controller:{type:Object,required:!0},showPopover:{type:Boolean,required:!0}},emits:{hiddenPopover:()=>!0},setup(e,{emit:t}){const a=B("async-action-tab"),n=e.controller,i=o([]),s=()=>{i.value=Yt(n.actions)};s(),n.evt.on("dataChange",s);return{ns:a,allItems:i,hiddenPopover:()=>{t("hiddenPopover")}}},render(){return n("div",{class:[this.ns.b()]},[this.allItems.length>0&&this.allItems.map(e=>{let t;try{t=va(e)}catch(e){ibiz.log.error(e)}return t?t.render({class:this.ns.e("item"),action:e,onClose:this.hiddenPopover}):n("div",{class:this.ns.e("item")},[ibiz.i18n.t("panelComponent.userMessage.asyncActionTab.noSupportType",{type:e.actiontype})])}),0===this.allItems.length&&n("div",{class:this.ns.e("nodata")},[ibiz.i18n.t("panelComponent.userMessage.asyncActionTab.noAsyncAction")])])}});function tD(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const aD=a({name:"IBizAsyncActionPreview",props:{asyncAction:{type:Object,required:!0},modal:{type:Object,required:!0}},setup(e){const t=B("async-action-preview"),a=u({title:"",beginTime:"",endTime:"",total:0,success:0,error:0,errorDetails:[{row:0,reason:""}],errorFileUrl:""});if(a.title=ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.importDetailPrompt",{name:e.asyncAction.asyncacitonname}),a.beginTime=e.asyncAction.begintime,a.endTime=e.asyncAction.endtime,e.asyncAction.actionresult){let t=e.asyncAction.actionresult;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){throw new Vt(ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.parseImportInfoErr"))}a.total=t.total||0,a.success=t.success||0,a.error=a.total-a.success,t.errorinfo?a.errorDetails=Object.keys(t.errorinfo).map(e=>({row:Number(e),reason:t.errorinfo[e].errorInfo})):a.errorDetails=[],t.errorfile&&(a.errorFileUrl="".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl,"/").concat(t.errorfile.folder,"/").concat(t.errorfile.fileid).replace("/{cat}",""))}return{ns:t,info:a,onClose:()=>{e.modal.dismiss()},onDownLoad:()=>{var e;e={url:a.errorFileUrl,name:a.title},ibiz.net.request(e.url,{method:"get",responseType:"blob",baseURL:""}).then(t=>{let a=ns.parse(t.headers["content-disposition"],{delimiter:";"}).filename;if(a&&(a.startsWith('"')&&a.endsWith('"')&&(a=a.substring(1,a.length-1)),e.name+=".".concat(a.split(".")[1])),200!==t.status)throw new Vt(ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.downloadFailedErr"));if(!t.data)throw new Vt(ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.noExistentErr"));{const a=e.name;Kt(t.data,a)}})}}},render(){let e,t;return n("div",{class:[this.ns.b()]},[n("div",{class:this.ns.b("header")},[n("div",{class:this.ns.e("title")},[this.info.title]),n("div",{class:this.ns.b("toolbar")},[this.info.errorFileUrl&&n(i("el-button"),{onClick:this.onDownLoad},tD(e=ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.downloadErrFile"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:this.onClose},tD(t=ibiz.i18n.t("app.close"))?t:{default:()=>[t]})])]),n("div",{class:this.ns.b("time")},[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.importTime")},{default:()=>[this.info.beginTime,p(" ~ "),this.info.endTime]})]),n(i("el-row"),{class:this.ns.b("count")},{default:()=>[n(i("el-col"),{span:8},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.importTotal")},{default:()=>[this.info.total]})]}),n(i("el-col"),{span:8},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.successImport")},{default:()=>[this.info.success]})]}),n(i("el-col"),{span:8},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.ImportFailed")},{default:()=>[this.info.error]})]})]}),this.info.errorDetails.length>0&&n("div",{class:this.ns.b("detail")},[this.info.errorDetails.map(e=>n("div",{class:this.ns.b("detail-item")},[n("div",{class:this.ns.be("detail-item","index")},[e.row]),n("div",{class:this.ns.be("detail-item","error")},[n("div",{class:this.ns.be("detail-item","error-title")},[ibiz.i18n.t("app.error")]),n("div",{class:this.ns.be("detail-item","error-reason")},[e.reason])])]))])])}});const nD=a({name:"IBizAsyncActionResult",props:{asyncAction:{type:Object,required:!0},modal:{type:Object,required:!0}},setup(e){const t=B("async-action-result"),a=u({title:e.asyncAction.asyncacitonname,beginTime:e.asyncAction.begintime,endTime:e.asyncAction.endtime,actionState:[30,40].includes(e.asyncAction.actionstate),message:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.noMessage"),isJSON:!1});qo(e.asyncAction.actionresult)?(a.message=JSON.stringify(e.asyncAction.actionresult,null,2),a.isJSON=!0):e.asyncAction.actionresult&&(a.message="".concat(e.asyncAction.actionresult));const i=(e,a)=>{if(null===e)return n("span",{class:t.be("content","json-null")},[p("null")]);if("boolean"==typeof e)return n("span",{class:t.be("content","json-boolean")},[e.toString()]);if("number"==typeof e)return n("span",{class:t.be("content","json-number")},[e.toString()]);if("string"==typeof e)return n("span",{class:t.be("content","json-string")},[p('"'),e,p('"')]);if(Array.isArray(e)){if(0===e.length)return n("span",null,[p("[]")]);const o=e.map((o,s)=>n("div",{key:s,class:t.be("content","json-indent"),style:{paddingLeft:"".concat(20*(a+1),"px")}},[i(o,a+1),s<e.length-1?",":""]));return n("div",{class:t.be("content","json-array")},[n("span",null,[p("[")]),o,n("div",{style:{paddingLeft:"".concat(20*a,"px")}},null),n("span",{style:{paddingLeft:"".concat(20*a,"px")}},[p("]")])])}const o=Object.keys(e);if(0===o.length)return n("span",null,["{}"]);const s=o.map((s,l)=>n("div",{key:s,class:t.be("content","json-indent"),style:{paddingLeft:"".concat(20*(a+1),"px")}},[n("span",{class:t.be("content","json-key")},[p('"'),s,p('"')]),p(":")," ",i(e[s],a+1),l<o.length-1?",":""]));return n("div",{class:t.be("content","json-object")},[n("span",null,["{"]),s,n("div",{style:{paddingLeft:"".concat(20*a,"px")}},null),n("span",{style:{paddingLeft:"".concat(20*a,"px")}},["}"])])};return{ns:t,info:a,onClose:()=>{e.modal.dismiss()},renderJSON:e=>{try{const t=JSON.parse(e);return i(t,0)}catch(t){return n("span",null,[e])}}}},render(){let e;return n("div",{class:[this.ns.b()]},[n("div",{class:this.ns.b("header")},[n("div",{class:this.ns.e("title")},[this.info.title]),n("div",{class:this.ns.b("toolbar")},[n(i("el-button"),{onClick:this.onClose},(t=e=ibiz.i18n.t("app.close"),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))])]),n("div",{class:this.ns.b("content")},[n(i("el-row"),null,{default:()=>[n(i("el-col"),{span:12},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.taskName")},{default:()=>[this.info.title]})]}),n(i("el-col"),{span:12},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.taskState")},{default:()=>[this.info.actionState?ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.finished"):ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.processing")]})]}),n(i("el-col"),{span:12},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.beginTime")},{default:()=>[this.info.beginTime]})]}),n(i("el-col"),{span:12},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.endTime")},{default:()=>[this.info.endTime]})]}),n(i("el-col"),{span:24},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.exeResult")},{default:()=>[n("div",{class:this.ns.be("content","json-container")},[this.renderJSON(this.info.message)])]})]})]})])]);var t}});function iD(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const oD=a({name:"IBizAsyncDataExport",props:{asyncAction:{type:Object,required:!0},modal:{type:Object,required:!0}},setup(e){const t=B("async-data-export"),a=u({title:"",beginTime:"",endTime:"",fileUrl:"",fileName:"",isFinish:!1});if(a.title=ibiz.i18n.t("panelComponent.userMessage.asyncDataExport.exportDetailPrompt",{name:e.asyncAction.asyncacitonname}),a.beginTime=e.asyncAction.begintime,a.endTime=e.asyncAction.endtime,e.asyncAction.asyncresultdownloadurl){const t=JSON.parse(e.asyncAction.asyncresultdownloadurl);a.fileUrl="".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl,"/").concat(t.folder,"/").concat(t.fileid).replace("/{cat}",""),a.fileName=t.filename}[30,40].includes(e.asyncAction.actionstate)?a.isFinish=!0:a.isFinish=!1;return{ns:t,info:a,onClose:()=>{e.modal.dismiss()},onDownLoad:()=>{ibiz.util.file.fileDownload(a.fileUrl,a.fileName,void 0,!1)}}},render(){let e,t;return n("div",{class:[this.ns.b()]},[n("div",{class:this.ns.b("header")},[n("div",{class:this.ns.e("title")},[this.info.title]),n("div",{class:this.ns.b("toolbar")},[this.info.fileUrl&&n(i("el-button"),{onClick:this.onDownLoad},iD(e=ibiz.i18n.t("panelComponent.userMessage.asyncDataExport.downloadFile"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:this.onClose},iD(t=ibiz.i18n.t("app.close"))?t:{default:()=>[t]})])]),n("div",{class:this.ns.b("time")},[this.info.isFinish?n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncDataExport.excuteTime")},{default:()=>[this.info.beginTime,p(" ~ "),this.info.endTime]}):n("span",{class:this.ns.be("time","executing")},[ibiz.i18n.t("panelComponent.userMessage.asyncDataExport.executing")])])])}});var sD=Object.defineProperty,lD=(e,t,a)=>(((e,t,a)=>{t in e?sD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class rD{constructor(){lD(this,"component",ZE)}render(e){return l(this.component,{provider:this,...e})}async onClick(e,t){return Fo(e.actiontype)?(ibiz.overlay.modal(t=>l(nD,{asyncAction:e,modal:t}),{},{width:"80%",height:"80%"}),!0):"DEEXPORTDATA"===e.actiontype?(ibiz.overlay.modal(t=>l(oD,{asyncAction:e,modal:t}),{},{width:"80%",height:"80%"}),!0):!!qo(e.actionresult)&&(ibiz.overlay.modal(t=>l(aD,{asyncAction:e,modal:t}),{},{width:"80%",height:"80%"}),!0)}}const cD={READ:"已阅读",SENT:"已发送",RECEIVED:"已接收",REPLIED:"已回复",SEND_FAILED:"发送失败",NOT_SENT:"未发送",DELETED:"已删除"},dD={READ:"",SENT:"success",RECEIVED:"success",REPLIED:"warning",SEND_FAILED:"danger",NOT_SENT:"info",DELETED:"info"},uD=a({name:"IBizInternalMessageDefault",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0,read:()=>!0},setup:()=>({ns:B("internal-message")}),render(){const{title:e,create_time:t,content:a,status:o}=this.message,s=n("div",{class:this.ns.e("short-content")},[a]);return n(i("iBizInternalMessageContainer"),{class:[this.ns.b()],message:this.message,provider:this.provider,onRead:()=>this.$emit("read"),onClose:()=>this.$emit("close")},{default:()=>[n("div",{class:this.ns.b("left")},[n("ion-icon",{name:"list-outline"},null)]),n("div",{class:this.ns.b("center")},[n("div",{class:this.ns.e("caption")},[n(i("el-tag"),{class:this.ns.e("status"),type:dD[o]},{default:()=>[cD[o]]}),e]),s,n("div",{class:this.ns.e("create-time")},[t])])]})}});var hD=Object.defineProperty,pD=(e,t,a)=>(((e,t,a)=>{t in e?hD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class mD{constructor(){pD(this,"component",uD),pD(this,"router",hs())}render(e){return l(this.component,{provider:this,...e})}async onClick(e,t){const a=ibiz.env.isMob?e.mobile_url:e.url;return this.openViewByUrl(a)}async openRedirectView(e,t){await ibiz.hub.notice.internalMessage.markRead(e),this.openViewByUrl(t)}openViewByUrl(e){if(e){if(e.startsWith("view://")){const{viewId:t,context:a,params:n}=Ti(e);a.srfkeepnull=!0,ibiz.commands.execute(Ai.TAG,t,Lt.create(a),n)}else if(e.startsWith("route://")){const t="/".concat(e.split("route://")[1]);this.router.push(t)}return!0}return!1}}const vD=a({name:"IBizInternalMessageJSON",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0,read:()=>!0},setup(e,{emit:t}){const a=B("internal-message-json"),n=r(()=>e.message.content&&"JSON"===e.message.content_type?JSON.parse(e.message.content):null),i=r(()=>{var t;if(e.message.enableLink){return(ibiz.env.isMob?e.message.mobile_url:e.message.url)||(null==(t=n.value)?void 0:t.redirecturl)}}),o=r(()=>{var e;return null==(e=n.value)?void 0:e.todoid}),s=r(()=>{if(i.value)return[{icon:"link-outline",key:"openRedirectView",tooltip:ibiz.i18n.t("panelComponent.userMessage.internalMessageJson.jumpToView")}]});return{ns:a,redirectUrl:i,isWFMessage:o,jsonContent:n,toolbarItems:s,onToolbarClick:a=>{"openRedirectView"===a&&(e.provider.openRedirectView(e.message,i.value),t("close"))}}},render(){var e,t;let a=null;return a=(null==(e=this.jsonContent)?void 0:e.html)?n("div",{class:this.ns.e("content"),innerHTML:this.jsonContent.html},null):(null==(t=this.jsonContent)?void 0:t.todoid)?n("div",{class:this.ns.e("content")},[n("div",{class:this.ns.e("card")},[n("div",{class:this.ns.em("card","avatar")},[this.jsonContent.createmanname.substring(0,2)]),n("div",{class:this.ns.em("card","content")},[n("div",{class:[this.ns.e("todo"),this.ns.em("todo","header")]},[n("span",{class:this.ns.em("todo","person")},[this.jsonContent.createmanname]),n("span",{class:this.ns.em("todo","action")},["ACTIVE"===this.jsonContent.todostate?ibiz.i18n.t("panelComponent.userMessage.internalMessageJson.todo"):ibiz.i18n.t("panelComponent.userMessage.internalMessageJson.done")])]),n("div",{class:[this.ns.e("todo"),this.ns.em("todo","content")]},[n("span",{class:this.ns.em("todo","title")},[this.jsonContent.title]),n("span",{class:this.ns.em("todo","step")},[this.jsonContent.param05]),n(i("el-tag"),{class:this.ns.em("todo","state")},{default:()=>[this.jsonContent.todostatetext]})]),n("div",{class:[this.ns.e("todo"),this.ns.em("todo","footer")]},[n("span",{class:this.ns.em("todo","date")},["ACTIVE"===this.jsonContent.todostate?this.jsonContent.createdate:this.jsonContent.processdate]),n("span",{class:this.ns.em("todo","separate")},[p("·")]),n("span",{class:this.ns.em("todo","name")},[this.jsonContent.param04])])])])]):n("div",{class:this.ns.e("content")},[ibiz.i18n.t("panelComponent.userMessage.internalMessageJson.missingHtml")]),n(i("iBizInternalMessageContainer"),{class:[this.ns.b()],message:this.message,provider:this.provider,clickable:!!this.redirectUrl||!!this.isWFMessage&&!!this.message.enableLink,isUnread:!!this.message.enableLink,toolbarItems:this.toolbarItems,onToolbarClick:this.onToolbarClick,onRead:()=>this.$emit("read"),onClose:()=>this.$emit("close")},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}}),gD=a({name:"IBizInternalMessageContainer",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0},clickable:{type:Boolean,default:void 0},isUnread:{type:Boolean,default:!0},toolbarItems:{type:Array,default:()=>[]}},emits:{toolbarClick:e=>!0,close:()=>!0,read:()=>!0},setup(e,{emit:t}){const a=B("internal-message-container"),n=r(()=>e.isUnread&&"RECEIVED"===e.message.status),i=r(()=>{const t=[...e.toolbarItems];return n.value&&t.push({key:"read",icon:"checkmark-done-outline",tooltip:ibiz.i18n.t("panelComponent.userMessage.internalMessageContainer.markAsRead")}),t}),o=r(()=>void 0===e.clickable?ibiz.env.isMob?!!e.message.mobile_url:!!e.message.url:e.clickable);return{ns:a,isUnread:n,isClickable:o,finalToolbarItems:i,onClick:async a=>{if(o.value&&e.provider.onClick){await e.provider.onClick(e.message,a)&&t("close")}t("read")},onToolbarClick:(e,a)=>{e.stopPropagation(),"read"===a?t("read"):t("toolbarClick",a)}}},render(){var e,t;return n("div",{class:[this.ns.b(),this.isClickable?this.ns.m("clickable"):"",this.isUnread?this.ns.m("unread"):""],onClick:this.onClick},[null==(t=(e=this.$slots).default)?void 0:t.call(e),n("div",{class:this.ns.b("toolbar")},[this.finalToolbarItems.map(e=>n(i("iBizIcon"),{class:this.ns.be("toolbar","button"),icon:{imagePath:"svg/read.svg"},baseDir:"iconfont",title:Tt(e.tooltip),onClick:t=>this.onToolbarClick(t,e.key)},null))]),n("div",{class:this.ns.e("unread-tag")},null),this.isClickable&&n("svg",{class:this.ns.e("click-tag"),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1618",width:"14",height:"14",fill:"currentColor"},[n("path",{d:"M256 258.133333c0-21.333333 14.933333-38.4 34.133333-42.666666H765.866667c23.466667 0 42.666667 19.2 42.666666 42.666666L810.666667 725.333333c0 10.666667-4.266667 21.333333-12.8 29.866667-8.533333 8.533333-19.2 12.8-29.866667 12.8-10.666667 0-21.333333-4.266667-29.866667-12.8-8.533333-8.533333-12.8-19.2-12.8-29.866667V360.533333L288 795.733333c-17.066667 17.066667-42.666667 17.066667-59.733333 0-17.066667-17.066667-17.066667-42.666667 0-59.733333l435.2-435.2H298.666667c-21.333333 0-38.4-14.933333-42.666667-34.133333v-8.533334z","p-id":"1619"},null)])])}});var bD=Object.defineProperty,fD=(e,t,a)=>(((e,t,a)=>{t in e?bD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class wD extends mD{constructor(){super(...arguments),fD(this,"component",vD),fD(this,"PREKEY_WFINST","WFINST__"),fD(this,"PREKEY_TODOHIS","TODOHIS__"),fD(this,"PREKEY_CARBONCOPY","CARBONCOPY__")}computeWFParams(e){switch(e.todostate){case"ACTIVE":return{preKey:"",subType:"Todo"};case"COMPLETED":return{preKey:this.PREKEY_TODOHIS,subType:"Done"};default:return{preKey:"",subType:""}}}async onClick(e,t){var a;if(!await super.onClick(e,t)&&"JSON"===e.content_type&&e.content){const t=JSON.parse(e.content);if(t.redirecturl)return this.openRedirectView(e,t.redirecturl),!0;if(t.todoid&&t.biztype)if(ibiz.env.isPortalApp)ibiz.log.error("门户应用暂不支持跳转工作流");else{const e=ibiz.hub.getApp(),{preKey:n,subType:i}=this.computeWFParams(t),o=await ibiz.net.post("/systodos/".concat(n).concat(t.todoid,"/getlinkurl"),{srfapptype:"pc",srfapp:e.model.codeName,todosubtype:i,todourltype:"RouterUrl"});if(o.data&&o.data.linkurl){const e=Lt.create((null==(a=ibiz.appData)?void 0:a.context)||{});Oi(e,o.data.linkurl)}}}return!0}}const yD=a({name:"IBizInternalMessageHTML",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0,read:()=>!0},setup:e=>({ns:B("internal-message-html"),msgContent:r(()=>js(e.message.content))}),render(){return n(i("iBizInternalMessageContainer"),{class:[this.ns.b()],message:this.message,provider:this.provider,onRead:()=>this.$emit("read"),onClose:()=>this.$emit("close")},{default:()=>[n("div",{class:this.ns.e("content"),innerHTML:this.msgContent},null)]})}});var CD=Object.defineProperty,ID=(e,t,a)=>(((e,t,a)=>{t in e?CD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class xD extends mD{constructor(){super(...arguments),ID(this,"component",yD)}async onClick(e,t){if(!await super.onClick(e,t)&&"JSON"===e.content_type&&e.content){const t=JSON.parse(e.content);if(t.redirecturl)return this.openRedirectView(e,t.redirecturl),!0}return!0}}const SD=a({name:"IBizInternalMessageText",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0,read:()=>!0},setup:()=>({ns:B("internal-message-text")}),render(){const{title:e,create_time:t,content:a}=this.message;return n(i("iBizInternalMessageContainer"),{class:[this.ns.b()],message:this.message,provider:this.provider,onRead:()=>this.$emit("read"),onClose:()=>this.$emit("close")},{default:()=>[n("div",{class:this.ns.e("caption")},[e]),!!a&&n("div",{class:this.ns.e("content")},[a]),n("div",{class:this.ns.e("create-time")},[t])]})}});var ED=Object.defineProperty,DD=(e,t,a)=>(((e,t,a)=>{t in e?ED(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class PD extends mD{constructor(){super(...arguments),DD(this,"component",SD)}}const kD=a({name:"IBizInternalMessageGroup",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:e=>!0,read:e=>!0},setup(e,{emit:t}){const a=B("internal-message-group"),n=o(!1),i=r(()=>{const{content_type:t,content:a}=e.message;return"JSON"===t?a?JSON.parse(a).html:a:"HTML"===a?js(a):a}),s=e=>{t("close",e)};return{ns:a,html:i,isExpand:n,onRead:e=>{t("read",e)},onClose:s,onClick:async t=>{if(e.provider.onClick){await e.provider.onClick(e.message,t)&&s()}},onExpandChange:()=>{n.value=!n.value}}},render(){var e,t;return n("div",{class:this.ns.b()},[n("div",{class:this.ns.e("content")},[n("div",{innerHTML:this.html,onClick:this.onClick,class:this.ns.em("content","html")},null),n("div",{class:this.ns.e("action")},[n("ion-icon",{class:this.ns.em("action","item"),title:Tt(this.isExpand?ibiz.i18n.t("panelComponent.userMessage.internalMessageGroup.collapse"):ibiz.i18n.t("panelComponent.userMessage.internalMessageGroup.expand")),name:this.isExpand?"chevron-down-outline":"chevron-forward-outline",onClick:this.onExpandChange},null),n(i("iBizBadge"),{class:this.ns.e("badge"),value:null==(e=this.message.children)?void 0:e.length},null),n(i("iBizIcon"),{baseDir:"iconfont",icon:{imagePath:"svg/read.svg"},class:[this.ns.em("action","item"),this.ns.em("action","read")],title:Tt(ibiz.i18n.t("panelComponent.userMessage.internalMessageContainer.markAsRead")),onClick:()=>this.onRead(this.message)},null)])]),this.isExpand&&n("div",{class:this.ns.e("children")},[null==(t=this.message.children)?void 0:t.map(e=>{let t;try{t=Mi(e)}catch(e){ibiz.log.error(e)}return t?t.render({message:e,class:this.ns.em("children","item"),onClose:()=>this.onClose(e),onRead:()=>this.onRead(e)}):n("div",{class:this.ns.em("children","item")},[ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.noSupportType",{type:e.content_type})])})])])}}),zD=a({name:"IBizInternalMessageTab",props:{controller:{type:Object,required:!0},showPopover:{type:Boolean,required:!0}},emits:{hiddenPopover:()=>!0},setup(e,{emit:t}){var a;const n=B("internal-message-tab"),i=()=>{t("hiddenPopover")},s=async(e,t)=>{var a;(null==(a=e.children)?void 0:a.length)?await Promise.all(e.children.filter(e=>e.id!==(null==t?void 0:t.id)).map(e=>ibiz.hub.notice.internalMessage.markRead(e))):await ibiz.hub.notice.internalMessage.markRead(e)},l=e.controller,r="".concat(null==(a=ibiz.appData)?void 0:a.context.srfsystemid,"-unreadOnly"),p=o(!1);ibiz.mc.command.internalMessage.on(async e=>{ibiz.log.debug("mqtt internalMessage: ",e),"INTERNALMESSAGE"===e.subtype&&(p.value=!0)}),c(()=>e.showPopover,e=>{e&&p.value&&(l.load(),l.refreshUnreadCount(),p.value=!1)});const m=o([]),v=o([]),g=u({total:0,pageSize:0,unreadOnly:l.unreadOnly}),b=()=>{g.total=l.total,g.pageSize=l.size,m.value=ko(l.messages),(()=>{const e={},t=[];m.value.forEach(a=>{const n=ibiz.env.isMob?a.mobile_url:a.url,i="".concat(a.message_type).concat(n);i&&"RECEIVED"===a.status&&"TodoNotify"!==a.message_type?(e[i]||(e[i]=[]),e[i].push({...a})):t.push({...a})});const a=[...t];Object.values(e).forEach(e=>{if(1===e.length)a.push({...e[0]});else{const t={...e[0]};t.children=e.map(e=>({...e})),a.push(t)}}),a.sort((e,t)=>as(e.update_time).isAfter(t.update_time)?-1:1);const n=new Set;a.filter(e=>"TodoNotify"===e.message_type&&"JSON"===e.content_type).forEach(e=>{try{const t=JSON.parse(e.content),a="".concat(t.bizkey,"_").concat(t.param02);t.todoid&&!n.has(a)&&(e.enableLink=!0,n.add(a))}catch(e){ibiz.log.error(e)}}),v.value=a})()};b();const f=e=>{g.unreadOnly=e};l.evt.on("dataChange",b),l.evt.on("unreadOnlyChange",f),h(()=>{l.evt.off("dataChange",b),l.evt.off("unreadOnlyChange",f)});return d(()=>{(()=>{const e=localStorage.getItem(r);e&&("true"===e?(g.unreadOnly=!0,l.unreadOnly=!0):(g.unreadOnly=!1,l.unreadOnly=!1))})(),l.load()}),{ns:n,state:g,allItems:m,messages:v,showMore:()=>{l.loadMore()},onMarkRead:s,onGroupClose:async(e,t)=>{i(),await s(e,t)},switchChange:()=>{l.toggleUnReadOnly(),localStorage.setItem(r,l.unreadOnly.toString())},hiddenPopover:i}},render(){const e=this.state.total-this.allItems.length;return n("div",{class:[this.ns.b()]},[n("div",{class:this.ns.b("content")},[this.allItems.length>0&&this.messages.map(e=>{var t;let a;try{a=Mi(e)}catch(e){ibiz.log.error(e)}return a?(null==(t=e.children)?void 0:t.length)?n(i("iBizInternalMessageGroup"),{message:e,provider:a,class:this.ns.e("group"),onRead:this.onMarkRead,onClose:t=>this.onGroupClose(e,t)},null):a.render({message:e,class:this.ns.e("item"),onClose:this.hiddenPopover,onRead:()=>this.onMarkRead(e)}):n("div",{class:this.ns.e("item")},[ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.noSupportType",{type:e.content_type})])}),0===this.allItems.length&&n("div",{class:this.ns.e("nodata")},[ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.notificationYet")]),e>0&&n("div",{class:this.ns.e("load-more"),onClick:this.showMore},[ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.loadMore",{length:e})])]),n("div",{class:this.ns.b("footer")},[n(i("el-switch"),{value:this.state.unreadOnly,onChange:this.switchChange,class:this.ns.be("footer","switch")},null),ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.onlyShowUnread")])])}});const TD=a({name:"IBizUserMessage",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(e){const t=B("user-message"),a=e.controller,n=ibiz.hub.notice,i=o(!1);let s=0;n.internalMessage.ns=t,n.internalMessage.provider=new mD;const l=o("notification"),r=e.modelData.sysImage||{imagePath:"svg/message.svg"},c=o(),u=o(n.total),p=e=>{u.value=e};n.evt.on("totalChange",p);const m=()=>{if("hidden"===document.visibilityState)s=(new Date).getTime();else{((new Date).getTime()-s)/1e3>300&&(async()=>{const e=await ibiz.net.get("/appdata",ibiz.appUtil.getAppContext());e.ok&&(ibiz.appData=e.data,bs())})()}};return d(()=>{document.addEventListener("visibilitychange",m)}),h(()=>{n.evt.off("totalChange",p),document.removeEventListener("visibilitychange",m)}),{ns:t,c:a,noticeController:n,noticeNum:u,popoverRef:c,showPopover:i,sysImage:r,currentTab:l,hiddenPopover:()=>{c.value.hide()},onBatchReadClick:()=>{n.internalMessage.batchMarkRead()}}},render(){return n("div",{title:Tt(ibiz.i18n.t("panelComponent.userMessage.notice")),class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},[n(i("el-popover"),{ref:"popoverRef","popper-class":this.ns.b("popover"),placement:"bottom",trigger:"click",visible:this.showPopover,"onUpdate:visible":e=>this.showPopover=e},{reference:()=>n(i("el-badge"),{class:this.ns.e("badge"),value:this.noticeNum,hidden:0===this.noticeNum},{default:()=>[n(i("i-biz-icon"),{id:Bi.MESSAGE,class:[this.ns.e("image")],icon:this.sysImage},null)]}),default:()=>n("div",{class:this.ns.b("popover-content-box")},[n(i("el-tabs"),{class:this.ns.b("popover-content"),modelValue:this.currentTab,"onUpdate:modelValue":e=>this.currentTab=e},{default:()=>[n(i("el-tab-pane"),{label:ibiz.i18n.t("panelComponent.userMessage.notice"),name:"notification"},{default:()=>[n(zD,{controller:this.noticeController.internalMessage,showPopover:this.showPopover,onHiddenPopover:this.hiddenPopover},null)]}),n(i("el-tab-pane"),{label:ibiz.i18n.t("panelComponent.userMessage.backendTasks"),name:"async-action"},{default:()=>[n(eD,{controller:this.noticeController.asyncAction,showPopover:this.showPopover,onHiddenPopover:this.hiddenPopover},null)]})]}),n("div",{class:this.ns.b("popover-icons")},[n(i("iBizIcon"),{class:this.ns.b("popover-icons-read"),icon:{imagePath:"svg/read.svg"},baseDir:"iconfont",title:Tt(ibiz.i18n.t("panelComponent.userMessage.allRead")),onClick:this.onBatchReadClick},null)])])})])}});var AD=Object.defineProperty,OD=(e,t,a)=>(((e,t,a)=>{t in e?AD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class MD{constructor(){OD(this,"component","IBizUserMessage")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const ND=ie(TD,function(e){e.component(TD.name,TD),e.component(ZE.name,ZE),Li("DEIMPORTDATA2",()=>new rD),Li("DEEXPORTDATA",()=>new rD),Li("DEFAULT",()=>new rD),function(e){e.component(kD.name,kD),e.component(gD.name,gD),e.component(uD.name,uD),e.component(vD.name,vD),e.component(yD.name,yD),e.component(SD.name,SD),Ni("DEFAULT",()=>new mD),Ni("JSON",()=>new wD),Ni("HTML",()=>new xD),Ni("TEXT",()=>new PD)}(e),xi("RAWITEM_USERMESSAGE",()=>new MD)});var BD=Object.defineProperty,LD=(e,t,a)=>(((e,t,a)=>{t in e?BD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class RD extends Ii{constructor(){super(...arguments),LD(this,"searchFrom")}get searchButtonStyle(){return this.searchFrom.model.searchButtonStyle||"DEFAULT"}get advanceSearch(){return!!this.searchFrom.model.enableAdvanceSearch}get storedFilters(){var e;return(null==(e=this.searchFrom)?void 0:e.state.storedFilters)||[]}async onInit(){await super.onInit();const e=this.panel.container;if(!e)throw new Vt(ibiz.i18n.t("panelComponent.searchformButtons.errMessage"));this.searchFrom=e}onSearchButtonClick(){fa.execAndResolved("search",{context:this.panel.context,params:this.panel.params,data:[],ctrl:this.searchFrom,view:this.panel.view},this.panel.context.srfappid)}onResetButtonClick(){fa.execAndResolved("reset",{context:this.panel.context,params:this.panel.params,data:[],ctrl:this.searchFrom,view:this.panel.view},this.panel.context.srfappid)}}function _D(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const jD=a({name:"IBizSearchFormButtons",props:{modelData:{type:Object,required:!0},controller:{type:RD,required:!0}},setup(e){var t,a;const n=B("searchform-buttons"),i=e.controller,o="DESIGN"===(null==(a=null==(t=i.panel)?void 0:t.context)?void 0:a.srfrunmode);return{c:i,ns:n,onSearchButtonClick:()=>{o||i.onSearchButtonClick()},onResetButtonClick:()=>{i.onResetButtonClick()},saveFilterConfirm:()=>{Co.prompt(ibiz.i18n.t("panelComponent.searchformButtons.enterPrompt"),ibiz.i18n.t("panelComponent.searchformButtons.queryPrompt"),{confirmButtonText:ibiz.i18n.t("app.save"),cancelButtonText:ibiz.i18n.t("app.cancel")}).then(({value:e})=>{i.searchFrom.storeFilter(e)})},onAdvanceSearch:()=>{i.searchFrom.evt.emit("openAdvanceSearch",void 0)}}},render(){let e,t;return n("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},["SEARCHONLY"===this.controller.searchButtonStyle?n(i("el-button"),{onClick:this.onSearchButtonClick},_D(e=ibiz.i18n.t("app.search"))?e:{default:()=>[e]}):n(i("el-dropdown"),{"split-button":!0,type:"primary",onClick:this.onSearchButtonClick},{default:()=>n("span",{class:this.ns.b("label")},[ibiz.i18n.t("app.search")]),dropdown:()=>{let e,t;return n(i("el-dropdown-menu"),null,{default:()=>[n(i("el-dropdown-item"),{onClick:this.onResetButtonClick},_D(e=ibiz.i18n.t("app.reset"))?e:{default:()=>[e]}),this.controller.searchFrom.state.enableStoredFilters&&n(i("el-dropdown-item"),{onClick:this.saveFilterConfirm},_D(t=ibiz.i18n.t("panelComponent.searchformButtons.saveCondition"))?t:{default:()=>[t]}),this.controller.storedFilters.length>0&&this.controller.storedFilters.map((e,t)=>n(i("el-dropdown-item"),{class:this.ns.b("filter-item"),onClick:()=>{this.controller.searchFrom.applyStoredFilter(t)}},{default:()=>[n("span",{class:this.ns.be("filter-item","text")},[e.name,n("ion-icon",{class:this.ns.be("filter-item","remove"),onClick:e=>{e.stopPropagation(),this.controller.searchFrom.removeStoredFilter(t)},name:"close-outline"},null)])]}))]})}}),this.controller.advanceSearch&&n(i("el-button"),{onClick:this.onAdvanceSearch},_D(t=ibiz.i18n.t("app.advanceSearch"))?t:{default:()=>[t]})])}});var VD=Object.defineProperty,FD=(e,t,a)=>(((e,t,a)=>{t in e?VD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class UD{constructor(){FD(this,"component","IBizSearchFormButtons")}async createController(e,t,a){const n=new RD(e,t,a);return await n.init(),n}}const HD=ie(jD,function(e){e.component(jD.name,jD),xi("RAWITEM_SEARCHFORM_BUTTONS",()=>new UD)}),qD=a({name:"IBizViewMessage",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("view-message"),a=e.controller,n=pe(),{view:i}=n;return{ns:t,c:a,view:i}},render(){const e=this.view;if(e.state.isCreated){const t=e.state.viewMessages.BODY;if(null==t?void 0:t.length)return n(i("view-message"),{class:[this.ns.e("body-message")],messages:t},null)}return null}});var GD=Object.defineProperty,WD=(e,t,a)=>(((e,t,a)=>{t in e?GD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class YD{constructor(){WD(this,"component","IBizViewMessage")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const KD=ie(qD,function(e){e.component(qD.name,qD),xi("RAWITEM_VIEW_MESSAGE",()=>new YD)}),XD=a({name:"IBizPanelStaticCarousel",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){var t;const a=B("panel-static-carousel"),n=e.modelData,i=o([]),s=o(!0),l=o(3e3),r=o("DEFAULT"),c=e=>{const t=e.find(e=>Object.is(e.key,"autoplay"));t&&(s.value=!!Object.is(t.value,"1"));const a=e.find(e=>Object.is(e.key,"timespan"));a&&(l.value=Number(a.value)||0);const n=e.find(e=>Object.is(e.key,"showMode"));n&&n.value&&(r.value=n.value)};if(null==(t=n.rawItem)?void 0:t.rawItemParams){let e=[];const t=n.rawItem.rawItemParams;let a=0;t.findIndex(e=>Object.is(e.key,"autoplay"))>=0&&(a+=1),t.findIndex(e=>Object.is(e.key,"timespan"))>=0&&(a+=1),t.findIndex(e=>Object.is(e.key,"showMode"))>=0&&(a+=1),a>0?(e=t.slice(0,-a),c(t.slice(-a))):(e=t,c(t)),i.value=e.map(e=>{const{id:t,key:a,sysImage:n}=e;return{id:t,name:a,imgUrl:(null==n?void 0:n.imagePath)||(null==n?void 0:n.rawContent),cssClass:null==n?void 0:n.cssClass,linkPath:e.linkPath}})}return{ns:a,carouselData:i,isAuto:s,timeSpan:l,showMode:r}},render(){return n("div",{class:this.ns.b()},[n(i("iBizCarouselComponent"),{carouselData:this.carouselData,isAuto:this.isAuto,timeSpan:this.timeSpan,showMode:this.showMode},null)])}});var $D=Object.defineProperty,JD=(e,t,a)=>(((e,t,a)=>{t in e?$D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class QD{constructor(){JD(this,"component","IBizPanelStaticCarousel")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const ZD=ie(XD,function(e){e.component(XD.name,XD),xi("RAWITEM_STATIC_CAROUSEL",()=>new QD)});var eP=Object.defineProperty,tP=(e,t,a)=>(((e,t,a)=>{t in e?eP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class aP extends Si{constructor(){super(...arguments),tP(this,"key",go()),tP(this,"messageModes"),tP(this,"messageMap",new Map),tP(this,"alertParams",{data:{action:"VIEW",entity:"",key:"",time:0,username:""}})}}var nP=Object.defineProperty,iP=(e,t,a)=>(((e,t,a)=>{t in e?nP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class oP extends Ii{constructor(){super(...arguments),iP(this,"operator",[]),iP(this,"rawItemParams",{}),iP(this,"showMode","default"),iP(this,"enableNoAccess",!1),iP(this,"globalDownloadPrifix",!1),iP(this,"messageModeMap",new Map([["OPENDATA","VIEW"],["EDITDATA","EDIT"],["NOTICERELOAD","UPDATE"]]))}createState(){var e;return new aP(null==(e=this.parent)?void 0:e.state)}async onInit(){await super.onInit(),this.handleRawItemParams(),this.showMode=this.rawItemParams.showmode,this.enableNoAccess="true"===this.rawItemParams.enablenoaccess,this.rawItemParams.globaldownloadprifix?this.globalDownloadPrifix="true"===this.rawItemParams.globaldownloadprifix:this.globalDownloadPrifix=ibiz.config.common.globalDownloadPrifix,await this.getOperator()}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}initMessageModes(e){if(e.includes("DISPLAYOPPERSON")){1===e.length?this.state.messageModes=["VIEW","EDIT","UPDATE"]:this.state.messageModes=e.map(e=>this.messageModeMap.get(e)||e);const t=this.panel.context.srfusername;this.state.messageMap.set(t,{username:t})}}updateMessage(e){this.state.key=go();const{data:t}=e;"CLOSE"===t.action?this.state.messageMap.delete(t.username):this.state.messageMap.set(t.username,t),this.state.alertParams=e}async getOperator(){if("avatar"===this.showMode){const e=await ibiz.hub.getApp(this.panel.context.srfappid);this.operator=await e.codeList.get("SysOperator",this.panel.context,this.panel.params)}}getIconUrlByName(e){var t;let a="";const n=this.operator.find(t=>t.text===e);return n&&(a=(null==(t=n.data)?void 0:t.iconurl)||""),a}getDownloadUrl(e){if(!e)return"";const t=JSON.parse(e);if(0===t.length)return"";const{downloadUrl:a}=ibiz.util.file.calcFileUpDownUrl(this.panel.context,this.panel.params,{},{enableNoAccess:this.enableNoAccess,globalDownloadPrifix:this.globalDownloadPrifix});return a.replace("%fileId%",t[0].id)}}const sP=a({name:"IBizCoopPos",props:{modelData:{type:Object,required:!0},controller:{type:oP,required:!0}},setup(e){const t=e.controller,a=B("coop-pos"),i=o([]),s=r(()=>[...t.state.messageMap.values()].filter(e=>!e.action||(t.state.messageModes||[]).includes(e.action)));return{ns:a,c:t,messages:s,renderItem:e=>{let o=ibiz.util.text.abbreviation(e.username)||e.username;if("avatar"===t.showMode){const s=t.getIconUrlByName(e.username),l=t.getDownloadUrl(s);l&&!i.value.includes(l)&&(o=n("img",{class:a.e("img"),src:l,onError:()=>(e=>{i.value.push(e)})(l)},null))}return o}}},render(){return n("div",{class:[this.ns.b(),...this.controller.containerClass]},[this.c.state.messageModes?n("div",{class:this.ns.e("on-line-editing")},[this.messages.map(e=>n("div",{class:this.ns.em("on-line-editing","person"),title:e.action?ibiz.i18n.t("panelComponent.coopPos.".concat(e.action.toLowerCase()),{username:e.username}):"",style:"background-color: ".concat(ibiz.util.text.stringToHexColor(e.username))},[this.renderItem(e)]))]):n(i("iBizCoopAlert"),y({key:this.c.state.key},this.c.state.alertParams),null)])}});var lP=Object.defineProperty,rP=(e,t,a)=>(((e,t,a)=>{t in e?lP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class cP{constructor(){rP(this,"component","IBizCoopPos")}async createController(e,t,a){const n=new oP(e,t,a);return await n.init(),n}}const dP=ie(sP,function(e){e.component(sP.name,sP),xi("RAWITEM_COOP_POS",()=>new cP)});var uP=Object.defineProperty,hP=(e,t,a)=>(((e,t,a)=>{t in e?uP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class pP extends Ii{constructor(){super(...arguments),hP(this,"rawItemParams",{})}async onInit(){await super.onInit(),this.handleRawItemParams()}handleRawItemParams(){var e;const t=null==(e=this.model.rawItem)?void 0:e.rawItemParams;Array.isArray(t)&&t.forEach(e=>{const t=e.key,a=e.value;t&&a&&(this.rawItemParams[t.toLowerCase()]=a)})}}const mP=a({name:"IBizViewMsgPos",props:{modelData:{type:Object,required:!0},controller:{type:pP,required:!0}},setup:()=>({ns:B("view-msg-pos"),view:pe().view}),render(){const e=this.controller;if(!this.view.state.isCreated)return;const t=e.rawItemParams.position||"BODY",a="true"===e.rawItemParams.scroll,o=this.view.state.viewMessages[t];return(null==o?void 0:o.length)?n("div",{class:this.ns.b()},[n(i("view-message"),{messages:o,scroll:a,context:e.panel.context,params:e.panel.params,controller:e.panel.view.viewMsgController},null)]):null}});var vP=Object.defineProperty,gP=(e,t,a)=>(((e,t,a)=>{t in e?vP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class bP{constructor(){gP(this,"component","IBizViewMsgPos")}async createController(e,t,a){const n=new pP(e,t,a);return await n.init(),n}}const fP=ie(mP,function(e){e.component(mP.name,mP),xi("RAWITEM_VIEWMSG_POS",()=>new bP)}),wP=a({name:"IBizUserAction",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(e){var t;const a=B("user-action"),n=e.controller,i={SETTING:{imagePath:"svg/setting.svg"},HELPER:{imagePath:"svg/helper.svg"},CUSTOM:{imagePath:"svg/custom-workbench.svg"}};let o=e.modelData.sysImage;if(!o&&e.modelData&&e.modelData.rawItem){const t=e.modelData.rawItem.predefinedType;t&&(o=i[t])}let s,l="PARENT";(null==(t=e.modelData.rawItem)?void 0:t.rawItemParams)&&e.modelData.rawItem.rawItemParams.find(e=>{var t;return!("noprivmode"!==(null==(t=e.key)?void 0:t.toLowerCase())||!e.value)&&(l=e.value,!0)});n.panel.view.evt.on("onMounted",()=>{(()=>{const t=n.panel.view.getController("appmenu");if(t&&(s=t.allAppMenuItems.find(t=>t.id===e.modelData.id),s&&s.accessKey)){const e=ibiz.hub.getApp(n.panel.context.srfappid).authority.calcByResCode(s.accessKey);n.state.visible=e,n.parent&&"PARENT"===l&&(n.parent.state.visible=e)}})()});return{ns:a,c:n,sysImage:o,onClick:async e=>{if(s){const t=n.panel.context.clone(),a=n.panel.params;t.srfappid=s.appId||ibiz.env.appId,await ibiz.commands.execute(zi.TAG,s.appFuncId,t,a,{event:e})}}}},render(){return n("div",{class:this.ns.b(),title:Tt(this.modelData.caption)},[n(i("i-biz-icon"),{class:[this.ns.e("image")],icon:this.sysImage,onClick:e=>this.onClick(e)},null)])}});var yP=Object.defineProperty,CP=(e,t,a)=>(((e,t,a)=>{t in e?yP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class IP{constructor(){CP(this,"component","IBizUserAction")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const xP=e("aU",ie(wP,function(e){e.component(wP.name,wP),xi("RAWITEM_SETTING",()=>new IP),xi("RAWITEM_HELPER",()=>new IP),xi("RAWITEM_CUSTOM",()=>new IP)})),SP=a({name:"IBizDataImportShell",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("data-import-shell"),a=e.controller;return{ns:t,c:a,onDismiss:()=>{a.panel.view.closeView()}}},render(){const{deDataImport:e,appDataEntity:t}=this.c.panel.view.state,a=[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass],n=e.enableCustomized?"DataImport2":"DataImport";return l(i(n),{dismiss:this.onDismiss,dataImport:e,appDataEntity:t,context:this.c.panel.context,params:this.c.panel.params,class:a})}});var EP=Object.defineProperty,DP=(e,t,a)=>(((e,t,a)=>{t in e?EP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class PP{constructor(){DP(this,"component","IBizDataImportShell")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const kP=ie(SP,function(e){e.component(SP.name,SP),xi("RAWITEM_DATA_IMPORT",()=>new PP)}),zP=a({name:"IBizShortCut",components:{draggable:is},props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("short-cut"),a=I().proxy,s=hs(),l=ibiz.util.shortCut,r=o(!0),c=o(!1),p=u(l.data),m={newIndex:0,oldIndex:0},v=new Map([["ROUTE_MODAL","INDEXVIEWTAB_POPUPMODAL"],["MODAL","POPUPMODAL"],["DRAWER","DRAWER_RIGHT"]]),g=e=>{0===p.length&&c.value&&(c.value=!1),a.$forceUpdate()};d(()=>{r.value="vertical"!==l.mode,ibiz.util.shortCut.onChange(g)}),h(()=>{ibiz.util.shortCut.offChange(g)});const b=()=>{r.value=!r.value,r.value?(c.value=!1,l.setShortCutMode("horizontal")):l.setShortCutMode("vertical")},f=e=>{e.moved?ibiz.util.shortCut.changeIndex(e.moved.newIndex,e.moved.oldIndex):e.added?m.newIndex=e.added.newIndex:e.removed&&(m.oldIndex=e.removed.oldIndex,ibiz.util.shortCut.changeIndex(m.newIndex,m.oldIndex))},w=a=>n(is,{itemKey:"key",class:[t.e("draggable"),t.is("horizontal",!a),t.is("vertical",a)],modelValue:p,group:e.controller.model.id,onChange:e=>f(e)},{item:({element:e,index:o})=>{if(a&&!r.value||a&&r.value&&o>5||!a&&o<6)return n("div",{class:[t.e("item"),t.e("draggable-item")],title:Tt(e.caption),onClick:()=>(e=>{if(c.value=!1,"ROUTE"===e.openMode){const t=e.fullPath.substring(1);s.currentRoute.value.fullPath!==t&&s.push({path:e.fullPath.substring(1)})}else ibiz.commands.execute(Ai.TAG,e.appViewId,Lt.create(e.context),e.params,{openMode:v.get(e.openMode)})})(e)},[n("svg",{viewBox:"0 0 16 16",class:["drag-icon","icon"],xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",focusable:"false"},[n("g",{id:"drag-icon/drag--","stroke-width":"1","fill-rule":"evenodd"},[n("g",{id:"drag-icon",transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z",id:"drag-icon-air"},null)])])]),e.icon?n(i("iBizIcon"),{class:["caption-icon","icon"],icon:e.icon},null):n("ion-icon",{class:["caption-icon","icon"],name:"ellipsis-horizontal-circle-outline"},null),n("div",{class:t.em("item","caption")},[e.caption]),n("ion-icon",{name:"close-outline",class:["close-icon","icon"],onClick:t=>((e,t)=>{e.stopPropagation(),ibiz.util.shortCut.removeShortCut(t)})(t,e.key)},null)])}});return{ns:t,data:p,isShowToolbar:r,onChange:f,renderDraggable:w,renderMore:()=>n(i("el-popover"),{visible:c.value,"onUpdate:visible":e=>c.value=e,placement:"top-start",trigger:"click",width:"auto","popper-class":t.e("popover")},{reference:()=>n("div",{class:[t.e("more"),t.e("operate")]},[n(i("el-tooltip"),{content:ibiz.i18n.t("app.more"),placement:"top"},{default:()=>[n("div",null,[n("span",{class:t.em("more","caption")},[r.value?"6/".concat(p.length):p.length]),n("i",{class:["fa","icon","more-icon",c.value?"fa-angle-double-down":"fa-angle-double-up"],"aria-hidden":"true"},null)])]})]),default:()=>[w(!0),n("div",{class:[t.e("item"),t.e("action-item"),t.is("hidden",r.value)],onClick:b},[n("ion-icon",{class:["expand-icon","icon"],name:"chevron-back-outline"},null),n("div",{class:t.em("item","caption")},[ibiz.i18n.t("panelComponent.shortCut.expandToolbar")])])]}),renderRecover:()=>n("div",{class:[t.e("recover"),t.e("operate")],onClick:b},[n(i("el-tooltip"),{effect:"dark",content:ibiz.i18n.t("app.retract"),placement:"top"},{default:()=>[n("ion-icon",{class:["recover-icon","icon"],name:"chevron-forward-outline"},null)]})])}},render(){return n("div",{class:[this.ns.b(),...this.controller.containerClass,this.ns.is("conceal",0===this.data.length)]},[this.isShowToolbar&&this.renderDraggable(!1),(!this.isShowToolbar||this.data.length>6)&&this.renderMore(),this.isShowToolbar&&this.renderRecover()])}});var TP=Object.defineProperty,AP=(e,t,a)=>(((e,t,a)=>{t in e?TP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class OP{constructor(){AP(this,"component","IBizShortCut")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const MP=ie(zP,function(e){e.component(zP.name,zP),xi("RAWITEM_SHORTCUT",()=>new OP)});var NP=Object.defineProperty,BP=(e,t,a)=>(((e,t,a)=>{t in e?NP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class LP extends Si{constructor(){super(...arguments),BP(this,"code",""),BP(this,"image",""),BP(this,"state",""),BP(this,"loading",!1),BP(this,"error")}}var RP=Object.defineProperty,_P=(e,t,a)=>(((e,t,a)=>{t in e?RP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class jP extends Ii{constructor(){super(...arguments),_P(this,"captcha",u({"Captcha-State":"","Captcha-Code":""}))}createState(){var e;return new LP(null==(e=this.parent)?void 0:e.state)}async panelStateNotify(e){super.panelStateNotify(e),this.data.captcha=this.captcha}async onInit(){super.onInit(),await this.loadCaptcha(),this.panel.view.evt.on("onAfterLogin",e=>{e.ok||e.panelDataParent&&e.panelDataParent!==this.dataParent.model.id||(this.loadCaptcha(),this.state.code="")})}async validate(){return this.state.code?(this.state.error=void 0,!0):(this.state.error="请输入验证码",!1)}onChange(){Object.assign(this.captcha,{"Captcha-State":this.state.state,"Captcha-Code":this.state.code})}async loadCaptcha(){this.state.loading=!0;const e={url:"".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId,"/auths/captcha"),method:"post",headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"},data:{}};try{const t=await ys(e);200===t.status&&t.data&&(this.state.state=t.data.state,this.state.image=t.data.image)}catch(e){this.state.state="",this.state.image=""}finally{this.state.loading=!1,this.onChange()}}}const VP=a({name:"IBizAuthCaptcha",props:{modelData:{type:Object,required:!0},controller:{type:jP,required:!0}},setup(e){const t=B("auth-captcha"),a=e.controller,n=r(()=>{let n=[t.b(),t.m(a.model.id)];return n=[...n,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible),t.is("error",!!a.state.error)],n});return{c:a,ns:t,classArr:n,onClick:()=>{a.state.loading||a.loadCaptcha()},onChange:()=>{a.onChange(),a.validate()}}},render(){return n("div",{class:this.classArr},[n(i("el-input"),{modelValue:this.c.state.code,"onUpdate:modelValue":e=>this.c.state.code=e,class:this.ns.e("captcha"),onInput:this.onChange,onBlur:this.onChange,placeholder:"验证码"},null),b(n(i("el-image"),{src:this.c.state.image,class:this.ns.e("image"),onClick:this.onClick,title:Tt("点击图片刷新")},{error:()=>n("div",{onClick:this.onClick,class:[this.ns.em("image","hint"),this.ns.is("loading",this.c.state.loading)]},[this.c.state.loading?"加载中...":"加载失败"])}),[[C("loading"),this.c.state.loading]]),this.c.state.error&&n("div",{class:this.ns.e("error")},[this.c.state.error])])}});var FP=Object.defineProperty,UP=(e,t,a)=>(((e,t,a)=>{t in e?FP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class HP{constructor(){UP(this,"component","IBizAuthCaptcha")}async createController(e,t,a){const n=new jP(e,t,a);return await n.init(),n}}const qP=ie(VP,function(e){e.component(VP.name,VP),xi("RAWITEM_AUTH_CAPTCHA",()=>new HP)});var GP=Object.defineProperty,WP=(e,t,a)=>(((e,t,a)=>{t in e?GP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class YP extends Si{constructor(){super(...arguments),WP(this,"buttonsState")}}class KP extends Ii{createState(){var e;return new YP(null==(e=this.parent)?void 0:e.state)}get data(){return this.dataParent.data}constructor(e,t,a){super(e,t,a),this.state.buttonsState=new Ri}async onInit(){await super.onInit(),await this.initUIActions(),await this.initButtonsState()}async initUIActions(){const{buttonListType:e,uiactionGroup:t}=this.model;"UIACTIONGROUP"===e&&await _i(t,this.panel.context,this.panel.params)}async initButtonsState(){const{buttonListType:e,uiactionGroup:t,panelButtons:a}=this.model;if("UIACTIONGROUP"===e){if(null==t?void 0:t.uiactionGroupDetails){ji(t.uiactionGroupDetails).forEach(e=>{if(e.uiactionId){const t=new Di(e.id,e.appId,e.uiactionId,e);this.state.buttonsState.addState(e.id,t)}})}}else null==a||a.forEach(e=>{if(e.uiactionId){const t=new Di(e.id,this.model.appId,e.uiactionId);this.state.buttonsState.addState(e.id,t)}});await this.state.buttonsState.init()}async dataChangeNotify(e){await this.state.buttonsState.update(this.panel.context,this.data,this.panel.model.appDataEntityId),super.dataChangeNotify(e)}async panelStateNotify(e){await this.state.buttonsState.update(this.panel.context,this.data,this.panel.model.appDataEntityId),super.panelStateNotify(e)}getModelById(e){const{buttonListType:t,uiactionGroup:a,panelButtons:n}=this.model;if("UIACTIONGROUP"===t){return ji(null==a?void 0:a.uiactionGroupDetails).find(t=>t.id===e)}return null==n?void 0:n.find(t=>t.id===e)}async handleClick(e,t){const a=this.getModelById(e);(null==a?void 0:a.uiactionId)&&await fa.execAndResolved(a.uiactionId,{context:this.panel.context,params:{panelDataParent:this.dataParent.model.id,...this.panel.params},event:t,data:[this.data],view:this.panel.view,ctrl:this.panel,noWaitRoute:!0},a.appId||this.model.appId)}calcItemVisible(e){this.state.buttonsState.visible?super.calcItemVisible(e):this.state.visible=!1}calcItemDisabled(e){this.state.buttonsState.disabled?this.state.disabled=!0:super.calcItemDisabled(e)}}const XP=a({name:"IBizPanelButtonList",props:{modelData:{type:Object,required:!0},controller:{type:KP,required:!0}},setup(e){const t=B("panel-button-list"),a=e.controller;return{ns:t,handleClick:async(e,t)=>{null==t||t.stopPropagation(),a.handleClick(e,t)}}},render(){const{state:e}=this.controller;return e.visible?n(i("iBizButtonList"),{class:[this.ns.b(),...this.controller.containerClass],model:this.modelData,disabled:e.disabled,buttonsState:e.buttonsState,onClick:this.handleClick},null):null}});var $P=Object.defineProperty,JP=(e,t,a)=>(((e,t,a)=>{t in e?$P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class QP{constructor(){JP(this,"component","IBizPanelButtonList")}async createController(e,t,a){const n=new KP(e,t,a);return await n.init(),n}}const ZP=ie(XP,function(e){e.component(XP.name,XP),xi("BUTTONLIST",()=>new QP)}),ek=a({name:"IBizAuthSsO",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){var t;const a=B("auth-sso"),n=null==(t=e.controller.model.rawItem)?void 0:t.rawItemParams,i=null==n?void 0:n.map(e=>{const t=e.value?JSON.parse(e.value):{};return{key:e.key,sysImage:e.sysImage,title:t.title,params:t}});return{ns:a,items:i,handleThridLogin:(e,t)=>{if(e)switch(e){case"DINGDING":(async()=>{ibiz.thirdAuth.auth("DINGTALK","THIRD")})();break;case"WXWORK":(async()=>{ibiz.thirdAuth.auth("WXWORK","THIRD")})();break;default:(async e=>{ibiz.thirdAuth.auth("OAUTH","THIRD",e)})(t)}}}},render(){return this.items&&this.items.length?n("div",{class:this.ns.b()},[this.items.map(e=>{var t;let a;return e.sysImage?a=n(i("iBizIcon"),{icon:e.sysImage},null):"DINGDING"===e.key?a=n("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"651",width:"48",height:"48"},[n("defs",null,[n("style",{type:"text/css"},null)]),n("path",{d:"M512 2C230.2 2 2 230.2 2 512s228.2 510 510 510 510-228.2 510-510S793.3 2 512 2z m235.9 442c-1 4.6-3.6 10.8-7.2 19.1l-0.5 0.5c-21.6 45.8-77.3 135.5-77.3 135.5l-0.5-0.5-16.5 28.3h78.8L574.3 826.8l34-136h-61.8l21.6-90.2c-17.5 4.1-38.1 9.8-62.3 18 0 0-33 19.1-94.8-37.1 0 0-41.7-37.1-17.5-45.8 10.3-4.1 50-8.8 81.4-12.9 42.2-5.7 68.5-8.8 68.5-8.8s-130.3 2.1-161.2-3.1c-30.9-4.6-70.1-56.7-78.3-102 0 0-12.9-24.7 27.8-12.9 40.2 11.8 209.2 45.8 209.2 45.8S321.4 375 307 358.5c-14.4-16.5-42.8-89.6-39.2-134.5 0 0 1.5-11.3 12.9-8.2 0 0 161.8 74.2 272.5 114.4C664.5 371.4 760.8 392 747.9 444z",fill:"#3296FA","p-id":"652"},null)]):"WXWORK"===e.key&&(a=n("svg",{class:"icon",width:"200px",height:"200.00px",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[n("path",{fill:"#36ab60",d:"M352.814545 385.396364m-33.512727 0a33.512727 33.512727 0 1 0 67.025455 0 33.512727 33.512727 0 1 0-67.025455 0Z"},null),n("path",{fill:"#36ab60",d:"M502.690909 384.465455m-33.512727 0a33.512727 33.512727 0 1 0 67.025454 0 33.512727 33.512727 0 1 0-67.025454 0Z"},null),n("path",{fill:"#36ab60",d:"M576.232727 534.341818m-23.272727 0a23.272727 23.272727 0 1 0 46.545455 0 23.272727 23.272727 0 1 0-46.545455 0Z"},null),n("path",{fill:"#36ab60",d:"M694.458182 536.203636m-23.272727 0a23.272727 23.272727 0 1 0 46.545454 0 23.272727 23.272727 0 1 0-46.545454 0Z"},null),n("path",{fill:"#36ab60",d:"M512 0C229.003636 0 0 229.003636 0 512s229.003636 512 512 512 512-229.003636 512-512S794.996364 0 512 0z m-87.505455 630.225455c-26.996364 0-48.407273-5.585455-75.403636-11.17091l-75.403636 37.236364 21.410909-64.232727c-53.992727-37.236364-85.643636-85.643636-85.643637-145.221818 0-102.4 96.814545-182.458182 215.04-182.458182 105.192727 0 198.283636 64.232727 216.901819 150.807273-6.516364-0.930909-13.963636-0.930909-20.48-0.93091-102.4 0-182.458182 76.334545-182.458182 170.356364 0 15.825455 2.792727 30.72 6.516363 44.683636-7.447273 0-13.963636 0.930909-20.48 0.93091z m314.647273 75.403636l15.825455 53.992727-58.647273-32.581818c-21.410909 5.585455-42.821818 11.170909-64.232727 11.170909-102.4 0-182.458182-69.818182-182.458182-155.461818s80.058182-155.461818 182.458182-155.461818c96.814545 0 182.458182 69.818182 182.458182 155.461818 0 47.476364-31.650909 90.298182-75.403637 122.88z"},null)])),n("div",{class:[this.ns.e("sign-btn"),this.ns.m("WXWORK"===e.key?"wx":null==(t=e.key)?void 0:t.toLowerCase())],title:e.title,onClick:()=>this.handleThridLogin(e.key,e.params)},[a])})]):n("div",{class:this.ns.b()},[n("div",{class:[this.ns.e("sign-btn"),this.ns.m("dingding")],onClick:()=>this.handleThridLogin("DINGDING"),title:ibiz.i18n.t("panelComponent.authSsO.dingLogin")},[n("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"651",width:"48",height:"48"},[n("defs",null,[n("style",{type:"text/css"},null)]),n("path",{d:"M512 2C230.2 2 2 230.2 2 512s228.2 510 510 510 510-228.2 510-510S793.3 2 512 2z m235.9 442c-1 4.6-3.6 10.8-7.2 19.1l-0.5 0.5c-21.6 45.8-77.3 135.5-77.3 135.5l-0.5-0.5-16.5 28.3h78.8L574.3 826.8l34-136h-61.8l21.6-90.2c-17.5 4.1-38.1 9.8-62.3 18 0 0-33 19.1-94.8-37.1 0 0-41.7-37.1-17.5-45.8 10.3-4.1 50-8.8 81.4-12.9 42.2-5.7 68.5-8.8 68.5-8.8s-130.3 2.1-161.2-3.1c-30.9-4.6-70.1-56.7-78.3-102 0 0-12.9-24.7 27.8-12.9 40.2 11.8 209.2 45.8 209.2 45.8S321.4 375 307 358.5c-14.4-16.5-42.8-89.6-39.2-134.5 0 0 1.5-11.3 12.9-8.2 0 0 161.8 74.2 272.5 114.4C664.5 371.4 760.8 392 747.9 444z",fill:"#3296FA","p-id":"652"},null)])]),n("div",{class:[this.ns.e("sign-btn"),this.ns.m("wx")],onClick:()=>this.handleThridLogin("WXWORK"),title:ibiz.i18n.t("panelComponent.authSsO.wechatLogin")},[n("svg",{class:"icon",width:"200px",height:"200.00px",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[n("path",{fill:"#36ab60",d:"M352.814545 385.396364m-33.512727 0a33.512727 33.512727 0 1 0 67.025455 0 33.512727 33.512727 0 1 0-67.025455 0Z"},null),n("path",{fill:"#36ab60",d:"M502.690909 384.465455m-33.512727 0a33.512727 33.512727 0 1 0 67.025454 0 33.512727 33.512727 0 1 0-67.025454 0Z"},null),n("path",{fill:"#36ab60",d:"M576.232727 534.341818m-23.272727 0a23.272727 23.272727 0 1 0 46.545455 0 23.272727 23.272727 0 1 0-46.545455 0Z"},null),n("path",{fill:"#36ab60",d:"M694.458182 536.203636m-23.272727 0a23.272727 23.272727 0 1 0 46.545454 0 23.272727 23.272727 0 1 0-46.545454 0Z"},null),n("path",{fill:"#36ab60",d:"M512 0C229.003636 0 0 229.003636 0 512s229.003636 512 512 512 512-229.003636 512-512S794.996364 0 512 0z m-87.505455 630.225455c-26.996364 0-48.407273-5.585455-75.403636-11.17091l-75.403636 37.236364 21.410909-64.232727c-53.992727-37.236364-85.643636-85.643636-85.643637-145.221818 0-102.4 96.814545-182.458182 215.04-182.458182 105.192727 0 198.283636 64.232727 216.901819 150.807273-6.516364-0.930909-13.963636-0.930909-20.48-0.93091-102.4 0-182.458182 76.334545-182.458182 170.356364 0 15.825455 2.792727 30.72 6.516363 44.683636-7.447273 0-13.963636 0.930909-20.48 0.93091z m314.647273 75.403636l15.825455 53.992727-58.647273-32.581818c-21.410909 5.585455-42.821818 11.170909-64.232727 11.170909-102.4 0-182.458182-69.818182-182.458182-155.461818s80.058182-155.461818 182.458182-155.461818c96.814545 0 182.458182 69.818182 182.458182 155.461818 0 47.476364-31.650909 90.298182-75.403637 122.88z"},null)])])])}});var tk=Object.defineProperty,ak=(e,t,a)=>(((e,t,a)=>{t in e?tk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class nk{constructor(){ak(this,"component","IBizAuthSsO")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const ik=ie(ek,function(e){e.component(ek.name,ek),xi("RAWITEM_AUTH_SSO",()=>new nk)});function ok(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const sk=a({name:"IBizIndexBlankPlaceholder",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(e){const t=e.controller,a=B("index-blank-placeholder"),{id:n}=e.modelData,i=r(()=>{let t=[a.b(),a.m(n)];return t=[...t,...e.controller.containerClass,a.is("hidden",!e.controller.state.visible)],t});return t.routeDepth&&ve(e=>{t.setVisible(!e.currentKey)},t.routeDepth+1),{ns:a,classArr:i}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},ok(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},ok(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr,onClick:e=>this.controller.onClick(e)},[this.controller.model.cssStyle?n("style",{type:"text/css"},[this.controller.model.cssStyle]):null,s])}});class lk extends Si{}class rk extends Ii{createState(){var e;return new lk(null==(e=this.parent)?void 0:e.state)}get routeDepth(){return this.panel.view.modal.routeDepth}get appmenu(){return this.panel.getController("appmenu")}get navPos(){return this.panel.panelItems.nav_pos_index}async onInit(){await super.onInit(),this.state.keepAlive=!0,this.state.visible=!1,this.panel.evt.on("onMounted",async()=>{var e;this.navPos&&(this.navPos.state.keepAlive=!0);const t=null==(e=this.appmenu)?void 0:e.getDefaultOpenView();if(t){const e=await ibiz.hub.config.view.get(t),{openMode:a="INDEXVIEWTAB"}=e;this.state.visible=!a.startsWith("INDEXVIEWTAB")}})}setVisible(e){this.state.visible=e,this.navPos&&(this.navPos.state.visible=!e)}}var ck=Object.defineProperty,dk=(e,t,a)=>(((e,t,a)=>{t in e?ck(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class uk{constructor(){dk(this,"component","IBizIndexBlankPlaceholder")}async createController(e,t,a){const n=new rk(e,t,a);return await n.init(),n}}const hk=ie(sk,function(e){e.component(sk.name,sk),xi("CONTAINER_INDEX_BLANK_PLACEHOLDER",()=>new uk)});var pk=Object.defineProperty,mk=(e,t,a)=>(((e,t,a)=>{t in e?pk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class vk extends Si{constructor(){super(...arguments),mk(this,"query",""),mk(this,"items",[]),mk(this,"histories",[]),mk(this,"list",[]),mk(this,"loading",!1)}}var gk=Object.defineProperty,bk=(e,t,a)=>(((e,t,a)=>{t in e?gk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class fk extends Ii{constructor(){super(...arguments),bk(this,"keyName","srfkey"),bk(this,"textName","srfmajortext"),bk(this,"rawItemParams",{}),bk(this,"historyCacheKey","global-search-history"),bk(this,"maxHistory",7),bk(this,"size",100)}createState(){var e;return new vk(null==(e=this.parent)?void 0:e.state)}async onInit(){await super.onInit(),this.handleRawItemParams(),this.initParams(),this.initHistory(),await this.initGlobalSearchItem()}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}initParams(){this.rawItemParams.historycachekey&&(this.historyCacheKey+=this.rawItemParams.historycachekey),this.rawItemParams.maxhistory&&(this.maxHistory=Number(this.rawItemParams.maxhistory)),this.rawItemParams.size&&(this.size=Number(this.rawItemParams.size))}initHistory(){const e=localStorage.getItem(this.historyCacheKey);e&&(this.state.histories=JSON.parse(e))}async getSearchFunc(e){const t=[],a=e.map(async e=>{try{if(e.appMenuItems){const a=await this.getSearchFunc(e.appMenuItems);return void t.push(...a)}if(e.appFuncId){let a=ibiz.hub.getApp(e.appId);a||(a=await ibiz.hub.getAppAsync(e.appId));const n=a.getAppFunc(e.appFuncId);n&&"SEARCH"===n.appFuncType&&n.appDEACModeId&&n.appDataEntityId&&t.push(n)}}catch(t){console.error("计算菜单应用功能异常: ".concat(e.appFuncId),t)}});return await Promise.all(a),t}async initGlobalSearchItem(){const e=Pn(this.panel.view.model,"appmenu");if(!e)return;const t=e.appMenuItems||[],a=await this.getSearchFunc(t);await Promise.all(a.map(async e=>{const t=await ga(e.appDEACModeId,e.appDataEntityId,e.appId);if(t){let a;t.itemSysPFPluginId&&(a=await Vi(t)),this.state.items.push({deACMode:t,acItemProvider:a,appDataEntityId:e.appDataEntityId})}}))}addToHistory(e){const t=this.state.histories.filter(t=>t!==e);t.push(e),t.length>this.maxHistory&&t.shift(),this.state.histories=t,localStorage.setItem(this.historyCacheKey,JSON.stringify(this.state.histories))}getFetchParams(e){const{deACMode:t}=e,{minorSortDir:a,minorSortAppDEFieldId:n}=t,i={page:0,size:this.size,query:this.state.query};return a&&n&&Object.assign(i,{sort:"".concat(n.toLowerCase(),",").concat(a.toLowerCase())}),i}handleResponseHeader(e){return{page:e.headers["x-page"]?Number(e.headers["x-page"]):0,total:e.headers["x-total"]?Number(e.headers["x-total"]):0}}async loadByACMode(e){let t=[];const{appDataEntityId:a,deACMode:n}=e,{appDEDataSetId:i}=n;if(!i)return t;const o=this.getFetchParams(e),s=ibiz.hub.getApp(n.appId),l=await s.deService.exec(a,i,this.panel.context,o);if(l.ok&&l.data){const{page:e,total:a}=this.handleResponseHeader(l),n=l.data;(e+1)*this.size<a&&n.push({[this.textName]:"".concat(ibiz.i18n.t("panelComponent.globalSearch.moreTips",{total:a,size:this.size})),[this.keyName]:go()}),t=n}return t}clearHistory(){this.state.histories=[],localStorage.setItem(this.historyCacheKey,JSON.stringify(this.state.histories))}async search(e){if(this.state.query=e,this.state.query){this.state.list=[],this.state.loading=!0,this.addToHistory(this.state.query);try{await Promise.all(this.state.items.map(async e=>{const t=await this.loadByACMode(e);this.state.list.push(...t)}))}catch(e){ibiz.log.error(e)}finally{this.state.loading=!1}}}openLinkView(e,t){const{appDataEntityId:a,deACMode:n}=t,{linkAppViewId:i}=n;if(!i)return;const o=this.panel.context.clone(),s=ra(a);Object.assign(o,{[s]:e[this.keyName]}),ibiz.commands.execute(Ai.TAG,i,o,{noWaitRoute:!0})}getSearchItemByEntity(e){return this.state.items.find(t=>ra(t.appDataEntityId)===(null==e?void 0:e.toLowerCase()))}}var wk=Object.defineProperty,yk=(e,t,a)=>(((e,t,a)=>{t in e?wk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ck{constructor(){yk(this,"component","IBizGlobalSearch")}async createController(e,t,a){const n=new fk(e,t,a);return await n.init(),n}}const Ik=a({name:"IBizVirtualList",props:{items:{type:Array,required:!0},itemSize:{type:Number,default:34},maxHeight:{type:Number,default:300},buffer:{type:Number,default:5},getKey:{type:Function,default:e=>e.id}},emits:["scroll","reach-bottom"],setup(e,{emit:t}){const a=B("virtual-list"),n=o(),i=o(0),s=r(()=>e.items.length*e.itemSize),l=r(()=>s.value>e.maxHeight?e.maxHeight:s.value),c=r(()=>Math.ceil(l.value/e.itemSize)+e.buffer),d=r(()=>Math.floor(i.value/e.itemSize)),u=r(()=>Math.min(d.value+c.value,e.items.length)),h=r(()=>e.items.slice(d.value,u.value)),p=r(()=>d.value*e.itemSize),m=e=>{n.value&&(n.value.scrollTop=e,i.value=e)};return{ns:a,height:l,offsetY:p,container:n,scrollTop:i,totalHeight:s,visibleData:h,scrollTo:m,handleScroll:()=>{if(n.value){const{scrollHeight:e,clientHeight:a}=n.value;i.value=n.value.scrollTop,t("scroll",{scrollTop:i.value,scrollHeight:n.value.scrollHeight,clientHeight:n.value.clientHeight}),e-(i.value+a)<50&&t("reach-bottom")}},scrollToIndex:t=>{const a=t*e.itemSize;m(a)}}},render(){return n("div",{ref:"container",class:this.ns.b(),style:{height:"".concat(this.height,"px")},onScroll:this.handleScroll},[n("div",{class:this.ns.e("phantom"),style:{height:"".concat(this.totalHeight,"px")}},null),n("div",{class:this.ns.e("content"),style:{transform:"translateY(".concat(this.offsetY,"px)")}},[this.visibleData.map(e=>{var t,a;return n("div",{key:this.getKey(e),style:{height:"".concat(this.itemSize,"px")},class:this.ns.em("content","item")},[null==(a=(t=this.$slots).default)?void 0:a.call(t,{item:e})])})])])}});const xk=a({name:"IBizGlobalSearch",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(e){const t=e.controller,a=B("global-search"),u=o();let p=!1;const m=o(!1),v=o(),g=o(""),b=r(()=>{const{query:e,list:a,histories:n,loading:i}=t.state,o=e&&a.length>0,s=!e&&n.length>0,l=n.includes(e)&&0===a.length;return(o||l||s||i)&&m.value}),f=r(()=>{const{placeholder:e}=t.rawItemParams;return e||ibiz.i18n.t("panelComponent.globalSearch.placeholder")}),w=()=>{t.state.list=[],t.state.query=""},y=e=>{const t=e.target;t.closest(".".concat(a.b()))||t.closest(".".concat(a.e("popper")))||t.closest(".el-input__suffix")||(m.value=!1)},C=()=>{w(),t.clearHistory()},I=e=>{var t;(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),null==(t=u.value)||t.focus())};c(()=>b.value,()=>{b.value&&(setTimeout(()=>{var e;null==(e=v.value)||e.scrollTo(0)}),g.value!==t.state.histories[t.state.histories.length-1]&&w())}),d(()=>{document.addEventListener("click",y,{capture:!0}),document.addEventListener("keydown",I)}),h(()=>{document.removeEventListener("click",y,{capture:!0}),document.removeEventListener("keydown",I)});return{c:t,ns:a,visible:b,editorRef:u,searchValue:g,curPlaceholder:f,handleFocus:e=>{p?p=!1:m.value=!0},handleEnter:e=>{"Enter"===e.key&&(m.value=!0,t.search(g.value))},renderAction:()=>{let e;if(!t.state.query&&t.state.histories.length)return n("div",{class:a.em("content","action-item")},[n(i("el-button"),{text:!0,onClick:C},(o=e=ibiz.i18n.t("panelComponent.globalSearch.clearHistory"),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?e:{default:()=>[e]}))]);var o},renderFooter:()=>{const{query:e,list:i,histories:o,loading:s}=t.state,l=o.includes(e)&&0===i.length;if(s||l)return n("div",{class:a.e("footer")},[ibiz.i18n.t("panelComponent.globalSearch.".concat(s?"loading":"empty"))])},renderSearchList:()=>{if(t.state.list.length)return n(Ik,{ref:v,items:t.state.list,class:a.e("virtual-list"),getKey:e=>e[t.keyName]},{default:({item:e})=>{const o=t.getSearchItemByEntity(e.srfdecodename);let s=e[t.textName];return(null==o?void 0:o.acItemProvider)?s=l(i(o.acItemProvider.component),{item:e,controller:t}):(null==o?void 0:o.deACMode.itemLayoutPanel)&&(s=n(i("iBizControlShell"),{data:e,modelData:o.deACMode.itemLayoutPanel,context:t.panel.context,params:t.panel.params},null)),n("div",{class:[a.em("list","item"),a.em("list","srearch-item")],onClick:()=>((e,a)=>{p=!0,m.value=!1,a&&t.openLinkView(e,a)})(e,o),title:Tt(e[t.textName])},[s])}})},renderHistoryList:()=>n("div",{class:a.e("list")},[t.state.histories.map(e=>n("div",{onClick:()=>{return a=e,g.value=a,void t.search(g.value);var a},class:[a.em("list","item"),a.em("list","history-item")]},[e]))]),handleClearSearch:w}},render(){return n("div",{class:this.ns.b()},[n(i("el-popover"),{width:"auto",visible:this.visible,placement:"bottom-start","popper-class":this.ns.e("popper")},{reference:()=>n(i("el-input"),{clearable:!0,ref:"editorRef",modelValue:this.searchValue,"onUpdate:modelValue":e=>this.searchValue=e,placeholder:this.curPlaceholder,class:[this.ns.e("search"),this.ns.is("search",this.visible)],onFocus:this.handleFocus,onKeyup:this.handleEnter,onClear:this.handleClearSearch},{prefix:()=>n("ion-icon",{name:"search",class:this.ns.em("search","icon")},null),suffix:()=>{if(this.searchValue)return n("ion-icon",{title:ibiz.i18n.t("panelComponent.globalSearch.search"),name:"return-down-back-outline",class:[this.ns.em("search","icon"),this.ns.em("search","enter-icon")],onClick:()=>this.c.search(this.searchValue)},null)}}),default:()=>n("div",{class:this.ns.e("content")},[this.c.state.query?this.renderSearchList():this.renderHistoryList(),this.renderAction(),this.renderFooter()])})])}}),Sk=ie(xk,function(e){e.component(xk.name,xk),xi("RAWITEM_GLOBAL_SEARCH",()=>new Ck)});var Ek=Object.defineProperty,Dk=(e,t,a)=>(((e,t,a)=>{t in e?Ek(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Pk extends Si{constructor(){super(...arguments),Dk(this,"activeMicroAppId",""),Dk(this,"items",[])}}var kk=Object.defineProperty,zk=(e,t,a)=>(((e,t,a)=>{t in e?kk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Tk extends Ii{constructor(){super(...arguments),zk(this,"rawItemParams",{}),zk(this,"util"),zk(this,"sourceType","REFAPP")}get view(){return this.panel.view}get context(){return this.panel.context}createState(){var e;return new Pk(null==(e=this.parent)?void 0:e.state)}async onInit(){await super.onInit(),this.handleRawItemParams(),this.state.visible=1===this.view.model.appSwitchMode,this.state.visible&&(this.state.items=await this.loadAllApps(),this.initActiveMicroAppId())}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t),this.sourceType=this.rawItemParams.sourcetype||"REFAPP"}async loadAllApps(){return"UTIL"===this.sourceType?this.loadAppsWithUtil():this.loadAppsWithRefApp()}initActiveMicroAppId(){if(this.view&&this.state.items.length>0){const e=this.state.items.find(e=>{var t;return e.indexViewName===(null==(t=this.view.model.codeName)?void 0:t.toLowerCase())});e&&this.setActiveMicroAppId(e.id)}}setActiveMicroAppId(e){ibiz.hub.activeMicroAppId=e,this.state.activeMicroAppId=e}async loadAppsWithUtil(){const e=[];if(!this.util){const t=ibiz.hub.getApp(ibiz.env.appId).getAppUtil("HUBAPP","CUSTOM");if(!t)return e;this.util=new ya(t)}const t=await this.util.load("",this.context,this.panel.params);if(!t||0===t.length)return e;const a=ibiz.hub.getAppSourceModel(ibiz.env.appId).getAllPSSubAppRefs;for(let n=0;n<t.length;n++){if(t[n].id!==ibiz.env.appId&&!/^[0-9a-zA-Z]+__[0-9a-zA-Z]+__[0-9a-zA-Z]+$/.test(t[n].id)){const e=a.find(e=>e.id.endsWith(t[n].id));e&&(t[n].id=e.id)}e.push({id:"".concat(t[n].id,"@").concat(t[n].indexViewName.toLowerCase()),dataId:t[n].dataId,caption:t[n].caption,indexViewName:t[n].indexViewName.toLowerCase(),order:t[n].order})}return e.sort((e,t)=>e.order-t.order)}async loadAppsWithRefApp(){var e,t,a,n;const i=[],o=ibiz.hub.getApp();if(!o)return i;const s=ibiz.hub.getAppSourceModel(o.appId);if(!s||!s.cache)return i;const l=null==(t=null==(e=s.cache)?void 0:e.getPSAppViews)?void 0:t.filter(e=>"APPINDEXVIEW"===e.viewType&&1===e.appSwitchMode);if(l&&l.length>0)for(let e=0;e<l.length;e++){const t=l[e];i.push({id:"".concat(t.appId,"@").concat(t.codeName.toLowerCase()),caption:t.title||t.caption,indexViewName:t.codeName.toLowerCase(),order:100*(e+1)})}const r=s.getAllPSSubAppRefs;if(!r||0===r.length)return i;for(let e=0;e<r.length;e++){const t=r[e];if(t.appMode&&"CLOUDHUBSUBAPP"===t.appMode){const e=await ibiz.hub.getAppAsync(t.id),o=null==(n=null==(a=ibiz.hub.getAppSourceModel(e.appId).cache)?void 0:a.getPSAppViews)?void 0:n.filter(e=>"APPINDEXVIEW"===e.viewType&&1===e.appSwitchMode);if(o&&o.length>0)for(let e=0;e<o.length;e++){const t=o[e];i.push({id:"".concat(t.appId,"@").concat(t.codeName.toLowerCase()),caption:t.title||t.caption,indexViewName:t.codeName.toLowerCase(),order:100*(i.length+1)})}}}return i.sort((e,t)=>e.order-t.order)}async switchMicroApp(e,t){if(e===this.state.activeMicroAppId)return;let a=e;-1!==e.indexOf("@")&&(a=e.split("@")[0]),a!==ibiz.env.appId&&await ibiz.hub.getAppAsync(a);const n=ibiz.hub.getAppSourceModel(a);if(ibiz.hub.getApp().model.appId===a&&window.Environment.AppTitle)ibiz.env.AppTitle=window.Environment.AppTitle;else if(n.getDefaultPSAppIndexView){const e=n.getDefaultPSAppIndexView;if(n.caption)ibiz.env.AppTitle=n.caption;else{const t=n.cache.getPSAppViews.find(t=>t.dynaModelFilePath===e.path);t&&(ibiz.env.AppTitle=t.caption)}}this.setActiveMicroAppId(e);const i=this.state.items.findIndex(t=>t.id===e),o=Y(t.currentRoute.value);o.pathNodes=o.pathNodes.slice(0,1),o.pathNodes[0].viewName=this.state.items[i].indexViewName;const s=K(o);t.push(s)}}const Ak=a({name:"IBizAppSwitch",props:{modelData:{type:Object,required:!0},controller:{type:Tk,required:!0}},setup(e){const t=B("app-switch"),{state:a}=e.controller,n=hs();return{ns:t,state:a,handleClick:t=>{e.controller.switchMicroApp(t,n)}}},render(){return this.state.visible?n(i("el-dropdown"),{class:this.ns.b(),trigger:"click",onCommand:e=>this.handleClick(e)},{default:()=>n("span",{class:this.ns.e("icon")},[n("i",{class:"fa fa-th","aria-hidden":"true"},null)]),dropdown:()=>n(i("el-dropdown-menu"),{class:[this.ns.e("dropdown")]},{default:()=>[this.state.items.length>0?this.state.items.map(e=>n(i("el-dropdown-item"),{class:[this.ns.e("item"),this.ns.is("active",this.state.activeMicroAppId===e.id)],title:Tt(e.caption),command:e.id},{default:()=>[e.caption]})):n(i("iBizNoData"),null,null)]})}):null}});var Ok=Object.defineProperty,Mk=(e,t,a)=>(((e,t,a)=>{t in e?Ok(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Nk{constructor(){Mk(this,"component","IBizAppSwitch")}async createController(e,t,a){const n=new Tk(e,t,a);return await n.init(),n}}const Bk=ie(Ak,function(e){e.component(Ak.name,Ak),xi("RAWITEM_APP_SWITCH",()=>new Nk)});function Lk(e,t,a,n){let i=0,s=null;const r=new Map,c=o([]),d=new Map,u=t=>{switch(e.position){case"TOP":return t>0?"right-start":"bottom-start";case"BOTTOM":return t>0?"right-end":"top-start";case"RIGHT":return"left-start";case"LEFT":return"right-start";default:return}},h=()=>{s&&(clearTimeout(s),s=null)},p=e=>{const a=r.get(e);a&&(a.dismiss(),r.delete(e),((e,t)=>{const a=d.get(t);a&&(a.classList.remove(e.is("rotate-arrow",!0)),d.delete(t))})(t,e))},m=()=>{for(const e of r.keys())p(e);r.clear(),c.value=[],i=0},v=()=>{h(),s=setTimeout(()=>{i<=0&&m()},300)},g=()=>{i++,h()},b=(e,t)=>{i=Math.max(0,i-1),v()},f=(e,i,o)=>{var s;const c=ibiz.overlay.createPopover(()=>l(n(e),{onMouseenter:g,onMouseleave:b}),void 0,{width:"auto",height:"auto",noArrow:!0,placement:u(e.level),offsetOpts:10,...o,modalClass:"".concat(t.b("cascader-popover")," ").concat(t.is(a.value,!0)," ").concat((null==o?void 0:o.modalClass)||"")});var h,p,m;r.set(e.level,c),null==c||c.present(i.currentTarget),h=null==(s=i.currentTarget)?void 0:s.parentElement,p=t,m=e.level,h&&(h.classList.add(p.is("rotate-arrow",!0)),d.set(m,h))};return{getOverlayNum:()=>r.size,openCascaderPopover:f,clearAllCascader:()=>{m(),h()},handleMenuItemMouseEnter:(e,t)=>{c.value.includes(e.id)||(c.value.push(e.id),(e=>{let t=e;for(;r.get(t+1);)t++;for(let a=t;a>=e;a--)p(a)})(e.level),e.children&&f(e,t),h())},handleMenuItemMouseLeave:e=>{const t=c.value.indexOf(e.id);-1!==t&&c.value.splice(t,1),v()}}}function Rk(e,t,a,n,i,o){let s;const r=()=>{switch(a){case"TOP":return"bottom";case"BOTTOM":return"top";case"RIGHT":return"left";case"LEFT":return"right";default:return}};let c;const u=()=>{null==s||s.dismiss(),s=null,document.removeEventListener("mousemove",p),c=void 0},p=e=>{c||(c=document.querySelector(".".concat(t.b("border-popover"))));const a=(e=>{let t=0,a=0,n=e;for(;n;)t+=n.offsetLeft,a+=n.offsetTop,n=n.offsetParent;return{x:t,y:a,width:e.offsetWidth,height:e.offsetHeight}})(c);!(e.pageX>=a.x&&e.pageX<=a.x+a.width&&e.pageY>=a.y&&e.pageY<=a.y+a.height)&&i()<=0&&u()},m=async e=>{var a;if(s)return;s=ibiz.overlay.createPopover(()=>l(o()),void 0,{width:"auto",height:"auto",noArrow:!0,placement:r(),offsetOpts:-1,modalClass:"".concat(t.b("border-popover")," ").concat(t.is(n.value,!0))});const i=null==(a=e.currentTarget)?void 0:a.querySelector(".".concat(t.be("placehold","line")));await(null==s?void 0:s.present(i)),setTimeout(()=>{document.addEventListener("mousemove",p)},200)};let v=null,g=null,b=null;function f(e){if(!v)return;const t=e.getBoundingClientRect();var n,i,o,s;v.style.top="".concat((n=t.top,i=t.height,"BOTTOM"===a?n+i-20:n),"px"),v.style.left="".concat((o=t.left,s=t.width,"RIGHT"===a?o+s-20:o),"px"),v.style.width="".concat((e=>["RIGHT","LEFT"].includes(a)?20:e)(t.width),"px"),v.style.height="".concat((e=>["TOP","BOTTOM"].includes(a)?20:e)(t.height),"px")}return d(function(){const n=e.value;if(!n)return;!function(e){const n=document.createElement("div");n.classList.add(t.b("placehold")),n.classList.add(t.is(a.toLowerCase(),!!a));const i=document.createElement("div");i.classList.add(t.be("placehold","line"));const o=document.createElement("div");o.classList.add(t.be("placehold","arrow")),n.appendChild(i),n.appendChild(o),document.body.appendChild(n),v=n,v.addEventListener("mouseenter",m),o.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 1024 1024"\n width="1em"\n height="1em"\n fill="currentColor">\n <path fill="currentColor"\n d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z">\n </path>\n </svg>\n ',f(e)}(n),g=new ResizeObserver(()=>f(n)),g.observe(n);const i=()=>{f(n),b=requestAnimationFrame(i)};b=requestAnimationFrame(i)}),h(function(){if(g){const t=e.value;t&&g.unobserve(t),g.disconnect(),g=null}null!==b&&(cancelAnimationFrame(b),b=null),v&&v.parentNode&&(v.removeEventListener("mouseenter",m),v.parentNode.removeChild(v),v=null)}),{closeBorderPopover:u}}function _k(e,t,a=0){return e.map(e=>{var n;const i={...e,value:e.id,label:e.caption,parentId:null==t?void 0:t.id,level:a};return(null==(n=e.appMenuItems)?void 0:n.length)&&(i.children=_k(e.appMenuItems,e,a+1)),i})}function jk(e,t){let a;return t&&t.some(t=>!t.id||(t.id===e?(a=t,!0):!!(t.appMenuItems&&t.appMenuItems.length>0)&&(a=jk(e,t.appMenuItems),!!a))),a}function Vk(e){const{ns:t,isLayout:a,menuLayout:o,position:s,menuAlign:l,menus:r,menuItemsState:c,showCascaderArrow:d,handleMenuItemClick:u,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p}=e,m=a?function(e){if("FLEX"===(null==e?void 0:e.layout)){const{align:t,valign:a}=e;return{justifyContent:t,alignItems:a}}return{}}(o):{};return n(i("el-row"),{class:[t.e("content"),t.is(l,!!l),t.is(null==s?void 0:s.toLowerCase(),!!s)],style:m},{default:()=>r.map(e=>{var o,s;const r=function(e){var t,a,o;const{ns:s,menu:l,menuAlign:r,menuItemsState:c}=e;if(l.id&&(null==(t=c[l.id])?void 0:t.visible)){if("MENUITEM"===l.itemType)return n(i("el-button"),{class:[s.e("menuitem"),"".concat((null==(a=l.sysCss)?void 0:a.cssName)||"")],index:l.id},{default:()=>[l.sysImage&&n(i("iBizIcon"),{class:s.e("icon"),icon:l.sysImage},null),l.caption&&n("span",{class:s.e("caption"),title:Tt(l.tooltip)},[l.caption])]});if("SEPERATOR"===l.itemType){const e="horizontal"===r?"vertical":"horizontal";return n(i("el-divider"),{direction:e,class:[s.em("separator"),s.em("separator",e)],id:l.id},null)}return"RAWITEM"===l.itemType?n(i("el-button"),{index:l.id,title:Tt(l.tooltip),class:[s.e("rawitem"),"".concat((null==(o=l.sysCss)?void 0:o.cssName)||"")]},{default:()=>[n(i("iBizRawItem"),{rawItem:l},null)]}):void 0}}({menu:e,ns:t,menuAlign:l,menuItemsState:c});if(!r)return;const m={};if(a&&"FLEX"===(null==(o=e.layoutPos)?void 0:o.layout)){const t=e.layoutPos;Object.assign(m,{flexGrow:t.grow,flexShrink:1===t.shrink?void 0:t.shrink,flexBasis:t.basis})}const v=!(!d||!e.children);return n("div",{class:[t.em("content","item"),t.em("content",null==(s=e.itemType)?void 0:s.toLowerCase()),t.is("show-arrow",v)],style:m},[n("div",{class:t.em("content","item-container"),onMouseenter:t=>h(e,t),onMouseleave:t=>p(e,t),onClick:t=>u(e,t)},[r]),v&&n("span",{class:t.em("content","item-arrow")},[n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor"},[n("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null)])])])})})}const Fk=a({name:"IBizExtendButtonMenu",props:{items:{type:Object,required:!0},menuItemsState:{type:Object,required:!0},providers:{type:Object,required:!0},position:{type:String,required:!0},layoutMode:{type:String,required:!0},layout:{type:Object}},emits:{menuItemClick:(e,t)=>!0},setup(e,{emit:t}){const a=B("extend-menu-button"),n=o(),i=r(()=>["TOP","BOTTOM"].includes(e.position)?"horizontal":"vertical"),s=r(()=>"BORDER"!==e.layoutMode),l=o(_k(e.items)),c=()=>Vk({ns:a,menuAlign:i.value,position:e.position,menus:l.value,menuItemsState:e.menuItemsState,handleMenuItemClick:v,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p,showCascaderArrow:!0,isLayout:!1}),{getOverlayNum:d,clearAllCascader:u,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p}=Lk(e,a,i,t=>Vk({ns:a,menuAlign:"vertical",position:e.position,menus:t.children,menuItemsState:e.menuItemsState,handleMenuItemClick:v,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p,showCascaderArrow:!0,isLayout:!1}));let m;if("BORDER"===e.layoutMode){const t=Rk(n,a,e.position,i,d,c);m=t.closeBorderPopover}const v=async(a,n)=>{if(a.children)return;if(u(),m&&m(),!a.appFuncId)return void ibiz.log.warn(ibiz.i18n.t("runtime.controller.control.menu.noConfigured"));const i=jk(a.id,e.items);t("menuItemClick",i,n)};return{ns:a,menus:l,menuAlign:i,isLayout:s,buttonMenuRef:n,handleMenuItemClick:v,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p}},render(){return n("div",{ref:"buttonMenuRef",class:[this.ns.b(),this.ns.is(this.layoutMode.toLowerCase(),!!this.layoutMode),this.ns.is(this.position.toLowerCase(),!!this.position),this.ns.is(this.menuAlign,!!this.menuAlign)]},["BORDER"!==this.layoutMode&&Vk({ns:this.ns,menuAlign:this.menuAlign,isLayout:this.isLayout,menuLayout:this.layout,position:this.position,menus:this.menus,menuItemsState:this.menuItemsState,handleMenuItemClick:this.handleMenuItemClick,handleMenuItemMouseEnter:this.handleMenuItemMouseEnter,handleMenuItemMouseLeave:this.handleMenuItemMouseLeave})])}});function Uk(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}function Hk(e){var t,a,o,s;const{isFirst:l,menu:r,collapse:c,ns:d,menuAlign:u,menuItemsState:h}=e;if(r.id&&(!h||(null==(t=h[r.id])?void 0:t.visible))){if("MENUITEM"===r.itemType){let e;return e=l&&c?[r.sysImage?n(i("iBizIcon"),{class:d.e("icon"),icon:r.sysImage},null):n("span",{class:d.e("caption")},[null==(a=r.caption)?void 0:a.slice(0,1)])]:[r.sysImage?n(i("iBizIcon"),{class:d.e("icon"),icon:r.sysImage},null):null,n("span",{class:d.e("caption")},[r.caption])],l&&c?n(i("el-tooltip"),{class:d.b("tooltip"),content:r.caption,placement:"horizontal"===u?"bottom":"left",theme:"light"},{default:()=>{var t;return[n(i("el-menu-item"),{class:[d.e("item"),"".concat((null==(t=r.sysCss)?void 0:t.cssName)||"")],index:r.id},Uk(e)?e:{default:()=>[e]})]}}):n(i("el-menu-item"),{class:[d.e("item"),"".concat((null==(o=r.sysCss)?void 0:o.cssName)||"")],index:r.id,title:Tt(r.tooltip)},Uk(e)?e:{default:()=>[e]})}if("SEPERATOR"===r.itemType){const e="horizontal"===u&&l?"vertical":"horizontal";return n(i("el-divider"),{direction:e,class:d.em("separator",e),id:r.id},null)}return"RAWITEM"===r.itemType?n(i("el-menu-item"),{index:r.id,title:Tt(r.tooltip),class:[d.e("rawitem"),"".concat((null==(s=r.sysCss)?void 0:s.cssName)||"")]},{default:()=>[n(i("iBizRawItem"),{rawItem:r},null)]}):void 0}}function qk(e){var t,a;const{isFirst:o,menu:s,collapse:l,ns:r,menuAlign:c,menuItemsState:d}=e;if(s.id&&(!d||(null==(t=d[s.id])?void 0:t.visible)))return n(i("el-sub-menu"),{class:[r.b("submenu"),"".concat((null==(a=s.sysCss)?void 0:a.cssName)||"")],index:s.id,teleported:!0,"popper-class":[r.b("popup-container")]},{default:()=>s.children&&s.children.map(e=>e.children&&e.children?qk({isFirst:!1,menu:e,collapse:l,ns:r,menuAlign:c,menuItemsState:d}):Hk({isFirst:!1,menu:e,collapse:l,ns:r,menuAlign:c,menuItemsState:d})),title:()=>{var e;return l?s.sysImage?n(i("iBizIcon"),{class:r.e("icon"),icon:s.sysImage},null):[o?null==(e=s.caption)?void 0:e.slice(0,1):s.caption,o?null:n("ion-icon",{name:"chevron-forward-outline"},null)]:[n(i("iBizIcon"),{class:r.e("icon"),icon:s.sysImage},null),n("span",{class:r.e("caption")},[s.caption])]}})}function Gk(e){const{refreshKey:t,ns:a,collapse:o,menuAlign:s,position:l,menus:r,menuItemsState:c,handleMenuSelect:d}=e;return n("div",{class:[a.e("content"),a.is("collapse",o),a.is(s,!!s),a.is(null==l?void 0:l.toLowerCase(),!!l)]},[n(i("el-menu"),{key:t,"popper-class":[a.b("popper")],collapse:o,"collapse-transition":!1,onSelect:d,theme:"light",mode:s,"ellipsis-icon":()=>n("ion-icon",{name:"ellipsis-horizontal"},null),ellipsis:"horizontal"===s},{default:()=>r.map(e=>e.children&&e.children.length>0?qk({isFirst:!0,menu:e,collapse:o,ns:a,menuAlign:s,menuItemsState:c}):Hk({isFirst:!0,menu:e,collapse:o,ns:a,menuAlign:s,menuItemsState:c}))})])}const Wk=a({name:"IBizExtendStandardMenu",props:{items:{type:Object,required:!0},menuItemsState:{type:Object,required:!0},providers:{type:Object,required:!0},position:{type:String,required:!0},layoutMode:{type:String,required:!0},layout:{type:Object}},emits:{menuItemClick:(e,t)=>!0},setup:(e,{emit:t})=>({ns:B("extend-standard-menu"),defaultMenuRef:o(),refreshKey:o(go()),collapse:o(!1),menuAlign:r(()=>["TOP","BOTTOM"].includes(e.position)?"horizontal":"vertical"),menus:o(_k(e.items)),handleMenuSelect:async(a,n)=>{const i=jk(a,e.items);(null==i?void 0:i.appFuncId)?t("menuItemClick",i,n):ibiz.log.warn(ibiz.i18n.t("runtime.controller.control.menu.noConfigured"))}}),render(){return n("div",{ref:"defaultMenuRef",class:[this.ns.b(),this.ns.b(this.layoutMode.toLowerCase()),this.ns.is(this.position.toLowerCase(),!0),this.ns.is(this.menuAlign,!0),this.ns.is("collapse",this.collapse)]},[Gk({position:this.position,refreshKey:this.refreshKey,ns:this.ns,collapse:this.collapse,menuAlign:this.menuAlign,menus:this.menus,menuLayout:this.layout,menuItemsState:this.menuItemsState,handleMenuSelect:this.handleMenuSelect})])}}),Yk=a({name:"IBizCommonExtendMenu",components:{ExtendButtonMenu:Fk,ExtendStandardMenu:Wk},props:{renderMode:{type:String,required:!0},items:{type:Object,required:!0},menuItemsState:{type:Object,required:!0},providers:{type:Object,required:!0},position:{type:String,required:!0},layoutMode:{type:String,default:"FLEX"},layout:{type:Object}},emits:{menuItemClick:(e,t)=>!0},setup:(e,{emit:t})=>({ns:B("common-extend-menu"),handleMenuItemClick:(e,a)=>{e&&"RAWITEM"!==(null==e?void 0:e.itemType)&&t("menuItemClick",e,a)}}),render(){var e;let t=n(Fk,{items:this.items,menuItemsState:this.menuItemsState,providers:this.providers,position:this.position,layoutMode:this.layoutMode,layout:this.layout,onMenuItemClick:this.handleMenuItemClick},null);return"MENU"===(null==(e=this.renderMode)?void 0:e.toLocaleUpperCase())&&(t=n(Wk,{items:this.items,menuItemsState:this.menuItemsState,providers:this.providers,position:this.position,layoutMode:this.layoutMode,layout:this.layout,onMenuItemClick:this.handleMenuItemClick},null)),n("div",{class:this.ns.b()},[t])}});var Kk=Object.defineProperty,Xk=(e,t,a)=>(((e,t,a)=>{t in e?Kk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class $k extends Si{constructor(){super(...arguments),Xk(this,"items",[]),Xk(this,"menuItemsState",{})}}var Jk=Object.defineProperty,Qk=(e,t,a)=>(((e,t,a)=>{t in e?Jk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Zk extends Ii{constructor(){super(...arguments),Qk(this,"rawItemParams",{rendermode:"BUTTON"}),Qk(this,"appMenuName",""),Qk(this,"appMenu"),Qk(this,"app"),Qk(this,"itemProviders",{}),Qk(this,"allAppMenuItems",[])}get view(){return this.panel.view}get routeDepth(){return this.view.modal.routeDepth}get context(){return this.panel.context}get params(){return this.panel.params}createState(){var e;return new $k(null==(e=this.parent)?void 0:e.state)}async onInit(){var e,t;await super.onInit(),this.handleRawItemParams(),this.app=await ibiz.hub.getApp(this.context.srfappid),this.appMenu=this.computeAppMenu(),this.state.items=this.appMenu&&this.appMenu.appMenuItems?this.appMenu.appMenuItems:[],this.flattenAllItems(),await this.initAppMenuItemProviders(),null==(t=null==(e=this.appMenu)?void 0:e.appMenuItems)||t.forEach(e=>{this.initMenuItemState(e)})}computeAppMenu(){return Pn(this.view.model,this.appMenuName)}flattenAllItems(){if(!this.appMenu)return;const e=[],t=a=>{a.forEach(a=>{e.push(a),a.appMenuItems&&a.appMenuItems.length>0&&t(a.appMenuItems)})};t(this.appMenu.appMenuItems),this.allAppMenuItems=e}async initAppMenuItemProviders(){0!==this.allAppMenuItems.length&&await Promise.all(this.allAppMenuItems.map(async e=>{const t=await Fi(e);t&&(this.itemProviders[e.id]=t)}))}initMenuItemState(e){var t;const a={permitted:!0,visible:!0};if(e.hidden)a.visible=!1;else{let n=!0;e.accessKey&&(n=this.app.authority.calcByResCode(e.accessKey));let i=n;if(null==(t=e.appMenuItems)?void 0:t.length){const t=e.appMenuItems.map(e=>this.initMenuItemState(e).visible);i=i&&t.includes(!0)}a.permitted=n,a.visible=i}return this.state.menuItemsState[e.id]=a,a}async handleClickMenuItem(e,t,a=!0){if(!e)return;const n=this.itemProviders[e.id];if(n&&n.onClick)return n.onClick(e,t);if(!e.appFuncId)throw new Xt(e,ibiz.i18n.t("runtime.controller.control.menu.noConfigured"));const i=this.context.clone();i.srfappid=e.appId||ibiz.env.appId,this.routeDepth&&a&&Object.assign(i,{toRouteDepth:this.routeDepth+1});const o={...this.params};await ibiz.commands.execute(zi.TAG,e.appFuncId,i,o,{view:this.view})}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}}var ez=Object.defineProperty,tz=(e,t,a)=>(((e,t,a)=>{t in e?ez(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class az extends Zk{constructor(){super(...arguments),tz(this,"appMenuName","leftsidemenu")}}const nz=a({name:"IBizLeftSideMenu",props:{modelData:{type:Object,required:!0},controller:{type:az,required:!0}},setup(e){const t=B("left-side-menu"),{state:a}=e.controller;return{ns:t,state:a}},render(){return this.controller.appMenu?n("div",{class:this.ns.b()},[n(i("iBizCommonExtendMenu"),{renderMode:this.controller.rawItemParams.rendermode,items:this.state.items,menuItemsState:this.state.menuItemsState,providers:this.controller.itemProviders,position:"LEFT",layoutMode:this.controller.appMenu.layoutMode,layout:this.controller.appMenu.layout,onMenuItemClick:(e,t)=>{this.controller.handleClickMenuItem(e,t)}},null)]):null}});var iz=Object.defineProperty,oz=(e,t,a)=>(((e,t,a)=>{t in e?iz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class sz{constructor(){oz(this,"component","IBizLeftSideMenu")}async createController(e,t,a){const n=new az(e,t,a);return await n.init(),n}}var lz={install(e){e.component(nz.name,nz),xi("RAWITEM_PREDEFINE_LEFT_SIDE_MENU",()=>new sz)}},rz=Object.defineProperty,cz=(e,t,a)=>(((e,t,a)=>{t in e?rz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class dz extends Zk{constructor(){super(...arguments),cz(this,"appMenuName","rightsidemenu")}}const uz=a({name:"IBizRightSideMenu",props:{modelData:{type:Object,required:!0},controller:{type:dz,required:!0}},setup(e){const t=B("right-side-menu"),{state:a}=e.controller;return{ns:t,state:a}},render(){return this.controller.appMenu?n("div",{class:this.ns.b()},[n(i("iBizCommonExtendMenu"),{renderMode:this.controller.rawItemParams.rendermode,items:this.state.items,menuItemsState:this.state.menuItemsState,providers:this.controller.itemProviders,position:"RIGHT",layoutMode:this.controller.appMenu.layoutMode,layout:this.controller.appMenu.layout,onMenuItemClick:(e,t)=>{this.controller.handleClickMenuItem(e,t)}},null)]):null}});var hz=Object.defineProperty,pz=(e,t,a)=>(((e,t,a)=>{t in e?hz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class mz{constructor(){pz(this,"component","IBizRightSideMenu")}async createController(e,t,a){const n=new dz(e,t,a);return await n.init(),n}}var vz={install(e){e.component(uz.name,uz),xi("RAWITEM_PREDEFINE_RIGHT_SIDE_MENU",()=>new mz)}},gz=Object.defineProperty,bz=(e,t,a)=>(((e,t,a)=>{t in e?gz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class fz extends Zk{constructor(){super(...arguments),bz(this,"appMenuName","bottomsidemenu")}}const wz=a({name:"IBizBottomSideMenu",props:{modelData:{type:Object,required:!0},controller:{type:fz,required:!0}},setup(e){const t=B("bottom-side-menu"),{state:a}=e.controller;return{ns:t,state:a}},render(){return this.controller.appMenu?n("div",{class:this.ns.b()},[n(i("iBizCommonExtendMenu"),{renderMode:this.controller.rawItemParams.rendermode,items:this.state.items,menuItemsState:this.state.menuItemsState,providers:this.controller.itemProviders,position:"BOTTOM",layoutMode:this.controller.appMenu.layoutMode,layout:this.controller.appMenu.layout,onMenuItemClick:(e,t)=>{this.controller.handleClickMenuItem(e,t)}},null)]):null}});var yz=Object.defineProperty,Cz=(e,t,a)=>(((e,t,a)=>{t in e?yz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Iz{constructor(){Cz(this,"component","IBizBottomSideMenu")}async createController(e,t,a){const n=new fz(e,t,a);return await n.init(),n}}var xz={install(e){e.component(wz.name,wz),xi("RAWITEM_PREDEFINE_BOTTOM_SIDE_MENU",()=>new Iz)}},Sz=Object.defineProperty,Ez=(e,t,a)=>(((e,t,a)=>{t in e?Sz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Dz extends Zk{constructor(){super(...arguments),Ez(this,"appMenuName","topsidemenu")}}const Pz=a({name:"IBizTopSideMenu",props:{modelData:{type:Object,required:!0},controller:{type:Dz,required:!0}},setup(e){const t=B("top-side-menu"),{state:a}=e.controller;return{ns:t,state:a}},render(){return this.controller.appMenu?n("div",{class:this.ns.b()},[n(i("iBizCommonExtendMenu"),{renderMode:this.controller.rawItemParams.rendermode,items:this.state.items,menuItemsState:this.state.menuItemsState,providers:this.controller.itemProviders,position:"TOP",layoutMode:this.controller.appMenu.layoutMode,layout:this.controller.appMenu.layout,onMenuItemClick:(e,t)=>{this.controller.handleClickMenuItem(e,t)}},null)]):null}});var kz=Object.defineProperty,zz=(e,t,a)=>(((e,t,a)=>{t in e?kz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Tz{constructor(){zz(this,"component","IBizTopSideMenu")}async createController(e,t,a){const n=new Dz(e,t,a);return await n.init(),n}}var Az={install(e){e.component(Pz.name,Pz),xi("RAWITEM_PREDEFINE_TOP_SIDE_MENU",()=>new Tz)}},Oz={install(e){e.component(Yk.name,Yk),e.use(lz),e.use(vz),e.use(xz),e.use(Az)}};const Mz=e("aG",{install:e=>{e.use(Sk),e.use(hk),e.use(ik),e.use(ye),e.use(Ce),e.use(Ie),e.use(xe),e.use(kx),e.use(jx),e.use(Xx),e.use(mS),e.use(xS),e.use(Se),e.use(NS),e.use(Ee),e.use(De),e.use(Pe),e.use(ke),e.use(VS),e.use(WS),e.use(QS),e.use(ze),e.use(iE),e.use(Te),e.use(pE),e.use(Ae),e.use(CE),e.use(zE),e.use(RE),e.use(qE),e.use($E),e.use(Oe),e.use(ND),e.use(Me),e.use(HD),e.use(Ne),e.use(KD),e.use(ZD),e.use(Be),e.use(Le),e.use(dP),e.use(fP),e.use(xP),e.use(kP),e.use(MP),e.use(qP),e.use(ZP),e.use(Re),e.use(Bk),e.use(Oz)}}),Nz=a({name:"NotSupportedEditor",props:{modelData:{type:Object,required:!0},context:{type:Object}},setup(e){var t;return{ns:B("not-supported-editor"),isDesignPreview:"DESIGN"===(null==(t=e.context)?void 0:t.srfrunmode)}},render(){return this.isDesignPreview?n("div",{class:this.ns.b()},[n("div",{class:this.ns.b("preview-content")},null)]):n("div",{class:this.ns.b()},[ibiz.i18n.t("editor.notSupportedEditor.unsupportedType",{type:this.modelData.editorType})])}});as.extend(Cs);const Bz=a({name:"IBizSpan",props:_e(),setup(e,{emit:t}){var a,n;const i=B("span"),s=e.controller,l=o(""),d=s.codeList,{valueFormat:u,dataType:h,unitName:p}=s.parent,m=o(""),v=s.model.textSeparator||(null==(a=s.editorParams)?void 0:a.TEXTSEPARATOR)||(null==(n=s.editorParams)?void 0:n.textseparator)||",";c(()=>e.value,(e,t)=>{if(e!==t){if(Po(e))return void(l.value="");if("SIMPLES"===s.model.valueType)l.value=e.join(v);else if("OBJECT"===s.model.valueType)l.value=e[s.model.objectNameField?s.model.objectNameField:"srfmajortext"];else if("OBJECTS"===s.model.valueType){const t=[];e.forEach(e=>{t.push(e[s.model.objectNameField?s.model.objectNameField:"srfmajortext"])}),l.value=t.join(v)}else if("ADDRESSPICKUP"===s.model.editorType)try{const t=[];JSON.parse(e).forEach(e=>{t.push(e[s.model.objectNameField?s.model.objectNameField:"srfmajortext"])}),l.value=t.join(v)}catch(t){ibiz.log.error("标签地址选择器的值不符合JSON格式".concat(e))}else if(u)try{if(null!=h&&$t.isDate(h))l.value=as(e).format(u);else{const t=as(e).format(u);(a=t)!==(n=u)&&as(a,n,!0).isValid()?l.value=t:!Number.isNaN(Number(e))&&Number.isFinite(Number(e))?l.value="".concat(ibiz.util.text.format(Number(e),u)):l.value=ibiz.util.text.format("".concat(e),u)}}catch(t){l.value="".concat(e),ibiz.log.error("".concat(e," 值格式化错误"))}else Jt("".concat(e))?l.value=Qt("".concat(e)):l.value="".concat(e);p&&(s.emptyHiddenUnit?l.value&&(l.value+=p):l.value+=p)}var a,n},{immediate:!0});const g=o([]);d&&c(()=>e.data,e=>{s.loadCodeList(e).then(e=>{g.value=e})},{immediate:!0,deep:!0});se(s.model.appCodeListId,s.context.srfappid,e=>{e&&(g.value=e)});const{componentRef:b}=je(()=>t("focus"),()=>t("blur")),f=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));return{ns:i,c:s,text:l,editorRef:b,items:g,valueFormat:u,unitName:p,showFormDefaultContent:f,spanTitle:m}},render(){let e=null;this.c.codeList?e=this.c.codeList.thresholdGroup?this.items.length>0&&n(i("iBizCodeList"),{class:this.ns.e("code-list"),codeListItems:this.items,codeList:this.c.codeList,value:this.value,valueFormat:this.valueFormat,unitName:this.unitName,convertToCodeItemText:this.c.convertToCodeItemText},null):this.items.length>0&&n(i("iBizCodeList"),{class:this.ns.e("code-list"),codeListItems:this.items,codeList:this.c.codeList,value:this.text,convertToCodeItemText:this.c.convertToCodeItemText},null):this.text?(e=this.text,this.spanTitle=this.text):e=n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null);const t="ellipsis"===this.c.editorParams.overflowMode||"ellipsis"===this.c.editorParams.overflowmode||"NOWRAP"===this.c.model.wrapMode;return n("span",{class:[this.ns.b(),this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("is-ellipsis",t)],ref:"editorRef",title:Tt(this.spanTitle)},[e])}}),Lz=a({name:"IBizSpanLink",props:_e(),emits:Ve(),setup(e,{emit:t}){const a=B("span-link"),n=e.controller,i=o("");c(()=>e.value,(e,t)=>{e&&e!==t&&(i.value="".concat(e))},{immediate:!0});const{componentRef:s}=je(()=>t("focus"),()=>t("blur")),l=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));return{ns:a,openLinkView:async()=>{await n.openLinkView(e.data)},curValue:i,editorRef:s,showFormDefaultContent:l}},render(){return n("div",{class:[this.ns.b(),this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[n("a",{onClick:this.openLinkView},[this.curValue])])}});var Rz=Object.defineProperty,_z=(e,t,a)=>(((e,t,a)=>{t in e?Rz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class jz extends Ui{constructor(){super(...arguments),_z(this,"valueItem",""),_z(this,"emptyHiddenUnit",!0),_z(this,"codeList")}async onInit(){var e,t;if(super.onInit(),(null==(t=null==(e=this.model)?void 0:e.editorItems)?void 0:t[0])&&(this.valueItem=this.model.editorItems[0].id),this.model.appCodeListId){const e=await ibiz.hub.getApp(this.context.srfappid);this.codeList=e.codeList.getCodeList(this.model.appCodeListId)}this.extraParams&&(this.emptyHiddenUnit=this.extraParams.emptyHiddenUnit)}async openLinkView(e){const t=this.context.deepClone();e[this.valueItem]&&(t.srfkey=e[this.valueItem]);const{context:a,params:n}=this.handlePublicParams(e,Lt.create(t),this.params),{linkAppViewId:i}=this.model;if(!i)throw new Xt(this.model,ibiz.i18n.t("editor.common.linkViewConfigErr"));return ibiz.commands.execute(Ai.TAG,i,a,n)}}var Vz=Object.defineProperty,Fz=(e,t,a)=>(((e,t,a)=>{t in e?Vz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Uz{constructor(e){Fz(this,"formEditor","IBizSpan"),Fz(this,"gridEditor","IBizSpan"),"SPAN_LINK"===e&&(this.formEditor="IBizSpanLink",this.gridEditor="IBizSpanLink")}async createController(e,t){const a=new jz(e,t);return await a.init(),a}}const Hz=a({name:"IBizInput",props:Fe(),emits:Ve(),setup(e,{emit:t}){const a=B("input"),n=e.controller,i=n.model,s=o(!1),l=o(),d=o(!0),u=o(!1),p=o(2);"TEXTAREA_10"===i.editorType&&(p.value=10),n.editorParams&&("false"!==n.editorParams.SHOWLIMIT&&"false"!==n.editorParams.showlimit||(d.value=!1),"true"!==n.editorParams.ISAUTO&&"true"!==n.editorParams.isauto||(u.value=!0));const m=r(()=>{switch(i.editorType){case"TEXTBOX":case"MOBTEXT":return"text";case"PASSWORD":case"MOBPASSWORD":return"password";case"TEXTAREA":case"TEXTAREA_10":case"MOBTEXTAREA":return"textarea";default:return"string"}}),v=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),g=o("");c(()=>e.value,(e,t)=>{e!==t&&(null==e?g.value="":Jt("".concat(e))?g.value=Qt("".concat(e)):g.value=e.toString())},{immediate:!0});const b=r(()=>{let t="";const{unitName:a}=e.controller.parent;return g.value&&(t=e.controller.formatValue(g.value)),a&&(n.emptyHiddenUnit?t&&(t+=a):t+=a),t}),f=(e,a="blur")=>{a===n.triggerMode&&t("change",e)},w=e=>{e?s.value=e:setTimeout(()=>{s.value=e},100)};let y,C,I=!1;const x=_o(e=>{C!==e&&f(e,"input"),C=void 0,I=!1,y&&y()},300,{leading:!0});c(l,t=>{if(e.autoFocus&&t){const e="textarea"===m.value?"textarea":"input";t.$el.getElementsByTagName(e)[0].focus()}});let S;h(()=>{S&&S.close()});const E=r(()=>{const{unitName:t}=e.controller.parent;let a="".concat(e.controller.formatValue(g.value));return t&&(n.emptyHiddenUnit?a&&(a+=t):a+=t),a}),D=r(()=>n.model.editorParams&&n.model.editorParams.autocomplete&&n.toBoolean(n.model.editorParams.autocomplete)?"on":"new-password"),P=o([]);n.codeList&&c(()=>e.data,e=>{n.loadCodeList(e).then(e=>{P.value=e})},{immediate:!0,deep:!0});return se(n.model.appCodeListId,n.context.srfappid,e=>{e&&(P.value=e)}),{c:n,ns:a,rows:p,type:m,items:P,currentVal:g,readonlyText:E,handleChange:e=>{C!==e&&f(e),C=void 0},handleInput:e=>{I=!0,x(e)},handleKeyUp:e=>{e&&"Enter"===e.code&&(t("enter",e),I&&(y=()=>{l.value.$el.dispatchEvent(e)}))},onBlur:a=>{C=a.target.value,C!=e.value&&f(C),t("blur",a),w(!1)},onFocus:e=>{t("focus",e),w(!0)},editorRef:l,onClick:async()=>{const a=n.model.appDataEntityId;if(!a||!n.deACMode)return;const{zIndex:i}=G(),o=i.increment();S=await ibiz.aiChatUtil.getAIChat();const{containerOptions:s,chatOptions:l}=await ibiz.aiChatUtil.getEditorExAIChatParams(n.editorParams,n.context,n.params,e.data,n.deACMode,{chatInstance:S,view:n.view,ctrl:n.ctrl}),r=await ibiz.aiChatUtil.getAIResourceOptions(n.context,n.params);S.create({resourceOptions:r,containerOptions:{zIndex:o,...s},chatOptions:{caption:n.deACMode.logicName,context:{...n.context},params:{...n.params,srfactag:n.deACMode.codeName},appDataEntityId:a,...l,action:(e,a)=>{"backfill"===e&&t("change",a.realcontent)}}})},shouldAutoComplete:D,isEditable:s,setEditable:w,showLimit:d,isAuto:u,showFormDefaultContent:v,currentFormatVal:b}},render(){const{unitName:e}=this.c.parent,{editorWidth:t,editorHeight:a,predefinedType:o}=this.c.model;let l=null;if(this.readonly)l=this.c.codeList?n(i("iBizCodeList"),{codeListItems:this.items,codeList:this.c.codeList,value:this.currentVal,convertToCodeItemText:this.c.convertToCodeItemText},null):this.readonlyText;else{const t={};e&&(t.suffix=()=>{let t="";return this.c.emptyHiddenUnit?this.currentVal&&(t=e):t=e,n("i",{class:this.ns.e("unit")},[t])}),"AUTH_USERID"===o?t.prefix=()=>n("ion-icon",{name:"person"},null):"AUTH_PASSWORD"===o&&(t.prefix=()=>n("ion-icon",{name:"unlock-alt"},null)),l=n(i("el-input"),y({ref:"editorRef",clearable:!0,modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,placeholder:this.c.placeHolder,type:this.type,rows:this.rows,resize:"none",autosize:this.isAuto,maxlength:this.c.model.maxLength,minlength:this.c.model.minLength,"show-word-limit":this.showLimit&&this.c.model.showMaxLength,onChange:this.handleChange,onInput:this.handleInput,onKeyup:this.handleKeyUp,onBlur:this.onBlur,onFocus:this.onFocus,class:this.ns.b("input"),disabled:this.disabled,"show-password":"password"===this.type,autocomplete:this.shouldAutoComplete},this.$attrs),"function"==typeof(r=t)||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?t:{default:()=>[t]})}var r;const c=n("div",{class:this.ns.b("form-default-content")},[this.currentVal?"password"===this.type?this.currentVal.split("").map(e=>"•"):this.currentFormatVal:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.ns.is("textarea",Object.is(this.type,"textarea")),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],style:{width:t?"".concat(t,"px"):"",height:a?"".concat(a,"px"):""}},[this.showFormDefaultContent&&c,"password"===this.type&&"new-password"===this.shouldAutoComplete?n("input",{type:"text",style:"opacity: 0;position:absolute;width:0;height:0;"},null):null,l,this.c.chatCompletion?n("div",{class:this.ns.e("ai-chat"),title:ibiz.i18n.t("editor.textBox.openAiChat"),onClick:this.onClick},[n("ion-icon",{src:"./assets/images/svg/chat.svg"},null)]):null])}}),qz=a({name:"IBizInputNumber",props:Ue(),emits:Ve(),setup(e,{emit:t}){const a=B("input-number"),n=o(!1),i=e.controller,s=i.model,l=o(null);let d=1/0,u=-1/0;s.editorParams&&(s.editorParams.maxvalue&&(d=Yo(s.editorParams.maxvalue)),s.editorParams.minvalue&&(u=Yo(s.editorParams.minvalue)),s.editorParams.enablethousands&&(n.value=JSON.parse(s.editorParams.enablethousands)));const h=o(!1),p=o(),m=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),v=(e,t=0)=>{const a={minimumFractionDigits:t,maximumFractionDigits:t};return null==e?void 0:e.toLocaleString("en-US",a)};c(()=>e.value,(e,t)=>{if(e!==t){const t=null==e||Object.is(e,"")?null:Number(e);n.value?l.value=Number.isNaN(t)?null:v(t,i.precision?i.precision:0):l.value=Number.isNaN(t)?null:t}},{immediate:!0});const g=r(()=>{if(n.value){if(l.value||0===l.value)return v(Number(l.value),i.precision?i.precision:0)}else if(l.value||0===l.value)return e.controller.formatValue(l.value);return""}),b=e=>{e?h.value=e:setTimeout(()=>{h.value=e},100)};c(p,t=>{if(e.autoFocus&&t){t.$el.getElementsByTagName("input")[0].focus()}});const f=((e,t)=>{let a;return(...n)=>{clearTimeout(a),a=setTimeout(()=>e.apply(this,n),t)}})(e=>{let a=null;"string"==typeof e&&(a=(e=>{const t=e.replace(/,/g,"");return parseFloat(t)})(e)),t("change",a)},300);return{ns:a,c:i,currentVal:l,handleChange:(e,a="blur")=>{a===i.triggerMode&&t("change",e)},onFocus:e=>{t("focus",e),b(!0)},onBlur:e=>{t("blur",e),n.value&&f(l.value),b(!1)},editorRef:p,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},isEditable:h,setEditable:b,showFormDefaultContent:m,max:d,min:u,currentFormatVal:g,enablethousands:n,onInput:e=>{l.value=e}}},render(){const{unitName:e}=this.c.parent;let t=null;this.readonly?(t=fo(this.currentVal)?"":"".concat(this.currentFormatVal),e&&(this.c.emptyHiddenUnit?t&&(t+=e):t+=e)):t=[this.enablethousands?n(i("el-input"),y({ref:"editorRef",class:[this.ns.b("input")],"model-value":this.currentVal,onInput:this.onInput,placeholder:this.c.placeHolder,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp},this.$attrs),null):n(i("el-input-number"),y({ref:"editorRef",class:[this.ns.b("input")],"model-value":this.currentVal,placeholder:this.c.placeHolder,min:this.min,max:this.max,precision:this.c.precision,disabled:this.disabled,controls:!1,onChange:e=>this.handleChange(e,"blur"),onInput:e=>this.handleChange(e,"input"),onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp},this.$attrs),null),e&&n("i",{class:this.ns.e("unit")},[e])];return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&(()=>{let t="";return e&&(this.c.emptyHiddenUnit?this.currentFormatVal&&(t=e):t=e),n("div",{class:this.ns.b("form-default-content")},[this.currentVal||0===this.currentVal?this.currentFormatVal+t:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)])})(),t])}}),Gz=a({name:"IBizInputIP",props:He(),emits:Ve(),setup(e,{emit:t}){const a=B("input-ip"),n=e.controller,i=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),s=o(!1),l=o(!1),d=e=>{const t=e.split(".");return[t[0]||"",t[1]||"",t[2]||"",t[3]||""]},u=e=>e.join("."),h=o(d(e.value||"")),p=o([]);return c(()=>e.value,e=>{h.value=d(e||"")}),c(()=>p.value[0],t=>{e.autoFocus&&t&&t.focus()}),{ns:a,c:n,showFormDefaultContent:i,activeElement:s,ipSegments:h,ipInputs:p,joinIp:u,handleInput:(e,a)=>{var n;if(e=e.replace(/[^0-9]/g,"").slice(0,3)){const t=parseInt(e,10);e=t>255?"255":"".concat(t)}h.value[a]=e;const i=p.value[a],o=null==i?void 0:i.input;if(3===h.value[a].length&&a<3&&o&&o.selectionStart===h.value[a].length&&o.selectionEnd===h.value[a].length){const e=p.value[a+1];e&&(e.focus(),null==(n=e.input)||n.setSelectionRange(0,h.value[a+1].length))}h.value.every(e=>!!e&&/^(0|[1-9]\d?|1\d\d|2[0-4]\d|25[0-5])$/.test(e))&&t("change",u(h.value))},handleKeydown:(e,a)=>{var n,i,o,s,l;if("Enter"!==e.key){if(/^[0-9]$/.test(e.key)){const t=e.target;if(t&&3===h.value[a].length&&t.selectionStart===t.selectionEnd&&(e.preventDefault(),a<3&&t.selectionEnd===h.value[a].length)){const e=a+1,t=p.value[e];t&&(t.focus(),null==(n=t.input)||n.setSelectionRange(0,h.value[e].length))}return}if("."===e.key){e.preventDefault();const t=e.target;if(t&&a<3&&t.selectionStart===t.selectionEnd&&0!==t.selectionEnd&&h.value[a].length){const e=a+1,t=p.value[e];t&&(t.focus(),null==(i=t.input)||i.setSelectionRange(0,h.value[e].length))}return}if("Backspace"===e.key){const t=e.target;if(t&&a>0&&0===t.selectionStart&&0===t.selectionEnd){e.preventDefault();const t=a-1,n=h.value[t],i=p.value[t];n.length>0&&(h.value[t]=n.slice(0,-1)),i&&(i.focus(),null==(o=i.input)||o.setSelectionRange(h.value[t].length,h.value[t].length))}}if("ArrowLeft"===e.key){const t=e.target;if(t&&a>0&&0===t.selectionStart&&0===t.selectionEnd){e.preventDefault();const t=a-1,n=p.value[t];n&&(n.focus(),null==(s=n.input)||s.setSelectionRange(h.value[t].length,h.value[t].length))}}if("ArrowRight"===e.key){const t=e.target;if(t&&a<3&&t.selectionStart===h.value[a].length&&t.selectionEnd===h.value[a].length){e.preventDefault();const t=a+1,n=p.value[t];n&&(n.focus(),null==(l=n.input)||l.setSelectionRange(0,0))}}}else t("enter",e)},handleFocus:()=>{s.value=!0,l.value&&(l.value=!1,t("focus"))},handleBlur:()=>{s.value=!1,setTimeout(()=>{s.value||(l.value=!0,t("blur"))},0)}}},render(){let e=null;e=this.readonly?this.value:n("div",{class:this.ns.b("content")},[this.ipSegments.map((e,t)=>[n(i("el-input"),{"model-value":e,maxlength:4,disabled:this.disabled,readonly:this.readonly,ref:e=>{this.ipInputs[t]=e||void 0},onInput:e=>this.handleInput(e,t),onKeydown:e=>this.handleKeydown(e,t),onFocus:this.handleFocus,onBlur:this.handleBlur},null),t<3&&n("span",{class:this.ns.b("dot")},[p(".")])])]);const t=n("div",{class:this.ns.b("form-default-content")},[this.ipSegments.some(e=>e)?this.joinIp(this.ipSegments):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("focus",this.activeElement&&!this.disabled&&!this.readonly)]},[this.showFormDefaultContent&&t,e])}}),Wz=a({name:"IBizSignature",props:Fe(),emits:Ve(),setup(e,{emit:t}){var a;const n=B("signature"),i=e.controller,s=i.model,l=o({["".concat(ibiz.env.tokenHeader,"Authorization")]:"".concat(ibiz.env.tokenPrefix,"Bearer ").concat(Zt(ea.TOKEN))}),d=o(""),u=o(""),h=o(),p=o(!1),m=o(""),v=o("");let b="true"===(null==(a=null==i?void 0:i.editorParams)?void 0:a.enablenoaccess),f=!1;f=(null==i?void 0:i.editorParams.globaldownloadprifix)?"true"===i.editorParams.globaldownloadprifix:ibiz.config.common.globalDownloadPrifix;let w="img",y=[{label:ibiz.i18n.t("editor.signature.undo"),type:"undo"},{label:ibiz.i18n.t("editor.signature.rewrite"),type:"rewrite"},{label:ibiz.i18n.t("editor.signature.confirm"),type:"confirm",buttonType:"primary"}];if(s.editorParams){if(s.editorParams.mode&&(w=s.editorParams.mode),s.editorParams.buttons)try{y=JSON.parse(s.editorParams.buttons)}catch(e){ibiz.log.error(e)}s.editorParams.enablenoaccess&&(b="true"===s.editorParams.enablenoaccess)}const C=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),I=async()=>{var t,a;if(v.value){if(ibiz.loading.showRedirect(),"img"===w)m.value=v.value;else if(u.value){const a=JSON.parse(v.value)[0],n=u.value.replace("%fileId%",a.id);try{const o={...i.editorParams,enableNoAccess:b,globalDownloadPrifix:f};o.exportparams&&(o.exportParams=JSON.parse(o.exportparams));const s=await ibiz.util.file.requestFile(n,void 0,{context:i.context,params:i.params,data:e.data,file:{fileId:a.id},extraParams:o,downloadTicketParams:i.downloadTicketParams},void 0,b),l=await(null==(t=h.value)?void 0:t.signaturePad.blobToDataURL(s));m.value=l}catch(e){ibiz.log.error(e)}}(()=>{var e;null==(e=h.value)||e.updateSignaturePad(()=>{g(()=>{var e,t;m.value?null==(e=h.value)||e.signaturePad.fromDataURL(m.value):null==(t=h.value)||t.signaturePad.clear()})})})(),null==(a=h.value)||a.signaturePad.loadImage(m.value,()=>{ibiz.loading.hideRedirect()})}};c(()=>e.data,e=>{if(e){const t={...i.editorParams,enableNoAccess:b,globalDownloadPrifix:f};t.uploadparams&&(t.uploadParams=JSON.parse(t.uploadparams));const a=ibiz.util.file.calcFileUpDownUrl(i.context,i.params,e,t);d.value=a.uploadUrl,u.value=a.downloadUrl}},{immediate:!0,deep:!0}),c(()=>e.value,async(e,t)=>{e!==t&&(v.value=e?"".concat(e||""):"",await I())},{immediate:!0});const x=e=>{t("change",e)},S=async e=>{const t=await(async e=>{const{type:t}=(e=>({type:e.split(",")[0].split(":")[1].split(";")[0]}))(e),a=ta(e),n="signature_".concat(Date.now(),".png"),i=new File([a],n,{type:t});return await ibiz.util.file.fileUpload(d.value,i,l.value)})(e);x(JSON.stringify([{name:t.name,id:t.id}]))},E=()=>{var e,t,a;if(p.value=!1,!(null==(e=h.value)?void 0:e.signaturePad.isRedrawn()))return;if(null==(t=h.value)?void 0:t.signaturePad.isEmpty())return void(()=>{var e;null==(e=h.value)||e.signaturePad.clear(),m.value="",x(null)})();const n=null==(a=h.value)?void 0:a.signaturePad.toDataURL();if(n!==m.value)if(m.value=n,"file"===w)S(n);else x(n)};return{c:i,ns:n,signatureRef:h,fullScreen:p,currentDataURL:m,buttons:y,showFormDefaultContent:C,handleButtonClick:e=>{var t,a;switch(e){case"undo":null==(t=h.value)||t.signaturePad.undoLastStep();break;case"rewrite":null==(a=h.value)||a.signaturePad.clear();break;case"confirm":E()}}}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[n(i("iBizSignaturePad"),{ref:"signatureRef",class:this.ns.e("pad"),options:{...this.c.model.editorParams,...this.$attrs}},null),!this.readonly&&n("div",{class:this.ns.e("toolbar")},[this.buttons.map(e=>n(i("el-button"),{disabled:this.disabled,type:e.buttonType&&e.buttonType.toLowerCase()||"default",onClick:()=>this.handleButtonClick(e.type)},{default:()=>[e.label]}))])])}});var Yz=Object.defineProperty,Kz=(e,t,a)=>(((e,t,a)=>{t in e?Yz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Xz extends Ui{constructor(){super(...arguments),Kz(this,"precision"),Kz(this,"deService"),Kz(this,"deACMode"),Kz(this,"keyName","srfkey"),Kz(this,"textName","srfmajortext"),Kz(this,"sort","asc"),Kz(this,"dataItems",[]),Kz(this,"chatCompletion",!1),Kz(this,"codeList"),Kz(this,"emptyHiddenUnit",!0)}async onInit(){if(await super.onInit(),this.precision=this.editorParams.precision?Yo(this.editorParams.precision):this.model.precision,"TEXTAREA"===this.model.editorType||"TEXTAREA_10"===this.model.editorType||"MOBTEXTAREA"===this.model.editorType){const e=this.model;if(e.appDEACModeId&&(this.deACMode=await ga(e.appDEACModeId,e.appDataEntityId,this.context.srfappid),this.deACMode)){if("AUTOCOMPLETE"===this.deACMode.actype){const{minorSortAppDEFieldId:e,minorSortDir:t}=this.deACMode;e&&t&&(this.sort="".concat(e.toLowerCase(),",").concat(t.toLowerCase())),this.deACMode.textAppDEFieldId&&(this.textName=this.deACMode.textAppDEFieldId),this.deACMode.valueAppDEFieldId&&(this.keyName=this.deACMode.valueAppDEFieldId),this.deACMode.deacmodeDataItems&&(this.dataItems=[],this.deACMode.deacmodeDataItems.forEach(e=>{"value"!==e.id&&"text"!==e.id&&this.dataItems.push(e)}))}"CHATCOMPLETION"===this.deACMode.actype&&ibiz.env.enableAI&&(this.deService=await ibiz.hub.getApp(e.appId).deService.getService(this.context,e.appDataEntityId),this.chatCompletion=!0)}}if("AUTH_USERID"!==this.model.predefinedType||this.placeHolder?"AUTH_PASSWORD"!==this.model.predefinedType||this.placeHolder||(this.placeHolder=ibiz.i18n.t("app.pleaseEnterPassword")):this.placeHolder=ibiz.i18n.t("app.pleaseEnterAccount"),this.model.appCodeListId){const e=await ibiz.hub.getApp(this.context.srfappid);this.codeList=e.codeList.getCodeList(this.model.appCodeListId)}this.extraParams&&(this.emptyHiddenUnit=this.extraParams.emptyHiddenUnit)}}var $z=Object.defineProperty,Jz=(e,t,a)=>(((e,t,a)=>{t in e?$z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Qz{constructor(e){Jz(this,"formEditor","IBizInput"),Jz(this,"gridEditor","IBizInput"),"NUMBER"===e&&(this.formEditor="IBizInputNumber",this.gridEditor="IBizInputNumber"),"IPADDRESSTEXTBOX"===e&&(this.formEditor="IBizInputIP",this.gridEditor="IBizInputIP"),"SIGNATURE"===e&&(this.formEditor="IBizSignature",this.gridEditor="IBizSignature")}async createController(e,t){const a=new Xz(e,t);return await a.init(),a}}const Zz=a({name:"IBizDropdown",props:qe(),emits:Ve(),setup(e,{emit:t}){var a;const s=B("dropdown"),l=e.controller,u=o([]),p=o([]),m=o(!1),v=o(!1),b=o([]),f=o(!1),w=o(),y=l.model.editorItems,C=o(!1);let I,x="";const S=o(!1),E=o(),D=(null==(a=l.editorParams)?void 0:a.valueseparator)||",",P=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),k=r(()=>"DROPDOWNLIST_100"===l.model.editorType?s.cssVarBlock({width:"100px"}):{}),z=e=>{if(0===e.length)return[];const t=[],a=new Set(p.value.map(e=>e.value));return e.forEach(e=>{var n;a.has(e.value)||p.value.push(e);const i={label:e.text,value:null==(n=e.value)?void 0:n.toString(),color:null==e?void 0:e.color,textCls:null==e?void 0:e.textCls,sysImage:e.sysImage,disabled:!0===e.disableSelect,children:[]};e.children&&e.children.length>0&&(i.children=z(e.children)),t.push(i)}),t},T=e=>{u.value=[],p.value=[],l.multiple&&!e.some(e=>e.children)&&(e=l.handleCodeListAllItems(e)),l.blankItemName&&!l.multiple?u.value=[{value:void 0,text:l.blankItemName},...e]:u.value=e;for(let t=0;t<u.value.length;t++){if(u.value[t].children){v.value=!0,b.value=z(e);break}}},A=async()=>{if(l.model.appCodeListId){const e=ibiz.hub.getApp(l.context.srfappid).codeList.getCodeList(l.model.appCodeListId);e&&(S.value=e.codeItemValueNumber||!1)}C.value=!0;const t=await l.loadCodeList(e.data);T(t),m.value=!0,C.value=!1};c(()=>e.value,async(e,t)=>{(e||null===e||0===e)&&(m.value||void 0!==t||await A())},{immediate:!0});const O=e=>{e?f.value=e:setTimeout(()=>{f.value=e},100)},{getSelection:M,getSelectionValue:N}=Hi(l.allItemsValue),L=r({get(){var t,a,n;return m.value?y&&y.length>0&&!l.multiple?null==(t=e.data[y[0].id])?void 0:t.toString():e.value&&"string"==typeof e.value?l.allItems&&l.multiple&&!v.value?M([],e.value.split(D),u.value,u.value).map(e=>"".concat(e)):l.multiple?null==(a=e.value)?void 0:a.toString().split(D):e.value.toString():e.value&&Array.isArray(e.value)?l.allItems&&l.multiple&&!v.value?M([],e.value,u.value,u.value).map(e=>"".concat(e)):l.multiple?e.value:e.value.toString():l.multiple?[]:(null==(n=e.value)?void 0:n.toString())||"":l.multiple?[]:""},set(a){let n=a;if(l.blankItemName&&!a&&(n=void 0),Array.isArray(n)){if(l.allItems&&l.multiple&&!v.value){const e=M(L.value,n,u.value,u.value);n=N(e).map(e=>"".concat(e))}let e=null;e=0===n.length?null:"SIMPLES"===l.model.valueType?n:n.join(D),t("change",e)}else if(y&&y.length>0){let e=n;S.value&&(e=""===n?null:Number(n)),t("change",e,y[0].id);const a=(i=S.value?Number(n):n,(v.value?p.value:u.value).find(e=>e.value===i));a&&t("change",a.text)}else{let e=n;S.value&&(e=""===n?null:Number(n)),t("change",e)}var i;O(!1),"true"!==l.editorParams.alwaysLoad&&"true"!==l.editorParams.alwaysload||A(),e.autoFocus&&(x="blur",t("blur"))}}),R=r(()=>{const e=Array.isArray(L.value)?L.value:[L.value],t=v.value?p.value:u.value,a=[];return e.forEach(e=>{t.forEach(t=>{(S.value?t.value===Number(e):t.value===e)&&a.push(t.text)})}),a.join(D)});c(R,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),c(w,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const _=e=>(v.value?p.value:u.value).find(t=>t.text===e);se(l.model.appCodeListId,l.context.srfappid,e=>{e&&T(e)}),d(()=>{(()=>{const{navigateContexts:t=[],navigateParams:a=[]}=l.model,n=[];[...t,...a].forEach(e=>{!e.rawValue&&e.value&&n.push(e.value)}),c(()=>{const t={};return Object.keys(e.data).forEach(a=>{n.includes(a)&&(t[a]=e.data[a])}),t},()=>{e.data&&A()},{deep:!0})})(),w.value&&(I=le(w,async e=>{x="outside"}))}),h(()=>{I&&I.stop&&I.stop()});const j={};return"round"===l.editorParams.type&&Object.assign(j,{prefix:()=>R.value.split(D).map(e=>{const t=_(e);return n("div",{class:[s.b("select-option-text"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?s.cssVarBlock({"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(t.bkcolor||""),"select-option-item-padding":"0 var(".concat(s.cssVarName("spacing-base"),")")}):""},[(null==t?void 0:t.sysImage)&&n(i("iBizIcon"),{icon:null==t?void 0:t.sysImage},null),e||""])})}),{ns:s,c:l,curValue:L,items:u,customNodeClass:(e,t)=>e.children.length?s.e("branch-node"):null,valueText:R,hasChildren:v,onBlur:e=>{x="blur",t("blur",e),O(!1)},onFocus:e=>{x="focus",t("focus",e),O(!0)},editorRef:w,treeNodes:b,cssVars:k,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},getCodeListItem:_,isEditable:f,setEditable:O,showFormDefaultContent:P,onVisibleChange:async e=>{var t,a,n;const i="SEARCHFORM"===(null==(n=null==(a=null==(t=l.parent)?void 0:t.form)?void 0:a.model)?void 0:n.controlType);!e&&i&&g(()=>{var e;null==(e=E.value)||e.focus()}),!e||m.value&&"true"!==l.editorParams.alwaysLoad&&"true"!==l.editorParams.alwaysload||(await A(),v.value&&w.value&&"outside"!==x&&g(()=>{w.value.focus()}),g(()=>{window.dispatchEvent(new Event("resize"))}))},isLoading:C,prefix:j,hiddenInputRef:E,valueSeparator:D}},render(){const e="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),t=this.hasChildren?n(i("el-tree-select"),y({ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,clearable:!0,class:[this.ns.b("select")],filterable:!0,teleported:!this.showFormDefaultContent,data:this.treeNodes,"allow-create":!this.c.forceSelection,"default-first-option":this.c.defaultFirstOption,"check-strictly":!0,"render-after-expand":!0,multiple:this.c.multiple,placeholder:this.c.placeHolder?this.c.placeHolder:" ",disabled:this.disabled,loading:this.isLoading,"fit-input-width":e,onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp,onVisibleChange:this.onVisibleChange,"popper-class":"".concat(this.ns.b("popper")," ").concat(this.ns.is("allow-create",!this.c.forceSelection)),props:{class:this.customNodeClass}},this.$attrs),{default:t=>{const a=(t.data||{}).label||"";return n("span",{title:Tt(e?a:"")},[a])}}):n(i("el-select"),y({ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,clearable:!0,class:[this.ns.b("select")],filterable:!0,teleported:!this.showFormDefaultContent,multiple:this.c.multiple,"allow-create":!this.c.forceSelection,placeholder:this.c.placeHolder?this.c.placeHolder:" ",disabled:this.disabled,loading:this.isLoading,"fit-input-width":e,"popper-class":"".concat(this.ns.b("popper")," ").concat("round"===this.c.editorParams.type?this.ns.bm("popper","round"):""," ").concat(this.ns.bm("popper","".concat(this.c.model.id))),onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp,onVisibleChange:this.onVisibleChange},this.$attrs),{default:()=>this.items.map(t=>{var a;return n(i("el-option"),{key:t.value,value:null==(a=t.value)?void 0:a.toString(),label:t.text,disabled:!0===t.disableSelect,style:t.bkcolor?this.ns.cssVarBlock({"select-option-item-bkcolor":"".concat(t.bkcolor)}):"",class:[t.cls?t.cls:null],title:Tt(e?t.text:"")},{default:()=>n("div",{class:[this.ns.b("select-option-content"),t.textCls?t.textCls:null],style:t.color?this.ns.cssVarBlock({"select-option-item-color":"".concat(t.color)}):""},[t.sysImage&&n(i("iBizIcon"),{icon:t.sysImage},null),n("span",{class:[e&&this.ns.be("select-option-content","text")]},[t.text])])})}),...this.prefix}),a=this.valueText.split(this.valueSeparator).map(e=>{const t=this.getCodeListItem(e);return n("span",{class:[this.ns.b("readonly-text-item"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?this.ns.cssVarBlock({"readonly-text-item-color":"".concat(t.color||""),"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(("round"===this.c.editorParams.type?t.bkcolor:"")||"")}):""},[(null==t?void 0:t.sysImage)&&n(i("iBizIcon"),{icon:null==t?void 0:t.sysImage},null),n("span",{class:this.ns.be("readonly-text-item","label")},[e])])}),o=n("div",{class:[this.ns.b("form-default-content"),this.ns.is("multiple",this.c.multiple)]},[this.valueText?this.valueText.split(this.valueSeparator).map(e=>{const t=this.getCodeListItem(e);return n("span",{class:[this.ns.b("content-item"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?this.ns.cssVarBlock({"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(("round"===this.c.editorParams.type?t.bkcolor:"")||"")}):""},[n("span",{class:this.ns.be("content-item","label")},[e])])}):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]),s=n("input",{ref:"hiddenInputRef",type:"text",class:this.ns.e("hidden-input"),readonly:!0,onKeyup:this.handleKeyUp},null);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent),"round"===this.c.editorParams.type&&this.ns.m("round")],style:this.cssVars},[this.showFormDefaultContent&&o,this.readonly?a:t,this.readonly?null:s])}}),eT=a({name:"IBizEmojiPicker",props:qe(),emits:Ve(),setup(e,{emit:t}){const a=B("emoji-picker"),s=e.controller,l=o(),d=o(""),u=o(!1),h=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),p=e=>{e.stopPropagation(),e.preventDefault(),u.value=!0},m=e=>{e.stopPropagation(),e.preventDefault(),d.value="",u.value=!1,t("change",""),l.value.click()};c(()=>e.value,(e,t)=>{e!==t&&(d.value=e&&Jt("".concat(e))?Qt(e):e)},{immediate:!0});const v=()=>{let e=n("span",{class:[a.e("button-content")],onClick:p},[n("svg",{class:a.em("button-content","icon"),viewBox:"0 0 1040 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1490",width:"1em",height:"1em"},[n("path",{d:"M512.075261 1024A511.774217 511.774217 0 1 1 730.482434 48.769072a37.630457 37.630457 0 1 1-32.061149 68.035867 436.513303 436.513303 0 1 0 250.468323 395.270322 37.630457 37.630457 0 0 1 75.260914 0 512.526826 512.526826 0 0 1-512.075261 511.924739z","p-id":"1491"},null),n("path",{d:"M333.857416 344.0929a57.348817 57.348817 0 1 0 57.348817 57.348817 57.499339 57.499339 0 0 0-57.348817-57.348817zM686.53006 344.0929a57.348817 57.348817 0 1 0 57.348817 57.348817 57.348817 57.348817 0 0 0-57.348817-57.348817zM515.236219 783.165074c-162.864619 0-262.359547-141.942084-262.359547-219.159782a30.104366 30.104366 0 0 1 60.208731 0c0 48.618551 76.314567 158.951051 202.150816 158.951051s193.571072-134.114949 193.571072-158.951051a30.104366 30.104366 0 0 1 60.208731 0c0 54.488902-90.012054 219.159782-253.779803 219.159782zM1009.549904 207.720123h-67.132735V139.985301a30.104366 30.104366 0 1 0-60.208732 0v67.734822h-67.734822a30.104366 30.104366 0 0 0-30.104366 30.104366 30.104366 30.104366 0 0 0 30.104366 30.104366h67.734822v67.734823a30.104366 30.104366 0 0 0 60.208732 0v-67.734823h67.734823a30.104366 30.104366 0 0 0 30.104365-30.104366 30.104366 30.104366 0 0 0-30.706453-30.104366z","p-id":"1492"},null)]),ibiz.i18n.t("editor.emojiPicker.addEmoji")]);return d.value&&(e=n("span",{class:[a.e("button-content")]},[n("svg",{class:a.em("button-content","icon"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em",onClick:m},[n("path",{d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"},null)]),n("span",{innerHTML:d.value},null)])),e};return{ns:a,c:s,emoji:d,visible:u,emojiRef:l,showFormDefaultContent:h,onSelect:e=>{u.value=!1,d.value=e.data,t("change",aa(e.data))},onAddEmoji:p,onClearEmoji:m,renderReference:()=>n(i("el-button"),{class:[a.e("button"),a.is("clear",!!d.value)]},{default:()=>[h.value&&n("div",{class:[a.b("form-default-content"),a.is("clear",!!d.value)]},[d.value?d.value:n(i("iBizEditorEmptyText"),{showPlaceholder:s.emptyShowPlaceholder,placeHolder:s.placeHolder},null)]),v()]})}},render(){return n("div",{ref:"emojiRef",class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("active",this.visible),this.ns.is("show-default",this.showFormDefaultContent)]},[n(i("el-popover"),{trigger:"click",placement:"bottom-start",width:"auto",visible:this.visible,"onUpdate:visible":e=>this.visible=e,"hide-after":0,"popper-class":[this.ns.b("popper")]},{reference:()=>this.renderReference(),default:()=>n(i("iBizEmojiSelect"),{continuousList:!0,dark:!0,onSelect:this.onSelect},null)})])}}),tT=a({name:"IBizVirtualizedList",props:qe(),emits:Ve(),setup(e,{emit:t}){const a=B("dropdown"),s=e.controller,l=o([]),u=o([]),p=o(!1),m=o(!1),v=o([]),b=o(),f=s.model.editorItems,w=o(!1);let y="";const C=o(!1),I=e=>{if(0===e.length)return[];const t=[],a=new Set(u.value.map(e=>e.value));return e.forEach(e=>{var n;a.has(e.value)||u.value.push(e);const i={label:e.text,value:null==(n=e.value)?void 0:n.toString(),color:null==e?void 0:e.color,textCls:null==e?void 0:e.textCls,sysImage:e.sysImage,disabled:!0===e.disableSelect,children:[]};e.children&&e.children.length>0&&(i.children=I(e.children)),t.push(i)}),t},x=e=>{l.value=[],u.value=[],s.multiple&&!e.some(e=>e.children)&&(e=s.handleCodeListAllItems(e)),s.blankItemName&&!s.multiple?l.value=[{value:void 0,text:s.blankItemName},...e]:l.value=e;for(let t=0;t<l.value.length;t++){if(l.value[t].children){m.value=!0,v.value=I(e);break}}},S=async()=>{if(s.model.appCodeListId){const e=ibiz.hub.getApp(s.context.srfappid).codeList.getCodeList(s.model.appCodeListId);e&&(C.value=e.codeItemValueNumber||!1)}w.value=!0;const t=await s.loadCodeList(e.data);x(t),p.value=!0,w.value=!1};c(()=>e.value,async(e,t)=>{(e||null===e||0===e)&&(p.value||void 0!==t||await S())},{immediate:!0});const{getSelection:E,getSelectionValue:D}=Hi(s.allItemsValue),P=r({get(){var t,a,n;return p.value?f&&f.length>0&&!s.multiple?null==(t=e.data[f[0].id])?void 0:t.toString():e.value&&"string"==typeof e.value?s.allItems&&s.multiple&&!m.value?E([],e.value.split(","),l.value,l.value).map(e=>"".concat(e)):s.multiple?null==(a=e.value)?void 0:a.toString().split(","):e.value.toString():e.value&&Array.isArray(e.value)?s.allItems&&s.multiple&&!m.value?E([],e.value,l.value,l.value).map(e=>"".concat(e)):s.multiple?e.value:e.value.toString():s.multiple?[]:(null==(n=e.value)?void 0:n.toString())||"":s.multiple?[]:""},set(a){let n=a;if(s.blankItemName&&!a&&(n=void 0),Array.isArray(n)){if(s.allItems&&s.multiple&&!m.value){const e=E(P.value,n,l.value,l.value);n=D(e).map(e=>"".concat(e))}let e=null;e=0===n.length?null:"SIMPLES"===s.model.valueType?n:n.join(","),t("change",e)}else if(f&&f.length>0){let e=void 0===n?null:n;C.value&&null!==e&&(e=Number(n)),t("change",e,f[0].id);const a=(i=C.value?Number(n):n,(m.value?u.value:l.value).find(e=>e.value===i));a&&t("change",a.text)}else{let e=void 0===n?null:n;C.value&&null!==e&&(e=Number(n)),t("change",e)}var i;"true"!==s.editorParams.alwaysLoad&&"true"!==s.editorParams.alwaysload||S(),e.autoFocus&&(y="blur",t("blur"))}}),k=r(()=>{const e=Array.isArray(P.value)?P.value:[P.value],t=m.value?u.value:l.value,a=[];return e.forEach(e=>{t.forEach(t=>{(C.value?t.value===Number(e):t.value===e)&&a.push(t.text)})}),a.join(",")});c(k,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),c(b,t=>{var a;e.autoFocus&&t&&t.focus&&(null==(a=t.focus)||a.call(t))});const z=e=>{y="focus",t("focus",e)},T=e=>{y="blur",t("blur",e)},A=e=>(m.value?u.value:l.value).find(t=>t.text===e);se(s.model.appCodeListId,s.context.srfappid,e=>{e&&x(e)});const O=e=>{const t=e.target;"focus"!==y||b.value.$el.contains(t)||b.value.$refs.popper.popperRef.contentRef.contains(t)||T(e)};d(()=>{(()=>{const{navigateContexts:t=[],navigateParams:a=[]}=s.model,n=[];[...t,...a].forEach(e=>{!e.rawValue&&e.value&&n.push(e.value)}),c(()=>{const t={};return Object.keys(e.data).forEach(a=>{n.includes(a)&&(t[a]=e.data[a])}),t},()=>S(),{deep:!0})})(),document.addEventListener("click",O,{capture:!0})}),h(()=>{document.removeEventListener("click",O,{capture:!0})});const M={};return"round"===s.editorParams.type&&Object.assign(M,{prefix:()=>k.value.split(",").map(e=>{const t=A(e);return n("div",{class:[a.b("select-option-text"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?a.cssVarBlock({"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(t.bkcolor||""),"select-option-item-padding":"0 var(".concat(a.cssVarName("spacing-base"),")")}):""},[(null==t?void 0:t.sysImage)&&n(i("iBizIcon"),{icon:null==t?void 0:t.sysImage},null),e||""])})}),{c:s,ns:a,items:l,prefix:M,curValue:P,editorRef:b,isLoading:w,treeNodes:v,valueText:k,hasChildren:m,onBlur:T,onFocus:z,handleClear:()=>{z()},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},customNodeClass:(e,t)=>e.children.length?a.e("branch-node"):null,getCodeListItem:A,onVisibleChange:async e=>{!e||p.value&&"true"!==s.editorParams.alwaysLoad&&"true"!==s.editorParams.alwaysload||(await S(),m.value&&b.value&&"outside"!==y&&g(()=>{var e,t;null==(t=(e=b.value).focus)||t.call(e)}),g(()=>{window.dispatchEvent(new Event("resize"))}))}}},render(){const e="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),t=n(i("el-select-v2"),y({ref:"editorRef",modelValue:this.curValue||void 0,"onUpdate:modelValue":e=>{this.curValue=e},clearable:!0,class:[this.ns.b("select")],filterable:!0,multiple:this.c.multiple,"allow-create":!this.c.forceSelection,placeholder:this.c.placeHolder?this.c.placeHolder:" ",disabled:this.disabled,loading:this.isLoading,"fit-input-width":e,"popper-class":"".concat(this.ns.b("popper")," ").concat("round"===this.c.editorParams.type?this.ns.bm("popper","round"):""," ").concat(this.ns.bm("popper","".concat(this.c.model.id))," ").concat(this.ns.b("virtualized-list-popper")),onFocus:this.onFocus,onClear:this.handleClear,onKeyup:this.handleKeyUp,onVisibleChange:this.onVisibleChange,options:this.items,props:{key:"value",label:"text"}},this.$attrs),{default:t=>{const{item:a}=t;return n("div",{style:a.bkcolor?this.ns.cssVarBlock({"select-option-item-bkcolor":"".concat(a.bkcolor)}):"",class:["select-v2-option-item",a.cls?a.cls:null,!0===a.disableSelect?"disabled-select-v2":null],title:Tt(e?a.text:"")},[n("div",{class:[this.ns.b("select-option-content"),a.textCls?a.textCls:null],style:a.color?this.ns.cssVarBlock({"select-option-item-color":"".concat(a.color)}):""},[a.sysImage&&n(i("iBizIcon"),{icon:a.sysImage},null),n("span",{class:[e&&this.ns.be("select-option-content","text")]},[a.text])])])},...this.prefix}),a=this.valueText.split(",").map(e=>{const t=this.getCodeListItem(e);return n("span",{class:[this.ns.b("readonly-text-item"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?this.ns.cssVarBlock({"readonly-text-item-color":"".concat(t.color||""),"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(("round"===this.c.editorParams.type?t.bkcolor:"")||"")}):""},[(null==t?void 0:t.sysImage)&&n(i("iBizIcon"),{icon:null==t?void 0:t.sysImage},null),n("span",{class:this.ns.be("readonly-text-item","label")},[e])])});return n("div",{class:[this.ns.b(),this.ns.b("virtualized-list"),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"","round"===this.c.editorParams.type&&this.ns.m("round"),this.ns.is("has-value",null!=this.value&&""!==this.value)]},[this.readonly?a:t])}});function aT(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const nT=a({name:"IBizTreePicker",props:qe(),emits:Ve(),setup(e,{emit:t}){const a=B("tree-picker"),n=e.controller,i=n.model,s=o([]),l=o([]),r=o(!1),u=o([]),h=o([]),p=o(!1),m=o(!1),v=o(""),g=o(),b=o(!0),f=o(!1),w=o([]),y=n.model.valueSeparator||",";let C=!1;if(i.editorParams){const{editorParams:e}=i;e.showtoolbar&&(C="true"===e.showtoolbar)}const I=e=>{if(0===e.length)return[];const t=[];return e.forEach(e=>{var a;-1===l.value.findIndex(t=>t.value===e.value)&&l.value.push(e);const n={label:e.text,value:null==(a=e.value)?void 0:a.toString(),color:null==e?void 0:e.color,textCls:null==e?void 0:e.textCls,sysImage:e.sysImage,disabled:!0===e.disableSelect,children:[]};e.children&&e.children.length>0&&(n.children=I(e.children)),t.push(n)}),t},x=e=>{s.value=[],l.value=[];let t=e;n.multiple&&!t.some(e=>e.children)&&(t=n.handleCodeListAllItems(t)),s.value=t;for(let e=0;e<s.value.length;e++){if(s.value[e].children){u.value=I(t);break}}},S=async()=>{if(n.model.appCodeListId){const e=ibiz.hub.getApp(n.context.srfappid).codeList.getCodeList(n.model.appCodeListId);e&&(m.value=e.codeItemValueNumber||!1)}p.value=!0;const t=await n.loadCodeList(e.data);x(t),r.value=!0,p.value=!1};c(()=>e.value,async(e,t)=>{if(e){let a=[];r.value||void 0!==t||await S(),Wo(e)?a=e:Lo(e)&&(a=e.split(y)),h.value=a.filter(e=>l.value.find(t=>t.value===e&&t.isLeaf))}},{immediate:!0});const E=e=>{let a=null;a="SIMPLES"===n.model.valueType?e:e.join(y),t("change",a)};se(n.model.appCodeListId,n.context.srfappid,e=>{e&&x(e)}),d(()=>{S()});c(v,e=>{var t;null==(t=g.value)||t.filter(e)});const D=(e=!0)=>{l.value.forEach(t=>{t.children&&t.children.length>0&&((e,t)=>{var a;const n=null==(a=g.value)?void 0:a.getNode(e);n.isLeaf||(t?n.expand():n.collapse())})(t.value,e)})};return{ns:a,c:n,items:s,treeRef:g,filterText:v,treeNodes:u,isCancel:b,defaultCheckedKeys:h,expandedKeys:w,showToolbar:C,onNodeExpand:(...e)=>{e[0]&&e[0].value&&w.value.push(e[0].value)},onNodeCollapse:(...e)=>{if(e[0]&&e[0].value){const t=w.value.findIndex(t=>e[0].value===t);-1!==t&&w.value.splice(t,1)}},filterNode:(e,t)=>!e||t.label&&t.label.includes(e),customNodeClass:e=>e.children.length?a.e("branch-node"):null,onAllExpand:()=>{f.value=!0,D()},onAllCollapse:()=>{f.value=!1,D(!1)},onAllSelect:()=>{var e,t;const a=null==(e=l.value)?void 0:e.map(e=>e.value);D(f.value),null==(t=g.value)||t.setCheckedKeys(a),E(a)},onAllCancel:()=>{var e;D(f.value),null==(e=g.value)||e.setCheckedKeys([]),E([])},onCheck:(...e)=>{if(e[1]){const{checkedKeys:t,halfCheckedKeys:a}=e[1],n=[...a,...t].filter((e,t,a)=>a.indexOf(e)===t);E(n)}}}},render(){const e=this.readonly||this.disabled,t=[n("div",{class:[this.ns.e("search")]},[n(i("el-input"),{modelValue:this.filterText,"onUpdate:modelValue":e=>this.filterText=e,placeholder:this.c.placeHolder||" "},null)]),n("div",{class:[this.ns.e("tree")]},[n(i("el-tree"),{ref:"treeRef",class:this.ns.b("tree"),data:this.treeNodes,"node-key":"value",props:{children:"children",label:"label",class:this.customNodeClass},"show-checkbox":!e,"default-checked-keys":this.defaultCheckedKeys,"default-expanded-keys":this.expandedKeys,"filter-node-method":this.filterNode,onNodeExpand:this.onNodeExpand,onNodeCollapse:this.onNodeCollapse,onCheck:this.onCheck},null)])];if(!e&&this.showToolbar){let e,a,o,s;t.unshift(n("div",{class:[this.ns.e("header")]},[n(i("el-button"),{type:"primary",onClick:this.onAllSelect},aT(e=ibiz.i18n.t("editor.treePicker.allowAll"))?e:{default:()=>[e]}),n(i("el-button"),{type:"primary",onClick:this.onAllCancel},aT(a=ibiz.i18n.t("editor.treePicker.allProhibited"))?a:{default:()=>[a]}),n(i("el-button"),{type:"primary",onClick:this.onAllExpand},aT(o=ibiz.i18n.t("editor.treePicker.expandAll"))?o:{default:()=>[o]}),n(i("el-button"),{type:"primary",onClick:this.onAllCollapse},aT(s=ibiz.i18n.t("editor.treePicker.collapseAll"))?s:{default:()=>[s]})]))}return n("div",{class:[this.ns.b()]},[t])}});var iT=Object.defineProperty,oT=(e,t,a)=>(((e,t,a)=>{t in e?iT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class sT extends Ui{constructor(){super(...arguments),oT(this,"multiple",!1),oT(this,"forceSelection",!0),oT(this,"defaultFirstOption",!1),oT(this,"blankItemName","")}async onInit(){var e,t,a,n,i,o;super.onInit(),"MDROPDOWNLIST"!==this.model.editorType&&"MOBCHECKLIST"!==this.model.editorType||(this.multiple=!0),(null==(e=this.editorParams)?void 0:e.forceSelection)&&(this.forceSelection=this.toBoolean(this.editorParams.forceSelection)),(null==(t=this.editorParams)?void 0:t.forceselection)&&(this.forceSelection=this.toBoolean(this.editorParams.forceselection)),(null==(a=this.editorParams)?void 0:a.defaultFirstOption)&&(this.defaultFirstOption=this.toBoolean(this.editorParams.defaultFirstOption)),(null==(n=this.editorParams)?void 0:n.defaultfirstoption)&&(this.defaultFirstOption=this.toBoolean(this.editorParams.defaultfirstoption)),(null==(i=this.editorParams)?void 0:i.blankItemName)&&(this.blankItemName=this.editorParams.blankItemName),(null==(o=this.editorParams)?void 0:o.blankitemname)&&(this.blankItemName=this.editorParams.blankitemname)}}var lT=Object.defineProperty,rT=(e,t,a)=>(((e,t,a)=>{t in e?lT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class cT{constructor(e){rT(this,"formEditor","IBizDropdown"),rT(this,"gridEditor","IBizDropdown");let t="IBizDropdown";switch(e){case"EMOJI_PICKER":t="IBizEmojiPicker";break;case"VIRTUALIZED_LIST":t="IBizVirtualizedList";break;case"TREE_PICKER":t="IBizTreePicker"}this.formEditor=t,this.gridEditor=t}async createController(e,t){const a=new sT(e,t);return await a.init(),a}}const dT=a({name:"IBizCheckbox",props:Ge(),emits:Ve(),setup(e,{emit:t}){var a,n,i,o;const s=B("checkbox"),l=e.controller.model;let c=1,d=0;(null==(a=l.editorParams)?void 0:a.selectValue)&&(c=l.editorParams.selectValue),(null==(n=l.editorParams)?void 0:n.selectvalue)&&(c=l.editorParams.selectvalue),(null==(i=l.editorParams)?void 0:i.nullValue)&&(d=l.editorParams.nullValue),(null==(o=l.editorParams)?void 0:o.nullvalue)&&(d=l.editorParams.nullvalue);const u=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),{useInFocusAndBlur:h,useInValueChange:p}=We(e,t),m=r({get:()=>e.value==c,set(e){let a;a=e?c:d,t("change",a),p()}}),{componentRef:v}=je(()=>t("focus"),()=>h());return{ns:s,editorModel:l,currentVal:m,editorRef:v,showFormDefaultContent:u}},render(){return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[n(i("el-checkbox"),y({modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.disabled||this.readonly},this.$attrs),null)])}});class uT extends qi{}var hT=Object.defineProperty,pT=(e,t,a)=>(((e,t,a)=>{t in e?hT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class mT{constructor(){pT(this,"formEditor","IBizCheckbox"),pT(this,"gridEditor","IBizCheckbox")}async createController(e,t){const a=new uT(e,t);return await a.init(),a}}const vT=a({name:"IBizCheckboxList",props:Ye(),emits:Ve(),setup(e,{emit:t}){const a=B("checkbox-list"),n=e.controller,i=n.codeList,s=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),l=o([]);c(()=>e.data,e=>{n.loadCodeList(e).then(e=>{l.value=n.handleCodeListAllItems(e)})},{immediate:!0,deep:!0});const d=r(()=>i&&i.orMode?i.orMode:"STR"),u=Gi(d.value,n.model.valueType);se(n.model.appCodeListId,n.context.srfappid,e=>{e&&(l.value=n.handleCodeListAllItems(e))});let h=",";i&&i.valueSeparator&&(h=i.valueSeparator);const{useInFocusAndBlur:p,useInValueChange:m}=We(e,t),{getSelection:v,getSelectionValue:g}=Hi(n.allItemsValue),b=r({get(){if(!Po(e.value)){const{getSelectArray:t}=u,a=t(e.value,i,l.value,h,null==i?void 0:i.codeItemValueNumber);if(a)return n.allItems?v([],a,l.value,l.value):a}return[]},set(e){if(n.allItems){const t=v(b.value,e,l.value,l.value);e=g(t)}let a=null;const{setSelectArray:i}=u;a=i(e,l.value,h),t("change",a),m()}}),f=r(()=>{const e=Array.isArray(b.value)?b.value:[b.value];return l.value.filter(t=>{let a=!1;return e.forEach(e=>{e==t.value&&(a=!0)}),a}).map(e=>e.text).join(",")});c(f,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});const{componentRef:w}=je(()=>t("focus"),()=>p());return{ns:a,items:l,selectArray:b,valueText:f,editorRef:w,onSelectArrayChange:e=>{b.value=e},showFormDefaultContent:s}},render(){let e;return n("div",{ref:"editorRef",class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("grid-layout",!!this.controller.rowNumber)],style:this.controller.rowNumber?"".concat(this.ns.cssVarBlockName("group-row-number"),":").concat(this.controller.rowNumber):""},[this.readonly?this.valueText:n(i("el-checkbox-group"),y({"model-value":this.selectArray,onChange:this.onSelectArrayChange},this.$attrs),(t=e=this.items.map((e,t)=>n(i("el-checkbox"),{key:t,label:e.value,disabled:this.disabled||!0===e.disableSelect},{default:()=>[n("span",{class:this.ns.e("text")},[e.text])]})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))]);var t}});var gT=Object.defineProperty,bT=(e,t,a)=>(((e,t,a)=>{t in e?gT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class fT extends Ui{constructor(){super(...arguments),bT(this,"codeList"),bT(this,"rowNumber")}async onInit(){var e,t;if(super.onInit(),this.model.appCodeListId){const e=await ibiz.hub.getApp(this.context.srfappid);this.codeList=e.codeList.getCodeList(this.model.appCodeListId)}(null==(e=this.editorParams)?void 0:e.rowNumber)&&(this.rowNumber=Number(this.editorParams.rowNumber)),(null==(t=this.editorParams)?void 0:t.rownumber)&&(this.rowNumber=Number(this.editorParams.rownumber))}}var wT=Object.defineProperty,yT=(e,t,a)=>(((e,t,a)=>{t in e?wT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class CT{constructor(){yT(this,"formEditor","IBizCheckboxList"),yT(this,"gridEditor","IBizCheckboxList")}async createController(e,t){const a=new fT(e,t);return await a.init(),a}}const IT=a({name:"IBizRadio",props:Ke(),emits:Ve(),setup(e,{emit:t}){const a=B("radio"),n=e.controller,i=n.model;let s="radio",l=!1;i.editorParams&&(i.editorParams.renderMode&&(s=i.editorParams.renderMode),i.editorParams.rendermode&&(s=i.editorParams.rendermode),i.editorParams.isBtnRoundCorner&&(l=n.toBoolean(i.editorParams.isBtnRoundCorner)),i.editorParams.isbtnroundcorner&&(l=n.toBoolean(i.editorParams.isbtnroundcorner)));const{useInFocusAndBlur:d,useInValueChange:u}=We(e,t),h=o([]);c(()=>e.data,e=>{n.loadCodeList(e).then(e=>{h.value=e})},{immediate:!0,deep:!0});se(n.model.appCodeListId,n.context.srfappid,e=>{e&&(h.value=e)});const p=r(()=>{var t;return(null==(t=h.value.find(t=>t.value==e.value))?void 0:t.text)||""}),m=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(p,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});const{componentRef:v}=je(()=>t("focus"),()=>d());return{ns:a,editorModel:i,items:h,valueText:p,onSelectValueChange:e=>{t("change",e),u()},editorRef:v,renderMode:s,isBtnRoundCorner:l,showFormDefaultContent:m}},render(){var e;let t;const a=null==(e=this.controller.editorParams)?void 0:e.itemwidth,o=a?"".concat(a,"px"):"";return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("grid-layout",!!this.controller.rowNumber)],style:this.controller.rowNumber?"".concat(this.ns.cssVarBlockName("group-row-number"),":").concat(this.controller.rowNumber):"",ref:"editorRef"},[this.readonly?this.valueText:"tab"!==this.renderMode?n(i("el-radio-group"),y({class:this.ns.e("group"),"model-value":vo(this.value)?String(this.value):"",onChange:this.onSelectValueChange},this.$attrs),(l=t=this.items.map((e,t)=>"radio"===this.renderMode?n(i("el-radio"),{key:t,style:{width:o},title:Tt(e.text),label:vo(e.value)?String(e.value):"",disabled:this.disabled||!0===e.disableSelect},{default:()=>[e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),n("span",{class:this.ns.e("text")},[e.text])]}):n(i("el-radio-button"),{key:t,class:[this.ns.e("button"),this.isBtnRoundCorner?this.ns.em("button","round-corner"):""],style:{width:o},title:Tt(e.text),label:vo(e.value)?String(e.value):"",disabled:this.disabled||!0===e.disableSelect},{default:()=>[e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),n("span",{class:this.ns.em("button","text")},[e.text])]})),"function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?t:{default:()=>[t]})):n("div",{class:this.ns.b("tab")},[this.items.map(e=>{const t=vo(this.value)?String(this.value):"",a=vo(e.value)?String(e.value):"",s=this.disabled||!0===e.disableSelect;return n("span",{class:[this.ns.b("tab-item"),this.ns.is("selected",t===a),this.ns.is("disabled",s)],style:{width:o},title:Tt(e.text),onClick:()=>{s||this.onSelectValueChange(a)}},[e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),n("span",{class:this.ns.be("tab-item","text")},[e.text||""])])})])]);var l}});var xT=Object.defineProperty,ST=(e,t,a)=>(((e,t,a)=>{t in e?xT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ET extends Ui{constructor(){super(...arguments),ST(this,"rowNumber")}async onInit(){var e,t;super.onInit(),(null==(e=this.editorParams)?void 0:e.rowNumber)&&(this.rowNumber=Number(this.editorParams.rowNumber)),(null==(t=this.editorParams)?void 0:t.rownumber)&&(this.rowNumber=Number(this.editorParams.rownumber))}}var DT=Object.defineProperty,PT=(e,t,a)=>(((e,t,a)=>{t in e?DT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class kT{constructor(){PT(this,"formEditor","IBizRadio"),PT(this,"gridEditor","IBizRadio")}async createController(e,t){const a=new ET(e,t);return await a.init(),a}}const zT=a({name:"IBizDatePicker",props:Xe(),emits:Ve(),setup(e,{emit:t}){const a=B("date-picker"),n=e.controller,i=n.model,s=o("date"),l=o("YYYY-MM-DD"),d=o(!1),u=o(!1),h=o(),p=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));switch(i.editorType){case"DATEPICKEREX":case"DATEPICKEREX_NOTIME":case"MOBDATE_NOTIME":s.value="date";break;case"DATEPICKEREX_NODAY":case"DATEPICKEREX_NODAY_NOSECOND":case"MOBDATE_NODAY":case"MOBDATE_NODAY_NOSECOND":d.value=!0,s.value="time";break;default:s.value="datetime"}const m=n.valueFormat;m&&(l.value=m);const v=o();c(()=>e.value,(e,t)=>{if(e&&e!==t){const t=as(e).format(m);v.value="Invalid Date"!==t?t:e}else null==e&&(v.value=e)},{immediate:!0});const g=e=>{e?u.value=e:setTimeout(()=>{u.value=e},100)};c(h,t=>{e.autoFocus&&t&&t.focus&&t.focus()});c(v,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});return{ns:a,c:n,editorModel:i,type:s,format:l,formatValue:v,handleChange:(e,a)=>{t("change",e),g(!1)},editorRef:h,isTimePicker:d,onFocus:e=>{t("focus",e),g(!0)},onBlur:e=>{t("blur",e),g(!1)},isEditable:u,setEditable:g,showFormDefaultContent:p,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)}}},render(){const e=this.isTimePicker?n(i("el-time-picker"),y({ref:"editorRef",class:[this.ns.b("input")],type:this.type,format:this.format,"value-format":this.format,placeholder:this.c.placeHolder,modelValue:this.formatValue,"onUpdate:modelValue":e=>this.formatValue=e,onChange:this.handleChange,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null):n(i("el-date-picker"),y({ref:"editorRef",class:[this.ns.b("input")],type:this.type,format:this.format,"value-format":this.format,placeholder:this.c.placeHolder,modelValue:this.formatValue,"onUpdate:modelValue":e=>this.formatValue=e,onChange:this.handleChange,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null),t=this.formatValue,a=n("div",{class:this.ns.b("form-default-content")},[this.formatValue?this.formatValue:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.e(this.editorModel.editorType),this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],onKeyup:this.handleKeyUp},[this.showFormDefaultContent&&a,this.readonly?t:e])}});class TT extends qi{getFormatByType(e){switch(e){case"DATEPICKER":case"MOBDATE":case"DATEPICKEREX":case"DATEPICKEREX_SECOND":case"MOBDATE_SECOND":default:return"YYYY-MM-DD HH:mm:ss";case"DATEPICKEREX_NOTIME":case"MOBDATE_NOTIME":return"YYYY-MM-DD";case"DATEPICKEREX_HOUR":case"MOBDATE_HOUR":return"YYYY-MM-DD HH";case"DATEPICKEREX_MINUTE":case"MOBDATE_MINUTE":case"DATEPICKEREX_NOSECOND":return"YYYY-MM-DD HH:mm";case"DATEPICKEREX_NODAY":case"MOBDATE_NODAY":return"HH:mm:ss";case"DATEPICKEREX_NODAY_NOSECOND":case"MOBDATE_NODAY_NOSECOND":return"HH:mm"}}get valueFormat(){return super.valueFormat?super.valueFormat:this.model.dateTimeFormat?this.model.dateTimeFormat:this.getFormatByType(this.model.editorType)}}var AT=Object.defineProperty,OT=(e,t,a)=>(((e,t,a)=>{t in e?AT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class MT{constructor(){OT(this,"formEditor","IBizDatePicker"),OT(this,"gridEditor","IBizDatePicker")}async createController(e,t){const a=new TT(e,t);return await a.init(),a}}const NT=a({name:"IBizRaw",props:$e(),emits:Ve(),setup(e){const t=B("raw"),a=e.controller,n=a.model,i=o(""),s=r(()=>!!a.model.editorHeight);let l="TEXT",d="";n.contentType&&(l=n.contentType),n.editorParams&&n.editorParams.contenttype&&(l=n.editorParams.contenttype),n.editorParams&&n.editorParams.template&&(d=n.editorParams.template.replace(/\/\/n/g,"\n")),n.editorParams&&n.editorParams.TEMPLATE&&(d=n.editorParams.TEMPLATE.replace(/\/\/n/g,"\n"));const u=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));return c(()=>e.value,async(t,a)=>{if(t!==a&&("string"!=typeof t&&"number"!=typeof t&&t||(i.value=t),d&&t)){let a=t;if("string"==typeof t)try{a=JSON.parse(t)}catch(e){ibiz.log.error("JSON字符串转换错误")}Array.isArray(a)||Object.assign(a,{data:{...e.data}}),ibiz.log.debug("模板内容:",d),ibiz.log.debug("模板编译对象:",a),i.value=await ibiz.util.hbs.render(d,a)}},{immediate:!0}),{ns:t,content:i,type:l,template:d,enableOverFlow:s,showFormDefaultContent:u}},render(){return n("div",{class:[this.ns.b(),this.ns.is("overflow",this.enableOverFlow),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[this.content&&n(i("iBizRawItem"),{class:this.ns.b("content"),content:this.content,type:this.type},null)])}});class BT extends qi{}var LT=Object.defineProperty,RT=(e,t,a)=>(((e,t,a)=>{t in e?LT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class _T{constructor(){RT(this,"formEditor","IBizRaw"),RT(this,"gridEditor","IBizRaw")}async createController(e,t){const a=new BT(e,t);return await a.init(),a}}const jT=a({name:"IBizStepper",props:Je(),emits:Ve(),setup(e,{emit:t}){const a=B("stepper"),n=e.controller,i=n.model,s=o(null);let l=1,d=0,u=1/0,h=-1/0;i.editorParams&&(i.editorParams.stepvalue&&(l=Yo(i.editorParams.stepvalue)),i.editorParams.precision&&(d=Yo(i.editorParams.precision)),i.editorParams.maxvalue&&(u=Yo(i.editorParams.maxvalue)),i.editorParams.minvalue&&(h=Yo(i.editorParams.minvalue)));const p=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{if(e!==t){const t=Number(e);s.value=Number.isNaN(t)?0:t}},{immediate:!0});const m=o();return{ns:a,c:n,currentVal:s,handleChange:e=>{t("change",e)},inputRef:m,step:l,precision:d,max:u,min:h,onFocus:()=>{t("focus")},onBlur:()=>{t("blur")},showFormDefaultContent:p}},render(){let e=null;return e=this.readonly?fo(this.currentVal)?"":"".concat(this.currentVal):[n(i("el-input-number"),y({ref:"inputRef",modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,placeholder:this.c.placeHolder,precision:this.precision,min:this.min,max:this.max,step:this.step,disabled:this.disabled,onChange:this.handleChange,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null)],n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[e])}});class VT extends qi{}var FT=Object.defineProperty,UT=(e,t,a)=>(((e,t,a)=>{t in e?FT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class HT{constructor(){UT(this,"formEditor","IBizStepper"),UT(this,"gridEditor","IBizStepper")}async createController(e,t){const a=new VT(e,t);return await a.init(),a}}const qT=a({name:"IBizRate",props:Qe(),emits:Ve(),setup(e,{emit:t}){const a=B("rate"),n=o(),i=e.controller,s=i.model,{useInFocusAndBlur:l,useInValueChange:d}=We(e,t);let u=[],h=!1,p=5,m=[];s.editorParams&&(s.editorParams.colors&&(u=i.toObj(s.editorParams.colors)),s.editorParams.showText&&(h=i.toBoolean(s.editorParams.showText)),s.editorParams.showtext&&(h=i.toBoolean(s.editorParams.showtext)),s.editorParams.maxvalue&&(p=Yo(s.editorParams.maxvalue)),s.editorParams.texts&&(m=i.toObj(s.editorParams.texts)));const v=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{e!==t&&(n.value=e||0)},{immediate:!0});const{componentRef:g}=je(()=>t("focus"),()=>l());return{ns:a,currentVal:n,handleChange:e=>{t("change",e),d()},colors:u,showText:h,max:p,texts:m,editorRef:g,showFormDefaultContent:v}},render(){return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[n(i("el-rate"),y({modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.disabled||this.readonly,max:this.max,colors:this.colors,showText:this.showText,texts:this.texts,onChange:this.handleChange},this.$attrs),null)])}});class GT extends qi{}var WT=Object.defineProperty,YT=(e,t,a)=>(((e,t,a)=>{t in e?WT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class KT{constructor(){YT(this,"formEditor","IBizRate"),YT(this,"gridEditor","IBizRate")}async createController(e,t){const a=new GT(e,t);return await a.init(),a}}const XT=a({name:"IBizSwitch",props:Ze(),emits:Ve(),setup(e,{emit:t}){const a=B("switch"),n=e.controller,i=n.model,s=o(!1);let l="",d="",u=[{value:0,label:""},{value:1,label:""}];if(i.editorParams&&(i.editorParams.dicData&&(u=n.toObj(i.editorParams.dicData)),i.editorParams.dicdata&&(u=n.toObj(i.editorParams.dicdata))),u&&Array.isArray(u)){const e=u.find(e=>0===e.value);e&&(d=e.label);const t=u.find(e=>1===e.value);t&&(l=t.label)}const h=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(t,a)=>{t!==a&&(s.value=!!t&&1==e.value)},{immediate:!0});const p=r(()=>!e.autoFocus&&(e.disabled||e.readonly)),{useInFocusAndBlur:m,useInValueChange:v}=We(e,t),{componentRef:g}=je(()=>t("focus"),()=>m());return{ns:a,currentVal:s,curDisabled:p,activeText:l,inactiveText:d,handleChange:e=>{t("change",!0===e?1:0),v()},dicData:u,editorRef:g,showFormDefaultContent:h}},render(){const e={...this.$attrs,title:""};return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[n(i("el-switch"),y({modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.curDisabled,activeText:this.activeText,inactiveText:this.inactiveText,onChange:this.handleChange},e),null)])}}),$T=a({name:"IBizSwitchTriState",props:Ze(),emits:Ve(),setup(e,{emit:t}){const a=B("switch-tristate"),n=e.controller,i=o(null),s=o(null);c(()=>e.value,(e,t)=>{e!==t&&(s.value=0===e?0:1===e?1:null)},{immediate:!0});return{ns:a,c:n,currentVal:s,onSwitchClick:()=>{e.disabled||e.readonly||(null===s.value&&(null!==i.value&&0!==i.value||(i.value=null,t("change",1)),1===i.value&&(i.value=null,t("change",0))),1===s.value&&(i.value=1,t("change",null)),0===s.value&&(i.value=0,t("change",null)))}}},render(){return n("div",{class:[this.ns.b()]},[n("div",{class:[this.ns.e("switch-wrapper"),this.ns.is("left",0===this.currentVal),this.ns.is("center",null===this.currentVal),this.ns.is("right",1===this.currentVal),this.ns.is("disabled",this.disabled||this.readonly)],onClick:this.onSwitchClick},null)])}});class JT extends qi{}var QT=Object.defineProperty,ZT=(e,t,a)=>(((e,t,a)=>{t in e?QT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class eA{constructor(e){ZT(this,"formEditor","IBizSwitch"),ZT(this,"gridEditor","IBizSwitch"),"TRISTATE"===e&&(this.formEditor="IBizSwitchTriState",this.gridEditor="IBizSwitchTriState")}async createController(e,t){const a=new JT(e,t);return await a.init(),a}}const tA=a({name:"IBizSlider",props:et(),emits:Ve(),setup(e,{emit:t}){const a=B("slider"),n=e.controller,i=n.model,{valueFormat:s}=n.parent,{useInFocusAndBlur:l,useInValueChange:u}=We(e,t),h=o(""),p=o(0);let v=1,b=100,f=0,w=!1,y=!1,C=!1,I=!1,x=s||"0%",S="line",E="",D="",P="";i.editorParams&&(i.editorParams.stepvalue&&(v=Yo(i.editorParams.stepvalue)),i.editorParams.maxvalue&&(b=Yo(i.editorParams.maxvalue)),i.editorParams.minvalue&&(f=Yo(i.editorParams.minvalue)),i.editorParams.showstops&&(w=n.toBoolean(i.editorParams.showstops)),i.editorParams.range&&(y=n.toBoolean(i.editorParams.range)),i.editorParams.showinput&&(C=n.toBoolean(i.editorParams.showinput)),i.editorParams.showText&&(I=n.toBoolean(i.editorParams.showText)),i.editorParams.showtext&&(I=n.toBoolean(i.editorParams.showtext)),i.editorParams.format&&(x=i.editorParams.format),i.editorParams.type&&(S=i.editorParams.type),i.editorParams.textItem&&(E=i.editorParams.textItem),i.editorParams.textitem&&(E=i.editorParams.textitem),i.editorParams.pieBg&&(D=i.editorParams.pieBg),i.editorParams.piebg&&(D=i.editorParams.piebg),i.editorParams.piePercentBg&&(P=i.editorParams.piePercentBg),i.editorParams.piepercentbg&&(P=i.editorParams.piepercentbg));const k=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),z=e=>100*Number(e),T=e=>{switch(S){case"line":return(e=>y?JSON.parse(e):Number(e))(e);case"circle":case"pie":return z(e);default:return e}},{componentRef:A}=je(()=>t("focus"),()=>l()),O=()=>{A.value&&(p.value=Math.min(A.value.clientHeight,A.value.clientWidth)),h.value="",p.value>0&&(h.value="height:".concat(p.value,"px;width:").concat(p.value,"px;min-width:unset;min-height:unset;")),D&&(h.value+="".concat(a.cssVarName("editor-slider-pie-bg"),":").concat(D,";")),P&&(h.value+="".concat(a.cssVarName("editor-slider-pie-percent-bg"),":").concat(P,";")),h.value+="animation-delay:-".concat(M.value,"s;")},M=o();c(()=>e.value,(e,t)=>{e!==t&&(null==e?(M.value=y?[0,1]:0,"pie"===S&&O()):(M.value=T(e),"pie"===S&&O()))},{immediate:!0});const N=()=>{O()};d(()=>{"pie"===S&&(window.addEventListener("resize",N),g(()=>{O()}))}),m(()=>{"pie"===S&&window.removeEventListener("resize",N)});const L=r(()=>{if(E){const t=e.data||{};return ibiz.util.text.format("".concat(null!=t[E]?t[E]:""),x)}const t=Number(M.value),a=Number(t/b);return ibiz.util.text.format("".concat(null!=a?a:""),x)});return{ns:a,currentVal:M,handleChange:e=>{Array.isArray(e)?t("change",JSON.stringify(e)):t("change",e),u()},step:v,max:b,min:f,type:S,textItem:E,showStops:w,range:y,showInput:C,editorRef:A,showText:I,textVal:L,showFormDefaultContent:k,pieStyle:h}},render(){let e;return"line"===this.type&&(e=[n(i("el-slider"),y({modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.disabled||this.readonly,step:this.step,max:this.max,min:this.min,showStops:this.showStops,range:this.range,showInput:this.showInput,onChange:this.handleChange},this.$attrs),null),this.showText?n("span",{class:[this.ns.em("text","val")]},[this.textVal]):null]),"circle"===this.type&&(e=n(i("el-progress"),y({type:this.type,percentage:this.currentVal},this.$attrs),{default:e=>{if(!this.showText)return"";let t=e.percentage;return this.textItem&&(t=this.textVal),n("span",{class:this.ns.em("circle","text")},[t])}})),"pie"===this.type&&(e=n("div",{class:[this.ns.e("pie-content"),this.ns.is("hundred-percent",this.currentVal>=this.max)],style:this.pieStyle},null)),n("div",{class:[this.ns.b(),this.readonly?this.ns.m("readonly"):"",this.showText?this.ns.e("text"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.e(this.type)],ref:"editorRef"},[e])}});class aA extends qi{async onInit(){super.onInit(),this.model.precision&&ibiz.log.warn("滑动输入条不支持配置精度")}}var nA=Object.defineProperty,iA=(e,t,a)=>(((e,t,a)=>{t in e?nA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class oA{constructor(){iA(this,"formEditor","IBizSlider"),iA(this,"gridEditor","IBizSlider")}async createController(e,t){const a=new aA(e,t);return await a.init(),a}}function sA(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const lA=a({name:"IBizListBox",props:tt(),emits:Ve(),setup(e,{emit:t}){const a=B("list-box"),n=e.controller,i=n.model;let s=!1;i.editorParams&&i.editorParams.multiple&&(s=n.toBoolean(i.editorParams.multiple));const{useInFocusAndBlur:l,useInValueChange:d}=We(e,t),u=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),h=n.codeList,p=i.editorType,m=o([]);(async()=>{if(Object.is("LISTBOX",p)){const t=n;t.loadCodeList(e.data).then(e=>{m.value=s?t.handleCodeListAllItems(e):e})}else if(Object.is("LISTBOXPICKUP",p)){const t=n;if(t.model.appDataEntityId){const a=await t.getServiceData(e.data);a&&(m.value=a.data.map(e=>({value:e[t.keyName],text:e[t.textName]})))}}})();se(n.model.appCodeListId,n.context.srfappid,e=>{if(e){if(Object.is("LISTBOX",p)&&s)return void(m.value=n.handleCodeListAllItems(e));m.value=e}});const v=r(()=>h&&h.orMode?h.orMode:"STR"),g=Gi(v.value,n.model.valueType);let b=",";h&&h.valueSeparator&&(b=h.valueSeparator);const{getSelection:f,getSelectionValue:w}=Hi(Object.is("LISTBOX",p)?n.allItemsValue:""),y=o([]);c(()=>e.value,e=>{if(Po(e))y.value=[];else if(s){let t=[];if("LISTBOX"===p){const{getSelectArray:a}=g,i=a(e,h,m.value,b,null==h?void 0:h.codeItemValueNumber);i&&(t=i,n.allItems&&(t=f([],t,m.value,m.value)))}else"LISTBOXPICKUP"===p&&""!==e&&(t="SIMPLES"===n.model.valueType&&Array.isArray(e)?e:e.split(b));y.value=t}else y.value=[e]},{immediate:!0,deep:!0});const{componentRef:C}=je(()=>t("focus"),()=>l());return{ns:a,items:m,selectArray:y,onSelectArrayChange:e=>{let a;if(s){let t=[...e];if(Object.is("LISTBOX",p)){if(n.allItems){const e=f(y.value,t,m.value,m.value);t=w(e)}const{setSelectArray:e}=g;a=e(t,m.value,b)}else Object.is("LISTBOXPICKUP",p)&&("SIMPLES"===n.model.valueType?a=t:"SIMPLE"===n.model.valueType&&(a=t.join(b)))}else a=e;t("change",a),d()},multiple:s,editorRef:C,showFormDefaultContent:u}},render(){let e,t;return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[this.multiple?n(i("el-checkbox-group"),y({class:this.ns.b("checkbox"),modelValue:this.selectArray,onChange:this.onSelectArrayChange},this.$attrs),sA(e=this.items.map((e,t)=>n(i("el-checkbox"),{key:t,label:e.value,disabled:this.disabled||this.readonly||!0===e.disableSelect},{default:()=>{const t=this.controller;if(t.acItemProvider){const a=i(t.acItemProvider.component);return l(a,{item:e,controller:t})}return n("span",{class:this.ns.e("text")},[e.text])}})))?e:{default:()=>[e]}):n(i("el-radio-group"),y({class:this.ns.b("radio"),modelValue:this.selectArray[0]},this.$attrs),sA(t=this.items.map((e,t)=>n(i("el-radio"),{key:t,label:e.value,disabled:this.disabled||this.readonly||!0===e.disableSelect,onChange:()=>{this.onSelectArrayChange(e.value)}},{default:()=>{const t=this.controller;if(t.acItemProvider){const a=i(t.acItemProvider.component);return l(a,{item:e,controller:t})}return n("span",{class:this.ns.e("text")},[e.text])}})))?t:{default:()=>[t]})])}});var rA=Object.defineProperty,cA=(e,t,a)=>(((e,t,a)=>{t in e?rA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class dA extends Ui{constructor(){super(...arguments),cA(this,"codeList")}async onInit(){if(super.onInit(),this.model.appCodeListId){const e=await ibiz.hub.getApp(this.context.srfappid);this.codeList=e.codeList.getCodeList(this.model.appCodeListId)}}}var uA=Object.defineProperty,hA=(e,t,a)=>(((e,t,a)=>{t in e?uA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class pA extends qi{constructor(){super(...arguments),hA(this,"keyName","srfkey"),hA(this,"textName","srfmajortext"),hA(this,"interfaceName",""),hA(this,"deACMode"),hA(this,"acItemProvider")}async onInit(){super.onInit(),"LISTBOXPICKUP"===this.model.editorType&&(this.model.appDEDataSetId&&(this.interfaceName=this.model.appDEDataSetId),this.model.appDataEntityId&&this.model.appDEACModeId&&(this.deACMode=await ga(this.model.appDEACModeId,this.model.appDataEntityId,this.context.srfappid),this.deACMode&&this.deACMode.itemSysPFPluginId&&(this.acItemProvider=await Vi(this.deACMode))))}async getServiceData(e){const{context:t,params:a}=this.handlePublicParams(e,this.context,this.params),n=Ao(a,{size:1e3});if(this.interfaceName){const e=ibiz.hub.getApp(this.context.srfappid);return await e.deService.exec(this.model.appDataEntityId,this.interfaceName,t,n)}throw new Xt(this.model,ibiz.i18n.t("editor.common.entityConfigErr"))}}var mA=Object.defineProperty,vA=(e,t,a)=>(((e,t,a)=>{t in e?mA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class gA{constructor(){vA(this,"formEditor","IBizListBox"),vA(this,"gridEditor","IBizListBox")}async createController(e,t){let a;return a="LISTBOXPICKUP"===e.editorType?new pA(e,t):new dA(e,t),await a.init(),a}}const bA=a({name:"IBizAutoComplete",props:at(),emits:Ve(),setup(e,{emit:t}){const a=B("autocomplete"),s=e.controller,l=s.model.editorType,d=o(""),u=o([]),h=o(!0),p=o(!1),m=o(),v=o(!1),g=o(!1),b=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(u,(t,a)=>{if(0===a.length&&t.length>0){const a=t.findIndex(t=>Object.is(t[s.keyName],e.value));-1!==a&&(d.value=t[a][s.textName])}});const f=e=>{e?p.value=e:setTimeout(()=>{p.value=e},100)},w=async(t,a)=>{if(s.model.appDataEntityId){const n=t.trim(),i=await s.getServiceData(n,e.data);if(i&&(u.value=i.data,v.value=!0,a&&a instanceof Function))if(u.value.length)a([...u.value,...s.actionDetails]);else{a([{srftype:"empty"},...s.actionDetails])}}};c(()=>e.value,async(e,t)=>{if(e||null===e){v.value||void 0!==t||await w(""),null===e&&(d.value="");const a=u.value.findIndex(t=>Object.is(t[s.keyName],e));-1!==a?d.value=u.value[a][s.textName]:(d.value=e,null===e&&(d.value=""))}},{immediate:!0}),c(m,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const y=()=>{if(u.value.length){const t=u.value.findIndex(t=>Object.is(t[s.keyName],e.value));-1!==t&&(d.value=u.value[t][s.textName])}else w("")},C=r(()=>!Object.is("AC_NOBUTTON",l)),I=r(()=>!(Object.is("AC_NOBUTTON",l)||Object.is("AC_FS_NOBUTTON",l)));let x,S=!1;const E=_o(e=>{x!==e&&t("change",e),x=void 0,S=!1},300,{leading:!0});return{ns:a,c:s,curValue:d,triggerOnFocus:C,autoCompleteClearable:I,onSearch:w,onClear:()=>{const e=s.dataItems;e.length>0&&e.forEach(e=>{t("change",null,e.id)}),t("change",null)},onFocus:e=>{g.value=!0,m.value.loading=!0,t("focus",e),f(!0)},onBlur:e=>{g.value=!1,t("blur",e),f(!1)},onACSelect:async a=>{h.value=!0,f(!1),"empty"!==a.srftype?"DEUIACTION"===a.detailType?(s.onActionClick(a,e.data),y()):await(async e=>{const a=await s.calcFillDataItems(e);a.length&&a.forEach(e=>{t("change",e.value,e.id)}),t("change",e[s.keyName])})(a):y()},items:u,handleInput:e=>{"AC_FS"!==l&&"AC_FS_NOBUTTON"!==l&&(S=!0,E(e))},isDebounce:S,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},editorRef:m,isEditable:p,isReverse:g,setEditable:f,showFormDefaultContent:b,renderActionItem:t=>{if(s.groupActionState[t.id].visible)return n("div",{class:[a.e("action-item"),a.is("disabled",s.groupActionState[t.id].disabled)],onClick:a=>s.onActionClick(t,e.data,a),title:Tt(t.tooltip)},[t.showIcon&&t.sysImage&&n(i("iBizIcon"),{icon:t.sysImage},null),t.showCaption?t.caption:""])},renderEmpty:()=>n(i("iBizNoData"),{class:a.e("empty"),onClick:e=>e.stopPropagation()},null)}},render(){var e;const t="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),a=null==(e=this.c.deACMode)?void 0:e.itemLayoutPanel,{context:o,params:s}=this.c,r=n(i("el-autocomplete"),y({class:this.ns.b("input"),ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,"value-key":this.c.textName,placeholder:this.c.placeHolder,placement:"bottom",clearable:this.autoCompleteClearable,"popper-class":[this.ns.e("transfer"),this.ns.is("empty",!this.items.length)],teleported:!this.showFormDefaultContent,"fetch-suggestions":this.onSearch,onClear:this.onClear,disabled:this.disabled||this.readonly,onSelect:this.onACSelect,onInput:this.handleInput,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp,"fit-input-width":t},this.$attrs),{default:({item:e})=>{if("empty"===e.srftype)return this.renderEmpty();if("DEUIACTION"===e.detailType)return this.renderActionItem(e);if(this.c.acItemProvider){const t=i(this.c.acItemProvider.component);return l(t,{item:e,controller:this.c})}const r=[this.ns.is("ellipsis",t),this.ns.e("transfer-item")];return a?n(i("iBizControlShell"),{data:e,class:r,modelData:a,context:o,params:s,onClick:()=>{this.onACSelect(e)}},null):n("div",{class:r,title:Tt(t?e[this.c.textName]:"")},[e[this.c.textName]])},suffix:()=>{if(this.controller.model.showTrigger)return n("ion-icon",{name:"chevron-down-outline",class:[this.ns.e("suffix"),this.ns.is("reverse",this.isReverse)]},null)}}),c=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.curValue]),d=n("div",{class:this.ns.b("form-default-content")},[this.curValue?this.curValue:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&d,this.readonly?c:r])}});var fA=Object.defineProperty,wA=(e,t,a)=>(((e,t,a)=>{t in e?fA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class yA extends qi{constructor(){super(...arguments),wA(this,"keyName","srfkey"),wA(this,"textName","srfmajortext"),wA(this,"interfaceName",""),wA(this,"sort",""),wA(this,"deACMode"),wA(this,"dataItems",[]),wA(this,"acItemProvider"),wA(this,"groupActionState",new Ri),wA(this,"actionDetails",[])}async onInit(){if(super.onInit(),this.model.appDataEntityId&&(this.model.appDEDataSetId&&(this.interfaceName=this.model.appDEDataSetId),this.model.appDEACModeId&&(this.deACMode=await ga(this.model.appDEACModeId,this.model.appDataEntityId,this.context.srfappid),this.deACMode))){const{minorSortAppDEFieldId:e,minorSortDir:t}=this.deACMode;e&&t&&(this.sort="".concat(e.toLowerCase(),",").concat(t.toLowerCase())),this.deACMode.textAppDEFieldId&&(this.textName=this.deACMode.textAppDEFieldId),this.deACMode.valueAppDEFieldId&&(this.keyName=this.deACMode.valueAppDEFieldId),this.deACMode.deacmodeDataItems&&(this.dataItems=[],this.deACMode.deacmodeDataItems.forEach(e=>{"value"!==e.id&&"text"!==e.id&&this.dataItems.push(e)})),this.deACMode.itemSysPFPluginId&&(this.acItemProvider=await Vi(this.deACMode))}this.model.uiactionGroup&&(this.actionDetails=this.model.uiactionGroup.uiactionGroupDetails||[],this.actionDetails.length>0&&(this.actionDetails.forEach(e=>{const t=e.uiactionId;if(t){const a=new Di(e.id,this.context.srfappid,t);this.groupActionState.addState(e.id,a)}}),await this.groupActionState.init(),this.actionDetails.forEach(e=>{e.capLanguageRes&&e.capLanguageRes.lanResTag&&(e.caption=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption)),e.tooltipLanguageRes&&e.tooltipLanguageRes.lanResTag&&(e.tooltip=ibiz.i18n.t(e.tooltipLanguageRes.lanResTag,e.tooltip))})))}async getServiceData(e,t){const{context:a,params:n}=this.handlePublicParams(t,this.context,this.params),i={};ibiz.config.pickerdefaultsort&&Object.assign(i,{sort:ibiz.config.pickerdefaultsort}),this.sort&&!Object.is(this.sort,"")&&Object.assign(i,{sort:this.sort}),e&&Object.assign(i,{query:e}),Object.assign(i,{size:1e3});const o=Ao(n,i);if(this.interfaceName){const e=ibiz.hub.getApp(this.context.srfappid);return await e.deService.exec(this.model.appDataEntityId,this.interfaceName,a,o)}throw new Xt(this.model,ibiz.i18n.t("editor.common.entityConfigErr"))}async calcFillDataItems(e){if(this.deACMode){if(0===this.dataItems.length)return[];return await Promise.all(this.dataItems.map(t=>{const a=e[t.appDEFieldId];return t.format||t.convertToCodeItemText&&t.codeListId||t.customCode,{id:t.id,value:a}}))}return[]}async onActionClick(e,t,a){a&&a.stopPropagation();const n=e.uiactionId;await fa.execAndResolved(n,{context:this.context,params:this.params,data:[t],view:this.view,event:a},e.appId)}}var CA=Object.defineProperty,IA=(e,t,a)=>(((e,t,a)=>{t in e?CA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class xA{constructor(){IA(this,"formEditor","IBizAutoComplete"),IA(this,"gridEditor","IBizAutoComplete")}async createController(e,t){const a=new yA(e,t);return await a.init(),a}}function SA(e,t,a){const n=o([]),i=ibiz.util.file.getUploadHeaders(),s=o({...i}),l=o(""),d={count:0,cacheFiles:[]},u=new Map;c(()=>e.value,e=>{n.value=e?JSON.parse(e):[]},{immediate:!0});const h=(e,t)=>{const n={...a.editorParams,enableNoAccess:a.enableNoAccess};n.exportparams&&(n.exportParams=JSON.parse(n.exportparams)),n.globaldownloadprifix?n.globalDownloadPrifix="true"===n.globaldownloadprifix:n.globalDownloadPrifix=ibiz.config.common.globalDownloadPrifix,t&&t.folder&&(n.osscat=t.folder);return ibiz.util.file.calcFileUpDownUrl(a.context,a.params,e,n).downloadUrl};c(()=>e.data,e=>{if(e){const t={...a.editorParams,enableNoAccess:a.enableNoAccess};t.uploadparams&&(t.uploadParams=JSON.parse(t.uploadparams));const n=ibiz.util.file.calcFileUpDownUrl(a.context,a.params,e,t);l.value=n.uploadUrl}},{immediate:!0,deep:!0});const p=e=>{const t=u.get(e.id);t?e.base64=t:(async e=>{try{const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch SVG: ".concat(t.status));const a=await t.blob(),n=new FileReader;return new Promise((e,t)=>{n.onloadend=()=>{const t=n.result;if(t){const a=t.replace("data:application/octet-stream;base64","data:image/svg+xml;base64");e(a)}},n.onerror=t,n.readAsDataURL(a)})}catch(e){throw ibiz.log.error(null==e?void 0:e.message),e}})(e.url).then(t=>{e.base64=t})};c(n,t=>{(null==t?void 0:t.length)&&t.forEach(t=>{const n=h(e.data,t);t.url=t.url||n.replace("%fileId%",t.id),ibiz.config.common.enableDownloadTicket&&!a.enableNoAccess?ibiz.util.file.getDownloadTicket(a.context,a.params,e.data,{fileId:t.id},a.downloadTicketParams).then(e=>{e&&e.ticket&&(t.url=n.replace("%fileId%",e.ticket),"svg"===t.name.split(".").pop()&&p(t))}):"svg"===t.name.split(".").pop()&&p(t)})},{immediate:!0});const m=()=>{const e=[...n.value,...d.cacheFiles],i=e.length>0?JSON.stringify(e.map(e=>({name:e.name,id:e.id,folder:e.folder,...a.transformInfoMap(e,a.infoMap,!0)}))):null;d.cacheFiles=[],t(i)},v=r(()=>a.multiple?9999:1);return{uploadUrl:l,headers:s,files:n,limit:v,onDownload:t=>{const n=h(e.data,t),i=t.url||n.replace("%fileId%",t.id),o={...a.editorParams,enableNoAccess:a.enableNoAccess};o.exportparams&&(o.exportParams=JSON.parse(o.exportparams)),o.globaldownloadprifix?o.globalDownloadPrifix="true"===o.globaldownloadprifix:o.globalDownloadPrifix=ibiz.config.common.globalDownloadPrifix,ibiz.util.file.fileDownload(i,t.name,{context:a.context,params:a.params,data:e.data,file:{fileId:t.id,...t},extraParams:o,downloadTicketParams:a.downloadTicketParams},void 0,a.enableNoAccess)},onError:(...e)=>{const t=e[0];throw d.count-=1,new na({response:{data:JSON.parse(t.message),status:t.status}})},onRemove:t=>{if(e.disabled)return;const a=n.value.findIndex(e=>e.id===t.id);-1!==a&&n.value.splice(a,1),m()},onSuccess:e=>{if(e){if(ibiz.config.common.enableDownloadTicket&&!a.enableNoAccess&&e.ticket&&ibiz.util.file.setDownloadTicket(e.id,e.ticket),d.cacheFiles.push({name:e.filename,id:e.fileid,folder:e.folder,...a.transformInfoMap(e,a.infoMap)}),"svg"===e.name.split(".").pop()){const t=u.get(e.name);t&&(u.set(e.fileid,t),u.delete(e.name))}d.count-=1,0===d.count&&m()}},beforeUpload:e=>{if("svg"===e.name.split(".").pop()){const t=URL.createObjectURL(e);u.set(e.name,t)}const t=e.size/1024/1024;return a.size&&t>a.size?(ibiz.message.error("".concat(ibiz.i18n.t("editor.upload.fileSizeErr")," ").concat(a.size,"MB!")),!1):(d.count+=1,!0)}}}const EA=a({name:"IBizFileUpload",props:nt(),emits:Ve(),setup(e,{emit:t}){const a=B("file-upload"),n=e.controller,{useInFocusAndBlur:i,useInValueChange:o}=We(e,t),{uploadUrl:s,headers:l,files:c,limit:d,onDownload:u,onError:h,onRemove:p,onSuccess:m,beforeUpload:v}=SA(e,e=>{t("change",e),o()},n),g=r(()=>{var e;return 1===d.value&&1===(null==(e=c.value)?void 0:e.length)}),b=r(()=>!!n.parent.model.columnType),f=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),{componentRef:w}=je(()=>t("focus"),()=>i());return{ns:a,c:n,uploadUrl:s,headers:l,files:c,limit:d,noUploadIcon:g,onDownload:u,onError:h,onRemove:p,onSuccess:m,beforeUpload:v,isGridEditor:b,componentRef:w,showFormDefaultContent:f}},render(){let e;return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)],ref:"componentRef"},[n(i("el-upload"),y({class:[this.ns.b("icon"),this.ns.is("not-show",this.noUploadIcon)],"file-list":this.files,action:this.uploadUrl,headers:this.headers,disabled:this.disabled||this.readonly,multiple:this.c.multiple,limit:this.limit,drag:!!this.c.isDrag,accept:this.c.accept,"before-upload":this.beforeUpload,onSuccess:this.onSuccess,onError:this.onError,onRemove:this.onRemove,onPreview:this.onDownload},this.$attrs),{default:()=>{return[this.noUploadIcon?null:n(i("el-button"),{class:[this.ns.b("button")],size:this.isGridEditor?"small":"default"},(t=e=ibiz.i18n.t("editor.upload.uploadFiles"),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))];var t}})])}}),DA=a({name:"IBizImageUpload",props:nt(),emits:Ve(),setup(e,{emit:t}){const a=B("image-upload"),n=e.controller,{useInFocusAndBlur:i,useInValueChange:s}=We(e,t),{uploadUrl:l,headers:c,files:d,limit:u,onDownload:h,onError:p,onRemove:m,onSuccess:v,beforeUpload:g}=SA(e,e=>{t("change",e),s()},n),b=o([]),f=o(0),w=o(!1),y=r(()=>1===u.value&&1===d.value.length),C=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),{componentRef:I}=je(()=>t("focus"),()=>i());return{ns:a,c:n,files:d,limit:u,headers:c,uploadUrl:l,dialogImageUrl:b,dialogVisible:w,noUploadIcon:y,beforeUpload:g,onSuccess:v,onError:p,onRemove:m,onDownload:h,onDialogVisibleChange:e=>{w.value=e},onPreview:e=>{b.value=[],d.value.forEach(e=>{e.base64?b.value.push(e.base64):e.url&&b.value.push(e.url)}),f.value=d.value.findIndex(t=>t.url===e.url),w.value=!0},componentRef:I,showFormDefaultContent:C,dialogImageUrlIndex:f}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.readonly&&this.c.autoPreview&&this.ns.m("autosize"),this.ns.is("show-default",this.showFormDefaultContent)],ref:"componentRef"},[n("div",{class:this.ns.e("image-upload-list")},[this.files.map(e=>n("div",{key:e.id,class:this.ns.e("list-item")},[n("img",{src:e.base64?e.base64:e.url},null),n("div",{class:this.ns.e("list-item-cover")},[n("ion-icon",{class:this.ns.e("preview-icon"),onClick:()=>this.onPreview(e),name:"search"},null),n("ion-icon",{class:this.ns.e("download-icon"),onClick:()=>this.onDownload(e),name:"download"},null),n("ion-icon",{class:this.ns.e("remove-icon"),onClick:()=>this.onRemove(e),name:"remove"},null)])]))]),n(i("el-upload"),y({ref:"imageUpload",class:[this.ns.b("icon"),this.ns.is("not-show",this.noUploadIcon)],"file-list":this.files,action:this.uploadUrl,headers:this.headers,disabled:this.disabled,multiple:this.c.multiple,limit:this.limit,"show-file-list":!1,accept:this.c.accept,"list-type":"picture-card","before-upload":this.beforeUpload,onSuccess:this.onSuccess,onError:this.onError,onRemove:this.onRemove,onPreview:this.onDownload},this.$attrs),{default:()=>[n("ion-icon",{name:"add-outline",class:this.ns.e("image-upload-add")},null)]}),this.dialogVisible?n(i("el-image-viewer"),y({onClose:()=>this.onDialogVisibleChange(!1),"url-list":this.dialogImageUrl,"hide-on-click-modal":!0,"close-on-press-escape":!0,teleported:!0,"z-index":9999,"initial-index":this.dialogImageUrlIndex},this.$attrs),null):null])}}),PA=a({name:"IBizImagePreview",props:nt(),emits:Ve(),setup(e){var t,a;const n=B("image-preview"),i=e.controller;let o="false"!==(null==(t=i.editorParams)?void 0:t.STOPPROPAGATION);(null==(a=i.editorParams)?void 0:a.stoppropagation)&&(o="false"!==i.editorParams.stoppropagation);return{ns:n,c:i,showFormDefaultContent:r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),previewList:r(()=>o?[e.value]:[]),onClick:e=>{o&&e.stopPropagation()}}},render(){return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],onClick:this.onClick},[n(i("el-image"),y({fit:"contain",src:this.value,"preview-src-list":this.previewList},this.$attrs),null)])}}),kA=a({name:"IBizImageCropping",props:nt(),emits:Ve(),setup(e,{emit:t}){var a,n,i,s;const l=B("image-cropping-upload"),c=e.controller,{useInFocusAndBlur:d,useInValueChange:u}=We(e,t),{uploadUrl:h,headers:p,files:m,limit:v,onDownload:b,onError:f,onRemove:w,onSuccess:y,beforeUpload:C}=SA(e,e=>{t("change",e),u()},c),I=o([]),x=o(0),S=o(!1),E=o(!1),D=o(),P={};(null==(a=c.editorParams)?void 0:a.cropWidth)&&Object.assign(P,{cropareaWidth:Number(c.editorParams.cropWidth)}),(null==(n=c.editorParams)?void 0:n.cropwidth)&&Object.assign(P,{cropareaWidth:Number(c.editorParams.cropwidth)}),(null==(i=c.editorParams)?void 0:i.cropHeight)&&Object.assign(P,{cropareaHeight:Number(c.editorParams.cropHeight)}),(null==(s=c.editorParams)?void 0:s.cropheight)&&Object.assign(P,{cropareaHeight:Number(c.editorParams.cropheight)});const k=o(),z=o(!1),T=r(()=>1===v.value&&1===m.value.length),A=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),{componentRef:O}=je(()=>t("focus"),()=>d());return{ns:l,c:c,files:m,limit:v,headers:p,uploadUrl:h,dialogImageUrl:I,dialogVisible:S,noUploadIcon:T,beforeUpload:C,onSuccess:y,onError:f,onRemove:w,onDownload:b,onDialogVisibleChange:e=>{S.value=e},onPreview:e=>{I.value=[],m.value.forEach(e=>{e.base64?I.value.push(e.base64):e.url&&I.value.push(e.url)}),x.value=m.value.findIndex(t=>t.url===e.url),S.value=!0},componentRef:O,showFormDefaultContent:A,dialogImageUrlIndex:x,cropVisible:z,tempFileList:k,imageUpload:D,cropRect:P,onChange:e=>{"ready"!==e.status||E.value||(k.value=e,E.value=!0,z.value=!0)},cropDialogClose:()=>{k.value&&(ibiz.message.info(ibiz.i18n.t("editor.upload.cancelUpload")),D.value.handleRemove(k.value)),E.value=!1},cropChange:e=>{if(!e)return E.value=!1,z.value=!1,void ibiz.message.info(ibiz.i18n.t("editor.upload.cancelUpload"));const t=(e=>{const t=atob(e.split(",")[1]),a=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),i=new Uint8Array(n);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return new Blob([n],{type:a})})(e),a=new File([t],"cropimg.png",{type:t.type});a&&g(()=>{D.value.handleRemove(k.value),D.value.handleStart(a),k.value=void 0,D.value.submit(),E.value=!1,z.value=!1})}}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.readonly&&this.c.autoPreview&&this.ns.m("autosize"),this.ns.is("show-default",this.showFormDefaultContent)],ref:"componentRef"},[n("div",{class:this.ns.e("image-upload-list")},[this.files.map(e=>n("div",{key:e.id,class:this.ns.e("list-item")},[n("img",{src:e.base64?e.base64:e.url},null),n("div",{class:this.ns.e("list-item-cover")},[n("ion-icon",{class:this.ns.e("preview-icon"),onClick:()=>this.onPreview(e),name:"search"},null),n("ion-icon",{class:this.ns.e("download-icon"),onClick:()=>this.onDownload(e),name:"download"},null),n("ion-icon",{class:this.ns.e("remove-icon"),onClick:()=>this.onRemove(e),name:"remove"},null)])]))]),n(i("el-upload"),y({ref:"imageUpload",class:[this.ns.b("icon"),this.ns.is("not-show",this.noUploadIcon)],"file-list":this.files,action:this.uploadUrl,headers:this.headers,disabled:this.disabled,multiple:!1,limit:this.limit,"show-file-list":!1,accept:this.c.accept,"list-type":"picture-card","auto-upload":!1,onChange:this.onChange,"before-upload":this.beforeUpload,onSuccess:this.onSuccess,onError:this.onError,onRemove:this.onRemove,onPreview:this.onDownload},this.$attrs),{default:()=>[n("ion-icon",{name:"add-outline",class:this.ns.e("image-upload-add")},null)]}),n(i("el-dialog"),{modelValue:this.cropVisible,"onUpdate:modelValue":e=>this.cropVisible=e,title:ibiz.i18n.t("editor.upload.cropImg"),class:this.ns.e("upload-dialog"),onClosed:this.cropDialogClose,"destroy-on-close":!0,width:640},{default:()=>n(i("iBizCropping"),y({img:this.tempFileList,onChange:this.cropChange},this.cropRect),null)}),this.dialogVisible?n(i("el-image-viewer"),y({onClose:()=>this.onDialogVisibleChange(!1),"url-list":this.dialogImageUrl,"hide-on-click-modal":!0,"close-on-press-escape":!0,teleported:!0,"z-index":9999,"initial-index":this.dialogImageUrlIndex},this.$attrs),null):null])}});var zA=Object.defineProperty,TA=(e,t,a)=>(((e,t,a)=>{t in e?zA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class AA extends qi{constructor(){super(...arguments),TA(this,"isDrag",!1),TA(this,"multiple",!0),TA(this,"accept",""),TA(this,"size",0),TA(this,"uploadParams"),TA(this,"exportParams"),TA(this,"infoMap",""),TA(this,"autoPreview",!1),TA(this,"enableNoAccess",!1),TA(this,"transformInfoMap",(e={},t="",a=!1)=>{const n={};return t.split(";").forEach(t=>{let[i,o]=t.split(":");a&&(i=o),i&&o&&Object.assign(n,{[o]:e[i]})}),n})}async onInit(){var e;if(await super.onInit(),this.infoMap=ibiz.config.uploadEditor.infoMap,(null==(e=this.model.editorType)?void 0:e.includes("PICTURE"))&&(this.accept="image/*"),["FILEUPLOADER_ONE","PICTURE_ONE","PICTURE_ONE_RAW","MOBSINGLEFILEUPLOAD","MOBPICTURE_RAW"].includes(this.model.editorType)&&(this.multiple=!1),this.editorParams){const{isDrag:e,multiple:t,accept:a,size:n,uploadParams:i,exportParams:o,autoPreview:s,isdrag:l,uploadparams:r,exportparams:c,autopreview:d,infomap:u,enablenoaccess:h}=this.editorParams;if(e&&(this.isDrag=Boolean(e)),l&&(this.isDrag=Boolean(l)),s&&(this.autoPreview=s),d&&(this.autoPreview=d),t&&(this.multiple=Boolean(t)),a&&(this.accept=a),n&&(this.size=Number(n)),u&&(this.infoMap=u),h&&(this.enableNoAccess="true"===h),i)try{this.uploadParams=JSON.parse(i)}catch(e){throw new Xt(i,ibiz.i18n.t("editor.upload.uploadJsonFormatErr"))}if(r)try{this.uploadParams=JSON.parse(r)}catch(e){throw new Xt(r,ibiz.i18n.t("editor.upload.uploadJsonFormatErr"))}if(o)try{this.exportParams=JSON.parse(o)}catch(e){throw new Xt(o,ibiz.i18n.t("editor.upload.exportJsonFormatErr"))}if(c)try{this.exportParams=JSON.parse(c)}catch(e){throw new Xt(c,ibiz.i18n.t("editor.upload.exportJsonFormatErr"))}}}}var OA=Object.defineProperty,MA=(e,t,a)=>(((e,t,a)=>{t in e?OA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class NA{constructor(e){MA(this,"formEditor","IBizFileUpload"),MA(this,"gridEditor","IBizFileUpload");let t="IBizFileUpload";switch(e){case"PICTURE":case"PICTURE_ONE":case"MOBPICTURE":case"MOBPICTURELIST":t="IBizImageUpload";break;case"PICTURE_CROPPING":t="IBizImageCropping";break;case"PICTURE_ONE_RAW":case"MOBPICTURE_RAW":t="IBizImagePreview"}this.formEditor=t,this.gridEditor=t}async createController(e,t){const a=new AA(e,t);return await a.init(),a}}const BA=a({name:"IBizPicker",props:it(),emits:Ve(),setup(e,{emit:t}){var a;const s=B("picker"),l=e.controller,u=o(""),h=o([]),p=o(!0),v=o(!1),g=o(),b=o(!1),f=o(!1),w=(null==(a=l.model.editorParams)?void 0:a.actionpostion)||"bottom",y=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),C=()=>{const{value:t}=e;"OBJECT"===l.model.valueType?u.value=t&&l.objectNameField?t[l.objectNameField]:"":u.value=t||"";const a=e.data[l.valueItem];-1===h.value.findIndex(e=>Object.is(e[l.keyName],a))&&(h.value=[],t&&!Oo(a)&&h.value.push({[l.textName]:t,[l.keyName]:a}))};c(()=>e.value,()=>{C()},{immediate:!0});const I=e=>{e?v.value=e:setTimeout(()=>{v.value=e},100)},x=async e=>{const a=await l.calcFillDataItems(e);a.length&&a.forEach(e=>{t("change",e.value,e.id)}),Object.assign(e,{[l.keyName]:e[l.keyName]?e[l.keyName]:e.srfkey,[l.textName]:e[l.textName]?e[l.textName]:e.srfmajortext}),l.valueItem&&t("change",e[l.keyName],l.valueItem),"OBJECT"===l.model.valueType?t("change",l.handleObjectParams(e)):t("change",e[l.textName]),I(!1)};let S,E="";const D=e=>{const t=h.value.length?[...h.value]:[{srftype:"empty"}];"top"===w?t.unshift(...l.actionDetails):t.push(...l.actionDetails),l.isShowLoadMore&&t.push({srftype:"loadmore"}),e(t)},P=async(t,a)=>{if(l.model.appDataEntityId){let n="";t!==e.value&&(n=t.trim());const i=await l.getServiceData(n,e.data);i&&(h.value=i.data,b.value=!0,a&&a instanceof Function&&(E=n,S=a,D(a)))}},k=async()=>{if(l.total>h.value.length&&l.model.appDataEntityId){const t=await l.getServiceData(E,e.data,{isLoadMore:!0});t&&(h.value=[...h.value,...t.data],S&&D(S))}},z=(l.linkView?1:0)+(l.pickupView?1:0);c(g,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const T=r(()=>ot(u.value));c(T,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});const A=o(),O=o(!1),M=e=>{var t,a,n,i,o;const s=null==(t=A.value)?void 0:t.contains(e.target),l=null==(n=null==(a=g.value)?void 0:a.inputRef)?void 0:n.input.contains(e.target);s||l||!O.value||(null==(o=null==(i=g.value)?void 0:i.popperRef)||o.onClose(),O.value=!1)},N=()=>{var e,t;return null==(t=null==(e=g.value)?void 0:e.popperRef)?void 0:t.popperRef.contentRef.querySelector(".el-scrollbar__wrap")},L=_o(async()=>{const e=N();if(!e)return;const{scrollTop:t,scrollHeight:a,clientHeight:n}=e;a-t-n<=20&&await k()},300);d(()=>{c(()=>e.data[l.valueItem],async(a,n)=>{if(a!==n){b.value||!Po(e.value)||Po(a)||await P("");const n=h.value.find(e=>Object.is(e[l.keyName],a));n&&(u.value=n[l.textName],Po(e.value)&&!Po(a)&&t("change",u.value,l.model.id,!0)),null===a&&t("change",null,l.model.id,!0)}(()=>{var e;switch(l.pagingMode){case 3:document.addEventListener("mouseup",M);break;case 2:null==(e=N())||e.addEventListener("scroll",L)}})()},{immediate:!0})}),m(()=>{var e;switch(l.pagingMode){case 3:document.removeEventListener("mouseup",M);break;case 2:null==(e=N())||e.removeEventListener("scroll",L)}});return{ns:s,c:l,items:h,curValue:u,valueText:T,editorRef:g,closeCircle:z,isEditable:v,isReverse:f,showFormDefaultContent:y,onBlur:e=>{f.value=!1,C(),t("blur",e),I(!1)},onFocus:e=>{f.value=!0,l.noAC||(g.value.loading=!0),t("focus",e),I(!0)},onClear:()=>{const e=l.dataItems;(null==e?void 0:e.length)&&e.forEach(e=>{t("change",null,e.id)}),l.valueItem&&t("change",null,l.valueItem),t("change",null)},onSearch:P,onACSelect:async e=>{if(p.value=!0,I(!1),"empty"===e.srftype||"DEUIACTION"===e.detailType||"loadmore"===e.srftype)return C();await x(e)},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},setEditable:I,renderEmpty:()=>n(i("iBizNoData"),{class:s.e("empty"),onClick:e=>e.stopPropagation()},null),renderLoadMore:()=>n("div",{ref:A,class:s.e("loadmore"),onClick:e=>(async e=>{var t,a;e.preventDefault(),e.stopPropagation(),k(),null==(a=null==(t=g.value)?void 0:t.popperRef)||a.onOpen(),O.value=!0})(e)},[ibiz.i18n.t("editor.common.loadMore")]),openLinkView:async t=>{t.stopPropagation();const a=await l.openLinkView(e.data);a&&a.ok&&a.data&&a.data.length>0&&await x(a.data[0])},openPickUpView:async t=>{t.stopPropagation();const a=await l.openPickUpView(e.data,JSON.stringify((()=>{const t=[];if(u.value){const a={srfkey:e.data[l.valueItem],srfmajortext:u.value,..."OBJECT"===l.model.valueType&&e.value&&l.objectValueField?e.value[l.objectValueField]:{}};l.deACMode&&l.dataItems.length&&l.dataItems.forEach(t=>Object.assign(a,{[t.appDEFieldId]:e.data[t.id]})),t.push(a)}return t})()));a&&a[0]&&await x(a[0])},renderActionItem:t=>{if(l.groupActionState[t.id].visible)return n("div",{title:Tt(t.tooltip),class:[s.e("action-item"),s.is("disabled",l.groupActionState[t.id].disabled)],onClick:a=>{l.groupActionState[t.id].disabled||l.onActionClick(t,e.data,a)}},[t.showIcon&&t.sysImage&&n(i("iBizIcon"),{class:s.em("action-item","icon"),icon:t.sysImage},null),n("span",{class:s.em("action-item","caption")},[t.showCaption?t.caption:""])])}}},render(){const e="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),t=t=>{var a;const o=null==(a=this.c.deACMode)?void 0:a.itemLayoutPanel,{context:s,params:r}=this.c;let c=(t[this.c.textName]||t.srfmajortext)===this.curValue;this.c.valueItem&&(c=(t[this.c.keyName]||t.srfkey)===this.data[this.c.valueItem]);const d=[this.ns.is("active",c),this.ns.e("transfer-item")];if(this.c.acItemProvider){const e=i(this.c.acItemProvider.component);return l(e,{item:t,controller:this.c,class:d,onClick:()=>{this.onACSelect(t)}})}return o?n(i("iBizControlShell"),{data:t,class:d,modelData:o,context:s,params:r,onClick:()=>{this.onACSelect(t)}},null):n("div",{class:[this.ns.is("ellipsis",e),...d],title:Tt(e?t[this.c.textName]:""),onClick:()=>{this.onACSelect(t)}},[t[this.c.textName]])},a=this.c.noAC?n(i("el-input"),y({ref:"editorRef",class:[this.ns.b("input")],modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,clearable:!0,placeholder:this.c.placeHolder,onClear:this.onClear,disabled:this.disabled,onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp},this.$attrs),{suffix:()=>this.$slots.append?this.$slots.append({}):this.c.noButton?void 0:[this.c.model.pickupAppViewId?n("ion-icon",{onClick:this.openPickUpView,name:"search"},null):null,this.c.model.linkAppViewId&&this.curValue?n("ion-icon",{onClick:this.openLinkView,name:"link-arrow"},null):null]}):n("div",{class:[this.ns.e("autocomplete"),this.ns.m(this.closeCircle.toString())]},[n(i("el-autocomplete"),y({ref:"editorRef",class:[this.ns.b("input")],modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,"value-key":this.c.textName,placeholder:this.c.placeHolder,clearable:!0,"popper-class":[this.ns.e("transfer"),this.ns.bm("popper","".concat(this.c.model.id)),this.ns.is("empty",!this.items.length)],"fetch-suggestions":this.onSearch,onClear:this.onClear,onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp,onSelect:this.onACSelect,disabled:this.disabled,"fit-input-width":e},this.$attrs),{default:({item:e})=>this.$slots.append?this.$slots.append({}):"empty"===e.srftype?this.renderEmpty():"loadmore"===e.srftype?this.renderLoadMore():"DEUIACTION"===e.detailType?this.renderActionItem(e):t(e),suffix:()=>{if(!this.c.noButton)return[this.c.model.pickupAppViewId?n("ion-icon",{onClick:this.openPickUpView,name:"search"},null):null,this.c.model.linkAppViewId&&this.curValue?n("ion-icon",{onClick:this.openLinkView,name:"link-arrow"},null):null,this.c.model.showTrigger&&!this.c.model.pickupAppViewId?n("ion-icon",{name:"chevron-down-outline",class:[this.ns.e("suffix"),this.ns.is("reverse",this.isReverse)]},null):null]}})]),o=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),s=n("div",{class:this.ns.b("form-default-content")},[this.curValue?this.valueText:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&s,this.readonly?o:a])}});const LA=a({name:"IBizMPicker",props:it(),emits:Ve(),setup(e,{emit:t}){var a;const s=B("mpicker"),u=e.controller,h=o([]),p=o([]),m=o([]),v=o(!1),g=o(!1),b=o(!1),f=o(),w=(null==(a=u.model.editorParams)?void 0:a.actionpostion)||"bottom",y="ellipsis"===(u.editorParams.overflowMode||u.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),C=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),I=()=>{if(h.value=[],m.value=[],e.value){if("OBJECTS"===u.model.valueType)e.value.forEach(e=>{const t=Ko(e);Object.assign(t,{[u.keyName]:e[u.objectIdField],[u.textName]:e[u.objectNameField]}),u.objectValueField&&(Object.assign(t,{...e[u.objectValueField]}),delete t[u.objectValueField]),t[u.keyName]&&m.value.push(t)});else if(u.objectIdField&&u.model.valueSeparator){e.value.split(u.model.valueSeparator).forEach(e=>{m.value.push({[u.keyName]:e})})}else try{m.value=JSON.parse(e.value)}catch(t){ibiz.log.error("SIMPLE类型地址栏值格式".concat(e.value,"不符合JSON字符串要求"))}m.value.forEach(e=>{h.value.push(e[u.keyName]);const t=p.value.findIndex(t=>Object.is(t[u.keyName],e[u.keyName]));t<0&&p.value.push({[u.keyName]:e[u.keyName],[u.textName]:e[u.textName]})})}};c(()=>e.value,()=>{I()},{immediate:!0,deep:!0}),c(f,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const x=e=>{e?b.value=e:setTimeout(()=>{b.value=e},100)},S=async t=>{if(u.model.appDataEntityId){g.value=!0;try{const a=t.trim(),n=await u.getServiceData(a,e.data);g.value=!1,n&&(p.value=n.data)}catch(e){g.value=!1}}},E=r(()=>m.value.map(e=>e[u.textName]).join(","));c(E,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});d(()=>{u.objectNameField&&S("")});const D=()=>u.actionDetails.map(t=>{if(u.groupActionState[t.id].visible)return n(i("el-option"),{key:t.id,label:t.caption,value:"DEUIACTION-".concat(t.id),disabled:u.groupActionState[t.id].disabled,title:Tt(y?t.tooltip:"")},{default:()=>n("div",{class:[s.e("action-item"),s.is("disabled",u.groupActionState[t.id].disabled)],onClick:a=>{u.groupActionState[t.id].disabled||u.onActionClick(t,e.data,a)}},[t.showIcon&&t.sysImage&&n(i("iBizIcon"),{class:s.em("action-item","icon"),icon:t.sysImage},null),n("span",{class:s.em("action-item","caption")},[t.showCaption?t.caption:""])])})}),P=()=>p.value.length?p.value.map(e=>n(i("el-option"),{key:e[u.keyName],value:e[u.keyName],label:e[u.textName],title:Tt(y?e[u.textName]:"")},{default:()=>{var t;if(u.acItemProvider){const t=i(u.acItemProvider.component);return l(t,{item:e,controller:u})}const a=null==(t=u.deACMode)?void 0:t.itemLayoutPanel;return a?n(i("iBizControlShell"),{data:e,modelData:a,context:u.context,params:u.params},null):n("span",null,[null!=e[u.textName]?e[u.textName]:""])}})):[n(i("el-option"),{value:"empty"},{default:()=>[n(i("iBizNoData"),{class:s.e("empty"),onClick:e=>e.stopPropagation()},null)]})];return{c:u,ns:s,items:p,loading:g,curValue:h,valueText:E,editorRef:f,isEllipsis:y,isEditable:b,selectItems:m,showFormDefaultContent:C,onBlur:e=>{t("blur",e),x(!1)},onFocus:e=>{t("focus",e),x(!0)},onSearch:S,onSelect:async e=>{var a;if(x(!1),e.includes("empty")||e.some(e=>e.includes("DEUIACTION")))return null==(a=f.value)||a.blur(),I();const n=[];let i=null;const o=e.map(e=>{let t=p.value.findIndex(t=>Object.is(t[u.keyName],e)),a={};return t>=0?a=p.value[t]:(t=m.value.findIndex(t=>Object.is(t[u.keyName],e)),t>=0&&(a=m.value[t])),a}),s=o.map(async e=>{const t=await u.calcFillDataItems(e),a={};return t.forEach(e=>{Object.assign(a,{[e.id]:e.value})}),a}),l=await Promise.all(s);o.forEach((e,t)=>{const a=l[t];"OBJECTS"===u.model.valueType?n.push({...u.handleObjectParams(e),...a}):u.objectIdField?n.push(e[u.keyName]):n.push({[u.keyName]:e[u.keyName],[u.textName]:e[u.textName],...a})}),n.length>0&&(i="OBJECTS"===u.model.valueType?n:u.objectIdField?n.join(u.model.valueSeparator):JSON.stringify(n)),t("change",i)},onRemove:e=>{const a=m.value.findIndex(t=>Object.is(t[u.keyName],e));if(a>=0){m.value.splice(a,1);const e=[];let n=null;m.value.forEach(t=>{"OBJECTS"===u.model.valueType?e.push(u.handleObjectParams(t)):u.objectIdField?e.push(t[u.keyName]):e.push({[u.keyName]:t[u.keyName],[u.textName]:t[u.textName]})}),e.length>0&&(n="OBJECTS"===u.model.valueType?e:u.objectIdField?e.join(u.model.valueSeparator):JSON.stringify(e)),t("change",n)}},onOpenChange:e=>{v.value=e,v.value&&(p.value=[],S(""))},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},setEditable:x,openPickUpView:async()=>{let a;if(m.value.length){const e=JSON.parse(JSON.stringify(m.value));e.forEach((t,a)=>{e[a].srfkey=t[u.keyName],e[a].srfmajortext=t[u.textName]}),a=JSON.stringify(e)}const n=await u.openPickUpView(e.data,a);n&&(async e=>{const a=[];if(e&&Array.isArray(e)){const t=e.map(async e=>{const t=e;e.srfnodeid&&Object.assign(t,e._deData);const a=await u.calcFillDataItems(t),n={};return a.forEach(e=>{Object.assign(n,{[e.id]:e.value})}),n}),n=await Promise.all(t);e.forEach((e,t)=>{Object.assign(e,{[u.keyName]:e[u.keyName]?e[u.keyName]:e.srfkey,[u.textName]:e[u.textName]?e[u.textName]:e.srfmajortext});const i=n[t];"OBJECTS"===u.model.valueType?a.push({...u.handleObjectParams(e),...i}):u.objectIdField?a.push(e[u.keyName]):a.push({[u.keyName]:e[u.keyName],[u.textName]:e[u.textName],...i}),p.value.findIndex(t=>Object.is(t[u.keyName],e[u.keyName]))<0&&p.value.push(e)})}let n=null;a.length>0&&(n="OBJECTS"===u.model.valueType?a:u.objectIdField?a.join(u.model.valueSeparator):JSON.stringify(a)),t("change",n),x(!1)})(n)},renderListContent:()=>"top"===w?[...D(),...P()]:[...P(),...D()]}},render(){let e;const t=[!this.readonly&&n(i("el-select"),y({ref:"editorRef",class:[this.ns.b("select")],modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,filterable:!0,remote:!0,multiple:!0,"popper-class":[this.ns.e("transfer"),this.ns.is("empty",!this.items.length)],teleported:!this.showFormDefaultContent,loading:this.loading,placeholder:this.c.placeHolder?this.c.placeHolder:" ","remote-method":this.onSearch,onVisibleChange:this.onOpenChange,onChange:this.onSelect,onRemoveTag:this.onRemove,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp,"fit-input-width":this.isEllipsis,"remote-show-suffix":this.c.model.showTrigger},this.$attrs),(a=e=this.renderListContent(),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?e:{default:()=>[e]})),!this.readonly&&n("div",{class:this.ns.e("buns-position")},[this.c.model.pickupAppViewId?n("div",{class:this.ns.e("btns"),onClick:this.openPickUpView},[n("ion-icon",{name:"search"},null)]):null])];var a;const o=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),l=n("div",{class:this.ns.b("form-default-content")},[this.curValue.length>0?this.selectItems.map(e=>n("span",{class:this.ns.b("content-item")},[e[this.c.textName]])):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&l,this.readonly?o:t])}}),RA=a({name:"IBizPickerDropDown",props:it(),emits:Ve(),setup(e,{emit:t}){const a=B("picker-dropdown"),s=e.controller,l=o(""),u=o([]),h=o(!1),p=o(""),m=o(!1),v=o(),b=o(!1);let f=null;const w=o(!1),y=o(),C=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),I=()=>{const{value:t}=e;"OBJECT"===s.model.valueType?l.value=t&&s.objectNameField?t[s.objectNameField]:"":l.value=t||"";const a=e.data[s.valueItem];p.value=a||l.value;-1===u.value.findIndex(e=>Object.is(e[s.keyName],a))&&(u.value=[],Po(e.value)||Po(a)||u.value.push({[s.textName]:e.value,[s.keyName]:a}))};c(()=>e.value,()=>{I()},{immediate:!0}),c(v,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const x=async t=>{if(h.value)if(s.model.appDataEntityId&&!1===b.value){b.value=!0;try{let a="";t!==e.value&&(a=t.trim());const n=await s.getServiceData(a,e.data);n&&(u.value=n.data)}finally{if(b.value=!1,w.value=!0,null!=f){const e=f;f=null,await x(e)}}}else f=t},S=e=>{e?m.value=e:setTimeout(()=>{m.value=e},100)},E=r(()=>ot(l.value)),{popoverid:D,setPopoverZIndex:P}=fe();c(E,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),d(()=>{c(()=>e.data[s.valueItem],async(a,n)=>{if(a!==n){w.value||!Po(e.value)||Po(a)||(h.value=!0,await x(""),h.value=!1);const n=u.value.find(e=>Object.is(e[s.keyName],a));n&&(l.value=n[s.textName],Po(e.value)&&!Po(a)&&t("change",l.value,s.model.id,!0)),p.value=a,null===a&&t("change",null,s.model.id,!0)}},{immediate:!0,deep:!0}),P("--".concat(a.namespace,"-picker-dropdown-transfer-zindex"))});return{ns:a,c:s,refValue:p,curValue:l,valueText:E,loading:b,items:u,onOpenChange:e=>{var t,a,n;if(e)u.value=[],x("");else{"SEARCHFORM"===(null==(n=null==(a=null==(t=s.parent)?void 0:t.form)?void 0:a.model)?void 0:n.controlType)&&g(()=>{var e;null==(e=y.value)||e.focus()})}},onClear:()=>{const e=s.dataItems;(null==e?void 0:e.length)&&e.forEach(e=>{t("change",null,e.id)}),s.valueItem&&t("change",null,s.valueItem),t("change",null)},onSelect:a=>{if(h.value=!1,S(!1),"empty"===a)return void I();const n=s.actionDetails.find(e=>e.id===a);if(n)return s.onActionClick(n,e.data),void I();const i=u.value.findIndex(e=>Object.is(e[s.keyName],a));i>=0&&(async e=>{const a=await s.calcFillDataItems(e);a.length&&a.forEach(e=>{t("change",e.value,e.id)});const n=ko(e);Object.assign(n,{[s.keyName]:n[s.keyName]?n[s.keyName]:n.srfkey,[s.textName]:n[s.textName]?n[s.textName]:n.srfmajortext}),s.valueItem&&t("change",n[s.keyName],s.valueItem),"OBJECT"===s.model.valueType?t("change",s.handleObjectParams(n)):t("change",e[s.textName]),S(!1)})(u.value[i])},onSearch:x,onFocus:e=>{h.value=!0,t("focus",e),S(!0)},onBlur:e=>{h.value=!1,t("blur",e),S(!1)},onClick:()=>{h.value=!0},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},editorRef:v,isEditable:m,setEditable:S,showFormDefaultContent:C,renderGroupAction:()=>{const t=s.actionDetails;if(t.length&&s.groupActionState.visible)return t.map(t=>(t=>{if(s.groupActionState[t.id].visible)return n(i("el-option"),{value:t.id,title:Tt(t.tooltip),disabled:s.groupActionState[t.id].disabled},{default:()=>[n("div",{class:a.e("action-item"),onClick:a=>s.onActionClick(t,e.data,a)},[t.showIcon&&t.sysImage&&n(i("iBizIcon"),{icon:t.sysImage},null),t.showCaption?t.caption:""])]})})(t))},renderEmpty:()=>{if(!u.value.length)return n(i("el-option"),{value:"empty"},{default:()=>[n(i("iBizNoData"),{class:a.e("empty"),onClick:e=>e.stopPropagation()},null)]})},popoverid:D,hiddenInputRef:y}},render(){const e="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),t=this.readonly?this.value:n(i("el-select"),y({ref:"editorRef",class:[this.ns.b("select")],modelValue:this.refValue,"onUpdate:modelValue":e=>this.refValue=e,filterable:!0,remote:!0,"remote-show-suffix":this.c.model.showTrigger,clearable:!0,"popper-class":[this.popoverid,this.ns.e("transfer"),this.ns.is("empty",!this.items.length)],loading:this.loading,placeholder:this.c.placeHolder?this.c.placeHolder:" ","remote-method":this.onSearch,onVisibleChange:this.onOpenChange,onChange:this.onSelect,onClear:this.onClear,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp,onClick:this.onClick,"fit-input-width":e},this.$attrs),{default:()=>[this.items.map(t=>n(i("el-option"),{title:Tt(e?t[this.c.textName]:""),value:t[this.c.keyName],key:t[this.c.keyName],label:t[this.c.textName]},{default:()=>{var e;if(this.c.acItemProvider){const e=i(this.c.acItemProvider.component);return l(e,{item:t,controller:this.c})}const a=null==(e=this.c.deACMode)?void 0:e.itemLayoutPanel;return a?n(i("iBizControlShell"),{data:t,modelData:a,context:this.c.context,params:this.c.params},null):n("span",null,[null!=t[this.c.textName]?t[this.c.textName]:""])}})),this.renderEmpty(),this.renderGroupAction()]}),a=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),o=n("div",{class:this.ns.b("form-default-content")},[this.curValue?this.valueText:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]),s=n("input",{ref:"hiddenInputRef",type:"text",class:this.ns.e("hidden-input"),readonly:!0,onKeyup:this.handleKeyUp},null);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&o,this.readonly?a:t,this.readonly?null:s])}}),_A=a({name:"IBizPickerLink",props:it(),emits:Ve(),setup(e,{emit:t}){const a=B("picker-link"),n=e.controller,i=o(""),s=o([]),l=o(!1),{useInFocusAndBlur:u,useInValueChange:h}=We(e,t),p=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,e=>{"OBJECT"===n.model.valueType?i.value=e&&n.objectNameField?e[n.objectNameField]:"":i.value=e||""},{immediate:!0}),d(()=>{c(()=>e.data[n.valueItem],async(a,o)=>{if(a!==o){l.value||!Po(e.value)||Po(a)||await(async t=>{if(n.model.appDataEntityId){let a="";t!==e.value&&(a=t.trim());const i=await n.getServiceData(a,e.data);i&&(l.value=!0,s.value=i.data)}})("");const o=s.value.find(e=>Object.is(e[n.keyName],a));o&&(i.value=o[n.textName],Po(e.value)&&!Po(a)&&t("change",i.value,n.model.id,!0)),null===a&&t("change",null,n.model.id,!0)}},{immediate:!0})});const{componentRef:m}=je(()=>t("focus"),()=>u()),v=r(()=>ot(i.value));return c(v,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),{ns:a,openLinkView:async()=>{const a=await n.openLinkView(e.data);a&&a.ok&&a.data&&a.data.length&&(e=>{const a={};Object.assign(a,e),Object.assign(a,{[n.keyName]:a[n.keyName]?a[n.keyName]:a.srfkey,[n.textName]:a[n.textName]?a[n.textName]:a.srfmajortext}),n.valueItem&&t("change",a[n.keyName],n.valueItem),"OBJECT"===n.model.valueType?t("change",n.handleObjectParams(a)):t("change",e[n.textName]),h()})(a.data[0])},curValue:i,editorRef:m,showFormDefaultContent:p}},render(){var e,t;const a=null==this.curValue||""===this.curValue,o="ellipsis"===(null==(e=this.controller.editorParams)?void 0:e.overflowMode)||"ellipsis"===(null==(t=this.controller.editorParams)?void 0:t.overflowmode);return n("div",{class:[this.ns.b(),this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("empty",a),this.ns.is("ellipsis",o)],ref:"editorRef",title:Tt(a?"":this.curValue)},[n("a",{onClick:()=>{a||this.openLinkView()}},[a?n(i("iBizEditorEmptyText"),{showPlaceholder:this.controller.emptyShowPlaceholder,placeHolder:this.controller.placeHolder},null):this.curValue])])}}),jA=a({name:"IBizPickerEmbedView",props:it(),emits:Ve(),setup(e,{emit:t}){const a=B("picker-embed-view"),n=e.controller,i=o(n.context.clone()),s=o({...n.params}),l=r(()=>({checkstrictly:!0,...s.value}));c(()=>e.data,e=>{const{context:t,params:a}=n.handlePublicParams(e,n.context,n.params),o=Object.assign(n.context.clone(),t),l=Object.assign({...n.params},a);JSON.stringify(i.value)!==JSON.stringify(o)&&(i.value=o),JSON.stringify(s.value)!==JSON.stringify(l)&&(s.value=l)},{deep:!0,immediate:!0});const d=n.model.editorParams,u=o(!0),h=o(!0),p=o(!0);d&&(d.multiple&&(u.value=!n.toBoolean(d.multiple)),d.checkStrictly&&(h.value=n.toBoolean(d.checkStrictly)),d.checkstrictly&&(h.value=n.toBoolean(d.checkstrictly)),d.isShowText&&(p.value=n.toBoolean(d.isShowText)),d.isshowtext&&(p.value=n.toBoolean(d.isshowtext)));const m=o([]);c(()=>e.value,t=>{var a,i,o,s;if(m.value=[],t&&n.valueItem){const l=null==(o=null==(i=null==(a=e.data)?void 0:a[n.valueItem])?void 0:i.split)?void 0:o.call(i,","),r=null==(s=null==t?void 0:t.split)?void 0:s.call(t,",");l&&r&&(m.value=l.map((e,t)=>({srfkey:e,srfmajortext:r[t]})))}},{immediate:!0});const{componentRef:v}=je(()=>t("focus"),()=>t("blur"));return{ns:a,c:n,context:i,params:s,editorRef:v,isShowText:p,cloneParams:l,singleSelect:u,selectedData:m,checkStrictly:h,onSelectionChange:e=>{(e=>{let a="",i="";e&&Array.isArray(e)&&(e.forEach(e=>{a+="".concat(e.srfkey,","),i+="".concat(e.srfmajortext,",")}),a=a.substring(0,a.length-1),i=i.substring(0,i.length-1),n.valueItem&&t("change",a,n.valueItem),t("change",i))})(e.data)}}},render(){const e=i("IBizViewShell");return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.isShowText?this.ns.m("show-value"):""],ref:"editorRef"},[this.c.model.pickupAppViewId?[n("div",{class:this.ns.b("view")},[l(e,{context:this.context,params:this.cloneParams,viewId:this.c.model.pickupAppViewId,state:{singleSelect:this.singleSelect,checkStrictly:this.checkStrictly,selectedData:this.selectedData},onSelectionChange:this.onSelectionChange})]),this.isShowText&&n("div",{class:this.ns.b("value")},[this.$props.value?this.$props.value.split(",").map(e=>n("span",null,[e,p("; ")])):n("span",null,[this.c.placeHolder])])]:null])}});const VA=a({name:"IBizPickerSelectView",props:it(),emits:Ve(),setup(e,{emit:t}){var a;const i=B("picker-select-view"),s=e.controller,l=s.model,u=o(!0);l.editorParams&&l.editorParams.multiple&&(u.value=!s.toBoolean(l.editorParams.multiple));const h=o([]),p=o([]),m=o([]),v=o(""),g=o(!1),b=o("auto"),f=o(s.context.clone()),w=o({...s.params}),y=r(()=>({...w.value}));c(()=>e.data,e=>{const{context:t,params:a}=s.handlePublicParams(e,s.context,s.params),n=Object.assign(s.context.clone(),t),i={...s.params,...a};JSON.stringify(f.value)!==JSON.stringify(n)&&(f.value=n),JSON.stringify(w.value)!==JSON.stringify(i)&&(w.value=i)},{immediate:!0,deep:!0});const C=o(!1),I=o(null),x=o(null),S=o(null),E=o(!1),D="DESIGN"===(null==(a=s.context)?void 0:a.srfrunmode),P=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),k=e=>{e?C.value=e:setTimeout(()=>{C.value=e},100)},{componentRef:z}=je(()=>t("focus"),()=>t("blur"));c(()=>e.value,t=>{if(u.value)"OBJECT"===s.model.valueType?v.value=t?t[s.objectNameField]:null:v.value=t||"",s.valueItem||D?m.value=[{srfkey:e.data[s.valueItem],srfmajortext:e.value}]:ibiz.log.error("值项异常");else{const a=[];if(h.value=[],p.value=[],t)if("OBJECTS"===s.model.valueType)t.forEach(e=>{const t=ko(e);Object.assign(t,{[s.keyName]:e[s.objectIdField],[s.textName]:e[s.objectNameField]}),s.objectValueField&&(Object.assign(t,{...e[s.objectValueField]}),delete t[s.objectValueField]),t[s.keyName]&&(p.value.push(t),h.value.push(t[s.keyName]))}),a.push(...t);else if(s.valueItem){const n=e.data[s.valueItem].split(","),i=t.split(",");n.forEach((e,t)=>{a.push({srfmajortext:i[t],srfkey:e})}),a.forEach(e=>{h.value.push(e.srfkey);const t=p.value.findIndex(t=>Object.is(t.srfkey,e.srfkey));t<0&&p.value.push({srfmajortext:e.srfmajortext,srfkey:e.srfkey})})}else ibiz.log.error("值项异常");m.value=a,S.value=a}},{immediate:!0,deep:!0}),c(z,t=>{e.autoFocus&&t&&t.focus&&t.focus()}),d(()=>{z.value&&(b.value="".concat(z.value.$parent.$el.offsetWidth,"px"))});const T=()=>{const e=s.dataItems;(null==e?void 0:e.length)&&e.forEach(e=>{t("change",null,e.id)}),s.valueItem&&t("change",null,s.valueItem),t("change",null)},A=e=>{if(0!==e.length){if(u.value){if(g.value=!1,s.valueItem){const a=e[0][s.keyName]?e[0][s.keyName]:e[0].srfkey;t("change",a,s.valueItem)}const a=e[0][s.textName]?e[0][s.textName]:e[0].srfmajortext;"OBJECT"===s.model.valueType?t("change",s.handleObjectParams(e[0])):t("change",a)}else if("OBJECTS"===s.model.valueType){if(e&&Array.isArray(e)){const t=[];e.forEach(e=>{const a=s.handleObjectParams(e);t.push(a)}),S.value=t}}else{let t="",a="";e&&Array.isArray(e)&&(p.value=[],e.forEach(e=>{const n=e[s.keyName]?e[s.keyName]:e.srfkey;t+="".concat(n,",");const i=e[s.textName]?e[s.textName]:e.srfmajortext;a+="".concat(i,",");p.value.findIndex(e=>Object.is(e.srfkey,n))<0&&p.value.push({srfmajortext:i,srfkey:n})})),t=t.substring(0,t.length-1),a=a.substring(0,a.length-1),s.valueItem&&(I.value=t),x.value=a}u.value||(0===e.length?(p.value=[],h.value=[]):Array.isArray(e)&&(p.value=e.map(e=>({srfkey:e[s.keyName]||e.srfkey,srfmajortext:e[s.textName]||e.srfmajortext})),h.value=p.value.map(e=>e.srfkey))),u.value||("OBJECTS"===s.model.valueType?t("change",S.value):(s.valueItem&&t("change",I.value,s.valueItem),t("change",x.value)))}else u.value?T():(p.value=[],"OBJECTS"===s.model.valueType?S.value=null:(s.valueItem&&(I.value=null),x.value=null),h.value=[])},O=(e,t=!1)=>{e.data&&(A(e.data),t&&z.value&&z.value.handleClose())},M=new ca({mode:da.DRAWER,viewUsage:2,dismiss:e=>{O(e,!0)}}),N=e=>{t("blur",e),k(!1)},L=r(()=>u.value?v.value:m.value.map(e=>e[s.textName]).join(","));return{c:s,ns:i,items:p,modal:M,keySet:h,params:w,visible:g,context:f,showView:E,editorRef:z,valueText:L,isEditable:C,queryValue:v,cloneParams:y,selectedData:m,singleSelect:u,pickViewWidth:b,showFormDefaultContent:P,arrow:()=>n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[n("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"},null)]),onBlur:N,onClear:T,onFocus:e=>{t("focus",e),k(!0)},triggerMenu:t=>{e.disabled||(g.value=t||!g.value)},setEditable:k,handleKeyUp:e=>{e&&"Enter"===e.code?t("enter",e):"Escape"===e.code&&(e.stopPropagation(),z.value&&z.value.handleClose())},openLinkView:async t=>{t.stopPropagation();const a=await s.openLinkView(e.data);a&&a.ok&&a.data&&A(a.data)},remoteMethod:e=>{v.value=e},onInputChange:e=>{e||T()},onSelectChange:e=>{const a=[];if(e.length>0&&e.forEach(e=>{const t=p.value.findIndex(t=>Object.is(t.srfkey,e));t>=0&&a.push(p.value[t])}),"OBJECTS"===s.model.valueType){const e=[];a.forEach(t=>{const a=s.handleObjectParams(t);e.push(a)}),t("change",e)}else{let e="",n="";a.forEach(t=>{const a=t[s.keyName]?t[s.keyName]:t.srfkey;e+="".concat(a,",");const i=t[s.textName]?t[s.textName]:t.srfmajortext;n+="".concat(i,",")}),e=e.substring(0,e.length-1),n=n.substring(0,n.length-1),s.valueItem&&(I.value=e,t("change",e,s.valueItem)),x.value=n,t("change",n)}},onVisibleChange:e=>{E.value=e,!1===e?N({}):z.value&&(b.value="".concat(z.value.$parent.$el.offsetWidth,"px"))},onViewDataChange:A,onSelectionChange:O,handleDropDownKeyDown:e=>{"Escape"===e.code&&(e.stopPropagation(),z.value&&z.value.handleClose())}}},render(){const e=n(i("el-dropdown"),{ref:"editorRef",trigger:"click",disabled:this.disabled||this.readonly,class:this.ns.b("select"),"popper-class":this.ns.b("popper"),onVisibleChange:this.onVisibleChange,onKeydown:this.handleDropDownKeyDown},{default:()=>{let e;return this.singleSelect?n(i("el-input"),{modelValue:this.queryValue,"onUpdate:modelValue":e=>this.queryValue=e,placeholder:this.c.placeHolder,disabled:this.disabled,readonly:this.readonly,onChange:this.onInputChange,clearable:!0,onFocus:e=>{this.onFocus(e)},onKeyup:this.handleKeyUp},{suffix:()=>[this.queryValue&&!this.disabled&&!this.readonly&&n("ion-icon",{onClick:this.onClear,name:"clear"},null),this.c.model.linkAppViewId&&n("ion-icon",{onClick:this.openLinkView,name:"link-arrow"},null),this.c.model.showTrigger&&n("div",{class:[this.ns.e("arrow"),this.showView?"overturn":""]},[this.arrow()])]}):n(i("el-select"),{"popper-class":this.ns.b("select-popover"),"model-value":this.keySet,placeholder:this.c.placeHolder?this.c.placeHolder:" ",multiple:!0,filterable:!0,remote:!0,"remote-method":this.remoteMethod,onChange:this.onSelectChange,onFocus:e=>{this.onFocus(e)},onKeyup:this.handleKeyUp,disabled:this.disabled||this.readonly,"remote-show-suffix":this.c.model.showTrigger},(t=e=this.items.map((e,t)=>n(i("el-option"),{key:e.srfkey+t,label:e.srfmajortext,value:e.srfkey},null)),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}));var t},dropdown:()=>{var e,t;if(!this.showView)return;const a=i("IBizViewShell");return this.c.pickupView&&l(a,{modal:this.modal,context:this.context,params:{checkstrictly:!0,...this.cloneParams},viewId:this.c.pickupView.id,style:{height:"".concat((null==(e=this.c.editorParams)?void 0:e.pickupViewHeight)||(null==(t=this.c.editorParams)?void 0:t.pickupviewheight)||500,"px"),width:this.pickViewWidth},state:{singleSelect:this.singleSelect,selectedData:this.selectedData},onSelectionChange:e=>this.onSelectionChange(e,this.singleSelect)})}}),t=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),a=n("div",{class:this.ns.b("form-default-content")},[this.valueText?this.singleSelect?n("span",{class:this.ns.b("content-item")},[this.valueText]):this.valueText.split(",").map(e=>n("span",{class:this.ns.b("content-item")},[e])):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&a,this.readonly?t:e])}}),FA="update:modelValue",UA="change",HA="leftCheckChange",qA="rightCheckChange",GA="leftAcSearch",WA=(e,t)=>[e,t].every(Wo)||Wo(e)&&Fo(t),YA={data:{type:Array,default:()=>[]},titles:{type:Array,default:()=>[]},buttonTexts:{type:Array,default:()=>[]},filterPlaceholder:String,filterMethod:{type:Function},rightSearchMethod:{type:Function},leftDefaultChecked:{type:Array,default:()=>[]},rightDefaultChecked:{type:Array,default:()=>[]},renderContent:{type:Function},modelValue:{type:Array,default:()=>[]},format:{type:Object,default:()=>({})},filterable:Boolean,props:{type:Object,default:()=>({label:"label",key:"key",disabled:"disabled"})},targetOrder:{type:String,values:["original","push","unshift"],default:"original"},enableRemoteSearch:{type:Boolean,default:!1},validateEvent:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},KA={[UA]:(e,t,a)=>[e,a].every(Wo)&&["left","right"].includes(t),[FA]:e=>Wo(e),[HA]:WA,[qA]:WA,[GA]:e=>e},XA=e=>{const t={label:"label",key:"key",disabled:"disabled"};return r(()=>({...t,...e.props}))},$A="checkedChange",JA="acSearch",QA={data:{type:Array,default:()=>[]},optionRender:{type:Function},placeholder:String,title:String,filterable:Boolean,enableAcSearch:Boolean,format:{type:Object,default:()=>({})},filterMethod:{type:Function},defaultChecked:{type:Array,default:()=>[]},props:{type:Object,default:()=>({label:"label",key:"key",disabled:"disabled"})},loading:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},ZA=e=>{const t={label:"label",key:"key",disabled:"disabled"};return r(()=>({...t,...e.props}))},eO=a({name:"IBizTransferPanel",props:QA,emits:{[$A]:(e,t)=>[e,t].every(Wo)||Wo(e)&&Fo(t),[JA]:e=>e},setup(e,{emit:t,slots:a}){const n=B("transfer-panel"),i=u({checked:[],allChecked:!1,query:"",checkChangeByUser:!0}),s=ZA(e),{filteredData:l,checkedSummary:d,isIndeterminate:h,onInputChange:p,handleAllCheckedChange:m}=((e,t,a)=>{const n=ZA(e),i=o([]),s=r(()=>i.value.filter(e=>!e[n.value.disabled])),l=r(()=>{const a=t.checked.length,n=e.data.length,{noChecked:i,hasChecked:o}=e.format;return i&&o?a>0?o.replace(/\${checked}/g,a.toString()).replace(/\${total}/g,n.toString()):i.replace(/\${total}/g,n.toString()):"".concat(a,"/").concat(n)}),d=r(()=>{const e=t.checked.length;return e>0&&e<s.value.length}),u=(t="")=>{i.value=e.data.filter(a=>Bo(e.filterMethod)?e.filterMethod(t,a):String(a[n.value.label]||a[n.value.key]).toLowerCase().includes(t.toLowerCase()))},h=()=>{const e=s.value.map(e=>e[n.value.key]);t.allChecked=e.length>0&&e.every(e=>t.checked.includes(e))};return c(()=>t.checked,(e,n)=>{if(h(),t.checkChangeByUser){const t=e.concat(n).filter(t=>!e.includes(t)||!n.includes(t));a($A,e,t)}else a($A,e),t.checkChangeByUser=!0}),c(s,()=>{h()}),c(()=>e.data,()=>{u(t.query);const e=[],a=i.value.map(e=>e[n.value.key]);t.checked.forEach(t=>{a.includes(t)&&e.push(t)}),t.checkChangeByUser=!1,t.checked=e}),c(()=>e.defaultChecked,a=>{const i=[],o=e.data.map(e=>e[n.value.key]);a.forEach(e=>{o.includes(e)&&i.push(e)}),t.checkChangeByUser=!1,t.checked=i},{immediate:!0}),{filteredData:i,checkableData:s,checkedSummary:l,isIndeterminate:d,onInputChange:async t=>{e.enableAcSearch?a("acSearch",t):u(t)},updateAllChecked:h,handleAllCheckedChange:e=>{t.checked=e?s.value.map(e=>e[n.value.key]):[]}}})(e,i,t),v=r(()=>!Oo(i.query)&&Oo(l.value)),g=r(()=>!(a.default&&Oo(a.default()[0].children))),{checked:b,allChecked:f,query:w}=O(i);return{ns:n,query:w,allChecked:f,checkedSummary:d,hasNoMatch:v,hasFooter:g,checked:b,filteredData:l,propsAlias:s,isIndeterminate:h,onInputChange:p,handleAllCheckedChange:m}},render(){var e,t;return n("div",{class:this.ns.b()},[n("p",{class:this.ns.e("header")},[n(i("el-checkbox"),{modelValue:this.allChecked,"onUpdate:modelValue":e=>this.allChecked=e,disabled:this.readonly,indeterminate:this.isIndeterminate,validateEvent:!1,onChange:this.handleAllCheckedChange},{default:()=>[this.title,n("span",null,[this.checkedSummary])]})]),n("div",{class:[this.ns.e("body"),this.ns.is("with-footer",this.hasFooter)]},[this.filterable?n(i("el-input"),{modelValue:this.query,"onUpdate:modelValue":e=>this.query=e,readonly:this.readonly,class:this.ns.e("filter"),size:"default",placeholder:this.placeholder,prefixIcon:()=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[n("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"},null)]),clearable:!0,validateEvent:!1,onInput:this.onInputChange},null):null,b(n("div",{class:[this.ns.e("content"),this.ns.is("filterable",this.filterable)]},[this.hasNoMatch||Oo(this.data)?n("div",{class:this.ns.e("empty")},[this.$slots.empty?null==(t=(e=this.$slots).empty)?void 0:t.call(e):n(i("iBizNoData"),{class:this.ns.em("empty","no-data")},null)]):n(i("el-checkbox-group"),{modelValue:this.checked,"onUpdate:modelValue":e=>this.checked=e,validateEvent:!1,disabled:this.readonly,class:[this.ns.e("list")]},{default:()=>this.filteredData.map(e=>n(i("el-checkbox"),{class:this.ns.e("item"),key:e[this.propsAlias.key],label:e[this.propsAlias.key],disabled:!!e[this.propsAlias.disabled],validateEvent:!1},{default:()=>{var t;return[null==(t=this.optionRender)?void 0:t.call(this,e)]}}))})]),[[C("loading"),this.enableAcSearch&&this.loading]])])])}}),tO=a({name:"IBizTransfer",props:YA,emits:KA,setup(e,{emit:t,slots:a}){const n=B("transfer"),i=u({leftChecked:[],rightChecked:[]}),s=XA(e),{sourceData:c,targetData:d}=(e=>{const t=XA(e),a=r(()=>e.data.reduce((e,a)=>(e[a[t.value.key]]=a)&&e,{})),n=r(()=>e.data.filter(a=>!e.modelValue.includes(a[t.value.key]))),i=r(()=>"original"===e.targetOrder?e.data.filter(a=>e.modelValue.includes(a[t.value.key])):e.modelValue.reduce((e,t)=>{const n=a.value[t];return n&&e.push(n),e},[]));return{sourceData:n,targetData:i}})(e),{onSourceCheckedChange:h,onTargetCheckedChange:p}=((e,t)=>({onSourceCheckedChange:(a,n)=>{e.leftChecked=a,n&&t(HA,a,n)},onTargetCheckedChange:(a,n)=>{e.rightChecked=a,n&&t(qA,a,n)}}))(i,t),{addToLeft:m,addToRight:v}=((e,t,a)=>{const n=XA(e),i=(e,t,n)=>{a(FA,e),a(UA,e,t,n)};return{addToLeft:()=>{const a=e.modelValue.slice();t.rightChecked.forEach(e=>{const t=a.indexOf(e);t>-1&&a.splice(t,1)}),i(a,"left",t.rightChecked)},addToRight:()=>{let a=e.modelValue.slice();const o=e.data.filter(a=>{const i=a[n.value.key];return t.leftChecked.includes(i)&&!e.modelValue.includes(i)}).map(e=>e[n.value.key]);a="unshift"===e.targetOrder?o.concat(a):a.concat(o),"original"===e.targetOrder&&(a=e.data.filter(e=>a.includes(e[n.value.key])).map(e=>e[n.value.key])),i(a,"right",t.leftChecked)}}})(e,i,t),g=o(),b=o(),f=r(()=>2===e.buttonTexts.length),w=r(()=>e.titles[0]||"可选列表"),y=r(()=>e.titles[1]||"已选列表"),C=r(()=>e.filterPlaceholder||"请输入");return{ns:n,targetData:d,rightPanelTitle:y,optionRender:r(()=>t=>{var n;if(e.renderContent)return e.renderContent(l,t);const i=((null==(n=a.default)?void 0:n.call(a,{option:t}))||[]).filter(e=>e.type!==Comment);return i.length?i:l("span",t[s.value.label]||t[s.value.key])}),panelFilterPlaceholder:C,leftPanelTitle:w,sourceData:c,leftPanel:g,rightPanel:b,hasButtonTexts:f,checkedState:i,addToLeft:m,addToRight:v,clearQuery:e=>{switch(e){case"left":g.value.query="";break;case"right":b.value.query=""}},onLeftAcSearch:e=>{t("leftAcSearch",e)},onSourceCheckedChange:h,onTargetCheckedChange:p}},render(){return n("div",{class:this.ns.b()},[n(eO,{ref:"leftPanel",data:this.sourceData,readonly:this.readonly,optionRender:this.optionRender,placeholder:this.panelFilterPlaceholder,title:this.leftPanelTitle,filterable:this.filterable,format:this.format,enableAcSearch:this.enableRemoteSearch,loading:this.loading,filterMethod:this.filterMethod,defaultChecked:this.leftDefaultChecked,onAcSearch:this.onLeftAcSearch,props:this.props,onCheckedChange:this.onSourceCheckedChange},null),n("div",{class:this.ns.e("buttons")},[n(i("el-button"),{class:[this.ns.e("button"),this.ns.is("with-texts",this.hasButtonTexts)],type:"primary",disabled:!!Oo(this.checkedState.rightChecked)||this.readonly,onClick:this.addToLeft},{default:()=>[n(i("el-icon"),null,{default:()=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[n("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"},null)])}),void 0!==this.buttonTexts[0]?n("span",null,[this.buttonTexts[0]]):null]}),n(i("el-button"),{class:[this.ns.e("button"),this.ns.is("with-texts",this.hasButtonTexts)],type:"primary",disabled:!!Oo(this.checkedState.leftChecked)||this.readonly,onClick:this.addToRight},{default:()=>[void 0!==this.buttonTexts[1]?n("span",null,[this.buttonTexts[1]]):null,n(i("el-icon"),null,{default:()=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[n("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null)])})]})]),n(eO,{ref:"rightPanel",data:this.targetData,readonly:this.readonly,optionRender:this.optionRender,placeholder:this.panelFilterPlaceholder,filterable:this.filterable,format:this.format,filterMethod:this.filterMethod,title:this.rightPanelTitle,defaultChecked:this.rightDefaultChecked,props:this.props,onCheckedChange:this.onTargetCheckedChange},null)])}}),aO=a({name:"IBizTransferPicker",props:it(),emits:Ve(),setup(e,{emit:t}){const a=B("picker"),n=B("transfer-picker"),i=e.controller,s=i.model,l=o([]),u=o([]),h=o([]),p=o(!1),m=o(),v=o([]),g=o([]),b=o([]),f=o([]),w=i.model.valueType,y=i.model.valueSeparator||",";let C=[ibiz.i18n.t("editor.transferPicker.optionalList"),ibiz.i18n.t("editor.transferPicker.selectedList")],I=[ibiz.i18n.t("app.delete"),ibiz.i18n.t("app.add")],x=!1;if(s.editorParams){const{editorParams:e}=s;if(e.titles)try{C=JSON.parse(e.titles)}catch(e){ibiz.log.info(e)}if(e.buttontexts)try{I=JSON.parse(e.buttontexts)}catch(e){ibiz.log.info(e)}e.remotesearch&&(x="true"===e.remotesearch)}c(()=>e.value,e=>{if(l.value=[],h.value=[],e){if("OBJECTS"===w)e.forEach(e=>{const t=Ko(e);Object.assign(t,{[i.keyName]:e[i.objectIdField],[i.textName]:e[i.objectNameField]}),i.objectValueField&&(Object.assign(t,{...e[i.objectValueField]}),delete t[i.objectValueField]),t[i.keyName]&&h.value.push(t)});else if(i.objectIdField&&y){e.split(y).forEach(e=>{h.value.push({[i.keyName]:e})})}else try{h.value=JSON.parse(e)}catch(t){ibiz.log.error("SIMPLE类型地址栏值格式".concat(e,"不符合JSON字符串要求"))}h.value.forEach(e=>{l.value.push(e[i.keyName]);const t=u.value.findIndex(t=>Object.is(t[i.keyName],e[i.keyName]));t<0&&u.value.push({[i.keyName]:e[i.keyName],[i.textName]:e[i.textName]})})}},{immediate:!0,deep:!0}),c(m,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const S=async(...t)=>{f.value=u.value.filter(e=>!!h.value.find(t=>t[i.keyName]===e[i.keyName]));const a=t[0]||"";p.value=!0;const n=await(async t=>{let a=[];if(i.model.appDataEntityId)try{const n=t.trim(),o=await i.getServiceData(n,e.data);o&&(a=o.data)}catch(e){ibiz.log.error(e)}return a})(a);n&&(u.value=[...f.value,...n.filter(e=>!f.value.find(t=>t[i.keyName]===e[i.keyName]))]),b.value=[...b.value],g.value=[...g.value],p.value=!1},E=ia(S,1e3),D=r(()=>h.value.map(e=>e[i.textName]).join(","));c(D,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),d(()=>{i.objectNameField&&(u.value=[],S(""))});return{c:i,ns:a,ns2:n,items:u,loading:p,curValue:l,valueText:D,editorRef:m,curIndexs:v,leftChecked:g,rightChecked:b,titles:C,buttonTexts:I,enableRemoteSearch:x,onSearch:S,filterMethod:(e,t)=>{const a=t[i.textName];return!e||(null==a?void 0:a.toLowerCase().includes(null==e?void 0:e.toLowerCase()))},onRightChange:e=>{(e=>{const a=[];e&&Array.isArray(e)&&e.forEach(e=>{Object.assign(e,{[i.keyName]:e[i.keyName]?e[i.keyName]:e.srfkey,[i.textName]:e[i.textName]?e[i.textName]:e.srfmajortext}),"OBJECTS"===w?a.push(i.handleObjectParams(e)):i.objectIdField?a.push(e[i.keyName]):a.push({[i.keyName]:e[i.keyName],[i.textName]:e[i.textName]}),u.value.findIndex(t=>Object.is(t[i.keyName],e[i.keyName]))<0&&u.value.push(e)});let n=null;a.length>0&&(n="OBJECTS"===w?a:i.objectIdField?a.join(y):JSON.stringify(a)),t("change",n)})(e.map(e=>u.value.find(t=>t[i.keyName]===e)||{}))},onLeftCheckChange:e=>{g.value=e},onRightCheckChange:e=>{b.value=e},renderContentItem:(e,t)=>e("span",{title:t[i.textName]},t[i.textName]),onLeftAcSearch:e=>{E(e)}}},render(){const e=n("div",{class:[this.ns.e("autocomplete")]},[n(tO,y({ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,data:this.items,readonly:this.readonly||this.disabled,"left-default-checked":this.leftChecked,"right-default-checked":this.rightChecked,props:{key:this.c.keyName,label:this.c.textName},filterable:!0,"filter-placeholder":this.c.placeHolder,enableRemoteSearch:this.enableRemoteSearch,titles:this.titles,"button-texts":this.buttonTexts,format:{noChecked:"${total}",hasChecked:"${checked}/${total}"},"target-order":this.enableRemoteSearch?"push":"original",loading:this.loading,filterMethod:this.filterMethod,renderContent:this.renderContentItem,onChange:this.onRightChange,onLeftCheckChange:this.onLeftCheckChange,onRightCheckChange:this.onRightCheckChange,onLeftAcSearch:this.onLeftAcSearch},this.$attrs),null)]);return n("div",{class:[this.ns.b(),this.ns2.b(),this.disabled?this.ns.m("disabled"):""]},[e])}});var nO=Object.defineProperty,iO=(e,t,a)=>(((e,t,a)=>{t in e?nO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class oO extends qi{constructor(){super(...arguments),iO(this,"multiple",!1),iO(this,"pickupView",null),iO(this,"linkView",null),iO(this,"valueItem",""),iO(this,"keyName","srfkey"),iO(this,"textName","srfmajortext"),iO(this,"interfaceName",""),iO(this,"sort",""),iO(this,"noAC",!1),iO(this,"noButton",!1),iO(this,"deACMode"),iO(this,"dataItems",[]),iO(this,"objectIdField",""),iO(this,"objectNameField",""),iO(this,"objectValueField",""),iO(this,"acItemProvider"),iO(this,"groupActionState",new Ri),iO(this,"actionDetails",[]),iO(this,"curPage",1),iO(this,"total",0),iO(this,"totalPages"),iO(this,"pagingSize"),iO(this,"pagingMode")}get isLazyLoad(){return No(this.pagingMode)&&0!==this.pagingMode}get isShowLoadMore(){return!!(this.isLazyLoad&&3===this.pagingMode&&this.totalPages&&this.curPage<this.totalPages)}async onInit(){var e,t,a,n;if(super.onInit(),this.initParams(),this.valueItem=(null==(e=this.model.valueItemName)?void 0:e.toLowerCase())||"",this.model.appDataEntityId&&(this.model.appDEDataSetId&&(this.interfaceName=this.model.appDEDataSetId),this.model.appDEACModeId&&(this.deACMode=await ga(this.model.appDEACModeId,this.model.appDataEntityId,this.context.srfappid),this.deACMode))){const{minorSortAppDEFieldId:e,minorSortDir:t,pagingMode:a,pagingSize:n}=this.deACMode;this.pagingMode=a,this.pagingSize=n,e&&t&&(this.sort="".concat(e.toLowerCase(),",").concat(t.toLowerCase())),this.deACMode.textAppDEFieldId&&(this.textName=this.deACMode.textAppDEFieldId),this.deACMode.valueAppDEFieldId&&(this.keyName=this.deACMode.valueAppDEFieldId),this.deACMode.deacmodeDataItems&&(this.dataItems=[],this.deACMode.deacmodeDataItems.forEach(e=>{"value"!==e.id&&"text"!==e.id&&this.dataItems.push(e)})),this.deACMode.itemSysPFPluginId&&(this.acItemProvider=await Vi(this.deACMode))}this.model.editorType&&["PICKEREX_DROPDOWNVIEW","PICKEREX_DROPDOWNVIEW_LINK","PICKUPVIEW","MOBPICKER_DROPDOWNVIEW"].includes(this.model.editorType)&&this.initPickupViewParams(),this.objectIdField=null==(t=this.model.objectIdField)?void 0:t.toLowerCase(),this.objectNameField=null==(a=this.model.objectNameField)?void 0:a.toLowerCase(),this.objectValueField=null==(n=this.model.objectValueField)?void 0:n.toLowerCase(),this.model.uiactionGroup&&(this.actionDetails=this.model.uiactionGroup.uiactionGroupDetails||[],this.actionDetails.length>0&&(this.actionDetails.forEach(e=>{const t=e.uiactionId;if(t){const a=new Di(e.id,this.context.srfappid,t);this.groupActionState.addState(e.id,a)}}),await this.groupActionState.init(),this.actionDetails.forEach(e=>{e.capLanguageRes&&e.capLanguageRes.lanResTag&&(e.caption=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption)),e.tooltipLanguageRes&&e.tooltipLanguageRes.lanResTag&&(e.tooltip=ibiz.i18n.t(e.tooltipLanguageRes.lanResTag,e.tooltip))})))}initParams(){switch(this.model.editorType){case"PICKEREX_NOAC":case"PICKEREX_NOAC_LINK":this.noAC=!0;break;case"PICKEREX_NOBUTTON":this.noButton=!0;break;default:this.noButton=!1,this.noAC=!1}}async initPickupViewParams(){this.model.pickupAppViewId&&(this.pickupView=await ibiz.hub.config.view.get(this.model.pickupAppViewId))}async initLinkViewParams(){this.model.linkAppViewId&&(this.linkView=await ibiz.hub.config.view.get(this.model.linkAppViewId))}async getServiceData(e,t,a){const{context:n,params:i}=this.handlePublicParams(t,this.context,this.params),o={};if(ibiz.config.pickerdefaultsort&&Object.assign(o,{sort:ibiz.config.pickerdefaultsort}),this.sort&&!Object.is(this.sort,"")&&Object.assign(o,{sort:this.sort}),e&&Object.assign(o,{query:e}),Object.assign(o,{size:1e3}),this.isLazyLoad){!0===(null==a?void 0:a.isLoadMore)?this.curPage+=1:this.curPage=1}this.isLazyLoad&&this.pagingSize&&Object.assign(o,{size:this.pagingSize,page:this.curPage-1});const s=Ao(i,o);if(this.interfaceName){const e=ibiz.hub.getApp(this.context.srfappid),t=await e.deService.exec(this.model.appDataEntityId,this.interfaceName,n,s);return t.headers&&(t.headers["x-total"]&&(this.total=Number(t.headers["x-total"])),t.headers["x-total-pages"]&&(this.totalPages=Number(t.headers["x-total-pages"]))),t}throw new Xt(this.model,ibiz.i18n.t("editor.common.entityConfigErr"))}async openPickUpView(e,t){await this.initPickupViewParams();const{context:a,params:n}=this.handlePublicParams(e,this.context,this.params);if(t&&(n.selecteddata=t),!this.pickupView)throw new Xt(this.model,ibiz.i18n.t("editor.common.selectViewConfigErr"));const i=await ibiz.commands.execute(Ai.TAG,this.pickupView.id,a,{checkstrictly:!0,...n},{openMode:"POPUPMODAL"});if(i&&i.ok&&i.data)return i.data;ibiz.log.debug("模态取消或关闭异常",i)}async openLinkView(e){const t=this.context.clone();e[this.valueItem]&&(t.srfkey=e[this.valueItem]);const{context:a,params:n}=this.handlePublicParams(e,t,this.params),{linkAppViewId:i}=this.model;if(!i)throw new Xt(this.model,ibiz.i18n.t("editor.common.linkViewConfigErr"));return ibiz.commands.execute(Ai.TAG,i,a,n)}async calcFillDataItems(e){if(this.deACMode){if(0===this.dataItems.length)return[];return await Promise.all(this.dataItems.map(t=>{const a=e[t.appDEFieldId];return t.format||t.convertToCodeItemText&&t.codeListId||t.customCode,{id:t.id,value:a}}))}return[]}handleObjectParams(e){const t={};if(this.objectIdField&&Object.assign(t,{[this.objectIdField]:e[this.keyName]}),this.objectNameField&&Object.assign(t,{[this.objectNameField]:e[this.textName]}),this.objectValueField){const a={...e};delete a.srfkey,delete a.srfmajortext,Object.assign(t,{[this.objectValueField]:a})}return e.srfnodeid&&Object.assign(t,{srfnodeid:e.srfnodeid}),t}async onActionClick(e,t,a){const n=e.uiactionId;await fa.execAndResolved(n,{context:this.context,params:this.params,data:[t],view:this.view,event:a},e.appId)}}var sO=Object.defineProperty,lO=(e,t,a)=>(((e,t,a)=>{t in e?sO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class rO{constructor(e){lO(this,"formEditor"),lO(this,"gridEditor");let t="IBizPicker";switch(e){case"PICKEREX_TRIGGER":t="IBizPickerDropDown";break;case"PICKEREX_LINKONLY":t="IBizPickerLink";break;case"ADDRESSPICKUP":case"ADDRESSPICKUP_AC":case"MOBMPICKER":t="IBizMPicker";break;case"PICKEREX_DROPDOWNVIEW":case"PICKEREX_DROPDOWNVIEW_LINK":case"MOBPICKER_DROPDOWNVIEW":t="IBizPickerSelectView";break;case"PICKUPVIEW":t="IBizPickerEmbedView";break;case"TRANSFER_PICKER":t="IBizTransferPicker"}this.formEditor=t,this.gridEditor=t}async createController(e,t){const a=new oO(e,t);return await a.init(),a}}const cO=a({name:"IBizNumberRangePicker",props:st(),emits:Ve(),setup(e,{emit:t}){const a=B("number-range-picker"),n=e.controller,i=n.model,{useInFocusAndBlur:s,useInValueChange:l}=We(e,t);let d=1/0,u=-1/0,h=0,p="-";const m=i.placeHolder&&i.placeHolder.split(";")[0]||"",v=i.placeHolder&&i.placeHolder.split(";")[1]||"";let g="~";i.editorParams&&(i.editorParams.maxvalue&&(d=Yo(i.editorParams.maxvalue)),i.editorParams.minvalue&&(u=Yo(i.editorParams.minvalue)),i.editorParams.precision&&(h=Yo(i.editorParams.precision)),i.editorParams.valueSeparator&&(p=i.editorParams.valueSeparator),i.editorParams.valueseparator&&(p=i.editorParams.valueseparator),i.editorParams.rangeSeparator&&(g=i.editorParams.rangeSeparator),i.editorParams.rangeseparator&&(g=i.editorParams.rangeseparator));const b=o([]),f=i.editorItems;if(f&&f.length>0){const e=f.map(e=>e.id);b.value=e}const w=o(null),y=o(null),C=o(!1),I=o(),x=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{e!==t&&"string"==typeof e&&(w.value=e.split(p)[0]?Number(e.split(p)[0]):null,y.value=e.split(p)[1]?Number(e.split(p)[1]):null)},{immediate:!0});const S=e=>{e?C.value=e:setTimeout(()=>{C.value=e},100)},E=(e,a,i)=>{e===n.triggerMode&&t("change",a,i)},{componentRef:D}=je(()=>t("focus"),()=>s()),P=r(()=>"number"==typeof w.value&&"number"==typeof y.value?"".concat(w.value).concat(g).concat(y.value):null);return{ns:a,c:n,refFormItem:b,minValue:w,maxValue:y,handleChange:(e,t,a="blur")=>{if(0===t?w.value=e:1===t&&(y.value=e),null!==w.value&&null!==y.value&&(E(a,[w.value,y.value].join(p)),S(!1),l()),b.value){const n=b.value[t];E(a,e,n),l()}},max:d,min:u,precision:h,valueSeparator:p,startPlaceHolder:m,endPlaceHolder:v,rangeSeparator:g,componentRef:D,editorRef:I,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},onFocus:e=>{t("focus",e),S(!0)},onBlur:e=>{null!==w.value&&null!==y.value&&(t("blur",e),S(!1))},valueText:P,isEditable:C,setEditable:S,showFormDefaultContent:x}},render(){const e=n("div",{class:this.ns.b("input")},[n(i("el-input-number"),y({ref:"editorRef",min:this.min,modelValue:this.minValue,disabled:this.disabled,readonly:this.readonly,precision:this.controller.model.precision,placeholder:this.startPlaceHolder,controls:!1,onChange:e=>this.handleChange(e,0),onInput:e=>this.handleChange(e,0,"input"),onKeyup:this.handleKeyUp,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null),n("div",{class:this.ns.b("separator")},[this.rangeSeparator]),n(i("el-input-number"),y({min:"number"==typeof this.minValue?this.minValue+1:-1/0,max:this.max,modelValue:this.maxValue,disabled:this.disabled,readonly:this.readonly,precision:this.controller.model.precision,placeholder:this.endPlaceHolder,controls:!1,onChange:e=>this.handleChange(e,1),onInput:e=>this.handleChange(e,1,"input"),onKeyup:this.handleKeyUp,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null)]),t=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),a=n("div",{class:this.ns.b("form-default-content")},[this.valueText?[n("div",{class:this.ns.b("default-min")},[this.minValue]),n("div",{class:this.ns.b("default-separator")},[this.rangeSeparator]),n("div",{class:this.ns.b("default-max")},[this.maxValue])]:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],ref:"componentRef"},[this.showFormDefaultContent&&a,this.readonly?t:e])}});class dO extends qi{}var uO=Object.defineProperty,hO=(e,t,a)=>(((e,t,a)=>{t in e?uO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class pO{constructor(){hO(this,"formEditor","IBizNumberRangePicker"),hO(this,"gridEditor","IBizNumberRangePicker")}async createController(e,t){const a=new dO(e,t);return await a.init(),a}}const mO=a({name:"IBizDateRangePicker",props:lt(),emits:Ve(),setup(e,{emit:t}){const a=B("date-range-picker"),n=e.controller,i=n.model;let s=",",l=!1;const d=i.placeHolder&&i.placeHolder.split(";")[0]||"",u=i.placeHolder&&i.placeHolder.split(";")[1]||"";let h=ibiz.i18n.t("editor.dateRange.rangeSeparator");i.editorParams&&(i.editorParams.valueSeparator&&(s=i.editorParams.valueSeparator),i.editorParams.valueseparator&&(s=i.editorParams.valueseparator),i.editorParams.rangeSeparator&&(h=i.editorParams.rangeSeparator),i.editorParams.rangeseparator&&(h=i.editorParams.rangeseparator),i.editorParams.unlinkPanels&&(l=n.toBoolean(i.editorParams.unlinkPanels)),i.editorParams.unlinkpanels&&(l=n.toBoolean(i.editorParams.unlinkpanels)));const p=o("daterange");switch(i.editorType){case"DATERANGE":case"MOBDATERANGE":default:p.value="datetimerange";break;case"DATERANGE_NOTIME":case"MOBDATERANGE_NOTIME":p.value="daterange"}const m=o("YYYY-MM-DD"),v=n.valueFormat;v&&(m.value=v);const g=o([]),b=i.editorItems;if(b&&b.length>0){const e=b.map(e=>e.id);g.value=e}const f=o(!1),w=o(),y=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),C=e=>{e?f.value=e:setTimeout(()=>{f.value=e},100)},I=r({get(){let t=[];if(g.value.length>0)g.value.forEach(a=>{e.data[a]&&t.push(e.data[a])});else if(e.value&&"string"==typeof e.value){const a=e.value.split(s);t=a.every(e=>as(e).isValid())?a:[]}return t},set(e){e&&e.length>0?(t("change",e.join(s)),g.value.length>0&&e.forEach((e,a)=>{t("change",e,g.value[a])})):(t("change",null),g.value.length>0&&g.value.forEach((e,a)=>{t("change",null,g.value[a])})),C(!1)}});c(w,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const x=r(()=>I.value.length>0?"".concat(I.value[0]," ").concat(h," ").concat(I.value[1]):null);return{ns:a,c:n,refFormItem:g,curValue:I,type:p,format:m,valueSeparator:s,startPlaceHolder:d,endPlaceHolder:u,rangeSeparator:h,unlinkPanels:l,onFocus:e=>{t("focus",e),C(!0)},onBlur:e=>{t("blur",e),C(!1)},editorRef:w,valueText:x,isEditable:f,setEditable:C,showFormDefaultContent:y,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},onCalendarChange:e=>{n.dateRange=ko(e)}}},render(){const e=n(i("el-date-picker"),y({ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,class:this.ns.b("input"),type:this.type,"popper-class":this.ns.b("popper"),format:this.format,"value-format":this.format,disabled:this.disabled,readonly:this.readonly,"range-separator":this.rangeSeparator,"start-placeholder":this.startPlaceHolder,"end-placeholder":this.endPlaceHolder,"unlink-panels":this.unlinkPanels,onFocus:this.onFocus,onBlur:this.onBlur,onCalendarChange:this.onCalendarChange},this.$attrs),null),t=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),a=n("div",{class:[this.ns.b("form-default-content"),this.ns.is("has-val",this.curValue.length>0)]},[this.curValue.length>0?n(i("el-date-picker"),y({"model-value":this.curValue,class:this.ns.b("default-input"),type:this.type,format:this.format,"value-format":this.format,readonly:!0,"range-separator":this.rangeSeparator,"start-placeholder":this.startPlaceHolder,"end-placeholder":this.endPlaceHolder,"unlink-panels":this.unlinkPanels},this.$attrs),null):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],onKeyup:this.handleKeyUp},[this.showFormDefaultContent&&a,this.readonly?t:e])}});var vO=Object.defineProperty,gO=(e,t,a)=>(((e,t,a)=>{t in e?vO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class bO extends qi{constructor(){super(...arguments),gO(this,"dateRange",[])}getFormatByType(){switch(this.model.editorType){case"DATERANGE":case"MOBDATERANGE":default:return"YYYY-MM-DD HH:mm:ss";case"DATERANGE_NOTIME":case"MOBDATERANGE_NOTIME":return"YYYY-MM-DD"}}get valueFormat(){return this.model.dateTimeFormat?this.model.dateTimeFormat:super.valueFormat?super.valueFormat:this.getFormatByType()}}var fO=Object.defineProperty,wO=(e,t,a)=>(((e,t,a)=>{t in e?fO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class yO{constructor(){wO(this,"formEditor","IBizDateRangePicker"),wO(this,"gridEditor","IBizDateRangePicker")}async createController(e,t){const a=new bO(e,t);return await a.init(),a}}const CO=a({name:"IBizCode",props:rt(),emits:Ve(),setup(e,{emit:t}){const a=o(),i=B("code"),s=e.controller,l=go(),r=o(""),{UIStore:u,zIndex:p}=G(),m=o(!0),v=o(!1),b=o(!1),f=o(!1),w=o(!1),y=o(!1),C=o(),I=o({[i.cssVarBlockName("text-editor-toolbar-z-index")]:p.increment()}),x=o(!1),S=o(""),E=s.model;let D,P,k,z,T,A;E.editorParams&&(E.editorParams.enableEdit&&(v.value=!0,b.value=!0,m.value=s.toBoolean(E.editorParams.enableEdit)&&!e.readonly&&!e.disabled),E.editorParams.enableedit&&(v.value=!0,b.value=!0,m.value=s.toBoolean(E.editorParams.enableedit)&&!e.readonly&&!e.disabled),E.editorParams.enableFullScreen&&(f.value=s.toBoolean(E.editorParams.enableFullScreen)),E.editorParams.enablefullscreen&&(f.value=s.toBoolean(E.editorParams.enablefullscreen)));const O=e=>{var t,a;S.value=(null==(t=null==s?void 0:s.editorParams)?void 0:t.customTheme)||ibiz.config.codeEditorTheme||e;const n=null==(a=null==s?void 0:s.editorParams)?void 0:a.customTheme;return n?"dark"===n?"vs-dark":"vs":ibiz.config.codeEditorTheme?"dark"===ibiz.config.codeEditorTheme?"vs-dark":"vs":"dark"===e?"vs-".concat(u.theme):"vs"};c(()=>u.theme,e=>{P.setTheme(O(e))}),c(()=>e.value,e=>{e!==r.value&&(r.value=e||"",null==D||D.setValue(r.value))},{immediate:!0});const M=()=>{D&&((e.readonly||e.disabled)&&(v.value=!1,b.value=!0),D.updateOptions({readOnly:v.value?b.value:e.readonly||e.disabled}))};c(()=>e.readonly,M,{immediate:!0}),c(()=>e.disabled,M,{immediate:!0});const N=()=>{null==D||D.dispose(),D=null,null==T||T.clear(),T=null,null==k||k.dispose(),k=null,null==z||z.dispose(),z=null,null==A||A.close()},L=()=>{if(e.readonly||!m.value||!s.deACMode||!s.chatCompletion)return;const t=null==D?void 0:D.getSelection();x.value=!(!t||t.isEmpty())},R=e=>{const t=e.selection;t&&((e=>{var t;const a=e.getStartPosition();if(a){const e=null==D?void 0:D.getScrolledVisiblePosition(a),n=null==(t=null==D?void 0:D.getDomNode())?void 0:t.getBoundingClientRect();if(!n||!e)return;I.value={...I.value,[i.cssVarBlockName("text-editor-toolbar-left")]:"".concat(n.left+e.left,"px"),[i.cssVarBlockName("text-editor-toolbar-top")]:"".concat(n.top+e.top+e.height,"px")}}})(t),s.currentSelection=t)},_=e=>{var t,a;const n=null==(t=null==D?void 0:D.getSelection())?void 0:t.getStartPosition();if(!n)return;const i=null==D?void 0:D.getScrolledVisiblePosition(n),o=null==(a=null==D?void 0:D.getDomNode())?void 0:a.getBoundingClientRect(),l=C.value.offsetHeight;if(!i||!o||!l)return;const r=ibiz.inLineAIUtil.calcContextMenus(s.deACMode,e=>{s.doInLineAIUIAction(e,s.model.appId)});0!==r.length&&ibiz.inLineAIUtil.showContextMenus(o.left+i.left,o.top+i.top+i.height+l,r,{zIndex:p.increment(),onClose:()=>{p.decrement()}})},j=e=>{var t;(null==(t=C.value)?void 0:t.contains(e.target))||setTimeout(L,100)},V=e=>{var t;x.value&&!(null==(t=C.value)?void 0:t.contains(e.target))&&(x.value=!1)},F=()=>{g(()=>{y.value=!0,Hd.config({paths:{vs:"".concat(ibiz.env.pluginBaseUrl,"/monaco-editor@0.52.2/min/vs")}}),Hd.init().then(n=>{var o;y.value=!1,D||(P=n.editor,D=P.create(a.value,{language:e.language||e.controller.language,theme:O(u.theme),foldingStrategy:"indentation",renderLineHighlight:"all",selectOnLineNumbers:!0,minimap:{enabled:!0},readOnly:v.value?b.value:e.readonly||e.disabled,readOnlyMessage:{value:ibiz.i18n.t("editor.code.readOnlyPrompt")},fontSize:16,fixedOverflowWidgets:!0,scrollBeyondLastLine:!1,overviewRulerBorder:!1}),D.__instanceId=l,s.chatCompletion&&ibiz.env.enableAI&&(k=n.languages.registerCodeLensProvider(e.language||e.controller.language,{provideCodeLenses:function(a,i){return(e=>{const t=P.getEditors().find(t=>t.getModel()===e);return!(!t||t.__instanceId!==l)})(a)?{lenses:[{id:"AI",range:new n.Range(1,1,1,1),command:{title:"".concat(s.deACMode.logicName),id:D.addCommand(0,()=>(async()=>{if(!s.deACMode||!s.model.appDataEntityId)return;A=await ibiz.aiChatUtil.getAIChat();const{containerOptions:a,chatOptions:n}=await ibiz.aiChatUtil.getEditorExAIChatParams(s.editorParams,s.context,s.params,e.data,s.deACMode,{chatInstance:A,view:s.view,ctrl:s.ctrl}),i=await ibiz.aiChatUtil.getAIResourceOptions(s.context,s.params);A.create({resourceOptions:i,containerOptions:{zIndex:p.increment(),...a},chatOptions:{caption:s.deACMode.logicName,context:{...s.context},params:{...s.params,srfactag:s.deACMode.codeName},appDataEntityId:s.model.appDataEntityId,...n,action:(e,a)=>{"backfill"===e&&t("change",a.realcontent)}}})})())}}],dispose:()=>{}}:{lenses:[],dispose:()=>{}}},resolveCodeLens:(e,t,a)=>t}))),s.onCreated(D,n),setTimeout(()=>{D.layout(),D.setValue(r.value)});const c=()=>{T&&T.clear(),s.placeHolder&&!(null==D?void 0:D.getValue())&&(T=D.createDecorationsCollection([{range:new n.Range(1,1,1,1),options:{isWholeLine:!0,beforeContentClassName:"".concat(i.e("first-prompt")," ghost-text-decoration")}}]))},d=D.setValue.bind(D);D.setValue=e=>{d(e),c()},D.onDidFocusEditorText(()=>{null==T||T.clear()}),D.onDidBlurEditorText(()=>{c()}),D.onDidChangeModelContent(()=>{L(),v.value||(r.value=D.getValue(),t("change",r.value))}),D.onDidChangeCursorSelection(R),null==(o=D.getDomNode())||o.addEventListener("click",j),window.addEventListener("resize",()=>{D.layout()})}).catch(()=>{y.value=!1})})},U=()=>{b.value=!b.value,D&&(b.value?D.updateOptions({readOnly:!0}):D.updateOptions({readOnly:!1}))},H=async()=>{r.value=String(null==D?void 0:D.getValue()),N(),w.value=!w.value,F()};return d(()=>{F(),window.addEventListener("mousedown",V.bind(this))}),h(()=>{N(),window.removeEventListener("mousedown",V.bind(this))}),{ns:i,currentVal:r,codeEditBox:a,isFullScreen:w,hasEnableEdit:v,readonlyState:b,isLoading:y,textTBRef:C,editorTheme:S,renderFooter:()=>v.value?n("div",{class:[i.b("footer"),{[i.b("footer-dialog")]:w.value}]},[n("div",{class:i.be("footer","cancel"),onClick:()=>{e.value!==(null==D?void 0:D.getValue())?Co({title:ibiz.i18n.t("editor.common.confirmCancel"),type:"warning",customClass:i.b("message"),message:n("div",{class:i.be("message","message-content")},[n("p",null,[ibiz.i18n.t("editor.common.confirmCancelPrompt")]),n("p",{class:i.bem("message","message-content","message-tip")},[ibiz.i18n.t("editor.common.cancelEditPrompt")])]),showCancelButton:!0,cancelButtonClass:i.be("message","message-cancel"),confirmButtonClass:i.be("message","message-comfire")}).then(()=>{null==D||D.setValue(String(e.value||"")),U()}).catch(()=>{null==D||D.focus()}):U()}},[ibiz.i18n.t("app.cancel")]),n("div",{class:i.be("footer","save"),onClick:()=>(U(),D&&(r.value=D.getValue(),t("change",r.value)),void(w.value&&H()))},[ibiz.i18n.t("app.save")])]):null,renderHeaderToolbar:()=>v.value||f.value?n("div",{class:i.b("toolbar")},[v.value&&m.value&&b.value?n("i",{class:"fa fa-edit","aria-hidden":"true",onClick:()=>U()},null):null,f.value?n("span",{class:i.be("toolbar","fullscreen"),title:ibiz.i18n.t("editor.common.".concat(w.value?"minimize":"fullscreen")),onClick:()=>H()},[w.value?n("i",{class:"ch-icon ch-icon-minscreen"},null):n("i",{class:"ch-icon ch-icon-fullscreen"},null)]):null]):null,renderTextEditorToolbar:()=>x.value&&s.chatCompletion?n("div",{ref:"textTBRef",class:[i.b("text-editor-toolbar")],style:{...I.value}},[n("div",{class:[i.be("text-editor-toolbar","item")],title:"AI",onClick:_},[n("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor"},[n("path",{d:"M274.344554 173.673875c16.429399 0 30.950568 8.00526 39.956484 20.338945a34.906655 34.906655 0 0 1 14.660796 15.754537l1.117013 2.815803 210.138065 597.927736c6.795162 19.268474-5.329083 40.817516-27.041022 48.147913-20.641469 6.95806-42.493035-1.419537-50.451753-18.803052l-1.117013-2.815803-54.477653-154.939008H134.997185L80.566074 837.039954c-6.771891 19.268474-29.856826 28.949253-51.568765 21.618855-20.641469-6.981331-32.602816-26.761769-27.925325-45.239025l0.861031-2.908888L212.047809 212.58316c4.025901-11.426112 13.799764-19.477914 25.598214-22.619512 9.029188-10.006575 22.107548-16.289773 36.67526-16.289773z m386.416675 169.460176c21.828295 0 39.723774 10.890876 41.469106 24.713912l0.116356 2.210755v461.652153c0 14.893506-18.616883 26.947938-41.585462 26.947938-21.805024 0-39.700503-10.890876-41.422565-24.737183l-0.162897-2.210755V370.081989c0-14.870235 18.616883-26.924667 41.585462-26.924667z m-389.697901-48.171184L163.620643 600.628812h214.88537l-107.442685-305.665945z m602.163076-206.181978a12.566396 12.566396 0 0 1 8.144887 8.051802l32.509731 99.041817 101.694723 36.07021a12.566396 12.566396 0 0 1-0.791218 23.922695l-99.53051 27.995137-30.857483 97.552467a12.566396 12.566396 0 0 1-23.899423 0.116355l-32.509732-99.018546-98.669479-31.322905a12.566396 12.566396 0 0 1-0.186169-23.876152l97.505924-32.812256 30.834212-97.529195a12.566396 12.566396 0 0 1 15.754537-8.191429zM649.544557 0.513593c2.676177 0.884302 4.770576 3.025243 5.608336 5.724692l18.523798 59.294772 60.970292 20.66474a8.796477 8.796477 0 0 1-0.325796 16.755194l-60.73758 18.058377-19.780438 59.550754a8.796477 8.796477 0 0 1-16.731924-0.162898l-18.523798-59.271501-59.062061-17.825665a8.796477 8.796477 0 0 1-0.395609-16.708653l59.574025-20.943993 19.780438-59.574025a8.796477 8.796477 0 0 1 11.100317-5.561794z"},null)])])]):null,renderCodeContent:()=>n("div",{ref:a,class:i.e("box"),style:{[i.cssVarBlockName("placeholder")]:'"'.concat(s.placeHolder,'"')}},null),changeFullScreenState:H}},render(){var e,t;const a=!(null==(t=null==(e=this.controller.view)?void 0:e.state)?void 0:t.isLoading)&&this.isLoading;return this.isFullScreen?n(i("el-dialog"),{modelValue:this.isFullScreen,"onUpdate:modelValue":e=>this.isFullScreen=e,class:this.ns.b("dialog-full-screen"),onClose:()=>this.changeFullScreenState()},{default:()=>[b(n("div",{class:[this.ns.b(),this.ns.is(this.editorTheme,!!this.editorTheme),{[this.ns.b("editor-readonly")]:this.readonlyState},{[this.ns.b("editor-enable")]:!this.readonlyState}]},[this.renderTextEditorToolbar(),this.renderHeaderToolbar(),this.renderCodeContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null]),[[C("loading"),a]])]}):b(n("div",{class:[this.ns.b(),this.ns.is(this.editorTheme,!!this.editorTheme),{[this.ns.b("editor-readonly")]:this.readonlyState},{[this.ns.b("editor-enable")]:!this.readonlyState},this.ns.is("enable",this.hasEnableEdit)]},[this.renderTextEditorToolbar(),this.renderHeaderToolbar(),this.renderCodeContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null]),[[C("loading"),a]])}});var IO=Object.defineProperty,xO=(e,t,a)=>(((e,t,a)=>{t in e?IO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class SO extends qi{constructor(){super(...arguments),xO(this,"deACMode"),xO(this,"editor"),xO(this,"monaco"),xO(this,"currentSelection"),xO(this,"chatCompletion",!1),xO(this,"inlineAiChatHeight")}get language(){return this.editorParams.codeType||this.editorParams.language||"typescript"}get theme(){return this.editorParams.theme||"vs-dark"}async onInit(){if(await super.onInit(),this.editorParams){const{inlineaichatheight:e}=this.editorParams;e&&(this.inlineAiChatHeight=Number(e))}const{appDEACModeId:e,appDataEntityId:t}=this.model;e&&(this.deACMode=await ga(e,t,this.context.srfappid)),this.deACMode&&"CHATCOMPLETION"===this.deACMode.actype&&(this.chatCompletion=!0)}onCreated(e,t){this.editor=e,this.monaco=t}getSelectionText(){var e,t,a;const n=null==(e=this.editor)?void 0:e.getSelection();let i;return n&&(i=null==(a=null==(t=this.editor)?void 0:t.getModel())?void 0:a.getValueInRange(n)),i||""}insertText(e){var t,a,n,i;if(!this.editor||!this.monaco)throw new Vt(ibiz.i18n.t("editor.code.editorNotInit"));const o=this.editor.getSelections();if(!o||0===o.length)return;const s=o[o.length-1],l=s.positionLineNumber,r=s.positionColumn,c="\n".concat(e,"\n");null==(t=this.editor)||t.executeEdits("",[{range:new this.monaco.Range(l,r,l,r),text:c}]);const d=c.split("\n"),u=l+(d.length-1)-1,h=(d[d.length-2]||"").length+1,p=new this.monaco.Position(u,h);null==(a=this.editor)||a.setPosition(p),null==(n=this.editor)||n.revealPositionInCenter(p),null==(i=this.editor)||i.focus()}replaceSelectionText(e){var t;const a=null==(t=this.editor)?void 0:t.getSelection();if(!a||a.isEmpty()||!this.monaco||!this.editor)return;const n=a.getStartPosition();this.editor.executeEdits("",[{range:a,text:e}]);const i=e.split("\n"),o=i.length,s=i[o-1].length;let l,r;1===o?(l=n.lineNumber,r=n.column+s):(l=n.lineNumber+(o-1),r=1+s);const c=new this.monaco.Range(l,r,l,r);this.editor.createDecorationsCollection().clear(),this.editor.setSelection(c),this.editor.focus()}restoreSelection(){var e;null==(e=this.editor)||e.focus()}getInLineAiEditorElement(){if(!this.editor)throw new Vt(ibiz.i18n.t("editor.code.editorNotInit"));return this.editor.getDomNode()}getInLineAiEditorTheme(){var e,t,a;return"vs-dark"===(null==(a=null==(t=null==(e=this.editor)?void 0:e._themeService)?void 0:t._theme)?void 0:a.themeName)?"dark":"light"}getInLineAiChatOptions(){var e,t,a,n,i,o;if(!this.editor||!this.monaco)throw new Vt(ibiz.i18n.t("editor.code.editorNotInit"));const s=null==(t=null==(e=this.editor)?void 0:e.getDomNode())?void 0:t.querySelector(".editor-scrollable");if(!s)throw new Vt(ibiz.i18n.t("editor.code.noEditorArea"));const l=null==(a=this.currentSelection)?void 0:a.getStartPosition();if(!l)throw new Vt(ibiz.i18n.t("editor.code.noSelStart"));const r=null==(n=this.editor)?void 0:n.getScrolledVisiblePosition(l),c=null==(o=null==(i=this.editor)?void 0:i.getDomNode())?void 0:o.getBoundingClientRect();if(!c)throw new Vt(ibiz.i18n.t("editor.code.noEditorRect"));if(!r)throw new Vt(ibiz.i18n.t("editor.code.noSelCoords"));const d=s.getBoundingClientRect(),u=this.editor.getLayoutInfo();return{left:d.left,top:c.top+r.top+r.height,width:d.width-u.minimap.minimapWidth-u.overviewRuler.width,editorElement:this.getInLineAiEditorElement(),editorTheme:this.getInLineAiEditorTheme(),height:this.inlineAiChatHeight}}async doInLineAIUIAction(e,t){const a=this.ctrl.getEventArgs();a.params=ko(a.params),a.params.editor=this,this.editorParams.srfaiappendcurdata&&"true"===this.editorParams.srfaiappendcurdata&&(a.context.srfaiappendcurdata=!0),await fa.exec(e,{...a},t)}}var EO=Object.defineProperty,DO=(e,t,a)=>(((e,t,a)=>{t in e?EO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class PO{constructor(){DO(this,"formEditor","IBizCode"),DO(this,"gridEditor","IBizCode")}async createController(e,t){const a=new SO(e,t);return await a.init(),a}}var kO=Object.defineProperty,zO=(e,t,a)=>(((e,t,a)=>{t in e?kO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class TO{constructor(){zO(this,"title","AI"),zO(this,"iconSvg",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" height="1em" width="1em" preserveAspectRatio="xMidYMid meet" focusable="false" class="cherry-menu-AIChart"><g id="aae1.Base基础/1.icon图标/2.normal/ai-star" stroke-width="1" fill-rule="evenodd"><path d="M5.817 1.53l3.158 8.797h.054v.152l1.443 4.021-1.402.001-1.041-2.982H2.495l-1.03 2.982L0 14.5 4.671 1.533l1.146-.003zm7.86 5.424V14.5h-1.213V6.954h1.212zM5.248 3.549l-2.342 6.778h4.706L5.249 3.55zM13.046 0c.075 0 .147.02.204.071a.318.318 0 01.094.181l.064.273c.097.417.17.727.255.968.084.24.177.4.31.523.134.124.318.218.599.306.281.088.65.166 1.15.265a.358.358 0 01.195.095c.056.057.083.13.083.213a.289.289 0 01-.083.21.362.362 0 01-.197.094c-.528.093-.918.167-1.214.255-.295.088-.485.187-.621.324-.137.138-.23.324-.31.606-.08.283-.145.651-.23 1.147a.329.329 0 01-.093.184.293.293 0 01-.206.075.308.308 0 01-.207-.072.322.322 0 01-.1-.188l-.006-.033c-.085-.486-.149-.845-.228-1.12-.079-.274-.17-.452-.305-.585-.135-.133-.323-.23-.618-.32s-.683-.168-1.21-.273a.353.353 0 01-.2-.096.29.29 0 01-.08-.208c0-.079.023-.153.079-.211a.35.35 0 01.2-.097c.5-.098.869-.176 1.15-.263.282-.087.465-.18.597-.302.132-.12.224-.278.306-.511.082-.236.151-.539.244-.947l.071-.312a.312.312 0 01.102-.183.311.311 0 01.205-.069z" id="aae形状结合"></path></g></svg>'),zO(this,"tag","button")}isActive(){return!1}getValue(){return"aichart"}isDisabled(){return!1}exec(e){e.emit("aiClick")}}const AO={key:"aichart",factory:()=>new TO};var OO=Object.defineProperty,MO=(e,t,a)=>(((e,t,a)=>{t in e?OO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);const NO={type:"emoji",renderElem:e=>{const{data:t={}}=e;return Du("emoji-elem",{dataset:{value:t.emoji?Qt(t.emoji):""},props:{contentEditable:!1}},[])}};class BO{constructor(){MO(this,"title","".concat(ibiz.i18n.t("editor.html.wangEditor.emoji"))),MO(this,"tag","button"),MO(this,"iconSvg","<svg viewBox='0 0 1040 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1490' width='1em' height='1em' stroke='var(--w-e-toolbar-color)' > <path stroke-width='38' d='M512.075261 1024A511.774217 511.774217 0 1 1 730.482434 48.769072a37.630457 37.630457 0 1 1-32.061149 68.035867 436.513303 436.513303 0 1 0 250.468323 395.270322 37.630457 37.630457 0 0 1 75.260914 0 512.526826 512.526826 0 0 1-512.075261 511.924739z' p-id='1491' ></path> <path stroke-width='38' d='M333.857416 344.0929a57.348817 57.348817 0 1 0 57.348817 57.348817 57.499339 57.499339 0 0 0-57.348817-57.348817zM686.53006 344.0929a57.348817 57.348817 0 1 0 57.348817 57.348817 57.348817 57.348817 0 0 0-57.348817-57.348817zM515.236219 783.165074c-162.864619 0-262.359547-141.942084-262.359547-219.159782a30.104366 30.104366 0 0 1 60.208731 0c0 48.618551 76.314567 158.951051 202.150816 158.951051s193.571072-134.114949 193.571072-158.951051a30.104366 30.104366 0 0 1 60.208731 0c0 54.488902-90.012054 219.159782-253.779803 219.159782zM1009.549904 207.720123h-67.132735V139.985301a30.104366 30.104366 0 1 0-60.208732 0v67.734822h-67.734822a30.104366 30.104366 0 0 0-30.104366 30.104366 30.104366 30.104366 0 0 0 30.104366 30.104366h67.734822v67.734823a30.104366 30.104366 0 0 0 60.208732 0v-67.734823h67.734823a30.104366 30.104366 0 0 0 30.104365-30.104366 30.104366 30.104366 0 0 0-30.706453-30.104366z' p-id='1492' ></path> </svg>")}isActive(){return!1}getValue(){return!1}isDisabled(){return!1}exec(e){e.emit("openEmojiSelect")}}const LO={renderElems:[NO],elemsToHtml:[{type:"emoji",elemToHtml:e=>{const{data:t}=e;return"<span data-w-e-type=\"emoji\" class='emoji'>".concat(t.emoji,"</span>")}}],parseElemsHtml:[{selector:'span[data-w-e-type="emoji"]',parseElemHtml:e=>({data:{emoji:e.innerHTML},type:"emoji",children:[{text:""}]})}],menus:[{key:"emoji",factory:()=>new BO}]};var RO=Object.defineProperty,_O=(e,t,a)=>(((e,t,a)=>{t in e?RO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class jO{constructor(){_O(this,"title"),_O(this,"tag"),_O(this,"iconSvg"),this.title="AI",this.tag="button",this.iconSvg='<svg t="1763370094787" class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="14" height="14" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M274.344554 173.673875c16.429399 0 30.950568 8.00526 39.956484 20.338945a34.906655 34.906655 0 0 1 14.660796 15.754537l1.117013 2.815803 210.138065 597.927736c6.795162 19.268474-5.329083 40.817516-27.041022 48.147913-20.641469 6.95806-42.493035-1.419537-50.451753-18.803052l-1.117013-2.815803-54.477653-154.939008H134.997185L80.566074 837.039954c-6.771891 19.268474-29.856826 28.949253-51.568765 21.618855-20.641469-6.981331-32.602816-26.761769-27.925325-45.239025l0.861031-2.908888L212.047809 212.58316c4.025901-11.426112 13.799764-19.477914 25.598214-22.619512 9.029188-10.006575 22.107548-16.289773 36.67526-16.289773z m386.416675 169.460176c21.828295 0 39.723774 10.890876 41.469106 24.713912l0.116356 2.210755v461.652153c0 14.893506-18.616883 26.947938-41.585462 26.947938-21.805024 0-39.700503-10.890876-41.422565-24.737183l-0.162897-2.210755V370.081989c0-14.870235 18.616883-26.924667 41.585462-26.924667z m-389.697901-48.171184L163.620643 600.628812h214.88537l-107.442685-305.665945z m602.163076-206.181978a12.566396 12.566396 0 0 1 8.144887 8.051802l32.509731 99.041817 101.694723 36.07021a12.566396 12.566396 0 0 1-0.791218 23.922695l-99.53051 27.995137-30.857483 97.552467a12.566396 12.566396 0 0 1-23.899423 0.116355l-32.509732-99.018546-98.669479-31.322905a12.566396 12.566396 0 0 1-0.186169-23.876152l97.505924-32.812256 30.834212-97.529195a12.566396 12.566396 0 0 1 15.754537-8.191429zM649.544557 0.513593c2.676177 0.884302 4.770576 3.025243 5.608336 5.724692l18.523798 59.294772 60.970292 20.66474a8.796477 8.796477 0 0 1-0.325796 16.755194l-60.73758 18.058377-19.780438 59.550754a8.796477 8.796477 0 0 1-16.731924-0.162898l-18.523798-59.271501-59.062061-17.825665a8.796477 8.796477 0 0 1-0.395609-16.708653l59.574025-20.943993 19.780438-59.574025a8.796477 8.796477 0 0 1 11.100317-5.561794z" fill="black"></path></svg>'}getValue(e){return""}isActive(e){return!1}isDisabled(e){return e.getConfig().readOnly}exec(e,t){this.isDisabled(e)||e.emit("lineAiClick")}}const VO={key:"inline-ai",factory:()=>new jO};e("h",{link:{menuKeys:["inline-ai","editLink","unLink","viewLink"]},image:{menuKeys:["inline-ai","imageWidth30","imageWidth50","imageWidth100","editImage","viewImageLink","deleteImage"]},pre:{menuKeys:["inline-ai","enter","codeBlock","codeSelectLang"]},table:{menuKeys:["inline-ai","enter","tableHeader","tableFullWidth","insertTableRow","deleteTableRow","insertTableCol","deleteTableCol","deleteTable"]},divider:{menuKeys:["inline-ai","enter"]},video:{menuKeys:["inline-ai","enter","editVideoSize"]},text:{menuKeys:["inline-ai","headerSelect","insertLink","bulletedList","|","bold","through","color","bgColor","clearStyle"]}});class FO extends HTMLElement{static get observedAttributes(){return["data-value"]}attributeChangedCallback(e,t,a){if("data-value"===e){if(a&&t===a)return;const e=this.attachShadow({mode:"open"}),n=e.ownerDocument.createElement("span");n.innerHTML=a,n.part.add("box"),n.classList.add("emoji-elem_box"),e.appendChild(n)}}}const UO=e=>{const{isInline:t,isVoid:a}=e;return e.isInline=e=>"emoji"===os.getNodeType(e)||t(e),e.isVoid=e=>"emoji"===os.getNodeType(e)||a(e),e},HO=a({name:"IBizHtmlEmoji",props:{modal:{type:Object,required:!0}},setup:e=>({ns:B("html-emoji"),onSelect:t=>{const a={ok:!0,data:[{emoji:aa(t.data)}]};e.modal.dismiss(a)}}),render(){return n("div",{class:this.ns.b()},[n(i("iBizEmojiSelect"),{dark:!0,continuousList:!0,onSelect:this.onSelect},null)])}});var qO=Object.defineProperty,GO=(e,t,a)=>(((e,t,a)=>{t in e?qO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class WO extends qi{constructor(){super(...arguments),GO(this,"uploadParams"),GO(this,"exportParams"),GO(this,"deService"),GO(this,"deACMode"),GO(this,"chatCompletion",!1),GO(this,"wangEditor"),GO(this,"overlay",null),GO(this,"cleanup",Ut),GO(this,"presetPreventEvents",[13,38,40]),GO(this,"presetPreventPropEvents",[27]),GO(this,"inlineAiChatHeight")}async onInit(){if(await super.onInit(),this.customRegister(),this.editorParams){const{uploadParams:e,exportParams:t,uploadparams:a,exportparams:n,inlineaichatheight:i}=this.editorParams;if(e)try{this.uploadParams=JSON.parse(e)}catch(e){ibiz.log.error("编辑器[".concat(ibiz.log.error(e),"]编辑器参数 uploadParams 非 json 格式"))}if(a)try{this.uploadParams=JSON.parse(a)}catch(e){ibiz.log.error("编辑器[".concat(ibiz.log.error(e),"]编辑器参数 uploadparams 非 json 格式"))}if(t)try{this.exportParams=JSON.parse(t)}catch(e){ibiz.log.error("编辑器[".concat(ibiz.log.error(e),"]编辑器参数 exportParams 非 json 格式"))}if(n)try{this.exportParams=JSON.parse(n)}catch(e){ibiz.log.error("编辑器[".concat(ibiz.log.error(e),"]编辑器参数 exportparams 非 json 格式"))}i&&(this.inlineAiChatHeight=Number(i))}const e=this.model;e.appDEACModeId&&(this.deACMode=await ga(e.appDEACModeId,e.appDataEntityId,this.context.srfappid),this.deACMode&&"CHATCOMPLETION"===this.deACMode.actype&&(this.deService=await ibiz.hub.getApp(e.appId).deService.getService(this.context,e.appDataEntityId),this.chatCompletion=!0))}customRegister(){!window.aichartRegister&&ibiz.env.enableAI&&(ls.registerMenu(AO),ls.registerMenu(VO),window.aichartRegister=!0),window.customElements.get("emoji-elem")||window.customElements.define("emoji-elem",FO),window.emojiIsRegiter||(ls.registerModule(LO),window.emojiIsRegiter=!0),window.wangEditorPlugin||(ls.registerPlugin(UO),window.wangEditorPlugin=!0)}onCreated(e){this.wangEditor=e,this.listenEvent()}listenEvent(){const e=this.wangEditor.getEditableContainer();this.wangEditor.on("openEmojiSelect",()=>this.openEmojiSelect()),this.cleanup=Nt(e,"keydown",e=>{var t;this.overlay&&this.presetPreventEvents.includes(e.keyCode)&&e.preventDefault(),this.overlay&&this.presetPreventPropEvents.includes(e.keyCode)&&(e.stopPropagation(),null==(t=this.overlay)||t.dismiss())})}async openEmojiSelect(){const e=document.getSelection(),{focusNode:t}=e;t&&(this.overlay=ibiz.overlay.createPopover(e=>l(HO,{modal:e}),void 0,{width:"auto",noArrow:!0,autoClose:!0,placement:"bottom-start"}),await this.overlay.present(t.parentNode),this.overlay.onWillDismiss().then(e=>{var t;const a=e,n=null==(t=a.data)?void 0:t[0];a.ok&&n&&this.addEmojiNode(n),this.overlay=null}))}addEmojiNode(e){const t={data:e,type:"emoji",children:[{text:""}]};this.wangEditor.restoreSelection(),this.wangEditor.insertNode(t),this.wangEditor.move(1)}onDestroyed(){this.cleanup!==Ut&&this.cleanup(),this.overlay&&this.overlay.dismiss()}getSelectionText(){return this.wangEditor?this.wangEditor.getSelectionText():""}insertText(e){if(this.wangEditor){const t={type:"paragraph",children:[{text:e}]},a=this.wangEditor.selection;if(a){const e={anchor:a.anchor,focus:a.anchor};a.anchor.path===a.focus.path&&a.anchor.offset===a.focus.offset||(e.anchor=a.focus,e.focus=a.focus),this.wangEditor.select(e)}this.wangEditor.insertNode(t),this.wangEditor.move(1)}}replaceSelectionText(e){this.wangEditor&&(this.wangEditor.selection?(this.wangEditor.deleteFragment(),this.wangEditor.insertText(e)):this.wangEditor.insertText(e))}restoreSelection(){this.wangEditor&&this.wangEditor.restoreSelection()}getInLineAiEditorElement(){if(!this.wangEditor)throw new Vt("编辑器未初始化");return this.wangEditor.getEditableContainer()}getInLineAiEditorTheme(){return-1!==ibiz.util.theme.getTheme().indexOf("dark")?"dark":"light"}getInLineAiChatOptions(){if(!this.wangEditor)throw new Vt("编辑器未初始化");const e=this.wangEditor.getSelectionPosition();if(!e||!e.left||!e.top)throw new Vt("获取选区位置失败");const t=this.wangEditor.getEditableContainer().getBoundingClientRect();return{left:t.x+10,top:t.y+Number(e.top.replace("px","")),width:t.width-20,editorElement:this.getInLineAiEditorElement(),editorTheme:this.getInLineAiEditorTheme(),height:this.inlineAiChatHeight}}async doInLineAIUIAction(e,t){const a=this.ctrl.getEventArgs();a.params=ko(a.params),a.params.editor=this,this.editorParams.srfaiappendcurdata&&"true"===this.editorParams.srfaiappendcurdata&&(a.context.srfaiappendcurdata=!0),await fa.exec(e,{...a},t)}}var YO=Object.defineProperty,KO=(e,t,a)=>(((e,t,a)=>{t in e?YO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class XO{constructor(){KO(this,"formEditor","IBizHtml"),KO(this,"gridEditor","IBizHtml")}async createController(e,t){const a=new WO(e,t);return await a.init(),a}}var $O=Object.defineProperty,JO=(e,t,a)=>(((e,t,a)=>{t in e?$O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class QO extends qi{constructor(){super(...arguments),JO(this,"uploadParams"),JO(this,"exportParams"),JO(this,"deService"),JO(this,"deACMode"),JO(this,"keyName","srfkey"),JO(this,"textName","srfmajortext"),JO(this,"sort","asc"),JO(this,"dataItems",[]),JO(this,"chatCompletion",!1),JO(this,"mdeditor",null),JO(this,"selectionAreaPosition",null),JO(this,"selectionDirection",!0),JO(this,"currentEditorTheme","light"),JO(this,"inlineAiChatHeight")}async onInit(){if(await super.onInit(),this.style.height||(this.style.height="600px"),this.editorParams){const{uploadparams:e,exportparams:t,inlineaichatheight:a}=this.editorParams;if(e)try{this.uploadParams=JSON.parse(e)}catch(t){throw new Xt(e,ibiz.i18n.t("editor.markdown.uploadJsonFormatErr"))}if(t)try{this.exportParams=JSON.parse(t)}catch(e){throw new Xt(t,ibiz.i18n.t("editor.markdown.exportJsonFormatErr"))}a&&(this.inlineAiChatHeight=Number(a))}const e=this.model;if(e.appDEACModeId&&(this.deACMode=await ga(e.appDEACModeId,e.appDataEntityId,this.context.srfappid),this.deACMode)){if("AUTOCOMPLETE"===this.deACMode.actype){const{minorSortAppDEFieldId:e,minorSortDir:t}=this.deACMode;e&&t&&(this.sort="".concat(e.toLowerCase(),",").concat(t.toLowerCase())),this.deACMode.textAppDEFieldId&&(this.textName=this.deACMode.textAppDEFieldId),this.deACMode.valueAppDEFieldId&&(this.keyName=this.deACMode.valueAppDEFieldId),this.deACMode.deacmodeDataItems&&(this.dataItems=[],this.deACMode.deacmodeDataItems.forEach(e=>{"value"!==e.id&&"text"!==e.id&&this.dataItems.push(e)}))}"CHATCOMPLETION"===this.deACMode.actype&&(this.deService=await ibiz.hub.getApp(e.appId).deService.getService(this.context,e.appDataEntityId),this.chatCompletion=!0)}}setMDEditor(e){this.mdeditor=e}setCursorPos(e,t){this.selectionAreaPosition={start:e,end:t}}setCurrentEditorTheme(e){this.currentEditorTheme=e}setSelectionDirection(e){this.selectionDirection=e}getCurrentTheme(){return"dark"===this.currentEditorTheme?"dark":"light"}getSelectionText(){var e;return null==(e=this.mdeditor)?void 0:e.editor.editor.getSelection()}getInLineAiEditorTheme(){return this.getCurrentTheme()}isPositionBefore(e,t){return e.line<t.line||!(e.line>t.line)&&e.ch<t.ch}insertText(e){var t,a,n;if(this.selectionAreaPosition){const{start:i,end:o}=this.selectionAreaPosition,s="\n".concat(e,"\n");if(!!(i.line===o.line&&i.ch===o.ch))return void(null==(t=this.mdeditor)||t.editor.editor.replaceSelection(s));let l;if(l=this.selectionDirection?o:i,null==(a=this.mdeditor)||a.editor.editor.setCursor(l),null==(n=this.mdeditor)||n.editor.editor.replaceSelection(s),!1===this.selectionDirection){const e=(s.match(/\n/g)||[]).length;this.selectionAreaPosition.start.line+=e,this.selectionAreaPosition.end.line+=e,this.selectionAreaPosition.end.ch-=this.selectionAreaPosition.start.ch,this.selectionAreaPosition.start.ch=0}this.restoreSelection()}}replaceSelectionText(e){var t;null==(t=this.mdeditor)||t.editor.editor.replaceSelection(e)}restoreSelection(){var e,t,a;null==(a=this.mdeditor)||a.editor.editor.setSelection(null==(e=this.selectionAreaPosition)?void 0:e.start,null==(t=this.selectionAreaPosition)?void 0:t.end)}getInLineAiChatOptions(){var e,t,a,n,i;const o=null==(e=this.mdeditor)?void 0:e.wrapperDom.getBoundingClientRect();(null==(t=this.mdeditor)?void 0:t.bubble.visible)||null==(a=this.mdeditor)||a.bubble.showBubble();const s=null==(n=this.mdeditor)?void 0:n.bubble.bubbleDom.getBoundingClientRect();return{left:o.left+10,top:s.top,width:o.width-58,editorElement:null==(i=this.mdeditor)?void 0:i.wrapperDom,editorTheme:this.getCurrentTheme(),height:this.inlineAiChatHeight}}getInLineAiEditorElement(){var e;return null==(e=this.mdeditor)?void 0:e.wrapperDom}async doInLineAIUIAction(e,t){const a=this.ctrl.getEventArgs();a.params=ko(a.params),a.params.editor=this,this.editorParams.srfaiappendcurdata&&"true"===this.editorParams.srfaiappendcurdata&&(a.context.srfaiappendcurdata=!0),await fa.exec(e,{...a},t)}}var ZO=Object.defineProperty,eM=(e,t,a)=>(((e,t,a)=>{t in e?ZO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class tM{constructor(){eM(this,"formEditor","IBizMarkDown"),eM(this,"gridEditor","IBizMarkDown")}async createController(e,t){const a=new QO(e,t);return await a.init(),a}}const aM=a({name:"IBizArray",props:ct(),emits:Ve(),setup(e,{emit:t}){const a=B("array"),n=e.controller,i=n.model;let s,l="default",d="default",u=0,h=!1,p="",m="",v="_blank";const g=o([]);i.editorParams&&(i.editorParams.editorStyle&&(l=i.editorParams.editorStyle),i.editorParams.editorstyle&&(l=i.editorParams.editorstyle),i.editorParams.size&&(d=i.editorParams.size),i.editorParams.limit&&(u=Yo(i.editorParams.limit)),i.editorParams.maxLength&&(s=Yo(i.editorParams.maxLength)),i.editorParams.maxlength&&(s=Yo(i.editorParams.maxlength)),i.editorParams.showWordLimit&&(h=n.toBoolean(i.editorParams.showWordLimit)),i.editorParams.showwordlimit&&(h=n.toBoolean(i.editorParams.showwordlimit)),i.editorParams.prepend&&(p=i.editorParams.prepend),i.editorParams.append&&(m=i.editorParams.append),i.editorParams.target&&(v=i.editorParams.target));const b=i.dataType,f=Object.is(b,"NUMBER")||Object.is(b,"INTEGER")?"number":"text",w=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{if(e&&e!==t&&0===g.value.length){const t=e.map(e=>({value:e,key:go()}));g.value=t}},{immediate:!0});const y=(e="blur")=>{const a=g.value.map(e=>e.value);e===n.triggerMode&&t("change",a)};return{ns:a,c:n,editorStyle:l,type:f,size:d,limit:u,maxLength:s,showWordLimit:h,prepend:p,append:m,target:v,items:g,getUrl:e=>{let t=e;return t&&(p&&(t=p+t),m&&(t+=m)),t},addItem:t=>{if(e.disabled||e.readonly)return;const a={key:go(),value:null};t?g.value.splice(t,0,a):g.value.push(a),y()},removeItem:e=>{g.value.splice(e,1),y()},handleChange:(e,t)=>{g.value[t].value=e,y()},handleInput:(e,t)=>{g.value[t].value=e,y("input")},onBlur:e=>{t("blur",e)},onFocus:e=>{t("focus",e)},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},showFormDefaultContent:w}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[0===this.items.length?n("ion-icon",{class:this.ns.b("add-icon"),name:"add-outline",onClick:this.addItem},null):this.items.map((e,t)=>n("div",{class:this.ns.b("item"),key:e.key},["default"===this.editorStyle?n(i("el-input"),y({type:this.type,size:this.size,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,placeholder:this.c.placeHolder,disabled:this.disabled,readonly:this.readonly,onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp,onChange:e=>this.handleChange(e,t),onInput:e=>this.handleInput(e,t)},this.$attrs),null):n(i("el-tooltip"),{placement:"bottom",trigger:"hover","popper-class":this.ns.b("tooltip")},{default:()=>n(i("el-input"),y({type:this.type,size:this.size,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,placeholder:this.c.placeHolder,disabled:this.disabled,readonly:this.readonly,maxlength:Object.is(this.editorStyle,"url")?this.maxLength:null,"show-word-limit":Object.is(this.editorStyle,"url")?this.showWordLimit:null,onBlur:this.onBlur,onFocus:this.onFocus,onChange:e=>this.handleChange(e,t),onInput:e=>this.handleInput(e,t),onKeyup:this.handleKeyUp},this.$attrs),{prefix:()=>Object.is(this.editorStyle,"url")&&this.prepend?this.prepend:null,suffix:()=>Object.is(this.editorStyle,"url")&&this.append?this.append:null}),content:()=>{let t;return"img"===this.editorStyle?n(i("el-image"),{fit:"contain",src:e.value},null):n(i("el-link"),{href:this.getUrl(e.value),target:this.target},"function"==typeof(a=t=this.getUrl(e.value))||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?t:{default:()=>[t]});var a}}),!(this.disabled||this.readonly)&&n("div",{class:this.ns.b("icons")},[(!this.limit||this.items.length<this.limit)&&n("ion-icon",{class:this.ns.b("add-icon"),name:"add",onClick:()=>this.addItem(t+1)},null),n("ion-icon",{class:this.ns.b("remove-icon"),name:"remove",onClick:()=>this.removeItem(t)},null)])]))])}});class nM extends qi{}var iM=Object.defineProperty,oM=(e,t,a)=>(((e,t,a)=>{t in e?iM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class sM{constructor(){oM(this,"formEditor","IBizArray"),oM(this,"gridEditor","IBizArray")}async createController(e,t){const a=new nM(e,t);return await a.init(),a}}const lM=a({name:"IBizCascader",props:dt(),emits:Ve(),setup(e,{emit:t}){const a=B("cascader"),n=e.controller,i=n.model,s=o(null),l=o([]),c=i.editorItems;if(c&&c.length>0){const e=c.map(e=>({name:e.id,appId:e.appId,appDataEntityId:e.appDataEntityId,appDEDataSetId:e.appDEDataSetId}));l.value=e}let d="default",u="default",h=!0,p=!1,m="/";i.editorParams&&(i.editorParams.editorStyle&&(d=i.editorParams.editorStyle),i.editorParams.editorstyle&&(d=i.editorParams.editorstyle),i.editorParams.size&&(u=i.editorParams.size),i.editorParams.filterable&&(h=n.toBoolean(i.editorParams.filterable)),i.editorParams.multiple&&(p=n.toBoolean(i.editorParams.multiple)),i.editorParams.separator&&(m=i.editorParams.separator));const v=o([]),g=o([]),b=o(null),f=o([]),w=o([]),y=o([]),C=o(""),I=o(!1),x=o(!1),S=o(),E=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),D=e=>{e?x.value=e:setTimeout(()=>{x.value=e},100)};l.value&&l.value.length>0&&l.value.forEach(e=>{w.value.push({name:e.name,value:[]})});const P=(t,a)=>{const{level:n,value:i}=t;I.value=!0;let o=[];if(0===n)(()=>{if(e.value&&l.value){const t=[],a=JSON.parse(e.value);if(a.forEach(e=>{t.push({label:e,value:[]})}),w.value.forEach(t=>{const a=e.data[t.name]?e.data[t.name].split(","):[];t.value=a}),f.value=[],t.forEach((e,t)=>{w.value.forEach(a=>{e.value.push(a.value[t])});const a=e.value.join(m);f.value.push({label:e.label,value:a})}),f.value.forEach(e=>{const t=e.value.split(m),a=e.label.split(m);t.forEach((e,t)=>{g.value.find(t=>t.value===e)||g.value.push({value:e,label:a[t]})})}),Object.is(d,"default")){let e=[];p?f.value.forEach(t=>{e.push(t.value.split(m))}):e=f.value[0].value.split(m),b.value=e}else{b.value=p?a:a.join(m);const e=w.value[w.value.length-1].value;if(w.value.length>1){const t=w.value[w.value.length-2].value;t&&t.length>0&&t.forEach((t,a)=>{e[a]="".concat(t,"_").concat(e[a])})}y.value=e}}})(),v.value.length>0?a.forEach(e=>{const t=v.value.findIndex(t=>e.value===t.value);t>-1?Object.assign(v.value[t],e):(v.value.push(e),o.push(e))}):(v.value=[...a],o=[...a]);else{const e=(t,n)=>{t&&t.length>0&&t.forEach(t=>{t.value===i?t.children&&t.children.length>0?a.forEach(e=>{const a=t.children.findIndex(t=>t.value===e.value);a>-1?Object.assign(t.children[a],e):(t.children.push(e),o.push(e))}):(t.children=a,o=a):e(t.children)})};e(v.value)}const s=b.value||[];return setTimeout(()=>{b.value=s,I.value=!1}),o},k=()=>{var e,a;if(!I.value){w.value.forEach(e=>{e.value=[]}),(null==(e=b.value)?void 0:e.length)&&b.value.forEach((e,t)=>{"string"==typeof e?w.value[t].value.push(e):e.forEach((e,t)=>{w.value[t].value.push(e)})});const n=[];let i=[];(null==(a=b.value)?void 0:a.length)&&b.value.forEach(e=>{if(p){const t=e.map(e=>{const t=g.value.find(t=>t.value===e);if(t)return t.label});n.push(t)}else{const t=g.value.find(t=>t.value===e);t&&n.push(t.label)}}),w.value.forEach(e=>{t("change",e.value.length>0?e.value.join(","):null,e.name)}),n.length>0&&(p?n.forEach(e=>{i.push(e.join(m))}):i=[n.join(m)]),t("change",i.length>0?JSON.stringify(i):null),D(!1)}},z=r(()=>{if(e.value){return JSON.parse(e.value)[0]}return null});return{ns:a,c:n,valueItems:l,editorStyle:d,filterable:h,separator:m,onBlur:e=>{t("blur",e),D(!1)},onFocus:e=>{t("focus",e),D(!0)},treeData:v,items:g,selectValue:b,treeSelectData:f,valueItemData:w,defaultCheckedKeys:y,searchValue:C,isLoaded:I,getSize:()=>{switch(u){case"large":return"large";case"small":return"small";default:return"default"}},getIsLeaf:(e,t)=>e.leaf,getDisabled:(e,t)=>t.level!==l.value.length,loadData:async(e,t)=>{const{level:a}=e,i=Object.is(d,"default")?e.value:e.data?e.data.value:null,o=l.value[a];try{if(o.appDataEntityId&&o.appDEDataSetId){const{context:s,params:r}=await(async(e,t)=>{const a=ko(n.context),i=ko(n.params);if(e>0){const{appDataEntityId:a}=l.value[e-1],{appId:n,appDataEntityId:o}=l.value[e],s=await ibiz.hub.getAppDataEntity(o,n),{minorAppDERSs:r}=s;if(r){const e=r.find(e=>e.majorAppDataEntityId===a);e&&e.parentAppDEFieldId&&Object.assign(i,{["n_".concat(e.parentAppDEFieldId.toLowerCase(),"_eq")]:t})}}return{context:a,params:i}})(a,i),c=ibiz.hub.getApp(n.context.srfappid),u=await c.deService.exec(o.appDataEntityId,o.appDEDataSetId,s,r);if(u&&200===u.status&&u.data.length>0){const n=u.data.map((e,t)=>({...e,value:e.srfkey,label:e.srfmajortext?e.srfmajortext:ibiz.i18n.t("editor.cascader.ibizCascader.title",{index:t}),leaf:a===l.value.length-1,nodekey:"".concat(i?"".concat(i,"_").concat(e.srfkey):e.srfkey)}));if(n.forEach(e=>{const t=g.value.findIndex(t=>e.value===t.value);t>-1?g.value[t]=e:g.value.push(e)}),Object.is(d,"default")){t(P(e,n))}else t(n)}}t([])}catch(e){t([])}},treeRef:s,handleTreeClear:()=>{f.value=[],w.value.forEach(e=>{e.value=[]}),s.value&&s.value.setCheckedKeys([]),(()=>{const e=[];b.value=[],f.value.forEach(t=>{e.push(t.label)}),b.value=p?e:e.length>0?e[0]:null,w.value.forEach(e=>{t("change",e.value.length>0?e.value.join(","):null,e.name)}),t("change",b.value.length>0?JSON.stringify(b.value):null)})()},handleRemoveTag:()=>{setTimeout(()=>{k()})},multiple:p,handleCascaderValueChange:k,editorRef:S,valueText:z,isEditable:x,setEditable:D,showFormDefaultContent:E,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)}}},render(){const e=n(i("el-cascader"),y({ref:"editorRef",class:[this.ns.b("input")],"popper-class":this.ns.b("popper"),clearable:!0,teleported:!this.showFormDefaultContent,options:this.treeData,size:this.getSize(),separator:this.separator,filterable:this.filterable,placeholder:this.c.placeHolder?this.c.placeHolder:" ",props:{lazy:!0,multiple:this.multiple,lazyLoad:this.loadData},disabled:this.disabled,modelValue:this.selectValue,"onUpdate:modelValue":e=>this.selectValue=e,onBlur:this.onBlur,onFocus:this.onFocus,onRemoveTag:this.handleRemoveTag,onChange:this.handleCascaderValueChange},this.$attrs),null),t=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),a=n("div",{class:this.ns.b("form-default-content")},[this.valueText?this.valueText:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],onKeyup:this.handleKeyUp},[this.showFormDefaultContent&&a,this.readonly?t:e])}});class rM extends qi{}var cM=Object.defineProperty,dM=(e,t,a)=>(((e,t,a)=>{t in e?cM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class uM{constructor(){dM(this,"formEditor","IBizCascader"),dM(this,"gridEditor","IBizCascader")}async createController(e,t){const a=new rM(e,t);return await a.init(),a}}const hM=a({name:"IBizColorMPickerCustom",props:{value:{type:Array},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},defaultVal:{type:Array,default:()=>[]}},emits:["change"],setup(e,{emit:t}){const a=B("color-mpicker-custom"),s=[{text:ibiz.i18n.t("editor.colorPicker.selector"),value:"select"},{text:ibiz.i18n.t("editor.colorPicker.textValue"),value:"write"}],l=o(["#000000","#2C2C2C","#50555C","#ACB3BF","#D0D3D9","#C4C4C4","#DADADA","#E5E5E5","#F0F0F0","#F24E1E","#E99C58","#FFC700","#FF4D00","#FF00D6","#D82E57","#8E1DE8","#0ACF83","#18A0FB","#A259FF","#907CFF"]),r=o([]),d=o("select"),u=o("");return c(()=>e.value,()=>{e.value&&0!==e.value.length?(r.value=e.value,u.value=r.value.toString()):(u.value="",r.value=e.defaultVal||[])},{immediate:!0,deep:!0}),{ns:a,tabs:s,curSelect:d,colorStr:u,renderColorList:()=>r.value.map((o,s)=>n("div",{class:a.em("color-list","item")},[n(i("el-color-picker"),{modelValue:o,"onUpdate:modelValue":e=>o=e,disabled:e.disabled||e.readonly,predefine:l.value,onChange:e=>((e,a)=>{r.value[e]=a,t("change",[...r.value])})(s,e)},null),n("ion-icon",{name:"close-circle-outline",onClick:()=>(e=>{r.value.splice(e,1),r.value.length?t("change",[...r.value]):t("change",null)})(s)},null)])),onSelect:e=>{if(d.value=e,"select"===e){const e=u.value.split(",");r.value=e.filter(e=>/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(e))}else u.value=r.value.toString()},onAdd:()=>{e.readonly||e.disabled||(r.value.push("#FFFFFF"),t("change",[...r.value]))},onBlur:()=>{if("select"===d.value)t("change",r.value);else{const e=u.value.split(",");r.value=e.filter(e=>/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(e)),t("change",r.value)}}}},render(){return n("div",{class:this.ns.b()},[n("div",{class:[this.ns.e("tabs")]},[n("div",{class:[this.ns.e("anchor"),this.ns.is("select-text","write"===this.curSelect)]},[this.tabs.map(e=>n("div",{class:[this.ns.em("tabs","tab"),this.ns.is("selected",e.value===this.curSelect)],onClick:()=>this.onSelect(e.value)},[e.text]))])]),n("div",{class:this.ns.e("content")},["select"===this.curSelect?n("div",{class:this.ns.e("color-list")},[this.renderColorList(),n("div",{class:[this.ns.em("color-list","add"),this.ns.is("disabled",this.disabled||this.readonly)],onClick:this.onAdd,title:ibiz.i18n.t("editor.colorPicker.add")},[n("ion-icon",{name:"add-outline"},null)])]):n(i("el-input"),{type:"textarea",modelValue:this.colorStr,"onUpdate:modelValue":e=>this.colorStr=e,disabled:this.disabled,readonly:this.readonly,onBlur:this.onBlur},null)])])}}),pM=a({name:"IBizColorMPickerDefault",props:{value:{type:[Array,String]},customColorList:{type:String},type:{type:String,default:"ITEMS"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=B("color-mpicker-default"),n=o("default"),i=o(""),s=o(!1),l=[{text:ibiz.i18n.t("editor.colorPicker.systemColor"),value:"default"},{text:ibiz.i18n.t("editor.colorPicker.templateColor"),value:"template"}],d=r(()=>e.customColorList?JSON.parse(e.customColorList):[{text:ibiz.i18n.t("editor.colorPicker.simpleBlue"),value:"ITEM"===e.type?["#6698FF"]:["#6698FF","#73DEB3","#7585A2","#F7BE21","#EE734A","#83D0EE"]},{text:ibiz.i18n.t("editor.colorPicker.autumnOrange"),value:"ITEM"===e.type?["#EE734A"]:["#EE734A","#7585A2","#FEC103","#9EB411","#CD8050","#DAD5B5"]},{text:ibiz.i18n.t("editor.colorPicker.Macaroon"),value:"ITEM"===e.type?["#467CE6"]:["#467CE6","#CD74CA","#4997CC","#BCBFE3","#666CEB","#82BC9A"]},{text:ibiz.i18n.t("editor.colorPicker.mintGreen"),value:"ITEM"===e.type?["#118299"]:["#118299","#13B3B3","#73DEB3","#FEC103","#9EB411","#83D0EE"]}]);return c(()=>e.value,()=>{e.value?"string"==typeof e.value?(n.value="default",s.value=!1):(n.value="template",s.value=!0,e.value.length>0&&(i.value=JSON.stringify(e.value))):(n.value="default",s.value=!1)},{immediate:!0,deep:!0}),{ns:a,curType:n,curTemplateColor:i,showTemplateList:s,colorType:l,templateColorList:d,handleTemplateColorChange:()=>{const e=JSON.parse(i.value);t("change",e)},handleSchemeChange:()=>{var e,a;"default"===n.value?(s.value=!1,t("change",null==(a=null==(e=d.value[0])?void 0:e.value)?void 0:a[0])):s.value=!0}}},render(){return n("div",{class:this.ns.b()},[n(i("el-select"),{class:this.ns.b("picker"),"popper-class":this.ns.b("popper"),modelValue:this.curType,"onUpdate:modelValue":e=>this.curType=e,onChange:this.handleSchemeChange},{default:()=>this.colorType.map(e=>n(i("el-option"),{key:e.value,label:e.text,value:e.value},null))}),this.showTemplateList&&n(i("el-select"),{class:this.ns.b("template-color-picker"),"popper-class":this.ns.b("popper"),modelValue:this.curTemplateColor,"onUpdate:modelValue":e=>this.curTemplateColor=e,onChange:this.handleTemplateColorChange},{default:()=>this.templateColorList.map(e=>n(i("el-option"),{key:e.key,label:e.text,value:JSON.stringify(e.value)},{default:()=>n("div",{class:this.ns.b("template-color-picker-option")},[Array.isArray(e.value)?e.value.map(e=>n("div",{class:this.ns.be("template-color-picker","icon"),style:{background:e}},null)):n("div",{class:this.ns.be("template-color-picker","icon"),style:{background:e.value}},null),n("div",{class:this.ns.be("template-color-picker","text")},[e.text])])})),prefix:()=>{if(this.curTemplateColor){const e=JSON.parse(this.curTemplateColor);return Array.isArray(e)?e.map(e=>n("div",{class:this.ns.be("template-color-picker","icon"),style:{background:e}},null)):n("div",{class:this.ns.be("template-color-picker","icon"),style:{background:e[0]}},[e[0]])}}})])}}),mM=a({name:"IBizColorPicker",props:ut(),emits:Ve(),setup(e,{emit:t}){var a,n,i,s,l,d,u,h;const p=B("color-picker"),m=e.controller,v=o(""),g=o(null),b="true"===(null==(a=m.editorParams)?void 0:a.MULTIPLE)||"true"===(null==(n=m.editorParams)?void 0:n.multiple),f="true"===(null==(i=m.editorParams)?void 0:i.CUSTOM)||"true"===(null==(s=m.editorParams)?void 0:s.custom),w=(null==(l=m.editorParams)?void 0:l.TYPE)||(null==(d=m.editorParams)?void 0:d.type),y=(null==(u=m.editorParams)?void 0:u.CUSTOMCOLORLIST)||(null==(h=m.editorParams)?void 0:h.customcolorlist)||"",C=o(["#000000","#2C2C2C","#50555C","#ACB3BF","#D0D3D9","#C4C4C4","#DADADA","#E5E5E5","#F0F0F0","#F24E1E","#E99C58","#FFC700","#FF4D00","#FF00D6","#D82E57","#8E1DE8","#0ACF83","#18A0FB","#A259FF","#907CFF"]),I=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{e!==t&&(v.value=b?e||(f?[]:""):e||"")},{immediate:!0});const x=r(()=>m.style?m.style:null);return{ns:p,c:m,currentVal:v,predefineColors:C,contentStyle:x,colorPicker:g,multiple:b,isCustom:f,customColorList:y,type:w,handleChange:e=>{t("change",e)},showPicker:e=>{setTimeout(()=>{g.value&&g.value.show()},200)},onFocus:e=>{t("focus",e)},onBlur:e=>{t("blur",e)},showFormDefaultContent:I,onChange:e=>{t("change",e)}}},render(){var e,t,a;if(this.multiple)return this.isCustom?n(hM,{value:this.currentVal||[],onChange:this.onChange,readonly:this.readonly,disabled:this.disabled,defaultVal:this.controller.defaultVal},null):n(pM,{value:this.currentVal||"",type:this.type,customColorList:this.customColorList,readonly:this.readonly,disabled:this.disabled,onChange:this.onChange},null);let o=null;return o=this.readonly?"".concat(null==(e=this.currentVal)?void 0:e.toString()):n("span",{class:this.ns.b("content"),style:this.contentStyle,onClick:this.showPicker},[n(i("el-color-picker"),y({ref:"colorPicker",modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.disabled,onChange:this.handleChange,onBlur:this.onBlur,onFocus:this.onFocus,size:"small",predefine:this.predefineColors,"show-alpha":!0},this.$attrs),null),"true"===(null==(t=this.c.editorParams)?void 0:t.isHiddenText)||"true"===(null==(a=this.c.editorParams)?void 0:a.ishiddentext)?null:n("span",{class:this.ns.b("text")},[this.currentVal])]),n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)],style:{color:this.currentVal||""}},[o])}});var vM=Object.defineProperty,gM=(e,t,a)=>(((e,t,a)=>{t in e?vM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class bM extends qi{constructor(){super(...arguments),gM(this,"defaultVal",[])}async onInit(){await super.onInit();const{defaultVal:e,defaultval:t}=this.editorParams;e&&(this.defaultVal=JSON.parse(e)),t&&(this.defaultVal=JSON.parse(t))}}var fM=Object.defineProperty,wM=(e,t,a)=>(((e,t,a)=>{t in e?fM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class yM{constructor(){wM(this,"formEditor","IBizColorPicker"),wM(this,"gridEditor","IBizColorPicker")}async createController(e,t){const a=new bM(e,t);return await a.init(),a}}const CM=a({name:"IBizPresetRawitem",props:$e(),emits:Ve(),setup(e,{emit:t}){const a=B("preset-rawitem"),n=e.controller,i=n.model,{componentRef:s}=je(()=>t("focus"),()=>t("blur")),l=n.model.predefinedType,r=o("");return c(()=>e.value,(e,t)=>{e!==t&&(r.value=e)},{immediate:!0}),{ns:a,editorModel:i,editorRef:s,type:l,content:r}},render(){let e=null;return e="FIELD_IMAGE"===this.type?n(i("iBizRawItem"),{content:this.content,type:"IMAGE"},null):"FIELD_TEXT_DYNAMIC"===this.type?n(i("iBizRawItem"),{content:this.content,type:"TEXT"},null):n("div",null,[ibiz.i18n.t("editor.preset.ibizPresetRawitem.noSupportType",{type:this.type})]),n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):""],ref:"editorRef"},[e])}}),IM=a({name:"IBizCarousel",props:ht(),emits:Ve(),setup(e){var t;const a=B("carousel"),n=e.controller,i=n.model,s="true"===(null==(t=null==n?void 0:n.editorParams)?void 0:t.enablenoaccess),l=o([]),r=o(!0),d=o(3e3);c(()=>e.value,e=>{"string"==typeof e&&(l.value=e?JSON.parse(e):[])},{immediate:!0});return c(l,t=>{(null==t?void 0:t.length)&&t.forEach(t=>{const a=((e,t)=>{const a={...n.editorParams,enableNoAccess:s};return a.exportparams&&(a.exportParams=JSON.parse(a.exportparams)),a.globaldownloadprifix?a.globalDownloadPrifix="true"===a.globaldownloadprifix:a.globalDownloadPrifix=ibiz.config.common.globalDownloadPrifix,t&&t.folder&&(a.osscat=t.folder),ibiz.util.file.calcFileUpDownUrl(n.context,n.params,e,a).downloadUrl})(e.data,t);t.imgUrl=t.imgUrl||a.replace("%fileId%",t.id),ibiz.config.common.enableDownloadTicket&&!s&&ibiz.util.file.getDownloadTicket(n.context,n.params,e.data,{fileId:t.id},n.downloadTicketParams).then(e=>{e&&e.ticket&&(t.imgUrl=a.replace("%fileId%",e.ticket))})})},{immediate:!0}),{ns:a,c:n,editorModel:i,carouselData:l,isAuto:r,timeSpan:d}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.e(this.editorModel.editorType)]},[n(i("iBizCarouselComponent"),y({carouselData:this.carouselData,isAuto:this.isAuto,timeSpan:this.timeSpan},this.$attrs),null)])}});class xM extends qi{}var SM=Object.defineProperty,EM=(e,t,a)=>(((e,t,a)=>{t in e?SM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class DM{constructor(){EM(this,"formEditor","IBizCarousel"),EM(this,"gridEditor","IBizCarousel")}async createController(e,t){const a=new xM(e,t);return await a.init(),a}}var PM=Object.defineProperty,kM=(e,t,a)=>(((e,t,a)=>{t in e?PM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class zM extends qi{constructor(){super(...arguments),kM(this,"searchBarFilters",[]),kM(this,"filterControllers",[]),kM(this,"appDataEntity",null)}async onInit(){await super.onInit(),await this.initByEntitySchema(),await this.initSearchBarFilters()}async initByEntitySchema(){if(!this.model.appDataEntityId)return;const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);e&&(this.appDataEntity=e);const t=await Wi(this.model.appDataEntityId,this.context);if(!t)return;const a=await Yi(t,this.model.appDataEntityId,this.model.appId);this.searchBarFilters=a}async initSearchBarFilters(){var e;(null==(e=this.searchBarFilters)?void 0:e.length)&&this.appDataEntity&&(this.searchBarFilters.forEach(e=>{const t=new Ki(e,this.appDataEntity,this.context,this.params);this.filterControllers.push(t)}),await Promise.all(this.filterControllers.map(e=>e.init())))}}var TM=Object.defineProperty,AM=(e,t,a)=>(((e,t,a)=>{t in e?TM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class OM{constructor(){AM(this,"formEditor","IBizSearchCondEdit"),AM(this,"gridEditor","IBizSearchCondEdit")}async createController(e,t){const a=new zM(e,t);return await a.init(),a}}const MM=a({name:"IBizSearchCondEdit",props:Fe(),emits:Ve(),setup(e,{emit:t}){const a=B("searchcond-edit"),s=e.controller,l=o(null),d=o(!1),u=o(),h=o([]),p=o();let m;const v=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{if(e!==t)if(null==e)l.value="",h.value=Xi();else if("string"==typeof e&&(l.value=e,e))try{const t=JSON.parse(e);h.value=t.map(e=>$i(e))}catch(t){ibiz.log.error("".concat(e,"值格式不正确,必须为json字符串"))}},{immediate:!0});const g=()=>{h.value=Xi()};g();const b=e=>{e?d.value=e:setTimeout(()=>{d.value=e},100)};c(u,t=>{if(e.autoFocus&&t){t.$el.getElementsByTagName("input")[0].focus()}});const f=()=>{const e=Ji(h.value);e&&(l.value=JSON.stringify(e,null,2))},w=async()=>{m=ibiz.overlay.createPopover(()=>n(i("iBizFilterTreeControl"),{filterControllers:s.filterControllers,filterNodes:h.value,parent:"searchcond-edit",onConfirm:()=>{f(),m&&m.dismiss(),t("change",l.value)},onCancel:()=>{g(),f(),t("change","")}},null),void 0,{placement:"bottom-end",autoClose:!0}),m.present(p.value.$el),await m.onWillDismiss(),m=void 0};return{ns:a,c:s,currentVal:l,handleChange:e=>{t("change",e)},onFocus:e=>{t("focus",e),b(!0)},onBlur:e=>{t("blur",e),b(!1)},editorRef:u,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},isEditable:d,setEditable:b,showFormDefaultContent:v,filterNodes:h,triggerFilter:()=>{m?m.dismiss():w()},filterButtonRef:p,resetFilter:g}},render(){let e=null;return e=this.readonly?fo(this.currentVal)?"":"".concat(this.currentVal):[n(i("el-input"),y({ref:"editorRef",class:[this.ns.b("input")],"model-value":this.currentVal,type:"textarea",rows:10,placeholder:this.c.placeHolder,disabled:this.disabled,controls:!1,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp},this.$attrs),null),n(i("el-button"),{ref:"filterButtonRef",type:"primary",title:Tt(ibiz.i18n.t("app.edit")),class:this.ns.b("filter"),onClick:()=>this.triggerFilter()},{default:()=>[n(i("iBizIcon"),{icon:{cssClass:"fa fa-edit"}},null)]})],n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[e])}});var NM=a({name:"BIQuarterRangeSelect",props:{value:{type:Array,default:()=>[]}},emits:["change","visibleChange"],setup(e,{emit:t}){const a=B("bi-quarter-range-select"),i=o(),s=o(),l=o(),r=o(),d=o(),u=o(!1),h=["Q1","Q2","Q3","Q4"],p=(e,t,a)=>{let n=3*t;"START"===a&&(n-=2);const i=new Date("".concat(e,"-").concat(n));if("START"===a)i.setDate(1),i.setHours(0,0,0,0);else{[1,3,5,7,8,10,12].includes(n)?i.setDate(31):i.setDate(30),i.setHours(23,59,59,0)}return i};c(()=>e.value,e=>{if(e&&Array.isArray(e)&&e.length>0){const t=new Date(e[0]),a=new Date(e[1]);i.value=t.getFullYear();const n=a.getFullYear();i.value===n?s.value=i.value+1:s.value=n;const o=Math.ceil((t.getMonth()+1)/3),c=Math.ceil((a.getMonth()+1)/3);l.value=p(i.value,o,"START"),r.value=p(n,c,"END")}else i.value=(new Date).getFullYear(),s.value=(new Date).getFullYear()+1,l.value=null,r.value=null},{immediate:!0,deep:!0});const m=e=>"right"===e&&i.value===s.value?n("div",null,null):n("svg",{onClick:()=>(e=>{"left"===e?i.value-=1:s.value-=1})(e),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aav1.icon图标/5.navigation/angle-double-left","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.984 7l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7l.005.006L7.984 7zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3l.005.006L7.984 3z",id:"aav形状结合",transform:"rotate(-90 7.949 7.822)"},null)])]),v=e=>"left"===e&&i.value===s.value?n("div",null,null):n("svg",{onClick:()=>(e=>{"left"===e?i.value+=1:s.value+=1})(e),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aaw1.icon图标/5.navigation/angle-double-right","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.984 7.3l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7.3l.005.006.006-.006zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3.3l.005.006.006-.006z",id:"aaw形状结合",transform:"rotate(90 7.949 8.122)"},null)])]),g=(e,a)=>{if(l.value&&r.value&&(l.value=null,r.value=null),l.value){const n=l.value.getFullYear(),i=l.value.getMonth()+1,o=Math.ceil(i/3);e>n?r.value=p(e,a,"END"):e<n?(r.value=p(n,o,"END"),l.value=p(e,a,"START")):a>=o?r.value=p(e,a,"END"):(r.value=p(n,o,"END"),l.value=p(e,a,"START")),t("change",[l.value.toLocaleDateString(),r.value.toLocaleDateString()]),u.value=!1}else l.value=p(e,a,"START")},b=(e,t)=>{if(i.value&&s.value&&l.value&&r.value){const a=l.value.getFullYear(),n=r.value.getFullYear(),i=l.value.getMonth()+1,o=r.value.getMonth()+1,s=Math.ceil(i/3),c=Math.ceil(o/3);if(e>a&&e<n)return!0;if(e===a&&e<n&&t>=s)return!0;if(e===n&&e>a&&t<=c)return!0;if(e===a&&e===n&&t<=c&&t>=s)return!0}return!1},f=(e,t)=>{if(i.value&&s.value&&l.value&&!r.value&&d.value){const a=d.value.getFullYear(),n=d.value.getMonth()+1,i=Math.ceil(n/3);let o=l.value,s=d.value;const r=l.value.getFullYear(),c=l.value.getMonth()+1,u=Math.ceil(c/3);a<=r&&i<=u&&(s=l.value,o=d.value);const h=o.getFullYear(),p=s.getFullYear(),m=o.getMonth()+1,v=s.getMonth()+1,g=Math.ceil(m/3),b=Math.ceil(v/3);if(e>h&&e<p)return!0;if(e===h&&e<p&&t>=g)return!0;if(e===p&&e>h&&t<=b)return!0;if(a<=r&&i<u&&e===a&&t>=i&&t<=u)return!0;if(a>=r&&i>u&&e===a&&t<=i&&t>=u)return!0}return!1},w=(e,t)=>{if(l.value){const a=l.value.getFullYear(),n=l.value.getMonth()+1,i=Math.ceil(n/3);if(e===a&&i===t)return!0}if(r.value){const a=r.value.getFullYear(),n=r.value.getMonth()+1,i=Math.ceil(n/3);if(e===a&&i===t)return!0}return!1},y=(e,t)=>!!d.value&&d.value.getTime()===p(e,t,"START").getTime(),C=(e,t)=>{const a=p(e,t,"START"),n=new Date,i=a.getMonth()+1,o=Math.ceil(i/3),s=n.getFullYear(),l=n.getMonth()+1,r=Math.ceil(l/3);return e===s&&o===r},I=(e,t)=>{d.value=p(e,t,"START")},x=()=>{d.value=null};return{ns:a,renderSelect:()=>n("div",{class:a.e("date-panel")},[n("div",{class:a.em("date-panel","left")},[n("div",{class:a.em("date-panel","left-header")},[m("left"),n("span",null,[i.value,ibiz.i18n.t("editor.dateRangeSelect.year")]),v("left")]),n("div",{class:a.em("date-panel","left-content")},[h.map((e,t)=>n("div",{class:[a.em("date-panel","left-item"),a.is("include",b(i.value,t+1)),a.is("selected",w(i.value,t+1)),a.is("hoverinclude",f(i.value,t+1)),a.is("curquarter",C(i.value,t+1)),a.is("hover",y(i.value,t+1))],onClick:()=>g(i.value,t+1),onMouseenter:()=>I(i.value,t+1),onMouseleave:()=>x()},[e]))])]),n("div",{class:a.em("date-panel","right")},[n("div",{class:a.em("date-panel","right-header")},[m("right"),n("span",null,[s.value,ibiz.i18n.t("editor.dateRangeSelect.year")]),v("right")]),n("div",{class:a.em("date-panel","right-content")},[h.map((e,t)=>n("div",{class:[a.em("date-panel","right-item"),a.is("selected",w(s.value,t+1)),a.is("include",b(s.value,t+1)),a.is("hoverinclude",f(s.value,t+1)),a.is("curquarter",C(s.value,t+1)),a.is("hover",y(s.value,t+1))],onClick:()=>g(s.value,t+1),onMouseenter:()=>I(s.value,t+1),onMouseleave:()=>x()},[e]))])])]),visible:u,handleClose:()=>{u.value=!1},handleOpen:()=>{u.value=!0},visibleChange:e=>{t("visibleChange",e)}}},render(){return n("div",{class:this.ns.b()},[n(i("el-popover"),{visible:this.visible,"onUpdate:visible":e=>this.visible=e,trigger:"click",width:600,"popper-class":this.ns.b("quarter-pop"),placement:"right",onAfterEnter:()=>this.visibleChange(!0),onAfterLeave:()=>this.visibleChange(!1)},{default:()=>this.renderSelect(),reference:()=>n("div",null,null)})])}}),BM=a({name:"BIYearRangeSelect",props:{value:{type:Array,default:()=>[]}},emits:["change","visibleChange"],setup(e,{emit:t}){const a=B("bi-year-range-select"),i=o(),s=o(!1),l=o([(new Date).getFullYear()-(new Date).getFullYear()%10,(new Date).getFullYear()+(9-(new Date).getFullYear()%10)]),r=o([(new Date).getFullYear()+(10-(new Date).getFullYear()%10),(new Date).getFullYear()+(19-(new Date).getFullYear()%10)]),d=o({start:void 0,end:void 0}),u=o([]),h=o([]),p=(e,t)=>{let a=e-1;const n=[];for(;a<=t+1;)n.push(a),a+=1;return n};u.value=p(l.value[0],l.value[1]),h.value=p(r.value[0],r.value[1]),c(()=>e.value,e=>{if(e&&Array.isArray(e)&&e.length>0){const t=Number(e[0]),a=Number(e[1]);Number.isNaN(t)||Number.isNaN(a)||(l.value=[t-t%10,t+(9-t%10)],d.value.start=t,r.value=[a-a%10,a+(9-a%10)],d.value.end=a)}else l.value=[(new Date).getFullYear()-(new Date).getFullYear()%10,(new Date).getFullYear()+(9-(new Date).getFullYear()%10)],r.value=[(new Date).getFullYear()+(10-(new Date).getFullYear()%10),(new Date).getFullYear()+(19-(new Date).getFullYear()%10)]},{immediate:!0,deep:!0});const m=e=>"right"===e&&l.value&&r.value&&l.value.at(-1)===r.value[0]-1?n("div",null,null):n("svg",{onClick:()=>(e=>{"left"===e?(l.value[0]-=10,l.value[1]-=10,u.value=p(l.value[0],l.value[1])):(r.value[0]-=10,r.value[1]-=10,h.value=p(r.value[0],r.value[1]))})(e),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aav1.icon图标/5.navigation/angle-double-left","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.984 7l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7l.005.006L7.984 7zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3l.005.006L7.984 3z",id:"aav形状结合",transform:"rotate(-90 7.949 7.822)"},null)])]),v=e=>"left"===e&&l.value&&r.value&&l.value.at(-1)===r.value[0]-1?n("div",null,null):n("svg",{onClick:()=>(e=>{"left"===e?(l.value[0]+=10,l.value[1]+=10,u.value=p(l.value[0],l.value[1])):(r.value[0]+=10,r.value[1]+=10,h.value=p(r.value[0],r.value[1]))})(e),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aaw1.icon图标/5.navigation/angle-double-right","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.984 7.3l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7.3l.005.006.006-.006zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3.3l.005.006.006-.006z",id:"aaw形状结合",transform:"rotate(90 7.949 8.122)"},null)])]),g=e=>{if(d.value.start&&d.value.end&&(d.value.start=void 0,d.value.end=void 0),d.value.start){if(e>=d.value.start)d.value.end=e;else{const t=d.value.start;d.value.start=e,d.value.end=t}t("change",[null==(a=d.value.start)?void 0:a.toString(),null==(n=d.value.end)?void 0:n.toString()]),s.value=!1}else d.value.start=e;var a,n},b=e=>!!(d.value.start&&d.value.end&&e>=d.value.start&&e<=d.value.end),f=e=>{if(d.value.start&&!d.value.end&&i.value){let t=d.value.start,a=i.value;if(i.value<d.value.start&&(a=d.value.start,t=i.value),e>=t&&e<=a)return!0}return!1},w=e=>d.value.start===e||d.value.end===e,y=e=>e===(new Date).getFullYear(),C=e=>{i.value=e},I=()=>{i.value=null};return{ns:a,visible:s,renderSelect:()=>{var e,t;return n("div",{class:a.e("date-panel")},[n("div",{class:a.em("date-panel","left")},[n("div",{class:a.em("date-panel","left-header")},[m("left"),n("span",null,[null==(e=l.value)?void 0:e.join("-")]),v("left")]),n("div",{class:a.em("date-panel","left-content")},[u.value.map(e=>n("div",{class:[a.em("date-panel","left-item"),a.is("selected",w(e)),a.is("include",b(e)),a.is("hover",i.value===e),a.is("curyear",y(e)),a.is("hoverinclude",f(e))],onClick:()=>g(e),onMouseenter:()=>C(e),onMouseleave:()=>I()},[e]))])]),n("div",{class:a.em("date-panel","right")},[n("div",{class:a.em("date-panel","right-header")},[m("right"),n("span",null,[null==(t=r.value)?void 0:t.join("-")]),v("right")]),n("div",{class:a.em("date-panel","right-content")},[h.value.map(e=>n("div",{class:[a.em("date-panel","right-item"),a.is("selected",w(e)),a.is("include",b(e)),a.is("hover",i.value===e),a.is("curyear",y(e)),a.is("hoverinclude",f(e))],onClick:()=>g(e),onMouseenter:()=>C(e),onMouseleave:()=>I()},[e]))])])])},handleClose:()=>{s.value=!0},handleOpen:()=>{s.value=!0},visibleChange:e=>{s.value=e,t("visibleChange",e)}}},render(){return n("div",{class:this.ns.b()},[n(i("el-popover"),{visible:this.visible,"onUpdate:visible":e=>this.visible=e,trigger:"click",width:600,placement:"top",onAfterEnter:()=>this.visibleChange(!0),onAfterLeave:()=>this.visibleChange(!1)},{default:()=>this.renderSelect(),reference:()=>n("div",null,null)})])}});e("c","undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{});function LM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(e){e.exports=function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),n={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,t){return"W"===t?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,t){var a=100*e+t;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return a.default.locale(n,null,!0),n}(as)}({exports:{}});const RM=a({name:"IBizDateRangeSelect",components:{"bi-quarter-range-select":NM,"bi-year-range-select":BM,"bi-week-range-select":a({props:{value:{type:Array,default:()=>[]}},emits:["change","visibleChange"],setup(e,{emit:t}){const a=B("bi-week-range"),n=o(),i=o(),s=o(!1),l=as(new Date).format("YYYY/MM/DD"),r=o(),d=o();let u=!1;const h=o(),p=()=>{r.value=null,d.value=null};c(()=>e.value,e=>{e&&Array.isArray(e)?(r.value=new Date(e[0]),d.value=new Date(e[1])):p()},{immediate:!0,deep:!0});const m=e=>{const t=e.getDay();let a=t;0===t&&(a=7);const n=e.getTime()+24*(7-a)*60*60*1e3,i=new Date(n);return i.setHours(23,59,59,0),i},v=e=>{const t=e.getDay();let a=t;0===t&&(a=7);const n=e.getTime()-24*(a-1)*60*60*1e3,i=new Date(n);return i.setHours(0,0,0,0),i},g=e=>{const{date:t}=e;if(h.value){const e=v(h.value),a=m(h.value),n=t.getTime();if(e.getTime()<=n&&a.getTime()>=n)return!0}return!1};return{ns:a,curValue:n,weekRangeRef:i,isInRange:e=>{const{date:t}=e,a=t.getTime();if(r.value&&d.value){const e=r.value.getTime(),t=d.value.getTime();if(a>=e&&a<=t)return!0}return!1},isInHoverRange:e=>{var t;const{date:a}=e,n=a.getTime();if(r.value&&!d.value&&h.value){const a=null==(t=h.value)?void 0:t.getTime();let i=r.value,o=h.value;a<r.value.getTime()&&(o=r.value,i=h.value);const s=i.getTime(),l=o.getTime();return n>=s&&n<=l||g(e)}return!1},isEnded:e=>{const{date:t}=e;if(d.value){const e=m(d.value),a=v(d.value);return t.getTime()>=a.getTime()&&t.getTime()<=e.getTime()}},isStarted:e=>{const{date:t}=e;if(r.value){const e=m(r.value),a=v(r.value);return t.getTime()>=a.getTime()&&t.getTime()<=e.getTime()}},isToday:e=>e.dayjs.format("YYYY/MM/DD")===l,weekRangeClick:()=>{s.value?i.value.handleClose():i.value.handleOpen()},cellClick:e=>{const{date:t}=e;if(u){const e=m(t),a=v(t);a.getTime()>r.value.getTime()?d.value=e:(d.value=m(r.value),r.value=a),u=!1}else p(),r.value=v(t),u=!0},visibleChange:e=>{s.value=e,t("visibleChange",e)},handleChange:()=>{if(r.value&&d.value){const e=r.value.toLocaleDateString(),a=d.value.toLocaleDateString();t("change",[e,a])}},handleClose:()=>{i.value.handleClose()},handleOpen:()=>{i.value.handleOpen()},isHover:g,isMonday:e=>{const{date:t}=e;return 1===t.getDay()},isSunday:e=>{const{date:t}=e;return 0===t.getDay()},onMouseHover:e=>{const{date:t}=e;h.value=t},onMouseleave:()=>{h.value=null}}},render(){return n("div",{class:this.ns.b(),onClick:this.weekRangeClick},[n(i("el-date-picker"),{ref:"weekRangeRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,"popper-class":this.ns.b("picker-pop"),type:"daterange",onChange:this.handleChange,onVisibleChange:this.visibleChange},{default:e=>n("div",{class:[this.ns.e("cell-item"),this.ns.is("inrange",this.isInRange(e)&&!this.isEnded(e)&&!this.isStarted(e)),this.ns.is("inhoverrange",this.isInHoverRange(e)&&!this.isEnded(e)&&!this.isStarted(e)),this.ns.is("hover",this.isHover(e)&&!this.isEnded(e)&&!this.isStarted(e)),this.ns.is("left",0===e.column),this.ns.is("right",6===e.column),this.ns.is("ended",this.isEnded(e)),this.ns.is("started",this.isStarted(e)),this.ns.is("monday",this.isMonday(e)),this.ns.is("sunday",this.isSunday(e))],onMouseenter:()=>this.onMouseHover(e),onMouseleave:()=>this.onMouseleave(),onClick:()=>this.cellClick(e)},[n("span",{class:[this.ns.em("cell-item","text"),this.ns.is("today",this.isToday(e))]},[e.text])])})])}})},props:mt(),emits:pt(),setup(e,{emit:t}){const a=B("date-range-select"),l=e.controller,r=o(l.defaultUnit),u=o(),h=o("DYNAMIC"),p=o({DYNAMIC:null,STATIC:null}),v=o({ALL:!1,STATIC:!1,DYNAMIC:!1}),g=o(),b=o(!1),f=[{value:"DAY",label:ibiz.i18n.t("editor.dateRangeSelect.day")},{value:"WEEK",label:ibiz.i18n.t("editor.dateRangeSelect.week")},{value:"MONTH",label:ibiz.i18n.t("editor.dateRangeSelect.month")},{value:"QUARTER",label:ibiz.i18n.t("editor.dateRangeSelect.quarter")},{value:"YEAR",label:ibiz.i18n.t("editor.dateRangeSelect.year")}],w=[{caption:ibiz.i18n.t("editor.dateRangeSelect.static"),type:"STATIC"},{caption:ibiz.i18n.t("editor.dateRangeSelect.dynamic"),type:"DYNAMIC"}],y=(e,t,a,n)=>{g.value=l.handleTimeToText(e,r.value,t,a,n)},C=()=>{u.value=l.initDefaultDate(r.value);const{start:a,end:n,emitStart:i,emitEnd:o}=e.controller.computedDateTypesTime(r.value,"DYNAMIC",u.value[0],u.value[1]);y("DYNAMIC",u.value,a,n),t("change",{unit:r.value,type:"DYNAMIC",start:i,end:o})},I=()=>{C()},x=(a,n)=>{v.value[a]=!1,v.value.ALL=!1,u.value=n;const{start:i,end:o,emitStart:s,emitEnd:l}=e.controller.computedDateTypesTime(r.value,a,n[0],n[1]);y(a,n,i,o),t("change",{start:s,end:l,unit:r.value,type:h.value})},S=(t,a)=>{var n;a||(v.value[t]=!1,v.value.STATIC||v.value.DYNAMIC||b.value?(b.value=!1,(null==(n=e.value)?void 0:n.type)&&h.value!==e.value.type&&(v.value.ALL=!1,x(h.value,u.value))):v.value.ALL=!1)},E=e=>{e.stopPropagation(),e.preventDefault(),v.value.ALL=!v.value.ALL},D=(e,t)=>{p.value[e]=t},P=e=>{if("QUARTER"===r.value)return n(i("bi-quarter-range-select"),{ref:t=>D(e,t),class:[a.em("date-type","editor"),a.em("date-type","quarter")],value:u.value,onVisibleChange:t=>S(e,t),onChange:t=>x(e,t)},null);if("YEAR"===r.value)return n(i("bi-year-range-select"),{ref:t=>D(e,t),class:[a.em("date-type","editor"),a.em("date-type","year")],value:u.value,onVisibleChange:t=>S(e,t),onChange:t=>x(e,t)},null);if("WEEK"===r.value)return n(i("bi-week-range-select"),{ref:t=>D(e,t),class:[a.em("date-type","editor"),a.em("date-type","week")],value:u.value,onChange:t=>x(e,t),onVisibleChange:t=>S(e,t)},null);const t="DAY"===r.value?"daterange":"monthrange",o="DAY"===r.value?"YYYY-MM-DD":"YYYY-MM";return n(i("el-date-picker"),{ref:t=>D(e,t),modelValue:u.value,"onUpdate:modelValue":e=>u.value=e,class:a.em("date-type","editor"),type:t,format:"YYYY-MM-DD","value-format":o,onVisibleChange:t=>S(e,t),onChange:t=>x(e,t)},null)},k=()=>{v.value.DYNAMIC||v.value.STATIC||(v.value.ALL=!1)};return c(()=>e.value,t=>{if(t&&Object.keys(t).length>0){const{start:a,end:n,unit:i,type:o}=t;if(r.value=i,h.value=o,"TIME"===e.controller.emitMode){u.value="YEAR"===i?[new Date(String(a)).getFullYear(),new Date(String(n)).getFullYear()]:[as(a).format("YYYY-MM-DD"),as(n).format("YYYY-MM-DD")];const{start:t,end:s}=e.controller.computedDateTypesTime(r.value,o,a,n);y(h.value,u.value,t,s)}else u.value=l.computedDynamicTimeToDate(r.value,h.value,a,n),y(h.value,u.value,a,n)}else C()},{immediate:!0}),d(()=>{window.addEventListener("click",k)}),m(()=>{window.removeEventListener("click",k)}),{ns:a,c:l,renderDateUnit:()=>{let e;return n("div",{class:a.e("date-unit")},[n("span",{class:a.em("date-unit","label")},[ibiz.i18n.t("editor.dateRangeSelect.dateUnit")]),n("div",{class:a.em("date-unit","editor")},[n(i("el-select"),{modelValue:r.value,"onUpdate:modelValue":e=>r.value=e,class:a.em("date-unit","editor-select"),onChange:I},(t=e=f.map(e=>n(i("el-option"),{key:e.value,value:e.value,label:e.label},{default:()=>e.label})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))])]);var t},renderDateRange:()=>n("div",{class:a.e("date-range")},[n("div",{class:a.em("date-range","label")},[ibiz.i18n.t("editor.dateRangeSelect.daterange")]),n(i("el-popover"),{visible:v.value.ALL||v.value.DYNAMIC||v.value.STATIC,trigger:"click",width:"240px","popper-class":a.b("date-range-select")},{reference:()=>n("div",{class:a.em("date-range","editor"),onClick:E},[n("span",{class:a.em("select","time-caption")},[n("div",{class:a.e("select-value")},[g.value])]),n("i",{class:"fa fa-angle-down","aria-hidden":"true"},null)]),default:()=>n("div",{class:a.e("date-type")},[w.map(t=>n("div",{class:a.em("date-type","item"),onClick:a=>((t,a)=>{if(a.stopPropagation(),a.preventDefault(),v.value.STATIC||v.value.DYNAMIC?(v.value[h.value]=!1,b.value=!0,p.value[t].handleClose()):(b.value=!0,h.value=t,v.value[t]=!0,p.value[t].handleOpen()),u.value&&Array.isArray(u.value)&&u.value.length>0){const{start:t,end:a}=e.controller.computedDateTypesTime(r.value,h.value,u.value[0],u.value[1]);y(h.value,u.value,t,a)}})(t.type,a)},[n("span",{class:a.em("date-type","item-caption")},[t.caption]),n("span",{class:a.em("date-type","item-icon")},[t.type===h.value&&n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false"},[n("g",{id:"agctips/check","stroke-width":"1","fill-rule":"evenodd"},[n("path",{id:"agc路径-12",d:"M6.012 11.201L1.313 6.832l-.817.879 5.54 5.15 9.304-9.163-.842-.855z"},null)])]),n("i",{class:"fa fa-angle-right","aria-hidden":"true"},null)]),P(t.type)]))])})]),onOpen:E}},render(){return n("div",{class:this.ns.b(),onClick:this.onOpen},[this.c.switchUnit&&this.renderDateUnit(),this.renderDateRange()])}});var _M=Object.defineProperty,jM=(e,t,a)=>(((e,t,a)=>{t in e?_M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class VM extends qi{constructor(){super(...arguments),jM(this,"switchUnit",!0),jM(this,"defaultUnit","DAY"),jM(this,"emitMode","DEFAULT"),jM(this,"initDefaultDate",e=>{const t=new Date((new Date).toLocaleDateString());if("DAY"===e){const e=new Date(t.getTime()-6048e5),a=t.toLocaleDateString().replaceAll("/","-");return[as(e).format("YYYY-MM-DD"),as(a).format("YYYY-MM-DD")]}if("WEEK"===e){const e=t.getDay();let a=e;0===e&&(a=7);const n=t.getTime()+24*(7-a)*60*60*1e3,i=new Date(n).toLocaleDateString().replaceAll("/","-"),o=t.getTime()-36288e5;return[new Date(o).toLocaleDateString().replaceAll("/","-"),i]}if("MONTH"===e){const e=t.getFullYear(),a=t.getMonth()+1;let n=e,i=a-6;i<1&&(i+=12,n-=1);let o="".concat(i),s="".concat(a);return i<10&&(o="0".concat(o)),a<10&&(s="0".concat(a)),["".concat(n,"-").concat(o),"".concat(e,"-").concat(s)]}if("QUARTER"===e){const e=t.getFullYear();return["".concat(e,"-1"),"".concat(e,"-12")]}if("YEAR"===e)return[t.getFullYear(),t.getFullYear()]}),jM(this,"handleTimeToText",(e,t,a,n,i)=>{if(!a||Array.isArray(a)&&!a.length)return"";const o=new Date(a[0]),s=new Date(a[1]),l=o.getFullYear(),r=s.getFullYear(),c=o.getMonth()+1,d=s.getMonth()+1,u=this.getYearWeek(o),h=this.getYearWeek(s);let p=a.join("~"),m="";if("DAY"===t&&(p=a.join("~")),"WEEK"===t){const e="".concat(l,"-").concat(u).concat(ibiz.i18n.t("editor.dateRangeSelect.week")),t="".concat(r,"-").concat(h).concat(ibiz.i18n.t("editor.dateRangeSelect.week"));p="".concat(e,"~").concat(t)}if("MONTH"===t){let e=c,t=d;c<10&&(e="0".concat(c)),d<10&&(t="0".concat(d)),p="".concat(l,"-").concat(e," ~ ").concat(r,"-").concat(t)}if("QUARTER"===t){const e=Math.ceil(c/3),t=Math.ceil(d/3);p="".concat(l,"-Q").concat(e," ~ ").concat(r,"-Q").concat(t)}return"YEAR"===t&&(p="".concat(a[0]," ~ ").concat(a[1])),m="STATIC"===e?ibiz.i18n.t("editor.dateRangeSelect.static"):"DAY"===t?this.computedTextOfDay(n,i):"WEEK"===t?this.computedTextOfWeek(n,i):"MONTH"===t?this.computedTextOfMonth(n,i):"QUARTER"===t?this.computedTextOfQuarter(n,i,l,r,c,d):"YEAR"===t?this.computedTextOfYear(n,i):this.computedTextOfDay(n,i),"".concat(m," | ").concat(p)})}async init(){await super.onInit(),this.editorParams&&(this.editorParams.switchUnit&&(this.switchUnit="true"===this.editorParams.switchUnit),this.editorParams.switchunit&&(this.switchUnit="true"===this.editorParams.switchunit),this.editorParams.defaultUnit&&(this.defaultUnit=this.editorParams.defaultUnit),this.editorParams.defaultunit&&(this.defaultUnit=this.editorParams.defaultunit),this.editorParams.emitMode&&(this.emitMode=this.editorParams.emitMode),this.editorParams.emitmode&&(this.emitMode=this.editorParams.emitmode))}computedDynamicTimeToDate(e,t,a,n){if("STATIC"===t){const t=new Date(1e3*a),i=new Date(1e3*n);return"YEAR"===e?[t.getFullYear(),i.getFullYear()]:[as(t).format("YYYY-MM-DD"),as(i).format("YYYY-MM-DD")]}const i=new Date;if(i.setHours(0,0,0,0),"WEEK"===e){return[this.timeSpanConvertToWeek(i,a),this.timeSpanConvertToWeek(i,n)]}if("MONTH"===e){return[this.timeSpanConvertToMonth(i,a),this.timeSpanConvertToMonth(i,n)]}if("QUARTER"===e){return[this.timeSpanConvertToQuarter(i,a),this.timeSpanConvertToQuarter(i,n)]}if("YEAR"===e){return[i.getFullYear()+a,i.getFullYear()+n]}const o=24*a*60*60*1e3,s=24*n*60*60*1e3,l=new Date(i.getTime()+o),r=new Date(i.getTime()+s);return[as(l).format("YYYY-MM-DD"),as(r).format("YYYY-MM-DD")]}timeSpanConvertToQuarter(e,t){const a=t%4;let n=Math.floor(Math.abs(t)/4);t<0&&(n=-n);let i=e.getFullYear()+n;const o=e.getMonth()+1;let s=Math.ceil(o/3)+a;return s<0&&(i-=1,s+=4),s>4&&(i+=1,s-=4),"".concat(i,"-").concat(3*s)}timeSpanConvertToWeek(e,t){const a=e.getTime();return new Date(a+7*t*24*60*60*1e3).toLocaleDateString()}timeSpanConvertToMonth(e,t){const a=t%12;let n=Math.floor(Math.abs(t)/12);t<0&&(n=-n);let i=e.getFullYear()+n,o=e.getMonth()+1+a;return o<0&&(i-=1,o+=12),o>12&&(i+=1,o-=12),o<10?"".concat(i,"-0").concat(o):"".concat(i,"-").concat(o)}computedDateTypesTime(e,t,a,n){const i={start:0,end:0,emitStart:0,emitEnd:0};if("STATIC"===t){const{start:t,end:o}=this.computedStaticTime(e,a,n);Object.assign(i,{start:t,end:o,emitStart:t,emitEnd:o})}else{const{start:t,end:o}=this.computedDynamicTime(e,a,n);Object.assign(i,{start:t,end:o,emitStart:t,emitEnd:o})}if("TIME"===this.emitMode){const t=this.computedFullDateFormat(a,e,"START"),o=this.computedFullDateFormat(n,e,"END");Object.assign(i,{emitStart:t,emitEnd:o})}return i}computedFullDateFormat(e,t,a){const n=new Date(String(e)),i=n.getMonth()+1,o=[1,3,5,7,8,10,12];return"START"===a?n.setHours(0,0,0,0):n.setHours(23,59,59,0),"MONTH"===t&&("START"===a?n.setDate(1):2===i?n.setDate(29):o.includes(i)?n.setDate(31):n.setDate(30)),"QUARTER"===t&&("START"===a?n.setDate(1):2===i?n.setDate(29):o.includes(i)?n.setDate(31):n.setDate(30)),"YEAR"===t&&("START"===a?(n.setMonth(0),n.setDate(1)):(n.setMonth(11),n.setDate(31))),n.toLocaleString()}computedDynamicTime(e,t,a){switch(e){case"DAY":default:return this.computedDaysSpace(t,a);case"WEEK":return this.computedWeeksSpace(t,a);case"MONTH":return this.computedMonthsSpace(t,a);case"QUARTER":return this.computedQuartersSpace(t,a);case"YEAR":return this.computedYearsSpace(t,a)}}computedDaysSpace(e,t){const a=new Date,n=new Date(e),i=new Date(t);a.setHours(0,0,0,0),n.setHours(0,0,0,0),i.setHours(0,0,0,0);return{start:(n.getTime()-a.getTime())/864e5,end:(i.getTime()-a.getTime())/864e5}}computedWeeksSpace(e,t){const a=new Date,n=new Date(e),i=new Date(t);a.setHours(0,0,0,0),n.setHours(0,0,0,0),i.setHours(0,0,0,0);const o=(e,t)=>{const a=this.getDateWeekMonday(e);return(this.getDateWeekMonday(t).getTime()-a.getTime())/6048e5};return{start:o(a,n),end:o(a,i)}}getDateWeekMonday(e){const t=e.getDay();let a=t;0===t&&(a=7);const n=e.getTime()-24*(a-1)*60*60*1e3;return new Date(n)}getYearWeek(e){const t=new Date(e.getFullYear(),0,1);let a=e.getDay();0===a&&(a=7);let n=t.getDay();0===n&&(n=7);const i=e.getTime()-t.getTime(),o=Math.floor((i+864e5*(n-a))/864e5);return Math.ceil(o/7)+1}computedMonthsSpace(e,t){const a=new Date,n=new Date(e),i=new Date(t),o=(e,t)=>{const a=e.getFullYear(),n=e.getMonth()+1;return 12*(t.getFullYear()-a)-n+(t.getMonth()+1)};return{start:o(a,n),end:o(a,i)}}computedQuartersSpace(e,t){const a=new Date,n=new Date(e),i=new Date(t),o=(e,t)=>{const a=e.getFullYear(),n=e.getMonth()+1,i=Math.ceil(n/3),o=t.getFullYear(),s=t.getMonth()+1;return 4*(o-a)-i+Math.ceil(s/3)};return{start:o(a,n),end:o(a,i)}}computedYearsSpace(e,t){const a=(new Date).getFullYear();return{start:new Date("".concat(e)).getFullYear()-a,end:new Date("".concat(t)).getFullYear()-a}}computedStaticTime(e,t,a){switch(e){case"DAY":default:return this.computedDaysTime(t,a);case"WEEK":return this.computedWeeksTime(t,a);case"MONTH":return this.computedMonthsTime(t,a);case"QUARTER":return this.computedQuartersTime(t,a);case"YEAR":return this.computedYearsTime(t,a)}}computedDaysTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedWeeksTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedMonthsTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),[1,3,5,7,8,10,12].includes(n.getMonth()+1)?n.setDate(31):1===n.getMonth()?n.setDate(29):n.setDate(30),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedQuartersTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedYearsTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),n.setMonth(11),n.setDate(31),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedTextOfDay(e,t){let a="";if(e===t&&0===e)a=ibiz.i18n.t("editor.dateRangeSelect.today");else if(0===t&&e<0)a="".concat(ibiz.i18n.t("editor.dateRangeSelect.recently")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.day"));else{const n="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.day")),i="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.day"));a="".concat(n," ~ ").concat(i)}return a}computedTextOfWeek(e,t){let a="";if(e===t&&0===e)a=ibiz.i18n.t("editor.dateRangeSelect.currentWeek");else if(0===t&&e<0)a="".concat(ibiz.i18n.t("editor.dateRangeSelect.recently")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.week"));else{const n="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.week")),i="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.week"));a="".concat(n," ~ ").concat(i)}return a}computedTextOfMonth(e,t){let a="";if(e===t&&0===e)a=ibiz.i18n.t("editor.dateRangeSelect.pastTime");else if(0===t&&e<0)a="".concat(ibiz.i18n.t("editor.dateRangeSelect.recently")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.month"));else{const n="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.month")),i="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.month"));a="".concat(n," ~ ").concat(i)}return a}computedTextOfQuarter(e,t,a,n,i,o){let s="";const l=(new Date).getFullYear(),r=Math.ceil(i/3),c=Math.ceil(o/3);if(a===n&&1===r&&4===c)s=ibiz.i18n.t("editor.dateRangeSelect.currentYear");else if(e===t&&0===e)s=ibiz.i18n.t("editor.dateRangeSelect.currentYear");else if(0===t&&e<0&&l===a)s="".concat(ibiz.i18n.t("editor.dateRangeSelect.currentYear")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.quarter"));else{const a="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.quarter")),n="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.quarter"));s="".concat(a," ~ ").concat(n)}return s}computedTextOfYear(e,t){let a="";if(e===t&&0===e)a=ibiz.i18n.t("editor.dateRangeSelect.currentYear");else if(0===t&&e<0)a="".concat(ibiz.i18n.t("editor.dateRangeSelect.recently")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.year"));else{const n="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.year")),i="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.year"));a="".concat(n," ~ ").concat(i)}return a}}var FM=Object.defineProperty,UM=(e,t,a)=>(((e,t,a)=>{t in e?FM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class HM{constructor(){UM(this,"formEditor","IBizDateRangeSelect"),UM(this,"gridEditor","IBizDateRangeSelect")}async createController(e,t){const a=new VM(e,t);return await a.init(),a}}var qM={exports:{}};!function(e){e.exports=function(){function e(e,t,a,n){function i(e){return e instanceof a?e:new a(function(t){t(e)})}return new(a||(a=Promise))(function(t,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){e.done?t(e.value):i(e.value).then(o,s)}l((n=n.apply(e,[])).next())})}function t(e,t){function a(e){return function(t){return n([e,t])}}function n(a){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,o&&(s=2&a[0]?o.return:a[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,a[1])).done)return s;switch(o=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!((s=0<(s=r.trys).length&&s[s.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3]))r.label=a[1];else if(6===a[0]&&r.label<s[1])r.label=s[1],s=a;else{if(!(s&&r.label<s[2])){s[2]&&r.ops.pop(),r.trys.pop();continue}r.label=s[2],r.ops.push(a)}}a=t.call(e,r)}catch(e){a=[6,e],o=0}finally{i=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var i,o,s,l,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l}function a(e){var t=[];return e.AMapUI&&t.push(n(e.AMapUI)),e.Loca&&t.push(i(e.Loca)),Promise.all(t)}function n(e){return new Promise(function(t,a){var n=[];if(e.plugins)for(var i=0;i<e.plugins.length;i+=1)-1==l.AMapUI.plugins.indexOf(e.plugins[i])&&n.push(e.plugins[i]);if(r.AMapUI===o.failed)a("前次请求 AMapUI 失败");else if(r.AMapUI===o.notload){r.AMapUI=o.loading,l.AMapUI.version=e.version||l.AMapUI.version,i=l.AMapUI.version;var s=document.body||document.head,d=document.createElement("script");d.type="text/javascript",d.src="https://webapi.amap.com/ui/"+i+"/main.js",d.onerror=function(e){r.AMapUI=o.failed,a("请求 AMapUI 失败")},d.onload=function(){if(r.AMapUI=o.loaded,n.length)window.AMapUI.loadUI(n,function(){for(var e=0,a=n.length;e<a;e++){var i=n[e].split("/").slice(-1)[0];window.AMapUI[i]=arguments[e]}for(t();c.AMapUI.length;)c.AMapUI.splice(0,1)[0]()});else for(t();c.AMapUI.length;)c.AMapUI.splice(0,1)[0]()},s.appendChild(d)}else r.AMapUI===o.loaded?e.version&&e.version!==l.AMapUI.version?a("不允许多个版本 AMapUI 混用"):n.length?window.AMapUI.loadUI(n,function(){for(var e=0,a=n.length;e<a;e++){var i=n[e].split("/").slice(-1)[0];window.AMapUI[i]=arguments[e]}t()}):t():e.version&&e.version!==l.AMapUI.version?a("不允许多个版本 AMapUI 混用"):c.AMapUI.push(function(e){e?a(e):n.length?window.AMapUI.loadUI(n,function(){for(var e=0,a=n.length;e<a;e++){var i=n[e].split("/").slice(-1)[0];window.AMapUI[i]=arguments[e]}t()}):t()})})}function i(e){return new Promise(function(t,a){if(r.Loca===o.failed)a("前次请求 Loca 失败");else if(r.Loca===o.notload){r.Loca=o.loading,l.Loca.version=e.version||l.Loca.version;var n=l.Loca.version,i=l.AMap.version.startsWith("2"),s=n.startsWith("2");if(i&&!s||!i&&s)a("JSAPI 与 Loca 版本不对应!!");else{i=l.key,s=document.body||document.head;var d=document.createElement("script");d.type="text/javascript",d.src="https://webapi.amap.com/loca?v="+n+"&key="+i,d.onerror=function(e){r.Loca=o.failed,a("请求 AMapUI 失败")},d.onload=function(){for(r.Loca=o.loaded,t();c.Loca.length;)c.Loca.splice(0,1)[0]()},s.appendChild(d)}}else r.Loca===o.loaded?e.version&&e.version!==l.Loca.version?a("不允许多个版本 Loca 混用"):t():e.version&&e.version!==l.Loca.version?a("不允许多个版本 Loca 混用"):c.Loca.push(function(e){e?a(e):a()})})}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var o,s;(s=o||(o={})).notload="notload",s.loading="loading",s.loaded="loaded",s.failed="failed";var l={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},r={AMap:o.notload,AMapUI:o.notload,Loca:o.notload},c={AMapUI:[],Loca:[]},d=[],u=function(e){"function"==typeof e&&(r.AMap===o.loaded?e(window.AMap):d.push(e))};return{load:function(n){var i=this;return new Promise(function(s,c){if(r.AMap==o.failed)c("");else if(r.AMap==o.notload){var h=n.key,p=n.version,m=n.plugins;if(h){window.AMap&&"lbs.amap.com"!==location.host&&c("禁止多种API加载方式混用"),l.key=h,l.AMap.version=p||l.AMap.version,l.AMap.plugins=m||l.AMap.plugins,r.AMap=o.loading;var v=document.body||document.head;window.___onAPILoaded=function(e){if(delete window.___onAPILoaded,e)r.AMap=o.failed,c(e);else for(r.AMap=o.loaded,a(n).then(function(){s(window.AMap)}).catch(c);d.length;)d.splice(0,1)[0]()};var g=document.createElement("script");g.type="text/javascript",h="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+l.AMap.version+"&key="+h+"&plugin="+l.AMap.plugins.join(","),fetch(h).then(function(a){return e(i,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return[4,a.text()];case 1:return e=t.sent(),g.textContent=e.replace("define.amd","undefined"),v.appendChild(g),[2]}})})}).catch(function(e){r.AMap=o.failed,c(e)})}else c("请填写key")}else if(r.AMap==o.loaded)if(n.key&&n.key!==l.key)c("多个不一致的 key");else if(n.version&&n.version!==l.AMap.version)c("不允许多个版本 JSAPI 混用");else{if(h=[],n.plugins)for(p=0;p<n.plugins.length;p+=1)-1==l.AMap.plugins.indexOf(n.plugins[p])&&h.push(n.plugins[p]);h.length?window.AMap.plugin(h,function(){a(n).then(function(){s(window.AMap)}).catch(c)}):a(n).then(function(){s(window.AMap)}).catch(c)}else if(n.key&&n.key!==l.key)c("多个不一致的 key");else if(n.version&&n.version!==l.AMap.version)c("不允许多个版本 JSAPI 混用");else{var b=[];if(n.plugins)for(p=0;p<n.plugins.length;p+=1)-1==l.AMap.plugins.indexOf(n.plugins[p])&&b.push(n.plugins[p]);u(function(){b.length?window.AMap.plugin(b,function(){a(n).then(function(){s(window.AMap)}).catch(c)}):a(n).then(function(){s(window.AMap)}).catch(c)})}})},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,l={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},r={AMap:o.notload,AMapUI:o.notload,Loca:o.notload},c={AMap:[],AMapUI:[],Loca:[]}}}}()}(qM);var GM=LM(qM.exports);const WM=a({name:"IBizMapPicker",props:vt(),emits:Ve(),setup(e,{emit:t}){var a;const n=B("map-picker"),i=e.controller,s=null==(a=i.model.editorItems)?void 0:a[0],l=o(),c=o(),d=o(),u=o(),p=o(!1),m=o(!1),v=o(""),b=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));let f,w,y;const C={address:"",longitude:null,latitude:null},I=()=>{w&&(w.setMap(null),w=void 0)},x=(e,t)=>{const a=window.AMap;a&&(I(),w=new a.Marker({position:[e,t]}))},S=(e,t)=>{const a=window.AMap;if(!a)return;if(!w)return;const i=new a.Geocoder({}),o=w;i.getAddress([e,t],(a,i)=>{if(w&&w===o&&"complete"===a&&"OK"===i.info&&i.regeocode){const a=i.regeocode.formattedAddress,o=document.createElement("div"),s=document.createElement("img");s.style.width="25px",s.src="//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",o.appendChild(s);const l=document.createElement("span");l.className=n.b("dialog-map-marker-text"),l.textContent=a,o.appendChild(l),w.setContent(o),w.setMap(f),C.address=a,C.longitude=e,C.latitude=t,v.value=a}})};return h(()=>{null==f||f.destroy()}),{ns:n,c:i,inputRef:l,searchInputRef:c,mapContainerRef:d,searchResultContainerRef:u,dialogVisible:p,isLoading:m,searchValue:v,showFormDefaultContent:b,handleShow:()=>{var t;p.value=!0,null==(t=l.value)||t.blur(),g(async()=>{var t;if(window.AMap||await(async()=>{try{m.value=!0,window._AMapSecurityConfig={securityJsCode:ibiz.env.aMapSecurityJsCode},await GM.load({key:ibiz.env.aMapKey,version:"2.0",plugins:["AMap.PlaceSearch","AMap.Geocoder"],AMapUI:{version:"1.1",plugins:["misc/PoiPicker"]}})}finally{m.value=!1}})(),f&&(null==(t=d.value)?void 0:t.children.length)||(null==f||f.destroy(),(()=>{const e=window.AMap;if(!e)return;if(!d.value)return;f=new e.Map(d.value,{viewMode:"3D",zoom:11}),null==f||f.on("click",e=>{const t=e.lnglat,a=t.lng,n=t.lat;null!=a&&null!=n&&(x(a,n),S(a,n))});const t=window.AMapUI;t&&c.value&&u.value&&t.loadUI(["misc/PoiPicker"],function(e){c.value&&u.value&&e&&(y=new e({input:c.value,placeSearchOptions:{map:f},searchResultsContainer:u.value}),null==y||y.on("poiPicked",function(e){var t,a;I();const n=e.item;n&&(C.address=n.name,C.longitude=null==(t=n.location)?void 0:t.lng,C.latitude=null==(a=n.location)?void 0:a.lat,v.value=n.name,"search"!==e.source&&(null==y||y.searchByKeyword(n.name)))}))})})()),v.value=e.value||"",s&&s.id){const[t,a]=s.id.split(",");if(e.data){const n=e.data[t],i=e.data[a];n&&i&&(null==f||f.setCenter([n,i],!0),x(n,i),S(n,i))}}})},handleConfirm:()=>{if(p.value=!1,s&&s.id){const[e,a]=s.id.split(",");e&&t("change",null!=C.longitude?C.longitude:null,e),a&&t("change",null!=C.latitude?C.latitude:null,a)}t("change",C.address||"")},handleClose:()=>{y&&(y.clearSuggest(),y.clearSearchResults()),v.value="",C.address="",C.longitude=null,C.latitude=null,I()},handleClear:()=>{if(s&&s.id){const[e,a]=s.id.split(",");e&&t("change",null,e),a&&t("change",null,a)}t("change","")},handleSearchClear:()=>{v.value="",C.address="",C.longitude=null,C.latitude=null,I()}}},render(){const e=n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[n("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"},null),n("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"},null)]);let t;t=this.readonly?this.value:[n(i("el-input"),{class:this.ns.b("input"),ref:"inputRef","model-value":this.value,placeholder:this.c.placeHolder,disabled:this.disabled,onFocus:this.handleShow},{suffix:()=>{if(this.value&&!this.disabled)return n("i",{class:"el-icon el-input__icon el-input__clear",onClick:e=>{e.stopPropagation(),this.handleClear()}},[e])}}),n(i("el-dialog"),{class:this.ns.b("dialog"),modelValue:this.dialogVisible,"onUpdate:modelValue":e=>this.dialogVisible=e,title:ibiz.i18n.t("editor.mapPicker.title"),"append-to-body":!0,"align-center":!0,width:"80%",onClose:this.handleClose},{default:()=>n("div",{class:this.ns.b("dialog-content")},[n("div",{class:"el-input el-input--suffix ".concat(this.ns.b("dialog-search-input")," ").concat(this.isLoading?"is-disabled":"")},[n("div",{class:"el-input__wrapper",tabindex:"-1"},[b(n("input",{ref:"searchInputRef",class:"el-input__inner",type:"text",autocomplete:"off",tabindex:"0",placeholder:ibiz.i18n.t("editor.mapPicker.searchPlaceholder"),disabled:this.isLoading,"onUpdate:modelValue":e=>this.searchValue=e},null),[[f,this.searchValue]]),this.searchValue?n("span",{class:"el-input__suffix"},[n("span",{class:"el-input__suffix-inner"},[n("i",{class:"el-icon el-input__icon el-input__clear",onClick:e=>{e.stopPropagation(),this.handleSearchClear()}},[e])])]):null])]),b(n("div",{class:this.ns.b("dialog-map-content")},[n("div",{class:this.ns.b("dialog-map-container"),ref:"mapContainerRef"},null),n("div",{class:this.ns.b("dialog-search-result-container"),ref:"searchResultContainerRef"},null)]),[[C("loading"),this.isLoading]])]),footer:()=>{let e;return n("div",{class:this.ns.b("dialog-footer")},[n(i("el-button"),{type:"primary",disabled:this.isLoading,onClick:this.handleConfirm},(t=e=ibiz.i18n.t("editor.common.confirm"),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))]);var t}})];const a=n("div",{class:this.ns.b("form-default-content")},[this.value?this.value:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&a,t])}});class YM extends qi{}var KM=Object.defineProperty,XM=(e,t,a)=>(((e,t,a)=>{t in e?KM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class $M{constructor(){XM(this,"formEditor","IBizMapPicker"),XM(this,"gridEditor","IBizMapPicker")}async createController(e,t){const a=new YM(e,t);return await a.init(),a}}const JM=e("aV",{install:e=>{e.component(kA.name,kA),e.component(Nz.name,Nz),e.component(Bz.name,Bz),e.component(Lz.name,Lz),e.component(Hz.name,Hz),e.component(qz.name,qz),e.component(Gz.name,Gz),e.component(Wz.name,Wz),e.component(Zz.name,Zz),e.component(eT.name,eT),e.component(nT.name,nT),e.component(dT.name,dT),e.component(vT.name,vT),e.component(IT.name,IT),e.component(zT.name,zT),e.component(NT.name,NT),e.component(jT.name,jT),e.component(qT.name,qT),e.component(XT.name,XT),e.component($T.name,$T),e.component(tA.name,tA),e.component(lA.name,lA),e.component(bA.name,bA),e.component(EA.name,EA),e.component(PA.name,PA),e.component(DA.name,DA),e.component(BA.name,BA),e.component(LA.name,LA),e.component(RA.name,RA),e.component(_A.name,_A),e.component(jA.name,jA),e.component(VA.name,VA),e.component(aO.name,aO),e.component(cO.name,cO),e.component(mO.name,mO),e.component(CO.name,CO),e.component(aM.name,aM),e.component(lM.name,lM),e.component(mM.name,mM),e.component(CM.name,CM),e.component(MM.name,MM),e.component(IM.name,IM),e.component(WM.name,WM),e.component("IBizHtml",E(()=>t.import("./wang-editor-CA-ztFOO.js"))),e.component("IBizMarkDown",E(()=>t.import("./ibiz-markdown-editor-uRNoNVHw.js"))),e.component(RM.name,RM),e.component(tT.name,tT),Qi("SPAN",()=>new Uz),Qi("SPAN_ADDRESSPICKUP",()=>new Uz),Qi("SPAN_LINK",()=>new Uz("SPAN_LINK"));const a=new Qz;Qi("TEXTBOX",()=>a),Qi("TEXTAREA",()=>a),Qi("TEXTAREA_10",()=>a),Qi("PASSWORD",()=>a),Qi("NUMBER",()=>new Qz("NUMBER")),Qi("IPADDRESSTEXTBOX",()=>new Qz("IPADDRESSTEXTBOX")),Qi("MOBTEXT",()=>a),Qi("MOBNUMBER",()=>new Qz("NUMBER")),Qi("MOBTEXTAREA",()=>a),Qi("MOBPASSWORD",()=>a),Qi("TEXTBOX_SIGNATURE",()=>new Qz("SIGNATURE")),Qi("DROPDOWNLIST",()=>new cT),Qi("MOBDROPDOWNLIST",()=>new cT),Qi("MOBCHECKLIST",()=>new cT),Qi("DROPDOWNLIST_100",()=>new cT),Qi("MDROPDOWNLIST",()=>new cT),Qi("DROPDOWNLIST_EMOJI_PICKER",()=>new cT("EMOJI_PICKER")),Qi("MDROPDOWNLIST_TREE_PICKER",()=>new cT("TREE_PICKER")),Qi("DROPDOWNLIST_VIRTUALIZED_LIST",()=>new cT("VIRTUALIZED_LIST")),Qi("MDROPDOWNLIST_VIRTUALIZED_LIST",()=>new cT("VIRTUALIZED_LIST")),Qi("CHECKBOX",()=>new mT),Qi("CHECKBOXLIST",()=>new CT),Qi("RADIOBUTTONLIST",()=>new kT),Qi("MOBRADIOLIST",()=>new kT);const n=new MT;Qi("DATEPICKER",()=>n),Qi("DATEPICKEREX",()=>n),Qi("DATEPICKEREX_NOTIME",()=>n),Qi("DATEPICKEREX_HOUR",()=>n),Qi("DATEPICKEREX_MINUTE",()=>n),Qi("DATEPICKEREX_SECOND",()=>n),Qi("DATEPICKEREX_NODAY",()=>n),Qi("DATEPICKEREX_NODAY_NOSECOND",()=>n),Qi("MOBDATE",()=>n),Qi("MOBDATE_HOUR",()=>n),Qi("MOBDATE_MINUTE",()=>n),Qi("MOBDATE_NODAY",()=>n),Qi("MOBDATE_NODAY_NOSECOND",()=>n),Qi("MOBDATE_NOTIME",()=>n),Qi("MOBDATE_SECOND",()=>n),Qi("DATERANGE_SWITCHUNIT",()=>new HM),Qi("FILEUPLOADER",()=>new NA("FILEUPLOADER")),Qi("FILEUPLOADER_ONE",()=>new NA("FILEUPLOADER_ONE")),Qi("MOBSINGLEFILEUPLOAD",()=>new NA("MOBSINGLEFILEUPLOAD")),Qi("MOBMULTIFILEUPLOAD",()=>new NA("MOBMULTIFILEUPLOAD")),Qi("PICTURE",()=>new NA("PICTURE")),Qi("PICTURE_ONE",()=>new NA("PICTURE_ONE")),Qi("PICTURE_ONE_RAW",()=>new NA("PICTURE_ONE_RAW")),Qi("MOBPICTURE",()=>new NA("MOBPICTURE")),Qi("MOBPICTURE_RAW",()=>new NA("MOBPICTURE_RAW")),Qi("MOBPICTURELIST",()=>new NA("MOBPICTURELIST")),Qi("PICTURE_CROPPING",()=>new NA("PICTURE_CROPPING")),Qi("RAW",()=>new _T),Qi("STEPPER",()=>new HT),Qi("MOBSTEPPER",()=>new HT),Qi("RATING",()=>new KT),Qi("MOBRATING",()=>new KT),Qi("SLIDER",()=>new oA),Qi("MOBSLIDER",()=>new oA),Qi("SWITCH",()=>new eA),Qi("SWITCH_TRISTATE",()=>new eA("TRISTATE")),Qi("MOBSWITCH",()=>new eA),Qi("LISTBOX",()=>new gA),Qi("LISTBOXPICKUP",()=>new gA);const i=new xA;Qi("AC",()=>i),Qi("AC_FS",()=>i),Qi("AC_NOBUTTON",()=>i),Qi("AC_FS_NOBUTTON",()=>i),Qi("PICKER",()=>new rO("PICKER")),Qi("PICKER_TRANSFER_PICKER",()=>new rO("TRANSFER_PICKER")),Qi("PICKEREX_NOAC",()=>new rO("PICKEREX_NOAC")),Qi("PICKEREX_NOAC_LINK",()=>new rO("PICKEREX_NOAC_LINK")),Qi("PICKEREX_TRIGGER_LINK",()=>new rO("PICKEREX_TRIGGER_LINK")),Qi("PICKEREX_TRIGGER",()=>new rO("PICKEREX_TRIGGER")),Qi("PICKEREX_LINK",()=>new rO("PICKEREX_LINK")),Qi("ADDRESSPICKUP",()=>new rO("ADDRESSPICKUP")),Qi("ADDRESSPICKUP_AC",()=>new rO("ADDRESSPICKUP_AC")),Qi("PICKEREX_LINKONLY",()=>new rO("PICKEREX_LINKONLY")),Qi("PICKEREX_NOBUTTON",()=>new rO("PICKEREX_NOBUTTON")),Qi("PICKEREX_DROPDOWNVIEW",()=>new rO("PICKEREX_DROPDOWNVIEW")),Qi("PICKEREX_DROPDOWNVIEW_LINK",()=>new rO("PICKEREX_DROPDOWNVIEW_LINK")),Qi("PICKUPVIEW",()=>new rO("PICKUPVIEW")),Qi("MOBPICKER",()=>new rO("MOBPICKER")),Qi("MOBPICKER_DROPDOWNVIEW",()=>new rO("MOBPICKER_DROPDOWNVIEW")),Qi("MOBMPICKER",()=>new rO("MOBMPICKER")),Qi("NUMBERRANGE",()=>new pO),Qi("MOBNUMBERRANGE",()=>new pO),Qi("DATERANGE",()=>new yO),Qi("DATERANGE_NOTIME",()=>new yO),Qi("MOBDATERANGE",()=>new yO),Qi("MOBDATERANGE_NOTIME",()=>new yO),Qi("CODE",()=>new PO),Qi("MOBCODE",()=>new PO),Qi("HTMLEDITOR",()=>new XO),Qi("MOBHTMLTEXT",()=>new XO),Qi("MARKDOWN",()=>new tM),Qi("MOBMARKDOWN",()=>new tM),Qi("ARRAY",()=>new sM),Qi("MOBARRAY",()=>new sM),Qi("CASCADER",()=>new uM),Qi("MOBCASCADER",()=>new uM),Qi("COLORPICKER",()=>new yM),Qi("MOBCOLORPICKER",()=>new yM),Qi("PICKER_searchCondEdit",()=>new OM),Qi("MAPPICKER",()=>new $M),Qi("FIELD_IMAGE_PICTURE_ONE",()=>new NA("PICTURE_ONE")),Qi("FIELD_IMAGE_PICTURE",()=>new NA("PICTURE")),Qi("FIELD_TEXT_DYNAMIC_SPAN",()=>new Uz),Qi("VIEW_PAGECAPTION_SPAN",()=>new Uz),Qi("STATIC_LABEL_RAW",()=>new _T),Qi("FIELD_TEXTBOX_TEXTBOX",()=>a),Qi("FIELD_TEXTAREA_TEXTAREA",()=>a),Qi("FIELD_RADIOBUTTONLIST_RADIOBUTTONLIST",()=>new kT),Qi("FIELD_CHECKBOXLIST_CHECKBOXLIST",()=>new CT),Qi("FIELD_DROPDOWNLIST_DROPDOWNLIST",()=>new cT),Qi("FIELD_RATING_RATING",()=>new KT),Qi("FIELD_SWITCH_SWITCH",()=>new eA),Qi("FIELD_SLIDER_SLIDER",()=>new oA),Qi("FIELD_DATEPICKER_DATEPICKER",()=>new MT),Qi("FIELD_DATERANGE_DATERANGE",()=>new yO),Qi("FIELD_PICKER_PICKER",()=>new rO("PICKER")),Qi("FIELD_ARRAY_ARRAY",()=>new sM),Qi("AUTH_USERID_TEXTBOX",()=>a),Qi("AUTH_PASSWORD_PASSWORD",()=>a),Qi("FIELD_CAROUSEL_PICTURE",()=>new DM)}}),QM=e("aW",a({name:"IBizView404",setup(){const e=B("404-view"),t=hs(),a=us();d(()=>ibiz.util.hiddenAppLoading());return{ns:e,isTop:r(()=>a&&!a.params.view1),gotoIndexView:async()=>{await t.push("/"),window.location.reload()}}},render(){return n("div",{class:[this.ns.b(),this.ns.is("top",this.isTop)]},[n("img",{class:this.ns.b("img"),src:"".concat(ibiz.env.assetsUrl,"/images/404.png")},null),n("div",{class:this.ns.b("text")},[n("div",{class:this.ns.be("text","text1")},[ibiz.i18n.t("view.noResourcesView.noResourcePrompt")]),this.isTop?n("div",{class:this.ns.be("text","text2")},[ibiz.i18n.t("view.noResourcesView.resourceNoExist"),n("a",{onClick:this.gotoIndexView},[ibiz.i18n.t("view.common.backHomepage")]),ibiz.i18n.t("view.common.continueBrowsing")]):null])])}})),ZM=e("aX",a({name:"IBizView403",setup(){const e=B("403-view"),t=hs(),a=us();d(()=>ibiz.util.hiddenAppLoading());return{ns:e,isTop:r(()=>a&&!a.params.view1),gotoIndexView:async()=>{await t.push("/"),window.location.reload()}}},render(){return n("div",{class:[this.ns.b(),this.ns.is("top",this.isTop)]},[n("img",{class:this.ns.b("img"),src:"".concat(ibiz.env.assetsUrl,"/images/403.png")},null),n("div",{class:this.ns.b("text")},[n("div",{class:this.ns.be("text","text1")},[ibiz.i18n.t("view.noPermissionView.noPermissionPrompt")]),this.isTop?n("div",{class:this.ns.be("text","text2")},[ibiz.i18n.t("view.noPermissionView.noPermission"),n("a",{onClick:this.gotoIndexView},[ibiz.i18n.t("view.common.backHomepage")]),ibiz.i18n.t("view.common.continueBrowsing")]):null])])}}));const eN=e("aY",a({setup(){const e=B("login-view"),t={username:[{required:!0,message:ibiz.i18n.t("app.pleaseEnterAccount"),trigger:"blur"}],password:[{required:!0,message:ibiz.i18n.t("app.pleaseEnterPassword"),trigger:"blur"},{type:"string",min:6,message:ibiz.i18n.t("view.loginView.passwordLength"),trigger:"blur"}]},a=u({username:"",password:""}),c=o(null),p=us().query.ru||"/",m=o(!1),v=o(null),g=i("IBizViewShell"),b=Lt.create({}),f={},w=o(!1),y=o(!1),C=o(!1),I=o(!0);let x=ibiz.env.AppTitle;const S=r(()=>window.location.href.indexOf("srfthird_auth_success=false")>=0);(async()=>{const e=(await ibiz.hub.getAppAsync(ibiz.env.appId)).model;e.caption&&!x&&(x=e.caption)})();const E=window.navigator.userAgent.toUpperCase();S.value||ibiz.env.loginMode===oa.OAUTH||(-1!==E.indexOf("DINGTALK")?ibiz.thirdAuth.auth("DINGTALK","EMBED"):-1!==E.indexOf("WXWORK")&&ibiz.thirdAuth.auth("WXWORK","EMBED")),ibiz.appData=void 0,ibiz.orgData=void 0;const D=async()=>{c.value.validate(async e=>{if(e){w.value=!0;if(!0===await ibiz.auth.login(a.username,a.password,C.value))if(window.location.hash=p,window.history.pushState({},""),S.value){const e=window.location.href.replace("?srfthird_auth_success=false","");window.location.href=e}else window.location.reload();w.value=!1}})},{cleanup:P}=Dl(document,["a",'input:not([type="checkbox"])',"button","textarea","select",'[tabindex]:not([tabindex="-1"])']);return d(async()=>{const e=ns.parse(window.location.search.replace("?",""));if(S.value&&ibiz.message.error(ibiz.i18n.t("view.loginView.thirdAuthFail")),-1===E.indexOf("DINGTALK")&&-1===E.indexOf("WXWORK")||S.value){if("true"===e.isAnonymous){!0===await ibiz.auth.anonymousLogin()&&(window.location.hash=p,window.location.reload())}else{try{const e=await ibiz.hub.config.view.get("AppLoginView");e&&(v.value=e,m.value=!0)}catch(e){ibiz.log.warn(e)}I.value=!1}ibiz.util.hiddenAppLoading(),y.value=!0}}),h(()=>{P()}),()=>{if(y.value&&!1===I.value){let o;return m.value?l(g,{context:b,params:f,viewId:v.value.id}):n("div",{class:e.b()},[n("div",{class:e.b("box")},[n("header",{class:e.b("box-header")},[n("img",{src:"./assets/images/login-header.png"},null),n("span",{class:e.b("box-header-title")},[x])]),n("main",{class:e.b("box-main")},[n("img",{class:e.be("box-main","avatar"),src:"./assets/images/login-avatar.png"},null),n("div",{class:e.b("box-main-content")},[n(i("el-form"),{model:a,rules:t,ref:c},{default:()=>[n(i("el-form-item"),{size:"large",prop:"username"},{default:()=>[n(i("el-input"),{modelValue:a.username,"onUpdate:modelValue":e=>a.username=e,clearable:!0,placeholder:ibiz.i18n.t("app.pleaseEnterAccount")},{prefix:()=>n("ion-icon",{name:"person"},null)})]}),n(i("el-form-item"),{size:"large",prop:"password"},{default:()=>[n(i("el-input"),{type:"password",modelValue:a.password,"onUpdate:modelValue":e=>a.password=e,"show-password":!0,placeholder:ibiz.i18n.t("app.pleaseEnterPassword")},{prefix:()=>n("ion-icon",{name:"unlock-alt"},null)})]}),n(i("el-checkbox"),{modelValue:C.value,"onUpdate:modelValue":e=>C.value=e,label:ibiz.i18n.t("app.rememberMe")},null),n(i("el-form-item"),{size:"large"},{default:()=>{return[n(i("el-button"),{type:"primary",onClick:D,size:"large",round:!0,loading:w.value,onKeyup:e=>(e=>{"Enter"===e.key&&D()})(e)},(e=o=ibiz.i18n.t("view.loginView.login"),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)?o:{default:()=>[o]}))];var e}})]})])])])])}return null}}}));var tN=Object.defineProperty,aN=(e,t,a)=>(((e,t,a)=>{t in e?tN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class nN{constructor(){aN(this,"component","IBizWFStepTraceView")}}const iN=a({name:"IBizWFStepTraceView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object}},setup(){const e=B("view"),t=gt((...e)=>new Zi(...e)),{viewType:a,sysCss:n,codeName:i}=t.model,o=a.toLowerCase(),s=null==n?void 0:n.cssName,l=[e.b(),e.b(o),e.m(i),s];return{c:t,ns:e,viewClassNames:l}},render(){return n("div",{class:this.viewClassNames},[n(i("iBizExtendActionTimeLine"),{data:this.c.state.historyData},null)])}}),oN=e("aZ",ie(iN,function(e){e.component(iN.name,iN),eo(to.APP_WF_STEP_TRACE_VIEW,()=>new nN)}));var sN=Object.defineProperty,lN=(e,t,a)=>(((e,t,a)=>{t in e?sN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class rN{constructor(){lN(this,"component","IBizSubAppRefView")}}const cN=a({name:"IBizSubAppRefView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object}},setup(){const e=B("sub-app-ref-view"),t=gt((...e)=>new ao(...e)),{viewType:a,sysCss:n,codeName:i}=t.model,o=a.toLowerCase(),s=null==n?void 0:n.cssName,l=[e.b(),e.b(o),e.m(i),s],c=r(()=>ibiz.env.marketAddress||window.Environment.marketAddress);return{c:t,ns:e,viewClassNames:l,htmlUrl:c,handleClick:()=>{c.value&&window.open(c.value,"_blank")}}},render(){return n("div",{class:this.viewClassNames},[n(i("el-result"),{class:this.ns.b("result"),icon:"info"},null),this.c.model.caption&&n("div",{class:this.ns.b("caption")},[this.c.model.caption]),this.c.model.subCaption&&n("div",{class:this.ns.b("sub-caption")},[this.c.model.subCaption]),this.htmlUrl&&n(i("el-button"),{class:this.ns.b("btn"),onClick:this.handleClick,size:"large"},{default:()=>[this.c.model.title||ibiz.i18n.t("view.subAppRefView.jump")]})])}}),dN=e("a_",ie(cN,function(e){e.component(cN.name,cN),eo(to.DE_SUB_APP_REF_VIEW,()=>new rN)})),uN=e("a$",a({name:"ErrorView",setup(){const e=B("error-view"),t=us(),a=r(()=>"".concat(t.params.code));d(()=>ibiz.util.hiddenAppLoading());return{ns:e,isTop:r(()=>t&&!t.params.view1),code:a}},render(){if(this.code){const e=no(this.code);if(e)return"string"==typeof e.component?l(i(e.component)):l(e.component)}return n("div",{class:[this.ns.b()]},[ibiz.i18n.t("view.errorView.noExistPrompt",{code:this.code})])}}));class hN extends io{get form(){return this.view.getController("form")}init(){if(super.init(),1===this.view.model.multiFormMode&&this.view.params.srfdatatype){const e=Pn(this.view.model,"_form_".concat(this.view.params.srfdatatype));if(e){const t=oo(this.view.model).filter(e=>"FORM"!==e.controlType);e.name="form",t.push(e),this.view.model.viewLayoutPanel?this.view.model.viewLayoutPanel.controls=t:this.view.model.controls=t}}}async modalPreDismissHook(e){try{this.form&&this.form.state.modified&&this.form.model.enableAutoSave&&await this.form.immediateAutoSave()}catch(t){e.allowNext=!1}}async modalShouldDismissHook(e){var t,a;const n=this.view.context.srfsessionid,i=ibiz.uiDomainManager.get(n);let o=!0===this.view.model.enableDirtyChecking;if(n===this.view.id){const e=(null==i?void 0:i.dataModification)||!1;o=o&&((null==(t=this.form)?void 0:t.state.modified)||e)}else o=o&&(null==(a=this.form)?void 0:a.state.modified);if(o&&null==e.allowClose){const t=await ibiz.confirm.error({title:ibiz.i18n.t("viewEngine.closeRemind"),desc:ibiz.i18n.t("viewEngine.confirmClosePrompt")});e.allowClose=!!t}}async onCreated(){await super.onCreated(),this.modalPreDismissHook=this.modalPreDismissHook.bind(this),this.modalShouldDismissHook=this.modalShouldDismissHook.bind(this),this.formDataStateChange=this.formDataStateChange.bind(this);const{childNames:e,modal:t}=this.view;e.push("form"),this.view.slotProps.form||(this.view.slotProps.form={}),this.view.slotProps.form.loadDefault=!1,this.view.slotProps.toolbar||(this.view.slotProps.toolbar={}),this.view.slotProps.toolbar.manualCalcButtonState=!0,t.hooks.preDismiss.tapPromise(this.modalPreDismissHook),t.hooks.shouldDismiss.tapPromise(this.modalShouldDismissHook)}formDataStateChange(e){var t;const{model:a,evt:n}=this.view,i=this.form.model.appDataEntityId,o=e.data[0];null==(t=this.toolbar)||t.calcButtonState(o,i,e),a.showDataInfoBar&&(o.srfkey?n.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}):n.emit("onViewInfoChange",{dataInfo:ibiz.i18n.t("app.newlyBuild")}))}async onMounted(){await super.onMounted();const{model:e,evt:t}=this.view;if(this.form){this.form.evt.on("onLoadSuccess",e=>{this.formDataStateChange(e);const a=e.data[0];this.view.state.srfactiveviewdata=a,Object.prototype.hasOwnProperty.call(a,"srfreadonly")&&(a.srfreadonly?this.view.context.srfreadonly=!0:Po(this.view.context.srfreadonly)&&(this.view.context.srfreadonly=!1)),t.emit("onDataChange",{...e,actionType:"LOAD"})}),this.form.evt.on("onLoadDraftSuccess",e=>{this.formDataStateChange(e),t.emit("onDataChange",{...e,actionType:"LOADDRAFT"})}),this.form.evt.on("onSaveSuccess",e=>{this.view.state.closeOK=!0;const a=ra(this.view.model.appDataEntityId),n=e.data[0];this.view.context[a]!==n.srfkey&&(this.view.context[a]=n.srfkey),this.formDataStateChange(e),t.emit("onDataChange",{...e,actionType:"SAVE"})}),this.form.evt.on("onRemoveSuccess",e=>{this.formDataStateChange(e),t.emit("onDataChange",{...e,actionType:"REMOVE"})});const a=await ibiz.hub.getAppDataEntity(this.view.model.appDataEntityId,this.view.model.appId);this.form.evt.on("onFormDataChange",e=>{const{name:t,value:n}=e;t===a.formTypeAppDEFieldId&&1===this.view.model.multiFormMode&&this.view.redrawView({context:this.view.context,params:{srfdatatype:n,[t]:n},isReloadModel:!0})}),!this.view.state.noLoadDefault&&e.loadDefault&&this.load()}}getData(){return this.form.getData()}async load(){return this.form.load()}async save(e){return this.form.save(e)}async refresh(){this.form.refresh()}async call(e,t){if(e===ha.SAVE)return await this.form.save(),null;if(e===ha.SAVE_AND_EXIT)return await this.form.save(),{closeView:!0};if(e===ha.REMOVE_AND_EXIT){return{closeView:await this.form.remove()}}if(e===ha.SAVE_AND_NEW)return this.saveAndNew(),null;if(e===ha.REFRESH)return await this.refresh(),null;if(e===ha.SAVE_AND_START)return await this.wfStart(),null;if(e===ha.FIRST_RECORD||e===ha.LAST_RECORD||e===ha.PREV_RECORD||e===ha.NEXT_RECORD)return await this.changeRecord(e),null;if(e===ha.VIEW_WF_STEP)return await this.wfSubmit(),null;if(e===Va.LOAD)return this.load(),null;if(e===Va.VALIDATE)return this.form.validate();if(e===Va.WF_WITHDRAW)return await this.wfWithdraw(),null;if(e===ha.EXPAND){const{srfcollapsetag:e,srfgroupid:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.form.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e,srfgroupid:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.form.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.form.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.form.changeCollapse({expand:!1}),null):super.call(e,t)}async saveAndNew(){await this.form.save(),this.form.state.data=new ma,this.view.context[ra(this.view.model.appDataEntityId)]=void 0,await this.form.load()}async cancelChanges(e={targetState:"INIT"}){await super.cancelChanges(e),await this.form.cancelChanges(e.targetState)}async wfStart(){var e,t;await this.save({silent:!0});const a=await ibiz.hub.getAppDEService(this.view.model.appId,this.view.model.appDataEntityId,this.view.context),n=this.form.state.data,i=await a.wf.getWFVersion(null!=(t=null!=(e=n.srfwftag)?e:this.view.params.srfwftag)?t:this.view.context.srfwftag);if(0===i.data.length)throw new Vt(ibiz.i18n.t("viewEngine.noExistVersionErr"));const o=i.data[0],s="WFSTART@".concat(o.wfversion),l=Object.assign(this.view.context.clone(),{activeForm:o["process-form"]}),r={processDefinitionKey:o.definitionkey},c=so(this.view.model,s);if(!c)return await this.form.wfStart({viewParam:r}),void await this.view.closeView();(await ibiz.commands.execute(Ai.TAG,c.refAppViewId,l,r)).ok&&await this.view.closeView()}wfSubmit(){return this.form.wfSubmit()}async wfWithdraw(){const e=ibiz.hub.getApp(this.view.context.srfappid),t=this.form.state.data,a=await e.deService.getService(this.view.context,this.view.model.appDataEntityId);await a.wf.exec("withdraw",this.view.context,{...this.view.params,taskId:this.view.params.taskId||this.view.params.srftaskid},t instanceof ma?t.getOrigin():t),ibiz.mc.command.send({srfdecodename:"SysTodo"},"OBJECTUPDATED","WITHDRAW")}doMarkDataAction(){if(super.doMarkDataAction(),this.doActions.includes("VIEW")&&this.form.evt.on("onLoadSuccess",()=>this.sendViewDataAction()),this.doActions.includes("EDIT")){let e=!1;this.form.evt.on("onFormDataChange",()=>{const t=this.form.getData()[0];e||(e=!0,this.sendMarkDataAction("EDIT",t.srfkey),setTimeout(()=>{e=!1},3e5))})}this.doActions.includes("UPDATE")&&this.form.evt.on("onSaveSuccess",()=>{const e=this.form.getData()[0];this.sendMarkDataAction("UPDATE",e.srfkey)}),this.doActions.includes("CLOSE")&&this.view.evt.on("onCloseView",()=>{const e=this.form.getData()[0];(null==e?void 0:e.srfkey)&&this.sendMarkDataAction("CLOSE",e.srfkey)})}async reloadConfirm(){const e=await super.reloadConfirm();return e&&this.form.state.modified?ibiz.confirm.warning({title:ibiz.i18n.t("viewEngine.refreshRemind"),desc:ibiz.i18n.t("viewEngine.confirmRefreshPrompt")}):e}async changeRecord(e){const t="".concat(this.view.context.srfnavctrlid);if(!t)throw new Vt(ibiz.i18n.t("viewEngine.missingErr"));const a=this.form.state.data.srfkey;let n;switch(e){case ha.FIRST_RECORD:n=await ibiz.util.record.getFirstRecord(t,a);break;case ha.LAST_RECORD:n=await ibiz.util.record.getLastRecord(t,a);break;case ha.PREV_RECORD:n=await ibiz.util.record.getPreviousRecord(t,a);break;case ha.NEXT_RECORD:n=await ibiz.util.record.getNextRecord(t,a)}if(n){const e=await ibiz.hub.getAppDataEntity(this.form.model.appDataEntityId,this.form.context.srfappid),{srfparentkey:a,srfparentdename:i}=await lo(this.form.model.appDataEntityId,this.view.context,{viewParams:this.view.params}),o=e.formTypeAppDEFieldId||e.dataTypeAppDEFieldId,s={srfdatatype:o?n[o]:void 0},l=await ro(n,this.view.context,this.form.model.appDataEntityId);l[this.deName]=n.srfkey;const r="".concat(this.view.context.srfnavlogicid);if(r){const e=ibiz.util.record.getTriggerLogic(r),a=ibiz.util.record.getCtrl(t);if(e){const{navContexts:t,navParams:i}=e;t&&Object.assign(l,_a(t,n,(null==a?void 0:a.params)||s,(null==a?void 0:a.context)||{})),i&&Object.assign(s,_a(i,n,(null==a?void 0:a.params)||s,(null==a?void 0:a.context)||{}))}}return Object.assign(this.view.context,l),Object.assign(this.view.params,s),i&&1===this.view.model.dynaSysMode&&this.view.context[i]!==a?this.view.redrawView({params:s,context:l,data:[n],isReloadModel:!0}):this.view.redrawView({params:s,context:l,data:[n]})}}async onDestroyed(){super.onDestroyed();const{modal:e}=this.view;e.hooks.preDismiss.removeTapPromise(this.modalPreDismissHook),e.hooks.shouldDismiss.removeTapPromise(this.modalShouldDismissHook)}}e("bg",hN);class pN extends hN{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drbar"),this.view.slotProps.drbar||(this.view.slotProps.drbar={}),this.view.slotProps.drbar.srfnav=this.view.state.srfnav}get drbar(){return this.view.getController("drbar")}}e("bh",pN);class mN extends hN{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drtab")}get drtab(){return this.view.getController("drtab")}}e("bi",mN);class vN extends hN{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drtab"),this.view.slotProps.drtab||(this.view.slotProps.drtab={}),this.view.slotProps.drtab.hideEditItem=!0}get drtab(){return this.view.getController("drtab")}}e("bj",vN);class gN extends co{async call(e,t){if(e===ha.NEW_ROW)return this.grid.newRow(),null;if(e===ha.TOGGLE_ROW_EDIT)return this.grid.toggleRowEdit(),null;if(e===ha.SAVE||e===ha.SAVE_ROW)return this.grid.saveAll(),null;if(e===ha.EXPAND){const{srfcollapsetag:e}=t.params||{};let a=e||"";if(!a){const{selectedData:e}=this.grid.state,t=e.filter(e=>e.isGroupData);t.length>0&&(a=t[0].srfkey)}if(!a)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.grid.changeCollapse({tag:a,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e}=t.params||{};let a=e||"";if(!a){const{selectedData:e}=this.grid.state,t=e.filter(e=>e.isGroupData);t.length>0&&(a=t[0].srfkey)}if(!a)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.grid.changeCollapse({tag:a,expand:!1}),null}return e===ha.EXPANDALL?(this.grid.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.grid.changeCollapse({expand:!1}),null):super.call(e,t)}get grid(){return this.view.getController("grid")}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.grid||(this.view.slotProps.grid={}),this.view.slotProps.grid.mdctrlActiveMode=e.gridRowActiveMode,this.view.slotProps.grid.rowEditOpen=e.rowEditDefault}}e("b1",gN);var bN=Object.defineProperty,fN=(e,t,a)=>(((e,t,a)=>{t in e?bN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class wN extends uo{constructor(){super(...arguments),fN(this,"route",us())}get appmenu(){return this.view.getController("appmenu")}get enableCollapse(){return"LEFT"===this.view.model.mainMenuAlign||void 0===this.view.model.mainMenuAlign}initViewState(){super.initViewState(),this.view.state.isCollapse=!1}async onCreated(){await super.onCreated(),this.view.childNames.push("appmenu"),this.view.slotProps.appmenu||(this.view.slotProps.appmenu={}),this.view.slotProps.appmenu.collapse=this.view.state.isCollapse,ibiz.util.hiddenAppLoading()}async onMounted(){if(await super.onMounted(),!this.isExistAndInLayout("appmenu")&&!this.route.params.view2){const{model:e,context:t,params:a}=this.view,{defAppViewId:n}=e;n&&ibiz.commands.execute(Ai.TAG,n,t,a)}(window.innerWidth<=1200||ibiz.config.appMenu.defaultCollapse)&&this.toggleCollapse()}async call(e,t){if(e===Va.TOGGLE_COLLAPSE)return this.toggleCollapse(),null}toggleCollapse(){var e;if(!this.enableCollapse)return void ibiz.log.error("非左侧菜单模式折叠功能不启用");this.view.state.isCollapse=!this.view.state.isCollapse,this.view.slotProps.appmenu.collapse=this.view.state.isCollapse;const t=null==(e=this.view.layoutPanel)?void 0:e.panelItems.container_scroll_left;t&&(this.view.state.isCollapse?t.state.layout.width="56px":t.state.layout.width="".concat(t.model.width,"px"))}calcViewHeaderVisible(){return!0}}e("b2",wN);class yN extends co{get list(){return this.view.getController("list")}async onMounted(){await super.onMounted();const{model:e}=this.view;this.list.state.mdctrlActiveMode=e.mdctrlActiveMode}async call(e,t){if(e===ha.EXPAND){const{srfcollapsetag:e,srfgroup:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.list.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e,srfgroup:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.list.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.list.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.list.changeCollapse({expand:!1}),null):super.call(e,t)}}e("bq",yN);class CN extends co{get dataview(){return this.view.getController("dataview")}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.dataview||(this.view.slotProps.dataview={}),this.view.slotProps.dataview.mdctrlActiveMode=e.mdctrlActiveMode}async call(e,t){if(e===ha.EXPAND){const{srfcollapsetag:e,srfgroup:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.dataview.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e,srfgroup:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.dataview.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.dataview.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.dataview.changeCollapse({expand:!1}),null):super.call(e,t)}}e("b3",CN);class IN extends uo{get form(){return this.view.getController("form")}init(){if(super.init(),1===this.view.model.multiFormMode&&this.view.params.srfdatatype){const e=Pn(this.view.model,"_form_".concat(this.view.params.srfdatatype));if(e){const t=oo(this.view.model).filter(e=>"FORM"!==e.controlType);e.name="form",t.push(e),this.view.model.viewLayoutPanel?this.view.model.viewLayoutPanel.controls=t:this.view.model.controls=t}}}async onCreated(){await super.onCreated(),this.modalPreDismissHook=this.modalPreDismissHook.bind(this),this.modalShouldDismissHook=this.modalShouldDismissHook.bind(this);const{childNames:e,modal:t}=this.view;e.push("form"),this.view.slotProps.form||(this.view.slotProps.form={}),this.view.slotProps.form.loadDefault=!1,this.view.slotProps.toolbar||(this.view.slotProps.toolbar={}),this.view.slotProps.toolbar.manualCalcButtonState=!0,t.hooks.preDismiss.tapPromise(this.modalPreDismissHook),t.hooks.shouldDismiss.tapPromise(this.modalShouldDismissHook)}async onMounted(){await super.onMounted();const{model:e,evt:t}=this.view,a=this.form.model.appDataEntityId,n=e=>{var n;const i=e.data[0];null==(n=this.toolbar)||n.calcButtonState(i,a,e),i.srfkey&&t.emit("onViewInfoChange",{dataInfo:i.srfmajortext})};this.form.evt.on("onLoadSuccess",e=>{const t=e.data[0];this.view.state.srfactiveviewdata=t,Object.prototype.hasOwnProperty.call(t,"srfreadonly")&&(t.srfreadonly?this.view.context.srfreadonly=!0:Po(this.view.context.srfreadonly)&&(this.view.context.srfreadonly=!1)),n(e)}),this.form.evt.on("onLoadDraftSuccess",e=>{n(e)}),this.form.evt.on("onSaveSuccess",e=>{n(e)});const i=await ibiz.hub.getAppDataEntity(this.view.model.appDataEntityId,this.view.model.appId);this.form.evt.on("onFormDataChange",e=>{const{name:t,value:a}=e;t===i.formTypeAppDEFieldId&&1===this.view.model.multiFormMode&&this.view.redrawView({context:this.view.context,params:{...this.view.params,srfdatatype:a,srfdefdata:e.data[0],[t]:a},isReloadModel:!0})}),!this.view.state.noLoadDefault&&e.loadDefault&&this.load()}async onDestroyed(){super.onDestroyed();const{modal:e}=this.view;e.hooks.preDismiss.removeTapPromise(this.modalPreDismissHook),e.hooks.shouldDismiss.removeTapPromise(this.modalShouldDismissHook)}async modalPreDismissHook(e){try{this.form&&this.form.state.modified&&this.form.model.enableAutoSave&&await this.form.immediateAutoSave()}catch(t){e.allowNext=!1}}async modalShouldDismissHook(e){var t,a;const n=this.view.context.srfsessionid,i=ibiz.uiDomainManager.get(n);let o=!0===this.view.model.enableDirtyChecking;if(n===this.view.id){const e=(null==i?void 0:i.dataModification)||!1;o=o&&((null==(t=this.form)?void 0:t.state.modified)||e)}else o=o&&(null==(a=this.form)?void 0:a.state.modified);if(o&&null==e.allowClose){const t=await ibiz.confirm.error({title:ibiz.i18n.t("viewEngine.closeRemind"),desc:ibiz.i18n.t("viewEngine.confirmClosePrompt")});e.allowClose=!!t}}getData(){return this.form.getData()}load(){return this.form.load()}async refresh(){await this.form.refresh()}async call(e,t){return e===ha.CANCEL?(this.cancel(),null):e===ha.OK?(await this.confirm(),null):e===Va.LOAD?(this.load(),null):e===Va.VALIDATE?this.form.validate():e===ha.REFRESH?(await this.refresh(),null):super.call(e,t)}async confirm(){this.view.state.isClosing=!0;try{await this.form.save(),await this.view.closeView({ok:!0,data:this.getData()})}catch(e){throw this.view.state.isClosing=!1,e}}cancel(){this.view.modal.ignoreDismissCheck=!0,this.view.closeView({ok:!1,data:[]})}}e("b4",IN);var xN=Object.defineProperty,SN=(e,t,a)=>(((e,t,a)=>{t in e?xN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class EN extends gN{constructor(){super(...arguments),SN(this,"selectData",[])}get grid(){return this.view.getController("grid")}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.grid||(this.view.slotProps.grid={}),this.view.slotProps.grid.singleSelect=this.view.state.singleSelect,this.view.slotProps.grid.mdctrlActiveMode=e.gridRowActiveMode,this.initSelectData()}initSelectData(){this.view.params.selecteddata&&(this.selectData=JSON.parse(this.view.params.selecteddata),delete this.view.params.selecteddata),this.view.state.selectedData&&(this.selectData=[...this.view.state.selectedData])}async onMounted(){await super.onMounted(),this.xdataControl.evt.on("onSelectionChange",async e=>{this.view.evt.emit("onSelectionChange",{...e})}),this.xdataControl.evt.on("onActive",async e=>{this.view.evt.emit("onDataActive",{...e})}),this.setSelectedData(this.selectData)}async call(e,t){return e===Va.GET_ALL_DATA?this.grid.state.items:super.call(e,t)}}e("by",EN);var DN=Object.defineProperty,PN=(e,t,a)=>(((e,t,a)=>{t in e?DN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class kN extends uo{constructor(){super(...arguments),PN(this,"selectData",[])}get pickupViewPanel(){return this.view.getController("pickupviewpanel")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("pickupviewpanel"),this.initSelectData()}initSelectData(){this.view.params.selecteddata&&(this.selectData=JSON.parse(this.view.params.selecteddata),delete this.view.params.selecteddata),this.view.state.selectedData&&(this.selectData=[...this.view.state.selectedData])}async onMounted(){await super.onMounted(),this.pickupViewPanel.state.singleSelect=!0,this.pickupViewPanel.evt.on("onSelectionChange",e=>{this.selectData=e.data}),this.pickupViewPanel.evt.on("onDataActive",e=>{this.pickupViewPanelDataActive(e.data)}),this.setSelectedData(this.selectData)}setSelectedData(e){this.selectData=e,this.pickupViewPanel.setSelectedData(e)}pickupViewPanelDataActive(e){this.selectData=e,this.view.closeView({ok:!0,data:this.selectData})}async call(e,t){return e===ha.CANCEL?(this.cancel(),null):e===ha.OK?(this.confirm(),null):super.call(e,t)}confirm(){this.view.closeView({ok:!0,data:this.selectData})}cancel(){this.view.closeView({ok:!1,data:[]})}}e("bA",kN);var zN=Object.defineProperty,TN=(e,t,a)=>(((e,t,a)=>{t in e?zN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class AN extends kN{constructor(){super(...arguments),TN(this,"checkStrictly",!1)}get simpleList(){return this.view.getController("simplelist")}async onCreated(){if(await super.onCreated(),!this.view.providers.simplelist)throw new Xt(this.view.model,ibiz.i18n.t("viewEngine.missingConfigErr"));const{childNames:e}=this.view;e.push("simplelist"),this.view.slotProps.simplelist||(this.view.slotProps.simplelist={}),this.view.slotProps.pickupviewpanel||(this.view.slotProps.pickupviewpanel={}),this.view.slotProps.simplelist.mdctrlActiveMode=2,this.view.slotProps.simplelist.isSimple=!0,this.view.slotProps.simplelist.singleSelect=!1,this.view.slotProps.pickupviewpanel.singleSelect=!1,this.view.params.checkstrictly&&(this.checkStrictly="true"===this.view.params.checkstrictly||!0===this.view.params.checkstrictly,delete this.view.params.checkstrictly)}async onMounted(){await super.onMounted(),this.simpleList.evt.on("onActive",e=>{this.simpleListActive(e.data)}),this.setSelectedData(this.selectData)}async call(e,t){return e===ha.CANCEL?(this.cancel(),null):e===ha.OK?(this.confirm(),null):e===ha.ADD_SELECTION?(this.addSelection(),null):e===ha.ADD_ALL?(this.addAll(),null):e===ha.REMOVE_ALL?(this.removeAll(),null):e===ha.REMOVE_SELECTION?(this.removeSelection(),null):super.call(e,t)}async pickupViewPanelDataActive(e){await this.handlePushSimpleListItems(e)}simpleListActive(e){const t=this.simpleList.getAllData();e.forEach(e=>{const a=t.findIndex(t=>t.srfkey===e.srfkey);-1!==a&&t.splice(a,1)}),this.setSelectedData(t)}async addSelection(){const e=await this.pickupViewPanel.getSelectedData();await this.handlePushSimpleListItems(e)}async handlePushSimpleListItems(e){let t=[];if(this.checkStrictly){const a=await this.pickupViewPanel.getAllData();t=this.simpleList.getAllData().filter(e=>!a.some(t=>t.srfkey===e.srfkey)),t.push(...e)}else{t=[...this.simpleList.getAllData(),...e]}const a=this.handleUniqueItems(t);this.setSelectedData(a)}handleUniqueItems(e){const t=new Map;return e.filter(e=>!t.has(e.srfkey)&&t.set(e.srfkey,1))}async addAll(){const e=await this.pickupViewPanel.getAllData();await this.handlePushSimpleListItems(e)}removeAll(){this.setSelectedData([])}removeSelection(){const e=this.simpleList.getData(),t=this.simpleList.getAllData();e.forEach(e=>{const a=t.findIndex(t=>e.srfkey===t.srfkey);-1!==a&&t.splice(a,1)}),this.setSelectedData(t)}setSelectedData(e){this.checkStrictly&&super.setSelectedData(e),this.simpleList.setData(e)}confirm(){const e=this.simpleList.getAllData();this.view.closeView({ok:!0,data:e})}}e("bu",AN);class ON extends co{async onCreated(){await super.onCreated();const{model:e}=this.view;this.view.slotProps.tree||(this.view.slotProps.tree={}),this.view.slotProps.tree.mdctrlActiveMode=e.mdctrlActiveMode}get tree(){return this.view.getController("tree")}async call(e,t){var a;if(e===ha.REFRESH_ALL)return await this.xdataControl.refresh(),null;if(e===ha.REFRESH)return(null==(a=null==t?void 0:t.data)?void 0:a[0])?await this.xdataControl.refreshNodeChildren(t.data[0],!1):await this.xdataControl.refresh(),null;if(e===ha.REFRESH_PARENT)return await this.xdataControl.refreshNodeChildren(t.data[0],!0),null;if(e===ha.EXPAND){const{data:e=[]}=t,{srfcollapsetag:a}=t.params||{};let n=a||"";if(!n&&e.length>0&&(n=e[0].srfnodeid),!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.xdataControl.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{data:e=[]}=t,{srfcollapsetag:a}=t.params||{};let n=a||"";if(!n&&e.length>0&&(n=e[0].srfnodeid),!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.xdataControl.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.xdataControl.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.xdataControl.changeCollapse({expand:!1}),null):super.call(e,t)}async openData(e){const{data:t,event:a}=e;return await this.xdataControl.openData(t[0],a)}async newData(e){const{data:t,event:a}=e;return await this.xdataControl.newData(t[0],a)}}e("bI",ON);class MN extends uo{get tabExpPanel(){return this.view.getController("tabexppanel")}async onCreated(){var e;this.preprocessTabExpModelLayout(),await super.onCreated();const{childNames:t,model:a}=this.view;t.push("tabexppanel"),this.view.slotProps.tabexppanel||(this.view.slotProps.tabexppanel={});const{appViewParams:n}=a,i=null==(e=null==n?void 0:n.find(e=>"srfdefaultnav"===e.id))?void 0:e.value;this.view.slotProps.tabexppanel.defaultTabName=this.view.state.srfnav||i,this.view.slotProps.tabexppanel.hideEditItem=!0}async refresh(){await this.loadEntityData(),this.tabExpPanel.refresh()}async call(e,t){return e===ha.REFRESH?(await this.refresh(),null):super.call(e,t)}async onMounted(){await super.onMounted(),await this.loadEntityData()}async loadEntityData(){const e=ra(this.view.model.appDataEntityId);if(this.view.context[e])return super.loadEntityData()}preprocessTabExpModelLayout(){const e=(t,a=this.view.model.viewLayoutPanel.rootPanelItems)=>{if(null==a?void 0:a.length)for(let n=0;n<a.length;n++){const i=a[n];if(i.id===t)return i;const o=i;if(o.panelItems&&o.panelItems.length>0){const a=e(t,o.panelItems);if(a)return a}}},t=(e,a=this.view.model.viewLayoutPanel.rootPanelItems)=>{for(let n=0;n<a.length;n++){const i=a[n];e.includes(i.id)&&a.splice(n,1);const o=i;o.panelItems&&o.panelItems.length>0&&t(e,o.panelItems)}},a=t=>{const a=e("tabexppanel");if(!a)throw new Gt(this.view.model.viewLayoutPanel,ibiz.i18n.t("viewEngine.noFoundLayoutOccupied"));const n=e(t);if(!n)throw new Gt(this.view.model.viewLayoutPanel,ibiz.i18n.t("viewEngine.noFoundLayoutContainer",{name:t}));n.panelItems=[a]},{tabLayout:n}=this.view.model,i=["view_tabexppanel","view_tabexppanel_left","view_tabexppanel_bottom","view_tabexppanel_right"];let o="view_tabexppanel";switch(n){case"LEFT":o="view_tabexppanel_left",i.splice(1,1);break;case"BOTTOM":o="view_tabexppanel_bottom",i.splice(2,1);break;case"RIGHT":o="view_tabexppanel_right",i.splice(3,1);break;case"TOP":default:i.splice(0,1);case"FLOW":case"FLOW_NOHEADER":}"FLOW"!==n&&"FLOW_NOHEADER"!==n&&(a(o),t(i))}calcViewHeaderVisible(){let e=super.calcViewHeaderVisible();const{tabLayout:t}=this.view.model;return(void 0===t||["TOP","TOP_DROPDOWNLIST"].includes(t)&&Pn(this.view.model,"tabexppanel"))&&(e=!0),e}}e("b5",MN);class NN extends co{get expBarName(){throw Error(ibiz.i18n.t("viewEngine.subclassAchieve"))}get expBar(){return this.view.getController(this.expBarName)}get xdataControl(){return this.expBar.xDataController}constructor(e){var t,a;const n=null==(a=null==(t=e.model.viewLayoutPanel)?void 0:t.controls)?void 0:a.find(e=>"searchbar"===e.id);n&&!n.name&&(n.name="searchbar"),super(e)}async onCreated(){super.onCreated(),this.modifySplitContainer();const{childNames:e}=this.view;e.push(this.expBarName),this.view.slotProps[this.expBarName]||(this.view.slotProps[this.expBarName]={}),this.view.slotProps[this.expBarName].loadDefault=!1,this.view.slotProps[this.expBarName].srfnav=this.view.state.srfnav}modifySplitContainer(){const e=Pn(this.view.model,this.expBarName),{width:t,height:a}=e;(t||a)&&qt(this.view.model.viewLayoutPanel,e=>{"view_exp_split"===e.id&&(t&&(e.panelItems[0].layoutPos.width=t),a&&(e.panelItems[0].layoutPos.height=a))},{childrenFields:["rootPanelItems","panelItems","panelTabPages"]})}async onXDataActive(e){}getSearchParams(){const e=super.getSearchParams();return this.expBar.state.query&&(e.query=this.expBar.state.query),e}async load(e){await this.expBar.load()}}e("bk",NN);class BN extends NN{get expBarName(){return"gridexpbar"}}e("bn",BN);class LN extends NN{get expBarName(){return"listexpbar"}}e("bp",LN);class RN extends NN{get expBarName(){return"dataviewexpbar"}}e("be",RN);class _N extends NN{get expBarName(){return"treeexpbar"}get tree(){return this.expBar.xDataController}async call(e,t){var a;if(e===ha.REFRESH_ALL)return await this.tree.refresh(),null;if(e===ha.REFRESH)return(null==(a=null==t?void 0:t.data)?void 0:a[0])?await this.tree.refreshNodeChildren(t.data[0],!1):await this.tree.refresh(),null;if(e===ha.REFRESH_PARENT)return await this.tree.refreshNodeChildren(t.data[0],!0),null;if(e===ha.EXPAND){const{data:e=[]}=t,{srfcollapsetag:a}=t.params||{};let n=a||"";if(!n&&e.length>0&&(n=e[0].srfnodeid),!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.tree.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{data:e=[]}=t,{srfcollapsetag:a}=t.params||{};let n=a||"";if(!n&&e.length>0&&(n=e[0].srfnodeid),!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.tree.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.tree.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.tree.changeCollapse({expand:!1}),null):super.call(e,t)}async onMounted(){await super.onMounted(),await this.loadEntityData()}async loadEntityData(){const e=ra(this.view.model.appDataEntityId);if(this.view.context[e]&&this.view.model.showDataInfoBar)return super.loadEntityData()}}e("b6",_N);class jN extends uo{get wizardPanel(){return this.view.getController("wizardpanel")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("wizardpanel")}async onMounted(){await super.onMounted(),this.view.slotProps.wizardpanel||(this.view.slotProps.wizardpanel={}),this.wizardPanel.initialize(),this.wizardPanel.evt.on("onFinishSuccess",e=>{this.view.closeView({ok:!0,data:e.data})})}}e("bO",jN);class VN extends co{get xdataControlName(){return"chart"}get chart(){return this.view.getController("chart")}async onCreated(){await super.onCreated(),this.view.slotProps.chart||(this.view.slotProps.chart={})}}e("bb",VN);var FN=Object.defineProperty,UN=(e,t,a)=>(((e,t,a)=>{t in e?FN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class HN extends hN{constructor(){super(...arguments),UN(this,"isEditable",!1),UN(this,"isCalcWFToolbar",!0),UN(this,"entityService"),UN(this,"processForm"),UN(this,"wfLinks",[])}get form(){return this.view.getController(this.processForm.name)}async onCreated(){await super.onCreated();const e=ibiz.hub.getApp(this.view.context.srfappid);this.entityService=await e.deService.getService(this.view.context,this.view.model.appDataEntityId),await this.calcProcessForm();const{childNames:t}=this.view;t.push(this.processForm.name)}async onMounted(){var e;await super.onMounted(),null==(e=this.toolbar)||e.evt.on("onClick",async e=>{"extra"===e.buttonType&&e.eventArg&&this.onLinkClick(e.eventArg)})}async load(){const e=await super.load();return this.isCalcWFToolbar&&this.calcWfToolbar(),e}async refresh(){const e=this.processForm;await this.calcProcessForm(),e===this.processForm&&await super.refresh()}async calcProcessFormName(){const e=(await this.entityService.wf.getWFStep(Object.assign(this.view.context.clone(),{...this.view.params}))).data;this.isEditable="true"===e.isEditable,this.isEditable||e.hasOwnProperty("process-editmode")&&Number(e["process-editmode"])>0&&(this.isEditable=!0);const t="process-".concat(ibiz.env.isMob?"mob":"","form");return e[t]?"wfform_".concat(e[t]):"form"}async calcProcessForm(){const e=await this.calcProcessFormName(),t=Pn(this.view.model,e.toLowerCase());if(!t)throw new Xt(this.view.model,ibiz.i18n.t("viewEngine.noFoundFormModel",{name:e}));this.processForm=t,this.view.slotProps.form||(this.view.slotProps.form={}),this.view.slotProps.form.modelData=this.processForm}async calcWfToolbar(){if(!this.toolbar)throw new Xt(this.view.model,ibiz.i18n.t("viewEngine.missingToolbarModel"));this.toolbar.clearExtraButtons();const e=ibiz.hub.getApp(this.view.context.srfappid),t=await e.deService.getService(this.view.context,this.view.model.appDataEntityId),a=await t.wf.getWFLink(Object.assign(this.view.context.clone(),{taskDefinitionKey:this.view.params.taskDefinitionKey}),this.getData()[0].getOrigin());this.wfLinks=a.data,this.wfLinks.forEach(e=>{e.id=go()});const n=this.wfLinks.map(e=>({id:e.id,appId:this.view.model.appId,caption:e.sequenceFlowName,buttonType:"extra",tooltip:e.sequenceFlowName,showCaption:!0}));this.toolbar.setExtraButtons("before",n)}async onLinkClick(e){const t=this.wfLinks.find(t=>t.id===e);if(t)return this.wfSubmitByLink(t)}async wfSubmitByLink(e){this.isEditable&&await this.save({silent:!0});const t=Object.assign(this.view.context.clone(),{isEditable:this.isEditable,processForm:e.sequenceflowform}),a={...e},n=ho(this.view.model,e);if(!n)return await this.form.wfSubmit({viewParam:a}),void await this.view.closeView({ok:!0,data:this.form.getData()});(await ibiz.commands.execute(Ai.TAG,n,t,a)).ok&&await this.view.closeView({ok:!0,data:this.form.getData()})}}e("bK",HN);class qN extends HN{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drtab")}get drtab(){return this.view.getController("drtab")}}e("bL",qN);var GN=Object.defineProperty,WN=(e,t,a)=>(((e,t,a)=>{t in e?GN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class YN extends HN{constructor(){super(...arguments),WN(this,"isCalcWFToolbar",!1)}async calcProcessFormName(){this.isEditable="true"===this.view.context.isEditable;return this.view.context.processForm?"wfform_".concat(this.view.context.processForm):"form"}async call(e,t){return e===ha.OK?(this.onOkButtonClick(),null):e===ha.CANCEL?(await this.onCancelButtonClick(),null):super.call(e,t)}async onOkButtonClick(){this.view.context.isEditable?await this.save({silent:!0}):this.form.state.modified=!1,await this.form.wfSubmit({}),await this.view.closeView({ok:!0,data:this.getData()})}async onCancelButtonClick(){await this.view.closeView({ok:!1,data:[]})}}e("bJ",YN);var KN=Object.defineProperty,XN=(e,t,a)=>(((e,t,a)=>{t in e?KN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class $N extends HN{constructor(){super(...arguments),XN(this,"isCalcWFToolbar",!1)}async calcProcessFormName(){this.isEditable="true"===this.view.context.isEditable;return this.view.context.processForm?"wfform_".concat(this.view.context.processForm):"form"}async call(e,t){return e===ha.OK?(this.onOkButtonClick(),null):e===ha.CANCEL?(await this.onCancelButtonClick(),null):super.call(e,t)}async onOkButtonClick(){await this.save({silent:!0}),await this.form.wfStart({}),await this.view.closeView({ok:!0,data:this.getData()})}async onCancelButtonClick(){await this.view.closeView({ok:!1,data:[]})}}e("bM",$N);class JN extends io{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("dashboard")}get dashboard(){return this.view.getController("dashboard")}async refresh(){await this.dashboard.refresh()}getData(){return this.view.state.srfactiveviewdata?[this.view.state.srfactiveviewdata]:[]}async call(e,t){return e===ha.REFRESH?(t.ctrl?await t.ctrl.refresh():await this.refresh(),null):super.call(e,t)}async onMounted(){if(await super.onMounted(),this.view.model.appDataEntityId){const e=ra(this.view.model.appDataEntityId);if(!this.view.context[e])return;await this.loadEntityData()}}doMarkDataAction(){if(super.doMarkDataAction(),this.doActions.includes("VIEW")&&this.view.evt.on("onDataChange",()=>this.sendViewDataAction()),this.doActions.includes("EDIT")){let e=!1;this.dashboard.evt.on("onConfigChange",()=>{const t=this.getData()[0];(null==t?void 0:t.srfkey)&&!e&&(e=!0,this.sendMarkDataAction("EDIT",t.srfkey),setTimeout(()=>{e=!1},3e5))})}this.doActions.includes("UPDATE")&&this.dashboard.evt.on("onSavePortlet",()=>{const e=this.getData()[0];(null==e?void 0:e.srfkey)&&this.sendMarkDataAction("UPDATE",null==e?void 0:e.srfkey)})}}e("bC",JN);class QN extends uo{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("panel")}get panel(){return this.view.getController("panel")}async onMounted(){await super.onMounted(),this.view.model.appDataEntityId&&await this.loadEntityData()}}e("bw",QN);var ZN=Object.defineProperty,eB=(e,t,a)=>(((e,t,a)=>{t in e?ZN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class tB extends uo{constructor(){super(...arguments),eB(this,"controls",[])}async onCreated(){await super.onCreated(),this.controls=oo(this.view.model)}async onMounted(){await super.onMounted(),this.calcToolbarState=this.calcToolbarState.bind(this),this.controls.forEach(e=>{const t=this.view.getController(e.name);null==t||t.evt.on("onLoadSuccess",t=>this.calcToolbarButtonState(e,void 0,t)),null==t||t.evt.on("onSelectionChange",t=>this.calcToolbarButtonState(e,t.data[0],t)),null==t||t.evt.on("onRefreshSuccess",t=>this.calcToolbarButtonState(e,t.data[0],t))})}calcToolbarButtonState(e,t,a){const n=this.controls.find(t=>{var a;return"TOOLBAR"===t.controlType&&(null==(a=t.xdataControlName)?void 0:a.toLowerCase())===e.name});if(n){const i=this.view.getController(n.name);null==i||i.calcButtonState(t,e.appDataEntityId,a)}}async call(e,t){var a;return e===ha.REFRESH?(await(null==(a=this.viewLayoutPanel)?void 0:a.load()),null):super.call(e,t)}}e("bc",tB);var aB=Object.defineProperty,nB=(e,t,a)=>(((e,t,a)=>{t in e?aB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class iB extends uo{constructor(){super(...arguments),nB(this,"controls",[])}get tabSearchBar(){return this.view.getController("tabsearchbar")}async onCreated(){await super.onCreated(),this.controls=oo(this.view.model),this.initMDCtrlActiveMode()}async onMounted(){await super.onMounted(),this.calcToolbarState=this.calcToolbarState.bind(this),this.searchForm&&this.searchForm.evt.on("onSearch",()=>{this.reLoad()}),this.searchBar&&this.searchBar.evt.on("onSearch",()=>{this.reLoad()}),this.tabSearchForm&&this.tabSearchForm.evt.on("onSearch",()=>{this.reLoad()}),this.tabSearchBar&&this.tabSearchBar.evt.on("onSearch",()=>{this.reLoad()}),this.controls.forEach(e=>{const t=this.view.getController(e.name);null==t||t.evt.on("onLoadSuccess",t=>this.calcToolbarButtonState(e,void 0,t)),null==t||t.evt.on("onSelectionChange",t=>this.calcToolbarButtonState(e,t.data[0],t)),null==t||t.evt.on("onRefreshSuccess",t=>this.calcToolbarButtonState(e,t.data[0],t)),null==t||t.evt.on("onBeforeLoad",()=>{t.state.searchParams=this.getSearchParams()})})}getSearchParams(){const e={};return this.searchForm&&Object.assign(e,this.searchForm.getFilterParams()),this.searchBar&&Object.assign(e,this.searchBar.getFilterParams()),this.tabSearchForm&&Object.assign(e,this.tabSearchForm.getFilterParams()),this.tabSearchBar&&Object.assign(e,this.tabSearchBar.getFilterParams()),e}initMDCtrlActiveMode(){const{model:e}=this.view;this.controls.forEach(t=>{const a=t.name||t.id;this.view.slotProps[a]||(this.view.slotProps[a]={}),this.view.slotProps[a].mdctrlActiveMode=e.mdctrlActiveMode})}calcToolbarButtonState(e,t,a){const n=this.controls.find(t=>{var a;return"TOOLBAR"===t.controlType&&(null==(a=t.xdataControlName)?void 0:a.toLowerCase())===e.name});if(n){const i=this.view.getController(n.name);null==i||i.calcButtonState(t,e.appDataEntityId,a)}}async call(e,t){return e===ha.REFRESH?(await this.refresh(),null):e===ha.EDIT||e===ha.VIEW?this.openData(t):e===ha.NEW?this.newData(t):super.call(e,t)}async reLoad(){if(this.view.state.xdatacontrolname){const e=this.view.getController(this.view.state.xdatacontrolname);await(null==e?void 0:e.load({isInitialLoad:!0}))}}async refresh(){if(this.view.state.xdatacontrolname){const e=this.view.getController(this.view.state.xdatacontrolname);await(null==e?void 0:e.refresh())}}async openData(e){var t,a;const{data:n,ctrl:i,event:o}=e,s=(e.context||this.view.context).clone();let l=null==(t=n[0].srfdecodename)?void 0:t.toLowerCase();i&&(s.srfnavctrlid=i.ctrlId,l||(l=ra(i.model.appDataEntityId)));const r=e.params||this.view.params;s[l.toLowerCase()]=n[0].srfkey;const c=await(null==(a=this.view.scheduler)?void 0:a.triggerCustom("opendata",{context:s,params:r,data:n,event:o,view:this.view}));if(-1===c)throw new Xt(this.view.model,ibiz.i18n.t("runtime.engine.logicOpendata"));return{cancel:!c||!c.ok}}async newData(e){var t,a,n;const{data:i,event:o,copyMode:s}=e;if(!(null==(a=null==(t=this.view.model.viewLayoutPanel)?void 0:t.appViewLogics)?void 0:a.find(e=>"newdata"===e.id)))throw new Xt(this.view.model,ibiz.i18n.t("runtime.engine.logicNewdata"));const l=Ko(this.view.params);s&&(l.srfcopymode=s);const r=await(null==(n=this.view.scheduler)?void 0:n.triggerCustom("newdata",{context:this.view.context,params:l,data:i,event:o,view:this.view}));if(-1===r)throw new Xt(this.view.model,ibiz.i18n.t("runtime.engine.logicNewdata"));return{cancel:!r||!r.ok}}}e("bd",iB);var oB=Object.defineProperty,sB=(e,t,a)=>(((e,t,a)=>{t in e?oB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class lB extends ON{constructor(){super(...arguments),sB(this,"selectData",[])}async onCreated(){super.onCreated(),this.view.slotProps.tree||(this.view.slotProps.tree={}),this.view.slotProps.tree.singleSelect=this.view.state.singleSelect,this.view.slotProps.tree.checkStrictly=this.view.state.checkStrictly,this.initSelectData()}initSelectData(){this.view.params.selecteddata&&(this.selectData=JSON.parse(this.view.params.selecteddata),delete this.view.params.selecteddata),this.view.state.selectedData&&(this.selectData=[...this.view.state.selectedData])}async onMounted(){const{model:e}=this.view;this.xdataControl.evt.on("onSelectionChange",async e=>{this.view.evt.emit("onSelectionChange",{...e})}),this.xdataControl.evt.on("onActive",async e=>{this.view.evt.emit("onDataActive",{...e})}),!this.view.state.noLoadDefault&&e.loadDefault&&this.load(),this.setSelectedData(this.selectData)}async call(e,t){return e===Va.GET_ALL_DATA?this.tree.state.items:super.call(e,t)}}e("bz",lB);var rB=Object.defineProperty,cB=(e,t,a)=>(((e,t,a)=>{t in e?rB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class dB extends CN{constructor(){super(...arguments),cB(this,"selectData",[])}get dataview(){return this.view.getController("dataview")}async onCreated(){super.onCreated(),this.view.slotProps.dataview.singleSelect=this.view.state.singleSelect,this.initSelectData()}initSelectData(){this.view.params.selecteddata&&(this.selectData=JSON.parse(this.view.params.selecteddata),delete this.view.params.selecteddata),this.view.state.selectedData&&(this.selectData=[...this.view.state.selectedData])}async onMounted(){await super.onMounted(),this.xdataControl.evt.on("onSelectionChange",async e=>{this.view.evt.emit("onSelectionChange",{...e})}),this.xdataControl.evt.on("onActive",async e=>{this.view.evt.emit("onDataActive",{...e})}),this.setSelectedData(this.selectData)}async call(e,t){return e===Va.GET_ALL_DATA?this.dataview.state.items:super.call(e,t)}}e("bx",dB);class uB extends kN{get treeExpBar(){return this.view.getController("treeexpbar")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("treeexpbar"),this.view.slotProps.treeexpbar||(this.view.slotProps.treeexpbar={}),this.view.slotProps.treeexpbar.noNeedNavView=!0,this.view.slotProps.pickupviewpanel||(this.view.slotProps.pickupviewpanel={}),this.view.slotProps.pickupviewpanel.noLoadDefault=!0,this.view.slotProps.pickupviewpanel.singleSelect=!0}async onMounted(){await super.onMounted(),this.treeExpBar.load(),this.treeExpBar.evt.on("onNavViewChange",e=>{this.view.slotProps.pickupviewpanel.context=e.navViewMsg.context,this.view.slotProps.pickupviewpanel.params={...this.view.params,...e.navViewMsg.params}})}}e("bB",uB);class hB extends co{async onXDataActive(e){}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.calendar||(this.view.slotProps.calendar={}),this.view.slotProps.calendar.mdctrlActiveMode=e.mdctrlActiveMode}async openData(e){const{data:t,event:a}=e;return await this.xdataControl.openData(t[0],a)}async newData(e){const{data:t,event:a}=e;return await this.xdataControl.newData(t[0],a)}}e("b9",hB);class pB extends NN{get expBarName(){return"calendarexpbar"}}e("b8",pB);class mB extends AN{get treeExpBar(){return this.view.getController("treeexpbar")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("treeexpbar"),this.view.slotProps.treeexpbar||(this.view.slotProps.treeexpbar={}),this.view.slotProps.treeexpbar.noNeedNavView=!0,this.view.slotProps.pickupviewpanel.noLoadDefault=!0}async onMounted(){await super.onMounted(),this.treeExpBar.load(),this.treeExpBar.evt.on("onNavViewChange",e=>{this.view.slotProps.pickupviewpanel.context=e.navViewMsg.context,this.view.slotProps.pickupviewpanel.params=e.navViewMsg.params})}}e("bv",mB);class vB extends co{get kanbanview(){return this.view.getController("kanban")}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.kanban||(this.view.slotProps.kanban={}),this.view.slotProps.kanban.mdctrlActiveMode=e.mdctrlActiveMode}}e("bo",vB);class gB extends dB{}e("bl",gB);var bB=Object.defineProperty,fB=(e,t,a)=>(((e,t,a)=>{t in e?bB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class wB extends uo{constructor(){super(...arguments),fB(this,"route",us()),fB(this,"enterKeyListener",async e=>{if("BUTTON"===e.target.nodeName&&"Enter"===e.key&&this.view.layoutPanel){const t={data:[{username:this.view.layoutPanel.data.username,password:this.view.layoutPanel.data.password,captcha:this.view.layoutPanel.data.captcha}]},a=e.target.dataset.id;if(a){const e=this.view.layoutPanel.findPanelItemByName(a);e&&(t.data=[e.data])}await this.login(t)}})}async onMounted(){super.onMounted(),document.addEventListener("keyup",this.enterKeyListener)}async onDestroyed(){super.onDestroyed(),document.removeEventListener("keyup",this.enterKeyListener)}async call(e,t={}){return e===ha.LOGIN?(await this.login(t),null):super.call(e,t)}async login(e){var t;let a;const n={},i=e.data[0]||{},o=null==(t=e.params)?void 0:t.panelDataParent;if(this.view.layoutPanel){if(!await this.view.layoutPanel.validate(o))return;const e=this.view.layoutPanel.data;"boolean"==typeof e.isRemember&&(a=e.isRemember),i.captcha&&Object.assign(n,i.captcha),e.srfheaders&&Object.assign(n,e.srfheaders)}let s=i.username;vo(i.orgid)&&(s="".concat(i.username,"@").concat(i.orgid));const l=await ibiz.auth.login(s,i.password,a,n);if(this.view.evt.emit("onAfterLogin",{ok:l,panelDataParent:o}),!0===l){const e=window.location.href.indexOf("srfthird_auth_success=false")>=0;if(window.location.hash=this.route.query.ru||"/",window.history.pushState({},""),e){const e=window.location.href.replace("?srfthird_auth_success=false","");window.location.href=e}else window.location.reload()}}async cancelChanges(e={targetState:"INIT"}){this.view.layoutPanel&&Object.keys(this.view.layoutPanel.panelItems).forEach(e=>{const t=this.view.layoutPanel.panelItems[e],{viewFieldName:a}=t.model;a&&t.setDataValue("",a)})}}e("br",wB);class yB extends ON{get treeGridEx(){return this.view.getController("treegridex")}async call(e,t){return e===ha.TOGGLE_ROW_EDIT?(this.treeGridEx.toggleRowEdit(),null):e===ha.SAVE_ROW?(this.treeGridEx.save(t.data[0]),null):e===ha.SAVE?(this.treeGridEx.saveAll(),null):e===ha.REFRESH?(this.treeGridEx.load(),null):super.call(e,t)}}e("bG",yB);class CB extends gN{get xdataControlName(){return"treegrid"}get treeGrid(){return this.view.getController("treegrid")}async onCreated(){await super.onCreated(),this.view.slotProps.treegrid?Object.assign(this.view.slotProps.treegrid,this.view.slotProps.grid):this.view.slotProps.treegrid=this.view.slotProps.grid}async call(e,t){if(e===ha.EXPAND){const{srfcollapsetag:e}=t.params||{};let a=e||"";if(!a){const{selectedData:e}=this.treeGrid.state,t=e.filter(e=>e.hasChildren);t.length>0&&(a=t[0].srfkey)}if(!a)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.treeGrid.changeCollapse({tag:a,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e}=t.params||{};let a=e||"";if(!a){const{selectedData:e}=this.treeGrid.state,t=e.filter(e=>e.hasChildren);t.length>0&&(a=t[0].srfkey)}if(!a)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.treeGrid.changeCollapse({tag:a,expand:!1}),null}return e===ha.EXPANDALL?(this.treeGrid.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.treeGrid.changeCollapse({expand:!1}),null):super.call(e,t)}}e("bH",CB);class IB extends co{get xdataControlName(){return"meditviewpanel"}get meditviewpanel(){return this.view.getController("meditviewpanel")}async onCreated(){await super.onCreated(),this.view.slotProps.meditviewpanel||(this.view.slotProps.meditviewpanel={})}async call(e,t){return e===ha.NEW?(await this.meditviewpanel.handleAdd(),null):e===ha.REFRESH?null:super.call(e,t)}}e("bt",IB);class xB extends NN{get expBarName(){return"chartexpbar"}}e("ba",xB);class SB extends co{get map(){return this.view.getController("map")}async onCreated(){super.onCreated(),this.view.slotProps.map||(this.view.slotProps.map={})}}e("bs",SB);class EB extends uo{get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get reportpanel(){return this.view.getController("reportpanel")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("searchform","searchbar","reportpanel"),this.view.slotProps.reportpanel||(this.view.slotProps.reportpanel={})}async onMounted(){await super.onMounted();const{model:e}=this.view;this.reportpanel.evt.on("onBeforeLoad",()=>{this.reportpanel.state.searchParams=this.getSearchParams()}),this.reportpanel.evt.on("onLoadSuccess",e=>{this.view.evt.emit("onDataChange",{...e,actionType:"LOAD"})});const t=this.viewLayoutPanel.panelItems.view_searchform;if(t){const a=!!this.searchForm;t.state.keepAlive=a,t.state.visible=a&&!!e.expandSearchForm}this.searchForm&&this.searchForm.evt.on("onSearch",()=>{this.reLoad()}),this.searchBar&&this.searchBar.evt.on("onSearch",()=>{this.reLoad()}),!this.view.state.noLoadDefault&&e.loadDefault&&this.load()}async call(e,t){return e===ha.REFRESH?(await this.refresh(),null):e===ha.SEARCH?(await this.searchForm.search(),null):e===ha.RESET?(await this.searchForm.reset(),null):super.call(e,t)}getData(){return this.reportpanel.getData()}async load(){return this.reportpanel.load()}async reLoad(){await this.reportpanel.load({isInitialLoad:!0})}async refresh(){this.reportpanel.doNextActive(()=>this.load(),{key:"load"})}getSearchParams(){const e={};return this.searchForm&&Object.assign(e,this.searchForm.getFilterParams()),this.searchBar&&Object.assign(e,this.searchBar.getFilterParams()),e}calcViewHeaderVisible(){const e=super.calcViewHeaderVisible();return this.calcViewSearchBarVisible()||e}calcViewSearchBarVisible(){const{model:e}=this.view,t=this.isExistAndInLayout("searchbar");if(!t)return t;const a=Pn(e,"searchbar");return!(!a.enableQuickSearch&&!a.enableGroup&&!0!==a.enableFilter)}calcRemoveLayoutModel(){const e=super.calcRemoveLayoutModel();return this.calcViewSearchBarVisible()||e.push("view_searchbar"),e}toggleFilter(){if(this.searchForm){const e=this.viewLayoutPanel.panelItems.view_searchform;e&&(e.state.visible=!e.state.visible)}}}e("bD",EB);class DB extends yB{get gantt(){return this.view.getController("gantt")}async call(e,t){return e===ha.NEW_ROW?(this.gantt.newRow(t),null):e===ha.TOGGLE_ROW_EDIT?(this.gantt.toggleRowEdit(),null):e===ha.SAVE_ROW?(this.gantt.save(t.data[0]),null):e===ha.SAVE?(this.gantt.saveAll(),null):e===ha.REFRESH?(await this.gantt.refresh(),null):super.call(e,t)}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.gantt||(this.view.slotProps.gantt={}),this.view.slotProps.gantt.mdctrlActiveMode=e.mdctrlActiveMode}}e("bm",DB);class PB extends hN{get drbar(){return this.view.getController("drbar")}get routeDepth(){return this.view.modal.routeDepth}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drbar"),this.view.slotProps.drbar||(this.view.slotProps.drbar={}),this.view.slotProps.drbar.showMode="horizontal",this.view.slotProps.drbar.srfnav=this.view.state.srfnav,this.view.slotProps.drbar.hideEditItem=!0}formDataStateChange(e){var t;const{evt:a}=this.view,n=this.form.model.appDataEntityId,i=e.data[0];null==(t=this.toolbar)||t.calcButtonState(i,n,e),i.srfkey&&a.emit("onViewInfoChange",{dataInfo:i.srfmajortext||""})}}e("bf",PB);class kB extends uo{}e("bE",kB);class zB extends MN{get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get tabExpPanel(){return this.view.getController("tabexppanel")}preprocessTabExpModelLayout(){}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("searchform","searchbar")}async onMounted(){await super.onMounted();const e=this.viewLayoutPanel.panelItems.view_searchform;if(e){const t=!!this.searchForm;e.state.keepAlive=t,e.state.visible=t}const t=this.viewLayoutPanel.panelItems.view_searchbar;if(t){const e=this.searchBar&&!(!this.searchBar.model.enableQuickSearch&&!this.searchBar.model.enableGroup&&!0!==this.searchBar.model.enableFilter);t.state.visible=e}if(this.searchForm&&this.searchForm.evt.on("onSearch",()=>{this.calcViewParams()}),this.searchBar&&this.searchBar.evt.on("onSearch",()=>{this.calcViewParams()}),this.tabExpPanel){this.tabExpPanel.evt.on("onTabChange",({tab:e})=>{this.calcViewParams(),this.onQuickSearchPlaceHolder(e)});const{activeTabViewPanelModel:e}=this.tabExpPanel;e&&this.onQuickSearchPlaceHolder(e)}}async onQuickSearchPlaceHolder(e){let{caption:t}=e;const a=await ibiz.hub.config.view.get(e.embeddedAppDEViewId||""),n=await ibiz.hub.getAppDataEntity(a.appDataEntityId,a.appId);if(n){const e=n.appDEFields.filter(e=>e.enableQuickSearch);if(e.length){const a=[];e.forEach(e=>{e.lnlanguageRes&&e.lnlanguageRes.lanResTag?a.push(ibiz.i18n.t(e.lnlanguageRes.lanResTag,e.logicName)):e.logicName&&a.push(e.logicName)}),a.length>0&&(t=a.join("、"))}}this.searchBar&&(this.searchBar.placeHolder=t||"",this.searchBar.state.quickSearchPlaceHolder=t||"")}async call(e,t){return e===ha.SEARCH?(await this.searchForm.search(),null):e===ha.RESET?(await this.searchForm.reset(),null):e===ha.REFRESH?(await this.calcViewParams(),null):super.call(e,t)}getSearchParams(){const e={};return this.searchForm&&Object.assign(e,this.searchForm.getFilterParams()),this.searchBar&&Object.assign(e,this.searchBar.getFilterParams()),e}calcViewHeaderVisible(){let e=!1;const{model:t}=this.view;return t.showCaptionBar&&(e=!0),ibiz.env.isMob?(this.isExistAndInLayout("lefttoolbar")&&(e=!0),this.isExistAndInLayout("righttoolbar")&&(e=!0)):this.isExistAndInLayout("toolbar")&&(e=!0),e}calcViewParams(){this.tabExpPanel.state.expViewParams=this.getSearchParams(),this.tabExpPanel.refresh()}}e("bF",zB);class TB extends uo{}e("b7",TB);class AB extends uo{}e("bN",AB);class OB extends uo{async onCreated(){await super.onCreated(),ibiz.util.hiddenAppLoading()}}class MB extends uo{async onCreated(){await super.onCreated(),ibiz.util.hiddenAppLoading()}}const NB=e("b0",{install:e=>{ibiz.engine.register("VIEW_APPWFSTEPDATAVIEW",e=>new AB(e)),ibiz.engine.register("VIEW_AppIndexView",e=>new wN(e)),ibiz.engine.register("VIEW_APPINDEXVIEW",e=>new wN(e)),ibiz.engine.register("VIEW_GridView",e=>new gN(e)),ibiz.engine.register("VIEW_ListView",e=>new yN(e)),ibiz.engine.register("VIEW_TreeView",e=>new ON(e)),ibiz.engine.register("VIEW_EditView",e=>new hN(e)),ibiz.engine.register("VIEW_EditView2",e=>new pN(e)),ibiz.engine.register("VIEW_EditView3",e=>new mN(e)),ibiz.engine.register("VIEW_EditView4",e=>new vN(e)),ibiz.engine.register("VIEW_DataView",e=>new CN(e)),ibiz.engine.register("VIEW_OptionView",e=>new IN(e)),ibiz.engine.register("VIEW_PickupGridView",e=>new EN(e)),ibiz.engine.register("VIEW_PickupTreeView",e=>new lB(e)),ibiz.engine.register("VIEW_DEPICKUPVIEW2",e=>new uB(e)),ibiz.engine.register("VIEW_PickupView",e=>new kN(e)),ibiz.engine.register("VIEW_MPickupView",e=>new AN(e)),ibiz.engine.register("VIEW_DEMPICKUPVIEW2",e=>new mB(e)),ibiz.engine.register("VIEW_TabExpView",e=>new MN(e)),ibiz.engine.register("VIEW_GridExpView",e=>new BN(e)),ibiz.engine.register("VIEW_ListExpView",e=>new LN(e)),ibiz.engine.register("VIEW_DataViewExpView",e=>new RN(e)),ibiz.engine.register("VIEW_ChartView",e=>new VN(e)),ibiz.engine.register("VIEW_TreeExpView",e=>new _N(e)),ibiz.engine.register("VIEW_WizardView",e=>new jN(e)),ibiz.engine.register("VIEW_WFDynaEditView",e=>new HN(e)),ibiz.engine.register("VIEW_DEWFDYNAEDITVIEW3",e=>new qN(e)),ibiz.engine.register("VIEW_DEWFDYNAACTIONVIEW",e=>new YN(e)),ibiz.engine.register("VIEW_DEWFDYNASTARTVIEW",e=>new $N(e)),ibiz.engine.register("VIEW_APPPORTALVIEW",e=>new JN(e)),ibiz.engine.register("VIEW_DEPORTALVIEW",e=>new JN(e)),ibiz.engine.register("VIEW_PortalView9",e=>new JN(e)),ibiz.engine.register("VIEW_PortalView",e=>new JN(e)),ibiz.engine.register("VIEW_DEPANELVIEW",e=>new QN(e)),ibiz.engine.register("VIEW_APPPANELVIEW",e=>new QN(e)),ibiz.engine.register("VIEW_DECUSTOMVIEW",e=>new tB(e)),ibiz.engine.register("VIEW_DEMDCUSTOMVIEW",e=>new iB(e)),ibiz.engine.register("VIEW_DEPICKUPDATAVIEW",e=>new dB(e)),ibiz.engine.register("VIEW_PickupDataView",e=>new dB(e)),ibiz.engine.register("VIEW_DEINDEXPICKUPDATAVIEW",e=>new dB(e)),ibiz.engine.register("VIEW_DECALENDARVIEW",e=>new hB(e)),ibiz.engine.register("VIEW_CalendarExpView",e=>new pB(e)),ibiz.engine.register("VIEW_FormPickupDataView",e=>new gB(e)),ibiz.engine.register("VIEW_KanBanView",e=>new vB(e)),ibiz.engine.register("VIEW_APPLOGINVIEW",e=>new wB(e)),ibiz.engine.register("VIEW_TreeGridExView",e=>new yB(e)),ibiz.engine.register("VIEW_DETREEGRIDVIEW",e=>new CB(e)),ibiz.engine.register("VIEW_DECHARTEXPVIEW",e=>new xB(e)),ibiz.engine.register("VIEW_DEGANTTVIEW",e=>new DB(e)),ibiz.engine.register("VIEW_DESUBAPPREFVIEW",e=>new kB(e)),ibiz.engine.register("VIEW_APPDATAUPLOADVIEW",e=>new TB(e)),ibiz.engine.register("VIEW_APPSTARTVIEW",e=>new OB(e)),ibiz.engine.register("VIEW_APPWELCOMEVIEW",e=>new MB(e)),ibiz.engine.register("VIEW_GridView9",e=>new gN(e)),ibiz.engine.register("VIEW_ListView9",e=>new yN(e)),ibiz.engine.register("VIEW_EditView9",e=>new hN(e)),ibiz.engine.register("VIEW_DataView9",e=>new CN(e)),ibiz.engine.register("VIEW_TreeView9",e=>new ON(e)),ibiz.engine.register("VIEW_DETABEXPVIEW9",e=>new MN(e)),ibiz.engine.register("VIEW_PortalView9",e=>new JN(e)),ibiz.engine.register("VIEW_DEPORTALVIEW9",e=>new JN(e)),ibiz.engine.register("VIEW_DEMEDITVIEW9",e=>new IB(e)),ibiz.engine.register("VIEW_DEMAPVIEW",e=>new SB(e)),ibiz.engine.register("VIEW_DEREPORTVIEW",e=>new EB(e)),ibiz.engine.register("VIEW_DEINDEXVIEW",e=>new PB(e)),ibiz.engine.register("VIEW_DETABSEARCHVIEW",e=>new zB(e))}});var BB=Object.defineProperty,LB=(e,t,a)=>(((e,t,a)=>{t in e?BB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);const RB=e("i",Is({legacy:!1,locale:"zh-CN"}));const _B=new class{constructor(){LB(this,"html"),LB(this,"defaultLang"),LB(this,"langMap",new Map),this.defaultLang="zh-CN",this.html=document.querySelector("html");const e=localStorage.getItem("language")||navigator.language||this.defaultLang;RB.global.locale.value=e,this.html.setAttribute("lang",e),this.langMap.set("en",()=>t.import("./index-Cmb9aRPY.js")),this.langMap.set("zh-CN",()=>t.import("./index-JVe7O62m.js"))}async init(){const e=RB.global.locale.value;let t;t=this.langMap.has(e)?this.langMap.get(e):this.langMap.get(this.defaultLang);const a=await t();RB.global.setLocaleMessage(RB.global.locale.value,a.default)}setLangConfigs(e){Object.keys(e).forEach(t=>{this.langMap.set(t,e[t])})}setLang(e){ibiz.confirm.warning({title:"提示",desc:"切换语言需要刷新页面,确认切换?"}).then(t=>{t&&(localStorage.setItem("language",e),window.location.reload())})}getLang(){return this.html.getAttribute("lang")||this.defaultLang}t(e,t,a){return RB.global.t(e,t,a)}mergeLocaleMessage(e,t){if("string"==typeof e){const a=e;RB.global.mergeLocaleMessage(a,t)}else{const t=e;t&&Object.keys(t).length>0&&Object.keys(t).forEach(e=>{RB.global.mergeLocaleMessage(e,t[e])})}}};var jB=Object.defineProperty,VB=(e,t,a)=>(((e,t,a)=>{t in e?jB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class FB{constructor(e){VB(this,"isFullCode",!1),VB(this,"customModelLoader"),this.isFullCode=(null==e?void 0:e.isFullCode)||!1,this.customModelLoader=(null==e?void 0:e.customModelLoader)||void 0,this.customModelLoader&&ibiz.hub.registerModelLoaderProvider(this.customModelLoader)}async verify(e,t=!0){if(t){let t=!0;try{ibiz.env.enableAnonymous?await this.anonymousValidate(e):await this.appInit(e)}catch(e){t=!1,e.tag="APPINIT",ibiz.util.error.handle(e)}return t}return await this.initModel(e,!1),!0}async anonymousValidate(e){const t=ibiz.auth.getAuthInfo();if(t&&!t.isAnonymous)try{return void await this.appInit(e)}catch(t){const{status:a}=t;if(401!==a)throw t;if(Zt(ea.REFRESH_TOKEN)){try{await ibiz.auth.refreshToken()}catch(e){if(!ibiz.env.enableAnonymous)throw t;if(!await ibiz.auth.anonymousLogin())throw t}return void await this.appInit(e)}ibiz.auth.clearAuthData()}if(null==t?void 0:t.token){try{await this.appInit(e)}catch(t){const{status:a}=t;if(401!==a)throw t;if(!await ibiz.auth.anonymousLogin())throw new Vt(ibiz.i18n.t("webApp.authGuard.loginFailed"));await this.appInit(e)}return}await this.initModel(e,!1);const a=window.location.hash.split("/"),n=a[a.length-2];let i;try{i=["#","index"].includes(n)&&ibiz.hub.defaultPage?await ibiz.hub.getAppView(ibiz.hub.defaultPage.id):await ibiz.hub.getAppView(n)}catch(e){ibiz.log.error(e)}if(!i)return ibiz.log.error("找不到视图模型".concat(n,",请确保该视图配置了匿名访问和用户引用")),void this.throw401();if(3===i.accUserMode){if(!t){if(!await ibiz.auth.anonymousLogin())throw new Vt(ibiz.i18n.t("webApp.authGuard.loginFailed"))}await this.appInit(e)}else this.throw401()}async appInit(e){await bt.beforeInitApp.call({context:e});try{!0===ibiz.env.isSaaSMode&&await this.loadOrgData(),await this.loadAppData(e),await bt.authedApp.call({context:e})}catch(t){const a=t.status,n=Zt(ea.TOKEN_REMEMBER),i=Zt(ea.REFRESH_TOKEN);if(401!==a||!n||null==i||""===i)throw t;try{try{await ibiz.auth.refreshToken()}catch(e){if(!ibiz.env.enableAnonymous)throw t;if(!await ibiz.auth.anonymousLogin())throw t}!0===ibiz.env.isSaaSMode&&await this.loadOrgData(),await this.loadAppData(e),await bt.authedApp.call({context:e})}catch(e){throw t}}await this.initModel(e),await ibiz.auth.extendLogin(e),await ibiz.hub.notice.init(),await ibiz.util.theme.initCustomTheme()}async initModel(e,t=!0){}async loadAppData(e){let t;t=e&&Object.keys(e).length>0?await ibiz.net.get("/appdata",e):await ibiz.net.get("/appdata"),t.ok&&(ibiz.appData=t.data,bs())}async loadOrgData(){const e=await ibiz.net.get("/uaa/getbydcsystem/".concat(ibiz.env.dcSystem));if(e.ok){const t=e.data;if(t){const[e]=t;ibiz.orgData=e}}}async initTheme(e){const a=await t.import("@ibiz-template/web-theme"),n=a.default||a;bt.useComponent.callSync(null,n),e.appUIThemes&&await this.loadTheme()}async loadTheme(){const e=ibiz.hub.getApp().model.appUIThemes||[];if(e.length>0){const t=e.filter(e=>e.themeParams&&"true"!==e.themeParams["icon-theme"]);if(t.length>0)for(let e=0;e<t.length;e++){const a=t[e];await ibiz.util.theme.loadTheme(a)}const a=e.filter(e=>e.themeParams&&"true"===e.themeParams["icon-theme"]);if(a.length>0)for(let e=0;e<a.length;e++){const t=a[e];await ibiz.util.theme.loadTheme(t,"ICON")}}}async initEnvironment(e){const t=e.userParam;t&&(Object.keys(t).forEach(e=>{const a=ibiz.util.rawValue.format(t[e]),n=e.split(".");let i=ibiz.env;for(let e=0;e<n.length;e++){const t=n[e];e===n.length-1?i[t]=a:(i[t]=i[t]||{},i=i[t])}}),ibiz.env.globalConfig&&(ibiz.config=Mo(ibiz.config,ibiz.env.globalConfig)),ibiz.log.setLevel(ibiz.env.logLevel))}throw401(){throw new na({response:{status:401,statusText:ibiz.i18n.t("webApp.authGuard.noPermission")}})}}e("ca",FB);var UB=Object.defineProperty,HB=(e,t,a)=>(((e,t,a)=>{t in e?UB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class qB extends FB{constructor(){super(...arguments),HB(this,"hasModelInit",!1),HB(this,"noPermissionModel",!1)}async initModel(e,a=!0){if(!this.hasModelInit||this.hasModelInit&&this.noPermissionModel!==a){ibiz.hub.reset();const n=new xs(async(e,t)=>(await ibiz.net.get("".concat(ibiz.env.remoteModelUrl).concat(e),t,a?{}:{srfdcsystem:ibiz.env.dcSystem})).data,ibiz.env.appId,e,a),i=await n.getAppModel();await this.initEnvironment(i),ibiz.appUtil.registerAutoCloseOnNavEnd();const o=await ibiz.hub.getAppAsync(ibiz.env.appId);await bt.initedApp.call({context:e,app:o});const s=o.model;if(ibiz.env.isMob=!0===s.mobileApp,ibiz.env.isEnableMultiLan){const e=ibiz.i18n.getLang(),t=(await n.getPSAppLang(e.replace("-","_").toUpperCase())).languageItems||[],a={};t.forEach(e=>{a[e.lanResTag]=e.content}),RB.global.mergeLocaleMessage(e,a)}const l=await t.import("@ibiz-template/web-theme"),r=l.default||l;bt.useComponent.callSync(null,r),ibiz.config.theme&&ibiz.util.theme.setTheme(ibiz.config.theme),s.appUIThemes&&await this.loadTheme(),o.model.title&&ibiz.util.setBrowserTitle("")}this.noPermissionModel=a,this.hasModelInit=!0}}
|
|
9
|
-
/*! Element Plus v2.4.4 */var GB={name:"zh-cn",el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"}}},WB=e("I",{install:e=>{ibiz.i18n=_B,ibiz.util.getExcelUtil=()=>t.import("./xlsx-util-
|
|
8
|
+
function Wm(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),a.push.apply(a,n)}return a}function Ym(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?Wm(Object(a),!0).forEach(function(t){Xm(e,t,a[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Wm(Object(a)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))})}return e}function Km(e){return Km="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Km(e)}function Xm(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function $m(){return $m=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n])}return e},$m.apply(this,arguments)}function Jm(e,t){if(null==e)return{};var a,n,i=function(e,t){if(null==e)return{};var a,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||(i[a]=e[a]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)a=o[n],t.indexOf(a)>=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(i[a]=e[a])}return i}function Qm(e){if("undefined"!=typeof window&&window.navigator)return!!navigator.userAgent.match(e)}var Zm=Qm(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ev=Qm(/Edge/i),tv=Qm(/firefox/i),av=Qm(/safari/i)&&!Qm(/chrome/i)&&!Qm(/android/i),nv=Qm(/iP(ad|od|hone)/i),iv=Qm(/chrome/i)&&Qm(/android/i),ov={capture:!1,passive:!1};function sv(e,t,a){e.addEventListener(t,a,!Zm&&ov)}function lv(e,t,a){e.removeEventListener(t,a,!Zm&&ov)}function rv(e,t){if(t){if(">"===t[0]&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch(e){return!1}return!1}}function cv(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function dv(e,t,a,n){if(e){a=a||document;do{if(null!=t&&(">"===t[0]?e.parentNode===a&&rv(e,t):rv(e,t))||n&&e===a)return e;if(e===a)break}while(e=cv(e))}return null}var uv,hv=/\s+/g;function pv(e,t,a){if(e&&t)if(e.classList)e.classList[a?"add":"remove"](t);else{var n=(" "+e.className+" ").replace(hv," ").replace(" "+t+" "," ");e.className=(n+(a?" "+t:"")).replace(hv," ")}}function mv(e,t,a){var n=e&&e.style;if(n){if(void 0===a)return document.defaultView&&document.defaultView.getComputedStyle?a=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(a=e.currentStyle),void 0===t?a:a[t];t in n||-1!==t.indexOf("webkit")||(t="-webkit-"+t),n[t]=a+("string"==typeof a?"":"px")}}function vv(e,t){var a="";if("string"==typeof e)a=e;else do{var n=mv(e,"transform");n&&"none"!==n&&(a=n+" "+a)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(a)}function gv(e,t,a){if(e){var n=e.getElementsByTagName(t),i=0,o=n.length;if(a)for(;i<o;i++)a(n[i],i);return n}return[]}function bv(){var e=document.scrollingElement;return e||document.documentElement}function fv(e,t,a,n,i){if(e.getBoundingClientRect||e===window){var o,s,l,r,c,d,u;if(e!==window&&e.parentNode&&e!==bv()?(s=(o=e.getBoundingClientRect()).top,l=o.left,r=o.bottom,c=o.right,d=o.height,u=o.width):(s=0,l=0,r=window.innerHeight,c=window.innerWidth,d=window.innerHeight,u=window.innerWidth),(t||a)&&e!==window&&(i=i||e.parentNode,!Zm))do{if(i&&i.getBoundingClientRect&&("none"!==mv(i,"transform")||a&&"static"!==mv(i,"position"))){var h=i.getBoundingClientRect();s-=h.top+parseInt(mv(i,"border-top-width")),l-=h.left+parseInt(mv(i,"border-left-width")),r=s+o.height,c=l+o.width;break}}while(i=i.parentNode);if(n&&e!==window){var p=vv(i||e),m=p&&p.a,v=p&&p.d;p&&(r=(s/=v)+(d/=v),c=(l/=m)+(u/=m))}return{top:s,left:l,bottom:r,right:c,width:u,height:d}}}function wv(e,t,a){for(var n=Sv(e,!0),i=fv(e)[t];n;){if(!(i>=fv(n)[a]))return n;if(n===bv())break;n=Sv(n,!1)}return!1}function yv(e,t,a,n){for(var i=0,o=0,s=e.children;o<s.length;){if("none"!==s[o].style.display&&s[o]!==kg.ghost&&(n||s[o]!==kg.dragged)&&dv(s[o],a.draggable,e,!1)){if(i===t)return s[o];i++}o++}return null}function Cv(e,t){for(var a=e.lastElementChild;a&&(a===kg.ghost||"none"===mv(a,"display")||t&&!rv(a,t));)a=a.previousElementSibling;return a||null}function Iv(e,t){var a=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)"TEMPLATE"===e.nodeName.toUpperCase()||e===kg.clone||t&&!rv(e,t)||a++;return a}function xv(e){var t=0,a=0,n=bv();if(e)do{var i=vv(e),o=i.a,s=i.d;t+=e.scrollLeft*o,a+=e.scrollTop*s}while(e!==n&&(e=e.parentNode));return[t,a]}function Sv(e,t){if(!e||!e.getBoundingClientRect)return bv();var a=e,n=!1;do{if(a.clientWidth<a.scrollWidth||a.clientHeight<a.scrollHeight){var i=mv(a);if(a.clientWidth<a.scrollWidth&&("auto"==i.overflowX||"scroll"==i.overflowX)||a.clientHeight<a.scrollHeight&&("auto"==i.overflowY||"scroll"==i.overflowY)){if(!a.getBoundingClientRect||a===document.body)return bv();if(n||t)return a;n=!0}}}while(a=a.parentNode);return bv()}function Ev(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}function Dv(e,t){return function(){if(!uv){var a=arguments;1===a.length?e.call(this,a[0]):e.apply(this,a),uv=setTimeout(function(){uv=void 0},t)}}}function Pv(e,t,a){e.scrollLeft+=t,e.scrollTop+=a}function kv(e){var t=window.Polymer,a=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):a?a(e).clone(!0)[0]:e.cloneNode(!0)}function zv(e,t,a){var n={};return Array.from(e.children).forEach(function(i){var o,s,l,r;if(dv(i,t.draggable,e,!1)&&!i.animated&&i!==a){var c=fv(i);n.left=Math.min(null!==(o=n.left)&&void 0!==o?o:1/0,c.left),n.top=Math.min(null!==(s=n.top)&&void 0!==s?s:1/0,c.top),n.right=Math.max(null!==(l=n.right)&&void 0!==l?l:-1/0,c.right),n.bottom=Math.max(null!==(r=n.bottom)&&void 0!==r?r:-1/0,c.bottom)}}),n.width=n.right-n.left,n.height=n.bottom-n.top,n.x=n.left,n.y=n.top,n}var Tv="Sortable"+(new Date).getTime();function Av(){var e,t=[];return{captureAnimationState:function(){(t=[],this.options.animation)&&[].slice.call(this.el.children).forEach(function(e){if("none"!==mv(e,"display")&&e!==kg.ghost){t.push({target:e,rect:fv(e)});var a=Ym({},t[t.length-1].rect);if(e.thisAnimationDuration){var n=vv(e,!0);n&&(a.top-=n.f,a.left-=n.e)}e.fromRect=a}})},addAnimationState:function(e){t.push(e)},removeAnimationState:function(e){t.splice(function(e,t){for(var a in e)if(e.hasOwnProperty(a))for(var n in t)if(t.hasOwnProperty(n)&&t[n]===e[a][n])return Number(a);return-1}(t,{target:e}),1)},animateAll:function(a){var n=this;if(!this.options.animation)return clearTimeout(e),void("function"==typeof a&&a());var i=!1,o=0;t.forEach(function(e){var t=0,a=e.target,s=a.fromRect,l=fv(a),r=a.prevFromRect,c=a.prevToRect,d=e.rect,u=vv(a,!0);u&&(l.top-=u.f,l.left-=u.e),a.toRect=l,a.thisAnimationDuration&&Ev(r,l)&&!Ev(s,l)&&(d.top-l.top)/(d.left-l.left)===(s.top-l.top)/(s.left-l.left)&&(t=function(e,t,a,n){return Math.sqrt(Math.pow(t.top-e.top,2)+Math.pow(t.left-e.left,2))/Math.sqrt(Math.pow(t.top-a.top,2)+Math.pow(t.left-a.left,2))*n.animation}(d,r,c,n.options)),Ev(l,s)||(a.prevFromRect=s,a.prevToRect=l,t||(t=n.options.animation),n.animate(a,d,l,t)),t&&(i=!0,o=Math.max(o,t),clearTimeout(a.animationResetTimer),a.animationResetTimer=setTimeout(function(){a.animationTime=0,a.prevFromRect=null,a.fromRect=null,a.prevToRect=null,a.thisAnimationDuration=null},t),a.thisAnimationDuration=t)}),clearTimeout(e),i?e=setTimeout(function(){"function"==typeof a&&a()},o):"function"==typeof a&&a(),t=[]},animate:function(e,t,a,n){if(n){mv(e,"transition",""),mv(e,"transform","");var i=vv(this.el),o=i&&i.a,s=i&&i.d,l=(t.left-a.left)/(o||1),r=(t.top-a.top)/(s||1);e.animatingX=!!l,e.animatingY=!!r,mv(e,"transform","translate3d("+l+"px,"+r+"px,0)"),this.forRepaintDummy=function(e){return e.offsetWidth}(e),mv(e,"transition","transform "+n+"ms"+(this.options.easing?" "+this.options.easing:"")),mv(e,"transform","translate3d(0,0,0)"),"number"==typeof e.animated&&clearTimeout(e.animated),e.animated=setTimeout(function(){mv(e,"transition",""),mv(e,"transform",""),e.animated=!1,e.animatingX=!1,e.animatingY=!1},n)}}}}var Ov=[],Mv={initializeByDefault:!0},Nv={mount:function(e){for(var t in Mv)Mv.hasOwnProperty(t)&&!(t in e)&&(e[t]=Mv[t]);Ov.forEach(function(t){if(t.pluginName===e.pluginName)throw"Sortable: Cannot mount plugin ".concat(e.pluginName," more than once")}),Ov.push(e)},pluginEvent:function(e,t,a){var n=this;this.eventCanceled=!1,a.cancel=function(){n.eventCanceled=!0};var i=e+"Global";Ov.forEach(function(n){t[n.pluginName]&&(t[n.pluginName][i]&&t[n.pluginName][i](Ym({sortable:t},a)),t.options[n.pluginName]&&t[n.pluginName][e]&&t[n.pluginName][e](Ym({sortable:t},a)))})},initializePlugins:function(e,t,a,n){for(var i in Ov.forEach(function(n){var i=n.pluginName;if(e.options[i]||n.initializeByDefault){var o=new n(e,t,e.options);o.sortable=e,o.options=e.options,e[i]=o,$m(a,o.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var o=this.modifyOption(e,i,e.options[i]);void 0!==o&&(e.options[i]=o)}},getEventProperties:function(e,t){var a={};return Ov.forEach(function(n){"function"==typeof n.eventProperties&&$m(a,n.eventProperties.call(t[n.pluginName],e))}),a},modifyOption:function(e,t,a){var n;return Ov.forEach(function(i){e[i.pluginName]&&i.optionListeners&&"function"==typeof i.optionListeners[t]&&(n=i.optionListeners[t].call(e[i.pluginName],a))}),n}};var Bv=["evt"],Lv=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=a.evt,i=Jm(a,Bv);Nv.pluginEvent.bind(kg)(e,t,Ym({dragEl:_v,parentEl:jv,ghostEl:Vv,rootEl:Fv,nextEl:Uv,lastDownEl:Hv,cloneEl:qv,cloneHidden:Gv,dragStarted:ig,putSortable:Jv,activeSortable:kg.active,originalEvent:n,oldIndex:Wv,oldDraggableIndex:Kv,newIndex:Yv,newDraggableIndex:Xv,hideGhostForTarget:Sg,unhideGhostForTarget:Eg,cloneNowHidden:function(){Gv=!0},cloneNowShown:function(){Gv=!1},dispatchSortableEvent:function(e){Rv({sortable:t,name:e,originalEvent:n})}},i))};function Rv(e){!function(e){var t=e.sortable,a=e.rootEl,n=e.name,i=e.targetEl,o=e.cloneEl,s=e.toEl,l=e.fromEl,r=e.oldIndex,c=e.newIndex,d=e.oldDraggableIndex,u=e.newDraggableIndex,h=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t=t||a&&a[Tv]){var v,g=t.options,b="on"+n.charAt(0).toUpperCase()+n.substr(1);!window.CustomEvent||Zm||ev?(v=document.createEvent("Event")).initEvent(n,!0,!0):v=new CustomEvent(n,{bubbles:!0,cancelable:!0}),v.to=s||a,v.from=l||a,v.item=i||a,v.clone=o,v.oldIndex=r,v.newIndex=c,v.oldDraggableIndex=d,v.newDraggableIndex=u,v.originalEvent=h,v.pullMode=p?p.lastPutMode:void 0;var f=Ym(Ym({},m),Nv.getEventProperties(n,t));for(var w in f)v[w]=f[w];a&&a.dispatchEvent(v),g[b]&&g[b].call(t,v)}}(Ym({putSortable:Jv,cloneEl:qv,targetEl:_v,rootEl:Fv,oldIndex:Wv,oldDraggableIndex:Kv,newIndex:Yv,newDraggableIndex:Xv},e))}var _v,jv,Vv,Fv,Uv,Hv,qv,Gv,Wv,Yv,Kv,Xv,$v,Jv,Qv,Zv,eg,tg,ag,ng,ig,og,sg,lg,rg,cg=!1,dg=!1,ug=[],hg=!1,pg=!1,mg=[],vg=!1,gg=[],bg="undefined"!=typeof document,fg=nv,wg=ev||Zm?"cssFloat":"float",yg=bg&&!iv&&!nv&&"draggable"in document.createElement("div"),Cg=function(){if(bg){if(Zm)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto","auto"===e.style.pointerEvents}}(),Ig=function(e,t){var a=mv(e),n=parseInt(a.width)-parseInt(a.paddingLeft)-parseInt(a.paddingRight)-parseInt(a.borderLeftWidth)-parseInt(a.borderRightWidth),i=yv(e,0,t),o=yv(e,1,t),s=i&&mv(i),l=o&&mv(o),r=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+fv(i).width,c=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+fv(o).width;if("flex"===a.display)return"column"===a.flexDirection||"column-reverse"===a.flexDirection?"vertical":"horizontal";if("grid"===a.display)return a.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(i&&s.float&&"none"!==s.float){var d="left"===s.float?"left":"right";return!o||"both"!==l.clear&&l.clear!==d?"horizontal":"vertical"}return i&&("block"===s.display||"flex"===s.display||"table"===s.display||"grid"===s.display||r>=n&&"none"===a[wg]||o&&"none"===a[wg]&&r+c>n)?"vertical":"horizontal"},xg=function(e){function t(e,a){return function(n,i,o,s){var l=n.options.group.name&&i.options.group.name&&n.options.group.name===i.options.group.name;if(null==e&&(a||l))return!0;if(null==e||!1===e)return!1;if(a&&"clone"===e)return e;if("function"==typeof e)return t(e(n,i,o,s),a)(n,i,o,s);var r=(a?n:i).options.group.name;return!0===e||"string"==typeof e&&e===r||e.join&&e.indexOf(r)>-1}}var a={},n=e.group;n&&"object"==Km(n)||(n={name:n}),a.name=n.name,a.checkPull=t(n.pull,!0),a.checkPut=t(n.put),a.revertClone=n.revertClone,e.group=a},Sg=function(){!Cg&&Vv&&mv(Vv,"display","none")},Eg=function(){!Cg&&Vv&&mv(Vv,"display","")};bg&&!iv&&document.addEventListener("click",function(e){if(dg)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),dg=!1,!1},!0);var Dg=function(e){if(_v){e=e.touches?e.touches[0]:e;var t=(i=e.clientX,o=e.clientY,ug.some(function(e){var t=e[Tv].options.emptyInsertThreshold;if(t&&!Cv(e)){var a=fv(e),n=i>=a.left-t&&i<=a.right+t,l=o>=a.top-t&&o<=a.bottom+t;return n&&l?s=e:void 0}}),s);if(t){var a={};for(var n in e)e.hasOwnProperty(n)&&(a[n]=e[n]);a.target=a.rootEl=t,a.preventDefault=void 0,a.stopPropagation=void 0,t[Tv]._onDragOver(a)}}var i,o,s},Pg=function(e){_v&&_v.parentNode[Tv]._isOutsideThisEl(e.target)};function kg(e,t){if(!e||!e.nodeType||1!==e.nodeType)throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=$m({},t),e[Tv]=this;var a={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Ig(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData("Text",t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:!1!==kg.supportPointer&&"PointerEvent"in window&&(!av||nv),emptyInsertThreshold:5};for(var n in Nv.initializePlugins(this,e,a),a)!(n in t)&&(t[n]=a[n]);for(var i in xg(t),this)"_"===i.charAt(0)&&"function"==typeof this[i]&&(this[i]=this[i].bind(this));this.nativeDraggable=!t.forceFallback&&yg,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?sv(e,"pointerdown",this._onTapStart):(sv(e,"mousedown",this._onTapStart),sv(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(sv(e,"dragover",this),sv(e,"dragenter",this)),ug.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),$m(this,Av())}function zg(e,t,a,n,i,o,s,l){var r,c,d=e[Tv],u=d.options.onMove;return!window.CustomEvent||Zm||ev?(r=document.createEvent("Event")).initEvent("move",!0,!0):r=new CustomEvent("move",{bubbles:!0,cancelable:!0}),r.to=t,r.from=e,r.dragged=a,r.draggedRect=n,r.related=i||t,r.relatedRect=o||fv(t),r.willInsertAfter=l,r.originalEvent=s,e.dispatchEvent(r),u&&(c=u.call(d,r,s)),c}function Tg(e){e.draggable=!1}function Ag(){vg=!1}function Og(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,a=t.length,n=0;a--;)n+=t.charCodeAt(a);return n.toString(36)}function Mg(e){return setTimeout(e,0)}function Ng(e){return clearTimeout(e)}kg.prototype={constructor:kg,_isOutsideThisEl:function(e){this.el.contains(e)||e===this.el||(og=null)},_getDirection:function(e,t){return"function"==typeof this.options.direction?this.options.direction.call(this,e,t,_v):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,a=this.el,n=this.options,i=n.preventOnFilter,o=e.type,s=e.touches&&e.touches[0]||e.pointerType&&"touch"===e.pointerType&&e,l=(s||e).target,r=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||l,c=n.filter;if(function(e){gg.length=0;var t=e.getElementsByTagName("input"),a=t.length;for(;a--;){var n=t[a];n.checked&&gg.push(n)}}(a),!_v&&!(/mousedown|pointerdown/.test(o)&&0!==e.button||n.disabled)&&!r.isContentEditable&&(this.nativeDraggable||!av||!l||"SELECT"!==l.tagName.toUpperCase())&&!((l=dv(l,n.draggable,a,!1))&&l.animated||Hv===l)){if(Wv=Iv(l),Kv=Iv(l,n.draggable),"function"==typeof c){if(c.call(this,e,l,this))return Rv({sortable:t,rootEl:r,name:"filter",targetEl:l,toEl:a,fromEl:a}),Lv("filter",t,{evt:e}),void(i&&e.preventDefault())}else if(c&&(c=c.split(",").some(function(n){if(n=dv(r,n.trim(),a,!1))return Rv({sortable:t,rootEl:n,name:"filter",targetEl:l,fromEl:a,toEl:a}),Lv("filter",t,{evt:e}),!0})))return void(i&&e.preventDefault());n.handle&&!dv(r,n.handle,a,!1)||this._prepareDragStart(e,s,l)}}},_prepareDragStart:function(e,t,a){var n,i=this,o=i.el,s=i.options,l=o.ownerDocument;if(a&&!_v&&a.parentNode===o){var r=fv(a);if(Fv=o,jv=(_v=a).parentNode,Uv=_v.nextSibling,Hv=a,$v=s.group,kg.dragged=_v,Qv={target:_v,clientX:(t||e).clientX,clientY:(t||e).clientY},ag=Qv.clientX-r.left,ng=Qv.clientY-r.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,_v.style["will-change"]="all",n=function(){Lv("delayEnded",i,{evt:e}),kg.eventCanceled?i._onDrop():(i._disableDelayedDragEvents(),!tv&&i.nativeDraggable&&(_v.draggable=!0),i._triggerDragStart(e,t),Rv({sortable:i,name:"choose",originalEvent:e}),pv(_v,s.chosenClass,!0))},s.ignore.split(",").forEach(function(e){gv(_v,e.trim(),Tg)}),sv(l,"dragover",Dg),sv(l,"mousemove",Dg),sv(l,"touchmove",Dg),s.supportPointer?(sv(l,"pointerup",i._onDrop),!this.nativeDraggable&&sv(l,"pointercancel",i._onDrop)):(sv(l,"mouseup",i._onDrop),sv(l,"touchend",i._onDrop),sv(l,"touchcancel",i._onDrop)),tv&&this.nativeDraggable&&(this.options.touchStartThreshold=4,_v.draggable=!0),Lv("delayStart",this,{evt:e}),!s.delay||s.delayOnTouchOnly&&!t||this.nativeDraggable&&(ev||Zm))n();else{if(kg.eventCanceled)return void this._onDrop();s.supportPointer?(sv(l,"pointerup",i._disableDelayedDrag),sv(l,"pointercancel",i._disableDelayedDrag)):(sv(l,"mouseup",i._disableDelayedDrag),sv(l,"touchend",i._disableDelayedDrag),sv(l,"touchcancel",i._disableDelayedDrag)),sv(l,"mousemove",i._delayedDragTouchMoveHandler),sv(l,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&sv(l,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(n,s.delay)}}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){_v&&Tg(_v),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;lv(e,"mouseup",this._disableDelayedDrag),lv(e,"touchend",this._disableDelayedDrag),lv(e,"touchcancel",this._disableDelayedDrag),lv(e,"pointerup",this._disableDelayedDrag),lv(e,"pointercancel",this._disableDelayedDrag),lv(e,"mousemove",this._delayedDragTouchMoveHandler),lv(e,"touchmove",this._delayedDragTouchMoveHandler),lv(e,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t=t||"touch"==e.pointerType&&e,!this.nativeDraggable||t?this.options.supportPointer?sv(document,"pointermove",this._onTouchMove):sv(document,t?"touchmove":"mousemove",this._onTouchMove):(sv(_v,"dragend",this),sv(Fv,"dragstart",this._onDragStart));try{document.selection?Mg(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch(e){}},_dragStarted:function(e,t){if(cg=!1,Fv&&_v){Lv("dragStarted",this,{evt:t}),this.nativeDraggable&&sv(document,"dragover",Pg);var a=this.options;!e&&pv(_v,a.dragClass,!1),pv(_v,a.ghostClass,!0),kg.active=this,e&&this._appendGhost(),Rv({sortable:this,name:"start",originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(Zv){this._lastX=Zv.clientX,this._lastY=Zv.clientY,Sg();for(var e=document.elementFromPoint(Zv.clientX,Zv.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(Zv.clientX,Zv.clientY))!==t;)t=e;if(_v.parentNode[Tv]._isOutsideThisEl(e),t)do{if(t[Tv]){if(t[Tv]._onDragOver({clientX:Zv.clientX,clientY:Zv.clientY,target:e,rootEl:t})&&!this.options.dragoverBubble)break}e=t}while(t=cv(t));Eg()}},_onTouchMove:function(e){if(Qv){var t=this.options,a=t.fallbackTolerance,n=t.fallbackOffset,i=e.touches?e.touches[0]:e,o=Vv&&vv(Vv,!0),s=Vv&&o&&o.a,l=Vv&&o&&o.d,r=fg&&rg&&xv(rg),c=(i.clientX-Qv.clientX+n.x)/(s||1)+(r?r[0]-mg[0]:0)/(s||1),d=(i.clientY-Qv.clientY+n.y)/(l||1)+(r?r[1]-mg[1]:0)/(l||1);if(!kg.active&&!cg){if(a&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<a)return;this._onDragStart(e,!0)}if(Vv){o?(o.e+=c-(eg||0),o.f+=d-(tg||0)):o={a:1,b:0,c:0,d:1,e:c,f:d};var u="matrix(".concat(o.a,",").concat(o.b,",").concat(o.c,",").concat(o.d,",").concat(o.e,",").concat(o.f,")");mv(Vv,"webkitTransform",u),mv(Vv,"mozTransform",u),mv(Vv,"msTransform",u),mv(Vv,"transform",u),eg=c,tg=d,Zv=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!Vv){var e=this.options.fallbackOnBody?document.body:Fv,t=fv(_v,!0,fg,!0,e),a=this.options;if(fg){for(rg=e;"static"===mv(rg,"position")&&"none"===mv(rg,"transform")&&rg!==document;)rg=rg.parentNode;rg!==document.body&&rg!==document.documentElement?(rg===document&&(rg=bv()),t.top+=rg.scrollTop,t.left+=rg.scrollLeft):rg=bv(),mg=xv(rg)}pv(Vv=_v.cloneNode(!0),a.ghostClass,!1),pv(Vv,a.fallbackClass,!0),pv(Vv,a.dragClass,!0),mv(Vv,"transition",""),mv(Vv,"transform",""),mv(Vv,"box-sizing","border-box"),mv(Vv,"margin",0),mv(Vv,"top",t.top),mv(Vv,"left",t.left),mv(Vv,"width",t.width),mv(Vv,"height",t.height),mv(Vv,"opacity","0.8"),mv(Vv,"position",fg?"absolute":"fixed"),mv(Vv,"zIndex","100000"),mv(Vv,"pointerEvents","none"),kg.ghost=Vv,e.appendChild(Vv),mv(Vv,"transform-origin",ag/parseInt(Vv.style.width)*100+"% "+ng/parseInt(Vv.style.height)*100+"%")}},_onDragStart:function(e,t){var a=this,n=e.dataTransfer,i=a.options;Lv("dragStart",this,{evt:e}),kg.eventCanceled?this._onDrop():(Lv("setupClone",this),kg.eventCanceled||((qv=kv(_v)).removeAttribute("id"),qv.draggable=!1,qv.style["will-change"]="",this._hideClone(),pv(qv,this.options.chosenClass,!1),kg.clone=qv),a.cloneId=Mg(function(){Lv("clone",a),kg.eventCanceled||(a.options.removeCloneOnHide||Fv.insertBefore(qv,_v),a._hideClone(),Rv({sortable:a,name:"clone"}))}),!t&&pv(_v,i.dragClass,!0),t?(dg=!0,a._loopId=setInterval(a._emulateDragOver,50)):(lv(document,"mouseup",a._onDrop),lv(document,"touchend",a._onDrop),lv(document,"touchcancel",a._onDrop),n&&(n.effectAllowed="move",i.setData&&i.setData.call(a,n,_v)),sv(document,"drop",a),mv(_v,"transform","translateZ(0)")),cg=!0,a._dragStartId=Mg(a._dragStarted.bind(a,t,e)),sv(document,"selectstart",a),ig=!0,window.getSelection().removeAllRanges(),av&&mv(document.body,"user-select","none"))},_onDragOver:function(e){var t,a,n,i,o=this.el,s=e.target,l=this.options,r=l.group,c=kg.active,d=$v===r,u=l.sort,h=Jv||c,p=this,m=!1;if(!vg){if(void 0!==e.preventDefault&&e.cancelable&&e.preventDefault(),s=dv(s,l.draggable,o,!0),z("dragOver"),kg.eventCanceled)return m;if(_v.contains(e.target)||s.animated&&s.animatingX&&s.animatingY||p._ignoreWhileAnimating===s)return A(!1);if(dg=!1,c&&!l.disabled&&(d?u||(n=jv!==Fv):Jv===this||(this.lastPutMode=$v.checkPull(this,c,_v,e))&&r.checkPut(this,c,_v,e))){if(i="vertical"===this._getDirection(e,s),t=fv(_v),z("dragOverValid"),kg.eventCanceled)return m;if(n)return jv=Fv,T(),this._hideClone(),z("revert"),kg.eventCanceled||(Uv?Fv.insertBefore(_v,Uv):Fv.appendChild(_v)),A(!0);var v=Cv(o,l.draggable);if(!v||function(e,t,a){var n=fv(Cv(a.el,a.options.draggable)),i=zv(a.el,a.options,Vv),o=10;return t?e.clientX>i.right+o||e.clientY>n.bottom&&e.clientX>n.left:e.clientY>i.bottom+o||e.clientX>n.right&&e.clientY>n.top}(e,i,this)&&!v.animated){if(v===_v)return A(!1);if(v&&o===e.target&&(s=v),s&&(a=fv(s)),!1!==zg(Fv,o,_v,t,s,a,e,!!s))return T(),v&&v.nextSibling?o.insertBefore(_v,v.nextSibling):o.appendChild(_v),jv=o,O(),A(!0)}else if(v&&function(e,t,a){var n=fv(yv(a.el,0,a.options,!0)),i=zv(a.el,a.options,Vv),o=10;return t?e.clientX<i.left-o||e.clientY<n.top&&e.clientX<n.right:e.clientY<i.top-o||e.clientY<n.bottom&&e.clientX<n.left}(e,i,this)){var g=yv(o,0,l,!0);if(g===_v)return A(!1);if(a=fv(s=g),!1!==zg(Fv,o,_v,t,s,a,e,!1))return T(),o.insertBefore(_v,g),jv=o,O(),A(!0)}else if(s.parentNode===o){a=fv(s);var b,f,w,y=_v.parentNode!==o,C=!function(e,t,a){var n=a?e.left:e.top,i=a?e.right:e.bottom,o=a?e.width:e.height,s=a?t.left:t.top,l=a?t.right:t.bottom,r=a?t.width:t.height;return n===s||i===l||n+o/2===s+r/2}(_v.animated&&_v.toRect||t,s.animated&&s.toRect||a,i),I=i?"top":"left",x=wv(s,"top","top")||wv(_v,"top","top"),S=x?x.scrollTop:void 0;if(og!==s&&(f=a[I],hg=!1,pg=!C&&l.invertSwap||y),b=function(e,t,a,n,i,o,s,l){var r=n?e.clientY:e.clientX,c=n?a.height:a.width,d=n?a.top:a.left,u=n?a.bottom:a.right,h=!1;if(!s)if(l&&lg<c*i){if(!hg&&(1===sg?r>d+c*o/2:r<u-c*o/2)&&(hg=!0),hg)h=!0;else if(1===sg?r<d+lg:r>u-lg)return-sg}else if(r>d+c*(1-i)/2&&r<u-c*(1-i)/2)return function(e){return Iv(_v)<Iv(e)?1:-1}(t);if((h=h||s)&&(r<d+c*o/2||r>u-c*o/2))return r>d+c/2?1:-1;return 0}(e,s,a,i,C?1:l.swapThreshold,null==l.invertedSwapThreshold?l.swapThreshold:l.invertedSwapThreshold,pg,og===s),0!==b){var E=Iv(_v);do{E-=b,w=jv.children[E]}while(w&&("none"===mv(w,"display")||w===Vv))}if(0===b||w===s)return A(!1);og=s,sg=b;var D=s.nextElementSibling,P=!1,k=zg(Fv,o,_v,t,s,a,e,P=1===b);if(!1!==k)return 1!==k&&-1!==k||(P=1===k),vg=!0,setTimeout(Ag,30),T(),P&&!D?o.appendChild(_v):s.parentNode.insertBefore(_v,P?D:s),x&&Pv(x,0,S-x.scrollTop),jv=_v.parentNode,void 0===f||pg||(lg=Math.abs(f-fv(s)[I])),O(),A(!0)}if(o.contains(_v))return A(!1)}return!1}function z(l,r){Lv(l,p,Ym({evt:e,isOwner:d,axis:i?"vertical":"horizontal",revert:n,dragRect:t,targetRect:a,canSort:u,fromSortable:h,target:s,completed:A,onMove:function(a,n){return zg(Fv,o,_v,t,a,fv(a),e,n)},changed:O},r))}function T(){z("dragOverAnimationCapture"),p.captureAnimationState(),p!==h&&h.captureAnimationState()}function A(t){return z("dragOverCompleted",{insertion:t}),t&&(d?c._hideClone():c._showClone(p),p!==h&&(pv(_v,Jv?Jv.options.ghostClass:c.options.ghostClass,!1),pv(_v,l.ghostClass,!0)),Jv!==p&&p!==kg.active?Jv=p:p===kg.active&&Jv&&(Jv=null),h===p&&(p._ignoreWhileAnimating=s),p.animateAll(function(){z("dragOverAnimationComplete"),p._ignoreWhileAnimating=null}),p!==h&&(h.animateAll(),h._ignoreWhileAnimating=null)),(s===_v&&!_v.animated||s===o&&!s.animated)&&(og=null),l.dragoverBubble||e.rootEl||s===document||(_v.parentNode[Tv]._isOutsideThisEl(e.target),!t&&Dg(e)),!l.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function O(){Yv=Iv(_v),Xv=Iv(_v,l.draggable),Rv({sortable:p,name:"change",toEl:o,newIndex:Yv,newDraggableIndex:Xv,originalEvent:e})}},_ignoreWhileAnimating:null,_offMoveEvents:function(){lv(document,"mousemove",this._onTouchMove),lv(document,"touchmove",this._onTouchMove),lv(document,"pointermove",this._onTouchMove),lv(document,"dragover",Dg),lv(document,"mousemove",Dg),lv(document,"touchmove",Dg)},_offUpEvents:function(){var e=this.el.ownerDocument;lv(e,"mouseup",this._onDrop),lv(e,"touchend",this._onDrop),lv(e,"pointerup",this._onDrop),lv(e,"pointercancel",this._onDrop),lv(e,"touchcancel",this._onDrop),lv(document,"selectstart",this)},_onDrop:function(e){var t=this.el,a=this.options;Yv=Iv(_v),Xv=Iv(_v,a.draggable),Lv("drop",this,{evt:e}),jv=_v&&_v.parentNode,Yv=Iv(_v),Xv=Iv(_v,a.draggable),kg.eventCanceled||(cg=!1,pg=!1,hg=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),Ng(this.cloneId),Ng(this._dragStartId),this.nativeDraggable&&(lv(document,"drop",this),lv(t,"dragstart",this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),av&&mv(document.body,"user-select",""),mv(_v,"transform",""),e&&(ig&&(e.cancelable&&e.preventDefault(),!a.dropBubble&&e.stopPropagation()),Vv&&Vv.parentNode&&Vv.parentNode.removeChild(Vv),(Fv===jv||Jv&&"clone"!==Jv.lastPutMode)&&qv&&qv.parentNode&&qv.parentNode.removeChild(qv),_v&&(this.nativeDraggable&&lv(_v,"dragend",this),Tg(_v),_v.style["will-change"]="",ig&&!cg&&pv(_v,Jv?Jv.options.ghostClass:this.options.ghostClass,!1),pv(_v,this.options.chosenClass,!1),Rv({sortable:this,name:"unchoose",toEl:jv,newIndex:null,newDraggableIndex:null,originalEvent:e}),Fv!==jv?(Yv>=0&&(Rv({rootEl:jv,name:"add",toEl:jv,fromEl:Fv,originalEvent:e}),Rv({sortable:this,name:"remove",toEl:jv,originalEvent:e}),Rv({rootEl:jv,name:"sort",toEl:jv,fromEl:Fv,originalEvent:e}),Rv({sortable:this,name:"sort",toEl:jv,originalEvent:e})),Jv&&Jv.save()):Yv!==Wv&&Yv>=0&&(Rv({sortable:this,name:"update",toEl:jv,originalEvent:e}),Rv({sortable:this,name:"sort",toEl:jv,originalEvent:e})),kg.active&&(null!=Yv&&-1!==Yv||(Yv=Wv,Xv=Kv),Rv({sortable:this,name:"end",toEl:jv,originalEvent:e}),this.save())))),this._nulling()},_nulling:function(){Lv("nulling",this),Fv=_v=jv=Vv=Uv=qv=Hv=Gv=Qv=Zv=ig=Yv=Xv=Wv=Kv=og=sg=Jv=$v=kg.dragged=kg.ghost=kg.clone=kg.active=null,gg.forEach(function(e){e.checked=!0}),gg.length=eg=tg=0},handleEvent:function(e){switch(e.type){case"drop":case"dragend":this._onDrop(e);break;case"dragenter":case"dragover":_v&&(this._onDragOver(e),function(e){e.dataTransfer&&(e.dataTransfer.dropEffect="move");e.cancelable&&e.preventDefault()}(e));break;case"selectstart":e.preventDefault()}},toArray:function(){for(var e,t=[],a=this.el.children,n=0,i=a.length,o=this.options;n<i;n++)dv(e=a[n],o.draggable,this.el,!1)&&t.push(e.getAttribute(o.dataIdAttr)||Og(e));return t},sort:function(e,t){var a={},n=this.el;this.toArray().forEach(function(e,t){var i=n.children[t];dv(i,this.options.draggable,n,!1)&&(a[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){a[e]&&(n.removeChild(a[e]),n.appendChild(a[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return dv(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var a=this.options;if(void 0===t)return a[e];var n=Nv.modifyOption(this,e,t);a[e]=void 0!==n?n:t,"group"===e&&xg(a)},destroy:function(){Lv("destroy",this);var e=this.el;e[Tv]=null,lv(e,"mousedown",this._onTapStart),lv(e,"touchstart",this._onTapStart),lv(e,"pointerdown",this._onTapStart),this.nativeDraggable&&(lv(e,"dragover",this),lv(e,"dragenter",this)),Array.prototype.forEach.call(e.querySelectorAll("[draggable]"),function(e){e.removeAttribute("draggable")}),this._onDrop(),this._disableDelayedDragEvents(),ug.splice(ug.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!Gv){if(Lv("hideClone",this),kg.eventCanceled)return;mv(qv,"display","none"),this.options.removeCloneOnHide&&qv.parentNode&&qv.parentNode.removeChild(qv),Gv=!0}},_showClone:function(e){if("clone"===e.lastPutMode){if(Gv){if(Lv("showClone",this),kg.eventCanceled)return;_v.parentNode!=Fv||this.options.group.revertClone?Uv?Fv.insertBefore(qv,Uv):Fv.appendChild(qv):Fv.insertBefore(qv,_v),this.options.group.revertClone&&this.animate(_v,qv),mv(qv,"display",""),Gv=!1}}else this._hideClone()}},bg&&sv(document,"touchmove",function(e){(kg.active||cg)&&e.cancelable&&e.preventDefault()}),kg.utils={on:sv,off:lv,css:mv,find:gv,is:function(e,t){return!!dv(e,t,e,!1)},extend:function(e,t){if(e&&t)for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a]);return e},throttle:Dv,closest:dv,toggleClass:pv,clone:kv,index:Iv,nextTick:Mg,cancelNextTick:Ng,detectDirection:Ig,getChild:yv,expando:Tv},kg.get=function(e){return e[Tv]},kg.mount=function(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw"Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(e));e.utils&&(kg.utils=Ym(Ym({},kg.utils),e.utils)),Nv.mount(e)})},kg.create=function(e,t){return new kg(e,t)},kg.version="1.15.6";var Bg,Lg,Rg,_g,jg,Vg,Fg=[],Ug=!1;function Hg(){Fg.forEach(function(e){clearInterval(e.pid)}),Fg=[]}function qg(){clearInterval(Vg)}var Gg=Dv(function(e,t,a,n){if(t.scroll){var i,o=(e.touches?e.touches[0]:e).clientX,s=(e.touches?e.touches[0]:e).clientY,l=t.scrollSensitivity,r=t.scrollSpeed,c=bv(),d=!1;Lg!==a&&(Lg=a,Hg(),Bg=t.scroll,i=t.scrollFn,!0===Bg&&(Bg=Sv(a,!0)));var u=0,h=Bg;do{var p=h,m=fv(p),v=m.top,g=m.bottom,b=m.left,f=m.right,w=m.width,y=m.height,C=void 0,I=void 0,x=p.scrollWidth,S=p.scrollHeight,E=mv(p),D=p.scrollLeft,P=p.scrollTop;p===c?(C=w<x&&("auto"===E.overflowX||"scroll"===E.overflowX||"visible"===E.overflowX),I=y<S&&("auto"===E.overflowY||"scroll"===E.overflowY||"visible"===E.overflowY)):(C=w<x&&("auto"===E.overflowX||"scroll"===E.overflowX),I=y<S&&("auto"===E.overflowY||"scroll"===E.overflowY));var k=C&&(Math.abs(f-o)<=l&&D+w<x)-(Math.abs(b-o)<=l&&!!D),z=I&&(Math.abs(g-s)<=l&&P+y<S)-(Math.abs(v-s)<=l&&!!P);if(!Fg[u])for(var T=0;T<=u;T++)Fg[T]||(Fg[T]={});Fg[u].vx==k&&Fg[u].vy==z&&Fg[u].el===p||(Fg[u].el=p,Fg[u].vx=k,Fg[u].vy=z,clearInterval(Fg[u].pid),0==k&&0==z||(d=!0,Fg[u].pid=setInterval(function(){n&&0===this.layer&&kg.active._onTouchMove(jg);var t=Fg[this.layer].vy?Fg[this.layer].vy*r:0,a=Fg[this.layer].vx?Fg[this.layer].vx*r:0;"function"==typeof i&&"continue"!==i.call(kg.dragged.parentNode[Tv],a,t,e,jg,Fg[this.layer].el)||Pv(Fg[this.layer].el,a,t)}.bind({layer:u}),24))),u++}while(t.bubbleScroll&&h!==c&&(h=Sv(h,!1)));Ug=d}},30),Wg=function(e){var t=e.originalEvent,a=e.putSortable,n=e.dragEl,i=e.activeSortable,o=e.dispatchSortableEvent,s=e.hideGhostForTarget,l=e.unhideGhostForTarget;if(t){var r=a||i;s();var c=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,d=document.elementFromPoint(c.clientX,c.clientY);l(),r&&!r.el.contains(d)&&(o("spill"),this.onSpill({dragEl:n,putSortable:a}))}};function Yg(){}function Kg(){}function Xg(e,t){let a=[],n=1;const i=o([]),s=e=>{n=1,a=null!=e?e:[],i.value=a.slice(0,t)};s(e);return{renderItems:i,loadMore:()=>{if(i.value.length>=a.length)return;n+=1;const e=(n-1)*t,o=n*t;i.value.push(...a.slice(e,o))},updateTotalItems:s}}function $g(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}Yg.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,a=e.putSortable;this.sortable.captureAnimationState(),a&&a.captureAnimationState();var n=yv(this.sortable.el,this.startIndex,this.options);n?this.sortable.el.insertBefore(t,n):this.sortable.el.appendChild(t),this.sortable.animateAll(),a&&a.animateAll()},drop:Wg},$m(Yg,{pluginName:"revertOnSpill"}),Kg.prototype={onSpill:function(e){var t=e.dragEl,a=e.putSortable||this.sortable;a.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),a.animateAll()},drop:Wg},$m(Kg,{pluginName:"removeOnSpill"}),kg.mount(new function(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)"_"===e.charAt(0)&&"function"==typeof this[e]&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?sv(document,"dragover",this._handleAutoScroll):this.options.supportPointer?sv(document,"pointermove",this._handleFallbackAutoScroll):t.touches?sv(document,"touchmove",this._handleFallbackAutoScroll):sv(document,"mousemove",this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;this.options.dragOverBubble||t.rootEl||this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?lv(document,"dragover",this._handleAutoScroll):(lv(document,"pointermove",this._handleFallbackAutoScroll),lv(document,"touchmove",this._handleFallbackAutoScroll),lv(document,"mousemove",this._handleFallbackAutoScroll)),qg(),Hg(),clearTimeout(uv),uv=void 0},nulling:function(){jg=Lg=Bg=Ug=Vg=Rg=_g=null,Fg.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var a=this,n=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,o=document.elementFromPoint(n,i);if(jg=e,t||this.options.forceAutoScrollFallback||ev||Zm||av){Gg(e,this.options,o,t);var s=Sv(o,!0);!Ug||Vg&&n===Rg&&i===_g||(Vg&&qg(),Vg=setInterval(function(){var o=Sv(document.elementFromPoint(n,i),!0);o!==s&&(s=o,Hg()),Gg(e,a.options,o,t)},10),Rg=n,_g=i)}else{if(!this.options.bubbleScroll||Sv(o,!0)===bv())return void Hg();Gg(e,this.options,Sv(o,!1),!1)}}},$m(e,{pluginName:"scroll",initializeByDefault:!0})}),kg.mount(Kg,Yg);const Jg=a({name:"IBizRepeaterGrid",props:{controller:{type:gn,required:!0}},emits:{change:e=>!0},setup(e,{emit:t}){var a,s;const l=B("repeater-grid"),r=[],d=o(),p=o(go()),m=(null==(a=e.controller.model.ctrlParams)?void 0:a.chunkSize)?Number(null==(s=e.controller.model.ctrlParams)?void 0:s.chunkSize):100,{renderItems:v,loadMore:g,updateTotalItems:b}=Xg(e.controller.value,m);qt(e.controller.repeatedForm,e=>{var t;"FORMITEM"===e.detailType&&"HIDDEN"!==(null==(t=e.editor)?void 0:t.editorType)&&r.push(e)},{childrenFields:["deformPages","deformTabPages","deformDetails"]});const f=pe(),w=u([]),y=async(a={})=>{const n=new bn(e.controller.repeatedForm,e.controller.context,e.controller.params,f);n.state.isSimple=!0,await n.created(),n.setSimpleData(a),w.push(n),e.controller.setRepeaterController("".concat(w.length-1),n),n.evt.on("onFormDataChange",a=>{const i=a.data[0];((a,n)=>{const i=[...e.controller.value];i[n]=a,t("change",i)})(i instanceof ma?i.clone():{...i},w.indexOf(n))})};let C;c(()=>e.controller.value,e=>{e&&e.length>0&&(e.forEach((e,t)=>{const a=w[t];if(a){const t=e||{};Object.keys(a.data).find(e=>t[e]!==a.data[e])&&a.setSimpleData(t)}else y(e)}),e.length<w.length&&w.forEach((t,a)=>{a>=e.length&&(t.state.isLoaded=!1)})),b(e||[])},{immediate:!0,deep:!0});c(()=>d.value,()=>{e.controller.enableSort&&(d.value?(()=>{var t,a;const n=null==(a=null==(t=d.value)?void 0:t.$el)?void 0:a.querySelector(".el-table__body-wrapper tbody");n&&e.controller.enableSort&&(C=kg.create(n,{animation:150,handle:".".concat(l.e("drag-icon")),ghostClass:"".concat(l.e("sortable-ghost")),onEnd({newIndex:t,oldIndex:a}){e.controller.dragChange(a,t),p.value=go()}}))})():null==C||C.destroy())}),h(()=>null==C?void 0:C.destroy());return{ns:l,tableRef:d,tableKey:p,formItems:r,renderItems:v,formControllers:w,renderRemoveBtn:t=>{let a;return e.controller.enableDelete?ibiz.config.form.mdCtrlConfirmBeforeRemove?n(i("el-popconfirm"),{title:Tt(ibiz.i18n.t("control.form.repeaterGrid.promptInformation")),"confirm-button-text":ibiz.i18n.t("app.confirm"),"cancel-button-text":ibiz.i18n.t("app.cancel"),onConfirm:()=>e.controller.remove(t)},{reference:()=>{let e;return n(i("el-button"),{text:!0,type:"danger",class:[l.be("index","remove")]},$g(e=ibiz.i18n.t("app.delete"))?e:{default:()=>[e]})}}):n(i("el-button"),{text:!0,type:"danger",class:[l.be("index","remove")],onClick:()=>e.controller.remove(t)},$g(a=ibiz.i18n.t("app.delete"))?a:{default:()=>[a]}):null},loadMore:g}},render(){var e;let t;const a=null==(e=this.controller.model.layoutPos)?void 0:e.height,o=a?{height:a}:{};return n("div",{class:this.ns.b()},[this.controller.enableCreate&&n(i("el-button"),{class:this.ns.e("add-btn"),onClick:()=>{this.controller.create()}},$g(t=ibiz.i18n.t("app.add"))?t:{default:()=>[t]}),n(i("el-table"),y({ref:"tableRef",key:this.tableKey,"show-header":!0,class:this.ns.e("table"),data:this.renderItems,"cell-class-name":({columnIndex:e})=>(this.controller.enableSort?1===e:0===e)?this.ns.b("index"):""},o),{default:()=>[this.controller.enableSort&&n(i("el-table-column"),{width:26,type:"default"},{default:()=>n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:this.ns.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])])}),n(i("el-table-column"),{type:"index",width:66,align:"center"},{default:e=>{const{$index:t}=e;return this.controller.enableDelete?[this.renderRemoveBtn(t),n("span",{class:this.ns.be("index","text")},[t+1])]:n("span",null,[t+1])}}),this.formItems.length>0&&this.formItems.map(e=>{const t=e.labelWidth;let a="width",o="";return"number"==typeof t&&(1===t&&(a="min-width"),o="".concat(t,"px")),n(i("el-table-column"),y({label:e.caption,prop:e.id},{[a]:o},{align:"center"}),{default:t=>{const{$index:a}=t,o=k(this.formControllers[a]);if(!o||!o.state.isLoaded)return n("div",null,[ibiz.i18n.t("control.form.repeaterGrid.absentOrLoad")]);const s=o.formItems.find(t=>t.name===e.id);let r=null;if(s.editorProvider){const e=i(s.editorProvider.formEditor);r=l(e,{value:s.value,data:s.data,controller:s.editor,disabled:s.state.disabled,readonly:s.state.readonly,onChange:(e,t)=>{s.setDataValue(e,t)}})}else r=n(i("not-supported-editor"),{modelData:e.editor},null);return n(i("iBizGridEditItem"),{error:s.state.error,required:s.state.required},$g(r)?r:{default:()=>[r]})}})})],append:()=>[a&&b(n("div",{"infinite-scroll-distance":20},null),[[C("infinite-scroll"),()=>this.loadMore()]])]})])}});const Qg=a({name:"IBizRepeaterGrid2",props:{controller:{type:gn,required:!0}},emits:{change:e=>!0},setup(e,{emit:t}){var a,s;const l=B("repeater-grid2"),r=[],d=o(),p=o(go()),m=(null==(a=e.controller.model.ctrlParams)?void 0:a.chunkSize)?Number(null==(s=e.controller.model.ctrlParams)?void 0:s.chunkSize):100,{renderItems:v,loadMore:g,updateTotalItems:b}=Xg(e.controller.value,m);qt(e.controller.repeatedForm,e=>{var t;"FORMITEM"===e.detailType&&"HIDDEN"!==(null==(t=e.editor)?void 0:t.editorType)&&r.push(e)},{childrenFields:["deformPages","deformTabPages","deformDetails"]});const f=pe(),w=u([]),y=async(a={})=>{const n=new bn(e.controller.repeatedForm,e.controller.context,e.controller.params,f);n.state.isSimple=!0,await n.created(),n.setSimpleData(a),w.push(n),e.controller.setRepeaterController("".concat(w.length-1),n),n.evt.on("onFormDataChange",a=>{const i=a.data[0];((a,n)=>{const i=[...e.controller.value||[]];i[n]=a,t("change",i)})(i instanceof ma?i.clone():{...i},w.indexOf(n))})};let C;c(()=>e.controller.value,e=>{e&&e.length>0&&e.forEach((e,t)=>{const a=w[t];if(a){const t=e||{};Object.keys(a.data).find(e=>t[e]!==a.data[e])&&a.setSimpleData(t)}else y(e)}),b(e||[])},{immediate:!0,deep:!0});c(()=>d.value,()=>{e.controller.enableSort&&(d.value?(()=>{var t,a;const n=null==(a=null==(t=d.value)?void 0:t.$el)?void 0:a.querySelector(".el-table__body-wrapper tbody");n&&e.controller.enableSort&&(C=kg.create(n,{animation:150,handle:".".concat(l.e("drag-icon")),ghostClass:"".concat(l.e("sortable-ghost")),onEnd({newIndex:t,oldIndex:a}){e.controller.dragChange(a,t),p.value=go()}}))})():null==C||C.destroy())}),h(()=>null==C?void 0:C.destroy());return{ns:l,tableRef:d,tableKey:p,formItems:r,renderItems:v,formControllers:w,renderRemoveBtn:t=>ibiz.config.form.mdCtrlConfirmBeforeRemove?n(i("el-popconfirm"),{title:ibiz.i18n.t("control.form.repeaterGrid.promptInformation"),"confirm-button-text":ibiz.i18n.t("app.confirm"),"cancel-button-text":ibiz.i18n.t("app.cancel"),onConfirm:()=>{e.controller.remove(t),w.splice(t,1)}},{reference:()=>n("ion-icon",{name:"remove-outline",title:ibiz.i18n.t("app.delete"),class:l.b("remove-btn")},null)}):n("ion-icon",{name:"remove-outline",title:ibiz.i18n.t("app.delete"),class:l.b("remove-btn"),onClick:()=>{e.controller.remove(t),w.splice(t,1)}},null),loadMore:g}},render(){var e;const t=null==(e=this.controller.model.layoutPos)?void 0:e.height,a=t?{height:t}:{},o=0===this.renderItems.length;return n("div",{class:this.ns.b()},[n(i("el-table"),y({ref:"tableRef",key:this.tableKey,"show-header":!0,class:this.ns.e("table"),data:o&&this.controller.enableCreate?[{}]:this.renderItems,"cell-class-name":({columnIndex:e})=>(this.controller.enableSort?1===e:0===e)?this.ns.b("index"):""},a),{default:()=>[this.controller.enableSort&&n(i("el-table-column"),{width:26,type:"default"},{default:()=>o?"":n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:this.ns.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])])}),n(i("el-table-column"),{type:"index",width:66,align:"center"},{default:e=>{if(o)return"";const{$index:t}=e;return n("span",null,[t+1])}}),this.formItems.length>0&&this.formItems.map(e=>{const t=e.labelWidth;let a="width",r="";return"number"==typeof t&&(1===t&&(a="min-width"),r="".concat(t,"px")),n(i("el-table-column"),y({label:e.caption,prop:e.id},{[a]:r},{align:"center"}),{default:t=>{if(o)return"";const{$index:a}=t,r=k(this.formControllers[a]);if(!r||!r.state.isLoaded)return n("div",null,[ibiz.i18n.t("control.form.repeaterGrid.absentOrLoad")]);const c=r.formItems.find(t=>t.name===e.id);let d=null;if(c.editorProvider){const e=i(c.editorProvider.formEditor);d=l(e,{value:c.value,data:c.data,controller:c.editor,disabled:c.state.disabled,readonly:c.state.readonly,onChange:(e,t)=>{c.setDataValue(e,t)}})}else d=n(i("not-supported-editor"),{modelData:e.editor},null);return n(i("iBizGridEditItem"),{error:c.state.error,required:c.state.required},"function"==typeof(u=d)||"[object Object]"===Object.prototype.toString.call(u)&&!s(u)?d:{default:()=>[d]});var u}})}),(this.controller.enableCreate||this.controller.enableDelete)&&n(i("el-table-column"),{width:80,align:"center"},{default:e=>{const{$index:t}=e;return n("div",{class:this.ns.b("action-group")},[this.controller.enableCreate&&n("ion-icon",{name:"add-outline",title:ibiz.i18n.t("app.add"),class:this.ns.b("add-btn"),onClick:()=>{this.controller.create(o?0:t+1)}},null),this.controller.enableDelete&&!o&&this.renderRemoveBtn(t)])}})],append:()=>[t&&b(n("div",{"infinite-scroll-distance":20},null),[[C("infinite-scroll"),()=>this.loadMore()]])]})])}}),Zg=a({name:"IBizFormMDCtrlRepeater",props:{controller:{type:gn,required:!0}},setup:e=>({ns:B("form-mdctrl-repeater"),onDataChange:t=>{e.controller.setValue(t)}}),render(){var e;const t=[this.ns.b()];switch(this.controller.repeaterStyle){case"MultiForm":return n(Gm,{class:t,onChange:this.onDataChange,controller:this.controller},null);case"Grid":const a=null==(e=this.controller.model.ctrlParams)?void 0:e.gridStyle;return n("style2"===a?Qg:Jg,{class:t,controller:this.controller,onChange:this.onDataChange},null);case"SingleForm":return n(qm,{class:t,data:this.controller.value,controller:this.controller,onChange:this.onDataChange},null);default:return n("div",{class:t},[ibiz.i18n.t("control.form.formMDctrlRepeater.noSupportStyle",{repeaterStyle:this.controller.repeaterStyle})])}}});var eb=Object.defineProperty,tb=(e,t,a)=>(((e,t,a)=>{t in e?eb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ab{constructor(){tb(this,"component","IBizFormMDCtrl")}async createController(e,t,a){let n;switch(e.contentType){case"LIST":case"GRID":case"DATAVIEW":n=new vn(e,t,a);break;case"FORM":n=new mn(e,t,a);break;case"REPEATER":n=new gn(e,t,a);break;default:throw new Gt(e,"".concat(ibiz.i18n.t("control.form.formMDctrl.errorMessage",{contentType:e.contentType})))}return await n.init(),n}}function nb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const ib=a({name:"IBizMDCtrlContainer",components:{draggable:is},props:{enableCreate:{type:Boolean,required:!0},enableDelete:{type:Boolean,required:!0},items:{type:Object,required:!0},userStyle:{type:String},enableSort:{type:Boolean,required:!1}},emits:{addClick:()=>!0,removeClick:(e,t)=>!0,dragChange:(e,t)=>!0},setup(e,{emit:t,slots:a}){const o=B("mdctrl-container"),s=o.be("item","icon-drag"),l=r(()=>e.enableCreate||e.enableDelete),c=r(()=>[...e.items]),d=()=>n("div",{class:[s]},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])])]),u=()=>{let e;return n(i("el-button"),{class:[o.be("item-actions","create"),o.be("item-actions","btn")],onClick:()=>t("addClick")},nb(e=ibiz.i18n.t("app.add"))?e:{default:()=>[e]})},h=(a,s)=>{let l;return e.enableDelete?ibiz.config.form.mdCtrlConfirmBeforeRemove?n(i("el-popconfirm"),{title:Tt(ibiz.i18n.t("control.form.mdCtrlContainer.promptInformation")),"confirm-button-text":ibiz.i18n.t("app.confirm"),"cancel-button-text":ibiz.i18n.t("app.cancel"),onConfirm:()=>t("removeClick",a,s)},{reference:()=>{let e;return n(i("el-button"),{type:"danger",class:[o.be("item-actions","remove"),o.be("item-actions","btn")]},nb(e=ibiz.i18n.t("app.delete"))?e:{default:()=>[e]})}}):n(i("el-button"),{type:"danger",class:[o.be("item-actions","remove"),o.be("item-actions","btn")],onClick:()=>t("removeClick",a,s)},nb(l=ibiz.i18n.t("app.delete"))?l:{default:()=>[l]}):null};return{ns:o,showActions:l,dragClssName:s,dragItems:c,renderDragBtn:d,renderAddBtn:u,renderDefaultItem:(t,i)=>{const s=a.item?a.item({data:t,index:i}):n("div",null,[ibiz.i18n.t("control.form.mdCtrlContainer.noSlot")]);return n("div",{class:o.b("item")},[n("div",{class:o.be("item","left")},[e.enableSort&&d()]),s,h(t,i),e.enableCreate&&n("div",{class:o.be("item","right")},[0===i&&u()])])},renderRemoveBtn:h,renderStyle2AddBtn:()=>n(i("el-button"),{class:[o.be("style2-item-actions","create"),o.be("style2-item-actions","btn")],title:ibiz.i18n.t("app.add"),onClick:()=>t("addClick")},{default:()=>[n("ion-icon",{name:"add-outline"},null),ibiz.i18n.t("app.add")]}),renderStyle2RemoveBtn:(a,s)=>{let l;return e.enableDelete?ibiz.config.form.mdCtrlConfirmBeforeRemove?n(i("el-popconfirm"),{title:Tt(ibiz.i18n.t("control.form.mdCtrlContainer.promptInformation")),"confirm-button-text":ibiz.i18n.t("app.confirm"),"cancel-button-text":ibiz.i18n.t("app.cancel"),onConfirm:()=>t("removeClick",a,s)},{reference:()=>n(i("el-button"),{type:"danger",class:[o.be("style2-item-actions","remove"),o.be("style2-item-actions","btn")],title:ibiz.i18n.t("app.delete")},{default:()=>[n("ion-icon",{name:"trash-outline"},null)]})}):n(i("el-button"),{type:"danger",class:[o.be("item-actions","remove"),o.be("item-actions","btn")],onClick:()=>t("removeClick",a,s)},nb(l=ibiz.i18n.t("app.delete"))?l:{default:()=>[l]}):null},handleDragChange:e=>{const{moved:a}=e,n=a.oldIndex,i=a.newIndex;t("dragChange",n,i)}}},render(){var e,t;if("STYLE2"===this.userStyle)return n("div",{class:[this.ns.b(),this.ns.b("style2")]},[(null==(e=this.items)?void 0:e.length)?n("div",{class:this.ns.e("item-container")},[this.showActions&&this.enableCreate&&this.renderStyle2AddBtn(),this.items.map((e,t)=>{const a=this.$slots.item?this.$slots.item({data:e,index:t}):n("div",null,[ibiz.i18n.t("control.form.mdCtrlContainer.noSlot")]);return n("div",{class:this.ns.b("item")},[a,this.showActions&&n("div",{class:this.ns.b("style2-item-actions")},[this.renderStyle2RemoveBtn(e,t)])])})]):n("div",{class:this.ns.b("no-data")},[this.enableCreate&&n("div",{class:this.ns.b("style2-item-actions")},[this.renderStyle2AddBtn()])])]);let a;return(null==(t=this.items)?void 0:t.length)&&(a=this.enableSort?n(is,{itemKey:"id",ref:"container",list:this.dragItems,class:[this.ns.e("drag")],handle:".".concat(this.dragClssName),onChange:this.handleDragChange,chosenClass:this.ns.is("drag-chosen",!0)},{item:({element:e,index:t})=>this.renderDefaultItem(e,t)}):this.items.map((e,t)=>this.renderDefaultItem(e,t))),n("div",{class:this.ns.b()},[a||n("div",{class:this.ns.b("no-data")},[this.enableCreate&&n("div",{class:this.ns.b("item-actions")},[this.renderAddBtn()])])])}}),ob=a({name:"IBizMDCtrlContainer2",components:{draggable:is},props:{controller:{type:mn,required:!0},items:{type:Array,default:()=>[]}},setup(e){const t=B("mdctrl-container2"),a=o("");c(()=>e.items,()=>{var t;a.value||(a.value=(null==(t=e.items[0])?void 0:t.id)||"")},{immediate:!0});const n=o(""),i=o(),s=o(!1),l=o(!1),r=o(!0);let u;const p=()=>{if(i.value){const e=i.value.$el;e&&(s.value=e.scrollLeft>0,l.value=e.scrollLeft<e.scrollWidth-e.offsetWidth,r.value=e.offsetWidth>e.scrollWidth)}};d(()=>{i.value&&i.value.$el&&(u=new ResizeObserver(e=>{e.forEach(()=>{p()})}),u.observe(i.value.$el))}),h(()=>{u&&u.disconnect()});return{ns:t,currentItem:a,draggingKey:n,container:i,isShowLeftArrow:s,isShowRightArrow:l,isShowBorder:r,handleSelect:(e,t)=>{e.stopPropagation(),a.value=t.id},handleAdd:t=>{var n;t.stopPropagation(),e.controller.create(),a.value=(null==(n=e.items[e.items.length-1])?void 0:n.id)||""},handleRemove:async(t,n)=>{var i;t.stopPropagation(),await e.controller.remove(n.id),a.value===n.id&&(a.value=(null==(i=e.items[0])?void 0:i.id)||""),p()},handleArrowClick:(e,a)=>{if(e.stopPropagation(),i.value){const e=i.value.$el;if(e){const n=Array.from(e.children||[]).find(e=>e.classList.contains(t.b("header-item")));if(n){const t=n.offsetWidth;"right"===a&&(e.scrollLeft+=t),"left"===a&&(e.scrollLeft-=t)}p()}}},handleDragStart:e=>{n.value=e.id},handleDragEnd:()=>{n.value="",e.controller.updateData(),p()}}},render(){return n("div",{class:this.ns.b()},[n("div",{class:[this.ns.b("header")]},[n(is,{ref:"container",class:[this.ns.b("header-content")],list:this.items,ghostClass:this.ns.bm("header-item","ghost"),itemKey:"id"},{item:({element:e})=>n("div",{class:[this.ns.b("header-item"),this.draggingKey&&this.ns.bm("header-item","dragging"),this.draggingKey===e.id&&this.ns.bm("header-item","drag"),this.currentItem===e.id&&this.ns.bm("header-item","active")],onDragstart:()=>{this.handleDragStart(e)},onDragend:()=>{this.handleDragEnd()},onClick:t=>{this.handleSelect(t,e)}},[n("div",{class:this.ns.be("header-item","drag-icon")},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])])]),n("div",{class:this.ns.be("header-item","text")},[e.title]),this.controller.enableDelete&&n("div",{class:this.ns.be("header-item","btn"),title:Tt(ibiz.i18n.t("app.delete")),onClick:t=>{this.handleRemove(t,e)}},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M4.002 3.403V1a1 1 0 0 1 1-1h6.003a1 1 0 0 1 1 1v2.403h3.396a.6.6 0 1 1 0 1.2h-1.395V15a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V4.603H.6a.6.6 0 1 1 0-1.2h3.4zm8.804 1.205H3.2V14.8h9.605V4.608zM5.202 1.2v2.155h5.603V1.2H5.202zm.6 6.417a.6.6 0 0 1 1.201 0v4.758a.6.6 0 0 1-1.2 0V7.617zm3.202 0a.6.6 0 0 1 1.2 0v4.758a.6.6 0 0 1-1.2 0V7.617z"},null)])])])]),footer:()=>[this.controller.enableCreate&&n("div",{class:[this.ns.b("header-item"),!this.isShowBorder&&this.ns.bm("header-item","hidden-border")],onClick:e=>{this.handleAdd(e)}},[n("div",{class:this.ns.be("header-item","icon")},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M8.578 7.383V1.602a.601.601 0 1 0-1.2 0v5.781H1.6a.601.601 0 0 0 0 1.203h5.777v5.812a.601.601 0 1 0 1.2 0V8.586H14.4a.601.601 0 0 0 0-1.203H8.578z"},null)])])]),n("div",{class:this.ns.be("header-item","text")},[ibiz.i18n.t("app.add")])]),this.isShowLeftArrow&&n("div",{class:this.ns.b("header-left-arrow"),onClick:e=>{this.handleArrowClick(e,"left")}},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.028 10.976l5.951-5.952a.6.6 0 0 1 1.024.425V11.4a.6.6 0 0 1-.6.6H7.452a.6.6 0 0 1-.424-1.024z",transform:"scale(-1 1) rotate(-45 0 32.15)"},null)])])]),this.isShowRightArrow&&n("div",{class:this.ns.b("header-right-arrow"),onClick:e=>{this.handleArrowClick(e,"right")}},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M3.028 10.976l5.951-5.952a.6.6 0 0 1 1.024.425V11.4a.6.6 0 0 1-.6.6H3.452a.6.6 0 0 1-.424-1.024z",transform:"rotate(-45 6.003 8)"},null)])])])]})]),n("div",{class:this.ns.b("content")},[this.items.map(e=>{var t,a;return n("div",{key:e.id,class:this.ns.b("content-item"),style:{display:e.id!==this.currentItem?"none":""}},[null==(a=(t=this.$slots).item)?void 0:a.call(t,{data:e})])})])])}}),sb=e("K",ie(Vm,function(e){e.component(Vm.name,Vm),e.component(Fm.name,Fm),e.component(Hm.name,Hm),e.component(Zg.name,Zg),e.component(ib.name,ib),e.component(ob.name,ob),nn("MDCTRL",()=>new ab)}));const lb=a({name:"IBizFormRawItem",props:{modelData:{type:Object,required:!0},controller:{type:wn,required:!0}},setup(e){var t;const a=B("form-raw-item"),l=e.controller,d=o(""),u=r(()=>!(!e.controller.form.controlParams||"hover"!==e.controller.form.controlParams.editmode)),h="DESIGN"===(null==(t=l.context)?void 0:t.srfrunmode);return c(()=>l.data,async e=>{if(e){const t=l.model.rawItem;if(!t)return;let a="";const n={...e};"RAW"===t.contentType?a=t.caption:"HTML"===t.contentType&&(a=t.content),a&&t.templateMode&&(a=await ibiz.util.hbs.render(a.replaceAll("//n","\n"),Object.assign(n,{data:{...e}}))),d.value=a}},{immediate:!0}),{ns:a,content:d,showFormDefaultContent:u,isDesignPreview:h,renderPreviewContent:()=>{var t;let o;switch(null==(t=e.modelData.rawItem)?void 0:t.contentType){case"RAW":{const t=e.modelData.rawItem.caption||"";return n("div",{class:a.be("preview-content","raw")},[t])}case"HTML":{const t=e.modelData.rawItem.content||"";return n("div",{class:a.be("preview-content","html"),innerHTML:t},null)}case"IMAGE":return n("div",{class:a.be("preview-content","image")},[n("svg",{width:"56px",height:"56px",viewBox:"0 0 56 56",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[n("g",{transform:"translate(4.000000, 0.000000)",fill:"#8c8c8c","fill-rule":"nonzero"},[n("rect",{opacity:"0",x:"0",y:"0",width:"48",height:"48"},null),n("path",{d:"M43.5,7.5 L4.5,7.5 C3.6703125,7.5 3,8.1703125 3,9 L3,39 C3,39.8296875 3.6703125,40.5 4.5,40.5 L43.5,40.5 C44.3296875,40.5 45,39.8296875 45,39 L45,9 C45,8.1703125 44.3296875,7.5 43.5,7.5 Z M15.84375,14.25 C17.4984375,14.25 18.84375,15.5953125 18.84375,17.25 C18.84375,18.9046875 17.4984375,20.25 15.84375,20.25 C14.1890625,20.25 12.84375,18.9046875 12.84375,17.25 C12.84375,15.5953125 14.1890625,14.25 15.84375,14.25 Z M39.9328125,34.7390625 C39.8671875,34.7953125 39.778125,34.828125 39.6890625,34.828125 L8.30625,34.828125 C8.1,34.828125 7.93125,34.659375 7.93125,34.453125 C7.93125,34.3640625 7.9640625,34.2796875 8.0203125,34.209375 L16.003125,24.740625 C16.134375,24.58125 16.3734375,24.5625 16.5328125,24.69375 C16.546875,24.7078125 16.565625,24.721875 16.5796875,24.740625 L21.2390625,30.271875 L28.65,21.4828125 C28.78125,21.3234375 29.0203125,21.3046875 29.1796875,21.4359375 C29.19375,21.45 29.2125,21.4640625 29.2265625,21.4828125 L39.9890625,34.2140625 C40.1109375,34.36875 40.0921875,34.6078125 39.9328125,34.7390625 Z"},null)])])])]);case"VIDEO":return n("div",{class:a.be("preview-content","video")},[n("svg",{width:"56px",height:"56px",viewBox:"0 0 56 56",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[n("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[n("g",{transform:"translate(4.000000, 4.000000)","fill-rule":"nonzero"},[n("rect",{opacity:"0",x:"0",y:"0",width:"48",height:"48"},null),n("rect",{"stroke-width":"2",x:"5",y:"5",width:"38",height:"38",rx:"2",stroke:"#1890FF"},null),n("path",{d:"M19.842,16.7706563 L30.3061875,22.4005313 C31.4090625,22.993875 31.822125,24.369 31.2287812,25.4717812 C30.9959833,25.9045408 30.6289074,26.2499678 30.1828125,26.4560625 L19.7187188,31.290375 C18.5818125,31.8156563 17.2343438,31.3198125 16.7090625,30.1828125 C16.571335,29.8846905 16.5,29.560211 16.5,29.2318125 L16.5,18.767625 C16.5,17.5153125 17.5153125,16.5 18.767625,16.5 C19.142625,16.5 19.5118125,16.593 19.842,16.7706563 Z",fill:"#1890FF"},null)])])])]);case"PLACEHOLDER":return null;case"DIVIDER":return n(i("el-divider"),{class:a.be("preview-content","divider")},"function"==typeof(l=o=ibiz.i18n.t("control.form.formRawItem.dividerText"))||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?o:{default:()=>[o]});case"INFO":return n(i("el-alert"),{class:a.be("preview-content","info"),title:ibiz.i18n.t("control.form.formRawItem.infoText"),type:"info",closable:!1,"show-icon":!0},null);case"WARNING":return n(i("el-alert"),{class:a.be("preview-content","warning"),title:ibiz.i18n.t("control.form.formRawItem.warningText"),type:"warning",closable:!1,"show-icon":!0},null);case"ERROR":return n(i("el-alert"),{class:a.be("preview-content","error"),title:ibiz.i18n.t("control.form.formRawItem.errorText"),type:"error",closable:!1,"show-icon":!0},null);default:return n("div",{class:a.be("preview-content","default")},[ibiz.i18n.t("control.form.formRawItem.defaultText")])}var l}}},render(){var e;return this.controller.state.visible?this.isDesignPreview?n("div",{class:this.ns.b()},[n("div",{class:this.ns.b("preview-content")},[this.renderPreviewContent()])]):n(i("iBizRawItem"),{class:[this.ns.b(),...this.controller.containerClass,this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("form-text",["TEXT","RAW"].includes((null==(e=this.modelData.rawItem)?void 0:e.contentType)||""))],rawItem:this.modelData,content:this.content,onClick:e=>this.controller.onClick(e)},null):null}});var rb=Object.defineProperty,cb=(e,t,a)=>(((e,t,a)=>{t in e?rb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class db{constructor(){cb(this,"component","IBizFormRawItem")}async createController(e,t,a){const n=new wn(e,t,a);return await n.init(),n}}const ub=e("L",ie(lb,function(e){e.component(lb.name,lb),nn("RAWITEM",()=>new db)}));function hb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const pb=a({name:"IBizFormTabPanel",props:{modelData:{type:Object,required:!0},controller:{type:yn,required:!0}},setup(e){const t=B("form-tab-panel");he(e.controller);const a=o(!1),i=(t,a)=>{const n=e.controller.form.details[t];n&&n.onClick(a)};return{ns:t,popoverVisible:a,onTabClick:(t,a)=>{e.controller.onTabChange(t.props.name),i(t.props.name,a)},renderAllTabContent:()=>{var o;return n("div",{class:t.be("tab-panel-container-style2","content")},[null==(o=e.modelData.deformTabPages)?void 0:o.map(o=>n("div",{class:[t.be("tab-panel-container-style2","tab-item-content"),t.is("active",o.id===e.controller.state.activeTab)],onClick:t=>((t,n)=>{e.controller.selectTab(t),a.value=!1,i(t,n)})(o.codeName,t),title:o.caption},[o.caption]))])}}},render(){var e,t;let a;const o="STYLE2"===this.modelData.detailStyle,s=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],l=e=>n("span",{class:[this.ns.b("tab-item-content"),...e.labelClass]},[e.model.sysImage&&n(i("iBizIcon"),{icon:e.model.sysImage},null),e.model.showCaption&&e.model.caption]),r=b(n(i("el-tabs"),{class:[this.ns.b(),this.ns.m(this.modelData.codeName),this.modelData.detailStyle?this.ns.m(this.modelData.detailStyle.toLowerCase()):"",...this.controller.containerClass],"model-value":this.controller.state.activeTab,onTabClick:this.onTabClick},hb(a=s.map(e=>{const t=e.props;if(!t||!t.controller)return e;const a=t.controller;return a.state.visible||a.state.keepAlive?n(i("el-tab-pane"),{class:this.ns.b("tab-item"),label:a.model.caption,name:a.model.id,lazy:!0},{default:()=>e,label:()=>{let e;const t=a.model.counterId?this.controller.state.counterData[a.model.counterId]:void 0;return a.model.counterId?n(i("el-badge"),{class:[this.ns.e("badge"),this.ns.is("no-counter",!t&&0!==t||1===a.model.counterMode&&t<=0)],"data-value":t,value:t,hidden:!t&&0!==t||1===a.model.counterMode&&t<=0,max:99},hb(e=l(a))?e:{default:()=>[e]}):l(a)}}):null}))?a:{default:()=>[a]}),[[C("loading"),this.controller.state.loading&&!o]]);return"STYLE2"===this.modelData.detailStyle?b(n("div",{class:this.ns.b("tab-panel-container-style2")},[r,n(i("el-popover"),{trigger:"click",placement:"top-end",visible:this.popoverVisible,"onUpdate:visible":e=>this.popoverVisible=e,"popper-class":this.ns.be("tab-panel-container-style2","popover")},{reference:()=>n("div",{class:this.ns.be("tab-panel-container-style2","select")},[n("div",{class:this.ns.bem("tab-panel-container-style2","select","title")},[ibiz.i18n.t("control.form.formTabPnel.all")]),n("ion-icon",{name:"caret-down-outline"},null)]),default:()=>this.renderAllTabContent()})]),[[C("loading"),this.controller.state.loading]]):r}});var mb=Object.defineProperty,vb=(e,t,a)=>(((e,t,a)=>{t in e?mb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class gb{constructor(){vb(this,"component","IBizFormTabPanel")}async createController(e,t,a){const n=new yn(e,t,a);return await n.init(),n}}const bb=e("M",ie(pb,function(e){e.component(pb.name,pb),nn("TABPANEL",()=>new gb)}));function fb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const wb=a({name:"IBizFormTabPage",props:{modelData:{type:Object,required:!0},controller:{type:Cn,required:!0}},setup(e){const t=B("form-tab-page");return he(e.controller),{ns:t}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[];return b(n(i("iBizRow"),{class:[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],layout:this.modelData.layout,onClick:e=>this.controller.onClick(e)},fb(a=o.map(e=>{const t=e.props;if(!t||!t.controller)return e;const a=t.controller;return n(i("iBizCol"),{layoutPos:a.model.layoutPos,state:a.state},fb(e)?e:{default:()=>[e]})}))?a:{default:()=>[a]}),[[C("loading"),this.controller.state.loading]])}});var yb=Object.defineProperty,Cb=(e,t,a)=>(((e,t,a)=>{t in e?yb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ib{constructor(){Cb(this,"component","IBizFormTabPage")}async createController(e,t,a){const n=new Cn(e,t,a);return await n.init(),n}}const xb=e("N",ie(wb,function(e){e.component(wb.name,wb),nn("TABPAGE",()=>new Ib)}));var Sb=Object.defineProperty,Eb=(e,t,a)=>(((e,t,a)=>{t in e?Sb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Db{constructor(){Eb(this,"component","IBizFormButtonList")}async createController(e,t,a){const n=new In(e,t,a);return await n.init(),n}}const Pb=a({name:"IBizFormButtonList",props:{modelData:{type:Object,required:!0},controller:{type:In,required:!0}},setup(e){var t;const a=B("form-button-list"),n=e.controller,i="DESIGN"===(null==(t=n.context)?void 0:t.srfrunmode);return{ns:a,handleClick:async(e,t)=>{null==t||t.stopPropagation(),i||n.handleClick(e,t)}}},render(){const{state:e}=this.controller;return e.visible?n(i("iBizButtonList"),{class:[this.ns.b(),...this.controller.containerClass],model:this.modelData,disabled:e.disabled,buttonsState:e.buttonsState,onClick:this.handleClick},null):null}}),kb=e("O",ie(Pb,function(e){e.component(Pb.name,Pb),nn("BUTTONLIST",()=>new Db)})),zb=a({name:"IBizFormIFrame",props:{modelData:{type:Object,required:!0},controller:{type:xn,required:!0}},setup(e){const t=e.controller,a=B("form-iframe");he(t);const n=o(!0);return{ns:a,url:r(()=>t.calcIFrameUrl()),loading:n,onLoad:()=>{n.value=!1}}},render(){return this.controller.state.visible&&this.url?b(n("div",{class:this.ns.b()},[n("iframe",{class:this.ns.e("iframe"),src:this.url,frameborder:"0",onLoad:()=>this.onLoad(),onError:()=>this.onLoad()},null)]),[[C("loading"),this.loading]]):null}});var Tb=Object.defineProperty,Ab=(e,t,a)=>(((e,t,a)=>{t in e?Tb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ob{constructor(){Ab(this,"component","IBizFormIFrame")}async createController(e,t,a){const n=new xn(e,t,a);return await n.init(),n}}const Mb=e("P",ie(zb,function(e){e.component(zb.name,zb),nn("IFRAME",()=>new Ob)}));var Nb=Object.defineProperty,Bb=(e,t,a)=>(((e,t,a)=>{t in e?Nb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Lb{constructor(){Bb(this,"component","IBizEditFormControl")}}const Rb=a({name:"IBizEditFormControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},isSimple:{type:Boolean,required:!1},data:{type:Object,required:!1},loadDefault:{type:Boolean,default:!0},simpleDataIndex:{type:Number,required:!1},mdCtrlFormIndex:{type:Number,required:!1}},setup(e){const t=ne((...e)=>new bn(...e),{excludePropsKeys:["data"]}),a=B("control-edit-form"),n=o(""),i=o([]),s=o();e.isSimple&&((e.simpleDataIndex||0===e.simpleDataIndex)&&t.setSimpleDataIndex(e.simpleDataIndex),t.evt.on("onMounted",()=>{t.setSimpleData(e.data||{})}),c(()=>e.data,e=>{const a=e||{},n=t.data instanceof ma?t.data.getOrigin():t.data;let i=!1;i=!!(n&&Object.keys(n)&&a&&Object.keys(a)&&Object.keys(n).length!==Object.keys(a).length)||!!Object.keys(n).find(e=>a[e]!==n[e]),i&&t.setSimpleData(a)},{deep:!0})),(e.mdCtrlFormIndex||0===e.mdCtrlFormIndex)&&t.setMdCtrlFormIndex(e.mdCtrlFormIndex),t.evt.on("onCreated",()=>{Object.keys(t.details).forEach(e=>{const a=t.details[e];a.state=u(a.state)}),i.value=t.anchorData});const l=_o(e=>{t.filterDetail(e)},300,{leading:!0});return{c:t,ns:a,filter:n,anchorList:i,anchorTargetRef:s,handleInput:l,calcNavBarConfig:()=>{const{navBarPos:e,navBarSysCss:a,navBarWidth:n,navBarStyle:i,navbarHeight:o}=t.model;return{navBarPos:e,navBarSysCss:a,navBarWidth:n,navBarStyle:i,navbarHeight:o}}}},render(){const{showFormNavBar:e,enableItemFilter:t}=this.c.model,a=n("div",{class:[this.ns.b(),this.ns.is("item-filter",t)]},[t&&n(i("el-input"),{clearable:!0,modelValue:this.filter,"onUpdate:modelValue":e=>this.filter=e,onInput:this.handleInput,class:this.ns.e("quick-search"),placeholder:ibiz.i18n.t("app.search")},null),n(i("iBizFormControl"),{ref:"anchorTargetRef",controller:this.c},{...this.$slots})]);return e?n(i("iBizAnchorContainer"),{anchorList:this.anchorList.filter(e=>e.pageId===this.c.state.activeTab),anchorTargetEle:this.anchorTargetRef,navBarConfig:this.calcNavBarConfig()},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]}):a;var o}}),_b=e("Q",ie(Rb,function(e){e.component(Rb.name,Rb),Ha(qa.FORM,()=>new Lb)}));const jb=a({name:"IBizFormControl",props:{controller:{type:Object,required:!0}},setup(e,{slots:t}){const a=B("control-form"),o=e.controller;ue(o);const s={form:o},r=t=>{var a;const n={};return null==(a=t.controlAttributes)||a.forEach(t=>{t.attrName&&t.attrValue&&(n[t.attrName]=Ua.execSingleLine(t.attrValue,{...e.controller.getEventArgs(),data:e.controller.data}))}),n},c=(e,a=!1)=>{const{hidden:s,userTag:d}=e;if(s||!a&&o.model.enableAdvanceSearch&&"permanent"!==d)return;const u=e.id;if(t[u])return D(t,u,{model:e,data:o.state.data,value:o.state.data[u],controller:o.details[u]});const h={};"FORMITEM"===e.detailType&&t["".concat(u,"_editor")]&&(h.default=(...e)=>t["".concat(u,"_editor")](...e));const p=Aa(e);p.length&&(h.default=()=>p.map(e=>c(e)));const m=o.providers[u];if(!m)return n("div",null,[ibiz.i18n.t("control.form.noSupportDetailType",{detailType:e.detailType})]);const v=i(m.component);return l(v,{modelData:e,controller:o.details[u],key:e.id,attrs:r(e)},h)},d=e=>{const{modelData:t}=e;return(t instanceof Array?t:[t]).map(e=>c(e))};return d.props=["modelData"],s.FormDetail=d,{ns:a,c:o,FormDetail:d,slotProps:s,renderByDetailType:c}},render(){const{state:e,model:t,controlPanel:a}=this.c,{isCreated:o}=e,l={};if(o)if(this.$slots.default)l.default=()=>this.$slots.default({...this.slotProps});else{const e=t.controlType===qa.SEARCHFORM?"searchform":"form";l[a?e:"default"]=()=>n(i("iBizFormPage"),{modelData:this.c.model,controller:this.c},{default:()=>{var e;return[null==(e=this.c.model.deformPages)?void 0:e.map(e=>this.renderByDetailType(e,!0))]}})}return n(i("iBizControlBase"),{class:this.ns.b(),controller:this.c},"function"==typeof(r=l)||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?l:{default:()=>[l]});var r}}),Vb=e("R",ie(jb,function(e){e.component(jb.name,jb),e.use(zm),e.use(Im),e.use(im),e.use(Nm),e.use(jm),e.use(sb),e.use(ub),e.use(bb),e.use(xb),e.use(kb),e.use(Mb)}));function Fb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Ub=a({name:"IBizExportExcel",props:{mode:{type:String,required:!1},size:{type:String,required:!1},item:{type:Object,required:!0},btnContent:{type:Function,required:!0},controller:{type:Object,required:!0}},emits:["exportExcel"],setup(e,{emit:t}){const a=B("export-excel"),n=o(1),i=o(9999),s=o(1e3),l=e.controller.xdataControl;d(()=>{l&&l.evt.on("onMounted",()=>{var e;s.value=(null==(e=l.dataExport)?void 0:e.maxRowCount)||1e3})});return{ns:a,maxRowCount:s,endPage:i,startPage:n,onCommand:(e,a)=>{e&&t("exportExcel",a,{type:e,startPage:n.value,endPage:i.value})}}},render(){return"menu"===this.$props.mode?n(i("el-sub-menu"),{index:this.$props.item.id,class:this.ns.b("submenu"),"popper-class":this.ns.b("submenu-popper")},{title:()=>{let e;return n(i("el-button"),{title:Tt(this.item.tooltip),size:this.$props.size,type:Pl(this.item.buttonStyle),class:this.ns.b("submenu-button")},Fb(e=this.btnContent(this.item))?e:{default:()=>[e]})},default:()=>{let e,t,a,o;return[n(i("el-menu-item"),{class:this.ns.b("menu-item"),onClick:e=>this.onCommand("maxRowCount",e)},Fb(e=ibiz.i18n.t("control.toolbar.exportExcel.exportAll",{maxRowCount:this.maxRowCount}))?e:{default:()=>[e]}),n(i("el-menu-item"),{class:this.ns.b("menu-item"),onClick:e=>this.onCommand("activatedPage",e)},Fb(t=ibiz.i18n.t("control.toolbar.exportExcel.expCurrentPage"))?t:{default:()=>[t]}),n(i("el-menu-item"),{class:this.ns.b("menu-item"),onClick:e=>this.onCommand("selectedRows",e)},Fb(a=ibiz.i18n.t("control.toolbar.exportExcel.expCurrentSelect"))?a:{default:()=>[a]}),n(i("el-menu-item"),{class:[this.ns.b("menu-item"),this.ns.e("custom")]},{default:()=>[n(i("el-input"),{type:"number",modelValue:this.startPage,"onUpdate:modelValue":e=>this.startPage=e,size:"small",maxlength:"4",onClick:e=>{e.stopPropagation()},onChange:e=>{this.startPage=e}},null),n("span",{class:"item-text",onClick:e=>{e.stopPropagation()}},[p("-")]),n(i("el-input"),{modelValue:this.endPage,"onUpdate:modelValue":e=>this.endPage=e,size:"small",type:"number",maxlength:"4",onClick:e=>{e.stopPropagation()}},null),n("span",{class:"item-text",onClick:e=>{e.stopPropagation()}},[ibiz.i18n.t("control.toolbar.exportExcel.page")]),n(i("el-button"),{onClick:e=>this.onCommand("customPage",e),size:"small"},Fb(o=ibiz.i18n.t("control.toolbar.exportExcel.export"))?o:{default:()=>[o]})]})]}}):n(i("el-dropdown"),{trigger:"click",size:this.$props.size,onCommand:this.onCommand,"popper-class":this.ns.b()},{default:()=>{let e;return n(i("el-button"),{size:this.$props.size,class:this.ns.e("button"),title:Tt(this.item.tooltip),type:Pl(this.item.buttonStyle)},Fb(e=this.btnContent(this.item))?e:{default:()=>[e]})},dropdown:()=>{let e,t,a,o;return n(i("el-dropdown-menu"),null,{default:()=>[n(i("el-dropdown-item"),{command:"maxRowCount"},Fb(e=ibiz.i18n.t("control.toolbar.exportExcel.exportAll",{maxRowCount:this.maxRowCount}))?e:{default:()=>[e]}),n(i("el-dropdown-item"),{command:"activatedPage"},Fb(t=ibiz.i18n.t("control.toolbar.exportExcel.expCurrentPage"))?t:{default:()=>[t]}),n(i("el-dropdown-item"),{command:"selectedRows"},Fb(a=ibiz.i18n.t("control.toolbar.exportExcel.expCurrentSelect"))?a:{default:()=>[a]}),n(i("el-dropdown-item"),{class:this.ns.e("custom"),command:""},{default:()=>[n(i("el-input"),{type:"number",modelValue:this.startPage,"onUpdate:modelValue":e=>this.startPage=e,size:"small",maxlength:"4",onClick:e=>{e.stopPropagation()},onChange:e=>{this.startPage=e}},null),n("span",{class:"item-text",onClick:e=>{e.stopPropagation()}},[p("-")]),n(i("el-input"),{modelValue:this.endPage,"onUpdate:modelValue":e=>this.endPage=e,size:"small",type:"number",maxlength:"4",onClick:e=>{e.stopPropagation()}},null),n("span",{class:"item-text",onClick:e=>{e.stopPropagation()}},[ibiz.i18n.t("control.toolbar.exportExcel.page")]),n(i("el-button"),{onClick:e=>this.onCommand("customPage",e),size:"small"},Fb(o=ibiz.i18n.t("control.toolbar.exportExcel.export"))?o:{default:()=>[o]})]})]})}})}}),Hb=a({name:"IBizShortCutButton",props:{mode:{type:String,required:!1},size:{type:String,required:!1},item:{type:Object,required:!0},controller:{type:Object,required:!0}},emits:["click"],setup(e,{emit:t}){var a;const n=B("short-cut-button"),i=B("toolbar-item"),o=null==(a=e.item.buttonStyle)?void 0:a.toLowerCase();return{ns:n,ns2:i,buttonState:r(()=>e.controller.state.buttonsState[e.item.id]),buttonType:o,isShortCut:r(()=>e.controller.view.state.isShortCut),onClick:e=>{t("click",e)}}},render(){return n("div",{class:[this.ns.b(),this.ns.is("short-cut",this.isShortCut)]},[n(i("el-button"),{title:Tt(this.isShortCut?"".concat(ibiz.i18n.t("app.cancel")).concat(this.item.tooltip):this.item.tooltip),size:this.size,type:Pl(this.item.buttonStyle),loading:this.buttonState.loading,disabled:this.buttonState.disabled,onClick:this.onClick},{default:()=>[this.item.showIcon&&this.item.sysImage&&n("span",{class:[this.ns2.b("icon"),this.ns.e("icon")]},[n(i("iBizIcon"),{icon:this.item.sysImage},null)]),this.item.showCaption&&n("span",{class:this.ns2.b("text")},[this.isShortCut?"".concat(ibiz.i18n.t("app.cancel")).concat(this.item.caption):this.item.caption])]})])}});function qb(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Gb=(e,t)=>{const a=t&&e.counterId?t.counterData[e.counterId]:void 0,o=e.sysImage,s=[],l=B("toolbar-item");return e.showIcon&&o&&s.push(n("span",{class:l.b("icon")},[n(i("iBizIcon"),{icon:o},null)])),e.showCaption&&e.caption&&s.push(n("span",{class:l.b("text")},[e.caption])),a&&s.push(n(i("iBizBadge"),{class:l.b("counter"),value:a,counterMode:e.counterMode},null)),s},Wb=e=>{var t;return null==(t=null==e?void 0:e.sysCss)?void 0:t.cssName},Yb=a({name:"IBizToolbarControl",props:{modelData:{type:Object,required:!0},runMode:{type:String,default:"RUNTIME"},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},manualCalcButtonState:{type:Boolean,default:!1}},emits:["click"],setup(e,{emit:t}){var a;const s=ne((...e)=>new Sn(...e)),r=B("control-".concat(s.model.controlType.toLowerCase())),c=B("control-".concat(s.model.controlType.toLowerCase(),"-actions")),d=o("default"),u=null==(a=s.model.toolbarStyle)?void 0:a.toLowerCase(),h=async(a,n,i)=>{"RUNTIME"===e.runMode?await s.onItemClick(a,n,i):t("click",a)},m=async(a,n,i)=>{if("RUNTIME"===e.runMode){const e={};Object.assign(e,{...a,itemType:a.detailType}),await h(e,n,i)}else t("click",a)},v=(e,t)=>{var a,o;let c;const u=t.uiactionId,h=null==(a=s.state.buttonsState[t.id])?void 0:a.visible,p=s.itemProviders[t.id];if(!h)return null;if(p){const a=i(p.component);return l(a,{key:t.id,class:[r.e("item")],item:e,controller:s})}const v=null==(o=t.buttonStyle)?void 0:o.toLowerCase();return"exportexcel"===u||"gridview_exportaction"===u?n(Ub,{class:[r.e("menu-exportexcel"),r.em("item",v),Wb(t)],mode:"menu",item:t,btnContent:e=>Gb(e,s.state),size:d.value,controller:s,onExportExcel:(e,a)=>{m(t,e,a)}},null):n(i("el-menu-item"),{class:[r.is("loading",s.state.buttonsState[t.id].loading),r.em("item",v),Wb(t)],index:"menuitem".concat(t.id),disabled:s.state.buttonsState[t.id].disabled,title:Tt(t.caption)},{default:()=>[n(i("el-button"),{loading:s.state.buttonsState[t.id].loading,onClick:e=>{t.uiactionId&&m(t,e)}},qb(c=Gb(t,s.state))?c:{default:()=>[c]})]})},g=(e,t)=>{if(s.state.buttonsState[e.id].visible){let a;return n(i("el-button"),{size:d.value,class:Wb(e),type:t||Pl(e.buttonStyle),title:Tt(e.tooltip||e.caption),loading:s.state.buttonsState[e.id].loading,disabled:s.state.buttonsState[e.id].disabled,onClick:t=>m(e,t)},qb(a=Gb(e,s.state))?a:{default:()=>[a]})}return null},b=e=>{if(s.state.buttonsState[e.id].visible){let t;const a=s.state.buttonsState[e.id].disabled;return n(i("el-dropdown-item"),{class:[c.be("dropdown-popper","dropdown-item"),c.is("disabled",a),r.em("item",Pl(e.buttonStyle))]},qb(t=g(e))?t:{default:()=>[t]})}return null},f=(e,t)=>{const a=e[t];return a?s.state.buttonsState[a.id].visible?t:f(e,t+1):-1},w=(e,t=!1)=>{const{groupExtractMode:a}=e;switch(a){case"ITEMS":return((e,t)=>{const{uiactionGroup:a}=e;if(a&&a.uiactionGroupDetails){const{uiactionGroupDetails:o}=a,l=o.length>0,d=e.buttonStyle||"";if(t){const t=s.state.buttonsState[e.id].disabled||-1===o.findIndex(e=>{var t;return!1===(null==(t=s.state.buttonsState[e.id])?void 0:t.disabled)});return n(i("el-sub-menu"),{class:[r.b("submenu"),r.be("submenu","groupdetails"),r.em("item",d.toLowerCase()),Wb(e)],index:e.id,disabled:t,title:Tt(e.tooltip),"popper-class":[r.b("submenu-popper"),r.em("submenu-popper","groupdetails"),r.bm("submenu-popper",u),r.em("submenu-popper",d.toLowerCase()),r.bm("submenu-popper",Wb(e)),Wb(e)]},{default:()=>o.map(t=>v(e,t)),title:()=>v(e,e)})}return n(i("el-dropdown"),{"popper-class":[c.b("dropdown-popper"),c.bm("dropdown-popper",u),c.em("dropdown-popper",d.toLowerCase()),c.bm("dropdown-popper",Wb(e))]},{default:()=>g(e),dropdown:()=>{let e;return l&&n(i("el-dropdown-menu"),null,qb(e=o.map(e=>b(e)))?e:{default:()=>[e]})}})}return null})(e,t);case"ITEMX":return((e,t)=>{const{uiactionGroup:a}=e;if(a&&a.uiactionGroupDetails){const{uiactionGroupDetails:o}=a,l=f(o,0);if(-1!==l){const a=o[l],d=o.slice(l+1).filter(e=>!!s.state.buttonsState[e.id].visible),h=d.length>0;let p=e.buttonStyle||"";return t?(p=a.buttonStyle||"",n(i("el-sub-menu"),{class:[r.b("submenu"),r.be("submenu","groupdetails"),r.em("item",p.toLowerCase()),Wb(a)],index:a.id,disabled:s.state.buttonsState[a.id].disabled,title:Tt(a.tooltip),"popper-class":[r.b("submenu-popper"),r.be("submenu-popper","groupdetails"),r.bm("submenu-popper",u),r.em("submenu-popper",p.toLowerCase()),r.bm("submenu-popper",Wb(a)),Wb(a)]},{default:()=>d.map(t=>v(e,t)),title:()=>v(e,a)})):n(i("el-dropdown"),{"split-button":h,type:Pl(p),"popper-class":[c.b("dropdown-popper"),c.bm("dropdown-popper",u),c.em("dropdown-popper",p.toLowerCase()),c.bm("dropdown-popper",Wb(e))]},{default:()=>g(a,Pl(p)),dropdown:()=>{let e;return h&&n(i("el-dropdown-menu"),null,qb(e=d.map(e=>b(e)))?e:{default:()=>[e]})}})}}return null})(e,t);default:return((e,t)=>{const{uiactionGroup:a}=e;if(a&&a.uiactionGroupDetails){const{uiactionGroupDetails:i}=a;return t?i.map(t=>v(e,t)):i.map(e=>n("div",{class:[c.e("item-deuiaction"),r.em("item",Pl(e.buttonStyle))]},[g(e)]))}return null})(e,t)}},y=e=>{const t=e.detoolbarItems||[],a=s.state.buttonsState[e.id].visible,o=s.state.buttonsState[e.id].disabled;if(!a)return null;const c=-1!==t.findIndex(e=>{var t;return null==(t=s.state.buttonsState[e.id])?void 0:t.loading}),p=-1!==t.findIndex(e=>{var t;return!0===(null==(t=s.state.buttonsState[e.id])?void 0:t.visible)}),m=o||-1===t.findIndex(e=>{var t;return!1===(null==(t=s.state.buttonsState[e.id])?void 0:t.disabled)});if(e.uiactionGroup&&e.uiactionGroup.uiactionGroupDetails&&e.uiactionGroup.uiactionGroupDetails.length>0)return w(e,!0);if(!p)return null;const v=e.buttonStyle||"";return n(i("el-sub-menu"),{class:[r.b("submenu"),r.em("item",v.toLowerCase()),Wb(e)],index:e.id,disabled:m,title:Tt(e.tooltip),"popper-class":[r.b("submenu-popper"),r.bm("submenu-popper",u),r.em("submenu-popper",v.toLowerCase()),r.bm("submenu-popper",Wb(e)),Wb(e)]},{default:()=>t.map(t=>{var a,o;const c=t.uiactionId,u=null==(a=s.state.buttonsState[t.id])?void 0:a.visible,p=s.itemProviders[t.id];if(!u)return null;if(p){const a=i(p.component);return l(a,{key:t.id,class:[r.e("item")],item:e,controller:s})}if("SEPERATOR"!==t.itemType){if("RAWITEM"===t.itemType)return n(i("el-menu-item"),{index:"menuitem".concat(t.id),title:Tt(t.tooltip)},{default:()=>[n(i("iBizRawItem"),{rawItem:t,content:t.rawItem.content,class:r.b("submenu-rawitem"),onClick:e=>h(t,e)},null)]});if("DEUIACTION"===t.itemType){let e;const a=null==(o=t.buttonStyle)?void 0:o.toLowerCase();return"exportexcel"===c||"gridview_exportaction"===c?n(Ub,{class:[r.e("menu-exportexcel"),r.em("item",a),Wb(t)],mode:"menu",item:t,btnContent:e=>Gb(e,s.state),size:d.value,controller:s,onExportExcel:(e,a)=>{h(t,e,a)}},null):n(i("el-menu-item"),{class:[r.is("loading",s.state.buttonsState[t.id].loading),r.em("item",a),Wb(t)],index:"menuitem".concat(t.id),disabled:s.state.buttonsState[t.id].disabled,title:Tt(t.tooltip),onClick:e=>h(t,e)},{default:()=>[n(i("el-button"),{loading:s.state.buttonsState[t.id].loading},qb(e=Gb(t,s.state))?e:{default:()=>[e]})]})}return"ITEMS"===t.itemType?y(t):null}}),title:()=>{let t;return n(i("el-button"),{loading:c,disabled:m,type:Pl(v)},qb(t=Gb(e,s.state))?t:{default:()=>[t]})}})};return{c:s,btnSize:d,ns:r,toolbarStyle:u,handleClick:h,renderExtraButtons:e=>e.map(e=>{let t;return n("div",{key:e.id,class:[r.e("item")]},[n(i("el-button"),{title:Tt(e.tooltip),size:d.value,onClick:t=>h(e,t)},qb(t=Gb(e,s.state))?t:{default:()=>[t]})])}),renderToolbarItem:e=>{var t,a;const o=e.id,u=null==(t=s.state.buttonsState[o])?void 0:t.visible,m=s.itemProviders[o];if(!u)return null;if(m){const t=i(m.component);return l(t,{key:o,class:[r.e("item")],item:e,controller:s})}if("SEPERATOR"===e.itemType)return s.state.hideSeparator.includes(o)?null:n("div",{key:o,class:[r.e("item"),r.e("item-separator")]},[p("|")]);if("RAWITEM"===e.itemType)return n("div",{key:o,class:[r.e("item"),r.e("item-rawitem")]},[n(i("iBizRawItem"),{rawItem:e,content:e.rawItem.content,onClick:t=>h(e,t)},null)]);if("DEUIACTION"===e.itemType){let t;const a=e.uiactionId,l=e.buttonStyle;return"exportexcel"===a||"gridview_exportaction"===a?n(Ub,{class:[r.e("item"),r.e("item-deuiaction"),r.em("item",null==l?void 0:l.toLowerCase()),Wb(e)],item:e,btnContent:e=>Gb(e,s.state),size:d.value,controller:s,onExportExcel:(t,a)=>{h(e,t,a)}},null):"shortcut"===a?n(Hb,{key:o,class:[r.e("item"),r.e("item-deuiaction"),r.em("item",null==l?void 0:l.toLowerCase()),Wb(e)],item:e,controller:s,size:d.value,onClick:t=>h(e,t)},null):n("div",{key:o,class:[r.e("item"),r.e("item-deuiaction"),r.em("item",null==l?void 0:l.toLowerCase()),Wb(e),r.is("loading",s.state.buttonsState[o].loading)]},[n(i("el-button"),{size:d.value,title:Tt(e.tooltip),type:Pl(l),loading:s.state.buttonsState[o].loading,disabled:s.state.buttonsState[o].disabled,onClick:t=>h(e,t)},qb(t=Gb(e,s.state))?t:{default:()=>[t]})])}if("ITEMS"===e.itemType){let t;const o=e,s=o.buttonStyle||"";if(o.groupExtractMode&&o.uiactionGroup){const t="extract-mode-".concat((null==(a=o.groupExtractMode)?void 0:a.toLowerCase())||"item");return n("div",{class:[c.b(),c.e(t),c.em("item",s.toLowerCase()),Wb(e)]},[w(e)])}return n(i("el-menu"),{mode:"horizontal",class:[r.e("menu"),r.em("menu",s.toLowerCase()),Wb(e)],ellipsis:!1,"menu-trigger":"hover"},qb(t=y(e))?t:{default:()=>[t]})}return null}}},render(){var e,t,a;const{state:o}=this.c;let s=null;return o.isCreated&&(s=[(null==(e=o.extraButtons.before)?void 0:e.length)>0&&this.renderExtraButtons(o.extraButtons.before),null==(t=this.modelData.detoolbarItems)?void 0:t.map((e,t)=>{var a;const n=this.renderToolbarItem(e);return(null==(a=o.extraButtons[t])?void 0:a.length)?[n,this.renderExtraButtons(o.extraButtons[t])]:n}),(null==(a=o.extraButtons.after)?void 0:a.length)>0&&this.renderExtraButtons(o.extraButtons.after)]),n(i("iBizControlBase"),{controller:this.c,class:[this.ns.m(o.viewMode.toLowerCase()),this.ns.m(this.toolbarStyle)]},qb(s)?s:{default:()=>[s]})}});var Kb=Object.defineProperty,Xb=(e,t,a)=>(((e,t,a)=>{t in e?Kb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class $b{constructor(){Xb(this,"component","IBizToolbarControl")}}const Jb=e("S",ie(Yb,function(e){e.component(Yb.name,Yb),Ha(qa.TOOLBAR,()=>new $b)})),Qb=a({name:"IBizCaptionBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},data:{type:Object}},setup(){const e=ne((...e)=>new En(...e)),t=B("control-".concat(e.model.controlType.toLowerCase()));e.setBrowserTabTitle(),x(()=>{e.setBrowserTabTitle()});const a=r(()=>void 0!==e.state.totalx);return{c:e,ns:t,showTotal:a}},render(){return n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b()]},{default:()=>[n("div",{class:[this.ns.b("caption"),this.ns.is("show-icon",!!this.c.model.sysImage)]},[this.c.model.sysImage&&n(i("iBizIcon"),{class:[this.ns.be("caption","icon")],icon:this.c.model.sysImage},null),n("div",{class:[this.ns.be("caption","content")]},[this.c.state.caption]),this.showTotal&&n("div",{class:[this.ns.be("caption","total")]},[ibiz.i18n.t("control.captionBar.total",{total:this.c.state.totalx,invisibleNum:this.c.state.totalx-this.c.state.total})])])]})}});var Zb=Object.defineProperty,ef=(e,t,a)=>(((e,t,a)=>{t in e?Zb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class tf{constructor(){ef(this,"component","IBizCaptionBarControl")}}const af=e("T",ie(Qb,function(e){e.component(Qb.name,Qb),Ha(qa.CAPTIONBAR,()=>new tf)}));function nf(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const of=a({name:"IBizDataViewControl",components:{draggable:is},props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0},isSimple:{type:Boolean,required:!1},data:{type:Array,required:!1},loadDefault:{type:Boolean,default:!0}},setup(e){const t=ne((...e)=>new Dn(...e)),a=B("control-".concat(t.model.controlType.toLowerCase()));ue(t);const s=r(()=>[a.is("enable-page",!0===t.model.enablePagingBar)]),d=o(!1),u=r(()=>!0===t.model.enablePagingBar||(2!==t.model.pagingMode||(t.state.items.length>=t.state.total||t.state.isLoading||t.state.total<=t.state.size))),h=r(()=>{var e,a;return(null==(a=null==(e=t.model.controlParam)?void 0:e.ctrlParams)?void 0:a.CARDSTYLE)||t.controlParams.cardstyle||"default"}),p=r(()=>!t.state.enableGroup&&(2===t.model.pagingMode||3===t.model.pagingMode)),m=o(),v=o(go());c(()=>t.state.curPage,()=>{var e,a;if(1===t.state.curPage&&(2===t.model.pagingMode||3===t.model.pagingMode)){v.value=go();const t=null==(a=null==(e=m.value)?void 0:e.ElInfiniteScroll)?void 0:a.containerEl;t&&(t.lastScrollTop=0,t.scrollTop=0)}});const g=()=>{e.data&&(t.state.items=e.data.map(e=>new ma(e)),t.afterLoad({},t.state.items))};t.evt.on("onCreated",async()=>{e.isSimple&&(g(),t.state.isSimple=!0,t.state.isLoaded=!0)});const f=e=>{let a=!!t.state.selectedData.find(t=>t.srfkey===e.srfkey);return"DEDATAVIEW"===t.view.model.viewType&&1===t.state.mdctrlActiveMode&&!0===t.state.singleSelect&&(a=!1),a};c(()=>e.data,()=>{e.isSimple&&g()},{deep:!0});const{onPageChange:w,onPageRefresh:y,onPageSizeChange:I}=ul(t),x=(e,a)=>(a.stopPropagation(),t.onRowClick(e)),S=(e,a)=>(a.stopPropagation(),t.onDbRowClick(e));let E=null;const D=(e,a)=>{e.moved&&t.onDragChange({from:a,to:a,fromIndex:e.moved.oldIndex,toIndex:e.moved.newIndex}),e.added&&(E={to:a,toIndex:e.added.newIndex}),e.removed&&(E&&(E.from=a,E.fromIndex=e.removed.oldIndex,t.onDragChange(E)),E=null)},P=e=>n(i("el-card"),{shadow:"hover",class:[a.b("item"),a.be("item","new")],title:ibiz.i18n.t("app.newlyBuild"),"body-style":{width:t.model.cardWidth?"".concat(t.model.cardWidth,"px"):"auto",height:t.model.cardHeight?"".concat(t.model.cardHeight,"px"):"auto"},onClick:a=>{t.onClickNew(a,null==e?void 0:e.key)}},{default:()=>[n("ion-icon",{name:"add-outline"},null)]}),k=(e,a)=>{const{context:o,params:s}=t;return n(i("iBizControlShell"),{data:e,modelData:a,context:o,params:s,onClick:t=>x(e,t),onDblclick:t=>S(e,t)},null)},z=e=>n(i("iBizActionToolbar"),{class:a.bem("item-content","bottom","actions"),"action-details":t.getOptItemModel(),"actions-state":t.state.uaState[e.srfkey],zIndex:t.state.zIndex,onActionClick:(a,n)=>t.onActionClick(a,e,n)},null),T=e=>{const i=t.getOptItemModel();return n("div",{class:a.b("item-content")},[n("div",{class:a.be("item-content","top")},[n("div",{class:a.bem("item-content","top","title")},[e.srfmajortext]),n("div",{class:a.bem("item-content","top","description")},[e.content])]),i.length?n("div",{class:a.be("item-content","bottom")},[z(e)]):null])},A=o=>{const s=a.cssVarBlock({"item-bg-color":"".concat(o.bgcolor||""),"text-color":"".concat(o.fontcolor||""),"hover-bg-color":"".concat(o.hovercolor||""),"active-bg-color":"".concat(o.activecolor||"")}),l=e.modelData.itemLayoutPanel;return n(i("el-card"),{shadow:"hover",class:[a.b("item"),a.is("active",f(o))],style:s,"body-style":{width:t.model.cardWidth?"".concat(t.model.cardWidth,"px"):"auto",height:t.model.cardHeight?"".concat(t.model.cardHeight,"px"):"auto"},onClick:e=>x(o,e),onDblclick:e=>S(o,e)},{default:()=>[n("div",{class:a.be("item","content")},[t.state.draggable&&!t.state.readonly&&n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:a.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])]),"style2"===h.value&&!t.state.singleSelect&&n(i("el-checkbox"),{size:"large",class:a.bem("item","content","checkbox"),modelValue:f(o),onClick:e=>e.stopPropagation(),onChange:()=>(e=>{const a=t.state.selectedData,n=a.findIndex(t=>t.srfkey===e.srfkey);-1===n?a.push(e):a.splice(n,1),t.setSelection(a)})(o)},null),l?k(o,l):T(o)])]})},O=(e,o,s=!0)=>{const{cardColXS:l,cardColSM:r,cardColMD:c,cardColLG:d}=t.model;return l||r||c||d?n(is,{itemKey:"srfkey",modelValue:e,group:t.model.id,handle:".".concat(a.e("drag-icon")),class:["el-row",a.e("layout-row")],disabled:s||t.state.updating||t.state.readonly,onChange:e=>D(e,null==o?void 0:o.key)},{item:({element:e})=>n(i("el-col"),{xs:l,sm:r,md:c,lg:d,class:a.e("layout-col")},{default:()=>[n("div",{class:a.b("scroll-item")},[A(e)])]}),footer:()=>{if(t.enableNew&&!t.state.readonly)return n(i("el-col"),{xs:l,sm:r,md:c,lg:d,class:a.e("layout-col")},{default:()=>[n("div",{class:a.b("scroll-item")},[P(o)])]})}}):n(is,{itemKey:"srfkey",modelValue:e,group:t.model.id,class:[a.e("layout-flex"),a.em("layout-flex","draggable")],disabled:s||t.state.updating||t.state.readonly,onChange:e=>D(e,null==o?void 0:o.key)},{item:({element:e})=>n("div",{class:a.b("scroll-item")},[A(e)]),footer:()=>{if(t.enableNew&&!t.state.readonly)return n("div",{class:a.b("scroll-item")},[P(o)])}})},M=()=>t.state.enableGroup?n("div",{class:a.b("group-content")},[t.state.groups.map(e=>(e=>{const{groupSysCss:o}=t.model;return n("div",{class:[a.be("group-content","item"),null==o?void 0:o.cssName,a.is("collapse",t.state.collapseKeys.includes(e.key.toString()))]},[n("div",{class:a.be("group-content","item-header")},[n("span",{class:a.be("group-content","item-title")},[e.caption]),n("span",{class:a.be("group-content","item-action")},[t.model.groupUIActionGroup&&e.groupActionGroupState&&n(i("iBizActionToolbar"),{zIndex:t.state.zIndex,class:a.be("group-content","header-actions"),"action-details":t.model.groupUIActionGroup.uiactionGroupDetails,"actions-state":e.groupActionGroupState,onActionClick:(a,n)=>{t.onGroupToolbarClick(a,n,e)}},null)])]),e.children.length>0?O(e.children,e,!t.state.draggable):n("div",{class:a.bem("group-content","item","empty")},[ibiz.i18n.t("app.noData")])])})(e))]):O(d.value?t.state.items.slice(0,t.state.size):t.state.items,void 0,!t.enableEditOrder),N=()=>{var e;null==(e=m.value)||e.scrollTo({top:0,behavior:"smooth"})};t.evt.on("onScrollToTop",()=>{N()});const L=()=>{d.value=!0,N()},R=()=>{d.value=!1},_=()=>n("div",{class:a.e("collapse-expand-icon")},[n("i",{class:"fa fa-angle-double-up",title:ibiz.i18n.t("control.common.collapseData"),onClick:L,"aria-hidden":"true"},null)]),j=()=>n("div",{class:a.e("collapse-expand-icon")},[n("i",{class:"fa fa-angle-double-down",title:ibiz.i18n.t("control.common.expandData"),onClick:R,"aria-hidden":"true"},null)]),V=()=>{var e;const o=null==(e=t.model.controls)?void 0:e.find(e=>e.name==="".concat(t.model.name,"_batchtoolbar"));if(o)return n("div",{class:[a.e("batchtoolbar"),a.is("show",t.showBatchToolbar)]},[n(i("iBizToolbarControl"),{modelData:o,context:t.context,params:t.params},null)])},F=()=>{var e;const{isLoaded:o}=t.state;if(!o)return;const s=null==(e=t.model.controls)?void 0:e.find(e=>e.name==="".concat(t.model.name,"_quicktoolbar"));if(s)return n(i("iBizToolbarControl"),{modelData:s,context:t.context,params:t.params,class:a.e("quicktoolbar")},null);const l={};return ce(t)&&Object.assign(l,{customRender:()=>n(de,{controller:t},null)}),n(i("iBizNoData"),{class:a.e("content"),text:t.model.emptyText,emptyTextLanguageRes:t.model.emptyTextLanguageRes,hideNoDataImage:t.state.hideNoDataImage},nf(l)?l:{default:()=>[l]})},U=()=>{let e=null;const i=!(t.state.items.length>=t.state.total||t.state.total<=t.state.size);return p.value&&(2===t.model.pagingMode&&(d.value?e=j():t.state.items.length>t.state.size&&(e=_())),3===t.model.pagingMode&&(d.value?e=j():i?e=n("div",{class:a.e("load-more")},[n("i",{class:"fa fa-angle-double-down",title:ibiz.i18n.t("control.common.loadMore"),onClick:()=>t.loadMore(),"aria-hidden":"true"},null)]):t.state.isCreated&&t.state.items.length>t.state.size&&(e=_()))),e},H=()=>{const{enableNavView:e,showNavIcon:i,showNavView:o}=t.state;if(e&&i)return n("ion-icon",o?{name:"eye-off-outline",class:a.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.hiddenNav"),onClick:()=>t.onShowNavViewChange()}:{name:"eye-outline",class:a.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.showNav"),onClick:()=>t.onShowNavViewChange()},null)},q=()=>{if(!t.state.noSort)return n(i("iBizSortBar"),{onSortChange:(e,a)=>{t.setSort(e.key,a),t.load({isInitialLoad:2===t.model.pagingMode||3===t.model.pagingMode})},sortItems:t.state.sortItems},null)},G=()=>[t.state.items.length>0?b(n("div",{class:a.e("content"),ref:"infiniteScroll","infinite-scroll-distance":10,"infinite-scroll-disabled":u.value,key:v.value},[M()]),[[C("infinite-scroll"),()=>t.loadMore()]]):F(),V(),H(),U()],W=()=>{if(t.state.enablePagingBar&&1===t.model.pagingMode)return n(i("iBizPagination"),{class:a.e("pagination"),total:t.state.total,curPage:t.state.curPage,size:t.state.size,totalPages:t.state.totalPages,onChange:w,onPageSizeChange:I,onPageRefresh:y},null)},Y=()=>({sortbar:()=>q(),searchbar:()=>(()=>{const e=Pn(t.view.model,"searchbar");if(!e)return;const a=e.name||e.id,n=t.view.providers[a];return l(i((null==n?void 0:n.component)||"IBizControlShell"),{context:t.view.context,params:t.view.params,modelData:e,...t.view.slotProps[a]||{},provider:n})})(),dataview:()=>n("div",{class:a.e("layout-content")},[G()]),pagingbar:()=>W()});return{c:t,ns:a,classNames:s,infiniteScroll:m,renderLayoutByStyle:()=>"userstyle"===h.value?Y():(()=>{if(t.state.isCreated)return[q(),...G(),W()]})()}},render(){let e;return n(i("iBizControlNavigation"),{controller:this.c},{default:()=>[n(i("iBizControlBase"),{class:[this.ns.is("enable-page",!!this.c.state.enablePagingBar)],controller:this.c},nf(e=this.renderLayoutByStyle())?e:{default:()=>[e]})]})}});var sf=Object.defineProperty,lf=(e,t,a)=>(((e,t,a)=>{t in e?sf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class rf{constructor(){lf(this,"component","IBizDataViewControl")}}e("V",rf);const cf=e("U",ie(of,function(e){e.component(of.name,of),Ha(qa.DATAVIEW,()=>new rf)}));function df(e,t){const a=t.state.items.find(t=>t._id===e);return a||t.state.items.find(t=>t._uuid===e)}function uf(e){switch(e){case"inner":return"inner";case"before":return"prev";case"after":return"next";default:throw new Vt(ibiz.i18n.t("control.tree.noSupported",{dropType:e}))}}const hf=a({name:"IBizTreeControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0},navigational:{type:Boolean,default:void 0},defaultExpandedKeys:{type:Array},loadDefault:{type:Boolean,default:!0},checkStrictly:{type:Boolean,default:!0},isSimple:{type:Boolean,default:!1},data:{type:Array,required:!1}},setup(e){const a=ne((...e)=>new zn(...e));!function(e,t){t.defaultExpandedKeys&&(e.state.defaultExpandedKeys=t.defaultExpandedKeys);const a=()=>{t.data&&t.data.find(e=>!0===e.isRoot)&&(e.state.rootNodes=t.data,e.state.items=t.data)};e.evt.on("onCreated",async()=>{t.isSimple&&(a(),e.state.isLoaded=!0)}),c(()=>t.data,()=>{t.isSimple&&a()},{deep:!0})}(a,e);const s=o(!1),l=o("default");a.evt.on("onCreated",()=>{a.controlParams.cascadeselect&&(s.value=!0),a.controlParams.menushowmode&&(l.value=a.controlParams.menushowmode)}),h(()=>{var e;null==(e=a.counter)||e.offChange(fn)});const u=B("control-".concat(a.model.controlType.toLowerCase())),p=o(null),m=o(null),v=o(""),b=o(null),f=o(null),w=o(null),y=o(),C=o(null),I=o(null),x=o(null),S=o("".concat(go(),"-").concat(go())),E=o(null),D=o(null),P=o(null);a.evt.on("onNewTreeNode",async e=>{var t;const{nodeModel:a,defaultValue:n,parentNodeData:i}=e,{appId:o,appDataEntityId:s}=a,l=await ibiz.hub.getAppDataEntity(s,o),r=function(e){if(e.controlRenders){const t=e.controlRenders.find(e=>"newnoderender"===(e.id||"").split("_")[0]);if(!t)return;if("LAYOUTPANEL_MODEL"===t.renderType&&t.layoutPanelModel)return Ua.execScriptFn({},t.layoutPanelModel,{isAsync:!1});if("LAYOUTPANEL"===t.renderType&&t.layoutPanel)return t.layoutPanel}}(a);if(r&&(D.value=new Tn(l,{}),P.value=r||null),x.value=n,f.value=null,w.value=null,E.value&&(null==(t=p.value)||t.remove(E.value),E.value=null),i&&p.value){const e={};Object.assign(e,{_id:S.value,_text:"",_leaf:!0}),p.value.append(e,i),E.value=e}I.value=a}),c(()=>b.value,e=>{e&&e.$el.getElementsByTagName("input")[0].focus()}),a.evt.on("onSelectionChange",async()=>{var e;p.value&&(a.state.singleSelect?p.value.setCurrentKey(null==(e=a.state.selectedData[0])?void 0:e._id):p.value.setCheckedKeys(a.state.selectedData.map(e=>e._id)))});const k=()=>{var e;const t=null==(e=p.value)?void 0:e.getCurrentKey();if(!t||t===f.value)return;const n=df(t,a),i=a.getNodeModel(n._nodeId);(null==i?void 0:i.allowEditText)&&(f.value=t)},z=async()=>{var e;if(f.value)if(w.value){const e=df(f.value,a);await a.modifyNodeText(e,w.value),f.value=null,w.value=null}else f.value=null;if(I.value){const t=D.value&&Object.values(D.value).some(e=>!!e);if(P.value&&t){const{textAppDEFieldId:e,id:t}=I.value,n={_nodeId:t,_text:[D.value[e]],_deData:{}};Object.assign(n._deData,D.value),x.value&&Object.keys(x.value).forEach(e=>{n._deData[e]||Object.assign(n._deData,{[e]:x.value[e]})}),await a.createDeNodeData([n])}else if(C.value){const{textAppDEFieldId:e,id:t}=I.value,n=C.value,i={_deData:{}};Object.assign(i,{_nodeId:t,_text:n}),x.value&&Object.assign(i._deData,x.value),Object.assign(i._deData,{[e]:n}),await a.createDeNodeData([i])}I.value=null,C.value=null,x.value=null,D.value=null,P.value=null,y.value=null,E.value&&(null==(e=p.value)||e.remove(E.value)),E.value=null}},T=async()=>{var e;f.value&&(f.value=null,w.value=null),I.value&&(I.value=null,C.value=null,x.value=null,D.value=null,P.value=null,y.value=null,E.value&&(null==(e=p.value)||e.remove(E.value)),E.value=null)},A=e=>{e.stopPropagation(),"Enter"!==e.code&&13!==e.keyCode||z(),"Escape"!==e.code&&27!==e.keyCode||T()},O=e=>{if(!e)return;const{panelItemEventName:t}=e;t===An.ENTER&&z()},M=e=>{"Escape"!==e.code&&27!==e.keyCode||T()},{updateUI:N,triggerNodeExpand:L}=function(e,t){const a=()=>{const t=e.value;if(!t)throw new Vt(ibiz.i18n.t("control.tree.noFoundInstance"));return t},n=()=>{var a;const i=e.value;i?(Object.values(i.store.nodesMap).forEach(e=>{const a=t.state.expandedKeys.includes(e.data._id);a!==e.expanded&&(a?e.expand():e.collapse())}),t.state.singleSelect?e.value.setCurrentKey((null==(a=t.state.selectedData[0])?void 0:a._id)||void 0):i.setCheckedKeys(t.state.selectedData.map(e=>e._id))):setTimeout(()=>{n()},200)},i=_o(n,500);return{getTreeInstance:a,updateUI:i,triggerNodeExpand:e=>{const t=a().store.nodesMap[e];if(t)return t.expanded?(t.collapse(),!1):(t.expand(),!0)}}}(p,a),{addLoadMoreNode:R}=function(e,t){const a=e=>({_id:"".concat(e,"_load_more"),_text:ibiz.i18n.t("control.common.loadMore"),_leaf:!0,_disableSelect:!0,_load_more:!0});return{toLoadMoreNode:a,addLoadMoreNode:(n,i)=>{if(!e.value||!n||!i)return;const o=a(n);e.value.getNode(o)&&e.value.remove(o);const s=t.getLoadMoreInfoItems(n);s&&s.some(e=>e.curPage<e.totalPage-1)&&e.value.append(o,i)}}}(p,a),_=e=>e.map(e=>({_id:e._id,_uuid:e._uuid,_leaf:e._leaf,_text:e._text,_disableSelect:e._disableSelect}));a.evt.on("onAfterRefreshParent",e=>{if(p.value){const{parentNode:t,children:a}=e,n=_(a);p.value.updateKeyChildren(t._id,n),N(),g(()=>{R(t._id,t)})}}),a.evt.on("onAfterNodeDrop",e=>{e.isChangedParent&&(v.value=go())}),a.evt.on("onUpdateUI",()=>{N()});const j=r(()=>a.state.isLoaded?a.model.rootVisible?a.state.rootNodes:a.state.rootNodes.reduce((e,t)=>t._children?e.concat(t._children):e,[]):[]);c(j,(e,t)=>{e!==t&&(v.value=go())}),c(()=>a.state.expandedKeys,()=>{N()},{deep:!0});let V=!1;const F=r(()=>!(!0!==a.context.srfreadonly&&"true"!==a.context.srfreadonly));let U;a.evt.on("onMounted",()=>{if(Object.values(a.contextMenus).length>0){(()=>t.import("@imengyu/vue3-context-menu"))().then(e=>{U=e.default,U.default&&!U.showContextMenu&&(U=U.default)})}});const H=i("IBizRawItem"),q=i("IBizIcon"),G=(e,t,i,o)=>{const s=[];return e.forEach(e=>{var l,r;if("SEPERATOR"===e.itemType)return void s.push({divided:"self"});const c=o[e.id];if(c&&!c.visible)return;let d={};if(e.showCaption&&e.caption&&(d.label=e.caption),e.sysImage&&e.showIcon&&(d.icon=n(q,{icon:e.sysImage},null)),"DEUIACTION"===e.itemType){d.disabled=c.disabled,d.clickClose=!0;const{uiactionId:n}=e;n&&(d.onClick=()=>{a.doUIAction(n,t,i,e.appId)})}else if("RAWITEM"===e.itemType){const{rawItem:t}=e;t&&(d.label=n(H,{rawItem:e},null))}else if("ITEMS"===e.itemType){const c=e;if((null==(l=c.detoolbarItems)?void 0:l.length)&&(d.children=G(c.detoolbarItems,t,i,o)),c.uiactionGroup&&c.groupExtractMode){const e=null==(r=c.uiactionGroup.uiactionGroupDetails)?void 0:r.filter(e=>o[e.id].visible).map(e=>{const s=o[e.id],{sysImage:l}=e;return{label:e.showCaption?e.caption:void 0,icon:e.showIcon?n(q,{icon:l},null):void 0,disabled:s.disabled,clickableWhenHasChildren:!0,onClick:()=>{U.closeContextMenu(),a.doUIAction(e.uiactionId,t,i,e.appId)}}});switch(c.groupExtractMode){case"ITEMS":d.children=e;break;case"ITEMX":e&&(d=e[0],d.children=e.slice(1));break;default:d=void 0,e&&s.push(...e)}}}d&&s.push(d)}),s},W=_o(()=>{a.load()},500),Y=e=>{"F2"!==e.code&&"Enter"!==e.code||k()},K=()=>{var e;const t=null==(e=y.value)?void 0:e.$el.querySelector(".is-focus");P.value&&!t&&z()};d(()=>{var e;document.addEventListener("mouseup",K.bind(this)),null==(e=m.value)||e.$el.addEventListener("keydown",Y)}),h(()=>{var e;document.removeEventListener("mouseup",K.bind(this)),null==(e=m.value)||e.$el.removeEventListener("keydown",Y)});return{c:a,ns:u,treeRef:p,treeviewRef:m,treeNodeTextInputRef:b,treeData:j,treeRefreshKey:v,editingNodeKey:f,editingNodeText:w,cascadeSelect:s,newNodeKey:S,newNodeData:E,findNodeData:df,onCheck:(e,t)=>{const{checkedNodes:n}=t;a.setSelection(n)},onNodeClick:(t,n,i)=>{var o,s;if(i.stopPropagation(),!t._disableSelect&&!V){if((null==(o=p.value)?void 0:o.getCurrentKey())!==t._id||F.value||k(),null==(s=p.value)||s.setCurrentKey(t._id),a.state.navigational){const e=a.getNodeModel(t._nodeId);if(!(null==e?void 0:e.navAppViewId)){const e=L(t._id);a.onExpandChange(t,e)}}e.isSimple?p.value.setCurrentKey(null==n?void 0:n._id):a.onTreeNodeClick(t,i),V=!0,setTimeout(()=>{V=!1},200)}},onNodeDbClick:(e,t)=>{t.stopPropagation(),e._disableSelect||a.onDbTreeNodeClick(e)},onNodeContextmenu:async(e,t)=>{var n;t.preventDefault(),t.stopPropagation();let i=ibiz.config.tree.contextMenuRightClickInvoke;if((null==(n=a.controlParams)?void 0:n.contextmenurightclickinvoke)&&(i=Object.is(a.controlParams.contextmenurightclickinvoke,"true")),!i)return;const o=a.getNodeModel(e._nodeId);if(!(null==o?void 0:o.decontextMenu))return;const s=a.contextMenus[o.decontextMenu.id];if(!s.model.detoolbarItems)return;await s.calcButtonState(e._deData||(e.srfkey?e:void 0),o.appDataEntityId,{view:a.view,ctrl:a});const l=s.state.buttonsState,r=G(s.model.detoolbarItems,e,t,l);r.length&&U.showContextMenu({x:t.x,y:t.y,customClass:u.b("context-menu"),items:r})},loadData:async(t,n)=>{if(e.isSimple){let i=[];if(0===t.level){const e=a.state.items.find(e=>e.isRoot);e&&(i=[e])}else i=function(e,t,a){const{detreeNodeRSs:n}=t,i=[];if(!n||0===n.length)return i;const o=n.filter(t=>{var n;const i=e.state.items.find(e=>e._uuid===a.data._uuid);return!!i&&t.parentDETreeNodeId===(null==(n=i._nodeId)?void 0:n.toLowerCase())});return o.sort((e,t)=>e.ordervalue-t.ordervalue),o.forEach(t=>{const a=e.state.items.filter(e=>{var a;return(null==(a=e._nodeId)?void 0:a.toLowerCase())===t.childDETreeNodeId});a.length&&a.forEach(e=>{const t=jo(e);t._id=go(),i.push(t)})}),i}(a,e.modelData,t);return t._children=i,n(_(i)),void N()}let i;if(0===t.level)i=j.value,ibiz.log.debug("初始加载");else{const e=df(t.data._uuid,a);e._children?(ibiz.log.debug("节点展开加载-本地",e),i=e._children):(ibiz.log.debug("节点展开加载-远程",e),i=await a.loadNodes(e))}ibiz.log.debug("给树返回值",i),n(_(i)),N(),g(()=>{var e,n,i;R(0===t.level?null==(n=null==(e=a.state.rootNodes)?void 0:e[0])?void 0:n._id:null==(i=t.data)?void 0:i._id,t)})},renderContextMenu:(e,t)=>{var o,s;if(!(null==(s=null==(o=null==e?void 0:e.decontextMenu)?void 0:o.detoolbarItems)?void 0:s.length))return;const r=a.contextMenuInfos[e.id];return r.clickTBUIActionItem&&r.onlyOneActionItem?null:n(i("iBizContextMenuControl"),{class:u.bem("node","buttons",l.value),modelData:e.decontextMenu,groupLevelKeys:[50,100],nodeModel:e,nodeData:t,context:a.context,actionCallBack:(e,n)=>a.doUIAction(e.uiactionId,t,n,e.appId)},null)},renderCounter:e=>{if(e.counterId){const t=a.state.counterData[e.counterId];return n(i("iBizBadge"),{value:t,class:u.e("counter"),counterMode:e.counterMode},null)}},updateNodeExpand:(t,n)=>{const i=df(t._uuid,a);if(!i)throw new Vt(ibiz.i18n.t("control.common.noFoundNode",{id:t._uuid}));if(e.isSimple){const e=jo(i);e._id=t._id,a.onExpandChange(e,n)}else a.onExpandChange(i,n)},onInput:e=>{a.state.query=e,W()},allowDrop:(e,t,n)=>{var i;if(null==(i=t.data)?void 0:i._load_more)return!1;const o=df(e.data._uuid,a),s=df(t.data._uuid,a);return a.calcAllowDrop(o,s,n)},allowDrag:e=>{var t;if(null==(t=e.data)?void 0:t._load_more)return!1;const n=df(e.data._uuid,a);return a.calcAllowDrag(n)},handleDrop:(e,t,n)=>{const i=uf(n),o=df(e.data._uuid,a),s=df(t.data._uuid,a);a.onNodeDrop(o,s,i)},onNodeTextEditBlur:z,renderNewNode:()=>{var e,t,o,s;return I.value?P.value?n(i("iBizControlShell"),{class:[u.b("new-node"),null==(e=I.value.sysCss)?void 0:e.cssName],ref:y,data:D.value,modelData:P.value,context:a.context,params:a.params,onMouseup:e=>e.stopPropagation(),onPanelItemEvent:O,onKeydown:M},null):n("div",{class:[u.b("new-node"),null==(t=I.value.sysCss)?void 0:t.cssName],onClick:e=>{e.preventDefault(),e.stopPropagation()}},[(null==(o=I.value)?void 0:o.sysImage)?n(q,{class:u.be("node","icon"),icon:null==(s=I.value)?void 0:s.sysImage},null):null,n(i("el-input"),{modelValue:C.value,"onUpdate:modelValue":e=>C.value=e,ref:"treeNodeTextInputRef",class:u.b("editing-node"),onBlur:()=>{z()},onKeydown:e=>{A(e)}},null)]):null},handleEditKeyDown:A,handleLoadMore:async(e,t)=>{var n,i;if(e.stopPropagation(),!t)return;if(0===t.level)return void await a.loadNodes(void 0,!0);const o=df(null==(n=t.data)?void 0:n._uuid,a);if(!o)return;await a.loadNodes(o,!0);const s=_(o._children||[]);null==(i=p.value)||i.updateKeyChildren(o._id,s),N(),g(()=>{R(o._id,o)})}}},render(){const e={searchbar:()=>this.c.enableQuickSearch?n(i("el-input"),{"model-value":this.c.state.query,class:this.ns.b("quick-search"),placeholder:this.c.state.placeHolder,onInput:this.onInput},{prefix:()=>n("ion-icon",{class:this.ns.e("search-icon"),name:"search"},null)}):null},t=this.c.controlPanel?"tree":"default";return e[t]=()=>{if(this.c.state.isLoaded&&this.treeRefreshKey)return[n(i("el-tree"),y({ref:"treeRef",class:this.ns.b("tree"),key:this.treeRefreshKey,"node-key":"_id","highlight-current":!0,"expand-on-click-node":!1,"auto-expand-parent":!1,"show-checkbox":!this.c.state.singleSelect,"check-strictly":!this.cascadeSelect&&this.checkStrictly,"default-expanded-keys":this.c.state.expandedKeys,props:{label:"_text",children:"_children",isLeaf:"_leaf",disabled:"_disableSelect",class:e=>(null==e?void 0:e._load_more)?this.ns.is("load-more",!0):""},lazy:!0,load:this.loadData,onCheck:this.onCheck,onNodeExpand:e=>{this.updateNodeExpand(e,!0)},onNodeCollapse:e=>{this.updateNodeExpand(e,!1)},draggable:!0,"allow-drop":this.allowDrop,"allow-drag":this.allowDrag,onNodeDrop:this.handleDrop},this.$attrs),{default:({data:e,node:t})=>{var a,o;if(e._load_more)return n("div",{class:this.ns.b("node"),onClick:e=>{this.handleLoadMore(e,null==t?void 0:t.parent)}},[e._text]);if(this.newNodeKey===e._id)return this.renderNewNode();const s=this.findNodeData(e._uuid,this.c);if(!s)return null;const l=this.c.getNodeModel(s._nodeId);if(this.editingNodeKey===s._id)return n("div",{class:[this.ns.b("node"),null==(a=l.sysCss)?void 0:a.cssName]},[n(i("el-input"),{modelValue:this.editingNodeText,"onUpdate:modelValue":e=>this.editingNodeText=e,ref:"treeNodeTextInputRef",class:this.ns.b("editing-node"),onBlur:()=>{this.onNodeTextEditBlur()},onKeydown:e=>{this.handleEditKeyDown(e)}},null)]);const r=function(e){if(e.controlRenders){const t=e.controlRenders.filter(e=>"newnoderender"!==(e.id||"").split("_")[0]);return kn({controlRenders:t})}}(l);let c;return c=r?n(i("iBizControlShell"),{data:s,modelData:r,context:this.c.context,params:this.c.params},null):[s._icon?n(i("iBizIcon"),{class:this.ns.be("node","icon"),icon:s._icon},null):null,s._textHtml?n("span",{class:this.ns.be("node","label"),innerHTML:s._textHtml},null):n("span",{class:this.ns.be("node","label")},[s._text])],n("div",{class:[this.ns.b("node"),s._disableSelect?this.ns.bm("node","disabled"):"",null==(o=l.sysCss)?void 0:o.cssName],title:s._text,onDblclick:e=>this.onNodeDbClick(s,e),onClick:t=>this.onNodeClick(s,e,t),onContextmenu:e=>this.onNodeContextmenu(s,e)},[c,this.renderCounter(l),this.renderContextMenu(l,s)])}}),!this.newNodeData&&this.renderNewNode(),this.c.state.enableNavView&&this.c.state.showNavIcon?this.c.state.showNavView?n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.hiddenNav"),name:"eye-off-outline",onClick:()=>this.c.onShowNavViewChange()},null):n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.showNav"),name:"eye-outline",onClick:()=>this.c.onShowNavViewChange()},null):null]},n(i("iBizControlNavigation"),{controller:this.c},{default:()=>{return[b(n(i("iBizControlBase"),{ref:"treeviewRef",controller:this.c},(t=e,"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]})),[[C("loading"),this.c.state.isLoading]])];var t}})}});var pf=Object.defineProperty,mf=(e,t,a)=>(((e,t,a)=>{t in e?pf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class vf{constructor(){mf(this,"component","IBizTreeControl")}}const gf=e("W",ie(hf,function(e){e.component(hf.name,hf),Ha(qa.TREEVIEW,()=>new vf)})),bf=a({name:"IBizPickupViewPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},singleSelect:{type:Boolean,default:!0},noLoadDefault:{type:Boolean,default:!1}},setup(){const e=ne((...e)=>new On(...e)),t=B("control-".concat(e.model.controlType.toLowerCase()));return{c:e,ns:t,onCreated:t=>{e.setEmbedView(t.view)}}},render(){return n(i("iBizControlBase"),{controller:this.c},{default:()=>[this.c.state.isCreated&&(this.$slots.default?this.$slots.default({context:this.c.state.context,params:this.c.state.params,state:{singleSelect:this.c.state.singleSelect,noLoadDefault:this.noLoadDefault},onCreated:this.onCreated}):l(i("IBizViewShell"),{context:this.c.state.context,params:this.c.state.params,viewId:this.c.model.embeddedAppDEViewId,state:{singleSelect:this.c.state.singleSelect,noLoadDefault:this.noLoadDefault},onCreated:this.onCreated}))]})}});var ff=Object.defineProperty,wf=(e,t,a)=>(((e,t,a)=>{t in e?ff(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class yf{constructor(){wf(this,"component","IBizPickupViewPanelControl")}}const Cf=e("X",ie(bf,function(e){e.component(bf.name,bf),Ha(qa.PICKUP_VIEW_PANEL,()=>new yf)}));const If=a({name:"IBizTabExpPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},defaultTabName:{type:String,required:!1}},setup(){var e;const t=ne((...e)=>new Mn(...e)),a=B("control-".concat(t.model.controlType.toLowerCase())),n=(null==(e=t.view.model.tabLayout)?void 0:e.toLowerCase())||"top",i=us();let o="";return t.routeDepth&&(o=me(i,t.routeDepth)),c(()=>i.fullPath,(e,a)=>{if(e!==a){const e=t.routeDepth;if(e){if(me(i,t.routeDepth)===o){const a=Y(i),{srfnav:n}=a.pathNodes[e-1];n&&t.state.activeName&&t.state.activeName!==n&&(t.state.activeName=n,t.handleTabChange())}}}},{immediate:!0}),{c:t,ns:a,tabPosition:n,handleTabChange:()=>{t.handleTabChange()}}},render(){let e;const{isCreated:t,tabPages:a,counterData:o}=this.c.state;return n(i("iBizControlBase"),{controller:this.c},{default:()=>{return[t&&n(i("el-tabs"),{modelValue:this.c.state.activeName,"onUpdate:modelValue":e=>this.c.state.activeName=e,tabPosition:this.tabPosition,onTabChange:this.handleTabChange},(l=e=a.map(e=>{const t=e.counterId?o[e.counterId]:void 0;return n(i("el-tab-pane"),{class:[this.ns.e("tab-item")],label:e.caption,name:e.tabTag},{label:()=>n("span",{class:[...e.class]},[this.c.isShowIcon&&n(i("iBizIcon"),{icon:e.sysImage},null),this.c.isShowCaption&&e.caption,!Po(t)&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:t},null)])})}),"function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?e:{default:()=>[e]}))];var l}})}});var xf=Object.defineProperty,Sf=(e,t,a)=>(((e,t,a)=>{t in e?xf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ef{constructor(){Sf(this,"component","IBizTabExpPanelControl")}}const Df=e("Y",ie(If,function(e){e.component(If.name,If),Ha(qa.TAB_EXP_PANEL,()=>new Ef)}));function Pf(e,t){const a=B("exp-bar"),o=_o(()=>{e.load()},500),s=t=>{e.state.query=t,o()};return{renderTitle:()=>{const{model:o}=e;if(!o.showTitleBar)return null;let s=o.title;return o.titleLanguageRes&&(s=ibiz.i18n.t(o.titleLanguageRes.lanResTag,o.title)),n("div",{class:[t.b("caption"),a.b("caption")]},[o.sysImage&&n(i("iBizIcon"),{class:[a.be("caption","icon")],icon:o.sysImage},null),s&&n("span",{class:[t.be("caption","text")]},[s])])},renderSearchBar:()=>{var o,r;const{model:c}=e;if(!c.enableSearch)return null;const d=null==(r=null==(o=e.view.model.viewLayoutPanel)?void 0:o.controls)?void 0:r.find(e=>"searchbar"===e.id);if(d){const t={context:e.context,params:e.params},a=i("IBizControlShell");return l(a,{modelData:d,...t})}return n(i("el-input"),{"model-value":e.state.query,class:[t.b("quick-search"),a.b("quick-search")],placeholder:e.state.placeHolder,onInput:s},{prefix:()=>n("ion-icon",{class:t.e("search-icon"),name:"search"},null)})}}}function kf(e){const t=e.view.modal.routeDepth;if(t){const a=us();let n;ve(({currentKey:i,fullPath:o})=>{if(n){if(n===i){const n=Y(a),{srfnav:i}=n.pathNodes[t-1];e.onRouterChange({srfnav:i||"",path:o})}}else n=i},t)}}const zf=a({name:"IBizTreeExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},noNeedNavView:{type:Boolean,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Nn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);kf(e);const i=r(()=>e.view.model.viewType&&!["DEMPICKUPVIEW2","DEPICKUPVIEW2"].includes(e.view.model.viewType));return{c:e,ns:t,navigational:i,renderTitle:a,renderSearchBar:n}},render(){const{state:e,XDataModel:t}=this.c,{isCreated:a}=e,o={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(a&&t){const e=this.c.controlPanel?t.name:"default";o[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,navigational:this.navigational,mdctrlActiveMode:1,loadDefault:!1,"default-expanded-keys":this.c.defaultExpandedKeys},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(l=o)||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?o:{default:()=>[o]});var l}});var Tf=Object.defineProperty,Af=(e,t,a)=>(((e,t,a)=>{t in e?Tf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Of{constructor(){Af(this,"component","IBizTreeExpBarControl")}}const Mf=e("Z",ie(zf,function(e){e.component(zf.name,zf),Ha(qa.TREE_EXP_BAR,()=>new Of)}));const Nf=a({name:"IBizListExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Bn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{isCreated:e}=this.c.state,{XDataModel:t}=this.c,a={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(e&&t){const e=this.c.controlPanel?t.name:"default";a[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}});var Bf=Object.defineProperty,Lf=(e,t,a)=>(((e,t,a)=>{t in e?Bf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Rf{constructor(){Lf(this,"component","IBizListExpBarControl")}}const _f=e("_",ie(Nf,function(e){e.component(Nf.name,Nf),Ha(qa.LIST_EXPBAR,()=>new Rf)}));const jf=a({name:"IBizGridExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Bn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{isCreated:e}=this.c.state,{XDataModel:t}=this.c,a={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(e&&t){const e=this.c.controlPanel?t.name:"default";a[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}});var Vf=Object.defineProperty,Ff=(e,t,a)=>(((e,t,a)=>{t in e?Vf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Uf{constructor(){Ff(this,"component","IBizGridExpBarControl")}}const Hf=e("$",ie(jf,function(e){e.component(jf.name,jf),Ha(qa.GRID_EXPBAR,()=>new Uf)}));const qf=a({name:"IBizDataViewExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Bn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{isCreated:e}=this.c.state,{XDataModel:t}=this.c,a={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(e&&t){const e=this.c.controlPanel?t.name:"default";a[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}});var Gf=Object.defineProperty,Wf=(e,t,a)=>(((e,t,a)=>{t in e?Gf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Yf{constructor(){Wf(this,"component","IBizDataViewExpBarControl")}}const Kf=e("a0",ie(qf,function(e){e.component(qf.name,qf),Ha(qa.DATA_VIEW_EXPBAR,()=>new Yf)}));const Xf=a({name:"IBizCalendarExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Ln(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{state:e,XDataModel:t}=this.c,{isCreated:a}=e,o={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(a&&t){const e=this.c.controlPanel?t.name:"default";o[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(l=o)||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?o:{default:()=>[o]});var l}});var $f=Object.defineProperty,Jf=(e,t,a)=>(((e,t,a)=>{t in e?$f(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Qf{constructor(){Jf(this,"component","IBizCalendarExpBarControl")}}const Zf=e("a1",ie(Xf,function(e){e.component(Xf.name,Xf),Ha(qa.CALENDAR_EXPBAR,()=>new Qf)}));const ew=a({name:"IBizChartExpBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new Rn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),{renderTitle:a,renderSearchBar:n}=Pf(e,t);return kf(e),{c:e,ns:t,renderTitle:a,renderSearchBar:n}},render(){const{isCreated:e}=this.c.state,{XDataModel:t}=this.c,a={captionbar:this.renderTitle,searchbar:this.renderSearchBar};if(e&&t){const e=this.c.controlPanel?t.name:"default";a[e]=()=>n(i("iBizControlShell"),{context:this.c.context,params:this.c.params,modelData:t,singleSelect:!0,mdctrlActiveMode:1,loadDefault:!1},null)}return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}});var tw=Object.defineProperty,aw=(e,t,a)=>(((e,t,a)=>{t in e?tw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class nw{constructor(){aw(this,"component","IBizChartExpBarControl")}}const iw=e("a2",ie(ew,function(e){e.component(ew.name,ew),Ha(qa.CHART_EXPBAR,()=>new nw)})),ow=a({name:"IBizSearchBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){var e;const t=ne((...e)=>new _n(...e)),a=o({}),s=e=>{a.value=e};t.evt.on("onCreated",()=>{t.counter&&t.counter.onChange(s,!0)}),h(()=>{var e;null==(e=t.counter)||e.offChange(s)}),t.setStorageKeyFn(ge(t.context,"SEARCH_BAR_SELECTED_GROUP",t.view.modal.routeDepth,"@","".concat(t.view.model.codeName,"@").concat(t.model.codeName)));const l=B("control-".concat(t.model.controlType.toLowerCase()));let c=!1;const d=()=>{c=!0,t.onSearch()},u=r(()=>t.model.quickSearchWidth?l.cssVarBlock({"quick-search-width":"".concat(t.model.quickSearchWidth,"px")}):{});if(t.model.enableGroup&&t.model.searchBarGroups&&(null==(e=t.model.searchBarGroups)?void 0:e.length)>0){const e=t.model.searchBarGroups.find(e=>e.defaultGroup);t.state.selectedGroupItem=e||t.model.searchBarGroups[0]}const p=o();let m;return{c:t,ns:l,cssVars:u,filterButtonRef:p,counterData:a,onClear:()=>{!0===c&&(c=!1,t.onSearch())},onSearch:d,onKeydown:e=>{"Enter"===e.code&&d()},onGroupClick:e=>{t.state.selectedGroupItem=e,t.evt.emit("onTabChange",{data:[e]}),d()},triggerFilter:()=>{m?m.dismiss():(async()=>{m=ibiz.overlay.createPopover(()=>n(i("iBizFilterTreeControl"),{filterControllers:t.filterControllers,filterNodes:t.state.filterNodes,parent:"search-bar",filterMode:t.state.filterMode,customCond:t.state.customCond,context:t.context,params:t.params,schemaEntityMap:t.schemaEntityMap,onCustomCondChange:e=>{t.state.customCond=e},onConfirm:(e,a)=>{t.state.filterMode=e,t.state.customCond=a,t.onSearch(),m&&m.dismiss()},onCancel:()=>{t.resetFilter(),t.state.customCond=""}},null),void 0,{placement:"bottom-end",autoClose:!0}),m.present(p.value.$el),await m.onWillDismiss(),m=void 0})()},handleSave:()=>{t.handleSave()},renderAdvancedSearch:()=>t.state.advancedQuickSearch?n(i("iBizQuickSearchSelect"),{controller:t},null):null}},render(){return n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b()],style:this.cssVars},{default:()=>{var e;return[this.c.model.enableGroup&&(this.c.isBackendSearchGroup?n(i("iBizSearchGroups"),{controller:this.c,counterData:this.counterData},null):n("div",{class:this.ns.b("quick-group")},[null==(e=this.c.model.searchBarGroups)?void 0:e.map(e=>{var t;return this.c.calcCountVisible(e)?n("span",{class:[this.ns.b("quick-group-item"),this.ns.is("selected",(null==(t=this.c.state.selectedGroupItem)?void 0:t.id)===e.id)],onClick:()=>this.onGroupClick(e)},[e.caption,e.counterId&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:this.counterData[e.counterId],counterMode:e.counterMode},null)]):null})])),this.c.model.enableGroup&&this.c.isBackendSearchGroup&&n(i("el-button"),{class:this.ns.b("save"),title:Tt(ibiz.i18n.t("control.searchBar.saveGroup")),onClick:this.handleSave},{default:()=>[n("ion-icon",{name:"save-outline"},null)]}),this.c.model.enableQuickSearch&&n(i("el-input"),{modelValue:this.c.state.query,"onUpdate:modelValue":e=>this.c.state.query=e,class:[this.ns.b("quick-search"),this.ns.is("advanced-quick-search",this.c.state.advancedQuickSearch)],placeholder:this.c.state.quickSearchPlaceHolder,clearable:!0,onKeydown:this.onKeydown,onClear:this.onClear,"suffix-icon":n("ion-icon",{onClick:this.onSearch,class:this.ns.e("search-icon"),name:"search"},null)},{prepend:()=>this.renderAdvancedSearch()}),this.c.enableFilter&&n(i("el-button"),{ref:"filterButtonRef",type:"primary",title:Tt(ibiz.i18n.t("control.searchBar.filter")),class:this.ns.b("filter"),onClick:()=>this.triggerFilter()},{default:()=>[n(i("iBizIcon"),{icon:{cssClass:"funnel-outline"}},null)]})]}})}});var sw=Object.defineProperty,lw=(e,t,a)=>(((e,t,a)=>{t in e?sw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class rw{constructor(){lw(this,"component","IBizSearchBarControl")}}function cw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const dw=[{valueOP:Oa.EQ,label:"等于(=)"},{valueOP:Oa.NOT_EQ,label:"不等于(<>)"},{valueOP:Oa.GT,label:"大于(>)"},{valueOP:Oa.GT_AND_EQ,label:"大于等于(>=)"},{valueOP:Oa.LT,label:"小于(<)"},{valueOP:Oa.LT_AND_EQ,label:"小于等于(<=)"},{valueOP:Oa.IS_NULL,label:"值为空(Nil)"},{valueOP:Oa.IS_NOT_NULL,label:"值不为空(NotNil)"},{valueOP:Oa.IN,label:"值在范围中(In)"},{valueOP:Oa.NOT_IN,label:"值不在范围中(NotIn)"},{valueOP:Oa.LIKE,label:"文本包含(%)"},{valueOP:Oa.LIFT_LIKE,label:"文本左包含(%#)"},{valueOP:Oa.RIGHT_LIKE,label:"文本右包含(#%)"},{valueOP:Oa.EXISTS,label:"存在(EXISTS)"},{valueOP:Oa.NOT_EXISTS,label:"不存在(NOTEXISTS)"}],uw=[Oa.IS_NULL,Oa.IS_NOT_NULL,Oa.EXISTS,Oa.NOT_EXISTS],hw=a({name:"IBizFilterTreeControl",props:{filterControllers:{type:Array,required:!0},filterNodes:{type:Array,required:!0},parent:{type:String,required:!0},filterMode:{type:String,default:"default"},customCond:{type:String,default:""},context:{type:Object},params:{type:Object},schemaEntityMap:{type:Object,default:()=>new Map}},emits:["confirm","cancel","change","customCondChange"],setup(e,{emit:t}){const a=B("filter-tree"),s=r(()=>"search-bar"===e.parent),d=r(()=>e.filterNodes),u=t=>{if("ITEMS"===t.nodeType&&t.simple){const a=t.children[0];return e.filterControllers.find(e=>{if("SIMPLE_ITEMS"===e.type){const n=e;if(n.fieldName===t.field&&n.valueOP===t.valueOP&&n.subFieldName===a.field&&n.subValueOP===a.valueOP)return!0}return!1})}const{field:a,valueOP:n}=t;return e.filterControllers.find(e=>"SIMPLE_ITEMS"!==e.type&&(e.fieldName===a&&(!e.valueOP||e.valueOP===n)))},h=[];e.filterControllers.forEach(e=>{let t=h.find(t=>t.name===e.key);e.hidden||(void 0===t&&(t={name:e.key,fieldName:e.fieldName,label:e.label,valueOPs:[]},"SIMPLE_ITEMS"===e.type&&(t.simpleFilterC=e),h.push(t)),e.valueOP?t.valueOPs.push(e.valueOP):t.valueOPs=dw.map(e=>e.valueOP))});const m=o([]);h.forEach(async t=>{var a,n;const i=e.filterControllers.find(e=>e.key===t.name);i&&m.value.push({appDEFieldId:t.fieldName,caption:t.label,valueOPs:t.valueOPs,appDataEntityId:e.schemaEntityMap.get(t.fieldName),appDataEntityFullTag:null==(a=i.appDataEntity)?void 0:a.defullTag,appCodeListId:null==(n=i.model.editor)?void 0:n.appCodeListId})});const v=o(),g=o(e.filterMode||"default"),b=o(""),f=e=>{b.value=e,t("customCondChange",b.value)};c(()=>e.customCond,()=>{b.value=e.customCond},{immediate:!0});const w=(e,t,a=h)=>{const n=a.find(e=>e.name===t);n?(bo(e),n.simpleFilterC?n.simpleFilterC.addSimpleFilterNode(e):(e.nodeType="FIELD",e.field=n.fieldName)):ibiz.log.error("allFields找不到属性标识为".concat(t,"的"))},y=e=>{e.children.push({nodeType:"FIELD",field:null,valueOP:null,value:null})},C=(e,t)=>{if(t.noEditor||e.valueOP&&uw.includes(e.valueOP))return null;let o=null;if(t.editorProvider){const{data:a,value:n}=t.calcEditorProps(e),s=i(t.editorProvider.formEditor);o=l(s,{key:t.editor.model.id,value:n,controller:t.editor,disabled:e.disabled,data:a,onChange:(a,n)=>{t.onEditorChange(e,a,n)}})}else o=n(i("not-supported-editor"),{modelData:t.model.editor},null);return n("div",{class:a.e("editor")},[o])},I=(e,t)=>{if(e.hidden)return;let o=h;t&&(o=t.allFields);const s=((e,t=h)=>{if(!e)return;const a=t.find(t=>t.name===e);return a?a.valueOPs:void 0})(e.field,o);let l=null;if(e.field&&e.valueOP)if(t){const a=t.getSubFilterController(e.field,e.valueOP);l=C(e,a)}else{const t=u(e);t&&!["EXISTS","NOTEXISTS"].includes(t.valueOP)&&(l=C(e,t))}return n("div",{class:a.b("item")},[n(i("el-select"),{disabled:e.disabled,"model-value":e.field,teleported:!1,class:a.e("field-select"),onChange:t=>{w(e,t,o)}},{default:()=>[null==o?void 0:o.map(e=>n(i("el-option"),{key:e.name,value:e.name,label:e.label},null))]}),s&&s.length>0&&n(i("iBizFilterModeSelect"),{disabled:e.disabled,class:a.e("mode-select"),value:e.valueOP,modes:s,onChange:t=>{((e,t)=>{e.valueOP=t,e.value=null,["EXISTS","NOTEXISTS"].includes(t)?Object.assign(e,{nodeType:"ITEMS",children:[{nodeType:"FIELD",field:null,valueOP:null,value:null}]}):Object.assign(e,{nodeType:"FIELD",children:void 0})})(e,t)}},null),l])};let x=e=>n("div",null,null);const S=(t,o,l)=>{if(!t.hidden)return"ITEMS"===t.nodeType?x(t):n("div",{class:a.b("group")},[n("div",{class:a.be("group","actions")},[n(i("el-button"),{text:!0,type:"primary",onClick:()=>{"pql"!==g.value?(e=>{e.children.push({nodeType:"GROUP",logicType:"AND",children:[{nodeType:"FIELD",field:null,valueOP:null,value:null}]})})(t):g.value="default"}},{default:()=>["pql"===g.value?"切换组":"添加组"]}),n(i("el-button"),{text:!0,onClick:()=>{"pql"!==g.value?y(t):g.value="default"}},{default:()=>["pql"===g.value?"切换项":"添加项"]}),l&&s.value&&n(i("el-button"),{text:!0,onClick:()=>{g.value="pql"}},{default:()=>[p("添加PQL")]}),n(i("el-select"),{"model-value":t.logicType,teleported:!1,class:a.be("group","logic-type"),onChange:e=>{g.value="default",((e,t)=>{e.logicType=t})(t,e)}},{default:()=>[n(i("el-option"),{key:"AND",value:"AND",label:"AND"},null),n(i("el-option"),{key:"OR",value:"OR",label:"OR"},null)]})]),"pql"===g.value&&n("div",{class:a.be("group","editor")},[n(i("iBizPqlEditor"),{ref:"pqlEditor",value:b.value,fields:m.value,context:e.context,params:e.params,onChange:f},null)]),"pql"!==g.value&&n("div",{class:a.be("group","list")},[t.children.length>0&&t.children.map((e,s)=>{const l="FIELD"===e.nodeType?I(e,o):S(e,o);return l?n("div",{class:a.be("group","list-item")},[n("div",{class:a.be("group","list-item-left")},[t.logicType]),l,n(i("iBizIcon"),{class:a.be("group","list-item-right"),onClick:()=>{t.children.splice(s,1)},icon:{cssClass:"trash"}},null)]):null})])])};x=e=>{let t;const o=u(e);if(o){if(e.simple){let t;const s=e.children[0];if(!s)return;return[n(i("el-select"),{disabled:s.disabled,"model-value":o.key,teleported:!1,class:a.e("field-select"),onChange:t=>{w(e,t)}},cw(t=h.map(e=>n(i("el-option"),{key:e.name,value:e.name,label:e.label},null)))?t:{default:()=>[t]}),n(i("iBizFilterModeSelect"),{disabled:!0,class:a.e("mode-select"),value:s.valueOP,modes:[s.valueOP]},null),C(s,o)]}return n("div",{class:(a.b("group"),a.bm("group","items"))},[n("div",{class:a.be("group","actions")},[I(e),n(i("el-button"),{text:!0,onClick:()=>{y(e)}},cw(t=ibiz.i18n.t("control.searchBar.filterTree.addItem"))?t:{default:()=>[t]})]),n("div",{class:a.be("group","list")},[e.children.length>0&&e.children.map((t,s)=>{const l="FIELD"===t.nodeType?I(t,o):S(t,o);return n("div",{class:a.be("group","list-item")},[n("div",{class:a.be("group","list-item-left")},[p("AND")]),l,n(i("iBizIcon"),{class:a.be("group","list-item-right"),onClick:()=>{e.children.splice(s,1)},icon:{cssClass:"trash"}},null)])})])])}};return{ns:a,renderFilterGroup:S,renderFilterItem:I,onConfirm:()=>{var e,a;if("pql"!==g.value)t("confirm",g.value,b.value);else if(v.value){(null==(a=(e=v.value).verify)?void 0:a.call(e))&&t("confirm",g.value,b.value)}},onCancel:()=>{t("cancel")},isInSearchBar:s,UiFilterNodes:d,pqlEditor:v}},render(){let e;return n("div",{class:[this.ns.b()]},[this.UiFilterNodes.length>0&&this.UiFilterNodes.map(e=>"FIELD"===e.nodeType?this.renderFilterItem(e):this.renderFilterGroup(e,void 0,!0)),n("div",{class:this.ns.b("footer")},[n(i("el-button"),{onClick:()=>{this.onConfirm()}},{default:()=>[this.isInSearchBar?ibiz.i18n.t("app.search"):ibiz.i18n.t("control.common.determine")]}),n(i("el-button"),{onClick:()=>{this.onCancel()}},cw(e=ibiz.i18n.t("app.reset"))?e:{default:()=>[e]})])])}});const pw=[{valueOP:Oa.EQ,label:"等于(=)"},{valueOP:Oa.NOT_EQ,label:"不等于(<>)"},{valueOP:Oa.GT,label:"大于(>)"},{valueOP:Oa.GT_AND_EQ,label:"大于等于(>=)"},{valueOP:Oa.LT,label:"小于(<)"},{valueOP:Oa.LT_AND_EQ,label:"小于等于(<=)"},{valueOP:Oa.IS_NULL,label:"值为空(Nil)"},{valueOP:Oa.IS_NOT_NULL,label:"值不为空(NotNil)"},{valueOP:Oa.IN,label:"值在范围中(In)"},{valueOP:Oa.NOT_IN,label:"值不在范围中(NotIn)"},{valueOP:Oa.LIKE,label:"文本包含(%)"},{valueOP:Oa.LIFT_LIKE,label:"文本左包含(%#)"},{valueOP:Oa.RIGHT_LIKE,label:"文本右包含(#%)"},{valueOP:Oa.EXISTS,label:"存在(EXISTS)"},{valueOP:Oa.NOT_EXISTS,label:"不存在(NOTEXISTS)"}],mw=a({name:"IBizFilterModeSelect",props:{value:String,modes:Array,disabled:Boolean},emits:{change:e=>!0},setup:(e,{emit:t})=>({availableModes:r(()=>{var t;return(null==(t=e.modes)?void 0:t.length)?pw.filter(t=>e.modes.includes(t.valueOP)):pw}),onChange:e=>{t("change",e)}}),render(){let e;return n(i("el-select"),{"model-value":this.value,disabled:this.disabled,teleported:!1,onChange:e=>{this.onChange(e)}},"function"==typeof(t=e=this.availableModes.map(e=>n(i("el-option"),{key:e.valueOP,value:e.valueOP,label:e.label},null)))||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]});var t}});function vw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const gw=a({name:"IBizSearchGroups",components:{draggable:is},props:{controller:{type:Object,required:!0},counterData:{type:Object,default:()=>{}}},setup(e){const t=B("search-groups"),a=e.controller,i=o(!1),{newDialogVisible:s,newForm:l,newFormRef:c,newFormRules:d,handleNewFormSubmit:h,handleNewFormCancel:p}=function(e){const t=o(!1),a=u({caption:""}),n=o(),i=u({caption:[{required:!0,message:ibiz.i18n.t("control.searchBar.searchGroups.groupValueRule"),trigger:"blur"}]}),s=()=>{n.value&&n.value.resetFields(),t.value=!1};return{newDialogVisible:t,newForm:a,newFormRef:n,newFormRules:i,handleNewFormSubmit:async()=>{n.value&&await n.value.validate(async(t,n)=>{if(t){if(e.state.searchBarGroups.find(e=>e.caption===a.caption))return void ibiz.message.error(ibiz.i18n.t("control.searchBar.searchGroups.errorMessage"));await e.service.create(a.caption),s(),await e.initSearBarGroups(),ibiz.message.success("".concat(ibiz.i18n.t("control.common.newSuccCreated"),"!"))}})},handleNewFormCancel:s}}(a),{editDialogVisible:m,editForm:v,editFormRef:g,editFormRules:b,handleEditFormSubmit:f,handleEditFormCancel:w}=function(e){const t=o(!1),a=u({caption:""}),n=o(),i=u({caption:[{required:!0,message:ibiz.i18n.t("control.searchBar.searchGroups.groupValueRule"),trigger:"blur"}]});return{editDialogVisible:t,editForm:a,editFormRef:n,editFormRules:i,handleEditFormSubmit:async()=>{n.value&&await n.value.validate(async(n,i)=>{if(n){if(e.currentEditGroup&&(await e.service.update(e.currentEditGroup.id,{caption:a.caption})).ok){const t=e.state.searchBarGroups.findIndex(t=>t.id===e.currentEditGroup.id);-1!==t&&(e.state.searchBarGroups[t].caption=a.caption)}ibiz.message.success("".concat(ibiz.i18n.t("control.common.updateSuccess"),"!")),t.value=!1}})},handleEditFormCancel:()=>{t.value=!1}}}(a),y=a.model.quickGroupCount||4,C=r(()=>a.state.searchBarGroups.filter(e=>e.show).slice(0,y)),I=r(()=>a.state.searchBarGroups.filter(e=>e.show).slice(y)),x=r(()=>!!a.state.selectedSearchGroupItem&&I.value.includes(a.state.selectedSearchGroupItem));return{ns:t,c:a,showGroups:C,hiddenGroups:I,onGroupClick:e=>{a.handleGroupClick(e)},newDialogVisible:s,editDialogVisible:m,manageDialogVisible:i,newGroup:()=>{s.value=!0},manageGroup:()=>{i.value=!0},newForm:l,newFormRef:c,newFormRules:d,handleNewFormSubmit:h,handleNewFormCancel:p,editForm:v,editFormRef:g,editFormRules:b,handleEditFormSubmit:f,handleEditFormCancel:w,editGroup:e=>{m.value=!0,a.currentEditGroup=e,v.caption=e.caption||e.name},removeGroup:e=>{Co({title:ibiz.i18n.t("control.searchBar.searchGroups.delTitle"),message:()=>n("div",{class:t.b("remove-dialog")},[n("div",{class:t.b("remove-dialog-content"),innerHTML:ibiz.i18n.t("control.searchBar.searchGroups.confirmDelPrompt",{itemName:e.caption||e.name})},null),n("div",{class:t.b("remove-dialog-tip")},[ibiz.i18n.t("control.searchBar.searchGroups.unrecoverablePrompt")])]),showCancelButton:!0,confirmButtonText:ibiz.i18n.t("control.common.determine"),confirmButtonClass:t.b("remove-confirm-btn"),cancelButtonText:ibiz.i18n.t("app.cancel"),cancelButtonClass:t.b("remove-cancel-btn")}).then(async()=>{if(e.id){if((await a.service.remove(e.id)).ok){const t=a.state.searchBarGroups.findIndex(t=>t.name===e.name);-1!==t&&a.state.searchBarGroups.splice(t,1)}ibiz.message.success("".concat(ibiz.i18n.t("control.common.deleteSuccess"),"!")),await a.initSearBarGroups()}}).catch(()=>{})},isActiveMore:x,onDragChange:async e=>{if(a.state.searchBarGroups.forEach((e,t)=>{e.order=100*(t+1)}),e.moved){const t=e.moved.newIndex,n=e.moved.oldIndex,i=Math.min(t,n),o=Math.max(t,n)+1,s=a.state.searchBarGroups.slice(i,o);if(s.length>0){const e=async()=>{await a.service.updateBatch(s)},t=s.filter(e=>!e.saved);if(t.length){const n=await a.service.createBatch(t);if(n.ok&&n.data&&n.data[0]){const i=n.data[0];i.length>0&&i.forEach(e=>{const t=s.find(t=>t.name===e.name);t&&Wt(t,e)}),await e(),t.forEach(e=>{const t=a.state.searchBarGroups.find(t=>t.name===e.name);t&&(t.saved=!0)})}}else await e()}}},editLinkTitle:e=>e.saved?e.noEdit?ibiz.i18n.t("control.searchBar.searchGroups.noEditPrompt"):"":ibiz.i18n.t("control.searchBar.searchGroups.savePrompt")}},render(){var e;return n("div",{class:this.ns.b()},[null==(e=this.showGroups)?void 0:e.map(e=>{var t;return this.c.calcCountVisible(e)?n("span",{class:[this.ns.b("quick-group-item"),this.ns.is("selected",(null==(t=this.c.state.selectedSearchGroupItem)?void 0:t.name)===e.name)],onClick:()=>this.onGroupClick(e)},[e.caption||e.name,e.counterId&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:this.counterData[e.counterId],counterMode:e.counterMode},null)]):null}),n(i("el-dropdown"),{"popper-class":this.ns.b("dropdown")},{default:()=>{var e;return n("div",{class:[this.ns.b("more"),this.ns.is("selected",this.isActiveMore)]},[this.isActiveMore?null==(e=this.c.state.selectedSearchGroupItem)?void 0:e.caption:this.c.model.groupMoreText||ibiz.i18n.t("app.more"),n("ion-icon",{name:"chevron-down-outline"},null)])},dropdown:()=>n(i("el-dropdown-menu"),null,{default:()=>[this.hiddenGroups.map(e=>n(i("el-dropdown-item"),{onClick:()=>this.onGroupClick(e)},{default:()=>{var t;return[n("ion-icon",{name:"list-outline"},null),n("span",{class:this.ns.b("item-caption")},[e.caption||e.name]),(null==(t=this.c.state.selectedSearchGroupItem)?void 0:t.name)===e.name&&n("ion-icon",{name:"checkmark-outline"},null)]}})),n(i("el-dropdown-item"),{divided:this.hiddenGroups.length>0,onClick:this.newGroup},{default:()=>[n("ion-icon",{name:"add-outline"},null),n("span",{class:this.ns.b("item-caption")},[ibiz.i18n.t("control.searchBar.searchGroups.newGroup")])]}),n(i("el-dropdown-item"),{onClick:this.manageGroup},{default:()=>[n("ion-icon",{name:"settings-outline"},null),n("span",{class:this.ns.b("item-caption")},[ibiz.i18n.t("control.searchBar.searchGroups.groupManage")])]})]})}),n(i("el-dialog"),{modelValue:this.newDialogVisible,"onUpdate:modelValue":e=>this.newDialogVisible=e,title:Tt(ibiz.i18n.t("control.searchBar.searchGroups.newGroup")),"modal-class":this.ns.b("new-dialog")},{default:()=>n(i("el-form"),{ref:"newFormRef",model:this.newForm,"label-position":"top",rules:this.newFormRules},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("control.searchBar.searchGroups.groupName"),prop:"caption"},{default:()=>[n(i("el-input"),{modelValue:this.newForm.caption,"onUpdate:modelValue":e=>this.newForm.caption=e,placeholder:ibiz.i18n.t("control.searchBar.searchGroups.enterPrompt")},null)]})]}),footer:()=>{let e,t;return n("div",{class:this.ns.b("new-dialog-footer")},[n(i("el-button"),{class:this.ns.b("cancel-btn"),onClick:this.handleNewFormCancel},vw(e=ibiz.i18n.t("control.searchBar.searchGroups.dialogCancel"))?e:{default:()=>[e]}),n(i("el-button"),{type:"primary",onClick:this.handleNewFormSubmit},vw(t=ibiz.i18n.t("control.searchBar.searchGroups.dialogDetermine"))?t:{default:()=>[t]})])}}),n(i("el-dialog"),{modelValue:this.editDialogVisible,"onUpdate:modelValue":e=>this.editDialogVisible=e,title:Tt(ibiz.i18n.t("control.searchBar.searchGroups.editGroup")),"modal-class":this.ns.b("edit-dialog")},{default:()=>n(i("el-form"),{ref:"editFormRef",model:this.editForm,"label-position":"top",rules:this.editFormRules},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("control.searchBar.searchGroups.groupName"),prop:"caption"},{default:()=>[n(i("el-input"),{modelValue:this.editForm.caption,"onUpdate:modelValue":e=>this.editForm.caption=e,placeholder:ibiz.i18n.t("control.searchBar.searchGroups.enterPrompt")},null)]})]}),footer:()=>{let e,t;return n("div",{class:this.ns.b("edit-dialog-footer")},[n(i("el-button"),{class:this.ns.b("cancel-btn"),onClick:this.handleEditFormCancel},vw(e=ibiz.i18n.t("control.searchBar.searchGroups.dialogCancel"))?e:{default:()=>[e]}),n(i("el-button"),{type:"primary",onClick:this.handleEditFormSubmit},vw(t=ibiz.i18n.t("control.searchBar.searchGroups.dialogDetermine"))?t:{default:()=>[t]})])}}),n(i("el-dialog"),{modelValue:this.manageDialogVisible,"onUpdate:modelValue":e=>this.manageDialogVisible=e,title:Tt(ibiz.i18n.t("control.searchBar.searchGroups.groupManage")),"modal-class":this.ns.b("manage-dialog")},{default:()=>[n("div",{class:this.ns.b("manage-dialog-content")},[n("div",{class:this.ns.b("content-top")},[n("div",{class:this.ns.b("content-top-left")},[n("ion-icon",{name:"alert-circle-outline"},null),ibiz.i18n.t("control.searchBar.searchGroups.manageTips")]),n("div",{class:this.ns.b("content-top-right")},[n(i("el-button"),{onClick:()=>{this.newDialogVisible=!0}},{default:()=>[n("ion-icon",{name:"add-outline"},null),ibiz.i18n.t("control.searchBar.searchGroups.newGroup")]})])]),n("div",{class:this.ns.b("content-bottom")},[n("div",{class:this.ns.b("table-header")},[n("div",{class:this.ns.b("name")},[ibiz.i18n.t("control.searchBar.searchGroups.name")]),n("div",{class:this.ns.b("show")},[ibiz.i18n.t("control.searchBar.searchGroups.show")]),n("div",{class:this.ns.b("action")},[ibiz.i18n.t("control.searchBar.searchGroups.operate")])]),n(is,{class:this.ns.b("table-body"),modelValue:this.c.state.searchBarGroups,"onUpdate:modelValue":e=>this.c.state.searchBarGroups=e,group:this.c.model.id,itemKey:"id",sort:!0,"force-fallback":!0,animation:500,"ghost-class":this.ns.b("table-row-ghost"),onChange:e=>this.onDragChange(e)},{item:({element:e})=>{let t,a;return n("div",{class:this.ns.b("table-row")},[n("div",{class:this.ns.b("name")},[e.caption||e.name]),n("div",{class:this.ns.b("show")},[n(i("el-switch"),{modelValue:e.show,"onUpdate:modelValue":t=>e.show=t},null)]),n("div",{class:this.ns.b("action")},[n(i("el-link"),{type:"primary",disabled:!e.saved||e.noEdit,title:Tt(this.editLinkTitle(e)),onClick:()=>this.editGroup(e)},vw(t=ibiz.i18n.t("app.edit"))?t:{default:()=>[t]}),n(i("el-link"),{type:"danger",disabled:!e.saved||"SYSTEM"===e.ownerType,title:Tt(e.saved&&"SYSTEM"!==e.ownerType?"":ibiz.i18n.t("control.searchBar.searchGroups.savePrompt")),onClick:()=>this.removeGroup(e)},vw(a=ibiz.i18n.t("app.delete"))?a:{default:()=>[a]})])])}})])])]})])}});const bw=a({name:"IBizQuickSearchSelect",props:{controller:{type:_n,required:!0}},setup:e=>({ns:B("quick-search-select"),onItemClick:t=>{const a=t.fieldName,{quickSearchFieldNames:n}=e.controller.state,i=n.indexOf(a);if(-1===i)n.push(a);else{if(n.length<=1)return;n.splice(i,1)}e.controller.calcQuickSearchPlaceHolder()}}),render(){const{state:e}=this.controller;return n(i("el-dropdown"),{onCommand:this.onItemClick,trigger:"click","hide-on-click":!1,class:[this.ns.b()],"popper-class":[this.ns.b("popover")]},{default:()=>n("div",{title:ibiz.i18n.t("control.searchBar.quickSearchSelect.searchField"),class:this.ns.e("icon")},[n("ion-icon",{name:"settings-outline"},null)]),dropdown:()=>{let t;return n(i("el-dropdown-menu"),null,"function"==typeof(a=t=e.quickSearchItems.map(t=>{const a=e.quickSearchFieldNames.includes(t.fieldName);return n(i("el-dropdown-item"),{class:[this.ns.be("popover","item"),a&&this.ns.bem("popover","item","selected")],command:t},{default:()=>[t.label]})}))||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?t:{default:()=>[t]});var a}})}}),fw=e("a3",ie(ow,function(e){e.component(ow.name,ow),e.component(hw.name,hw),e.component(mw.name,mw),e.component(gw.name,gw),e.component(bw.name,bw),Ha(qa.SEARCHBAR,()=>new rw)}));var ww=Object.defineProperty,yw=(e,t,a)=>(((e,t,a)=>{t in e?ww(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Cw{constructor(){yw(this,"component","IBizChartControl")}}const Iw=e("a4",{install(e){e.component("IBizChartControl",E({loader:()=>t.import("./chart-B_uQaEfA.js"),loadingComponent:be,delay:0})),Ha(qa.CHART,()=>new Cw)}});function xw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Sw=a({name:"IBizWizardPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){const e=ne((...e)=>new jn(...e)),t=B("control-".concat(e.model.controlType.toLowerCase()));return{c:e,ns:t}},render(){var e,t,a,o,s;const{activeFormTag:r,buttonsState:c}=this.c.state;let d=null,u=null,h=null;if(r&&this.c.activeWizardForm){if(this.c.providers[r]){const t=i(this.c.providers[r].component),a=null==(e=this.c.model.deeditForms)?void 0:e.find(e=>{var t;return r===(null==(t=e.dewizardForm)?void 0:t.formTag)});u=l(t,{class:this.ns.e("form"),modelData:a,context:Object.assign(this.c.context,{srfsilent:!0}),params:this.c.params,key:r,onMounted:e=>this.c.onFormMounted(r,e),onSaveSuccess:e=>this.c.onFormSaved(e)})}const{dewizard:p}=this.c.model;h=p&&n("div",{key:"".concat(r,"footer"),class:this.ns.b("footer")},[(null==(t=c["".concat(r,"@PREV")])?void 0:t.visible)&&n(i("el-button"),{onClick:()=>{this.c.onPrevClick()}},{default:()=>[p.prevCaption?p.prevCaption:ibiz.i18n.t("control.common.retreat")]}),(null==(a=c["".concat(r,"@NEXT")])?void 0:a.visible)&&n(i("el-button"),{onClick:()=>{this.c.onNextClick()}},{default:()=>[p.nextCaption?p.nextCaption:ibiz.i18n.t("control.common.forward")]}),(null==(o=c["".concat(r,"@FINISH")])?void 0:o.visible)&&n(i("el-button"),{onClick:()=>{this.c.onFinishClick()}},{default:()=>[p.finishCaption?p.finishCaption:ibiz.i18n.t("app.complete")]})]);const{dewizardSteps:m}=p;if(this.c.model.showStepBar&&m&&m.length>0){let e,t=this.c.steps.indexOf(this.c.stepTags["".concat(this.c.model.name,"_form_").concat(null==(s=this.c.state.activeFormTag)?void 0:s.toLowerCase())]);-1===t&&(t=0),d=n(i("el-steps"),{class:this.ns.b("header"),"align-center":!0,"finish-status":"success",active:t},xw(e=m.map(e=>{const t={title:()=>{var t;return n("span",{class:[this.ns.bm("header","title"),null==(t=e.titleSysCss)?void 0:t.cssName]},[Tt(e.title)])}};return e.sysImage&&Object.assign(t,{icon:()=>n($,{class:this.ns.bm("header","step-icon"),icon:e.sysImage},null)}),n(i("el-step"),null,xw(t)?t:{default:()=>[t]})}))?e:{default:()=>[e]})}}return n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b(),this.ns.is("header",this.c.model.showStepBar)]},{default:()=>[d,u,h]})}});var Ew=Object.defineProperty,Dw=(e,t,a)=>(((e,t,a)=>{t in e?Ew(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Pw{constructor(){Dw(this,"component","IBizWizardPanelControl")}}const kw=e("a5",ie(Sw,function(e){e.component(Sw.name,Sw),Ha(qa.WIZARD_PANEL,()=>new Pw)}));var zw=Object.defineProperty,Tw=(e,t,a)=>(((e,t,a)=>{t in e?zw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Aw extends Vn{constructor(){super(...arguments),Tw(this,"counter"),Tw(this,"router")}get navPos(){var e;return null==(e=this.view.layoutPanel)?void 0:e.panelItems.nav_pos}get viewNavPos(){var e;return null==(e=this.view.layoutPanel)?void 0:e.panelItems.view_nav_pos}get form(){var e;return null==(e=this.view)?void 0:e.getController("form")}get isCreate(){return this.getData()[0].srfuf!==Qa.UPDATE}getData(){var e;return(null==(e=this.form)?void 0:e.getData())||[{}]}setRouter(e){this.router=e}get routeDepth(){return this.view.modal.routeDepth}initState(){super.initState(),this.state.drBarItems=[],this.state.srfnav="",this.state.selectedItem="",this.state.hideEditItem=!!this.model.hideEditItem}async onCreated(){await super.onCreated(),this.initDRBarItems(),await this.initCounter()}calcItemStateByCounter(e,t=!0){if(this.state.activated&&(this.state.drBarItems.forEach(e=>{var t;if(null==(t=e.children)?void 0:t.length)e.children.forEach(e=>{const t=Fn(e,this.counter);void 0!==t&&(e.visible=t)}),e.visible=e.children.some(e=>e.visible);else{const t=Fn(e,this.counter);void 0!==t&&(e.visible=t)}}),this.state.selectedItem&&t)){const{visible:e,defaultVisibleItem:t}=this.getItemVisibleState(this.state.selectedItem);!e&&t&&this.handleSelectChange(t.tag)}}getItemVisibleState(e){let t,a=!0;return this.state.drBarItems.forEach(n=>{if(n.children){t||(t=n.children.find(e=>e.visible));const i=n.children.find(t=>t.tag===e);i&&(a=!!i.visible)}else!t&&n.visible&&(t=n),n.tag===e&&(a=!!n.visible)}),{visible:a,defaultVisibleItem:t}}async calcPermitted(e){var t;let a=!0;const n=(null==(t=this.getData())?void 0:t.length)?this.getData()[0]:void 0,i=await Un(e,this.context,this.params,this.model.appDataEntityId,this.model.appId,n);void 0!==i&&(a=i),e.visible=a}async calcDrBarItemsState(){await Promise.all(this.state.drBarItems.map(async e=>{var t;(null==(t=e.children)?void 0:t.length)?(await Promise.all(e.children.map(async e=>{await this.calcPermitted(e)})),e.visible=e.children.some(e=>e.visible)):await this.calcPermitted(e)})),this.calcItemStateByCounter({},!1),this.state.isCalculatedPermission=!0}async onMounted(){await super.onMounted(),this.form?(this.form.evt.on("onLoadSuccess",async e=>{const t=e.data[0];this.view.state.srfactiveviewdata=t,Object.prototype.hasOwnProperty.call(t,"srfreadonly")&&(t.srfreadonly?this.view.context.srfreadonly=!0:Po(this.view.context.srfreadonly)&&(this.view.context.srfreadonly=!1)),await this.calcDrBarItemsState(),this.handleFormChange(),this.doDefaultSelect()}),this.form.evt.on("onLoadDraftSuccess",()=>{this.handleFormChange()}),this.form.evt.on("onSaveSuccess",()=>{this.handleFormChange()})):await this.calcDrBarItemsState(),this.form&&this.form.state.isLoaded&&this.doDefaultSelect()}handleFormChange(){const e=this.isCreate;this.setDRBarItemsState(this.state.drBarItems,e)}setDRBarItemsState(e,t){e.forEach(e=>{e.tag!==this.model.uniqueTag&&(e.disabled=t),e.children&&this.setDRBarItemsState(e.children,t)})}initDRBarItems(){var e;const{dedrctrlItems:t,dedrbarGroups:a}=this.model,n=[];if(!this.state.hideEditItem){const{editItemCaption:t,editItemCapLanguageRes:a,editItemSysImage:i,uniqueTag:o}=this.model;let s=t;a&&(s=ibiz.i18n.t(a.lanResTag,t)),n.push({tag:o,caption:s,disabled:!1,sysImage:i,fullPath:null==(e=this.router)?void 0:e.currentRoute.value.fullPath}),this.state.defaultItem=o,this.state.selectedItem=n[0].tag}const i=e=>{let t=e.caption;e.capLanguageRes&&(t=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption));const{enableMode:a,testAppDELogicId:n,testScriptCode:i,counterMode:o}=e;return{tag:e.id,caption:t,sysImage:e.sysImage,disabled:!1,counterId:e.counterId,visible:!1,dataAccessAction:e.dataAccessAction||void 0,enableMode:a,testAppDELogicId:n,testScriptCode:i,counterMode:o}};a&&t&&(1===a.length?t.forEach(e=>{n.push(i(e))}):a.forEach(e=>{var a;const o=t.filter(t=>t.dedrbarGroupId===e.id);if(o.length>1||"true"===(null==(a=this.controlParams)?void 0:a.singleitemgroup)&&1===o.length){let t=e.caption;e.capLanguageRes&&(t=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption)),n.push({tag:e.id,caption:t,sysImage:e.sysImage,visible:!1,children:o.map(e=>i(e))})}else 1===o.length&&n.push(i(o[0]))})),this.state.drBarItems=n}handleSelectChange(e=this.state.selectedItem||this.state.defaultItem,t=!1){var a,n;if(this.state.selectedItem===e)return;const i=null==(a=this.model.dedrctrlItems)?void 0:a.find(t=>t.id===e);i?(this.setVisible("navPos"),this.openNavPosView(i,t)):(this.setVisible("form"),this.routeDepth&&(null==(n=this.state.drBarItems[0])?void 0:n.fullPath)&&this.router.push(this.state.drBarItems[0].fullPath)),this.state.selectedItem=e}setVisible(e){var t;if(this.state.hideEditItem)return;const a=null==(t=this.view.layoutPanel)?void 0:t.panelItems.view_form;"form"===e?(a&&(a.state.visible=!0,a.state.keepAlive=!0),this.viewNavPos&&(this.viewNavPos.state.visible=!1,this.viewNavPos.state.keepAlive=!0)):(a&&(a.state.visible=!1,a.state.keepAlive=!0),this.viewNavPos&&(this.viewNavPos.state.visible=!0,this.viewNavPos.state.keepAlive=!0))}prepareParams(e){const{navigateContexts:t,navigateParams:a}=e,n={navContexts:t,navParams:a},i={context:this.context,params:this.params,data:this.getData()[0]},{resultContext:o,resultParams:s}=Na(n,i);return{context:Object.assign(this.context.clone(),o),params:{...this.params,...s}}}async openNavPosView(e,t=!1){var a;if(!e.appViewId)return;const{context:n,params:i}=this.prepareParams(e);n.currentSrfNav=e.id,this.state.srfnav=e.id,null==(a=this.navPos)||a.openView({key:e.id,context:n,params:i,viewId:e.appViewId,isRoutePushed:t})}doDefaultSelect(){var e,t;const a=null==(e=this.view.layoutPanel)?void 0:e.panelItems.view_form;if(a&&(a.state.visible=!1,a.state.keepAlive=!1),!this.state.hideEditItem&&!this.state.srfnav)return void this.setVisible("form");if(this.isCreate)return void(this.state.defaultItem=this.model.uniqueTag);const{drBarItems:n}=this.state;let i=(null==(t=n[0].children)?void 0:t[0].tag)||n[0].tag;if(this.routeDepth&&this.state.srfnav&&(i=this.state.srfnav),i){const e=!!this.routeDepth&&Hn(this.routeDepth),{visible:t,defaultVisibleItem:a}=this.getItemVisibleState(i);!t&&a?(i=a.tag,this.handleSelectChange(i)):this.handleSelectChange(i,e),this.state.defaultItem=i}}async initCounter(){if(this.state.isCounterDisabled)return;const{appCounterRefs:e}=this.model,t=null==e?void 0:e[0];t&&(this.counter=await qn.getCounterByRef(t,this.context,{...this.params}),this.calcItemStateByCounter=this.calcItemStateByCounter.bind(this),this.counter.onChange(this.calcItemStateByCounter))}async onDestroyed(){await super.onDestroyed(),this.counter&&(this.counter.offChange(this.calcItemStateByCounter),this.counter.destroy())}setActive(e){this.handleSelectChange(e)}}e("a7",Aw);const Ow=a({name:"IBizDrBarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},srfnav:{type:String,required:!1},showMode:{type:String,default:"vertical"},hideEditItem:{type:Boolean,default:void 0}},setup(e){const t=ne((...e)=>new Aw(...e)),a=B("control-".concat(t.model.controlType.toLowerCase())),s=hs(),l=o({}),r=e=>{l.value=e};t.evt.on("onCreated",()=>{t.counter&&t.counter.onChange(r,!0)}),h(()=>{var e;null==(e=t.counter)||e.offChange(r)}),t.setRouter(s);const d=us();let u="";const p=[];c(()=>t.state.isCreated,(a,n)=>{if("horizontal"!==e.showMode){const{drBarItems:e}=t.state;e.forEach(e=>{p.push(e.tag)})}}),t.routeDepth&&(u=me(d,t.routeDepth)),d&&c(()=>d.fullPath,(e,a)=>{if(e!==a){const e=t.routeDepth;if(e){if(me(d,t.routeDepth)===u){const a=Y(d),{srfnav:n}=a.pathNodes[e-1];t.handleSelectChange(n)}}}},{immediate:!0});const m=o=>{if(o.visible){if(o.children){let s="";if("horizontal"===e.showMode&&o.tag!==t.state.selectedItem){const e=o.children.find(e=>e.tag===t.state.selectedItem);e&&(s="-".concat(e.caption))}return n(i("el-sub-menu"),{class:a.b("group"),index:o.tag,disabled:o.disabled},{default:()=>o.children.map(e=>m(e)),title:()=>[n(i("iBizIcon"),{class:a.e("icon"),icon:o.sysImage},null),n("span",null,[o.caption,s])]})}return n(i("el-menu-item"),{class:a.e("item"),index:o.tag,disabled:o.disabled},{default:()=>[n(i("iBizIcon"),{class:a.e("icon"),icon:o.sysImage},null),n("span",null,[o.caption]),o.counterId&&null!=l.value[o.counterId]&&n(i("iBizBadge"),{class:a.e("counter"),value:l.value[o.counterId],counterMode:o.counterMode},null)]})}};return{c:t,ns:a,handleSelect:e=>{t.handleSelectChange(e);const a=t.state.drBarItems.find(t=>t.tag===e);a&&t.evt.emit("onTabChange",{data:a})},renderMenuItems:m,opens:p}},render(){const{isCreated:e,drBarItems:t,selectedItem:a,isCalculatedPermission:o}=this.c.state;return n(i("iBizControlBase"),{controller:this.c,class:this.ns.b()},{default:()=>[e&&o&&n(i("el-menu"),{class:this.ns.e("menu"),mode:this.showMode,"default-active":a,onSelect:this.handleSelect,"default-openeds":this.opens},{default:()=>t.map(e=>this.renderMenuItems(e))})]})}});var Mw=Object.defineProperty,Nw=(e,t,a)=>(((e,t,a)=>{t in e?Mw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Bw{constructor(){Nw(this,"component","IBizDrBarControl")}}const Lw=e("a6",ie(Ow,function(e){e.component(Ow.name,Ow),Ha(qa.DRBAR,()=>new Bw)}));var Rw=Object.defineProperty,_w=(e,t,a)=>(((e,t,a)=>{t in e?Rw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class jw extends Vn{constructor(){super(...arguments),_w(this,"counter"),_w(this,"srfCachePos",!1),_w(this,"srfCacheKeyTempl",""),_w(this,"router")}get navPos(){var e;return null==(e=this.view.layoutPanel)?void 0:e.panelItems.nav_pos}get form(){var e;return null==(e=this.view)?void 0:e.getController("form")}get routeDepth(){return this.view.modal.routeDepth}get storageTag(){if(this.srfCacheKeyTempl)return this.srfCacheKeyTempl;const e=this.context.srfuserid;return"".concat(e,"_").concat(this.view.model.codeName,"_").concat(this.model.codeName)}get enableAnchor(){return this.controlParams.enablenavbar?"true"===this.controlParams.enablenavbar:ibiz.config.drtab.enableNavbar}get navbarpos(){var e;return(null==(e=this.controlParams.navbarpos)?void 0:e.toLowerCase())||ibiz.config.drtab.navbarPos.toLowerCase()}get navbarwidth(){return this.controlParams.navbarwidth||ibiz.config.drtab.navbarWidth}setRouter(e){this.router=e}getData(){var e;return(null==(e=this.form)?void 0:e.getData())||[{}]}initState(){super.initState(),this.state.drTabPages=[],this.state.showMore=!1,this.state.hideEditItem=!!this.model.hideEditItem}async onCreated(){await super.onCreated(),await this.initCounter(),this.srfCacheKeyTempl=this.controlParams.srfcachekeytempl||"",this.controlParams.showmore&&(this.state.showMore="true"===this.controlParams.showmore),this.controlParams.srfcachepos&&(this.srfCachePos="true"===this.controlParams.srfcachepos.toLowerCase())}calcItemStateByCounter(){if(this.state.activated&&(this.state.drTabPages.forEach(e=>{const t=Fn(e,this.counter);void 0!==t&&(e.hidden=!t)}),this.state.activeName)){const{visible:e,defaultVisibleItem:t}=this.getItemVisibleState(this.state.activeName);!e&&t&&(this.state.activeName=t.tag,this.handleTabChange())}}getItemVisibleState(e){let t,a=!0;return this.state.drTabPages.forEach(n=>{t||n.hidden||(t=n),n.tag===e&&(a=!n.hidden)}),{visible:a,defaultVisibleItem:t}}async calcPermitted(e){var t;let a=!0;const n=(null==(t=this.getData())?void 0:t.length)?this.getData()[0]:void 0,i=await Un(e,this.context,this.params,this.model.appDataEntityId,this.model.appId,n);void 0!==i&&(a=i),e.hidden=!a}async calcDrTabPagesState(){await Promise.all(this.state.drTabPages.map(async e=>{await this.calcPermitted(e)})),this.calcItemStateByCounter(),this.state.isCalculatedPermission=!0}async onMounted(){await super.onMounted(),this.form&&(this.form.evt.on("onLoadSuccess",async e=>{const t=e.data[0];this.view.state.srfactiveviewdata=t,Object.prototype.hasOwnProperty.call(t,"srfreadonly")&&(t.srfreadonly?this.view.context.srfreadonly=!0:Po(this.view.context.srfreadonly)&&(this.view.context.srfreadonly=!1)),await this.calcDrTabPagesState(),this.handleFormChange(),this.doDefaultSelect()}),this.form.evt.on("onLoadDraftSuccess",()=>{this.handleFormChange()}),this.form.evt.on("onSaveSuccess",()=>{this.handleFormChange()})),this.initDRTabPages(),this.form||await this.calcDrTabPagesState(),this.form&&this.form.state.isLoaded&&this.doDefaultSelect()}doDefaultSelect(){var e;const t=null==(e=this.view.layoutPanel)?void 0:e.panelItems.view_form;t&&(t.state.visible=!1,t.state.keepAlive=!1),this.state.hideEditItem||this.state.activeName!==this.model.uniqueTag||this.setVisible("form")}handleFormChange(){const e=this.getData()[0].srfuf!==Qa.UPDATE;this.setDRTabPagesState(this.state.drTabPages,e)}setDRTabPagesState(e,t){e.forEach(e=>{e.tag!==this.model.uniqueTag&&(e.disabled=t)})}initDRTabPages(){const{editItemCaption:e,editItemCapLanguageRes:t,editItemSysImage:a,uniqueTag:n,dedrtabPages:i}=this.model,o=[];let s=e;if(t&&(s=ibiz.i18n.t(t.lanResTag,e)),this.state.hideEditItem||o.push({caption:s,tag:n,hidden:!!this.state.hideEditItem,disabled:!1,sysImage:a,fullPath:this.routeDepth?me(this.router.currentRoute.value,this.routeDepth):""}),null==i||i.forEach(e=>{let t=e.caption;e.capLanguageRes&&(t=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption));const{enableMode:a,dataAccessAction:n,testAppDELogicId:i,testScriptCode:s,counterMode:l}=e;o.push({tag:e.id,caption:t,sysImage:e.sysImage,hidden:!1,disabled:!1,counterId:e.counterId,dataAccessAction:n,enableMode:a,testAppDELogicId:i,testScriptCode:s,counterMode:l})}),this.state.drTabPages=o,this.state.defaultName=o[0].tag,this.view.state.srfnav)this.state.activeName=this.view.state.srfnav;else if(this.state.activeName=o[0].tag,this.srfCachePos&&localStorage.getItem(this.storageTag)){const e=localStorage.getItem(this.storageTag);this.state.activeName=e}const l=!!this.routeDepth&&Hn(this.routeDepth);this.handleTabChange(l)}handleTabChange(e=!1){var t;const{activeName:a}=this.state,n=null==(t=this.model.dedrtabPages)?void 0:t.find(e=>e.id===a);this.srfCachePos&&a&&localStorage.setItem("".concat(this.storageTag),a),n?(this.setVisible("navPos"),this.openNavPosView(n,e)):(this.setVisible("form"),this.routeDepth&&this.state.drTabPages[0]&&this.router.push(this.state.drTabPages[0].fullPath))}setVisible(e){var t;if(this.state.hideEditItem)return;const a=null==(t=this.view.layoutPanel)?void 0:t.panelItems.view_form;"form"===e?(a&&(a.state.visible=!0,a.state.keepAlive=!0),this.navPos&&(this.navPos.state.visible=!1,this.navPos.state.keepAlive=!0)):(a&&(a.state.visible=!1,a.state.keepAlive=!0),this.navPos&&(this.navPos.state.visible=!0,this.navPos.state.keepAlive=!0))}prepareParams(e){const{navigateContexts:t,navigateParams:a}=e,n={navContexts:t,navParams:a},i={context:this.context,params:this.params,data:this.getData()[0]},{resultContext:o,resultParams:s}=Na(n,i);return{context:Object.assign(this.context.clone(),o,{currentSrfNav:e.id}),params:{...this.params,...s}}}async openNavPosView(e,t=!1,a){var n;const{context:i,params:o}=this.prepareParams(e);e.appViewId&&(null==(n=this.navPos)||n.openView({key:a||e.id,context:i,params:o,viewId:e.appViewId,isRoutePushed:t}))}async initCounter(){if(this.state.isCounterDisabled)return;const{appCounterRefs:e}=this.model,t=null==e?void 0:e[0];t&&(this.counter=await qn.getCounterByRef(t,this.context,{...this.params}),this.calcItemStateByCounter=this.calcItemStateByCounter.bind(this),this.counter.onChange(this.calcItemStateByCounter))}async refresh(){var e;const{activeName:t}=this.state,a=null==(e=this.model.dedrtabPages)?void 0:e.find(e=>e.id===t);a?(this.setVisible("navPos"),this.openNavPosView(a,!1,go())):(this.setVisible("form"),this.routeDepth&&this.state.drTabPages[0]&&this.router.push(this.state.drTabPages[0].fullPath))}async onDestroyed(){await super.onDestroyed(),this.counter&&(this.counter.offChange(this.calcItemStateByCounter),this.counter.destroy())}setActive(e){this.state.activeName=e,this.handleTabChange()}}function Vw(e,t,a){let n=null,i=0;const s=o([]),l=o([]),r=(e,t={})=>{let a=0;const n=document.createElement("span"),i=document.createElement("span");return i.innerHTML=e,Object.assign(i.style,t),Object.assign(n.style,{width:"auto",position:"absolute",left:"-9999px"}),n.appendChild(i),document.body.appendChild(n),a=n.offsetWidth,document.body.removeChild(n),a};function d(){const{drTabPages:n,showMore:i}=e.state;if(!t.value||!i||0===n.length)return s.value=n,void(l.value=[]);const o=t.value.$el.offsetWidth;let c=0;s.value=[],l.value=[],n.forEach((e,t)=>{if(!e.hidden){const n=e.caption||"",i=e.counterId?a.value[e.counterId]:void 0,d="var(--".concat(yl,"-font-size-regular)");if(null!=i&&(i||0===i)&&!(1===e.counterMode&&i<=0)){const e={marginLeft:"var(--".concat(yl,"-spacing-tight)"),minWidth:"20px",fontSize:d},t=r(String(i),e);c+=t}const u={padding:"0 var(--".concat(yl,0===t?"-spacing-base) 0 0":"-spacing-base)"),fontSize:d},h=r(n,u);c+=h;const p={padding:"0 0 0 var(--".concat(yl,"-spacing-base)"),fontSize:d},m=r("".concat(ibiz.i18n.t("app.more")," ^"),p);c+m>o?l.value.push(e):s.value.push(e)}})}c(()=>e.state.drTabPages,()=>{d()},{deep:!0});const u=P(()=>{t.value&&(()=>{if(window.ResizeObserver){const e=t.value.$el;e&&(n=new ResizeObserver(e=>{const t=e[0].contentRect.width;t!==i&&(d(),i=t)}),n.observe(e))}})()});return h(()=>{n&&n.disconnect(),u()}),{visibleItems:s,moreItems:l}}e("a9",jw);const Fw=a({name:"FlowDrtab",props:{pagesstate:{type:Array,default:()=>[]},drtabpages:{type:Array,default:()=>[]},context:{type:Object,default:()=>{}},params:{type:Object,default:()=>{}},counterData:{type:Array,default:()=>{}},showHeader:{type:Boolean,default:!0},activeTab:{type:Object,default:()=>{}},controller:{type:Object,default:()=>{}}},setup(e){const t=B("flow-drtab"),a=go(),i=e.controller,s=o(""),l=o([]),d=o(),u=o(200),h=[],p=o(0),m=o(),v=o(0),b=o(),f=o();d.value=i.navbarpos,u.value=i.navbarwidth;const w=r(()=>e.pagesstate.filter(t=>e.drtabpages.find(e=>e.id===t.tag)&&!t.hidden).length),y=r(()=>e.pagesstate?e.pagesstate.map(t=>{const a=e.drtabpages.find(e=>e.id===t.tag);return"".concat(null==a?void 0:a.appViewId,"_").concat(t.tag)}):[]),C=()=>{if(s.value){const e=document.getElementById("".concat(s.value));e&&e.scrollIntoView()}},I=()=>{const e=document.getElementById("navbar_".concat(s.value));e&&m.value&&!((e,t)=>{const a=t.getBoundingClientRect(),n=e.getBoundingClientRect();return n.top>=a.top&&n.bottom<=a.bottom&&n.left>=a.left&&n.right<=a.right})(e,m.value)&&e.scrollIntoView({behavior:"smooth"})},S=new IntersectionObserver(e=>{e.forEach(e=>{var t,a;if(e.isIntersecting){if(e.target&&e.target.id)if(h.length>0){(null==(t=y.value)?void 0:t.findIndex(t=>t===e.target.id))<(null==(a=y.value)?void 0:a.findIndex(e=>e===h[0]))?h.unshift(e.target.id):h.push(e.target.id)}else h.push(e.target.id)}else if(e.target&&e.target.id){const t=h.indexOf(e.target.id);t>=0&&h.splice(t,1)}}),h.sort((e,t)=>{var a,n;return(null==(a=y.value)?void 0:a.findIndex(t=>t===e))-(null==(n=y.value)?void 0:n.findIndex(e=>e===t))}),w.value===v.value&&i.enableAnchor&&(h.length>0&&(s.value=h[0]),f.value?(clearTimeout(b.value),b.value=setTimeout(()=>{s.value=f.value,I(),f.value=""},200)):I())});c(()=>e.activeTab,(t,a)=>{if(t&&t.tag!==(null==a?void 0:a.tag)){const a=e.drtabpages.find(e=>e.id===t.tag);s.value="".concat(null==a?void 0:a.appViewId,"_").concat(t.tag),t.tag!==e.drtabpages[0].id&&C()}},{deep:!0,immediate:!0}),c(()=>e.drtabpages,e=>{e&&Promise.all(e.map(async e=>{const t=await ibiz.hub.getAppView(e.appViewId);return{id:e.id,height:null==t?void 0:t.height,width:null==t?void 0:t.width}})).then(e=>{l.value=e})},{deep:!0,immediate:!0}),x(()=>{g(()=>{const e=document.getElementById("".concat(a));e&&(e.scrollTop=p.value)})});return{c:i,ns:t,uuid:a,navbarpos:d,onViewMounted:t=>{const a=e.drtabpages.find(e=>e.id===t.tag);v.value+=1,v.value!==w.value||s.value||(s.value="".concat(null==a?void 0:a.appViewId,"_").concat(e.pagesstate[0].tag));const n=document.getElementById("".concat(null==a?void 0:a.appViewId,"_").concat(t.tag));n&&S.observe(n),v.value===w.value&&e.activeTab&&e.activeTab.tag!==e.drtabpages[0].id&&g(()=>{C()})},navBarWidth:u,calcStyle:e=>{const t=l.value.find(t=>t.id===e);if(t)return{height:t.height?"".concat(t.height,"px"):"100%",width:t.width?"".concat(t.width,"px"):"100%"}},renderAnchorBar:()=>{if(i.enableAnchor)return n("div",{class:[t.e("anchor-bar"),t.is(d.value,!0)],style:{width:"".concat(u.value,"px")}},[n("div",{class:[t.e("anchor-items"),t.is(d.value)],ref:e=>{m.value=e}},[e.pagesstate.map(a=>{const i=e.drtabpages.find(e=>e.id===a.tag);return!i||a.hidden?null:n("div",{class:[t.e("anchor-item"),t.is("active","".concat(null==i?void 0:i.appViewId,"_").concat(a.tag)===s.value)],id:"navbar_".concat(i.appViewId,"_").concat(a.tag),onClick:()=>(t=>{const a=e.drtabpages.find(e=>e.id===t.tag);f.value="".concat(null==a?void 0:a.appViewId,"_").concat(t.tag);const n=document.getElementById("".concat(null==a?void 0:a.appViewId,"_").concat(t.tag));n&&(n.scrollIntoView({behavior:"smooth"}),h.includes(f.value)&&(s.value=f.value))})(a)},[a.caption])})])])},handleScroll:()=>{const e=document.getElementById("".concat(a));e&&(p.value=e.scrollTop)}}},render(){var e,t;const a=this.pagesstate.map(e=>{const t=e.counterId?this.counterData[e.counterId]:void 0,a=i("IBizViewShell"),o=this.drtabpages.find(t=>t.id===e.tag);return!o||e.hidden?null:n("div",{id:"".concat(o.appViewId,"_").concat(e.tag),class:this.ns.e("tab-item")},[this.showHeader&&n("div",{class:this.ns.em("tab-item","label")},[e.sysImage&&n(i("iBizIcon"),{class:this.ns.be("label","icon"),icon:e.sysImage},null),n("span",{class:this.ns.be("label","text")},[e.caption]),!Po(t)&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:t,counterMode:e.counterMode},null)]),n("div",{class:this.ns.em("tab-item","tab-view"),style:this.calcStyle(e.tag)},[l(a,{context:this.context,params:this.params,viewId:o.appViewId,onMounted:()=>this.onViewMounted(e)})])])});return n("div",{class:[this.ns.b(),this.ns.m(this.navbarpos),this.ns.is("left",null==(e=this.navbarpos)?void 0:e.includes("left")),this.ns.is("right",null==(t=this.navbarpos)?void 0:t.includes("right")),this.ns.is("enable-anchor",this.c.enableAnchor)],onScroll:this.handleScroll,id:this.uuid},[this.renderAnchorBar(),n("div",{class:this.ns.e("container"),style:{"--navbarwidth":"".concat(this.navBarWidth,"px")}},[a])])}}),Uw=a({name:"IBizDrTabControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},hideEditItem:{type:Boolean,default:void 0}},setup(){var e;const t=ne((...e)=>new jw(...e)),a=B("control-".concat(t.model.controlType.toLowerCase())),s=hs(),l=o(),d=o({}),{visibleItems:u,moreItems:p}=Vw(t,l,d),m=e=>{d.value=e},v=(null==(e=t.view.model.tabLayout)?void 0:e.toLowerCase())||"top";t.evt.on("onCreated",()=>{t.counter&&t.counter.onChange(m,!0)});const g=r(()=>t.state.drTabPages.find(e=>e.tag===t.state.activeName));h(()=>{var e;null==(e=t.counter)||e.offChange(m)}),t.setRouter(s);const b=()=>{const{activeName:e}=t.state,a=t.state.drTabPages.find(t=>t.tag===e);a&&t.evt.emit("onTabChange",{data:a})},f=e=>{t.state.activeName=e,t.handleTabChange(),b()},w=us();let y="";t.routeDepth&&(y=me(w,t.routeDepth)),w&&c(()=>w.fullPath,(e,a)=>{if(e!==a){const e=t.routeDepth;if(e){if(me(w,t.routeDepth)===y){const a=Y(w),{srfnav:n}=a.pathNodes[e-1],i=!!t.routeDepth&&Hn(t.routeDepth);if(n&&t.state.activeName&&t.state.activeName!==n)t.state.activeName=n,t.handleTabChange(i);else if(!n){const e=!!t.routeDepth&&!Hn(t.routeDepth);(t.state.activeName!==t.state.defaultName||e)&&(t.state.activeName=t.state.defaultName,t.handleTabChange(i))}}}}},{immediate:!0});return{c:t,ns:a,activeTab:g,controlRef:l,counterData:d,visibleItems:u,moreItems:p,tabPosition:v,onTabChange:f,handleTabChange:()=>{t.handleTabChange(),b()},renderDropdownList:()=>n(i("el-dropdown"),{trigger:"click",class:a.b("dropdown-list"),"popper-class":a.be("dropdown-list","popper"),onCommand:f},{default:()=>{var e,t,o;return n("div",{class:a.be("dropdown-list","trigger")},[(null==(e=g.value)?void 0:e.sysImage)&&n(i("iBizIcon"),{icon:g.value.sysImage},null),n("div",{class:"caption"},[null==(t=g.value)?void 0:t.caption,(null==(o=g.value)?void 0:o.counterId)&&n(i("iBizBadge"),{value:d.value[g.value.counterId],counterMode:g.value.counterMode},null)]),n("ion-icon",{name:"chevron-down-outline"},null)])},dropdown:()=>n("div",{class:a.bem("dropdown-list","popper","content")},[t.state.drTabPages.map(e=>e.hidden?null:n(i("el-dropdown-item"),{class:[a.bem("dropdown-list","popper","item"),a.is("active",e.tag===t.state.activeName)],command:e.tag,disabled:e.disabled},{default:()=>[e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),n("span",{class:"caption"},[e.caption]),e.counterId&&n(i("iBizBadge"),{value:d.value[e.counterId],counterMode:e.counterMode},null),e.tag===t.state.activeName&&n("ion-icon",{name:"checkmark-outline"},null)]}))])})}},render(){const{isCreated:e,isCalculatedPermission:t}=this.c.state;if("flow_noheader"===this.tabPosition||"flow"===this.tabPosition)return n(Fw,{pagesstate:this.visibleItems,drtabpages:this.modelData.dedrtabPages,context:this.c.context,params:this.c.params,showHeader:"flow"===this.tabPosition,counterData:this.counterData,activeTab:this.activeTab,controller:this.c},null);const a=this.moreItems.find(e=>e.tag===this.c.state.activeName)||{},o=n(i("el-dropdown"),{trigger:"click",class:this.ns.b("more-dropdown"),"popper-class":this.ns.b("more-dropdown-popper")},{default:()=>n("div",{class:this.ns.be("more-dropdown","link"),onClick:e=>e.stopPropagation()},[n("span",null,[ibiz.i18n.t("app.more"),p(" ")]),n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.978 11.997l-.005.006L2.3 6.33l.83-.831 4.848 4.848L12.826 5.5l.83.83-5.673 5.673-.005-.006z"},null)])])]),dropdown:()=>n(i("el-dropdown-menu"),null,{default:()=>this.moreItems.map(e=>n(i("el-dropdown-item"),{class:[this.c.state.activeName===e.tag?this.ns.be("more-dropdown-popper","active"):""],onClick:()=>this.onTabChange(e.tag)},{default:()=>[n("span",{class:[this.ns.be("more-dropdown-popper","label")]},[n("span",{class:this.ns.bem("more-dropdown-popper","label","text"),title:Tt(e.caption||"")},[e.caption||""]),e.counterId&&null!=this.counterData[e.counterId]&&n(i("iBizBadge"),{class:this.ns.bem("more-dropdown-popper","label","counter"),value:this.counterData[e.counterId],counterMode:e.counterMode},null)])]}))})});return n(i("iBizControlBase"),{ref:"controlRef",controller:this.c,class:[this.ns.b(),this.moreItems.length>0?this.ns.b("more"):""]},{default:()=>[e&&t&&"top_dropdownlist"===this.tabPosition?this.renderDropdownList():n(i("el-tabs"),{modelValue:this.c.state.activeName,"onUpdate:modelValue":e=>this.c.state.activeName=e,tabPosition:this.tabPosition,onTabChange:this.handleTabChange},{default:()=>[this.visibleItems.map(e=>{const t=e.counterId?this.counterData[e.counterId]:void 0;return e.hidden?null:n(i("el-tab-pane"),{class:this.ns.e("tab-item"),label:e.caption+t,disabled:e.disabled,name:e.tag},{label:()=>n("span",{class:this.ns.b("label")},[e.sysImage&&n(i("iBizIcon"),{class:this.ns.be("label","icon"),icon:e.sysImage},null),n("span",{class:this.ns.be("label","text")},[e.caption]),!Po(t)&&n(i("iBizBadge"),{class:this.ns.e("counter"),value:t,counterMode:e.counterMode},null)])})}),this.moreItems.length>0&&n(i("el-tab-pane"),{label:"",name:a.tag},{label:()=>o})]})]})}});var Hw=Object.defineProperty,qw=(e,t,a)=>(((e,t,a)=>{t in e?Hw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Gw{constructor(){qw(this,"component","IBizDrTabControl")}}const Ww=e("a8",ie(Uw,function(e){e.component(Uw.name,Uw),Ha(qa.DRTAB,()=>new Gw)}));function Yw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Kw={};function Xw(e,t,a){var o;const s=t.providers[e.id],r={modelData:e,controller:t.portlets[e.id]};if(!s)return n("div",null,[e.portletType,ibiz.i18n.t("app.noSupport")]);const c=i(s.component);if("CONTAINER"===e.portletType){const a=e;return l(c,{...r,key:e.id,id:e.id},{default:()=>{var e;return null==(e=a.controls)?void 0:e.map(e=>Xw(e,t))}})}return l(c,{...r,key:(null==(o=Kw[e.id])?void 0:o.refreshtag)?Kw[e.id].refreshtag:e.id,id:e.id})}const $w=a({name:"IBizDashboardControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){const e=ne((...e)=>new Gn(...e));ue(e);const t=I().proxy,a=o([]),n=o([]),i=o(),s=B("control-".concat(e.model.controlType.toLowerCase()));e.evt.on("onInitPortlets",()=>{Object.values(e.portlets).forEach(e=>{z(e.state)||(e.state=u(e.state))}),n.value=e.enableAnchorCtrls}),e.evt.on("onItemModelReset",async n=>{if(2!==e.model.customizeMode)return;const{name:i}=n,o=a.value.findIndex(e=>e.id===i);if(-1!==o){const n=ibiz.hub.getApp(e.model.appId),s=await e.loadDynaPortletById("".concat(n.model.codeName,".").concat(i));s&&(Kw[s.id]={refreshtag:Uo()},a.value.splice(o,1,s),t.$forceUpdate())}});return{c:e,ns:s,customModelDatas:a,anchorList:n,dashboardRef:i,calcNavBarConfig:()=>{const{navBarPos:t,navBarSysCss:a,navBarWidth:n,navBarStyle:i,navbarHeight:o}=e.model;return{navBarPos:t,navBarSysCss:a,navBarWidth:n,navBarStyle:i,navbarHeight:o}},handleCustomModelChange:n=>{const i=n.model,o=e.model.controls;i&&i.length>0?i.forEach(e=>{"FILTER"===e.portletType&&(Kw[e.id]={refreshtag:Uo()})}):o&&o.length>0&&o.forEach(e=>{"FILTER"===e.portletType&&(Kw[e.id]={refreshtag:Uo()})}),a.value=i,t.$forceUpdate()}}},render(){const{state:e,model:t}=this.c,a=()=>n(i("iBizRow"),{ref:"dashboardRef",class:[this.ns.b()],layout:t.layout},{default:()=>{var e;return[null==(e=t.controls)?void 0:e.map(e=>{var t;let a;return n(i("iBizCol"),{layoutPos:e.layoutPos,state:null==(t=this.c.portlets[e.id])?void 0:t.state},Yw(a=Xw(e,this.c))?a:{default:()=>[a]})})]}}),o=()=>{const e={default:()=>a()};return this.customModelDatas.forEach(t=>{e[t.codeName]=()=>Xw(t,this.c)}),e};let s=null;if(t.enableCustomized){let e;s=n(i("iBizCustomDashboardContainer"),{modelData:this.modelData,dashboard:this.c,onChanged:this.handleCustomModelChange},Yw(e=o())?e:{default:()=>[e]})}else if(t.showDashboardNavBar){let e;s=n(i("iBizAnchorContainer"),{anchorList:this.anchorList.map(e=>({id:e.id,title:e.title})),anchorTargetEle:this.dashboardRef,navBarConfig:this.calcNavBarConfig()},Yw(e=a())?e:{default:()=>[e]})}else s=a();return n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b()]},{default:()=>[e.isCreated&&s]})}});function Jw(e,t){var a;const{layoutRowH:n,layoutColNum:i}=t,o=ibiz.hub.getApp(e.model.appId),s=(e,t)=>{const{controls:a,layout:i}=e,o=(null==a?void 0:a.filter(e=>!!e.layoutPos))||[],l=[],r=[];if("TABLE_24COL"===(null==i?void 0:i.layout)||"TABLE_12COL"===(null==i?void 0:i.layout))o.forEach(a=>{var i;const{height:o}=a.layoutPos,{span:c,offset:d}=function(e){const{layout:t,colXS:a,colSM:n,colMD:i,colLG:o,colXSOffset:s,colSMOffset:l,colMDOffset:r,colLGOffset:c}=e,d=o||i||n||a,u=c||r||l||s,h="TABLE_24COL"===t?24:12;return{span:d&&-1!==d?d/h:1,offset:u&&-1!==u?u/h:0}}(a.layoutPos),u=c*t.w,h=d*t.w;let p=o?o/n:3;if("CONTAINER"===a.portletType&&(null==(i=a.controls)?void 0:i.length)){const e=s(a,{w:u,x:h});p=e.reduce((e,t)=>Math.max(e,t.y+t.h),-1/0),r.push(...e)}l.push({w:u,x:h,h:p,y:0,model:a,parentId:e.codeName})});else if("FLEX"===(null==i?void 0:i.layout)){const a=function(e,t){const{dir:a,align:n,valign:i}=t.layout,o=[],s=(null==a?void 0:a.includes("reverse"))?e.toReversed():e;if(null==a?void 0:a.includes("row")){const e=parseFloat((t.w/s.length).toFixed(1));let i=0,l=0,r=0;s.forEach(e=>{const{grow:t,width:a}=e.layoutPos;t||!a?l++:(r++,i+=parseFloat((a/100).toFixed(1)))});const c=i>e*r?e*r:i,d=t.w-c,u=l>0?d/l:0;s.forEach(e=>{const{grow:t,width:a}=e.layoutPos;o.push({x:0,model:e,w:t||!a?u:parseFloat((a/100).toFixed(1))})});const h=o.reduce((e,t)=>e+t.w,0),p=t.w-h;switch(n){case"flex-start":"row-reverse"===a&&(o[0].x=p);break;case"flex-end":"row"===a&&(o[0].x=p);break;case"center":p&&(o[0].x=p/2);break;case"space-between":if(p&&o.length>1){const e=p/(o.length-1);o.forEach((t,a)=>{0!==a&&(t.x=e)})}break;case"space-around":if(p){const e=p/(2*o.length);o.forEach((t,a)=>{t.x=0===a?e:2*e})}}}return(null==a?void 0:a.includes("column"))&&s.forEach(e=>{const{width:a}=e.layoutPos;let n=0,s=t.w;a&&(s=a/100>1&&a/100<t.w?a/100:t.w);const l=t.w-s;switch(i){case"flex-end":n=l;break;case"center":l&&(n=(t.w-s)/2)}o.push({x:n,w:s,model:e})}),o}(o,{...t,layout:i});a.forEach(t=>{var a;const{x:i,w:o,model:c}=t,{height:d}=c.layoutPos;let u=d?d/n:3;if("CONTAINER"===c.portletType&&(null==(a=c.controls)?void 0:a.length)){const e=s(c,{w:o,x:i});u=e.reduce((e,t)=>Math.max(e,t.y+t.h),-1/0),r.push(...e)}l.push({w:o,x:i,h:u,y:0,model:c,parentId:e.codeName})})}!function(e,t){let a=0,n=0,i=0;e.forEach(e=>{a+e.x+e.w>t.w&&(n+=i,a=0,i=0),e.x=a+e.x,e.y=n,a+=e.x+e.w-a,i=Math.max(i,e.h)}),e.forEach(e=>{e.x+=t.x})}(l,t),l.forEach(e=>{if("CONTAINER"===e.model.portletType){r.filter(t=>t.parentId===e.model.codeName).forEach(t=>{t.x+=e.x,t.y+=e.y})}});const c=l.filter(e=>!["CONTAINER","RAWITEM"].includes(e.model.portletType));return c.push(...r),c},l=[];if(null==(a=e.model.controls)?void 0:a.length){s(e.model,{x:0,w:i}).forEach(e=>{const{x:t,y:a,w:n,h:i,model:s}=e;l.push({x:t,y:a,w:n,h:i,i:s.codeName,appName:o.model.name,portletName:s.title,portletImage:s.sysImage,portletCodeName:s.codeName,appCodeName:s.appDataEntityId||o.model.pkgcodeName})})}return l}function Qw(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Zw=a({name:"IBizDashboardDesign",props:{dashboard:{type:Object,required:!0},customDashboard:{type:Object,required:!0},isShowDesign:{type:Boolean,required:!0}},emits:["saved","reset"],setup(e,{emit:t}){const a=B("dashboard-design"),n=e.dashboard,i=e.customDashboard,s=o([]),l=o([]),d=o([]),u=o(""),p=o(ko(i.customModelData)),m=o(ko(i.portletConfig)),v=o({}),g=o({}),b=o(null),f=o(!1),w=e=>{const t=[];return e.forEach(e=>{let a=t.find(t=>Object.is(e.type,t.type));a||(a={},Object.assign(a,{type:e.type,name:Object.is(e.type,"app")?ibiz.i18n.t("control.dashboard.dashboardDesign.global"):e.appName,children:[]}),t.push(a)),((e,t)=>{let a=e.find(e=>Object.is(t.groupCodeName,e.type));a||(a={},Object.assign(a,{type:t.groupCodeName,name:t.groupName,children:[]}),e.push(a)),a.children.find(e=>Object.is(e.portletCodeName,t.portletCodeName))||a.children.push(t)})(a.children,e)}),t},y=async()=>{const t=[],a=ibiz.hub.getApp(n.model.appId);if(2===n.model.customizeMode){const e=await n.loadAllDynaPortlet();null==e||e.forEach(e=>{const n={type:"app",dynamodelFlag:1,portletId:e.psappportletid,portletCodeName:e.codename,portletName:e.psappportletname,groupCodeName:e.groupcodename||"Ungroup",groupName:e.groupname||ibiz.i18n.t("control.dashboard.dashboardDesign.unGroup"),appCodeName:a.model.pkgcodeName,appName:a.model.name};t.push(n)})}else if(a.model.appPortletCats&&a.model.appPortlets){const n=i.model.appDataEntityId,o=e.dashboard.controlParams.categorytag,s=e.dashboard.controlParams.portletnametag;a.model.appPortlets.forEach(e=>{var i;if(!n&&!e.enableAppDashboard)return;if(n&&!e.enableDEDashboard)return;const l=null==(i=a.model.appPortletCats)?void 0:i.find(t=>{var a;return t.codeName===(null==(a=e.appPortletCat)?void 0:a.codeName)});if(o){const e=new RegExp(o);if(!l||l&&l.codeName&&!e.test(l.codeName))return}if(s){const t=new RegExp(s);if(e.codeName&&!t.test(e.codeName))return}const r={type:"app",portletCodeName:e.codeName,portletName:e.name,portletImage:e.control.sysImage,groupCodeName:(null==l?void 0:l.codeName)||"",groupName:(null==l?void 0:l.name)||"",appCodeName:e.appDataEntityId||a.model.pkgcodeName,appName:a.model.name};t.push(r)})}const o=(e=>{const t=[];return e.forEach(e=>{var a;Object.is(e.type,"app")&&t.push(e);const n=(null==(a=i.model)?void 0:a.appDataEntityId)||"app";Object.is(e.appCodeName,n)&&t.push(e)}),t})(t);s.value=o,l.value=w(o).reverse(),d.value=(e=>{const t=[];return e.forEach(e=>{const a=t.find(t=>Object.is(t.value,e.groupCodeName));a?a.children.find(t=>Object.is(t.portletCodeName,e.portletCodeName))||a.children.push(e):t.push({name:e.groupName,value:e.groupCodeName,children:[e]})}),t})(o)},C=r(()=>{let e=[];return u.value?e=[u.value]:d.value.forEach((t,a)=>{e.push(t.value+a)}),e}),I=e=>{const t=ibiz.hub.getApp(n.model.appId);if(t.model.appPortlets){const a=t.model.appPortlets.find(t=>{var a;return(null==(a=t.control)?void 0:a.codeName)===e});if(a)return a.control}},x=async e=>{if(e.dynamodelFlag){if(e.portletModel)return e.portletModel;return await n.loadDynaPortletById(e.portletId)}return I(e.portletCodeName)},S=async t=>{const a=await(async e=>{const t=[];if(e.length>0)for(let a=0;a<e.length;a++){const n=await x(e[a]);n&&t.push(n)}return t})(t);return await(async t=>{(null==t?void 0:t.length)&&await Promise.all(t.map(async t=>{const a=await Wn(t);if(a){v.value[t.id]=a;const n=await a.createController(t,e.dashboard);g.value[t.id]=n}}))})(a),await(async()=>{const e=m.value||{};Object.keys(e).forEach(t=>{const a=g.value[t];a&&(a.config=e[t],a.state.title=a.config.srftitle,Object.assign(a.params,a.config))})})(),a};c(()=>e.isShowDesign,async e=>{if(e)try{f.value=!0,await y();const e=await i.loadCustomModelData();let t=ko(e.model);t.length||(t=Jw(n,i));const a=await S(t);p.value=t,p.value.forEach((e,t)=>{e.dynamodelFlag&&(e.portletModel=a[t])}),m.value=ko(e.config)}catch(e){ibiz.log.error(e)}finally{f.value=!1}},{immediate:!0});const E=o(0),D=r(()=>"calc((100% - 10px) / ".concat(i.layoutColNum,") ").concat(i.layoutRowH+10,"px"));return h(async()=>{const e=Object.values(g.value);await Promise.all(e.map(async e=>{await e.destroyed()}))}),{ns:a,customC:i,portlets:s,list:l,groups:d,filterVal:u,defaultOpens:C,layoutModel:p,isLoading:f,onReset:async()=>{const e=await i.resetCustomModelData();p.value=e.model,m.value=e.config,t("reset")},onSave:async()=>{const e=await i.saveCustomModelData(p.value);t("saved",{model:e.model,config:e.config})},removeItem:async e=>{const t=p.value.indexOf(e);if(-1!==t){p.value.splice(t,1);const a=await x(e);if(a){const e=g.value[a.id];await e.destroyed()}}},addLayoutItem:async e=>{const t=await S([e]),a=b.value;a&&(E.value=a.scrollHeight+3*i.layoutRowH);let o=0;for(const e of p.value)e.y>o&&(o=e.y);const s={w:4,h:3,x:0,y:o+3,i:e.portletCodeName,...e};if(e.dynamodelFlag){const a=n.dynaPortletMap.get(e.portletId);a&&Object.assign(s,{controlmodeldigest:a.controlmodeldigest}),Object.assign(s,{portletModel:t[0]})}if(p.value.push(s),a){const e=setInterval(()=>{a.scrollHeight>=E.value&&(a.scrollTo({top:a.scrollHeight,behavior:"smooth"}),clearInterval(e))},50)}},handleColNumberChange:e=>{i.layoutColNum=e},handleRolHChange:e=>{i.layoutRowH=e},isDisabled:e=>!!p.value.find(t=>t.i===e.portletCodeName),providers:v,portletControllers:g,maskSize:D,designPanel:b,getPortletModelByCodeName:I}},render(){let e,t,a,o;const s=e=>n(i("el-menu-item"),{key:e.portletCodeName,index:e.portletCodeName,tag:e.portletCodeName,disabled:this.isDisabled(e)},{default:()=>[n("span",null,[n("ion-icon",{icon:e.portletImage},null),e.portletName]),n("ion-icon",{title:Tt(ibiz.i18n.t("control.dashboard.dashboardDesign.add")),name:"arrow-forward-outline",onClick:()=>this.addLayoutItem(e)},null)]}),r=e=>{const t=e.dynamodelFlag?e.portletModel:this.getPortletModelByCodeName(e.portletCodeName);if(!t)return null;const a=this.providers[t.id],o=this.portletControllers[t.id],s={modelData:t,controller:o};if(!a||!o)return n("div",null,[t.portletType,ibiz.i18n.t("app.noSupport")]);const r=i(a.component);return l(r,{...s,key:t.id})};return n("div",{class:this.ns.b()},[n("div",{class:this.ns.b("header")},[n("span",null,[ibiz.i18n.t("control.dashboard.dashboardDesign.customPortal")]),n("span",{class:this.ns.b("header-utils")},[n("div",{class:this.ns.be("header-utils","col-num")},[ibiz.i18n.t("control.dashboard.dashboardDesign.colNum"),p(":"),n(i("el-input-number"),{modelValue:this.customC.layoutColNum,"onUpdate:modelValue":e=>this.customC.layoutColNum=e,onChange:this.handleColNumberChange},null)]),n("div",{class:this.ns.be("header-utils","row-h")},[ibiz.i18n.t("control.dashboard.dashboardDesign.cellHeight"),p(":"),n(i("el-input-number"),{modelValue:this.customC.layoutRowH,"onUpdate:modelValue":e=>this.customC.layoutRowH=e,onChange:this.handleRolHChange},null)]),n(i("el-button"),{class:this.ns.be("header-utils","reset"),style:{display:this.customC.multiMode?"none":"inline-flex"},onClick:this.onReset},Qw(e=ibiz.i18n.t("control.dashboard.dashboardDesign.restoreDefault"))?e:{default:()=>[e]}),n(i("el-button"),{class:this.ns.be("header-utils","save"),onClick:this.onSave},Qw(t=ibiz.i18n.t("control.dashboard.dashboardDesign.save"))?t:{default:()=>[t]})])]),n("div",{class:this.ns.b("content")},[n("div",{class:this.ns.b("tree")},[n(i("el-select"),{modelValue:this.filterVal,"onUpdate:modelValue":e=>this.filterVal=e,clearable:!0,class:this.ns.b("tree-filter")},Qw(a=this.groups.map(e=>n(i("el-option"),{key:e.value,value:e.value,label:e.name},null)))?a:{default:()=>[a]}),n("div",{class:this.ns.b("tree-content")},[(()=>{let e,t;return this.filterVal?n(i("el-menu"),{"default-openeds":this.defaultOpens,class:this.ns.is("filter",!0),key:this.filterVal},Qw(e=this.groups.map(e=>e.value===this.filterVal?n(i("el-sub-menu"),{key:e.value,index:e.value},{title:()=>e.name,default:()=>e.children.map(e=>s(e))}):null))?e:{default:()=>[e]}):n(i("el-menu"),{class:this.ns.is("no-filter",!0),"default-openeds":this.defaultOpens,key:"default"},Qw(t=this.groups.map((e,t)=>n(i("el-sub-menu"),{key:e.value+t,index:e.value+t},{title:()=>e.name,default:()=>e.children.map(e=>s(e))})))?t:{default:()=>[t]})})()])]),b(n("div",{ref:"designPanel",class:this.ns.b("scroll-box")},[n("div",{class:this.ns.b("panel")},[n("div",{class:this.ns.b("grid-layout-mask"),style:{backgroundSize:this.maskSize}},null),n(i("grid-layout"),{class:this.ns.b("grid-layout"),layout:this.layoutModel,"col-num":this.customC.layoutColNum,"row-height":this.customC.layoutRowH,"is-draggable":!0,"is-resizable":!0,"is-mirrored":!1,"vertical-compact":!0,margin:[10,10],"use-css-transforms":!0,style:{maxHeight:"100%"}},Qw(o=this.layoutModel.map(e=>n(i("grid-item"),{x:e.x,y:e.y,w:e.w,h:e.h,i:e.i,key:e.i},{default:()=>[n(i("el-card"),{class:this.ns.b("grid-layout-item")},{default:()=>[n("ion-icon",{name:"close-outline",title:ibiz.i18n.t("app.delete"),onClick:()=>this.removeItem(e),class:this.ns.b("grid-layout-item-icon")},null),n("div",{class:this.ns.b("grid-layout-item-content")},[r(e)])]})]})))?o:{default:()=>[o]})])]),[[C("loading"),this.isLoading]])])])}}),ey=a({name:"IBizCustomDashboardContainer",props:{modelData:{type:Object,required:!0},dashboard:{type:Object,required:!0}},setup(e,{emit:t}){const a=B("custom-dashboard-container"),n=new Yn(e.modelData,e.dashboard);e.dashboard.setCustomDashboard(n);const i=u(n),s=o(!1),l=o(!1),r=o(!1),c=o(!1),h=async t=>{if(t.dynamodelFlag){if(t.portletModel)return t.portletModel;return await e.dashboard.loadDynaPortletById(t.portletId)}return(t=>{const a=ibiz.hub.getApp(e.dashboard.model.appId);if(a.model.appPortlets){const e=a.model.appPortlets.find(e=>{var a;return(null==(a=e.control)?void 0:a.codeName)===t});if(e)return e.control}})(t.portletCodeName)},p=async e=>{const t=[];if(e.length>0)for(let a=0;a<e.length;a++){const n=await h(e[a]);n&&t.push(n)}return t},m=async t=>{var a,n;const i=null==(a=e.dashboard.model.controls)?void 0:a.filter(e=>"FILTER"===e.portletType),o=null==(n=e.dashboard.model.controls)?void 0:n.filter(e=>"FILTER"!==e.portletType);t.model&&t.model.length>0?await e.dashboard.initPortlets(t.model):i&&i.length>0&&(await e.dashboard.initPortlets(i),await e.dashboard.initPortlets(o||[])),await e.dashboard.initPortletsConfig(t.config)};return d(async()=>{var a;c.value="BIREPORTDASHBOARD"===(null==(a=e.dashboard.model)?void 0:a.dashboardStyle);const n=await i.loadCustomModelData(),o=await p(n.model);t("changed",{model:o}),await m({model:o,config:n.config}),s.value=!0,e.dashboard.evt.on("onConfigChange",async e=>{const{name:t,config:a}=e;i.saveCustomModelData(i.customModelData,{[t]:a})}),e.dashboard.evt.on("onSavePortlet",async a=>{const n=await p(a.model);await m({model:n,config:a.config}),e.dashboard.refresh(),t("changed",{model:n})})}),{ns:a,customC:i,isShowDesign:l,isInited:s,showTypeDir:r,showFilter:c,openDesign:()=>{l.value=!0},onSaved:async e=>{l.value=!1;const a=await p(e.model);await m({model:a,config:e.config}),t("changed",{model:a})},onReset:async()=>{s.value=!1,l.value=!1,await e.dashboard.resetPortlets(),await g(),s.value=!0},clickCollapse:e=>{r.value="left"===e},openFilterDesign:()=>{e.dashboard.openFilterDesignPage()}}},render(){var e,t;return b(n("div",{class:[this.ns.b()]},[this.customC.showDesignBtn?n("div",{class:this.ns.b("build-btn")},[this.showTypeDir?n("div",null,[this.showFilter?n(i("el-button"),{class:this.ns.b("deisgn-btn"),title:ibiz.i18n.t("control.dashboard.customDashboardContainer.newFilter"),onClick:this.openFilterDesign},{default:()=>[n("ion-icon",{name:"filter-outline"},null)]}):null,n(i("el-button"),{class:this.ns.b("deisgn-btn"),title:Tt(ibiz.i18n.t("control.dashboard.customDashboardContainer.portalCustomPrompt")),onClick:this.openDesign},{default:()=>[n("ion-icon",{name:"build-outline"},null)]}),n(i("el-button"),{class:this.ns.b("forward-btn"),onClick:()=>this.clickCollapse("right")},{default:()=>[n("ion-icon",{name:"chevron-forward-outline"},null)]})]):n(i("el-button"),{class:this.ns.b("back-btn"),onClick:()=>this.clickCollapse("left")},{default:()=>[n("ion-icon",{name:"chevron-back-outline"},null)]})]):null,n(i("el-drawer"),{modelValue:this.isShowDesign,"onUpdate:modelValue":e=>this.isShowDesign=e,"with-header":!1,size:"80%","modal-class":"custom-dashboard-drawer"},{default:()=>[this.isShowDesign&&n(i("iBizDashboardDesign"),{dashboard:this.dashboard,"custom-dashboard":this.customC,"is-show-design":this.isShowDesign,onSaved:this.onSaved,onReset:this.onReset},null)]}),this.isInited&&(0===this.customC.customModelData.length?null==(t=(e=this.$slots).default)?void 0:t.call(e):this.customC.customModelData.map(e=>{var t,a;const i={position:"absolute",height:"".concat(e.h*this.customC.layoutRowH,"px"),width:"calc(100% / ".concat(this.customC.layoutColNum," * ").concat(e.w,")"),top:"".concat(e.y*this.customC.layoutRowH,"px"),left:"calc(100% / ".concat(this.customC.layoutColNum," * ").concat(e.x,")")};return n("div",{style:i},[null==(a=(t=this.$slots)[e.portletCodeName])?void 0:a.call(t)])}))]),[[C("loading"),!this.isInited]])}});var ty=Object.defineProperty,ay=(e,t,a)=>(((e,t,a)=>{t in e?ty(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ny{constructor(){ay(this,"component","IBizDashboardControl")}}function iy(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const oy=e("ac",a({name:"IBizContainerPortlet",props:{modelData:{type:Object,required:!0},controller:{type:Kn,required:!0}},setup(e){var t;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase()))}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{layout:this.modelData.layout},iy(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},iy(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]}),l=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:l},iy(s)?s:{default:()=>[s]})}}));var sy=Object.defineProperty,ly=(e,t,a)=>(((e,t,a)=>{t in e?sy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ry{constructor(){ly(this,"component","IBizContainerPortlet")}async createController(e,t,a){const n=new Kn(e,t,a);return await n.init(),n}}const cy=e("ab",ie(oy,function(e){e.component(oy.name,oy),Xn("CONTAINER",()=>new ry)})),dy=e("ad",a({name:"IBizPortletLayout",props:{controller:{type:$n,required:!0},linkAction:{type:Object}},setup(e){var t;const a=B("portlet-layout"),o="portlet-".concat(null==(t=e.controller.model.portletType)?void 0:t.toLowerCase()),s=e.controller,l=e.controller.dashboard.state.zIndex,c=r(()=>{const e=[a.em("toolbar","".concat(o,"-").concat(s.model.id))],{codeName:t}=s.dashboard.view.model;return e.push(a.em("toolbar",t)),e}),d=r(()=>s.model.showTitleBar&&(s.model.title||s.model.sysImage)||s.model.uiactionGroup),u=s.dashboard.model.controlRenders,h=null==u?void 0:u.find(e=>"dashboard_".concat(e.id)==="".concat(s.model.name,"_header")),p=null==u?void 0:u.find(e=>"dashboard_".concat(e.id)==="".concat(s.model.name,"_header_caption")),m=null==u?void 0:u.find(e=>"dashboard_".concat(e.id)==="".concat(s.model.name,"_header_bg")),v=null==u?void 0:u.find(e=>"dashboard_".concat(e.id)==="".concat(s.model.name,"_header_action"));return{c:s,ns:a,zIndex:l,popperClass:c,portletType:o,isShowHeader:d,header:h,headerCaption:p,headerBg:m,headerAction:v,renderContent:e=>{if("LAYOUTPANEL_MODEL"===e.renderType&&e.layoutPanelModel){const t=Ua.execScriptFn({params:s.params,context:s.context},e.layoutPanelModel,{isAsync:!1});return n("div",{class:a.b("header-render"),innerHTML:t},null)}if("LAYOUTPANEL"===e.renderType&&e.layoutPanel)return n(i("iBizControlShell"),{class:a.b("header-render"),params:s.params,context:s.context,modelData:e.layoutPanel},null)},openLink:t=>{e.linkAction&&e.controller.onActionClick(e.linkAction,t)},clickPorlet:(e,t)=>{e.stopPropagation(),s.dashboard.view.evt.emit("onPorletClick",{data:{tag:s.model.codeName,position:t}})},onActionClick:async(t,a)=>{await e.controller.onActionClick(t,a)}}},render(){var e,t;const{model:a,state:o}=this.controller,s=!!(this.header||this.headerCaption||this.headerBg||this.headerAction);return n("div",{class:[this.ns.b(),this.ns.is("no-header",!this.isShowHeader),this.ns.is("hight-light",o.hightLight)]},[this.isShowHeader?this.header?n("div",{key:"header",class:[this.ns.b("header"),this.ns.is("custom",s)]},[this.renderContent(this.header)]):n("div",{key:"header",class:[this.ns.b("header"),this.ns.is("custom",s)]},[this.headerBg&&n("div",{class:this.ns.be("header","bg")},[this.renderContent(this.headerBg)]),n("div",{class:this.ns.be("header","left"),onClick:e=>this.clickPorlet(e,"title")},[a.showTitleBar&&(this.headerCaption?this.renderContent(this.headerCaption):n("div",{class:[this.ns.e("caption"),this.ns.is("link",!!this.linkAction)],onClick:this.openLink},[n(i("iBizIcon"),{class:this.ns.e("caption-icon"),icon:a.sysImage},null),n("span",{class:this.ns.e("caption-text"),title:Tt(o.title)},[o.title])]))]),n("div",{class:this.ns.be("header","right")},[this.headerAction?this.renderContent(this.headerAction):"ACTIONBAR"!==a.portletType&&a.uiactionGroup&&n(i("iBizActionToolbar"),{zIndex:this.zIndex,class:this.ns.e("toolbar"),"action-details":a.uiactionGroup.uiactionGroupDetails,"actions-state":o.actionGroupState,mode:"ITEMS"===a.actionGroupExtractMode?"dropdown":"buttons",popperClass:this.popperClass,onActionClick:this.onActionClick},null)])]):null,n("div",{key:"content",class:this.ns.b("content"),onClick:e=>this.clickPorlet(e,"content")},[null==(t=(e=this.$slots).default)?void 0:t.call(e)])])}}));const uy=e("af",a({name:"IBizViewPortlet",props:{modelData:{type:Object,required:!0},controller:{type:Jn,required:!0}},setup(e){var t;const a=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),n=e.modelData.portletAppView;let i;return d(()=>{const t=e.controller.model.timer;t&&t>0&&(i=setInterval(()=>{e.controller.refresh()},t))}),m(()=>{clearInterval(i)}),{ns:a,view:n}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:a,params:o}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,class:t},"function"==typeof(r=e=l(i("IBizViewShell"),{context:a,params:o,modelData:this.view}))||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?e:{default:()=>[e]});var r}}));var hy=Object.defineProperty,py=(e,t,a)=>(((e,t,a)=>{t in e?hy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class my{constructor(){py(this,"component","IBizViewPortlet")}async createController(e,t,a){const n=new Jn(e,t,a);return await n.init(),n}}const vy=e("ae",ie(uy,function(e){e.component(uy.name,uy),Xn("VIEW",()=>new my)}));function gy(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const by=a({name:"IBizAppMenuPortletControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},collapse:Boolean,currentPath:String},setup(){var e;const t=ne((...e)=>new Ga(...e)),a=B("control-".concat(t.model.controlType.toLowerCase(),"-portlet")),s=o(""),l=o([]);null==(e=t.model.appMenuItems)||e.forEach(e=>{"MENUITEM"===e.itemType&&l.value.push(e.id)});const r=async(e,a)=>{await t.onClickMenuItem(e,a)},c=e=>t.state.menuItemsState[e.id].visible?n("div",{class:[a.b("item"),a.is("disabled",!e.appFuncId)],title:Tt(e.tooltip||e.caption),onClick:t=>{e.appFuncId&&r(e.id,t)}},[n(i("iBizIcon"),{class:a.be("item","icon"),icon:e.sysImage},null),n("span",{class:a.be("item","label")},[e.caption])]):null;return{c:t,ns:a,defaultActive:s,defaultOpens:l,onClick:r,renderGroup:e=>t.state.menuItemsState[e.id].visible?e.appMenuItems?n(i("el-collapse-item"),{class:a.b("group"),name:e.id,title:Tt(e.caption)},{default:()=>{var t;return[null==(t=e.appMenuItems)?void 0:t.map(e=>c(e))]}}):c(e):null,renderItem:c}},render(){var e;const{state:t,model:a}=this.c;let o=null;if(t.isCreated&&(null==(e=a.appMenuItems)?void 0:e.length)){let e;o=n(i("el-collapse"),{class:this.ns.e("content"),modelValue:this.defaultOpens,"onUpdate:modelValue":e=>this.defaultOpens=e},gy(e=a.appMenuItems.map(e=>"MENUITEM"!==e.itemType?null:this.renderGroup(e)))?e:{default:()=>[e]})}return n(i("iBizControlBase"),{class:[this.ns.b()],controller:this.c},gy(o)?o:{default:()=>[o]})}}),fy=e("ah",a({name:"IBizMenuPortlet",props:{modelData:{type:Object,required:!0},controller:{type:Qn,required:!0}},setup(e){var t,a;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),menu:null==(a=e.modelData.controls)?void 0:a.find(e=>e.controlType===qa.APP_MENU)}},render(){const e=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:t,params:a}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,class:e},{default:()=>[this.menu&&n(i("iBizAppMenuPortletControl"),{modelData:this.menu,context:t,params:a},null)]})}}));var wy=Object.defineProperty,yy=(e,t,a)=>(((e,t,a)=>{t in e?wy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Cy{constructor(){yy(this,"component","IBizMenuPortlet")}async createController(e,t,a){const n=new Qn(e,t,a);return await n.init(),n}}const Iy=e("ag",ie(fy,function(e){e.component(fy.name,fy),e.component(by.name,by),Xn("APPMENU",()=>new Cy)}));const xy=e("aj",a({name:"IBizChartPortlet",props:{modelData:{type:Object,required:!0},controller:{type:Zn,required:!0}},setup(e){var t,a;const n=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),i=null==(a=e.modelData.controls)?void 0:a.find(e=>e.controlType===qa.CHART);let o;return d(()=>{const t=e.controller.model.timer;t&&t>0&&(o=setInterval(()=>{e.controller.refresh()},t))}),m(()=>{clearInterval(o)}),{ns:n,chart:i}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:a,params:o}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,class:t},"function"==typeof(r=e=l(i("IBizControlShell"),{context:a,params:o,modelData:this.chart}))||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?e:{default:()=>[e]});var r}}));var Sy=Object.defineProperty,Ey=(e,t,a)=>(((e,t,a)=>{t in e?Sy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Dy{constructor(){Ey(this,"component","IBizChartPortlet")}async createController(e,t,a){const n=new Zn(e,t,a);return await n.init(),n}}const Py=e("ai",ie(xy,function(e){e.component(xy.name,xy),Xn("CHART",()=>new Dy)}));const ky=e("al",a({name:"IBizRawItemPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ei,required:!0}},setup(e){var t;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),rawItem:e.modelData}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:t},"function"==typeof(a=e=l(i("iBizRawItem"),{rawItem:this.rawItem}))||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?e:{default:()=>[e]});var a}}));var zy=Object.defineProperty,Ty=(e,t,a)=>(((e,t,a)=>{t in e?zy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ay{constructor(){Ty(this,"component","IBizRawItemPortlet")}async createController(e,t,a){const n=new ei(e,t,a);return await n.init(),n}}const Oy=e("ak",ie(ky,function(e){e.component(ky.name,ky),Xn("RAWITEM",()=>new Ay)}));const My=e("an",a({name:"IBizListPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ti,required:!0}},setup(e){var t,a;const n=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),i=null==(a=e.modelData.controls)?void 0:a.find(e=>e.controlType===qa.LIST);let o;return d(()=>{const t=e.controller.model.timer;t&&t>0&&(o=setInterval(()=>{e.controller.refresh()},t))}),m(()=>{clearInterval(o)}),{ns:n,list:i}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:a,params:o}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,class:t},"function"==typeof(r=e=l(i("IBizControlShell"),{context:a,params:o,modelData:this.list}))||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?e:{default:()=>[e]});var r}}));var Ny=Object.defineProperty,By=(e,t,a)=>(((e,t,a)=>{t in e?Ny(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ly{constructor(){By(this,"component","IBizListPortlet")}async createController(e,t,a){const n=new ti(e,t,a);return await n.init(),n}}const Ry=e("am",ie(My,function(e){e.component(My.name,My),Xn("LIST",()=>new Ly)})),_y=e("ap",a({name:"IBizHtmlPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ai,required:!0}},setup(e){var t;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase()))}},render(){const e=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:e},{default:()=>[n("iframe",{src:this.modelData.pageUrl},null)]})}}));var jy=Object.defineProperty,Vy=(e,t,a)=>(((e,t,a)=>{t in e?jy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Fy{constructor(){Vy(this,"component","IBizHtmlPortlet")}async createController(e,t,a){const n=new ai(e,t,a);return await n.init(),n}}const Uy=e("ao",ie(_y,function(e){e.component(_y.name,_y),Xn("HTML",()=>new Fy)})),Hy=e("ar",a({name:"IBizActionBarPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ni,required:!0}},setup(e){var t;return{ns:B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),zIndex:e.controller.dashboard.state.zIndex,onActionClick:async(t,a)=>{await e.controller.onActionClick(t,a)}}},render(){const e=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:e},{default:()=>[this.modelData.uiactionGroup&&n(i("iBizActionToolbar"),{zIndex:this.zIndex,"action-details":this.modelData.uiactionGroup.uiactionGroupDetails,"actions-state":this.controller.state.actionGroupState,onActionClick:this.onActionClick},null)]})}}));var qy=Object.defineProperty,Gy=(e,t,a)=>(((e,t,a)=>{t in e?qy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Wy{constructor(){Gy(this,"component","IBizActionBarPortlet")}async createController(e,t,a){const n=new ni(e,t,a);return await n.init(),n}}const Yy=e("aq",ie(Hy,function(e){e.component(Hy.name,Hy),Xn("ACTIONBAR",()=>new Wy)}));const Ky=e("at",a({name:"IBizReportPortlet",props:{modelData:{type:Object,required:!0},controller:{type:ii,required:!0}},setup(e){var t,a;const n=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase())),i=null==(a=e.modelData.controls)?void 0:a.find(e=>e.controlType===qa.REPORT_PANEL),o=r(()=>{const{uiactionGroupDetails:t=[]}=e.controller.model.uiactionGroup||{};return t.find(e=>e.uiactionId&&e.uiactionId.startsWith("bi_report_view"))});let s;return d(()=>{const t=e.controller.model.timer;t&&t>0&&(s=setInterval(()=>{e.controller.refresh()},t))}),m(()=>{clearInterval(s)}),{ns:n,report:i,linkAction:o}},render(){let e;const t=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],{context:a,params:o}=this.controller;return n(i("iBizPortletLayout"),{controller:this.controller,linkAction:this.linkAction,class:t},"function"==typeof(r=e=l(i("IBizControlShell"),{context:a,params:o,modelData:this.report}))||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?e:{default:()=>[e]});var r}}));var Xy=Object.defineProperty,$y=(e,t,a)=>(((e,t,a)=>{t in e?Xy(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Jy{constructor(){$y(this,"component","IBizReportPortlet")}async createController(e,t,a){const n=new ii(e,t,a);return await n.init(),n}}const Qy=e("as",ie(Ky,function(e){e.component(Ky.name,Ky),Xn("REPORT",()=>new Jy)}));const Zy=a({name:"IBizFilterPortletItem",props:{context:{type:Object,required:!0},params:{type:Object,required:!0},field:{type:Object,required:!0},filterNode:{type:Object}},emits:["change"],setup(e,{emit:t}){const a=B("filter-portlet-item"),d=o(void 0),u=o(void 0),h=o({value:null,valueOP:null,nodeType:"FIELD",field:e.field.appDEFieldId}),p=r(()=>ibiz.util.jsonSchema.getValueOPsByDataType(e.field.type)),m=async t=>{const a=ibiz.util.jsonSchema.getMockEditor(e.context,e.field,t);a&&(d.value=await Ma(a),d.value&&(u.value=await d.value.createController(a,{context:e.context,params:e.params})))};c(()=>e.filterNode,()=>{(async()=>{e.filterNode&&(h.value={...e.filterNode}),m(p.value[0].valueOP)})()},{immediate:!0});const v=e=>{h.value.value=e,t("change",h.value)},g=()=>{if(u.value){const e=i(d.value.formEditor);return l(e,{value:h.value.value,controller:u.value,onChange:(e,t)=>{v(e)}})}};return{ns:a,renderContent:()=>{let e;return n("div",{class:a.e("content")},[n("div",{class:a.em("content","option")},[n(i("el-select"),{"model-value":h.value.valueOP,onChange:e=>{(e=>{h.value.valueOP=e,v(null),m(e)})(e)}},(t=e=p.value.map(e=>n(i("el-option"),{key:e.valueOP,value:e.valueOP,label:e.label},null)),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))]),n("div",{class:a.em("content","editor")},[g()])]);var t}}},render(){return n("div",{class:this.ns.b()},[n("div",{class:this.ns.e("header")},[n("span",{class:this.ns.em("header","caption")},[this.field.caption])]),this.renderContent()])}});function eC(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const tC=e("av",a({name:"IBizFilterPortlet",props:{modelData:{type:Object,required:!0},controller:{type:oi,required:!0}},setup(e){var t;const a=e.controller,n=B("portlet-".concat(null==(t=e.modelData.portletType)?void 0:t.toLowerCase()));return{ns:n,handleReset:()=>{a.resetFilter()},handleSearch:()=>{a.search()},renderFilter:()=>{if(!a.state.filterNode)return;return(a.state.filterNode.children||[]).map((e,t)=>((e,t)=>{const n=a.jsonSchemaFields.find(t=>t.appDEFieldId===e.field);if(n)return l(Zy,{field:n,filterNode:e,context:a.context,params:a.params,onChange:e=>{a.state.filterNode.children[t]=e}})})(e,t))}}},render(){let e,t;const a=[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass];return n(i("iBizPortletLayout"),{controller:this.controller,class:a},{default:()=>[n("div",{class:this.ns.e("left")},[this.renderFilter()]),n("div",{class:this.ns.e("right")},[n(i("el-button"),{onClick:this.handleReset},eC(e=ibiz.i18n.t("app.reset"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:this.handleSearch},eC(t=ibiz.i18n.t("app.search"))?t:{default:()=>[t]})])]})}}));var aC=Object.defineProperty,nC=(e,t,a)=>(((e,t,a)=>{t in e?aC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class iC{constructor(){nC(this,"component","IBizFilterPortlet")}async createController(e,t,a){const n=new oi(e,t,a);return await n.init(),n}}function oC(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const sC=a({name:"IBizFilterPortletDesign",props:{context:{type:Object,required:!0},viewParams:{type:Object,required:!0},filter:{type:Object},items:{type:Array,default:()=>[]},dashboardStyle:{type:String},dismiss:{type:Function,required:!0}},emits:["lisTSelect","formChange"],setup(e){const t=B("filter-portlet-design"),a=o(!1),s=o(!1),l=o(),r=u({title:[{required:!0,message:ibiz.i18n.t("control.dashboard.filterPortletDesign.ctrlTitleError"),trigger:"blur"}]}),c=u({title:"",selectAll:!0,items:[]}),d=o({}),h=o();let m=[],v=[];const g=o({}),f=o([]),w=new Map,y=new Map,I=o([]),x=async t=>{t&&(w.has(t)||(s.value=!0,f.value=await ibiz.util.jsonSchema.getEntitySchemaFields(t,e.context,e.viewParams),s.value=!1,w.set(t,f.value)),f.value=w.get(t))},S=()=>{I.value=si(h.value.id,e.context,e.items,"BIREPORTDASHBOARD"===e.dashboardStyle||"BIREPORTDASHBOARD2"===e.dashboardStyle)};(async()=>{var t;if(v=(()=>{let t=[];const a=ibiz.hub.getApp(e.context.srfappid);return m=a.model.appPortlets||[],m.length>0&&(t=m.filter(e=>{if(e.control)return"PORTLET"===e.control.controlType&&"FILTER"===e.control.portletType})),t})(),e.items&&(c.items=e.items.map(e=>e.id)),e.filter){const a=v.find(t=>t.id===e.filter.model.id);if(a){h.value=Yt(a.control),c.title=e.filter.config.srftitle,g.value=a.portletParams||{};"all"===e.filter.filterConfig.scope||(c.selectAll=!1,c.items=(null==(t=e.filter.filterConfig.scopedata)?void 0:t.split(","))||[]),d.value=e.filter.searchConds}}!h.value&&v.length>0&&(h.value=Yt(v[0].control),c.title=h.value.title||"",g.value=v[0].portletParams||{}),h.value&&(await x(h.value.appDataEntityId),S()),a.value=!0})();const E=e=>{d.value=e,y.set(h.value.appDataEntityId,e)},D=t=>{t&&e.items&&(c.items=e.items.map(e=>e.id))},P=()=>{e.dismiss({ok:!1})},k=()=>{l.value&&l.value.validate(t=>{if(t){const t={config:(()=>{const e={};if(c.selectAll)e.scope="all";else{e.scope="custom";const t=[];I.value.forEach(e=>{c.items.includes(e.id)&&t.push(e.id)}),e.scopedata=t.join(",")}return Object.keys(g.value).length>0&&(e.scopetag=g.value.filtergroup),e})(),model:Object.assign(h.value,{title:c.title}),searchconds:d.value};e.dismiss({ok:!0,data:[t]})}})},z=()=>v.length?n("ul",{class:[t.b("left-list")]},[v.map(a=>{var i;const o=a.control,s=a.portletParams||{};let l=!1;return e.filter&&e.filter.id!==o.id&&(l=!0),n("li",{class:[t.be("left-list","item"),t.is("disabled",l),t.is("actvie",o.id===(null==(i=h.value)?void 0:i.id))],title:o.title,onClick:()=>((e,t,a)=>{a||(h.value=Yt(e),c.title=e.title||"",g.value=t,x(e.appDataEntityId),y.has(e.appDataEntityId)?d.value=y.get(e.appDataEntityId):d.value={},S())})(o,s,l)},[o.title])})]):n(i("iBizNoData"),{text:ibiz.i18n.t("control.common.currentNoData")},null),T=()=>{let e;if(!I.value)return;const a=I.value.length>0&&1===c.items.length;return n(i("el-checkbox-group"),{class:[t.b("checkbox"),t.is("only-add",a)],modelValue:c.items,"onUpdate:modelValue":e=>c.items=e,disabled:c.selectAll},oC(e=I.value.map(e=>n(i("el-checkbox"),{label:e.id,disabled:a&&c.items.includes(e.id)},{default:()=>[e.title]})))?e:{default:()=>[e]})};return{ns:t,loaded:a,formRef:l,renderRightContent:()=>n("div",{class:[t.b("right-content")]},[n("div",{class:[t.be("right-content","title")]},[ibiz.i18n.t("control.dashboard.filterPortletDesign.baseSet")]),h.value?n(i("el-form"),{ref:"formRef",model:c,rules:r,"label-width":"auto",class:t.b("right-form")},{default:()=>[n(i("el-form-item"),{required:!0,label:ibiz.i18n.t("control.dashboard.filterPortletDesign.ctrlTitle"),prop:"title"},{default:()=>[n(i("el-input"),{modelValue:c.title,"onUpdate:modelValue":e=>c.title=e,maxlength:32,placeholder:ibiz.i18n.t("control.dashboard.filterPortletDesign.ctrlPlaceholder")},{suffix:()=>n("div",null,[c.title.length,p(" / "),32])})]}),n(i("el-form-item"),{class:t.be("right-form","checks"),label:ibiz.i18n.t("control.dashboard.filterPortletDesign.checkTitle"),required:!0,props:"items"},{default:()=>[n(i("el-switch"),{title:ibiz.i18n.t("control.dashboard.filterPortletDesign.selectAll"),modelValue:c.selectAll,"onUpdate:modelValue":e=>c.selectAll=e,onChange:D},null),T()]})]}):null]),renderLeftContent:()=>{const a=e.filter?ibiz.i18n.t("app.edit"):ibiz.i18n.t("app.newlyBuild");return n("div",{class:[t.b("left-content")]},[n("div",{class:t.be("left-content","title")},["".concat(a," ").concat(ibiz.i18n.t("control.dashboard.filterPortletDesign.filterTitle"))]),z()])},renderCondition:()=>b(n(i("iBizCustomFilterCondition"),{class:t.b("condition"),context:e.context,params:e.viewParams,value:d.value,schemaFields:f.value,onChange:E},null),[[C("loading"),s.value]]),renderFooter:()=>{let e,a;return n("div",{class:t.b("footer")},[n(i("el-button"),{onClick:P,title:ibiz.i18n.t("app.cancel")},oC(e=ibiz.i18n.t("app.cancel"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:k,title:ibiz.i18n.t("app.confirm")},oC(a=ibiz.i18n.t("app.confirm"))?a:{default:()=>[a]})])}}},render(){if(this.loaded)return n("div",{class:[this.ns.b()]},[n("div",{class:[this.ns.e("layout-left")]},[this.renderLeftContent()]),n("div",{class:[this.ns.e("layout-right")]},[this.renderRightContent(),this.renderCondition(),this.renderFooter()])])}}),lC=e("au",ie(tC,function(e){e.component(tC.name,tC),e.component(sC.name,sC),Xn("FILTER",()=>new iC)})),rC=e("aa",ie($w,function(e){e.component($w.name,$w),e.component(Zw.name,Zw),e.component(ey.name,ey),Ha(qa.DASHBOARD,()=>new ny),e.component(dy.name,dy),e.use(cy),e.use(vy),e.use(Iy),e.use(Py),e.use(Oy),e.use(Ry),e.use(Uy),e.use(Yy),e.use(Qy),e.use(lC)})),cC="__epPropKey",dC=["#2196F3","#4CAF50","#3F51B5","#FF9800","#673AB7","#757575"],uC=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,hC=/^(rgb|rgba|RGB|RGBA)/,pC=(e,t,a,n="~")=>{var i,o;let s="";return e&&(null==(i=as(e))?void 0:i.isValid())&&(s=as(e).format(a)),t&&(null==(o=as(t))?void 0:o.isValid())&&(s="".concat(s," ").concat(n," ").concat(as(t).format(a))),s},mC=(e,t)=>{let a=e.get(t);const n=e.size;return t&&!a&&n<dC.length&&(a=dC[n],e.set(t,a)),a||dC[0]},vC=e=>{if(!e)return console.error("getRgbValue: Missing parameters!"),!1;const t=(e=>{const t=uC.test(e),a=hC.test(e),n=e;return t||a||e?n:(console.error("Color: Invalid color!"),"")})(e);if(!t)return!1;const a=uC.test(t),n=hC.test(t),i=t.toLowerCase();return a?(e=>{const t=e.replace("#","");return[parseInt(t.substring(0,2),16),parseInt(t.substring(2,4),16),parseInt(t.substring(4,6),16)]})(i):n?(e=>e.replace(/rgb\(|rgba\(|\)/g,"").split(",").slice(0,3).map(function(e){return parseInt(e,10)}))(i):void 0},gC=(e,t)=>{const a=t;if(!e)return console.error("fade: Missing parameters!"),!1;const n=vC(e);if(!n)return!1;return(e=>{if(!e)return console.error("getColorFromRgbValue: Missing parameters!"),!1;const t=e.length;if(3!==t&&4!==t)return console.error("getColorFromRgbValue: Value is illegal!"),!1;let a=3===t?"rgb(":"rgba(";return a+="".concat(e.join(","),")"),a})([...n,a/100])},bC=(e,t)=>{const a=new Date(e),n=t?new Date(t):new Date;return a.getDate()===n.getDate()&&a.getMonth()===n.getMonth()&&a.getFullYear()===n.getFullYear()};function fC(e,t,a){const n=as(a),i=as(e),o=as(t);return!!(n.isValid()&&i.isValid()&&o.isValid())&&(n.isSame(i,"day")||n.isSame(o,"day")||i.isBefore(n,"day")&&o.isAfter(n,"day"))}function wC(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const yC=(e,t,a)=>{const n=new Date(e),i=new Date(t),o=new Date(a);return n.setHours(0,0,0,0),i.setHours(0,0,0,0),o.setHours(0,0,0,0),n>=i&&n<=o},CC=(e,t)=>{const a=new Date(e),n=new Date(t);return a.getTime()>n.getTime()},IC=(e,t,a,n,i,o,s)=>{let l=ko(o),r=!0;const c=n.find(e=>t.id===e.id),d=l.findIndex(e=>t.id===e.id);switch(i?-1===d?l.push(c):(Object.assign(t,{isSelectedEvent:!1}),r=!1,l.splice(d,1)):-1===d?l=[c]:(Object.assign(t,{isSelectedEvent:!1}),r=!1,l=[]),e){case"eventClick":s("eventClick",{location:a,data:l});break;case"eventDblClick":s("eventDblClick",{location:a,data:l})}return{eventName:e,tempSelectedData:l,isSelectedEvent:r}},xC=(e,t)=>{if(!qo(e)||qo(a=e)&&a[cC])return e;var a;const{values:n,required:i,default:o,type:s,validator:l}=e,r=n||l?a=>{let i=!1,s=[];if(n&&(s=Array.from(n),wC(e,"default")&&s.push(o),i||(i=s.includes(a))),l&&(i||(i=l(a))),!i&&s.length>0){const e=[...new Set(s)].map(e=>JSON.stringify(e)).join(", ");T("Invalid prop: validation failed".concat(t?' for prop "'.concat(t,'"'):"",". Expected one of [").concat(e,"], got value ").concat(JSON.stringify(a),"."))}return i}:void 0,c={type:s,required:!!i,validator:r,[cC]:!0};return wC(e,"default")&&(c.default=o),c},SC=e=>Ho(Object.entries(e).map(([e,t])=>[e,xC(t,e)]));function EC(e,t,a){const n=ibiz.overlay.createPopover(t=>l(e,{modal:t}),void 0,{width:"auto",height:"auto",noArrow:!0,...a});return null==n||n.present(t),n}function DC(e,t){t.style.left="".concat(e.clientX+20,"px"),t.style.top="".concat(e.clientY+20,"px")}const PC=()=>{var e;const t=document.createElement("div");return t.style="position: fixed; height: 2px; width: 2px; z-index: -1;",null==(e=document.body)||e.appendChild(t),t},kC=e=>{document.body.removeChild(e)},zC="update:modelValue",TC="change",AC="input",OC="eventClick",MC="eventDblClick",NC="eventContextmenu",BC=SC({calendarTitle:{type:String},showDetail:{type:Boolean,default:!1},modelValue:{type:Date},range:{type:Array,validator:e=>Wo(e)&&2===e.length&&e.every(e=>Go(e))},viewType:{type:String,default:"DAY"},events:{type:Array,default:[]},legends:{type:Array,default:[]},multiple:{type:Boolean},selectedData:{type:Object}}),LC={[zC]:e=>Go(e),[AC]:e=>Go(e),[TC]:e=>Go(e),[OC]:e=>e,[MC]:e=>e,[NC]:e=>e},RC=SC({selectedDay:{type:Object},events:{type:Array,default:[]},legends:{type:Array,default:[]},multiple:{type:Boolean},selectedData:{type:Object},showDetail:{type:Boolean,default:!1}}),_C={pick:e=>qo(e),eventClick:e=>e,eventDblClick:e=>e,eventContextmenu:e=>e},jC=SC({showDetail:{type:Boolean,default:!1},selectedDay:{type:Object},events:{type:Array,default:[]},legends:{type:Array,default:[]},multiple:{type:Boolean},selectedData:{type:Object}}),VC={pick:e=>qo(e),eventClick:e=>e,eventDblClick:e=>e,eventContextmenu:e=>e},FC=SC({selectedDay:{type:Object,default:()=>new Date},events:{type:Array,default:[]}}),UC=a({name:"CalendarDaily",props:RC,emits:_C,setup(e,{emit:t,slots:a}){const s=B("calendar-daily"),{drawData:l,curTimeTop:u,curTimeVal:p,resizableHand:v,events:g,curTimeTimer:b,calendarDaily:f,selectedData:w,handleEventClick:y,handleEventDblClick:C,handleDrag:I,handleDragStart:x,handleCurTime:S,initDrawData:E,eventContextmenu:D,contentMousemove:P,eventMouseenter:k,eventMouseleave:z}=((e,t,a)=>{const n=o([]),i=o(),s=o(0),l=o("00:00"),c=o(),d=o(),u=r(()=>e.legends||[]),h=r(()=>!0===e.multiple),p=o([]);let v=0,g=0;const b=r(()=>f(e.events,null==e?void 0:e.selectedDay,u.value,d.value)),f=(e,t,a,n)=>{const i=[],o=new Map;let s=0;n&&(s=parseInt(window.getComputedStyle(n).width,10)),e.sort((e,t)=>{const a=new Date(e.beginTime).getTime()-new Date(t.beginTime).getTime();let n;return n=0===a?new Date(e.endTime).getTime()-new Date(t.endTime).getTime():a,n});const l=[];return e.forEach(e=>{const n=a.find(t=>Object.is(t.id,e.itemType));if(n&&n.isShow&&e&&e.beginTime&&fC(e.beginTime,e.endTime,t)){const t={...e,targetLegend:n};p.value.find(t=>t.id===e.id)?Object.assign(t,{isSelectedEvent:!0}):Object.assign(t,{isSelectedEvent:!1}),!e.endTime&&e.beginTime&&Object.assign(t,{endTime:e.beginTime}),l.push(t)}}),l.forEach((e,a)=>{const{targetLegend:n}=e,r={};Object.assign(r,e),Object.assign(r,{zIndex:a+1});const c=l.length,d=(s-90)/c,u=Number((100/c).toFixed(3));let h="".concat(u,"%"),p="".concat(a*u,"%");d<100&&(h="100px",p="".concat(100*a,"px")),Object.assign(r,{width:h,styleLeft:p});let m="auto",v=60;const g=pC(e.beginTime,e.endTime,"YYYY-MM-DD HH:mm:ss");if(bC(e.beginTime,e.endTime))m=w(e.beginTime,e.endTime),v=y(new Date(e.beginTime)).styleTop;else if(bC(e.beginTime,t)&&!bC(e.endTime,t)){const a=new Date(t);a.setHours(23,59,59,0),m=w(e.beginTime,a),v=y(new Date(e.beginTime)).styleTop}else if(bC(e.endTime,t)&&!bC(e.beginTime,t)){const a=new Date(t);a.setHours(0,0,0,0),m=w(a,e.endTime),v=y(new Date(a)).styleTop}else{const e=new Date(t),a=new Date(e.setHours(0,0,0,0)),n=new Date(e.setHours(23,59,59,59));m=w(a,n),v=y(new Date(a)).styleTop}if(Object.assign(r,{height:m,styleTop:v,timeRange:g}),!(null==e?void 0:e.bkColor)){const t=n&&n.bkcolor||mC(o,e.itemType);Object.assign(r,{bkColor:t})}if(r.bkColor){const e=gC(r.bkColor,10);Object.assign(r,{bkColorFade:e})}if(!(null==e?void 0:e.color)){const e=n&&n.color;Object.assign(r,{color:e})}if((null==r?void 0:r.height)&&(null==r?void 0:r.height)>10){const e="1px solid #FFF";Object.assign(r,{border:e})}else Object.assign(r,{border:"none"});i.push(r)}),o.clear(),i},w=(e,t)=>{let a=1;if(bC(e,t)){const n=new Date(t).getTime()-new Date(e).getTime();a=Math.floor(n/6e4)}return a<30&&(a="auto"),a},y=e=>{const t=e.getHours(),a=e.getMinutes(),n=String(t).padStart(2,"0"),i=String(a).padStart(2,"0");let o,s;return 0===t&&0===a?(o=0,s="00:00"):(o=60*t+a,s="".concat(n,":").concat(i)),{styleTop:o,timeVal:s}},C=PC();let I=null,x="";return m(()=>{kC(C)}),{drawData:n,curTimeTimer:i,curTimeTop:s,curTimeVal:l,events:b,resizableHand:c,calendarDaily:d,selectedData:p,handleCurTime:()=>{const{styleTop:e,timeVal:t}=y(new Date);s.value=e,l.value=t},handleDrag:e=>{const t=e.clientY-v+g;t<320&&(c.value.style.height="".concat(t,"px"))},handleDragStart:e=>{v=e.clientY,g=parseInt(window.getComputedStyle(c.value).height,10)},handleEventClick:(a,n)=>{const i=IC("eventClick",a,n,e.events,h.value,p.value,t),{tempSelectedData:o,isSelectedEvent:s}=i;s||Object.assign(a,{isSelectedEvent:s}),p.value=o},handleEventDblClick:(a,n)=>{const i=IC("eventDblClick",a,n,e.events,h.value,p.value,t),{tempSelectedData:o,isSelectedEvent:s}=i;s||Object.assign(a,{isSelectedEvent:s}),p.value=o},eventContextmenu:async(e,a)=>{t("eventContextmenu",{evt:a,data:[e]})},initDrawData:()=>{const e=[];for(let t=1;t<24;t++){const a=String(t).padStart(2,"0"),n="".concat(a,":00");e.push(n)}return e},contentMousemove:e=>{"content"===x&&I&&C&&DC(e,C)},eventMouseenter:(t,n,i)=>{if(!e.showDetail||I)return;const o="content"===i;x=i,I=EC(n,o?C:t.target,{placement:o?"right-start":"bottom",modalClass:a.e("event-popover")})},eventMouseleave:e=>{null==I||I.dismiss(),I=null,x=""}}})(e,t,s);c(()=>e.selectedData,()=>{if(e.selectedData&&e.selectedData.length>0){const t=e.selectedData.length>w.value.length?e.selectedData:w.value;w.value=t}else w.value=[]},{immediate:!0,deep:!0}),d(()=>{S(),l.value=E(),b.value=setInterval(()=>S(),1e3)}),h(()=>{const e=b.value;e&&(clearInterval(e),b.value=null)});const T=(t,i,o,l,r,c,d)=>{var u;let h="".concat(l.text||"");"header"===t&&l.timeRange&&(h="".concat(h," ").concat(l.timeRange||"")),h=Tt(h)||"",e.showDetail&&(h="");const p=(e=>{var t;const i={...e,color:"",bkColor:""};return n("div",{class:[s.em("event-popover","body")]},[n("div",{class:[s.em("event-popover","scroll")]},[(null==a?void 0:a.event)?null==(t=a.event)?void 0:t.call(a,{data:i}):n("div",{class:[s.em("event-popover","content")]},["".concat(e.text||""," ").concat(e.timeRange||"")])])])})(l);return n("div",{key:r,class:[s.em(d,"event-box")],style:i},[n("button",{class:[s.em(d,"event-content"),l.isSelectedEvent?"is-selected-event":"",l.classname],onClick:()=>{y(l,"head")},onDblclick:()=>{C(l,"head")},onContextmenu:e=>D(l,e),onMouseenter:e=>k(e,p,t),onMouseleave:z,style:o,title:h},[a[c]?null==(u=a[c])?void 0:u.call(a,{data:l}):n("div",{class:[s.em(d,"event-summary"),l.classname]},[l.icon&&n("span",{class:[l.icon,s.em(d,"event-icon")],style:{color:l.bkColor}},null),l.text&&n("span",{class:[s.em(d,"event-name")]},[l.text])]),"header"===t&&l.isSelectedEvent?n("span",{class:["fa fa-check",s.em(d,"check")]},null):""])])};return{ns:s,calendarDaily:f,renderHeader:()=>n("div",{class:[s.e("calendar-daily__head")],ref:e=>{v.value=e}},[n("div",{class:s.e("allday-info")},[ibiz.i18n.t("control.calendar.calendardaily.tip")]),n("div",{class:s.em("allday-info","work-items")},[n("div",{class:s.em("allday-info","work-items-scroll")},[n("div",{class:s.em("allday-info","work-items-body")},[g.value.length>0?g.value.map((e,t)=>{const a={background:e.bkColorFade};return T("header",{},a,e,t,"head-event","allday-info")}):n(i("iBizNoData"),{hideNoDataImage:!0},null)])])]),n("div",{class:s.e("resizable-handle"),draggable:"true",onDrag:e=>I(e),onDragstart:e=>x(e)},[n("div",{class:s.e("allday-resize-line")},null)])]),renderContent:()=>n("div",{class:[s.e("scroll-area")],onMousemove:P},[n("div",{class:s.e("time-pane")},[n("div",{class:s.em("time-pane","time-labels")},[l.value.map(e=>n("div",{key:e,class:[s.em("time-pane","time-label")]},[e]))]),n("div",{class:s.em("time-pane","time-columns")},[l.value.map((e,t)=>n("div",{key:e,class:[s.em("time-pane","time-column"),t===l.value.length-1&&s.em("time-pane","time-column-last")]},null)),n("div",{class:s.em("time-pane","event-timed-container")},[n("div",{class:s.em("time-pane","container-scroll")},[g.value.map((e,t)=>{const a={top:"".concat(e.styleTop,"px"),left:"".concat(e.styleLeft),height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"".concat(e.width),"z-index":e.zIndex};"number"==typeof e.height&&Object.assign(a,{"min-height":"".concat(e.height,"px")});const n={background:e.bkColorFade,"border-left":"3px solid ".concat(e.bkColor)};return T("content",a,n,e,t,"","time-pane")})])])]),bC(null==e?void 0:e.selectedDay,new Date)?n("div",{class:s.em("time-pane","current-time"),style:{top:"".concat(u.value,"px")}},[n("div",{class:s.em("time-pane","current-time-label")},[p.value])]):""])])}},render(){return n("div",{ref:e=>{this.calendarDaily=e},class:this.ns.b()},[this.renderHeader(),this.renderContent()])}}),HC=ie(UC,function(e){e.component(UC.name,UC)}),qC=(e,t,a)=>{const n=o([]),i=o(),s=o(1),l=o("00:00"),d=o(),u=o(),h=o(),p=r(()=>!0===e.multiple),v=o([]),b=o([]),f=o([]),w=o([]),y=o(!0);let C=0,I=0;const x=(e,t)=>{const a=new Date(e),n=new Date(t),i=[];a.setHours(0,0,0,0),n.setHours(0,0,0,0);for(let e=new Date(a);e<=n;e.setDate(e.getDate()+1))i.push(new Date(e));return i},S=(e,t,a,n,i)=>{const o={},{targetLegend:s}=e;Object.assign(o,e),Object.assign(o,{zIndex:i+1});const l=Number((100/n).toFixed(3)),r="".concat(l,"%"),c="".concat(i*l,"%");Object.assign(o,{width:r,styleLeft:c});let d="auto",u=60;const h=pC(e.beginTime,e.endTime,"YYYY-MM-DD HH:mm:ss");if(bC(e.beginTime,e.endTime)){d=D(e.beginTime,e.endTime);u=z(new Date(e.beginTime)).styleTop}else if(bC(e.beginTime,t.date)&&!bC(e.endTime,t.date)){const a=new Date(t.date);a.setHours(23,59,59,0),d=D(e.beginTime,a);u=z(new Date(e.beginTime)).styleTop}else if(bC(e.endTime,t.date)&&!bC(e.beginTime,t.date)){const a=new Date(t.date);a.setHours(0,0,0,0),d=D(a,e.endTime);u=z(new Date(a)).styleTop}else{const e=new Date(t.date),a=new Date(e.setHours(0,0,0,0)),n=new Date(e.setHours(23,59,59,59));d=D(a,n);u=z(new Date(a)).styleTop}if(Object.assign(o,{height:d,styleTop:u,timeRange:h}),!(null==e?void 0:e.bkColor)){const t=s&&s.bkcolor||mC(a,e.itemType);Object.assign(o,{bkColor:t})}if(o.bkColor){const e=gC(o.bkColor,10);Object.assign(o,{bkColorFade:e})}if(!(null==e?void 0:e.color)){const e=s&&s.color;Object.assign(o,{color:e})}if((null==o?void 0:o.height)&&(null==o?void 0:o.height)>10){const e="1px solid #FFF";Object.assign(o,{border:e})}else Object.assign(o,{border:"none"});return o},E=()=>{const t=e.events,a=null==e?void 0:e.selectedDay,n=new Map,{firstDay:i,lastDay:o}=(e=>{const t=new Date(e),a=t.getDay(),n=new Date(t);n.setDate(t.getDate()-a);const i=new Date(n);return i.setDate(n.getDate()+6),n.setHours(0,0,0,0),i.setHours(23,59,59,0),{firstDay:n,lastDay:i}})(a),s=[],l=[],r=[],c=[];w.value=[];for(let e=0;e<7;e++){const t=e,n=i.getDate()+t,o=new Date(i.getFullYear(),i.getMonth(),n),d=o.getDate(),u={date:o,day:d,caption:["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map(e=>ibiz.i18n.t("control.calendar.calendarweek.weeks.".concat(e)))[e],isActivate:bC(o,a)};w.value.push(u),s.push([]),l.push([]),r.push([]),c.push([])}t.forEach(e=>{const t=h.value.find(t=>Object.is(t.id,e.itemType));if(t&&t.isShow&&e.beginTime){const a={targetLegend:t};Object.assign(a,e);if(v.value.find(t=>t.id===e.id)?Object.assign(a,{isSelectedEvent:!0}):Object.assign(a,{isSelectedEvent:!1}),!e.endTime&&e.beginTime&&Object.assign(a,{endTime:e.beginTime}),yC(a.beginTime,i,o)&&yC(a.endTime,i,o)||yC(a.beginTime,i,o)&&!yC(a.endTime,i,o)||yC(a.endTime,i,o)&&!yC(a.beginTime,i,o)||!yC(e.endTime,i,o)&&!yC(e.beginTime,i,o)&&CC(i,e.beginTime)&&CC(e.endTime,i)){x(i,o).forEach(e=>{const t=new Date(e).getDay();l[t].push({...a})})}if(yC(a.beginTime,i,o)&&yC(a.endTime,i,o)){x(a.beginTime,a.endTime).forEach(e=>{const t=new Date(e).getDay();s[t].push(a)})}else if(yC(a.beginTime,i,o)&&!yC(a.endTime,i,o)){x(a.beginTime,o).forEach(e=>{const t=new Date(e).getDay();s[t].push(a)})}else if(yC(a.endTime,i,o)&&!yC(a.beginTime,i,o)){x(i,a.endTime).forEach(e=>{const t=new Date(e).getDay();s[t].push(a)})}else if(!yC(e.endTime,i,o)&&!yC(e.beginTime,i,o)&&CC(i,e.beginTime)&&CC(e.endTime,i)){x(i,o).forEach(e=>{const t=new Date(e).getDay();s[t].push(a)})}}}),s.forEach(e=>{e.sort((e,t)=>{const a=e,n=t,i=new Date(a.beginTime).getTime()-new Date(n.beginTime).getTime();let o;return o=0===i?new Date(a.endTime).getTime()-new Date(n.endTime).getTime():i,o})}),l.forEach(e=>{e.sort((e,t)=>{const a=e,n=t,i=new Date(a.beginTime).getTime()-new Date(n.beginTime).getTime();let o;return o=0===i?new Date(a.endTime).getTime()-new Date(n.endTime).getTime():i,o})}),s.forEach((e,t)=>{e.forEach((e,a)=>{if(e.targetLegend){const i=s[t].length,o=w.value[t];r[t].push(S(e,o,n,i,a))}})}),l.forEach((e,t)=>{e.forEach((e,a)=>{if(e.targetLegend){const l=s[t].length,r=w.value[t],d=S(e,r,n,l,a);c[t].push(((e,t,a,n,i,o,s)=>{const l={};Object.assign(l,e),Object.assign(l,{width:0,styleLeft:0});let r=0,c=0;if(yC(e.beginTime,a,n)&&yC(e.endTime,a,n)){const t=P(e.beginTime,e.endTime,a,n),i=k(e.beginTime,a,n);r="".concat(t,"%"),c="".concat(i,"%")}else if(yC(e.beginTime,a,n)&&!yC(e.endTime,a,n)){const t=P(e.beginTime,n,a,n),i=k(e.beginTime,a,n);r="".concat(t,"%"),c="".concat(i,"%")}else if(yC(e.endTime,a,n)&&!yC(e.beginTime,a,n)){const t=P(a,e.endTime,a,n);r="".concat(t,"%"),c="".concat(0,"%")}else if(!yC(e.endTime,a,n)&&!yC(e.beginTime,a,n)&&CC(a,e.beginTime)&&CC(e.endTime,a)){const e=P(a,n,a,n);r="".concat(e,"%"),c="".concat(0,"%")}Object.assign(l,{width:r,styleLeft:c});let d=!1;(yC(e.beginTime,a,n)&&bC(e.beginTime,t.date)||0===s)&&(d=!0);const u=new Date(t.date);return fC(e.beginTime,e.endTime,u)||(d=!1),Object.assign(l,{isShow:d}),l})(d,r,i,o,0,0,t))}})}),n.clear(),b.value=r,f.value=c},D=(e,t)=>{let a=1;if(bC(e,t)){const n=new Date(t).getTime()-new Date(e).getTime();a=Math.floor(n/6e4)}return a<30&&(a="auto"),a},P=(e,t,a,n)=>{let i="0";if(yC(e,a,n)&&yC(t,a,n)){const a=Number((100/24).toFixed(3));i=((new Date(t).getTime()-new Date(e).getTime())/36e5*a).toFixed(3)}return i},k=(e,t,a)=>{let n="0";if(yC(e,t,a)){n=((new Date(e).getHours()+new Date(e).getMinutes()/60)*Number((100/24).toFixed(3))).toFixed(3)}return n},z=e=>{const t=e.getHours(),a=e.getMinutes(),n=String(t).padStart(2,"0"),i=String(a).padStart(2,"0");let o,s;if(0===t&&0===a)o=1,s="00:00";else{o=60*t+a,s="".concat(n,":").concat(i)}return{styleTop:o,timeVal:s}},T=o(),A=o(0),O=o(0),M=o(!1),N=o(0),B=o(1),L=o(1),R=o(!1),_=e=>{if(M.value){const t=e.clientY-N.value;A.value+=t,N.value=e.clientY,T.value&&(T.value.scrollTop=B.value*(A.value/L.value))}e.preventDefault(),e.stopPropagation()},j=e=>{M.value=!1,e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",_),document.removeEventListener("mouseup",j)},V=()=>{B.value=0,L.value=0,R.value=!1,O.value=0,g(()=>{T.value&&(B.value=T.value.scrollHeight,L.value=T.value.clientHeight,B.value>L.value&&(R.value=!0),O.value=L.value*(L.value/B.value))})};c(()=>T.value,()=>{V()},{immediate:!0,deep:!0});const F=PC();let U=null,H="";return m(()=>{kC(F)}),{drawData:n,curTimeTimer:i,curTimeTop:s,curTimeVal:l,rows:b,resizableHand:d,calendarWeek:u,selectedData:v,weekDays:w,legends:h,rowsHeader:f,popVisible:y,headerEventRef:T,thumbHeight:O,realHeight:B,scrollTop:A,isScroll:R,handleCurTime:()=>{const{styleTop:e,timeVal:t}=z(new Date);s.value=e,l.value=t},handleDrag:e=>{const t=e.clientY-C+I;t<320&&(d.value.style.height="".concat(t,"px"))},handleDragStart:e=>{C=e.clientY,I=parseInt(window.getComputedStyle(d.value).height,10)},handleDragEnd:()=>{V()},handleEventClick:(a,n)=>{y.value=!1;const i=IC("eventClick",a,n,e.events,p.value,v.value,t),{tempSelectedData:o,isSelectedEvent:s}=i;s||Object.assign(a,{isSelectedEvent:s}),v.value=o,E()},handleEventDblClick:(a,n)=>{y.value=!1;const i=IC("eventDblClick",a,n,e.events,p.value,v.value,t),{tempSelectedData:o,isSelectedEvent:s}=i;s||Object.assign(a,{isSelectedEvent:s}),v.value=o,E()},initDrawData:()=>{const e=[];for(let t=1;t<24;t++){const a=String(t).padStart(2,"0"),n="".concat(a,":00");e.push(n)}return e},handleUIEvents:E,onScrollbarMouseDown:e=>{N.value=e.clientY,M.value=!0,e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",_),document.addEventListener("mouseup",j)},onHeaderEventScroll:e=>{var t,a,n;const i=(null==(t=e.target)?void 0:t.scrollTop)||0;B.value=null==(a=e.target)?void 0:a.scrollHeight,L.value=null==(n=e.target)?void 0:n.clientHeight;const o=i/B.value;A.value=o*L.value,O.value=L.value*(L.value/B.value)},initHeaderEventScroll:V,eventContextmenu:async(e,a)=>{t("eventContextmenu",{evt:a,data:[e]})},contentMousemove:e=>{"content"===H&&U&&F&&DC(e,F)},eventMouseenter:(t,n,i)=>{if(!e.showDetail||U)return;const o="content"===i;H=i,U=EC(n,o?F:t.target,{placement:o?"right-start":"bottom",modalClass:a.e("event-popover")})},eventMouseleave:e=>{null==U||U.dismiss(),U=null,H=""}}},GC=a({name:"CalendarWeek",props:jC,emits:VC,setup(e,{emit:t,slots:a}){const i=B("calendar-week"),{drawData:o,resizableHand:s,rows:l,weekDays:r,curTimeTimer:u,calendarWeek:p,selectedData:m,legends:v,rowsHeader:g,headerEventRef:b,thumbHeight:f,scrollTop:w,realHeight:y,isScroll:C,handleEventClick:I,handleEventDblClick:x,handleDrag:S,handleDragStart:E,handleDragEnd:D,handleCurTime:P,initDrawData:k,handleUIEvents:z,onScrollbarMouseDown:T,onHeaderEventScroll:A,initHeaderEventScroll:O,eventContextmenu:M,contentMousemove:N,eventMouseenter:L,eventMouseleave:R}=qC(e,t,i);c(()=>e.selectedData,()=>{if(e.selectedData&&e.selectedData.length>0){const t=e.selectedData.length>m.value.length?e.selectedData:m.value;m.value=t}else m.value=[]},{immediate:!0,deep:!0}),c(()=>e.legends,()=>{v.value=e.legends||[],z()},{immediate:!0,deep:!0}),c(()=>e.events,()=>{z(),O()},{immediate:!0,deep:!0}),d(()=>{P(),o.value=k(),u.value=setInterval(()=>P(),1e3)}),h(()=>{const e=u.value;e&&(clearInterval(e),u.value=null)});const _=(t,o,s,l,r,c,d)=>{var u;let h="".concat(l.text||"");"header"===t&&l.timeRange&&(h="".concat(h," ").concat(l.timeRange||"")),h=Tt(h)||"",e.showDetail&&(h="");const p=(e=>{var t;const o={...e,color:"",bkColor:""};return n("div",{class:[i.em("event-popover","body")]},[n("div",{class:[i.em("event-popover","scroll")]},[(null==a?void 0:a.event)?null==(t=a.event)?void 0:t.call(a,{data:o}):n("div",{class:[i.em("event-popover","content")]},["".concat(e.text||""," ").concat(e.timeRange||"")])])])})(l);return n("div",{key:r,class:[i.em(d,"event-box")],style:o},[n("button",{class:[i.em(d,"event-content"),i.is("selected-event",!!l.isSelectedEvent),l.classname],onClick:()=>{I(l,"head")},onDblclick:()=>{x(l,"head")},onContextmenu:e=>M(l,e),onMouseenter:e=>L(e,p,t),onMouseleave:R,style:s,title:h},[a[c]?null==(u=a[c])?void 0:u.call(a,{data:l}):n("div",{class:[i.em(d,"event-summary"),l.classname]},[l.icon&&n("span",{class:[l.icon,i.em(d,"event-icon")],style:{color:l.bkColor}},null),l.text&&n("span",{class:[i.em(d,"event-name")]},[l.text])]),"header"===t&&l.isSelectedEvent?n("span",{class:["fa fa-check",i.em(d,"check")]},null):""])])};return{ns:i,thumbHeight:f,calendarWeek:p,scrollTop:w,realHeight:y,headerEventRef:b,renderHeader:()=>n("div",{class:[i.e("header")],ref:e=>{s.value=e}},[n("div",{class:[i.em("header","dates")]},[n("div",{class:[i.em("header","date-cell-first")]},null),r.value.map(e=>n("div",{class:[i.em("header","date-cell")]},[n("div",{class:[i.em("header","date-week")]},[e.caption]),n("div",{class:[i.em("header","date-day"),e.isActivate?"is-today":""]},[e.day])]))]),n("div",{class:[i.em("header","events")]},[n("div",{class:[i.em("header","event-cell-first")]},[ibiz.i18n.t("control.calendar.calendardaily.tip")]),n("div",{class:i.em("header","event-container"),ref:e=>{b.value=e},onScroll:A},[n("div",{class:i.em("header","container-scroll")},[g.value.map(e=>n("div",{class:[i.em("header","event-cell")]},[e.map((e,t)=>{const a={top:"".concat(Number(26*t)+2,"px"),left:"".concat(e.styleLeft),width:"".concat(null==e?void 0:e.width)},n={background:e.bkColorFade};return e.isShow?_("header",a,n,e,t,"head-event","header"):""})]))]),C.value&&n("div",{class:i.b("scroll-bar")},[n("div",{class:i.be("scroll-bar","thumb"),onMousedown:T},null)])])]),n("div",{class:i.em("header","resizable-handle"),draggable:"true",onDrag:e=>S(e),onDragstart:e=>E(e),onDragend:()=>D()},[n("div",{class:i.em("header","resize-line")},null)])]),renderContent:()=>n("div",{class:[i.e("scroll-area")],onMousemove:N},[n("div",{class:i.e("time-pane")},[n("div",{class:i.em("time-pane","time-labels")},[o.value.map(e=>n("div",{key:e,class:[i.em("time-pane","time-label")]},[e]))]),l.value.map(e=>n("div",{class:i.em("time-pane","time-columns")},[o.value.map((e,t)=>n("div",{key:e,class:[i.em("time-pane","time-column"),t===o.value.length-1&&i.em("time-pane","time-column-last")]},null)),n("div",{class:i.em("time-pane","event-timed-container")},[n("div",{class:i.em("time-pane","container-scroll")},[e.map((e,t)=>{const a={top:"".concat(e.styleTop,"px"),left:"".concat(e.styleLeft),height:"number"==typeof e.height?"".concat(e.height,"px"):e.height,width:"".concat(e.width),"min-height":"".concat(e.height&&e.height>30?e.height:30,"px"),"z-index":e.zIndex};"number"==typeof e.height&&Object.assign(a,{"min-height":"".concat(e.height,"px")});const n={background:e.bkColorFade,"border-left":"3px solid ".concat(e.bkColor)};return _("content",a,n,e,t,"","time-pane")})])])]))])])}},render(){return n("div",{ref:e=>{this.calendarWeek=e},class:this.ns.b(),style:{["".concat(this.ns.cssVarBlockName("header-event-scroll-bar-thumb-height"))]:"".concat(this.thumbHeight,"px"),["".concat(this.ns.cssVarBlockName("header-event-scroll-bar-thumb-top"))]:"".concat(this.scrollTop,"px"),["".concat(this.ns.cssVarBlockName("header-event-scroll-real-height"))]:"".concat(this.realHeight,"px")}},[this.renderHeader(),this.renderContent()])}}),WC=ie(GC,function(e){e.component(GC.name,GC)});const YC=a({name:"CalendarUser",props:FC,emits:{eventClick:e=>e,eventDblClick:e=>e},setup(e,{emit:t,slots:a}){const s=B("calendar-user"),l=o([]),r=o([]);r.value=function(){const e=[];for(let t=0;t<24;t++)e.push({time:t,text:"".concat(t,":00")});return e}();const d=o(""),u=o(),h=o(),m=o(0),v=o(0),g=o(!1),b=o(0),f=o(1),w=o(1),y=o(!1);c(()=>e.selectedDay,()=>{e.selectedDay&&(l.value=function(e){const t=[],a=e.getDay();let n;if(0===a){const t=e.getTime()-5184e5;n=new Date(t)}else{const t=e.getTime()-24*(a-1)*60*60*1e3;n=new Date(t)}const i=[ibiz.i18n.t("control.calendar.calendarUser.weeks.monday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.tuesday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.wednesday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.thursday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.friday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.saturday"),ibiz.i18n.t("control.calendar.calendarUser.weeks.sunday")];for(let e=0;e<7;e++){const a=24*e*60*60*1e3;t.push({text:i[e],date:as(new Date(n.getTime()+a)).format("MM/DD")})}return t}(new Date(e.selectedDay)))},{immediate:!0,deep:!0});const C=()=>{t("eventClick",{data:[]})},I=(t,o)=>{const l=function(e,t,a){const n=e.filter(e=>as(new Date(e.beginTime)).format("MM/DD")===t.date)||[];return a?n.filter(e=>new Date(e.beginTime).getHours()===a.time):n}(e.events,t,o);return 0===(r=l).length?n("div",{class:s.e("black"),onClick:C},null):r.length>1?[null==(c=a.event)?void 0:c.call(a,{data:r[0]}),n(i("el-popover"),{"popper-class":s.e("custom-user-popover"),trigger:"click",ref:e=>{e&&r[0].id===d.value&&(u.value=e)},onShow:()=>{d.value=r[0].id}},{reference:()=>n("span",{class:s.b("more")},["+".concat(r.length-1," ").concat(ibiz.i18n.t("app.more"),"...")]),default:()=>r.map(e=>{var t;return null==(t=a.event)?void 0:t.call(a,{data:e})})})]:r.map(e=>{var t;return null==(t=a.event)?void 0:t.call(a,{data:e})});var r,c},x=e=>{if(g.value){const t=e.clientY-b.value;m.value+=t,b.value=e.clientY,h.value&&(h.value.scrollTop=f.value*(m.value/w.value))}e.preventDefault(),e.stopPropagation()},S=e=>{g.value=!1,e.preventDefault(),e.stopPropagation(),document.removeEventListener("mousemove",x),document.removeEventListener("mouseup",S)},E=e=>{b.value=e.clientY,g.value=!0,e.preventDefault(),e.stopPropagation(),document.addEventListener("mousemove",x),document.addEventListener("mouseup",S)},D=e=>{var t,a,n;const i=(null==(t=e.target)?void 0:t.scrollTop)||0;f.value=null==(a=e.target)?void 0:a.scrollHeight,w.value=null==(n=e.target)?void 0:n.clientHeight;const o=i/f.value;m.value=o*w.value};return c(()=>h.value,()=>{h.value&&(f.value=h.value.scrollHeight,w.value=h.value.clientHeight,f.value>w.value&&(y.value=!0),v.value=w.value*(w.value/f.value))},{immediate:!0,deep:!0}),{ns:s,renderWeekHeader:()=>n("div",{class:s.b("header")},[n("div",{class:s.be("header","time-item")},[n("div",{class:[s.e("cell"),s.be("header","time-text"),s.be("header","top")]},null),l.value.map(e=>n("div",{class:[s.be("header","week-day"),s.e("cell"),s.be("header","top")]},[e.text,e.date]))]),n("div",{class:s.be("header","time-item")},[n("div",{class:[s.e("cell"),s.be("header","time-text")]},[p("全天")]),l.value.map(e=>n("div",{class:[s.be("header","week-item"),s.e("cell")]},[I(e)]))])]),renderWeekContent:()=>n("div",{class:s.b("content"),style:{["--".concat(s.namespace,"-calendar-user-scroll-bar-thumb-height")]:"".concat(v.value,"px"),["--".concat(s.namespace,"-calendar-user-scroll-bar-thumb-top")]:"".concat(m.value,"px")}},[n("div",{class:s.be("content","wrapping"),ref:e=>{h.value=e},onScroll:D},[r.value.map(e=>n("div",{class:s.be("content","time-item")},[n("div",{class:[s.be("content","time-text"),s.e("cell")]},[e.text]),l.value.map(t=>n("div",{class:[s.be("content","week-item"),s.e("cell")]},[I(t,e)]))]))]),y.value&&n("div",{class:s.b("scroll-bar")},[n("div",{class:s.be("scroll-bar","thumb"),onMousedown:E},null)])])}},render(){return n("div",{class:this.ns.b()},[this.renderWeekHeader(),this.renderWeekContent()])}}),KC=ie(YC,function(e){e.component(YC.name,YC)});const XC=a({name:"CustomCalendar",props:BC,emits:LC,setup(e,{emit:t,slots:a}){const s=B("custom-calendar"),{date:l,events:d,shortcuts:u,viewType:h,validatedRange:p,realSelectedDay:m,curWeek:v,legends:g,multiple:b,selectedData:f,pickDay:w,handleEVentClick:y,handleEVentDblClick:C,handleEventContextmenu:I,selectDate:x,selectLegend:S}=((e,t)=>{const{lang:a}=Eo(),n=o(),i=as().locale(a.value),s=o(),l=r(()=>e.viewType),d=o([]),u=new Map,h=r(()=>!0===e.multiple),p=r(()=>e.selectedData);c(()=>e.legends,t=>{const a=[];t&&e.legends.forEach(e=>{const t={};if(Object.assign(t,e),Object.assign(t,{isShow:!0}),e&&!e.bkcolor){const a=mC(u,e.id);Object.assign(t,{bkcolor:a})}a.push(t)}),d.value=a},{immediate:!0,deep:!0});const m=(e,t)=>{const a=e.startOf("week"),n=t.endOf("week"),i=a.get("month"),o=n.get("month");let s;return s=i===o?[[a,n]]:(i+1)%12===o?((e,t)=>{const a=e.endOf("month"),n=t.startOf("month"),i=a.isSame(n,"week");return[[e,a],[(i?n.add(1,"week"):n).startOf("week"),t]]})(a,n):i+2===o||(i+1)%11===o?((e,t)=>{const a=e.endOf("month"),n=e.add(1,"month").startOf("month"),i=a.isSame(n,"week")?n.add(1,"week"):n,o=i.endOf("month"),s=t.startOf("month"),l=o.isSame(s,"week")?s.add(1,"week"):s;return[[e,a],[i.startOf("week"),o],[l.startOf("week"),t]]})(a,n):[],s},v=r(()=>{if(!e.range)return[];let t=[];const n=e.range.map(e=>as(e).locale(a.value)),[i,o]=n;return i.isAfter(o)&&(t=[]),i.isSame(o,"month")||i.add(1,"month").month()!==o.month()&&(t=[]),t=m(i,o),t}),g=r(()=>{let t;return t=e.modelValue?as(e.modelValue).locale(a.value):s.value||(v.value.length?v.value[0][0]:i),t}),b=r({get(){let t=g.value;return e.modelValue||(t=n.value),s.value=t,t},set(e){if(!e)return;const a=as(e);n.value=a;const i=a.toDate();t(AC,i),t(TC,i),t(zC,i)}}),f=r(()=>{if(e.events.length>0)return e.events.map(e=>{const t={};return Object.assign(t,e),Object.assign(t,{deData:e.deData,beginTime:e.beginTime,endTime:e.endTime,id:e.id,classname:e.classname,text:e.text,content:e.content,tips:e.tips,icon:e.icon,color:e.color,bkColor:e.bkColor,itemType:e.itemType}),t})}),w=r(()=>g.value.subtract(1,"month").date(1)),y=r(()=>g.value.add(1,"month").date(1)),C=r(()=>g.value.subtract(1,"year").date(1)),I=r(()=>g.value.add(1,"year").date(1)),x=e=>{b.value=e},S=r(()=>{const e="".concat(g.value.format("M"));return"".concat(g.value.year()," ").concat(ibiz.i18n.t("control.calendar.year")," ").concat(e," ").concat(ibiz.i18n.t("control.calendar.month"))}),E=[{text:ibiz.i18n.t("control.calendar.today"),value:new Date},{text:ibiz.i18n.t("control.calendar.calendardaily.tomorrow"),value:()=>{const e=new Date;return e.setTime(e.getTime()+864e5),e}},{text:ibiz.i18n.t("control.calendar.calendardaily.nextweek"),value:()=>{const e=new Date;return e.setTime(e.getTime()+6048e5),e}}],D=r(()=>{let e="";if(b.value){const t=b.value.day();e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].map(e=>ibiz.i18n.t("control.calendar.calendardaily.weeks.".concat(e)))[t]}return e});return{date:g,viewType:l,i18nDate:S,events:f,shortcuts:E,validatedRange:v,realSelectedDay:b,curWeek:D,legends:d,multiple:h,selectedData:p,calculateValidatedDateRange:m,pickDay:x,selectDate:e=>{const t={"prev-month":w.value,"next-month":y.value,"prev-year":C.value,"next-year":I.value,today:i}[e];t.isSame(g.value,"day")||x(t)},handleEVentClick:e=>{t("eventClick",e)},handleEVentDblClick:e=>{t("eventDblClick",e)},handleEventContextmenu:e=>{t("eventContextmenu",e)},selectLegend:e=>{const t=d.value.find(t=>e.id===t.id);t&&Object.assign(t,{isShow:!e.isShow})}}})(e,t),E=()=>{const e=function(e){let t,a;const n=e.getDay();return 0===n?(t=as(new Date(e.getTime()-5184e5)).format("YYYY-MM-DD"),a=as(e).format("YYYY-MM-DD")):(t=as(new Date(e.getTime()-864e5*(n-1))).format("YYYY-MM-DD"),a=as(new Date(e.getTime()+864e5*(7-n))).format("YYYY-MM-DD")),[t,a]}(new Date(m.value));return n("div",{class:[s.e("calendar-user")]},[n("div",{class:[s.e("calendar-user-header")]},[n("div",{class:s.em("calendar-user-header","left")},[e.map(e=>as(new Date(e)).format("YYYY-MM-DD")).join(" ~ ")]),n("div",{class:s.em("calendar-user-header","right")},[n(i("el-date-picker"),{type:"week",clearable:!1,"popper-class":s.em("calendar-user-header","date-picker"),modelValue:m.value,"onUpdate:modelValue":e=>m.value=e,class:s.em("calendar-user-header","date-range"),placeholder:ibiz.i18n.t("control.calendar.calendarUser.selectWeekRange"),format:ibiz.i18n.t("control.calendar.calendarUser.weekFormat")},null)])]),n(KC,{"selected-day":m.value,events:d.value,onEventClick:e=>y(e),onEventDblClick:e=>C(e)},a)])};return{ns:s,date:l,validatedRange:p,pickDay:w,selectDate:x,renderContent:()=>{switch(h.value){case"DAY":return n("div",{class:[s.e("calendar-week")]},[(null==a?void 0:a.header)?n("div",{class:[s.em("calendar-month","header")]},[null==(t=null==a?void 0:a.header)?void 0:t.call(a,{date:as(m.value).format("YYYY-MM-DD"),legends:g.value})]):n("div",{class:[s.em("calendar-week","header")]},[n("div",{class:s.em("calendar-week","header-top")},[n("div",{class:s.em("calendar-week","title")},[e.calendarTitle||ibiz.i18n.t("control.calendar.title")]),n("div",{class:s.em("calendar-week","legend")},[g.value.length>1&&g.value.map(e=>n("div",{class:s.em("calendar-week","legend-item"),onClick:()=>S(e)},[n("div",{class:s.em("calendar-week","legend-item-tip"),style:{background:e.isShow?e.bkcolor:"var(".concat(s.cssVarName("color-disabled-bg"),")")}},null),n("div",{class:s.em("calendar-week","legend-item-text"),title:Tt(e.name)},[e.name])]))]),n("div",{class:s.em("calendar-week","select-time")},[n(i("el-date-picker"),{modelValue:m.value,"onUpdate:modelValue":e=>m.value=e,type:"date",placeholder:ibiz.i18n.t("control.calendar.calendardaily.selectdate"),shortcuts:u},null)])]),n("div",{class:s.em("calendar-week","text-secondary")},[v.value])]),n(HC,{"selected-day":m.value,controller:e.controller,showDetail:e.showDetail,events:d.value,legends:g.value,multiple:b.value,selectedData:f.value,onEventClick:e=>y(e),onEventDblClick:e=>C(e),onEventContextmenu:e=>I(e)},a)]);case"WEEK":return(()=>{var t;return n("div",{class:[s.e("calendar-week")]},[(null==a?void 0:a.header)?n("div",{class:[s.em("calendar-month","header")]},[null==(t=null==a?void 0:a.header)?void 0:t.call(a,{date:as(m.value).format("YYYY-MM-DD"),legends:g.value})]):n("div",{class:[s.em("calendar-week","header")]},[n("div",{class:s.em("calendar-week","header-top")},[n("div",{class:s.em("calendar-week","title")},[e.calendarTitle||ibiz.i18n.t("control.calendar.title")]),n("div",{class:s.em("calendar-week","legend")},[g.value.length>1&&g.value.map(e=>n("div",{class:s.em("calendar-week","legend-item"),onClick:()=>S(e)},[n("div",{class:s.em("calendar-week","legend-item-tip"),style:{background:e.isShow?e.bkcolor:"var(".concat(s.cssVarName("color-disabled-bg"),")")}},null),n("div",{class:s.em("calendar-week","legend-item-text"),title:Tt(e.name)},[e.name])]))]),n("div",{class:s.em("calendar-week","select-time")},[n(i("el-date-picker"),{modelValue:m.value,"onUpdate:modelValue":e=>m.value=e,type:"date",placeholder:"选择日期",shortcuts:u},null)])])]),n(WC,{"selected-day":m.value,showDetail:e.showDetail,events:d.value,legends:g.value,multiple:b.value,selectedData:f.value,onEventClick:e=>y(e),onEventDblClick:e=>C(e),onEventContextmenu:e=>I(e)},a)])})();case"USER":return E();default:return null}var t}}},render(){return n("div",{class:[this.ns.b()]},[this.renderContent()])}}),$C=ie(XC,function(e){e.component(XC.name,XC)}),JC=e=>{const{date:t,beginTime:a,endTime:n,unit:i="day"}=e;return!!(a&&as(t).isSame(a,i)||n&&as(t).isSame(n,i)||a&&n&&as(t).isAfter(a,i)&&as(t).isBefore(n,i))};function QC(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const ZC=a({name:"IBizCalendarControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},isSimple:{type:Boolean,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new li(...e)),a=B("control-".concat(e.model.controlType.toLowerCase())),{UIStore:s}=G(),{getFontColor:l,getBkColor:d,getActBdrColors:u}=function(e){const t=e=>{const t=document.documentElement;return getComputedStyle(t).getPropertyValue(e)},a=[t("".concat(e.cssVarName("color-primary"))),"#2196F3","#4CAF50","#3F51B5","#FF9800","#673AB7","#757575"],n=a.map(()=>t("".concat(e.cssVarName("color-black"))));return{getFontColor:()=>t("".concat(e.cssVarName("color-primary-text"))),getBkColor:e=>a[e]||a[0],getActBdrColors:a=>n[a]||t("".concat(e.cssVarName("color-primary")))}}(a),h=o(),p=o(),m=o("daterange"===e.controlParams.showmode),v=o("expand"===e.controlParams.showmode),g=o(),b=r(()=>{if("TIMELINE"!==e.model.calendarStyle||e.state.isLoading)return!0;return!Object.values(e.loadMoreItems).some(e=>e.curPage<e.totalPage)}),f=o([]),w=["DAY","WEEK","MONTH"],y=()=>{f.value=e.state.legends.map((t,a)=>{const n={...t,isShow:!0};return e.model.calendarStyle&&w.includes(e.model.calendarStyle)?(t.bkcolor||Object.assign(n,{bkcolor:d(a),actBdrColor:u(a)}),t.color||Object.assign(n,{color:l()}),n):n})};c(()=>e.state.legends,()=>{y()},{deep:!0}),c(()=>s.theme,()=>{y()});const C=o("");e.evt.on("onActive",()=>{p.value&&(p.value.hide(),p.value=void 0)});const I=e=>{const t=e.getDay();let a;return a=0===t?e.getTime()-5184e5:e.getTime()-24*(t-1)*60*60*1e3,as(new Date(a)).format("YYYY-MM-DD")};c(()=>e.state.selectedDate,(t,a)=>{((t,a)=>{if("WEEK"===e.model.calendarStyle||"USER"===e.model.calendarStyle)return I(t)===I(a);if("DAY"===e.model.calendarStyle)return as(t).format("YYYY-MM-DD")===as(a).format("YYYY-MM-DD");if("MONTH"===e.model.calendarStyle)return as(a).format("YYYY-MM")===as(t).format("YYYY-MM");return"TIMELINE"===e.model.calendarStyle&&as(t).isSame(as(a),"millisecond")})(t,a)||e.load()});let x;const S=i("IBizRawItem"),E=i("IBizIcon");e.evt.on("onMounted",()=>{if(Object.values(e.contextMenus).length>0){(()=>t.import("@imengyu/vue3-context-menu"))().then(e=>{x=e.default,x.default&&!x.showContextMenu&&(x=x.default)})}});const D=(t,a,i,o)=>{const s=[];return t.forEach(t=>{var l,r;if("SEPERATOR"===t.itemType)return void s.push({divided:"self"});const c=o[t.id];if(c&&!c.visible)return;let d={};if(t.showCaption&&t.caption&&(d.label=t.caption),t.sysImage&&t.showIcon&&(d.icon=n(E,{icon:t.sysImage},null)),"DEUIACTION"===t.itemType){d.disabled=c.disabled,d.clickClose=!0;const{uiactionId:n}=t;n&&(d.onClick=()=>{e.doUIAction(n,a,i,t.appId)})}else if("RAWITEM"===t.itemType){const{rawItem:e}=t;e&&(d.label=n(S,{rawItem:t},null))}else if("ITEMS"===t.itemType){const c=t;if((null==(l=c.detoolbarItems)?void 0:l.length)&&(d.children=D(c.detoolbarItems,a,i,o)),c.uiactionGroup&&c.groupExtractMode){const t=null==(r=c.uiactionGroup.uiactionGroupDetails)?void 0:r.filter(e=>o[e.id].visible).map(t=>{const s=o[t.id],{sysImage:l}=t;return{label:t.showCaption?t.caption:void 0,icon:t.showIcon?n(E,{icon:l},null):void 0,disabled:s.disabled,clickableWhenHasChildren:!0,onClick:()=>{x.closeContextMenu(),e.doUIAction(t.uiactionId,a,i,t.appId)}}});switch(c.groupExtractMode){case"ITEMS":d.children=t;break;case"ITEMX":t&&(d=t[0],d.children=t.slice(1));break;default:d=void 0,t&&s.push(...t)}}}d&&s.push(d)}),s};return{c:e,ns:a,curPopover:p,calendarRef:h,legendItems:f,popoverValue:C,showDateList:v,showDateRange:m,infiniteScroll:g,disabledLodeMore:b,selectDate:e=>{h.value&&h.value.selectDate(e)},calcItemStyle:e=>{const t=f.value.find(t=>t.id===e.itemType);return{color:e.color,backgroundColor:e.bkColor,["".concat(a.cssVarBlockName("item-color"))]:e.color,["".concat(a.cssVarBlockName("item-active-border-color"))]:null==t?void 0:t.actBdrColor}},handleScrollLoad:async()=>{if(!g.value||b.value)return;const t=g.value.scrollTop;g.value.scrollHeight-t-g.value.clientHeight<10&&await e.load({isLoadMore:!0})},monthLegendClick:e=>{Object.assign(e,{isShow:!e.isShow})},calcCalendarItems:t=>{const a=(e=>{const t=as(e),a=t.startOf("week"),n=t.endOf("week"),i=[];let o=a;for(;o.isBefore(n)||o.isSame(n,"day");)i.push(o),o=o.add(1,"day");return i})(t),n=e.state.items.filter(e=>{const n=f.value.find(t=>t.id===e.itemType);return!(n&&!n.isShow)&&(m.value?a.some(t=>JC({beginTime:e.beginTime,endTime:e.endTime,date:t})):as(t).isSame(e.beginTime,"day"))});return m.value&&n.sort((e,t)=>{let a=0;return a=as(e.beginTime).isSame(t.beginTime,"day")?as(e.endTime).isAfter(t.endTime)?-1:1:as(e.beginTime).isAfter(t.beginTime)?1:-1,a}),n.map(e=>{const t=f.value.find(t=>Object.is(t.id,e.itemType));return t?(e.bkColor||Object.assign(e,{bkColor:t.bkcolor}),e.color||Object.assign(e,{color:t.color}),e):e})},onNodeContextmenu:async(t,n)=>{n.preventDefault(),n.stopPropagation();const{sysCalendarItems:i}=e.model,o=null==i?void 0:i.find(e=>e.id===t.itemType);if(!(null==o?void 0:o.decontextMenu))return;const s=e.contextMenus[o.decontextMenu.id];if(!s.model.detoolbarItems)return;await s.calcButtonState(t.deData||(t.deData?t:void 0),o.appDataEntityId,{view:e.view,ctrl:e});const l=s.state.buttonsState,r=D(s.model.detoolbarItems,t,n,l);r.length&&x.showContextMenu({x:n.x,y:n.y,customClass:a.b("context-menu"),items:r,zIndex:9999})}}},render(){const e=(e,t,a)=>{const{context:o,params:s}=this.c,l=this.c.state.selectedData.findIndex(t=>t.deData.srfkey===e.deData.srfkey),r=[this.ns.b("item"),this.ns.is("active",-1!==l),this.ns.is("begin-time",a&&as(a).isSame(e.beginTime,"day")),this.ns.is("hidden",this.showDateRange&&!JC({beginTime:e.beginTime,endTime:e.endTime,date:a})),this.ns.is("no-begin-time",this.showDateRange&&!e.beginTime),this.ns.is("no-end-time",this.showDateRange&&!e.endTime),this.ns.is("end-time",a&&as(a).isSame(e.endTime,"day"))],c=this.calcItemStyle(e);return n(i("iBizControlShell"),{class:r,data:e.deData,modelData:t,context:o,params:s,style:c,onClick:t=>(t.stopPropagation(),this.c.onRowClick(e)),onDblclick:t=>(t.stopPropagation(),this.c.onDbRowClick(e)),onContextmenu:t=>this.onNodeContextmenu(e,t)},null)},t=(e,t)=>{const a=this.c.state.selectedData.findIndex(t=>t.deData.srfkey===e.deData.srfkey),i=[this.ns.b("item"),this.ns.be("item","default"),this.ns.is("active",-1!==a),this.ns.is("begin-time",t&&as(t).isSame(e.beginTime,"day")),this.ns.is("hidden",this.showDateRange&&!JC({beginTime:e.beginTime,endTime:e.endTime,date:t})),this.ns.is("no-begin-time",this.showDateRange&&!e.beginTime),this.ns.is("no-end-time",this.showDateRange&&!e.endTime),this.ns.is("end-time",t&&as(t).isSame(e.endTime,"day"))],o=this.calcItemStyle(e);return n("div",{class:i,key:e.deData.srfkey,style:o,title:Tt(e.tips||e.text),onClick:()=>this.c.onRowClick(e),onDblclick:()=>this.c.onDbRowClick(e),onContextmenu:t=>this.onNodeContextmenu(e,t)},[this.showDateRange?t&&(as(t).isSame(e.beginTime,"day")||0===as(t).day()||!e.beginTime&&as(t).isSame(e.endTime,"day"))?e.text:"":e.text])},a=(a,n)=>{var i;const o=(null==(i=this.c.model.sysCalendarItems)?void 0:i.find(e=>a.itemType===e.itemType)).layoutPanel;return o?e(a,o,n):t(a,n)},o=(e,t)=>e.length>1&&!this.showDateRange&&!this.showDateList?[a(e[0],t),n(i("el-popover"),{trigger:"click",ref:t=>{t&&e[0].id===this.popoverValue&&(this.curPopover=t)},onShow:()=>{this.popoverValue=e[0].id}},{reference:()=>n("span",{class:this.ns.b("more")},["+".concat(e.length-1," ").concat(ibiz.i18n.t("app.more"),"...")]),default:()=>e.map(e=>a(e,t))})]:e.map(e=>a(e,t)),s=e=>{const t=this.calcCalendarItems(e);return o(t,e)},l=()=>n("div",{class:[this.ns.b("content"),this.ns.is("show-date-range",this.showDateRange)]},[n(i("el-calendar"),{modelValue:this.c.state.selectedDate,"onUpdate:modelValue":e=>this.c.state.selectedDate=e,ref:"calendarRef"},{header:({date:e})=>{let t,a,o,s,l;return[n("span",{class:this.ns.b("content-title")},[e]),n("div",{class:this.ns.b("legend")},[this.legendItems&&this.legendItems.length>1&&this.legendItems.map(e=>{var t;let a=e.name;const i=null==(t=this.c.model.sysCalendarItems)?void 0:t.find(t=>t.id===e.id);return(null==i?void 0:i.nameLanguageRes)&&(a=ibiz.i18n.t(i.nameLanguageRes.lanResTag,i.name)),n("div",{class:[this.ns.be("legend","item")],onClick:()=>this.monthLegendClick(e)},[n("div",{class:this.ns.bem("legend","item","tip"),style:{background:e.isShow?null==e?void 0:e.bkcolor:"var(".concat(this.ns.cssVarName("color-disabled-bg"),")"),color:null==e?void 0:e.color}},null),n("div",{class:this.ns.bem("legend","item","text")},[a])])})]),n("div",{class:this.ns.b("content-header")},[n(i("el-date-picker"),{modelValue:this.c.state.selectedDate,"onUpdate:modelValue":e=>this.c.state.selectedDate=e,type:"month"},null),n(i("el-button-group"),null,{default:()=>[n(i("el-button"),{onClick:()=>{this.selectDate("prev-year")}},QC(t=ibiz.i18n.t("control.calendar.lastYear"))?t:{default:()=>[t]}),n(i("el-button"),{onClick:()=>{this.selectDate("prev-month")}},QC(a=ibiz.i18n.t("control.calendar.lastMonth"))?a:{default:()=>[a]}),n(i("el-button"),{onClick:()=>{this.selectDate("today")}},QC(o=ibiz.i18n.t("control.calendar.today"))?o:{default:()=>[o]}),n(i("el-button"),{onClick:()=>{this.selectDate("next-month")}},QC(s=ibiz.i18n.t("control.calendar.nextMonth"))?s:{default:()=>[s]}),n(i("el-button"),{onClick:()=>{this.selectDate("next-year")}},QC(l=ibiz.i18n.t("control.calendar.nextYear"))?l:{default:()=>[l]})]})])]},"date-cell":({data:e})=>{const{date:t}=e;return n("div",{class:this.ns.b("day")},[n("p",{class:this.ns.b("date-text")},[t.getDate()]),n("div",{class:this.ns.b("items")},[s(t)])])}})]),r=()=>{const{isLoaded:e}=this.c.state,t={};return ce(this.c)&&Object.assign(t,{customRender:()=>n(de,{controller:this.c},null)}),e&&n(i("iBizNoData"),{text:this.c.model.emptyText,emptyTextLanguageRes:this.c.model.emptyTextLanguageRes,hideNoDataImage:this.c.state.hideNoDataImage},QC(t)?t:{default:()=>[t]})},c=()=>{const a={},{sysCalendarItems:i}=this.c.model;return a.event=({data:a})=>{const n=null==i?void 0:i.find(e=>e.id===a.itemType);return n&&n.layoutPanel?e(a,n.layoutPanel):t(a)},n("div",{class:this.ns.b("content")},[n($C,{modelValue:this.c.state.selectedDate,"onUpdate:modelValue":e=>this.c.state.selectedDate=e,showDetail:this.c.state.showDetail,calendarTitle:this.c.state.calendarTitle,ref:"calendarRef",viewType:this.c.model.calendarStyle,events:this.c.state.items,legends:this.legendItems,multiple:!this.c.state.singleSelect,selectedData:this.c.state.selectedData,onEventClick:e=>{const{data:t}=e,a=t[0];a&&this.c.onRowClick(a)},onEventDblClick:e=>{const{data:t}=e,a=t[0];a&&this.c.onDbRowClick(a)},onEventContextmenu:e=>{const{data:t,evt:a}=e,n=t[0];n&&a&&this.onNodeContextmenu(n,a)}},QC(a)?a:{default:()=>[a]})])},d=()=>n("div",{ref:"infiniteScroll",class:this.ns.b("timeline-content"),onScroll:_o(this.handleScrollLoad,300)},[n(i("el-timeline"),null,{default:()=>[this.c.state.items.length>0?this.c.state.items.map(a=>{var o;const s=null==(o=this.c.model.sysCalendarItems)?void 0:o.find(e=>a.itemType===e.itemType),l=a[this.c.groupTimeField],r=l?as(l).format(this.c.timelineCaptionFormat):l;return n(i("el-timeline-item"),{key:a.id,placement:"top",color:a.bkColor,timestamp:r},{default:()=>[(null==s?void 0:s.layoutPanel)?e(a,s.layoutPanel):t(a)]})}):r()]})]),u=()=>{switch(this.c.model.calendarStyle){case"TIMELINE":return d();case"WEEK":case"DAY":case"USER":return c();default:return l()}};return n(i("iBizControlNavigation"),{controller:this.c},{default:()=>{var e;return[n(i("iBizControlBase"),{controller:this.c,class:this.ns.e(null==(e=this.c.model.calendarStyle)?void 0:e.toLowerCase())},{default:()=>[u(),this.c.state.enableNavView&&this.c.state.showNavIcon?this.c.state.showNavView?n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.hiddenNav"),name:"eye-off-outline",onClick:()=>this.c.onShowNavViewChange()},null):n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.showNav"),name:"eye-outline",onClick:()=>this.c.onShowNavViewChange()},null):null]})]}})}});var eI=Object.defineProperty,tI=(e,t,a)=>(((e,t,a)=>{t in e?eI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class aI{constructor(){tI(this,"component","IBizCalendarControl")}}const nI=e("aw",ie(ZC,function(e){e.use($C),e.component(ZC.name,ZC),Ha(qa.CALENDAR,()=>new aI)}));function iI(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const oI=a({name:"IBizSwimlaneKanban",components:{draggable:is},props:{controller:{type:Object,required:!0}},setup(e){var t,a;const s=B("swimlane-kanban"),l=e.controller,{zIndex:c}=G(),u=o(!1),h={zIndex:c.increment()},v=o(!0),g=o(),b=o();let f=Ut;d(()=>{f=Nt(window,"resize",()=>{u.value=l.getFullscreen()})}),m(()=>{f!==Ut&&f()});const w=r(()=>!l.state.draggable||0===l.draggableMode||l.state.updating||l.state.readonly),y=r(()=>{const{groupWidth:e,cardWidth:t}=l.model;return e||t||320}),C=r(()=>l.state.batching?l.state.selectGroupKey:""),I=null==(t=l.model.controls)?void 0:t.find(e=>e.name==="".concat(l.model.name,"_quicktoolbar")||e.name==="".concat(l.model.name,"_groupquicktoolbar")),x=null==(a=l.model.controls)?void 0:a.find(e=>e.name==="".concat(l.model.name,"_batchtoolbar"));let S=null;const E=()=>{const e=b.value;u.value=l.onFullScreen(e)},D=()=>{v.value=!v.value,l.state.swimlanes.forEach(e=>{e.isExpand=v.value})},P=e=>{let t;const a=l.model.groupUIActionGroup&&e.groupActionGroupState||x;return!1===e.isExpand?null:C.value===e.key?n("div",{class:[s.em("cell","right"),s.em("header","actions")]},[n(i("el-button"),{text:!0,onClick:()=>l.closeBatch()},iI(t=ibiz.i18n.t("app.complete"))?t:{default:()=>[t]})]):n("div",{class:[s.em("cell","right"),s.em("header","actions")]},[n(i("el-button"),{text:!0,circle:!0,class:s.em("header","action"),onClick:()=>{e.isExpand=!1}},{default:()=>[n("ion-icon",{name:"chevron-back-outline",title:ibiz.i18n.t("control.kanban.collapsed")},null)]}),a&&n(i("el-dropdown"),{trigger:"click",teleported:!1,style:h,class:[s.em("header","action"),s.is("visible",e.key===g.value)],"popper-class":s.em("header","popper"),onVisibleChange:t=>((e,t)=>{g.value=e?t:void 0})(t,e.key)},{default:()=>n(i("el-button"),{text:!0,circle:!0},{default:()=>[n("ion-icon",{title:Tt(ibiz.i18n.t("app.more")),name:"ellipsis-horizontal"},null)]}),dropdown:()=>n("div",{class:s.em("header","toolbar")},[l.model.groupUIActionGroup&&n(i("iBizActionToolbar"),{zIndex:l.state.zIndex,actionDetails:l.model.groupUIActionGroup.uiactionGroupDetails,actionsState:e.groupActionGroupState,onActionClick:(t,a)=>{l.onGroupToolbarClick(t,a,e)}},null),x&&n(i("el-button"),{size:"small",onClick:()=>{l.openBatch(e.key)}},{default:()=>[n("ion-icon",{name:"checkmark-sharp"},null),ibiz.i18n.t("control.kanban.natchOperation")]})])})])},k=(e,t)=>{const{context:a,params:o}=l,{itemLayoutPanel:r}=l.model;if(r)return n(i("iBizControlShell"),{data:t,params:o,context:a,class:s.e("panel-item"),modelData:r},null)},z=(e,t,a)=>{const o=l.getOptItemModel();return n("div",{class:s.e("default-item")},[n("div",{class:s.em("default-item","header")},[t.srfmajortext]),n("div",{class:s.em("default-item","content")},[t.content]),o.length?n("div",{class:s.em("default-item","footer")},[n(i("iBizActionToolbar"),{zIndex:l.state.zIndex,class:s.em("default-item","actions"),"action-details":o,"actions-state":l.state.uaState[t.srfkey],onActionClick:(n,i)=>l.onGroupActionClick(n,t,i,a,e)},null)]):null])},T=(e,t)=>{const{swimlaneAppDEFieldId:a}=l.model,o=t.children.filter(t=>t[a]===e.key);return n("div",{class:s.em("cell","toolbar")},[l.enableNew&&!l.state.readonly&&n(i("el-button"),{text:!0,class:s.em("cell","action"),onClick:a=>{l.onClickNew(a,t.key,e)}},{default:()=>[n("ion-icon",{name:"add-outline"},null),ibiz.i18n.t("app.newlyBuild")]}),I&&0===o.length&&n(i("iBizControlShell"),{class:s.e("quicktoolbar"),modelData:{...I,name:"".concat(I.name,"_").concat(t.key)},context:l.context,params:l.params},null)])},A=e=>{let t;if(!x||C.value!==e.key)return;const a=e.selectedData||[],o=a.length===e.children.length,r=a.length>0&&a.length<e.children.length;return n("div",{class:s.e("batch")},[n(i("iBizControlShell"),{modelData:{...x,name:"".concat(x.name,"_").concat(e.key)},class:s.em("batch","toolbar"),context:l.context,params:l.params},null),n("div",{class:s.em("batch","check")},[n(i("el-checkbox"),{"model-value":o,indeterminate:r,onChange:()=>((e,t)=>{const a=e.selectedData||[];t?a.forEach(e=>{l.onRowClick(e)}):e.children.filter(e=>!a.includes(e)).forEach(e=>{l.onRowClick(e)})})(e,o)},iI(t=ibiz.i18n.t("control.kanban.selectAll"))?t:{default:()=>[t]}),n("span",{class:s.em("batch","info"),innerHTML:ibiz.i18n.t("control.kanban.selectedDataCount",{length:a.length})},null)])])},O=(e,t,a)=>{const{swimlaneAppDEFieldId:o}=l.model;return n("div",{class:[s.e("cell"),s.em("body","cell"),s.is("collapsed",!1===a.isExpand)]},[0===e&&A(a),!1!==a.isExpand?n("div",{class:s.em("cell","content")},[t.isExpand?[n(is,{itemKey:"srfkey",disabled:w.value,modelValue:a.children,handle:".".concat(s.e("drag-icon")),class:s.em("cell","draggable"),group:(r=a.key,c=t.key,1===l.draggableMode?r.toString():2===l.draggableMode?c||"custom":l.model.id),onChange:e=>((e,t,a)=>{e.moved&&l.onDragChange({from:t,to:t,fromIndex:e.moved.oldIndex,toIndex:e.moved.newIndex,fromLane:a,toLane:a}),e.added&&(S={to:t,toLane:a,toIndex:e.added.newIndex}),e.removed&&(S&&(Object.assign(S,{from:t,fromLane:a,fromIndex:e.removed.oldIndex}),l.onDragChange(S)),S=null)})(e,a.key,t.key)},{item:({element:e})=>{return o&&e[o]===t.key?n(i("el-card"),{shadow:"hover",class:[s.e("card"),s.is("selected",(r=e,-1!==l.state.selectedData.findIndex(e=>e.srfkey===r.srfkey))),s.is("disabled",l.state.draggable&&l.state.updating)],onClick:()=>l.onRowClick(e),onDblclick:()=>l.onDbRowClick(e)},{default:()=>[n("div",{class:s.em("card","content")},[l.state.draggable&&!l.state.readonly&&0!==l.draggableMode&&n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:s.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])]),l.model.itemLayoutPanel?k(0,e):z(t,e,a)])]}):null;var r}}),T(t,a)]:n("div",{class:s.em("cell","left")},[n("span",{class:s.em("cell","description")},["".concat(a.children.filter(e=>o&&e[o]===t.key).length," 个").concat(a.caption)])])]):null]);var r,c};return{ns:s,swimlaneKanban:b,width:y,renderHeader:()=>n("div",{class:s.e("header")},[n("div",{class:s.em("header","row")},[n("div",{class:[s.e("cell"),s.em("header","cell")]},[n("div",{class:s.em("cell","content")},[n("div",{class:s.em("cell","left")},[n("ion-icon",{onClick:D,class:s.em("cell","expand-icon"),title:v.value?ibiz.i18n.t("control.kanban.allCollapsed"):ibiz.i18n.t("control.kanban.allExpand"),name:v.value?"chevron-collapse-outline":"chevron-expand-outline"},null),n("div",{class:s.em("cell","caption")},[ibiz.i18n.t("control.kanban.lane")])]),n("div",{class:s.em("cell","right")},[l.enableGroupHidden&&n(i("iBizKanbanSetting"),{buttonStyle:{circle:!0,type:"text"},controller:e.controller},null),l.enableFullScreen&&n(i("el-button"),{type:"text",circle:!0,onClick:E,title:u.value?ibiz.i18n.t("app.cancelFullscreen"):ibiz.i18n.t("app.fullscreen")},{default:()=>[n("ion-icon",{name:u.value?"contract-outline":"expand-outline"},null)]})])])]),l.state.groups.map(e=>{if(!e.hidden)return(e=>n("div",{class:[s.e("cell"),s.em("header","cell"),s.is("collapsed",!1===e.isExpand)]},[n("div",{class:s.em("cell","content")},[n("div",{class:s.em("cell","left")},[n("div",{class:s.em("cell","caption")},[e.caption,n("span",{class:s.em("cell","separator")},[p("·")]),e.children.length]),!1===e.isExpand&&n(i("el-button"),{text:!0,circle:!0,onClick:()=>{e.isExpand=!0}},{default:()=>[n("ion-icon",{title:ibiz.i18n.t("control.kanban.expand"),name:"chevron-forward-outline"},null)]})]),P(e)])]))(e)})])]),renderBody:()=>n("div",{class:s.e("body")},[l.state.swimlanes.map((e,t)=>n("div",{class:[s.em("body","row"),s.is("expand",e.isExpand)]},[n("div",{class:[s.e("cell"),s.em("body","cell")]},[n("div",{class:s.em("cell","content")},[n("div",{class:s.em("cell","left")},[n("ion-icon",{class:s.em("cell","expand-icon"),name:e.isExpand?"chevron-down-outline":"chevron-forward-outline",onClick:()=>{e.isExpand=!e.isExpand}},null),n("div",{class:s.em("cell","caption")},[e.caption])]),n("div",{class:s.em("cell","right")},[n("span",{class:s.em("cell","description")},["".concat(e.count," 个").concat(l.laneDescription)])])])]),l.state.groups.map(a=>{if(!a.hidden)return O(t,e,a)})]))])}},render(){var e;return n("div",{ref:"swimlaneKanban",class:[this.ns.b(),this.ns.e(null==(e=this.controller.model.groupStyle)?void 0:e.toLowerCase())],style:{"--ibiz-swimlane-kanban-width":"".concat(this.width,"px")}},[n("div",{class:this.ns.e("table")},[this.renderHeader(),this.renderBody()])])}});function sI(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const lI=a({name:"IBizKanbanControl",components:{draggable:is},props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0},isSimple:{type:Boolean,required:!1},data:{type:Array,required:!1},loadDefault:{type:Boolean,default:!0}},setup(e){var t,a,s;const l=ne((...e)=>new ri(...e));ue(l);const u=B("control-".concat(l.model.controlType.toLowerCase())),h=o(),v=o(!1),{onPageChange:g,onPageRefresh:b,onPageSizeChange:f}=ul(l),w=()=>{e.data&&(l.state.items=e.data.map(e=>new ma(e)),l.afterLoad({},l.state.items))};l.evt.on("onCreated",async()=>{e.isSimple&&(w(),l.state.isSimple=!0,l.state.isLoaded=!0)}),c(()=>e.data,()=>{e.isSimple&&w()},{deep:!0});const y=r(()=>l.state.batching?l.state.selectGroupKey:""),C=null==(t=l.model.controls)?void 0:t.find(e=>e.name==="".concat(l.model.name,"_quicktoolbar")||e.name==="".concat(l.model.name,"_groupquicktoolbar")),I=null==(a=l.model.controls)?void 0:a.find(e=>e.name==="".concat(l.model.name,"_batchtoolbar")),x=(null==(s=l.model.groupSysCss)?void 0:s.cssName)||"",S=o({});let E=Ut;const D={};switch(l.model.groupLayout){case"ROW":D.width="".concat(l.model.groupWidth||300,"px"),D.height="100%";break;case"COLUMN":D.width="100%",D.height="".concat(l.model.groupHeight||500,"px")}const P=e=>{e.stopPropagation()},k=(e,t)=>{P(t);const a=String(e.key);S.value[a]=!S.value[a]};d(()=>{E=Nt(window,"resize",()=>{v.value=l.getFullscreen()})}),m(()=>{E!==Ut&&E()});const z=(e,t)=>{const{context:a,params:o}=l;return n(i("iBizControlShell"),{data:e,class:u.e("panel-item"),modelData:t,context:a,params:o},null)},T=(e,t)=>n(i("iBizActionToolbar"),{zIndex:l.state.zIndex,class:u.bem("item","bottom","actions"),"action-details":l.getOptItemModel(),"actions-state":l.state.uaState[e.srfkey],onActionClick:(a,n)=>l.onGroupActionClick(a,e,n,t)},null),A=e=>{if(C)return n(i("iBizControlShell"),{class:u.e("quicktoolbar"),modelData:{...C,name:"".concat(C.name,"_").concat(e.key)},context:l.context,params:l.params},null)},O=e=>{if(I)return n("div",{class:u.be("batch","toolbar")},[n(i("iBizControlShell"),{modelData:{...I,name:"".concat(I.name,"_").concat(e.key)},context:l.context,params:l.params},null)])},M=e=>{let t;const a=e.selectedData||[],o=a.length===e.children.length,s=a.length>0&&a.length<e.children.length;return n("div",{class:u.be("batch","check")},[n(i("el-checkbox"),{"model-value":o,indeterminate:s,onChange:()=>((e,t)=>{const a=e.selectedData||[];t?a.forEach(e=>{l.onRowClick(e)}):e.children.filter(e=>!a.includes(e)).forEach(e=>{l.onRowClick(e)})})(e,o)},sI(t=ibiz.i18n.t("control.kanban.selectAll"))?t:{default:()=>[t]}),n("span",{class:u.be("batch","info"),innerHTML:ibiz.i18n.t("control.kanban.selectedDataCount",{length:a.length})},null)])},N=e=>{if(y.value===e.key)return n("div",{class:u.b("batch")},[O(e),M(e)])},L=(e,t)=>{const a=l.getOptItemModel();return n("div",{class:u.e("default-item")},[n("div",{class:u.be("item","top")},[n("div",{class:u.bem("item","top","title")},[e.srfmajortext]),n("div",{class:u.bem("item","top","description")},[e.content])]),a.length?n("div",{class:u.be("item","bottom")},[T(e,t)]):null])},R=(t,a)=>{const o=l.state.selectedData.findIndex(e=>e.srfkey===t.srfkey),s=[u.b("item"),u.is("selected",-1!==o),u.is("disabled",l.state.draggable&&l.state.updating)],r={};l.model.cardWidth&&(r.width="".concat(l.model.cardWidth,"px")),l.model.cardHeight&&(r.height="".concat(l.model.cardHeight,"px"));const c=e.modelData.itemLayoutPanel;return n(i("el-card"),{shadow:"hover",class:s,"body-style":r,onClick:e=>((e,t)=>(P(t),l.onRowClick(e)))(t,e),onDblclick:e=>((e,t)=>(P(t),l.onDbRowClick(e)))(t,e)},{default:()=>[n("div",{class:u.be("item","content")},[l.state.draggable&&!l.state.readonly&&n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",class:u.e("drag-icon"),preserveAspectRatio:"xMidYMid meet",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("g",{transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z"},null)])])]),c?z(t,c):L(t,a)])]})},_=()=>{if(!l.state.isLoaded)return;const e={};return ce(l)&&Object.assign(e,{customRender:()=>n(de,{controller:l},null)}),n(i("iBizNoData"),{text:l.model.emptyText,emptyTextLanguageRes:l.model.emptyTextLanguageRes},sI(e)?e:{default:()=>[e]})};let j=null;const V=e=>{const t=l.model.groupUIActionGroup&&e.groupActionGroupState||I;if(y.value===e.key){let e;return n("span",{class:u.be("group","header-right"),onClick:e=>P(e)},[n(i("el-button"),{text:!0,onClick:()=>l.closeBatch()},sI(e=ibiz.i18n.t("app.complete"))?e:{default:()=>[e]})])}return n("span",{class:u.be("group","header-right"),onClick:e=>P(e)},[l.enableNew&&!l.state.readonly&&n(i("el-button"),{class:u.be("group","header-new"),text:!0,circle:!0,onClick:t=>{((e,t)=>{P(e),l.onClickNew(e,t)})(t,e.key)}},{default:()=>[n("ion-icon",{name:"add-outline",title:ibiz.i18n.t("app.newlyBuild")},null)]}),t&&n(i("el-dropdown"),{class:u.be("group","header-actions"),trigger:"click",teleported:!1,"popper-class":u.e("popover")},{default:()=>n("span",{title:ibiz.i18n.t("app.more")},[p("···")]),dropdown:()=>n("div",{class:u.be("group","actions-dropdown")},[l.model.groupUIActionGroup&&e.groupActionGroupState&&n(i("iBizActionToolbar"),{direction:"vertical",actionDetails:l.model.groupUIActionGroup.uiactionGroupDetails,actionsState:e.groupActionGroupState,onActionClick:(t,a)=>{l.onGroupToolbarClick(t,a,e)}},null),I&&n(i("el-button"),{size:"small",onClick:()=>{l.openBatch(e.key)}},{default:()=>[n("ion-icon",{name:"checkmark-sharp"},null),ibiz.i18n.t("control.kanban.natchOperation")]})])})])};return{c:l,ns:u,isFull:v,kanban:h,renderGroup:e=>{const t=S.value[String(e.key)],a="COLUMN"===l.model.groupLayout,i={...D};return t&&(i.height="50px"),!t||a?n("div",{class:[u.b("group"),u.is("collapse",t),x],style:i},[n("div",{class:u.be("group","header"),style:{borderTopColor:e.color||"transparent"},onClick:t=>k(e,t)},[n("div",{class:u.be("group","header-left")},[n("ion-icon",{name:"caret-down-sharp"},null),n("span",{class:[u.be("group","header-caption"),u.is("badge",!!e.color)],style:{backgroundColor:e.color}},["".concat(e.caption).concat(e.children.length?" · ".concat(e.children.length):"")])]),V(e)]),N(e),n("div",{class:[u.be("group","list"),u.is("empty",!e.children.length)]},[n(is,{itemKey:"srfkey",group:l.model.id,modelValue:e.children,class:u.be("group","draggable"),handle:".".concat(u.e("drag-icon")),disabled:!l.state.draggable||l.state.updating||l.state.readonly,onChange:t=>((e,t)=>{e.moved&&l.onDragChange({from:t,to:t,fromIndex:e.moved.oldIndex,toIndex:e.moved.newIndex}),e.added&&(j={to:t,toIndex:e.added.newIndex}),e.removed&&(j&&(j.from=t,j.fromIndex=e.removed.oldIndex,l.onDragChange(j)),j=null)})(t,e.key)},{item:({element:t})=>R(t,e),header:()=>e.children.length?null:n("div",{class:u.be("group","list")},[_()])}),A(e)])]):n("div",{class:[u.b("group"),u.is("collapse",t),x]},[n("div",{class:u.be("group","header"),style:{borderTopColor:e.color||"transparent"},onClick:t=>k(e,t)},[n("span",{class:[u.be("group","header-caption"),u.is("badge",!!e.color)],style:{backgroundColor:e.color}},["".concat(e.caption).concat(e.children.length?" · ".concat(e.children.length):"")]),n("ion-icon",{name:"caret-forward-sharp"},null)])])},onFullScreen:()=>{const e=h.value.$el;v.value=l.onFullScreen(e)},onPageChange:g,onPageRefresh:b,onPageSizeChange:f}},render(){var e;const{groups:t,isCreated:a}=this.c.state,{swimlaneAppDEFieldId:o}=this.c.model;return a?n(i("iBizControlBase"),{ref:"kanban",controller:this.c,class:[this.ns.m(null==(e=this.modelData.groupLayout)?void 0:e.toLowerCase()),this.ns.is("full",this.isFull),this.ns.is("swimlane",!!o),this.ns.is("enable-page",this.c.state.enablePagingBar)]},{default:()=>[n("div",{class:this.ns.e("content")},[o?n(oI,{controller:this.c},null):[n("div",{class:this.ns.b("group-container")},[t.length>0&&t.map(e=>e.hidden?null:this.renderGroup(e))]),t.length>0&&n("div",{class:this.ns.b("toolbar")},[this.c.enableGroupHidden&&n(i("iBizKanbanSetting"),{controller:this.c},null),this.c.enableFullScreen&&n(i("el-button"),{type:"info",onClick:this.onFullScreen,title:this.isFull?ibiz.i18n.t("app.cancelFullscreen"):ibiz.i18n.t("app.fullscreen")},{default:()=>[n("ion-icon",{name:this.isFull?"contract-outline":"expand-outline"},null)]})])]]),this.c.state.enablePagingBar&&n(i("iBizPagination"),{size:this.c.state.size,total:this.c.state.total,curPage:this.c.state.curPage,totalPages:this.c.state.totalPages,onChange:this.onPageChange,onPageRefresh:this.onPageRefresh,onPageSizeChange:this.onPageSizeChange},null)]}):null}});var rI=Object.defineProperty,cI=(e,t,a)=>(((e,t,a)=>{t in e?rI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class dI{constructor(){cI(this,"component","IBizKanbanControl")}}const uI=e("ax",ie(lI,function(e){e.component(lI.name,lI),Ha(qa.KANBAN,()=>new dI)}));function hI(e,t){let a;const s=o(!1),l=o(!1),r=o(),c=u({}),d=async t=>{var n;const i=(t=>{if(!e.value)throw new Vt(ibiz.i18n.t("control.common.citeErrMessage"));const a=e.value.$el;let n=".el-table__row";t.data._uuid&&(n+='[class*="id-'.concat(t.data._uuid,'"]'));const i=a.querySelector(n);if(!i)throw new Vt(ibiz.i18n.t("control.common.noDomErrMessage"));return i})(t);if(l.value=(null==(n=i.parentNode)?void 0:n.lastElementChild)===i,!a)throw new Vt(ibiz.i18n.t("control.common.noPopErrMessage"));const o=a.$el,{x:d,y:u}=await es(i,o,{placement:"bottom"});Object.assign(c,{top:"".concat(u,"px"),left:"".concat(d,"px")}),r.value=t,setTimeout(()=>{s.value=!0},200)},h=async()=>{r.value&&t.switchRowEdit(r.value,!1,!0)},p=async()=>{r.value&&t.switchRowEdit(r.value,!1,!1)};return t.evt.on("onRowEditChange",e=>{e.row.showRowEdit?setTimeout(()=>{d(e.row)},0):(r.value=void 0,s.value=!1,Object.assign(c,{top:void 0,left:void 0}))}),{renderPopover:()=>[n("div",{class:"row-edit-popover__placeholder",style:{display:l.value?"block":"none"}},null),n(i("iBizRowEditPopover"),{ref:e=>{a=e},style:c,show:s.value,onConfirm:h,onCancel:p},null)]}}function pI(e,t){var a;const n={};return null==(a=e.controlAttributes)||a.forEach(e=>{e.attrName&&e.attrValue&&(n[e.attrName]=Ua.execSingleLine(e.attrValue,{...t}))}),n}const mI=a({name:"IBizTreeGridExControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){const e=ne((...e)=>new ci(...e));ue(e);const t=B("control-".concat(e.model.controlType.toLowerCase())),a=r(()=>{const t=[];return e.state.columnStates.forEach(a=>{var n,i;if(a.hidden)return;const o=(null==(n=e.fieldColumns[a.key])?void 0:n.model)||(null==(i=e.uaColumns[a.key])?void 0:i.model);o&&t.push(o)}),t}),l=(e,t=!1)=>e.map(e=>{const a={id:e._id,_uuid:e._uuid,hasChildren:!e._leaf,_deData:e._deData};return t||e._leaf||void 0===e._children||(a.children=l(e._children)),a}),c=o(go()),d=r(()=>e.state.isLoaded?e.model.rootVisible?e.state.rootNodes:e.state.rootNodes.reduce((e,t)=>t._children?e.concat(t._children):e,[]):[]),u=r(()=>(c.value=go(),0===d.value.length?[]:l(d.value,!0)));e.evt.on("onAfterRefreshParent",()=>{c.value=go()});const h=o(),{renderPopover:p}=hI(h,e);P(()=>{if(h.value){const t=h.value.store.states.treeData.value,a=e.state.expandedKeys;Object.keys(t).forEach(n=>{if(a.includes(n)!==t[n].expanded){const t=l([e.getNodeData(n)])[0];h.value.store.loadOrToggle(t)}})}});return{c:e,ns:t,tableRef:h,elTableData:u,renderColumns:a,tableRefreshKey:c,loadData:async(t,a,n)=>{let i;const o=e.getNodeData(t.id);i=o._children?o._children:await e.loadNodes(o),n(l(i))},onRowClick:async(t,a,n)=>{const i=e.getNodeData(t.id);if("row"===e.editShowMode&&e.model.enableEdit){const a=e.state.rows[i._uuid];if(!a||!0===a.showRowEdit)throw new Vt(ibiz.i18n.t("control.treeGridEx.noFoundMessage",{id:t.id}));await e.switchRowEdit(a,!0)}else e.onTreeNodeClick(i,n)},renderNoData:()=>{const{isLoaded:t}=e.state,a={};return ce(e)&&Object.assign(a,{customRender:()=>n(de,{controller:e},null)}),t&&n(i("iBizNoData"),{text:e.model.emptyText,emptyTextLanguageRes:e.model.emptyTextLanguageRes},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o},renderPopover:p,onExpandChange:(t,a)=>{const n=e.getNodeData(t._uuid);if(!n)throw new Vt(ibiz.i18n.t("control.common.noFoundNode",{id:t._uuid}));e.onExpandChange(n,a)},handleRowClassName:function({row:t}){const a=e.getNodeData(t.id);if(!a)return"";let n="";e.state.selectedData.length>0&&e.state.selectedData.forEach(e=>{e===a&&(n="current-row")});const i=e.getRowState(a._uuid);return(null==i?void 0:i.showRowEdit)&&(n+=" editing-row"),n+=" id-".concat(a._uuid),n}}},render(){const e=(e,t)=>{var a,o,s;if(this.$slots[e.id])return D(this.$slots,e.id,{model:e,data:this.c.state.items});const{codeName:r,width:c}=e,d=this.c.columns[r],u=this.c.state.columnStates.find(e=>e.key===r),h=d.isAdaptiveColumn||!this.c.hasAdaptiveColumn&&t===this.renderColumns.length-1?"min-width":"width";let p="default";const m=null==(a=this.c.controlParams.expandiconcolumn)?void 0:a.toLowerCase(),v=this.c.state.columnStates.find(e=>m&&e.key.toLowerCase()===m);return v&&!v.hidden&&(p=(null==r?void 0:r.toLowerCase())===m?"default":""),n(i("el-table-column"),y({type:p,prop:r,label:e.caption},{[h]:c},{fixed:u.fixed,sortable:!!e.enableSort&&"custom",align:(null==(o=e.align)?void 0:o.toLowerCase())||"center","label-class-name":null==(s=d.model.headerSysCss)?void 0:s.cssName}),{header:({column:e})=>n(i("iBizGridColumnHeader"),{key:e.property,controller:d},null),default:({row:e})=>{const t=this.c.getRowState(e.id);if(t){const e=i(this.c.providers[r].component),a=t.data,n=this.c.getNodeModel(a._nodeId);return l(e,{controller:d,row:t,key:t.data._uuid+r,attrs:pI(n,{...this.c.getEventArgs(),data:t.data})})}return null}})};return n(i("iBizControlNavigation"),{controller:this.c},{default:()=>[n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b()]},{default:()=>[this.c.state.isLoaded&&n(i("el-table"),y({ref:"tableRef",key:this.tableRefreshKey,class:this.ns.e("table"),border:!0,"row-key":"id",data:this.elTableData,"tree-props":{children:"children",hasChildren:"hasChildren"},lazy:!0,onRowClick:this.onRowClick,onExpandChange:this.onExpandChange,"row-class-name":this.handleRowClassName,load:this.loadData},pI(this.c.model,{...this.c.getEventArgs()})),{empty:this.renderNoData,default:()=>[this.renderColumns.map((t,a)=>e(t,a))],append:()=>this.renderPopover()})]})]})}});var vI=Object.defineProperty,gI=(e,t,a)=>(((e,t,a)=>{t in e?vI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class bI{constructor(){gI(this,"component","IBizTreeGridExControl")}}const fI=a({name:"IBizTreeGridExFieldColumn",props:{controller:{type:ui,required:!0},row:{type:di,required:!0}},setup(e){const t=B("tree-grid-ex-field-column"),a=e.controller.treeGrid.state.zIndex,n=r(()=>"DE"!==e.row.data._nodeType&&e.controller.isFirstShowColumn?e.row.data._text:e.row.data[e.controller.name]),i=r(()=>e.controller.nodeColumnControllerMap.get(e.row.data._nodeId)),s=o(""),l=r(()=>{var t,a;const o=i.value;if(o){if(o.nodeEditItem)return;if(o.codeList)return s.value;let i=o.formatValue(n.value);return e.controller.treeGrid.emptyHiddenUnit?i&&(i+=o.unitName||(null==(t=o.nodeColumn)?void 0:t.unitName)||""):i+=o.unitName||(null==(a=o.nodeColumn)?void 0:a.unitName)||"",i}return n.value}),c=r(()=>{if("ellipsis"===e.controller.treeGrid.overflowMode&&zo(n.value)&&""!==n.value)return l.value}),d=r(()=>n.value&&i.value&&(i.value.isLinkColumn||i.value.hasClickAction));return{ns:t,zIndex:a,tooltip:c,showText:l,clickable:d,nodeColumn:i,fieldValue:n,onTextClick:t=>{var a;null==(a=i.value)||a.onTextClick(e.row,t)},onActionClick:async(t,a)=>{var n;await(null==(n=i.value)?void 0:n.onActionClick(t,e.row,a))},onInfoTextChange:e=>{s.value=e}}},render(){var e,t,a,o;let s,l=null;return l=(null==(e=this.nodeColumn)?void 0:e.nodeEditItem)?n(i("iBizTreeGridExEditColumn"),{controller:this.nodeColumn,row:this.row},null):(null==(t=this.nodeColumn)?void 0:t.codeList)?n(i("iBizCodeList"),{class:this.ns.e("text"),codeListItems:this.nodeColumn.codeListItems,codeList:this.nodeColumn.codeList,value:this.fieldValue,onClick:this.onTextClick,onInfoTextChange:this.onInfoTextChange,title:Tt(this.tooltip)},null):n("span",{class:this.ns.e("text"),title:Tt(this.tooltip),onClick:this.onTextClick},[this.showText]),this.$slots.actions?s=this.$slots.actions():this.row.columnActionsStates[this.controller.name]&&(s=n(i("iBizActionToolbar"),{zIndex:this.zIndex,class:this.ns.e("toolbar"),"action-details":null==(a=this.nodeColumn)?void 0:a.nodeColumn.deuiactionGroup.uiactionGroupDetails,"actions-state":this.row.columnActionsStates[this.controller.name],groupLevelKeys:[50,100],onActionClick:this.onActionClick},null)),n("div",{class:[this.ns.b(),this.clickable&&this.ns.m("clickable"),this.ns.m(this.controller.treeGrid.overflowMode),null==(o=this.controller.model.cellSysCss)?void 0:o.cssName,this.ns.is("has-action",!!s)]},[n("div",{class:this.ns.b("text-container")},[l]),n("div",{class:this.ns.b("toolbar-container")},[s])])}});var wI=Object.defineProperty,yI=(e,t,a)=>(((e,t,a)=>{t in e?wI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class CI{constructor(){yI(this,"component","IBizTreeGridExFieldColumn")}async createController(e,t){const a=new ui(e,t);return await a.init(),a}}const II=ie(fI,function(e){e.component(fI.name,fI),hi("DEFGRIDCOLUMN",()=>new CI)});const xI=a({name:"IBizTreeGridExEditColumn",props:{controller:{type:pi,required:!0},row:{type:di,required:!0}},setup(e){const t=r(()=>e.row.data[e.controller.name]),a=B("tree-grid-ex-edit-column"),n=o(),i=e.controller,{gridEditItemProps:s,editorProps:l}=(()=>{switch(i.treeGrid.editShowMode){case"cell":return function(e,t){const a=e.controller,n=r(()=>e.row.editColStates[a.name].disabled),i=r(()=>e.row.editColStates[a.name].readonly),o=r(()=>!!e.row.errors[a.name]),s=r(()=>e.row.editColStates[a.name].editable),l=t=>{e.row.editColStates[a.name].editable=t},c=r(()=>!n.value&&!i.value&&!o.value),d=r(()=>o.value||c.value&&s.value),h=r(()=>!d.value),p=r(()=>!o.value),m=r(()=>c.value&&!s.value),v=r(()=>c.value);let g;return{gridEditItemProps:u({showEditMask:m,stopPropagation:v,onMaskClick:()=>{l(!0),g=le(t,async e=>{l(!1),g.stop()})}}),editorProps:u({autoFocus:p,disabled:!1,readonly:h,onBlur:()=>{ibiz.log.debug("".concat(a.name,"属性编辑器blur事件")),l(!1),"cell-blur"===a.treeGrid.editSaveMode&&a.treeGrid.save(e.row.data)},onFocus:()=>{g&&g.stop(),ibiz.log.debug("".concat(a.name,"属性编辑器focus事件"))}})}}(e,n);case"row":return function(e){const t=e.controller,a=r(()=>e.row.editColStates[t.name].disabled),n=r(()=>e.row.editColStates[t.name].readonly),i=r(()=>e.row.editColStates[t.name].editable),o=r(()=>n.value||!i.value),s=r(()=>i.value&&a.value),l=r(()=>i.value);return{gridEditItemProps:u({stopPropagation:l}),editorProps:u({disabled:s,readonly:o})}}(e);case"all":return function(e){const t=e.controller,a=r(()=>e.row.editColStates[t.name].disabled),n=r(()=>e.row.editColStates[t.name].readonly),i=r(()=>e.controller.treeGrid.state.rowEditOpen),o=r(()=>n.value||!i.value),s=r(()=>i.value&&a.value),l=r(()=>i.value);return{gridEditItemProps:u({stopPropagation:l}),editorProps:u({disabled:s,readonly:o,onBlur:()=>{"cell-blur"===t.treeGrid.editSaveMode&&t.treeGrid.save(e.row.data)}})}}(e);default:throw new Vt(ibiz.i18n.t("control.common.noSupportItem",{name:i.treeGrid.editShowMode}))}})(),c=o(void 0),d=r(()=>{if(l.readonly)return Po(c.value)?i.formatValue(t.value):c.value});return{ns:a,fieldValue:t,componentRef:n,tooltip:d,rowDataChange:async(t,a,n=!1)=>{ibiz.log.debug("".concat(i.name,"值变更"),t),await i.setRowValue(e.row,t,a,n)},onInfoTextChange:e=>{c.value=e},gridEditItemProps:s,editorProps:l}},render(){return n(i("iBizGridEditItem"),{ref:"componentRef",required:!this.controller.nodeEditItem.allowEmpty,overflowMode:this.controller.treeGrid.overflowMode,class:[this.ns,this.ns.m(this.controller.treeGrid.overflowMode)],...this.gridEditItemProps},{default:()=>[this.controller.editorProvider&&l(i(this.controller.editorProvider.gridEditor),{class:this.ns.e("editor"),value:this.fieldValue,data:this.row.data,controller:this.controller.editor,overflowMode:this.controller.treeGrid.overflowMode,onChange:this.rowDataChange,onInfoTextChange:this.onInfoTextChange,title:this.tooltip,...this.editorProps})]})}}),SI=a({name:"IBizTreeGridExUAColumn",props:{controller:{type:mi,required:!0},row:{type:di,required:!0}},setup:e=>({ns:B("tree-grid-ex-ua-column"),onStopPropagation:e=>{e.stopPropagation()},onActionClick:async(t,a)=>{await e.controller.onActionClick(t,e.row,a)}}),render(){var e,t;const a=this.controller.getUIActionGroup(this.row);return n("div",{class:[this.ns.b(),null==(e=this.controller.model.cellSysCss)?void 0:e.cssName],onDblclick:this.onStopPropagation,onClick:this.onStopPropagation},[(null==(t=null==a?void 0:a.uiactionGroupDetails)?void 0:t.length)&&n(i("iBizActionToolbar"),{"action-details":a.uiactionGroupDetails,"actions-state":this.row.columnActionsStates[this.controller.model.codeName],onActionClick:this.onActionClick},null)])}});var EI=Object.defineProperty,DI=(e,t,a)=>(((e,t,a)=>{t in e?EI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class PI{constructor(){DI(this,"component","IBizTreeGridExUAColumn")}async createController(e,t){const a=new mi(e,t);return await a.init(),a}}const kI=ie(SI,function(e){e.component(SI.name,SI),hi("UAGRIDCOLUMN",()=>new PI)}),zI=e("ay",ie(mI,function(e){e.component(mI.name,mI),e.component(xI.name,xI),Ha(qa.TREE_GRIDEX,()=>new bI),e.use(II),e.use(kI)}));function TI(e,t){var a;const n={};return null==(a=e.controlAttributes)||a.forEach(e=>{e.attrName&&e.attrValue&&(n[e.attrName]=Ua.execSingleLine(e.attrValue,{...t}))}),n}const AI=a({name:"IBizTreeGridControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0},rowEditOpen:{type:Boolean,default:void 0},isSimple:{type:Boolean,required:!1},data:{type:Array,required:!1},loadDefault:{type:Boolean,default:!0}},setup(e,{slots:t}){const a=ne((...e)=>new vi(...e));ue(a);const o=B("control-grid"),l=B("control-".concat(a.model.controlType.toLowerCase())),{tableRef:r,onRowClick:d,onDbRowClick:u,onSortChange:h,onSelectionChange:m,handleRowClassName:v,handleHeaderCellClassName:b}=Dp(a),{onPageChange:f,onPageRefresh:w,onPageSizeChange:y}=Pp(a),{tableData:C,defaultSort:I,renderColumns:x,summaryMethod:S,headerDragend:E}=kp(a,e,r),{renderPopover:P}=Ap(r,a),{headerCssVars:k}=zp(r,o),z=e=>{r.value&&a.state.expandRowKeys.length&&(a.state.expandRowKeys.forEach(t=>{const a=e.find(e=>e.srfkey===t);a&&g(()=>{r.value.store.loadOrToggle(a)})}),(()=>{const{expandRowKeys:e,selectedData:t,singleSelect:n}=a.state,i=r.value;if(!i||!t.length)return;const o=i.store.states.treeData.value,s=Object.keys(o).filter(e=>o[e].loaded);if(e.length===s.length&&e.sort().every((e,t)=>e===s.sort()[t])){const e=[],a=t.map(e=>e.srfkey);qt({children:i.store.states.data.value},t=>{a.includes(t.srfkey)&&e.push(t)}),g(()=>{n?i.setCurrentRow(e[0]):i.store.states.selection.value=e})}})())};c(()=>r.value,()=>{z(a.state.treeGirdData)});return{c:a,ns:o,ns2:l,tableRef:r,tableData:C,defaultSort:I,renderColumns:x,headerCssVars:k,loadData:async(e,t,n)=>{const i=a.state.items.map(e=>a.getTreeGridDataItem(e)).filter(t=>e[a.treeGridValueField]===t[a.treeGridParentField]);e.children=i,n(i),z(i)},onRowClick:d,renderColumn:(e,n)=>t[e.id]?D(t,e.id,{model:e,data:a.state.items}):Bp(a,e,x.value,n),onDbRowClick:u,onSortChange:h,onPageChange:f,renderNoData:()=>{var e;const{isLoaded:t}=a.state;if(t){const t=null==(e=a.model.controls)?void 0:e.find(e=>e.name==="".concat(a.model.name,"_quicktoolbar"));if(t)return n(i("iBizToolbarControl"),{modelData:t,context:a.context,params:a.params,class:o.b("quick-toolbar")},null);const r={};return ce(a)&&Object.assign(r,{customRender:()=>n(de,{controller:a},null)}),n(i("iBizNoData"),{text:a.model.emptyText,emptyTextLanguageRes:a.model.emptyTextLanguageRes},"function"==typeof(l=r)||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?r:{default:()=>[r]})}var l;return null},onPageRefresh:w,summaryMethod:S,headerDragend:E,renderPopover:P,onPageSizeChange:y,onSelectionChange:m,handleRowClassName:v,renderBatchToolBar:()=>{var e;const t=null==(e=a.model.controls)?void 0:e.find(e=>e.name==="".concat(a.model.name,"_batchtoolbar"));if(t&&!a.state.singleSelect)return n("div",{class:[o.b("batch-toolbar"),o.is("show",a.showBatchToolbar)]},[n("div",{class:o.b("batch-toolbar-content")},[n("div",{class:o.b("batch-toolbar-text")},[ibiz.i18n.t("control.common.itemsSelected",{length:a.state.selectedData.length})]),n("div",{class:o.b("batch-toolbar-separator")},[p("|")]),n(i("iBizToolbarControl"),{modelData:t,context:a.context,params:a.params,class:o.b("batch-toolbar-items")},null)])])},handleHeaderCellClassName:b}},render(){const e=this.c.state,{hideHeader:t,enablePagingBar:a}=this.c.model;return n(i("iBizControlNavigation"),{controller:this.c},{default:()=>[n(i("iBizControlBase"),{class:[this.ns.b(),this.ns2.b(),this.ns.is("show-header",!t),this.ns.is("enable-page",a),this.ns.is("enable-group",this.c.model.enableGroup),this.ns.is("enable-customized",this.c.model.enableCustomized)],controller:this.c,style:this.headerCssVars},{default:()=>{var o;return[this.c.state.isLoaded&&n(i("el-table"),y({lazy:!0,border:!0,ref:"tableRef","row-key":"srfkey",load:this.loadData,"tooltip-effect":"light","show-header":!t,class:this.ns.e("table"),key:this.c.state.tableKey,onRowClick:this.onRowClick,"default-sort":this.defaultSort,"show-summary":this.c.enableAgg,onSortChange:this.onSortChange,onRowDblclick:this.onDbRowClick,"summary-method":this.summaryMethod,onHeaderDragend:this.headerDragend,"row-class-name":this.handleRowClassName,onSelectionChange:this.onSelectionChange,"highlight-current-row":e.singleSelect,onExpandChange:(e,t)=>this.c.expandChange(e,t),"header-cell-class-name":this.handleHeaderCellClassName,"tree-props":{children:"children",hasChildren:"hasChildren"},data:this.c.state.showTreeGrid?e.treeGirdData:this.tableData},this.$attrs,TI(this.c.model,{...this.c.getEventArgs()})),{empty:this.renderNoData,default:()=>[!e.singleSelect&&n(i("el-table-column"),{width:"55",type:"selection","reserve-selection":!0,"class-name":this.ns.e("selection")},null),e.isCreated&&this.renderColumns.map((e,t)=>this.renderColumn(e,t))],append:()=>this.renderPopover()}),a&&n(i("iBizPagination"),{total:e.total,curPage:e.curPage,size:e.size,totalPages:e.totalPages,onChange:this.onPageChange,onPageSizeChange:this.onPageSizeChange,onPageRefresh:this.onPageRefresh,popperClass:"".concat((null==(o=this.c.model.sysCss)?void 0:o.cssName)||"default","--popper")},null),this.c.model.enableCustomized&&!t&&n("div",{class:this.ns.b("setting-box")},[n(i("iBizGridSetting"),{columnStates:e.columnStates,controller:this.c},null)]),this.renderBatchToolBar()]}})]})}});var OI=Object.defineProperty,MI=(e,t,a)=>(((e,t,a)=>{t in e?OI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class NI{constructor(){MI(this,"component","IBizTreeGridControl")}}const BI=e("az",ie(AI,function(e){e.component(AI.name,AI),Ha(qa.TREEGRID,()=>new NI)})),LI=a({name:"IBizMEditViewPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})}},setup(){const e=ne((...e)=>new gi(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),a=o(null),n=o(0);let i=null;return d(()=>{a.value&&(i=new MutationObserver(()=>{const t=a.value.scrollHeight;t!==n.value&&e.state.isNeedScroll&&(n.value=t,a.value.scrollTop=t)}),i.observe(a.value,{childList:!0,attributes:!0,characterData:!0,subtree:!0}))}),h(()=>{i&&i.disconnect()}),{c:e,ns:t,panelContent:a,handleDelete:t=>{e.handleDelete(t)},onTabChange:t=>{e.state.activeTab=t,e.onTabChange(t)},handleTabDelete:(t,a)=>{a.stopPropagation(),e.handleDelete(t)}}},render(){const e=i("IBizViewShell"),t=()=>n(i("el-tabs"),{class:this.ns.b("tabs"),addable:!0,modelValue:this.c.state.activeTab,"onUpdate:modelValue":e=>this.c.state.activeTab=e,onTabChange:this.onTabChange,onTabAdd:()=>this.c.handleAdd()},{addIcon:()=>n(i("el-button"),null,{default:()=>[n("ion-icon",{name:"add"},null),ibiz.i18n.t("app.add")]}),default:()=>this.c.state.panelUiItems.map(t=>n(i("el-tab-pane"),{key:t.id+t.srfmajortext,name:t.id},{label:()=>n("div",{class:this.ns.b("tab-label")},[n("span",null,[t.srfmajortext]),n("ion-icon",{name:"close-outline",onClick:e=>this.handleTabDelete(t,e)},null)]),default:()=>this.c.state.activeTab===t.id&&l(e,{context:t.context,params:t.params,viewId:this.c.model.embeddedAppViewId,onDataChange:e=>this.c.onViewDataChange(e,t.id),onCreated:e=>this.c.onViewCreated(e,t.id)})}))}),a=()=>this.c.state.panelUiItems.map(t=>n("div",{class:this.ns.b("item"),key:t.id},[[l(e,{context:t.context,params:t.params,viewId:this.c.model.embeddedAppViewId,onDataChange:e=>this.c.onViewDataChange(e,t.id),onCreated:e=>this.c.onViewCreated(e,t.id)}),n("div",{class:this.ns.b("close")},[n("ion-icon",{name:"close-outline",onClick:()=>this.handleDelete(t)},null)])]])),o=()=>{if(this.c.model.embeddedAppViewId)return Object.is(this.c.model.panelStyle,"TAB_TOP")?t():a()};return n(i("iBizControlBase"),{controller:this.c},{default:()=>[n("div",{class:this.ns.b("content"),ref:"panelContent"},[this.c.state.panelUiItems.length>0?o():null])]})}});var RI=Object.defineProperty,_I=(e,t,a)=>(((e,t,a)=>{t in e?RI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class jI{constructor(){_I(this,"component","IBizMEditViewPanelControl")}}const VI=e("aA",ie(LI,function(e){e.component(LI.name,LI),Ha(qa.MULTI_EDIT_VIEWPANEL,()=>new jI)})),FI=a({name:"IBizMapControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},mdctrlActiveMode:{type:Number,default:void 0},isSimple:{type:Boolean,required:!1},loadDefault:{type:Boolean,default:!0}},setup(){const e=ne((...e)=>new bi(...e)),t=B("control-".concat(e.model.controlType.toLowerCase())),a=o(),n=e.model.mapStyle,i=r(()=>({strAreaCode:e.state.strAreaCode,defaultAreaCode:e.state.defaultAreaCode,jsonBaseUrl:e.state.jsonBaseUrl}));return{c:e,ns:t,mapRef:a,mapOpts:i,mapStyle:n}},render(){const{state:e}=this.c;if(!e.isCreated)return;let t;return e.isLoaded&&(t="USER"===this.mapStyle?n(i("iBizMapChartUser"),{areaData:e.areaData,pointData:e.pointData,options:this.mapOpts,class:this.ns.e("map"),controller:this.c},null):n(i("iBizMapChart"),{controller:this.c,areaData:e.areaData,pointData:e.pointData,options:this.mapOpts,class:this.ns.e("map"),onPointClick:e=>{this.c.onPointClick(e)},onAreaClick:e=>{this.c.onAreaClick(e,"","")}},null)),n(i("iBizControlNavigation"),{controller:this.c},{default:()=>[n(i("iBizControlBase"),{controller:this.c},{default:()=>[t,this.c.state.enableNavView&&this.c.state.showNavIcon?this.c.state.showNavView?n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.hiddenNav"),name:"eye-off-outline",onClick:()=>this.c.onShowNavViewChange()},null):n("ion-icon",{class:this.ns.e("nav-icon"),title:ibiz.i18n.t("component.controlNavigation.showNav"),name:"eye-outline",onClick:()=>this.c.onShowNavViewChange()},null):null]})]})}});var UI=Object.defineProperty,HI=(e,t,a)=>(((e,t,a)=>{t in e?UI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class qI{constructor(){HI(this,"component","IBizMapControl")}}const GI=e("aB",{install(e){e.component(FI.name,FI),Ha(qa.MAP,()=>new qI)}});const WI=a({name:"IBizReportPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},noLoadDefault:{type:Boolean,default:!1}},setup(){const e=ne((...e)=>new fi(...e)),t=B("control-".concat(e.model.controlType.toLowerCase()));return{c:e,ns:t,renderContent:()=>{var t;switch(null==(t=e.model.appDEReport)?void 0:t.reportType){case"USER":return n(i("iBizUserReportPanel"),{controller:e},null);case"USER2":return n(i("iBizUser2ReportPanel"),{controller:e},null);case"SYSBIREPORT":case"DESYSBIREPORTS":case"SYSBICUBE":case"DESYSBICUBES":case"ALLSYSBICUBES":case"SYSBICUBEREPORTS":case"ALLSYSBIREPORTS":return e.isBIReportDesign?n(i("iBizBIReportPanel"),{controller:e},null):n(i("iBizBIReport"),{controller:e},null);default:return n("div",null,[ibiz.i18n.t("control.reportPanel.unrealized")])}}}},render(){let e;var t;if(this.c.state.isCreated)return n(i("iBizControlBase"),{controller:this.c},"function"==typeof(t=e=this.renderContent())||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]})}});var YI=Object.defineProperty,KI=(e,t,a)=>(((e,t,a)=>{t in e?YI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class XI{constructor(){KI(this,"component","IBizReportPanelControl")}}const $I=a({name:"IBizUserReportPanel",props:{controller:{type:Object}},setup(e){const t=e.controller;return{c:t,ns:B("user-report-panel"),generator:t&&t.generator}},render(){if(!this.c)return;const e=this.c.state;return n("div",{class:this.ns.e("container")},[n(i("iBizRelationshipDesign"),{data:e.data,context:this.c.context,params:this.c.params,config:this.generator&&this.generator.config.CONFIG,pluginConfig:this.generator&&this.generator.config.PLUGINCONFIG,nodeLegendConfig:this.generator&&this.generator.config.NODELEGENDCONFIG,edgeLegendConfig:this.generator&&this.generator.config.EDGELEGENDCONFIG,hooks:this.generator&&this.generator.config.HOOKS,showLoading:!0,onInit:e=>{this.generator&&this.generator.init(e)}},null)])}}),JI=ie($I,function(e){e.component($I.name,$I)}),QI=a({name:"IBizUser2ReportPanel",props:{controller:{type:Object}},setup(e){const t=e.controller,a=B("user2-report-panel"),n=t&&t.generator;return{c:t,ns:a,generator:n,handleClick:async e=>{let a=e.target.getAttribute("click"),n=e.target.getAttribute("params");if(!a||!t||!n)return;a=a.replaceAll("`",""),n=n.replaceAll("`",'"');const i=/\(([^)]+)\)/.exec(a);i&&i[1]&&fa.exec(i[1],{context:t.context,params:t.params,data:[JSON.parse(n)],view:t.view},t.context.srfappid)}}},render(){if(!this.c)return;const e=this.c.state;return e.isLoaded?n("div",{class:this.ns.e("container"),innerHTML:e.data,onClick:e=>{this.handleClick(e)}},null):n("div",{class:this.ns.e("empty")},[ibiz.i18n.t("control.common.currentNoData")])}}),ZI=ie(QI,function(e){e.component(QI.name,QI)}),ex=a({name:"IBizBIReportPanel",props:{controller:{type:Object}},setup(e){const t=e.controller;return{c:t,ns:B("bi-report-panel"),generator:t&&t.generator}},render(){if(this.c)return n("div",{class:this.ns.e("container")},[n(i("iBizBIReportContent"),{mode:"CONTENT",context:this.c.context,viewParams:this.c.params,config:this.generator&&this.generator.config,onInit:e=>{this.generator&&this.generator.init(e)},onReportChartChange:e=>{this.generator&&this.generator.init(e)}},null)])}}),tx=ie(ex,function(e){e.component(ex.name,ex)}),ax=a({name:"IBizBINumberReport",props:{model:{type:Object,required:!0},data:{type:Array,required:!0}},setup(e){const t=B("bi-number-report"),a=o({visible:!1,yoy:0,qoq:0,currentTotal:0,yoyTotal:0,qoqTotal:0});(()=>{var t,n;const i=null==(n=null==(t=e.model.measure)?void 0:t.measureTag)?void 0:n.toLowerCase();i&&(e.data.forEach(e=>{e&&"PoP1"===e.srfperiodtype?a.value.qoqTotal=Number.isNaN(Number(e[i]))?0:Number(e[i]):e&&"YoY1"===e.srfperiodtype?a.value.yoyTotal=Number.isNaN(Number(e[i]))?0:Number(e[i]):e&&e[i]&&(a.value.currentTotal=Number.isNaN(Number(e[i]))?0:Number(e[i]))}),a.value.qoq=a.value.currentTotal-a.value.qoqTotal,a.value.yoy=a.value.currentTotal-a.value.yoyTotal)})();const i=r(()=>{const t={},{number_fontstyle:a,number_fontsize:n,number_fontcolor:i}=e.model;return a&&(a.includes("bold")?t.fontWeight="bold":t.fontStyle=a),n&&(t.fontSize="".concat(n,"px")),i&&(t.color=i),t}),s=()=>n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor",style:"transform: rotate(180deg);"},[n("g",{id:"aft1.Base基础/1.icon图标/5.navigation/caret-down","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M5.02 8.233l5.952-5.952a.6.6 0 0 1 1.025.424v5.952a.6.6 0 0 1-.6.6H5.445a.6.6 0 0 1-.424-1.024z",id:"aft路径",transform:"rotate(45 7.997 5.257)"},null)])]);return{ns:t,style:i,uiState:a,handleFormat:t=>{var a;const n=null==(a=e.model.measure)?void 0:a.jsonFormat;return n?ibiz.util.text.format(String(t),n):t},renderUpDownResult:(e,a)=>{if(0===e)return 0===a?n("span",null,[p("-")]):n("div",{class:t.e("up")},[s(),n("span",null,[p("100%")])]);const i=a-e,o=(Math.abs(i)/e*100).toFixed(0);return i<0?n("div",{class:t.e("down")},[n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aft1.Base基础/1.icon图标/5.navigation/caret-down","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M5.02 8.233l5.952-5.952a.6.6 0 0 1 1.025.424v5.952a.6.6 0 0 1-.6.6H5.445a.6.6 0 0 1-.424-1.024z",id:"aft路径",transform:"rotate(45 7.997 5.257)"},null)])]),n("span",null,[o,p("%")])]):0===i?n("span",null,[p("-")]):n("div",{class:t.e("up")},[s(),n("span",null,[o,p("%")])])}}},render(){var e,t,a,i;return n("div",{class:this.ns.b()},[n("div",{class:this.ns.e("content")},[n("div",{class:this.ns.em("content","number")},[n("span",{class:this.ns.em("content","number-text"),style:this.style},[this.handleFormat(this.uiState.currentTotal)])]),n("div",{class:this.ns.em("content","compare")},[1===this.model.number_yoy_show&&n("div",{class:this.ns.em("content","yoy")},[n("div",{class:this.ns.em("content","compare-number")},[n("span",null,[p("同比")]),n("span",{class:[this.ns.em("content","yoy-yoyTotal"),this.ns.is("show",null==(e=this.model.number_yoy_value)?void 0:e.includes("orgin"))]},[this.uiState.yoyTotal]),n("span",{class:[this.ns.em("content","yoy-value"),this.ns.is("show",null==(t=this.model.number_yoy_value)?void 0:t.includes("difference"))]},[p("("),this.uiState.yoy>0?"+":"",this.uiState.yoy,p(")")])]),n("div",{class:this.ns.em("content","icon")},[this.renderUpDownResult(this.uiState.yoyTotal,this.uiState.currentTotal)])]),1===this.model.number_qoq_show&&n("div",{class:this.ns.em("content","qoq")},[n("div",{class:this.ns.em("content","compare-number")},[n("span",null,[p("环比")]),n("span",{class:[this.ns.em("content","qoq-qoqTotal"),this.ns.is("show",null==(a=this.model.number_qoq_value)?void 0:a.includes("orgin"))]},[this.uiState.qoqTotal]),n("span",{class:[this.ns.em("content","qoq-value"),this.ns.is("show",null==(i=this.model.number_qoq_value)?void 0:i.includes("difference"))]},[p("("),this.uiState.qoq>0?"+":"",this.uiState.qoq,p(")")])]),n("div",{class:this.ns.em("content","icon")},[this.renderUpDownResult(this.uiState.qoqTotal,this.uiState.currentTotal)])])])])])}}),nx=a({name:"IBizBIReport",props:{controller:{type:Object,required:!0}},setup(e){const t=e.controller;return{c:t,ns:B("bi-report"),reportType:t.generator.reportType}},render(){if(this.c.state.biReport)return n("div",{class:this.ns.b()},["NUMBER"===this.reportType?n(ax,{model:this.c.state.biReport.model,data:this.c.state.biReport.data},null):n(i("iBizControlShell"),{isSimple:!0,context:this.c.context,data:this.c.state.biReport.data,modelData:this.c.state.biReport.model,style:this.c.state.biReport.options.vars,class:this.c.state.biReport.options.classList},null)])}}),ix=ie(nx,e=>{e.component(nx.name,nx)}),ox=e("aC",ie(WI,function(e){e.use(ix),e.use(JI),e.use(ZI),e.use(tx),e.component(WI.name,WI),Ha(qa.REPORT_PANEL,()=>new XI)}));const sx=a({name:"IBizGanttControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object},loadDefault:{type:Boolean,default:!0},mdctrlActiveMode:{type:Number,default:void 0},singleSelect:{type:Boolean,default:void 0}},setup(e){var a;const u=ne((...e)=>new wi(...e)),h=o(),p=o(!1),m=B("control-".concat(u.model.controlType.toLowerCase()));let v=null,b=null;const f=o(!1),w=i("IBizRawItem"),y=i("IBizIcon");let C=!1,x=!1;const S=[],E=null==(a=I())?void 0:a.appContext.app;d(()=>{t.import("@ibiz-template-plugin/gantt").then(e=>{const t=e.default;null==E||E.use(t),p.value=!0}),u.evt.on("onToggleRowExpansion",e=>{const{row:t,expand:a}=e;h.value&&(a?h.value.setExpand(t):h.value.setCollapse(t))})});const D=e=>{const t=document.documentElement;return getComputedStyle(t).getPropertyValue(e)},{UIStore:P}=G(),k=o({});c(()=>P.theme,()=>{var e,t;k.value={primaryColor:(null==(e=u.state.ganttStyle)?void 0:e.primaryColor)||D("--ibiz-color-primary"),textColor:(null==(t=u.state.ganttStyle)?void 0:t.textColor)||D("--ibiz-color-text-3"),headerBgColor:"rgba(".concat(D("--ibiz-grey-1"),", 1)"),bgColor:D("--ibiz-color-bg-1"),weekendColor:D("--ibiz-color-fill-2"),todayColor:D("--ibiz-color-primary-light-active"),borderColor:D("--ibiz-color-tertiary-light-active")}},{immediate:!0});const z=r(()=>!!u.state.isLoaded&&u.state.isLoading),T=r(()=>u.state.isLoaded?u.model.rootVisible?u.state.rootNodes:u.state.rootNodes.reduce((e,t)=>t._children?e.concat(t._children):e,[]):[]),A=r(()=>{const e=[];return u.state.columnStates.forEach(t=>{var a;const n=null==(a=u.columns[t.key])?void 0:a.model;!t.hidden&&n&&e.push(n)}),e}),O=r(()=>ibiz.i18n.getLang().toLowerCase()),M=r(()=>{var e;const t=null==(e=u.controlParams.expandiconcolumn)?void 0:e.toLowerCase(),a=u.state.columnStates.find(e=>t&&e.key.toLowerCase()===t);if(a&&!a.hidden)return a.key});c([()=>h.value,()=>u.state.selectedData],([e,t])=>{!x&&e&&g(()=>{var e,a;u.state.singleSelect?t[0]?null==(e=h.value)||e.setSelected(t[0]):null==(a=h.value)||a.setSelected():(S.length=0,S.push(...t),t.forEach(e=>{var t;return null==(t=h.value)?void 0:t.setChecked(e,!0)}))})});let N=!1;const L=[],R=(e,t)=>{e.forEach(e=>e.parentElement!==t&&(null==t?void 0:t.append(e)))},_=()=>{var e;const t=null==(e=h.value)?void 0:e.getElementRefs().rootRef.value,a=Object.values((()=>{var e;const t={},a=null==(e=document.querySelector(".el-popover"))?void 0:e.parentElement;return a&&Object.assign(t,{elPopover:a}),t})()).filter(e=>e&&e.parentElement===document.body);L.push(...a),R(a,t)},j=(e,t)=>{C||f.value?f.value=!1:(x=!0,u.onTreeNodeClick(e,t),C=!0,setTimeout(()=>{C=!1,x=!1},200))},V=e=>{u.onDbTreeNodeClick(e)};u.evt.on("onNewRow",e=>{var t;const a=e.row.data;null==(t=h.value)||t.setExpand(a)});const F=(e,t,a,i)=>{const o=[];return e.forEach(e=>{var s;if("SEPERATOR"===e.itemType)return void o.push({divided:"self"});const l=i[e.id];if(l&&!l.visible)return;const r={};if(e.showCaption&&e.caption&&(r.label=e.caption),e.sysImage&&e.showIcon&&(r.icon=n(y,{icon:e.sysImage},null)),"DEUIACTION"===e.itemType){r.disabled=l.disabled,r.clickClose=!0;const{uiactionId:n}=e;n&&(r.onClick=()=>{u.doUIAction(n,t,a,e.appId)})}else if("RAWITEM"===e.itemType){const{rawItem:t}=e;t&&(r.label=n(w,{rawItem:e},null))}else"ITEMS"===e.itemType&&(null==(s=e.detoolbarItems)?void 0:s.length)&&(r.children=F(e.detoolbarItems,t,a,i));o.push(r)}),o};let U;u.evt.on("onMounted",()=>{if(Object.values(u.contextMenus).length>0){(()=>t.import("@imengyu/vue3-context-menu"))().then(e=>{U=e.default,U.default&&!U.showContextMenu&&(U=U.default)})}});const H=(e,t)=>l(Z,{data:t,modelData:e,context:u.context,params:u.params}),q=(e,t)=>{var a;if(v)return;const i=N&&(null==(a=h.value)?void 0:a.getElementRefs().rootRef.value),o=(e=>{var t;let a;const n=u.getNodeModel(e);return null==(t=null==n?void 0:n.controlRenders)||t.forEach(e=>{"LAYOUTPANEL"===e.renderType&&"nodelinkrender"!==(e.id||"").split("_")[0]&&(a=e.layoutPanel)}),a})(e._nodeId),s=o?H(o,e._deData):(r=e,n("div",{class:m.em("slider","container")},[n("div",{class:m.em("slider","container-title")},[n("div",{class:"number"},[r._icon&&n(y,{class:"icon",icon:r._icon},null),r._snDataItemValue]),n("div",{class:"caption"},[r._text])])]));var r;v=ibiz.overlay.createPopover(e=>l(s,{modal:e}),void 0,{width:"auto",height:"auto",noArrow:!0,placement:"bottom",modalClass:m.e("slider-popover"),appendTo:i}),null==v||v.present(t.target.children[0])},W=()=>{null==v||v.dismiss(),v=null},Y=()=>n(i("x-gantt-slider"),{"allow-link":!1,"resize-mode":"dragonly",move:u.state.sliderDraggable,"resize-left":u.state.sliderDraggable,"resize-right":u.state.sliderDraggable},{content:({row:e,left:t})=>{const{sysCss:a}=u.getNodeModel(e._nodeId),i=(null==a?void 0:a.cssName)||"",o=t<0?"".concat(-t,"px"):"",s=null==e?void 0:e._text;return n("div",{class:[m.e("slider"),i],onClick:t=>j(e,t),onDblclick:()=>V(e),onContextmenu:t=>(async(e,t)=>{t.stopPropagation(),t.preventDefault();const a=u.getNodeModel(e._nodeId);if(!(null==a?void 0:a.decontextMenu))return;const n=u.contextMenus[a.decontextMenu.id];if(!n.model.detoolbarItems)return;await n.calcButtonState(e._deData||(e.srfkey?e:void 0),a.appDataEntityId,{view:u.view,ctrl:u});const i=n.state.buttonsState,o=F(n.model.detoolbarItems,e,t,i);o.length&&U.showContextMenu({x:t.x,y:t.y,customClass:m.b("context-menu"),items:o})})(e,t),onMouseenter:t=>q(e,t),onMouseleave:W},[n("div",{class:m.em("slider","caption"),style:{marginLeft:o},title:s,innerHTML:s},null)])}}),K=async(e,t,a)=>{var n;const i=(e=>{var t;let a;const n=u.getNodeModel(e);return null==(t=null==n?void 0:n.controlRenders)||t.find(e=>"LAYOUTPANEL"===e.renderType&&"nodelinkrender"===(e.id||"").split("_")[0]&&(a=e.layoutPanel,!0)),a})(e._nodeId);if(b||!i)return;const o=N&&(null==(n=h.value)?void 0:n.getElementRefs().rootRef.value),s=H(i,t);b=ibiz.overlay.createPopover(e=>l(s,{modal:e}),void 0,{width:"auto",height:"auto",noArrow:!0,autoClose:!0,modalClass:m.e("link-path-popover"),appendTo:o}),null==b||b.present(a.currentTarget),await b.onWillDismiss(),b=null};return{c:u,ns:m,ganttRef:h,isInited:p,data:T,locale:O,columns:A,onCheck:(e,t)=>{if(x=!0,e)S.push(t);else{const e=S.findIndex(e=>e._id===t._id);e>-1&&S.splice(e,1)}u.setSelection(S),setTimeout(()=>{x=!1},200)},loading:z,expandColumnName:M,ganttStyle:k,onNodeClick:j,onNodeDbClick:V,onNodeExpand:e=>{u.onExpandChange(e,!0),e&&!e._children&&u.refreshNodeChildren(e)},onNodeCollapse:e=>{u.onExpandChange(e,!1)},renderContent:()=>[...A.value.map((e,t)=>(e=>{const{caption:t,codeName:a,width:o,headerSysCss:s,align:r}=e,c=u.columns[a],d=u.state.columnStates.find(e=>e.key===a);let h=30;return d&&d.columnWidth?h=d.columnWidth>30?d.columnWidth:30:o&&o>30&&(h=o),n(i("x-gantt-column"),{label:t,prop:a,width:h,center:"center"===(null==r?void 0:r.toLowerCase())},{title:()=>n("div",{class:null==s?void 0:s.cssName},[t]),default:({row:e})=>{const t=u.getRowState(e._id);if(t){const e=i(u.providers[a].component);return l(e,{controller:c,row:t,key:t.data._uuid+a})}return null}})})(e)),Y()],renderSetting:()=>!u.controlParams.enablecustomized||u.controlParams.enablecustomized&&"false"===u.controlParams.enablecustomized?null:n("div",{class:m.e("setting"),onClick:()=>(async()=>{let e=0;u.controlParams.limitsize&&(e=Number(u.controlParams.limitsize));const t=await ibiz.overlay.modal(t=>{const a=i("IBizGanttSetting"),n={modal:t,columnStates:u.state.columnStates,limitsize:e};return u.state.mustShowColumns&&(n.mustShowColumns=u.state.mustShowColumns),l(a,n)},void 0,{width:"auto",height:"auto"});t.ok&&t.data&&t.data.length>0&&u.setColumnVisible(t.data)})(),title:Tt(ibiz.i18n.t("control.gantt.hideControl"))},[n("svg",{class:m.em("setting","icon"),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false"},[n("g",{"stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M11.405 13.975l3.398-5.889L11.405 2.2H4.607L1.208 8.087l3.399 5.889h6.798zm1.023-12.4l3.43 5.938c.205.356.205.793 0 1.149l-3.43 5.938a1.147 1.147 0 0 1-.993.574H4.577c-.41 0-.789-.218-.994-.573L.153 8.66a1.153 1.153 0 0 1 0-1.147l3.43-5.94c.205-.356.584-.575.994-.575h6.858c.409 0 .788.22.993.576zM8.006 9.879c.988 0 1.792-.804 1.792-1.792s-.804-1.792-1.792-1.792-1.792.804-1.792 1.792.804 1.792 1.792 1.792zm0-4.784a2.993 2.993 0 1 1-.002 5.985 2.993 2.993 0 0 1 .002-5.985z"},null)])])]),onSliderMove:e=>{var t;const a=null==(t=e[0])?void 0:t.row,n={begin:a._beginDataItemValue?as(a._beginDataItemValue).format("YYYY-MM-DD HH:mm:ss"):void 0,end:a._endDataItemValue?as(a._endDataItemValue).format("YYYY-MM-DD HH:mm:ss"):void 0};f.value=!0,u.modifyNodeTime(a,n)},renderNoData:()=>{const{isLoaded:e}=u.state,t={};return ce(u)&&Object.assign(t,{customRender:()=>n(de,{controller:u},null)}),e&&n(i("iBizNoData"),{text:u.model.emptyText,emptyTextLanguageRes:u.model.emptyTextLanguageRes},"function"==typeof(a=t)||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?t:{default:()=>[t]});var a},allowDrop:(e,t,a)=>{const n=df(e._uuid,u),i=df(t._uuid,u);return u.calcAllowDrop(n,i,a)},allowDrag:e=>{const t=df(e._uuid,u);return u.calcAllowDrag(t)},handleDrop:(e,t,a)=>{const n=df(e._uuid,u),i=df(t._uuid,u),o=uf(a);u.onNodeDrop(n,i,o)},onHeaderDragend:(e,t)=>{const a=u.state.columnStates.filter(e=>{var t;const a=null==(t=u.columns[e.key])?void 0:t.model;return!e.hidden&&a});a&&a[e]&&(a[e].columnWidth=t,u.saveColumnState())},handleClickLink:(e,t)=>{if(e&&t){const a=u.state.links.find(t=>t._uuid===e.id);a&&K(a._fromData,a._deData,t)}},handleFullscreenChange:e=>{N=e,e?_():(()=>{const e=L.filter(e=>!!e);L.length=0,R(e,document.body)})()}}},render(){var e;return this.isInited?b(n(i("iBizControlBase"),{controller:this.c,class:[this.ns.b(),(null==(e=this.data)?void 0:e.length)?"":this.ns.m("empty")]},{default:()=>[n(i("x-gantt"),{ref:"ganttRef","data-id":"_id",data:this.data,links:this.c.state.links,"row-height":46,"expand-all":!1,headerDrag:!0,"start-key":"_beginDataItemValue","end-key":"_endDataItemValue",children:"_children",leaf:"_leaf","expand-key":"_defaultExpand","link-props":{fromKey:"_from",toKey:"_to",linkKey:"_uuid"},locale:this.locale,unit:this.c.state.unit,draggable:{level:"all",draggable:!1,draggableStateKey:"_draggable"},"allow-drop":this.allowDrop,"allow-drag":this.allowDrag,onNodeDrop:this.handleDrop,expandColumnName:this.expandColumnName,showCheckbox:!this.c.state.singleSelect,onNodeExpand:this.onNodeExpand,onNodeCollapse:this.onNodeCollapse,onRowClick:this.onNodeClick,onRowDblClick:this.onNodeDbClick,onRowChecked:this.onCheck,onHeaderDragend:this.onHeaderDragend,onMoveSlider:this.onSliderMove,onClickLink:this.handleClickLink,onFullscreenChange:this.handleFullscreenChange,primaryColor:this.ganttStyle.primaryColor,headerStyle:{textColor:this.ganttStyle.textColor,bgColor:this.ganttStyle.headerBgColor},borderColor:this.ganttStyle.borderColor,enableDateCompletion:!0,bodyStyle:{todayColor:this.ganttStyle.todayColor,weekendColor:this.ganttStyle.headerBgColor,bgColor:this.ganttStyle.bgColor,selectColor:this.ganttStyle.headerBgColor}},{default:()=>this.renderContent(),empty:()=>this.renderNoData(),setting:()=>this.renderSetting()})]}),[[C("loading"),this.loading]]):null}});var lx=Object.defineProperty,rx=(e,t,a)=>(((e,t,a)=>{t in e?lx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class cx{constructor(){rx(this,"component","IBizGanttControl")}}const dx=e("aD",ie(sx,function(e){e.component(sx.name,sx),Ha(qa.GANTT,()=>new cx)}));const ux=a({name:"IBizContextMenuControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},mode:{type:String,default:"buttons"},groupLevelKeys:{type:Object,default:[50]},nodeData:{type:Object,required:!0},nodeModel:{type:Object,required:!0},actionCallBack:{type:Function}},setup(e,{emit:t}){const a=ne((...e)=>new yi(...e)),s=B("context-menu"),l=e.modelData.detoolbarItems,r=o([]),d=o([]),u=o(),{popoverVisible:h,setPopoverVisible:p}=L(u,e=>e.ref),m=o(),{popoverid:v,setPopoverZIndex:g}=fe(),b=e=>{Array.isArray(e)&&e.forEach(e=>{e.capLanguageRes&&e.capLanguageRes.lanResTag&&(e.caption=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption)),e.tooltipLanguageRes&&e.tooltipLanguageRes.lanResTag&&(e.tooltip=ibiz.i18n.t(e.tooltipLanguageRes.lanResTag,e.tooltip)),b(e.detoolbarItems)})};l&&(b(l),l.forEach(t=>{t.actionLevel&&-1===e.groupLevelKeys.findIndex(e=>e===t.actionLevel)?r.value.push(t):d.value.push(t)}));const f=e=>{var t;const{actionLevel:n}=e;return[s.e("item"),"".concat(null==(t=null==e?void 0:e.sysCss)?void 0:t.cssName),s.em("item","level-".concat(n)),s.is("disabled",a.state.buttonsState[e.id].disabled)]};c(()=>e.nodeData,async(t,n)=>{t!==n&&await a.calcButtonState(t._deData||(t.srfkey?t:void 0),e.nodeModel.appDataEntityId)}),a.evt.on("onCreated",async()=>{await a.calcButtonState(e.nodeData._deData||(e.nodeData.srfkey?e.nodeData:void 0),e.nodeModel.appDataEntityId)});const w=async(a,n)=>{n.stopPropagation(),a.uiactionId?(e.actionCallBack&&await e.actionCallBack(a,n),"buttons"===e.mode?p(!1):m.value&&m.value.handleClose(),e.actionCallBack||t("action-click",a,n)):p(!1)},y=e=>n(i("el-divider"),{class:s.e("separator"),"border-style":"double",direction:e?"vertical":"horizontal"},null),C=(e,t=!0)=>a.state.buttonsState[e.id].visible?[e.addSeparator&&y(t),n(i("el-button"),{text:!0,size:"small",title:Tt(e.tooltip),class:f(e),disabled:a.state.buttonsState[e.id].disabled,onClick:t=>w(e,t)},{default:()=>[n("div",{class:s.e("action-content")},[e.showIcon&&e.sysImage&&n("div",{class:s.e("action-content-icon")},[n(i("iBizIcon"),{icon:e.sysImage},null)]),e.showCaption?n("div",{class:s.e("action-content-caption")},[e.caption]):""])]})]:null,I=(e,t=!0)=>e.map(e=>{var o;return(null==(o=a.state.buttonsState[e.id])?void 0:o.visible)?"SEPERATOR"===e.itemType?y(t):"DEUIACTION"===e.itemType?C(e,t):"ITEMS"===e.itemType?((e,t=!0)=>{var o,l,r;const{groupExtractMode:c,uiactionGroup:d}=e;let u=e;if(d&&"ITEM"===c)return null==(o=null==d?void 0:d.uiactionGroupDetails)?void 0:o.map(e=>C(e,t));const h=null==(r=null==(l=e.uiactionGroup)?void 0:l.uiactionGroupDetails)?void 0:r.filter(e=>a.state.buttonsState[e.id].visible);return d&&"ITEMX"===c&&h&&(u=h[0]),u?n(i("el-popover"),{placement:"right-start","popper-class":s.e("popover"),teleported:!1,"popper-options":{modifiers:[{name:"offset",options:{offset:[0,4]}}]}},{reference:()=>n(i("el-button"),{text:!0,size:"small",onClick:e=>w(u,e),title:Tt(u.tooltip),class:f(u),disabled:a.state.buttonsState[u.id].disabled},{default:()=>[n("div",{class:s.e("action-content")},[u.showIcon&&u.sysImage&&n("div",{class:s.e("action-content-icon")},[n(i("iBizIcon"),{icon:u.sysImage},null)]),u.showCaption?n("div",{class:[s.e("action-content-caption"),s.e("action-content-group-caption")]},[u.caption]):"",n("ion-icon",{class:s.e("action-content-group-icon"),name:"chevron-forward-outline"},null)])]}),default:()=>d?null==h?void 0:h.map((e,a)=>"ITEMX"===c&&0===a?null:C(e,t)):I(e.detoolbarItems||[],t)}):void 0})(e,t):null:null});return{c:a,ns:s,popoverid:v,expandDetails:r,groupDetails:d,groupButtonRef:u,dropdownRef:m,popoverVisible:h,handleClick:w,renderActions:I,renderActionButton:C,calcActionItemClass:f,setPopoverZIndex:g,actionDetails:l}},render(){const e=this.actionDetails||[],t=()=>{let e;if(0===this.groupDetails.length)return null;if(!(-1!==this.groupDetails.findIndex(e=>!0===this.c.state.buttonsState[e.id].visible)))return null;const t=-1===this.groupDetails.findIndex(e=>!1===this.c.state.buttonsState[e.id].disabled);return[n(i("el-button"),{size:"small",text:!0,disabled:t,ref:"groupButtonRef",class:[this.ns.e("item"),this.ns.is("expand",this.popoverVisible)],onClick:()=>{this.popoverVisible=!this.popoverVisible}},{icon:()=>n("ion-icon",{class:this.ns.e("icon"),name:"ellipsis-vertical"},null)}),n(i("el-popover"),{placement:"bottom-start","virtual-ref":this.groupButtonRef,visible:this.popoverVisible,"popper-class":[this.popoverid,this.ns.e("popover"),this.ns.e("transfer")],"virtual-triggering":!0,transition:"none","onBefore-enter":()=>this.setPopoverZIndex("--".concat(this.ns.namespace,"-context-menu-transfer-zindex"))},(a=e=this.renderActions(this.groupDetails,!1),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?e:{default:()=>[e]}))];var a};if(this.c.state.buttonsState.visible)return"buttons"===this.mode?n("div",{class:[this.ns.b(),this.ns.m("buttons")],onClick:e=>e.stopPropagation()},[this.renderActions(this.expandDetails),t()]):n(i("el-dropdown"),{ref:"dropdownRef",onCommand:e=>this.handleClick(e,new MouseEvent("click")),"onVisible-change":()=>this.setPopoverZIndex("--".concat(this.ns.namespace,"-context-menu-transfer-zindex")),"popper-class":[this.popoverid,this.ns.e("transfer")],class:[this.ns.b(),this.ns.m("dropdown")]},{default:()=>n("span",{class:this.ns.e("caption")},[n("ion-icon",{class:this.ns.e("caption-icon"),name:"ibiz-arrow-down"},null)]),dropdown:()=>n(i("el-dropdown-menu"),null,{default:()=>[e.length>0&&e.map(e=>{var t;return(null==(t=this.c.state.buttonsState[e.id])?void 0:t.visible)?n(i("el-dropdown-item"),{class:[this.ns.e("item"),this.ns.is("disabled",!1)],title:Tt(e.tooltip),disabled:this.c.state.buttonsState[e.id].disabled,command:e},{default:()=>[e.showIcon&&e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),e.showCaption?e.caption:""]}):null})]})})}});var hx=Object.defineProperty,px=(e,t,a)=>(((e,t,a)=>{t in e?hx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class mx{constructor(){px(this,"component","IBizContextMenuControl")}}const vx=e("aE",ie(ux,function(e){e.component(ux.name,ux),Ha(qa.CONTEXT_MENU,()=>new mx)})),gx=a({name:"IBizViewPanelControl",props:{modelData:{type:Object,required:!0},context:{type:Object,required:!0},params:{type:Object,default:()=>({})},provider:{type:Object}},setup(){var e;const t=ne((...e)=>new Ci(...e)),a=B("control-".concat(null==(e=t.model.controlType)?void 0:e.toLowerCase()));return{c:t,ns:a,onCreated:e=>{e&&e.view&&t.setEmbedView(e.view)}}},render(){return n(i("iBizControlBase"),{controller:this.c},{default:()=>[this.c.state.isCreated&&(this.$slots.default?this.$slots.default({context:this.c.context,params:this.c.params,onCreated:this.onCreated}):l(i("IBizViewShell"),{context:this.c.context,params:this.c.params,viewId:this.c.model.embeddedAppDEViewId,onCreated:this.onCreated}))]})}});var bx=Object.defineProperty,fx=(e,t,a)=>(((e,t,a)=>{t in e?bx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class wx{constructor(){fx(this,"component","IBizViewPanelControl")}}const yx=e("aF",ie(gx,function(e){e.component(gx.name,gx),Ha(qa.VIEWPANEL,()=>new wx)}));var Cx=Object.defineProperty,Ix=(e,t,a)=>(((e,t,a)=>{t in e?Cx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class xx extends Ii{constructor(){super(...arguments),Ix(this,"rawItemParams",{})}async onInit(){await super.onInit(),this.handleRawItemParams()}handleRawItemParams(){var e;const t=null==(e=this.model.rawItem)?void 0:e.rawItemParams;Array.isArray(t)&&t.forEach(e=>{const t=e.key,a=e.value;t&&a&&(this.rawItemParams[t.toLowerCase()]=a)})}}const Sx=a({name:"IBizAuthUserinfo",props:{modelData:{type:Object,required:!0},controller:{type:xx,required:!0}},setup(e){var t;const a=B("user-info"),n=e.controller,{srfusername:i=ibiz.i18n.t("panelComponent.authUserinfo.visitor"),loginname:o}=(null==(t=ibiz.appData)?void 0:t.context)||{},s=hs(),l=A("ctx",void 0),c=r(()=>(null==l?void 0:l.view)&&l.view.model.mainMenuAlign||"LEFT"),d=r(()=>{const{strictly:e}=n.rawItemParams;return(!e||"true"!==e)&&n.panel.view.state.isCollapse}),u=r(()=>{const{readonly:e}=n.rawItemParams;return"true"===e});return{ns:a,c:n,onClick:()=>{ibiz.hub.controller.logout()},srfusername:i,loginname:o,router:s,menuAlign:c,isCollapse:d,isReadonly:u}},render(){return n("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("left","LEFT"===this.menuAlign),this.ns.is("top","TOP"===this.menuAlign),this.ns.is("collapse",this.isCollapse),this.ns.is("readonly",this.isReadonly)]},[n(i("el-dropdown"),{disabled:this.isReadonly},{default:()=>n("div",{class:[this.ns.b("info"),this.ns.is("collapse",this.isCollapse)]},[n("div",{class:this.ns.b("label")},[n(i("el-avatar"),{class:this.ns.b("avatar"),src:"./assets/images/user-avatar.png"},null),n("div",{class:[this.ns.b("name"),this.ns.is("collapse",this.isCollapse)]},[n("div",{class:this.ns.be("name","user-name")},[this.srfusername]),"LEFT"===this.menuAlign&&this.loginname&&n("div",{class:this.ns.be("name","person-name")},[this.loginname])])]),n("ion-icon",{class:[this.ns.e("down"),this.ns.is("collapse",this.isCollapse)],name:"chevron-down-outline"},null)]),dropdown:()=>n(i("el-dropdown-menu"),null,{default:()=>[n(i("el-dropdown-item"),null,{default:()=>[n("ion-icon",{name:"log-out-outline",class:this.ns.e("icon")},null),n("span",{onClick:this.onClick},[ibiz.i18n.t("app.logout")])]})]})})])}});var Ex=Object.defineProperty,Dx=(e,t,a)=>(((e,t,a)=>{t in e?Ex(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Px{constructor(){Dx(this,"component","IBizAuthUserinfo")}async createController(e,t,a){const n=new xx(e,t,a);return await n.init(),n}}const kx=e("aH",ie(Sx,function(e){e.component(Sx.name,Sx),xi("RAWITEM_AUTH_USERINFO",()=>new Px)}));var zx=Object.defineProperty,Tx=(e,t,a)=>(((e,t,a)=>{t in e?zx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Ax extends Si{constructor(){super(...arguments),Tx(this,"currentKey",""),Tx(this,"cacheKeys",["RouterShell"]),Tx(this,"navViewMsgs",{}),Tx(this,"operateSort",[])}}e("aI",Ax);var Ox=Object.defineProperty,Mx=(e,t,a)=>(((e,t,a)=>{t in e?Ox(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Nx extends Ii{constructor(){super(...arguments),Mx(this,"viewModals",{}),Mx(this,"router"),Mx(this,"autoGoLast",!0),Mx(this,"noCache",!1),Mx(this,"rawItemParams",{}),Mx(this,"currentKey","")}createState(){var e;return new Ax(null==(e=this.parent)?void 0:e.state)}setRouter(e){this.router=e}get routeDepth(){return this.panel.view.modal.routeDepth}get navTabs(){return this.panel.panelItems.nav_tabs}get navBreadcrumb(){return this.panel.panelItems.nav_breadcrumb}get appmenu(){return this.panel.getController("appmenu")}async onInit(){await super.onInit(),this.handleRawItemParams(),this.noCache="NO_CACHE"===this.rawItemParams.expcache}changeView(e){var t;const a=this.state.navViewMsgs[e];(null==a?void 0:a.fullPath)&&(null==(t=this.router)||t.push(a.fullPath))}onRouteChange({currentKey:e,fullPath:t}){if(this.state.currentKey!==e){if(this.state.cacheKeys.includes(e)&&this.router&&this.router.currentRoute.value.matched.length===this.routeDepth+1){const a=this.state.navViewMsgs[e].fullPath;if(a!==t)return void setTimeout(()=>{this.router.replace({path:a})},0)}this.state.currentKey=e,this.navTabs&&(this.navTabs.state.currentKey=e)}if(""===e)return;this.currentKey=e;const a=this.state.operateSort.indexOf(e);-1!==a&&this.state.operateSort.splice(a,1),this.state.operateSort.push(e),this.state.cacheKeys.includes(e)||(this.state.cacheKeys.push(e),this.routeDepth&&(this.viewModals[e]=new ca({mode:da.ROUTE,viewUsage:1,routeDepth:this.routeDepth+1,dismiss:t=>{this.dismiss(e,t)}}))),this.state.navViewMsgs[e]?this.state.navViewMsgs[e].fullPath=t:(ibiz.log.debug("维护导航视图信息",e,t),this.state.navViewMsgs[e]={key:e,fullPath:t},R.active(e))}onViewCreated(e){const{view:t}=e,a=this.state.currentKey,n="".concat(t.model.codeName,"-").concat(t.id);this.navTabs&&(this.navTabs.updateViewInfo(a,{viewKey:n,caption:t.model.caption,sysImage:t.model.sysImage}),t.evt.on("onViewInfoChange",({caption:e,dataInfo:t})=>{this.navTabs.updateViewInfo(a,{viewKey:n,caption:e,dataInfo:t})})),this.navBreadcrumb&&(this.navBreadcrumb.updateViewInfo(a,{viewName:t.model.codeName,caption:t.model.caption}),t.evt.on("onViewInfoChange",({caption:e,dataInfo:n})=>{this.navBreadcrumb.updateViewInfo(a,{viewName:t.model.codeName,caption:e,dataInfo:n})}),t.evt.on("onActivated",()=>{const e=t.state.srfactiveviewdata,n={viewName:t.model.codeName,caption:t.model.caption};e&&e.srfkey&&Object.assign(n,{dataInfo:e.srfmajortext||""}),this.navBreadcrumb.updateViewInfo(a,n)}))}removeCache(e){const t=this.state.cacheKeys.indexOf(e);if(-1!==t){this.state.cacheKeys.splice(t,1),delete this.viewModals[e],delete this.state.navViewMsgs[e];const a=this.state.operateSort.indexOf(e);-1!==a&&this.state.operateSort.splice(a,1)}}clearCache(){this.state.cacheKeys=[],this.viewModals={}}async closeViewByKeys(e){this.autoGoLast=!1;for(let t=0;t<e.length;t++){const a=e[t],n=this.viewModals[a];await n.dismiss()}this.goLast(),this.autoGoLast=!0}dismiss(e,t){R.close(e,t),this.navTabs&&this.navTabs.removeCache(e),this.navBreadcrumb&&this.navBreadcrumb.removeCache(e),this.removeCache(e),this.autoGoLast&&this.goLast()}goLast(){const e=this.state.operateSort.pop();if(e){if(this.state.currentKey===e)return void this.state.operateSort.push(e);const t=this.state.navViewMsgs[e].fullPath;this.router.push(t)}else{const e=this.router.currentRoute.value,{appContext:t}=e.params;let a="/".concat(t);for(let t=1;t<=this.routeDepth;t++)a+="/".concat(e.params["view".concat(t)],"/").concat(ibiz.env.routePlaceholder);this.router.push(a),ibiz.util.setBrowserTitle("")}}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}}e("aJ",Nx);const Bx=a({name:"IBizNavPosIndex",props:{modelData:{type:Object,required:!0},controller:{type:Nx,required:!0}},setup(e){var t;const a=e.controller,n=B("nav-pos-index"),i=hs();if(a.setRouter(i),a.routeDepth&&(ve(e=>{a.onRouteChange(e)},a.routeDepth+1),"APPINDEXVIEW"===a.panel.view.model.viewType&&!a.navTabs)){const e=us();let n="";null==(t=a.appmenu)||t.evt.on("onClick",()=>{n=e.fullPath}),i.beforeEach((e,t,i)=>{t.fullPath===n&&a.clearCache(),i()})}return{ns:n,onViewCreated:e=>{a.onViewCreated(e)},c:a}},render(){const{state:e,viewModals:t}=this.c,{currentKey:a,cacheKeys:o}=e;if(a)return n("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass,this.ns.is("no-nav",ibiz.config.view.disableHomeTabs)]},[this.c.routeDepth?n(i("iBizRouterView"),{manualKey:a,modal:t[a],onCreated:this.onViewCreated},{default:({Component:e})=>this.c.noCache?e?n(e,null,null):null:n(i("keepAlive"),{include:o,max:30,isKey:!0},{default:()=>[e&&n(e,null,null)]})}):n("div",null,[ibiz.i18n.t("panelComponent.navPosIndex.noSupportPrompt")])])}});var Lx=Object.defineProperty,Rx=(e,t,a)=>(((e,t,a)=>{t in e?Lx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class _x{constructor(){Rx(this,"component","IBizNavPosIndex")}async createController(e,t,a){const n=new Nx(e,t,a);return await n.init(),n}}const jx=e("aK",ie(Bx,function(e){e.component(Bx.name,Bx),xi("RAWITEM_NAV_POS_INDEX",()=>new _x)}));var Vx=Object.defineProperty,Fx=(e,t,a)=>(((e,t,a)=>{t in e?Vx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Ux extends Si{constructor(){super(...arguments),Fx(this,"currentKey",""),Fx(this,"tabItems",[]),Fx(this,"activeTab","")}}class Hx extends Ii{createState(){var e;return new Ux(null==(e=this.parent)?void 0:e.state)}get routeDepth(){return this.panel.view.modal.routeDepth}get navPos(){return this.panel.panelItems.nav_pos_index}findTabItem(e){return this.state.tabItems.find(t=>t.key===e)}findTabItemByViewKey(e){return this.state.tabItems.find(t=>t.viewKey===e)}onTabClick(e){var t;null==(t=this.navPos)||t.changeView(e)}updateViewInfo(e,t){const a=t.viewKey?this.findTabItemByViewKey(t.viewKey):this.findTabItem(e);a?(Object.assign(a,To(Po,t)),this.refreshItemUI(e)):(this.state.tabItems.push({key:e,...t}),this.state.activeTab=this.state.currentKey)}removeCache(e){const t=this.state.tabItems.findIndex(t=>t.key===e);-1!==t&&this.state.tabItems.splice(t,1)}onTabRemove(e){var t;null==(t=this.navPos)||t.closeViewByKeys([e])}removeOther(){var e;const t=this.state.currentKey,a=[];this.state.tabItems.forEach(e=>{e.key!==t&&a.push(e.key)}),a.length>0&&(null==(e=this.navPos)||e.closeViewByKeys(a))}removeAll(){var e;const t=this.state.tabItems.map(e=>e.key);t.length>0&&(null==(e=this.navPos)||e.closeViewByKeys(t))}refreshItemUI(e){const t={key:"exampleItem",caption:""};this.state.tabItems.push(t),this.state.activeTab=t.key,g(()=>{this.state.tabItems.pop(),this.state.activeTab=e})}}function qx(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const Gx=a({name:"IBizNavTabs",props:{modelData:{type:Object,required:!0},controller:{type:Hx,required:!0}},setup(e){const t=B("nav-tabs"),a=e.controller,{state:n}=e.controller,i=[{text:ibiz.i18n.t("panelComponent.navTabs.closeAll"),value:"closeAll"},{text:ibiz.i18n.t("panelComponent.navTabs.closeOther"),value:"closeOther"}];return c(()=>a.state.currentKey,(e,t)=>{if(e!==t){a.findTabItem(e)&&(n.activeTab=e)}}),{ns:t,actions:i,changePage:e=>{n.currentKey!==e.paneName&&a.onTabClick(e.paneName)},onTabRemove:e=>{a.onTabRemove(e)},handleCommand:e=>{"closeAll"===e.value?a.removeAll():"closeOther"===e.value&&a.removeOther()}}},render(){let e;const{state:t}=this.controller;if(!ibiz.config.view.disableHomeTabs)return n("div",{class:[this.ns.b(),...this.controller.containerClass]},[n("div",{class:this.ns.e("left")},[n(i("el-tabs"),{type:"card",modelValue:t.activeTab,"onUpdate:modelValue":e=>t.activeTab=e,closable:!0,onTabClick:this.changePage,onTabRemove:this.onTabRemove},qx(e=t.tabItems.map(e=>{let t=e.caption;return e.dataInfo&&(t+=" - ".concat(e.dataInfo)),n(i("el-tab-pane"),{name:e.key,key:e.key,label:t},{label:()=>n("div",{class:this.ns.em("left","content")},[n(i("iBizIcon"),{class:this.ns.em("left","icon"),icon:e.sysImage},null),n("div",{class:this.ns.em("left","caption"),title:Tt(t)},[t])])})}))?e:{default:()=>[e]})]),n("div",{class:this.ns.e("right")},[n(i("el-dropdown"),{onCommand:this.handleCommand},{default:()=>n(i("el-button"),{size:"small",type:"primary"},{default:()=>[ibiz.i18n.t("app.more"),n("ion-icon",{name:"arrow-down"},null)]}),dropdown:()=>{let e;return n(i("el-dropdown-menu"),null,qx(e=this.actions.map(e=>n(i("el-dropdown-item"),{command:e},{default:()=>[e.text]})))?e:{default:()=>[e]})}})])])}});var Wx=Object.defineProperty,Yx=(e,t,a)=>(((e,t,a)=>{t in e?Wx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Kx{constructor(){Yx(this,"component","IBizNavTabs")}async createController(e,t,a){const n=new Hx(e,t,a);return await n.init(),n}}const Xx=ie(Gx,function(e){e.component(Gx.name,Gx),xi("RAWITEM_NAV_TABS",()=>new Kx)});var $x=Object.defineProperty,Jx=(e,t,a)=>(((e,t,a)=>{t in e?$x(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Qx extends Si{constructor(){super(...arguments),Jx(this,"breadcrumbItems",[]),Jx(this,"menuTag","")}}function Zx(e){const t=ibiz.hub.getAppSourceModel(e.srfappid);if(t.getDefaultPSAppIndexView){return t.getDefaultPSAppIndexView.path.split("/").pop().replace(".json","")}return ibiz.hub.defaultAppIndexViewName}function eS(e){const t=ibiz.hub.getApp(e.srfappid).model.caption;return{viewName:Zx(e),fullPath:"/",type:"default",caption:t}}function tS(e){var t;return e.length>1&&(null==(t=e[1].params)?void 0:t.srfmenuitem)||""}async function aS(e,t,a){var n;if(!e)return;const i=t.allAppMenuItems.find(t=>t.id===e);if(i){const t=ibiz.hub.getApp(a.srfappid).getAppFunc(i.appFuncId),o=(null==(n=t.appViewId)?void 0:n.split(".").pop())||"",s=await ibiz.hub.config.view.get(o);return{tag:e,viewName:o,viewConfig:s,appFunc:t,menuItem:i}}}var nS=Object.defineProperty,iS=(e,t,a)=>(((e,t,a)=>{t in e?nS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class oS{constructor(e,t){this.navMode=e,this.context=t,iS(this,"chache",[])}add(e){this.chache.push(e),this.chache=this.chache.filter(e=>!e.isEmbed&&!e.isModal),"store"===this.navMode&&localStorage.setItem("breadcrumb",JSON.stringify(this.chache))}remove(e){const t=this.chache.findIndex(t=>t.fullPath===e);return-1!==t&&this.chache.splice(t,1),ko(this.chache)}removeAfter(e){if(0===this.chache.length)return[];const t=this.chache.findIndex(t=>t.fullPath===e);if(-1!==t){const e=this.chache.splice(t+1,this.chache.length);return"store"===this.navMode&&localStorage.setItem("breadcrumb",JSON.stringify(this.chache)),e}return[]}update(e){if(!this.chache.length&&"store"===this.navMode){const e=localStorage.getItem("breadcrumb");e&&(this.chache=JSON.parse(e))}const t=this.chache.findIndex(t=>t.fullPath&&t.fullPath===e.fullPath||t.viewName.toLowerCase()===e.viewName.toLowerCase());-1!==t&&(Object.assign(this.chache[t],To(Po,e)),this.chache=this.chache.filter(e=>!e.isEmbed&&!e.isModal),"store"===this.navMode&&localStorage.setItem("breadcrumb",JSON.stringify(this.chache)))}getItem(e){const{viewName:t="",fullPath:a=""}=e,n=Zx(this.context);if(t===n)return eS(this.context);const i=this.chache.find(e=>a&&e.fullPath===a||t&&e.viewName.toLowerCase()===t.toLowerCase());return i?ko(i):void 0}getChache(){if("store"===this.navMode){const e=localStorage.getItem("breadcrumb");return e?JSON.parse(e):[]}return"router"===this.navMode?ko(this.chache.filter(e=>!e.isEmbed)):ko(this.chache)}setChache(e){this.chache=ko(e),this.chache=this.chache.filter(e=>!e.isEmbed&&!e.isModal),"store"===this.navMode&&localStorage.setItem("breadcrumb",JSON.stringify(this.chache))}}var sS=Object.defineProperty,lS=(e,t,a)=>(((e,t,a)=>{t in e?sS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class rS extends Ii{constructor(){super(...arguments),lS(this,"separator","/"),lS(this,"navMode","router"),lS(this,"showHome",!0),lS(this,"service"),lS(this,"rawItemParams",{})}createState(){var e;return new Qx(null==(e=this.parent)?void 0:e.state)}get appmenu(){return this.panel.view.getController("appmenu")}get navPos(){return this.panel.panelItems.nav_pos_index}async onInit(){await super.onInit(),this.handleRawItemParams(),this.navMode=this.rawItemParams.navmode||"router",this.separator=this.rawItemParams.separator||"/",this.showHome="true"===this.rawItemParams.showhome,this.service=new oS(this.navMode,this.panel.context)}onCreated(e){"menu"===this.navMode&&this.setBreadcrumbByMenu(e),"store"===this.navMode&&this.setBreadcrumbByStore(e)}onRouteChange(e){if("router"!==this.navMode){if("store"===this.navMode){const{currentRoute:t}=e,a=Y(t.value),n=t.value.fullPath,i=function(e){var t;const{currentRoute:a}=e;return(null==(t=Y(a.value).pathNodes.pop())?void 0:t.viewName)||""}(e),o=tS(a.pathNodes),s=this.service.getItem({fullPath:n,viewName:i}),l=Zx(this.panel.context);if(s){if(s.viewName===l)return this.service.setChache([{...eS(this.panel.context),fullPath:n}]),void this.resetBreadcrumbs();this.service.update({...s,fullPath:n});this.service.removeAfter(n).forEach(e=>{var t;null==(t=this.navPos)||t.removeCache(e.fullPath)}),this.resetBreadcrumbs()}else this.state.menuTag!==o?this.setBreadcrumbByRouter(e):this.service.add({viewName:i,fullPath:n,type:"default"});this.state.menuTag=o}}else this.setBreadcrumbByRouter(e)}resetBreadcrumbs(){this.state.breadcrumbItems=this.service.getChache()}updateViewInfo(e,t){"menu"!==this.navMode&&(this.service.update({fullPath:e,type:"default",...t}),this.resetBreadcrumbs())}removeCache(e){this.service.remove(e)}async setBreadcrumbByRouter(e){const{currentRoute:t}=e,a=Y(t.value),{appContext:n={},pathNodes:i}=a,o=tS(i);let s=!1;const l=await aS(o,this.appmenu,this.panel.context),r=a.pathNodes.map(async(e,t)=>{this.appmenu&&l&&l.viewName===e.viewName&&(s=!0);const a=K({appContext:n,pathNodes:i.slice(0,t+1)}),o={viewName:e.viewName,fullPath:a,type:"default"},r=this.service.getItem({viewName:e.viewName});r&&(r.fullPath||(r.fullPath=a),Object.assign(o,r));const c=function(e,t){if(e===Ei.ROUTE_MODAL_TAG)return{viewName:e,fullPath:"",isModal:!0};const a=ibiz.appUtil.viewCacheCenter.get(e),n=Zx(t);if(a){let e=!1;a.parentView&&a.parentView.model.codeName!==n&&"APPINDEXVIEW"!==a.parentView.model.viewType&&(e=!0);const t=a.state.srfactiveviewdata,i={viewName:a.model.codeName,caption:a.model.caption,isEmbed:e};return t&&t.srfkey&&Object.assign(i,{dataInfo:t.srfmajortext||""}),i}}(e.viewName,this.panel.context);return c&&Object.assign(o,To(Po,c)),o}),c=await Promise.all(r);if(!s&&l){this.state.menuTag=l.tag;const e={viewName:l.viewName,caption:l.menuItem.caption,fullPath:"",type:"menuItem",menuTag:l.tag};c.splice(1,0,e)}this.service.setChache(c),this.resetBreadcrumbs()}setBreadcrumbByMenu(e){const{currentRoute:t}=e;let a;if(Y(t.value).pathNodes.some((e,t)=>{if(0===t)return!1;const{viewName:n}=e,i=(o=n,s=this.panel.context.srfappid,(ibiz.hub.getApp(s).model.appFuncs||[]).find(e=>{const{appViewId:t=""}=e,a=t.split(".").pop();return(null==a?void 0:a.toLowerCase())===o.toLowerCase()}));var o,s;return i&&(a=i),a}),this.appmenu){if(a){const e=function(e,t){const a=[],n=t=>t.find(t=>(t.appFuncId&&t.appFuncId===e.id||!!(t.appMenuItems&&t.appMenuItems.length>0&&n(t.appMenuItems)))&&(a.unshift(t),!0));return n(t),a}(a,this.appmenu.model.appMenuItems||[]),t=e.map(e=>({caption:e.caption,fullPath:"",type:"default",viewName:e.id}));t.unshift(eS(this.panel.context)),this.service.setChache(t),this.resetBreadcrumbs()}else this.service.setChache([eS(this.panel.context)]),this.resetBreadcrumbs();this.appmenu.evt.on("onClick",e=>{const{event:t}=e,a=t.map(e=>{const t=this.appmenu.allAppMenuItems.find(t=>t.id===e);if(t)return{caption:t.caption,fullPath:"",viewName:t.id}});a.unshift(eS(this.panel.context)),this.service.setChache(a),this.resetBreadcrumbs()})}}setBreadcrumbByStore(e){0===this.service.getChache().length?this.setBreadcrumbByRouter(e):this.resetBreadcrumbs(),this.appmenu&&this.appmenu.evt.on("onClick",async e=>{const{eventArg:t}=e,a=await aS(t,this.appmenu,this.panel.context);if(a){const{viewName:e,appFunc:t,viewConfig:n}=a;if("INDEXVIEWTAB"!==t.openMode||n&&n.openMode&&"INDEXVIEWTAB"!==n.openMode)return;const i=this.service.getItem({viewName:e}),o=[];i?o.push(i):o.push({viewName:e,fullPath:"",type:"default"}),o.unshift(eS(this.panel.context)),this.service.setChache(o),this.resetBreadcrumbs()}})}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}openMenuItemView(e,t){this.appmenu&&this.appmenu.onClickMenuItem(e.menuTag,t)}}function cS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const dS=a({name:"IBizNavBreadcrumb",props:{modelData:{type:Object,required:!0},controller:{type:rS,required:!0}},setup(e){const t=B("nav-breadcrumb"),a=e.controller,n=us(),i=hs();a.onCreated(i),c(()=>n.fullPath,()=>{a.onRouteChange(i)},{immediate:!0});const o=r(()=>{const{breadcrumbItems:e}=a.state;let t=e.filter(e=>e.caption);const n=Zx(a.panel.context);return a.showHome||(t=t.filter(e=>e.viewName!==n)),t});return{ns:t,c:a,items:o,onClick:(e,t)=>{"menuItem"===t.type&&(e.stopPropagation(),a.openMenuItemView(t,e))}}},render(){let e;return n("div",{class:[this.ns.b(),...this.controller.containerClass,this.ns.m(this.c.navMode)]},[n(i("el-breadcrumb"),{separator:this.c.separator},cS(e=this.items.map(e=>{let t=e.caption;return e.dataInfo&&(t+=" - ".concat(e.dataInfo)),n(i("el-breadcrumb-item"),{class:this.ns.is("link","menuItem"===e.type),to:e.fullPath,onClick:t=>this.onClick(t,e)},cS(t)?t:{default:()=>[t]})}))?e:{default:()=>[e]})])}});var uS=Object.defineProperty,hS=(e,t,a)=>(((e,t,a)=>{t in e?uS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class pS{constructor(){hS(this,"component","IBizNavBreadcrumb")}async createController(e,t,a){const n=new rS(e,t,a);return await n.init(),n}}const mS=ie(dS,function(e){e.component(dS.name,dS),xi("RAWITEM_NAV_BREADCRUMB",()=>new pS)});var vS=Object.defineProperty,gS=(e,t,a)=>(((e,t,a)=>{t in e?vS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class bS extends Si{constructor(){super(...arguments),gS(this,"loading",!1),gS(this,"uiActionState")}}class fS extends Ii{createState(){var e;return new bS(null==(e=this.parent)?void 0:e.state)}get data(){return this.dataParent.data}constructor(e,t,a){super(e,t,a),this.state.uiActionState=this.createUIActionState()}async onInit(){await super.onInit(),this.updateButtonState()}createUIActionState(){const{uiactionId:e,name:t}=this.model;return new Di(t,this.panel.context.srfappid,e)}async dataChangeNotify(e){await this.updateButtonState(),super.dataChangeNotify(e)}async panelStateNotify(e){await this.updateButtonState(),super.panelStateNotify(e)}async updateButtonState(){await this.state.uiActionState.update(this.panel.context,this.data,this.panel.model.appDataEntityId)}async onActionClick(e){const{uiactionId:t,actionType:a}=this.model;"NONE"!==a&&(e.stopPropagation(),e.preventDefault(),await fa.execAndResolved(t,{context:this.panel.context,params:{panelDataParent:this.dataParent.model.id,...this.panel.params},data:[this.data],view:this.panel.view,event:e,noWaitRoute:!0,ctrl:this.panel},this.model.appId))}calcItemVisible(e){!1!==this.state.uiActionState.visible?super.calcItemVisible(e):this.state.visible=!1}calcItemDisabled(e){!0!==this.state.uiActionState.disabled?super.calcItemDisabled(e):this.state.disabled=!0}}e("aM",fS);const wS=a({name:"IBizPanelButton",props:{modelData:{type:Object,required:!0},controller:{type:fS,required:!0}},setup(e){const t=B("panel-button"),{caption:a,captionItemName:n,renderMode:i,showCaption:s,sysImage:l,codeName:c,itemStyle:d,tooltip:u,buttonCssStyle:h,buttonStyle:p}=e.modelData,{panel:m,state:v}=e.controller,g=o("");h&&(g.value=h);const b=r(()=>n&&m.data?m.data[n.toLowerCase()]:a);let f=!1;Object.is(i,"LINK")&&(f=!0);return{ns:t,isText:f,captionText:b,buttonType:r(()=>Object.is(i,"LINK")?"text":Pl(p)),showCaption:s,sysImage:l,codeName:c,state:v,tooltip:u,handleButtonClick:async t=>{try{v.loading=!0,await e.controller.onActionClick(t),e.controller.onClick(t)}finally{v.loading=!1}},buttonCssStyle:h,tempStyle:g,itemStyle:d}},render(){return this.state.visible?n("div",{class:[this.ns.b(),this.ns.m(this.codeName),this.ns.is("loading",this.state.loading),this.itemStyle&&this.ns.m(this.itemStyle.toLowerCase()),...this.controller.containerClass],style:this.tempStyle},[n(i("el-button"),{type:this.buttonType,text:this.isText,"data-id":this.modelData.id,title:Tt(this.tooltip),disabled:this.state.disabled,loading:this.state.loading,onClick:this.handleButtonClick},{default:()=>[n("div",{class:this.ns.b("content")},[n(i("iBizIcon"),{class:this.ns.bm("content","icon"),icon:this.sysImage},null),this.showCaption?n("span",{class:this.ns.bm("content","caption")},[this.captionText]):""])]})]):null}});var yS=Object.defineProperty,CS=(e,t,a)=>(((e,t,a)=>{t in e?yS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class IS{constructor(){CS(this,"component","IBizPanelButton")}async createController(e,t,a){const n=new fS(e,t,a);return await n.init(),n}}const xS=e("aL",ie(wS,function(e){e.component(wS.name,wS),xi("BUTTON",()=>new IS)}));var SS=Object.defineProperty,ES=(e,t,a)=>(((e,t,a)=>{t in e?SS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class DS extends Si{constructor(){super(...arguments),ES(this,"caption",""),ES(this,"caption2",""),ES(this,"subCaption",""),ES(this,"subCaption2",""),ES(this,"icon",""),ES(this,"icon2",""),ES(this,"isSvg",!1)}}var PS=Object.defineProperty,kS=(e,t,a)=>(((e,t,a)=>{t in e?PS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class zS extends Ii{constructor(){super(...arguments),kS(this,"captionSplit","|"),kS(this,"rawItemParams",{})}createState(){var e;return new DS(null==(e=this.parent)?void 0:e.state)}async onInit(){if(await super.onInit(),this.handleRawItemParams(),"APPINDEXVIEW"!==this.panel.view.model.viewType){const e=this.panel.view.model,t=ibiz.hub.getApp(e.appId);return void(t&&(this.state.caption=ibiz.env.AppTitle||t.model.caption||""))}const e=this.panel.view.model;e.title&&!document.title&&(document.title=e.title),this.model.sysImage&&this.model.sysImage.rawContent?this.state.icon=this.model.sysImage.rawContent:e.appIconPath&&(this.state.icon=e.appIconPath),e.sysImage&&e.sysImage.rawContent?this.state.icon2=e.sysImage.rawContent:e.appIconPath2&&(this.state.icon2=e.appIconPath2),e.caption&&(this.state.caption=e.caption.split(this.captionSplit)[0],this.state.caption2=e.caption.split(this.captionSplit)[1]||e.caption.split(this.captionSplit)[0]),e.subCaption&&(this.state.subCaption=e.subCaption.split(this.captionSplit)[0],this.state.subCaption2=e.subCaption.split(this.captionSplit)[1]||e.subCaption.split(this.captionSplit)[0]),(this.state.icon.endsWith(".svg")||this.state.icon2.endsWith(".svg"))&&(this.state.isSvg=!0);ibiz.hub.getApp().model.appId===e.appId&&ibiz.env.AppTitle&&(this.state.caption=ibiz.env.AppTitle)}handleRawItemParams(){var e;const t=null==(e=this.model.rawItem)?void 0:e.rawItemParams;Array.isArray(t)&&t.forEach(e=>{const t=e.key,a=e.value;t&&a&&(this.rawItemParams[t.toLowerCase()]=a)})}}e("aO",zS);const TS=a({name:"IBizPanelAppTitle",props:{modelData:{type:Object,required:!0},controller:{type:zS,required:!0}},setup(e){const t=B("panel-app-title"),a=e.controller,n=us(),i=hs(),o=A("ctx",void 0),s=r(()=>(null==o?void 0:o.view)&&o.view.model.mainMenuAlign||"LEFT"),l=r(()=>"LEFT"===s.value),c=r(()=>{const{strictly:e}=a.rawItemParams;return(!e||"true"!==e)&&a.panel.view.state.isCollapse}),d=r(()=>"STYLE2"===a.model.itemStyle);return{ns:t,c:a,menuAlign:s,showImgOnly:l,handleClick:async t=>{if("APPLOGINVIEW"!==a.panel.view.model.viewType){if(null==o?void 0:o.view){const e=Y(n);e.pathNodes=e.pathNodes.slice(0,1);const t=K(e);i.push({path:t}),setTimeout(()=>{window.location.reload()})}e.controller.onClick(t)}},isCollapse:c,showIcon:d}},render(){const{icon:e,icon2:t,caption:a,caption2:o,subCaption:s,subCaption2:l}=this.c.state;let r=null,c=null;const d=n("span",{class:this.ns.e("title")},[a]);if("APPINDEXVIEW"!==this.c.panel.view.model.viewType)c=d;else{if("LEFT"===this.menuAlign)if(this.isCollapse){const a=t||e;r=a?n("div",{class:this.ns.e("collpase-icon")},[n(i("iBizIcon"),{class:this.ns.e("logo"),icon:{rawContent:a}},null)]):n("div",{class:this.ns.e("collapse-title")},[n("div",{class:this.ns.e("caption2")},[o]),n("div",{class:this.ns.e("subCaption2")},[l])])}else if(this.showIcon&&e){let t=n("g",{id:"app-caption-panel",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},[n("text",{id:"app-caption","font-family":"Poppins-Bold, Poppins","font-size":"22","font-weight":"bold"},[n("tspan",{x:"0",y:"52"},[a])])]);s&&(t=n("g",{id:"app-caption-panel",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},[n("text",{id:"app-caption","font-family":"Poppins-Bold, Poppins","font-size":"22","font-weight":"bold"},[n("tspan",{x:"8",y:"39"},[a])]),n("text",{id:"app-subcaption","font-family":"PingFangSC-Semibold, PingFang SC","font-size":"14","font-weight":"bold"},[n("tspan",{x:"8",y:"66"},[s])])])),r=n("span",{class:this.ns.e("logo")},[n(i("iBizIcon"),{class:this.ns.em("logo","expand"),icon:{rawContent:e}},null),n("svg",{width:"166px",height:"80px",viewBox:"0 0 166 90",version:"1.1"},[t])])}else r=n("span",{class:this.ns.e("logo")},[n("svg",{width:"256px",height:"80px",viewBox:"0 0 256 80",version:"1.1"},[n("g",{id:"app-caption-panel",stroke:"none","stroke-width":"1","fill-rule":"evenodd"},[n("text",{id:"app-caption","font-family":"Poppins-Bold, Poppins","font-size":"22","font-weight":"bold"},[n("tspan",{x:"20.961",y:"40"},[a])]),n("text",{id:"app-subcaption","font-family":"PingFangSC-Semibold, PingFang SC","font-size":"18","font-weight":"bold"},[n("tspan",{x:"96",y:"69"},[s])])])])]);else"TOP"===this.menuAlign&&e&&(r=n(i("iBizIcon"),{class:this.ns.e("logo"),icon:{rawContent:e}},null));c="LEFT"===this.menuAlign?r:[r,d]}return n("div",{class:[this.ns.b(),this.ns.is("only-img",this.showImgOnly),this.ns.is("collapse",this.isCollapse),this.ns.is("only-title","APPINDEXVIEW"!==this.c.panel.view.model.viewType),...this.controller.containerClass],onClick:this.handleClick},[c])}});var AS=Object.defineProperty,OS=(e,t,a)=>(((e,t,a)=>{t in e?AS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class MS{constructor(){OS(this,"component","IBizPanelAppTitle")}async createController(e,t,a){const n=new zS(e,t,a);return await n.init(),n}}const NS=e("aN",ie(TS,function(e){e.component(TS.name,TS),xi("RAWITEM_APP_APPTITLE",()=>new MS),xi("CTRLPOS_APP_APPTITLE",()=>new MS)}));function BS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const LS=a({name:"IBizPanelAppHeader",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("panel-app-header"),{showCaption:a,titleBarCloseMode:n,id:i}=e.modelData,s=0!==n,l=o(2===n),c=r(()=>"TOP"===e.controller.panel.view.model.mainMenuAlign?"horizontal":"vertical"),d=r(()=>{let n=[t.b(),t.m(c.value),t.m(i)];return!0===a&&(n=[...n,...e.controller.containerClass,a&&t.m("show-header"),s&&t.m("collapsible"),t.is("collapse",s&&l.value),t.is("hidden",!e.controller.state.visible)]),n});return{ns:t,isCollapse:l,classArr:d,changeCollapse:()=>{s&&(l.value=!l.value)}}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},BS(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},BS(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr},[s])}});var RS=Object.defineProperty,_S=(e,t,a)=>(((e,t,a)=>{t in e?RS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class jS{constructor(){_S(this,"component","IBizPanelAppHeader")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const VS=ie(LS,function(e){e.component(LS.name,LS),xi("CONTAINER_AppHeader",()=>new jS)});function FS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const US=a({name:"IBizPanelViewHeader",props:{modelData:{type:Object,required:!0},controller:{type:Pi,required:!0}},setup(e){const t=B("panel-view-header"),{showCaption:a,titleBarCloseMode:n,id:i}=e.modelData,s=0!==n,l=o(2===n),c=r(()=>{let n=[t.b(),t.m(i)];return!0===a&&(n=[...n,...e.controller.containerClass,a&&t.m("show-header"),s&&t.m("collapsible"),t.is("collapse",s&&l.value),t.is("hidden",!e.controller.state.visible)]),n});return{ns:t,isCollapse:l,classArr:c,changeCollapse:()=>{s&&(l.value=!l.value)}}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},FS(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},FS(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return b(n("div",{class:this.classArr},[s]),[[C("loading"),this.controller.state.loading]])}});var HS=Object.defineProperty,qS=(e,t,a)=>(((e,t,a)=>{t in e?HS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class GS{constructor(){qS(this,"component","IBizPanelViewHeader")}async createController(e,t,a){const n=new Pi(e,t,a);return await n.init(),n}}const WS=ie(US,function(e){e.component(US.name,US),xi("CONTAINER_ViewHeader",()=>new GS)});function YS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const KS=a({name:"IBizPanelExpHeader",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("panel-exp-header"),{showCaption:a,titleBarCloseMode:n,id:i}=e.modelData,s=0!==n,l=o(2===n),c=r(()=>{let n=[t.b(),t.m(i)];return!0===a&&(n=[...n,...e.controller.containerClass,a&&t.m("show-header"),s&&t.m("collapsible"),t.is("collapse",s&&l.value),t.is("hidden",!e.controller.state.visible)]),n});return{ns:t,isCollapse:l,classArr:c,changeCollapse:()=>{s&&(l.value=!l.value)}}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},YS(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},YS(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr},[s])}});var XS=Object.defineProperty,$S=(e,t,a)=>(((e,t,a)=>{t in e?XS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class JS{constructor(){$S(this,"component","IBizPanelExpHeader")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const QS=ie(KS,function(e){e.component(KS.name,KS),xi("CONTAINER_Exp_Header",()=>new JS)});function ZS(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const eE=a({name:"IBizPanelViewContent",props:{modelData:{type:Object,required:!0},controller:{type:Pi,required:!0}},setup(e){const t=B("panel-view-content"),{showCaption:a,titleBarCloseMode:n,id:i}=e.modelData,s=0!==n,l=o(2===n),c=r(()=>{let n=[t.b(),t.m(i)];const{view:o}=e.controller.panel;return o.model.viewType&&n.push(t.m(o.model.viewType.toLowerCase())),n.push(t.is("no-caption",!o.model.showCaptionBar)),!0===a&&(n=[...n,...e.controller.containerClass,t.is("collapse",s&&l.value),t.is("hidden",!e.controller.state.visible)]),n});return{ns:t,isCollapse:l,classArr:c,changeCollapse:()=>{s&&(l.value=!l.value)}}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{layout:this.modelData.layout},ZS(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},ZS(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return b(n("div",{class:this.classArr},[s]),[[C("loading"),this.controller.state.loading]])}});var tE=Object.defineProperty,aE=(e,t,a)=>(((e,t,a)=>{t in e?tE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class nE{constructor(){aE(this,"component","IBizPanelViewContent")}async createController(e,t,a){const n=new Pi(e,t,a);return await n.init(),n}}const iE=ie(eE,function(e){e.component(eE.name,eE),xi("CONTAINER_VIEWCONTENT",()=>new nE)});var oE=Object.defineProperty,sE=(e,t,a)=>(((e,t,a)=>{t in e?oE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class lE extends ki{constructor(){super(...arguments),sE(this,"activeTab","")}}class rE extends Pi{createState(){var e;return new lE(null==(e=this.parent)?void 0:e.state)}async onInit(){var e;await super.onInit(),this.state.activeTab=(null==(e=this.model.panelTabPages)?void 0:e[0].id)||""}onTabChange(e){this.state.activeTab=e}}const cE=a({name:"IBizPanelTabPanel",props:{modelData:{type:Object,required:!0},controller:{type:rE,required:!0}},setup(e){const t=B("panel-tab-panel"),{state:a}=e.controller,n=r(()=>{const{id:a}=e.modelData,n=[t.b(),t.m(a)];return n.push(...e.controller.containerClass),n});return{ns:t,state:a,classArr:n,onTabClick:(t,a)=>{e.controller.onTabChange(t.props.name)}}},render(){var e,t;let a;if(!this.controller.state.visible)return;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[];return n(i("el-tabs"),{class:[this.ns.b(),this.ns.m(this.modelData.codeName),...this.controller.containerClass],"model-value":this.state.activeTab,onTabClick:this.onTabClick},"function"==typeof(l=a=o.map(e=>{const t=e.props;if(!t||!t.controller)return e;const a=t.controller;return a.state.visible||a.state.keepAlive?n(i("el-tab-pane"),{class:this.ns.b("tab-item"),label:a.model.caption,name:a.model.id,lazy:!0},{default:()=>[this.state.activeTab===a.model.id&&e]}):null}))||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?a:{default:()=>[a]});var l}});var dE=Object.defineProperty,uE=(e,t,a)=>(((e,t,a)=>{t in e?dE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class hE{constructor(){uE(this,"component","IBizPanelTabPanel")}async createController(e,t,a){const n=new rE(e,t,a);return await n.init(),n}}const pE=e("aP",ie(cE,function(e){e.component(cE.name,cE),xi("TABPANEL",()=>new hE)}));var mE=Object.defineProperty,vE=(e,t,a)=>(((e,t,a)=>{t in e?mE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class gE extends Pi{constructor(){super(...arguments),vE(this,"splitMode","horizontal"),vE(this,"splitValue",.5),vE(this,"lastSplitValue",null)}initSplitValue(e,t){"PX"===t&&(this.splitValue="".concat(e,"px")),"PERCENTAGE"===t&&(this.splitValue=e/100),this.state.splitValue=this.splitValue}async onInit(){await super.onInit();const{predefinedType:e,panelItems:t}=this.model;if(this.splitMode="CONTAINER_V_SPLIT"===e?"vertical":"horizontal",Array.isArray(t)&&t.length){const e=t[0].layoutPos;if(e){if("horizontal"===this.splitMode){const{width:t,widthMode:a}=e;null!=t&&null!=a&&this.initSplitValue(t,a)}if("vertical"===this.splitMode){const{height:t,heightMode:a}=e;null!=t&&null!=a&&this.initSplitValue(t,a)}}}}hiddenPanel(e){this.state.isHiddenTrigger||(this.lastSplitValue=this.state.splitValue),"left"!==e&&"top"!==e||(this.state.splitValue=0),"right"!==e&&"bottom"!==e||(this.state.splitValue=1),this.state.isHiddenTrigger=!0}showPanel(){null!=this.lastSplitValue&&(this.state.splitValue=this.lastSplitValue,this.state.isHiddenTrigger=!1,this.lastSplitValue=null)}}e("aQ",gE);const bE=a({name:"IBizSplitContainer",props:{modelData:{type:Object,required:!0},controller:{type:gE,required:!0}},setup(e){const t=B("split-container"),{id:a}=e.modelData,n=r(()=>{let n=[t.b(),t.m(a)];return n=[...n,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible),t.is("hidden-trigger",e.controller.state.isHiddenTrigger)],n});return{ns:t,classArr:n}},render(){var e,t;const a=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[];return b(n("div",{class:this.classArr},[n(i("iBizSplit"),{modelValue:this.controller.state.splitValue,"onUpdate:modelValue":e=>this.controller.state.splitValue=e,mode:this.controller.splitMode},{left:()=>a[0],right:()=>a[1],top:()=>a[0],bottom:()=>a[1]})]),[[C("loading"),this.controller.state.loading]])}});var fE=Object.defineProperty,wE=(e,t,a)=>(((e,t,a)=>{t in e?fE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class yE{constructor(){wE(this,"component","IBizSplitContainer")}async createController(e,t,a){const n=new gE(e,t,a);return await n.init(),n}}const CE=e("aR",ie(bE,function(e){e.component(bE.name,bE),xi("CONTAINER_CONTAINER_H_SPLIT",()=>new yE),xi("CONTAINER_CONTAINER_V_SPLIT",()=>new yE)}));var IE=Object.defineProperty,xE=(e,t,a)=>(((e,t,a)=>{t in e?IE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class SE extends Ii{constructor(){super(...arguments),xE(this,"rawItemParams",{})}async onInit(){await super.onInit(),this.handleRawItemParams()}handleRawItemParams(){var e;const t=null==(e=this.model.rawItem)?void 0:e.rawItemParams;Array.isArray(t)&&t.forEach(e=>{const t=e.key,a=e.value;t&&a&&(this.rawItemParams[t.toLowerCase()]=a)})}}const EE=a({name:"IBizPanelIndexViewSearch",props:{modelData:{type:Object,required:!0},controller:{type:SE,required:!0}},setup(e){const t=B("panel-index-view-search"),a=e.controller,n=o(""),i=_o(()=>{},500),s=A("ctx",void 0),l=r(()=>(null==s?void 0:s.view)&&s.view.model.mainMenuAlign||"LEFT"),c=r(()=>{const{strictly:e}=a.rawItemParams;return(!e||"true"!==e)&&a.panel.view.state.isCollapse}),d=r(()=>{const{placeholder:e}=a.rawItemParams;return e||ibiz.i18n.t("component.indexSearch.placeholder")}),u=r(()=>{const{id:a}=e.modelData,n=[t.b(),t.m(a),t.is("collapse",c.value)];return n.push(...e.controller.containerClass),n}),h=async()=>{const t=e.modelData.id,i=a.panel.view.getController("appmenu");if(i){const e=i.allAppMenuItems.find(e=>e.id===t);if(e){const t=a.panel.context.clone(),i=a.panel.params;t.srfappid=e.appId||ibiz.env.appId,await ibiz.commands.execute(zi.TAG,e.appFuncId,t,{...i,srfquery:n.value},{})}}};return{ns:t,classArr:u,isCollapse:c,curPlaceholder:d,onInput:e=>{n.value=e,i()},onSearch:h,c:a,query:n,menuAlign:l,onEnter:e=>{"Enter"===e.key&&h()}}},render(){if(this.controller.state.visible)return n("div",{class:this.classArr},["LEFT"===this.menuAlign&&!this.isCollapse&&n(i("el-input"),{"model-value":this.query,class:this.ns.b("search"),placeholder:this.curPlaceholder,onInput:this.onInput,onKeyup:this.onEnter},{prefix:()=>n("ion-icon",{class:this.ns.e("search-icon"),name:"search"},null)})])}});var DE=Object.defineProperty,PE=(e,t,a)=>(((e,t,a)=>{t in e?DE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class kE{constructor(){PE(this,"component","IBizPanelIndexViewSearch")}async createController(e,t,a){const n=new SE(e,t,a);return await n.init(),n}}const zE=e("aS",ie(EE,function(e){e.component(EE.name,EE),xi("RAWITEM_INDEX_VIEW_SEARCH",()=>new kE)}));class TE extends Si{}class AE extends Ii{createState(){var e;return new TE(null==(e=this.parent)?void 0:e.state)}}function OE(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const ME=a({name:"IBizPanelAppLoginView",props:{modelData:{type:Object,required:!0},controller:{type:AE,required:!0}},setup(e){const t=B("panel-app-login-view"),{id:a}=e.modelData,n=r(()=>{let n=[t.b(),t.m(a)];return n=[...n,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible)],n}),i=r(()=>{let e={};const a=window.location.pathname;if(a){const t=a.lastIndexOf("/");if(-1!==t){const n=a.substring(0,t+1);e={"header-url":"url('".concat(n,"assets/images/login-header.png')"),"avatar-url":"url('".concat(n,"assets/images/login-avatar.png')")}}}return t.cssVarBlock(e)});return{ns:t,classArr:n,cssVars:i}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},OE(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},OE(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr,style:this.cssVars,onClick:e=>this.controller.onClick(e)},[this.controller.model.cssStyle?n("style",{type:"text/css"},[this.controller.model.cssStyle]):null,s])}});var NE=Object.defineProperty,BE=(e,t,a)=>(((e,t,a)=>{t in e?NE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class LE{constructor(){BE(this,"component","IBizPanelAppLoginView")}async createController(e,t,a){const n=new AE(e,t,a);return await n.init(),n}}const RE=ie(ME,function(e){e.component(ME.name,ME),xi("CONTAINER_APPLOGINVIEW",()=>new LE)});class _E extends Si{}class jE extends Ii{createState(){var e;return new _E(null==(e=this.parent)?void 0:e.state)}}const VE=a({name:"IBizPanelRememberMe",props:{modelData:{type:Object,required:!0},controller:{type:jE,required:!0}},setup(e){const t=B("panel-remember-me"),{id:a}=e.modelData,n=e.controller,i=r(()=>{let n=[t.b(),t.m(a)];return n=[...n,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible)],n}),o=r({get:()=>n.panel.state.data.isRemember,set:e=>{n.panel.state.data.isRemember=e}});return{ns:t,classArr:i,c:n,isRemember:o}},render(){return n("div",{class:this.classArr},[n(i("el-checkbox"),{modelValue:this.isRemember,"onUpdate:modelValue":e=>this.isRemember=e,label:ibiz.i18n.t("app.rememberMe")},null)])}});var FE=Object.defineProperty,UE=(e,t,a)=>(((e,t,a)=>{t in e?FE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class HE{constructor(){UE(this,"component","IBizPanelRememberMe")}async createController(e,t,a){const n=new jE(e,t,a);return await n.init(),n}}const qE=ie(VE,function(e){e.component(VE.name,VE),xi("CONTAINER_REMEMBER_ME",()=>new HE),xi("FIELD_AUTH_REMEMBERME",()=>new HE)});function GE(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const WE=a({name:"IBizIndexActions",props:{modelData:{type:Object,required:!0},controller:{type:we,required:!0}},setup(e){const t=B("index-actions"),{id:a}=e.modelData,n=r(()=>e.controller.panel.view.state.isCollapse),i=r(()=>{let i=[t.b(),t.m(a)];return i=[...i,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible),t.is("collapse",n.value)],i});return{ns:t,classArr:i,isCollapse:n}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},GE(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},GE(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr,onClick:e=>this.controller.onClick(e)},[this.controller.model.cssStyle?n("style",{type:"text/css"},[this.controller.model.cssStyle]):null,s])}});var YE=Object.defineProperty,KE=(e,t,a)=>(((e,t,a)=>{t in e?YE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class XE{constructor(){KE(this,"component","IBizIndexActions")}async createController(e,t,a){const n=new we(e,t,a);return await n.init(),n}}const $E=e("aT",ie(WE,function(e){e.component(WE.name,WE),xi("CONTAINER_INDEX_ACTIONS",()=>new XE)})),JE={10:"未开始",20:"执行中",30:"已执行",40:"执行失败"},QE={10:"info",20:"",30:"success",40:"danger"},ZE=a({name:"IBizAsyncAction",props:{action:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0},setup(e,{emit:t}){const a=B("async-action"),n=r(()=>qo(e.action.actionresult)),i=r(()=>!e.action.actiontype||n.value);return{ns:a,showErrorInfo:r(()=>e.action.actiontype&&Lo(e.action.actionresult)),clickable:i,actionstate:r(()=>{if(n.value){const t=e.action.actionresult;return t.total-t.success>0?40:30}return e.action.actionstate}),progressText:r(()=>e.action.completionrate?"(".concat(e.action.completionrate,"%)"):""),onClick:async a=>{if(e.provider.onClick){await e.provider.onClick(e.action,a)&&t("close")}}}},render(){const{asyncacitonname:e,begintime:t,stepinfo:a="进行中"}=this.action;return n("div",{class:[this.ns.b(),this.clickable?this.ns.m("clickable"):""],onClick:this.onClick},[n("div",{class:this.ns.b("left")},[n("ion-icon",{name:"list-outline"},null)]),n("div",{class:this.ns.b("center")},[n("div",{class:this.ns.e("caption")},[e]),this.showErrorInfo&&n("div",{title:Tt(this.action.actionresult),class:this.ns.e("error-info")},[this.action.actionresult]),20===this.actionstate?n("div",{class:this.ns.e("progress")},[a,this.progressText]):n("div",{class:this.ns.e("begin-time")},[t])]),n("div",{class:this.ns.b("right")},[n(i("el-tag"),{type:QE[this.actionstate]},{default:()=>[JE[this.actionstate]]})]),20===this.actionstate&&!!this.action.completionrate&&n("div",{class:this.ns.b("loading-warp")},[n("div",{class:this.ns.be("loading-warp","inner"),style:"width:".concat(this.action.completionrate,"%;")},null)])])}}),eD=a({name:"IBizAsyncActionTab",props:{controller:{type:Object,required:!0},showPopover:{type:Boolean,required:!0}},emits:{hiddenPopover:()=>!0},setup(e,{emit:t}){const a=B("async-action-tab"),n=e.controller,i=o([]),s=()=>{i.value=Yt(n.actions)};s(),n.evt.on("dataChange",s);return{ns:a,allItems:i,hiddenPopover:()=>{t("hiddenPopover")}}},render(){return n("div",{class:[this.ns.b()]},[this.allItems.length>0&&this.allItems.map(e=>{let t;try{t=va(e)}catch(e){ibiz.log.error(e)}return t?t.render({class:this.ns.e("item"),action:e,onClose:this.hiddenPopover}):n("div",{class:this.ns.e("item")},[ibiz.i18n.t("panelComponent.userMessage.asyncActionTab.noSupportType",{type:e.actiontype})])}),0===this.allItems.length&&n("div",{class:this.ns.e("nodata")},[ibiz.i18n.t("panelComponent.userMessage.asyncActionTab.noAsyncAction")])])}});function tD(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const aD=a({name:"IBizAsyncActionPreview",props:{asyncAction:{type:Object,required:!0},modal:{type:Object,required:!0}},setup(e){const t=B("async-action-preview"),a=u({title:"",beginTime:"",endTime:"",total:0,success:0,error:0,errorDetails:[{row:0,reason:""}],errorFileUrl:""});if(a.title=ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.importDetailPrompt",{name:e.asyncAction.asyncacitonname}),a.beginTime=e.asyncAction.begintime,a.endTime=e.asyncAction.endtime,e.asyncAction.actionresult){let t=e.asyncAction.actionresult;if("string"==typeof t)try{t=JSON.parse(t)}catch(e){throw new Vt(ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.parseImportInfoErr"))}a.total=t.total||0,a.success=t.success||0,a.error=a.total-a.success,t.errorinfo?a.errorDetails=Object.keys(t.errorinfo).map(e=>({row:Number(e),reason:t.errorinfo[e].errorInfo})):a.errorDetails=[],t.errorfile&&(a.errorFileUrl="".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl,"/").concat(t.errorfile.folder,"/").concat(t.errorfile.fileid).replace("/{cat}",""))}return{ns:t,info:a,onClose:()=>{e.modal.dismiss()},onDownLoad:()=>{var e;e={url:a.errorFileUrl,name:a.title},ibiz.net.request(e.url,{method:"get",responseType:"blob",baseURL:""}).then(t=>{let a=ns.parse(t.headers["content-disposition"],{delimiter:";"}).filename;if(a&&(a.startsWith('"')&&a.endsWith('"')&&(a=a.substring(1,a.length-1)),e.name+=".".concat(a.split(".")[1])),200!==t.status)throw new Vt(ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.downloadFailedErr"));if(!t.data)throw new Vt(ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.noExistentErr"));{const a=e.name;Kt(t.data,a)}})}}},render(){let e,t;return n("div",{class:[this.ns.b()]},[n("div",{class:this.ns.b("header")},[n("div",{class:this.ns.e("title")},[this.info.title]),n("div",{class:this.ns.b("toolbar")},[this.info.errorFileUrl&&n(i("el-button"),{onClick:this.onDownLoad},tD(e=ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.downloadErrFile"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:this.onClose},tD(t=ibiz.i18n.t("app.close"))?t:{default:()=>[t]})])]),n("div",{class:this.ns.b("time")},[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.importTime")},{default:()=>[this.info.beginTime,p(" ~ "),this.info.endTime]})]),n(i("el-row"),{class:this.ns.b("count")},{default:()=>[n(i("el-col"),{span:8},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.importTotal")},{default:()=>[this.info.total]})]}),n(i("el-col"),{span:8},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.successImport")},{default:()=>[this.info.success]})]}),n(i("el-col"),{span:8},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionPreview.ImportFailed")},{default:()=>[this.info.error]})]})]}),this.info.errorDetails.length>0&&n("div",{class:this.ns.b("detail")},[this.info.errorDetails.map(e=>n("div",{class:this.ns.b("detail-item")},[n("div",{class:this.ns.be("detail-item","index")},[e.row]),n("div",{class:this.ns.be("detail-item","error")},[n("div",{class:this.ns.be("detail-item","error-title")},[ibiz.i18n.t("app.error")]),n("div",{class:this.ns.be("detail-item","error-reason")},[e.reason])])]))])])}});const nD=a({name:"IBizAsyncActionResult",props:{asyncAction:{type:Object,required:!0},modal:{type:Object,required:!0}},setup(e){const t=B("async-action-result"),a=u({title:e.asyncAction.asyncacitonname,beginTime:e.asyncAction.begintime,endTime:e.asyncAction.endtime,actionState:[30,40].includes(e.asyncAction.actionstate),message:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.noMessage"),isJSON:!1});qo(e.asyncAction.actionresult)?(a.message=JSON.stringify(e.asyncAction.actionresult,null,2),a.isJSON=!0):e.asyncAction.actionresult&&(a.message="".concat(e.asyncAction.actionresult));const i=(e,a)=>{if(null===e)return n("span",{class:t.be("content","json-null")},[p("null")]);if("boolean"==typeof e)return n("span",{class:t.be("content","json-boolean")},[e.toString()]);if("number"==typeof e)return n("span",{class:t.be("content","json-number")},[e.toString()]);if("string"==typeof e)return n("span",{class:t.be("content","json-string")},[p('"'),e,p('"')]);if(Array.isArray(e)){if(0===e.length)return n("span",null,[p("[]")]);const o=e.map((o,s)=>n("div",{key:s,class:t.be("content","json-indent"),style:{paddingLeft:"".concat(20*(a+1),"px")}},[i(o,a+1),s<e.length-1?",":""]));return n("div",{class:t.be("content","json-array")},[n("span",null,[p("[")]),o,n("div",{style:{paddingLeft:"".concat(20*a,"px")}},null),n("span",{style:{paddingLeft:"".concat(20*a,"px")}},[p("]")])])}const o=Object.keys(e);if(0===o.length)return n("span",null,["{}"]);const s=o.map((s,l)=>n("div",{key:s,class:t.be("content","json-indent"),style:{paddingLeft:"".concat(20*(a+1),"px")}},[n("span",{class:t.be("content","json-key")},[p('"'),s,p('"')]),p(":")," ",i(e[s],a+1),l<o.length-1?",":""]));return n("div",{class:t.be("content","json-object")},[n("span",null,["{"]),s,n("div",{style:{paddingLeft:"".concat(20*a,"px")}},null),n("span",{style:{paddingLeft:"".concat(20*a,"px")}},["}"])])};return{ns:t,info:a,onClose:()=>{e.modal.dismiss()},renderJSON:e=>{try{const t=JSON.parse(e);return i(t,0)}catch(t){return n("span",null,[e])}}}},render(){let e;return n("div",{class:[this.ns.b()]},[n("div",{class:this.ns.b("header")},[n("div",{class:this.ns.e("title")},[this.info.title]),n("div",{class:this.ns.b("toolbar")},[n(i("el-button"),{onClick:this.onClose},(t=e=ibiz.i18n.t("app.close"),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))])]),n("div",{class:this.ns.b("content")},[n(i("el-row"),null,{default:()=>[n(i("el-col"),{span:12},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.taskName")},{default:()=>[this.info.title]})]}),n(i("el-col"),{span:12},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.taskState")},{default:()=>[this.info.actionState?ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.finished"):ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.processing")]})]}),n(i("el-col"),{span:12},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.beginTime")},{default:()=>[this.info.beginTime]})]}),n(i("el-col"),{span:12},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.endTime")},{default:()=>[this.info.endTime]})]}),n(i("el-col"),{span:24},{default:()=>[n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncActionResult.exeResult")},{default:()=>[n("div",{class:this.ns.be("content","json-container")},[this.renderJSON(this.info.message)])]})]})]})])]);var t}});function iD(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const oD=a({name:"IBizAsyncDataExport",props:{asyncAction:{type:Object,required:!0},modal:{type:Object,required:!0}},setup(e){const t=B("async-data-export"),a=u({title:"",beginTime:"",endTime:"",fileUrl:"",fileName:"",isFinish:!1});if(a.title=ibiz.i18n.t("panelComponent.userMessage.asyncDataExport.exportDetailPrompt",{name:e.asyncAction.asyncacitonname}),a.beginTime=e.asyncAction.begintime,a.endTime=e.asyncAction.endtime,e.asyncAction.asyncresultdownloadurl){const t=JSON.parse(e.asyncAction.asyncresultdownloadurl);a.fileUrl="".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId).concat(ibiz.env.downloadFileUrl,"/").concat(t.folder,"/").concat(t.fileid).replace("/{cat}",""),a.fileName=t.filename}[30,40].includes(e.asyncAction.actionstate)?a.isFinish=!0:a.isFinish=!1;return{ns:t,info:a,onClose:()=>{e.modal.dismiss()},onDownLoad:()=>{ibiz.util.file.fileDownload(a.fileUrl,a.fileName,void 0,!1)}}},render(){let e,t;return n("div",{class:[this.ns.b()]},[n("div",{class:this.ns.b("header")},[n("div",{class:this.ns.e("title")},[this.info.title]),n("div",{class:this.ns.b("toolbar")},[this.info.fileUrl&&n(i("el-button"),{onClick:this.onDownLoad},iD(e=ibiz.i18n.t("panelComponent.userMessage.asyncDataExport.downloadFile"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:this.onClose},iD(t=ibiz.i18n.t("app.close"))?t:{default:()=>[t]})])]),n("div",{class:this.ns.b("time")},[this.info.isFinish?n(i("el-form-item"),{label:ibiz.i18n.t("panelComponent.userMessage.asyncDataExport.excuteTime")},{default:()=>[this.info.beginTime,p(" ~ "),this.info.endTime]}):n("span",{class:this.ns.be("time","executing")},[ibiz.i18n.t("panelComponent.userMessage.asyncDataExport.executing")])])])}});var sD=Object.defineProperty,lD=(e,t,a)=>(((e,t,a)=>{t in e?sD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class rD{constructor(){lD(this,"component",ZE)}render(e){return l(this.component,{provider:this,...e})}async onClick(e,t){return Fo(e.actiontype)?(ibiz.overlay.modal(t=>l(nD,{asyncAction:e,modal:t}),{},{width:"80%",height:"80%"}),!0):"DEEXPORTDATA"===e.actiontype?(ibiz.overlay.modal(t=>l(oD,{asyncAction:e,modal:t}),{},{width:"80%",height:"80%"}),!0):!!qo(e.actionresult)&&(ibiz.overlay.modal(t=>l(aD,{asyncAction:e,modal:t}),{},{width:"80%",height:"80%"}),!0)}}const cD={READ:"已阅读",SENT:"已发送",RECEIVED:"已接收",REPLIED:"已回复",SEND_FAILED:"发送失败",NOT_SENT:"未发送",DELETED:"已删除"},dD={READ:"",SENT:"success",RECEIVED:"success",REPLIED:"warning",SEND_FAILED:"danger",NOT_SENT:"info",DELETED:"info"},uD=a({name:"IBizInternalMessageDefault",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0,read:()=>!0},setup:()=>({ns:B("internal-message")}),render(){const{title:e,create_time:t,content:a,status:o}=this.message,s=n("div",{class:this.ns.e("short-content")},[a]);return n(i("iBizInternalMessageContainer"),{class:[this.ns.b()],message:this.message,provider:this.provider,onRead:()=>this.$emit("read"),onClose:()=>this.$emit("close")},{default:()=>[n("div",{class:this.ns.b("left")},[n("ion-icon",{name:"list-outline"},null)]),n("div",{class:this.ns.b("center")},[n("div",{class:this.ns.e("caption")},[n(i("el-tag"),{class:this.ns.e("status"),type:dD[o]},{default:()=>[cD[o]]}),e]),s,n("div",{class:this.ns.e("create-time")},[t])])]})}});var hD=Object.defineProperty,pD=(e,t,a)=>(((e,t,a)=>{t in e?hD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class mD{constructor(){pD(this,"component",uD),pD(this,"router",hs())}render(e){return l(this.component,{provider:this,...e})}async onClick(e,t){const a=ibiz.env.isMob?e.mobile_url:e.url;return this.openViewByUrl(a)}async openRedirectView(e,t){await ibiz.hub.notice.internalMessage.markRead(e),this.openViewByUrl(t)}openViewByUrl(e){if(e){if(e.startsWith("view://")){const{viewId:t,context:a,params:n}=Ti(e);a.srfkeepnull=!0,ibiz.commands.execute(Ai.TAG,t,Lt.create(a),n)}else if(e.startsWith("route://")){const t="/".concat(e.split("route://")[1]);this.router.push(t)}return!0}return!1}}const vD=a({name:"IBizInternalMessageJSON",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0,read:()=>!0},setup(e,{emit:t}){const a=B("internal-message-json"),n=r(()=>e.message.content&&"JSON"===e.message.content_type?JSON.parse(e.message.content):null),i=r(()=>{var t;if(e.message.enableLink){return(ibiz.env.isMob?e.message.mobile_url:e.message.url)||(null==(t=n.value)?void 0:t.redirecturl)}}),o=r(()=>{var e;return null==(e=n.value)?void 0:e.todoid}),s=r(()=>{if(i.value)return[{icon:"link-outline",key:"openRedirectView",tooltip:ibiz.i18n.t("panelComponent.userMessage.internalMessageJson.jumpToView")}]});return{ns:a,redirectUrl:i,isWFMessage:o,jsonContent:n,toolbarItems:s,onToolbarClick:a=>{"openRedirectView"===a&&(e.provider.openRedirectView(e.message,i.value),t("close"))}}},render(){var e,t;let a=null;return a=(null==(e=this.jsonContent)?void 0:e.html)?n("div",{class:this.ns.e("content"),innerHTML:this.jsonContent.html},null):(null==(t=this.jsonContent)?void 0:t.todoid)?n("div",{class:this.ns.e("content")},[n("div",{class:this.ns.e("card")},[n("div",{class:this.ns.em("card","avatar")},[this.jsonContent.createmanname.substring(0,2)]),n("div",{class:this.ns.em("card","content")},[n("div",{class:[this.ns.e("todo"),this.ns.em("todo","header")]},[n("span",{class:this.ns.em("todo","person")},[this.jsonContent.createmanname]),n("span",{class:this.ns.em("todo","action")},["ACTIVE"===this.jsonContent.todostate?ibiz.i18n.t("panelComponent.userMessage.internalMessageJson.todo"):ibiz.i18n.t("panelComponent.userMessage.internalMessageJson.done")])]),n("div",{class:[this.ns.e("todo"),this.ns.em("todo","content")]},[n("span",{class:this.ns.em("todo","title")},[this.jsonContent.title]),n("span",{class:this.ns.em("todo","step")},[this.jsonContent.param05]),n(i("el-tag"),{class:this.ns.em("todo","state")},{default:()=>[this.jsonContent.todostatetext]})]),n("div",{class:[this.ns.e("todo"),this.ns.em("todo","footer")]},[n("span",{class:this.ns.em("todo","date")},["ACTIVE"===this.jsonContent.todostate?this.jsonContent.createdate:this.jsonContent.processdate]),n("span",{class:this.ns.em("todo","separate")},[p("·")]),n("span",{class:this.ns.em("todo","name")},[this.jsonContent.param04])])])])]):n("div",{class:this.ns.e("content")},[ibiz.i18n.t("panelComponent.userMessage.internalMessageJson.missingHtml")]),n(i("iBizInternalMessageContainer"),{class:[this.ns.b()],message:this.message,provider:this.provider,clickable:!!this.redirectUrl||!!this.isWFMessage&&!!this.message.enableLink,isUnread:!!this.message.enableLink,toolbarItems:this.toolbarItems,onToolbarClick:this.onToolbarClick,onRead:()=>this.$emit("read"),onClose:()=>this.$emit("close")},"function"==typeof(o=a)||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?a:{default:()=>[a]});var o}}),gD=a({name:"IBizInternalMessageContainer",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0},clickable:{type:Boolean,default:void 0},isUnread:{type:Boolean,default:!0},toolbarItems:{type:Array,default:()=>[]}},emits:{toolbarClick:e=>!0,close:()=>!0,read:()=>!0},setup(e,{emit:t}){const a=B("internal-message-container"),n=r(()=>e.isUnread&&"RECEIVED"===e.message.status),i=r(()=>{const t=[...e.toolbarItems];return n.value&&t.push({key:"read",icon:"checkmark-done-outline",tooltip:ibiz.i18n.t("panelComponent.userMessage.internalMessageContainer.markAsRead")}),t}),o=r(()=>void 0===e.clickable?ibiz.env.isMob?!!e.message.mobile_url:!!e.message.url:e.clickable);return{ns:a,isUnread:n,isClickable:o,finalToolbarItems:i,onClick:async a=>{if(o.value&&e.provider.onClick){await e.provider.onClick(e.message,a)&&t("close")}t("read")},onToolbarClick:(e,a)=>{e.stopPropagation(),"read"===a?t("read"):t("toolbarClick",a)}}},render(){var e,t;return n("div",{class:[this.ns.b(),this.isClickable?this.ns.m("clickable"):"",this.isUnread?this.ns.m("unread"):""],onClick:this.onClick},[null==(t=(e=this.$slots).default)?void 0:t.call(e),n("div",{class:this.ns.b("toolbar")},[this.finalToolbarItems.map(e=>n(i("iBizIcon"),{class:this.ns.be("toolbar","button"),icon:{imagePath:"svg/read.svg"},baseDir:"iconfont",title:Tt(e.tooltip),onClick:t=>this.onToolbarClick(t,e.key)},null))]),n("div",{class:this.ns.e("unread-tag")},null),this.isClickable&&n("svg",{class:this.ns.e("click-tag"),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1618",width:"14",height:"14",fill:"currentColor"},[n("path",{d:"M256 258.133333c0-21.333333 14.933333-38.4 34.133333-42.666666H765.866667c23.466667 0 42.666667 19.2 42.666666 42.666666L810.666667 725.333333c0 10.666667-4.266667 21.333333-12.8 29.866667-8.533333 8.533333-19.2 12.8-29.866667 12.8-10.666667 0-21.333333-4.266667-29.866667-12.8-8.533333-8.533333-12.8-19.2-12.8-29.866667V360.533333L288 795.733333c-17.066667 17.066667-42.666667 17.066667-59.733333 0-17.066667-17.066667-17.066667-42.666667 0-59.733333l435.2-435.2H298.666667c-21.333333 0-38.4-14.933333-42.666667-34.133333v-8.533334z","p-id":"1619"},null)])])}});var bD=Object.defineProperty,fD=(e,t,a)=>(((e,t,a)=>{t in e?bD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class wD extends mD{constructor(){super(...arguments),fD(this,"component",vD),fD(this,"PREKEY_WFINST","WFINST__"),fD(this,"PREKEY_TODOHIS","TODOHIS__"),fD(this,"PREKEY_CARBONCOPY","CARBONCOPY__")}computeWFParams(e){switch(e.todostate){case"ACTIVE":return{preKey:"",subType:"Todo"};case"COMPLETED":return{preKey:this.PREKEY_TODOHIS,subType:"Done"};default:return{preKey:"",subType:""}}}async onClick(e,t){var a;if(!await super.onClick(e,t)&&"JSON"===e.content_type&&e.content){const t=JSON.parse(e.content);if(t.redirecturl)return this.openRedirectView(e,t.redirecturl),!0;if(t.todoid&&t.biztype)if(ibiz.env.isPortalApp)ibiz.log.error("门户应用暂不支持跳转工作流");else{const e=ibiz.hub.getApp(),{preKey:n,subType:i}=this.computeWFParams(t),o=await ibiz.net.post("/systodos/".concat(n).concat(t.todoid,"/getlinkurl"),{srfapptype:"pc",srfapp:e.model.codeName,todosubtype:i,todourltype:"RouterUrl"});if(o.data&&o.data.linkurl){const e=Lt.create((null==(a=ibiz.appData)?void 0:a.context)||{});Oi(e,o.data.linkurl)}}}return!0}}const yD=a({name:"IBizInternalMessageHTML",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0,read:()=>!0},setup:e=>({ns:B("internal-message-html"),msgContent:r(()=>js(e.message.content))}),render(){return n(i("iBizInternalMessageContainer"),{class:[this.ns.b()],message:this.message,provider:this.provider,onRead:()=>this.$emit("read"),onClose:()=>this.$emit("close")},{default:()=>[n("div",{class:this.ns.e("content"),innerHTML:this.msgContent},null)]})}});var CD=Object.defineProperty,ID=(e,t,a)=>(((e,t,a)=>{t in e?CD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class xD extends mD{constructor(){super(...arguments),ID(this,"component",yD)}async onClick(e,t){if(!await super.onClick(e,t)&&"JSON"===e.content_type&&e.content){const t=JSON.parse(e.content);if(t.redirecturl)return this.openRedirectView(e,t.redirecturl),!0}return!0}}const SD=a({name:"IBizInternalMessageText",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:()=>!0,read:()=>!0},setup:()=>({ns:B("internal-message-text")}),render(){const{title:e,create_time:t,content:a}=this.message;return n(i("iBizInternalMessageContainer"),{class:[this.ns.b()],message:this.message,provider:this.provider,onRead:()=>this.$emit("read"),onClose:()=>this.$emit("close")},{default:()=>[n("div",{class:this.ns.e("caption")},[e]),!!a&&n("div",{class:this.ns.e("content")},[a]),n("div",{class:this.ns.e("create-time")},[t])]})}});var ED=Object.defineProperty,DD=(e,t,a)=>(((e,t,a)=>{t in e?ED(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class PD extends mD{constructor(){super(...arguments),DD(this,"component",SD)}}const kD=a({name:"IBizInternalMessageGroup",props:{message:{type:Object,required:!0},provider:{type:Object,required:!0}},emits:{close:e=>!0,read:e=>!0},setup(e,{emit:t}){const a=B("internal-message-group"),n=o(!1),i=r(()=>{const{content_type:t,content:a}=e.message;return"JSON"===t?a?JSON.parse(a).html:a:"HTML"===a?js(a):a}),s=e=>{t("close",e)};return{ns:a,html:i,isExpand:n,onRead:e=>{t("read",e)},onClose:s,onClick:async t=>{if(e.provider.onClick){await e.provider.onClick(e.message,t)&&s()}},onExpandChange:()=>{n.value=!n.value}}},render(){var e,t;return n("div",{class:this.ns.b()},[n("div",{class:this.ns.e("content")},[n("div",{innerHTML:this.html,onClick:this.onClick,class:this.ns.em("content","html")},null),n("div",{class:this.ns.e("action")},[n("ion-icon",{class:this.ns.em("action","item"),title:Tt(this.isExpand?ibiz.i18n.t("panelComponent.userMessage.internalMessageGroup.collapse"):ibiz.i18n.t("panelComponent.userMessage.internalMessageGroup.expand")),name:this.isExpand?"chevron-down-outline":"chevron-forward-outline",onClick:this.onExpandChange},null),n(i("iBizBadge"),{class:this.ns.e("badge"),value:null==(e=this.message.children)?void 0:e.length},null),n(i("iBizIcon"),{baseDir:"iconfont",icon:{imagePath:"svg/read.svg"},class:[this.ns.em("action","item"),this.ns.em("action","read")],title:Tt(ibiz.i18n.t("panelComponent.userMessage.internalMessageContainer.markAsRead")),onClick:()=>this.onRead(this.message)},null)])]),this.isExpand&&n("div",{class:this.ns.e("children")},[null==(t=this.message.children)?void 0:t.map(e=>{let t;try{t=Mi(e)}catch(e){ibiz.log.error(e)}return t?t.render({message:e,class:this.ns.em("children","item"),onClose:()=>this.onClose(e),onRead:()=>this.onRead(e)}):n("div",{class:this.ns.em("children","item")},[ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.noSupportType",{type:e.content_type})])})])])}}),zD=a({name:"IBizInternalMessageTab",props:{controller:{type:Object,required:!0},showPopover:{type:Boolean,required:!0}},emits:{hiddenPopover:()=>!0},setup(e,{emit:t}){var a;const n=B("internal-message-tab"),i=()=>{t("hiddenPopover")},s=async(e,t)=>{var a;(null==(a=e.children)?void 0:a.length)?await Promise.all(e.children.filter(e=>e.id!==(null==t?void 0:t.id)).map(e=>ibiz.hub.notice.internalMessage.markRead(e))):await ibiz.hub.notice.internalMessage.markRead(e)},l=e.controller,r="".concat(null==(a=ibiz.appData)?void 0:a.context.srfsystemid,"-unreadOnly"),p=o(!1);ibiz.mc.command.internalMessage.on(async e=>{ibiz.log.debug("mqtt internalMessage: ",e),"INTERNALMESSAGE"===e.subtype&&(p.value=!0)}),c(()=>e.showPopover,e=>{e&&p.value&&(l.load(),l.refreshUnreadCount(),p.value=!1)});const m=o([]),v=o([]),g=u({total:0,pageSize:0,unreadOnly:l.unreadOnly}),b=()=>{g.total=l.total,g.pageSize=l.size,m.value=ko(l.messages),(()=>{const e={},t=[];m.value.forEach(a=>{const n=ibiz.env.isMob?a.mobile_url:a.url,i="".concat(a.message_type).concat(n);i&&"RECEIVED"===a.status&&"TodoNotify"!==a.message_type?(e[i]||(e[i]=[]),e[i].push({...a})):t.push({...a})});const a=[...t];Object.values(e).forEach(e=>{if(1===e.length)a.push({...e[0]});else{const t={...e[0]};t.children=e.map(e=>({...e})),a.push(t)}}),a.sort((e,t)=>as(e.update_time).isAfter(t.update_time)?-1:1);const n=new Set;a.filter(e=>"TodoNotify"===e.message_type&&"JSON"===e.content_type).forEach(e=>{try{const t=JSON.parse(e.content),a="".concat(t.bizkey,"_").concat(t.param02);t.todoid&&!n.has(a)&&(e.enableLink=!0,n.add(a))}catch(e){ibiz.log.error(e)}}),v.value=a})()};b();const f=e=>{g.unreadOnly=e};l.evt.on("dataChange",b),l.evt.on("unreadOnlyChange",f),h(()=>{l.evt.off("dataChange",b),l.evt.off("unreadOnlyChange",f)});return d(()=>{(()=>{const e=localStorage.getItem(r);e&&("true"===e?(g.unreadOnly=!0,l.unreadOnly=!0):(g.unreadOnly=!1,l.unreadOnly=!1))})(),l.load()}),{ns:n,state:g,allItems:m,messages:v,showMore:()=>{l.loadMore()},onMarkRead:s,onGroupClose:async(e,t)=>{i(),await s(e,t)},switchChange:()=>{l.toggleUnReadOnly(),localStorage.setItem(r,l.unreadOnly.toString())},hiddenPopover:i}},render(){const e=this.state.total-this.allItems.length;return n("div",{class:[this.ns.b()]},[n("div",{class:this.ns.b("content")},[this.allItems.length>0&&this.messages.map(e=>{var t;let a;try{a=Mi(e)}catch(e){ibiz.log.error(e)}return a?(null==(t=e.children)?void 0:t.length)?n(i("iBizInternalMessageGroup"),{message:e,provider:a,class:this.ns.e("group"),onRead:this.onMarkRead,onClose:t=>this.onGroupClose(e,t)},null):a.render({message:e,class:this.ns.e("item"),onClose:this.hiddenPopover,onRead:()=>this.onMarkRead(e)}):n("div",{class:this.ns.e("item")},[ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.noSupportType",{type:e.content_type})])}),0===this.allItems.length&&n("div",{class:this.ns.e("nodata")},[ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.notificationYet")]),e>0&&n("div",{class:this.ns.e("load-more"),onClick:this.showMore},[ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.loadMore",{length:e})])]),n("div",{class:this.ns.b("footer")},[n(i("el-switch"),{value:this.state.unreadOnly,onChange:this.switchChange,class:this.ns.be("footer","switch")},null),ibiz.i18n.t("panelComponent.userMessage.internalMessageTab.onlyShowUnread")])])}});const TD=a({name:"IBizUserMessage",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(e){const t=B("user-message"),a=e.controller,n=ibiz.hub.notice,i=o(!1);let s=0;n.internalMessage.ns=t,n.internalMessage.provider=new mD;const l=o("notification"),r=e.modelData.sysImage||{imagePath:"svg/message.svg"},c=o(),u=o(n.total),p=e=>{u.value=e};n.evt.on("totalChange",p);const m=()=>{if("hidden"===document.visibilityState)s=(new Date).getTime();else{((new Date).getTime()-s)/1e3>300&&(async()=>{const e=await ibiz.net.get("/appdata",ibiz.appUtil.getAppContext());e.ok&&(ibiz.appData=e.data,bs())})()}};return d(()=>{document.addEventListener("visibilitychange",m)}),h(()=>{n.evt.off("totalChange",p),document.removeEventListener("visibilitychange",m)}),{ns:t,c:a,noticeController:n,noticeNum:u,popoverRef:c,showPopover:i,sysImage:r,currentTab:l,hiddenPopover:()=>{c.value.hide()},onBatchReadClick:()=>{n.internalMessage.batchMarkRead()}}},render(){return n("div",{title:Tt(ibiz.i18n.t("panelComponent.userMessage.notice")),class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},[n(i("el-popover"),{ref:"popoverRef","popper-class":this.ns.b("popover"),placement:"bottom",trigger:"click",visible:this.showPopover,"onUpdate:visible":e=>this.showPopover=e},{reference:()=>n(i("el-badge"),{class:this.ns.e("badge"),value:this.noticeNum,hidden:0===this.noticeNum},{default:()=>[n(i("i-biz-icon"),{id:Bi.MESSAGE,class:[this.ns.e("image")],icon:this.sysImage},null)]}),default:()=>n("div",{class:this.ns.b("popover-content-box")},[n(i("el-tabs"),{class:this.ns.b("popover-content"),modelValue:this.currentTab,"onUpdate:modelValue":e=>this.currentTab=e},{default:()=>[n(i("el-tab-pane"),{label:ibiz.i18n.t("panelComponent.userMessage.notice"),name:"notification"},{default:()=>[n(zD,{controller:this.noticeController.internalMessage,showPopover:this.showPopover,onHiddenPopover:this.hiddenPopover},null)]}),n(i("el-tab-pane"),{label:ibiz.i18n.t("panelComponent.userMessage.backendTasks"),name:"async-action"},{default:()=>[n(eD,{controller:this.noticeController.asyncAction,showPopover:this.showPopover,onHiddenPopover:this.hiddenPopover},null)]})]}),n("div",{class:this.ns.b("popover-icons")},[n(i("iBizIcon"),{class:this.ns.b("popover-icons-read"),icon:{imagePath:"svg/read.svg"},baseDir:"iconfont",title:Tt(ibiz.i18n.t("panelComponent.userMessage.allRead")),onClick:this.onBatchReadClick},null)])])})])}});var AD=Object.defineProperty,OD=(e,t,a)=>(((e,t,a)=>{t in e?AD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class MD{constructor(){OD(this,"component","IBizUserMessage")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const ND=ie(TD,function(e){e.component(TD.name,TD),e.component(ZE.name,ZE),Li("DEIMPORTDATA2",()=>new rD),Li("DEEXPORTDATA",()=>new rD),Li("DEFAULT",()=>new rD),function(e){e.component(kD.name,kD),e.component(gD.name,gD),e.component(uD.name,uD),e.component(vD.name,vD),e.component(yD.name,yD),e.component(SD.name,SD),Ni("DEFAULT",()=>new mD),Ni("JSON",()=>new wD),Ni("HTML",()=>new xD),Ni("TEXT",()=>new PD)}(e),xi("RAWITEM_USERMESSAGE",()=>new MD)});var BD=Object.defineProperty,LD=(e,t,a)=>(((e,t,a)=>{t in e?BD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class RD extends Ii{constructor(){super(...arguments),LD(this,"searchFrom")}get searchButtonStyle(){return this.searchFrom.model.searchButtonStyle||"DEFAULT"}get advanceSearch(){return!!this.searchFrom.model.enableAdvanceSearch}get storedFilters(){var e;return(null==(e=this.searchFrom)?void 0:e.state.storedFilters)||[]}async onInit(){await super.onInit();const e=this.panel.container;if(!e)throw new Vt(ibiz.i18n.t("panelComponent.searchformButtons.errMessage"));this.searchFrom=e}onSearchButtonClick(){fa.execAndResolved("search",{context:this.panel.context,params:this.panel.params,data:[],ctrl:this.searchFrom,view:this.panel.view},this.panel.context.srfappid)}onResetButtonClick(){fa.execAndResolved("reset",{context:this.panel.context,params:this.panel.params,data:[],ctrl:this.searchFrom,view:this.panel.view},this.panel.context.srfappid)}}function _D(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const jD=a({name:"IBizSearchFormButtons",props:{modelData:{type:Object,required:!0},controller:{type:RD,required:!0}},setup(e){var t,a;const n=B("searchform-buttons"),i=e.controller,o="DESIGN"===(null==(a=null==(t=i.panel)?void 0:t.context)?void 0:a.srfrunmode);return{c:i,ns:n,onSearchButtonClick:()=>{o||i.onSearchButtonClick()},onResetButtonClick:()=>{i.onResetButtonClick()},saveFilterConfirm:()=>{Co.prompt(ibiz.i18n.t("panelComponent.searchformButtons.enterPrompt"),ibiz.i18n.t("panelComponent.searchformButtons.queryPrompt"),{confirmButtonText:ibiz.i18n.t("app.save"),cancelButtonText:ibiz.i18n.t("app.cancel")}).then(({value:e})=>{i.searchFrom.storeFilter(e)})},onAdvanceSearch:()=>{i.searchFrom.evt.emit("openAdvanceSearch",void 0)}}},render(){let e,t;return n("div",{class:[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass]},["SEARCHONLY"===this.controller.searchButtonStyle?n(i("el-button"),{onClick:this.onSearchButtonClick},_D(e=ibiz.i18n.t("app.search"))?e:{default:()=>[e]}):n(i("el-dropdown"),{"split-button":!0,type:"primary",onClick:this.onSearchButtonClick},{default:()=>n("span",{class:this.ns.b("label")},[ibiz.i18n.t("app.search")]),dropdown:()=>{let e,t;return n(i("el-dropdown-menu"),null,{default:()=>[n(i("el-dropdown-item"),{onClick:this.onResetButtonClick},_D(e=ibiz.i18n.t("app.reset"))?e:{default:()=>[e]}),this.controller.searchFrom.state.enableStoredFilters&&n(i("el-dropdown-item"),{onClick:this.saveFilterConfirm},_D(t=ibiz.i18n.t("panelComponent.searchformButtons.saveCondition"))?t:{default:()=>[t]}),this.controller.storedFilters.length>0&&this.controller.storedFilters.map((e,t)=>n(i("el-dropdown-item"),{class:this.ns.b("filter-item"),onClick:()=>{this.controller.searchFrom.applyStoredFilter(t)}},{default:()=>[n("span",{class:this.ns.be("filter-item","text")},[e.name,n("ion-icon",{class:this.ns.be("filter-item","remove"),onClick:e=>{e.stopPropagation(),this.controller.searchFrom.removeStoredFilter(t)},name:"close-outline"},null)])]}))]})}}),this.controller.advanceSearch&&n(i("el-button"),{onClick:this.onAdvanceSearch},_D(t=ibiz.i18n.t("app.advanceSearch"))?t:{default:()=>[t]})])}});var VD=Object.defineProperty,FD=(e,t,a)=>(((e,t,a)=>{t in e?VD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class UD{constructor(){FD(this,"component","IBizSearchFormButtons")}async createController(e,t,a){const n=new RD(e,t,a);return await n.init(),n}}const HD=ie(jD,function(e){e.component(jD.name,jD),xi("RAWITEM_SEARCHFORM_BUTTONS",()=>new UD)}),qD=a({name:"IBizViewMessage",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("view-message"),a=e.controller,n=pe(),{view:i}=n;return{ns:t,c:a,view:i}},render(){const e=this.view;if(e.state.isCreated){const t=e.state.viewMessages.BODY;if(null==t?void 0:t.length)return n(i("view-message"),{class:[this.ns.e("body-message")],messages:t},null)}return null}});var GD=Object.defineProperty,WD=(e,t,a)=>(((e,t,a)=>{t in e?GD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class YD{constructor(){WD(this,"component","IBizViewMessage")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const KD=ie(qD,function(e){e.component(qD.name,qD),xi("RAWITEM_VIEW_MESSAGE",()=>new YD)}),XD=a({name:"IBizPanelStaticCarousel",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){var t;const a=B("panel-static-carousel"),n=e.modelData,i=o([]),s=o(!0),l=o(3e3),r=o("DEFAULT"),c=e=>{const t=e.find(e=>Object.is(e.key,"autoplay"));t&&(s.value=!!Object.is(t.value,"1"));const a=e.find(e=>Object.is(e.key,"timespan"));a&&(l.value=Number(a.value)||0);const n=e.find(e=>Object.is(e.key,"showMode"));n&&n.value&&(r.value=n.value)};if(null==(t=n.rawItem)?void 0:t.rawItemParams){let e=[];const t=n.rawItem.rawItemParams;let a=0;t.findIndex(e=>Object.is(e.key,"autoplay"))>=0&&(a+=1),t.findIndex(e=>Object.is(e.key,"timespan"))>=0&&(a+=1),t.findIndex(e=>Object.is(e.key,"showMode"))>=0&&(a+=1),a>0?(e=t.slice(0,-a),c(t.slice(-a))):(e=t,c(t)),i.value=e.map(e=>{const{id:t,key:a,sysImage:n}=e;return{id:t,name:a,imgUrl:(null==n?void 0:n.imagePath)||(null==n?void 0:n.rawContent),cssClass:null==n?void 0:n.cssClass,linkPath:e.linkPath}})}return{ns:a,carouselData:i,isAuto:s,timeSpan:l,showMode:r}},render(){return n("div",{class:this.ns.b()},[n(i("iBizCarouselComponent"),{carouselData:this.carouselData,isAuto:this.isAuto,timeSpan:this.timeSpan,showMode:this.showMode},null)])}});var $D=Object.defineProperty,JD=(e,t,a)=>(((e,t,a)=>{t in e?$D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class QD{constructor(){JD(this,"component","IBizPanelStaticCarousel")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const ZD=ie(XD,function(e){e.component(XD.name,XD),xi("RAWITEM_STATIC_CAROUSEL",()=>new QD)});var eP=Object.defineProperty,tP=(e,t,a)=>(((e,t,a)=>{t in e?eP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class aP extends Si{constructor(){super(...arguments),tP(this,"key",go()),tP(this,"messageModes"),tP(this,"messageMap",new Map),tP(this,"alertParams",{data:{action:"VIEW",entity:"",key:"",time:0,username:""}})}}var nP=Object.defineProperty,iP=(e,t,a)=>(((e,t,a)=>{t in e?nP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class oP extends Ii{constructor(){super(...arguments),iP(this,"operator",[]),iP(this,"rawItemParams",{}),iP(this,"showMode","default"),iP(this,"enableNoAccess",!1),iP(this,"globalDownloadPrifix",!1),iP(this,"messageModeMap",new Map([["OPENDATA","VIEW"],["EDITDATA","EDIT"],["NOTICERELOAD","UPDATE"]]))}createState(){var e;return new aP(null==(e=this.parent)?void 0:e.state)}async onInit(){await super.onInit(),this.handleRawItemParams(),this.showMode=this.rawItemParams.showmode,this.enableNoAccess="true"===this.rawItemParams.enablenoaccess,this.rawItemParams.globaldownloadprifix?this.globalDownloadPrifix="true"===this.rawItemParams.globaldownloadprifix:this.globalDownloadPrifix=ibiz.config.common.globalDownloadPrifix,await this.getOperator()}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}initMessageModes(e){if(e.includes("DISPLAYOPPERSON")){1===e.length?this.state.messageModes=["VIEW","EDIT","UPDATE"]:this.state.messageModes=e.map(e=>this.messageModeMap.get(e)||e);const t=this.panel.context.srfusername;this.state.messageMap.set(t,{username:t})}}updateMessage(e){this.state.key=go();const{data:t}=e;"CLOSE"===t.action?this.state.messageMap.delete(t.username):this.state.messageMap.set(t.username,t),this.state.alertParams=e}async getOperator(){if("avatar"===this.showMode){const e=await ibiz.hub.getApp(this.panel.context.srfappid);this.operator=await e.codeList.get("SysOperator",this.panel.context,this.panel.params)}}getIconUrlByName(e){var t;let a="";const n=this.operator.find(t=>t.text===e);return n&&(a=(null==(t=n.data)?void 0:t.iconurl)||""),a}getDownloadUrl(e){if(!e)return"";const t=JSON.parse(e);if(0===t.length)return"";const{downloadUrl:a}=ibiz.util.file.calcFileUpDownUrl(this.panel.context,this.panel.params,{},{enableNoAccess:this.enableNoAccess,globalDownloadPrifix:this.globalDownloadPrifix});return a.replace("%fileId%",t[0].id)}}const sP=a({name:"IBizCoopPos",props:{modelData:{type:Object,required:!0},controller:{type:oP,required:!0}},setup(e){const t=e.controller,a=B("coop-pos"),i=o([]),s=r(()=>[...t.state.messageMap.values()].filter(e=>!e.action||(t.state.messageModes||[]).includes(e.action)));return{ns:a,c:t,messages:s,renderItem:e=>{let o=ibiz.util.text.abbreviation(e.username)||e.username;if("avatar"===t.showMode){const s=t.getIconUrlByName(e.username),l=t.getDownloadUrl(s);l&&!i.value.includes(l)&&(o=n("img",{class:a.e("img"),src:l,onError:()=>(e=>{i.value.push(e)})(l)},null))}return o}}},render(){return n("div",{class:[this.ns.b(),...this.controller.containerClass]},[this.c.state.messageModes?n("div",{class:this.ns.e("on-line-editing")},[this.messages.map(e=>n("div",{class:this.ns.em("on-line-editing","person"),title:e.action?ibiz.i18n.t("panelComponent.coopPos.".concat(e.action.toLowerCase()),{username:e.username}):"",style:"background-color: ".concat(ibiz.util.text.stringToHexColor(e.username))},[this.renderItem(e)]))]):n(i("iBizCoopAlert"),y({key:this.c.state.key},this.c.state.alertParams),null)])}});var lP=Object.defineProperty,rP=(e,t,a)=>(((e,t,a)=>{t in e?lP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class cP{constructor(){rP(this,"component","IBizCoopPos")}async createController(e,t,a){const n=new oP(e,t,a);return await n.init(),n}}const dP=ie(sP,function(e){e.component(sP.name,sP),xi("RAWITEM_COOP_POS",()=>new cP)});var uP=Object.defineProperty,hP=(e,t,a)=>(((e,t,a)=>{t in e?uP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class pP extends Ii{constructor(){super(...arguments),hP(this,"rawItemParams",{})}async onInit(){await super.onInit(),this.handleRawItemParams()}handleRawItemParams(){var e;const t=null==(e=this.model.rawItem)?void 0:e.rawItemParams;Array.isArray(t)&&t.forEach(e=>{const t=e.key,a=e.value;t&&a&&(this.rawItemParams[t.toLowerCase()]=a)})}}const mP=a({name:"IBizViewMsgPos",props:{modelData:{type:Object,required:!0},controller:{type:pP,required:!0}},setup:()=>({ns:B("view-msg-pos"),view:pe().view}),render(){const e=this.controller;if(!this.view.state.isCreated)return;const t=e.rawItemParams.position||"BODY",a="true"===e.rawItemParams.scroll,o=this.view.state.viewMessages[t];return(null==o?void 0:o.length)?n("div",{class:this.ns.b()},[n(i("view-message"),{messages:o,scroll:a,context:e.panel.context,params:e.panel.params,controller:e.panel.view.viewMsgController},null)]):null}});var vP=Object.defineProperty,gP=(e,t,a)=>(((e,t,a)=>{t in e?vP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class bP{constructor(){gP(this,"component","IBizViewMsgPos")}async createController(e,t,a){const n=new pP(e,t,a);return await n.init(),n}}const fP=ie(mP,function(e){e.component(mP.name,mP),xi("RAWITEM_VIEWMSG_POS",()=>new bP)}),wP=a({name:"IBizUserAction",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(e){var t;const a=B("user-action"),n=e.controller,i={SETTING:{imagePath:"svg/setting.svg"},HELPER:{imagePath:"svg/helper.svg"},CUSTOM:{imagePath:"svg/custom-workbench.svg"}};let o=e.modelData.sysImage;if(!o&&e.modelData&&e.modelData.rawItem){const t=e.modelData.rawItem.predefinedType;t&&(o=i[t])}let s,l="PARENT";(null==(t=e.modelData.rawItem)?void 0:t.rawItemParams)&&e.modelData.rawItem.rawItemParams.find(e=>{var t;return!("noprivmode"!==(null==(t=e.key)?void 0:t.toLowerCase())||!e.value)&&(l=e.value,!0)});n.panel.view.evt.on("onMounted",()=>{(()=>{const t=n.panel.view.getController("appmenu");if(t&&(s=t.allAppMenuItems.find(t=>t.id===e.modelData.id),s&&s.accessKey)){const e=ibiz.hub.getApp(n.panel.context.srfappid).authority.calcByResCode(s.accessKey);n.state.visible=e,n.parent&&"PARENT"===l&&(n.parent.state.visible=e)}})()});return{ns:a,c:n,sysImage:o,onClick:async e=>{if(s){const t=n.panel.context.clone(),a=n.panel.params;t.srfappid=s.appId||ibiz.env.appId,await ibiz.commands.execute(zi.TAG,s.appFuncId,t,a,{event:e})}}}},render(){return n("div",{class:this.ns.b(),title:Tt(this.modelData.caption)},[n(i("i-biz-icon"),{class:[this.ns.e("image")],icon:this.sysImage,onClick:e=>this.onClick(e)},null)])}});var yP=Object.defineProperty,CP=(e,t,a)=>(((e,t,a)=>{t in e?yP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class IP{constructor(){CP(this,"component","IBizUserAction")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const xP=e("aU",ie(wP,function(e){e.component(wP.name,wP),xi("RAWITEM_SETTING",()=>new IP),xi("RAWITEM_HELPER",()=>new IP),xi("RAWITEM_CUSTOM",()=>new IP)})),SP=a({name:"IBizDataImportShell",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("data-import-shell"),a=e.controller;return{ns:t,c:a,onDismiss:()=>{a.panel.view.closeView()}}},render(){const{deDataImport:e,appDataEntity:t}=this.c.panel.view.state,a=[this.ns.b(),this.ns.m(this.modelData.id),...this.controller.containerClass],n=e.enableCustomized?"DataImport2":"DataImport";return l(i(n),{dismiss:this.onDismiss,dataImport:e,appDataEntity:t,context:this.c.panel.context,params:this.c.panel.params,class:a})}});var EP=Object.defineProperty,DP=(e,t,a)=>(((e,t,a)=>{t in e?EP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class PP{constructor(){DP(this,"component","IBizDataImportShell")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const kP=ie(SP,function(e){e.component(SP.name,SP),xi("RAWITEM_DATA_IMPORT",()=>new PP)}),zP=a({name:"IBizShortCut",components:{draggable:is},props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){const t=B("short-cut"),a=I().proxy,s=hs(),l=ibiz.util.shortCut,r=o(!0),c=o(!1),p=u(l.data),m={newIndex:0,oldIndex:0},v=new Map([["ROUTE_MODAL","INDEXVIEWTAB_POPUPMODAL"],["MODAL","POPUPMODAL"],["DRAWER","DRAWER_RIGHT"]]),g=e=>{0===p.length&&c.value&&(c.value=!1),a.$forceUpdate()};d(()=>{r.value="vertical"!==l.mode,ibiz.util.shortCut.onChange(g)}),h(()=>{ibiz.util.shortCut.offChange(g)});const b=()=>{r.value=!r.value,r.value?(c.value=!1,l.setShortCutMode("horizontal")):l.setShortCutMode("vertical")},f=e=>{e.moved?ibiz.util.shortCut.changeIndex(e.moved.newIndex,e.moved.oldIndex):e.added?m.newIndex=e.added.newIndex:e.removed&&(m.oldIndex=e.removed.oldIndex,ibiz.util.shortCut.changeIndex(m.newIndex,m.oldIndex))},w=a=>n(is,{itemKey:"key",class:[t.e("draggable"),t.is("horizontal",!a),t.is("vertical",a)],modelValue:p,group:e.controller.model.id,onChange:e=>f(e)},{item:({element:e,index:o})=>{if(a&&!r.value||a&&r.value&&o>5||!a&&o<6)return n("div",{class:[t.e("item"),t.e("draggable-item")],title:Tt(e.caption),onClick:()=>(e=>{if(c.value=!1,"ROUTE"===e.openMode){const t=e.fullPath.substring(1);s.currentRoute.value.fullPath!==t&&s.push({path:e.fullPath.substring(1)})}else ibiz.commands.execute(Ai.TAG,e.appViewId,Lt.create(e.context),e.params,{openMode:v.get(e.openMode)})})(e)},[n("svg",{viewBox:"0 0 16 16",class:["drag-icon","icon"],xmlns:"http://www.w3.org/2000/svg",height:"16px",width:"16px",focusable:"false"},[n("g",{id:"drag-icon/drag--","stroke-width":"1","fill-rule":"evenodd"},[n("g",{id:"drag-icon",transform:"translate(5 1)","fill-rule":"nonzero"},[n("path",{d:"M1 2a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zM1 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm-4 4a1 1 0 1 1 0-2 1 1 0 0 1 0 2zm4 0a1 1 0 1 1 0-2 1 1 0 0 1 0 2z",id:"drag-icon-air"},null)])])]),e.icon?n(i("iBizIcon"),{class:["caption-icon","icon"],icon:e.icon},null):n("ion-icon",{class:["caption-icon","icon"],name:"ellipsis-horizontal-circle-outline"},null),n("div",{class:t.em("item","caption")},[e.caption]),n("ion-icon",{name:"close-outline",class:["close-icon","icon"],onClick:t=>((e,t)=>{e.stopPropagation(),ibiz.util.shortCut.removeShortCut(t)})(t,e.key)},null)])}});return{ns:t,data:p,isShowToolbar:r,onChange:f,renderDraggable:w,renderMore:()=>n(i("el-popover"),{visible:c.value,"onUpdate:visible":e=>c.value=e,placement:"top-start",trigger:"click",width:"auto","popper-class":t.e("popover")},{reference:()=>n("div",{class:[t.e("more"),t.e("operate")]},[n(i("el-tooltip"),{content:ibiz.i18n.t("app.more"),placement:"top"},{default:()=>[n("div",null,[n("span",{class:t.em("more","caption")},[r.value?"6/".concat(p.length):p.length]),n("i",{class:["fa","icon","more-icon",c.value?"fa-angle-double-down":"fa-angle-double-up"],"aria-hidden":"true"},null)])]})]),default:()=>[w(!0),n("div",{class:[t.e("item"),t.e("action-item"),t.is("hidden",r.value)],onClick:b},[n("ion-icon",{class:["expand-icon","icon"],name:"chevron-back-outline"},null),n("div",{class:t.em("item","caption")},[ibiz.i18n.t("panelComponent.shortCut.expandToolbar")])])]}),renderRecover:()=>n("div",{class:[t.e("recover"),t.e("operate")],onClick:b},[n(i("el-tooltip"),{effect:"dark",content:ibiz.i18n.t("app.retract"),placement:"top"},{default:()=>[n("ion-icon",{class:["recover-icon","icon"],name:"chevron-forward-outline"},null)]})])}},render(){return n("div",{class:[this.ns.b(),...this.controller.containerClass,this.ns.is("conceal",0===this.data.length)]},[this.isShowToolbar&&this.renderDraggable(!1),(!this.isShowToolbar||this.data.length>6)&&this.renderMore(),this.isShowToolbar&&this.renderRecover()])}});var TP=Object.defineProperty,AP=(e,t,a)=>(((e,t,a)=>{t in e?TP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class OP{constructor(){AP(this,"component","IBizShortCut")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const MP=ie(zP,function(e){e.component(zP.name,zP),xi("RAWITEM_SHORTCUT",()=>new OP)});var NP=Object.defineProperty,BP=(e,t,a)=>(((e,t,a)=>{t in e?NP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class LP extends Si{constructor(){super(...arguments),BP(this,"code",""),BP(this,"image",""),BP(this,"state",""),BP(this,"loading",!1),BP(this,"error")}}var RP=Object.defineProperty,_P=(e,t,a)=>(((e,t,a)=>{t in e?RP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class jP extends Ii{constructor(){super(...arguments),_P(this,"captcha",u({"Captcha-State":"","Captcha-Code":""}))}createState(){var e;return new LP(null==(e=this.parent)?void 0:e.state)}async panelStateNotify(e){super.panelStateNotify(e),this.data.captcha=this.captcha}async onInit(){super.onInit(),await this.loadCaptcha(),this.panel.view.evt.on("onAfterLogin",e=>{e.ok||e.panelDataParent&&e.panelDataParent!==this.dataParent.model.id||(this.loadCaptcha(),this.state.code="")})}async validate(){return this.state.code?(this.state.error=void 0,!0):(this.state.error="请输入验证码",!1)}onChange(){Object.assign(this.captcha,{"Captcha-State":this.state.state,"Captcha-Code":this.state.code})}async loadCaptcha(){this.state.loading=!0;const e={url:"".concat(ibiz.env.baseUrl,"/").concat(ibiz.env.appId,"/auths/captcha"),method:"post",headers:{"Content-Type":"application/json;charset=UTF-8",Accept:"application/json"},data:{}};try{const t=await ys(e);200===t.status&&t.data&&(this.state.state=t.data.state,this.state.image=t.data.image)}catch(e){this.state.state="",this.state.image=""}finally{this.state.loading=!1,this.onChange()}}}const VP=a({name:"IBizAuthCaptcha",props:{modelData:{type:Object,required:!0},controller:{type:jP,required:!0}},setup(e){const t=B("auth-captcha"),a=e.controller,n=r(()=>{let n=[t.b(),t.m(a.model.id)];return n=[...n,...e.controller.containerClass,t.is("hidden",!e.controller.state.visible),t.is("error",!!a.state.error)],n});return{c:a,ns:t,classArr:n,onClick:()=>{a.state.loading||a.loadCaptcha()},onChange:()=>{a.onChange(),a.validate()}}},render(){return n("div",{class:this.classArr},[n(i("el-input"),{modelValue:this.c.state.code,"onUpdate:modelValue":e=>this.c.state.code=e,class:this.ns.e("captcha"),onInput:this.onChange,onBlur:this.onChange,placeholder:"验证码"},null),b(n(i("el-image"),{src:this.c.state.image,class:this.ns.e("image"),onClick:this.onClick,title:Tt("点击图片刷新")},{error:()=>n("div",{onClick:this.onClick,class:[this.ns.em("image","hint"),this.ns.is("loading",this.c.state.loading)]},[this.c.state.loading?"加载中...":"加载失败"])}),[[C("loading"),this.c.state.loading]]),this.c.state.error&&n("div",{class:this.ns.e("error")},[this.c.state.error])])}});var FP=Object.defineProperty,UP=(e,t,a)=>(((e,t,a)=>{t in e?FP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class HP{constructor(){UP(this,"component","IBizAuthCaptcha")}async createController(e,t,a){const n=new jP(e,t,a);return await n.init(),n}}const qP=ie(VP,function(e){e.component(VP.name,VP),xi("RAWITEM_AUTH_CAPTCHA",()=>new HP)});var GP=Object.defineProperty,WP=(e,t,a)=>(((e,t,a)=>{t in e?GP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class YP extends Si{constructor(){super(...arguments),WP(this,"buttonsState")}}class KP extends Ii{createState(){var e;return new YP(null==(e=this.parent)?void 0:e.state)}get data(){return this.dataParent.data}constructor(e,t,a){super(e,t,a),this.state.buttonsState=new Ri}async onInit(){await super.onInit(),await this.initUIActions(),await this.initButtonsState()}async initUIActions(){const{buttonListType:e,uiactionGroup:t}=this.model;"UIACTIONGROUP"===e&&await _i(t,this.panel.context,this.panel.params)}async initButtonsState(){const{buttonListType:e,uiactionGroup:t,panelButtons:a}=this.model;if("UIACTIONGROUP"===e){if(null==t?void 0:t.uiactionGroupDetails){ji(t.uiactionGroupDetails).forEach(e=>{if(e.uiactionId){const t=new Di(e.id,e.appId,e.uiactionId,e);this.state.buttonsState.addState(e.id,t)}})}}else null==a||a.forEach(e=>{if(e.uiactionId){const t=new Di(e.id,this.model.appId,e.uiactionId);this.state.buttonsState.addState(e.id,t)}});await this.state.buttonsState.init()}async dataChangeNotify(e){await this.state.buttonsState.update(this.panel.context,this.data,this.panel.model.appDataEntityId),super.dataChangeNotify(e)}async panelStateNotify(e){await this.state.buttonsState.update(this.panel.context,this.data,this.panel.model.appDataEntityId),super.panelStateNotify(e)}getModelById(e){const{buttonListType:t,uiactionGroup:a,panelButtons:n}=this.model;if("UIACTIONGROUP"===t){return ji(null==a?void 0:a.uiactionGroupDetails).find(t=>t.id===e)}return null==n?void 0:n.find(t=>t.id===e)}async handleClick(e,t){const a=this.getModelById(e);(null==a?void 0:a.uiactionId)&&await fa.execAndResolved(a.uiactionId,{context:this.panel.context,params:{panelDataParent:this.dataParent.model.id,...this.panel.params},event:t,data:[this.data],view:this.panel.view,ctrl:this.panel,noWaitRoute:!0},a.appId||this.model.appId)}calcItemVisible(e){this.state.buttonsState.visible?super.calcItemVisible(e):this.state.visible=!1}calcItemDisabled(e){this.state.buttonsState.disabled?this.state.disabled=!0:super.calcItemDisabled(e)}}const XP=a({name:"IBizPanelButtonList",props:{modelData:{type:Object,required:!0},controller:{type:KP,required:!0}},setup(e){const t=B("panel-button-list"),a=e.controller;return{ns:t,handleClick:async(e,t)=>{null==t||t.stopPropagation(),a.handleClick(e,t)}}},render(){const{state:e}=this.controller;return e.visible?n(i("iBizButtonList"),{class:[this.ns.b(),...this.controller.containerClass],model:this.modelData,disabled:e.disabled,buttonsState:e.buttonsState,onClick:this.handleClick},null):null}});var $P=Object.defineProperty,JP=(e,t,a)=>(((e,t,a)=>{t in e?$P(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class QP{constructor(){JP(this,"component","IBizPanelButtonList")}async createController(e,t,a){const n=new KP(e,t,a);return await n.init(),n}}const ZP=ie(XP,function(e){e.component(XP.name,XP),xi("BUTTONLIST",()=>new QP)}),ek=a({name:"IBizAuthSsO",props:{modelData:{type:Object,required:!0},controller:{type:Ii,required:!0}},setup(e){var t;const a=B("auth-sso"),n=null==(t=e.controller.model.rawItem)?void 0:t.rawItemParams,i=null==n?void 0:n.map(e=>{const t=e.value?JSON.parse(e.value):{};return{key:e.key,sysImage:e.sysImage,title:t.title,params:t}});return{ns:a,items:i,handleThridLogin:(e,t)=>{if(e)switch(e){case"DINGDING":(async()=>{ibiz.thirdAuth.auth("DINGTALK","THIRD")})();break;case"WXWORK":(async()=>{ibiz.thirdAuth.auth("WXWORK","THIRD")})();break;default:(async e=>{ibiz.thirdAuth.auth("OAUTH","THIRD",e)})(t)}}}},render(){return this.items&&this.items.length?n("div",{class:this.ns.b()},[this.items.map(e=>{var t;let a;return e.sysImage?a=n(i("iBizIcon"),{icon:e.sysImage},null):"DINGDING"===e.key?a=n("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"651",width:"48",height:"48"},[n("defs",null,[n("style",{type:"text/css"},null)]),n("path",{d:"M512 2C230.2 2 2 230.2 2 512s228.2 510 510 510 510-228.2 510-510S793.3 2 512 2z m235.9 442c-1 4.6-3.6 10.8-7.2 19.1l-0.5 0.5c-21.6 45.8-77.3 135.5-77.3 135.5l-0.5-0.5-16.5 28.3h78.8L574.3 826.8l34-136h-61.8l21.6-90.2c-17.5 4.1-38.1 9.8-62.3 18 0 0-33 19.1-94.8-37.1 0 0-41.7-37.1-17.5-45.8 10.3-4.1 50-8.8 81.4-12.9 42.2-5.7 68.5-8.8 68.5-8.8s-130.3 2.1-161.2-3.1c-30.9-4.6-70.1-56.7-78.3-102 0 0-12.9-24.7 27.8-12.9 40.2 11.8 209.2 45.8 209.2 45.8S321.4 375 307 358.5c-14.4-16.5-42.8-89.6-39.2-134.5 0 0 1.5-11.3 12.9-8.2 0 0 161.8 74.2 272.5 114.4C664.5 371.4 760.8 392 747.9 444z",fill:"#3296FA","p-id":"652"},null)]):"WXWORK"===e.key&&(a=n("svg",{class:"icon",width:"200px",height:"200.00px",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[n("path",{fill:"#36ab60",d:"M352.814545 385.396364m-33.512727 0a33.512727 33.512727 0 1 0 67.025455 0 33.512727 33.512727 0 1 0-67.025455 0Z"},null),n("path",{fill:"#36ab60",d:"M502.690909 384.465455m-33.512727 0a33.512727 33.512727 0 1 0 67.025454 0 33.512727 33.512727 0 1 0-67.025454 0Z"},null),n("path",{fill:"#36ab60",d:"M576.232727 534.341818m-23.272727 0a23.272727 23.272727 0 1 0 46.545455 0 23.272727 23.272727 0 1 0-46.545455 0Z"},null),n("path",{fill:"#36ab60",d:"M694.458182 536.203636m-23.272727 0a23.272727 23.272727 0 1 0 46.545454 0 23.272727 23.272727 0 1 0-46.545454 0Z"},null),n("path",{fill:"#36ab60",d:"M512 0C229.003636 0 0 229.003636 0 512s229.003636 512 512 512 512-229.003636 512-512S794.996364 0 512 0z m-87.505455 630.225455c-26.996364 0-48.407273-5.585455-75.403636-11.17091l-75.403636 37.236364 21.410909-64.232727c-53.992727-37.236364-85.643636-85.643636-85.643637-145.221818 0-102.4 96.814545-182.458182 215.04-182.458182 105.192727 0 198.283636 64.232727 216.901819 150.807273-6.516364-0.930909-13.963636-0.930909-20.48-0.93091-102.4 0-182.458182 76.334545-182.458182 170.356364 0 15.825455 2.792727 30.72 6.516363 44.683636-7.447273 0-13.963636 0.930909-20.48 0.93091z m314.647273 75.403636l15.825455 53.992727-58.647273-32.581818c-21.410909 5.585455-42.821818 11.170909-64.232727 11.170909-102.4 0-182.458182-69.818182-182.458182-155.461818s80.058182-155.461818 182.458182-155.461818c96.814545 0 182.458182 69.818182 182.458182 155.461818 0 47.476364-31.650909 90.298182-75.403637 122.88z"},null)])),n("div",{class:[this.ns.e("sign-btn"),this.ns.m("WXWORK"===e.key?"wx":null==(t=e.key)?void 0:t.toLowerCase())],title:e.title,onClick:()=>this.handleThridLogin(e.key,e.params)},[a])})]):n("div",{class:this.ns.b()},[n("div",{class:[this.ns.e("sign-btn"),this.ns.m("dingding")],onClick:()=>this.handleThridLogin("DINGDING"),title:ibiz.i18n.t("panelComponent.authSsO.dingLogin")},[n("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"651",width:"48",height:"48"},[n("defs",null,[n("style",{type:"text/css"},null)]),n("path",{d:"M512 2C230.2 2 2 230.2 2 512s228.2 510 510 510 510-228.2 510-510S793.3 2 512 2z m235.9 442c-1 4.6-3.6 10.8-7.2 19.1l-0.5 0.5c-21.6 45.8-77.3 135.5-77.3 135.5l-0.5-0.5-16.5 28.3h78.8L574.3 826.8l34-136h-61.8l21.6-90.2c-17.5 4.1-38.1 9.8-62.3 18 0 0-33 19.1-94.8-37.1 0 0-41.7-37.1-17.5-45.8 10.3-4.1 50-8.8 81.4-12.9 42.2-5.7 68.5-8.8 68.5-8.8s-130.3 2.1-161.2-3.1c-30.9-4.6-70.1-56.7-78.3-102 0 0-12.9-24.7 27.8-12.9 40.2 11.8 209.2 45.8 209.2 45.8S321.4 375 307 358.5c-14.4-16.5-42.8-89.6-39.2-134.5 0 0 1.5-11.3 12.9-8.2 0 0 161.8 74.2 272.5 114.4C664.5 371.4 760.8 392 747.9 444z",fill:"#3296FA","p-id":"652"},null)])]),n("div",{class:[this.ns.e("sign-btn"),this.ns.m("wx")],onClick:()=>this.handleThridLogin("WXWORK"),title:ibiz.i18n.t("panelComponent.authSsO.wechatLogin")},[n("svg",{class:"icon",width:"200px",height:"200.00px",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[n("path",{fill:"#36ab60",d:"M352.814545 385.396364m-33.512727 0a33.512727 33.512727 0 1 0 67.025455 0 33.512727 33.512727 0 1 0-67.025455 0Z"},null),n("path",{fill:"#36ab60",d:"M502.690909 384.465455m-33.512727 0a33.512727 33.512727 0 1 0 67.025454 0 33.512727 33.512727 0 1 0-67.025454 0Z"},null),n("path",{fill:"#36ab60",d:"M576.232727 534.341818m-23.272727 0a23.272727 23.272727 0 1 0 46.545455 0 23.272727 23.272727 0 1 0-46.545455 0Z"},null),n("path",{fill:"#36ab60",d:"M694.458182 536.203636m-23.272727 0a23.272727 23.272727 0 1 0 46.545454 0 23.272727 23.272727 0 1 0-46.545454 0Z"},null),n("path",{fill:"#36ab60",d:"M512 0C229.003636 0 0 229.003636 0 512s229.003636 512 512 512 512-229.003636 512-512S794.996364 0 512 0z m-87.505455 630.225455c-26.996364 0-48.407273-5.585455-75.403636-11.17091l-75.403636 37.236364 21.410909-64.232727c-53.992727-37.236364-85.643636-85.643636-85.643637-145.221818 0-102.4 96.814545-182.458182 215.04-182.458182 105.192727 0 198.283636 64.232727 216.901819 150.807273-6.516364-0.930909-13.963636-0.930909-20.48-0.93091-102.4 0-182.458182 76.334545-182.458182 170.356364 0 15.825455 2.792727 30.72 6.516363 44.683636-7.447273 0-13.963636 0.930909-20.48 0.93091z m314.647273 75.403636l15.825455 53.992727-58.647273-32.581818c-21.410909 5.585455-42.821818 11.170909-64.232727 11.170909-102.4 0-182.458182-69.818182-182.458182-155.461818s80.058182-155.461818 182.458182-155.461818c96.814545 0 182.458182 69.818182 182.458182 155.461818 0 47.476364-31.650909 90.298182-75.403637 122.88z"},null)])])])}});var tk=Object.defineProperty,ak=(e,t,a)=>(((e,t,a)=>{t in e?tk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class nk{constructor(){ak(this,"component","IBizAuthSsO")}async createController(e,t,a){const n=new Ii(e,t,a);return await n.init(),n}}const ik=ie(ek,function(e){e.component(ek.name,ek),xi("RAWITEM_AUTH_SSO",()=>new nk)});function ok(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const sk=a({name:"IBizIndexBlankPlaceholder",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(e){const t=e.controller,a=B("index-blank-placeholder"),{id:n}=e.modelData,i=r(()=>{let t=[a.b(),a.m(n)];return t=[...t,...e.controller.containerClass,a.is("hidden",!e.controller.state.visible)],t});return t.routeDepth&&ve(e=>{t.setVisible(!e.currentKey)},t.routeDepth+1),{ns:a,classArr:i}},render(){var e,t;let a;const o=(null==(t=(e=this.$slots).default)?void 0:t.call(e))||[],s=n(i("iBizRow"),{slot:"content",layout:this.modelData.layout},ok(a=o.map(e=>{const t=e.props;return t&&t.controller?n(i("iBizCol"),{layoutPos:t.modelData.layoutPos,state:t.controller.state},ok(e)?e:{default:()=>[e]}):e}))?a:{default:()=>[a]});return n("div",{class:this.classArr,onClick:e=>this.controller.onClick(e)},[this.controller.model.cssStyle?n("style",{type:"text/css"},[this.controller.model.cssStyle]):null,s])}});class lk extends Si{}class rk extends Ii{createState(){var e;return new lk(null==(e=this.parent)?void 0:e.state)}get routeDepth(){return this.panel.view.modal.routeDepth}get appmenu(){return this.panel.getController("appmenu")}get navPos(){return this.panel.panelItems.nav_pos_index}async onInit(){await super.onInit(),this.state.keepAlive=!0,this.state.visible=!1,this.panel.evt.on("onMounted",async()=>{var e;this.navPos&&(this.navPos.state.keepAlive=!0);const t=null==(e=this.appmenu)?void 0:e.getDefaultOpenView();if(t){const e=await ibiz.hub.config.view.get(t),{openMode:a="INDEXVIEWTAB"}=e;this.state.visible=!a.startsWith("INDEXVIEWTAB")}})}setVisible(e){this.state.visible=e,this.navPos&&(this.navPos.state.visible=!e)}}var ck=Object.defineProperty,dk=(e,t,a)=>(((e,t,a)=>{t in e?ck(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class uk{constructor(){dk(this,"component","IBizIndexBlankPlaceholder")}async createController(e,t,a){const n=new rk(e,t,a);return await n.init(),n}}const hk=ie(sk,function(e){e.component(sk.name,sk),xi("CONTAINER_INDEX_BLANK_PLACEHOLDER",()=>new uk)});var pk=Object.defineProperty,mk=(e,t,a)=>(((e,t,a)=>{t in e?pk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class vk extends Si{constructor(){super(...arguments),mk(this,"query",""),mk(this,"items",[]),mk(this,"histories",[]),mk(this,"list",[]),mk(this,"loading",!1)}}var gk=Object.defineProperty,bk=(e,t,a)=>(((e,t,a)=>{t in e?gk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class fk extends Ii{constructor(){super(...arguments),bk(this,"keyName","srfkey"),bk(this,"textName","srfmajortext"),bk(this,"rawItemParams",{}),bk(this,"historyCacheKey","global-search-history"),bk(this,"maxHistory",7),bk(this,"size",100)}createState(){var e;return new vk(null==(e=this.parent)?void 0:e.state)}async onInit(){await super.onInit(),this.handleRawItemParams(),this.initParams(),this.initHistory(),await this.initGlobalSearchItem()}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}initParams(){this.rawItemParams.historycachekey&&(this.historyCacheKey+=this.rawItemParams.historycachekey),this.rawItemParams.maxhistory&&(this.maxHistory=Number(this.rawItemParams.maxhistory)),this.rawItemParams.size&&(this.size=Number(this.rawItemParams.size))}initHistory(){const e=localStorage.getItem(this.historyCacheKey);e&&(this.state.histories=JSON.parse(e))}async getSearchFunc(e){const t=[],a=e.map(async e=>{try{if(e.appMenuItems){const a=await this.getSearchFunc(e.appMenuItems);return void t.push(...a)}if(e.appFuncId){let a=ibiz.hub.getApp(e.appId);a||(a=await ibiz.hub.getAppAsync(e.appId));const n=a.getAppFunc(e.appFuncId);n&&"SEARCH"===n.appFuncType&&n.appDEACModeId&&n.appDataEntityId&&t.push(n)}}catch(t){console.error("计算菜单应用功能异常: ".concat(e.appFuncId),t)}});return await Promise.all(a),t}async initGlobalSearchItem(){const e=Pn(this.panel.view.model,"appmenu");if(!e)return;const t=e.appMenuItems||[],a=await this.getSearchFunc(t);await Promise.all(a.map(async e=>{const t=await ga(e.appDEACModeId,e.appDataEntityId,e.appId);if(t){let a;t.itemSysPFPluginId&&(a=await Vi(t)),this.state.items.push({deACMode:t,acItemProvider:a,appDataEntityId:e.appDataEntityId})}}))}addToHistory(e){const t=this.state.histories.filter(t=>t!==e);t.push(e),t.length>this.maxHistory&&t.shift(),this.state.histories=t,localStorage.setItem(this.historyCacheKey,JSON.stringify(this.state.histories))}getFetchParams(e){const{deACMode:t}=e,{minorSortDir:a,minorSortAppDEFieldId:n}=t,i={page:0,size:this.size,query:this.state.query};return a&&n&&Object.assign(i,{sort:"".concat(n.toLowerCase(),",").concat(a.toLowerCase())}),i}handleResponseHeader(e){return{page:e.headers["x-page"]?Number(e.headers["x-page"]):0,total:e.headers["x-total"]?Number(e.headers["x-total"]):0}}async loadByACMode(e){let t=[];const{appDataEntityId:a,deACMode:n}=e,{appDEDataSetId:i}=n;if(!i)return t;const o=this.getFetchParams(e),s=ibiz.hub.getApp(n.appId),l=await s.deService.exec(a,i,this.panel.context,o);if(l.ok&&l.data){const{page:e,total:a}=this.handleResponseHeader(l),n=l.data;(e+1)*this.size<a&&n.push({[this.textName]:"".concat(ibiz.i18n.t("panelComponent.globalSearch.moreTips",{total:a,size:this.size})),[this.keyName]:go()}),t=n}return t}clearHistory(){this.state.histories=[],localStorage.setItem(this.historyCacheKey,JSON.stringify(this.state.histories))}async search(e){if(this.state.query=e,this.state.query){this.state.list=[],this.state.loading=!0,this.addToHistory(this.state.query);try{await Promise.all(this.state.items.map(async e=>{const t=await this.loadByACMode(e);this.state.list.push(...t)}))}catch(e){ibiz.log.error(e)}finally{this.state.loading=!1}}}openLinkView(e,t){const{appDataEntityId:a,deACMode:n}=t,{linkAppViewId:i}=n;if(!i)return;const o=this.panel.context.clone(),s=ra(a);Object.assign(o,{[s]:e[this.keyName]}),ibiz.commands.execute(Ai.TAG,i,o,{noWaitRoute:!0})}getSearchItemByEntity(e){return this.state.items.find(t=>ra(t.appDataEntityId)===(null==e?void 0:e.toLowerCase()))}}var wk=Object.defineProperty,yk=(e,t,a)=>(((e,t,a)=>{t in e?wk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Ck{constructor(){yk(this,"component","IBizGlobalSearch")}async createController(e,t,a){const n=new fk(e,t,a);return await n.init(),n}}const Ik=a({name:"IBizVirtualList",props:{items:{type:Array,required:!0},itemSize:{type:Number,default:34},maxHeight:{type:Number,default:300},buffer:{type:Number,default:5},getKey:{type:Function,default:e=>e.id}},emits:["scroll","reach-bottom"],setup(e,{emit:t}){const a=B("virtual-list"),n=o(),i=o(0),s=r(()=>e.items.length*e.itemSize),l=r(()=>s.value>e.maxHeight?e.maxHeight:s.value),c=r(()=>Math.ceil(l.value/e.itemSize)+e.buffer),d=r(()=>Math.floor(i.value/e.itemSize)),u=r(()=>Math.min(d.value+c.value,e.items.length)),h=r(()=>e.items.slice(d.value,u.value)),p=r(()=>d.value*e.itemSize),m=e=>{n.value&&(n.value.scrollTop=e,i.value=e)};return{ns:a,height:l,offsetY:p,container:n,scrollTop:i,totalHeight:s,visibleData:h,scrollTo:m,handleScroll:()=>{if(n.value){const{scrollHeight:e,clientHeight:a}=n.value;i.value=n.value.scrollTop,t("scroll",{scrollTop:i.value,scrollHeight:n.value.scrollHeight,clientHeight:n.value.clientHeight}),e-(i.value+a)<50&&t("reach-bottom")}},scrollToIndex:t=>{const a=t*e.itemSize;m(a)}}},render(){return n("div",{ref:"container",class:this.ns.b(),style:{height:"".concat(this.height,"px")},onScroll:this.handleScroll},[n("div",{class:this.ns.e("phantom"),style:{height:"".concat(this.totalHeight,"px")}},null),n("div",{class:this.ns.e("content"),style:{transform:"translateY(".concat(this.offsetY,"px)")}},[this.visibleData.map(e=>{var t,a;return n("div",{key:this.getKey(e),style:{height:"".concat(this.itemSize,"px")},class:this.ns.em("content","item")},[null==(a=(t=this.$slots).default)?void 0:a.call(t,{item:e})])})])])}});const xk=a({name:"IBizGlobalSearch",props:{modelData:{type:Object,required:!0},controller:{type:Object,required:!0}},setup(e){const t=e.controller,a=B("global-search"),u=o();let p=!1;const m=o(!1),v=o(),g=o(""),b=r(()=>{const{query:e,list:a,histories:n,loading:i}=t.state,o=e&&a.length>0,s=!e&&n.length>0,l=n.includes(e)&&0===a.length;return(o||l||s||i)&&m.value}),f=r(()=>{const{placeholder:e}=t.rawItemParams;return e||ibiz.i18n.t("panelComponent.globalSearch.placeholder")}),w=()=>{t.state.list=[],t.state.query=""},y=e=>{const t=e.target;t.closest(".".concat(a.b()))||t.closest(".".concat(a.e("popper")))||t.closest(".el-input__suffix")||(m.value=!1)},C=()=>{w(),t.clearHistory()},I=e=>{var t;(e.ctrlKey||e.metaKey)&&"k"===e.key&&(e.preventDefault(),null==(t=u.value)||t.focus())};c(()=>b.value,()=>{b.value&&(setTimeout(()=>{var e;null==(e=v.value)||e.scrollTo(0)}),g.value!==t.state.histories[t.state.histories.length-1]&&w())}),d(()=>{document.addEventListener("click",y,{capture:!0}),document.addEventListener("keydown",I)}),h(()=>{document.removeEventListener("click",y,{capture:!0}),document.removeEventListener("keydown",I)});return{c:t,ns:a,visible:b,editorRef:u,searchValue:g,curPlaceholder:f,handleFocus:e=>{p?p=!1:m.value=!0},handleEnter:e=>{"Enter"===e.key&&(m.value=!0,t.search(g.value))},renderAction:()=>{let e;if(!t.state.query&&t.state.histories.length)return n("div",{class:a.em("content","action-item")},[n(i("el-button"),{text:!0,onClick:C},(o=e=ibiz.i18n.t("panelComponent.globalSearch.clearHistory"),"function"==typeof o||"[object Object]"===Object.prototype.toString.call(o)&&!s(o)?e:{default:()=>[e]}))]);var o},renderFooter:()=>{const{query:e,list:i,histories:o,loading:s}=t.state,l=o.includes(e)&&0===i.length;if(s||l)return n("div",{class:a.e("footer")},[ibiz.i18n.t("panelComponent.globalSearch.".concat(s?"loading":"empty"))])},renderSearchList:()=>{if(t.state.list.length)return n(Ik,{ref:v,items:t.state.list,class:a.e("virtual-list"),getKey:e=>e[t.keyName]},{default:({item:e})=>{const o=t.getSearchItemByEntity(e.srfdecodename);let s=e[t.textName];return(null==o?void 0:o.acItemProvider)?s=l(i(o.acItemProvider.component),{item:e,controller:t}):(null==o?void 0:o.deACMode.itemLayoutPanel)&&(s=n(i("iBizControlShell"),{data:e,modelData:o.deACMode.itemLayoutPanel,context:t.panel.context,params:t.panel.params},null)),n("div",{class:[a.em("list","item"),a.em("list","srearch-item")],onClick:()=>((e,a)=>{p=!0,m.value=!1,a&&t.openLinkView(e,a)})(e,o),title:Tt(e[t.textName])},[s])}})},renderHistoryList:()=>n("div",{class:a.e("list")},[t.state.histories.map(e=>n("div",{onClick:()=>{return a=e,g.value=a,void t.search(g.value);var a},class:[a.em("list","item"),a.em("list","history-item")]},[e]))]),handleClearSearch:w}},render(){return n("div",{class:this.ns.b()},[n(i("el-popover"),{width:"auto",visible:this.visible,placement:"bottom-start","popper-class":this.ns.e("popper")},{reference:()=>n(i("el-input"),{clearable:!0,ref:"editorRef",modelValue:this.searchValue,"onUpdate:modelValue":e=>this.searchValue=e,placeholder:this.curPlaceholder,class:[this.ns.e("search"),this.ns.is("search",this.visible)],onFocus:this.handleFocus,onKeyup:this.handleEnter,onClear:this.handleClearSearch},{prefix:()=>n("ion-icon",{name:"search",class:this.ns.em("search","icon")},null),suffix:()=>{if(this.searchValue)return n("ion-icon",{title:ibiz.i18n.t("panelComponent.globalSearch.search"),name:"return-down-back-outline",class:[this.ns.em("search","icon"),this.ns.em("search","enter-icon")],onClick:()=>this.c.search(this.searchValue)},null)}}),default:()=>n("div",{class:this.ns.e("content")},[this.c.state.query?this.renderSearchList():this.renderHistoryList(),this.renderAction(),this.renderFooter()])})])}}),Sk=ie(xk,function(e){e.component(xk.name,xk),xi("RAWITEM_GLOBAL_SEARCH",()=>new Ck)});var Ek=Object.defineProperty,Dk=(e,t,a)=>(((e,t,a)=>{t in e?Ek(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Pk extends Si{constructor(){super(...arguments),Dk(this,"activeMicroAppId",""),Dk(this,"items",[])}}var kk=Object.defineProperty,zk=(e,t,a)=>(((e,t,a)=>{t in e?kk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Tk extends Ii{constructor(){super(...arguments),zk(this,"rawItemParams",{}),zk(this,"util"),zk(this,"sourceType","REFAPP")}get view(){return this.panel.view}get context(){return this.panel.context}createState(){var e;return new Pk(null==(e=this.parent)?void 0:e.state)}async onInit(){await super.onInit(),this.handleRawItemParams(),this.state.visible=1===this.view.model.appSwitchMode,this.state.visible&&(this.state.items=await this.loadAllApps(),this.initActiveMicroAppId())}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t),this.sourceType=this.rawItemParams.sourcetype||"REFAPP"}async loadAllApps(){return"UTIL"===this.sourceType?this.loadAppsWithUtil():this.loadAppsWithRefApp()}initActiveMicroAppId(){if(this.view&&this.state.items.length>0){const e=this.state.items.find(e=>{var t;return e.indexViewName===(null==(t=this.view.model.codeName)?void 0:t.toLowerCase())});e&&this.setActiveMicroAppId(e.id)}}setActiveMicroAppId(e){ibiz.hub.activeMicroAppId=e,this.state.activeMicroAppId=e}async loadAppsWithUtil(){const e=[];if(!this.util){const t=ibiz.hub.getApp(ibiz.env.appId).getAppUtil("HUBAPP","CUSTOM");if(!t)return e;this.util=new ya(t)}const t=await this.util.load("",this.context,this.panel.params);if(!t||0===t.length)return e;const a=ibiz.hub.getAppSourceModel(ibiz.env.appId).getAllPSSubAppRefs;for(let n=0;n<t.length;n++){if(t[n].id!==ibiz.env.appId&&!/^[0-9a-zA-Z]+__[0-9a-zA-Z]+__[0-9a-zA-Z]+$/.test(t[n].id)){const e=a.find(e=>e.id.endsWith(t[n].id));e&&(t[n].id=e.id)}e.push({id:"".concat(t[n].id,"@").concat(t[n].indexViewName.toLowerCase()),dataId:t[n].dataId,caption:t[n].caption,indexViewName:t[n].indexViewName.toLowerCase(),order:t[n].order})}return e.sort((e,t)=>e.order-t.order)}async loadAppsWithRefApp(){var e,t,a,n;const i=[],o=ibiz.hub.getApp();if(!o)return i;const s=ibiz.hub.getAppSourceModel(o.appId);if(!s||!s.cache)return i;const l=null==(t=null==(e=s.cache)?void 0:e.getPSAppViews)?void 0:t.filter(e=>"APPINDEXVIEW"===e.viewType&&1===e.appSwitchMode);if(l&&l.length>0)for(let e=0;e<l.length;e++){const t=l[e];i.push({id:"".concat(t.appId,"@").concat(t.codeName.toLowerCase()),caption:t.title||t.caption,indexViewName:t.codeName.toLowerCase(),order:100*(e+1)})}const r=s.getAllPSSubAppRefs;if(!r||0===r.length)return i;for(let e=0;e<r.length;e++){const t=r[e];if(t.appMode&&"CLOUDHUBSUBAPP"===t.appMode){const e=await ibiz.hub.getAppAsync(t.id),o=null==(n=null==(a=ibiz.hub.getAppSourceModel(e.appId).cache)?void 0:a.getPSAppViews)?void 0:n.filter(e=>"APPINDEXVIEW"===e.viewType&&1===e.appSwitchMode);if(o&&o.length>0)for(let e=0;e<o.length;e++){const t=o[e];i.push({id:"".concat(t.appId,"@").concat(t.codeName.toLowerCase()),caption:t.title||t.caption,indexViewName:t.codeName.toLowerCase(),order:100*(i.length+1)})}}}return i.sort((e,t)=>e.order-t.order)}async switchMicroApp(e,t){if(e===this.state.activeMicroAppId)return;let a=e;-1!==e.indexOf("@")&&(a=e.split("@")[0]),a!==ibiz.env.appId&&await ibiz.hub.getAppAsync(a);const n=ibiz.hub.getAppSourceModel(a);if(ibiz.hub.getApp().model.appId===a&&window.Environment.AppTitle)ibiz.env.AppTitle=window.Environment.AppTitle;else if(n.getDefaultPSAppIndexView){const e=n.getDefaultPSAppIndexView;if(n.caption)ibiz.env.AppTitle=n.caption;else{const t=n.cache.getPSAppViews.find(t=>t.dynaModelFilePath===e.path);t&&(ibiz.env.AppTitle=t.caption)}}this.setActiveMicroAppId(e);const i=this.state.items.findIndex(t=>t.id===e),o=Y(t.currentRoute.value);o.pathNodes=o.pathNodes.slice(0,1),o.pathNodes[0].viewName=this.state.items[i].indexViewName;const s=K(o);t.push(s)}}const Ak=a({name:"IBizAppSwitch",props:{modelData:{type:Object,required:!0},controller:{type:Tk,required:!0}},setup(e){const t=B("app-switch"),{state:a}=e.controller,n=hs();return{ns:t,state:a,handleClick:t=>{e.controller.switchMicroApp(t,n)}}},render(){return this.state.visible?n(i("el-dropdown"),{class:this.ns.b(),trigger:"click",onCommand:e=>this.handleClick(e)},{default:()=>n("span",{class:this.ns.e("icon")},[n("i",{class:"fa fa-th","aria-hidden":"true"},null)]),dropdown:()=>n(i("el-dropdown-menu"),{class:[this.ns.e("dropdown")]},{default:()=>[this.state.items.length>0?this.state.items.map(e=>n(i("el-dropdown-item"),{class:[this.ns.e("item"),this.ns.is("active",this.state.activeMicroAppId===e.id)],title:Tt(e.caption),command:e.id},{default:()=>[e.caption]})):n(i("iBizNoData"),null,null)]})}):null}});var Ok=Object.defineProperty,Mk=(e,t,a)=>(((e,t,a)=>{t in e?Ok(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Nk{constructor(){Mk(this,"component","IBizAppSwitch")}async createController(e,t,a){const n=new Tk(e,t,a);return await n.init(),n}}const Bk=ie(Ak,function(e){e.component(Ak.name,Ak),xi("RAWITEM_APP_SWITCH",()=>new Nk)});function Lk(e,t,a,n){let i=0,s=null;const r=new Map,c=o([]),d=new Map,u=t=>{switch(e.position){case"TOP":return t>0?"right-start":"bottom-start";case"BOTTOM":return t>0?"right-end":"top-start";case"RIGHT":return"left-start";case"LEFT":return"right-start";default:return}},h=()=>{s&&(clearTimeout(s),s=null)},p=e=>{const a=r.get(e);a&&(a.dismiss(),r.delete(e),((e,t)=>{const a=d.get(t);a&&(a.classList.remove(e.is("rotate-arrow",!0)),d.delete(t))})(t,e))},m=()=>{for(const e of r.keys())p(e);r.clear(),c.value=[],i=0},v=()=>{h(),s=setTimeout(()=>{i<=0&&m()},300)},g=()=>{i++,h()},b=(e,t)=>{i=Math.max(0,i-1),v()},f=(e,i,o)=>{var s;const c=ibiz.overlay.createPopover(()=>l(n(e),{onMouseenter:g,onMouseleave:b}),void 0,{width:"auto",height:"auto",noArrow:!0,placement:u(e.level),offsetOpts:10,...o,modalClass:"".concat(t.b("cascader-popover")," ").concat(t.is(a.value,!0)," ").concat((null==o?void 0:o.modalClass)||"")});var h,p,m;r.set(e.level,c),null==c||c.present(i.currentTarget),h=null==(s=i.currentTarget)?void 0:s.parentElement,p=t,m=e.level,h&&(h.classList.add(p.is("rotate-arrow",!0)),d.set(m,h))};return{getOverlayNum:()=>r.size,openCascaderPopover:f,clearAllCascader:()=>{m(),h()},handleMenuItemMouseEnter:(e,t)=>{c.value.includes(e.id)||(c.value.push(e.id),(e=>{let t=e;for(;r.get(t+1);)t++;for(let a=t;a>=e;a--)p(a)})(e.level),e.children&&f(e,t),h())},handleMenuItemMouseLeave:e=>{const t=c.value.indexOf(e.id);-1!==t&&c.value.splice(t,1),v()}}}function Rk(e,t,a,n,i,o){let s;const r=()=>{switch(a){case"TOP":return"bottom";case"BOTTOM":return"top";case"RIGHT":return"left";case"LEFT":return"right";default:return}};let c;const u=()=>{null==s||s.dismiss(),s=null,document.removeEventListener("mousemove",p),c=void 0},p=e=>{c||(c=document.querySelector(".".concat(t.b("border-popover"))));const a=(e=>{let t=0,a=0,n=e;for(;n;)t+=n.offsetLeft,a+=n.offsetTop,n=n.offsetParent;return{x:t,y:a,width:e.offsetWidth,height:e.offsetHeight}})(c);!(e.pageX>=a.x&&e.pageX<=a.x+a.width&&e.pageY>=a.y&&e.pageY<=a.y+a.height)&&i()<=0&&u()},m=async e=>{var a;if(s)return;s=ibiz.overlay.createPopover(()=>l(o()),void 0,{width:"auto",height:"auto",noArrow:!0,placement:r(),offsetOpts:-1,modalClass:"".concat(t.b("border-popover")," ").concat(t.is(n.value,!0))});const i=null==(a=e.currentTarget)?void 0:a.querySelector(".".concat(t.be("placehold","line")));await(null==s?void 0:s.present(i)),setTimeout(()=>{document.addEventListener("mousemove",p)},200)};let v=null,g=null,b=null;function f(e){if(!v)return;const t=e.getBoundingClientRect();var n,i,o,s;v.style.top="".concat((n=t.top,i=t.height,"BOTTOM"===a?n+i-20:n),"px"),v.style.left="".concat((o=t.left,s=t.width,"RIGHT"===a?o+s-20:o),"px"),v.style.width="".concat((e=>["RIGHT","LEFT"].includes(a)?20:e)(t.width),"px"),v.style.height="".concat((e=>["TOP","BOTTOM"].includes(a)?20:e)(t.height),"px")}return d(function(){const n=e.value;if(!n)return;!function(e){const n=document.createElement("div");n.classList.add(t.b("placehold")),n.classList.add(t.is(a.toLowerCase(),!!a));const i=document.createElement("div");i.classList.add(t.be("placehold","line"));const o=document.createElement("div");o.classList.add(t.be("placehold","arrow")),n.appendChild(i),n.appendChild(o),document.body.appendChild(n),v=n,v.addEventListener("mouseenter",m),o.innerHTML='\n <svg xmlns="http://www.w3.org/2000/svg"\n viewBox="0 0 1024 1024"\n width="1em"\n height="1em"\n fill="currentColor">\n <path fill="currentColor"\n d="M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z">\n </path>\n </svg>\n ',f(e)}(n),g=new ResizeObserver(()=>f(n)),g.observe(n);const i=()=>{f(n),b=requestAnimationFrame(i)};b=requestAnimationFrame(i)}),h(function(){if(g){const t=e.value;t&&g.unobserve(t),g.disconnect(),g=null}null!==b&&(cancelAnimationFrame(b),b=null),v&&v.parentNode&&(v.removeEventListener("mouseenter",m),v.parentNode.removeChild(v),v=null)}),{closeBorderPopover:u}}function _k(e,t,a=0){return e.map(e=>{var n;const i={...e,value:e.id,label:e.caption,parentId:null==t?void 0:t.id,level:a};return(null==(n=e.appMenuItems)?void 0:n.length)&&(i.children=_k(e.appMenuItems,e,a+1)),i})}function jk(e,t){let a;return t&&t.some(t=>!t.id||(t.id===e?(a=t,!0):!!(t.appMenuItems&&t.appMenuItems.length>0)&&(a=jk(e,t.appMenuItems),!!a))),a}function Vk(e){const{ns:t,isLayout:a,menuLayout:o,position:s,menuAlign:l,menus:r,menuItemsState:c,showCascaderArrow:d,handleMenuItemClick:u,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p}=e,m=a?function(e){if("FLEX"===(null==e?void 0:e.layout)){const{align:t,valign:a}=e;return{justifyContent:t,alignItems:a}}return{}}(o):{};return n(i("el-row"),{class:[t.e("content"),t.is(l,!!l),t.is(null==s?void 0:s.toLowerCase(),!!s)],style:m},{default:()=>r.map(e=>{var o,s;const r=function(e){var t,a,o;const{ns:s,menu:l,menuAlign:r,menuItemsState:c}=e;if(l.id&&(null==(t=c[l.id])?void 0:t.visible)){if("MENUITEM"===l.itemType)return n(i("el-button"),{class:[s.e("menuitem"),"".concat((null==(a=l.sysCss)?void 0:a.cssName)||"")],index:l.id},{default:()=>[l.sysImage&&n(i("iBizIcon"),{class:s.e("icon"),icon:l.sysImage},null),l.caption&&n("span",{class:s.e("caption"),title:Tt(l.tooltip)},[l.caption])]});if("SEPERATOR"===l.itemType){const e="horizontal"===r?"vertical":"horizontal";return n(i("el-divider"),{direction:e,class:[s.em("separator"),s.em("separator",e)],id:l.id},null)}return"RAWITEM"===l.itemType?n(i("el-button"),{index:l.id,title:Tt(l.tooltip),class:[s.e("rawitem"),"".concat((null==(o=l.sysCss)?void 0:o.cssName)||"")]},{default:()=>[n(i("iBizRawItem"),{rawItem:l},null)]}):void 0}}({menu:e,ns:t,menuAlign:l,menuItemsState:c});if(!r)return;const m={};if(a&&"FLEX"===(null==(o=e.layoutPos)?void 0:o.layout)){const t=e.layoutPos;Object.assign(m,{flexGrow:t.grow,flexShrink:1===t.shrink?void 0:t.shrink,flexBasis:t.basis})}const v=!(!d||!e.children);return n("div",{class:[t.em("content","item"),t.em("content",null==(s=e.itemType)?void 0:s.toLowerCase()),t.is("show-arrow",v)],style:m},[n("div",{class:t.em("content","item-container"),onMouseenter:t=>h(e,t),onMouseleave:t=>p(e,t),onClick:t=>u(e,t)},[r]),v&&n("span",{class:t.em("content","item-arrow")},[n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor"},[n("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null)])])])})})}const Fk=a({name:"IBizExtendButtonMenu",props:{items:{type:Object,required:!0},menuItemsState:{type:Object,required:!0},providers:{type:Object,required:!0},position:{type:String,required:!0},layoutMode:{type:String,required:!0},layout:{type:Object}},emits:{menuItemClick:(e,t)=>!0},setup(e,{emit:t}){const a=B("extend-menu-button"),n=o(),i=r(()=>["TOP","BOTTOM"].includes(e.position)?"horizontal":"vertical"),s=r(()=>"BORDER"!==e.layoutMode),l=o(_k(e.items)),c=()=>Vk({ns:a,menuAlign:i.value,position:e.position,menus:l.value,menuItemsState:e.menuItemsState,handleMenuItemClick:v,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p,showCascaderArrow:!0,isLayout:!1}),{getOverlayNum:d,clearAllCascader:u,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p}=Lk(e,a,i,t=>Vk({ns:a,menuAlign:"vertical",position:e.position,menus:t.children,menuItemsState:e.menuItemsState,handleMenuItemClick:v,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p,showCascaderArrow:!0,isLayout:!1}));let m;if("BORDER"===e.layoutMode){const t=Rk(n,a,e.position,i,d,c);m=t.closeBorderPopover}const v=async(a,n)=>{if(a.children)return;if(u(),m&&m(),!a.appFuncId)return void ibiz.log.warn(ibiz.i18n.t("runtime.controller.control.menu.noConfigured"));const i=jk(a.id,e.items);t("menuItemClick",i,n)};return{ns:a,menus:l,menuAlign:i,isLayout:s,buttonMenuRef:n,handleMenuItemClick:v,handleMenuItemMouseEnter:h,handleMenuItemMouseLeave:p}},render(){return n("div",{ref:"buttonMenuRef",class:[this.ns.b(),this.ns.is(this.layoutMode.toLowerCase(),!!this.layoutMode),this.ns.is(this.position.toLowerCase(),!!this.position),this.ns.is(this.menuAlign,!!this.menuAlign)]},["BORDER"!==this.layoutMode&&Vk({ns:this.ns,menuAlign:this.menuAlign,isLayout:this.isLayout,menuLayout:this.layout,position:this.position,menus:this.menus,menuItemsState:this.menuItemsState,handleMenuItemClick:this.handleMenuItemClick,handleMenuItemMouseEnter:this.handleMenuItemMouseEnter,handleMenuItemMouseLeave:this.handleMenuItemMouseLeave})])}});function Uk(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}function Hk(e){var t,a,o,s;const{isFirst:l,menu:r,collapse:c,ns:d,menuAlign:u,menuItemsState:h}=e;if(r.id&&(!h||(null==(t=h[r.id])?void 0:t.visible))){if("MENUITEM"===r.itemType){let e;return e=l&&c?[r.sysImage?n(i("iBizIcon"),{class:d.e("icon"),icon:r.sysImage},null):n("span",{class:d.e("caption")},[null==(a=r.caption)?void 0:a.slice(0,1)])]:[r.sysImage?n(i("iBizIcon"),{class:d.e("icon"),icon:r.sysImage},null):null,n("span",{class:d.e("caption")},[r.caption])],l&&c?n(i("el-tooltip"),{class:d.b("tooltip"),content:r.caption,placement:"horizontal"===u?"bottom":"left",theme:"light"},{default:()=>{var t;return[n(i("el-menu-item"),{class:[d.e("item"),"".concat((null==(t=r.sysCss)?void 0:t.cssName)||"")],index:r.id},Uk(e)?e:{default:()=>[e]})]}}):n(i("el-menu-item"),{class:[d.e("item"),"".concat((null==(o=r.sysCss)?void 0:o.cssName)||"")],index:r.id,title:Tt(r.tooltip)},Uk(e)?e:{default:()=>[e]})}if("SEPERATOR"===r.itemType){const e="horizontal"===u&&l?"vertical":"horizontal";return n(i("el-divider"),{direction:e,class:d.em("separator",e),id:r.id},null)}return"RAWITEM"===r.itemType?n(i("el-menu-item"),{index:r.id,title:Tt(r.tooltip),class:[d.e("rawitem"),"".concat((null==(s=r.sysCss)?void 0:s.cssName)||"")]},{default:()=>[n(i("iBizRawItem"),{rawItem:r},null)]}):void 0}}function qk(e){var t,a;const{isFirst:o,menu:s,collapse:l,ns:r,menuAlign:c,menuItemsState:d}=e;if(s.id&&(!d||(null==(t=d[s.id])?void 0:t.visible)))return n(i("el-sub-menu"),{class:[r.b("submenu"),"".concat((null==(a=s.sysCss)?void 0:a.cssName)||"")],index:s.id,teleported:!0,"popper-class":[r.b("popup-container")]},{default:()=>s.children&&s.children.map(e=>e.children&&e.children?qk({isFirst:!1,menu:e,collapse:l,ns:r,menuAlign:c,menuItemsState:d}):Hk({isFirst:!1,menu:e,collapse:l,ns:r,menuAlign:c,menuItemsState:d})),title:()=>{var e;return l?s.sysImage?n(i("iBizIcon"),{class:r.e("icon"),icon:s.sysImage},null):[o?null==(e=s.caption)?void 0:e.slice(0,1):s.caption,o?null:n("ion-icon",{name:"chevron-forward-outline"},null)]:[n(i("iBizIcon"),{class:r.e("icon"),icon:s.sysImage},null),n("span",{class:r.e("caption")},[s.caption])]}})}function Gk(e){const{refreshKey:t,ns:a,collapse:o,menuAlign:s,position:l,menus:r,menuItemsState:c,handleMenuSelect:d}=e;return n("div",{class:[a.e("content"),a.is("collapse",o),a.is(s,!!s),a.is(null==l?void 0:l.toLowerCase(),!!l)]},[n(i("el-menu"),{key:t,"popper-class":[a.b("popper")],collapse:o,"collapse-transition":!1,onSelect:d,theme:"light",mode:s,"ellipsis-icon":()=>n("ion-icon",{name:"ellipsis-horizontal"},null),ellipsis:"horizontal"===s},{default:()=>r.map(e=>e.children&&e.children.length>0?qk({isFirst:!0,menu:e,collapse:o,ns:a,menuAlign:s,menuItemsState:c}):Hk({isFirst:!0,menu:e,collapse:o,ns:a,menuAlign:s,menuItemsState:c}))})])}const Wk=a({name:"IBizExtendStandardMenu",props:{items:{type:Object,required:!0},menuItemsState:{type:Object,required:!0},providers:{type:Object,required:!0},position:{type:String,required:!0},layoutMode:{type:String,required:!0},layout:{type:Object}},emits:{menuItemClick:(e,t)=>!0},setup:(e,{emit:t})=>({ns:B("extend-standard-menu"),defaultMenuRef:o(),refreshKey:o(go()),collapse:o(!1),menuAlign:r(()=>["TOP","BOTTOM"].includes(e.position)?"horizontal":"vertical"),menus:o(_k(e.items)),handleMenuSelect:async(a,n)=>{const i=jk(a,e.items);(null==i?void 0:i.appFuncId)?t("menuItemClick",i,n):ibiz.log.warn(ibiz.i18n.t("runtime.controller.control.menu.noConfigured"))}}),render(){return n("div",{ref:"defaultMenuRef",class:[this.ns.b(),this.ns.b(this.layoutMode.toLowerCase()),this.ns.is(this.position.toLowerCase(),!0),this.ns.is(this.menuAlign,!0),this.ns.is("collapse",this.collapse)]},[Gk({position:this.position,refreshKey:this.refreshKey,ns:this.ns,collapse:this.collapse,menuAlign:this.menuAlign,menus:this.menus,menuLayout:this.layout,menuItemsState:this.menuItemsState,handleMenuSelect:this.handleMenuSelect})])}}),Yk=a({name:"IBizCommonExtendMenu",components:{ExtendButtonMenu:Fk,ExtendStandardMenu:Wk},props:{renderMode:{type:String,required:!0},items:{type:Object,required:!0},menuItemsState:{type:Object,required:!0},providers:{type:Object,required:!0},position:{type:String,required:!0},layoutMode:{type:String,default:"FLEX"},layout:{type:Object}},emits:{menuItemClick:(e,t)=>!0},setup:(e,{emit:t})=>({ns:B("common-extend-menu"),handleMenuItemClick:(e,a)=>{e&&"RAWITEM"!==(null==e?void 0:e.itemType)&&t("menuItemClick",e,a)}}),render(){var e;let t=n(Fk,{items:this.items,menuItemsState:this.menuItemsState,providers:this.providers,position:this.position,layoutMode:this.layoutMode,layout:this.layout,onMenuItemClick:this.handleMenuItemClick},null);return"MENU"===(null==(e=this.renderMode)?void 0:e.toLocaleUpperCase())&&(t=n(Wk,{items:this.items,menuItemsState:this.menuItemsState,providers:this.providers,position:this.position,layoutMode:this.layoutMode,layout:this.layout,onMenuItemClick:this.handleMenuItemClick},null)),n("div",{class:this.ns.b()},[t])}});var Kk=Object.defineProperty,Xk=(e,t,a)=>(((e,t,a)=>{t in e?Kk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class $k extends Si{constructor(){super(...arguments),Xk(this,"items",[]),Xk(this,"menuItemsState",{})}}var Jk=Object.defineProperty,Qk=(e,t,a)=>(((e,t,a)=>{t in e?Jk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Zk extends Ii{constructor(){super(...arguments),Qk(this,"rawItemParams",{rendermode:"BUTTON"}),Qk(this,"appMenuName",""),Qk(this,"appMenu"),Qk(this,"app"),Qk(this,"itemProviders",{}),Qk(this,"allAppMenuItems",[])}get view(){return this.panel.view}get routeDepth(){return this.view.modal.routeDepth}get context(){return this.panel.context}get params(){return this.panel.params}createState(){var e;return new $k(null==(e=this.parent)?void 0:e.state)}async onInit(){var e,t;await super.onInit(),this.handleRawItemParams(),this.app=await ibiz.hub.getApp(this.context.srfappid),this.appMenu=this.computeAppMenu(),this.state.items=this.appMenu&&this.appMenu.appMenuItems?this.appMenu.appMenuItems:[],this.flattenAllItems(),await this.initAppMenuItemProviders(),null==(t=null==(e=this.appMenu)?void 0:e.appMenuItems)||t.forEach(e=>{this.initMenuItemState(e)})}computeAppMenu(){return Pn(this.view.model,this.appMenuName)}flattenAllItems(){if(!this.appMenu)return;const e=[],t=a=>{a.forEach(a=>{e.push(a),a.appMenuItems&&a.appMenuItems.length>0&&t(a.appMenuItems)})};t(this.appMenu.appMenuItems),this.allAppMenuItems=e}async initAppMenuItemProviders(){0!==this.allAppMenuItems.length&&await Promise.all(this.allAppMenuItems.map(async e=>{const t=await Fi(e);t&&(this.itemProviders[e.id]=t)}))}initMenuItemState(e){var t;const a={permitted:!0,visible:!0};if(e.hidden)a.visible=!1;else{let n=!0;e.accessKey&&(n=this.app.authority.calcByResCode(e.accessKey));let i=n;if(null==(t=e.appMenuItems)?void 0:t.length){const t=e.appMenuItems.map(e=>this.initMenuItemState(e).visible);i=i&&t.includes(!0)}a.permitted=n,a.visible=i}return this.state.menuItemsState[e.id]=a,a}async handleClickMenuItem(e,t,a=!0){if(!e)return;const n=this.itemProviders[e.id];if(n&&n.onClick)return n.onClick(e,t);if(!e.appFuncId)throw new Xt(e,ibiz.i18n.t("runtime.controller.control.menu.noConfigured"));const i=this.context.clone();i.srfappid=e.appId||ibiz.env.appId,this.routeDepth&&a&&Object.assign(i,{toRouteDepth:this.routeDepth+1});const o={...this.params};await ibiz.commands.execute(zi.TAG,e.appFuncId,i,o,{view:this.view})}handleRawItemParams(){var e;let t={};const a=null==(e=this.model.rawItem)?void 0:e.rawItemParams;vo(a)&&(t=a.reduce((e,t)=>(e[t.key.toLowerCase()]=t.value,e),{})),Object.assign(this.rawItemParams,t)}}var ez=Object.defineProperty,tz=(e,t,a)=>(((e,t,a)=>{t in e?ez(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class az extends Zk{constructor(){super(...arguments),tz(this,"appMenuName","leftsidemenu")}}const nz=a({name:"IBizLeftSideMenu",props:{modelData:{type:Object,required:!0},controller:{type:az,required:!0}},setup(e){const t=B("left-side-menu"),{state:a}=e.controller;return{ns:t,state:a}},render(){return this.controller.appMenu?n("div",{class:this.ns.b()},[n(i("iBizCommonExtendMenu"),{renderMode:this.controller.rawItemParams.rendermode,items:this.state.items,menuItemsState:this.state.menuItemsState,providers:this.controller.itemProviders,position:"LEFT",layoutMode:this.controller.appMenu.layoutMode,layout:this.controller.appMenu.layout,onMenuItemClick:(e,t)=>{this.controller.handleClickMenuItem(e,t)}},null)]):null}});var iz=Object.defineProperty,oz=(e,t,a)=>(((e,t,a)=>{t in e?iz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class sz{constructor(){oz(this,"component","IBizLeftSideMenu")}async createController(e,t,a){const n=new az(e,t,a);return await n.init(),n}}var lz={install(e){e.component(nz.name,nz),xi("RAWITEM_PREDEFINE_LEFT_SIDE_MENU",()=>new sz)}},rz=Object.defineProperty,cz=(e,t,a)=>(((e,t,a)=>{t in e?rz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class dz extends Zk{constructor(){super(...arguments),cz(this,"appMenuName","rightsidemenu")}}const uz=a({name:"IBizRightSideMenu",props:{modelData:{type:Object,required:!0},controller:{type:dz,required:!0}},setup(e){const t=B("right-side-menu"),{state:a}=e.controller;return{ns:t,state:a}},render(){return this.controller.appMenu?n("div",{class:this.ns.b()},[n(i("iBizCommonExtendMenu"),{renderMode:this.controller.rawItemParams.rendermode,items:this.state.items,menuItemsState:this.state.menuItemsState,providers:this.controller.itemProviders,position:"RIGHT",layoutMode:this.controller.appMenu.layoutMode,layout:this.controller.appMenu.layout,onMenuItemClick:(e,t)=>{this.controller.handleClickMenuItem(e,t)}},null)]):null}});var hz=Object.defineProperty,pz=(e,t,a)=>(((e,t,a)=>{t in e?hz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class mz{constructor(){pz(this,"component","IBizRightSideMenu")}async createController(e,t,a){const n=new dz(e,t,a);return await n.init(),n}}var vz={install(e){e.component(uz.name,uz),xi("RAWITEM_PREDEFINE_RIGHT_SIDE_MENU",()=>new mz)}},gz=Object.defineProperty,bz=(e,t,a)=>(((e,t,a)=>{t in e?gz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class fz extends Zk{constructor(){super(...arguments),bz(this,"appMenuName","bottomsidemenu")}}const wz=a({name:"IBizBottomSideMenu",props:{modelData:{type:Object,required:!0},controller:{type:fz,required:!0}},setup(e){const t=B("bottom-side-menu"),{state:a}=e.controller;return{ns:t,state:a}},render(){return this.controller.appMenu?n("div",{class:this.ns.b()},[n(i("iBizCommonExtendMenu"),{renderMode:this.controller.rawItemParams.rendermode,items:this.state.items,menuItemsState:this.state.menuItemsState,providers:this.controller.itemProviders,position:"BOTTOM",layoutMode:this.controller.appMenu.layoutMode,layout:this.controller.appMenu.layout,onMenuItemClick:(e,t)=>{this.controller.handleClickMenuItem(e,t)}},null)]):null}});var yz=Object.defineProperty,Cz=(e,t,a)=>(((e,t,a)=>{t in e?yz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Iz{constructor(){Cz(this,"component","IBizBottomSideMenu")}async createController(e,t,a){const n=new fz(e,t,a);return await n.init(),n}}var xz={install(e){e.component(wz.name,wz),xi("RAWITEM_PREDEFINE_BOTTOM_SIDE_MENU",()=>new Iz)}},Sz=Object.defineProperty,Ez=(e,t,a)=>(((e,t,a)=>{t in e?Sz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Dz extends Zk{constructor(){super(...arguments),Ez(this,"appMenuName","topsidemenu")}}const Pz=a({name:"IBizTopSideMenu",props:{modelData:{type:Object,required:!0},controller:{type:Dz,required:!0}},setup(e){const t=B("top-side-menu"),{state:a}=e.controller;return{ns:t,state:a}},render(){return this.controller.appMenu?n("div",{class:this.ns.b()},[n(i("iBizCommonExtendMenu"),{renderMode:this.controller.rawItemParams.rendermode,items:this.state.items,menuItemsState:this.state.menuItemsState,providers:this.controller.itemProviders,position:"TOP",layoutMode:this.controller.appMenu.layoutMode,layout:this.controller.appMenu.layout,onMenuItemClick:(e,t)=>{this.controller.handleClickMenuItem(e,t)}},null)]):null}});var kz=Object.defineProperty,zz=(e,t,a)=>(((e,t,a)=>{t in e?kz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class Tz{constructor(){zz(this,"component","IBizTopSideMenu")}async createController(e,t,a){const n=new Dz(e,t,a);return await n.init(),n}}var Az={install(e){e.component(Pz.name,Pz),xi("RAWITEM_PREDEFINE_TOP_SIDE_MENU",()=>new Tz)}},Oz={install(e){e.component(Yk.name,Yk),e.use(lz),e.use(vz),e.use(xz),e.use(Az)}};const Mz=e("aG",{install:e=>{e.use(Sk),e.use(hk),e.use(ik),e.use(ye),e.use(Ce),e.use(Ie),e.use(xe),e.use(kx),e.use(jx),e.use(Xx),e.use(mS),e.use(xS),e.use(Se),e.use(NS),e.use(Ee),e.use(De),e.use(Pe),e.use(ke),e.use(VS),e.use(WS),e.use(QS),e.use(ze),e.use(iE),e.use(Te),e.use(pE),e.use(Ae),e.use(CE),e.use(zE),e.use(RE),e.use(qE),e.use($E),e.use(Oe),e.use(ND),e.use(Me),e.use(HD),e.use(Ne),e.use(KD),e.use(ZD),e.use(Be),e.use(Le),e.use(dP),e.use(fP),e.use(xP),e.use(kP),e.use(MP),e.use(qP),e.use(ZP),e.use(Re),e.use(Bk),e.use(Oz)}}),Nz=a({name:"NotSupportedEditor",props:{modelData:{type:Object,required:!0},context:{type:Object}},setup(e){var t;return{ns:B("not-supported-editor"),isDesignPreview:"DESIGN"===(null==(t=e.context)?void 0:t.srfrunmode)}},render(){return this.isDesignPreview?n("div",{class:this.ns.b()},[n("div",{class:this.ns.b("preview-content")},null)]):n("div",{class:this.ns.b()},[ibiz.i18n.t("editor.notSupportedEditor.unsupportedType",{type:this.modelData.editorType})])}});as.extend(Cs);const Bz=a({name:"IBizSpan",props:_e(),setup(e,{emit:t}){var a,n;const i=B("span"),s=e.controller,l=o(""),d=s.codeList,{valueFormat:u,dataType:h,unitName:p}=s.parent,m=o(""),v=s.model.textSeparator||(null==(a=s.editorParams)?void 0:a.TEXTSEPARATOR)||(null==(n=s.editorParams)?void 0:n.textseparator)||",";c(()=>e.value,(e,t)=>{if(e!==t){if(Po(e))return void(l.value="");if("SIMPLES"===s.model.valueType)l.value=e.join(v);else if("OBJECT"===s.model.valueType)l.value=e[s.model.objectNameField?s.model.objectNameField:"srfmajortext"];else if("OBJECTS"===s.model.valueType){const t=[];e.forEach(e=>{t.push(e[s.model.objectNameField?s.model.objectNameField:"srfmajortext"])}),l.value=t.join(v)}else if("ADDRESSPICKUP"===s.model.editorType)try{const t=[];JSON.parse(e).forEach(e=>{t.push(e[s.model.objectNameField?s.model.objectNameField:"srfmajortext"])}),l.value=t.join(v)}catch(t){ibiz.log.error("标签地址选择器的值不符合JSON格式".concat(e))}else if(u)try{if(null!=h&&$t.isDate(h))l.value=as(e).format(u);else{const t=as(e).format(u);(a=t)!==(n=u)&&as(a,n,!0).isValid()?l.value=t:!Number.isNaN(Number(e))&&Number.isFinite(Number(e))?l.value="".concat(ibiz.util.text.format(Number(e),u)):l.value=ibiz.util.text.format("".concat(e),u)}}catch(t){l.value="".concat(e),ibiz.log.error("".concat(e," 值格式化错误"))}else Jt("".concat(e))?l.value=Qt("".concat(e)):l.value="".concat(e);p&&(s.emptyHiddenUnit?l.value&&(l.value+=p):l.value+=p)}var a,n},{immediate:!0});const g=o([]);d&&c(()=>e.data,e=>{s.loadCodeList(e).then(e=>{g.value=e})},{immediate:!0,deep:!0});se(s.model.appCodeListId,s.context.srfappid,e=>{e&&(g.value=e)});const{componentRef:b}=je(()=>t("focus"),()=>t("blur")),f=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));return{ns:i,c:s,text:l,editorRef:b,items:g,valueFormat:u,unitName:p,showFormDefaultContent:f,spanTitle:m}},render(){let e=null;this.c.codeList?e=this.c.codeList.thresholdGroup?this.items.length>0&&n(i("iBizCodeList"),{class:this.ns.e("code-list"),codeListItems:this.items,codeList:this.c.codeList,value:this.value,valueFormat:this.valueFormat,unitName:this.unitName,convertToCodeItemText:this.c.convertToCodeItemText},null):this.items.length>0&&n(i("iBizCodeList"),{class:this.ns.e("code-list"),codeListItems:this.items,codeList:this.c.codeList,value:this.text,convertToCodeItemText:this.c.convertToCodeItemText},null):this.text?(e=this.text,this.spanTitle=this.text):e=n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null);const t="ellipsis"===this.c.editorParams.overflowMode||"ellipsis"===this.c.editorParams.overflowmode||"NOWRAP"===this.c.model.wrapMode;return n("span",{class:[this.ns.b(),this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("is-ellipsis",t)],ref:"editorRef",title:Tt(this.spanTitle)},[e])}}),Lz=a({name:"IBizSpanLink",props:_e(),emits:Ve(),setup(e,{emit:t}){const a=B("span-link"),n=e.controller,i=o("");c(()=>e.value,(e,t)=>{e&&e!==t&&(i.value="".concat(e))},{immediate:!0});const{componentRef:s}=je(()=>t("focus"),()=>t("blur")),l=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));return{ns:a,openLinkView:async()=>{await n.openLinkView(e.data)},curValue:i,editorRef:s,showFormDefaultContent:l}},render(){return n("div",{class:[this.ns.b(),this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[n("a",{onClick:this.openLinkView},[this.curValue])])}});var Rz=Object.defineProperty,_z=(e,t,a)=>(((e,t,a)=>{t in e?Rz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class jz extends Ui{constructor(){super(...arguments),_z(this,"valueItem",""),_z(this,"emptyHiddenUnit",!0),_z(this,"codeList")}async onInit(){var e,t;if(super.onInit(),(null==(t=null==(e=this.model)?void 0:e.editorItems)?void 0:t[0])&&(this.valueItem=this.model.editorItems[0].id),this.model.appCodeListId){const e=await ibiz.hub.getApp(this.context.srfappid);this.codeList=e.codeList.getCodeList(this.model.appCodeListId)}this.extraParams&&(this.emptyHiddenUnit=this.extraParams.emptyHiddenUnit)}async openLinkView(e){const t=this.context.deepClone();e[this.valueItem]&&(t.srfkey=e[this.valueItem]);const{context:a,params:n}=this.handlePublicParams(e,Lt.create(t),this.params),{linkAppViewId:i}=this.model;if(!i)throw new Xt(this.model,ibiz.i18n.t("editor.common.linkViewConfigErr"));return ibiz.commands.execute(Ai.TAG,i,a,n)}}var Vz=Object.defineProperty,Fz=(e,t,a)=>(((e,t,a)=>{t in e?Vz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Uz{constructor(e){Fz(this,"formEditor","IBizSpan"),Fz(this,"gridEditor","IBizSpan"),"SPAN_LINK"===e&&(this.formEditor="IBizSpanLink",this.gridEditor="IBizSpanLink")}async createController(e,t){const a=new jz(e,t);return await a.init(),a}}const Hz=a({name:"IBizInput",props:Fe(),emits:Ve(),setup(e,{emit:t}){const a=B("input"),n=e.controller,i=n.model,s=o(!1),l=o(),d=o(!0),u=o(!1),p=o(2);"TEXTAREA_10"===i.editorType&&(p.value=10),n.editorParams&&("false"!==n.editorParams.SHOWLIMIT&&"false"!==n.editorParams.showlimit||(d.value=!1),"true"!==n.editorParams.ISAUTO&&"true"!==n.editorParams.isauto||(u.value=!0));const m=r(()=>{switch(i.editorType){case"TEXTBOX":case"MOBTEXT":return"text";case"PASSWORD":case"MOBPASSWORD":return"password";case"TEXTAREA":case"TEXTAREA_10":case"MOBTEXTAREA":return"textarea";default:return"string"}}),v=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),g=o("");c(()=>e.value,(e,t)=>{e!==t&&(null==e?g.value="":Jt("".concat(e))?g.value=Qt("".concat(e)):g.value=e.toString())},{immediate:!0});const b=r(()=>{let t="";const{unitName:a}=e.controller.parent;return g.value&&(t=e.controller.formatValue(g.value)),a&&(n.emptyHiddenUnit?t&&(t+=a):t+=a),t}),f=(e,a="blur")=>{a===n.triggerMode&&t("change",e)},w=e=>{e?s.value=e:setTimeout(()=>{s.value=e},100)};let y,C,I=!1;const x=_o(e=>{C!==e&&f(e,"input"),C=void 0,I=!1,y&&y()},300,{leading:!0});c(l,t=>{if(e.autoFocus&&t){const e="textarea"===m.value?"textarea":"input";t.$el.getElementsByTagName(e)[0].focus()}});let S;h(()=>{S&&S.close()});const E=r(()=>{const{unitName:t}=e.controller.parent;let a="".concat(e.controller.formatValue(g.value));return t&&(n.emptyHiddenUnit?a&&(a+=t):a+=t),a}),D=r(()=>n.model.editorParams&&n.model.editorParams.autocomplete&&n.toBoolean(n.model.editorParams.autocomplete)?"on":"new-password"),P=o([]);n.codeList&&c(()=>e.data,e=>{n.loadCodeList(e).then(e=>{P.value=e})},{immediate:!0,deep:!0});return se(n.model.appCodeListId,n.context.srfappid,e=>{e&&(P.value=e)}),{c:n,ns:a,rows:p,type:m,items:P,currentVal:g,readonlyText:E,handleChange:e=>{C!==e&&f(e),C=void 0},handleInput:e=>{I=!0,x(e)},handleKeyUp:e=>{e&&"Enter"===e.code&&(t("enter",e),I&&(y=()=>{l.value.$el.dispatchEvent(e)}))},onBlur:a=>{C=a.target.value,C!=e.value&&f(C),t("blur",a),w(!1)},onFocus:e=>{t("focus",e),w(!0)},editorRef:l,onClick:async()=>{const a=n.model.appDataEntityId;if(!a||!n.deACMode)return;const{zIndex:i}=G(),o=i.increment();S=await ibiz.aiChatUtil.getAIChat();const{containerOptions:s,chatOptions:l}=await ibiz.aiChatUtil.getEditorExAIChatParams(n.editorParams,n.context,n.params,e.data,n.deACMode,{chatInstance:S,view:n.view,ctrl:n.ctrl}),r=await ibiz.aiChatUtil.getAIResourceOptions(n.context,n.params);S.create({resourceOptions:r,containerOptions:{zIndex:o,...s},chatOptions:{caption:n.deACMode.logicName,context:{...n.context},params:{...n.params,srfactag:n.deACMode.codeName},appDataEntityId:a,...l,action:(e,a)=>{"backfill"===e&&t("change",a.realcontent)}}})},shouldAutoComplete:D,isEditable:s,setEditable:w,showLimit:d,isAuto:u,showFormDefaultContent:v,currentFormatVal:b}},render(){const{unitName:e}=this.c.parent,{editorWidth:t,editorHeight:a,predefinedType:o}=this.c.model;let l=null;if(this.readonly)l=this.c.codeList?n(i("iBizCodeList"),{codeListItems:this.items,codeList:this.c.codeList,value:this.currentVal,convertToCodeItemText:this.c.convertToCodeItemText},null):this.readonlyText;else{const t={};e&&(t.suffix=()=>{let t="";return this.c.emptyHiddenUnit?this.currentVal&&(t=e):t=e,n("i",{class:this.ns.e("unit")},[t])}),"AUTH_USERID"===o?t.prefix=()=>n("ion-icon",{name:"person"},null):"AUTH_PASSWORD"===o&&(t.prefix=()=>n("ion-icon",{name:"unlock-alt"},null)),l=n(i("el-input"),y({ref:"editorRef",clearable:!0,modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,placeholder:this.c.placeHolder,type:this.type,rows:this.rows,resize:"none",autosize:this.isAuto,maxlength:this.c.model.maxLength,minlength:this.c.model.minLength,"show-word-limit":this.showLimit&&this.c.model.showMaxLength,onChange:this.handleChange,onInput:this.handleInput,onKeyup:this.handleKeyUp,onBlur:this.onBlur,onFocus:this.onFocus,class:this.ns.b("input"),disabled:this.disabled,"show-password":"password"===this.type,autocomplete:this.shouldAutoComplete},this.$attrs),"function"==typeof(r=t)||"[object Object]"===Object.prototype.toString.call(r)&&!s(r)?t:{default:()=>[t]})}var r;const c=n("div",{class:this.ns.b("form-default-content")},[this.currentVal?"password"===this.type?this.currentVal.split("").map(e=>"•"):this.currentFormatVal:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.ns.is("textarea",Object.is(this.type,"textarea")),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],style:{width:t?"".concat(t,"px"):"",height:a?"".concat(a,"px"):""}},[this.showFormDefaultContent&&c,"password"===this.type&&"new-password"===this.shouldAutoComplete?n("input",{type:"text",style:"opacity: 0;position:absolute;width:0;height:0;"},null):null,l,this.c.chatCompletion?n("div",{class:this.ns.e("ai-chat"),title:ibiz.i18n.t("editor.textBox.openAiChat"),onClick:this.onClick},[n("ion-icon",{src:"./assets/images/svg/chat.svg"},null)]):null])}}),qz=a({name:"IBizInputNumber",props:Ue(),emits:Ve(),setup(e,{emit:t}){const a=B("input-number"),n=o(!1),i=e.controller,s=i.model,l=o(null);let d=1/0,u=-1/0;s.editorParams&&(s.editorParams.maxvalue&&(d=Yo(s.editorParams.maxvalue)),s.editorParams.minvalue&&(u=Yo(s.editorParams.minvalue)),s.editorParams.enablethousands&&(n.value=JSON.parse(s.editorParams.enablethousands)));const h=o(!1),p=o(),m=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),v=(e,t=0)=>{const a={minimumFractionDigits:t,maximumFractionDigits:t};return null==e?void 0:e.toLocaleString("en-US",a)};c(()=>e.value,(e,t)=>{if(e!==t){const t=null==e||Object.is(e,"")?null:Number(e);n.value?l.value=Number.isNaN(t)?null:v(t,i.precision?i.precision:0):l.value=Number.isNaN(t)?null:t}},{immediate:!0});const g=r(()=>{if(n.value){if(l.value||0===l.value)return v(Number(l.value),i.precision?i.precision:0)}else if(l.value||0===l.value)return e.controller.formatValue(l.value);return""}),b=e=>{e?h.value=e:setTimeout(()=>{h.value=e},100)};c(p,t=>{if(e.autoFocus&&t){t.$el.getElementsByTagName("input")[0].focus()}});const f=((e,t)=>{let a;return(...n)=>{clearTimeout(a),a=setTimeout(()=>e.apply(this,n),t)}})(e=>{let a=null;"string"==typeof e&&(a=(e=>{const t=e.replace(/,/g,"");return parseFloat(t)})(e)),t("change",a)},300);return{ns:a,c:i,currentVal:l,handleChange:(e,a="blur")=>{a===i.triggerMode&&t("change",e)},onFocus:e=>{t("focus",e),b(!0)},onBlur:e=>{t("blur",e),n.value&&f(l.value),b(!1)},editorRef:p,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},isEditable:h,setEditable:b,showFormDefaultContent:m,max:d,min:u,currentFormatVal:g,enablethousands:n,onInput:e=>{l.value=e}}},render(){const{unitName:e}=this.c.parent;let t=null;this.readonly?(t=fo(this.currentVal)?"":"".concat(this.currentFormatVal),e&&(this.c.emptyHiddenUnit?t&&(t+=e):t+=e)):t=[this.enablethousands?n(i("el-input"),y({ref:"editorRef",class:[this.ns.b("input")],"model-value":this.currentVal,onInput:this.onInput,placeholder:this.c.placeHolder,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp},this.$attrs),null):n(i("el-input-number"),y({ref:"editorRef",class:[this.ns.b("input")],"model-value":this.currentVal,placeholder:this.c.placeHolder,min:this.min,max:this.max,precision:this.c.precision,disabled:this.disabled,controls:!1,onChange:e=>this.handleChange(e,"blur"),onInput:e=>this.handleChange(e,"input"),onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp},this.$attrs),null),e&&n("i",{class:this.ns.e("unit")},[e])];return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&(()=>{let t="";return e&&(this.c.emptyHiddenUnit?this.currentFormatVal&&(t=e):t=e),n("div",{class:this.ns.b("form-default-content")},[this.currentVal||0===this.currentVal?this.currentFormatVal+t:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)])})(),t])}}),Gz=a({name:"IBizInputIP",props:He(),emits:Ve(),setup(e,{emit:t}){const a=B("input-ip"),n=e.controller,i=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),s=o(!1),l=o(!1),d=e=>{const t=e.split(".");return[t[0]||"",t[1]||"",t[2]||"",t[3]||""]},u=e=>e.join("."),h=o(d(e.value||"")),p=o([]);return c(()=>e.value,e=>{h.value=d(e||"")}),c(()=>p.value[0],t=>{e.autoFocus&&t&&t.focus()}),{ns:a,c:n,showFormDefaultContent:i,activeElement:s,ipSegments:h,ipInputs:p,joinIp:u,handleInput:(e,a)=>{var n;if(e=e.replace(/[^0-9]/g,"").slice(0,3)){const t=parseInt(e,10);e=t>255?"255":"".concat(t)}h.value[a]=e;const i=p.value[a],o=null==i?void 0:i.input;if(3===h.value[a].length&&a<3&&o&&o.selectionStart===h.value[a].length&&o.selectionEnd===h.value[a].length){const e=p.value[a+1];e&&(e.focus(),null==(n=e.input)||n.setSelectionRange(0,h.value[a+1].length))}h.value.every(e=>!!e&&/^(0|[1-9]\d?|1\d\d|2[0-4]\d|25[0-5])$/.test(e))&&t("change",u(h.value))},handleKeydown:(e,a)=>{var n,i,o,s,l;if("Enter"!==e.key){if(/^[0-9]$/.test(e.key)){const t=e.target;if(t&&3===h.value[a].length&&t.selectionStart===t.selectionEnd&&(e.preventDefault(),a<3&&t.selectionEnd===h.value[a].length)){const e=a+1,t=p.value[e];t&&(t.focus(),null==(n=t.input)||n.setSelectionRange(0,h.value[e].length))}return}if("."===e.key){e.preventDefault();const t=e.target;if(t&&a<3&&t.selectionStart===t.selectionEnd&&0!==t.selectionEnd&&h.value[a].length){const e=a+1,t=p.value[e];t&&(t.focus(),null==(i=t.input)||i.setSelectionRange(0,h.value[e].length))}return}if("Backspace"===e.key){const t=e.target;if(t&&a>0&&0===t.selectionStart&&0===t.selectionEnd){e.preventDefault();const t=a-1,n=h.value[t],i=p.value[t];n.length>0&&(h.value[t]=n.slice(0,-1)),i&&(i.focus(),null==(o=i.input)||o.setSelectionRange(h.value[t].length,h.value[t].length))}}if("ArrowLeft"===e.key){const t=e.target;if(t&&a>0&&0===t.selectionStart&&0===t.selectionEnd){e.preventDefault();const t=a-1,n=p.value[t];n&&(n.focus(),null==(s=n.input)||s.setSelectionRange(h.value[t].length,h.value[t].length))}}if("ArrowRight"===e.key){const t=e.target;if(t&&a<3&&t.selectionStart===h.value[a].length&&t.selectionEnd===h.value[a].length){e.preventDefault();const t=a+1,n=p.value[t];n&&(n.focus(),null==(l=n.input)||l.setSelectionRange(0,0))}}}else t("enter",e)},handleFocus:()=>{s.value=!0,l.value&&(l.value=!1,t("focus"))},handleBlur:()=>{s.value=!1,setTimeout(()=>{s.value||(l.value=!0,t("blur"))},0)}}},render(){let e=null;e=this.readonly?this.value:n("div",{class:this.ns.b("content")},[this.ipSegments.map((e,t)=>[n(i("el-input"),{"model-value":e,maxlength:4,disabled:this.disabled,readonly:this.readonly,ref:e=>{this.ipInputs[t]=e||void 0},onInput:e=>this.handleInput(e,t),onKeydown:e=>this.handleKeydown(e,t),onFocus:this.handleFocus,onBlur:this.handleBlur},null),t<3&&n("span",{class:this.ns.b("dot")},[p(".")])])]);const t=n("div",{class:this.ns.b("form-default-content")},[this.ipSegments.some(e=>e)?this.joinIp(this.ipSegments):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("focus",this.activeElement&&!this.disabled&&!this.readonly)]},[this.showFormDefaultContent&&t,e])}}),Wz=a({name:"IBizSignature",props:Fe(),emits:Ve(),setup(e,{emit:t}){var a;const n=B("signature"),i=e.controller,s=i.model,l=o({["".concat(ibiz.env.tokenHeader,"Authorization")]:"".concat(ibiz.env.tokenPrefix,"Bearer ").concat(Zt(ea.TOKEN))}),d=o(""),u=o(""),h=o(),p=o(!1),m=o(""),v=o("");let b="true"===(null==(a=null==i?void 0:i.editorParams)?void 0:a.enablenoaccess),f=!1;f=(null==i?void 0:i.editorParams.globaldownloadprifix)?"true"===i.editorParams.globaldownloadprifix:ibiz.config.common.globalDownloadPrifix;let w="img",y=[{label:ibiz.i18n.t("editor.signature.undo"),type:"undo"},{label:ibiz.i18n.t("editor.signature.rewrite"),type:"rewrite"},{label:ibiz.i18n.t("editor.signature.confirm"),type:"confirm",buttonType:"primary"}];if(s.editorParams){if(s.editorParams.mode&&(w=s.editorParams.mode),s.editorParams.buttons)try{y=JSON.parse(s.editorParams.buttons)}catch(e){ibiz.log.error(e)}s.editorParams.enablenoaccess&&(b="true"===s.editorParams.enablenoaccess)}const C=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),I=async()=>{var t,a;if(v.value){if(ibiz.loading.showRedirect(),"img"===w)m.value=v.value;else if(u.value){const a=JSON.parse(v.value)[0],n=u.value.replace("%fileId%",a.id);try{const o={...i.editorParams,enableNoAccess:b,globalDownloadPrifix:f};o.exportparams&&(o.exportParams=JSON.parse(o.exportparams));const s=await ibiz.util.file.requestFile(n,void 0,{context:i.context,params:i.params,data:e.data,file:{fileId:a.id},extraParams:o,downloadTicketParams:i.downloadTicketParams},void 0,b),l=await(null==(t=h.value)?void 0:t.signaturePad.blobToDataURL(s));m.value=l}catch(e){ibiz.log.error(e)}}(()=>{var e;null==(e=h.value)||e.updateSignaturePad(()=>{g(()=>{var e,t;m.value?null==(e=h.value)||e.signaturePad.fromDataURL(m.value):null==(t=h.value)||t.signaturePad.clear()})})})(),null==(a=h.value)||a.signaturePad.loadImage(m.value,()=>{ibiz.loading.hideRedirect()})}};c(()=>e.data,e=>{if(e){const t={...i.editorParams,enableNoAccess:b,globalDownloadPrifix:f};t.uploadparams&&(t.uploadParams=JSON.parse(t.uploadparams));const a=ibiz.util.file.calcFileUpDownUrl(i.context,i.params,e,t);d.value=a.uploadUrl,u.value=a.downloadUrl}},{immediate:!0,deep:!0}),c(()=>e.value,async(e,t)=>{e!==t&&(v.value=e?"".concat(e||""):"",await I())},{immediate:!0});const x=e=>{t("change",e)},S=async e=>{const t=await(async e=>{const{type:t}=(e=>({type:e.split(",")[0].split(":")[1].split(";")[0]}))(e),a=ta(e),n="signature_".concat(Date.now(),".png"),i=new File([a],n,{type:t});return await ibiz.util.file.fileUpload(d.value,i,l.value)})(e);x(JSON.stringify([{name:t.name,id:t.id}]))},E=()=>{var e,t,a;if(p.value=!1,!(null==(e=h.value)?void 0:e.signaturePad.isRedrawn()))return;if(null==(t=h.value)?void 0:t.signaturePad.isEmpty())return void(()=>{var e;null==(e=h.value)||e.signaturePad.clear(),m.value="",x(null)})();const n=null==(a=h.value)?void 0:a.signaturePad.toDataURL();if(n!==m.value)if(m.value=n,"file"===w)S(n);else x(n)};return{c:i,ns:n,signatureRef:h,fullScreen:p,currentDataURL:m,buttons:y,showFormDefaultContent:C,handleButtonClick:e=>{var t,a;switch(e){case"undo":null==(t=h.value)||t.signaturePad.undoLastStep();break;case"rewrite":null==(a=h.value)||a.signaturePad.clear();break;case"confirm":E()}}}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[n(i("iBizSignaturePad"),{ref:"signatureRef",class:this.ns.e("pad"),options:{...this.c.model.editorParams,...this.$attrs}},null),!this.readonly&&n("div",{class:this.ns.e("toolbar")},[this.buttons.map(e=>n(i("el-button"),{disabled:this.disabled,type:e.buttonType&&e.buttonType.toLowerCase()||"default",onClick:()=>this.handleButtonClick(e.type)},{default:()=>[e.label]}))])])}});var Yz=Object.defineProperty,Kz=(e,t,a)=>(((e,t,a)=>{t in e?Yz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Xz extends Ui{constructor(){super(...arguments),Kz(this,"precision"),Kz(this,"deService"),Kz(this,"deACMode"),Kz(this,"keyName","srfkey"),Kz(this,"textName","srfmajortext"),Kz(this,"sort","asc"),Kz(this,"dataItems",[]),Kz(this,"chatCompletion",!1),Kz(this,"codeList"),Kz(this,"emptyHiddenUnit",!0)}async onInit(){if(await super.onInit(),this.precision=this.editorParams.precision?Yo(this.editorParams.precision):this.model.precision,"TEXTAREA"===this.model.editorType||"TEXTAREA_10"===this.model.editorType||"MOBTEXTAREA"===this.model.editorType){const e=this.model;if(e.appDEACModeId&&(this.deACMode=await ga(e.appDEACModeId,e.appDataEntityId,this.context.srfappid),this.deACMode)){if("AUTOCOMPLETE"===this.deACMode.actype){const{minorSortAppDEFieldId:e,minorSortDir:t}=this.deACMode;e&&t&&(this.sort="".concat(e.toLowerCase(),",").concat(t.toLowerCase())),this.deACMode.textAppDEFieldId&&(this.textName=this.deACMode.textAppDEFieldId),this.deACMode.valueAppDEFieldId&&(this.keyName=this.deACMode.valueAppDEFieldId),this.deACMode.deacmodeDataItems&&(this.dataItems=[],this.deACMode.deacmodeDataItems.forEach(e=>{"value"!==e.id&&"text"!==e.id&&this.dataItems.push(e)}))}"CHATCOMPLETION"===this.deACMode.actype&&ibiz.env.enableAI&&(this.deService=await ibiz.hub.getApp(e.appId).deService.getService(this.context,e.appDataEntityId),this.chatCompletion=!0)}}if("AUTH_USERID"!==this.model.predefinedType||this.placeHolder?"AUTH_PASSWORD"!==this.model.predefinedType||this.placeHolder||(this.placeHolder=ibiz.i18n.t("app.pleaseEnterPassword")):this.placeHolder=ibiz.i18n.t("app.pleaseEnterAccount"),this.model.appCodeListId){const e=await ibiz.hub.getApp(this.context.srfappid);this.codeList=e.codeList.getCodeList(this.model.appCodeListId)}this.extraParams&&(this.emptyHiddenUnit=this.extraParams.emptyHiddenUnit)}}var $z=Object.defineProperty,Jz=(e,t,a)=>(((e,t,a)=>{t in e?$z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class Qz{constructor(e){Jz(this,"formEditor","IBizInput"),Jz(this,"gridEditor","IBizInput"),"NUMBER"===e&&(this.formEditor="IBizInputNumber",this.gridEditor="IBizInputNumber"),"IPADDRESSTEXTBOX"===e&&(this.formEditor="IBizInputIP",this.gridEditor="IBizInputIP"),"SIGNATURE"===e&&(this.formEditor="IBizSignature",this.gridEditor="IBizSignature")}async createController(e,t){const a=new Xz(e,t);return await a.init(),a}}const Zz=a({name:"IBizDropdown",props:qe(),emits:Ve(),setup(e,{emit:t}){var a;const s=B("dropdown"),l=e.controller,u=o([]),p=o([]),m=o(!1),v=o(!1),b=o([]),f=o(!1),w=o(),y=l.model.editorItems,C=o(!1);let I,x="";const S=o(!1),E=o(),D=(null==(a=l.editorParams)?void 0:a.valueseparator)||",",P=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),k=r(()=>"DROPDOWNLIST_100"===l.model.editorType?s.cssVarBlock({width:"100px"}):{}),z=e=>{if(0===e.length)return[];const t=[],a=new Set(p.value.map(e=>e.value));return e.forEach(e=>{var n;a.has(e.value)||p.value.push(e);const i={label:e.text,value:null==(n=e.value)?void 0:n.toString(),color:null==e?void 0:e.color,textCls:null==e?void 0:e.textCls,sysImage:e.sysImage,disabled:!0===e.disableSelect,children:[]};e.children&&e.children.length>0&&(i.children=z(e.children)),t.push(i)}),t},T=e=>{u.value=[],p.value=[],l.multiple&&!e.some(e=>e.children)&&(e=l.handleCodeListAllItems(e)),l.blankItemName&&!l.multiple?u.value=[{value:void 0,text:l.blankItemName},...e]:u.value=e;for(let t=0;t<u.value.length;t++){if(u.value[t].children){v.value=!0,b.value=z(e);break}}},A=async()=>{if(l.model.appCodeListId){const e=ibiz.hub.getApp(l.context.srfappid).codeList.getCodeList(l.model.appCodeListId);e&&(S.value=e.codeItemValueNumber||!1)}C.value=!0;const t=await l.loadCodeList(e.data);T(t),m.value=!0,C.value=!1};c(()=>e.value,async(e,t)=>{(e||null===e||0===e)&&(m.value||void 0!==t||await A())},{immediate:!0});const O=e=>{e?f.value=e:setTimeout(()=>{f.value=e},100)},{getSelection:M,getSelectionValue:N}=Hi(l.allItemsValue),L=r({get(){var t,a,n;return m.value?y&&y.length>0&&!l.multiple?null==(t=e.data[y[0].id])?void 0:t.toString():e.value&&"string"==typeof e.value?l.allItems&&l.multiple&&!v.value?M([],e.value.split(D),u.value,u.value).map(e=>"".concat(e)):l.multiple?null==(a=e.value)?void 0:a.toString().split(D):e.value.toString():e.value&&Array.isArray(e.value)?l.allItems&&l.multiple&&!v.value?M([],e.value,u.value,u.value).map(e=>"".concat(e)):l.multiple?e.value:e.value.toString():l.multiple?[]:(null==(n=e.value)?void 0:n.toString())||"":l.multiple?[]:""},set(a){let n=a;if(l.blankItemName&&!a&&(n=void 0),Array.isArray(n)){if(l.allItems&&l.multiple&&!v.value){const e=M(L.value,n,u.value,u.value);n=N(e).map(e=>"".concat(e))}let e=null;e=0===n.length?null:"SIMPLES"===l.model.valueType?n:n.join(D),t("change",e)}else if(y&&y.length>0){let e=n;S.value&&(e=""===n?null:Number(n)),t("change",e,y[0].id);const a=(i=S.value?Number(n):n,(v.value?p.value:u.value).find(e=>e.value===i));a&&t("change",a.text)}else{let e=n;S.value&&(e=""===n?null:Number(n)),t("change",e)}var i;O(!1),"true"!==l.editorParams.alwaysLoad&&"true"!==l.editorParams.alwaysload||A(),e.autoFocus&&(x="blur",t("blur"))}}),R=r(()=>{const e=Array.isArray(L.value)?L.value:[L.value],t=v.value?p.value:u.value,a=[];return e.forEach(e=>{t.forEach(t=>{(S.value?t.value===Number(e):t.value===e)&&a.push(t.text)})}),a.join(D)});c(R,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),c(w,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const _=e=>(v.value?p.value:u.value).find(t=>t.text===e);se(l.model.appCodeListId,l.context.srfappid,e=>{e&&T(e)}),d(()=>{(()=>{const{navigateContexts:t=[],navigateParams:a=[]}=l.model,n=[];[...t,...a].forEach(e=>{!e.rawValue&&e.value&&n.push(e.value)}),c(()=>{const t={};return Object.keys(e.data).forEach(a=>{n.includes(a)&&(t[a]=e.data[a])}),t},()=>{e.data&&A()},{deep:!0})})(),w.value&&(I=le(w,async e=>{x="outside"}))}),h(()=>{I&&I.stop&&I.stop()});const j={};return"round"===l.editorParams.type&&Object.assign(j,{prefix:()=>R.value.split(D).map(e=>{const t=_(e);return n("div",{class:[s.b("select-option-text"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?s.cssVarBlock({"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(t.bkcolor||""),"select-option-item-padding":"0 var(".concat(s.cssVarName("spacing-base"),")")}):""},[(null==t?void 0:t.sysImage)&&n(i("iBizIcon"),{icon:null==t?void 0:t.sysImage},null),e||""])})}),{ns:s,c:l,curValue:L,items:u,customNodeClass:(e,t)=>e.children.length?s.e("branch-node"):null,valueText:R,hasChildren:v,onBlur:e=>{x="blur",t("blur",e),O(!1)},onFocus:e=>{x="focus",t("focus",e),O(!0)},editorRef:w,treeNodes:b,cssVars:k,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},getCodeListItem:_,isEditable:f,setEditable:O,showFormDefaultContent:P,onVisibleChange:async e=>{var t,a,n;const i="SEARCHFORM"===(null==(n=null==(a=null==(t=l.parent)?void 0:t.form)?void 0:a.model)?void 0:n.controlType);!e&&i&&g(()=>{var e;null==(e=E.value)||e.focus()}),!e||m.value&&"true"!==l.editorParams.alwaysLoad&&"true"!==l.editorParams.alwaysload||(await A(),v.value&&w.value&&"outside"!==x&&g(()=>{w.value.focus()}),g(()=>{window.dispatchEvent(new Event("resize"))}))},isLoading:C,prefix:j,hiddenInputRef:E,valueSeparator:D}},render(){const e="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),t=this.hasChildren?n(i("el-tree-select"),y({ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,clearable:!0,class:[this.ns.b("select")],filterable:!0,teleported:!this.showFormDefaultContent,data:this.treeNodes,"allow-create":!this.c.forceSelection,"default-first-option":this.c.defaultFirstOption,"check-strictly":!0,"render-after-expand":!0,multiple:this.c.multiple,placeholder:this.c.placeHolder?this.c.placeHolder:" ",disabled:this.disabled,loading:this.isLoading,"fit-input-width":e,onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp,onVisibleChange:this.onVisibleChange,"popper-class":"".concat(this.ns.b("popper")," ").concat(this.ns.is("allow-create",!this.c.forceSelection)),props:{class:this.customNodeClass}},this.$attrs),{default:t=>{const a=(t.data||{}).label||"";return n("span",{title:Tt(e?a:"")},[a])}}):n(i("el-select"),y({ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,clearable:!0,class:[this.ns.b("select")],filterable:!0,teleported:!this.showFormDefaultContent,multiple:this.c.multiple,"allow-create":!this.c.forceSelection,placeholder:this.c.placeHolder?this.c.placeHolder:" ",disabled:this.disabled,loading:this.isLoading,"fit-input-width":e,"popper-class":"".concat(this.ns.b("popper")," ").concat("round"===this.c.editorParams.type?this.ns.bm("popper","round"):""," ").concat(this.ns.bm("popper","".concat(this.c.model.id))),onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp,onVisibleChange:this.onVisibleChange},this.$attrs),{default:()=>this.items.map(t=>{var a;return n(i("el-option"),{key:t.value,value:null==(a=t.value)?void 0:a.toString(),label:t.text,disabled:!0===t.disableSelect,style:t.bkcolor?this.ns.cssVarBlock({"select-option-item-bkcolor":"".concat(t.bkcolor)}):"",class:[t.cls?t.cls:null],title:Tt(e?t.text:"")},{default:()=>n("div",{class:[this.ns.b("select-option-content"),t.textCls?t.textCls:null],style:t.color?this.ns.cssVarBlock({"select-option-item-color":"".concat(t.color)}):""},[t.sysImage&&n(i("iBizIcon"),{icon:t.sysImage},null),n("span",{class:[e&&this.ns.be("select-option-content","text")]},[t.text])])})}),...this.prefix}),a=this.valueText.split(this.valueSeparator).map(e=>{const t=this.getCodeListItem(e);return n("span",{class:[this.ns.b("readonly-text-item"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?this.ns.cssVarBlock({"readonly-text-item-color":"".concat(t.color||""),"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(("round"===this.c.editorParams.type?t.bkcolor:"")||"")}):""},[(null==t?void 0:t.sysImage)&&n(i("iBizIcon"),{icon:null==t?void 0:t.sysImage},null),n("span",{class:this.ns.be("readonly-text-item","label")},[e])])}),o=n("div",{class:[this.ns.b("form-default-content"),this.ns.is("multiple",this.c.multiple)]},[this.valueText?this.valueText.split(this.valueSeparator).map(e=>{const t=this.getCodeListItem(e);return n("span",{class:[this.ns.b("content-item"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?this.ns.cssVarBlock({"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(("round"===this.c.editorParams.type?t.bkcolor:"")||"")}):""},[n("span",{class:this.ns.be("content-item","label")},[e])])}):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]),s=n("input",{ref:"hiddenInputRef",type:"text",class:this.ns.e("hidden-input"),readonly:!0,onKeyup:this.handleKeyUp},null);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent),"round"===this.c.editorParams.type&&this.ns.m("round")],style:this.cssVars},[this.showFormDefaultContent&&o,this.readonly?a:t,this.readonly?null:s])}}),eT=a({name:"IBizEmojiPicker",props:qe(),emits:Ve(),setup(e,{emit:t}){const a=B("emoji-picker"),s=e.controller,l=o(),d=o(""),u=o(!1),h=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),p=e=>{e.stopPropagation(),e.preventDefault(),u.value=!0},m=e=>{e.stopPropagation(),e.preventDefault(),d.value="",u.value=!1,t("change",""),l.value.click()};c(()=>e.value,(e,t)=>{e!==t&&(d.value=e&&Jt("".concat(e))?Qt(e):e)},{immediate:!0});const v=()=>{let e=n("span",{class:[a.e("button-content")],onClick:p},[n("svg",{class:a.em("button-content","icon"),viewBox:"0 0 1040 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1490",width:"1em",height:"1em"},[n("path",{d:"M512.075261 1024A511.774217 511.774217 0 1 1 730.482434 48.769072a37.630457 37.630457 0 1 1-32.061149 68.035867 436.513303 436.513303 0 1 0 250.468323 395.270322 37.630457 37.630457 0 0 1 75.260914 0 512.526826 512.526826 0 0 1-512.075261 511.924739z","p-id":"1491"},null),n("path",{d:"M333.857416 344.0929a57.348817 57.348817 0 1 0 57.348817 57.348817 57.499339 57.499339 0 0 0-57.348817-57.348817zM686.53006 344.0929a57.348817 57.348817 0 1 0 57.348817 57.348817 57.348817 57.348817 0 0 0-57.348817-57.348817zM515.236219 783.165074c-162.864619 0-262.359547-141.942084-262.359547-219.159782a30.104366 30.104366 0 0 1 60.208731 0c0 48.618551 76.314567 158.951051 202.150816 158.951051s193.571072-134.114949 193.571072-158.951051a30.104366 30.104366 0 0 1 60.208731 0c0 54.488902-90.012054 219.159782-253.779803 219.159782zM1009.549904 207.720123h-67.132735V139.985301a30.104366 30.104366 0 1 0-60.208732 0v67.734822h-67.734822a30.104366 30.104366 0 0 0-30.104366 30.104366 30.104366 30.104366 0 0 0 30.104366 30.104366h67.734822v67.734823a30.104366 30.104366 0 0 0 60.208732 0v-67.734823h67.734823a30.104366 30.104366 0 0 0 30.104365-30.104366 30.104366 30.104366 0 0 0-30.706453-30.104366z","p-id":"1492"},null)]),ibiz.i18n.t("editor.emojiPicker.addEmoji")]);return d.value&&(e=n("span",{class:[a.e("button-content")]},[n("svg",{class:a.em("button-content","icon"),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em",onClick:m},[n("path",{d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 393.664L407.936 353.6a38.4 38.4 0 1 0-54.336 54.336L457.664 512 353.6 616.064a38.4 38.4 0 1 0 54.336 54.336L512 566.336 616.064 670.4a38.4 38.4 0 1 0 54.336-54.336L566.336 512 670.4 407.936a38.4 38.4 0 1 0-54.336-54.336z"},null)]),n("span",{innerHTML:d.value},null)])),e};return{ns:a,c:s,emoji:d,visible:u,emojiRef:l,showFormDefaultContent:h,onSelect:e=>{u.value=!1,d.value=e.data,t("change",aa(e.data))},onAddEmoji:p,onClearEmoji:m,renderReference:()=>n(i("el-button"),{class:[a.e("button"),a.is("clear",!!d.value)]},{default:()=>[h.value&&n("div",{class:[a.b("form-default-content"),a.is("clear",!!d.value)]},[d.value?d.value:n(i("iBizEditorEmptyText"),{showPlaceholder:s.emptyShowPlaceholder,placeHolder:s.placeHolder},null)]),v()]})}},render(){return n("div",{ref:"emojiRef",class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("active",this.visible),this.ns.is("show-default",this.showFormDefaultContent)]},[n(i("el-popover"),{trigger:"click",placement:"bottom-start",width:"auto",visible:this.visible,"onUpdate:visible":e=>this.visible=e,"hide-after":0,"popper-class":[this.ns.b("popper")]},{reference:()=>this.renderReference(),default:()=>n(i("iBizEmojiSelect"),{continuousList:!0,dark:!0,onSelect:this.onSelect},null)})])}}),tT=a({name:"IBizVirtualizedList",props:qe(),emits:Ve(),setup(e,{emit:t}){const a=B("dropdown"),s=e.controller,l=o([]),u=o([]),p=o(!1),m=o(!1),v=o([]),b=o(),f=s.model.editorItems,w=o(!1);let y="";const C=o(!1),I=e=>{if(0===e.length)return[];const t=[],a=new Set(u.value.map(e=>e.value));return e.forEach(e=>{var n;a.has(e.value)||u.value.push(e);const i={label:e.text,value:null==(n=e.value)?void 0:n.toString(),color:null==e?void 0:e.color,textCls:null==e?void 0:e.textCls,sysImage:e.sysImage,disabled:!0===e.disableSelect,children:[]};e.children&&e.children.length>0&&(i.children=I(e.children)),t.push(i)}),t},x=e=>{l.value=[],u.value=[],s.multiple&&!e.some(e=>e.children)&&(e=s.handleCodeListAllItems(e)),s.blankItemName&&!s.multiple?l.value=[{value:void 0,text:s.blankItemName},...e]:l.value=e;for(let t=0;t<l.value.length;t++){if(l.value[t].children){m.value=!0,v.value=I(e);break}}},S=async()=>{if(s.model.appCodeListId){const e=ibiz.hub.getApp(s.context.srfappid).codeList.getCodeList(s.model.appCodeListId);e&&(C.value=e.codeItemValueNumber||!1)}w.value=!0;const t=await s.loadCodeList(e.data);x(t),p.value=!0,w.value=!1};c(()=>e.value,async(e,t)=>{(e||null===e||0===e)&&(p.value||void 0!==t||await S())},{immediate:!0});const{getSelection:E,getSelectionValue:D}=Hi(s.allItemsValue),P=r({get(){var t,a,n;return p.value?f&&f.length>0&&!s.multiple?null==(t=e.data[f[0].id])?void 0:t.toString():e.value&&"string"==typeof e.value?s.allItems&&s.multiple&&!m.value?E([],e.value.split(","),l.value,l.value).map(e=>"".concat(e)):s.multiple?null==(a=e.value)?void 0:a.toString().split(","):e.value.toString():e.value&&Array.isArray(e.value)?s.allItems&&s.multiple&&!m.value?E([],e.value,l.value,l.value).map(e=>"".concat(e)):s.multiple?e.value:e.value.toString():s.multiple?[]:(null==(n=e.value)?void 0:n.toString())||"":s.multiple?[]:""},set(a){let n=a;if(s.blankItemName&&!a&&(n=void 0),Array.isArray(n)){if(s.allItems&&s.multiple&&!m.value){const e=E(P.value,n,l.value,l.value);n=D(e).map(e=>"".concat(e))}let e=null;e=0===n.length?null:"SIMPLES"===s.model.valueType?n:n.join(","),t("change",e)}else if(f&&f.length>0){let e=void 0===n?null:n;C.value&&null!==e&&(e=Number(n)),t("change",e,f[0].id);const a=(i=C.value?Number(n):n,(m.value?u.value:l.value).find(e=>e.value===i));a&&t("change",a.text)}else{let e=void 0===n?null:n;C.value&&null!==e&&(e=Number(n)),t("change",e)}var i;"true"!==s.editorParams.alwaysLoad&&"true"!==s.editorParams.alwaysload||S(),e.autoFocus&&(y="blur",t("blur"))}}),k=r(()=>{const e=Array.isArray(P.value)?P.value:[P.value],t=m.value?u.value:l.value,a=[];return e.forEach(e=>{t.forEach(t=>{(C.value?t.value===Number(e):t.value===e)&&a.push(t.text)})}),a.join(",")});c(k,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),c(b,t=>{var a;e.autoFocus&&t&&t.focus&&(null==(a=t.focus)||a.call(t))});const z=e=>{y="focus",t("focus",e)},T=e=>{y="blur",t("blur",e)},A=e=>(m.value?u.value:l.value).find(t=>t.text===e);se(s.model.appCodeListId,s.context.srfappid,e=>{e&&x(e)});const O=e=>{const t=e.target;"focus"!==y||b.value.$el.contains(t)||b.value.$refs.popper.popperRef.contentRef.contains(t)||T(e)};d(()=>{(()=>{const{navigateContexts:t=[],navigateParams:a=[]}=s.model,n=[];[...t,...a].forEach(e=>{!e.rawValue&&e.value&&n.push(e.value)}),c(()=>{const t={};return Object.keys(e.data).forEach(a=>{n.includes(a)&&(t[a]=e.data[a])}),t},()=>S(),{deep:!0})})(),document.addEventListener("click",O,{capture:!0})}),h(()=>{document.removeEventListener("click",O,{capture:!0})});const M={};return"round"===s.editorParams.type&&Object.assign(M,{prefix:()=>k.value.split(",").map(e=>{const t=A(e);return n("div",{class:[a.b("select-option-text"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?a.cssVarBlock({"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(t.bkcolor||""),"select-option-item-padding":"0 var(".concat(a.cssVarName("spacing-base"),")")}):""},[(null==t?void 0:t.sysImage)&&n(i("iBizIcon"),{icon:null==t?void 0:t.sysImage},null),e||""])})}),{c:s,ns:a,items:l,prefix:M,curValue:P,editorRef:b,isLoading:w,treeNodes:v,valueText:k,hasChildren:m,onBlur:T,onFocus:z,handleClear:()=>{z()},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},customNodeClass:(e,t)=>e.children.length?a.e("branch-node"):null,getCodeListItem:A,onVisibleChange:async e=>{!e||p.value&&"true"!==s.editorParams.alwaysLoad&&"true"!==s.editorParams.alwaysload||(await S(),m.value&&b.value&&"outside"!==y&&g(()=>{var e,t;null==(t=(e=b.value).focus)||t.call(e)}),g(()=>{window.dispatchEvent(new Event("resize"))}))}}},render(){const e="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),t=n(i("el-select-v2"),y({ref:"editorRef",modelValue:this.curValue||void 0,"onUpdate:modelValue":e=>{this.curValue=e},clearable:!0,class:[this.ns.b("select")],filterable:!0,multiple:this.c.multiple,"allow-create":!this.c.forceSelection,placeholder:this.c.placeHolder?this.c.placeHolder:" ",disabled:this.disabled,loading:this.isLoading,"fit-input-width":e,"popper-class":"".concat(this.ns.b("popper")," ").concat("round"===this.c.editorParams.type?this.ns.bm("popper","round"):""," ").concat(this.ns.bm("popper","".concat(this.c.model.id))," ").concat(this.ns.b("virtualized-list-popper")),onFocus:this.onFocus,onClear:this.handleClear,onKeyup:this.handleKeyUp,onVisibleChange:this.onVisibleChange,options:this.items,props:{key:"value",label:"text"}},this.$attrs),{default:t=>{const{item:a}=t;return n("div",{style:a.bkcolor?this.ns.cssVarBlock({"select-option-item-bkcolor":"".concat(a.bkcolor)}):"",class:["select-v2-option-item",a.cls?a.cls:null,!0===a.disableSelect?"disabled-select-v2":null],title:Tt(e?a.text:"")},[n("div",{class:[this.ns.b("select-option-content"),a.textCls?a.textCls:null],style:a.color?this.ns.cssVarBlock({"select-option-item-color":"".concat(a.color)}):""},[a.sysImage&&n(i("iBizIcon"),{icon:a.sysImage},null),n("span",{class:[e&&this.ns.be("select-option-content","text")]},[a.text])])])},...this.prefix}),a=this.valueText.split(",").map(e=>{const t=this.getCodeListItem(e);return n("span",{class:[this.ns.b("readonly-text-item"),null==t?void 0:t.textCls],style:(null==t?void 0:t.color)||(null==t?void 0:t.bkcolor)?this.ns.cssVarBlock({"readonly-text-item-color":"".concat(t.color||""),"select-option-item-color":"".concat(t.color||""),"select-option-item-bkcolor":"".concat(("round"===this.c.editorParams.type?t.bkcolor:"")||"")}):""},[(null==t?void 0:t.sysImage)&&n(i("iBizIcon"),{icon:null==t?void 0:t.sysImage},null),n("span",{class:this.ns.be("readonly-text-item","label")},[e])])});return n("div",{class:[this.ns.b(),this.ns.b("virtualized-list"),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"","round"===this.c.editorParams.type&&this.ns.m("round"),this.ns.is("has-value",null!=this.value&&""!==this.value)]},[this.readonly?a:t])}});function aT(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const nT=a({name:"IBizTreePicker",props:qe(),emits:Ve(),setup(e,{emit:t}){const a=B("tree-picker"),n=e.controller,i=n.model,s=o([]),l=o([]),r=o(!1),u=o([]),h=o([]),p=o(!1),m=o(!1),v=o(""),g=o(),b=o(!0),f=o(!1),w=o([]),y=n.model.valueSeparator||",";let C=!1;if(i.editorParams){const{editorParams:e}=i;e.showtoolbar&&(C="true"===e.showtoolbar)}const I=e=>{if(0===e.length)return[];const t=[];return e.forEach(e=>{var a;-1===l.value.findIndex(t=>t.value===e.value)&&l.value.push(e);const n={label:e.text,value:null==(a=e.value)?void 0:a.toString(),color:null==e?void 0:e.color,textCls:null==e?void 0:e.textCls,sysImage:e.sysImage,disabled:!0===e.disableSelect,children:[]};e.children&&e.children.length>0&&(n.children=I(e.children)),t.push(n)}),t},x=e=>{s.value=[],l.value=[];let t=e;n.multiple&&!t.some(e=>e.children)&&(t=n.handleCodeListAllItems(t)),s.value=t;for(let e=0;e<s.value.length;e++){if(s.value[e].children){u.value=I(t);break}}},S=async()=>{if(n.model.appCodeListId){const e=ibiz.hub.getApp(n.context.srfappid).codeList.getCodeList(n.model.appCodeListId);e&&(m.value=e.codeItemValueNumber||!1)}p.value=!0;const t=await n.loadCodeList(e.data);x(t),r.value=!0,p.value=!1};c(()=>e.value,async(e,t)=>{if(e){let a=[];r.value||void 0!==t||await S(),Wo(e)?a=e:Lo(e)&&(a=e.split(y)),h.value=a.filter(e=>l.value.find(t=>t.value===e&&t.isLeaf))}},{immediate:!0});const E=e=>{let a=null;a="SIMPLES"===n.model.valueType?e:e.join(y),t("change",a)};se(n.model.appCodeListId,n.context.srfappid,e=>{e&&x(e)}),d(()=>{S()});c(v,e=>{var t;null==(t=g.value)||t.filter(e)});const D=(e=!0)=>{l.value.forEach(t=>{t.children&&t.children.length>0&&((e,t)=>{var a;const n=null==(a=g.value)?void 0:a.getNode(e);n.isLeaf||(t?n.expand():n.collapse())})(t.value,e)})};return{ns:a,c:n,items:s,treeRef:g,filterText:v,treeNodes:u,isCancel:b,defaultCheckedKeys:h,expandedKeys:w,showToolbar:C,onNodeExpand:(...e)=>{e[0]&&e[0].value&&w.value.push(e[0].value)},onNodeCollapse:(...e)=>{if(e[0]&&e[0].value){const t=w.value.findIndex(t=>e[0].value===t);-1!==t&&w.value.splice(t,1)}},filterNode:(e,t)=>!e||t.label&&t.label.includes(e),customNodeClass:e=>e.children.length?a.e("branch-node"):null,onAllExpand:()=>{f.value=!0,D()},onAllCollapse:()=>{f.value=!1,D(!1)},onAllSelect:()=>{var e,t;const a=null==(e=l.value)?void 0:e.map(e=>e.value);D(f.value),null==(t=g.value)||t.setCheckedKeys(a),E(a)},onAllCancel:()=>{var e;D(f.value),null==(e=g.value)||e.setCheckedKeys([]),E([])},onCheck:(...e)=>{if(e[1]){const{checkedKeys:t,halfCheckedKeys:a}=e[1],n=[...a,...t].filter((e,t,a)=>a.indexOf(e)===t);E(n)}}}},render(){const e=this.readonly||this.disabled,t=[n("div",{class:[this.ns.e("search")]},[n(i("el-input"),{modelValue:this.filterText,"onUpdate:modelValue":e=>this.filterText=e,placeholder:this.c.placeHolder||" "},null)]),n("div",{class:[this.ns.e("tree")]},[n(i("el-tree"),{ref:"treeRef",class:this.ns.b("tree"),data:this.treeNodes,"node-key":"value",props:{children:"children",label:"label",class:this.customNodeClass},"show-checkbox":!e,"default-checked-keys":this.defaultCheckedKeys,"default-expanded-keys":this.expandedKeys,"filter-node-method":this.filterNode,onNodeExpand:this.onNodeExpand,onNodeCollapse:this.onNodeCollapse,onCheck:this.onCheck},null)])];if(!e&&this.showToolbar){let e,a,o,s;t.unshift(n("div",{class:[this.ns.e("header")]},[n(i("el-button"),{type:"primary",onClick:this.onAllSelect},aT(e=ibiz.i18n.t("editor.treePicker.allowAll"))?e:{default:()=>[e]}),n(i("el-button"),{type:"primary",onClick:this.onAllCancel},aT(a=ibiz.i18n.t("editor.treePicker.allProhibited"))?a:{default:()=>[a]}),n(i("el-button"),{type:"primary",onClick:this.onAllExpand},aT(o=ibiz.i18n.t("editor.treePicker.expandAll"))?o:{default:()=>[o]}),n(i("el-button"),{type:"primary",onClick:this.onAllCollapse},aT(s=ibiz.i18n.t("editor.treePicker.collapseAll"))?s:{default:()=>[s]})]))}return n("div",{class:[this.ns.b()]},[t])}});var iT=Object.defineProperty,oT=(e,t,a)=>(((e,t,a)=>{t in e?iT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class sT extends Ui{constructor(){super(...arguments),oT(this,"multiple",!1),oT(this,"forceSelection",!0),oT(this,"defaultFirstOption",!1),oT(this,"blankItemName","")}async onInit(){var e,t,a,n,i,o;super.onInit(),"MDROPDOWNLIST"!==this.model.editorType&&"MOBCHECKLIST"!==this.model.editorType||(this.multiple=!0),(null==(e=this.editorParams)?void 0:e.forceSelection)&&(this.forceSelection=this.toBoolean(this.editorParams.forceSelection)),(null==(t=this.editorParams)?void 0:t.forceselection)&&(this.forceSelection=this.toBoolean(this.editorParams.forceselection)),(null==(a=this.editorParams)?void 0:a.defaultFirstOption)&&(this.defaultFirstOption=this.toBoolean(this.editorParams.defaultFirstOption)),(null==(n=this.editorParams)?void 0:n.defaultfirstoption)&&(this.defaultFirstOption=this.toBoolean(this.editorParams.defaultfirstoption)),(null==(i=this.editorParams)?void 0:i.blankItemName)&&(this.blankItemName=this.editorParams.blankItemName),(null==(o=this.editorParams)?void 0:o.blankitemname)&&(this.blankItemName=this.editorParams.blankitemname)}}var lT=Object.defineProperty,rT=(e,t,a)=>(((e,t,a)=>{t in e?lT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class cT{constructor(e){rT(this,"formEditor","IBizDropdown"),rT(this,"gridEditor","IBizDropdown");let t="IBizDropdown";switch(e){case"EMOJI_PICKER":t="IBizEmojiPicker";break;case"VIRTUALIZED_LIST":t="IBizVirtualizedList";break;case"TREE_PICKER":t="IBizTreePicker"}this.formEditor=t,this.gridEditor=t}async createController(e,t){const a=new sT(e,t);return await a.init(),a}}const dT=a({name:"IBizCheckbox",props:Ge(),emits:Ve(),setup(e,{emit:t}){var a,n,i,o;const s=B("checkbox"),l=e.controller.model;let c=1,d=0;(null==(a=l.editorParams)?void 0:a.selectValue)&&(c=l.editorParams.selectValue),(null==(n=l.editorParams)?void 0:n.selectvalue)&&(c=l.editorParams.selectvalue),(null==(i=l.editorParams)?void 0:i.nullValue)&&(d=l.editorParams.nullValue),(null==(o=l.editorParams)?void 0:o.nullvalue)&&(d=l.editorParams.nullvalue);const u=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),{useInFocusAndBlur:h,useInValueChange:p}=We(e,t),m=r({get:()=>e.value==c,set(e){let a;a=e?c:d,t("change",a),p()}}),{componentRef:v}=je(()=>t("focus"),()=>h());return{ns:s,editorModel:l,currentVal:m,editorRef:v,showFormDefaultContent:u}},render(){return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[n(i("el-checkbox"),y({modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.disabled||this.readonly},this.$attrs),null)])}});class uT extends qi{}var hT=Object.defineProperty,pT=(e,t,a)=>(((e,t,a)=>{t in e?hT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class mT{constructor(){pT(this,"formEditor","IBizCheckbox"),pT(this,"gridEditor","IBizCheckbox")}async createController(e,t){const a=new uT(e,t);return await a.init(),a}}const vT=a({name:"IBizCheckboxList",props:Ye(),emits:Ve(),setup(e,{emit:t}){const a=B("checkbox-list"),n=e.controller,i=n.codeList,s=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),l=o([]);c(()=>e.data,e=>{n.loadCodeList(e).then(e=>{l.value=n.handleCodeListAllItems(e)})},{immediate:!0,deep:!0});const d=r(()=>i&&i.orMode?i.orMode:"STR"),u=Gi(d.value,n.model.valueType);se(n.model.appCodeListId,n.context.srfappid,e=>{e&&(l.value=n.handleCodeListAllItems(e))});let h=",";i&&i.valueSeparator&&(h=i.valueSeparator);const{useInFocusAndBlur:p,useInValueChange:m}=We(e,t),{getSelection:v,getSelectionValue:g}=Hi(n.allItemsValue),b=r({get(){if(!Po(e.value)){const{getSelectArray:t}=u,a=t(e.value,i,l.value,h,null==i?void 0:i.codeItemValueNumber);if(a)return n.allItems?v([],a,l.value,l.value):a}return[]},set(e){if(n.allItems){const t=v(b.value,e,l.value,l.value);e=g(t)}let a=null;const{setSelectArray:i}=u;a=i(e,l.value,h),t("change",a),m()}}),f=r(()=>{const e=Array.isArray(b.value)?b.value:[b.value];return l.value.filter(t=>{let a=!1;return e.forEach(e=>{e==t.value&&(a=!0)}),a}).map(e=>e.text).join(",")});c(f,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});const{componentRef:w}=je(()=>t("focus"),()=>p());return{ns:a,items:l,selectArray:b,valueText:f,editorRef:w,onSelectArrayChange:e=>{b.value=e},showFormDefaultContent:s}},render(){let e;return n("div",{ref:"editorRef",class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("grid-layout",!!this.controller.rowNumber)],style:this.controller.rowNumber?"".concat(this.ns.cssVarBlockName("group-row-number"),":").concat(this.controller.rowNumber):""},[this.readonly?this.valueText:n(i("el-checkbox-group"),y({"model-value":this.selectArray,onChange:this.onSelectArrayChange},this.$attrs),(t=e=this.items.map((e,t)=>n(i("el-checkbox"),{key:t,label:e.value,disabled:this.disabled||!0===e.disableSelect},{default:()=>[n("span",{class:this.ns.e("text")},[e.text])]})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))]);var t}});var gT=Object.defineProperty,bT=(e,t,a)=>(((e,t,a)=>{t in e?gT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class fT extends Ui{constructor(){super(...arguments),bT(this,"codeList"),bT(this,"rowNumber")}async onInit(){var e,t;if(super.onInit(),this.model.appCodeListId){const e=await ibiz.hub.getApp(this.context.srfappid);this.codeList=e.codeList.getCodeList(this.model.appCodeListId)}(null==(e=this.editorParams)?void 0:e.rowNumber)&&(this.rowNumber=Number(this.editorParams.rowNumber)),(null==(t=this.editorParams)?void 0:t.rownumber)&&(this.rowNumber=Number(this.editorParams.rownumber))}}var wT=Object.defineProperty,yT=(e,t,a)=>(((e,t,a)=>{t in e?wT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class CT{constructor(){yT(this,"formEditor","IBizCheckboxList"),yT(this,"gridEditor","IBizCheckboxList")}async createController(e,t){const a=new fT(e,t);return await a.init(),a}}const IT=a({name:"IBizRadio",props:Ke(),emits:Ve(),setup(e,{emit:t}){const a=B("radio"),n=e.controller,i=n.model;let s="radio",l=!1;i.editorParams&&(i.editorParams.renderMode&&(s=i.editorParams.renderMode),i.editorParams.rendermode&&(s=i.editorParams.rendermode),i.editorParams.isBtnRoundCorner&&(l=n.toBoolean(i.editorParams.isBtnRoundCorner)),i.editorParams.isbtnroundcorner&&(l=n.toBoolean(i.editorParams.isbtnroundcorner)));const{useInFocusAndBlur:d,useInValueChange:u}=We(e,t),h=o([]);c(()=>e.data,e=>{n.loadCodeList(e).then(e=>{h.value=e})},{immediate:!0,deep:!0});se(n.model.appCodeListId,n.context.srfappid,e=>{e&&(h.value=e)});const p=r(()=>{var t;return(null==(t=h.value.find(t=>t.value==e.value))?void 0:t.text)||""}),m=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(p,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});const{componentRef:v}=je(()=>t("focus"),()=>d());return{ns:a,editorModel:i,items:h,valueText:p,onSelectValueChange:e=>{t("change",e),u()},editorRef:v,renderMode:s,isBtnRoundCorner:l,showFormDefaultContent:m}},render(){var e;let t;const a=null==(e=this.controller.editorParams)?void 0:e.itemwidth,o=a?"".concat(a,"px"):"";return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("grid-layout",!!this.controller.rowNumber)],style:this.controller.rowNumber?"".concat(this.ns.cssVarBlockName("group-row-number"),":").concat(this.controller.rowNumber):"",ref:"editorRef"},[this.readonly?this.valueText:"tab"!==this.renderMode?n(i("el-radio-group"),y({class:this.ns.e("group"),"model-value":vo(this.value)?String(this.value):"",onChange:this.onSelectValueChange},this.$attrs),(l=t=this.items.map((e,t)=>"radio"===this.renderMode?n(i("el-radio"),{key:t,style:{width:o},title:Tt(e.text),label:vo(e.value)?String(e.value):"",disabled:this.disabled||!0===e.disableSelect},{default:()=>[e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),n("span",{class:this.ns.e("text")},[e.text])]}):n(i("el-radio-button"),{key:t,class:[this.ns.e("button"),this.isBtnRoundCorner?this.ns.em("button","round-corner"):""],style:{width:o},title:Tt(e.text),label:vo(e.value)?String(e.value):"",disabled:this.disabled||!0===e.disableSelect},{default:()=>[e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),n("span",{class:this.ns.em("button","text")},[e.text])]})),"function"==typeof l||"[object Object]"===Object.prototype.toString.call(l)&&!s(l)?t:{default:()=>[t]})):n("div",{class:this.ns.b("tab")},[this.items.map(e=>{const t=vo(this.value)?String(this.value):"",a=vo(e.value)?String(e.value):"",s=this.disabled||!0===e.disableSelect;return n("span",{class:[this.ns.b("tab-item"),this.ns.is("selected",t===a),this.ns.is("disabled",s)],style:{width:o},title:Tt(e.text),onClick:()=>{s||this.onSelectValueChange(a)}},[e.sysImage&&n(i("iBizIcon"),{icon:e.sysImage},null),n("span",{class:this.ns.be("tab-item","text")},[e.text||""])])})])]);var l}});var xT=Object.defineProperty,ST=(e,t,a)=>(((e,t,a)=>{t in e?xT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ET extends Ui{constructor(){super(...arguments),ST(this,"rowNumber")}async onInit(){var e,t;super.onInit(),(null==(e=this.editorParams)?void 0:e.rowNumber)&&(this.rowNumber=Number(this.editorParams.rowNumber)),(null==(t=this.editorParams)?void 0:t.rownumber)&&(this.rowNumber=Number(this.editorParams.rownumber))}}var DT=Object.defineProperty,PT=(e,t,a)=>(((e,t,a)=>{t in e?DT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class kT{constructor(){PT(this,"formEditor","IBizRadio"),PT(this,"gridEditor","IBizRadio")}async createController(e,t){const a=new ET(e,t);return await a.init(),a}}const zT=a({name:"IBizDatePicker",props:Xe(),emits:Ve(),setup(e,{emit:t}){const a=B("date-picker"),n=e.controller,i=n.model,s=o("date"),l=o("YYYY-MM-DD"),d=o(!1),u=o(!1),h=o(),p=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));switch(i.editorType){case"DATEPICKEREX":case"DATEPICKEREX_NOTIME":case"MOBDATE_NOTIME":s.value="date";break;case"DATEPICKEREX_NODAY":case"DATEPICKEREX_NODAY_NOSECOND":case"MOBDATE_NODAY":case"MOBDATE_NODAY_NOSECOND":d.value=!0,s.value="time";break;default:s.value="datetime"}const m=n.valueFormat;m&&(l.value=m);const v=o();c(()=>e.value,(e,t)=>{if(e&&e!==t){const t=as(e).format(m);v.value="Invalid Date"!==t?t:e}else null==e&&(v.value=e)},{immediate:!0});const g=e=>{e?u.value=e:setTimeout(()=>{u.value=e},100)};c(h,t=>{e.autoFocus&&t&&t.focus&&t.focus()});c(v,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});return{ns:a,c:n,editorModel:i,type:s,format:l,formatValue:v,handleChange:(e,a)=>{t("change",e),g(!1)},editorRef:h,isTimePicker:d,onFocus:e=>{t("focus",e),g(!0)},onBlur:e=>{t("blur",e),g(!1)},isEditable:u,setEditable:g,showFormDefaultContent:p,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)}}},render(){const e=this.isTimePicker?n(i("el-time-picker"),y({ref:"editorRef",class:[this.ns.b("input")],type:this.type,format:this.format,"value-format":this.format,placeholder:this.c.placeHolder,modelValue:this.formatValue,"onUpdate:modelValue":e=>this.formatValue=e,onChange:this.handleChange,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null):n(i("el-date-picker"),y({ref:"editorRef",class:[this.ns.b("input")],type:this.type,format:this.format,"value-format":this.format,placeholder:this.c.placeHolder,modelValue:this.formatValue,"onUpdate:modelValue":e=>this.formatValue=e,onChange:this.handleChange,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null),t=this.formatValue,a=n("div",{class:this.ns.b("form-default-content")},[this.formatValue?this.formatValue:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.e(this.editorModel.editorType),this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],onKeyup:this.handleKeyUp},[this.showFormDefaultContent&&a,this.readonly?t:e])}});class TT extends qi{getFormatByType(e){switch(e){case"DATEPICKER":case"MOBDATE":case"DATEPICKEREX":case"DATEPICKEREX_SECOND":case"MOBDATE_SECOND":default:return"YYYY-MM-DD HH:mm:ss";case"DATEPICKEREX_NOTIME":case"MOBDATE_NOTIME":return"YYYY-MM-DD";case"DATEPICKEREX_HOUR":case"MOBDATE_HOUR":return"YYYY-MM-DD HH";case"DATEPICKEREX_MINUTE":case"MOBDATE_MINUTE":case"DATEPICKEREX_NOSECOND":return"YYYY-MM-DD HH:mm";case"DATEPICKEREX_NODAY":case"MOBDATE_NODAY":return"HH:mm:ss";case"DATEPICKEREX_NODAY_NOSECOND":case"MOBDATE_NODAY_NOSECOND":return"HH:mm"}}get valueFormat(){return super.valueFormat?super.valueFormat:this.model.dateTimeFormat?this.model.dateTimeFormat:this.getFormatByType(this.model.editorType)}}var AT=Object.defineProperty,OT=(e,t,a)=>(((e,t,a)=>{t in e?AT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class MT{constructor(){OT(this,"formEditor","IBizDatePicker"),OT(this,"gridEditor","IBizDatePicker")}async createController(e,t){const a=new TT(e,t);return await a.init(),a}}const NT=a({name:"IBizRaw",props:$e(),emits:Ve(),setup(e){const t=B("raw"),a=e.controller,n=a.model,i=o(""),s=r(()=>!!a.model.editorHeight);let l="TEXT",d="";n.contentType&&(l=n.contentType),n.editorParams&&n.editorParams.contenttype&&(l=n.editorParams.contenttype),n.editorParams&&n.editorParams.template&&(d=n.editorParams.template.replace(/\/\/n/g,"\n")),n.editorParams&&n.editorParams.TEMPLATE&&(d=n.editorParams.TEMPLATE.replace(/\/\/n/g,"\n"));const u=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));return c(()=>e.value,async(t,a)=>{if(t!==a&&("string"!=typeof t&&"number"!=typeof t&&t||(i.value=t),d&&t)){let a=t;if("string"==typeof t)try{a=JSON.parse(t)}catch(e){ibiz.log.error("JSON字符串转换错误")}Array.isArray(a)||Object.assign(a,{data:{...e.data}}),ibiz.log.debug("模板内容:",d),ibiz.log.debug("模板编译对象:",a),i.value=await ibiz.util.hbs.render(d,a)}},{immediate:!0}),{ns:t,content:i,type:l,template:d,enableOverFlow:s,showFormDefaultContent:u}},render(){return n("div",{class:[this.ns.b(),this.ns.is("overflow",this.enableOverFlow),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[this.content&&n(i("iBizRawItem"),{class:this.ns.b("content"),content:this.content,type:this.type},null)])}});class BT extends qi{}var LT=Object.defineProperty,RT=(e,t,a)=>(((e,t,a)=>{t in e?LT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class _T{constructor(){RT(this,"formEditor","IBizRaw"),RT(this,"gridEditor","IBizRaw")}async createController(e,t){const a=new BT(e,t);return await a.init(),a}}const jT=a({name:"IBizStepper",props:Je(),emits:Ve(),setup(e,{emit:t}){const a=B("stepper"),n=e.controller,i=n.model,s=o(null);let l=1,d=0,u=1/0,h=-1/0;i.editorParams&&(i.editorParams.stepvalue&&(l=Yo(i.editorParams.stepvalue)),i.editorParams.precision&&(d=Yo(i.editorParams.precision)),i.editorParams.maxvalue&&(u=Yo(i.editorParams.maxvalue)),i.editorParams.minvalue&&(h=Yo(i.editorParams.minvalue)));const p=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{if(e!==t){const t=Number(e);s.value=Number.isNaN(t)?0:t}},{immediate:!0});const m=o();return{ns:a,c:n,currentVal:s,handleChange:e=>{t("change",e)},inputRef:m,step:l,precision:d,max:u,min:h,onFocus:()=>{t("focus")},onBlur:()=>{t("blur")},showFormDefaultContent:p}},render(){let e=null;return e=this.readonly?fo(this.currentVal)?"":"".concat(this.currentVal):[n(i("el-input-number"),y({ref:"inputRef",modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,placeholder:this.c.placeHolder,precision:this.precision,min:this.min,max:this.max,step:this.step,disabled:this.disabled,onChange:this.handleChange,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null)],n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[e])}});class VT extends qi{}var FT=Object.defineProperty,UT=(e,t,a)=>(((e,t,a)=>{t in e?FT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class HT{constructor(){UT(this,"formEditor","IBizStepper"),UT(this,"gridEditor","IBizStepper")}async createController(e,t){const a=new VT(e,t);return await a.init(),a}}const qT=a({name:"IBizRate",props:Qe(),emits:Ve(),setup(e,{emit:t}){const a=B("rate"),n=o(),i=e.controller,s=i.model,{useInFocusAndBlur:l,useInValueChange:d}=We(e,t);let u=[],h=!1,p=5,m=[];s.editorParams&&(s.editorParams.colors&&(u=i.toObj(s.editorParams.colors)),s.editorParams.showText&&(h=i.toBoolean(s.editorParams.showText)),s.editorParams.showtext&&(h=i.toBoolean(s.editorParams.showtext)),s.editorParams.maxvalue&&(p=Yo(s.editorParams.maxvalue)),s.editorParams.texts&&(m=i.toObj(s.editorParams.texts)));const v=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{e!==t&&(n.value=e||0)},{immediate:!0});const{componentRef:g}=je(()=>t("focus"),()=>l());return{ns:a,currentVal:n,handleChange:e=>{t("change",e),d()},colors:u,showText:h,max:p,texts:m,editorRef:g,showFormDefaultContent:v}},render(){return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[n(i("el-rate"),y({modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.disabled||this.readonly,max:this.max,colors:this.colors,showText:this.showText,texts:this.texts,onChange:this.handleChange},this.$attrs),null)])}});class GT extends qi{}var WT=Object.defineProperty,YT=(e,t,a)=>(((e,t,a)=>{t in e?WT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class KT{constructor(){YT(this,"formEditor","IBizRate"),YT(this,"gridEditor","IBizRate")}async createController(e,t){const a=new GT(e,t);return await a.init(),a}}const XT=a({name:"IBizSwitch",props:Ze(),emits:Ve(),setup(e,{emit:t}){const a=B("switch"),n=e.controller,i=n.model,s=o(!1);let l="",d="",u=[{value:0,label:""},{value:1,label:""}];if(i.editorParams&&(i.editorParams.dicData&&(u=n.toObj(i.editorParams.dicData)),i.editorParams.dicdata&&(u=n.toObj(i.editorParams.dicdata))),u&&Array.isArray(u)){const e=u.find(e=>0===e.value);e&&(d=e.label);const t=u.find(e=>1===e.value);t&&(l=t.label)}const h=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(t,a)=>{t!==a&&(s.value=!!t&&1==e.value)},{immediate:!0});const p=r(()=>!e.autoFocus&&(e.disabled||e.readonly)),{useInFocusAndBlur:m,useInValueChange:v}=We(e,t),{componentRef:g}=je(()=>t("focus"),()=>m());return{ns:a,currentVal:s,curDisabled:p,activeText:l,inactiveText:d,handleChange:e=>{t("change",!0===e?1:0),v()},dicData:u,editorRef:g,showFormDefaultContent:h}},render(){const e={...this.$attrs,title:""};return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[n(i("el-switch"),y({modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.curDisabled,activeText:this.activeText,inactiveText:this.inactiveText,onChange:this.handleChange},e),null)])}}),$T=a({name:"IBizSwitchTriState",props:Ze(),emits:Ve(),setup(e,{emit:t}){const a=B("switch-tristate"),n=e.controller,i=o(null),s=o(null);c(()=>e.value,(e,t)=>{e!==t&&(s.value=0===e?0:1===e?1:null)},{immediate:!0});return{ns:a,c:n,currentVal:s,onSwitchClick:()=>{e.disabled||e.readonly||(null===s.value&&(null!==i.value&&0!==i.value||(i.value=null,t("change",1)),1===i.value&&(i.value=null,t("change",0))),1===s.value&&(i.value=1,t("change",null)),0===s.value&&(i.value=0,t("change",null)))}}},render(){return n("div",{class:[this.ns.b()]},[n("div",{class:[this.ns.e("switch-wrapper"),this.ns.is("left",0===this.currentVal),this.ns.is("center",null===this.currentVal),this.ns.is("right",1===this.currentVal),this.ns.is("disabled",this.disabled||this.readonly)],onClick:this.onSwitchClick},null)])}});class JT extends qi{}var QT=Object.defineProperty,ZT=(e,t,a)=>(((e,t,a)=>{t in e?QT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class eA{constructor(e){ZT(this,"formEditor","IBizSwitch"),ZT(this,"gridEditor","IBizSwitch"),"TRISTATE"===e&&(this.formEditor="IBizSwitchTriState",this.gridEditor="IBizSwitchTriState")}async createController(e,t){const a=new JT(e,t);return await a.init(),a}}const tA=a({name:"IBizSlider",props:et(),emits:Ve(),setup(e,{emit:t}){const a=B("slider"),n=e.controller,i=n.model,{valueFormat:s}=n.parent,{useInFocusAndBlur:l,useInValueChange:u}=We(e,t),h=o(""),p=o(0);let v=1,b=100,f=0,w=!1,y=!1,C=!1,I=!1,x=s||"0%",S="line",E="",D="",P="";i.editorParams&&(i.editorParams.stepvalue&&(v=Yo(i.editorParams.stepvalue)),i.editorParams.maxvalue&&(b=Yo(i.editorParams.maxvalue)),i.editorParams.minvalue&&(f=Yo(i.editorParams.minvalue)),i.editorParams.showstops&&(w=n.toBoolean(i.editorParams.showstops)),i.editorParams.range&&(y=n.toBoolean(i.editorParams.range)),i.editorParams.showinput&&(C=n.toBoolean(i.editorParams.showinput)),i.editorParams.showText&&(I=n.toBoolean(i.editorParams.showText)),i.editorParams.showtext&&(I=n.toBoolean(i.editorParams.showtext)),i.editorParams.format&&(x=i.editorParams.format),i.editorParams.type&&(S=i.editorParams.type),i.editorParams.textItem&&(E=i.editorParams.textItem),i.editorParams.textitem&&(E=i.editorParams.textitem),i.editorParams.pieBg&&(D=i.editorParams.pieBg),i.editorParams.piebg&&(D=i.editorParams.piebg),i.editorParams.piePercentBg&&(P=i.editorParams.piePercentBg),i.editorParams.piepercentbg&&(P=i.editorParams.piepercentbg));const k=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),z=e=>100*Number(e),T=e=>{switch(S){case"line":return(e=>y?JSON.parse(e):Number(e))(e);case"circle":case"pie":return z(e);default:return e}},{componentRef:A}=je(()=>t("focus"),()=>l()),O=()=>{A.value&&(p.value=Math.min(A.value.clientHeight,A.value.clientWidth)),h.value="",p.value>0&&(h.value="height:".concat(p.value,"px;width:").concat(p.value,"px;min-width:unset;min-height:unset;")),D&&(h.value+="".concat(a.cssVarName("editor-slider-pie-bg"),":").concat(D,";")),P&&(h.value+="".concat(a.cssVarName("editor-slider-pie-percent-bg"),":").concat(P,";")),h.value+="animation-delay:-".concat(M.value,"s;")},M=o();c(()=>e.value,(e,t)=>{e!==t&&(null==e?(M.value=y?[0,1]:0,"pie"===S&&O()):(M.value=T(e),"pie"===S&&O()))},{immediate:!0});const N=()=>{O()};d(()=>{"pie"===S&&(window.addEventListener("resize",N),g(()=>{O()}))}),m(()=>{"pie"===S&&window.removeEventListener("resize",N)});const L=r(()=>{if(E){const t=e.data||{};return ibiz.util.text.format("".concat(null!=t[E]?t[E]:""),x)}const t=Number(M.value),a=Number(t/b);return ibiz.util.text.format("".concat(null!=a?a:""),x)});return{ns:a,currentVal:M,handleChange:e=>{Array.isArray(e)?t("change",JSON.stringify(e)):t("change",e),u()},step:v,max:b,min:f,type:S,textItem:E,showStops:w,range:y,showInput:C,editorRef:A,showText:I,textVal:L,showFormDefaultContent:k,pieStyle:h}},render(){let e;return"line"===this.type&&(e=[n(i("el-slider"),y({modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.disabled||this.readonly,step:this.step,max:this.max,min:this.min,showStops:this.showStops,range:this.range,showInput:this.showInput,onChange:this.handleChange},this.$attrs),null),this.showText?n("span",{class:[this.ns.em("text","val")]},[this.textVal]):null]),"circle"===this.type&&(e=n(i("el-progress"),y({type:this.type,percentage:this.currentVal},this.$attrs),{default:e=>{if(!this.showText)return"";let t=e.percentage;return this.textItem&&(t=this.textVal),n("span",{class:this.ns.em("circle","text")},[t])}})),"pie"===this.type&&(e=n("div",{class:[this.ns.e("pie-content"),this.ns.is("hundred-percent",this.currentVal>=this.max)],style:this.pieStyle},null)),n("div",{class:[this.ns.b(),this.readonly?this.ns.m("readonly"):"",this.showText?this.ns.e("text"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.e(this.type)],ref:"editorRef"},[e])}});class aA extends qi{async onInit(){super.onInit(),this.model.precision&&ibiz.log.warn("滑动输入条不支持配置精度")}}var nA=Object.defineProperty,iA=(e,t,a)=>(((e,t,a)=>{t in e?nA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class oA{constructor(){iA(this,"formEditor","IBizSlider"),iA(this,"gridEditor","IBizSlider")}async createController(e,t){const a=new aA(e,t);return await a.init(),a}}function sA(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const lA=a({name:"IBizListBox",props:tt(),emits:Ve(),setup(e,{emit:t}){const a=B("list-box"),n=e.controller,i=n.model;let s=!1;i.editorParams&&i.editorParams.multiple&&(s=n.toBoolean(i.editorParams.multiple));const{useInFocusAndBlur:l,useInValueChange:d}=We(e,t),u=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),h=n.codeList,p=i.editorType,m=o([]);(async()=>{if(Object.is("LISTBOX",p)){const t=n;t.loadCodeList(e.data).then(e=>{m.value=s?t.handleCodeListAllItems(e):e})}else if(Object.is("LISTBOXPICKUP",p)){const t=n;if(t.model.appDataEntityId){const a=await t.getServiceData(e.data);a&&(m.value=a.data.map(e=>({value:e[t.keyName],text:e[t.textName]})))}}})();se(n.model.appCodeListId,n.context.srfappid,e=>{if(e){if(Object.is("LISTBOX",p)&&s)return void(m.value=n.handleCodeListAllItems(e));m.value=e}});const v=r(()=>h&&h.orMode?h.orMode:"STR"),g=Gi(v.value,n.model.valueType);let b=",";h&&h.valueSeparator&&(b=h.valueSeparator);const{getSelection:f,getSelectionValue:w}=Hi(Object.is("LISTBOX",p)?n.allItemsValue:""),y=o([]);c(()=>e.value,e=>{if(Po(e))y.value=[];else if(s){let t=[];if("LISTBOX"===p){const{getSelectArray:a}=g,i=a(e,h,m.value,b,null==h?void 0:h.codeItemValueNumber);i&&(t=i,n.allItems&&(t=f([],t,m.value,m.value)))}else"LISTBOXPICKUP"===p&&""!==e&&(t="SIMPLES"===n.model.valueType&&Array.isArray(e)?e:e.split(b));y.value=t}else y.value=[e]},{immediate:!0,deep:!0});const{componentRef:C}=je(()=>t("focus"),()=>l());return{ns:a,items:m,selectArray:y,onSelectArrayChange:e=>{let a;if(s){let t=[...e];if(Object.is("LISTBOX",p)){if(n.allItems){const e=f(y.value,t,m.value,m.value);t=w(e)}const{setSelectArray:e}=g;a=e(t,m.value,b)}else Object.is("LISTBOXPICKUP",p)&&("SIMPLES"===n.model.valueType?a=t:"SIMPLE"===n.model.valueType&&(a=t.join(b)))}else a=e;t("change",a),d()},multiple:s,editorRef:C,showFormDefaultContent:u}},render(){let e,t;return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],ref:"editorRef"},[this.multiple?n(i("el-checkbox-group"),y({class:this.ns.b("checkbox"),modelValue:this.selectArray,onChange:this.onSelectArrayChange},this.$attrs),sA(e=this.items.map((e,t)=>n(i("el-checkbox"),{key:t,label:e.value,disabled:this.disabled||this.readonly||!0===e.disableSelect},{default:()=>{const t=this.controller;if(t.acItemProvider){const a=i(t.acItemProvider.component);return l(a,{item:e,controller:t})}return n("span",{class:this.ns.e("text")},[e.text])}})))?e:{default:()=>[e]}):n(i("el-radio-group"),y({class:this.ns.b("radio"),modelValue:this.selectArray[0]},this.$attrs),sA(t=this.items.map((e,t)=>n(i("el-radio"),{key:t,label:e.value,disabled:this.disabled||this.readonly||!0===e.disableSelect,onChange:()=>{this.onSelectArrayChange(e.value)}},{default:()=>{const t=this.controller;if(t.acItemProvider){const a=i(t.acItemProvider.component);return l(a,{item:e,controller:t})}return n("span",{class:this.ns.e("text")},[e.text])}})))?t:{default:()=>[t]})])}});var rA=Object.defineProperty,cA=(e,t,a)=>(((e,t,a)=>{t in e?rA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class dA extends Ui{constructor(){super(...arguments),cA(this,"codeList")}async onInit(){if(super.onInit(),this.model.appCodeListId){const e=await ibiz.hub.getApp(this.context.srfappid);this.codeList=e.codeList.getCodeList(this.model.appCodeListId)}}}var uA=Object.defineProperty,hA=(e,t,a)=>(((e,t,a)=>{t in e?uA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class pA extends qi{constructor(){super(...arguments),hA(this,"keyName","srfkey"),hA(this,"textName","srfmajortext"),hA(this,"interfaceName",""),hA(this,"deACMode"),hA(this,"acItemProvider")}async onInit(){super.onInit(),"LISTBOXPICKUP"===this.model.editorType&&(this.model.appDEDataSetId&&(this.interfaceName=this.model.appDEDataSetId),this.model.appDataEntityId&&this.model.appDEACModeId&&(this.deACMode=await ga(this.model.appDEACModeId,this.model.appDataEntityId,this.context.srfappid),this.deACMode&&this.deACMode.itemSysPFPluginId&&(this.acItemProvider=await Vi(this.deACMode))))}async getServiceData(e){const{context:t,params:a}=this.handlePublicParams(e,this.context,this.params),n=Ao(a,{size:1e3});if(this.interfaceName){const e=ibiz.hub.getApp(this.context.srfappid);return await e.deService.exec(this.model.appDataEntityId,this.interfaceName,t,n)}throw new Xt(this.model,ibiz.i18n.t("editor.common.entityConfigErr"))}}var mA=Object.defineProperty,vA=(e,t,a)=>(((e,t,a)=>{t in e?mA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class gA{constructor(){vA(this,"formEditor","IBizListBox"),vA(this,"gridEditor","IBizListBox")}async createController(e,t){let a;return a="LISTBOXPICKUP"===e.editorType?new pA(e,t):new dA(e,t),await a.init(),a}}const bA=a({name:"IBizAutoComplete",props:at(),emits:Ve(),setup(e,{emit:t}){const a=B("autocomplete"),s=e.controller,l=s.model.editorType,d=o(""),u=o([]),h=o(!0),p=o(!1),m=o(),v=o(!1),g=o(!1),b=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(u,(t,a)=>{if(0===a.length&&t.length>0){const a=t.findIndex(t=>Object.is(t[s.keyName],e.value));-1!==a&&(d.value=t[a][s.textName])}});const f=e=>{e?p.value=e:setTimeout(()=>{p.value=e},100)},w=async(t,a)=>{if(s.model.appDataEntityId){const n=t.trim(),i=await s.getServiceData(n,e.data);if(i&&(u.value=i.data,v.value=!0,a&&a instanceof Function))if(u.value.length)a([...u.value,...s.actionDetails]);else{a([{srftype:"empty"},...s.actionDetails])}}};c(()=>e.value,async(e,t)=>{if(e||null===e){v.value||void 0!==t||await w(""),null===e&&(d.value="");const a=u.value.findIndex(t=>Object.is(t[s.keyName],e));-1!==a?d.value=u.value[a][s.textName]:(d.value=e,null===e&&(d.value=""))}},{immediate:!0}),c(m,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const y=()=>{if(u.value.length){const t=u.value.findIndex(t=>Object.is(t[s.keyName],e.value));-1!==t&&(d.value=u.value[t][s.textName])}else w("")},C=r(()=>!Object.is("AC_NOBUTTON",l)),I=r(()=>!(Object.is("AC_NOBUTTON",l)||Object.is("AC_FS_NOBUTTON",l)));let x,S=!1;const E=_o(e=>{x!==e&&t("change",e),x=void 0,S=!1},300,{leading:!0});return{ns:a,c:s,curValue:d,triggerOnFocus:C,autoCompleteClearable:I,onSearch:w,onClear:()=>{const e=s.dataItems;e.length>0&&e.forEach(e=>{t("change",null,e.id)}),t("change",null)},onFocus:e=>{g.value=!0,m.value.loading=!0,t("focus",e),f(!0)},onBlur:e=>{g.value=!1,t("blur",e),f(!1)},onACSelect:async a=>{h.value=!0,f(!1),"empty"!==a.srftype?"DEUIACTION"===a.detailType?(s.onActionClick(a,e.data),y()):await(async e=>{const a=await s.calcFillDataItems(e);a.length&&a.forEach(e=>{t("change",e.value,e.id)}),t("change",e[s.keyName])})(a):y()},items:u,handleInput:e=>{"AC_FS"!==l&&"AC_FS_NOBUTTON"!==l&&(S=!0,E(e))},isDebounce:S,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},editorRef:m,isEditable:p,isReverse:g,setEditable:f,showFormDefaultContent:b,renderActionItem:t=>{if(s.groupActionState[t.id].visible)return n("div",{class:[a.e("action-item"),a.is("disabled",s.groupActionState[t.id].disabled)],onClick:a=>s.onActionClick(t,e.data,a),title:Tt(t.tooltip)},[t.showIcon&&t.sysImage&&n(i("iBizIcon"),{icon:t.sysImage},null),t.showCaption?t.caption:""])},renderEmpty:()=>n(i("iBizNoData"),{class:a.e("empty"),onClick:e=>e.stopPropagation()},null)}},render(){var e;const t="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),a=null==(e=this.c.deACMode)?void 0:e.itemLayoutPanel,{context:o,params:s}=this.c,r=n(i("el-autocomplete"),y({class:this.ns.b("input"),ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,"value-key":this.c.textName,placeholder:this.c.placeHolder,placement:"bottom",clearable:this.autoCompleteClearable,"popper-class":[this.ns.e("transfer"),this.ns.is("empty",!this.items.length)],teleported:!this.showFormDefaultContent,"fetch-suggestions":this.onSearch,onClear:this.onClear,disabled:this.disabled||this.readonly,onSelect:this.onACSelect,onInput:this.handleInput,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp,"fit-input-width":t},this.$attrs),{default:({item:e})=>{if("empty"===e.srftype)return this.renderEmpty();if("DEUIACTION"===e.detailType)return this.renderActionItem(e);if(this.c.acItemProvider){const t=i(this.c.acItemProvider.component);return l(t,{item:e,controller:this.c})}const r=[this.ns.is("ellipsis",t),this.ns.e("transfer-item")];return a?n(i("iBizControlShell"),{data:e,class:r,modelData:a,context:o,params:s,onClick:()=>{this.onACSelect(e)}},null):n("div",{class:r,title:Tt(t?e[this.c.textName]:"")},[e[this.c.textName]])},suffix:()=>{if(this.controller.model.showTrigger)return n("ion-icon",{name:"chevron-down-outline",class:[this.ns.e("suffix"),this.ns.is("reverse",this.isReverse)]},null)}}),c=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.curValue]),d=n("div",{class:this.ns.b("form-default-content")},[this.curValue?this.curValue:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&d,this.readonly?c:r])}});var fA=Object.defineProperty,wA=(e,t,a)=>(((e,t,a)=>{t in e?fA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class yA extends qi{constructor(){super(...arguments),wA(this,"keyName","srfkey"),wA(this,"textName","srfmajortext"),wA(this,"interfaceName",""),wA(this,"sort",""),wA(this,"deACMode"),wA(this,"dataItems",[]),wA(this,"acItemProvider"),wA(this,"groupActionState",new Ri),wA(this,"actionDetails",[])}async onInit(){if(super.onInit(),this.model.appDataEntityId&&(this.model.appDEDataSetId&&(this.interfaceName=this.model.appDEDataSetId),this.model.appDEACModeId&&(this.deACMode=await ga(this.model.appDEACModeId,this.model.appDataEntityId,this.context.srfappid),this.deACMode))){const{minorSortAppDEFieldId:e,minorSortDir:t}=this.deACMode;e&&t&&(this.sort="".concat(e.toLowerCase(),",").concat(t.toLowerCase())),this.deACMode.textAppDEFieldId&&(this.textName=this.deACMode.textAppDEFieldId),this.deACMode.valueAppDEFieldId&&(this.keyName=this.deACMode.valueAppDEFieldId),this.deACMode.deacmodeDataItems&&(this.dataItems=[],this.deACMode.deacmodeDataItems.forEach(e=>{"value"!==e.id&&"text"!==e.id&&this.dataItems.push(e)})),this.deACMode.itemSysPFPluginId&&(this.acItemProvider=await Vi(this.deACMode))}this.model.uiactionGroup&&(this.actionDetails=this.model.uiactionGroup.uiactionGroupDetails||[],this.actionDetails.length>0&&(this.actionDetails.forEach(e=>{const t=e.uiactionId;if(t){const a=new Di(e.id,this.context.srfappid,t);this.groupActionState.addState(e.id,a)}}),await this.groupActionState.init(),this.actionDetails.forEach(e=>{e.capLanguageRes&&e.capLanguageRes.lanResTag&&(e.caption=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption)),e.tooltipLanguageRes&&e.tooltipLanguageRes.lanResTag&&(e.tooltip=ibiz.i18n.t(e.tooltipLanguageRes.lanResTag,e.tooltip))})))}async getServiceData(e,t){const{context:a,params:n}=this.handlePublicParams(t,this.context,this.params),i={};ibiz.config.pickerdefaultsort&&Object.assign(i,{sort:ibiz.config.pickerdefaultsort}),this.sort&&!Object.is(this.sort,"")&&Object.assign(i,{sort:this.sort}),e&&Object.assign(i,{query:e}),Object.assign(i,{size:1e3});const o=Ao(n,i);if(this.interfaceName){const e=ibiz.hub.getApp(this.context.srfappid);return await e.deService.exec(this.model.appDataEntityId,this.interfaceName,a,o)}throw new Xt(this.model,ibiz.i18n.t("editor.common.entityConfigErr"))}async calcFillDataItems(e){if(this.deACMode){if(0===this.dataItems.length)return[];return await Promise.all(this.dataItems.map(t=>{const a=e[t.appDEFieldId];return t.format||t.convertToCodeItemText&&t.codeListId||t.customCode,{id:t.id,value:a}}))}return[]}async onActionClick(e,t,a){a&&a.stopPropagation();const n=e.uiactionId;await fa.execAndResolved(n,{context:this.context,params:this.params,data:[t],view:this.view,event:a},e.appId)}}var CA=Object.defineProperty,IA=(e,t,a)=>(((e,t,a)=>{t in e?CA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class xA{constructor(){IA(this,"formEditor","IBizAutoComplete"),IA(this,"gridEditor","IBizAutoComplete")}async createController(e,t){const a=new yA(e,t);return await a.init(),a}}function SA(e,t,a){const n=o([]),i=ibiz.util.file.getUploadHeaders(),s=o({...i}),l=o(""),d={count:0,cacheFiles:[]},u=new Map;c(()=>e.value,e=>{n.value=e?JSON.parse(e):[]},{immediate:!0});const h=(e,t)=>{const n={...a.editorParams,enableNoAccess:a.enableNoAccess};n.exportparams&&(n.exportParams=JSON.parse(n.exportparams)),n.globaldownloadprifix?n.globalDownloadPrifix="true"===n.globaldownloadprifix:n.globalDownloadPrifix=ibiz.config.common.globalDownloadPrifix,t&&t.folder&&(n.osscat=t.folder);return ibiz.util.file.calcFileUpDownUrl(a.context,a.params,e,n).downloadUrl};c(()=>e.data,e=>{if(e){const t={...a.editorParams,enableNoAccess:a.enableNoAccess};t.uploadparams&&(t.uploadParams=JSON.parse(t.uploadparams));const n=ibiz.util.file.calcFileUpDownUrl(a.context,a.params,e,t);l.value=n.uploadUrl}},{immediate:!0,deep:!0});const p=e=>{const t=u.get(e.id);t?e.base64=t:(async e=>{try{const t=await fetch(e);if(!t.ok)throw new Error("Failed to fetch SVG: ".concat(t.status));const a=await t.blob(),n=new FileReader;return new Promise((e,t)=>{n.onloadend=()=>{const t=n.result;if(t){const a=t.replace("data:application/octet-stream;base64","data:image/svg+xml;base64");e(a)}},n.onerror=t,n.readAsDataURL(a)})}catch(e){throw ibiz.log.error(null==e?void 0:e.message),e}})(e.url).then(t=>{e.base64=t})};c(n,t=>{(null==t?void 0:t.length)&&t.forEach(t=>{const n=h(e.data,t);t.url=t.url||n.replace("%fileId%",t.id),ibiz.config.common.enableDownloadTicket&&!a.enableNoAccess?ibiz.util.file.getDownloadTicket(a.context,a.params,e.data,{fileId:t.id},a.downloadTicketParams).then(e=>{e&&e.ticket&&(t.url=n.replace("%fileId%",e.ticket),"svg"===t.name.split(".").pop()&&p(t))}):"svg"===t.name.split(".").pop()&&p(t)})},{immediate:!0});const m=()=>{const e=[...n.value,...d.cacheFiles],i=e.length>0?JSON.stringify(e.map(e=>({name:e.name,id:e.id,folder:e.folder,...a.transformInfoMap(e,a.infoMap,!0)}))):null;d.cacheFiles=[],t(i)},v=r(()=>a.multiple?9999:1);return{uploadUrl:l,headers:s,files:n,limit:v,onDownload:t=>{const n=h(e.data,t),i=t.url||n.replace("%fileId%",t.id),o={...a.editorParams,enableNoAccess:a.enableNoAccess};o.exportparams&&(o.exportParams=JSON.parse(o.exportparams)),o.globaldownloadprifix?o.globalDownloadPrifix="true"===o.globaldownloadprifix:o.globalDownloadPrifix=ibiz.config.common.globalDownloadPrifix,ibiz.util.file.fileDownload(i,t.name,{context:a.context,params:a.params,data:e.data,file:{fileId:t.id,...t},extraParams:o,downloadTicketParams:a.downloadTicketParams},void 0,a.enableNoAccess)},onError:(...e)=>{const t=e[0];throw d.count-=1,new na({response:{data:JSON.parse(t.message),status:t.status}})},onRemove:t=>{if(e.disabled)return;const a=n.value.findIndex(e=>e.id===t.id);-1!==a&&n.value.splice(a,1),m()},onSuccess:e=>{if(e){if(ibiz.config.common.enableDownloadTicket&&!a.enableNoAccess&&e.ticket&&ibiz.util.file.setDownloadTicket(e.id,e.ticket),d.cacheFiles.push({name:e.filename,id:e.fileid,folder:e.folder,...a.transformInfoMap(e,a.infoMap)}),"svg"===e.name.split(".").pop()){const t=u.get(e.name);t&&(u.set(e.fileid,t),u.delete(e.name))}d.count-=1,0===d.count&&m()}},beforeUpload:e=>{if("svg"===e.name.split(".").pop()){const t=URL.createObjectURL(e);u.set(e.name,t)}const t=e.size/1024/1024;return a.size&&t>a.size?(ibiz.message.error("".concat(ibiz.i18n.t("editor.upload.fileSizeErr")," ").concat(a.size,"MB!")),!1):(d.count+=1,!0)}}}const EA=a({name:"IBizFileUpload",props:nt(),emits:Ve(),setup(e,{emit:t}){const a=B("file-upload"),n=e.controller,{useInFocusAndBlur:i,useInValueChange:o}=We(e,t),{uploadUrl:s,headers:l,files:c,limit:d,onDownload:u,onError:h,onRemove:p,onSuccess:m,beforeUpload:v}=SA(e,e=>{t("change",e),o()},n),g=r(()=>{var e;return 1===d.value&&1===(null==(e=c.value)?void 0:e.length)}),b=r(()=>!!n.parent.model.columnType),f=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),{componentRef:w}=je(()=>t("focus"),()=>i());return{ns:a,c:n,uploadUrl:s,headers:l,files:c,limit:d,noUploadIcon:g,onDownload:u,onError:h,onRemove:p,onSuccess:m,beforeUpload:v,isGridEditor:b,componentRef:w,showFormDefaultContent:f}},render(){let e;return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)],ref:"componentRef"},[n(i("el-upload"),y({class:[this.ns.b("icon"),this.ns.is("not-show",this.noUploadIcon)],"file-list":this.files,action:this.uploadUrl,headers:this.headers,disabled:this.disabled||this.readonly,multiple:this.c.multiple,limit:this.limit,drag:!!this.c.isDrag,accept:this.c.accept,"before-upload":this.beforeUpload,onSuccess:this.onSuccess,onError:this.onError,onRemove:this.onRemove,onPreview:this.onDownload},this.$attrs),{default:()=>{return[this.noUploadIcon?null:n(i("el-button"),{class:[this.ns.b("button")],size:this.isGridEditor?"small":"default"},(t=e=ibiz.i18n.t("editor.upload.uploadFiles"),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))];var t}})])}}),DA=a({name:"IBizImageUpload",props:nt(),emits:Ve(),setup(e,{emit:t}){const a=B("image-upload"),n=e.controller,{useInFocusAndBlur:i,useInValueChange:s}=We(e,t),{uploadUrl:l,headers:c,files:d,limit:u,onDownload:h,onError:p,onRemove:m,onSuccess:v,beforeUpload:g}=SA(e,e=>{t("change",e),s()},n),b=o([]),f=o(0),w=o(!1),y=r(()=>1===u.value&&1===d.value.length),C=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),{componentRef:I}=je(()=>t("focus"),()=>i());return{ns:a,c:n,files:d,limit:u,headers:c,uploadUrl:l,dialogImageUrl:b,dialogVisible:w,noUploadIcon:y,beforeUpload:g,onSuccess:v,onError:p,onRemove:m,onDownload:h,onDialogVisibleChange:e=>{w.value=e},onPreview:e=>{b.value=[],d.value.forEach(e=>{e.base64?b.value.push(e.base64):e.url&&b.value.push(e.url)}),f.value=d.value.findIndex(t=>t.url===e.url),w.value=!0},componentRef:I,showFormDefaultContent:C,dialogImageUrlIndex:f}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.readonly&&this.c.autoPreview&&this.ns.m("autosize"),this.ns.is("show-default",this.showFormDefaultContent)],ref:"componentRef"},[n("div",{class:this.ns.e("image-upload-list")},[this.files.map(e=>n("div",{key:e.id,class:this.ns.e("list-item")},[n("img",{src:e.base64?e.base64:e.url},null),n("div",{class:this.ns.e("list-item-cover")},[n("ion-icon",{class:this.ns.e("preview-icon"),onClick:()=>this.onPreview(e),name:"search"},null),n("ion-icon",{class:this.ns.e("download-icon"),onClick:()=>this.onDownload(e),name:"download"},null),n("ion-icon",{class:this.ns.e("remove-icon"),onClick:()=>this.onRemove(e),name:"remove"},null)])]))]),n(i("el-upload"),y({ref:"imageUpload",class:[this.ns.b("icon"),this.ns.is("not-show",this.noUploadIcon)],"file-list":this.files,action:this.uploadUrl,headers:this.headers,disabled:this.disabled,multiple:this.c.multiple,limit:this.limit,"show-file-list":!1,accept:this.c.accept,"list-type":"picture-card","before-upload":this.beforeUpload,onSuccess:this.onSuccess,onError:this.onError,onRemove:this.onRemove,onPreview:this.onDownload},this.$attrs),{default:()=>[n("ion-icon",{name:"add-outline",class:this.ns.e("image-upload-add")},null)]}),this.dialogVisible?n(i("el-image-viewer"),y({onClose:()=>this.onDialogVisibleChange(!1),"url-list":this.dialogImageUrl,"hide-on-click-modal":!0,"close-on-press-escape":!0,teleported:!0,"z-index":9999,"initial-index":this.dialogImageUrlIndex},this.$attrs),null):null])}}),PA=a({name:"IBizImagePreview",props:nt(),emits:Ve(),setup(e){var t,a;const n=B("image-preview"),i=e.controller;let o="false"!==(null==(t=i.editorParams)?void 0:t.STOPPROPAGATION);(null==(a=i.editorParams)?void 0:a.stoppropagation)&&(o="false"!==i.editorParams.stoppropagation);return{ns:n,c:i,showFormDefaultContent:r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),previewList:r(()=>o?[e.value]:[]),onClick:e=>{o&&e.stopPropagation()}}},render(){return n("div",{class:[this.ns.b(),this.ns.is("show-default",this.showFormDefaultContent)],onClick:this.onClick},[n(i("el-image"),y({fit:"contain",src:this.value,"preview-src-list":this.previewList},this.$attrs),null)])}}),kA=a({name:"IBizImageCropping",props:nt(),emits:Ve(),setup(e,{emit:t}){var a,n,i,s;const l=B("image-cropping-upload"),c=e.controller,{useInFocusAndBlur:d,useInValueChange:u}=We(e,t),{uploadUrl:h,headers:p,files:m,limit:v,onDownload:b,onError:f,onRemove:w,onSuccess:y,beforeUpload:C}=SA(e,e=>{t("change",e),u()},c),I=o([]),x=o(0),S=o(!1),E=o(!1),D=o(),P={};(null==(a=c.editorParams)?void 0:a.cropWidth)&&Object.assign(P,{cropareaWidth:Number(c.editorParams.cropWidth)}),(null==(n=c.editorParams)?void 0:n.cropwidth)&&Object.assign(P,{cropareaWidth:Number(c.editorParams.cropwidth)}),(null==(i=c.editorParams)?void 0:i.cropHeight)&&Object.assign(P,{cropareaHeight:Number(c.editorParams.cropHeight)}),(null==(s=c.editorParams)?void 0:s.cropheight)&&Object.assign(P,{cropareaHeight:Number(c.editorParams.cropheight)});const k=o(),z=o(!1),T=r(()=>1===v.value&&1===m.value.length),A=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),{componentRef:O}=je(()=>t("focus"),()=>d());return{ns:l,c:c,files:m,limit:v,headers:p,uploadUrl:h,dialogImageUrl:I,dialogVisible:S,noUploadIcon:T,beforeUpload:C,onSuccess:y,onError:f,onRemove:w,onDownload:b,onDialogVisibleChange:e=>{S.value=e},onPreview:e=>{I.value=[],m.value.forEach(e=>{e.base64?I.value.push(e.base64):e.url&&I.value.push(e.url)}),x.value=m.value.findIndex(t=>t.url===e.url),S.value=!0},componentRef:O,showFormDefaultContent:A,dialogImageUrlIndex:x,cropVisible:z,tempFileList:k,imageUpload:D,cropRect:P,onChange:e=>{"ready"!==e.status||E.value||(k.value=e,E.value=!0,z.value=!0)},cropDialogClose:()=>{k.value&&(ibiz.message.info(ibiz.i18n.t("editor.upload.cancelUpload")),D.value.handleRemove(k.value)),E.value=!1},cropChange:e=>{if(!e)return E.value=!1,z.value=!1,void ibiz.message.info(ibiz.i18n.t("editor.upload.cancelUpload"));const t=(e=>{const t=atob(e.split(",")[1]),a=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),i=new Uint8Array(n);for(let e=0;e<t.length;e++)i[e]=t.charCodeAt(e);return new Blob([n],{type:a})})(e),a=new File([t],"cropimg.png",{type:t.type});a&&g(()=>{D.value.handleRemove(k.value),D.value.handleStart(a),k.value=void 0,D.value.submit(),E.value=!1,z.value=!1})}}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.readonly&&this.c.autoPreview&&this.ns.m("autosize"),this.ns.is("show-default",this.showFormDefaultContent)],ref:"componentRef"},[n("div",{class:this.ns.e("image-upload-list")},[this.files.map(e=>n("div",{key:e.id,class:this.ns.e("list-item")},[n("img",{src:e.base64?e.base64:e.url},null),n("div",{class:this.ns.e("list-item-cover")},[n("ion-icon",{class:this.ns.e("preview-icon"),onClick:()=>this.onPreview(e),name:"search"},null),n("ion-icon",{class:this.ns.e("download-icon"),onClick:()=>this.onDownload(e),name:"download"},null),n("ion-icon",{class:this.ns.e("remove-icon"),onClick:()=>this.onRemove(e),name:"remove"},null)])]))]),n(i("el-upload"),y({ref:"imageUpload",class:[this.ns.b("icon"),this.ns.is("not-show",this.noUploadIcon)],"file-list":this.files,action:this.uploadUrl,headers:this.headers,disabled:this.disabled,multiple:!1,limit:this.limit,"show-file-list":!1,accept:this.c.accept,"list-type":"picture-card","auto-upload":!1,onChange:this.onChange,"before-upload":this.beforeUpload,onSuccess:this.onSuccess,onError:this.onError,onRemove:this.onRemove,onPreview:this.onDownload},this.$attrs),{default:()=>[n("ion-icon",{name:"add-outline",class:this.ns.e("image-upload-add")},null)]}),n(i("el-dialog"),{modelValue:this.cropVisible,"onUpdate:modelValue":e=>this.cropVisible=e,title:ibiz.i18n.t("editor.upload.cropImg"),class:this.ns.e("upload-dialog"),onClosed:this.cropDialogClose,"destroy-on-close":!0,width:640},{default:()=>n(i("iBizCropping"),y({img:this.tempFileList,onChange:this.cropChange},this.cropRect),null)}),this.dialogVisible?n(i("el-image-viewer"),y({onClose:()=>this.onDialogVisibleChange(!1),"url-list":this.dialogImageUrl,"hide-on-click-modal":!0,"close-on-press-escape":!0,teleported:!0,"z-index":9999,"initial-index":this.dialogImageUrlIndex},this.$attrs),null):null])}});var zA=Object.defineProperty,TA=(e,t,a)=>(((e,t,a)=>{t in e?zA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class AA extends qi{constructor(){super(...arguments),TA(this,"isDrag",!1),TA(this,"multiple",!0),TA(this,"accept",""),TA(this,"size",0),TA(this,"uploadParams"),TA(this,"exportParams"),TA(this,"infoMap",""),TA(this,"autoPreview",!1),TA(this,"enableNoAccess",!1),TA(this,"transformInfoMap",(e={},t="",a=!1)=>{const n={};return t.split(";").forEach(t=>{let[i,o]=t.split(":");a&&(i=o),i&&o&&Object.assign(n,{[o]:e[i]})}),n})}async onInit(){var e;if(await super.onInit(),this.infoMap=ibiz.config.uploadEditor.infoMap,(null==(e=this.model.editorType)?void 0:e.includes("PICTURE"))&&(this.accept="image/*"),["FILEUPLOADER_ONE","PICTURE_ONE","PICTURE_ONE_RAW","MOBSINGLEFILEUPLOAD","MOBPICTURE_RAW"].includes(this.model.editorType)&&(this.multiple=!1),this.editorParams){const{isDrag:e,multiple:t,accept:a,size:n,uploadParams:i,exportParams:o,autoPreview:s,isdrag:l,uploadparams:r,exportparams:c,autopreview:d,infomap:u,enablenoaccess:h}=this.editorParams;if(e&&(this.isDrag=Boolean(e)),l&&(this.isDrag=Boolean(l)),s&&(this.autoPreview=s),d&&(this.autoPreview=d),t&&(this.multiple=Boolean(t)),a&&(this.accept=a),n&&(this.size=Number(n)),u&&(this.infoMap=u),h&&(this.enableNoAccess="true"===h),i)try{this.uploadParams=JSON.parse(i)}catch(e){throw new Xt(i,ibiz.i18n.t("editor.upload.uploadJsonFormatErr"))}if(r)try{this.uploadParams=JSON.parse(r)}catch(e){throw new Xt(r,ibiz.i18n.t("editor.upload.uploadJsonFormatErr"))}if(o)try{this.exportParams=JSON.parse(o)}catch(e){throw new Xt(o,ibiz.i18n.t("editor.upload.exportJsonFormatErr"))}if(c)try{this.exportParams=JSON.parse(c)}catch(e){throw new Xt(c,ibiz.i18n.t("editor.upload.exportJsonFormatErr"))}}}}var OA=Object.defineProperty,MA=(e,t,a)=>(((e,t,a)=>{t in e?OA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class NA{constructor(e){MA(this,"formEditor","IBizFileUpload"),MA(this,"gridEditor","IBizFileUpload");let t="IBizFileUpload";switch(e){case"PICTURE":case"PICTURE_ONE":case"MOBPICTURE":case"MOBPICTURELIST":t="IBizImageUpload";break;case"PICTURE_CROPPING":t="IBizImageCropping";break;case"PICTURE_ONE_RAW":case"MOBPICTURE_RAW":t="IBizImagePreview"}this.formEditor=t,this.gridEditor=t}async createController(e,t){const a=new AA(e,t);return await a.init(),a}}const BA=a({name:"IBizPicker",props:it(),emits:Ve(),setup(e,{emit:t}){var a;const s=B("picker"),l=e.controller,u=o(""),h=o([]),p=o(!0),v=o(!1),g=o(),b=o(!1),f=o(!1),w=(null==(a=l.model.editorParams)?void 0:a.actionpostion)||"bottom",y=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),C=()=>{const{value:t}=e;"OBJECT"===l.model.valueType?u.value=t&&l.objectNameField?t[l.objectNameField]:"":u.value=t||"";const a=e.data[l.valueItem];-1===h.value.findIndex(e=>Object.is(e[l.keyName],a))&&(h.value=[],t&&!Oo(a)&&h.value.push({[l.textName]:t,[l.keyName]:a}))};c(()=>e.value,()=>{C()},{immediate:!0});const I=e=>{e?v.value=e:setTimeout(()=>{v.value=e},100)},x=async e=>{const a=await l.calcFillDataItems(e);a.length&&a.forEach(e=>{t("change",e.value,e.id)}),Object.assign(e,{[l.keyName]:e[l.keyName]?e[l.keyName]:e.srfkey,[l.textName]:e[l.textName]?e[l.textName]:e.srfmajortext}),l.valueItem&&t("change",e[l.keyName],l.valueItem),"OBJECT"===l.model.valueType?t("change",l.handleObjectParams(e)):t("change",e[l.textName]),I(!1)};let S,E="";const D=e=>{const t=h.value.length?[...h.value]:[{srftype:"empty"}];"top"===w?t.unshift(...l.actionDetails):t.push(...l.actionDetails),l.isShowLoadMore&&t.push({srftype:"loadmore"}),e(t)},P=async(t,a)=>{if(l.model.appDataEntityId){let n="";t!==e.value&&(n=t.trim());const i=await l.getServiceData(n,e.data);i&&(h.value=i.data,b.value=!0,a&&a instanceof Function&&(E=n,S=a,D(a)))}},k=async()=>{if(l.total>h.value.length&&l.model.appDataEntityId){const t=await l.getServiceData(E,e.data,{isLoadMore:!0});t&&(h.value=[...h.value,...t.data],S&&D(S))}},z=(l.linkView?1:0)+(l.pickupView?1:0);c(g,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const T=r(()=>ot(u.value));c(T,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});const A=o(),O=o(!1),M=e=>{var t,a,n,i,o;const s=null==(t=A.value)?void 0:t.contains(e.target),l=null==(n=null==(a=g.value)?void 0:a.inputRef)?void 0:n.input.contains(e.target);s||l||!O.value||(null==(o=null==(i=g.value)?void 0:i.popperRef)||o.onClose(),O.value=!1)},N=()=>{var e,t;return null==(t=null==(e=g.value)?void 0:e.popperRef)?void 0:t.popperRef.contentRef.querySelector(".el-scrollbar__wrap")},L=_o(async()=>{const e=N();if(!e)return;const{scrollTop:t,scrollHeight:a,clientHeight:n}=e;a-t-n<=20&&await k()},300);d(()=>{c(()=>e.data[l.valueItem],async(a,n)=>{if(a!==n){b.value||!Po(e.value)||Po(a)||await P("");const n=h.value.find(e=>Object.is(e[l.keyName],a));n&&(u.value=n[l.textName],Po(e.value)&&!Po(a)&&t("change",u.value,l.model.id,!0)),null===a&&t("change",null,l.model.id,!0)}(()=>{var e;switch(l.pagingMode){case 3:document.addEventListener("mouseup",M);break;case 2:null==(e=N())||e.addEventListener("scroll",L)}})()},{immediate:!0})}),m(()=>{var e;switch(l.pagingMode){case 3:document.removeEventListener("mouseup",M);break;case 2:null==(e=N())||e.removeEventListener("scroll",L)}});return{ns:s,c:l,items:h,curValue:u,valueText:T,editorRef:g,closeCircle:z,isEditable:v,isReverse:f,showFormDefaultContent:y,onBlur:e=>{f.value=!1,C(),t("blur",e),I(!1)},onFocus:e=>{f.value=!0,l.noAC||(g.value.loading=!0),t("focus",e),I(!0)},onClear:()=>{const e=l.dataItems;(null==e?void 0:e.length)&&e.forEach(e=>{t("change",null,e.id)}),l.valueItem&&t("change",null,l.valueItem),t("change",null)},onSearch:P,onACSelect:async e=>{if(p.value=!0,I(!1),"empty"===e.srftype||"DEUIACTION"===e.detailType||"loadmore"===e.srftype)return C();await x(e)},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},setEditable:I,renderEmpty:()=>n(i("iBizNoData"),{class:s.e("empty"),onClick:e=>e.stopPropagation()},null),renderLoadMore:()=>n("div",{ref:A,class:s.e("loadmore"),onClick:e=>(async e=>{var t,a;e.preventDefault(),e.stopPropagation(),k(),null==(a=null==(t=g.value)?void 0:t.popperRef)||a.onOpen(),O.value=!0})(e)},[ibiz.i18n.t("editor.common.loadMore")]),openLinkView:async t=>{t.stopPropagation();const a=await l.openLinkView(e.data);a&&a.ok&&a.data&&a.data.length>0&&await x(a.data[0])},openPickUpView:async t=>{t.stopPropagation();const a=await l.openPickUpView(e.data,JSON.stringify((()=>{const t=[];if(u.value){const a={srfkey:e.data[l.valueItem],srfmajortext:u.value,..."OBJECT"===l.model.valueType&&e.value&&l.objectValueField?e.value[l.objectValueField]:{}};l.deACMode&&l.dataItems.length&&l.dataItems.forEach(t=>Object.assign(a,{[t.appDEFieldId]:e.data[t.id]})),t.push(a)}return t})()));a&&a[0]&&await x(a[0])},renderActionItem:t=>{if(l.groupActionState[t.id].visible)return n("div",{title:Tt(t.tooltip),class:[s.e("action-item"),s.is("disabled",l.groupActionState[t.id].disabled)],onClick:a=>{l.groupActionState[t.id].disabled||l.onActionClick(t,e.data,a)}},[t.showIcon&&t.sysImage&&n(i("iBizIcon"),{class:s.em("action-item","icon"),icon:t.sysImage},null),n("span",{class:s.em("action-item","caption")},[t.showCaption?t.caption:""])])}}},render(){const e="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),t=t=>{var a;const o=null==(a=this.c.deACMode)?void 0:a.itemLayoutPanel,{context:s,params:r}=this.c;let c=(t[this.c.textName]||t.srfmajortext)===this.curValue;this.c.valueItem&&(c=(t[this.c.keyName]||t.srfkey)===this.data[this.c.valueItem]);const d=[this.ns.is("active",c),this.ns.e("transfer-item")];if(this.c.acItemProvider){const e=i(this.c.acItemProvider.component);return l(e,{item:t,controller:this.c,class:d,onClick:()=>{this.onACSelect(t)}})}return o?n(i("iBizControlShell"),{data:t,class:d,modelData:o,context:s,params:r,onClick:()=>{this.onACSelect(t)}},null):n("div",{class:[this.ns.is("ellipsis",e),...d],title:Tt(e?t[this.c.textName]:""),onClick:()=>{this.onACSelect(t)}},[t[this.c.textName]])},a=this.c.noAC?n(i("el-input"),y({ref:"editorRef",class:[this.ns.b("input")],modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,clearable:!0,placeholder:this.c.placeHolder,onClear:this.onClear,disabled:this.disabled,onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp},this.$attrs),{suffix:()=>this.$slots.append?this.$slots.append({}):this.c.noButton?void 0:[this.c.model.pickupAppViewId?n("ion-icon",{onClick:this.openPickUpView,name:"search"},null):null,this.c.model.linkAppViewId&&this.curValue?n("ion-icon",{onClick:this.openLinkView,name:"link-arrow"},null):null]}):n("div",{class:[this.ns.e("autocomplete"),this.ns.m(this.closeCircle.toString())]},[n(i("el-autocomplete"),y({ref:"editorRef",class:[this.ns.b("input")],modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,"value-key":this.c.textName,placeholder:this.c.placeHolder,clearable:!0,"popper-class":[this.ns.e("transfer"),this.ns.bm("popper","".concat(this.c.model.id)),this.ns.is("empty",!this.items.length)],"fetch-suggestions":this.onSearch,onClear:this.onClear,onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp,onSelect:this.onACSelect,disabled:this.disabled,"fit-input-width":e},this.$attrs),{default:({item:e})=>this.$slots.append?this.$slots.append({}):"empty"===e.srftype?this.renderEmpty():"loadmore"===e.srftype?this.renderLoadMore():"DEUIACTION"===e.detailType?this.renderActionItem(e):t(e),suffix:()=>{if(!this.c.noButton)return[this.c.model.pickupAppViewId?n("ion-icon",{onClick:this.openPickUpView,name:"search"},null):null,this.c.model.linkAppViewId&&this.curValue?n("ion-icon",{onClick:this.openLinkView,name:"link-arrow"},null):null,this.c.model.showTrigger&&!this.c.model.pickupAppViewId?n("ion-icon",{name:"chevron-down-outline",class:[this.ns.e("suffix"),this.ns.is("reverse",this.isReverse)]},null):null]}})]),o=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),s=n("div",{class:this.ns.b("form-default-content")},[this.curValue?this.valueText:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&s,this.readonly?o:a])}});const LA=a({name:"IBizMPicker",props:it(),emits:Ve(),setup(e,{emit:t}){var a;const s=B("mpicker"),u=e.controller,h=o([]),p=o([]),m=o([]),v=o(!1),g=o(!1),b=o(!1),f=o(),w=(null==(a=u.model.editorParams)?void 0:a.actionpostion)||"bottom",y="ellipsis"===(u.editorParams.overflowMode||u.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),C=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),I=()=>{if(h.value=[],m.value=[],e.value){if("OBJECTS"===u.model.valueType)e.value.forEach(e=>{const t=Ko(e);Object.assign(t,{[u.keyName]:e[u.objectIdField],[u.textName]:e[u.objectNameField]}),u.objectValueField&&(Object.assign(t,{...e[u.objectValueField]}),delete t[u.objectValueField]),t[u.keyName]&&m.value.push(t)});else if(u.objectIdField&&u.model.valueSeparator){e.value.split(u.model.valueSeparator).forEach(e=>{m.value.push({[u.keyName]:e})})}else try{m.value=JSON.parse(e.value)}catch(t){ibiz.log.error("SIMPLE类型地址栏值格式".concat(e.value,"不符合JSON字符串要求"))}m.value.forEach(e=>{h.value.push(e[u.keyName]);const t=p.value.findIndex(t=>Object.is(t[u.keyName],e[u.keyName]));t<0&&p.value.push({[u.keyName]:e[u.keyName],[u.textName]:e[u.textName]})})}};c(()=>e.value,()=>{I()},{immediate:!0,deep:!0}),c(f,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const x=e=>{e?b.value=e:setTimeout(()=>{b.value=e},100)},S=async t=>{if(u.model.appDataEntityId){g.value=!0;try{const a=t.trim(),n=await u.getServiceData(a,e.data);g.value=!1,n&&(p.value=n.data)}catch(e){g.value=!1}}},E=r(()=>m.value.map(e=>e[u.textName]).join(","));c(E,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0});d(()=>{u.objectNameField&&S("")});const D=()=>u.actionDetails.map(t=>{if(u.groupActionState[t.id].visible)return n(i("el-option"),{key:t.id,label:t.caption,value:"DEUIACTION-".concat(t.id),disabled:u.groupActionState[t.id].disabled,title:Tt(y?t.tooltip:"")},{default:()=>n("div",{class:[s.e("action-item"),s.is("disabled",u.groupActionState[t.id].disabled)],onClick:a=>{u.groupActionState[t.id].disabled||u.onActionClick(t,e.data,a)}},[t.showIcon&&t.sysImage&&n(i("iBizIcon"),{class:s.em("action-item","icon"),icon:t.sysImage},null),n("span",{class:s.em("action-item","caption")},[t.showCaption?t.caption:""])])})}),P=()=>p.value.length?p.value.map(e=>n(i("el-option"),{key:e[u.keyName],value:e[u.keyName],label:e[u.textName],title:Tt(y?e[u.textName]:"")},{default:()=>{var t;if(u.acItemProvider){const t=i(u.acItemProvider.component);return l(t,{item:e,controller:u})}const a=null==(t=u.deACMode)?void 0:t.itemLayoutPanel;return a?n(i("iBizControlShell"),{data:e,modelData:a,context:u.context,params:u.params},null):n("span",null,[null!=e[u.textName]?e[u.textName]:""])}})):[n(i("el-option"),{value:"empty"},{default:()=>[n(i("iBizNoData"),{class:s.e("empty"),onClick:e=>e.stopPropagation()},null)]})];return{c:u,ns:s,items:p,loading:g,curValue:h,valueText:E,editorRef:f,isEllipsis:y,isEditable:b,selectItems:m,showFormDefaultContent:C,onBlur:e=>{t("blur",e),x(!1)},onFocus:e=>{t("focus",e),x(!0)},onSearch:S,onSelect:async e=>{var a;if(x(!1),e.includes("empty")||e.some(e=>e.includes("DEUIACTION")))return null==(a=f.value)||a.blur(),I();const n=[];let i=null;const o=e.map(e=>{let t=p.value.findIndex(t=>Object.is(t[u.keyName],e)),a={};return t>=0?a=p.value[t]:(t=m.value.findIndex(t=>Object.is(t[u.keyName],e)),t>=0&&(a=m.value[t])),a}),s=o.map(async e=>{const t=await u.calcFillDataItems(e),a={};return t.forEach(e=>{Object.assign(a,{[e.id]:e.value})}),a}),l=await Promise.all(s);o.forEach((e,t)=>{const a=l[t];"OBJECTS"===u.model.valueType?n.push({...u.handleObjectParams(e),...a}):u.objectIdField?n.push(e[u.keyName]):n.push({[u.keyName]:e[u.keyName],[u.textName]:e[u.textName],...a})}),n.length>0&&(i="OBJECTS"===u.model.valueType?n:u.objectIdField?n.join(u.model.valueSeparator):JSON.stringify(n)),t("change",i)},onRemove:e=>{const a=m.value.findIndex(t=>Object.is(t[u.keyName],e));if(a>=0){m.value.splice(a,1);const e=[];let n=null;m.value.forEach(t=>{"OBJECTS"===u.model.valueType?e.push(u.handleObjectParams(t)):u.objectIdField?e.push(t[u.keyName]):e.push({[u.keyName]:t[u.keyName],[u.textName]:t[u.textName]})}),e.length>0&&(n="OBJECTS"===u.model.valueType?e:u.objectIdField?e.join(u.model.valueSeparator):JSON.stringify(e)),t("change",n)}},onOpenChange:e=>{v.value=e,v.value&&(p.value=[],S(""))},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},setEditable:x,openPickUpView:async()=>{let a;if(m.value.length){const e=JSON.parse(JSON.stringify(m.value));e.forEach((t,a)=>{e[a].srfkey=t[u.keyName],e[a].srfmajortext=t[u.textName]}),a=JSON.stringify(e)}const n=await u.openPickUpView(e.data,a);n&&(async e=>{const a=[];if(e&&Array.isArray(e)){const t=e.map(async e=>{const t=e;e.srfnodeid&&Object.assign(t,e._deData);const a=await u.calcFillDataItems(t),n={};return a.forEach(e=>{Object.assign(n,{[e.id]:e.value})}),n}),n=await Promise.all(t);e.forEach((e,t)=>{Object.assign(e,{[u.keyName]:e[u.keyName]?e[u.keyName]:e.srfkey,[u.textName]:e[u.textName]?e[u.textName]:e.srfmajortext});const i=n[t];"OBJECTS"===u.model.valueType?a.push({...u.handleObjectParams(e),...i}):u.objectIdField?a.push(e[u.keyName]):a.push({[u.keyName]:e[u.keyName],[u.textName]:e[u.textName],...i}),p.value.findIndex(t=>Object.is(t[u.keyName],e[u.keyName]))<0&&p.value.push(e)})}let n=null;a.length>0&&(n="OBJECTS"===u.model.valueType?a:u.objectIdField?a.join(u.model.valueSeparator):JSON.stringify(a)),t("change",n),x(!1)})(n)},renderListContent:()=>"top"===w?[...D(),...P()]:[...P(),...D()]}},render(){let e;const t=[!this.readonly&&n(i("el-select"),y({ref:"editorRef",class:[this.ns.b("select")],modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,filterable:!0,remote:!0,multiple:!0,"popper-class":[this.ns.e("transfer"),this.ns.is("empty",!this.items.length)],teleported:!this.showFormDefaultContent,loading:this.loading,placeholder:this.c.placeHolder?this.c.placeHolder:" ","remote-method":this.onSearch,onVisibleChange:this.onOpenChange,onChange:this.onSelect,onRemoveTag:this.onRemove,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp,"fit-input-width":this.isEllipsis,"remote-show-suffix":this.c.model.showTrigger},this.$attrs),(a=e=this.renderListContent(),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?e:{default:()=>[e]})),!this.readonly&&n("div",{class:this.ns.e("buns-position")},[this.c.model.pickupAppViewId?n("div",{class:this.ns.e("btns"),onClick:this.openPickUpView},[n("ion-icon",{name:"search"},null)]):null])];var a;const o=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),l=n("div",{class:this.ns.b("form-default-content")},[this.curValue.length>0?this.selectItems.map(e=>n("span",{class:this.ns.b("content-item")},[e[this.c.textName]])):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&l,this.readonly?o:t])}}),RA=a({name:"IBizPickerDropDown",props:it(),emits:Ve(),setup(e,{emit:t}){const a=B("picker-dropdown"),s=e.controller,l=o(""),u=o([]),h=o(!1),p=o(""),m=o(!1),v=o(),b=o(!1);let f=null;const w=o(!1),y=o(),C=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),I=()=>{const{value:t}=e;"OBJECT"===s.model.valueType?l.value=t&&s.objectNameField?t[s.objectNameField]:"":l.value=t||"";const a=e.data[s.valueItem];p.value=a||l.value;-1===u.value.findIndex(e=>Object.is(e[s.keyName],a))&&(u.value=[],Po(e.value)||Po(a)||u.value.push({[s.textName]:e.value,[s.keyName]:a}))};c(()=>e.value,()=>{I()},{immediate:!0}),c(v,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const x=async t=>{if(h.value)if(s.model.appDataEntityId&&!1===b.value){b.value=!0;try{let a="";t!==e.value&&(a=t.trim());const n=await s.getServiceData(a,e.data);n&&(u.value=n.data)}finally{if(b.value=!1,w.value=!0,null!=f){const e=f;f=null,await x(e)}}}else f=t},S=e=>{e?m.value=e:setTimeout(()=>{m.value=e},100)},E=r(()=>ot(l.value)),{popoverid:D,setPopoverZIndex:P}=fe();c(E,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),d(()=>{c(()=>e.data[s.valueItem],async(a,n)=>{if(a!==n){w.value||!Po(e.value)||Po(a)||(h.value=!0,await x(""),h.value=!1);const n=u.value.find(e=>Object.is(e[s.keyName],a));n&&(l.value=n[s.textName],Po(e.value)&&!Po(a)&&t("change",l.value,s.model.id,!0)),p.value=a,null===a&&t("change",null,s.model.id,!0)}},{immediate:!0,deep:!0}),P("--".concat(a.namespace,"-picker-dropdown-transfer-zindex"))});return{ns:a,c:s,refValue:p,curValue:l,valueText:E,loading:b,items:u,onOpenChange:e=>{var t,a,n;if(e)u.value=[],x("");else{"SEARCHFORM"===(null==(n=null==(a=null==(t=s.parent)?void 0:t.form)?void 0:a.model)?void 0:n.controlType)&&g(()=>{var e;null==(e=y.value)||e.focus()})}},onClear:()=>{const e=s.dataItems;(null==e?void 0:e.length)&&e.forEach(e=>{t("change",null,e.id)}),s.valueItem&&t("change",null,s.valueItem),t("change",null)},onSelect:a=>{if(h.value=!1,S(!1),"empty"===a)return void I();const n=s.actionDetails.find(e=>e.id===a);if(n)return s.onActionClick(n,e.data),void I();const i=u.value.findIndex(e=>Object.is(e[s.keyName],a));i>=0&&(async e=>{const a=await s.calcFillDataItems(e);a.length&&a.forEach(e=>{t("change",e.value,e.id)});const n=ko(e);Object.assign(n,{[s.keyName]:n[s.keyName]?n[s.keyName]:n.srfkey,[s.textName]:n[s.textName]?n[s.textName]:n.srfmajortext}),s.valueItem&&t("change",n[s.keyName],s.valueItem),"OBJECT"===s.model.valueType?t("change",s.handleObjectParams(n)):t("change",e[s.textName]),S(!1)})(u.value[i])},onSearch:x,onFocus:e=>{h.value=!0,t("focus",e),S(!0)},onBlur:e=>{h.value=!1,t("blur",e),S(!1)},onClick:()=>{h.value=!0},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},editorRef:v,isEditable:m,setEditable:S,showFormDefaultContent:C,renderGroupAction:()=>{const t=s.actionDetails;if(t.length&&s.groupActionState.visible)return t.map(t=>(t=>{if(s.groupActionState[t.id].visible)return n(i("el-option"),{value:t.id,title:Tt(t.tooltip),disabled:s.groupActionState[t.id].disabled},{default:()=>[n("div",{class:a.e("action-item"),onClick:a=>s.onActionClick(t,e.data,a)},[t.showIcon&&t.sysImage&&n(i("iBizIcon"),{icon:t.sysImage},null),t.showCaption?t.caption:""])]})})(t))},renderEmpty:()=>{if(!u.value.length)return n(i("el-option"),{value:"empty"},{default:()=>[n(i("iBizNoData"),{class:a.e("empty"),onClick:e=>e.stopPropagation()},null)]})},popoverid:D,hiddenInputRef:y}},render(){const e="ellipsis"===(this.c.editorParams.overflowMode||this.c.editorParams.overflowmode||ibiz.config.pickerEditor.overflowMode),t=this.readonly?this.value:n(i("el-select"),y({ref:"editorRef",class:[this.ns.b("select")],modelValue:this.refValue,"onUpdate:modelValue":e=>this.refValue=e,filterable:!0,remote:!0,"remote-show-suffix":this.c.model.showTrigger,clearable:!0,"popper-class":[this.popoverid,this.ns.e("transfer"),this.ns.is("empty",!this.items.length)],loading:this.loading,placeholder:this.c.placeHolder?this.c.placeHolder:" ","remote-method":this.onSearch,onVisibleChange:this.onOpenChange,onChange:this.onSelect,onClear:this.onClear,disabled:this.disabled,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp,onClick:this.onClick,"fit-input-width":e},this.$attrs),{default:()=>[this.items.map(t=>n(i("el-option"),{title:Tt(e?t[this.c.textName]:""),value:t[this.c.keyName],key:t[this.c.keyName],label:t[this.c.textName]},{default:()=>{var e;if(this.c.acItemProvider){const e=i(this.c.acItemProvider.component);return l(e,{item:t,controller:this.c})}const a=null==(e=this.c.deACMode)?void 0:e.itemLayoutPanel;return a?n(i("iBizControlShell"),{data:t,modelData:a,context:this.c.context,params:this.c.params},null):n("span",null,[null!=t[this.c.textName]?t[this.c.textName]:""])}})),this.renderEmpty(),this.renderGroupAction()]}),a=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),o=n("div",{class:this.ns.b("form-default-content")},[this.curValue?this.valueText:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]),s=n("input",{ref:"hiddenInputRef",type:"text",class:this.ns.e("hidden-input"),readonly:!0,onKeyup:this.handleKeyUp},null);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&o,this.readonly?a:t,this.readonly?null:s])}}),_A=a({name:"IBizPickerLink",props:it(),emits:Ve(),setup(e,{emit:t}){const a=B("picker-link"),n=e.controller,i=o(""),s=o([]),l=o(!1),{useInFocusAndBlur:u,useInValueChange:h}=We(e,t),p=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,e=>{"OBJECT"===n.model.valueType?i.value=e&&n.objectNameField?e[n.objectNameField]:"":i.value=e||""},{immediate:!0}),d(()=>{c(()=>e.data[n.valueItem],async(a,o)=>{if(a!==o){l.value||!Po(e.value)||Po(a)||await(async t=>{if(n.model.appDataEntityId){let a="";t!==e.value&&(a=t.trim());const i=await n.getServiceData(a,e.data);i&&(l.value=!0,s.value=i.data)}})("");const o=s.value.find(e=>Object.is(e[n.keyName],a));o&&(i.value=o[n.textName],Po(e.value)&&!Po(a)&&t("change",i.value,n.model.id,!0)),null===a&&t("change",null,n.model.id,!0)}},{immediate:!0})});const{componentRef:m}=je(()=>t("focus"),()=>u()),v=r(()=>ot(i.value));return c(v,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),{ns:a,openLinkView:async()=>{const a=await n.openLinkView(e.data);a&&a.ok&&a.data&&a.data.length&&(e=>{const a={};Object.assign(a,e),Object.assign(a,{[n.keyName]:a[n.keyName]?a[n.keyName]:a.srfkey,[n.textName]:a[n.textName]?a[n.textName]:a.srfmajortext}),n.valueItem&&t("change",a[n.keyName],n.valueItem),"OBJECT"===n.model.valueType?t("change",n.handleObjectParams(a)):t("change",e[n.textName]),h()})(a.data[0])},curValue:i,editorRef:m,showFormDefaultContent:p}},render(){var e,t;const a=null==this.curValue||""===this.curValue,o="ellipsis"===(null==(e=this.controller.editorParams)?void 0:e.overflowMode)||"ellipsis"===(null==(t=this.controller.editorParams)?void 0:t.overflowmode);return n("div",{class:[this.ns.b(),this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent),this.ns.is("empty",a),this.ns.is("ellipsis",o)],ref:"editorRef",title:Tt(a?"":this.curValue)},[n("a",{onClick:()=>{a||this.openLinkView()}},[a?n(i("iBizEditorEmptyText"),{showPlaceholder:this.controller.emptyShowPlaceholder,placeHolder:this.controller.placeHolder},null):this.curValue])])}}),jA=a({name:"IBizPickerEmbedView",props:it(),emits:Ve(),setup(e,{emit:t}){const a=B("picker-embed-view"),n=e.controller,i=o(n.context.clone()),s=o({...n.params}),l=r(()=>({checkstrictly:!0,...s.value}));c(()=>e.data,e=>{const{context:t,params:a}=n.handlePublicParams(e,n.context,n.params),o=Object.assign(n.context.clone(),t),l=Object.assign({...n.params},a);JSON.stringify(i.value)!==JSON.stringify(o)&&(i.value=o),JSON.stringify(s.value)!==JSON.stringify(l)&&(s.value=l)},{deep:!0,immediate:!0});const d=n.model.editorParams,u=o(!0),h=o(!0),p=o(!0);d&&(d.multiple&&(u.value=!n.toBoolean(d.multiple)),d.checkStrictly&&(h.value=n.toBoolean(d.checkStrictly)),d.checkstrictly&&(h.value=n.toBoolean(d.checkstrictly)),d.isShowText&&(p.value=n.toBoolean(d.isShowText)),d.isshowtext&&(p.value=n.toBoolean(d.isshowtext)));const m=o([]);c(()=>e.value,t=>{var a,i,o,s;if(m.value=[],t&&n.valueItem){const l=null==(o=null==(i=null==(a=e.data)?void 0:a[n.valueItem])?void 0:i.split)?void 0:o.call(i,","),r=null==(s=null==t?void 0:t.split)?void 0:s.call(t,",");l&&r&&(m.value=l.map((e,t)=>({srfkey:e,srfmajortext:r[t]})))}},{immediate:!0});const{componentRef:v}=je(()=>t("focus"),()=>t("blur"));return{ns:a,c:n,context:i,params:s,editorRef:v,isShowText:p,cloneParams:l,singleSelect:u,selectedData:m,checkStrictly:h,onSelectionChange:e=>{(e=>{let a="",i="";e&&Array.isArray(e)&&(e.forEach(e=>{a+="".concat(e.srfkey,","),i+="".concat(e.srfmajortext,",")}),a=a.substring(0,a.length-1),i=i.substring(0,i.length-1),n.valueItem&&t("change",a,n.valueItem),t("change",i))})(e.data)}}},render(){const e=i("IBizViewShell");return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.isShowText?this.ns.m("show-value"):""],ref:"editorRef"},[this.c.model.pickupAppViewId?[n("div",{class:this.ns.b("view")},[l(e,{context:this.context,params:this.cloneParams,viewId:this.c.model.pickupAppViewId,state:{singleSelect:this.singleSelect,checkStrictly:this.checkStrictly,selectedData:this.selectedData},onSelectionChange:this.onSelectionChange})]),this.isShowText&&n("div",{class:this.ns.b("value")},[this.$props.value?this.$props.value.split(",").map(e=>n("span",null,[e,p("; ")])):n("span",null,[this.c.placeHolder])])]:null])}});const VA=a({name:"IBizPickerSelectView",props:it(),emits:Ve(),setup(e,{emit:t}){var a;const i=B("picker-select-view"),s=e.controller,l=s.model,u=o(!0);l.editorParams&&l.editorParams.multiple&&(u.value=!s.toBoolean(l.editorParams.multiple));const h=o([]),p=o([]),m=o([]),v=o(""),g=o(!1),b=o("auto"),f=o(s.context.clone()),w=o({...s.params}),y=r(()=>({...w.value}));c(()=>e.data,e=>{const{context:t,params:a}=s.handlePublicParams(e,s.context,s.params),n=Object.assign(s.context.clone(),t),i={...s.params,...a};JSON.stringify(f.value)!==JSON.stringify(n)&&(f.value=n),JSON.stringify(w.value)!==JSON.stringify(i)&&(w.value=i)},{immediate:!0,deep:!0});const C=o(!1),I=o(null),x=o(null),S=o(null),E=o(!1),D="DESIGN"===(null==(a=s.context)?void 0:a.srfrunmode),P=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),k=e=>{e?C.value=e:setTimeout(()=>{C.value=e},100)},{componentRef:z}=je(()=>t("focus"),()=>t("blur"));c(()=>e.value,t=>{if(u.value)"OBJECT"===s.model.valueType?v.value=t?t[s.objectNameField]:null:v.value=t||"",s.valueItem||D?m.value=[{srfkey:e.data[s.valueItem],srfmajortext:e.value}]:ibiz.log.error("值项异常");else{const a=[];if(h.value=[],p.value=[],t)if("OBJECTS"===s.model.valueType)t.forEach(e=>{const t=ko(e);Object.assign(t,{[s.keyName]:e[s.objectIdField],[s.textName]:e[s.objectNameField]}),s.objectValueField&&(Object.assign(t,{...e[s.objectValueField]}),delete t[s.objectValueField]),t[s.keyName]&&(p.value.push(t),h.value.push(t[s.keyName]))}),a.push(...t);else if(s.valueItem){const n=e.data[s.valueItem].split(","),i=t.split(",");n.forEach((e,t)=>{a.push({srfmajortext:i[t],srfkey:e})}),a.forEach(e=>{h.value.push(e.srfkey);const t=p.value.findIndex(t=>Object.is(t.srfkey,e.srfkey));t<0&&p.value.push({srfmajortext:e.srfmajortext,srfkey:e.srfkey})})}else ibiz.log.error("值项异常");m.value=a,S.value=a}},{immediate:!0,deep:!0}),c(z,t=>{e.autoFocus&&t&&t.focus&&t.focus()}),d(()=>{z.value&&(b.value="".concat(z.value.$parent.$el.offsetWidth,"px"))});const T=()=>{const e=s.dataItems;(null==e?void 0:e.length)&&e.forEach(e=>{t("change",null,e.id)}),s.valueItem&&t("change",null,s.valueItem),t("change",null)},A=e=>{if(0!==e.length){if(u.value){if(g.value=!1,s.valueItem){const a=e[0][s.keyName]?e[0][s.keyName]:e[0].srfkey;t("change",a,s.valueItem)}const a=e[0][s.textName]?e[0][s.textName]:e[0].srfmajortext;"OBJECT"===s.model.valueType?t("change",s.handleObjectParams(e[0])):t("change",a)}else if("OBJECTS"===s.model.valueType){if(e&&Array.isArray(e)){const t=[];e.forEach(e=>{const a=s.handleObjectParams(e);t.push(a)}),S.value=t}}else{let t="",a="";e&&Array.isArray(e)&&(p.value=[],e.forEach(e=>{const n=e[s.keyName]?e[s.keyName]:e.srfkey;t+="".concat(n,",");const i=e[s.textName]?e[s.textName]:e.srfmajortext;a+="".concat(i,",");p.value.findIndex(e=>Object.is(e.srfkey,n))<0&&p.value.push({srfmajortext:i,srfkey:n})})),t=t.substring(0,t.length-1),a=a.substring(0,a.length-1),s.valueItem&&(I.value=t),x.value=a}u.value||(0===e.length?(p.value=[],h.value=[]):Array.isArray(e)&&(p.value=e.map(e=>({srfkey:e[s.keyName]||e.srfkey,srfmajortext:e[s.textName]||e.srfmajortext})),h.value=p.value.map(e=>e.srfkey))),u.value||("OBJECTS"===s.model.valueType?t("change",S.value):(s.valueItem&&t("change",I.value,s.valueItem),t("change",x.value)))}else u.value?T():(p.value=[],"OBJECTS"===s.model.valueType?S.value=null:(s.valueItem&&(I.value=null),x.value=null),h.value=[])},O=(e,t=!1)=>{e.data&&(A(e.data),t&&z.value&&z.value.handleClose())},M=new ca({mode:da.DRAWER,viewUsage:2,dismiss:e=>{O(e,!0)}}),N=e=>{t("blur",e),k(!1)},L=r(()=>u.value?v.value:m.value.map(e=>e[s.textName]).join(","));return{c:s,ns:i,items:p,modal:M,keySet:h,params:w,visible:g,context:f,showView:E,editorRef:z,valueText:L,isEditable:C,queryValue:v,cloneParams:y,selectedData:m,singleSelect:u,pickViewWidth:b,showFormDefaultContent:P,arrow:()=>n("svg",{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg"},[n("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.592 30.592 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.592 30.592 0 0 0-42.752 0z"},null)]),onBlur:N,onClear:T,onFocus:e=>{t("focus",e),k(!0)},triggerMenu:t=>{e.disabled||(g.value=t||!g.value)},setEditable:k,handleKeyUp:e=>{e&&"Enter"===e.code?t("enter",e):"Escape"===e.code&&(e.stopPropagation(),z.value&&z.value.handleClose())},openLinkView:async t=>{t.stopPropagation();const a=await s.openLinkView(e.data);a&&a.ok&&a.data&&A(a.data)},remoteMethod:e=>{v.value=e},onInputChange:e=>{e||T()},onSelectChange:e=>{const a=[];if(e.length>0&&e.forEach(e=>{const t=p.value.findIndex(t=>Object.is(t.srfkey,e));t>=0&&a.push(p.value[t])}),"OBJECTS"===s.model.valueType){const e=[];a.forEach(t=>{const a=s.handleObjectParams(t);e.push(a)}),t("change",e)}else{let e="",n="";a.forEach(t=>{const a=t[s.keyName]?t[s.keyName]:t.srfkey;e+="".concat(a,",");const i=t[s.textName]?t[s.textName]:t.srfmajortext;n+="".concat(i,",")}),e=e.substring(0,e.length-1),n=n.substring(0,n.length-1),s.valueItem&&(I.value=e,t("change",e,s.valueItem)),x.value=n,t("change",n)}},onVisibleChange:e=>{E.value=e,!1===e?N({}):z.value&&(b.value="".concat(z.value.$parent.$el.offsetWidth,"px"))},onViewDataChange:A,onSelectionChange:O,handleDropDownKeyDown:e=>{"Escape"===e.code&&(e.stopPropagation(),z.value&&z.value.handleClose())}}},render(){const e=n(i("el-dropdown"),{ref:"editorRef",trigger:"click",disabled:this.disabled||this.readonly,class:this.ns.b("select"),"popper-class":this.ns.b("popper"),onVisibleChange:this.onVisibleChange,onKeydown:this.handleDropDownKeyDown},{default:()=>{let e;return this.singleSelect?n(i("el-input"),{modelValue:this.queryValue,"onUpdate:modelValue":e=>this.queryValue=e,placeholder:this.c.placeHolder,disabled:this.disabled,readonly:this.readonly,onChange:this.onInputChange,clearable:!0,onFocus:e=>{this.onFocus(e)},onKeyup:this.handleKeyUp},{suffix:()=>[this.queryValue&&!this.disabled&&!this.readonly&&n("ion-icon",{onClick:this.onClear,name:"clear"},null),this.c.model.linkAppViewId&&n("ion-icon",{onClick:this.openLinkView,name:"link-arrow"},null),this.c.model.showTrigger&&n("div",{class:[this.ns.e("arrow"),this.showView?"overturn":""]},[this.arrow()])]}):n(i("el-select"),{"popper-class":this.ns.b("select-popover"),"model-value":this.keySet,placeholder:this.c.placeHolder?this.c.placeHolder:" ",multiple:!0,filterable:!0,remote:!0,"remote-method":this.remoteMethod,onChange:this.onSelectChange,onFocus:e=>{this.onFocus(e)},onKeyup:this.handleKeyUp,disabled:this.disabled||this.readonly,"remote-show-suffix":this.c.model.showTrigger},(t=e=this.items.map((e,t)=>n(i("el-option"),{key:e.srfkey+t,label:e.srfmajortext,value:e.srfkey},null)),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}));var t},dropdown:()=>{var e,t;if(!this.showView)return;const a=i("IBizViewShell");return this.c.pickupView&&l(a,{modal:this.modal,context:this.context,params:{checkstrictly:!0,...this.cloneParams},viewId:this.c.pickupView.id,style:{height:"".concat((null==(e=this.c.editorParams)?void 0:e.pickupViewHeight)||(null==(t=this.c.editorParams)?void 0:t.pickupviewheight)||500,"px"),width:this.pickViewWidth},state:{singleSelect:this.singleSelect,selectedData:this.selectedData},onSelectionChange:e=>this.onSelectionChange(e,this.singleSelect)})}}),t=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),a=n("div",{class:this.ns.b("form-default-content")},[this.valueText?this.singleSelect?n("span",{class:this.ns.b("content-item")},[this.valueText]):this.valueText.split(",").map(e=>n("span",{class:this.ns.b("content-item")},[e])):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&a,this.readonly?t:e])}}),FA="update:modelValue",UA="change",HA="leftCheckChange",qA="rightCheckChange",GA="leftAcSearch",WA=(e,t)=>[e,t].every(Wo)||Wo(e)&&Fo(t),YA={data:{type:Array,default:()=>[]},titles:{type:Array,default:()=>[]},buttonTexts:{type:Array,default:()=>[]},filterPlaceholder:String,filterMethod:{type:Function},rightSearchMethod:{type:Function},leftDefaultChecked:{type:Array,default:()=>[]},rightDefaultChecked:{type:Array,default:()=>[]},renderContent:{type:Function},modelValue:{type:Array,default:()=>[]},format:{type:Object,default:()=>({})},filterable:Boolean,props:{type:Object,default:()=>({label:"label",key:"key",disabled:"disabled"})},targetOrder:{type:String,values:["original","push","unshift"],default:"original"},enableRemoteSearch:{type:Boolean,default:!1},validateEvent:{type:Boolean,default:!0},loading:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},KA={[UA]:(e,t,a)=>[e,a].every(Wo)&&["left","right"].includes(t),[FA]:e=>Wo(e),[HA]:WA,[qA]:WA,[GA]:e=>e},XA=e=>{const t={label:"label",key:"key",disabled:"disabled"};return r(()=>({...t,...e.props}))},$A="checkedChange",JA="acSearch",QA={data:{type:Array,default:()=>[]},optionRender:{type:Function},placeholder:String,title:String,filterable:Boolean,enableAcSearch:Boolean,format:{type:Object,default:()=>({})},filterMethod:{type:Function},defaultChecked:{type:Array,default:()=>[]},props:{type:Object,default:()=>({label:"label",key:"key",disabled:"disabled"})},loading:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1}},ZA=e=>{const t={label:"label",key:"key",disabled:"disabled"};return r(()=>({...t,...e.props}))},eO=a({name:"IBizTransferPanel",props:QA,emits:{[$A]:(e,t)=>[e,t].every(Wo)||Wo(e)&&Fo(t),[JA]:e=>e},setup(e,{emit:t,slots:a}){const n=B("transfer-panel"),i=u({checked:[],allChecked:!1,query:"",checkChangeByUser:!0}),s=ZA(e),{filteredData:l,checkedSummary:d,isIndeterminate:h,onInputChange:p,handleAllCheckedChange:m}=((e,t,a)=>{const n=ZA(e),i=o([]),s=r(()=>i.value.filter(e=>!e[n.value.disabled])),l=r(()=>{const a=t.checked.length,n=e.data.length,{noChecked:i,hasChecked:o}=e.format;return i&&o?a>0?o.replace(/\${checked}/g,a.toString()).replace(/\${total}/g,n.toString()):i.replace(/\${total}/g,n.toString()):"".concat(a,"/").concat(n)}),d=r(()=>{const e=t.checked.length;return e>0&&e<s.value.length}),u=(t="")=>{i.value=e.data.filter(a=>Bo(e.filterMethod)?e.filterMethod(t,a):String(a[n.value.label]||a[n.value.key]).toLowerCase().includes(t.toLowerCase()))},h=()=>{const e=s.value.map(e=>e[n.value.key]);t.allChecked=e.length>0&&e.every(e=>t.checked.includes(e))};return c(()=>t.checked,(e,n)=>{if(h(),t.checkChangeByUser){const t=e.concat(n).filter(t=>!e.includes(t)||!n.includes(t));a($A,e,t)}else a($A,e),t.checkChangeByUser=!0}),c(s,()=>{h()}),c(()=>e.data,()=>{u(t.query);const e=[],a=i.value.map(e=>e[n.value.key]);t.checked.forEach(t=>{a.includes(t)&&e.push(t)}),t.checkChangeByUser=!1,t.checked=e}),c(()=>e.defaultChecked,a=>{const i=[],o=e.data.map(e=>e[n.value.key]);a.forEach(e=>{o.includes(e)&&i.push(e)}),t.checkChangeByUser=!1,t.checked=i},{immediate:!0}),{filteredData:i,checkableData:s,checkedSummary:l,isIndeterminate:d,onInputChange:async t=>{e.enableAcSearch?a("acSearch",t):u(t)},updateAllChecked:h,handleAllCheckedChange:e=>{t.checked=e?s.value.map(e=>e[n.value.key]):[]}}})(e,i,t),v=r(()=>!Oo(i.query)&&Oo(l.value)),g=r(()=>!(a.default&&Oo(a.default()[0].children))),{checked:b,allChecked:f,query:w}=O(i);return{ns:n,query:w,allChecked:f,checkedSummary:d,hasNoMatch:v,hasFooter:g,checked:b,filteredData:l,propsAlias:s,isIndeterminate:h,onInputChange:p,handleAllCheckedChange:m}},render(){var e,t;return n("div",{class:this.ns.b()},[n("p",{class:this.ns.e("header")},[n(i("el-checkbox"),{modelValue:this.allChecked,"onUpdate:modelValue":e=>this.allChecked=e,disabled:this.readonly,indeterminate:this.isIndeterminate,validateEvent:!1,onChange:this.handleAllCheckedChange},{default:()=>[this.title,n("span",null,[this.checkedSummary])]})]),n("div",{class:[this.ns.e("body"),this.ns.is("with-footer",this.hasFooter)]},[this.filterable?n(i("el-input"),{modelValue:this.query,"onUpdate:modelValue":e=>this.query=e,readonly:this.readonly,class:this.ns.e("filter"),size:"default",placeholder:this.placeholder,prefixIcon:()=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[n("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"},null)]),clearable:!0,validateEvent:!1,onInput:this.onInputChange},null):null,b(n("div",{class:[this.ns.e("content"),this.ns.is("filterable",this.filterable)]},[this.hasNoMatch||Oo(this.data)?n("div",{class:this.ns.e("empty")},[this.$slots.empty?null==(t=(e=this.$slots).empty)?void 0:t.call(e):n(i("iBizNoData"),{class:this.ns.em("empty","no-data")},null)]):n(i("el-checkbox-group"),{modelValue:this.checked,"onUpdate:modelValue":e=>this.checked=e,validateEvent:!1,disabled:this.readonly,class:[this.ns.e("list")]},{default:()=>this.filteredData.map(e=>n(i("el-checkbox"),{class:this.ns.e("item"),key:e[this.propsAlias.key],label:e[this.propsAlias.key],disabled:!!e[this.propsAlias.disabled],validateEvent:!1},{default:()=>{var t;return[null==(t=this.optionRender)?void 0:t.call(this,e)]}}))})]),[[C("loading"),this.enableAcSearch&&this.loading]])])])}}),tO=a({name:"IBizTransfer",props:YA,emits:KA,setup(e,{emit:t,slots:a}){const n=B("transfer"),i=u({leftChecked:[],rightChecked:[]}),s=XA(e),{sourceData:c,targetData:d}=(e=>{const t=XA(e),a=r(()=>e.data.reduce((e,a)=>(e[a[t.value.key]]=a)&&e,{})),n=r(()=>e.data.filter(a=>!e.modelValue.includes(a[t.value.key]))),i=r(()=>"original"===e.targetOrder?e.data.filter(a=>e.modelValue.includes(a[t.value.key])):e.modelValue.reduce((e,t)=>{const n=a.value[t];return n&&e.push(n),e},[]));return{sourceData:n,targetData:i}})(e),{onSourceCheckedChange:h,onTargetCheckedChange:p}=((e,t)=>({onSourceCheckedChange:(a,n)=>{e.leftChecked=a,n&&t(HA,a,n)},onTargetCheckedChange:(a,n)=>{e.rightChecked=a,n&&t(qA,a,n)}}))(i,t),{addToLeft:m,addToRight:v}=((e,t,a)=>{const n=XA(e),i=(e,t,n)=>{a(FA,e),a(UA,e,t,n)};return{addToLeft:()=>{const a=e.modelValue.slice();t.rightChecked.forEach(e=>{const t=a.indexOf(e);t>-1&&a.splice(t,1)}),i(a,"left",t.rightChecked)},addToRight:()=>{let a=e.modelValue.slice();const o=e.data.filter(a=>{const i=a[n.value.key];return t.leftChecked.includes(i)&&!e.modelValue.includes(i)}).map(e=>e[n.value.key]);a="unshift"===e.targetOrder?o.concat(a):a.concat(o),"original"===e.targetOrder&&(a=e.data.filter(e=>a.includes(e[n.value.key])).map(e=>e[n.value.key])),i(a,"right",t.leftChecked)}}})(e,i,t),g=o(),b=o(),f=r(()=>2===e.buttonTexts.length),w=r(()=>e.titles[0]||"可选列表"),y=r(()=>e.titles[1]||"已选列表"),C=r(()=>e.filterPlaceholder||"请输入");return{ns:n,targetData:d,rightPanelTitle:y,optionRender:r(()=>t=>{var n;if(e.renderContent)return e.renderContent(l,t);const i=((null==(n=a.default)?void 0:n.call(a,{option:t}))||[]).filter(e=>e.type!==Comment);return i.length?i:l("span",t[s.value.label]||t[s.value.key])}),panelFilterPlaceholder:C,leftPanelTitle:w,sourceData:c,leftPanel:g,rightPanel:b,hasButtonTexts:f,checkedState:i,addToLeft:m,addToRight:v,clearQuery:e=>{switch(e){case"left":g.value.query="";break;case"right":b.value.query=""}},onLeftAcSearch:e=>{t("leftAcSearch",e)},onSourceCheckedChange:h,onTargetCheckedChange:p}},render(){return n("div",{class:this.ns.b()},[n(eO,{ref:"leftPanel",data:this.sourceData,readonly:this.readonly,optionRender:this.optionRender,placeholder:this.panelFilterPlaceholder,title:this.leftPanelTitle,filterable:this.filterable,format:this.format,enableAcSearch:this.enableRemoteSearch,loading:this.loading,filterMethod:this.filterMethod,defaultChecked:this.leftDefaultChecked,onAcSearch:this.onLeftAcSearch,props:this.props,onCheckedChange:this.onSourceCheckedChange},null),n("div",{class:this.ns.e("buttons")},[n(i("el-button"),{class:[this.ns.e("button"),this.ns.is("with-texts",this.hasButtonTexts)],type:"primary",disabled:!!Oo(this.checkedState.rightChecked)||this.readonly,onClick:this.addToLeft},{default:()=>[n(i("el-icon"),null,{default:()=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[n("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.592 30.592 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.592 30.592 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0z"},null)])}),void 0!==this.buttonTexts[0]?n("span",null,[this.buttonTexts[0]]):null]}),n(i("el-button"),{class:[this.ns.e("button"),this.ns.is("with-texts",this.hasButtonTexts)],type:"primary",disabled:!!Oo(this.checkedState.leftChecked)||this.readonly,onClick:this.addToRight},{default:()=>[void 0!==this.buttonTexts[1]?n("span",null,[this.buttonTexts[1]]):null,n(i("el-icon"),null,{default:()=>n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[n("path",{fill:"currentColor",d:"M340.864 149.312a30.592 30.592 0 0 0 0 42.752L652.736 512 340.864 831.872a30.592 30.592 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"},null)])})]})]),n(eO,{ref:"rightPanel",data:this.targetData,readonly:this.readonly,optionRender:this.optionRender,placeholder:this.panelFilterPlaceholder,filterable:this.filterable,format:this.format,filterMethod:this.filterMethod,title:this.rightPanelTitle,defaultChecked:this.rightDefaultChecked,props:this.props,onCheckedChange:this.onTargetCheckedChange},null)])}}),aO=a({name:"IBizTransferPicker",props:it(),emits:Ve(),setup(e,{emit:t}){const a=B("picker"),n=B("transfer-picker"),i=e.controller,s=i.model,l=o([]),u=o([]),h=o([]),p=o(!1),m=o(),v=o([]),g=o([]),b=o([]),f=o([]),w=i.model.valueType,y=i.model.valueSeparator||",";let C=[ibiz.i18n.t("editor.transferPicker.optionalList"),ibiz.i18n.t("editor.transferPicker.selectedList")],I=[ibiz.i18n.t("app.delete"),ibiz.i18n.t("app.add")],x=!1;if(s.editorParams){const{editorParams:e}=s;if(e.titles)try{C=JSON.parse(e.titles)}catch(e){ibiz.log.info(e)}if(e.buttontexts)try{I=JSON.parse(e.buttontexts)}catch(e){ibiz.log.info(e)}e.remotesearch&&(x="true"===e.remotesearch)}c(()=>e.value,e=>{if(l.value=[],h.value=[],e){if("OBJECTS"===w)e.forEach(e=>{const t=Ko(e);Object.assign(t,{[i.keyName]:e[i.objectIdField],[i.textName]:e[i.objectNameField]}),i.objectValueField&&(Object.assign(t,{...e[i.objectValueField]}),delete t[i.objectValueField]),t[i.keyName]&&h.value.push(t)});else if(i.objectIdField&&y){e.split(y).forEach(e=>{h.value.push({[i.keyName]:e})})}else try{h.value=JSON.parse(e)}catch(t){ibiz.log.error("SIMPLE类型地址栏值格式".concat(e,"不符合JSON字符串要求"))}h.value.forEach(e=>{l.value.push(e[i.keyName]);const t=u.value.findIndex(t=>Object.is(t[i.keyName],e[i.keyName]));t<0&&u.value.push({[i.keyName]:e[i.keyName],[i.textName]:e[i.textName]})})}},{immediate:!0,deep:!0}),c(m,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const S=async(...t)=>{f.value=u.value.filter(e=>!!h.value.find(t=>t[i.keyName]===e[i.keyName]));const a=t[0]||"";p.value=!0;const n=await(async t=>{let a=[];if(i.model.appDataEntityId)try{const n=t.trim(),o=await i.getServiceData(n,e.data);o&&(a=o.data)}catch(e){ibiz.log.error(e)}return a})(a);n&&(u.value=[...f.value,...n.filter(e=>!f.value.find(t=>t[i.keyName]===e[i.keyName]))]),b.value=[...b.value],g.value=[...g.value],p.value=!1},E=ia(S,1e3),D=r(()=>h.value.map(e=>e[i.textName]).join(","));c(D,(e,a)=>{e!==a&&t("infoTextChange",e)},{immediate:!0}),d(()=>{i.objectNameField&&(u.value=[],S(""))});return{c:i,ns:a,ns2:n,items:u,loading:p,curValue:l,valueText:D,editorRef:m,curIndexs:v,leftChecked:g,rightChecked:b,titles:C,buttonTexts:I,enableRemoteSearch:x,onSearch:S,filterMethod:(e,t)=>{const a=t[i.textName];return!e||(null==a?void 0:a.toLowerCase().includes(null==e?void 0:e.toLowerCase()))},onRightChange:e=>{(e=>{const a=[];e&&Array.isArray(e)&&e.forEach(e=>{Object.assign(e,{[i.keyName]:e[i.keyName]?e[i.keyName]:e.srfkey,[i.textName]:e[i.textName]?e[i.textName]:e.srfmajortext}),"OBJECTS"===w?a.push(i.handleObjectParams(e)):i.objectIdField?a.push(e[i.keyName]):a.push({[i.keyName]:e[i.keyName],[i.textName]:e[i.textName]}),u.value.findIndex(t=>Object.is(t[i.keyName],e[i.keyName]))<0&&u.value.push(e)});let n=null;a.length>0&&(n="OBJECTS"===w?a:i.objectIdField?a.join(y):JSON.stringify(a)),t("change",n)})(e.map(e=>u.value.find(t=>t[i.keyName]===e)||{}))},onLeftCheckChange:e=>{g.value=e},onRightCheckChange:e=>{b.value=e},renderContentItem:(e,t)=>e("span",{title:t[i.textName]},t[i.textName]),onLeftAcSearch:e=>{E(e)}}},render(){const e=n("div",{class:[this.ns.e("autocomplete")]},[n(tO,y({ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,data:this.items,readonly:this.readonly||this.disabled,"left-default-checked":this.leftChecked,"right-default-checked":this.rightChecked,props:{key:this.c.keyName,label:this.c.textName},filterable:!0,"filter-placeholder":this.c.placeHolder,enableRemoteSearch:this.enableRemoteSearch,titles:this.titles,"button-texts":this.buttonTexts,format:{noChecked:"${total}",hasChecked:"${checked}/${total}"},"target-order":this.enableRemoteSearch?"push":"original",loading:this.loading,filterMethod:this.filterMethod,renderContent:this.renderContentItem,onChange:this.onRightChange,onLeftCheckChange:this.onLeftCheckChange,onRightCheckChange:this.onRightCheckChange,onLeftAcSearch:this.onLeftAcSearch},this.$attrs),null)]);return n("div",{class:[this.ns.b(),this.ns2.b(),this.disabled?this.ns.m("disabled"):""]},[e])}});var nO=Object.defineProperty,iO=(e,t,a)=>(((e,t,a)=>{t in e?nO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class oO extends qi{constructor(){super(...arguments),iO(this,"multiple",!1),iO(this,"pickupView",null),iO(this,"linkView",null),iO(this,"valueItem",""),iO(this,"keyName","srfkey"),iO(this,"textName","srfmajortext"),iO(this,"interfaceName",""),iO(this,"sort",""),iO(this,"noAC",!1),iO(this,"noButton",!1),iO(this,"deACMode"),iO(this,"dataItems",[]),iO(this,"objectIdField",""),iO(this,"objectNameField",""),iO(this,"objectValueField",""),iO(this,"acItemProvider"),iO(this,"groupActionState",new Ri),iO(this,"actionDetails",[]),iO(this,"curPage",1),iO(this,"total",0),iO(this,"totalPages"),iO(this,"pagingSize"),iO(this,"pagingMode")}get isLazyLoad(){return No(this.pagingMode)&&0!==this.pagingMode}get isShowLoadMore(){return!!(this.isLazyLoad&&3===this.pagingMode&&this.totalPages&&this.curPage<this.totalPages)}async onInit(){var e,t,a,n;if(super.onInit(),this.initParams(),this.valueItem=(null==(e=this.model.valueItemName)?void 0:e.toLowerCase())||"",this.model.appDataEntityId&&(this.model.appDEDataSetId&&(this.interfaceName=this.model.appDEDataSetId),this.model.appDEACModeId&&(this.deACMode=await ga(this.model.appDEACModeId,this.model.appDataEntityId,this.context.srfappid),this.deACMode))){const{minorSortAppDEFieldId:e,minorSortDir:t,pagingMode:a,pagingSize:n}=this.deACMode;this.pagingMode=a,this.pagingSize=n,e&&t&&(this.sort="".concat(e.toLowerCase(),",").concat(t.toLowerCase())),this.deACMode.textAppDEFieldId&&(this.textName=this.deACMode.textAppDEFieldId),this.deACMode.valueAppDEFieldId&&(this.keyName=this.deACMode.valueAppDEFieldId),this.deACMode.deacmodeDataItems&&(this.dataItems=[],this.deACMode.deacmodeDataItems.forEach(e=>{"value"!==e.id&&"text"!==e.id&&this.dataItems.push(e)})),this.deACMode.itemSysPFPluginId&&(this.acItemProvider=await Vi(this.deACMode))}this.model.editorType&&["PICKEREX_DROPDOWNVIEW","PICKEREX_DROPDOWNVIEW_LINK","PICKUPVIEW","MOBPICKER_DROPDOWNVIEW"].includes(this.model.editorType)&&this.initPickupViewParams(),this.objectIdField=null==(t=this.model.objectIdField)?void 0:t.toLowerCase(),this.objectNameField=null==(a=this.model.objectNameField)?void 0:a.toLowerCase(),this.objectValueField=null==(n=this.model.objectValueField)?void 0:n.toLowerCase(),this.model.uiactionGroup&&(this.actionDetails=this.model.uiactionGroup.uiactionGroupDetails||[],this.actionDetails.length>0&&(this.actionDetails.forEach(e=>{const t=e.uiactionId;if(t){const a=new Di(e.id,this.context.srfappid,t);this.groupActionState.addState(e.id,a)}}),await this.groupActionState.init(),this.actionDetails.forEach(e=>{e.capLanguageRes&&e.capLanguageRes.lanResTag&&(e.caption=ibiz.i18n.t(e.capLanguageRes.lanResTag,e.caption)),e.tooltipLanguageRes&&e.tooltipLanguageRes.lanResTag&&(e.tooltip=ibiz.i18n.t(e.tooltipLanguageRes.lanResTag,e.tooltip))})))}initParams(){switch(this.model.editorType){case"PICKEREX_NOAC":case"PICKEREX_NOAC_LINK":this.noAC=!0;break;case"PICKEREX_NOBUTTON":this.noButton=!0;break;default:this.noButton=!1,this.noAC=!1}}async initPickupViewParams(){this.model.pickupAppViewId&&(this.pickupView=await ibiz.hub.config.view.get(this.model.pickupAppViewId))}async initLinkViewParams(){this.model.linkAppViewId&&(this.linkView=await ibiz.hub.config.view.get(this.model.linkAppViewId))}async getServiceData(e,t,a){const{context:n,params:i}=this.handlePublicParams(t,this.context,this.params),o={};if(ibiz.config.pickerdefaultsort&&Object.assign(o,{sort:ibiz.config.pickerdefaultsort}),this.sort&&!Object.is(this.sort,"")&&Object.assign(o,{sort:this.sort}),e&&Object.assign(o,{query:e}),Object.assign(o,{size:1e3}),this.isLazyLoad){!0===(null==a?void 0:a.isLoadMore)?this.curPage+=1:this.curPage=1}this.isLazyLoad&&this.pagingSize&&Object.assign(o,{size:this.pagingSize,page:this.curPage-1});const s=Ao(i,o);if(this.interfaceName){const e=ibiz.hub.getApp(this.context.srfappid),t=await e.deService.exec(this.model.appDataEntityId,this.interfaceName,n,s);return t.headers&&(t.headers["x-total"]&&(this.total=Number(t.headers["x-total"])),t.headers["x-total-pages"]&&(this.totalPages=Number(t.headers["x-total-pages"]))),t}throw new Xt(this.model,ibiz.i18n.t("editor.common.entityConfigErr"))}async openPickUpView(e,t){await this.initPickupViewParams();const{context:a,params:n}=this.handlePublicParams(e,this.context,this.params);if(t&&(n.selecteddata=t),!this.pickupView)throw new Xt(this.model,ibiz.i18n.t("editor.common.selectViewConfigErr"));const i=await ibiz.commands.execute(Ai.TAG,this.pickupView.id,a,{checkstrictly:!0,...n},{openMode:"POPUPMODAL"});if(i&&i.ok&&i.data)return i.data;ibiz.log.debug("模态取消或关闭异常",i)}async openLinkView(e){const t=this.context.clone();e[this.valueItem]&&(t.srfkey=e[this.valueItem]);const{context:a,params:n}=this.handlePublicParams(e,t,this.params),{linkAppViewId:i}=this.model;if(!i)throw new Xt(this.model,ibiz.i18n.t("editor.common.linkViewConfigErr"));return ibiz.commands.execute(Ai.TAG,i,a,n)}async calcFillDataItems(e){if(this.deACMode){if(0===this.dataItems.length)return[];return await Promise.all(this.dataItems.map(t=>{const a=e[t.appDEFieldId];return t.format||t.convertToCodeItemText&&t.codeListId||t.customCode,{id:t.id,value:a}}))}return[]}handleObjectParams(e){const t={};if(this.objectIdField&&Object.assign(t,{[this.objectIdField]:e[this.keyName]}),this.objectNameField&&Object.assign(t,{[this.objectNameField]:e[this.textName]}),this.objectValueField){const a={...e};delete a.srfkey,delete a.srfmajortext,Object.assign(t,{[this.objectValueField]:a})}return e.srfnodeid&&Object.assign(t,{srfnodeid:e.srfnodeid}),t}async onActionClick(e,t,a){const n=e.uiactionId;await fa.execAndResolved(n,{context:this.context,params:this.params,data:[t],view:this.view,event:a},e.appId)}}var sO=Object.defineProperty,lO=(e,t,a)=>(((e,t,a)=>{t in e?sO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class rO{constructor(e){lO(this,"formEditor"),lO(this,"gridEditor");let t="IBizPicker";switch(e){case"PICKEREX_TRIGGER":t="IBizPickerDropDown";break;case"PICKEREX_LINKONLY":t="IBizPickerLink";break;case"ADDRESSPICKUP":case"ADDRESSPICKUP_AC":case"MOBMPICKER":t="IBizMPicker";break;case"PICKEREX_DROPDOWNVIEW":case"PICKEREX_DROPDOWNVIEW_LINK":case"MOBPICKER_DROPDOWNVIEW":t="IBizPickerSelectView";break;case"PICKUPVIEW":t="IBizPickerEmbedView";break;case"TRANSFER_PICKER":t="IBizTransferPicker"}this.formEditor=t,this.gridEditor=t}async createController(e,t){const a=new oO(e,t);return await a.init(),a}}const cO=a({name:"IBizNumberRangePicker",props:st(),emits:Ve(),setup(e,{emit:t}){const a=B("number-range-picker"),n=e.controller,i=n.model,{useInFocusAndBlur:s,useInValueChange:l}=We(e,t);let d=1/0,u=-1/0,h=0,p="-";const m=i.placeHolder&&i.placeHolder.split(";")[0]||"",v=i.placeHolder&&i.placeHolder.split(";")[1]||"";let g="~";i.editorParams&&(i.editorParams.maxvalue&&(d=Yo(i.editorParams.maxvalue)),i.editorParams.minvalue&&(u=Yo(i.editorParams.minvalue)),i.editorParams.precision&&(h=Yo(i.editorParams.precision)),i.editorParams.valueSeparator&&(p=i.editorParams.valueSeparator),i.editorParams.valueseparator&&(p=i.editorParams.valueseparator),i.editorParams.rangeSeparator&&(g=i.editorParams.rangeSeparator),i.editorParams.rangeseparator&&(g=i.editorParams.rangeseparator));const b=o([]),f=i.editorItems;if(f&&f.length>0){const e=f.map(e=>e.id);b.value=e}const w=o(null),y=o(null),C=o(!1),I=o(),x=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{e!==t&&"string"==typeof e&&(w.value=e.split(p)[0]?Number(e.split(p)[0]):null,y.value=e.split(p)[1]?Number(e.split(p)[1]):null)},{immediate:!0});const S=e=>{e?C.value=e:setTimeout(()=>{C.value=e},100)},E=(e,a,i)=>{e===n.triggerMode&&t("change",a,i)},{componentRef:D}=je(()=>t("focus"),()=>s()),P=r(()=>"number"==typeof w.value&&"number"==typeof y.value?"".concat(w.value).concat(g).concat(y.value):null);return{ns:a,c:n,refFormItem:b,minValue:w,maxValue:y,handleChange:(e,t,a="blur")=>{if(0===t?w.value=e:1===t&&(y.value=e),null!==w.value&&null!==y.value&&(E(a,[w.value,y.value].join(p)),S(!1),l()),b.value){const n=b.value[t];E(a,e,n),l()}},max:d,min:u,precision:h,valueSeparator:p,startPlaceHolder:m,endPlaceHolder:v,rangeSeparator:g,componentRef:D,editorRef:I,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},onFocus:e=>{t("focus",e),S(!0)},onBlur:e=>{null!==w.value&&null!==y.value&&(t("blur",e),S(!1))},valueText:P,isEditable:C,setEditable:S,showFormDefaultContent:x}},render(){const e=n("div",{class:this.ns.b("input")},[n(i("el-input-number"),y({ref:"editorRef",min:this.min,modelValue:this.minValue,disabled:this.disabled,readonly:this.readonly,precision:this.controller.model.precision,placeholder:this.startPlaceHolder,controls:!1,onChange:e=>this.handleChange(e,0),onInput:e=>this.handleChange(e,0,"input"),onKeyup:this.handleKeyUp,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null),n("div",{class:this.ns.b("separator")},[this.rangeSeparator]),n(i("el-input-number"),y({min:"number"==typeof this.minValue?this.minValue+1:-1/0,max:this.max,modelValue:this.maxValue,disabled:this.disabled,readonly:this.readonly,precision:this.controller.model.precision,placeholder:this.endPlaceHolder,controls:!1,onChange:e=>this.handleChange(e,1),onInput:e=>this.handleChange(e,1,"input"),onKeyup:this.handleKeyUp,onFocus:this.onFocus,onBlur:this.onBlur},this.$attrs),null)]),t=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),a=n("div",{class:this.ns.b("form-default-content")},[this.valueText?[n("div",{class:this.ns.b("default-min")},[this.minValue]),n("div",{class:this.ns.b("default-separator")},[this.rangeSeparator]),n("div",{class:this.ns.b("default-max")},[this.maxValue])]:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],ref:"componentRef"},[this.showFormDefaultContent&&a,this.readonly?t:e])}});class dO extends qi{}var uO=Object.defineProperty,hO=(e,t,a)=>(((e,t,a)=>{t in e?uO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class pO{constructor(){hO(this,"formEditor","IBizNumberRangePicker"),hO(this,"gridEditor","IBizNumberRangePicker")}async createController(e,t){const a=new dO(e,t);return await a.init(),a}}const mO=a({name:"IBizDateRangePicker",props:lt(),emits:Ve(),setup(e,{emit:t}){const a=B("date-range-picker"),n=e.controller,i=n.model;let s=",",l=!1;const d=i.placeHolder&&i.placeHolder.split(";")[0]||"",u=i.placeHolder&&i.placeHolder.split(";")[1]||"";let h=ibiz.i18n.t("editor.dateRange.rangeSeparator");i.editorParams&&(i.editorParams.valueSeparator&&(s=i.editorParams.valueSeparator),i.editorParams.valueseparator&&(s=i.editorParams.valueseparator),i.editorParams.rangeSeparator&&(h=i.editorParams.rangeSeparator),i.editorParams.rangeseparator&&(h=i.editorParams.rangeseparator),i.editorParams.unlinkPanels&&(l=n.toBoolean(i.editorParams.unlinkPanels)),i.editorParams.unlinkpanels&&(l=n.toBoolean(i.editorParams.unlinkpanels)));const p=o("daterange");switch(i.editorType){case"DATERANGE":case"MOBDATERANGE":default:p.value="datetimerange";break;case"DATERANGE_NOTIME":case"MOBDATERANGE_NOTIME":p.value="daterange"}const m=o("YYYY-MM-DD"),v=n.valueFormat;v&&(m.value=v);const g=o([]),b=i.editorItems;if(b&&b.length>0){const e=b.map(e=>e.id);g.value=e}const f=o(!1),w=o(),y=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),C=e=>{e?f.value=e:setTimeout(()=>{f.value=e},100)},I=r({get(){let t=[];if(g.value.length>0)g.value.forEach(a=>{e.data[a]&&t.push(e.data[a])});else if(e.value&&"string"==typeof e.value){const a=e.value.split(s);t=a.every(e=>as(e).isValid())?a:[]}return t},set(e){e&&e.length>0?(t("change",e.join(s)),g.value.length>0&&e.forEach((e,a)=>{t("change",e,g.value[a])})):(t("change",null),g.value.length>0&&g.value.forEach((e,a)=>{t("change",null,g.value[a])})),C(!1)}});c(w,t=>{e.autoFocus&&t&&t.focus&&t.focus()});const x=r(()=>I.value.length>0?"".concat(I.value[0]," ").concat(h," ").concat(I.value[1]):null);return{ns:a,c:n,refFormItem:g,curValue:I,type:p,format:m,valueSeparator:s,startPlaceHolder:d,endPlaceHolder:u,rangeSeparator:h,unlinkPanels:l,onFocus:e=>{t("focus",e),C(!0)},onBlur:e=>{t("blur",e),C(!1)},editorRef:w,valueText:x,isEditable:f,setEditable:C,showFormDefaultContent:y,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},onCalendarChange:e=>{n.dateRange=ko(e)}}},render(){const e=n(i("el-date-picker"),y({ref:"editorRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,class:this.ns.b("input"),type:this.type,"popper-class":this.ns.b("popper"),format:this.format,"value-format":this.format,disabled:this.disabled,readonly:this.readonly,"range-separator":this.rangeSeparator,"start-placeholder":this.startPlaceHolder,"end-placeholder":this.endPlaceHolder,"unlink-panels":this.unlinkPanels,onFocus:this.onFocus,onBlur:this.onBlur,onCalendarChange:this.onCalendarChange},this.$attrs),null),t=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),a=n("div",{class:[this.ns.b("form-default-content"),this.ns.is("has-val",this.curValue.length>0)]},[this.curValue.length>0?n(i("el-date-picker"),y({"model-value":this.curValue,class:this.ns.b("default-input"),type:this.type,format:this.format,"value-format":this.format,readonly:!0,"range-separator":this.rangeSeparator,"start-placeholder":this.startPlaceHolder,"end-placeholder":this.endPlaceHolder,"unlink-panels":this.unlinkPanels},this.$attrs),null):n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],onKeyup:this.handleKeyUp},[this.showFormDefaultContent&&a,this.readonly?t:e])}});var vO=Object.defineProperty,gO=(e,t,a)=>(((e,t,a)=>{t in e?vO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class bO extends qi{constructor(){super(...arguments),gO(this,"dateRange",[])}getFormatByType(){switch(this.model.editorType){case"DATERANGE":case"MOBDATERANGE":default:return"YYYY-MM-DD HH:mm:ss";case"DATERANGE_NOTIME":case"MOBDATERANGE_NOTIME":return"YYYY-MM-DD"}}get valueFormat(){return this.model.dateTimeFormat?this.model.dateTimeFormat:super.valueFormat?super.valueFormat:this.getFormatByType()}}var fO=Object.defineProperty,wO=(e,t,a)=>(((e,t,a)=>{t in e?fO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class yO{constructor(){wO(this,"formEditor","IBizDateRangePicker"),wO(this,"gridEditor","IBizDateRangePicker")}async createController(e,t){const a=new bO(e,t);return await a.init(),a}}const CO=a({name:"IBizCode",props:rt(),emits:Ve(),setup(e,{emit:t}){const a=o(),i=B("code"),s=e.controller,l=go(),r=o(""),{UIStore:u,zIndex:p}=G(),m=o(!0),v=o(!1),b=o(!1),f=o(!1),w=o(!1),y=o(!1),C=o(),I=o({[i.cssVarBlockName("text-editor-toolbar-z-index")]:p.increment()}),x=o(!1),S=o(""),E=s.model;let D,P,k,z,T,A;E.editorParams&&(E.editorParams.enableEdit&&(v.value=!0,b.value=!0,m.value=s.toBoolean(E.editorParams.enableEdit)&&!e.readonly&&!e.disabled),E.editorParams.enableedit&&(v.value=!0,b.value=!0,m.value=s.toBoolean(E.editorParams.enableedit)&&!e.readonly&&!e.disabled),E.editorParams.enableFullScreen&&(f.value=s.toBoolean(E.editorParams.enableFullScreen)),E.editorParams.enablefullscreen&&(f.value=s.toBoolean(E.editorParams.enablefullscreen)));const O=e=>{var t,a;S.value=(null==(t=null==s?void 0:s.editorParams)?void 0:t.customTheme)||ibiz.config.codeEditorTheme||e;const n=null==(a=null==s?void 0:s.editorParams)?void 0:a.customTheme;return n?"dark"===n?"vs-dark":"vs":ibiz.config.codeEditorTheme?"dark"===ibiz.config.codeEditorTheme?"vs-dark":"vs":"dark"===e?"vs-".concat(u.theme):"vs"};c(()=>u.theme,e=>{P.setTheme(O(e))}),c(()=>e.value,e=>{e!==r.value&&(r.value=e||"",null==D||D.setValue(r.value))},{immediate:!0});const M=()=>{D&&((e.readonly||e.disabled)&&(v.value=!1,b.value=!0),D.updateOptions({readOnly:v.value?b.value:e.readonly||e.disabled}))};c(()=>e.readonly,M,{immediate:!0}),c(()=>e.disabled,M,{immediate:!0});const N=()=>{null==D||D.dispose(),D=null,null==T||T.clear(),T=null,null==k||k.dispose(),k=null,null==z||z.dispose(),z=null,null==A||A.close()},L=()=>{if(e.readonly||!m.value||!s.deACMode||!s.chatCompletion)return;const t=null==D?void 0:D.getSelection();x.value=!(!t||t.isEmpty())},R=e=>{const t=e.selection;t&&((e=>{var t;const a=e.getStartPosition();if(a){const e=null==D?void 0:D.getScrolledVisiblePosition(a),n=null==(t=null==D?void 0:D.getDomNode())?void 0:t.getBoundingClientRect();if(!n||!e)return;I.value={...I.value,[i.cssVarBlockName("text-editor-toolbar-left")]:"".concat(n.left+e.left,"px"),[i.cssVarBlockName("text-editor-toolbar-top")]:"".concat(n.top+e.top+e.height,"px")}}})(t),s.currentSelection=t)},_=e=>{var t,a;const n=null==(t=null==D?void 0:D.getSelection())?void 0:t.getStartPosition();if(!n)return;const i=null==D?void 0:D.getScrolledVisiblePosition(n),o=null==(a=null==D?void 0:D.getDomNode())?void 0:a.getBoundingClientRect(),l=C.value.offsetHeight;if(!i||!o||!l)return;const r=ibiz.inLineAIUtil.calcContextMenus(s.deACMode,e=>{s.doInLineAIUIAction(e,s.model.appId)});0!==r.length&&ibiz.inLineAIUtil.showContextMenus(o.left+i.left,o.top+i.top+i.height+l,r,{zIndex:p.increment(),onClose:()=>{p.decrement()}})},j=e=>{var t;(null==(t=C.value)?void 0:t.contains(e.target))||setTimeout(L,100)},V=e=>{var t;x.value&&!(null==(t=C.value)?void 0:t.contains(e.target))&&(x.value=!1)},F=()=>{g(()=>{y.value=!0,Hd.config({paths:{vs:"".concat(ibiz.env.pluginBaseUrl,"/monaco-editor@0.52.2/min/vs")}}),Hd.init().then(n=>{var o;y.value=!1,D||(P=n.editor,D=P.create(a.value,{language:e.language||e.controller.language,theme:O(u.theme),foldingStrategy:"indentation",renderLineHighlight:"all",selectOnLineNumbers:!0,minimap:{enabled:!0},readOnly:v.value?b.value:e.readonly||e.disabled,readOnlyMessage:{value:ibiz.i18n.t("editor.code.readOnlyPrompt")},fontSize:16,fixedOverflowWidgets:!0,scrollBeyondLastLine:!1,overviewRulerBorder:!1}),D.__instanceId=l,s.chatCompletion&&ibiz.env.enableAI&&(k=n.languages.registerCodeLensProvider(e.language||e.controller.language,{provideCodeLenses:function(a,i){return(e=>{const t=P.getEditors().find(t=>t.getModel()===e);return!(!t||t.__instanceId!==l)})(a)?{lenses:[{id:"AI",range:new n.Range(1,1,1,1),command:{title:"".concat(s.deACMode.logicName),id:D.addCommand(0,()=>(async()=>{if(!s.deACMode||!s.model.appDataEntityId)return;A=await ibiz.aiChatUtil.getAIChat();const{containerOptions:a,chatOptions:n}=await ibiz.aiChatUtil.getEditorExAIChatParams(s.editorParams,s.context,s.params,e.data,s.deACMode,{chatInstance:A,view:s.view,ctrl:s.ctrl}),i=await ibiz.aiChatUtil.getAIResourceOptions(s.context,s.params);A.create({resourceOptions:i,containerOptions:{zIndex:p.increment(),...a},chatOptions:{caption:s.deACMode.logicName,context:{...s.context},params:{...s.params,srfactag:s.deACMode.codeName},appDataEntityId:s.model.appDataEntityId,...n,action:(e,a)=>{"backfill"===e&&t("change",a.realcontent)}}})})())}}],dispose:()=>{}}:{lenses:[],dispose:()=>{}}},resolveCodeLens:(e,t,a)=>t}))),s.onCreated(D,n),setTimeout(()=>{D.layout(),D.setValue(r.value)});const c=()=>{T&&T.clear(),s.placeHolder&&!(null==D?void 0:D.getValue())&&(T=D.createDecorationsCollection([{range:new n.Range(1,1,1,1),options:{isWholeLine:!0,beforeContentClassName:"".concat(i.e("first-prompt")," ghost-text-decoration")}}]))},d=D.setValue.bind(D);D.setValue=e=>{d(e),c()},D.onDidFocusEditorText(()=>{null==T||T.clear()}),D.onDidBlurEditorText(()=>{c()}),D.onDidChangeModelContent(()=>{L(),v.value||(r.value=D.getValue(),t("change",r.value))}),D.onDidChangeCursorSelection(R),null==(o=D.getDomNode())||o.addEventListener("click",j),window.addEventListener("resize",()=>{D.layout()})}).catch(()=>{y.value=!1})})},U=()=>{b.value=!b.value,D&&(b.value?D.updateOptions({readOnly:!0}):D.updateOptions({readOnly:!1}))},H=async()=>{r.value=String(null==D?void 0:D.getValue()),N(),w.value=!w.value,F()};return d(()=>{F(),window.addEventListener("mousedown",V.bind(this))}),h(()=>{N(),window.removeEventListener("mousedown",V.bind(this))}),{ns:i,currentVal:r,codeEditBox:a,isFullScreen:w,hasEnableEdit:v,readonlyState:b,isLoading:y,textTBRef:C,editorTheme:S,renderFooter:()=>v.value?n("div",{class:[i.b("footer"),{[i.b("footer-dialog")]:w.value}]},[n("div",{class:i.be("footer","cancel"),onClick:()=>{e.value!==(null==D?void 0:D.getValue())?Co({title:ibiz.i18n.t("editor.common.confirmCancel"),type:"warning",customClass:i.b("message"),message:n("div",{class:i.be("message","message-content")},[n("p",null,[ibiz.i18n.t("editor.common.confirmCancelPrompt")]),n("p",{class:i.bem("message","message-content","message-tip")},[ibiz.i18n.t("editor.common.cancelEditPrompt")])]),showCancelButton:!0,cancelButtonClass:i.be("message","message-cancel"),confirmButtonClass:i.be("message","message-comfire")}).then(()=>{null==D||D.setValue(String(e.value||"")),U()}).catch(()=>{null==D||D.focus()}):U()}},[ibiz.i18n.t("app.cancel")]),n("div",{class:i.be("footer","save"),onClick:()=>(U(),D&&(r.value=D.getValue(),t("change",r.value)),void(w.value&&H()))},[ibiz.i18n.t("app.save")])]):null,renderHeaderToolbar:()=>v.value||f.value?n("div",{class:i.b("toolbar")},[v.value&&m.value&&b.value?n("i",{class:"fa fa-edit","aria-hidden":"true",onClick:()=>U()},null):null,f.value?n("span",{class:i.be("toolbar","fullscreen"),title:ibiz.i18n.t("editor.common.".concat(w.value?"minimize":"fullscreen")),onClick:()=>H()},[w.value?n("i",{class:"ch-icon ch-icon-minscreen"},null):n("i",{class:"ch-icon ch-icon-fullscreen"},null)]):null]):null,renderTextEditorToolbar:()=>x.value&&s.chatCompletion?n("div",{ref:"textTBRef",class:[i.b("text-editor-toolbar")],style:{...I.value}},[n("div",{class:[i.be("text-editor-toolbar","item")],title:"AI",onClick:_},[n("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",width:"1em",height:"1em",fill:"currentColor"},[n("path",{d:"M274.344554 173.673875c16.429399 0 30.950568 8.00526 39.956484 20.338945a34.906655 34.906655 0 0 1 14.660796 15.754537l1.117013 2.815803 210.138065 597.927736c6.795162 19.268474-5.329083 40.817516-27.041022 48.147913-20.641469 6.95806-42.493035-1.419537-50.451753-18.803052l-1.117013-2.815803-54.477653-154.939008H134.997185L80.566074 837.039954c-6.771891 19.268474-29.856826 28.949253-51.568765 21.618855-20.641469-6.981331-32.602816-26.761769-27.925325-45.239025l0.861031-2.908888L212.047809 212.58316c4.025901-11.426112 13.799764-19.477914 25.598214-22.619512 9.029188-10.006575 22.107548-16.289773 36.67526-16.289773z m386.416675 169.460176c21.828295 0 39.723774 10.890876 41.469106 24.713912l0.116356 2.210755v461.652153c0 14.893506-18.616883 26.947938-41.585462 26.947938-21.805024 0-39.700503-10.890876-41.422565-24.737183l-0.162897-2.210755V370.081989c0-14.870235 18.616883-26.924667 41.585462-26.924667z m-389.697901-48.171184L163.620643 600.628812h214.88537l-107.442685-305.665945z m602.163076-206.181978a12.566396 12.566396 0 0 1 8.144887 8.051802l32.509731 99.041817 101.694723 36.07021a12.566396 12.566396 0 0 1-0.791218 23.922695l-99.53051 27.995137-30.857483 97.552467a12.566396 12.566396 0 0 1-23.899423 0.116355l-32.509732-99.018546-98.669479-31.322905a12.566396 12.566396 0 0 1-0.186169-23.876152l97.505924-32.812256 30.834212-97.529195a12.566396 12.566396 0 0 1 15.754537-8.191429zM649.544557 0.513593c2.676177 0.884302 4.770576 3.025243 5.608336 5.724692l18.523798 59.294772 60.970292 20.66474a8.796477 8.796477 0 0 1-0.325796 16.755194l-60.73758 18.058377-19.780438 59.550754a8.796477 8.796477 0 0 1-16.731924-0.162898l-18.523798-59.271501-59.062061-17.825665a8.796477 8.796477 0 0 1-0.395609-16.708653l59.574025-20.943993 19.780438-59.574025a8.796477 8.796477 0 0 1 11.100317-5.561794z"},null)])])]):null,renderCodeContent:()=>n("div",{ref:a,class:i.e("box"),style:{[i.cssVarBlockName("placeholder")]:'"'.concat(s.placeHolder,'"')}},null),changeFullScreenState:H}},render(){var e,t;const a=!(null==(t=null==(e=this.controller.view)?void 0:e.state)?void 0:t.isLoading)&&this.isLoading;return this.isFullScreen?n(i("el-dialog"),{modelValue:this.isFullScreen,"onUpdate:modelValue":e=>this.isFullScreen=e,class:this.ns.b("dialog-full-screen"),onClose:()=>this.changeFullScreenState()},{default:()=>[b(n("div",{class:[this.ns.b(),this.ns.is(this.editorTheme,!!this.editorTheme),{[this.ns.b("editor-readonly")]:this.readonlyState},{[this.ns.b("editor-enable")]:!this.readonlyState}]},[this.renderTextEditorToolbar(),this.renderHeaderToolbar(),this.renderCodeContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null]),[[C("loading"),a]])]}):b(n("div",{class:[this.ns.b(),this.ns.is(this.editorTheme,!!this.editorTheme),{[this.ns.b("editor-readonly")]:this.readonlyState},{[this.ns.b("editor-enable")]:!this.readonlyState},this.ns.is("enable",this.hasEnableEdit)]},[this.renderTextEditorToolbar(),this.renderHeaderToolbar(),this.renderCodeContent(),this.hasEnableEdit&&!this.readonlyState?this.renderFooter():null]),[[C("loading"),a]])}});var IO=Object.defineProperty,xO=(e,t,a)=>(((e,t,a)=>{t in e?IO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class SO extends qi{constructor(){super(...arguments),xO(this,"deACMode"),xO(this,"editor"),xO(this,"monaco"),xO(this,"currentSelection"),xO(this,"chatCompletion",!1),xO(this,"inlineAiChatHeight")}get language(){return this.editorParams.codeType||this.editorParams.language||"typescript"}get theme(){return this.editorParams.theme||"vs-dark"}async onInit(){if(await super.onInit(),this.editorParams){const{inlineaichatheight:e}=this.editorParams;e&&(this.inlineAiChatHeight=Number(e))}const{appDEACModeId:e,appDataEntityId:t}=this.model;e&&(this.deACMode=await ga(e,t,this.context.srfappid)),this.deACMode&&"CHATCOMPLETION"===this.deACMode.actype&&(this.chatCompletion=!0)}onCreated(e,t){this.editor=e,this.monaco=t}getSelectionText(){var e,t,a;const n=null==(e=this.editor)?void 0:e.getSelection();let i;return n&&(i=null==(a=null==(t=this.editor)?void 0:t.getModel())?void 0:a.getValueInRange(n)),i||""}insertText(e){var t,a,n,i;if(!this.editor||!this.monaco)throw new Vt(ibiz.i18n.t("editor.code.editorNotInit"));const o=this.editor.getSelections();if(!o||0===o.length)return;const s=o[o.length-1],l=s.positionLineNumber,r=s.positionColumn,c="\n".concat(e,"\n");null==(t=this.editor)||t.executeEdits("",[{range:new this.monaco.Range(l,r,l,r),text:c}]);const d=c.split("\n"),u=l+(d.length-1)-1,h=(d[d.length-2]||"").length+1,p=new this.monaco.Position(u,h);null==(a=this.editor)||a.setPosition(p),null==(n=this.editor)||n.revealPositionInCenter(p),null==(i=this.editor)||i.focus()}replaceSelectionText(e){var t;const a=null==(t=this.editor)?void 0:t.getSelection();if(!a||a.isEmpty()||!this.monaco||!this.editor)return;const n=a.getStartPosition();this.editor.executeEdits("",[{range:a,text:e}]);const i=e.split("\n"),o=i.length,s=i[o-1].length;let l,r;1===o?(l=n.lineNumber,r=n.column+s):(l=n.lineNumber+(o-1),r=1+s);const c=new this.monaco.Range(l,r,l,r);this.editor.createDecorationsCollection().clear(),this.editor.setSelection(c),this.editor.focus()}restoreSelection(){var e;null==(e=this.editor)||e.focus()}getInLineAiEditorElement(){if(!this.editor)throw new Vt(ibiz.i18n.t("editor.code.editorNotInit"));return this.editor.getDomNode()}getInLineAiEditorTheme(){var e,t,a;return"vs-dark"===(null==(a=null==(t=null==(e=this.editor)?void 0:e._themeService)?void 0:t._theme)?void 0:a.themeName)?"dark":"light"}getInLineAiChatOptions(){var e,t,a,n,i,o;if(!this.editor||!this.monaco)throw new Vt(ibiz.i18n.t("editor.code.editorNotInit"));const s=null==(t=null==(e=this.editor)?void 0:e.getDomNode())?void 0:t.querySelector(".editor-scrollable");if(!s)throw new Vt(ibiz.i18n.t("editor.code.noEditorArea"));const l=null==(a=this.currentSelection)?void 0:a.getStartPosition();if(!l)throw new Vt(ibiz.i18n.t("editor.code.noSelStart"));const r=null==(n=this.editor)?void 0:n.getScrolledVisiblePosition(l),c=null==(o=null==(i=this.editor)?void 0:i.getDomNode())?void 0:o.getBoundingClientRect();if(!c)throw new Vt(ibiz.i18n.t("editor.code.noEditorRect"));if(!r)throw new Vt(ibiz.i18n.t("editor.code.noSelCoords"));const d=s.getBoundingClientRect(),u=this.editor.getLayoutInfo();return{left:d.left,top:c.top+r.top+r.height,width:d.width-u.minimap.minimapWidth-u.overviewRuler.width,editorElement:this.getInLineAiEditorElement(),editorTheme:this.getInLineAiEditorTheme(),height:this.inlineAiChatHeight}}async doInLineAIUIAction(e,t){const a=this.ctrl.getEventArgs();a.params=ko(a.params),a.params.editor=this,this.editorParams.srfaiappendcurdata&&"true"===this.editorParams.srfaiappendcurdata&&(a.context.srfaiappendcurdata=!0),await fa.exec(e,{...a},t)}}var EO=Object.defineProperty,DO=(e,t,a)=>(((e,t,a)=>{t in e?EO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class PO{constructor(){DO(this,"formEditor","IBizCode"),DO(this,"gridEditor","IBizCode")}async createController(e,t){const a=new SO(e,t);return await a.init(),a}}var kO=Object.defineProperty,zO=(e,t,a)=>(((e,t,a)=>{t in e?kO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class TO{constructor(){zO(this,"title","AI"),zO(this,"iconSvg",'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" height="1em" width="1em" preserveAspectRatio="xMidYMid meet" focusable="false" class="cherry-menu-AIChart"><g id="aae1.Base基础/1.icon图标/2.normal/ai-star" stroke-width="1" fill-rule="evenodd"><path d="M5.817 1.53l3.158 8.797h.054v.152l1.443 4.021-1.402.001-1.041-2.982H2.495l-1.03 2.982L0 14.5 4.671 1.533l1.146-.003zm7.86 5.424V14.5h-1.213V6.954h1.212zM5.248 3.549l-2.342 6.778h4.706L5.249 3.55zM13.046 0c.075 0 .147.02.204.071a.318.318 0 01.094.181l.064.273c.097.417.17.727.255.968.084.24.177.4.31.523.134.124.318.218.599.306.281.088.65.166 1.15.265a.358.358 0 01.195.095c.056.057.083.13.083.213a.289.289 0 01-.083.21.362.362 0 01-.197.094c-.528.093-.918.167-1.214.255-.295.088-.485.187-.621.324-.137.138-.23.324-.31.606-.08.283-.145.651-.23 1.147a.329.329 0 01-.093.184.293.293 0 01-.206.075.308.308 0 01-.207-.072.322.322 0 01-.1-.188l-.006-.033c-.085-.486-.149-.845-.228-1.12-.079-.274-.17-.452-.305-.585-.135-.133-.323-.23-.618-.32s-.683-.168-1.21-.273a.353.353 0 01-.2-.096.29.29 0 01-.08-.208c0-.079.023-.153.079-.211a.35.35 0 01.2-.097c.5-.098.869-.176 1.15-.263.282-.087.465-.18.597-.302.132-.12.224-.278.306-.511.082-.236.151-.539.244-.947l.071-.312a.312.312 0 01.102-.183.311.311 0 01.205-.069z" id="aae形状结合"></path></g></svg>'),zO(this,"tag","button")}isActive(){return!1}getValue(){return"aichart"}isDisabled(){return!1}exec(e){e.emit("aiClick")}}const AO={key:"aichart",factory:()=>new TO};var OO=Object.defineProperty,MO=(e,t,a)=>(((e,t,a)=>{t in e?OO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);const NO={type:"emoji",renderElem:e=>{const{data:t={}}=e;return Du("emoji-elem",{dataset:{value:t.emoji?Qt(t.emoji):""},props:{contentEditable:!1}},[])}};class BO{constructor(){MO(this,"title","".concat(ibiz.i18n.t("editor.html.wangEditor.emoji"))),MO(this,"tag","button"),MO(this,"iconSvg","<svg viewBox='0 0 1040 1024' version='1.1' xmlns='http://www.w3.org/2000/svg' p-id='1490' width='1em' height='1em' stroke='var(--w-e-toolbar-color)' > <path stroke-width='38' d='M512.075261 1024A511.774217 511.774217 0 1 1 730.482434 48.769072a37.630457 37.630457 0 1 1-32.061149 68.035867 436.513303 436.513303 0 1 0 250.468323 395.270322 37.630457 37.630457 0 0 1 75.260914 0 512.526826 512.526826 0 0 1-512.075261 511.924739z' p-id='1491' ></path> <path stroke-width='38' d='M333.857416 344.0929a57.348817 57.348817 0 1 0 57.348817 57.348817 57.499339 57.499339 0 0 0-57.348817-57.348817zM686.53006 344.0929a57.348817 57.348817 0 1 0 57.348817 57.348817 57.348817 57.348817 0 0 0-57.348817-57.348817zM515.236219 783.165074c-162.864619 0-262.359547-141.942084-262.359547-219.159782a30.104366 30.104366 0 0 1 60.208731 0c0 48.618551 76.314567 158.951051 202.150816 158.951051s193.571072-134.114949 193.571072-158.951051a30.104366 30.104366 0 0 1 60.208731 0c0 54.488902-90.012054 219.159782-253.779803 219.159782zM1009.549904 207.720123h-67.132735V139.985301a30.104366 30.104366 0 1 0-60.208732 0v67.734822h-67.734822a30.104366 30.104366 0 0 0-30.104366 30.104366 30.104366 30.104366 0 0 0 30.104366 30.104366h67.734822v67.734823a30.104366 30.104366 0 0 0 60.208732 0v-67.734823h67.734823a30.104366 30.104366 0 0 0 30.104365-30.104366 30.104366 30.104366 0 0 0-30.706453-30.104366z' p-id='1492' ></path> </svg>")}isActive(){return!1}getValue(){return!1}isDisabled(){return!1}exec(e){e.emit("openEmojiSelect")}}const LO={renderElems:[NO],elemsToHtml:[{type:"emoji",elemToHtml:e=>{const{data:t}=e;return"<span data-w-e-type=\"emoji\" class='emoji'>".concat(t.emoji,"</span>")}}],parseElemsHtml:[{selector:'span[data-w-e-type="emoji"]',parseElemHtml:e=>({data:{emoji:e.innerHTML},type:"emoji",children:[{text:""}]})}],menus:[{key:"emoji",factory:()=>new BO}]};var RO=Object.defineProperty,_O=(e,t,a)=>(((e,t,a)=>{t in e?RO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class jO{constructor(){_O(this,"title"),_O(this,"tag"),_O(this,"iconSvg"),this.title="AI",this.tag="button",this.iconSvg='<svg t="1763370094787" class="icon" version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024" width="14" height="14" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M274.344554 173.673875c16.429399 0 30.950568 8.00526 39.956484 20.338945a34.906655 34.906655 0 0 1 14.660796 15.754537l1.117013 2.815803 210.138065 597.927736c6.795162 19.268474-5.329083 40.817516-27.041022 48.147913-20.641469 6.95806-42.493035-1.419537-50.451753-18.803052l-1.117013-2.815803-54.477653-154.939008H134.997185L80.566074 837.039954c-6.771891 19.268474-29.856826 28.949253-51.568765 21.618855-20.641469-6.981331-32.602816-26.761769-27.925325-45.239025l0.861031-2.908888L212.047809 212.58316c4.025901-11.426112 13.799764-19.477914 25.598214-22.619512 9.029188-10.006575 22.107548-16.289773 36.67526-16.289773z m386.416675 169.460176c21.828295 0 39.723774 10.890876 41.469106 24.713912l0.116356 2.210755v461.652153c0 14.893506-18.616883 26.947938-41.585462 26.947938-21.805024 0-39.700503-10.890876-41.422565-24.737183l-0.162897-2.210755V370.081989c0-14.870235 18.616883-26.924667 41.585462-26.924667z m-389.697901-48.171184L163.620643 600.628812h214.88537l-107.442685-305.665945z m602.163076-206.181978a12.566396 12.566396 0 0 1 8.144887 8.051802l32.509731 99.041817 101.694723 36.07021a12.566396 12.566396 0 0 1-0.791218 23.922695l-99.53051 27.995137-30.857483 97.552467a12.566396 12.566396 0 0 1-23.899423 0.116355l-32.509732-99.018546-98.669479-31.322905a12.566396 12.566396 0 0 1-0.186169-23.876152l97.505924-32.812256 30.834212-97.529195a12.566396 12.566396 0 0 1 15.754537-8.191429zM649.544557 0.513593c2.676177 0.884302 4.770576 3.025243 5.608336 5.724692l18.523798 59.294772 60.970292 20.66474a8.796477 8.796477 0 0 1-0.325796 16.755194l-60.73758 18.058377-19.780438 59.550754a8.796477 8.796477 0 0 1-16.731924-0.162898l-18.523798-59.271501-59.062061-17.825665a8.796477 8.796477 0 0 1-0.395609-16.708653l59.574025-20.943993 19.780438-59.574025a8.796477 8.796477 0 0 1 11.100317-5.561794z" fill="black"></path></svg>'}getValue(e){return""}isActive(e){return!1}isDisabled(e){return e.getConfig().readOnly}exec(e,t){this.isDisabled(e)||e.emit("lineAiClick")}}const VO={key:"inline-ai",factory:()=>new jO};e("h",{link:{menuKeys:["inline-ai","editLink","unLink","viewLink"]},image:{menuKeys:["inline-ai","imageWidth30","imageWidth50","imageWidth100","editImage","viewImageLink","deleteImage"]},pre:{menuKeys:["inline-ai","enter","codeBlock","codeSelectLang"]},table:{menuKeys:["inline-ai","enter","tableHeader","tableFullWidth","insertTableRow","deleteTableRow","insertTableCol","deleteTableCol","deleteTable"]},divider:{menuKeys:["inline-ai","enter"]},video:{menuKeys:["inline-ai","enter","editVideoSize"]},text:{menuKeys:["inline-ai","headerSelect","insertLink","bulletedList","|","bold","through","color","bgColor","clearStyle"]}});class FO extends HTMLElement{static get observedAttributes(){return["data-value"]}attributeChangedCallback(e,t,a){if("data-value"===e){if(a&&t===a)return;const e=this.attachShadow({mode:"open"}),n=e.ownerDocument.createElement("span");n.innerHTML=a,n.part.add("box"),n.classList.add("emoji-elem_box"),e.appendChild(n)}}}const UO=e=>{const{isInline:t,isVoid:a}=e;return e.isInline=e=>"emoji"===os.getNodeType(e)||t(e),e.isVoid=e=>"emoji"===os.getNodeType(e)||a(e),e},HO=a({name:"IBizHtmlEmoji",props:{modal:{type:Object,required:!0}},setup:e=>({ns:B("html-emoji"),onSelect:t=>{const a={ok:!0,data:[{emoji:aa(t.data)}]};e.modal.dismiss(a)}}),render(){return n("div",{class:this.ns.b()},[n(i("iBizEmojiSelect"),{dark:!0,continuousList:!0,onSelect:this.onSelect},null)])}});var qO=Object.defineProperty,GO=(e,t,a)=>(((e,t,a)=>{t in e?qO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class WO extends qi{constructor(){super(...arguments),GO(this,"uploadParams"),GO(this,"exportParams"),GO(this,"deService"),GO(this,"deACMode"),GO(this,"chatCompletion",!1),GO(this,"wangEditor"),GO(this,"overlay",null),GO(this,"cleanup",Ut),GO(this,"presetPreventEvents",[13,38,40]),GO(this,"presetPreventPropEvents",[27]),GO(this,"inlineAiChatHeight")}async onInit(){if(await super.onInit(),this.customRegister(),this.editorParams){const{uploadParams:e,exportParams:t,uploadparams:a,exportparams:n,inlineaichatheight:i}=this.editorParams;if(e)try{this.uploadParams=JSON.parse(e)}catch(e){ibiz.log.error("编辑器[".concat(ibiz.log.error(e),"]编辑器参数 uploadParams 非 json 格式"))}if(a)try{this.uploadParams=JSON.parse(a)}catch(e){ibiz.log.error("编辑器[".concat(ibiz.log.error(e),"]编辑器参数 uploadparams 非 json 格式"))}if(t)try{this.exportParams=JSON.parse(t)}catch(e){ibiz.log.error("编辑器[".concat(ibiz.log.error(e),"]编辑器参数 exportParams 非 json 格式"))}if(n)try{this.exportParams=JSON.parse(n)}catch(e){ibiz.log.error("编辑器[".concat(ibiz.log.error(e),"]编辑器参数 exportparams 非 json 格式"))}i&&(this.inlineAiChatHeight=Number(i))}const e=this.model;e.appDEACModeId&&(this.deACMode=await ga(e.appDEACModeId,e.appDataEntityId,this.context.srfappid),this.deACMode&&"CHATCOMPLETION"===this.deACMode.actype&&(this.deService=await ibiz.hub.getApp(e.appId).deService.getService(this.context,e.appDataEntityId),this.chatCompletion=!0))}customRegister(){!window.aichartRegister&&ibiz.env.enableAI&&(ls.registerMenu(AO),ls.registerMenu(VO),window.aichartRegister=!0),window.customElements.get("emoji-elem")||window.customElements.define("emoji-elem",FO),window.emojiIsRegiter||(ls.registerModule(LO),window.emojiIsRegiter=!0),window.wangEditorPlugin||(ls.registerPlugin(UO),window.wangEditorPlugin=!0)}onCreated(e){this.wangEditor=e,this.listenEvent()}listenEvent(){const e=this.wangEditor.getEditableContainer();this.wangEditor.on("openEmojiSelect",()=>this.openEmojiSelect()),this.cleanup=Nt(e,"keydown",e=>{var t;this.overlay&&this.presetPreventEvents.includes(e.keyCode)&&e.preventDefault(),this.overlay&&this.presetPreventPropEvents.includes(e.keyCode)&&(e.stopPropagation(),null==(t=this.overlay)||t.dismiss())})}async openEmojiSelect(){const e=document.getSelection(),{focusNode:t}=e;t&&(this.overlay=ibiz.overlay.createPopover(e=>l(HO,{modal:e}),void 0,{width:"auto",noArrow:!0,autoClose:!0,placement:"bottom-start"}),await this.overlay.present(t.parentNode),this.overlay.onWillDismiss().then(e=>{var t;const a=e,n=null==(t=a.data)?void 0:t[0];a.ok&&n&&this.addEmojiNode(n),this.overlay=null}))}addEmojiNode(e){const t={data:e,type:"emoji",children:[{text:""}]};this.wangEditor.restoreSelection(),this.wangEditor.insertNode(t),this.wangEditor.move(1)}onDestroyed(){this.cleanup!==Ut&&this.cleanup(),this.overlay&&this.overlay.dismiss()}getSelectionText(){return this.wangEditor?this.wangEditor.getSelectionText():""}insertText(e){if(this.wangEditor){const t={type:"paragraph",children:[{text:e}]},a=this.wangEditor.selection;if(a){const e={anchor:a.anchor,focus:a.anchor};a.anchor.path===a.focus.path&&a.anchor.offset===a.focus.offset||(e.anchor=a.focus,e.focus=a.focus),this.wangEditor.select(e)}this.wangEditor.insertNode(t),this.wangEditor.move(1)}}replaceSelectionText(e){this.wangEditor&&(this.wangEditor.selection?(this.wangEditor.deleteFragment(),this.wangEditor.insertText(e)):this.wangEditor.insertText(e))}restoreSelection(){this.wangEditor&&this.wangEditor.restoreSelection()}getInLineAiEditorElement(){if(!this.wangEditor)throw new Vt("编辑器未初始化");return this.wangEditor.getEditableContainer()}getInLineAiEditorTheme(){return-1!==ibiz.util.theme.getTheme().indexOf("dark")?"dark":"light"}getInLineAiChatOptions(){if(!this.wangEditor)throw new Vt("编辑器未初始化");const e=this.wangEditor.getSelectionPosition();if(!e||!e.left||!e.top)throw new Vt("获取选区位置失败");const t=this.wangEditor.getEditableContainer().getBoundingClientRect();return{left:t.x+10,top:t.y+Number(e.top.replace("px","")),width:t.width-20,editorElement:this.getInLineAiEditorElement(),editorTheme:this.getInLineAiEditorTheme(),height:this.inlineAiChatHeight}}async doInLineAIUIAction(e,t){const a=this.ctrl.getEventArgs();a.params=ko(a.params),a.params.editor=this,this.editorParams.srfaiappendcurdata&&"true"===this.editorParams.srfaiappendcurdata&&(a.context.srfaiappendcurdata=!0),await fa.exec(e,{...a},t)}}var YO=Object.defineProperty,KO=(e,t,a)=>(((e,t,a)=>{t in e?YO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class XO{constructor(){KO(this,"formEditor","IBizHtml"),KO(this,"gridEditor","IBizHtml")}async createController(e,t){const a=new WO(e,t);return await a.init(),a}}var $O=Object.defineProperty,JO=(e,t,a)=>(((e,t,a)=>{t in e?$O(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class QO extends qi{constructor(){super(...arguments),JO(this,"uploadParams"),JO(this,"exportParams"),JO(this,"deService"),JO(this,"deACMode"),JO(this,"keyName","srfkey"),JO(this,"textName","srfmajortext"),JO(this,"sort","asc"),JO(this,"dataItems",[]),JO(this,"chatCompletion",!1),JO(this,"mdeditor",null),JO(this,"selectionAreaPosition",null),JO(this,"selectionDirection",!0),JO(this,"currentEditorTheme","light"),JO(this,"inlineAiChatHeight")}async onInit(){if(await super.onInit(),this.style.height||(this.style.height="600px"),this.editorParams){const{uploadparams:e,exportparams:t,inlineaichatheight:a}=this.editorParams;if(e)try{this.uploadParams=JSON.parse(e)}catch(t){throw new Xt(e,ibiz.i18n.t("editor.markdown.uploadJsonFormatErr"))}if(t)try{this.exportParams=JSON.parse(t)}catch(e){throw new Xt(t,ibiz.i18n.t("editor.markdown.exportJsonFormatErr"))}a&&(this.inlineAiChatHeight=Number(a))}const e=this.model;if(e.appDEACModeId&&(this.deACMode=await ga(e.appDEACModeId,e.appDataEntityId,this.context.srfappid),this.deACMode)){if("AUTOCOMPLETE"===this.deACMode.actype){const{minorSortAppDEFieldId:e,minorSortDir:t}=this.deACMode;e&&t&&(this.sort="".concat(e.toLowerCase(),",").concat(t.toLowerCase())),this.deACMode.textAppDEFieldId&&(this.textName=this.deACMode.textAppDEFieldId),this.deACMode.valueAppDEFieldId&&(this.keyName=this.deACMode.valueAppDEFieldId),this.deACMode.deacmodeDataItems&&(this.dataItems=[],this.deACMode.deacmodeDataItems.forEach(e=>{"value"!==e.id&&"text"!==e.id&&this.dataItems.push(e)}))}"CHATCOMPLETION"===this.deACMode.actype&&(this.deService=await ibiz.hub.getApp(e.appId).deService.getService(this.context,e.appDataEntityId),this.chatCompletion=!0)}}setMDEditor(e){this.mdeditor=e}setCursorPos(e,t){this.selectionAreaPosition={start:e,end:t}}setCurrentEditorTheme(e){this.currentEditorTheme=e}setSelectionDirection(e){this.selectionDirection=e}getCurrentTheme(){return"dark"===this.currentEditorTheme?"dark":"light"}getSelectionText(){var e;return null==(e=this.mdeditor)?void 0:e.editor.editor.getSelection()}getInLineAiEditorTheme(){return this.getCurrentTheme()}isPositionBefore(e,t){return e.line<t.line||!(e.line>t.line)&&e.ch<t.ch}insertText(e){var t,a,n;if(this.selectionAreaPosition){const{start:i,end:o}=this.selectionAreaPosition,s="\n".concat(e,"\n");if(!!(i.line===o.line&&i.ch===o.ch))return void(null==(t=this.mdeditor)||t.editor.editor.replaceSelection(s));let l;if(l=this.selectionDirection?o:i,null==(a=this.mdeditor)||a.editor.editor.setCursor(l),null==(n=this.mdeditor)||n.editor.editor.replaceSelection(s),!1===this.selectionDirection){const e=(s.match(/\n/g)||[]).length;this.selectionAreaPosition.start.line+=e,this.selectionAreaPosition.end.line+=e,this.selectionAreaPosition.end.ch-=this.selectionAreaPosition.start.ch,this.selectionAreaPosition.start.ch=0}this.restoreSelection()}}replaceSelectionText(e){var t;null==(t=this.mdeditor)||t.editor.editor.replaceSelection(e)}restoreSelection(){var e,t,a;null==(a=this.mdeditor)||a.editor.editor.setSelection(null==(e=this.selectionAreaPosition)?void 0:e.start,null==(t=this.selectionAreaPosition)?void 0:t.end)}getInLineAiChatOptions(){var e,t,a,n,i;const o=null==(e=this.mdeditor)?void 0:e.wrapperDom.getBoundingClientRect();(null==(t=this.mdeditor)?void 0:t.bubble.visible)||null==(a=this.mdeditor)||a.bubble.showBubble();const s=null==(n=this.mdeditor)?void 0:n.bubble.bubbleDom.getBoundingClientRect();return{left:o.left+10,top:s.top,width:o.width-58,editorElement:null==(i=this.mdeditor)?void 0:i.wrapperDom,editorTheme:this.getCurrentTheme(),height:this.inlineAiChatHeight}}getInLineAiEditorElement(){var e;return null==(e=this.mdeditor)?void 0:e.wrapperDom}async doInLineAIUIAction(e,t){const a=this.ctrl.getEventArgs();a.params=ko(a.params),a.params.editor=this,this.editorParams.srfaiappendcurdata&&"true"===this.editorParams.srfaiappendcurdata&&(a.context.srfaiappendcurdata=!0),await fa.exec(e,{...a},t)}}var ZO=Object.defineProperty,eM=(e,t,a)=>(((e,t,a)=>{t in e?ZO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class tM{constructor(){eM(this,"formEditor","IBizMarkDown"),eM(this,"gridEditor","IBizMarkDown")}async createController(e,t){const a=new QO(e,t);return await a.init(),a}}const aM=a({name:"IBizArray",props:ct(),emits:Ve(),setup(e,{emit:t}){const a=B("array"),n=e.controller,i=n.model;let s,l="default",d="default",u=0,h=!1,p="",m="",v="_blank";const g=o([]);i.editorParams&&(i.editorParams.editorStyle&&(l=i.editorParams.editorStyle),i.editorParams.editorstyle&&(l=i.editorParams.editorstyle),i.editorParams.size&&(d=i.editorParams.size),i.editorParams.limit&&(u=Yo(i.editorParams.limit)),i.editorParams.maxLength&&(s=Yo(i.editorParams.maxLength)),i.editorParams.maxlength&&(s=Yo(i.editorParams.maxlength)),i.editorParams.showWordLimit&&(h=n.toBoolean(i.editorParams.showWordLimit)),i.editorParams.showwordlimit&&(h=n.toBoolean(i.editorParams.showwordlimit)),i.editorParams.prepend&&(p=i.editorParams.prepend),i.editorParams.append&&(m=i.editorParams.append),i.editorParams.target&&(v=i.editorParams.target));const b=i.dataType,f=Object.is(b,"NUMBER")||Object.is(b,"INTEGER")?"number":"text",w=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{if(e&&e!==t&&0===g.value.length){const t=e.map(e=>({value:e,key:go()}));g.value=t}},{immediate:!0});const y=(e="blur")=>{const a=g.value.map(e=>e.value);e===n.triggerMode&&t("change",a)};return{ns:a,c:n,editorStyle:l,type:f,size:d,limit:u,maxLength:s,showWordLimit:h,prepend:p,append:m,target:v,items:g,getUrl:e=>{let t=e;return t&&(p&&(t=p+t),m&&(t+=m)),t},addItem:t=>{if(e.disabled||e.readonly)return;const a={key:go(),value:null};t?g.value.splice(t,0,a):g.value.push(a),y()},removeItem:e=>{g.value.splice(e,1),y()},handleChange:(e,t)=>{g.value[t].value=e,y()},handleInput:(e,t)=>{g.value[t].value=e,y("input")},onBlur:e=>{t("blur",e)},onFocus:e=>{t("focus",e)},handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},showFormDefaultContent:w}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[0===this.items.length?n("ion-icon",{class:this.ns.b("add-icon"),name:"add-outline",onClick:this.addItem},null):this.items.map((e,t)=>n("div",{class:this.ns.b("item"),key:e.key},["default"===this.editorStyle?n(i("el-input"),y({type:this.type,size:this.size,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,placeholder:this.c.placeHolder,disabled:this.disabled,readonly:this.readonly,onBlur:this.onBlur,onFocus:this.onFocus,onKeyup:this.handleKeyUp,onChange:e=>this.handleChange(e,t),onInput:e=>this.handleInput(e,t)},this.$attrs),null):n(i("el-tooltip"),{placement:"bottom",trigger:"hover","popper-class":this.ns.b("tooltip")},{default:()=>n(i("el-input"),y({type:this.type,size:this.size,modelValue:e.value,"onUpdate:modelValue":t=>e.value=t,placeholder:this.c.placeHolder,disabled:this.disabled,readonly:this.readonly,maxlength:Object.is(this.editorStyle,"url")?this.maxLength:null,"show-word-limit":Object.is(this.editorStyle,"url")?this.showWordLimit:null,onBlur:this.onBlur,onFocus:this.onFocus,onChange:e=>this.handleChange(e,t),onInput:e=>this.handleInput(e,t),onKeyup:this.handleKeyUp},this.$attrs),{prefix:()=>Object.is(this.editorStyle,"url")&&this.prepend?this.prepend:null,suffix:()=>Object.is(this.editorStyle,"url")&&this.append?this.append:null}),content:()=>{let t;return"img"===this.editorStyle?n(i("el-image"),{fit:"contain",src:e.value},null):n(i("el-link"),{href:this.getUrl(e.value),target:this.target},"function"==typeof(a=t=this.getUrl(e.value))||"[object Object]"===Object.prototype.toString.call(a)&&!s(a)?t:{default:()=>[t]});var a}}),!(this.disabled||this.readonly)&&n("div",{class:this.ns.b("icons")},[(!this.limit||this.items.length<this.limit)&&n("ion-icon",{class:this.ns.b("add-icon"),name:"add",onClick:()=>this.addItem(t+1)},null),n("ion-icon",{class:this.ns.b("remove-icon"),name:"remove",onClick:()=>this.removeItem(t)},null)])]))])}});class nM extends qi{}var iM=Object.defineProperty,oM=(e,t,a)=>(((e,t,a)=>{t in e?iM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class sM{constructor(){oM(this,"formEditor","IBizArray"),oM(this,"gridEditor","IBizArray")}async createController(e,t){const a=new nM(e,t);return await a.init(),a}}const lM=a({name:"IBizCascader",props:dt(),emits:Ve(),setup(e,{emit:t}){const a=B("cascader"),n=e.controller,i=n.model,s=o(null),l=o([]),c=i.editorItems;if(c&&c.length>0){const e=c.map(e=>({name:e.id,appId:e.appId,appDataEntityId:e.appDataEntityId,appDEDataSetId:e.appDEDataSetId}));l.value=e}let d="default",u="default",h=!0,p=!1,m="/";i.editorParams&&(i.editorParams.editorStyle&&(d=i.editorParams.editorStyle),i.editorParams.editorstyle&&(d=i.editorParams.editorstyle),i.editorParams.size&&(u=i.editorParams.size),i.editorParams.filterable&&(h=n.toBoolean(i.editorParams.filterable)),i.editorParams.multiple&&(p=n.toBoolean(i.editorParams.multiple)),i.editorParams.separator&&(m=i.editorParams.separator));const v=o([]),g=o([]),b=o(null),f=o([]),w=o([]),y=o([]),C=o(""),I=o(!1),x=o(!1),S=o(),E=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly)),D=e=>{e?x.value=e:setTimeout(()=>{x.value=e},100)};l.value&&l.value.length>0&&l.value.forEach(e=>{w.value.push({name:e.name,value:[]})});const P=(t,a)=>{const{level:n,value:i}=t;I.value=!0;let o=[];if(0===n)(()=>{if(e.value&&l.value){const t=[],a=JSON.parse(e.value);if(a.forEach(e=>{t.push({label:e,value:[]})}),w.value.forEach(t=>{const a=e.data[t.name]?e.data[t.name].split(","):[];t.value=a}),f.value=[],t.forEach((e,t)=>{w.value.forEach(a=>{e.value.push(a.value[t])});const a=e.value.join(m);f.value.push({label:e.label,value:a})}),f.value.forEach(e=>{const t=e.value.split(m),a=e.label.split(m);t.forEach((e,t)=>{g.value.find(t=>t.value===e)||g.value.push({value:e,label:a[t]})})}),Object.is(d,"default")){let e=[];p?f.value.forEach(t=>{e.push(t.value.split(m))}):e=f.value[0].value.split(m),b.value=e}else{b.value=p?a:a.join(m);const e=w.value[w.value.length-1].value;if(w.value.length>1){const t=w.value[w.value.length-2].value;t&&t.length>0&&t.forEach((t,a)=>{e[a]="".concat(t,"_").concat(e[a])})}y.value=e}}})(),v.value.length>0?a.forEach(e=>{const t=v.value.findIndex(t=>e.value===t.value);t>-1?Object.assign(v.value[t],e):(v.value.push(e),o.push(e))}):(v.value=[...a],o=[...a]);else{const e=(t,n)=>{t&&t.length>0&&t.forEach(t=>{t.value===i?t.children&&t.children.length>0?a.forEach(e=>{const a=t.children.findIndex(t=>t.value===e.value);a>-1?Object.assign(t.children[a],e):(t.children.push(e),o.push(e))}):(t.children=a,o=a):e(t.children)})};e(v.value)}const s=b.value||[];return setTimeout(()=>{b.value=s,I.value=!1}),o},k=()=>{var e,a;if(!I.value){w.value.forEach(e=>{e.value=[]}),(null==(e=b.value)?void 0:e.length)&&b.value.forEach((e,t)=>{"string"==typeof e?w.value[t].value.push(e):e.forEach((e,t)=>{w.value[t].value.push(e)})});const n=[];let i=[];(null==(a=b.value)?void 0:a.length)&&b.value.forEach(e=>{if(p){const t=e.map(e=>{const t=g.value.find(t=>t.value===e);if(t)return t.label});n.push(t)}else{const t=g.value.find(t=>t.value===e);t&&n.push(t.label)}}),w.value.forEach(e=>{t("change",e.value.length>0?e.value.join(","):null,e.name)}),n.length>0&&(p?n.forEach(e=>{i.push(e.join(m))}):i=[n.join(m)]),t("change",i.length>0?JSON.stringify(i):null),D(!1)}},z=r(()=>{if(e.value){return JSON.parse(e.value)[0]}return null});return{ns:a,c:n,valueItems:l,editorStyle:d,filterable:h,separator:m,onBlur:e=>{t("blur",e),D(!1)},onFocus:e=>{t("focus",e),D(!0)},treeData:v,items:g,selectValue:b,treeSelectData:f,valueItemData:w,defaultCheckedKeys:y,searchValue:C,isLoaded:I,getSize:()=>{switch(u){case"large":return"large";case"small":return"small";default:return"default"}},getIsLeaf:(e,t)=>e.leaf,getDisabled:(e,t)=>t.level!==l.value.length,loadData:async(e,t)=>{const{level:a}=e,i=Object.is(d,"default")?e.value:e.data?e.data.value:null,o=l.value[a];try{if(o.appDataEntityId&&o.appDEDataSetId){const{context:s,params:r}=await(async(e,t)=>{const a=ko(n.context),i=ko(n.params);if(e>0){const{appDataEntityId:a}=l.value[e-1],{appId:n,appDataEntityId:o}=l.value[e],s=await ibiz.hub.getAppDataEntity(o,n),{minorAppDERSs:r}=s;if(r){const e=r.find(e=>e.majorAppDataEntityId===a);e&&e.parentAppDEFieldId&&Object.assign(i,{["n_".concat(e.parentAppDEFieldId.toLowerCase(),"_eq")]:t})}}return{context:a,params:i}})(a,i),c=ibiz.hub.getApp(n.context.srfappid),u=await c.deService.exec(o.appDataEntityId,o.appDEDataSetId,s,r);if(u&&200===u.status&&u.data.length>0){const n=u.data.map((e,t)=>({...e,value:e.srfkey,label:e.srfmajortext?e.srfmajortext:ibiz.i18n.t("editor.cascader.ibizCascader.title",{index:t}),leaf:a===l.value.length-1,nodekey:"".concat(i?"".concat(i,"_").concat(e.srfkey):e.srfkey)}));if(n.forEach(e=>{const t=g.value.findIndex(t=>e.value===t.value);t>-1?g.value[t]=e:g.value.push(e)}),Object.is(d,"default")){t(P(e,n))}else t(n)}}t([])}catch(e){t([])}},treeRef:s,handleTreeClear:()=>{f.value=[],w.value.forEach(e=>{e.value=[]}),s.value&&s.value.setCheckedKeys([]),(()=>{const e=[];b.value=[],f.value.forEach(t=>{e.push(t.label)}),b.value=p?e:e.length>0?e[0]:null,w.value.forEach(e=>{t("change",e.value.length>0?e.value.join(","):null,e.name)}),t("change",b.value.length>0?JSON.stringify(b.value):null)})()},handleRemoveTag:()=>{setTimeout(()=>{k()})},multiple:p,handleCascaderValueChange:k,editorRef:S,valueText:z,isEditable:x,setEditable:D,showFormDefaultContent:E,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)}}},render(){const e=n(i("el-cascader"),y({ref:"editorRef",class:[this.ns.b("input")],"popper-class":this.ns.b("popper"),clearable:!0,teleported:!this.showFormDefaultContent,options:this.treeData,size:this.getSize(),separator:this.separator,filterable:this.filterable,placeholder:this.c.placeHolder?this.c.placeHolder:" ",props:{lazy:!0,multiple:this.multiple,lazyLoad:this.loadData},disabled:this.disabled,modelValue:this.selectValue,"onUpdate:modelValue":e=>this.selectValue=e,onBlur:this.onBlur,onFocus:this.onFocus,onRemoveTag:this.handleRemoveTag,onChange:this.handleCascaderValueChange},this.$attrs),null),t=n("div",{class:(this.ns.b(),this.ns.m("readonly"))},[this.valueText]),a=n("div",{class:this.ns.b("form-default-content")},[this.valueText?this.valueText:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)],onKeyup:this.handleKeyUp},[this.showFormDefaultContent&&a,this.readonly?t:e])}});class rM extends qi{}var cM=Object.defineProperty,dM=(e,t,a)=>(((e,t,a)=>{t in e?cM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class uM{constructor(){dM(this,"formEditor","IBizCascader"),dM(this,"gridEditor","IBizCascader")}async createController(e,t){const a=new rM(e,t);return await a.init(),a}}const hM=a({name:"IBizColorMPickerCustom",props:{value:{type:Array},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},defaultVal:{type:Array,default:()=>[]}},emits:["change"],setup(e,{emit:t}){const a=B("color-mpicker-custom"),s=[{text:ibiz.i18n.t("editor.colorPicker.selector"),value:"select"},{text:ibiz.i18n.t("editor.colorPicker.textValue"),value:"write"}],l=o(["#000000","#2C2C2C","#50555C","#ACB3BF","#D0D3D9","#C4C4C4","#DADADA","#E5E5E5","#F0F0F0","#F24E1E","#E99C58","#FFC700","#FF4D00","#FF00D6","#D82E57","#8E1DE8","#0ACF83","#18A0FB","#A259FF","#907CFF"]),r=o([]),d=o("select"),u=o("");return c(()=>e.value,()=>{e.value&&0!==e.value.length?(r.value=e.value,u.value=r.value.toString()):(u.value="",r.value=e.defaultVal||[])},{immediate:!0,deep:!0}),{ns:a,tabs:s,curSelect:d,colorStr:u,renderColorList:()=>r.value.map((o,s)=>n("div",{class:a.em("color-list","item")},[n(i("el-color-picker"),{modelValue:o,"onUpdate:modelValue":e=>o=e,disabled:e.disabled||e.readonly,predefine:l.value,onChange:e=>((e,a)=>{r.value[e]=a,t("change",[...r.value])})(s,e)},null),n("ion-icon",{name:"close-circle-outline",onClick:()=>(e=>{r.value.splice(e,1),r.value.length?t("change",[...r.value]):t("change",null)})(s)},null)])),onSelect:e=>{if(d.value=e,"select"===e){const e=u.value.split(",");r.value=e.filter(e=>/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(e))}else u.value=r.value.toString()},onAdd:()=>{e.readonly||e.disabled||(r.value.push("#FFFFFF"),t("change",[...r.value]))},onBlur:()=>{if("select"===d.value)t("change",r.value);else{const e=u.value.split(",");r.value=e.filter(e=>/^#([0-9a-fA-F]{6}|[0-9a-fA-F]{3})$/.test(e)),t("change",r.value)}}}},render(){return n("div",{class:this.ns.b()},[n("div",{class:[this.ns.e("tabs")]},[n("div",{class:[this.ns.e("anchor"),this.ns.is("select-text","write"===this.curSelect)]},[this.tabs.map(e=>n("div",{class:[this.ns.em("tabs","tab"),this.ns.is("selected",e.value===this.curSelect)],onClick:()=>this.onSelect(e.value)},[e.text]))])]),n("div",{class:this.ns.e("content")},["select"===this.curSelect?n("div",{class:this.ns.e("color-list")},[this.renderColorList(),n("div",{class:[this.ns.em("color-list","add"),this.ns.is("disabled",this.disabled||this.readonly)],onClick:this.onAdd,title:ibiz.i18n.t("editor.colorPicker.add")},[n("ion-icon",{name:"add-outline"},null)])]):n(i("el-input"),{type:"textarea",modelValue:this.colorStr,"onUpdate:modelValue":e=>this.colorStr=e,disabled:this.disabled,readonly:this.readonly,onBlur:this.onBlur},null)])])}}),pM=a({name:"IBizColorMPickerDefault",props:{value:{type:[Array,String]},customColorList:{type:String},type:{type:String,default:"ITEMS"},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const a=B("color-mpicker-default"),n=o("default"),i=o(""),s=o(!1),l=[{text:ibiz.i18n.t("editor.colorPicker.systemColor"),value:"default"},{text:ibiz.i18n.t("editor.colorPicker.templateColor"),value:"template"}],d=r(()=>e.customColorList?JSON.parse(e.customColorList):[{text:ibiz.i18n.t("editor.colorPicker.simpleBlue"),value:"ITEM"===e.type?["#6698FF"]:["#6698FF","#73DEB3","#7585A2","#F7BE21","#EE734A","#83D0EE"]},{text:ibiz.i18n.t("editor.colorPicker.autumnOrange"),value:"ITEM"===e.type?["#EE734A"]:["#EE734A","#7585A2","#FEC103","#9EB411","#CD8050","#DAD5B5"]},{text:ibiz.i18n.t("editor.colorPicker.Macaroon"),value:"ITEM"===e.type?["#467CE6"]:["#467CE6","#CD74CA","#4997CC","#BCBFE3","#666CEB","#82BC9A"]},{text:ibiz.i18n.t("editor.colorPicker.mintGreen"),value:"ITEM"===e.type?["#118299"]:["#118299","#13B3B3","#73DEB3","#FEC103","#9EB411","#83D0EE"]}]);return c(()=>e.value,()=>{e.value?"string"==typeof e.value?(n.value="default",s.value=!1):(n.value="template",s.value=!0,e.value.length>0&&(i.value=JSON.stringify(e.value))):(n.value="default",s.value=!1)},{immediate:!0,deep:!0}),{ns:a,curType:n,curTemplateColor:i,showTemplateList:s,colorType:l,templateColorList:d,handleTemplateColorChange:()=>{const e=JSON.parse(i.value);t("change",e)},handleSchemeChange:()=>{var e,a;"default"===n.value?(s.value=!1,t("change",null==(a=null==(e=d.value[0])?void 0:e.value)?void 0:a[0])):s.value=!0}}},render(){return n("div",{class:this.ns.b()},[n(i("el-select"),{class:this.ns.b("picker"),"popper-class":this.ns.b("popper"),modelValue:this.curType,"onUpdate:modelValue":e=>this.curType=e,onChange:this.handleSchemeChange},{default:()=>this.colorType.map(e=>n(i("el-option"),{key:e.value,label:e.text,value:e.value},null))}),this.showTemplateList&&n(i("el-select"),{class:this.ns.b("template-color-picker"),"popper-class":this.ns.b("popper"),modelValue:this.curTemplateColor,"onUpdate:modelValue":e=>this.curTemplateColor=e,onChange:this.handleTemplateColorChange},{default:()=>this.templateColorList.map(e=>n(i("el-option"),{key:e.key,label:e.text,value:JSON.stringify(e.value)},{default:()=>n("div",{class:this.ns.b("template-color-picker-option")},[Array.isArray(e.value)?e.value.map(e=>n("div",{class:this.ns.be("template-color-picker","icon"),style:{background:e}},null)):n("div",{class:this.ns.be("template-color-picker","icon"),style:{background:e.value}},null),n("div",{class:this.ns.be("template-color-picker","text")},[e.text])])})),prefix:()=>{if(this.curTemplateColor){const e=JSON.parse(this.curTemplateColor);return Array.isArray(e)?e.map(e=>n("div",{class:this.ns.be("template-color-picker","icon"),style:{background:e}},null)):n("div",{class:this.ns.be("template-color-picker","icon"),style:{background:e[0]}},[e[0]])}}})])}}),mM=a({name:"IBizColorPicker",props:ut(),emits:Ve(),setup(e,{emit:t}){var a,n,i,s,l,d,u,h;const p=B("color-picker"),m=e.controller,v=o(""),g=o(null),b="true"===(null==(a=m.editorParams)?void 0:a.MULTIPLE)||"true"===(null==(n=m.editorParams)?void 0:n.multiple),f="true"===(null==(i=m.editorParams)?void 0:i.CUSTOM)||"true"===(null==(s=m.editorParams)?void 0:s.custom),w=(null==(l=m.editorParams)?void 0:l.TYPE)||(null==(d=m.editorParams)?void 0:d.type),y=(null==(u=m.editorParams)?void 0:u.CUSTOMCOLORLIST)||(null==(h=m.editorParams)?void 0:h.customcolorlist)||"",C=o(["#000000","#2C2C2C","#50555C","#ACB3BF","#D0D3D9","#C4C4C4","#DADADA","#E5E5E5","#F0F0F0","#F24E1E","#E99C58","#FFC700","#FF4D00","#FF00D6","#D82E57","#8E1DE8","#0ACF83","#18A0FB","#A259FF","#907CFF"]),I=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{e!==t&&(v.value=b?e||(f?[]:""):e||"")},{immediate:!0});const x=r(()=>m.style?m.style:null);return{ns:p,c:m,currentVal:v,predefineColors:C,contentStyle:x,colorPicker:g,multiple:b,isCustom:f,customColorList:y,type:w,handleChange:e=>{t("change",e)},showPicker:e=>{setTimeout(()=>{g.value&&g.value.show()},200)},onFocus:e=>{t("focus",e)},onBlur:e=>{t("blur",e)},showFormDefaultContent:I,onChange:e=>{t("change",e)}}},render(){var e,t,a;if(this.multiple)return this.isCustom?n(hM,{value:this.currentVal||[],onChange:this.onChange,readonly:this.readonly,disabled:this.disabled,defaultVal:this.controller.defaultVal},null):n(pM,{value:this.currentVal||"",type:this.type,customColorList:this.customColorList,readonly:this.readonly,disabled:this.disabled,onChange:this.onChange},null);let o=null;return o=this.readonly?"".concat(null==(e=this.currentVal)?void 0:e.toString()):n("span",{class:this.ns.b("content"),style:this.contentStyle,onClick:this.showPicker},[n(i("el-color-picker"),y({ref:"colorPicker",modelValue:this.currentVal,"onUpdate:modelValue":e=>this.currentVal=e,disabled:this.disabled,onChange:this.handleChange,onBlur:this.onBlur,onFocus:this.onFocus,size:"small",predefine:this.predefineColors,"show-alpha":!0},this.$attrs),null),"true"===(null==(t=this.c.editorParams)?void 0:t.isHiddenText)||"true"===(null==(a=this.c.editorParams)?void 0:a.ishiddentext)?null:n("span",{class:this.ns.b("text")},[this.currentVal])]),n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)],style:{color:this.currentVal||""}},[o])}});var vM=Object.defineProperty,gM=(e,t,a)=>(((e,t,a)=>{t in e?vM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class bM extends qi{constructor(){super(...arguments),gM(this,"defaultVal",[])}async onInit(){await super.onInit();const{defaultVal:e,defaultval:t}=this.editorParams;e&&(this.defaultVal=JSON.parse(e)),t&&(this.defaultVal=JSON.parse(t))}}var fM=Object.defineProperty,wM=(e,t,a)=>(((e,t,a)=>{t in e?fM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class yM{constructor(){wM(this,"formEditor","IBizColorPicker"),wM(this,"gridEditor","IBizColorPicker")}async createController(e,t){const a=new bM(e,t);return await a.init(),a}}const CM=a({name:"IBizPresetRawitem",props:$e(),emits:Ve(),setup(e,{emit:t}){const a=B("preset-rawitem"),n=e.controller,i=n.model,{componentRef:s}=je(()=>t("focus"),()=>t("blur")),l=n.model.predefinedType,r=o("");return c(()=>e.value,(e,t)=>{e!==t&&(r.value=e)},{immediate:!0}),{ns:a,editorModel:i,editorRef:s,type:l,content:r}},render(){let e=null;return e="FIELD_IMAGE"===this.type?n(i("iBizRawItem"),{content:this.content,type:"IMAGE"},null):"FIELD_TEXT_DYNAMIC"===this.type?n(i("iBizRawItem"),{content:this.content,type:"TEXT"},null):n("div",null,[ibiz.i18n.t("editor.preset.ibizPresetRawitem.noSupportType",{type:this.type})]),n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):""],ref:"editorRef"},[e])}}),IM=a({name:"IBizCarousel",props:ht(),emits:Ve(),setup(e){var t;const a=B("carousel"),n=e.controller,i=n.model,s="true"===(null==(t=null==n?void 0:n.editorParams)?void 0:t.enablenoaccess),l=o([]),r=o(!0),d=o(3e3);c(()=>e.value,e=>{"string"==typeof e&&(l.value=e?JSON.parse(e):[])},{immediate:!0});return c(l,t=>{(null==t?void 0:t.length)&&t.forEach(t=>{const a=((e,t)=>{const a={...n.editorParams,enableNoAccess:s};return a.exportparams&&(a.exportParams=JSON.parse(a.exportparams)),a.globaldownloadprifix?a.globalDownloadPrifix="true"===a.globaldownloadprifix:a.globalDownloadPrifix=ibiz.config.common.globalDownloadPrifix,t&&t.folder&&(a.osscat=t.folder),ibiz.util.file.calcFileUpDownUrl(n.context,n.params,e,a).downloadUrl})(e.data,t);t.imgUrl=t.imgUrl||a.replace("%fileId%",t.id),ibiz.config.common.enableDownloadTicket&&!s&&ibiz.util.file.getDownloadTicket(n.context,n.params,e.data,{fileId:t.id},n.downloadTicketParams).then(e=>{e&&e.ticket&&(t.imgUrl=a.replace("%fileId%",e.ticket))})})},{immediate:!0}),{ns:a,c:n,editorModel:i,carouselData:l,isAuto:r,timeSpan:d}},render(){return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.e(this.editorModel.editorType)]},[n(i("iBizCarouselComponent"),y({carouselData:this.carouselData,isAuto:this.isAuto,timeSpan:this.timeSpan},this.$attrs),null)])}});class xM extends qi{}var SM=Object.defineProperty,EM=(e,t,a)=>(((e,t,a)=>{t in e?SM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class DM{constructor(){EM(this,"formEditor","IBizCarousel"),EM(this,"gridEditor","IBizCarousel")}async createController(e,t){const a=new xM(e,t);return await a.init(),a}}var PM=Object.defineProperty,kM=(e,t,a)=>(((e,t,a)=>{t in e?PM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class zM extends qi{constructor(){super(...arguments),kM(this,"searchBarFilters",[]),kM(this,"filterControllers",[]),kM(this,"appDataEntity",null)}async onInit(){await super.onInit(),await this.initByEntitySchema(),await this.initSearchBarFilters()}async initByEntitySchema(){if(!this.model.appDataEntityId)return;const e=await ibiz.hub.getAppDataEntity(this.model.appDataEntityId,this.context.srfappid);e&&(this.appDataEntity=e);const t=await Wi(this.model.appDataEntityId,this.context);if(!t)return;const a=await Yi(t,this.model.appDataEntityId,this.model.appId);this.searchBarFilters=a}async initSearchBarFilters(){var e;(null==(e=this.searchBarFilters)?void 0:e.length)&&this.appDataEntity&&(this.searchBarFilters.forEach(e=>{const t=new Ki(e,this.appDataEntity,this.context,this.params);this.filterControllers.push(t)}),await Promise.all(this.filterControllers.map(e=>e.init())))}}var TM=Object.defineProperty,AM=(e,t,a)=>(((e,t,a)=>{t in e?TM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class OM{constructor(){AM(this,"formEditor","IBizSearchCondEdit"),AM(this,"gridEditor","IBizSearchCondEdit")}async createController(e,t){const a=new zM(e,t);return await a.init(),a}}const MM=a({name:"IBizSearchCondEdit",props:Fe(),emits:Ve(),setup(e,{emit:t}){const a=B("searchcond-edit"),s=e.controller,l=o(null),d=o(!1),u=o(),h=o([]),p=o();let m;const v=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));c(()=>e.value,(e,t)=>{if(e!==t)if(null==e)l.value="",h.value=Xi();else if("string"==typeof e&&(l.value=e,e))try{const t=JSON.parse(e);h.value=t.map(e=>$i(e))}catch(t){ibiz.log.error("".concat(e,"值格式不正确,必须为json字符串"))}},{immediate:!0});const g=()=>{h.value=Xi()};g();const b=e=>{e?d.value=e:setTimeout(()=>{d.value=e},100)};c(u,t=>{if(e.autoFocus&&t){t.$el.getElementsByTagName("input")[0].focus()}});const f=()=>{const e=Ji(h.value);e&&(l.value=JSON.stringify(e,null,2))},w=async()=>{m=ibiz.overlay.createPopover(()=>n(i("iBizFilterTreeControl"),{filterControllers:s.filterControllers,filterNodes:h.value,parent:"searchcond-edit",onConfirm:()=>{f(),m&&m.dismiss(),t("change",l.value)},onCancel:()=>{g(),f(),t("change","")}},null),void 0,{placement:"bottom-end",autoClose:!0}),m.present(p.value.$el),await m.onWillDismiss(),m=void 0};return{ns:a,c:s,currentVal:l,handleChange:e=>{t("change",e)},onFocus:e=>{t("focus",e),b(!0)},onBlur:e=>{t("blur",e),b(!1)},editorRef:u,handleKeyUp:e=>{e&&"Enter"===e.code&&t("enter",e)},isEditable:d,setEditable:b,showFormDefaultContent:v,filterNodes:h,triggerFilter:()=>{m?m.dismiss():w()},filterButtonRef:p,resetFilter:g}},render(){let e=null;return e=this.readonly?fo(this.currentVal)?"":"".concat(this.currentVal):[n(i("el-input"),y({ref:"editorRef",class:[this.ns.b("input")],"model-value":this.currentVal,type:"textarea",rows:10,placeholder:this.c.placeHolder,disabled:this.disabled,controls:!1,onFocus:this.onFocus,onBlur:this.onBlur,onKeyup:this.handleKeyUp},this.$attrs),null),n(i("el-button"),{ref:"filterButtonRef",type:"primary",title:Tt(ibiz.i18n.t("app.edit")),class:this.ns.b("filter"),onClick:()=>this.triggerFilter()},{default:()=>[n(i("iBizIcon"),{icon:{cssClass:"fa fa-edit"}},null)]})],n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("editable",this.isEditable),this.ns.is("show-default",this.showFormDefaultContent)]},[e])}});var NM=a({name:"BIQuarterRangeSelect",props:{value:{type:Array,default:()=>[]}},emits:["change","visibleChange"],setup(e,{emit:t}){const a=B("bi-quarter-range-select"),i=o(),s=o(),l=o(),r=o(),d=o(),u=o(!1),h=["Q1","Q2","Q3","Q4"],p=(e,t,a)=>{let n=3*t;"START"===a&&(n-=2);const i=new Date("".concat(e,"-").concat(n));if("START"===a)i.setDate(1),i.setHours(0,0,0,0);else{[1,3,5,7,8,10,12].includes(n)?i.setDate(31):i.setDate(30),i.setHours(23,59,59,0)}return i};c(()=>e.value,e=>{if(e&&Array.isArray(e)&&e.length>0){const t=new Date(e[0]),a=new Date(e[1]);i.value=t.getFullYear();const n=a.getFullYear();i.value===n?s.value=i.value+1:s.value=n;const o=Math.ceil((t.getMonth()+1)/3),c=Math.ceil((a.getMonth()+1)/3);l.value=p(i.value,o,"START"),r.value=p(n,c,"END")}else i.value=(new Date).getFullYear(),s.value=(new Date).getFullYear()+1,l.value=null,r.value=null},{immediate:!0,deep:!0});const m=e=>"right"===e&&i.value===s.value?n("div",null,null):n("svg",{onClick:()=>(e=>{"left"===e?i.value-=1:s.value-=1})(e),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aav1.icon图标/5.navigation/angle-double-left","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.984 7l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7l.005.006L7.984 7zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3l.005.006L7.984 3z",id:"aav形状结合",transform:"rotate(-90 7.949 7.822)"},null)])]),v=e=>"left"===e&&i.value===s.value?n("div",null,null):n("svg",{onClick:()=>(e=>{"left"===e?i.value+=1:s.value+=1})(e),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aaw1.icon图标/5.navigation/angle-double-right","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.984 7.3l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7.3l.005.006.006-.006zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3.3l.005.006.006-.006z",id:"aaw形状结合",transform:"rotate(90 7.949 8.122)"},null)])]),g=(e,a)=>{if(l.value&&r.value&&(l.value=null,r.value=null),l.value){const n=l.value.getFullYear(),i=l.value.getMonth()+1,o=Math.ceil(i/3);e>n?r.value=p(e,a,"END"):e<n?(r.value=p(n,o,"END"),l.value=p(e,a,"START")):a>=o?r.value=p(e,a,"END"):(r.value=p(n,o,"END"),l.value=p(e,a,"START")),t("change",[l.value.toLocaleDateString(),r.value.toLocaleDateString()]),u.value=!1}else l.value=p(e,a,"START")},b=(e,t)=>{if(i.value&&s.value&&l.value&&r.value){const a=l.value.getFullYear(),n=r.value.getFullYear(),i=l.value.getMonth()+1,o=r.value.getMonth()+1,s=Math.ceil(i/3),c=Math.ceil(o/3);if(e>a&&e<n)return!0;if(e===a&&e<n&&t>=s)return!0;if(e===n&&e>a&&t<=c)return!0;if(e===a&&e===n&&t<=c&&t>=s)return!0}return!1},f=(e,t)=>{if(i.value&&s.value&&l.value&&!r.value&&d.value){const a=d.value.getFullYear(),n=d.value.getMonth()+1,i=Math.ceil(n/3);let o=l.value,s=d.value;const r=l.value.getFullYear(),c=l.value.getMonth()+1,u=Math.ceil(c/3);a<=r&&i<=u&&(s=l.value,o=d.value);const h=o.getFullYear(),p=s.getFullYear(),m=o.getMonth()+1,v=s.getMonth()+1,g=Math.ceil(m/3),b=Math.ceil(v/3);if(e>h&&e<p)return!0;if(e===h&&e<p&&t>=g)return!0;if(e===p&&e>h&&t<=b)return!0;if(a<=r&&i<u&&e===a&&t>=i&&t<=u)return!0;if(a>=r&&i>u&&e===a&&t<=i&&t>=u)return!0}return!1},w=(e,t)=>{if(l.value){const a=l.value.getFullYear(),n=l.value.getMonth()+1,i=Math.ceil(n/3);if(e===a&&i===t)return!0}if(r.value){const a=r.value.getFullYear(),n=r.value.getMonth()+1,i=Math.ceil(n/3);if(e===a&&i===t)return!0}return!1},y=(e,t)=>!!d.value&&d.value.getTime()===p(e,t,"START").getTime(),C=(e,t)=>{const a=p(e,t,"START"),n=new Date,i=a.getMonth()+1,o=Math.ceil(i/3),s=n.getFullYear(),l=n.getMonth()+1,r=Math.ceil(l/3);return e===s&&o===r},I=(e,t)=>{d.value=p(e,t,"START")},x=()=>{d.value=null};return{ns:a,renderSelect:()=>n("div",{class:a.e("date-panel")},[n("div",{class:a.em("date-panel","left")},[n("div",{class:a.em("date-panel","left-header")},[m("left"),n("span",null,[i.value,ibiz.i18n.t("editor.dateRangeSelect.year")]),v("left")]),n("div",{class:a.em("date-panel","left-content")},[h.map((e,t)=>n("div",{class:[a.em("date-panel","left-item"),a.is("include",b(i.value,t+1)),a.is("selected",w(i.value,t+1)),a.is("hoverinclude",f(i.value,t+1)),a.is("curquarter",C(i.value,t+1)),a.is("hover",y(i.value,t+1))],onClick:()=>g(i.value,t+1),onMouseenter:()=>I(i.value,t+1),onMouseleave:()=>x()},[e]))])]),n("div",{class:a.em("date-panel","right")},[n("div",{class:a.em("date-panel","right-header")},[m("right"),n("span",null,[s.value,ibiz.i18n.t("editor.dateRangeSelect.year")]),v("right")]),n("div",{class:a.em("date-panel","right-content")},[h.map((e,t)=>n("div",{class:[a.em("date-panel","right-item"),a.is("selected",w(s.value,t+1)),a.is("include",b(s.value,t+1)),a.is("hoverinclude",f(s.value,t+1)),a.is("curquarter",C(s.value,t+1)),a.is("hover",y(s.value,t+1))],onClick:()=>g(s.value,t+1),onMouseenter:()=>I(s.value,t+1),onMouseleave:()=>x()},[e]))])])]),visible:u,handleClose:()=>{u.value=!1},handleOpen:()=>{u.value=!0},visibleChange:e=>{t("visibleChange",e)}}},render(){return n("div",{class:this.ns.b()},[n(i("el-popover"),{visible:this.visible,"onUpdate:visible":e=>this.visible=e,trigger:"click",width:600,"popper-class":this.ns.b("quarter-pop"),placement:"right",onAfterEnter:()=>this.visibleChange(!0),onAfterLeave:()=>this.visibleChange(!1)},{default:()=>this.renderSelect(),reference:()=>n("div",null,null)})])}}),BM=a({name:"BIYearRangeSelect",props:{value:{type:Array,default:()=>[]}},emits:["change","visibleChange"],setup(e,{emit:t}){const a=B("bi-year-range-select"),i=o(),s=o(!1),l=o([(new Date).getFullYear()-(new Date).getFullYear()%10,(new Date).getFullYear()+(9-(new Date).getFullYear()%10)]),r=o([(new Date).getFullYear()+(10-(new Date).getFullYear()%10),(new Date).getFullYear()+(19-(new Date).getFullYear()%10)]),d=o({start:void 0,end:void 0}),u=o([]),h=o([]),p=(e,t)=>{let a=e-1;const n=[];for(;a<=t+1;)n.push(a),a+=1;return n};u.value=p(l.value[0],l.value[1]),h.value=p(r.value[0],r.value[1]),c(()=>e.value,e=>{if(e&&Array.isArray(e)&&e.length>0){const t=Number(e[0]),a=Number(e[1]);Number.isNaN(t)||Number.isNaN(a)||(l.value=[t-t%10,t+(9-t%10)],d.value.start=t,r.value=[a-a%10,a+(9-a%10)],d.value.end=a)}else l.value=[(new Date).getFullYear()-(new Date).getFullYear()%10,(new Date).getFullYear()+(9-(new Date).getFullYear()%10)],r.value=[(new Date).getFullYear()+(10-(new Date).getFullYear()%10),(new Date).getFullYear()+(19-(new Date).getFullYear()%10)]},{immediate:!0,deep:!0});const m=e=>"right"===e&&l.value&&r.value&&l.value.at(-1)===r.value[0]-1?n("div",null,null):n("svg",{onClick:()=>(e=>{"left"===e?(l.value[0]-=10,l.value[1]-=10,u.value=p(l.value[0],l.value[1])):(r.value[0]-=10,r.value[1]-=10,h.value=p(r.value[0],r.value[1]))})(e),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aav1.icon图标/5.navigation/angle-double-left","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.984 7l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7l.005.006L7.984 7zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3l.005.006L7.984 3z",id:"aav形状结合",transform:"rotate(-90 7.949 7.822)"},null)])]),v=e=>"left"===e&&l.value&&r.value&&l.value.at(-1)===r.value[0]-1?n("div",null,null):n("svg",{onClick:()=>(e=>{"left"===e?(l.value[0]+=10,l.value[1]+=10,u.value=p(l.value[0],l.value[1])):(r.value[0]+=10,r.value[1]+=10,h.value=p(r.value[0],r.value[1]))})(e),viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false",fill:"currentColor"},[n("g",{id:"aaw1.icon图标/5.navigation/angle-double-right","stroke-width":"1","fill-rule":"evenodd"},[n("path",{d:"M7.984 7.3l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 7.3l.005.006.006-.006zm0-4l4.75 4.762-.832.817-3.924-3.924-3.99 3.99-.825-.836L7.973 3.3l.005.006.006-.006z",id:"aaw形状结合",transform:"rotate(90 7.949 8.122)"},null)])]),g=e=>{if(d.value.start&&d.value.end&&(d.value.start=void 0,d.value.end=void 0),d.value.start){if(e>=d.value.start)d.value.end=e;else{const t=d.value.start;d.value.start=e,d.value.end=t}t("change",[null==(a=d.value.start)?void 0:a.toString(),null==(n=d.value.end)?void 0:n.toString()]),s.value=!1}else d.value.start=e;var a,n},b=e=>!!(d.value.start&&d.value.end&&e>=d.value.start&&e<=d.value.end),f=e=>{if(d.value.start&&!d.value.end&&i.value){let t=d.value.start,a=i.value;if(i.value<d.value.start&&(a=d.value.start,t=i.value),e>=t&&e<=a)return!0}return!1},w=e=>d.value.start===e||d.value.end===e,y=e=>e===(new Date).getFullYear(),C=e=>{i.value=e},I=()=>{i.value=null};return{ns:a,visible:s,renderSelect:()=>{var e,t;return n("div",{class:a.e("date-panel")},[n("div",{class:a.em("date-panel","left")},[n("div",{class:a.em("date-panel","left-header")},[m("left"),n("span",null,[null==(e=l.value)?void 0:e.join("-")]),v("left")]),n("div",{class:a.em("date-panel","left-content")},[u.value.map(e=>n("div",{class:[a.em("date-panel","left-item"),a.is("selected",w(e)),a.is("include",b(e)),a.is("hover",i.value===e),a.is("curyear",y(e)),a.is("hoverinclude",f(e))],onClick:()=>g(e),onMouseenter:()=>C(e),onMouseleave:()=>I()},[e]))])]),n("div",{class:a.em("date-panel","right")},[n("div",{class:a.em("date-panel","right-header")},[m("right"),n("span",null,[null==(t=r.value)?void 0:t.join("-")]),v("right")]),n("div",{class:a.em("date-panel","right-content")},[h.value.map(e=>n("div",{class:[a.em("date-panel","right-item"),a.is("selected",w(e)),a.is("include",b(e)),a.is("hover",i.value===e),a.is("curyear",y(e)),a.is("hoverinclude",f(e))],onClick:()=>g(e),onMouseenter:()=>C(e),onMouseleave:()=>I()},[e]))])])])},handleClose:()=>{s.value=!0},handleOpen:()=>{s.value=!0},visibleChange:e=>{s.value=e,t("visibleChange",e)}}},render(){return n("div",{class:this.ns.b()},[n(i("el-popover"),{visible:this.visible,"onUpdate:visible":e=>this.visible=e,trigger:"click",width:600,placement:"top",onAfterEnter:()=>this.visibleChange(!0),onAfterLeave:()=>this.visibleChange(!1)},{default:()=>this.renderSelect(),reference:()=>n("div",null,null)})])}});e("c","undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{});function LM(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}!function(e){e.exports=function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=t(e),n={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(e,t){return"W"===t?e+"周":e+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(e,t){var a=100*e+t;return a<600?"凌晨":a<900?"早上":a<1100?"上午":a<1300?"中午":a<1800?"下午":"晚上"}};return a.default.locale(n,null,!0),n}(as)}({exports:{}});const RM=a({name:"IBizDateRangeSelect",components:{"bi-quarter-range-select":NM,"bi-year-range-select":BM,"bi-week-range-select":a({props:{value:{type:Array,default:()=>[]}},emits:["change","visibleChange"],setup(e,{emit:t}){const a=B("bi-week-range"),n=o(),i=o(),s=o(!1),l=as(new Date).format("YYYY/MM/DD"),r=o(),d=o();let u=!1;const h=o(),p=()=>{r.value=null,d.value=null};c(()=>e.value,e=>{e&&Array.isArray(e)?(r.value=new Date(e[0]),d.value=new Date(e[1])):p()},{immediate:!0,deep:!0});const m=e=>{const t=e.getDay();let a=t;0===t&&(a=7);const n=e.getTime()+24*(7-a)*60*60*1e3,i=new Date(n);return i.setHours(23,59,59,0),i},v=e=>{const t=e.getDay();let a=t;0===t&&(a=7);const n=e.getTime()-24*(a-1)*60*60*1e3,i=new Date(n);return i.setHours(0,0,0,0),i},g=e=>{const{date:t}=e;if(h.value){const e=v(h.value),a=m(h.value),n=t.getTime();if(e.getTime()<=n&&a.getTime()>=n)return!0}return!1};return{ns:a,curValue:n,weekRangeRef:i,isInRange:e=>{const{date:t}=e,a=t.getTime();if(r.value&&d.value){const e=r.value.getTime(),t=d.value.getTime();if(a>=e&&a<=t)return!0}return!1},isInHoverRange:e=>{var t;const{date:a}=e,n=a.getTime();if(r.value&&!d.value&&h.value){const a=null==(t=h.value)?void 0:t.getTime();let i=r.value,o=h.value;a<r.value.getTime()&&(o=r.value,i=h.value);const s=i.getTime(),l=o.getTime();return n>=s&&n<=l||g(e)}return!1},isEnded:e=>{const{date:t}=e;if(d.value){const e=m(d.value),a=v(d.value);return t.getTime()>=a.getTime()&&t.getTime()<=e.getTime()}},isStarted:e=>{const{date:t}=e;if(r.value){const e=m(r.value),a=v(r.value);return t.getTime()>=a.getTime()&&t.getTime()<=e.getTime()}},isToday:e=>e.dayjs.format("YYYY/MM/DD")===l,weekRangeClick:()=>{s.value?i.value.handleClose():i.value.handleOpen()},cellClick:e=>{const{date:t}=e;if(u){const e=m(t),a=v(t);a.getTime()>r.value.getTime()?d.value=e:(d.value=m(r.value),r.value=a),u=!1}else p(),r.value=v(t),u=!0},visibleChange:e=>{s.value=e,t("visibleChange",e)},handleChange:()=>{if(r.value&&d.value){const e=r.value.toLocaleDateString(),a=d.value.toLocaleDateString();t("change",[e,a])}},handleClose:()=>{i.value.handleClose()},handleOpen:()=>{i.value.handleOpen()},isHover:g,isMonday:e=>{const{date:t}=e;return 1===t.getDay()},isSunday:e=>{const{date:t}=e;return 0===t.getDay()},onMouseHover:e=>{const{date:t}=e;h.value=t},onMouseleave:()=>{h.value=null}}},render(){return n("div",{class:this.ns.b(),onClick:this.weekRangeClick},[n(i("el-date-picker"),{ref:"weekRangeRef",modelValue:this.curValue,"onUpdate:modelValue":e=>this.curValue=e,"popper-class":this.ns.b("picker-pop"),type:"daterange",onChange:this.handleChange,onVisibleChange:this.visibleChange},{default:e=>n("div",{class:[this.ns.e("cell-item"),this.ns.is("inrange",this.isInRange(e)&&!this.isEnded(e)&&!this.isStarted(e)),this.ns.is("inhoverrange",this.isInHoverRange(e)&&!this.isEnded(e)&&!this.isStarted(e)),this.ns.is("hover",this.isHover(e)&&!this.isEnded(e)&&!this.isStarted(e)),this.ns.is("left",0===e.column),this.ns.is("right",6===e.column),this.ns.is("ended",this.isEnded(e)),this.ns.is("started",this.isStarted(e)),this.ns.is("monday",this.isMonday(e)),this.ns.is("sunday",this.isSunday(e))],onMouseenter:()=>this.onMouseHover(e),onMouseleave:()=>this.onMouseleave(),onClick:()=>this.cellClick(e)},[n("span",{class:[this.ns.em("cell-item","text"),this.ns.is("today",this.isToday(e))]},[e.text])])})])}})},props:mt(),emits:pt(),setup(e,{emit:t}){const a=B("date-range-select"),l=e.controller,r=o(l.defaultUnit),u=o(),h=o("DYNAMIC"),p=o({DYNAMIC:null,STATIC:null}),v=o({ALL:!1,STATIC:!1,DYNAMIC:!1}),g=o(),b=o(!1),f=[{value:"DAY",label:ibiz.i18n.t("editor.dateRangeSelect.day")},{value:"WEEK",label:ibiz.i18n.t("editor.dateRangeSelect.week")},{value:"MONTH",label:ibiz.i18n.t("editor.dateRangeSelect.month")},{value:"QUARTER",label:ibiz.i18n.t("editor.dateRangeSelect.quarter")},{value:"YEAR",label:ibiz.i18n.t("editor.dateRangeSelect.year")}],w=[{caption:ibiz.i18n.t("editor.dateRangeSelect.static"),type:"STATIC"},{caption:ibiz.i18n.t("editor.dateRangeSelect.dynamic"),type:"DYNAMIC"}],y=(e,t,a,n)=>{g.value=l.handleTimeToText(e,r.value,t,a,n)},C=()=>{u.value=l.initDefaultDate(r.value);const{start:a,end:n,emitStart:i,emitEnd:o}=e.controller.computedDateTypesTime(r.value,"DYNAMIC",u.value[0],u.value[1]);y("DYNAMIC",u.value,a,n),t("change",{unit:r.value,type:"DYNAMIC",start:i,end:o})},I=()=>{C()},x=(a,n)=>{v.value[a]=!1,v.value.ALL=!1,u.value=n;const{start:i,end:o,emitStart:s,emitEnd:l}=e.controller.computedDateTypesTime(r.value,a,n[0],n[1]);y(a,n,i,o),t("change",{start:s,end:l,unit:r.value,type:h.value})},S=(t,a)=>{var n;a||(v.value[t]=!1,v.value.STATIC||v.value.DYNAMIC||b.value?(b.value=!1,(null==(n=e.value)?void 0:n.type)&&h.value!==e.value.type&&(v.value.ALL=!1,x(h.value,u.value))):v.value.ALL=!1)},E=e=>{e.stopPropagation(),e.preventDefault(),v.value.ALL=!v.value.ALL},D=(e,t)=>{p.value[e]=t},P=e=>{if("QUARTER"===r.value)return n(i("bi-quarter-range-select"),{ref:t=>D(e,t),class:[a.em("date-type","editor"),a.em("date-type","quarter")],value:u.value,onVisibleChange:t=>S(e,t),onChange:t=>x(e,t)},null);if("YEAR"===r.value)return n(i("bi-year-range-select"),{ref:t=>D(e,t),class:[a.em("date-type","editor"),a.em("date-type","year")],value:u.value,onVisibleChange:t=>S(e,t),onChange:t=>x(e,t)},null);if("WEEK"===r.value)return n(i("bi-week-range-select"),{ref:t=>D(e,t),class:[a.em("date-type","editor"),a.em("date-type","week")],value:u.value,onChange:t=>x(e,t),onVisibleChange:t=>S(e,t)},null);const t="DAY"===r.value?"daterange":"monthrange",o="DAY"===r.value?"YYYY-MM-DD":"YYYY-MM";return n(i("el-date-picker"),{ref:t=>D(e,t),modelValue:u.value,"onUpdate:modelValue":e=>u.value=e,class:a.em("date-type","editor"),type:t,format:"YYYY-MM-DD","value-format":o,onVisibleChange:t=>S(e,t),onChange:t=>x(e,t)},null)},k=()=>{v.value.DYNAMIC||v.value.STATIC||(v.value.ALL=!1)};return c(()=>e.value,t=>{if(t&&Object.keys(t).length>0){const{start:a,end:n,unit:i,type:o}=t;if(r.value=i,h.value=o,"TIME"===e.controller.emitMode){u.value="YEAR"===i?[new Date(String(a)).getFullYear(),new Date(String(n)).getFullYear()]:[as(a).format("YYYY-MM-DD"),as(n).format("YYYY-MM-DD")];const{start:t,end:s}=e.controller.computedDateTypesTime(r.value,o,a,n);y(h.value,u.value,t,s)}else u.value=l.computedDynamicTimeToDate(r.value,h.value,a,n),y(h.value,u.value,a,n)}else C()},{immediate:!0}),d(()=>{window.addEventListener("click",k)}),m(()=>{window.removeEventListener("click",k)}),{ns:a,c:l,renderDateUnit:()=>{let e;return n("div",{class:a.e("date-unit")},[n("span",{class:a.em("date-unit","label")},[ibiz.i18n.t("editor.dateRangeSelect.dateUnit")]),n("div",{class:a.em("date-unit","editor")},[n(i("el-select"),{modelValue:r.value,"onUpdate:modelValue":e=>r.value=e,class:a.em("date-unit","editor-select"),onChange:I},(t=e=f.map(e=>n(i("el-option"),{key:e.value,value:e.value,label:e.label},{default:()=>e.label})),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))])]);var t},renderDateRange:()=>n("div",{class:a.e("date-range")},[n("div",{class:a.em("date-range","label")},[ibiz.i18n.t("editor.dateRangeSelect.daterange")]),n(i("el-popover"),{visible:v.value.ALL||v.value.DYNAMIC||v.value.STATIC,trigger:"click",width:"240px","popper-class":a.b("date-range-select")},{reference:()=>n("div",{class:a.em("date-range","editor"),onClick:E},[n("span",{class:a.em("select","time-caption")},[n("div",{class:a.e("select-value")},[g.value])]),n("i",{class:"fa fa-angle-down","aria-hidden":"true"},null)]),default:()=>n("div",{class:a.e("date-type")},[w.map(t=>n("div",{class:a.em("date-type","item"),onClick:a=>((t,a)=>{if(a.stopPropagation(),a.preventDefault(),v.value.STATIC||v.value.DYNAMIC?(v.value[h.value]=!1,b.value=!0,p.value[t].handleClose()):(b.value=!0,h.value=t,v.value[t]=!0,p.value[t].handleOpen()),u.value&&Array.isArray(u.value)&&u.value.length>0){const{start:t,end:a}=e.controller.computedDateTypesTime(r.value,h.value,u.value[0],u.value[1]);y(h.value,u.value,t,a)}})(t.type,a)},[n("span",{class:a.em("date-type","item-caption")},[t.caption]),n("span",{class:a.em("date-type","item-icon")},[t.type===h.value&&n("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",height:"1em",width:"1em",focusable:"false"},[n("g",{id:"agctips/check","stroke-width":"1","fill-rule":"evenodd"},[n("path",{id:"agc路径-12",d:"M6.012 11.201L1.313 6.832l-.817.879 5.54 5.15 9.304-9.163-.842-.855z"},null)])]),n("i",{class:"fa fa-angle-right","aria-hidden":"true"},null)]),P(t.type)]))])})]),onOpen:E}},render(){return n("div",{class:this.ns.b(),onClick:this.onOpen},[this.c.switchUnit&&this.renderDateUnit(),this.renderDateRange()])}});var _M=Object.defineProperty,jM=(e,t,a)=>(((e,t,a)=>{t in e?_M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class VM extends qi{constructor(){super(...arguments),jM(this,"switchUnit",!0),jM(this,"defaultUnit","DAY"),jM(this,"emitMode","DEFAULT"),jM(this,"initDefaultDate",e=>{const t=new Date((new Date).toLocaleDateString());if("DAY"===e){const e=new Date(t.getTime()-6048e5),a=t.toLocaleDateString().replaceAll("/","-");return[as(e).format("YYYY-MM-DD"),as(a).format("YYYY-MM-DD")]}if("WEEK"===e){const e=t.getDay();let a=e;0===e&&(a=7);const n=t.getTime()+24*(7-a)*60*60*1e3,i=new Date(n).toLocaleDateString().replaceAll("/","-"),o=t.getTime()-36288e5;return[new Date(o).toLocaleDateString().replaceAll("/","-"),i]}if("MONTH"===e){const e=t.getFullYear(),a=t.getMonth()+1;let n=e,i=a-6;i<1&&(i+=12,n-=1);let o="".concat(i),s="".concat(a);return i<10&&(o="0".concat(o)),a<10&&(s="0".concat(a)),["".concat(n,"-").concat(o),"".concat(e,"-").concat(s)]}if("QUARTER"===e){const e=t.getFullYear();return["".concat(e,"-1"),"".concat(e,"-12")]}if("YEAR"===e)return[t.getFullYear(),t.getFullYear()]}),jM(this,"handleTimeToText",(e,t,a,n,i)=>{if(!a||Array.isArray(a)&&!a.length)return"";const o=new Date(a[0]),s=new Date(a[1]),l=o.getFullYear(),r=s.getFullYear(),c=o.getMonth()+1,d=s.getMonth()+1,u=this.getYearWeek(o),h=this.getYearWeek(s);let p=a.join("~"),m="";if("DAY"===t&&(p=a.join("~")),"WEEK"===t){const e="".concat(l,"-").concat(u).concat(ibiz.i18n.t("editor.dateRangeSelect.week")),t="".concat(r,"-").concat(h).concat(ibiz.i18n.t("editor.dateRangeSelect.week"));p="".concat(e,"~").concat(t)}if("MONTH"===t){let e=c,t=d;c<10&&(e="0".concat(c)),d<10&&(t="0".concat(d)),p="".concat(l,"-").concat(e," ~ ").concat(r,"-").concat(t)}if("QUARTER"===t){const e=Math.ceil(c/3),t=Math.ceil(d/3);p="".concat(l,"-Q").concat(e," ~ ").concat(r,"-Q").concat(t)}return"YEAR"===t&&(p="".concat(a[0]," ~ ").concat(a[1])),m="STATIC"===e?ibiz.i18n.t("editor.dateRangeSelect.static"):"DAY"===t?this.computedTextOfDay(n,i):"WEEK"===t?this.computedTextOfWeek(n,i):"MONTH"===t?this.computedTextOfMonth(n,i):"QUARTER"===t?this.computedTextOfQuarter(n,i,l,r,c,d):"YEAR"===t?this.computedTextOfYear(n,i):this.computedTextOfDay(n,i),"".concat(m," | ").concat(p)})}async init(){await super.onInit(),this.editorParams&&(this.editorParams.switchUnit&&(this.switchUnit="true"===this.editorParams.switchUnit),this.editorParams.switchunit&&(this.switchUnit="true"===this.editorParams.switchunit),this.editorParams.defaultUnit&&(this.defaultUnit=this.editorParams.defaultUnit),this.editorParams.defaultunit&&(this.defaultUnit=this.editorParams.defaultunit),this.editorParams.emitMode&&(this.emitMode=this.editorParams.emitMode),this.editorParams.emitmode&&(this.emitMode=this.editorParams.emitmode))}computedDynamicTimeToDate(e,t,a,n){if("STATIC"===t){const t=new Date(1e3*a),i=new Date(1e3*n);return"YEAR"===e?[t.getFullYear(),i.getFullYear()]:[as(t).format("YYYY-MM-DD"),as(i).format("YYYY-MM-DD")]}const i=new Date;if(i.setHours(0,0,0,0),"WEEK"===e){return[this.timeSpanConvertToWeek(i,a),this.timeSpanConvertToWeek(i,n)]}if("MONTH"===e){return[this.timeSpanConvertToMonth(i,a),this.timeSpanConvertToMonth(i,n)]}if("QUARTER"===e){return[this.timeSpanConvertToQuarter(i,a),this.timeSpanConvertToQuarter(i,n)]}if("YEAR"===e){return[i.getFullYear()+a,i.getFullYear()+n]}const o=24*a*60*60*1e3,s=24*n*60*60*1e3,l=new Date(i.getTime()+o),r=new Date(i.getTime()+s);return[as(l).format("YYYY-MM-DD"),as(r).format("YYYY-MM-DD")]}timeSpanConvertToQuarter(e,t){const a=t%4;let n=Math.floor(Math.abs(t)/4);t<0&&(n=-n);let i=e.getFullYear()+n;const o=e.getMonth()+1;let s=Math.ceil(o/3)+a;return s<0&&(i-=1,s+=4),s>4&&(i+=1,s-=4),"".concat(i,"-").concat(3*s)}timeSpanConvertToWeek(e,t){const a=e.getTime();return new Date(a+7*t*24*60*60*1e3).toLocaleDateString()}timeSpanConvertToMonth(e,t){const a=t%12;let n=Math.floor(Math.abs(t)/12);t<0&&(n=-n);let i=e.getFullYear()+n,o=e.getMonth()+1+a;return o<0&&(i-=1,o+=12),o>12&&(i+=1,o-=12),o<10?"".concat(i,"-0").concat(o):"".concat(i,"-").concat(o)}computedDateTypesTime(e,t,a,n){const i={start:0,end:0,emitStart:0,emitEnd:0};if("STATIC"===t){const{start:t,end:o}=this.computedStaticTime(e,a,n);Object.assign(i,{start:t,end:o,emitStart:t,emitEnd:o})}else{const{start:t,end:o}=this.computedDynamicTime(e,a,n);Object.assign(i,{start:t,end:o,emitStart:t,emitEnd:o})}if("TIME"===this.emitMode){const t=this.computedFullDateFormat(a,e,"START"),o=this.computedFullDateFormat(n,e,"END");Object.assign(i,{emitStart:t,emitEnd:o})}return i}computedFullDateFormat(e,t,a){const n=new Date(String(e)),i=n.getMonth()+1,o=[1,3,5,7,8,10,12];return"START"===a?n.setHours(0,0,0,0):n.setHours(23,59,59,0),"MONTH"===t&&("START"===a?n.setDate(1):2===i?n.setDate(29):o.includes(i)?n.setDate(31):n.setDate(30)),"QUARTER"===t&&("START"===a?n.setDate(1):2===i?n.setDate(29):o.includes(i)?n.setDate(31):n.setDate(30)),"YEAR"===t&&("START"===a?(n.setMonth(0),n.setDate(1)):(n.setMonth(11),n.setDate(31))),n.toLocaleString()}computedDynamicTime(e,t,a){switch(e){case"DAY":default:return this.computedDaysSpace(t,a);case"WEEK":return this.computedWeeksSpace(t,a);case"MONTH":return this.computedMonthsSpace(t,a);case"QUARTER":return this.computedQuartersSpace(t,a);case"YEAR":return this.computedYearsSpace(t,a)}}computedDaysSpace(e,t){const a=new Date,n=new Date(e),i=new Date(t);a.setHours(0,0,0,0),n.setHours(0,0,0,0),i.setHours(0,0,0,0);return{start:(n.getTime()-a.getTime())/864e5,end:(i.getTime()-a.getTime())/864e5}}computedWeeksSpace(e,t){const a=new Date,n=new Date(e),i=new Date(t);a.setHours(0,0,0,0),n.setHours(0,0,0,0),i.setHours(0,0,0,0);const o=(e,t)=>{const a=this.getDateWeekMonday(e);return(this.getDateWeekMonday(t).getTime()-a.getTime())/6048e5};return{start:o(a,n),end:o(a,i)}}getDateWeekMonday(e){const t=e.getDay();let a=t;0===t&&(a=7);const n=e.getTime()-24*(a-1)*60*60*1e3;return new Date(n)}getYearWeek(e){const t=new Date(e.getFullYear(),0,1);let a=e.getDay();0===a&&(a=7);let n=t.getDay();0===n&&(n=7);const i=e.getTime()-t.getTime(),o=Math.floor((i+864e5*(n-a))/864e5);return Math.ceil(o/7)+1}computedMonthsSpace(e,t){const a=new Date,n=new Date(e),i=new Date(t),o=(e,t)=>{const a=e.getFullYear(),n=e.getMonth()+1;return 12*(t.getFullYear()-a)-n+(t.getMonth()+1)};return{start:o(a,n),end:o(a,i)}}computedQuartersSpace(e,t){const a=new Date,n=new Date(e),i=new Date(t),o=(e,t)=>{const a=e.getFullYear(),n=e.getMonth()+1,i=Math.ceil(n/3),o=t.getFullYear(),s=t.getMonth()+1;return 4*(o-a)-i+Math.ceil(s/3)};return{start:o(a,n),end:o(a,i)}}computedYearsSpace(e,t){const a=(new Date).getFullYear();return{start:new Date("".concat(e)).getFullYear()-a,end:new Date("".concat(t)).getFullYear()-a}}computedStaticTime(e,t,a){switch(e){case"DAY":default:return this.computedDaysTime(t,a);case"WEEK":return this.computedWeeksTime(t,a);case"MONTH":return this.computedMonthsTime(t,a);case"QUARTER":return this.computedQuartersTime(t,a);case"YEAR":return this.computedYearsTime(t,a)}}computedDaysTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedWeeksTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedMonthsTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),[1,3,5,7,8,10,12].includes(n.getMonth()+1)?n.setDate(31):1===n.getMonth()?n.setDate(29):n.setDate(30),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedQuartersTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedYearsTime(e,t){const a=new Date(e),n=new Date(t);a.setHours(0,0,0,0),n.setMonth(11),n.setDate(31),n.setHours(23,59,59,0);return{start:a.getTime()/1e3,end:n.getTime()/1e3}}computedTextOfDay(e,t){let a="";if(e===t&&0===e)a=ibiz.i18n.t("editor.dateRangeSelect.today");else if(0===t&&e<0)a="".concat(ibiz.i18n.t("editor.dateRangeSelect.recently")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.day"));else{const n="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.day")),i="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.day"));a="".concat(n," ~ ").concat(i)}return a}computedTextOfWeek(e,t){let a="";if(e===t&&0===e)a=ibiz.i18n.t("editor.dateRangeSelect.currentWeek");else if(0===t&&e<0)a="".concat(ibiz.i18n.t("editor.dateRangeSelect.recently")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.week"));else{const n="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.week")),i="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.week"));a="".concat(n," ~ ").concat(i)}return a}computedTextOfMonth(e,t){let a="";if(e===t&&0===e)a=ibiz.i18n.t("editor.dateRangeSelect.pastTime");else if(0===t&&e<0)a="".concat(ibiz.i18n.t("editor.dateRangeSelect.recently")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.month"));else{const n="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.month")),i="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.month"));a="".concat(n," ~ ").concat(i)}return a}computedTextOfQuarter(e,t,a,n,i,o){let s="";const l=(new Date).getFullYear(),r=Math.ceil(i/3),c=Math.ceil(o/3);if(a===n&&1===r&&4===c)s=ibiz.i18n.t("editor.dateRangeSelect.currentYear");else if(e===t&&0===e)s=ibiz.i18n.t("editor.dateRangeSelect.currentYear");else if(0===t&&e<0&&l===a)s="".concat(ibiz.i18n.t("editor.dateRangeSelect.currentYear")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.quarter"));else{const a="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.quarter")),n="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.quarter"));s="".concat(a," ~ ").concat(n)}return s}computedTextOfYear(e,t){let a="";if(e===t&&0===e)a=ibiz.i18n.t("editor.dateRangeSelect.currentYear");else if(0===t&&e<0)a="".concat(ibiz.i18n.t("editor.dateRangeSelect.recently")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.year"));else{const n="".concat(e>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(e)).concat(ibiz.i18n.t("editor.dateRangeSelect.year")),i="".concat(t>0?ibiz.i18n.t("editor.dateRangeSelect.future"):ibiz.i18n.t("editor.dateRangeSelect.pastTime")).concat(Math.abs(t)).concat(ibiz.i18n.t("editor.dateRangeSelect.year"));a="".concat(n," ~ ").concat(i)}return a}}var FM=Object.defineProperty,UM=(e,t,a)=>(((e,t,a)=>{t in e?FM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class HM{constructor(){UM(this,"formEditor","IBizDateRangeSelect"),UM(this,"gridEditor","IBizDateRangeSelect")}async createController(e,t){const a=new VM(e,t);return await a.init(),a}}var qM={exports:{}};!function(e){e.exports=function(){function e(e,t,a,n){function i(e){return e instanceof a?e:new a(function(t){t(e)})}return new(a||(a=Promise))(function(t,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){e.done?t(e.value):i(e.value).then(o,s)}l((n=n.apply(e,[])).next())})}function t(e,t){function a(e){return function(t){return n([e,t])}}function n(a){if(i)throw new TypeError("Generator is already executing.");for(;r;)try{if(i=1,o&&(s=2&a[0]?o.return:a[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,a[1])).done)return s;switch(o=0,s&&(a=[2&a[0],s.value]),a[0]){case 0:case 1:s=a;break;case 4:return r.label++,{value:a[1],done:!1};case 5:r.label++,o=a[1],a=[0];continue;case 7:a=r.ops.pop(),r.trys.pop();continue;default:if(!((s=0<(s=r.trys).length&&s[s.length-1])||6!==a[0]&&2!==a[0])){r=0;continue}if(3===a[0]&&(!s||a[1]>s[0]&&a[1]<s[3]))r.label=a[1];else if(6===a[0]&&r.label<s[1])r.label=s[1],s=a;else{if(!(s&&r.label<s[2])){s[2]&&r.ops.pop(),r.trys.pop();continue}r.label=s[2],r.ops.push(a)}}a=t.call(e,r)}catch(e){a=[6,e],o=0}finally{i=s=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}var i,o,s,l,r={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l}function a(e){var t=[];return e.AMapUI&&t.push(n(e.AMapUI)),e.Loca&&t.push(i(e.Loca)),Promise.all(t)}function n(e){return new Promise(function(t,a){var n=[];if(e.plugins)for(var i=0;i<e.plugins.length;i+=1)-1==l.AMapUI.plugins.indexOf(e.plugins[i])&&n.push(e.plugins[i]);if(r.AMapUI===o.failed)a("前次请求 AMapUI 失败");else if(r.AMapUI===o.notload){r.AMapUI=o.loading,l.AMapUI.version=e.version||l.AMapUI.version,i=l.AMapUI.version;var s=document.body||document.head,d=document.createElement("script");d.type="text/javascript",d.src="https://webapi.amap.com/ui/"+i+"/main.js",d.onerror=function(e){r.AMapUI=o.failed,a("请求 AMapUI 失败")},d.onload=function(){if(r.AMapUI=o.loaded,n.length)window.AMapUI.loadUI(n,function(){for(var e=0,a=n.length;e<a;e++){var i=n[e].split("/").slice(-1)[0];window.AMapUI[i]=arguments[e]}for(t();c.AMapUI.length;)c.AMapUI.splice(0,1)[0]()});else for(t();c.AMapUI.length;)c.AMapUI.splice(0,1)[0]()},s.appendChild(d)}else r.AMapUI===o.loaded?e.version&&e.version!==l.AMapUI.version?a("不允许多个版本 AMapUI 混用"):n.length?window.AMapUI.loadUI(n,function(){for(var e=0,a=n.length;e<a;e++){var i=n[e].split("/").slice(-1)[0];window.AMapUI[i]=arguments[e]}t()}):t():e.version&&e.version!==l.AMapUI.version?a("不允许多个版本 AMapUI 混用"):c.AMapUI.push(function(e){e?a(e):n.length?window.AMapUI.loadUI(n,function(){for(var e=0,a=n.length;e<a;e++){var i=n[e].split("/").slice(-1)[0];window.AMapUI[i]=arguments[e]}t()}):t()})})}function i(e){return new Promise(function(t,a){if(r.Loca===o.failed)a("前次请求 Loca 失败");else if(r.Loca===o.notload){r.Loca=o.loading,l.Loca.version=e.version||l.Loca.version;var n=l.Loca.version,i=l.AMap.version.startsWith("2"),s=n.startsWith("2");if(i&&!s||!i&&s)a("JSAPI 与 Loca 版本不对应!!");else{i=l.key,s=document.body||document.head;var d=document.createElement("script");d.type="text/javascript",d.src="https://webapi.amap.com/loca?v="+n+"&key="+i,d.onerror=function(e){r.Loca=o.failed,a("请求 AMapUI 失败")},d.onload=function(){for(r.Loca=o.loaded,t();c.Loca.length;)c.Loca.splice(0,1)[0]()},s.appendChild(d)}}else r.Loca===o.loaded?e.version&&e.version!==l.Loca.version?a("不允许多个版本 Loca 混用"):t():e.version&&e.version!==l.Loca.version?a("不允许多个版本 Loca 混用"):c.Loca.push(function(e){e?a(e):a()})})}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var o,s;(s=o||(o={})).notload="notload",s.loading="loading",s.loaded="loaded",s.failed="failed";var l={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},r={AMap:o.notload,AMapUI:o.notload,Loca:o.notload},c={AMapUI:[],Loca:[]},d=[],u=function(e){"function"==typeof e&&(r.AMap===o.loaded?e(window.AMap):d.push(e))};return{load:function(n){var i=this;return new Promise(function(s,c){if(r.AMap==o.failed)c("");else if(r.AMap==o.notload){var h=n.key,p=n.version,m=n.plugins;if(h){window.AMap&&"lbs.amap.com"!==location.host&&c("禁止多种API加载方式混用"),l.key=h,l.AMap.version=p||l.AMap.version,l.AMap.plugins=m||l.AMap.plugins,r.AMap=o.loading;var v=document.body||document.head;window.___onAPILoaded=function(e){if(delete window.___onAPILoaded,e)r.AMap=o.failed,c(e);else for(r.AMap=o.loaded,a(n).then(function(){s(window.AMap)}).catch(c);d.length;)d.splice(0,1)[0]()};var g=document.createElement("script");g.type="text/javascript",h="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+l.AMap.version+"&key="+h+"&plugin="+l.AMap.plugins.join(","),fetch(h).then(function(a){return e(i,void 0,void 0,function(){var e;return t(this,function(t){switch(t.label){case 0:return[4,a.text()];case 1:return e=t.sent(),g.textContent=e.replace("define.amd","undefined"),v.appendChild(g),[2]}})})}).catch(function(e){r.AMap=o.failed,c(e)})}else c("请填写key")}else if(r.AMap==o.loaded)if(n.key&&n.key!==l.key)c("多个不一致的 key");else if(n.version&&n.version!==l.AMap.version)c("不允许多个版本 JSAPI 混用");else{if(h=[],n.plugins)for(p=0;p<n.plugins.length;p+=1)-1==l.AMap.plugins.indexOf(n.plugins[p])&&h.push(n.plugins[p]);h.length?window.AMap.plugin(h,function(){a(n).then(function(){s(window.AMap)}).catch(c)}):a(n).then(function(){s(window.AMap)}).catch(c)}else if(n.key&&n.key!==l.key)c("多个不一致的 key");else if(n.version&&n.version!==l.AMap.version)c("不允许多个版本 JSAPI 混用");else{var b=[];if(n.plugins)for(p=0;p<n.plugins.length;p+=1)-1==l.AMap.plugins.indexOf(n.plugins[p])&&b.push(n.plugins[p]);u(function(){b.length?window.AMap.plugin(b,function(){a(n).then(function(){s(window.AMap)}).catch(c)}):a(n).then(function(){s(window.AMap)}).catch(c)})}})},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,l={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},r={AMap:o.notload,AMapUI:o.notload,Loca:o.notload},c={AMap:[],AMapUI:[],Loca:[]}}}}()}(qM);var GM=LM(qM.exports);const WM=a({name:"IBizMapPicker",props:vt(),emits:Ve(),setup(e,{emit:t}){var a;const n=B("map-picker"),i=e.controller,s=null==(a=i.model.editorItems)?void 0:a[0],l=o(),c=o(),d=o(),u=o(),p=o(!1),m=o(!1),v=o(""),b=r(()=>!(!e.controlParams||"hover"!==e.controlParams.editmode||e.readonly));let f,w,y;const C={address:"",longitude:null,latitude:null},I=()=>{w&&(w.setMap(null),w=void 0)},x=(e,t)=>{const a=window.AMap;a&&(I(),w=new a.Marker({position:[e,t]}))},S=(e,t)=>{const a=window.AMap;if(!a)return;if(!w)return;const i=new a.Geocoder({}),o=w;i.getAddress([e,t],(a,i)=>{if(w&&w===o&&"complete"===a&&"OK"===i.info&&i.regeocode){const a=i.regeocode.formattedAddress,o=document.createElement("div"),s=document.createElement("img");s.style.width="25px",s.src="//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png",o.appendChild(s);const l=document.createElement("span");l.className=n.b("dialog-map-marker-text"),l.textContent=a,o.appendChild(l),w.setContent(o),w.setMap(f),C.address=a,C.longitude=e,C.latitude=t,v.value=a}})};return h(()=>{null==f||f.destroy()}),{ns:n,c:i,inputRef:l,searchInputRef:c,mapContainerRef:d,searchResultContainerRef:u,dialogVisible:p,isLoading:m,searchValue:v,showFormDefaultContent:b,handleShow:()=>{var t;p.value=!0,null==(t=l.value)||t.blur(),g(async()=>{var t;if(window.AMap||await(async()=>{try{m.value=!0,window._AMapSecurityConfig={securityJsCode:ibiz.env.aMapSecurityJsCode},await GM.load({key:ibiz.env.aMapKey,version:"2.0",plugins:["AMap.PlaceSearch","AMap.Geocoder"],AMapUI:{version:"1.1",plugins:["misc/PoiPicker"]}})}finally{m.value=!1}})(),f&&(null==(t=d.value)?void 0:t.children.length)||(null==f||f.destroy(),(()=>{const e=window.AMap;if(!e)return;if(!d.value)return;f=new e.Map(d.value,{viewMode:"3D",zoom:11}),null==f||f.on("click",e=>{const t=e.lnglat,a=t.lng,n=t.lat;null!=a&&null!=n&&(x(a,n),S(a,n))});const t=window.AMapUI;t&&c.value&&u.value&&t.loadUI(["misc/PoiPicker"],function(e){c.value&&u.value&&e&&(y=new e({input:c.value,placeSearchOptions:{map:f},searchResultsContainer:u.value}),null==y||y.on("poiPicked",function(e){var t,a;I();const n=e.item;n&&(C.address=n.name,C.longitude=null==(t=n.location)?void 0:t.lng,C.latitude=null==(a=n.location)?void 0:a.lat,v.value=n.name,"search"!==e.source&&(null==y||y.searchByKeyword(n.name)))}))})})()),v.value=e.value||"",s&&s.id){const[t,a]=s.id.split(",");if(e.data){const n=e.data[t],i=e.data[a];n&&i&&(null==f||f.setCenter([n,i],!0),x(n,i),S(n,i))}}})},handleConfirm:()=>{if(p.value=!1,s&&s.id){const[e,a]=s.id.split(",");e&&t("change",null!=C.longitude?C.longitude:null,e),a&&t("change",null!=C.latitude?C.latitude:null,a)}t("change",C.address||"")},handleClose:()=>{y&&(y.clearSuggest(),y.clearSearchResults()),v.value="",C.address="",C.longitude=null,C.latitude=null,I()},handleClear:()=>{if(s&&s.id){const[e,a]=s.id.split(",");e&&t("change",null,e),a&&t("change",null,a)}t("change","")},handleSearchClear:()=>{v.value="",C.address="",C.longitude=null,C.latitude=null,I()}}},render(){const e=n("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[n("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"},null),n("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"},null)]);let t;t=this.readonly?this.value:[n(i("el-input"),{class:this.ns.b("input"),ref:"inputRef","model-value":this.value,placeholder:this.c.placeHolder,disabled:this.disabled,onFocus:this.handleShow},{suffix:()=>{if(this.value&&!this.disabled)return n("i",{class:"el-icon el-input__icon el-input__clear",onClick:e=>{e.stopPropagation(),this.handleClear()}},[e])}}),n(i("el-dialog"),{class:this.ns.b("dialog"),modelValue:this.dialogVisible,"onUpdate:modelValue":e=>this.dialogVisible=e,title:ibiz.i18n.t("editor.mapPicker.title"),"append-to-body":!0,"align-center":!0,width:"80%",onClose:this.handleClose},{default:()=>n("div",{class:this.ns.b("dialog-content")},[n("div",{class:"el-input el-input--suffix ".concat(this.ns.b("dialog-search-input")," ").concat(this.isLoading?"is-disabled":"")},[n("div",{class:"el-input__wrapper",tabindex:"-1"},[b(n("input",{ref:"searchInputRef",class:"el-input__inner",type:"text",autocomplete:"off",tabindex:"0",placeholder:ibiz.i18n.t("editor.mapPicker.searchPlaceholder"),disabled:this.isLoading,"onUpdate:modelValue":e=>this.searchValue=e},null),[[f,this.searchValue]]),this.searchValue?n("span",{class:"el-input__suffix"},[n("span",{class:"el-input__suffix-inner"},[n("i",{class:"el-icon el-input__icon el-input__clear",onClick:e=>{e.stopPropagation(),this.handleSearchClear()}},[e])])]):null])]),b(n("div",{class:this.ns.b("dialog-map-content")},[n("div",{class:this.ns.b("dialog-map-container"),ref:"mapContainerRef"},null),n("div",{class:this.ns.b("dialog-search-result-container"),ref:"searchResultContainerRef"},null)]),[[C("loading"),this.isLoading]])]),footer:()=>{let e;return n("div",{class:this.ns.b("dialog-footer")},[n(i("el-button"),{type:"primary",disabled:this.isLoading,onClick:this.handleConfirm},(t=e=ibiz.i18n.t("editor.common.confirm"),"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!s(t)?e:{default:()=>[e]}))]);var t}})];const a=n("div",{class:this.ns.b("form-default-content")},[this.value?this.value:n(i("iBizEditorEmptyText"),{showPlaceholder:this.c.emptyShowPlaceholder,placeHolder:this.c.placeHolder},null)]);return n("div",{class:[this.ns.b(),this.disabled?this.ns.m("disabled"):"",this.readonly?this.ns.m("readonly"):"",this.ns.is("show-default",this.showFormDefaultContent)]},[this.showFormDefaultContent&&a,t])}});class YM extends qi{}var KM=Object.defineProperty,XM=(e,t,a)=>(((e,t,a)=>{t in e?KM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class $M{constructor(){XM(this,"formEditor","IBizMapPicker"),XM(this,"gridEditor","IBizMapPicker")}async createController(e,t){const a=new YM(e,t);return await a.init(),a}}const JM=e("aV",{install:e=>{e.component(kA.name,kA),e.component(Nz.name,Nz),e.component(Bz.name,Bz),e.component(Lz.name,Lz),e.component(Hz.name,Hz),e.component(qz.name,qz),e.component(Gz.name,Gz),e.component(Wz.name,Wz),e.component(Zz.name,Zz),e.component(eT.name,eT),e.component(nT.name,nT),e.component(dT.name,dT),e.component(vT.name,vT),e.component(IT.name,IT),e.component(zT.name,zT),e.component(NT.name,NT),e.component(jT.name,jT),e.component(qT.name,qT),e.component(XT.name,XT),e.component($T.name,$T),e.component(tA.name,tA),e.component(lA.name,lA),e.component(bA.name,bA),e.component(EA.name,EA),e.component(PA.name,PA),e.component(DA.name,DA),e.component(BA.name,BA),e.component(LA.name,LA),e.component(RA.name,RA),e.component(_A.name,_A),e.component(jA.name,jA),e.component(VA.name,VA),e.component(aO.name,aO),e.component(cO.name,cO),e.component(mO.name,mO),e.component(CO.name,CO),e.component(aM.name,aM),e.component(lM.name,lM),e.component(mM.name,mM),e.component(CM.name,CM),e.component(MM.name,MM),e.component(IM.name,IM),e.component(WM.name,WM),e.component("IBizHtml",E(()=>t.import("./wang-editor-BdJ2v_6e.js"))),e.component("IBizMarkDown",E(()=>t.import("./ibiz-markdown-editor-D-5gnej5.js"))),e.component(RM.name,RM),e.component(tT.name,tT),Qi("SPAN",()=>new Uz),Qi("SPAN_ADDRESSPICKUP",()=>new Uz),Qi("SPAN_LINK",()=>new Uz("SPAN_LINK"));const a=new Qz;Qi("TEXTBOX",()=>a),Qi("TEXTAREA",()=>a),Qi("TEXTAREA_10",()=>a),Qi("PASSWORD",()=>a),Qi("NUMBER",()=>new Qz("NUMBER")),Qi("IPADDRESSTEXTBOX",()=>new Qz("IPADDRESSTEXTBOX")),Qi("MOBTEXT",()=>a),Qi("MOBNUMBER",()=>new Qz("NUMBER")),Qi("MOBTEXTAREA",()=>a),Qi("MOBPASSWORD",()=>a),Qi("TEXTBOX_SIGNATURE",()=>new Qz("SIGNATURE")),Qi("DROPDOWNLIST",()=>new cT),Qi("MOBDROPDOWNLIST",()=>new cT),Qi("MOBCHECKLIST",()=>new cT),Qi("DROPDOWNLIST_100",()=>new cT),Qi("MDROPDOWNLIST",()=>new cT),Qi("DROPDOWNLIST_EMOJI_PICKER",()=>new cT("EMOJI_PICKER")),Qi("MDROPDOWNLIST_TREE_PICKER",()=>new cT("TREE_PICKER")),Qi("DROPDOWNLIST_VIRTUALIZED_LIST",()=>new cT("VIRTUALIZED_LIST")),Qi("MDROPDOWNLIST_VIRTUALIZED_LIST",()=>new cT("VIRTUALIZED_LIST")),Qi("CHECKBOX",()=>new mT),Qi("CHECKBOXLIST",()=>new CT),Qi("RADIOBUTTONLIST",()=>new kT),Qi("MOBRADIOLIST",()=>new kT);const n=new MT;Qi("DATEPICKER",()=>n),Qi("DATEPICKEREX",()=>n),Qi("DATEPICKEREX_NOTIME",()=>n),Qi("DATEPICKEREX_HOUR",()=>n),Qi("DATEPICKEREX_MINUTE",()=>n),Qi("DATEPICKEREX_SECOND",()=>n),Qi("DATEPICKEREX_NODAY",()=>n),Qi("DATEPICKEREX_NODAY_NOSECOND",()=>n),Qi("MOBDATE",()=>n),Qi("MOBDATE_HOUR",()=>n),Qi("MOBDATE_MINUTE",()=>n),Qi("MOBDATE_NODAY",()=>n),Qi("MOBDATE_NODAY_NOSECOND",()=>n),Qi("MOBDATE_NOTIME",()=>n),Qi("MOBDATE_SECOND",()=>n),Qi("DATERANGE_SWITCHUNIT",()=>new HM),Qi("FILEUPLOADER",()=>new NA("FILEUPLOADER")),Qi("FILEUPLOADER_ONE",()=>new NA("FILEUPLOADER_ONE")),Qi("MOBSINGLEFILEUPLOAD",()=>new NA("MOBSINGLEFILEUPLOAD")),Qi("MOBMULTIFILEUPLOAD",()=>new NA("MOBMULTIFILEUPLOAD")),Qi("PICTURE",()=>new NA("PICTURE")),Qi("PICTURE_ONE",()=>new NA("PICTURE_ONE")),Qi("PICTURE_ONE_RAW",()=>new NA("PICTURE_ONE_RAW")),Qi("MOBPICTURE",()=>new NA("MOBPICTURE")),Qi("MOBPICTURE_RAW",()=>new NA("MOBPICTURE_RAW")),Qi("MOBPICTURELIST",()=>new NA("MOBPICTURELIST")),Qi("PICTURE_CROPPING",()=>new NA("PICTURE_CROPPING")),Qi("RAW",()=>new _T),Qi("STEPPER",()=>new HT),Qi("MOBSTEPPER",()=>new HT),Qi("RATING",()=>new KT),Qi("MOBRATING",()=>new KT),Qi("SLIDER",()=>new oA),Qi("MOBSLIDER",()=>new oA),Qi("SWITCH",()=>new eA),Qi("SWITCH_TRISTATE",()=>new eA("TRISTATE")),Qi("MOBSWITCH",()=>new eA),Qi("LISTBOX",()=>new gA),Qi("LISTBOXPICKUP",()=>new gA);const i=new xA;Qi("AC",()=>i),Qi("AC_FS",()=>i),Qi("AC_NOBUTTON",()=>i),Qi("AC_FS_NOBUTTON",()=>i),Qi("PICKER",()=>new rO("PICKER")),Qi("PICKER_TRANSFER_PICKER",()=>new rO("TRANSFER_PICKER")),Qi("PICKEREX_NOAC",()=>new rO("PICKEREX_NOAC")),Qi("PICKEREX_NOAC_LINK",()=>new rO("PICKEREX_NOAC_LINK")),Qi("PICKEREX_TRIGGER_LINK",()=>new rO("PICKEREX_TRIGGER_LINK")),Qi("PICKEREX_TRIGGER",()=>new rO("PICKEREX_TRIGGER")),Qi("PICKEREX_LINK",()=>new rO("PICKEREX_LINK")),Qi("ADDRESSPICKUP",()=>new rO("ADDRESSPICKUP")),Qi("ADDRESSPICKUP_AC",()=>new rO("ADDRESSPICKUP_AC")),Qi("PICKEREX_LINKONLY",()=>new rO("PICKEREX_LINKONLY")),Qi("PICKEREX_NOBUTTON",()=>new rO("PICKEREX_NOBUTTON")),Qi("PICKEREX_DROPDOWNVIEW",()=>new rO("PICKEREX_DROPDOWNVIEW")),Qi("PICKEREX_DROPDOWNVIEW_LINK",()=>new rO("PICKEREX_DROPDOWNVIEW_LINK")),Qi("PICKUPVIEW",()=>new rO("PICKUPVIEW")),Qi("MOBPICKER",()=>new rO("MOBPICKER")),Qi("MOBPICKER_DROPDOWNVIEW",()=>new rO("MOBPICKER_DROPDOWNVIEW")),Qi("MOBMPICKER",()=>new rO("MOBMPICKER")),Qi("NUMBERRANGE",()=>new pO),Qi("MOBNUMBERRANGE",()=>new pO),Qi("DATERANGE",()=>new yO),Qi("DATERANGE_NOTIME",()=>new yO),Qi("MOBDATERANGE",()=>new yO),Qi("MOBDATERANGE_NOTIME",()=>new yO),Qi("CODE",()=>new PO),Qi("MOBCODE",()=>new PO),Qi("HTMLEDITOR",()=>new XO),Qi("MOBHTMLTEXT",()=>new XO),Qi("MARKDOWN",()=>new tM),Qi("MOBMARKDOWN",()=>new tM),Qi("ARRAY",()=>new sM),Qi("MOBARRAY",()=>new sM),Qi("CASCADER",()=>new uM),Qi("MOBCASCADER",()=>new uM),Qi("COLORPICKER",()=>new yM),Qi("MOBCOLORPICKER",()=>new yM),Qi("PICKER_searchCondEdit",()=>new OM),Qi("MAPPICKER",()=>new $M),Qi("FIELD_IMAGE_PICTURE_ONE",()=>new NA("PICTURE_ONE")),Qi("FIELD_IMAGE_PICTURE",()=>new NA("PICTURE")),Qi("FIELD_TEXT_DYNAMIC_SPAN",()=>new Uz),Qi("VIEW_PAGECAPTION_SPAN",()=>new Uz),Qi("STATIC_LABEL_RAW",()=>new _T),Qi("FIELD_TEXTBOX_TEXTBOX",()=>a),Qi("FIELD_TEXTAREA_TEXTAREA",()=>a),Qi("FIELD_RADIOBUTTONLIST_RADIOBUTTONLIST",()=>new kT),Qi("FIELD_CHECKBOXLIST_CHECKBOXLIST",()=>new CT),Qi("FIELD_DROPDOWNLIST_DROPDOWNLIST",()=>new cT),Qi("FIELD_RATING_RATING",()=>new KT),Qi("FIELD_SWITCH_SWITCH",()=>new eA),Qi("FIELD_SLIDER_SLIDER",()=>new oA),Qi("FIELD_DATEPICKER_DATEPICKER",()=>new MT),Qi("FIELD_DATERANGE_DATERANGE",()=>new yO),Qi("FIELD_PICKER_PICKER",()=>new rO("PICKER")),Qi("FIELD_ARRAY_ARRAY",()=>new sM),Qi("AUTH_USERID_TEXTBOX",()=>a),Qi("AUTH_PASSWORD_PASSWORD",()=>a),Qi("FIELD_CAROUSEL_PICTURE",()=>new DM)}}),QM=e("aW",a({name:"IBizView404",setup(){const e=B("404-view"),t=hs(),a=us();d(()=>ibiz.util.hiddenAppLoading());return{ns:e,isTop:r(()=>a&&!a.params.view1),gotoIndexView:async()=>{await t.push("/"),window.location.reload()}}},render(){return n("div",{class:[this.ns.b(),this.ns.is("top",this.isTop)]},[n("img",{class:this.ns.b("img"),src:"".concat(ibiz.env.assetsUrl,"/images/404.png")},null),n("div",{class:this.ns.b("text")},[n("div",{class:this.ns.be("text","text1")},[ibiz.i18n.t("view.noResourcesView.noResourcePrompt")]),this.isTop?n("div",{class:this.ns.be("text","text2")},[ibiz.i18n.t("view.noResourcesView.resourceNoExist"),n("a",{onClick:this.gotoIndexView},[ibiz.i18n.t("view.common.backHomepage")]),ibiz.i18n.t("view.common.continueBrowsing")]):null])])}})),ZM=e("aX",a({name:"IBizView403",setup(){const e=B("403-view"),t=hs(),a=us();d(()=>ibiz.util.hiddenAppLoading());return{ns:e,isTop:r(()=>a&&!a.params.view1),gotoIndexView:async()=>{await t.push("/"),window.location.reload()}}},render(){return n("div",{class:[this.ns.b(),this.ns.is("top",this.isTop)]},[n("img",{class:this.ns.b("img"),src:"".concat(ibiz.env.assetsUrl,"/images/403.png")},null),n("div",{class:this.ns.b("text")},[n("div",{class:this.ns.be("text","text1")},[ibiz.i18n.t("view.noPermissionView.noPermissionPrompt")]),this.isTop?n("div",{class:this.ns.be("text","text2")},[ibiz.i18n.t("view.noPermissionView.noPermission"),n("a",{onClick:this.gotoIndexView},[ibiz.i18n.t("view.common.backHomepage")]),ibiz.i18n.t("view.common.continueBrowsing")]):null])])}}));const eN=e("aY",a({setup(){const e=B("login-view"),t={username:[{required:!0,message:ibiz.i18n.t("app.pleaseEnterAccount"),trigger:"blur"}],password:[{required:!0,message:ibiz.i18n.t("app.pleaseEnterPassword"),trigger:"blur"},{type:"string",min:6,message:ibiz.i18n.t("view.loginView.passwordLength"),trigger:"blur"}]},a=u({username:"",password:""}),c=o(null),p=us().query.ru||"/",m=o(!1),v=o(null),g=i("IBizViewShell"),b=Lt.create({}),f={},w=o(!1),y=o(!1),C=o(!1),I=o(!0);let x=ibiz.env.AppTitle;const S=r(()=>window.location.href.indexOf("srfthird_auth_success=false")>=0);(async()=>{const e=(await ibiz.hub.getAppAsync(ibiz.env.appId)).model;e.caption&&!x&&(x=e.caption)})();const E=window.navigator.userAgent.toUpperCase();S.value||ibiz.env.loginMode===oa.OAUTH||(-1!==E.indexOf("DINGTALK")?ibiz.thirdAuth.auth("DINGTALK","EMBED"):-1!==E.indexOf("WXWORK")&&ibiz.thirdAuth.auth("WXWORK","EMBED")),ibiz.appData=void 0,ibiz.orgData=void 0;const D=async()=>{c.value.validate(async e=>{if(e){w.value=!0;if(!0===await ibiz.auth.login(a.username,a.password,C.value))if(window.location.hash=p,window.history.pushState({},""),S.value){const e=window.location.href.replace("?srfthird_auth_success=false","");window.location.href=e}else window.location.reload();w.value=!1}})},{cleanup:P}=Dl(document,["a",'input:not([type="checkbox"])',"button","textarea","select",'[tabindex]:not([tabindex="-1"])']);return d(async()=>{const e=ns.parse(window.location.search.replace("?",""));if(S.value&&ibiz.message.error(ibiz.i18n.t("view.loginView.thirdAuthFail")),-1===E.indexOf("DINGTALK")&&-1===E.indexOf("WXWORK")||S.value){if("true"===e.isAnonymous){!0===await ibiz.auth.anonymousLogin()&&(window.location.hash=p,window.location.reload())}else{try{const e=await ibiz.hub.config.view.get("AppLoginView");e&&(v.value=e,m.value=!0)}catch(e){ibiz.log.warn(e)}I.value=!1}ibiz.util.hiddenAppLoading(),y.value=!0}}),h(()=>{P()}),()=>{if(y.value&&!1===I.value){let o;return m.value?l(g,{context:b,params:f,viewId:v.value.id}):n("div",{class:e.b()},[n("div",{class:e.b("box")},[n("header",{class:e.b("box-header")},[n("img",{src:"./assets/images/login-header.png"},null),n("span",{class:e.b("box-header-title")},[x])]),n("main",{class:e.b("box-main")},[n("img",{class:e.be("box-main","avatar"),src:"./assets/images/login-avatar.png"},null),n("div",{class:e.b("box-main-content")},[n(i("el-form"),{model:a,rules:t,ref:c},{default:()=>[n(i("el-form-item"),{size:"large",prop:"username"},{default:()=>[n(i("el-input"),{modelValue:a.username,"onUpdate:modelValue":e=>a.username=e,clearable:!0,placeholder:ibiz.i18n.t("app.pleaseEnterAccount")},{prefix:()=>n("ion-icon",{name:"person"},null)})]}),n(i("el-form-item"),{size:"large",prop:"password"},{default:()=>[n(i("el-input"),{type:"password",modelValue:a.password,"onUpdate:modelValue":e=>a.password=e,"show-password":!0,placeholder:ibiz.i18n.t("app.pleaseEnterPassword")},{prefix:()=>n("ion-icon",{name:"unlock-alt"},null)})]}),n(i("el-checkbox"),{modelValue:C.value,"onUpdate:modelValue":e=>C.value=e,label:ibiz.i18n.t("app.rememberMe")},null),n(i("el-form-item"),{size:"large"},{default:()=>{return[n(i("el-button"),{type:"primary",onClick:D,size:"large",round:!0,loading:w.value,onKeyup:e=>(e=>{"Enter"===e.key&&D()})(e)},(e=o=ibiz.i18n.t("view.loginView.login"),"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)?o:{default:()=>[o]}))];var e}})]})])])])])}return null}}}));var tN=Object.defineProperty,aN=(e,t,a)=>(((e,t,a)=>{t in e?tN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class nN{constructor(){aN(this,"component","IBizWFStepTraceView")}}const iN=a({name:"IBizWFStepTraceView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object}},setup(){const e=B("view"),t=gt((...e)=>new Zi(...e)),{viewType:a,sysCss:n,codeName:i}=t.model,o=a.toLowerCase(),s=null==n?void 0:n.cssName,l=[e.b(),e.b(o),e.m(i),s];return{c:t,ns:e,viewClassNames:l}},render(){return n("div",{class:this.viewClassNames},[n(i("iBizExtendActionTimeLine"),{data:this.c.state.historyData},null)])}}),oN=e("aZ",ie(iN,function(e){e.component(iN.name,iN),eo(to.APP_WF_STEP_TRACE_VIEW,()=>new nN)}));var sN=Object.defineProperty,lN=(e,t,a)=>(((e,t,a)=>{t in e?sN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class rN{constructor(){lN(this,"component","IBizSubAppRefView")}}const cN=a({name:"IBizSubAppRefView",props:{context:Object,params:{type:Object,default:()=>({})},modelData:{type:Object,required:!0},modal:{type:Object},state:{type:Object}},setup(){const e=B("sub-app-ref-view"),t=gt((...e)=>new ao(...e)),{viewType:a,sysCss:n,codeName:i}=t.model,o=a.toLowerCase(),s=null==n?void 0:n.cssName,l=[e.b(),e.b(o),e.m(i),s],c=r(()=>ibiz.env.marketAddress||window.Environment.marketAddress);return{c:t,ns:e,viewClassNames:l,htmlUrl:c,handleClick:()=>{c.value&&window.open(c.value,"_blank")}}},render(){return n("div",{class:this.viewClassNames},[n(i("el-result"),{class:this.ns.b("result"),icon:"info"},null),this.c.model.caption&&n("div",{class:this.ns.b("caption")},[this.c.model.caption]),this.c.model.subCaption&&n("div",{class:this.ns.b("sub-caption")},[this.c.model.subCaption]),this.htmlUrl&&n(i("el-button"),{class:this.ns.b("btn"),onClick:this.handleClick,size:"large"},{default:()=>[this.c.model.title||ibiz.i18n.t("view.subAppRefView.jump")]})])}}),dN=e("a_",ie(cN,function(e){e.component(cN.name,cN),eo(to.DE_SUB_APP_REF_VIEW,()=>new rN)})),uN=e("a$",a({name:"ErrorView",setup(){const e=B("error-view"),t=us(),a=r(()=>"".concat(t.params.code));d(()=>ibiz.util.hiddenAppLoading());return{ns:e,isTop:r(()=>t&&!t.params.view1),code:a}},render(){if(this.code){const e=no(this.code);if(e)return"string"==typeof e.component?l(i(e.component)):l(e.component)}return n("div",{class:[this.ns.b()]},[ibiz.i18n.t("view.errorView.noExistPrompt",{code:this.code})])}}));class hN extends io{get form(){return this.view.getController("form")}init(){if(super.init(),1===this.view.model.multiFormMode&&this.view.params.srfdatatype){const e=Pn(this.view.model,"_form_".concat(this.view.params.srfdatatype));if(e){const t=oo(this.view.model).filter(e=>"FORM"!==e.controlType);e.name="form",t.push(e),this.view.model.viewLayoutPanel?this.view.model.viewLayoutPanel.controls=t:this.view.model.controls=t}}}async modalPreDismissHook(e){try{this.form&&this.form.state.modified&&this.form.model.enableAutoSave&&await this.form.immediateAutoSave()}catch(t){e.allowNext=!1}}async modalShouldDismissHook(e){var t,a;const n=this.view.context.srfsessionid,i=ibiz.uiDomainManager.get(n);let o=!0===this.view.model.enableDirtyChecking;if(n===this.view.id){const e=(null==i?void 0:i.dataModification)||!1;o=o&&((null==(t=this.form)?void 0:t.state.modified)||e)}else o=o&&(null==(a=this.form)?void 0:a.state.modified);if(o&&null==e.allowClose){const t=await ibiz.confirm.error({title:ibiz.i18n.t("viewEngine.closeRemind"),desc:ibiz.i18n.t("viewEngine.confirmClosePrompt")});e.allowClose=!!t}}async onCreated(){await super.onCreated(),this.modalPreDismissHook=this.modalPreDismissHook.bind(this),this.modalShouldDismissHook=this.modalShouldDismissHook.bind(this),this.formDataStateChange=this.formDataStateChange.bind(this);const{childNames:e,modal:t}=this.view;e.push("form"),this.view.slotProps.form||(this.view.slotProps.form={}),this.view.slotProps.form.loadDefault=!1,this.view.slotProps.toolbar||(this.view.slotProps.toolbar={}),this.view.slotProps.toolbar.manualCalcButtonState=!0,t.hooks.preDismiss.tapPromise(this.modalPreDismissHook),t.hooks.shouldDismiss.tapPromise(this.modalShouldDismissHook)}formDataStateChange(e){var t;const{model:a,evt:n}=this.view,i=this.form.model.appDataEntityId,o=e.data[0];null==(t=this.toolbar)||t.calcButtonState(o,i,e),a.showDataInfoBar&&(o.srfkey?n.emit("onViewInfoChange",{dataInfo:o.srfmajortext||""}):n.emit("onViewInfoChange",{dataInfo:ibiz.i18n.t("app.newlyBuild")}))}async onMounted(){await super.onMounted();const{model:e,evt:t}=this.view;if(this.form){this.form.evt.on("onLoadSuccess",e=>{this.formDataStateChange(e);const a=e.data[0];this.view.state.srfactiveviewdata=a,Object.prototype.hasOwnProperty.call(a,"srfreadonly")&&(a.srfreadonly?this.view.context.srfreadonly=!0:Po(this.view.context.srfreadonly)&&(this.view.context.srfreadonly=!1)),t.emit("onDataChange",{...e,actionType:"LOAD"})}),this.form.evt.on("onLoadDraftSuccess",e=>{this.formDataStateChange(e),t.emit("onDataChange",{...e,actionType:"LOADDRAFT"})}),this.form.evt.on("onSaveSuccess",e=>{this.view.state.closeOK=!0;const a=ra(this.view.model.appDataEntityId),n=e.data[0];this.view.context[a]!==n.srfkey&&(this.view.context[a]=n.srfkey),this.formDataStateChange(e),t.emit("onDataChange",{...e,actionType:"SAVE"})}),this.form.evt.on("onRemoveSuccess",e=>{this.formDataStateChange(e),t.emit("onDataChange",{...e,actionType:"REMOVE"})});const a=await ibiz.hub.getAppDataEntity(this.view.model.appDataEntityId,this.view.model.appId);this.form.evt.on("onFormDataChange",e=>{const{name:t,value:n}=e;t===a.formTypeAppDEFieldId&&1===this.view.model.multiFormMode&&this.view.redrawView({context:this.view.context,params:{srfdatatype:n,[t]:n},isReloadModel:!0})}),!this.view.state.noLoadDefault&&e.loadDefault&&this.load()}}getData(){return this.form.getData()}async load(){return this.form.load()}async save(e){return this.form.save(e)}async refresh(){this.form.refresh()}async call(e,t){if(e===ha.SAVE)return await this.form.save(),null;if(e===ha.SAVE_AND_EXIT)return await this.form.save(),{closeView:!0};if(e===ha.REMOVE_AND_EXIT){return{closeView:await this.form.remove()}}if(e===ha.SAVE_AND_NEW)return this.saveAndNew(),null;if(e===ha.REFRESH)return await this.refresh(),null;if(e===ha.SAVE_AND_START)return await this.wfStart(),null;if(e===ha.FIRST_RECORD||e===ha.LAST_RECORD||e===ha.PREV_RECORD||e===ha.NEXT_RECORD)return await this.changeRecord(e),null;if(e===ha.VIEW_WF_STEP)return await this.wfSubmit(),null;if(e===Va.LOAD)return this.load(),null;if(e===Va.VALIDATE)return this.form.validate();if(e===Va.WF_WITHDRAW)return await this.wfWithdraw(),null;if(e===ha.EXPAND){const{srfcollapsetag:e,srfgroupid:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.form.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e,srfgroupid:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.form.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.form.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.form.changeCollapse({expand:!1}),null):super.call(e,t)}async saveAndNew(){await this.form.save(),this.form.state.data=new ma,this.view.context[ra(this.view.model.appDataEntityId)]=void 0,await this.form.load()}async cancelChanges(e={targetState:"INIT"}){await super.cancelChanges(e),await this.form.cancelChanges(e.targetState)}async wfStart(){var e,t;await this.save({silent:!0});const a=await ibiz.hub.getAppDEService(this.view.model.appId,this.view.model.appDataEntityId,this.view.context),n=this.form.state.data,i=await a.wf.getWFVersion(null!=(t=null!=(e=n.srfwftag)?e:this.view.params.srfwftag)?t:this.view.context.srfwftag);if(0===i.data.length)throw new Vt(ibiz.i18n.t("viewEngine.noExistVersionErr"));const o=i.data[0],s="WFSTART@".concat(o.wfversion),l=Object.assign(this.view.context.clone(),{activeForm:o["process-form"]}),r={processDefinitionKey:o.definitionkey},c=so(this.view.model,s);if(!c)return await this.form.wfStart({viewParam:r}),void await this.view.closeView();(await ibiz.commands.execute(Ai.TAG,c.refAppViewId,l,r)).ok&&await this.view.closeView()}wfSubmit(){return this.form.wfSubmit()}async wfWithdraw(){const e=ibiz.hub.getApp(this.view.context.srfappid),t=this.form.state.data,a=await e.deService.getService(this.view.context,this.view.model.appDataEntityId);await a.wf.exec("withdraw",this.view.context,{...this.view.params,taskId:this.view.params.taskId||this.view.params.srftaskid},t instanceof ma?t.getOrigin():t),ibiz.mc.command.send({srfdecodename:"SysTodo"},"OBJECTUPDATED","WITHDRAW")}doMarkDataAction(){if(super.doMarkDataAction(),this.doActions.includes("VIEW")&&this.form.evt.on("onLoadSuccess",()=>this.sendViewDataAction()),this.doActions.includes("EDIT")){let e=!1;this.form.evt.on("onFormDataChange",()=>{const t=this.form.getData()[0];e||(e=!0,this.sendMarkDataAction("EDIT",t.srfkey),setTimeout(()=>{e=!1},3e5))})}this.doActions.includes("UPDATE")&&this.form.evt.on("onSaveSuccess",()=>{const e=this.form.getData()[0];this.sendMarkDataAction("UPDATE",e.srfkey)}),this.doActions.includes("CLOSE")&&this.view.evt.on("onCloseView",()=>{const e=this.form.getData()[0];(null==e?void 0:e.srfkey)&&this.sendMarkDataAction("CLOSE",e.srfkey)})}async reloadConfirm(){const e=await super.reloadConfirm();return e&&this.form.state.modified?ibiz.confirm.warning({title:ibiz.i18n.t("viewEngine.refreshRemind"),desc:ibiz.i18n.t("viewEngine.confirmRefreshPrompt")}):e}async changeRecord(e){const t="".concat(this.view.context.srfnavctrlid);if(!t)throw new Vt(ibiz.i18n.t("viewEngine.missingErr"));const a=this.form.state.data.srfkey;let n;switch(e){case ha.FIRST_RECORD:n=await ibiz.util.record.getFirstRecord(t,a);break;case ha.LAST_RECORD:n=await ibiz.util.record.getLastRecord(t,a);break;case ha.PREV_RECORD:n=await ibiz.util.record.getPreviousRecord(t,a);break;case ha.NEXT_RECORD:n=await ibiz.util.record.getNextRecord(t,a)}if(n){const e=await ibiz.hub.getAppDataEntity(this.form.model.appDataEntityId,this.form.context.srfappid),{srfparentkey:a,srfparentdename:i}=await lo(this.form.model.appDataEntityId,this.view.context,{viewParams:this.view.params}),o=e.formTypeAppDEFieldId||e.dataTypeAppDEFieldId,s={srfdatatype:o?n[o]:void 0},l=await ro(n,this.view.context,this.form.model.appDataEntityId);l[this.deName]=n.srfkey;const r="".concat(this.view.context.srfnavlogicid);if(r){const e=ibiz.util.record.getTriggerLogic(r),a=ibiz.util.record.getCtrl(t);if(e){const{navContexts:t,navParams:i}=e;t&&Object.assign(l,_a(t,n,(null==a?void 0:a.params)||s,(null==a?void 0:a.context)||{})),i&&Object.assign(s,_a(i,n,(null==a?void 0:a.params)||s,(null==a?void 0:a.context)||{}))}}return Object.assign(this.view.context,l),Object.assign(this.view.params,s),i&&1===this.view.model.dynaSysMode&&this.view.context[i]!==a?this.view.redrawView({params:s,context:l,data:[n],isReloadModel:!0}):this.view.redrawView({params:s,context:l,data:[n]})}}async onDestroyed(){super.onDestroyed();const{modal:e}=this.view;e.hooks.preDismiss.removeTapPromise(this.modalPreDismissHook),e.hooks.shouldDismiss.removeTapPromise(this.modalShouldDismissHook)}}e("bg",hN);class pN extends hN{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drbar"),this.view.slotProps.drbar||(this.view.slotProps.drbar={}),this.view.slotProps.drbar.srfnav=this.view.state.srfnav}get drbar(){return this.view.getController("drbar")}}e("bh",pN);class mN extends hN{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drtab")}get drtab(){return this.view.getController("drtab")}}e("bi",mN);class vN extends hN{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drtab"),this.view.slotProps.drtab||(this.view.slotProps.drtab={}),this.view.slotProps.drtab.hideEditItem=!0}get drtab(){return this.view.getController("drtab")}}e("bj",vN);class gN extends co{async call(e,t){if(e===ha.NEW_ROW)return this.grid.newRow(),null;if(e===ha.TOGGLE_ROW_EDIT)return this.grid.toggleRowEdit(),null;if(e===ha.SAVE||e===ha.SAVE_ROW)return this.grid.saveAll(),null;if(e===ha.EXPAND){const{srfcollapsetag:e}=t.params||{};let a=e||"";if(!a){const{selectedData:e}=this.grid.state,t=e.filter(e=>e.isGroupData);t.length>0&&(a=t[0].srfkey)}if(!a)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.grid.changeCollapse({tag:a,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e}=t.params||{};let a=e||"";if(!a){const{selectedData:e}=this.grid.state,t=e.filter(e=>e.isGroupData);t.length>0&&(a=t[0].srfkey)}if(!a)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.grid.changeCollapse({tag:a,expand:!1}),null}return e===ha.EXPANDALL?(this.grid.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.grid.changeCollapse({expand:!1}),null):super.call(e,t)}get grid(){return this.view.getController("grid")}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.grid||(this.view.slotProps.grid={}),this.view.slotProps.grid.mdctrlActiveMode=e.gridRowActiveMode,this.view.slotProps.grid.rowEditOpen=e.rowEditDefault}}e("b1",gN);var bN=Object.defineProperty,fN=(e,t,a)=>(((e,t,a)=>{t in e?bN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class wN extends uo{constructor(){super(...arguments),fN(this,"route",us())}get appmenu(){return this.view.getController("appmenu")}get enableCollapse(){return"LEFT"===this.view.model.mainMenuAlign||void 0===this.view.model.mainMenuAlign}initViewState(){super.initViewState(),this.view.state.isCollapse=!1}async onCreated(){await super.onCreated(),this.view.childNames.push("appmenu"),this.view.slotProps.appmenu||(this.view.slotProps.appmenu={}),this.view.slotProps.appmenu.collapse=this.view.state.isCollapse,ibiz.util.hiddenAppLoading()}async onMounted(){if(await super.onMounted(),!this.isExistAndInLayout("appmenu")&&!this.route.params.view2){const{model:e,context:t,params:a}=this.view,{defAppViewId:n}=e;n&&ibiz.commands.execute(Ai.TAG,n,t,a)}(window.innerWidth<=1200||ibiz.config.appMenu.defaultCollapse)&&this.toggleCollapse()}async call(e,t){if(e===Va.TOGGLE_COLLAPSE)return this.toggleCollapse(),null}toggleCollapse(){var e;if(!this.enableCollapse)return void ibiz.log.error("非左侧菜单模式折叠功能不启用");this.view.state.isCollapse=!this.view.state.isCollapse,this.view.slotProps.appmenu.collapse=this.view.state.isCollapse;const t=null==(e=this.view.layoutPanel)?void 0:e.panelItems.container_scroll_left;t&&(this.view.state.isCollapse?t.state.layout.width="56px":t.state.layout.width="".concat(t.model.width,"px"))}calcViewHeaderVisible(){return!0}}e("b2",wN);class yN extends co{get list(){return this.view.getController("list")}async onMounted(){await super.onMounted();const{model:e}=this.view;this.list.state.mdctrlActiveMode=e.mdctrlActiveMode}async call(e,t){if(e===ha.EXPAND){const{srfcollapsetag:e,srfgroup:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.list.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e,srfgroup:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.list.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.list.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.list.changeCollapse({expand:!1}),null):super.call(e,t)}}e("bq",yN);class CN extends co{get dataview(){return this.view.getController("dataview")}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.dataview||(this.view.slotProps.dataview={}),this.view.slotProps.dataview.mdctrlActiveMode=e.mdctrlActiveMode}async call(e,t){if(e===ha.EXPAND){const{srfcollapsetag:e,srfgroup:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.dataview.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e,srfgroup:a}=t.params||{},n=e||a;if(!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.dataview.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.dataview.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.dataview.changeCollapse({expand:!1}),null):super.call(e,t)}}e("b3",CN);class IN extends uo{get form(){return this.view.getController("form")}init(){if(super.init(),1===this.view.model.multiFormMode&&this.view.params.srfdatatype){const e=Pn(this.view.model,"_form_".concat(this.view.params.srfdatatype));if(e){const t=oo(this.view.model).filter(e=>"FORM"!==e.controlType);e.name="form",t.push(e),this.view.model.viewLayoutPanel?this.view.model.viewLayoutPanel.controls=t:this.view.model.controls=t}}}async onCreated(){await super.onCreated(),this.modalPreDismissHook=this.modalPreDismissHook.bind(this),this.modalShouldDismissHook=this.modalShouldDismissHook.bind(this);const{childNames:e,modal:t}=this.view;e.push("form"),this.view.slotProps.form||(this.view.slotProps.form={}),this.view.slotProps.form.loadDefault=!1,this.view.slotProps.toolbar||(this.view.slotProps.toolbar={}),this.view.slotProps.toolbar.manualCalcButtonState=!0,t.hooks.preDismiss.tapPromise(this.modalPreDismissHook),t.hooks.shouldDismiss.tapPromise(this.modalShouldDismissHook)}async onMounted(){await super.onMounted();const{model:e,evt:t}=this.view,a=this.form.model.appDataEntityId,n=e=>{var n;const i=e.data[0];null==(n=this.toolbar)||n.calcButtonState(i,a,e),i.srfkey&&t.emit("onViewInfoChange",{dataInfo:i.srfmajortext})};this.form.evt.on("onLoadSuccess",e=>{const t=e.data[0];this.view.state.srfactiveviewdata=t,Object.prototype.hasOwnProperty.call(t,"srfreadonly")&&(t.srfreadonly?this.view.context.srfreadonly=!0:Po(this.view.context.srfreadonly)&&(this.view.context.srfreadonly=!1)),n(e)}),this.form.evt.on("onLoadDraftSuccess",e=>{n(e)}),this.form.evt.on("onSaveSuccess",e=>{n(e)});const i=await ibiz.hub.getAppDataEntity(this.view.model.appDataEntityId,this.view.model.appId);this.form.evt.on("onFormDataChange",e=>{const{name:t,value:a}=e;t===i.formTypeAppDEFieldId&&1===this.view.model.multiFormMode&&this.view.redrawView({context:this.view.context,params:{...this.view.params,srfdatatype:a,srfdefdata:e.data[0],[t]:a},isReloadModel:!0})}),!this.view.state.noLoadDefault&&e.loadDefault&&this.load()}async onDestroyed(){super.onDestroyed();const{modal:e}=this.view;e.hooks.preDismiss.removeTapPromise(this.modalPreDismissHook),e.hooks.shouldDismiss.removeTapPromise(this.modalShouldDismissHook)}async modalPreDismissHook(e){try{this.form&&this.form.state.modified&&this.form.model.enableAutoSave&&await this.form.immediateAutoSave()}catch(t){e.allowNext=!1}}async modalShouldDismissHook(e){var t,a;const n=this.view.context.srfsessionid,i=ibiz.uiDomainManager.get(n);let o=!0===this.view.model.enableDirtyChecking;if(n===this.view.id){const e=(null==i?void 0:i.dataModification)||!1;o=o&&((null==(t=this.form)?void 0:t.state.modified)||e)}else o=o&&(null==(a=this.form)?void 0:a.state.modified);if(o&&null==e.allowClose){const t=await ibiz.confirm.error({title:ibiz.i18n.t("viewEngine.closeRemind"),desc:ibiz.i18n.t("viewEngine.confirmClosePrompt")});e.allowClose=!!t}}getData(){return this.form.getData()}load(){return this.form.load()}async refresh(){await this.form.refresh()}async call(e,t){return e===ha.CANCEL?(this.cancel(),null):e===ha.OK?(await this.confirm(),null):e===Va.LOAD?(this.load(),null):e===Va.VALIDATE?this.form.validate():e===ha.REFRESH?(await this.refresh(),null):super.call(e,t)}async confirm(){this.view.state.isClosing=!0;try{await this.form.save(),await this.view.closeView({ok:!0,data:this.getData()})}catch(e){throw this.view.state.isClosing=!1,e}}cancel(){this.view.modal.ignoreDismissCheck=!0,this.view.closeView({ok:!1,data:[]})}}e("b4",IN);var xN=Object.defineProperty,SN=(e,t,a)=>(((e,t,a)=>{t in e?xN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class EN extends gN{constructor(){super(...arguments),SN(this,"selectData",[])}get grid(){return this.view.getController("grid")}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.grid||(this.view.slotProps.grid={}),this.view.slotProps.grid.singleSelect=this.view.state.singleSelect,this.view.slotProps.grid.mdctrlActiveMode=e.gridRowActiveMode,this.initSelectData()}initSelectData(){this.view.params.selecteddata&&(this.selectData=JSON.parse(this.view.params.selecteddata),delete this.view.params.selecteddata),this.view.state.selectedData&&(this.selectData=[...this.view.state.selectedData])}async onMounted(){await super.onMounted(),this.xdataControl.evt.on("onSelectionChange",async e=>{this.view.evt.emit("onSelectionChange",{...e})}),this.xdataControl.evt.on("onActive",async e=>{this.view.evt.emit("onDataActive",{...e})}),this.setSelectedData(this.selectData)}async call(e,t){return e===Va.GET_ALL_DATA?this.grid.state.items:super.call(e,t)}}e("by",EN);var DN=Object.defineProperty,PN=(e,t,a)=>(((e,t,a)=>{t in e?DN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class kN extends uo{constructor(){super(...arguments),PN(this,"selectData",[])}get pickupViewPanel(){return this.view.getController("pickupviewpanel")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("pickupviewpanel"),this.initSelectData()}initSelectData(){this.view.params.selecteddata&&(this.selectData=JSON.parse(this.view.params.selecteddata),delete this.view.params.selecteddata),this.view.state.selectedData&&(this.selectData=[...this.view.state.selectedData])}async onMounted(){await super.onMounted(),this.pickupViewPanel.state.singleSelect=!0,this.pickupViewPanel.evt.on("onSelectionChange",e=>{this.selectData=e.data}),this.pickupViewPanel.evt.on("onDataActive",e=>{this.pickupViewPanelDataActive(e.data)}),this.setSelectedData(this.selectData)}setSelectedData(e){this.selectData=e,this.pickupViewPanel.setSelectedData(e)}pickupViewPanelDataActive(e){this.selectData=e,this.view.closeView({ok:!0,data:this.selectData})}async call(e,t){return e===ha.CANCEL?(this.cancel(),null):e===ha.OK?(this.confirm(),null):super.call(e,t)}confirm(){this.view.closeView({ok:!0,data:this.selectData})}cancel(){this.view.closeView({ok:!1,data:[]})}}e("bA",kN);var zN=Object.defineProperty,TN=(e,t,a)=>(((e,t,a)=>{t in e?zN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class AN extends kN{constructor(){super(...arguments),TN(this,"checkStrictly",!1)}get simpleList(){return this.view.getController("simplelist")}async onCreated(){if(await super.onCreated(),!this.view.providers.simplelist)throw new Xt(this.view.model,ibiz.i18n.t("viewEngine.missingConfigErr"));const{childNames:e}=this.view;e.push("simplelist"),this.view.slotProps.simplelist||(this.view.slotProps.simplelist={}),this.view.slotProps.pickupviewpanel||(this.view.slotProps.pickupviewpanel={}),this.view.slotProps.simplelist.mdctrlActiveMode=2,this.view.slotProps.simplelist.isSimple=!0,this.view.slotProps.simplelist.singleSelect=!1,this.view.slotProps.pickupviewpanel.singleSelect=!1,this.view.params.checkstrictly&&(this.checkStrictly="true"===this.view.params.checkstrictly||!0===this.view.params.checkstrictly,delete this.view.params.checkstrictly)}async onMounted(){await super.onMounted(),this.simpleList.evt.on("onActive",e=>{this.simpleListActive(e.data)}),this.setSelectedData(this.selectData)}async call(e,t){return e===ha.CANCEL?(this.cancel(),null):e===ha.OK?(this.confirm(),null):e===ha.ADD_SELECTION?(this.addSelection(),null):e===ha.ADD_ALL?(this.addAll(),null):e===ha.REMOVE_ALL?(this.removeAll(),null):e===ha.REMOVE_SELECTION?(this.removeSelection(),null):super.call(e,t)}async pickupViewPanelDataActive(e){await this.handlePushSimpleListItems(e)}simpleListActive(e){const t=this.simpleList.getAllData();e.forEach(e=>{const a=t.findIndex(t=>t.srfkey===e.srfkey);-1!==a&&t.splice(a,1)}),this.setSelectedData(t)}async addSelection(){const e=await this.pickupViewPanel.getSelectedData();await this.handlePushSimpleListItems(e)}async handlePushSimpleListItems(e){let t=[];if(this.checkStrictly){const a=await this.pickupViewPanel.getAllData();t=this.simpleList.getAllData().filter(e=>!a.some(t=>t.srfkey===e.srfkey)),t.push(...e)}else{t=[...this.simpleList.getAllData(),...e]}const a=this.handleUniqueItems(t);this.setSelectedData(a)}handleUniqueItems(e){const t=new Map;return e.filter(e=>!t.has(e.srfkey)&&t.set(e.srfkey,1))}async addAll(){const e=await this.pickupViewPanel.getAllData();await this.handlePushSimpleListItems(e)}removeAll(){this.setSelectedData([])}removeSelection(){const e=this.simpleList.getData(),t=this.simpleList.getAllData();e.forEach(e=>{const a=t.findIndex(t=>e.srfkey===t.srfkey);-1!==a&&t.splice(a,1)}),this.setSelectedData(t)}setSelectedData(e){this.checkStrictly&&super.setSelectedData(e),this.simpleList.setData(e)}confirm(){const e=this.simpleList.getAllData();this.view.closeView({ok:!0,data:e})}}e("bu",AN);class ON extends co{async onCreated(){await super.onCreated();const{model:e}=this.view;this.view.slotProps.tree||(this.view.slotProps.tree={}),this.view.slotProps.tree.mdctrlActiveMode=e.mdctrlActiveMode}get tree(){return this.view.getController("tree")}async call(e,t){var a;if(e===ha.REFRESH_ALL)return await this.xdataControl.refresh(),null;if(e===ha.REFRESH)return(null==(a=null==t?void 0:t.data)?void 0:a[0])?await this.xdataControl.refreshNodeChildren(t.data[0],!1):await this.xdataControl.refresh(),null;if(e===ha.REFRESH_PARENT)return await this.xdataControl.refreshNodeChildren(t.data[0],!0),null;if(e===ha.EXPAND){const{data:e=[]}=t,{srfcollapsetag:a}=t.params||{};let n=a||"";if(!n&&e.length>0&&(n=e[0].srfnodeid),!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.xdataControl.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{data:e=[]}=t,{srfcollapsetag:a}=t.params||{};let n=a||"";if(!n&&e.length>0&&(n=e[0].srfnodeid),!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.xdataControl.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.xdataControl.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.xdataControl.changeCollapse({expand:!1}),null):super.call(e,t)}async openData(e){const{data:t,event:a}=e;return await this.xdataControl.openData(t[0],a)}async newData(e){const{data:t,event:a}=e;return await this.xdataControl.newData(t[0],a)}}e("bI",ON);class MN extends uo{get tabExpPanel(){return this.view.getController("tabexppanel")}async onCreated(){var e;this.preprocessTabExpModelLayout(),await super.onCreated();const{childNames:t,model:a}=this.view;t.push("tabexppanel"),this.view.slotProps.tabexppanel||(this.view.slotProps.tabexppanel={});const{appViewParams:n}=a,i=null==(e=null==n?void 0:n.find(e=>"srfdefaultnav"===e.id))?void 0:e.value;this.view.slotProps.tabexppanel.defaultTabName=this.view.state.srfnav||i,this.view.slotProps.tabexppanel.hideEditItem=!0}async refresh(){await this.loadEntityData(),this.tabExpPanel.refresh()}async call(e,t){return e===ha.REFRESH?(await this.refresh(),null):super.call(e,t)}async onMounted(){await super.onMounted(),await this.loadEntityData()}async loadEntityData(){const e=ra(this.view.model.appDataEntityId);if(this.view.context[e])return super.loadEntityData()}preprocessTabExpModelLayout(){const e=(t,a=this.view.model.viewLayoutPanel.rootPanelItems)=>{if(null==a?void 0:a.length)for(let n=0;n<a.length;n++){const i=a[n];if(i.id===t)return i;const o=i;if(o.panelItems&&o.panelItems.length>0){const a=e(t,o.panelItems);if(a)return a}}},t=(e,a=this.view.model.viewLayoutPanel.rootPanelItems)=>{for(let n=0;n<a.length;n++){const i=a[n];e.includes(i.id)&&a.splice(n,1);const o=i;o.panelItems&&o.panelItems.length>0&&t(e,o.panelItems)}},a=t=>{const a=e("tabexppanel");if(!a)throw new Gt(this.view.model.viewLayoutPanel,ibiz.i18n.t("viewEngine.noFoundLayoutOccupied"));const n=e(t);if(!n)throw new Gt(this.view.model.viewLayoutPanel,ibiz.i18n.t("viewEngine.noFoundLayoutContainer",{name:t}));n.panelItems=[a]},{tabLayout:n}=this.view.model,i=["view_tabexppanel","view_tabexppanel_left","view_tabexppanel_bottom","view_tabexppanel_right"];let o="view_tabexppanel";switch(n){case"LEFT":o="view_tabexppanel_left",i.splice(1,1);break;case"BOTTOM":o="view_tabexppanel_bottom",i.splice(2,1);break;case"RIGHT":o="view_tabexppanel_right",i.splice(3,1);break;case"TOP":default:i.splice(0,1);case"FLOW":case"FLOW_NOHEADER":}"FLOW"!==n&&"FLOW_NOHEADER"!==n&&(a(o),t(i))}calcViewHeaderVisible(){let e=super.calcViewHeaderVisible();const{tabLayout:t}=this.view.model;return(void 0===t||["TOP","TOP_DROPDOWNLIST"].includes(t)&&Pn(this.view.model,"tabexppanel"))&&(e=!0),e}}e("b5",MN);class NN extends co{get expBarName(){throw Error(ibiz.i18n.t("viewEngine.subclassAchieve"))}get expBar(){return this.view.getController(this.expBarName)}get xdataControl(){return this.expBar.xDataController}constructor(e){var t,a;const n=null==(a=null==(t=e.model.viewLayoutPanel)?void 0:t.controls)?void 0:a.find(e=>"searchbar"===e.id);n&&!n.name&&(n.name="searchbar"),super(e)}async onCreated(){super.onCreated(),this.modifySplitContainer();const{childNames:e}=this.view;e.push(this.expBarName),this.view.slotProps[this.expBarName]||(this.view.slotProps[this.expBarName]={}),this.view.slotProps[this.expBarName].loadDefault=!1,this.view.slotProps[this.expBarName].srfnav=this.view.state.srfnav}modifySplitContainer(){const e=Pn(this.view.model,this.expBarName),{width:t,height:a}=e;(t||a)&&qt(this.view.model.viewLayoutPanel,e=>{"view_exp_split"===e.id&&(t&&(e.panelItems[0].layoutPos.width=t),a&&(e.panelItems[0].layoutPos.height=a))},{childrenFields:["rootPanelItems","panelItems","panelTabPages"]})}async onXDataActive(e){}getSearchParams(){const e=super.getSearchParams();return this.expBar.state.query&&(e.query=this.expBar.state.query),e}async load(e){await this.expBar.load()}}e("bk",NN);class BN extends NN{get expBarName(){return"gridexpbar"}}e("bn",BN);class LN extends NN{get expBarName(){return"listexpbar"}}e("bp",LN);class RN extends NN{get expBarName(){return"dataviewexpbar"}}e("be",RN);class _N extends NN{get expBarName(){return"treeexpbar"}get tree(){return this.expBar.xDataController}async call(e,t){var a;if(e===ha.REFRESH_ALL)return await this.tree.refresh(),null;if(e===ha.REFRESH)return(null==(a=null==t?void 0:t.data)?void 0:a[0])?await this.tree.refreshNodeChildren(t.data[0],!1):await this.tree.refresh(),null;if(e===ha.REFRESH_PARENT)return await this.tree.refreshNodeChildren(t.data[0],!0),null;if(e===ha.EXPAND){const{data:e=[]}=t,{srfcollapsetag:a}=t.params||{};let n=a||"";if(!n&&e.length>0&&(n=e[0].srfnodeid),!n)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.tree.changeCollapse({tag:n,expand:!0}),null}if(e===ha.COLLAPSE){const{data:e=[]}=t,{srfcollapsetag:a}=t.params||{};let n=a||"";if(!n&&e.length>0&&(n=e[0].srfnodeid),!n)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.tree.changeCollapse({tag:n,expand:!1}),null}return e===ha.EXPANDALL?(this.tree.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.tree.changeCollapse({expand:!1}),null):super.call(e,t)}async onMounted(){await super.onMounted(),await this.loadEntityData()}async loadEntityData(){const e=ra(this.view.model.appDataEntityId);if(this.view.context[e]&&this.view.model.showDataInfoBar)return super.loadEntityData()}}e("b6",_N);class jN extends uo{get wizardPanel(){return this.view.getController("wizardpanel")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("wizardpanel")}async onMounted(){await super.onMounted(),this.view.slotProps.wizardpanel||(this.view.slotProps.wizardpanel={}),this.wizardPanel.initialize(),this.wizardPanel.evt.on("onFinishSuccess",e=>{this.view.closeView({ok:!0,data:e.data})})}}e("bO",jN);class VN extends co{get xdataControlName(){return"chart"}get chart(){return this.view.getController("chart")}async onCreated(){await super.onCreated(),this.view.slotProps.chart||(this.view.slotProps.chart={})}}e("bb",VN);var FN=Object.defineProperty,UN=(e,t,a)=>(((e,t,a)=>{t in e?FN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class HN extends hN{constructor(){super(...arguments),UN(this,"isEditable",!1),UN(this,"isCalcWFToolbar",!0),UN(this,"entityService"),UN(this,"processForm"),UN(this,"wfLinks",[])}get form(){return this.view.getController(this.processForm.name)}async onCreated(){await super.onCreated();const e=ibiz.hub.getApp(this.view.context.srfappid);this.entityService=await e.deService.getService(this.view.context,this.view.model.appDataEntityId),await this.calcProcessForm();const{childNames:t}=this.view;t.push(this.processForm.name)}async onMounted(){var e;await super.onMounted(),null==(e=this.toolbar)||e.evt.on("onClick",async e=>{"extra"===e.buttonType&&e.eventArg&&this.onLinkClick(e.eventArg)})}async load(){const e=await super.load();return this.isCalcWFToolbar&&this.calcWfToolbar(),e}async refresh(){const e=this.processForm;await this.calcProcessForm(),e===this.processForm&&await super.refresh()}async calcProcessFormName(){const e=(await this.entityService.wf.getWFStep(Object.assign(this.view.context.clone(),{...this.view.params}))).data;this.isEditable="true"===e.isEditable,this.isEditable||e.hasOwnProperty("process-editmode")&&Number(e["process-editmode"])>0&&(this.isEditable=!0);const t="process-".concat(ibiz.env.isMob?"mob":"","form");return e[t]?"wfform_".concat(e[t]):"form"}async calcProcessForm(){const e=await this.calcProcessFormName(),t=Pn(this.view.model,e.toLowerCase());if(!t)throw new Xt(this.view.model,ibiz.i18n.t("viewEngine.noFoundFormModel",{name:e}));this.processForm=t,this.view.slotProps.form||(this.view.slotProps.form={}),this.view.slotProps.form.modelData=this.processForm}async calcWfToolbar(){if(!this.toolbar)throw new Xt(this.view.model,ibiz.i18n.t("viewEngine.missingToolbarModel"));this.toolbar.clearExtraButtons();const e=ibiz.hub.getApp(this.view.context.srfappid),t=await e.deService.getService(this.view.context,this.view.model.appDataEntityId),a=await t.wf.getWFLink(Object.assign(this.view.context.clone(),{taskDefinitionKey:this.view.params.taskDefinitionKey}),this.getData()[0].getOrigin());this.wfLinks=a.data,this.wfLinks.forEach(e=>{e.id=go()});const n=this.wfLinks.map(e=>({id:e.id,appId:this.view.model.appId,caption:e.sequenceFlowName,buttonType:"extra",tooltip:e.sequenceFlowName,showCaption:!0}));this.toolbar.setExtraButtons("before",n)}async onLinkClick(e){const t=this.wfLinks.find(t=>t.id===e);if(t)return this.wfSubmitByLink(t)}async wfSubmitByLink(e){this.isEditable&&await this.save({silent:!0});const t=Object.assign(this.view.context.clone(),{isEditable:this.isEditable,processForm:e.sequenceflowform}),a={...e},n=ho(this.view.model,e);if(!n)return await this.form.wfSubmit({viewParam:a}),void await this.view.closeView({ok:!0,data:this.form.getData()});(await ibiz.commands.execute(Ai.TAG,n,t,a)).ok&&await this.view.closeView({ok:!0,data:this.form.getData()})}}e("bK",HN);class qN extends HN{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drtab")}get drtab(){return this.view.getController("drtab")}}e("bL",qN);var GN=Object.defineProperty,WN=(e,t,a)=>(((e,t,a)=>{t in e?GN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class YN extends HN{constructor(){super(...arguments),WN(this,"isCalcWFToolbar",!1)}async calcProcessFormName(){this.isEditable="true"===this.view.context.isEditable;return this.view.context.processForm?"wfform_".concat(this.view.context.processForm):"form"}async call(e,t){return e===ha.OK?(this.onOkButtonClick(),null):e===ha.CANCEL?(await this.onCancelButtonClick(),null):super.call(e,t)}async onOkButtonClick(){this.view.context.isEditable?await this.save({silent:!0}):this.form.state.modified=!1,await this.form.wfSubmit({}),await this.view.closeView({ok:!0,data:this.getData()})}async onCancelButtonClick(){await this.view.closeView({ok:!1,data:[]})}}e("bJ",YN);var KN=Object.defineProperty,XN=(e,t,a)=>(((e,t,a)=>{t in e?KN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class $N extends HN{constructor(){super(...arguments),XN(this,"isCalcWFToolbar",!1)}async calcProcessFormName(){this.isEditable="true"===this.view.context.isEditable;return this.view.context.processForm?"wfform_".concat(this.view.context.processForm):"form"}async call(e,t){return e===ha.OK?(this.onOkButtonClick(),null):e===ha.CANCEL?(await this.onCancelButtonClick(),null):super.call(e,t)}async onOkButtonClick(){await this.save({silent:!0}),await this.form.wfStart({}),await this.view.closeView({ok:!0,data:this.getData()})}async onCancelButtonClick(){await this.view.closeView({ok:!1,data:[]})}}e("bM",$N);class JN extends io{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("dashboard")}get dashboard(){return this.view.getController("dashboard")}async refresh(){await this.dashboard.refresh()}getData(){return this.view.state.srfactiveviewdata?[this.view.state.srfactiveviewdata]:[]}async call(e,t){return e===ha.REFRESH?(t.ctrl?await t.ctrl.refresh():await this.refresh(),null):super.call(e,t)}async onMounted(){if(await super.onMounted(),this.view.model.appDataEntityId){const e=ra(this.view.model.appDataEntityId);if(!this.view.context[e])return;await this.loadEntityData()}}doMarkDataAction(){if(super.doMarkDataAction(),this.doActions.includes("VIEW")&&this.view.evt.on("onDataChange",()=>this.sendViewDataAction()),this.doActions.includes("EDIT")){let e=!1;this.dashboard.evt.on("onConfigChange",()=>{const t=this.getData()[0];(null==t?void 0:t.srfkey)&&!e&&(e=!0,this.sendMarkDataAction("EDIT",t.srfkey),setTimeout(()=>{e=!1},3e5))})}this.doActions.includes("UPDATE")&&this.dashboard.evt.on("onSavePortlet",()=>{const e=this.getData()[0];(null==e?void 0:e.srfkey)&&this.sendMarkDataAction("UPDATE",null==e?void 0:e.srfkey)})}}e("bC",JN);class QN extends uo{async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("panel")}get panel(){return this.view.getController("panel")}async onMounted(){await super.onMounted(),this.view.model.appDataEntityId&&await this.loadEntityData()}}e("bw",QN);var ZN=Object.defineProperty,eB=(e,t,a)=>(((e,t,a)=>{t in e?ZN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class tB extends uo{constructor(){super(...arguments),eB(this,"controls",[])}async onCreated(){await super.onCreated(),this.controls=oo(this.view.model)}async onMounted(){await super.onMounted(),this.calcToolbarState=this.calcToolbarState.bind(this),this.controls.forEach(e=>{const t=this.view.getController(e.name);null==t||t.evt.on("onLoadSuccess",t=>this.calcToolbarButtonState(e,void 0,t)),null==t||t.evt.on("onSelectionChange",t=>this.calcToolbarButtonState(e,t.data[0],t)),null==t||t.evt.on("onRefreshSuccess",t=>this.calcToolbarButtonState(e,t.data[0],t))})}calcToolbarButtonState(e,t,a){const n=this.controls.find(t=>{var a;return"TOOLBAR"===t.controlType&&(null==(a=t.xdataControlName)?void 0:a.toLowerCase())===e.name});if(n){const i=this.view.getController(n.name);null==i||i.calcButtonState(t,e.appDataEntityId,a)}}async call(e,t){var a;return e===ha.REFRESH?(await(null==(a=this.viewLayoutPanel)?void 0:a.load()),null):super.call(e,t)}}e("bc",tB);var aB=Object.defineProperty,nB=(e,t,a)=>(((e,t,a)=>{t in e?aB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class iB extends uo{constructor(){super(...arguments),nB(this,"controls",[])}get tabSearchBar(){return this.view.getController("tabsearchbar")}async onCreated(){await super.onCreated(),this.controls=oo(this.view.model),this.initMDCtrlActiveMode()}async onMounted(){await super.onMounted(),this.calcToolbarState=this.calcToolbarState.bind(this),this.searchForm&&this.searchForm.evt.on("onSearch",()=>{this.reLoad()}),this.searchBar&&this.searchBar.evt.on("onSearch",()=>{this.reLoad()}),this.tabSearchForm&&this.tabSearchForm.evt.on("onSearch",()=>{this.reLoad()}),this.tabSearchBar&&this.tabSearchBar.evt.on("onSearch",()=>{this.reLoad()}),this.controls.forEach(e=>{const t=this.view.getController(e.name);null==t||t.evt.on("onLoadSuccess",t=>this.calcToolbarButtonState(e,void 0,t)),null==t||t.evt.on("onSelectionChange",t=>this.calcToolbarButtonState(e,t.data[0],t)),null==t||t.evt.on("onRefreshSuccess",t=>this.calcToolbarButtonState(e,t.data[0],t)),null==t||t.evt.on("onBeforeLoad",()=>{t.state.searchParams=this.getSearchParams()})})}getSearchParams(){const e={};return this.searchForm&&Object.assign(e,this.searchForm.getFilterParams()),this.searchBar&&Object.assign(e,this.searchBar.getFilterParams()),this.tabSearchForm&&Object.assign(e,this.tabSearchForm.getFilterParams()),this.tabSearchBar&&Object.assign(e,this.tabSearchBar.getFilterParams()),e}initMDCtrlActiveMode(){const{model:e}=this.view;this.controls.forEach(t=>{const a=t.name||t.id;this.view.slotProps[a]||(this.view.slotProps[a]={}),this.view.slotProps[a].mdctrlActiveMode=e.mdctrlActiveMode})}calcToolbarButtonState(e,t,a){const n=this.controls.find(t=>{var a;return"TOOLBAR"===t.controlType&&(null==(a=t.xdataControlName)?void 0:a.toLowerCase())===e.name});if(n){const i=this.view.getController(n.name);null==i||i.calcButtonState(t,e.appDataEntityId,a)}}async call(e,t){return e===ha.REFRESH?(await this.refresh(),null):e===ha.EDIT||e===ha.VIEW?this.openData(t):e===ha.NEW?this.newData(t):super.call(e,t)}async reLoad(){if(this.view.state.xdatacontrolname){const e=this.view.getController(this.view.state.xdatacontrolname);await(null==e?void 0:e.load({isInitialLoad:!0}))}}async refresh(){if(this.view.state.xdatacontrolname){const e=this.view.getController(this.view.state.xdatacontrolname);await(null==e?void 0:e.refresh())}}async openData(e){var t,a;const{data:n,ctrl:i,event:o}=e,s=(e.context||this.view.context).clone();let l=null==(t=n[0].srfdecodename)?void 0:t.toLowerCase();i&&(s.srfnavctrlid=i.ctrlId,l||(l=ra(i.model.appDataEntityId)));const r=e.params||this.view.params;s[l.toLowerCase()]=n[0].srfkey;const c=await(null==(a=this.view.scheduler)?void 0:a.triggerCustom("opendata",{context:s,params:r,data:n,event:o,view:this.view}));if(-1===c)throw new Xt(this.view.model,ibiz.i18n.t("runtime.engine.logicOpendata"));return{cancel:!c||!c.ok}}async newData(e){var t,a,n;const{data:i,event:o,copyMode:s}=e;if(!(null==(a=null==(t=this.view.model.viewLayoutPanel)?void 0:t.appViewLogics)?void 0:a.find(e=>"newdata"===e.id)))throw new Xt(this.view.model,ibiz.i18n.t("runtime.engine.logicNewdata"));const l=Ko(this.view.params);s&&(l.srfcopymode=s);const r=await(null==(n=this.view.scheduler)?void 0:n.triggerCustom("newdata",{context:this.view.context,params:l,data:i,event:o,view:this.view}));if(-1===r)throw new Xt(this.view.model,ibiz.i18n.t("runtime.engine.logicNewdata"));return{cancel:!r||!r.ok}}}e("bd",iB);var oB=Object.defineProperty,sB=(e,t,a)=>(((e,t,a)=>{t in e?oB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class lB extends ON{constructor(){super(...arguments),sB(this,"selectData",[])}async onCreated(){super.onCreated(),this.view.slotProps.tree||(this.view.slotProps.tree={}),this.view.slotProps.tree.singleSelect=this.view.state.singleSelect,this.view.slotProps.tree.checkStrictly=this.view.state.checkStrictly,this.initSelectData()}initSelectData(){this.view.params.selecteddata&&(this.selectData=JSON.parse(this.view.params.selecteddata),delete this.view.params.selecteddata),this.view.state.selectedData&&(this.selectData=[...this.view.state.selectedData])}async onMounted(){const{model:e}=this.view;this.xdataControl.evt.on("onSelectionChange",async e=>{this.view.evt.emit("onSelectionChange",{...e})}),this.xdataControl.evt.on("onActive",async e=>{this.view.evt.emit("onDataActive",{...e})}),!this.view.state.noLoadDefault&&e.loadDefault&&this.load(),this.setSelectedData(this.selectData)}async call(e,t){return e===Va.GET_ALL_DATA?this.tree.state.items:super.call(e,t)}}e("bz",lB);var rB=Object.defineProperty,cB=(e,t,a)=>(((e,t,a)=>{t in e?rB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class dB extends CN{constructor(){super(...arguments),cB(this,"selectData",[])}get dataview(){return this.view.getController("dataview")}async onCreated(){super.onCreated(),this.view.slotProps.dataview.singleSelect=this.view.state.singleSelect,this.initSelectData()}initSelectData(){this.view.params.selecteddata&&(this.selectData=JSON.parse(this.view.params.selecteddata),delete this.view.params.selecteddata),this.view.state.selectedData&&(this.selectData=[...this.view.state.selectedData])}async onMounted(){await super.onMounted(),this.xdataControl.evt.on("onSelectionChange",async e=>{this.view.evt.emit("onSelectionChange",{...e})}),this.xdataControl.evt.on("onActive",async e=>{this.view.evt.emit("onDataActive",{...e})}),this.setSelectedData(this.selectData)}async call(e,t){return e===Va.GET_ALL_DATA?this.dataview.state.items:super.call(e,t)}}e("bx",dB);class uB extends kN{get treeExpBar(){return this.view.getController("treeexpbar")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("treeexpbar"),this.view.slotProps.treeexpbar||(this.view.slotProps.treeexpbar={}),this.view.slotProps.treeexpbar.noNeedNavView=!0,this.view.slotProps.pickupviewpanel||(this.view.slotProps.pickupviewpanel={}),this.view.slotProps.pickupviewpanel.noLoadDefault=!0,this.view.slotProps.pickupviewpanel.singleSelect=!0}async onMounted(){await super.onMounted(),this.treeExpBar.load(),this.treeExpBar.evt.on("onNavViewChange",e=>{this.view.slotProps.pickupviewpanel.context=e.navViewMsg.context,this.view.slotProps.pickupviewpanel.params={...this.view.params,...e.navViewMsg.params}})}}e("bB",uB);class hB extends co{async onXDataActive(e){}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.calendar||(this.view.slotProps.calendar={}),this.view.slotProps.calendar.mdctrlActiveMode=e.mdctrlActiveMode}async openData(e){const{data:t,event:a}=e;return await this.xdataControl.openData(t[0],a)}async newData(e){const{data:t,event:a}=e;return await this.xdataControl.newData(t[0],a)}}e("b9",hB);class pB extends NN{get expBarName(){return"calendarexpbar"}}e("b8",pB);class mB extends AN{get treeExpBar(){return this.view.getController("treeexpbar")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("treeexpbar"),this.view.slotProps.treeexpbar||(this.view.slotProps.treeexpbar={}),this.view.slotProps.treeexpbar.noNeedNavView=!0,this.view.slotProps.pickupviewpanel.noLoadDefault=!0}async onMounted(){await super.onMounted(),this.treeExpBar.load(),this.treeExpBar.evt.on("onNavViewChange",e=>{this.view.slotProps.pickupviewpanel.context=e.navViewMsg.context,this.view.slotProps.pickupviewpanel.params=e.navViewMsg.params})}}e("bv",mB);class vB extends co{get kanbanview(){return this.view.getController("kanban")}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.kanban||(this.view.slotProps.kanban={}),this.view.slotProps.kanban.mdctrlActiveMode=e.mdctrlActiveMode}}e("bo",vB);class gB extends dB{}e("bl",gB);var bB=Object.defineProperty,fB=(e,t,a)=>(((e,t,a)=>{t in e?bB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class wB extends uo{constructor(){super(...arguments),fB(this,"route",us()),fB(this,"enterKeyListener",async e=>{if("BUTTON"===e.target.nodeName&&"Enter"===e.key&&this.view.layoutPanel){const t={data:[{username:this.view.layoutPanel.data.username,password:this.view.layoutPanel.data.password,captcha:this.view.layoutPanel.data.captcha}]},a=e.target.dataset.id;if(a){const e=this.view.layoutPanel.findPanelItemByName(a);e&&(t.data=[e.data])}await this.login(t)}})}async onMounted(){super.onMounted(),document.addEventListener("keyup",this.enterKeyListener)}async onDestroyed(){super.onDestroyed(),document.removeEventListener("keyup",this.enterKeyListener)}async call(e,t={}){return e===ha.LOGIN?(await this.login(t),null):super.call(e,t)}async login(e){var t;let a;const n={},i=e.data[0]||{},o=null==(t=e.params)?void 0:t.panelDataParent;if(this.view.layoutPanel){if(!await this.view.layoutPanel.validate(o))return;const e=this.view.layoutPanel.data;"boolean"==typeof e.isRemember&&(a=e.isRemember),i.captcha&&Object.assign(n,i.captcha),e.srfheaders&&Object.assign(n,e.srfheaders)}let s=i.username;vo(i.orgid)&&(s="".concat(i.username,"@").concat(i.orgid));const l=await ibiz.auth.login(s,i.password,a,n);if(this.view.evt.emit("onAfterLogin",{ok:l,panelDataParent:o}),!0===l){const e=window.location.href.indexOf("srfthird_auth_success=false")>=0;if(window.location.hash=this.route.query.ru||"/",window.history.pushState({},""),e){const e=window.location.href.replace("?srfthird_auth_success=false","");window.location.href=e}else window.location.reload()}}async cancelChanges(e={targetState:"INIT"}){this.view.layoutPanel&&Object.keys(this.view.layoutPanel.panelItems).forEach(e=>{const t=this.view.layoutPanel.panelItems[e],{viewFieldName:a}=t.model;a&&t.setDataValue("",a)})}}e("br",wB);class yB extends ON{get treeGridEx(){return this.view.getController("treegridex")}async call(e,t){return e===ha.TOGGLE_ROW_EDIT?(this.treeGridEx.toggleRowEdit(),null):e===ha.SAVE_ROW?(this.treeGridEx.save(t.data[0]),null):e===ha.SAVE?(this.treeGridEx.saveAll(),null):e===ha.REFRESH?(this.treeGridEx.load(),null):super.call(e,t)}}e("bG",yB);class CB extends gN{get xdataControlName(){return"treegrid"}get treeGrid(){return this.view.getController("treegrid")}async onCreated(){await super.onCreated(),this.view.slotProps.treegrid?Object.assign(this.view.slotProps.treegrid,this.view.slotProps.grid):this.view.slotProps.treegrid=this.view.slotProps.grid}async call(e,t){if(e===ha.EXPAND){const{srfcollapsetag:e}=t.params||{};let a=e||"";if(!a){const{selectedData:e}=this.treeGrid.state,t=e.filter(e=>e.hasChildren);t.length>0&&(a=t[0].srfkey)}if(!a)throw new Vt(ibiz.i18n.t("viewEngine.noExpandTag"));return this.treeGrid.changeCollapse({tag:a,expand:!0}),null}if(e===ha.COLLAPSE){const{srfcollapsetag:e}=t.params||{};let a=e||"";if(!a){const{selectedData:e}=this.treeGrid.state,t=e.filter(e=>e.hasChildren);t.length>0&&(a=t[0].srfkey)}if(!a)throw new Vt(ibiz.i18n.t("viewEngine.noCollapseTag"));return this.treeGrid.changeCollapse({tag:a,expand:!1}),null}return e===ha.EXPANDALL?(this.treeGrid.changeCollapse({expand:!0}),null):e===ha.COLLAPSEALL?(this.treeGrid.changeCollapse({expand:!1}),null):super.call(e,t)}}e("bH",CB);class IB extends co{get xdataControlName(){return"meditviewpanel"}get meditviewpanel(){return this.view.getController("meditviewpanel")}async onCreated(){await super.onCreated(),this.view.slotProps.meditviewpanel||(this.view.slotProps.meditviewpanel={})}async call(e,t){return e===ha.NEW?(await this.meditviewpanel.handleAdd(),null):e===ha.REFRESH?null:super.call(e,t)}}e("bt",IB);class xB extends NN{get expBarName(){return"chartexpbar"}}e("ba",xB);class SB extends co{get map(){return this.view.getController("map")}async onCreated(){super.onCreated(),this.view.slotProps.map||(this.view.slotProps.map={})}}e("bs",SB);class EB extends uo{get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get reportpanel(){return this.view.getController("reportpanel")}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("searchform","searchbar","reportpanel"),this.view.slotProps.reportpanel||(this.view.slotProps.reportpanel={})}async onMounted(){await super.onMounted();const{model:e}=this.view;this.reportpanel.evt.on("onBeforeLoad",()=>{this.reportpanel.state.searchParams=this.getSearchParams()}),this.reportpanel.evt.on("onLoadSuccess",e=>{this.view.evt.emit("onDataChange",{...e,actionType:"LOAD"})});const t=this.viewLayoutPanel.panelItems.view_searchform;if(t){const a=!!this.searchForm;t.state.keepAlive=a,t.state.visible=a&&!!e.expandSearchForm}this.searchForm&&this.searchForm.evt.on("onSearch",()=>{this.reLoad()}),this.searchBar&&this.searchBar.evt.on("onSearch",()=>{this.reLoad()}),!this.view.state.noLoadDefault&&e.loadDefault&&this.load()}async call(e,t){return e===ha.REFRESH?(await this.refresh(),null):e===ha.SEARCH?(await this.searchForm.search(),null):e===ha.RESET?(await this.searchForm.reset(),null):super.call(e,t)}getData(){return this.reportpanel.getData()}async load(){return this.reportpanel.load()}async reLoad(){await this.reportpanel.load({isInitialLoad:!0})}async refresh(){this.reportpanel.doNextActive(()=>this.load(),{key:"load"})}getSearchParams(){const e={};return this.searchForm&&Object.assign(e,this.searchForm.getFilterParams()),this.searchBar&&Object.assign(e,this.searchBar.getFilterParams()),e}calcViewHeaderVisible(){const e=super.calcViewHeaderVisible();return this.calcViewSearchBarVisible()||e}calcViewSearchBarVisible(){const{model:e}=this.view,t=this.isExistAndInLayout("searchbar");if(!t)return t;const a=Pn(e,"searchbar");return!(!a.enableQuickSearch&&!a.enableGroup&&!0!==a.enableFilter)}calcRemoveLayoutModel(){const e=super.calcRemoveLayoutModel();return this.calcViewSearchBarVisible()||e.push("view_searchbar"),e}toggleFilter(){if(this.searchForm){const e=this.viewLayoutPanel.panelItems.view_searchform;e&&(e.state.visible=!e.state.visible)}}}e("bD",EB);class DB extends yB{get gantt(){return this.view.getController("gantt")}async call(e,t){return e===ha.NEW_ROW?(this.gantt.newRow(t),null):e===ha.TOGGLE_ROW_EDIT?(this.gantt.toggleRowEdit(),null):e===ha.SAVE_ROW?(this.gantt.save(t.data[0]),null):e===ha.SAVE?(this.gantt.saveAll(),null):e===ha.REFRESH?(await this.gantt.refresh(),null):super.call(e,t)}async onCreated(){super.onCreated();const{model:e}=this.view;this.view.slotProps.gantt||(this.view.slotProps.gantt={}),this.view.slotProps.gantt.mdctrlActiveMode=e.mdctrlActiveMode}}e("bm",DB);class PB extends hN{get drbar(){return this.view.getController("drbar")}get routeDepth(){return this.view.modal.routeDepth}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("drbar"),this.view.slotProps.drbar||(this.view.slotProps.drbar={}),this.view.slotProps.drbar.showMode="horizontal",this.view.slotProps.drbar.srfnav=this.view.state.srfnav,this.view.slotProps.drbar.hideEditItem=!0}formDataStateChange(e){var t;const{evt:a}=this.view,n=this.form.model.appDataEntityId,i=e.data[0];null==(t=this.toolbar)||t.calcButtonState(i,n,e),i.srfkey&&a.emit("onViewInfoChange",{dataInfo:i.srfmajortext||""})}}e("bf",PB);class kB extends uo{}e("bE",kB);class zB extends MN{get searchForm(){return this.view.getController("searchform")}get searchBar(){return this.view.getController("searchbar")}get tabExpPanel(){return this.view.getController("tabexppanel")}preprocessTabExpModelLayout(){}async onCreated(){await super.onCreated();const{childNames:e}=this.view;e.push("searchform","searchbar")}async onMounted(){await super.onMounted();const e=this.viewLayoutPanel.panelItems.view_searchform;if(e){const t=!!this.searchForm;e.state.keepAlive=t,e.state.visible=t}const t=this.viewLayoutPanel.panelItems.view_searchbar;if(t){const e=this.searchBar&&!(!this.searchBar.model.enableQuickSearch&&!this.searchBar.model.enableGroup&&!0!==this.searchBar.model.enableFilter);t.state.visible=e}if(this.searchForm&&this.searchForm.evt.on("onSearch",()=>{this.calcViewParams()}),this.searchBar&&this.searchBar.evt.on("onSearch",()=>{this.calcViewParams()}),this.tabExpPanel){this.tabExpPanel.evt.on("onTabChange",({tab:e})=>{this.calcViewParams(),this.onQuickSearchPlaceHolder(e)});const{activeTabViewPanelModel:e}=this.tabExpPanel;e&&this.onQuickSearchPlaceHolder(e)}}async onQuickSearchPlaceHolder(e){let{caption:t}=e;const a=await ibiz.hub.config.view.get(e.embeddedAppDEViewId||""),n=await ibiz.hub.getAppDataEntity(a.appDataEntityId,a.appId);if(n){const e=n.appDEFields.filter(e=>e.enableQuickSearch);if(e.length){const a=[];e.forEach(e=>{e.lnlanguageRes&&e.lnlanguageRes.lanResTag?a.push(ibiz.i18n.t(e.lnlanguageRes.lanResTag,e.logicName)):e.logicName&&a.push(e.logicName)}),a.length>0&&(t=a.join("、"))}}this.searchBar&&(this.searchBar.placeHolder=t||"",this.searchBar.state.quickSearchPlaceHolder=t||"")}async call(e,t){return e===ha.SEARCH?(await this.searchForm.search(),null):e===ha.RESET?(await this.searchForm.reset(),null):e===ha.REFRESH?(await this.calcViewParams(),null):super.call(e,t)}getSearchParams(){const e={};return this.searchForm&&Object.assign(e,this.searchForm.getFilterParams()),this.searchBar&&Object.assign(e,this.searchBar.getFilterParams()),e}calcViewHeaderVisible(){let e=!1;const{model:t}=this.view;return t.showCaptionBar&&(e=!0),ibiz.env.isMob?(this.isExistAndInLayout("lefttoolbar")&&(e=!0),this.isExistAndInLayout("righttoolbar")&&(e=!0)):this.isExistAndInLayout("toolbar")&&(e=!0),e}calcViewParams(){this.tabExpPanel.state.expViewParams=this.getSearchParams(),this.tabExpPanel.refresh()}}e("bF",zB);class TB extends uo{}e("b7",TB);class AB extends uo{}e("bN",AB);class OB extends uo{async onCreated(){await super.onCreated(),ibiz.util.hiddenAppLoading()}}class MB extends uo{async onCreated(){await super.onCreated(),ibiz.util.hiddenAppLoading()}}const NB=e("b0",{install:e=>{ibiz.engine.register("VIEW_APPWFSTEPDATAVIEW",e=>new AB(e)),ibiz.engine.register("VIEW_AppIndexView",e=>new wN(e)),ibiz.engine.register("VIEW_APPINDEXVIEW",e=>new wN(e)),ibiz.engine.register("VIEW_GridView",e=>new gN(e)),ibiz.engine.register("VIEW_ListView",e=>new yN(e)),ibiz.engine.register("VIEW_TreeView",e=>new ON(e)),ibiz.engine.register("VIEW_EditView",e=>new hN(e)),ibiz.engine.register("VIEW_EditView2",e=>new pN(e)),ibiz.engine.register("VIEW_EditView3",e=>new mN(e)),ibiz.engine.register("VIEW_EditView4",e=>new vN(e)),ibiz.engine.register("VIEW_DataView",e=>new CN(e)),ibiz.engine.register("VIEW_OptionView",e=>new IN(e)),ibiz.engine.register("VIEW_PickupGridView",e=>new EN(e)),ibiz.engine.register("VIEW_PickupTreeView",e=>new lB(e)),ibiz.engine.register("VIEW_DEPICKUPVIEW2",e=>new uB(e)),ibiz.engine.register("VIEW_PickupView",e=>new kN(e)),ibiz.engine.register("VIEW_MPickupView",e=>new AN(e)),ibiz.engine.register("VIEW_DEMPICKUPVIEW2",e=>new mB(e)),ibiz.engine.register("VIEW_TabExpView",e=>new MN(e)),ibiz.engine.register("VIEW_GridExpView",e=>new BN(e)),ibiz.engine.register("VIEW_ListExpView",e=>new LN(e)),ibiz.engine.register("VIEW_DataViewExpView",e=>new RN(e)),ibiz.engine.register("VIEW_ChartView",e=>new VN(e)),ibiz.engine.register("VIEW_TreeExpView",e=>new _N(e)),ibiz.engine.register("VIEW_WizardView",e=>new jN(e)),ibiz.engine.register("VIEW_WFDynaEditView",e=>new HN(e)),ibiz.engine.register("VIEW_DEWFDYNAEDITVIEW3",e=>new qN(e)),ibiz.engine.register("VIEW_DEWFDYNAACTIONVIEW",e=>new YN(e)),ibiz.engine.register("VIEW_DEWFDYNASTARTVIEW",e=>new $N(e)),ibiz.engine.register("VIEW_APPPORTALVIEW",e=>new JN(e)),ibiz.engine.register("VIEW_DEPORTALVIEW",e=>new JN(e)),ibiz.engine.register("VIEW_PortalView9",e=>new JN(e)),ibiz.engine.register("VIEW_PortalView",e=>new JN(e)),ibiz.engine.register("VIEW_DEPANELVIEW",e=>new QN(e)),ibiz.engine.register("VIEW_APPPANELVIEW",e=>new QN(e)),ibiz.engine.register("VIEW_DECUSTOMVIEW",e=>new tB(e)),ibiz.engine.register("VIEW_DEMDCUSTOMVIEW",e=>new iB(e)),ibiz.engine.register("VIEW_DEPICKUPDATAVIEW",e=>new dB(e)),ibiz.engine.register("VIEW_PickupDataView",e=>new dB(e)),ibiz.engine.register("VIEW_DEINDEXPICKUPDATAVIEW",e=>new dB(e)),ibiz.engine.register("VIEW_DECALENDARVIEW",e=>new hB(e)),ibiz.engine.register("VIEW_CalendarExpView",e=>new pB(e)),ibiz.engine.register("VIEW_FormPickupDataView",e=>new gB(e)),ibiz.engine.register("VIEW_KanBanView",e=>new vB(e)),ibiz.engine.register("VIEW_APPLOGINVIEW",e=>new wB(e)),ibiz.engine.register("VIEW_TreeGridExView",e=>new yB(e)),ibiz.engine.register("VIEW_DETREEGRIDVIEW",e=>new CB(e)),ibiz.engine.register("VIEW_DECHARTEXPVIEW",e=>new xB(e)),ibiz.engine.register("VIEW_DEGANTTVIEW",e=>new DB(e)),ibiz.engine.register("VIEW_DESUBAPPREFVIEW",e=>new kB(e)),ibiz.engine.register("VIEW_APPDATAUPLOADVIEW",e=>new TB(e)),ibiz.engine.register("VIEW_APPSTARTVIEW",e=>new OB(e)),ibiz.engine.register("VIEW_APPWELCOMEVIEW",e=>new MB(e)),ibiz.engine.register("VIEW_GridView9",e=>new gN(e)),ibiz.engine.register("VIEW_ListView9",e=>new yN(e)),ibiz.engine.register("VIEW_EditView9",e=>new hN(e)),ibiz.engine.register("VIEW_DataView9",e=>new CN(e)),ibiz.engine.register("VIEW_TreeView9",e=>new ON(e)),ibiz.engine.register("VIEW_DETABEXPVIEW9",e=>new MN(e)),ibiz.engine.register("VIEW_PortalView9",e=>new JN(e)),ibiz.engine.register("VIEW_DEPORTALVIEW9",e=>new JN(e)),ibiz.engine.register("VIEW_DEMEDITVIEW9",e=>new IB(e)),ibiz.engine.register("VIEW_DEMAPVIEW",e=>new SB(e)),ibiz.engine.register("VIEW_DEREPORTVIEW",e=>new EB(e)),ibiz.engine.register("VIEW_DEINDEXVIEW",e=>new PB(e)),ibiz.engine.register("VIEW_DETABSEARCHVIEW",e=>new zB(e))}});var BB=Object.defineProperty,LB=(e,t,a)=>(((e,t,a)=>{t in e?BB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);const RB=e("i",Is({legacy:!1,locale:"zh-CN"}));const _B=new class{constructor(){LB(this,"html"),LB(this,"defaultLang"),LB(this,"langMap",new Map),this.defaultLang="zh-CN",this.html=document.querySelector("html");const e=localStorage.getItem("language")||navigator.language||this.defaultLang;RB.global.locale.value=e,this.html.setAttribute("lang",e),this.langMap.set("en",()=>t.import("./index-Cmb9aRPY.js")),this.langMap.set("zh-CN",()=>t.import("./index-JVe7O62m.js"))}async init(){const e=RB.global.locale.value;let t;t=this.langMap.has(e)?this.langMap.get(e):this.langMap.get(this.defaultLang);const a=await t();RB.global.setLocaleMessage(RB.global.locale.value,a.default)}setLangConfigs(e){Object.keys(e).forEach(t=>{this.langMap.set(t,e[t])})}setLang(e){ibiz.confirm.warning({title:"提示",desc:"切换语言需要刷新页面,确认切换?"}).then(t=>{t&&(localStorage.setItem("language",e),window.location.reload())})}getLang(){return this.html.getAttribute("lang")||this.defaultLang}t(e,t,a){return RB.global.t(e,t,a)}mergeLocaleMessage(e,t){if("string"==typeof e){const a=e;RB.global.mergeLocaleMessage(a,t)}else{const t=e;t&&Object.keys(t).length>0&&Object.keys(t).forEach(e=>{RB.global.mergeLocaleMessage(e,t[e])})}}};var jB=Object.defineProperty,VB=(e,t,a)=>(((e,t,a)=>{t in e?jB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class FB{constructor(e){VB(this,"isFullCode",!1),VB(this,"customModelLoader"),this.isFullCode=(null==e?void 0:e.isFullCode)||!1,this.customModelLoader=(null==e?void 0:e.customModelLoader)||void 0,this.customModelLoader&&ibiz.hub.registerModelLoaderProvider(this.customModelLoader)}async verify(e,t=!0){if(t){let t=!0;try{ibiz.env.enableAnonymous?await this.anonymousValidate(e):await this.appInit(e)}catch(e){t=!1,e.tag="APPINIT",ibiz.util.error.handle(e)}return t}return await this.initModel(e,!1),!0}async anonymousValidate(e){const t=ibiz.auth.getAuthInfo();if(t&&!t.isAnonymous)try{return void await this.appInit(e)}catch(t){const{status:a}=t;if(401!==a)throw t;if(Zt(ea.REFRESH_TOKEN)){try{await ibiz.auth.refreshToken()}catch(e){if(!ibiz.env.enableAnonymous)throw t;if(!await ibiz.auth.anonymousLogin())throw t}return void await this.appInit(e)}ibiz.auth.clearAuthData()}if(null==t?void 0:t.token){try{await this.appInit(e)}catch(t){const{status:a}=t;if(401!==a)throw t;if(!await ibiz.auth.anonymousLogin())throw new Vt(ibiz.i18n.t("webApp.authGuard.loginFailed"));await this.appInit(e)}return}await this.initModel(e,!1);const a=window.location.hash.split("/"),n=a[a.length-2];let i;try{i=["#","index"].includes(n)&&ibiz.hub.defaultPage?await ibiz.hub.getAppView(ibiz.hub.defaultPage.id):await ibiz.hub.getAppView(n)}catch(e){ibiz.log.error(e)}if(!i)return ibiz.log.error("找不到视图模型".concat(n,",请确保该视图配置了匿名访问和用户引用")),void this.throw401();if(3===i.accUserMode){if(!t){if(!await ibiz.auth.anonymousLogin())throw new Vt(ibiz.i18n.t("webApp.authGuard.loginFailed"))}await this.appInit(e)}else this.throw401()}async appInit(e){await bt.beforeInitApp.call({context:e});try{!0===ibiz.env.isSaaSMode&&await this.loadOrgData(),await this.loadAppData(e),await bt.authedApp.call({context:e})}catch(t){const a=t.status,n=Zt(ea.TOKEN_REMEMBER),i=Zt(ea.REFRESH_TOKEN);if(401!==a||!n||null==i||""===i)throw t;try{try{await ibiz.auth.refreshToken()}catch(e){if(!ibiz.env.enableAnonymous)throw t;if(!await ibiz.auth.anonymousLogin())throw t}!0===ibiz.env.isSaaSMode&&await this.loadOrgData(),await this.loadAppData(e),await bt.authedApp.call({context:e})}catch(e){throw t}}await this.initModel(e),await ibiz.auth.extendLogin(e),await ibiz.hub.notice.init(),await ibiz.util.theme.initCustomTheme()}async initModel(e,t=!0){}async loadAppData(e){let t;t=e&&Object.keys(e).length>0?await ibiz.net.get("/appdata",e):await ibiz.net.get("/appdata"),t.ok&&(ibiz.appData=t.data,bs())}async loadOrgData(){const e=await ibiz.net.get("/uaa/getbydcsystem/".concat(ibiz.env.dcSystem));if(e.ok){const t=e.data;if(t){const[e]=t;ibiz.orgData=e}}}async initTheme(e){const a=await t.import("@ibiz-template/web-theme"),n=a.default||a;bt.useComponent.callSync(null,n),e.appUIThemes&&await this.loadTheme()}async loadTheme(){const e=ibiz.hub.getApp().model.appUIThemes||[];if(e.length>0){const t=e.filter(e=>e.themeParams&&"true"!==e.themeParams["icon-theme"]);if(t.length>0)for(let e=0;e<t.length;e++){const a=t[e];await ibiz.util.theme.loadTheme(a)}const a=e.filter(e=>e.themeParams&&"true"===e.themeParams["icon-theme"]);if(a.length>0)for(let e=0;e<a.length;e++){const t=a[e];await ibiz.util.theme.loadTheme(t,"ICON")}}}async initEnvironment(e){const t=e.userParam;t&&(Object.keys(t).forEach(e=>{const a=ibiz.util.rawValue.format(t[e]),n=e.split(".");let i=ibiz.env;for(let e=0;e<n.length;e++){const t=n[e];e===n.length-1?i[t]=a:(i[t]=i[t]||{},i=i[t])}}),ibiz.env.globalConfig&&(ibiz.config=Mo(ibiz.config,ibiz.env.globalConfig)),ibiz.log.setLevel(ibiz.env.logLevel))}throw401(){throw new na({response:{status:401,statusText:ibiz.i18n.t("webApp.authGuard.noPermission")}})}}e("ca",FB);var UB=Object.defineProperty,HB=(e,t,a)=>(((e,t,a)=>{t in e?UB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class qB extends FB{constructor(){super(...arguments),HB(this,"hasModelInit",!1),HB(this,"noPermissionModel",!1)}async initModel(e,a=!0){if(!this.hasModelInit||this.hasModelInit&&this.noPermissionModel!==a){ibiz.hub.reset();const n=new xs(async(e,t)=>(await ibiz.net.get("".concat(ibiz.env.remoteModelUrl).concat(e),t,a?{}:{srfdcsystem:ibiz.env.dcSystem})).data,ibiz.env.appId,e,a),i=await n.getAppModel();await this.initEnvironment(i),ibiz.appUtil.registerAutoCloseOnNavEnd();const o=await ibiz.hub.getAppAsync(ibiz.env.appId);await bt.initedApp.call({context:e,app:o});const s=o.model;if(ibiz.env.isMob=!0===s.mobileApp,ibiz.env.isEnableMultiLan){const e=ibiz.i18n.getLang(),t=(await n.getPSAppLang(e.replace("-","_").toUpperCase())).languageItems||[],a={};t.forEach(e=>{a[e.lanResTag]=e.content}),RB.global.mergeLocaleMessage(e,a)}const l=await t.import("@ibiz-template/web-theme"),r=l.default||l;bt.useComponent.callSync(null,r),ibiz.config.theme&&ibiz.util.theme.setTheme(ibiz.config.theme),s.appUIThemes&&await this.loadTheme(),o.model.title&&ibiz.util.setBrowserTitle("")}this.noPermissionModel=a,this.hasModelInit=!0}}
|
|
9
|
+
/*! Element Plus v2.4.4 */var GB={name:"zh-cn",el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页",page:"页",prev:"上一页",next:"下一页",currentPage:"第 {pager} 页",prevPages:"向前 {pager} 页",nextPages:"向后 {pager} 页",deprecationWarning:"你使用了一些已被废弃的用法,请参考 el-pagination 的官方文档"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"}}},WB=e("I",{install:e=>{ibiz.i18n=_B,ibiz.util.getExcelUtil=()=>t.import("./xlsx-util-C4If0XV-.js"),po("404",()=>({component:QM})),po("403",()=>({component:ZM})),e.use(bh),e.use(Mz),e.use(NB),e.use(ft),e.use(wt),e.use(yt),e.use(oN),e.use(Ct),e.use(dN),e.use(cf),e.use(gf),e.use(Mh),e.use(jh),e.use(Vp),e.use(BI),e.use(Gp),e.use(Iw),e.use(Cf),e.use(Jb),e.use(It),e.use(xt),e.use(Vb),e.use(_f),e.use(Kf),e.use(Hf),e.use(Qp),e.use(_b),e.use(af),e.use(Df),e.use(Mf),e.use(fw),e.use(kw),e.use(Lw),e.use(Ww),e.use(rC),e.use(nI),e.use(Zf),e.use(uI),e.use(zI),e.use(VI),e.use(iw),e.use(GI),e.use(ox),e.use(dx),e.use(vx),e.use(yx),e.use(JM)}});function YB(e,a){const n=v(e,a);n.component("KeepAlive",M),n.config.errorHandler=function(e){ibiz.util.error.handle(e)};const i=(e,t,a)=>{n.use(t,a)};bt.useComponent.tap(i);t.import("@ibiz-template-plugin/bi-report").then(e=>{const t=e.default;bt.useComponent.callSync(null,t),bt.createApp.tap((e,a)=>{a.use(t)})});if(t.import("@ibiz-template-plugin/data-view").then(e=>{const t=e.default;bt.useComponent.callSync(null,t),bt.createApp.tap((e,a)=>{a.use(t)})}),a){const e=a.unmounted;a.unmounted=()=>{e(),bt.useComponent.removeTap(i)}}return n.use(RB),n.use(xo,{locale:GB}),n.use(St),n.use(WB),bt.createApp.callSync(null,n),ibiz.plugin.register(n),n}const KB=new Map([["baseUrl","BaseUrl"],["remoteModelUrl","remoteDynaPath"],["dcSystem","mockDcSystemId"],["enablePermission","enablePermissionValid"],["enableTitle","enableTitle"]]);async function XB(){const e=window.Environment,t=ns.parse(window.location.search,{ignoreQueryPrefix:!0});if(Object.keys(ibiz.env).forEach(t=>{const a=KB.has(t)?KB.get(t):t;null!=e[a]&&(ibiz.env[t]="customParams"===a||"devtoolConfig"===a?JSON.parse(e[a]):e[a])}),t&&t.srfdcsystem&&(ibiz.env.dcSystem=t.srfdcsystem),e.AppLabel&&(document.title=e.AppLabel),e.favicon){const t=document.getElementById("favicon");if(t){const a=e.favicon;a.endsWith(".png")?t.type="image/png":a.endsWith(".ico")?t.type="image/x-icon":a.endsWith(".gif")?t.type="image/gif":a.endsWith(".svg")&&(t.type="image/svg+xml"),t.href=a}}e.globalConfig&&(ibiz.env.globalConfig=e.globalConfig,ibiz.config=Mo(ibiz.config,e.globalConfig)),ibiz.log.setLevel(ibiz.env.logLevel)}var $B=a({setup(){const e=new ca({mode:da.ROUTE,viewUsage:1,routeDepth:1}),t=()=>{window.removeEventListener("unload",t),ibiz.hub.destroy()};let a;return window.addEventListener("unload",t),d(()=>{bt.initedApp.tapPromise(async({context:e})=>{var t;null==a||a(),a=ibiz.util.watermark.mount(ibiz.config.watermark,void 0,{...e,...null==(t=ibiz.appData)?void 0:t.context})})}),m(()=>{null==a||a()}),h(()=>{t(),bt.destoryApp.call(null)}),{modal:e}},render(){return n(i("router-view"),{modal:this.modal},null)}}),JB=Object.defineProperty,QB=(e,t,a)=>(((e,t,a)=>{t in e?JB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,t+"",a),a);class ZB{constructor(){QB(this,"hasPermErrPending",!1)}match(e){return e instanceof na&&(401===e.status||403===e.status)}async oauthLogin(){window.location.href.indexOf("srfthird_auth_success=false")>=0&&(ibiz.log.debug("获取OAUTH的token失败,跳转正常登录页"),this.normalLogin());(await ibiz.thirdAuth.auth("OAUTH","THIRD")).ok||(ibiz.log.debug("获取OAUTH重定向地址失败,跳转正常登录页"),this.normalLogin())}async casLogin(){if(!ibiz.env.casLoginUrl)throw new Vt(ibiz.i18n.t("webApp.unauthorizedHandler.noFoundEnvParams"));const{origin:e}=window.location,t="".concat(e).concat(ibiz.env.baseUrl),a="".concat(t,"/cas/v7/login").concat(ns.stringify({RU:Ot.fullPath,base:t},{addQueryPrefix:!0})),n=-1!==ibiz.env.casLoginUrl.indexOf("?"),i=ibiz.env.casLoginUrl+(n?"&":"?")+ns.stringify({service:a},{addQueryPrefix:!1});window.location.href=i}async normalLogin(){const e=window.location.hash.replace("#",""),t="".concat(Ot.routeBase,"/login?ru=").concat(encodeURIComponent(e));document.body.style.display="none",window.location.href=t,window.location.reload()}async handle403(e){if("APPINIT"===e.tag){if(this.hasPermErrPending)return;this.hasPermErrPending=!0;const e=await ibiz.confirm.warning({title:ibiz.i18n.t("webApp.unauthorizedHandler.forbiddenAccess"),desc:ibiz.i18n.t("webApp.unauthorizedHandler.logoutAccount")});if(this.hasPermErrPending=!1,e){await ibiz.hub.controller.logout()&&window.location.reload()}}else ibiz.mc.error.send(e)}handle(e){if(e instanceof na){if(401===e.status){return(ns.parse(window.location.search.replace("?","")).isAnonymous||ibiz.env.enableAnonymous)&&"APPINIT"!==e.tag?ibiz.auth.anonymousLogin().then(e=>{e&&window.location.reload()}):ibiz.env.loginMode===oa.CAS?this.casLogin():ibiz.env.loginMode===oa.OAUTH?this.oauthLogin():this.normalLogin(),!0}if(403===e.status)return this.handle403(e),!0}}}var eL={exports:{}};
|
|
10
10
|
/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress
|
|
11
11
|
* @license MIT */!function(e){e.exports=function(){var e,t,a={version:"0.2.0"},n=a.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};function i(e,t,a){return e<t?t:e>a?a:e}function o(e){return 100*(-1+e)}function s(e,t,a){var i;return(i="translate3d"===n.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===n.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+a,i}a.configure=function(e){var t,a;for(t in e)void 0!==(a=e[t])&&e.hasOwnProperty(t)&&(n[t]=a);return this},a.status=null,a.set=function(e){var t=a.isStarted();e=i(e,n.minimum,1),a.status=1===e?null:e;var o=a.render(!t),c=o.querySelector(n.barSelector),d=n.speed,u=n.easing;return o.offsetWidth,l(function(t){""===n.positionUsing&&(n.positionUsing=a.getPositioningCSS()),r(c,s(e,d,u)),1===e?(r(o,{transition:"none",opacity:1}),o.offsetWidth,setTimeout(function(){r(o,{transition:"all "+d+"ms linear",opacity:0}),setTimeout(function(){a.remove(),t()},d)},d)):setTimeout(t,d)}),this},a.isStarted=function(){return"number"==typeof a.status},a.start=function(){a.status||a.set(0);var e=function(){setTimeout(function(){a.status&&(a.trickle(),e())},n.trickleSpeed)};return n.trickle&&e(),this},a.done=function(e){return e||a.status?a.inc(.3+.5*Math.random()).set(1):this},a.inc=function(e){var t=a.status;return t?("number"!=typeof e&&(e=(1-t)*i(Math.random()*t,.1,.95)),t=i(t+e,0,.994),a.set(t)):a.start()},a.trickle=function(){return a.inc(Math.random()*n.trickleRate)},e=0,t=0,a.promise=function(n){return n&&"resolved"!==n.state()?(0===t&&a.start(),e++,t++,n.always(function(){0===--t?(e=0,a.done()):a.set((e-t)/e)}),this):this},a.render=function(e){if(a.isRendered())return document.getElementById("nprogress");d(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=n.template;var i,s=t.querySelector(n.barSelector),l=e?"-100":o(a.status||0),c=document.querySelector(n.parent);return r(s,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),n.showSpinner||(i=t.querySelector(n.spinnerSelector))&&p(i),c!=document.body&&d(c,"nprogress-custom-parent"),c.appendChild(t),t},a.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(n.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},a.isRendered=function(){return!!document.getElementById("nprogress")},a.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var l=function(){var e=[];function t(){var a=e.shift();a&&a(t)}return function(a){e.push(a),1==e.length&&t()}}(),r=function(){var e=["Webkit","O","Moz","ms"],t={};function a(e){return e.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(e,t){return t.toUpperCase()})}function n(t){var a=document.body.style;if(t in a)return t;for(var n,i=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);i--;)if((n=e[i]+o)in a)return n;return t}function i(e){return e=a(e),t[e]||(t[e]=n(e))}function o(e,t,a){t=i(t),e.style[t]=a}return function(e,t){var a,n,i=arguments;if(2==i.length)for(a in t)void 0!==(n=t[a])&&t.hasOwnProperty(a)&&o(e,a,n);else o(e,i[1],i[2])}}();function c(e,t){return("string"==typeof e?e:h(e)).indexOf(" "+t+" ")>=0}function d(e,t){var a=h(e),n=a+t;c(a,t)||(e.className=n.substring(1))}function u(e,t){var a,n=h(e);c(e,t)&&(a=n.replace(" "+t+" "," "),e.className=a.substring(1,a.length-1))}function h(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return a}()}(eL);var tL=LM(eL.exports);const aL=a({name:"ModalRouterShell",props:{modal:{type:Object,required:!0}},setup(e){const t=us(),a=hs(),n=o(!1),i=o({}),s=[],l=e.modal.routeDepth;let r=null;h(()=>{n.value=!0,r&&(r.dismiss(),r=null),(()=>{if(i.value.context){const{context:e}=k(i.value);e&&e.destroy()}})()});const c=async e=>{var t;if(i.value=await Et(e,l,!0),n.value)return;i.value.context instanceof Lt||(i.value.context=Lt.create(i.value.context));const o=e.params.modalView,c=e.params.modalParams;if(c&&"-"!==c){const e=ns.parse(c,{strictNullHandling:!0,delimiter:";"});if(e.srfnavctx){const t=JSON.parse(decodeURIComponent(e.srfnavctx));Object.assign(i.value.context,t),delete e.srfnavctx}e.srfnav&&(i.value.srfnav=e.srfnav,delete e.srfnav),Oo(e)||(i.value.params?Object.assign(i.value.params,e):i.value.params=e)}if(!i.value.context){const e=Lt.create({});i.value.context=e}let d,u=i.value.viewConfig;try{u||(u=await ibiz.hub.config.view.get(o)),d=Dt({context:i.value.context,params:i.value.params,viewId:u.id})}catch(e){d=QM}const h={width:(null==u?void 0:u.width)||"80%",height:(null==u?void 0:u.height)||"80%",footerHide:!0,isRouteModal:!0};r=ibiz.overlay.createModal(d,void 0,h),r.present(),s.push(e.fullPath);const p=await r.onWillDismiss();if(r=null,!1===n.value){const n=s.indexOf(e.fullPath);if(-1!==n&&s.splice(n,1),null==(t=window.history.state)?void 0:t.back)a.back();else{const t=e.path,n=t.indexOf("/".concat(Ei.ROUTE_MODAL_TAG,"/"));a.replace(t.substring(0,n))}R.close(a.currentRoute.value.fullPath,p||{ok:!1})}};return ps((e,t)=>{if(!n.value&&s.length>0&&-1!==s.indexOf(t.fullPath)&&-1===s.indexOf(e.fullPath)){const t=Y(e).pathNodes,a=t[t.length-1];a&&a.viewName===Ei.ROUTE_MODAL_TAG&&c(e)}}),c(t),{}},render:()=>n("div",{style:"position: absolute;width: 0;height: 0;"},null)}),nL=a({name:"RouterShell",props:{modal:{type:Object,required:!0}},setup(e){var t;const a=us(),n=hs(),i=o({}),s=o(!1),l=o(!0),r=()=>{if(i.value.context){const{context:e}=k(i.value);e&&e.destroy()}},d=null==(t=e.modal)?void 0:t.routeDepth;h(()=>{r()});const u=async()=>{if(d)try{const e=await Et(a,d),t=Lt.create(e.context);i.value={...e,context:t},s.value=!0}catch(e){n.push({name:"errorView".concat(d),params:{code:"404"}})}};u(),c(()=>a.params.view1,()=>{1===d&&(r(),u())});const p=new ca({mode:da.ROUTE,routeDepth:(d||0)+1});return x(()=>{l.value=!0}),S(()=>{l.value=!1}),{routeModal:p,route:a,viewData:i,isLoaded:s,isActivated:l}},render(){if(!this.isLoaded)return null;const{context:e,params:t,srfnav:a,viewConfig:o}=this.viewData,s=Ao({...this.$props,...this.$attrs,context:e,params:t,viewId:o.id,key:o.codeName},{state:{srfnav:a}});return n(N,null,[l(i("IBizViewShell"),s,this.$slots),this.isActivated&&n(i("router-view"),{key:o.codeName,name:Ei.ROUTE_MODAL_TAG,modal:this.routeModal},null)])}});function iL(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!s(e)}const oL=a({setup(){const e=B("share-view"),t=us(),a=o(!1),n=o(!1),i=o({});let s={},l="";d(async()=>{const e=t.query;l=window.atob(e.shareThemeId),i.value={userId:e.shareUserId,userName:e.shareUserName},ibiz.util.hiddenAppLoading(),await ibiz.util.theme.initCustomTheme(!1),await(async()=>{const{userId:e}=i.value;s=await ibiz.util.theme.getShareTheme(e,l),s&&ibiz.util.theme.previewCustomTheme(s.themeTag,s.themeVars)})(),n.value=!0});return{ns:e,loading:a,isMounted:n,shareUser:i,handleApply:async()=>{},handleCancel:()=>{}}},render(){let e,t;if(this.isMounted)return n("div",{class:this.ns.b()},[n("div",{class:this.ns.b("box")},[n("header",{class:this.ns.b("box-header")},[n("img",{src:"./assets/images/login-header.png"},null),n("div",{class:this.ns.b("box-header-title")},[n("div",null,[this.shareUser.userName]),ibiz.i18n.t("view.shareView.inviting")])]),n("main",{class:this.ns.b("box-main")},[n("div",{class:this.ns.b("box-main-content")},[n(i("el-button"),{onClick:this.handleApply,size:"large",round:!0,loading:this.loading},iL(e=ibiz.i18n.t("view.shareView.use"))?e:{default:()=>[e]}),n(i("el-button"),{onClick:this.handleCancel,size:"large",round:!0},iL(t=ibiz.i18n.t("view.shareView.cancel"))?t:{default:()=>[t]})])])])])}});var sL=Object.defineProperty,lL=(e,t,a)=>(((e,t,a)=>{t in e?sL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[t]=a})(e,"symbol"!=typeof t?t+"":t,a),a);class rL{static setAuthGuard(e){this.authGuard=e}static getAppContext(e){let t={};return e.params.appContext&&e.params.appContext!==ibiz.env.routePlaceholder&&(t=ns.parse(e.params.appContext,{strictNullHandling:!0,delimiter:";"})),t}static getRoutes(){const e=ibiz.env.routePlaceholder,t="[^/]+=[^/]+|".concat(e),a="[^=/]+";return[{path:"/",redirect:"/".concat(e,"/index/").concat(e)},{path:"/login",name:"loginView",beforeEnter:async(e,t,a)=>{await this.authGuard(this.getAppContext(e),!1),a()},component:eN},{path:"/share",name:"shareView",beforeEnter:async(e,t,a)=>{await this.authGuard(this.getAppContext(e))?a():a(!1)},component:oL},{path:"/error/:code",name:"errorView1",component:uN},{path:"/appredirectview",name:"appRedirectView",beforeEnter:async(e,t,a)=>{await this.authGuard(this.getAppContext(e))?a():a(!1)},component:Pt},{path:"/:appContext(".concat(t,")/:view1(").concat(a,")/:params1(").concat(t,")"),beforeEnter:async(e,t,a)=>{await this.authGuard(this.getAppContext(e))?a():a(!1)},component:nL,meta:{depth:1},children:[{path:"error/:code",name:"errorView2",component:uN},{path:"".concat(Ei.ROUTE_MODAL_TAG,"/:modalView(").concat(a,")/:modalParams(").concat(t,")"),components:{[Ei.ROUTE_MODAL_TAG]:aL}},{path:":view2(".concat(a,")/:params2(").concat(t,")"),component:nL,meta:{depth:2},children:[{path:"error/:code",name:"errorView3",component:uN},{path:"".concat(Ei.ROUTE_MODAL_TAG,"/:modalView(").concat(a,")/:modalParams(").concat(t,")"),components:{[Ei.ROUTE_MODAL_TAG]:aL}},{path:":view3(".concat(a,")/:params3(").concat(t,")"),component:nL,meta:{depth:3},children:[{path:"error/:code",name:"errorView4",component:uN},{path:"".concat(Ei.ROUTE_MODAL_TAG,"/:modalView(").concat(a,")/:modalParams(").concat(t,")"),components:{[Ei.ROUTE_MODAL_TAG]:aL}},{path:":view4(".concat(a,")/:params4(").concat(t,")"),component:nL,meta:{depth:4},children:[{path:"error/:code",name:"errorView5",component:uN},{path:"".concat(Ei.ROUTE_MODAL_TAG,"/:modalView(").concat(a,")/:modalParams(").concat(t,")"),components:{[Ei.ROUTE_MODAL_TAG]:aL}},{path:":view5(".concat(a,")/:params5(").concat(t,")"),component:nL,meta:{depth:5},children:[{path:"error/:code",name:"errorView6",component:uN},{path:"".concat(Ei.ROUTE_MODAL_TAG,"/:modalView(").concat(a,")/:modalParams(").concat(t,")"),components:{[Ei.ROUTE_MODAL_TAG]:aL}},{path:":view6(".concat(a,")/:params6(").concat(t,")"),component:nL,meta:{depth:6},children:[{path:"error/:code",name:"errorView7",component:uN},{path:"".concat(Ei.ROUTE_MODAL_TAG,"/:modalView(").concat(a,")/:modalParams(").concat(t,")"),components:{[Ei.ROUTE_MODAL_TAG]:aL}},{path:":view7(".concat(a,")/:params7(").concat(t,")"),component:nL,meta:{depth:7},children:[{path:"error/:code",name:"errorView8",component:uN},{path:"".concat(Ei.ROUTE_MODAL_TAG,"/:modalView(").concat(a,")/:modalParams(").concat(t,")"),components:{[Ei.ROUTE_MODAL_TAG]:aL}},{path:":view8(".concat(a,")/:params8(").concat(t,")"),component:nL,meta:{depth:8}},{path:":pathMatch(.*)*",redirect:{name:"errorView8"}}]},{path:":pathMatch(.*)*",redirect:{name:"errorView7"}}]},{path:":pathMatch(.*)*",redirect:{name:"errorView6"}}]},{path:":pathMatch(.*)*",redirect:{name:"errorView5"}}]},{path:":pathMatch(.*)*",redirect:{name:"errorView4"}}]},{path:":pathMatch(.*)*",redirect:{name:"errorView3"}}]},{path:":pathMatch(.*)*",redirect:{name:"errorView2"}}]},{path:"/:pathMatch(.*)*",redirect:{name:"errorView1"}}]}static addRoute(e,t,a){if(!e)return;const n=a=>{for(const i of a){if(i&&i.meta&&i.meta.depth===e)return i.children&&i.children.length>0?i.children.push(t):i.children=[t],!0;if(i.children&&i.children.length>0&&n(i.children))return!0}return!1};n(a)}static getRouter(e=[]){if(!this.router){const t=this.getRoutes();if(e&&e.length>0)for(let a=0;a<e.length;a++){const n=e[a],i=Rc(n.path);if(!_c(i)){ibiz.log.warn("路由配置错误:路由路径有误,请检查路由配置,详情参见:https://open.ibizlab.cn/apphub/zh/guide/router.html");continue}const o=(i.length-1)/2;if(o>1){const e=i.length;n.path="".concat(i[e-2],"/").concat(i[e-1]),this.addRoute(o-1,n,t)}else t.push(n)}this.router=ms({history:vs(),routes:t}),this.router.beforeEach((e,t,a)=>{tL.configure({showSpinner:!1}),tL.start(),a()}),this.router.afterEach(()=>{tL.done()})}return this.router}}e("cc",rL),lL(rL,"router"),lL(rL,"authGuard")}}});
|